# Enumerate with multiple numbers (comma-separated) for a single item

I'd like to get a list that looks like this:

1. Text addressing #1.

2,3. Text addressing #2 and #3 together.

4. Text addressing #4.


The motivation is that the list items are referring to a previous list. Any idea on how to do this easily with enumerate? (Or some other way to do it that looks consistent with the enumerate environment, i.e. if I had an enumerate list right above it, the two would seem to be formatted identically except the 2,3 part..)

-

## 2 Answers

If you don't need greater generality, this might work:

\documentclass{article}
\newcommand{\doubleitem}{%
\begingroup
\stepcounter{enumi}%
\edef\tmp{\theenumi, }%
\stepcounter{enumi}
\edef\tmp{\endgroup\noexpand\item[\tmp\labelenumi]}%
\tmp}

\begin{document}
\begin{enumerate}
\item A
\item B
\item C
\item D
\end{enumerate}
Another
\begin{enumerate}
\item about A
\doubleitem about B and C
\item D
\end{enumerate}
\end{document}


-
That looks great, thanks very much! –  thelookingglass Apr 14 '13 at 3:28

(I am answering because my reputation is too low to comment)

I found this interesting, and I was searching for a solution for three numbers actually. Piggybacking on egreg's answer, I came up with

\newcommand{\tripleitem}{%
\begingroup
\stepcounter{enumi}%
\edef\tmp{\theenumi, }%
\stepcounter{enumi}
\edef\tmpt{\theenumi, }
\stepcounter{enumi}
\edef\tmp{\endgroup\noexpand\item[\tmp\tmpt\labelenumi]}%
\tmp}


for three numbers. Perhaps someone who knows more about the language would know how to generalize it for an arbitrary number of grouped items?

-
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. –  Martin Schröder yesterday