CONTEXT.
For different journals one have to cite in different ways (in footnotes ore Harvard-citation style). To manage this in an easy way I created a cite-command (\mycite) with two optional and one mandatory parameters. This command can easily be redefined depending on a journals format.
PROBLEM.
If an optional argument is empty, then the respective parameter is identical with \empty. But the usual citation-command \cite that is used in my definition of \mycite implements (\cite[\empty][\empty]{carnap1928LogAuf}) different from (\cite[][]{carnap1928LogAuf}), namely: ( [Car28], p.) vs. ([Car28]). How to get out of (\cite[\empty][\empty]{carnap1928LogAuf}) the result ([Car28])?
FAILED-SOLUTION.
I think that it is a problem of expansion. I tried to expand first the arguments - but I only succeeded expanding the first argument: (\expandafter\cite\expandafter[\empty][\empty]{carnap1928LogAuf}) results in ([Car28], p.)
IMPLEMENTATION.
Code: Select all
\newcommand{\mycite}[1][\empty]{%
\def\ArgI{#1}%
\mycitemycite%
}
\newcommand\mycitemycite[1][\empty]{%
\def\ArgII{#1}%
\mycitemycitemycite%
}
\newcommand\mycitemycitemycite[1]{%
(\cite[\ArgI][\ArgII]{#1})%
}