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}
You could simply use the optional Argument of \item
\documentclass{scrartcl}
\begin{document}
\begin{itemize}
\item [2.9] Foo
\item [53.2] Bar
\item [69.11]
\end{itemize}
\end{document}
I hope that’s what you wanted to do …
Best Answer
You can use for example the
enumitem
package to customize theenumerate
environment.enumitem
also allows you to define your own list environment:Setting the
itemindent
to*
automatically calculates the necessary width for the entire label. Without this the label will run into the left margin.If an item text is too long to fit on one line, the next line will be indented a little from the left margin:
If you want this second line to be aligned with the start of the item text, use
leftmargin=*
instead ofitemindent=*
. If you want the second line to not be indented, useleftmargin=0pt
in addition toitemindent=*
. The following example sums this up: