Re: [tex4ht] Decimal comma and specing (bug?)
The problem is, the tex4ht command is written in C and it seems that nobody understand it, so it is quite unlikely that we can fix it. If someone can tell me how to change it, I expect the change can be implemented. The hard part is figuring out what to do. I find the C program more or less equally inscrutable with all other aspects of tex4ht source, not especially worse (or better). -k
Re: [tex4ht] Decimal comma and specing (bug?)
Am Wed, 11 May 2016 13:06:31 +0200 schrieb Michal Hoftich: > this feature would be hard to implement, I am afraid. The icomma package make the comma active in math. Perhaps it can be used by tex4ht: \documentclass{article} \usepackage{icomma} \begin{document} $x, y, 1,5$ \end{document} -- Ulrike Fischer http://www.troubleshooting-tex.de/
Re: [tex4ht] Decimal comma and specing (bug?)
Dear Nasser and Michal, thanks a lot for you replies. The solution with siunitx is a good one. The old solution was both awkward, ad hoc, and unnatural. With siunitx it is only awkward :-) Thanks again. :-- Hans Georg On Wed, May 11, 2016 at 01:06:31PM +0200, Michal Hoftich wrote: > Hi Hans, > > >> > >> typesetting of decimal numbers in languages which use a > >> decimal comma instead of a point (i.e. most languages > >> except English AFAIK :-) is a well-known challenge. > >> The standard TeX solution does not work in tex4ht though. > >> > >> A quite typical example would be this: > >> $\Delta t = 24, 6, 2, 0{,}5, 0{,}1$. > >> In regular TeX, the braces around the commas ensures that there > >> is only intra-word spacing around the comma. Thus, the bracketed > >> commas appear as decimal commas, while the unbracketed ones are > >> list separators with some spacing after. > >> > > this feature would be hard to implement, I am afraid. The mathml code > for your example is added by tex4ht comand. It means that it tries to > add structure based on font information in the DVI file, as opposed to > tags inserted in the configurable hooks. In the DVI file, there is > only following structure: > > fnt: cmr10 at 10pt > set: '6' > fnt: cmmi10 at 10pt > set: ';' > w0: > fnt: cmr10 at 10pt > set: '2' > fnt: cmmi10 at 10pt > set: ';' > w0: > fnt: cmr10 at 10pt > set: '0' > push: > fnt: cmmi10 at 10pt > set: ';' > pop: > x: 2.86pt > fnt: cmr10 at 10pt > set: '5' > > so the coma in braces is surrounded by `push` and `pop` instructions. > You can also see that it is `;` character instead of `,`, in the DVI > file there is no actual character, but only pointer to to glyph at > that position in the font. We can get the character through mapping in > the HTF files. The problem is, the tex4ht command is written in C and > it seems that nobody understand it, so it is quite unlikely that we > can fix it. > > As a workaround, you can use Siunitx as Nasser suggest, or some custom > macro which would insert correct MathML elements. > > Best regards, > Michal -- :-- Hans Georg
Re: [tex4ht] Decimal comma and specing (bug?)
Dear Nasser and Michal, thanks a lot for you replies. The solution with siunitx is a good one. The old solution was both awkward, ad hoc, and unnatural. With siunitx it is only awkward :-) Thanks again. :-- Hans Georg On Wed, May 11, 2016 at 01:06:31PM +0200, Michal Hoftich wrote: > Hi Hans, > > >> > >> typesetting of decimal numbers in languages which use a > >> decimal comma instead of a point (i.e. most languages > >> except English AFAIK :-) is a well-known challenge. > >> The standard TeX solution does not work in tex4ht though. > >> > >> A quite typical example would be this: > >> $\Delta t = 24, 6, 2, 0{,}5, 0{,}1$. > >> In regular TeX, the braces around the commas ensures that there > >> is only intra-word spacing around the comma. Thus, the bracketed > >> commas appear as decimal commas, while the unbracketed ones are > >> list separators with some spacing after. > >> > > this feature would be hard to implement, I am afraid. The mathml code > for your example is added by tex4ht comand. It means that it tries to > add structure based on font information in the DVI file, as opposed to > tags inserted in the configurable hooks. In the DVI file, there is > only following structure: > > fnt: cmr10 at 10pt > set: '6' > fnt: cmmi10 at 10pt > set: ';' > w0: > fnt: cmr10 at 10pt > set: '2' > fnt: cmmi10 at 10pt > set: ';' > w0: > fnt: cmr10 at 10pt > set: '0' > push: > fnt: cmmi10 at 10pt > set: ';' > pop: > x: 2.86pt > fnt: cmr10 at 10pt > set: '5' > > so the coma in braces is surrounded by `push` and `pop` instructions. > You can also see that it is `;` character instead of `,`, in the DVI > file there is no actual character, but only pointer to to glyph at > that position in the font. We can get the character through mapping in > the HTF files. The problem is, the tex4ht command is written in C and > it seems that nobody understand it, so it is quite unlikely that we > can fix it. > > As a workaround, you can use Siunitx as Nasser suggest, or some custom > macro which would insert correct MathML elements. > > Best regards, > Michal -- :-- Hans Georg
Re: [tex4ht] Decimal comma and specing (bug?)
Hi Hans, >> >> typesetting of decimal numbers in languages which use a >> decimal comma instead of a point (i.e. most languages >> except English AFAIK :-) is a well-known challenge. >> The standard TeX solution does not work in tex4ht though. >> >> A quite typical example would be this: >> $\Delta t = 24, 6, 2, 0{,}5, 0{,}1$. >> In regular TeX, the braces around the commas ensures that there >> is only intra-word spacing around the comma. Thus, the bracketed >> commas appear as decimal commas, while the unbracketed ones are >> list separators with some spacing after. >> this feature would be hard to implement, I am afraid. The mathml code for your example is added by tex4ht comand. It means that it tries to add structure based on font information in the DVI file, as opposed to tags inserted in the configurable hooks. In the DVI file, there is only following structure: fnt: cmr10 at 10pt set: '6' fnt: cmmi10 at 10pt set: ';' w0: fnt: cmr10 at 10pt set: '2' fnt: cmmi10 at 10pt set: ';' w0: fnt: cmr10 at 10pt set: '0' push: fnt: cmmi10 at 10pt set: ';' pop: x: 2.86pt fnt: cmr10 at 10pt set: '5' so the coma in braces is surrounded by `push` and `pop` instructions. You can also see that it is `;` character instead of `,`, in the DVI file there is no actual character, but only pointer to to glyph at that position in the font. We can get the character through mapping in the HTF files. The problem is, the tex4ht command is written in C and it seems that nobody understand it, so it is quite unlikely that we can fix it. As a workaround, you can use Siunitx as Nasser suggest, or some custom macro which would insert correct MathML elements. Best regards, Michal
Re: [tex4ht] Decimal comma and specing (bug?)
On 5/11/2016 3:04 AM, Hans Georg Schaathun wrote: Hi, typesetting of decimal numbers in languages which use a decimal comma instead of a point (i.e. most languages except English AFAIK :-) is a well-known challenge. The standard TeX solution does not work in tex4ht though. A quite typical example would be this: $\Delta t = 24, 6, 2, 0{,}5, 0{,}1$. In regular TeX, the braces around the commas ensures that there is only intra-word spacing around the comma. Thus, the bracketed commas appear as decimal commas, while the unbracketed ones are list separators with some spacing after. This does not work in tex4ht. Live example here: http://kerckhoffs.schaathun.net/m1draft/week01se1.html#x2-10001 (Problem 1.1 Item 2) Does anyone have a fix for this? The solution using braces was the best recommendation I found when I checked it 15-20 years ago :-) This works for me: -- \documentclass[12pt]{article}% \usepackage{siunitx} \sisetup{output-decimal-marker = {,}} \begin{document} $\pi=\num{3.14}$ \end{document} - htlatex foo2.tex HTML shows comma in place of decimal points. --Nasser
[tex4ht] Decimal comma and specing (bug?)
Hi, typesetting of decimal numbers in languages which use a decimal comma instead of a point (i.e. most languages except English AFAIK :-) is a well-known challenge. The standard TeX solution does not work in tex4ht though. A quite typical example would be this: $\Delta t = 24, 6, 2, 0{,}5, 0{,}1$. In regular TeX, the braces around the commas ensures that there is only intra-word spacing around the comma. Thus, the bracketed commas appear as decimal commas, while the unbracketed ones are list separators with some spacing after. This does not work in tex4ht. Live example here: http://kerckhoffs.schaathun.net/m1draft/week01se1.html#x2-10001 (Problem 1.1 Item 2) Does anyone have a fix for this? The solution using braces was the best recommendation I found when I checked it 15-20 years ago :-) -- :-- Hans Georg