Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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..)

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

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}

enter image description here

share|improve this answer
    
That looks great, thanks very much! –  thelookingglass Apr 14 '13 at 3:28
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.