bugtex4ht - Bugs: bug #624, File ended while scanning use of...

 
 
Show feedback again

You are not allowed to post comments on this tracker with your current authentification level.

bug #624: File ended while scanning use of \AltMathOne. error

Submitted by:  Nasser M. Abbasi <nma123>
Submitted on:  Thu Apr 25 06:03:46 2024  
 
Category: NonePriority: 5 - Normal
Severity: 5 - NormalStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Thu Apr 25 12:36:31 2024, comment #2:

Hi Nasser,

I would prefer use of a special environment, like this:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% https://puszcza.gnu.org.ua/bugs/?624
\documentclass[12pt]{article}

\usepackage{amsmath}
\usepackage{longtable}
\usepackage{array}
\newcolumntype{C}{>{$}c<{$}}

\NewDocumentEnvironment{longmathtable}{m+b}{
\begin{longtable}{#1}
#2
\end{longtable}
}{}
\ifdefined\HCode
\RenewDocumentEnvironment{longmathtable}{m+b}{
\alteqtoks{\[\begin{array}{#1}
#2
\end{array}\]
}
}{}
\fi

\begin{document}

\begin{longmathtable}{CCC}
& {} & \textrm{Let's solve}
\\
{} & {} & \left[y^{\prime}=1+2 x , y \left(0\right)=3\right]
\end{longmathtable}

\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

I've defined a new column type, C, so you don't need to type all these ugly preambles, and also so it works better with MathJax. The redefined environment will print array in math mode.

Michal Hoftich <michal_h21>
Project Member
Thu Apr 25 06:26:21 2024, comment #1:

I found a workaround. So I am OK for now.

In tex4ht mode, I changed to using \begin{array}{ccc} instead. And now it compiled OK and produces same output as PDF. Here is the new MWE

-----------------------------
\documentclass[12pt]{article}

\usepackage{amsmath}
\usepackage{longtable}
\usepackage{array}

\begin{document}

\ifdefined\HCode
\[
\begin{array}{ccc}
& {} & \textrm{Let's solve}
\\
{} & {} & \left[y^{\prime}=1+2 x , y \left(0\right)=3\right]
\end{array}
\]
\else
\begin{longtable}{ >{$}c<{$} >{$}c<{$} >{$}c<{$} }
& {} & \textrm{Let's solve}
\\
{} & {} & \left[y^{\prime}=1+2 x , y \left(0\right)=3\right]
\end{longtable}
\fi

\end{document}
-----------------------

But it will good to know why it failed in the first version just in case it is a bug in tex4ht.

--Nasser

Nasser M. Abbasi <nma123>
Thu Apr 25 06:03:46 2024, original submission:

This MWE compiles with no problem with lualatex but gives this error with tex4ht

---------------
(/usr/local/texlive/2023/texmf-dist/tex/latex/lm/t1lmtt.fd))
Runaway argument?
\b:array> \ignorespaces {} & \textrm {Let's solve} \\ {} & {} & \left \ETC.
! File ended while scanning use of \AltMathOne.
<inserted text>
\par
<*> ...=utf-8,html5.a.b.c.\input "\detokenize{A.tex}"

?
-----------------------

I am using code generated by Maple, and just putting this code inside longtable.

I can not change the code generated. Here is MWE. I only added the lines \begin{longtable}{...} and \end{longtable} and everything else in between is auto-generated.

-----------------------
\documentclass[12pt]{article}

\usepackage{amsmath}
\usepackage{longtable}
\usepackage{array}

\begin{document}

\begin{longtable}{ >{$}c<{$} >{$}c<{$} >{$}c<{$} }
& {} & \textrm{Let's solve}
\\
{} & {} & \left[y^{\prime}=1+2 x , y \left(0\right)=3\right]
\end{longtable}

\end{document}
--------------------------------

Now compiled using

make4ht -ulm default -a debug A.tex 'mathjax,htm'

and it gave the error shown above.

No error compiling with lualatex.

Using tex4ht under TL 2023

>which make4ht

/usr/local/texlive/2023/bin/x86_64-linux/make4ht

>make4ht --version

make4ht version v0.3m

How can I make this compile with tex4ht?

Thanks
--Nasser

Nasser M. Abbasi <nma123>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by michal_h21 (Posted a comment)
  • -unavailable- added by nma123 (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup+gray