Color "item #"

David Carlisle d.p.carlisle at
Wed Dec 22 15:06:52 CET 2021

On Wed, 22 Dec 2021 at 12:23, Jerry Seibert <jerry at> wrote:

> On Tue, 21 Dec 2021 22:54:14 +0000, David Carlisle stated:
> Thanks David, I had not considered that approach before. While I have
> your attention, I do have one other quick question. I have used the
> "soul" package to create text background colors. I can use the
> "\hl{text}" command inside an enumerate listing; however, it can only
> be used AFTER an "\item" command, ie
> \begin{enumerate}
>         \item \hl{This is text with a yellow background}
> \end{enumerate}
> If I try to place the "\hl" command before the "\item" an error
> message is issued.

you could use \ul in the label format (or rather a local command that you
define to be \url or not) in a similar way to color, or simpler if you want
a rectangular box around the whole list use \colorbox around a \parbox with
the list. If you are using luatex you could look at using lua-ul instead of
soul, as it attacks things at a different level and avoids many of the
complications soul has to deal with.

> Again, I can do it in MS Word, so I figure that there has to be a
> relatively easy way to do it in LaTeX also. I am just not finding it.

Your expectations are rather different to mine:-) The underlying models of
TeX and Word are so fundamentally different I would find it natural that
things that are easy in Word are harder in TeX and vice versa.


> --
> Thanks!
> Jerry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the texhax mailing list.