I've been trying this for hours now. Probably is something simple I missed...
I have a macro \newcommand{\cf}[1]{\footnote{Cf. #1}}
(usage usually \cf{\cite{xx}}
). Now I want to extend it, that it remembers which reference I used last, and if it is the same again, does not print the citation but "Ibd." instead.
Thus I modified it like
\newcommand{\cf}[1]{
Cf.
\ifthenelse{\equals{\SVE}{#1}}{%
ibd.}{%
#1
\def\SVE#1
}
}
But that does not work. \SVE
remains empty (or however I initialized it first). I experimented a lot till now, putting \expandafter
s, \noexpand
s,... around like crazy... But no result.
-- Edit:
Heres the full code copied:
\documentclass{article}
% somewhere in my preamble
\usepackage{ifthen}
\newcommand{\LLfootnoteLastCite}{}
\newcommand\LLfootnoteCite[1]{%
\ifthenelse{\equal{\LLfootnoteLastCite}{#1}}{%
ibd.}{%
#1%
\def\LLfootnoteLastCite{#1}%
}%
}
\newcommand{\LLfootnote}[3]{\footnote{#3~#2\ifx#10\else, S. #1\fi.}}
% the exposed commands
\newcommand{\vgl}[2][0]{\LLfootnote{#1}{\LLfootnoteCite{#2}}{Vgl.}}
% small working example
\begin{document}
This is a\vgl{\cite{Reference}}. And this is the second\vgl{\cite{Reference}}. And this is a third\vgl{\cite{Reference2}}
\end{document}
\if...\fi
is not a group