[tex4ht] tex4ht gives package amsmath error tag not allowed here

Michal Hoftich michal.h21 at gmail.com
Tue Jul 25 14:08:03 CEST 2017


Hi Nasser,

> 
> 
> Not sure if this is known or not? Should I create a bug report?
> 
> There was a related issue
> 
> https://puszcza.gnu.org.ua/bugs/?225
> 
> But it does not look they are same error, Or may be they are
> the same?

I think they are the same error, at least the attached test.tex file in
the related issue contains:

    \[
    x=y    ag{*}
    \]

I think that     ag should be used only in asmmath's equation
environments, because it is meant to redefine equation number with
custom text. As ordinary display math doesn't produce any label, it
doesn't really make sense to do that. 

For tagged display math, I would use custom environment. Something like:


    \documentclass{article}
    
    \newcommand\printtaggedmath[1]{(#1)}
    \newenvironment{taggedmath}[1]{\def    aggedmathpar{#1}    abular{p{.8    extwidth}r}\(\displaystyle}{\)&\printtaggedmath{    aggedmathpar}\endtabular}
    \begin{document}
    
    \begin{taggedmath}{hello}
      a = b
    \end{taggedmath}
    \end{document}

And some tex4ht configuration for \printtaggedmath to get it right
aligned.


> 
> I changed the code to use \begin{align} etc... and now tex4ht does
> not complain about     ag any more
> 

This is of course the best solution, IMHO.

Best regards,
Michal




More information about the tex4ht mailing list