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:
\documentclass{article}
\usepackage{amsmath}
\DeclareMathOperator{\Tr}{Tr}
\begin{document}
\begin{equation}
\Tr\left(e^{-\beta H}\right)
\end{equation}
\end{document}
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
\batchmode
\def\inlatexml{true}
\documentclass[onecolumn]{article}
\usepackage{amsmath}
\makeatletter
% STUFF HERE, NO REFERENCE AT \Tr.
\makeatother
\begin{document}
\beginDISPLAY \Tr\left(e^{-\beta H}\right)\endDISPLAY\clearpage
\end{document}
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! 😃
I've run into a problem with
\DeclareMathOperatorfrom theamsopnpackage (loaded by theamsmathpackage, in my understanding). I've got this MWE:Then, I run
latexmlc --verbose --destination=MWE.html MWE.texand I get a clean output without problems. But if I runlatexmlc --verbose --mathsvg --destination=MWE.html MWE.tex, I get 1 error:The same with
--mathimages. By looking intoltxmlimg.tex, I've found no definition at all about my\Troperator; the file looks likeIf I manually add
\DeclareMathOperator{\Tr}{Tr}just after\usepackage{amsmath}, thenltxmlimg.texcompiles as expected.As a workaround, if I substitute
\DeclareMathOperator{\Tr}{Tr}with\newcommand{\Tr}{\mathrm{Tr}}in my MWE, then bothlatexmlc --verbose --destination=MWE.html MWE.texandlatexmlc --verbose --mathsvg --destination=MWE.html MWE.texproduce the expected output. However, also for semantic reasons, I'd prefer to stick with\DeclareMathOperator.Thanks in advance! 😃