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.

Please consider the following code. I would like to use the enumerate-environment to generate a list, which (for better understanding) I built with the tabular-environment. I would like to have the second item labeled as "2-5.".

\documentclass[fontsize=12pt, paper=a4]{scrartcl}

\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{ngerman}

\begin{document}


\begin{enumerate}
\item bla
\item bla bla
\item bla bla bla
\end{enumerate}


\begin{table}[htbp]
   \begin{tabular}{rl}
1. & bla \\
2-5. & bla bla   \\
6. & bla bla bla  \\
   \end{tabular}
\end{table}

\end{document}  

example

share|improve this question
1  
What exactly do you want the customized enumeration to be like. Be more specific. You mean the enumerate 2-5 is brought together in one \item[2-5] sort of input? –  azetina Jun 12 '12 at 22:29
    
@azetina: Thx for the comment. Please see edit. –  John Jun 12 '12 at 22:37
add comment

2 Answers 2

up vote 2 down vote accepted

If you want to resume the numbering after a modification

\documentclass[fontsize=12pt, paper=a4]{scrartcl}

\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{ngerman}

\begin{document}
\begin{enumerate}
\item bla \stepcounter{enumi}
\item[\theenumi--5.] bla bla \setcounter{enumi}{5}
\item bla bla bla
\end{enumerate}
\end{document}

Thanks to egreg and Mico for the correction/modification!

enter image description here

share|improve this answer
    
You should add the period: \item[\theenumi-5.]. –  egreg Jun 12 '12 at 22:51
    
@egreg oops. Fixed. Thanks a lot. –  percusse Jun 12 '12 at 22:53
    
To highlight that you're dealing with a range of numbers rather than a simple "dash", you may want to to write \item[\theenumi--5.] (the -- will be typeset as an en-dash). –  Mico Jun 13 '12 at 2:28
    
@Mico That's better, thank you. I've updated the code accordingly. –  percusse Jun 13 '12 at 7:55
add comment

I think you are looking for the optional argument to \item:

enter image description here

\documentclass[fontsize=12pt, paper=a4]{scrartcl}

\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}


\begin{document}


\begin{enumerate}
\item bla
\item[2--5.]\addtocounter{enumi}{4} bla bla
\item bla bla bla
\end{enumerate}


\begin{table}[htbp]
   \begin{tabular}{rl}
1. & bla \\
2-5. & bla bla   \\
6. & bla bla bla  \\
   \end{tabular}
\end{table}

\end{document} 
share|improve this answer
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.