1

I need to redefine "\citet" command to have its output printed in red. I did:

\let\oldcitet\citet
\renewcommand*\citet[2][]{{\color{red}\oldcitet[#1]{#2}}}

that works for the "one optional argument" case: \citet[ARG]{label}.

How can I get the same result for the "two optional argument" case: \citet[ARG1][ARG2]{label}?

1

You don't have to check for any optional argument, if you use the #1#{ argument to get everything before the {:

\let\oldcitet\citet
\def\citet#1#{\citetaux{#1}}
\newcommand*\citetaux[2]{{\color{red}\oldcitet#1{#2}}}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.