Post by dbPost by Peter FlynnPost by dbIn a LaTeX document, I can highlight bits of text using the
package color, soul and \hl{...} in the body. But this doesn't
work for citations, equations and maybe other things. How do I
hjghlight these?
By "highlight" do you mean "change font" or "change color" or
something else?
If you use the xcolor package, you can specify a color for links, so
citations would change to that color.
I don't understand what highlighting an equation is meant to do? Make
it a different color?
Peter
The package color,soul enables the markup \hl{...} which superimposes
a colour onto the text, in my case yellow,
OK.
Post by dbexcept for citations and equations and probably other things.
Yes, \hl is only intended for static text, not more commands inside it.
Post by dbWhen you resubmit an article to a journal after getting critical
remarks from reviewers, you are asked to provide a version with
changes highlighted in this way, and that might include equations.
Ah, OK. You don't need soul for this, as xcolor already provides most of
what you want. The trick with equations (or anything bigger than a few
words) is to capture it into a box first, then highlight the box.
============================ test.tex ==========================
\documentclass{article}
\usepackage{xcolor,soul}
\usepackage[backend=biber,style=authoryear]{biblatex}
\addbibresource{test.bib}
\newsavebox{\HLbox}
\newenvironment{HL}{%
\setbox\HLbox=\vbox\bgroup\advance\hsize by-2\parindent}{%
\egroup\colorbox{yellow}{\box\HLbox}}
\fboxsep1pt
\begin{document}
This is some \hl{text} that was changed
\colorbox{yellow}{\parencite{latexguide}} and an inline equation
\colorbox{yellow}{\(E=mc^2\)}.
and displayed equations
\begin{HL}
\[E=mc^2\]
\end{HL}
\printbibliography
\end{document}
========================= test.bib ==============================
@book{latexguide,
author = {Marc {van Dongen}},
title = {{\LaTeX{} and Friends}},
publisher = {Springer},
address = {Berlin},
uri = {http://www.springer.com/us/book/9783642238154},
year = {2012},
isbn = {978-3-642-23815-4}}
=================================================================
Peter