tags:

views:

79

answers:

1

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 #.

+3  A: 
\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 }
Alexey Malistov
Cool, that seems to work. BTW, is there an easy way to also turn off the special meaning of $ at the same time?
Jacob Gabrielson
Yes. What do you want to do with the meaning of $?
Alexey Malistov
I was thinking of just having them disappear.
Jacob Gabrielson
I added a new sample.
Alexey Malistov