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 write homework assignments in LaTex and the assignments are always divided into subparts (i.e. Problem 1 is divided into 1.1, 1.2, 1.3, ...). Currently what I do is I have nested enumerations, but the numbering isn't exactly what I'd like. I am currently using

\renewcommand{\labelenumii}{\arabic{enumii}.}

to number the subparts, but this produces 1., 2., ... and what I'd like it to be is 1.1, 1.2,... Is there anyway to do this?

share|improve this question
    
Welcome to TeX.SE. –  Peter Grill Oct 23 '12 at 21:37
add comment

1 Answer

up vote 16 down vote accepted

Use

\renewcommand{\labelenumii}{\theenumii}
\renewcommand{\theenumii}{\theenumi.\arabic{enumii}.}

to change the way nested enumerations are set (without brackets ()) and in a sub-enumeration form that is \arabic:

enter image description here

\documentclass{article}
\renewcommand{\labelenumii}{\theenumii}
\renewcommand{\theenumii}{\theenumi.\arabic{enumii}.}
\begin{document}
\begin{enumerate}
  \item First
  \begin{enumerate}
    \item Second
    \item Third
  \end{enumerate}
  \item Fourth
\end{enumerate}
\end{document}​

The enumitem is actually the de-facto list processing/setting package. Here's such a take on your enumeration:

\documentclass{article}
\usepackage{enumitem}% http://ctan.org/pkg/enumitem
\begin{document}
\begin{enumerate}
  \item First
  \begin{enumerate}[label*=\arabic*.]
    \item Second
    \item Third
  \end{enumerate}
  \item Fourth
\end{enumerate}
\end{document}​

label* appends the suggested key-value to the parent label. Of course, global setting is also possible.

share|improve this answer
    
Perfect! Thanks for the help. –  nh0815 Oct 23 '12 at 22:54
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.