I want to create a command whose argument is used within a \label{}
command. I also want a boolean switch that turns on/off the display of this label for editing purposes. Here is pseudo-code for what I'd like to do:
\newcommand{\foo}[1]{%
\refstepcounter{foocount}\label{#1}%
... do other things ... %
\ifthenelse{\boolean{showlabel}}%
{DISPLAY #1}%
{}%
}
The problem is in the DISPLAY #1
part. I want to display the label no matter what the label contains. For instance, many of my labels have the form "ex:function_continuous_everywhere
" but the underscores causes math-mode errors. Using variations of \verbatim
has its own set of issues.
Is there a slick way of doing this? I know I could change all my labels, but I'd rather not.
showkeys
that shows labels automatically.