The command \displaygraphics[width-1in]{figure=some_fig.pdf} will display a graphic. Sometimes I want to typeset when I do not have the graphics files available, so I want to do something like:
\renewcommand{\includegraphics}[1][]{\verb|#2|}
The intention is that it will simply display the name of the file to be used, rather than try to display the graphic. Note graphics names have underscores, which is the reason I would want something like verbatim. So the command
\renewcommand{\includegraphics}[1][]{#2} does not work.
Of course the solution above does not work either, since \verb cannot be used like this inside a \renewcommand. How do I do this?



{}icon. Larger chunks of code can be similarly selected and will be marked up with a preceding 4 spaces. (BTW, do you mean\includegraphics? – Alan Munn Feb 14 '16 at 23:05\verbcannot be used in the argument to another macro, even\newcommand. – egreg Feb 15 '16 at 00:44