When I use \cite[something with spaces]{ref} inside \sout{...} I get errors. For the article document class it helps to replace spaces by ~. That doesn't help, however, for the elsarticle document class. See minimal working example below:
\documentclass{elsarticle}
% \documentclass{article}
\usepackage{ulem}
\begin{document}
text
\cite{lamport}
\cite[p.10]{lamport}
\cite[p. 10]{lamport}
\cite[p.~10]{lamport}
\sout{text}
\sout{\cite{lamport}}
\sout{\cite[p.10]{lamport}}
% \sout{\cite[p. 10]{lamport}} % Fails with elsarticle and article
% \sout{\cite[p.~10]{lamport}} % Fails with elsarticle only
\begin{thebibliography}{9}
\bibitem{lamport}
Leslie Lamport,
\textit{\LaTeX: a document preparation system},
Addison Wesley, Massachusetts,
2nd edition,
1994.
\end{thebibliography}
\end{document}
For article I get
! Argument of \UL@word has an extra }.
whereas for elsarticle I get
! Extra }, or forgotten \endgroup.
\UL@stop ...z@ \else \UL@putbox \fi \else \egroup
\egroup \UL@putbox \fi \if...
Is this an error in ulem? I would be grateful if anyone knows a quick-fix.
Kind regards.
{p.~10}still gives error onelsarticle. – sigvaldm Apr 25 '19 at 09:26