# soul package \hl with \cite gives error: “@citex has an extra }” [duplicate]

The following MWE gives me an error. This should work, shouldn't it?

\documentclass{article}
\usepackage{color,soul}
\begin{document}
\hl{A statement \cite{hong_groups_2004}}
\end{document}


Here's the error:

! Argument of \@citex has an extra }.
<inserted text>
\par
l.4 \hl{A statement \cite{hong_groups_2004}}


## marked as duplicate by Stefan Pinnow, Mico, Maarten Dhondt, Zarko, Andrew SwannMar 22 '17 at 7:55

• – Robert May 21 '16 at 18:05

Just put the \cite{hong_groups_2004} in an extra pair of curly brackets ({}), without them, soul will do funny things with the \cite-command:

\documentclass{article}
\usepackage{color,soul}
\begin{document}
\hl{A statement {\cite{hong_groups_2004}}}
\end{document}


You will get some ideas from section 2.1 and 2.2. in the manual. I suggest to use the more robust soulutf8 by Heiko Oberdiek to avoid possible future errors. You can then use utf8 in your file, nice if you write in other languages than US English.

New MWE:

\documentclass[UKenglish]{article}
\usepackage[utf8]{inputenx}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{color,soulutf8}

\begin{document}
\hl{A statement {\cite{hong_groups_2004}}}

Normal text.

\hl{Highlighted text with æøåÆØÅ}

\end{document}


Edit: If it does not work using curly brackets ({}), try mbox{} instead. My best tip is to look in the manual subsection 2.3.1 to see if you recognise some of the boarder line cases there.

• This solution gets rid of the citex error, but creates a new one: ! Package soul Error: Reconstruction failed. – elplatt May 23 '16 at 18:44
• @elplatt I found putting \protect before the citations is a decent solution. – kevinkayaks Oct 20 at 21:57