Re: [tex4ht] tex4ht gives amsmath Error: \tag not allowed here
On 9/7/2018 8:27 AM, Michal Hoftich wrote: you can see \[ ->\begin {equation*} and Ah, all right, there is the following code in amsmath.sty: \DeclareRobustCommand{\[}{\begin{equation*}} \DeclareRobustCommand{\]}{\end{equation*}} Nasser, you can try to add it to your config file and test it if it doesn't break something.It worked for me. We can add it to the sources if everything works correctly. Best, Michal Great, that worked! Now tex4ht does not give an error any more. If you like to use this as answer for https://tex.stackexchange.com/questions/383129/tex4ht-gives-package-amsmath-error-tag-not-allowed-here I'll be happy to accept it as well. Thanks for everyone's help. I'll remove these command from my .cfg file, once this fix is added to the tex4ht official source code in texlive. --Nasser
Re: [tex4ht] tex4ht gives amsmath Error: \tag not allowed here
> you can see > > \[ ->\begin {equation*} > > and Ah, all right, there is the following code in amsmath.sty: \DeclareRobustCommand{\[}{\begin{equation*}} \DeclareRobustCommand{\]}{\end{equation*}} Nasser, you can try to add it to your config file and test it if it doesn't break something.It worked for me. We can add it to the sources if everything works correctly. Best, Michal
Re: [tex4ht] tex4ht gives amsmath Error: \tag not allowed here
Am Fri, 7 Sep 2018 10:29:48 +0200 schrieb Michal Hoftich: > Hi Nasser, > >> Ok, using equation instead of \[ \] does not produce error with tex4ht > > Isn't \tag supposed to be used only with amsmath environments? I think > you really shouldn't use it with \[ \] No. Tracing the code \documentclass{article} \usepackage{amsmath} \begin{document} \tracingmacros=1 \[abc \tag{x}\] \end{document} you can see \[ ->\begin {equation*} and \mathdisplay #1->\ifmmode \@badmath \else $$\def \@currenvir {#1}\let \dspbrk@context \z@ \let \tag \tag@in@display So it is quite obvious that is should work in \[ \]. -- Ulrike Fischer https://www.troubleshooting-tex.de/
Re: [tex4ht] tex4ht gives amsmath Error: \tag not allowed here
On 9/7/2018 3:29 AM, Michal Hoftich wrote: Hi Nasser, Ok, using equation instead of \[ \] does not produce error with tex4ht Isn't \tag supposed to be used only with amsmath environments? I think you really shouldn't use it with \[ \] Best regards, Michal You must be right. But the question is: Why then lualatex and pdflatex do not generate an error or even a warning for the same input? I've always went by the rule of thumb: if it works correctly in pdflatex, (i.e. no error), then it must be valid latex. This is the first time where I see roles reversed: tex4ht detects invalid latex while pdflatex does not. --Nasser
Re: [tex4ht] tex4ht gives amsmath Error: \tag not allowed here
Hi Nasser, > Ok, using equation instead of \[ \] does not produce error with tex4ht Isn't \tag supposed to be used only with amsmath environments? I think you really shouldn't use it with \[ \] Best regards, Michal
Re: [tex4ht] tex4ht gives amsmath Error: \tag not allowed here
On 9/7/2018 2:42 AM, Nasser M. Abbasi wrote: What is a workaround? comment on the above question says not to use align for single equation and so I use \[ \] for single equation but want to tage it also. Ok, using equation instead of \[ \] does not produce error with tex4ht = \documentclass[11pt]{book} \usepackage{amsmath,mathtools,amssymb} \begin{document} \begin{equation} y \left( x \right) = G\left(x, \frac{ \mathop{\mathrm{d}y}}{\mathop{\mathrm{d}x}}\right) \tag{1A} \end{equation} \end{document} === And it works in pdf also. so now I just need to change my program and make it use equation instead of \[ \] everywhere from now on and will not use \[ \] any more. Not sure what other subtle differences there are between equation and \[ \] but as long as it compiles with tex4ht, I am happy. --Nasser
[tex4ht] tex4ht gives amsmath Error: \tag not allowed here
I just got this error, only with tex4ht: - (/usr/local/texlive/2018/texmf-dist/tex/latex/amsfonts/umsb.fd) ! Package amsmath Error: \tag not allowed here. See the amsmath package documentation for explanation. Type H for immediate help. ... l.11 ...thrm{d}y}}{\mathop{\mathrm{d}x}}\right) \tag {1A} ? The funny thing, when I went to ask about it at https://tex.stackexchange.com, it turned out I asked the same question more than one year ago and forgot: https://tex.stackexchange.com/questions/383129/tex4ht-gives-package-amsmath-error-tag-not-allowed-here But there was no resolution on that. Is this a bug in tex4ht? Should I enter a bug on this? MWE below. THis compiled OK with lualatex and pdflatex. So I expected it to compile ok with tex4ht as well. cat T.tex -- \documentclass[11pt]{book} \usepackage{amsmath,mathtools,amssymb} \begin{document} \[ y \left( x \right) = G\left(x, \frac{ \mathop{\mathrm{d}y}}{\mathop{\mathrm{d}x}}\right) \tag{1A} \] - compiled with make4ht -ulm draft -f html5+dvisvgm_hashes T.tex 'htm,0,pic-align,notoc*,p-width,svg' why \tag does not work with tex4ht in \[ \] but works with lualatex? What is a workaround? comment on the above question says not to use align for single equation and so I use \[ \] for single equation but want to tage it also. thanks --Nasser