[Tex/LaTex] Highlight / color parts of text


LaTex newbie here. Currently using vim with solarized color scheme to edit .tex documents.

When writing I often jump around to different parts of the document, leaving gaps behind to work on later. In Microsoft Word I would highlight text in yellow to remind myself what needed to be finished.
How can I do something similar with my .tex documents? I have seen this question but the answers focus on adding notes or highlighting to the final pdf product. I want something to stand out in the actual tex document I'm working on.

I tried putting comments after the lines, but these didn't stand out very well (almost same color as standard text). This may simply be a color scheme problem.

What is a typical/recommended way to do this?

Best Answer

You could use the soul package. If you put \usepackage{xcolor} and \usepackage{soul} in your preamble, then you can simply use \hl{...} to highlight a piece of text.





Nullam accumsan, dui vitae vehicula aliquet, libero ligula congue
turpis, rutrum molestie ante nisl ac mi. Sed sem quam, hendrerit in
fermentum id, elementum quis magna. Proin ac diam lacus, eu egestas
leo. Donec ultricies nulla vel massa semper adipiscing. Etiam
venenatis congue molestie. Class aptent taciti sociosqu ad litora
torquent per conubia nostra, per inceptos himenaeos. Vivamus ante
risus, gravida non dapibus id, vestibulum nec erat. Cras in lorem vel
nisi pulvinar tristique. Phasellus dignissim, mauris vel convallis
sagittis, tortor magna malesuada justo, nec placerat lorem neque id

Donec ante enim, imperdiet at eleifend vitae, accumsan ut massa. Donec
laoreet venenatis imperdiet. \hl{Quisque facilisis, arcu nec tempor
varius, felis diam faucibus augue, ac auctor nisi orci ac
justo. Vestibulum et purus orci, sed hendrerit nulla. Fusce et nisi
in justo fringilla malesuada eu ut neque. Integer ac tellus eget
enim aliquam egestas ut sit amet elit. Nulla sagittis tellus ut
velit euismod pulvinar. In dapibus laoreet lectus, sed vulputate
justo laoreet ut. Aenean semper tempor tortor, sed vehicula ligula
pellentesque eget. Sed semper, odio ut ultrices lobortis, nunc nibh
viverra quam, pulvinar tincidunt lacus felis egestas enim. Sed
porttitor eros pretium magna pellentesque sit amet varius nisl

Suspendisse blandit gravida semper. Fusce luctus, nisl non adipiscing
euismod, ante mi mollis massa, ut vulputate sem nulla non nisi. Mauris
erat est, tincidunt sollicitudin tincidunt in, condimentum ac
turpis. Proin accumsan neque eu mauris accumsan vel} condimentum quam
porta. Nam imperdiet lacinia ligula, vitae luctus orci volutpat
et. Morbi in turpis in lorem venenatis suscipit. Mauris cursus libero
ac sem imperdiet venenatis. Nulla volutpat leo nibh, at ornare
urna. Etiam rhoncus ornare volutpat. Cras pharetra nisl vitae turpis
pulvinar eu suscipit lacus pulvinar. Phasellus ut metus nibh. In at
elit eleifend odio molestie ullamcorper. Integer cursus risus ac quam
viverra tempus.



enter image description here