Say I want to produce something with the effect like this:
[\textbf{1}] foo
[\textit{2}] bar
[\color{red} 3] foobar
and the numbers should be generated automatically by \item in \enumerate.
For example, the code should be something like
\begin{enumerate}
\item[\bf] foo
\item[\it] bar
\item[\red] foobar
\end{enumerate}
Thanks.
Some edits: Both Bolding a single number in a enumerated list and How to modify labels on some (not all) etaremune items seem to provide some useful methods. For example, based on the suggestion in broken hyperlink to items in etaremune or revnum environment, I can implement the bold font with proper reference by
\providecommand*{\phantomsection}{}% for compatibility if hyperref not loaded
\newcommand{\lebal}{\phantomsection\label}
\begin{etaremune}
\newif\ifitembf
\renewcommand*\labelenumi{[\ifitembf\bfseries\fi\theenumi]}
{\itembftrue \item \lebal{bar} foo}
\end{etaremune}
to get a reference to foo, and in the enumerate the item number for is correctly bolded. However, when I use \ref{bar}, the caption in the link seems to be with the correct number but the font is not bolded automatically. Is there a proper solution? Thanks. [I do not have enough reputation to comment on the other questions so I cannot ask there.]
\item? It doesn't show in your code. – Miyase Nov 06 '22 at 09:01