# How can I "outcompile" macros? [duplicate]

Let's say I have have the file asdf.tex which contains the code:

\documentclass{article}
\newcommand{\asdf}{blabla}
\begin{document}
\asdf is very cool!
\end{document}


How can I compile my latex to a version asdf_standard.tex where only the standard latex is used, i.e.:

\documentclass{article}
\begin{document}
blabla is very cool!
\end{document}


I'm sure the compiler does this kind of procedure at some point anyway, so how can I get this as a file?

• There is de-macro. It won't be a general solution - I assume it handles things like macros used as abbreviations (i.e. simple cases). Also, note that I've no personal experience with the package. I only wish somebody would accept any kind of .tex file from me!
• "I'm sure the compiler does this kind of procedure at some point anyway" To my understanding, this is only part of the picture. The actual process is simpler and more powerful, but makes this kind of 'search and replace' impossible. In fact, your best bet would be a regular expression search and replace – this is likely what 'de-macro' does. Feb 22 '15 at 21:36