Using natbib together with hl or st from soul (or soulutf8) produces Argument of \@citex has an extra }. [{\st\cite] errors, as already mentioned in other questions.
While a solution is to wrap all the \cite commands with an additional pair of curly brackets, or when this fails with \mbox, this solution may not be very convenient.
Consider in particular the situation in which we have a document, in which for some reason we are forced to use natbib for the references (like what happens when using revtex document classes).
We have lots of text with lots of \cite in it.
We want to define a command \remove that highlights text to be removed, with something like \newcommand{\remove}[1]{{\color{red}\st{#1}}}.
To use this command in blocks of text containing lots of \cite can be very annoying, requiring to wrap all of them with brackets or \mbox.
Is there a way to define a "smarter" command that can be used over \cite without modifying the original text?
A MWE of the problem of using \hl and \cite together is already given in the linked question, but I'll include another just for completeness:
Tex file:
\documentclass{article}
\usepackage{soulutf8}
\usepackage{natbib}
% how can I more smartly define this command, to use it to wrap text containing \cite{...}?
\newcommand{\remove}[1]{{\st{#1}}}
\begin{document}
\remove{\cite{foo}}
\bibliography{bibliography}
\end{document}
bibliography.bib:
@article{foo,
author = {SomeGuy},
journal = {Somewhere},
title = {Foo}
}
\soulregister\cite7– Robert Mar 01 '17 at 23:05