Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[amsmath] Issues with \DeclareMathOperator #785

matteosecli opened this issue Jul 8, 2016 · 1 comment

[amsmath] Issues with \DeclareMathOperator #785

matteosecli opened this issue Jul 8, 2016 · 1 comment


Copy link

I've run into a problem with \DeclareMathOperator from the amsopn package (loaded by the amsmath package, in my understanding). I've got this MWE:


        \Tr\left(e^{-\beta H}\right)

Then, I run latexmlc --verbose --destination=MWE.html MWE.tex and I get a clean output without problems. But if I run latexmlc --verbose --mathsvg --destination=MWE.html MWE.tex, I get 1 error:

Error:shell:latex LaTeX command 'latex ltxmlimg > ltxmlimg.ltxoutput' failed
    returned code 256 (!= 0): 
    See /tmp/LaTeXML2vtErS/ltxmlimg.log
    In Post::MathImages[@0x46fd890] ->generateImages
Couldn't find image for 'LaTeXML::Post::MathImages:svg:\beginDISPLAY \Tr\left(e^{-\beta H}\right)\endDISPLAY'

The same with --mathimages. By looking into ltxmlimg.tex, I've found no definition at all about my \Tr operator; the file looks like

\beginDISPLAY \Tr\left(e^{-\beta H}\right)\endDISPLAY\clearpage

If I manually add \DeclareMathOperator{\Tr}{Tr} just after \usepackage{amsmath}, then ltxmlimg.tex compiles as expected.

As a workaround, if I substitute \DeclareMathOperator{\Tr}{Tr} with \newcommand{\Tr}{\mathrm{Tr}} in my MWE, then both latexmlc --verbose --destination=MWE.html MWE.tex and latexmlc --verbose --mathsvg --destination=MWE.html MWE.tex produce the expected output. However, also for semantic reasons, I'd prefer to stick with \DeclareMathOperator.

Thanks in advance! 😃

Copy link

Sorry for the delay getting to this; easy fix actually: needed to dumbdown the TeX reversion. Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

3 participants