# Enumerate with a range of numbers in an item's label

I am preparing an outline of lectures for a course. Some topics will take more than one lecture. I want to create an enumerate environment that reflects this.

I want to end up with something like

  1. Topic 1.
2-3. Topic 2.
4. Topic 3.
5-6. Topic 4.


I know that I can do this manually, e.g.,

\documentclass{article}

\begin{document}
\begin{enumerate}
\item [1.] Topic 1.
\item [2-3.] Topic 2.
\item [4.] Topic 3.
\item [5-6.] Topic 4.
\end{enumerate}
\end{document}


However, if I want to insert another topic in the middle of the list, I need to re-do everything by hand. Is there a way of doing this with one or more counters?

-

\documentclass{article}

\def\itemrange#1{%
\edef\labelenumi{\theenumi--\noexpand\theenumi}%
\item
\def\labelenumi{\theenumi}}

\begin{document}
\begin{enumerate}
\item  Topic 1.
\itemrange{1} Topic 2.
\item  Topic 3.
\itemrange{1} Topic 4.
\end{enumerate}
\end{document}

-
This is a very nice solution. I have one nitpick: an itemrange does not put a period after the label, and the same is true of any items that occur after the first itemrange. – Andrew Uzzell Dec 14 '12 at 16:16
oh sorry just put a . at the end of the two definitions of \labelenumi. – David Carlisle Dec 14 '12 at 17:07

Disclaimer: This is a personal variation. People are free to have difference of opinion on this.

I would be doing it like this:

\documentclass{article}

\begin{document}
\begin{enumerate}
\item  Topic 1
\item  Topic 2
\begin{enumerate}
\item First session
\item Second session
\end{enumerate}
\item  Topic 3
\item  Topic 4
\begin{enumerate}
\item First session
\item Second session
\end{enumerate}
\end{enumerate}
\end{document}


-