I have always wondered how certain macros are made and I usually use the \show
command to get a glimps of its definition. Is it possible to print the definition of a macro with a command, say \printmacro{\quad}
, which will in turn create a .pdf
(or .txt
) file with the definition and the location (the file) in which it is defined?
Update:
The following features would be great:
- Create the
\printmacro
command with the option[printhere]
. That is, it will emulate the behaviour of\meaning
. - Create the options
printtopdf
orprinttotxt
file. - Note that all of these options should automatically indicate which file contains the definition of the command. If the exact location of the file which contains the command definition can be extracted, that would be great.
\meaning
:\meaning\quad
– cgnieder Nov 18 '13 at 20:12-¿“hskip 1em“relax
but its close to it. – azetina Nov 18 '13 at 20:14\texttt{\meaning\quad}
, or then\let\printmacro\texttt
would also work. Providing file location would be difficult, period. – Werner Nov 18 '13 at 20:18(
so just look in those (and in latex.ltx which is the source of the latex format) – David Carlisle Nov 18 '13 at 20:52latexdef
can do for you in command line console:xxx$ latexdef -s tabular
% latex.ltx, line 5006:
\def\tabular{\let\@halignto\@empty\@tabular}
. But I usually dotexdoc source2e
and use the search of my pdf viewer. – user4686 Nov 18 '13 at 21:01