I want to highlight changes which are introduced by myself in the pdf document. So far the soul package is very neat but it does throw errors when I want to highlight not only paragraphs but also some itemize environments, and I don't want to highlight the items separately. Also the \cite{...} command is not supported by \hl. I recently posted a slightly different question: Change text background within paragraph (with automatic linebreaks)

BTW: What I liked most over other approaches like pdfcomments etc. is that the \hl command from soul has a very exact and clear output, no icons, no clicking etc. involved. Together with todonotes it's very good and almost all I need.

  • Clumsy me: when this is a single paragraph I could clearly use \colorbox. Even with \cite commands inside. When its a phrase without \cite commands inside a paragraph I can use \hl from soul package. The only problem left is when I have a phrase with \cite commands, \hl will not work :( – math Jun 9 '11 at 8:42

Concerning your question about \hl support for \cite: while \hl{text\cite{book}} gives an error, it works if you additionally group the \cite command by curly braces.

\bibitem[Knuth86]{texbook} D.E. Knuth, The TeXbook, 1986


highlighted \cite

  • 5
    I had instead to use \hl{text\mbox{\cite{texbook}}} for it to work for me, otherwise I got "Reconstruction failed" errors. – Filipe Correia May 17 '13 at 19:53
  • Is there a way to automate this encapsulation into curly braces? I though of a custom macro \newcommand{\mycite}[1]{{\cite{#1}}}.. and then maybe \soulregister{\mycite}{1}? – math Aug 16 '13 at 11:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.