I have a library of tikz pictures, eg.
\newcommand*{\mypic}[1]{
\begin{tikzpicture}
%...
\end{tikzpicture}
}
which I would like to print together with their names (including arguments). However,
\renewcommand{\show}[1]{\verb|#1|\quad #1}
\show{\mypic{a}}
produces
Package tikz Error: Sorry, some package has redefined the meaning of the math-mode dollar sign. This is incompatible with tikz and its calc library and might cause unrecoverable errors.
I guess \show is trying to expand its argument inside \verb. I experimented with \expandafter but it didn't help. When I replaced \verb| | with \texttt{}, \show didn't print the macro name at all.
\verb
cannot appear inside another macro.\renewcommand{\show}[1]{\detokenize{#1}\quad #1}
\show
only takes a single token. If you want to print multiple, try\message{...}
or\errmessage{...}
.