[Tex/LaTex] LaTeX enumerate – bold item with non-bold text

#enumerateboldenumitemenvironmentslists

I'm trying to customize the environment enumerate where the \item is bold but the text is not bold. What I've tried is (at the suggestion of one of the google-results):

\let\origitem\item
\renewcommand{\item}{\normalfont\origitem}
\newcommand{\bolditem}{\normalfont\bfseries\origitem}

and then use it with

\begin{enumerate}
    \bolditem[0] First item (whole line is bold)
    \bolditem[1] Second item (also bold)
    \item[2] Third item (not bold)
\end{enumerate}

But this makes the whole line bold. I only want the numbered part to be bold.

How can I achieve this ?

Best Answer

You can use the enumitem package. If you don't want to use additional packages, you can simply redefine \labelenumi:

\documentclass{article}
\usepackage{enumitem}

\begin{document}

\begin{enumerate}
    \renewcommand\labelenumi{\bfseries\theenumi}
    \item First item.
    \item Second item.
    \item Third item.
\end{enumerate}

% requires the enumitem package
\begin{enumerate}[label=\bfseries\arabic*]
    \item First item.
    \item Second item.
    \item Third item.
\end{enumerate}

\end{document}

EDIT: on a more programmatic level, you could define a new list-like environment that behaves like the standard enumerate, but with the desired format for the label. This can be done using something like this

\documentclass{article}

\newenvironment{boenumerate}
  {\begin{enumerate}\renewcommand\labelenumi{\textbf\theenumi}}
  {\end{enumerate}}

\begin{document}

\begin{boenumerate}
    \item First item.
    \item Second item.
    \item Third item.
\end{boenumerate}

\end{document}

or imitating the definition of the enumerate environment as given in source2e):

\documentclass{article}

\makeatletter
\def\boenumerate{%
\renewcommand\labelenumi{\textbf\theenumi}
  \ifnum \@enumdepth >\thr@@\@toodeep\else
    \advance\@enumdepth\@ne
    \edef\@enumctr{enum\romannumeral\the\@enumdepth}%
      \expandafter
      \list
        \csname label\@enumctr\endcsname
        {\usecounter\@enumctr\def\makelabel##1{\hss\llap{##1}}}%
  \fi}
\let\endboenumerate =\endlist
\makeatother

\begin{document}

\begin{boenumerate}
    \item First item.
    \item Second item.
    \item Third item.
\end{boenumerate}

\end{document}

Something similar, but now with the help of the enumitem package:

\documentclass{article}
\usepackage{enumitem}

\newlist{boenumerate}{enumerate}{4}
\setlist[boenumerate,1]{label=\bfseries\arabic*}

\begin{document}

\begin{boenumerate}
    \item First item.
    \item Second item.
    \item Third item.
\end{boenumerate}

\end{document}
Related Question