# ulem incompatibility with multiple entries in \cite

Consider the LaTeX code:

\documentclass[aps,pre]{revtex4}

\usepackage[normalem]{ulem}

\begin{document}

\sout{
asdas~\cite{a1989, b2001}.
}

\bibliographystyle{apsrev4-1}
\bibliography{references.bib}

\end{document}


where references.bib is just a .bib-file with some random entries with a1989 and b2001 keys. I compile using

1. Latex
2. BibTex
3. Latex
4. Latex

At step 4, I get the following error

! Missing number, treated as zero


If I continue, it just ignores and does what it is supposed to.

This only happens when there is more than 1 citation on the same \cite. E.g. if I use

asdas~\cite{a1989}~cite{b2001}


it works fine.

-

This is covered in the documentation to ulem on page 5:

This loss of local assignments will break some other standard commands, (e.g., \cite) which produce multiple ‘words’ using local assignments. The way to protect such commands is to bury them in an \mbox: \emph{every\-one agrees~\mbox{\cite{you,me}}.}

In your case using \mbox you get

a requested, from:

\documentclass[aps,pre]{revtex4}

\usepackage[normalem]{ulem}

\begin{document}

\sout{
asdas~\mbox{\cite{a1989,b2001}}.
}

\bibliographystyle{apsrev4-1}
\bibliography{references.bib}

\end{document}

-
So, there is no way to solve this other than putting \mbox on all the \cite. Does not sound feasible when ulem is to be used with to track deleted stuff. Nevertheless, your answer is impressive, quite knowledge about ulem! –  J. C. Leitão Feb 14 '13 at 17:28
latexdiff does exactly this, the main downside is that can result in some overfull, but latexdiff provides otherways to mark up differences, e.g. via colour. May be you should investigate that. –  Andrew Swann Feb 14 '13 at 17:37