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?
Asked
Active
Viewed 2,401 times
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
1 Answers
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}
Salim Bou
- 17,021
- 2
- 31
- 76
-
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 01:48
-
1
-
