This might be an known limitation in tex4ht, I do not know. But this MWE below gives the error
! Package amsmath Error: \tag not allowed here.
Only when run with make4ht
. No error with lualatex nor with pdflatex.
\documentclass[11pt]{article}
\usepackage{amsmath}
\begin{document}
\[
x=y \tag{1}
\]
\end{document}
The output is
>make4ht foo.tex
.....
LaTeX2e <2017/01/01> patch level 3
Babel <3.9r> and hyphenation patterns for 83 language(s) loaded.
(./foo.tex (/usr/local/texlive/2016/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/size11.clo))
....
(/usr/local/texlive/2016/texmf-dist/tex/generic/tex4ht/html4.4ht)
(/usr/local/texlive/2016/texmf-dist/tex/generic/tex4ht/html4-math.4ht))
(/usr/local/texlive/2016/texmf-dist/tex/generic/tex4ht/html4.4ht)
(/usr/local/texlive/2016/texmf-dist/tex/generic/tex4ht/html4-math.4ht))
(./foo.aux)
! Package amsmath Error: \tag not allowed here.
See the amsmath package documentation for explanation.
Type H <return> for immediate help.
...
l.7 x=y \tag
{1}
?
List files
*File List*
article.cls 2014/09/29 v1.4h Standard LaTeX document class
size11.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
amsmath.sty 2016/11/05 v2.16a AMS math features
amstext.sty 2000/06/29 v2.01 AMS text
amsgen.sty 1999/11/30 v2.0 generic functions
amsbsy.sty 1999/11/29 v1.2d Bold Symbols
amsopn.sty 2016/03/08 v2.02 operator names
Version
which make4ht
/usr/local/texlive/2016/texmf-dist/scripts/make4ht/make4ht
Is the above known issue with make4ht? What should I do to workaround this? Do I need to change \[..\]
to \begin{align}....\end{align}
to use \tag{}
with tex4ht? No error there with make4ht. Only error when using tag with \[..\]
align
! single-line equations should use theequation
environment. (the spacing above and below is calculated differently forequation
andalign
.)\[...\]
and notalign
. Also there is no error with lualatex nor with pdflatex usingtag
with\[...\]
. I've also seentag
used with\[...\]
by Latex experts. For example this accepted answer adding-letters-to-equation-numbers usestag
with\[...\]