Text Formatting ⇒ Using macros in LaTeX but then removing them from source code for others?
Using macros in LaTeX but then removing them from source code for others?
I am curious to know if there is a way of "flattening" any LaTeX output that arises from macros? Consider the following minimal example (with the preamble and document begin/end declarations removed):
\global\long\def\testMacroA#1{{\color{red}#1}}%
\global\long\def\testMacroB#1{\tilde{#1}}%
\global\long\def\testMacroC#1{\underrightarrow{#1}}%
$\testMacroA{\testMacroB{\testMacroC A}}$
Is there anything in LaTeX that can be used to remove any trace of the original macros and replace any instances of them with the code that they represent, so that when the source code is compiled, it simply gives
${\color{red}\tilde{\underrightarrow{A}}}$ ?
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis