Is it possible to print the exact definition of a macro?
For example, the code
\def\foo#1{\bar\baz}
\printdef\foo
should result with \bar\baz.
If we define (as suggested in a similar question)
\def\printdef#1{\texttt{\meaning#1}}
then the result is macro:->\bar \baz, which is slightly different.
def\foo#1{\bar\baz}and\def\foo#1{\bar \baz }are identical definitions, the space characters are never tokenised or part of the definition, so you can not tell which was used – David Carlisle Dec 22 '22 at 20:02\showor\meaning, it will always add a space after every control word. The token itself is stored in an internal (and not accessible) way (with a pointer to the name, stored elsewhere), so there's not much you can do. But\bar \bazis the exact definition. – egreg Dec 22 '22 at 21:25