Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
    
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

1 Answer 1

up vote 4 down vote accepted

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.

\documentclass{article}
\usepackage{soul}
\begin{document}
\hl{text{\cite{texbook}}}
\begin{thebibliography}{Knuth86]}
\bibitem[Knuth86]{texbook} D.E. Knuth, The TeXbook, 1986
\end{thebibliography}
\end{document}

gives

highlighted \cite

share|improve this answer
3  
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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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