How to highlight citations in a revised manuscript

I don't know your other reasons for using the soul package, but doesn't the xcolor package suffice? Moreover, if I read the author's instructions correctly, you can also choose to use just a different text color.

Here are some possibilities for highlighting. Changing the background color usually entails some limitations, like boxes that don't wrap or restrictions on what can be put inside the highlighted area; but citations work with all approaches.

\documentclass[aapm,graphicx,preprint,showkeys]{revtex4-1} 
\usepackage{amsmath,amssymb,enumitem,mathtools}
\usepackage{xcolor}
\newcommand\hl[1]{\colorbox{yellow}{\textcolor{red}{#1}}}
\newcommand\hlbreakable[1]{\textcolor{red}{#1}}
\usepackage[most]{tcolorbox}
\newtcolorbox{highlighted}{colback=yellow,coltext=red,breakable}
\usepackage{lipsum}
\begin{document}

\hl{This text is highlighted.}

\hl{Highlighting a citation causes no compilation error \cite{rockafellar1997convex,rudin1992nonlinear}.}

\hlbreakable{Highlighting a citation causes no compilation error \cite{rockafellar1997convex,rudin1992nonlinear}.
\lipsum}

\begin{highlighted}
Highlighting a citation causes no compilation error \cite{rockafellar1997convex,rudin1992nonlinear}.
\lipsum
\end{highlighted}

\begin{thebibliography}{10}
\bibitem{rockafellar1997convex}
  R.T. Rockafellar.
  \newblock {\em Convex analysis}.
  \newblock Number~28. Princeton university press, 1997.
\bibitem{rudin1992nonlinear}
  L.~Rudin, S.~Osher, and E.~Fatemi.
  \newblock Nonlinear total variation based noise removal algorithms.
  \newblock {\em Physica D: Nonlinear Phenomena}, 60(1):259--268, 1992.
\end{thebibliography}
\end{document}

enter image description here enter image description here

enter image description here enter image description here

enter image description here

Edit: It may be more convenient to define the \hlbreakable command as an environment, since \begin-\end pairs are easier to trace than pairs of braces.

\newenvironment{hlbreakable}%
  {\color{red}}%
  {}
...
\begin{hlbreakable}
Highlighting a citation causes no compilation error \cite{rockafellar1997convex,rudin1992nonlinear}.
\lipsum
\end{hlbreakable}

A pragmatic solution would be to use some other, less intrusive implementation of highlighting. In the following, I define the \hl command to just switch the text color to red (slightly toned for better readability):

\documentclass{article} 
\usepackage{amsmath,amssymb,enumitem,mathtools}
\usepackage{xcolor}

\newcommand\hl[1]{%
  \bgroup
  \hskip0pt\color{red!80!black}%
  #1%
  \egroup
}

\begin{document}

\hl{This text is highlighted}.

Here's a citation \cite{rockafellar1997convex,rudin1992nonlinear}.

\hl{ Highlighting a citation does no longer cause a compilation error and even  works across line breaks \cite{rockafellar1997convex,rudin1992nonlinear}.}

\begin{thebibliography}{10}

\bibitem{rockafellar1997convex}
R.T. Rockafellar.
\newblock {\em Convex analysis}.
\newblock Number~28. Princeton university press, 1997.

\bibitem{rudin1992nonlinear}
L.~Rudin, S.~Osher, and E.~Fatemi.
\newblock Nonlinear total variation based noise removal algorithms.
\newblock {\em Physica D: Nonlinear Phenomena}, 60(1):259--268, 1992.

\end{thebibliography}

\end{document}

This simple approach looks less fancy, but has a lot of advantages: It works over most content (headings, tables, formulas, ...), is more printer-friendly and – taking the viewpoint of the reviewer – a lot more friendly for the reviewer's eye.


You only need the "soul" package for this to work. Inside the "\hl{...}" command, instead of just putting in "\cite{...}", type "\mbox{\cite{...}}". This should do it.

Tags:

Highlighting