tags:

views:

22

answers:

2

I'm new to latex, but it seems you can temporarily redefine some commands? The problem I have is that normally the citation is (SMITH, 2000). But at times, I'd like to have Smith (2000) instead. Anyway I can temporarily redefine it, then use the standard version again after that "block" of code?

A: 

Enclose the local definition in braces ({}).

\newcommand\foo{FOO!}
\foo
{\renewcommand\foo{BAR?}\foo\foo}
\foo

This will generate something like:

FOO!BAR?BAR? FOO!

This can be done inside macro definitions, too - just make sure you add the extra braces:

\newcommand\newfoo{{\renewcommand\foo{BAR?}\foo}}

Hope this helps.

Phil Richards
A: 

You should already have \citep and \citet commands that should do what you want, there's no reason to redefine the macros yourself.

Seamus