Highlighting a paragraph in LaTex
When writing a text in Microsoft Word I like to highlight sections with a "neon marker" effect to have a clear visual guidance which parts still need some reviewing or for example need additional citations added. So basically this is how it should look in a LaTex generated PDF as well:
Googling for latex highlight paragraph blog posts like e.g. devdaily.com suggest the following approach to highlight a paragraph:
Add the following to your preamble:
\\usepackage{color}
\\newcommand{\\hilight}\[1\]{\\colorbox{yellow}{#1}}
To highlight text in the body of your document, use
\\hilight{this is some highlighted text}
There is a problem with the previous method is that the color box does not wrap properly. Here's a much easier and robust way of doing this
\\usepackage{soul}
To highlight text in the body of your document, use
\\hl{this is some highlighted text}
Unfortunately this approach works only if the highlighted paragraph contains no other nested block elements like a \citep tag. If you, like me, use such elements in the text you want to highlight you will get error messages which makes the Soul package quite unusable for the original purpose.
What actually does work exactly as I wanted it to in the first place is using the todonotes package:
\\usepackage\[bordercolor=white,backgroundcolor=gray!30,linecolor=black,colorinlistoftodos\]{todonotes}
\\newcommand{\\rework}\[1\]{\\todo\[color=yellow,inline\]{Rework: #1}}
Now marking up a paragraph in \\rework{paragraph(s)}
results in:
this throws yet another error
! TeX capacity exceeded, sorry \[input stack size=1500\].
when the paragraph contains a footnote. Oh well - will have to do for now anyway.