# How to \show the code of the command \autoref? [duplicate]

Edit: I think this is a duplicate of How can I see the "implementation" of the \LaTeX command? .

I wanted to see the code for the hyperref \autoref command, so created this simple document:

\documentclass{article}
\usepackage{hyperref}
\begin{document}
\show\autoref
\end{document}


However, in the log output, instead of the code, I see:

> \autoref=macro:
->\protect \autoref  .
l.4 \show\autoref


Changing line 4 to \show\section shows the code for \section, as expected:

> \section=\long macro:
->\@startsection {section}{1}{\z@ }{-3.5ex \@plus -1ex \@minus -.2ex}{2.3ex \@plus .2ex}{\normalfont \Large \bfseries }.
l.4 \show\section


How can I get the actual code for \autoref?

• voted to close as dup, my answer here is same as Joseph's over there (clearly latex-team group-think) – David Carlisle May 20 '15 at 10:55

That is the code for \autoref if you want to see the code for the internal command \autoref_ (with a space) then

{\let\protect\show\autoref}


works

> \autoref =macro:
->\leavevmode \@ifstar {\HyRef@autoref \@gobbletwo }{\HyRef@autoref \hyper@@lin
k }.
\autoref ->\protect \autoref

l.4 {\let\protect\show\autoref
}

• Neat trick. Using \expandafter\show\csname autoref \endcsname works too. – Suzanne Dupéron May 20 '15 at 10:51

This is described in the tex faq: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=ltxcmds

An expl3-variant to show the internal command (which ends with a space as David mentioned):

\documentclass{article}
\usepackage{hyperref,expl3}
\begin{document}
\ExplSyntaxOn\cs_show:c{autoref~}\ExplSyntaxOff
\end{document}