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 use this document class: \documentclass[a4paper,12pt]{article}. Can someone please help me to form such style of table of contents.

I need:

  • the arabic numbering everywhere in the toc (now "parts" are roman)
  • resetting of section number counter in each part (now they just keep getting incremented)
  • to make part number with a dot to preceed the section number (now only sections numbers are displayed)
  • indentation of sections relative to parts, identation of subsections relative to sections (now sections are directly under the parts)

It should look like this:

1 Part Name
   1.1 Section Name
   1.2 Section Name

2 Part Name
   2.1 Section Name
   2.2 Section Name
   2.3 Section Name
       2.3.1 Subsection Name
share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

There are a couple of problems here:

  • You have the wrong hierarchy for sectioning commands. Sections are inside chapters, not parts. Parts are intended to contain a number of chapters, not a number of sections. Use \chapter instead of \part and a lot of your problems with disappear.
  • You shouldn't be using \part with the base LaTeX article class. If you want to stick with the base LaTeX document classes, use report rather than article if the document truly does contain parts. You can use the report class for a document that does not contain parts (highest entity is a \chapter).
share|improve this answer
1  
\part can be used in article. Probably azerIO doesn't want the "dramatic" appearance of chapters in the report class. –  egreg Jun 21 '11 at 10:32
add comment
\documentclass[a4paper]{article}
\usepackage{chngcntr}
\usepackage[titles]{tocloft}
\renewcommand{\thepart}{\arabic{part}}
\counterwithin{section}{part}

\setlength{\cftsecindent}{2em}
\setlength{\cftsecnumwidth}{2em}
\setlength{\cftsubsecindent}{4em}
\setlength{\cftsubsecnumwidth}{2.5em}

\begin{document}
\tableofcontents
\part{Uno}
\section{Uno}
\part{Due}
\section{Due}
\subsection{Due}
\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.