I am addressing reviewer comments for a scientific article. I would like to highlight significant changes to make it easier for reviewers to spot the changes. However, I find that when using the soul package and wrapping any display equations or citations in
\hl{ ... }
that it breaks compilation.
As an example, highlighting the paragraph in this document requires opening and closing multiple \hl
s:
\documentclass{article}
\usepackage{soul}
\usepackage[usenames,dvipsnames]{xcolor}
\begin{document}
\hl{This is a sentence with a citation}~\cite{lamport94}.
\hl{This is a sentence with another citation}~\cite{lamport94}.
\hl{Here is a display equation,}
\begin{equation}
2 + 2 = 4
\end{equation}
\hl{where $4$ is the number that comes after $3$.}
\begin{thebibliography}{9}
\bibitem{lamport94}
Leslie Lamport,
\textit{\LaTeX: a document preparation system},
Addison Wesley, Massachusetts,
2nd edition,
1994.
\end{thebibliography}
\end{document}
I would much prefer:
\documentclass{article}
\usepackage{soul}
\usepackage[usenames,dvipsnames]{xcolor}
\begin{document}
\hl{
This is a sentence with a citation~\cite{lamport94}.
This is a sentence with another citation~\cite{lamport94}.
Here is a display equation,
\begin{equation}
2 + 2 = 4
\end{equation}
where $4$ is the number that comes after $3$.
}
\begin{thebibliography}{9}
\bibitem{lamport94}
Leslie Lamport,
\textit{\LaTeX: a document preparation system},
Addison Wesley, Massachusetts,
2nd edition,
1994.
\end{thebibliography}
\end{document}
but this breaks compilation.
I have seen the answer How to highlight text that includes glossaries and citations?, but this seems fairly messy. I have a lot of citations and display equations (and equation references, section references, lists, etc.) and would prefer not to need to wrap everything in \mbox
or extra braces. Is there a cleaner solution? Note: this is purely for the reviewers' reference so it does not need to look perfect.