2

This question already has an answer here:

How could I hightlight an item from an enumerated list just like this is from the following picture?

enter image description here

\documentclass[12pt,a4paper]{article} 
\usepackage{enumerate} 
\usepackage{tikz} 
\usepackage{mdframed} 
\usepackage{type1cm} 
\usepackage{lettrine} 
\usepackage[listings]{tcolorbox} 
\usepackage{color} 
\begin{document} 
\begin{enumerate} 
\item 12 
\item 143 
\item 154 
\end{enumerate} 
\end{document}

A minimal working code be this one above.

marked as duplicate by jub0bs, Mensch, Marco Daniel, Thorsten, mafp Apr 7 '13 at 18:37

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

If the lists are as simple that the one you have shown a rather easy solution is to define your own \item commands. One for highlighting and one for no highlighting.

\documentclass[12pt,a4paper]{article} 
\usepackage{xcolor,soul} 
\begin{document}
\makeatletter
\renewcommand\theenumi{\@Roman\c@enumi.}
\long\def\Item#1\par{%
 \stepcounter{enumi}%
 \leavevmode\makebox[2em]{\theenumi} #1%
 \vskip4\p@ \@plus2\p@ \@minus\p@
}
\long\def\hItem#1\par{%
 \stepcounter{enumi}%
 \leavevmode\makebox[2em]{\hl\theenumi}\hl{ #1}%
 \vskip4\p@ \@plus2\p@ \@minus\p@
}
\newenvironment{hlroman}{\quote\setcounter{enumi}{0}}
{\endquote}

\begin{hlroman}
\hItem A\par
\Item B\par
\Item C\par
\end{hlroman}
\end{document}

Feel free as an exercise to improve, by adding \leftkskip, \rightskip or hangindent to suit. Add complexity as needed (see for sample source2e 228).

I have used the soul package for highlighting.

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