LaTeXML icon indicating copy to clipboard operation
LaTeXML copied to clipboard

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

Open nschloe opened this issue 2 years ago • 2 comments
trafficstars

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>

nschloe avatar Oct 25 '23 09:10 nschloe

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 avatar Oct 25 '23 12:10 dginev

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 ...]

dginev avatar Oct 25 '23 12:10 dginev