[Tex/LaTex] Enumerate \item with a decimal value

#enumeratelists

I'm using enumerate to create an outline that already exists. (As in, I'm copying an existing list, and I get no say in the numbers that are already picked.) My problem is that occasionally the outlines have a fractional value thrown in. One of the sections proceeds like: 1, 2, 2.5, 3.

I tried using \setcounter{enumi}{1.5} before where 2.5 goes, but LaTeX didn't like that at all. This works, but is a little clunky:

\setcounter{enumi}{1}
\renewcommand{\labelenumi}{(\theenumi.5)}
\item This is item number 2.5.
\setcounter{enumi}{2}
\renewcommand{\labelenumi}{(\theenumi)}

Is there a better way to have a decimal value?

Best Answer

Use the optional argument:

\documentclass{article}
\begin{document}

\begin{enumerate}
 \item foo
 \item bar
 \item[(2.5)] foobar
 \item baz
\end{enumerate}

\end{document}
Related Question