[Tex/LaTex] LaTeX macro expander

expansionmacros

Is it possible to have LaTeX (or another program) to expand a the macros in a .tex file, and output the expanded LaTeX source?

If no such program exists: are LaTeX macros processed simply as string substitutions, before the document is interpreted? If so, it might be easy enough to write my own such converter.

Edit: The reason I ask is journals which don't accept LaTeX submissions with macros. It would be useful to be able to develop with my usual macros, and convert automatically to the 'macro-expanded' format for submission.

Best Answer

If you just want to see how LaTeX works, and what it does when macros are expanded, you can put \tracingmacros or \tracingall in your .tex file, and LaTeX will write the expansion process in the log file.

Related Question