how to replace latex macros with their definitions (using latex)
- by RamyenHead
How can I replace all occurrence of user defined latex macros with their definitions?
For example, given this file
old.tex
\newcommand{\blah}[2]{#1 \to #2}
...
foo \blah{egg}{spam} bar
...
how to generate the file below in an automatic way
new.tex
...
foo egg \to spam bar
...
Instead of reimplementing latex macro logic with perl, can I use latex or tex engine itself to do this?