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

token registers #2221

Open teepeemm opened 1 year ago

teepeemm commented 1 year ago

I think I've dug as far into this rabbit hole as I'm able...

Working on #2123, I determined that InputDefinitions('changes', type => 'sty', noltxml => 1) doesn't work because changes.sty uses presetting keys, and xkeyval.sty.ltxml doesn't support that. I went one step further and tried to InputDefinitions('xkeyval', type => 'sty', noltxml => 1);. This results in changes loading without error, but the example posted in that issue still doesn't work. I think I chased it down to xkeyval.sty working with token registers. The following tex

\def\twoexpansions{3}
\def\oneexpansions{\twoexpansions}
\def\zeroexpansions{\oneexpansions}
\toks78\expandafter{\zeroexpansions}
\typeout{toks78 is: \the\toks78}

\documentclass{article}
\begin{document}
toks78 is: \the\toks78
\end{document}

will create a pdf displaying "toks78 is: 3", but the log file will say "toks 78 is: \oneexpansions". On the other hand, LaTeXML will have "toks78 is: 3" in both locations.

teepeemm commented 1 year ago

(And even without the \expandafter, the log ends up with "toks78 is \zeroexpansions".)