Re: [tex4ht] [bug #481] Problem with Braces / Brackets in Maths equations using mk4ht latex->mathml

2020-08-21 Thread Ulrike Fischer




> I see. But I did not not write this latex. It seems to work OK in mathjax.

> This is how the latex came from a Mathematica newsletter which is emailed each
> week.

Yes I know. As I wrote: it sometimes work if you are lucky.

And people are lazy and so often try their luck and leave of the
braces. And then they complain when it doesn't work after some change
or when using another engine or workflow.

But the rule is: use braces unless you are very, very sure, that you 
know it works, and that is will continue to work, even if commands are 
changed internally. Which basically means you should only leave them out 
for stuff like x^2. 

See also 
https://tex.stackexchange.com/a/342272/2388
https://github.com/josephwright/beamer/issues/599


-- 
Mit freundlichen Grüßen
Ulrike Fischer





Re: [tex4ht] [bug #481] Problem with Braces / Brackets in Maths equations using mk4ht latex->mathml

2020-08-21 Thread Michal Hoftich

Hi Nasser,


After changing the command and adding "mathml", now some
of my latex files no longer compile.

Please see this MWE

\documentclass{article}
\usepackage{amsmath}
\begin{document}
$n^\text{th}$
\end{document}

THe above used to compile OK using

make4ht filename.tex "mathjax,htm"

But now using

make4ht filename.tex "mathml,mathjax,htm"

it gives error


I can confirm this issue. BTW, you will get this error even without the 
"mathml" option. It is a know issue, see:


https://tug.org/tex4ht/doc/mml.html

Quoting:

Missing grouping for subscripts and suprscripts, such as 
‘A_\mathit{...}’ instead of ‘A_{\mathit{...}}’. (LaTeX allows indirect 
access to the content of the operands; TeX4ht requires direct access.) 


So the correct way is "$n^{\text{th}}$". I know that your files are 
automatically generated so it is not something easilly solvable. 

You will not get this error with "mathjax" option, without "mathml", so 
you may want to stick to it.


Best regards,
Michal


Re: [tex4ht] [bug #481] Problem with Braces / Brackets in Maths equations using mk4ht latex->mathml

2020-08-21 Thread Nasser M. Abbasi

On 8/21/2020 3:40 AM, Ulrike Fischer wrote:



After changing the command and adding "mathml", now some
of my latex files no longer compile.



Please see this MWE



\documentclass{article}
\usepackage{amsmath}
\begin{document}
$n^\text{th}$
\end{document}


$n^\text{th}$ is wrong, unsupported syntax. It works (sometimes) but only by
chance. The correct latex input if you have more than one token in a
superscript or subscript is to add additional braces:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
$n^{\text{th}}$
\end{document}

With them your example compiles.



I see. But I did not not write this latex. It seems to work OK in mathjax.

This is how the latex came from a Mathematica newsletter which is emailed each
week.

Which I tried to compile. The original message itself which had this latex in 
it this
one:

https://mathematica.stackexchange.com/questions/154944/finding-n-textth-largest-smallest-element

Viewing the page source, it shows

=

list manipulation - Finding $n^\text{th}$ largest/smallest element - 
Mathematica Stack Exchange
===

It is the title of the above message.

This is how the latex came in email to me from stackexchange.

But I corrected it now. It used to  compile OK before using mathml.

Best,
--Nasser



Re: [tex4ht] [bug #481] Problem with Braces / Brackets in Maths equations using mk4ht latex->mathml

2020-08-21 Thread Ulrike Fischer


> After changing the command and adding "mathml", now some
> of my latex files no longer compile.

> Please see this MWE

> \documentclass{article}
> \usepackage{amsmath}
> \begin{document}
> $n^\text{th}$
> \end{document}

$n^\text{th}$ is wrong, unsupported syntax. It works (sometimes) but only by 
chance. The correct latex input if you have more than one token in a 
superscript or subscript is to add additional braces:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
$n^{\text{th}}$
\end{document}

With them your example compiles. 

-- 
Mit freundlichen Grüßen
Ulrike Fischer
mailto:ne...@nililand.de




Re: [tex4ht] [bug #481] Problem with Braces / Brackets in Maths equations using mk4ht latex->mathml

2020-08-21 Thread Nasser M. Abbasi

On 8/19/2020 11:35 AM, Michal Hoftich wrote:



There is no change in regards to .htm files, you can still use

make4ht filename.tex "mathml,mathjax,htm"

to get .htm files. The change is just in the mathml.4ht file, it should
now render brackets correctly in most cases.

Best regards,
Michal



After changing the command and adding "mathml", now some
of my latex files no longer compile.

Please see this MWE

\documentclass{article}
\usepackage{amsmath}
\begin{document}
$n^\text{th}$
\end{document}

THe above used to compile OK using

 make4ht filename.tex "mathjax,htm"

But now using

 make4ht filename.tex "mathml,mathjax,htm"

it gives error

(base) >make4ht foo4.tex "mathml,htm,mathjax"
[STATUS]  make4ht: Conversion started
[STATUS]  make4ht: Input file: foo4.tex
[ERROR]   htlatex: Compilation errors in the htlatex run
[ERROR]   htlatex: Filename LineMessage
[ERROR]   htlatex: ./foo4.tex   4Argument of \n:text@: has an extra }.
[ERROR]   htlatex: ./foo4.tex   4Paragraph ended before \n:text@: was 
complete.
[ERROR]   htlatex: ./foo4.tex   4Missing $ inserted.
[ERROR]   htlatex: ./foo4.tex   4Missing } inserted.
[ERROR]   htlatex: ./foo4.tex   4Missing } inserted.
[ERROR]   htlatex: ./foo4.tex   4Too many }'s.
[ERROR]   htlatex: ./foo4.tex   4Too many }'s.
[ERROR]   htlatex: ./foo4.tex   5Missing $ inserted.
[ERROR]   htlatex: ./foo4.tex   5Missing } inserted.
[ERROR]   htlatex: ./foo4.tex   5Too many }'s.
[ERROR]   htlatex: Compilation errors in the htlatex run

I am using TL 2020. Just updated fully now.

(base) >make4ht --version
make4ht version v0.3e

regards,

--Nasser