latex-unravel
latex-unravel copied to clipboard
obtain unraveled TeX code
This is a question and perhaps a feature request.
Is there a nice way to obtain the unraveled TeX code (the FINAL step shown before the compiler exits)?
Basically, I have to move some math LaTeX code to MathJax, and since MathJax supports less features that LaTeX, the most unravelled code is what I'm after. A good solution would be a script that takes in the LaTeX code and outputs the unravelled code.
Now there is partial support with \unravel_get:nnN { mute } { "some code" } \l_result_tl
. However since I had not planned this feature from the start I almost certainly abused the fact that I only cared about the output as a string. Another thing to keep in mind is that unravel goes all the way down to primitives, which is often not what one wants when expanding a user's macro. For instance it would probably be better to turn $\newcommand{\ZZ}{\mathbb{Z}}\ZZ$
into $\mathbb{Z}$
rather than a low-level font selection command.