निरंजन
I want to compile two LaTeX-articles, in which one uses biblatex-style citations and the other one uses standard LaTeX measures for producing citations. It seems that biblatex renews the \cite macro. What I wanted to achieve is saving the original \cite command with a different name and then letting package biblatex do what it wants to do. I tried the following. I also tried \global\let\cite\oldcite with no different results.


\documentclass{article}
\let\cite\oldcite
\usepackage{biblatex}

\begin{document}
See: \oldcite{abcd}

See: \oldcite{efgh}

\begin{thebibliography}{1}
\bibitem{abcd}
\bibitem{efgh}
\end{thebibliography}
\end{document}


How to save the original definition of \cite macro?
Skillmon
The syntax of \let is \let<token 1><token 2> where <token 1> should be a control sequence or active character. It assigns to <token 1> the same meaning <token 2> currently has (there are some specialties regarding equals signs and space tokens, something we don't have to care for here).

As a result, to save the current meaning of \cite inside another macro you should use \let<new-macro>\cite (here \let\oldcite\cite). However for macros created with LaTeX2e measurements for robustness (or for optional arguments) you shouldn't use just \let but instead should use the newish \NewCommandCopy (if that isn't available because of an out of date installation you could use \usepackage{letltxmacro} and then \LetLtxMacro instead).

With all this your MWE becomes:


\documentclass{article}
\NewCommandCopy\oldcite\cite
\usepackage{biblatex}

\begin{document}
See: \oldcite{abcd}

See: \oldcite{efgh}

\begin{thebibliography}{1}
\bibitem{abcd}
\bibitem{efgh}
\end{thebibliography}
\end{document}


The reason why you shouldn't just use \let is best understood when we look at the actual definition of \cite (with the default definition of LaTeX2e):


> \cite=macro:
->\protect \cite  .


Notice that there are two spaces after the \cite in the second line, that's because that macro is actually built with \csname cite\space\endcsname (so the name really contains a single trailing space). The real definition sits inside that macro, and \cite is just a front facing macro serving to protect \cite from further expanding inside many of LaTeX2e's internal processing steps (think \protected@edef and the like) and in file output (because TeX expands tokens while writing, e.g., to the ToC, but we typically don't want to expand things just yet but only when the ToC is read back in on the next run).

So when you do \let\oldcite\cite what happens is that \oldcite gets the meaning \protect\cite␣ (with trailing space), but it doesn't save the real definition. Now if some package overwrites \cite with the same mechanisms used by LaTeX2e (introduced before \protected from the e-TeX extension was available) your \oldcite doesn't call that definition but something potentially arbitrary.

You're just lucky that biblatex is relatively modern and doesn't use that mechanism of protecting but instead uses \protected, so get away with it here.

Macros like \NewCommandCopy or \LetLtxMacro parse the structure of the macro and automagically detect this protection mechanism and do the right thing. So after \NewCommandCopy\oldcite\cite you'll get the following definition of \oldcite:


> \oldcite=macro:
->\protect \oldcite  .


and \oldcite␣ will hold the definition of \cite␣ for you.

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.