To change the value of an enumerate item within a basic enumerate environment seems to be fairly straightforward; consider
\documentclass{book}
\begin{document}
\LARGE
\begin{enumerate}
\item Sentence.
\item[10.] Sentence.
\item Sentence.
\end{enumerate}
\end{document}
which produces
However, the same process does not necessarily work for a slightly more fancy enumerate environment---say, when making use of \newtcbox
; for example,
\documentclass[openany]{book}
\usepackage{tcolorbox}
\newtcbox{\greenbox}[1][]{nobeforeafter,
notitle,
colframe=green!20!black,
colback=green!50!black,
top=4pt,
left=5pt,
right=5pt,
bottom=2pt,
fontupper=\sffamily\bfseries,
colupper=white,
tcbox raise base,
#1}
\usepackage{enumitem}
\setlist{label*={\greenbox{\arabic*}}}
\begin{document}
\thispagestyle{empty}
\Large
\begin{enumerate}
\item Sentence.
\item Sentence.
%\item[2*] Description.
\item Sentence.
\end{enumerate}
\end{document}
produces the list
But when I run the same code with the second item replaced by \item[2*] Description
, I get the following output.
QUESTION: How may I modify the above code so that, for instance, "2*" is displayed within the green box as the second item in the list?
Thank you.
\item[\greenbox{2*}] Description.
would not be an option for you?