Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

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

Sample output

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}
share|improve this answer
    
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
1  
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.