Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Highlighting text and equations

1,205 views
Skip to first unread message

jfh

unread,
May 11, 2010, 6:27:28 PM5/11/10
to
I have just received a MS back with referees' comments. The journal
editor wants changes highlighted. These include text, math mode in-
line, displayed equations, and figures. I tried the following:

\documentclass{article}
\usepackage{amsmath,amssymb}
\usepackage{color,soul}
\begin{document}
blah \hl{blah} blah \hl{$x=x$}
\hl{
\begin{gather}
x=y
\end{gather}
}
\end{document}

If I remove \hl{ before \begin{gather} and } after \end{gather} I get
yellow highlighting for both the plain text blah and the in-line
equation $x=x$ but if I don't, the error message is

! LaTeX Error: Environment {gather} undefined.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.10 }

What should I do instead?

-- John Harper

Gonzalo Medina Arellano

unread,
May 11, 2010, 7:06:24 PM5/11/10
to

You could use the shaded environment from the framed package (http://
www.ctan.org/pkg/framed):

\documentclass{article}
\usepackage{amsmath,amssymb}
\usepackage{xcolor,soul,framed,caption}

\colorlet{shadecolor}{yellow}

\begin{document}
blah \hl{blah} blah \hl{$x=x$}

\begin{shaded}


\begin{gather}
x=y
\end{gather}

\end{shaded}

\begin{shaded}
\centering
\rule{4cm}{2cm} % just to simulate an actual figure
\captionof{figure}{Test figure}
\end{shaded}

\end{document}

you cannot use floats inside shaded, but you could use the \captionof
command from the caption package, as the example shows.

0 new messages