Consider this:
I want to be able to highlight text like this without adding space around it -- so each word in the first line should line up with the corresponding word in the second line. (I know that I may have to fiddle with the size of the highlighting to stop it overflowing onto other words.)
That example was generated with PSTricks, although I'd much prefer a tikz solution.
\documentclass[a4paper]{article}
\usepackage{color}
\usepackage{pstricks}
\newrgbcolor{vlgray}{0.87 0.87 0.87}
\newcommand{\highlight}[1]{\psframebox[linearc=1.4mm,cornersize=absolute,fillcolor=vlgray, fillstyle=solid,linecolor=white]{#1}}
\begin{document}
Lorem ipsum \highlight{dolor} sit amet, \highlight{consectetuer} adipiscing elit, sed diam
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam
\end{document}
Edit: also see the answer at https://tex.stackexchange.com/a/89145/17049 , which I particularly like because it fits the highlighting around the text more tightly than the answers below (or my example above).
\tikzmark
macro: see as reference How to “highlight” text/formals with tikz? for text and for formulas \boxed{}, TikZ and colored equation background and http://tex.stackexchange.com/questions/88429/color-box-with-rounded-corners-around-a-fragment-of-a-formula.tikzmark
library on launchpad.net which provides properhighlight
methods.