I am looking for a command similar to show, but want the output in the document itself. All the examples I have found produce the output in the terminal, not the document.
So, I want to replace the use of \show with an appropriate macro in the following:
\documentclass{article}
\newcommand*{\MyFrac}{\ensuremath{\frac{\pi}{4}}}
\begin{document}
The macro \textbackslash MyFrac is set to \show\MyFrac.
\end{document}
and the output I want produced is
The macro \MyFrac is set to \ensuremath{\frac{\pi}{4}}
I could probably use the verbatim package, but I think that would require me to change the definition at two places if it was to be updated. I want to be able to define the macro in one place and be able use it as needed, but also to be able to display the LaTeX code associated with it.
ttfamilywas required. I see that it doesn't work without that. – Peter Grill Jun 10 '11 at 05:06\,<,>and others. – egreg Jun 10 '11 at 06:13\ttfamilyis the common usage. – Alain Matthes Jun 10 '11 at 06:49\ttfamilyis better than normal text font and it's necessary with OT1 fonts because>gives¡in the Roman font. Ouch! – egreg Jun 10 '11 at 15:11