brucemiller / LaTeXML

LaTeXML: a TeX and LaTeX to XML/HTML/ePub/MathML translator.
http://dlmf.nist.gov/LaTeXML/
Other
961 stars 101 forks source link

Undefined `\topmargin`, `\textwidth`, `\textheight`, probably others #2247

Open nschloe opened 1 year ago

nschloe commented 1 year ago

MWE:

\topmargin -1.5cm \textwidth 6in \textheight 8.5in
\documentclass{article}

\begin{document}
x
\end{document}

LaTeXML output:

  <ERROR class="undefined">\topmargin</ERROR>
  <para xml:id="p1">
    <p>-1.5cm <ERROR class="undefined">\textwidth</ERROR>6in <ERROR class="undefined">\textheight</ERROR>8.5in

x</p>
  </para>
dginev commented 1 year ago

Is it now common practice to use these before \documentclass? They'd be defined, but only courtesy of article loading and getting our LaTeX.pool support enabled.

Since latexml tries to emulate both plain TeX documents, as well as LaTeX documents, in a single executable, we hook ourselves at \documentclass as the trigger to provide the LaTeX-related definitions.

dginev commented 1 year ago

If you didn't need this support as the general default, you could force LaTeX support from outside via a preload directive, as in:

latexml --preload=LaTeX.pool [... rest of options ...]