1

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?

1
  • 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
4

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}

enter image description here

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.