[tex4ht] another problem with mathjax mode: Forbidden control sequence found while scanning use of \AltlDisplay
Nasser M. Abbasi
nma at 12000.org
Tue Jan 22 04:04:54 CET 2019
good news. global search and replace of
\begin{array} --> {\begin{array} and
\end{array}---> \end{array}} worked and nothing else broke.
I was able to compile this now with mathjax.
But it will be nice if one can better understand why this
happens as I am sure this will come up again.
--Nasser
On 1/21/2019 8:41 PM, Nasser M. Abbasi wrote:
> This problem I've seen before. But now I have this large latex file
> that I am trying to compile, which has 1000's of such constructs
> as follows.
>
> A tabular which contains math entries like this in a cell:
>
> \[\left[
> \begin{array}{cc}
> 0 & 1 \\
> -25 & -4
> \end{array}
> \right]
> \]
>
> latex has no problem with these, nor svg or png. But mathjax
> does not like it. Here is MWE
>
> ===================================
> \documentclass[11pt]{article}
> \usepackage{amsmath}
> \begin{document}
>
> \begin{tabular}[c]{|p{2in}|p{2in}|}
> test
> &
> \[\left[
> \begin{array}{cc}
> 0 & 1 \\
> -25 & -4
> \end{array}
> \right]
> \]
> \end{tabular}
> \end{document}
> ======================================
>
> make4ht -ulm draft foo.tex "htm,mathjax"
> gives
>
> (/usr/local/texlive/2018/texmf-dist/tex/generic/tex4ht/html5.4ht)) (./foo.aux)
> (/usr/local/texlive/2018/texmf-dist/tex/latex/lm/ot1lmtt.fd)
> Runaway argument?
> \left [\begin {array}{cc} 0 \@endpbox \hskip \tabcolsep \hskip -.5\arrayrulewi
> dth \ETC.
> ! Forbidden control sequence found while scanning use of \AltlDisplay.
> <inserted text>
> \par
> l.12 0 &
> 1 \\
> ? C
>
> The fix is to add { and } inside the math, like this
>
> ================
> \documentclass[11pt]{article}
> \usepackage{amsmath}
> \begin{document}
> \begin{tabular}[c]{|p{2in}|p{2in}|}
> test
> &
> \[\left[
> {\begin{array}{cc}
> 0 & 1 \\
> -25 & -4
> \end{array}
> }
> \right]
> \]
> \end{tabular}
> \end{document}
> ==============================
>
> Notice the "{" added before \begin{array} and at end.
>
> But it is not possible for me to edit manually this large
> file and add {} everywhere, as there are thousands of such places.
>
> I'll try global search and replace and hopefully not break anything else.
>
> But is there a reason why this problem keeps hapenning with mathjax
> and no other system? Is this a mathjax issue itself
> or the translation to mathjax done by tex4ht?
>
> Thank you
> --Nasser
> TL 2018
>
>
>
More information about the tex4ht
mailing list