1
votes

I'd like to include Perforce's $Revision$ keyword in my LaTeX document. However, the presence of # seems to mess thing up. For example, if you have something like this:

\cfoot{$Revision: #8 $}

you end up with an error like "Illegal parameter number in definition of \temp@a". I did some searching and found packages (such as the LaTeX rcs package) that handle other keywords (such as Date) but nothing that appeared to handle the #.

1
I don't think so -- you can't control Perforce's behavior to get it to put in \# instead of # (AFAIK).Jacob Gabrielson
I agree this isn't a duplicate.Will Robertson

1 Answers

3
votes
\let \savecfoot \cfoot
\def \cfoot{\catcode`\#=12 \cfoothelp}
\def \cfoothelp #1{\savecfoot{#1}\catcode`\#=6 }

New:

To turn off the meaning of $ too:

\let \savecfoot \cfoot
\def \cfoot{\catcode`\#=12 \catcode`\$=9 \cfoothelp}
\def \cfoothelp #1{\savecfoot{#1}\catcode`\#=6 \catcode`\$=3 }