# how to highlight an item label?

Is there any way to highlight (say put background yellow) on the label of itemized list such as (1. 2. 3 ... or A. B. C. ), not the item body itself, to make them stand out?

• Please give us a small, compilable document we can use which demonstrates your set up. Right now, we don't know what class you are using, what kinds of itemised/enumerated lists you are using, how they are nested, etc. That makes any solution a guessing game which probably won't work with your set up anyway.
– cfr
Aug 13 '15 at 21:14

You can define a command to color box containing the item label which can be applied to some item, here we use the enumitem package.

\documentclass{article}
\usepackage{xcolor}
\usepackage{enumitem}

\newcommand{\hilight}[1]{\setlength{\fboxsep}{1pt}\colorbox{yellow}{#1}}

\newcommand{\hlitem}{\stepcounter{enumi}\item[\hilight{\theenumi}]}

\begin{document}

\begin{enumerate}[label=\arabic*.]
\item   text
\hlitem text
\item   text
\end{enumerate}

\bigskip

\begin{enumerate}[label=\Alph*.]
\item   text
\hlitem text
\item   text
\end{enumerate}

\end{document}


• Thanks for the reply. Is there a way to highlight only a few or selected individual ones instead of ALL of them? Aug 14 '15 at 1:48
• I updated my answer to enable highlighting selected item label Aug 14 '15 at 6:27
• What if you want to highlight the whole line? Jan 31 '18 at 20:45