Hey all!
I am beginning with Latex, and find it awesome. However I have a problem seriously bugging me.
I would like to use report as my document class as I find it perfect (title on seperate page, vertically and horizontally centered, parts on seperate pages, etc.). However, I DO NOT want to use chapters, only parts, sections, subsections, etc. My table of contents thus show sections as 0.1, 0.2, etc. as I have not defined any chapter. How can I change numbering in a report-class Table of Content to be PART.SECTION instead of CHAPTER.SECTION?
Thanks!
Document Classes ⇒ Report vs. Article
NEW: TikZ book now 40% off at Amazon.com for a short time.

Report vs. Article
Hi,
you can do a redefinition of the representation of the section counter and some adjustment to make this counter restart with every new part; an example:
you can do a redefinition of the representation of the section counter and some adjustment to make this counter restart with every new part; an example:
Code: Select all
\documentclass{report}
\usepackage{chngcntr}
\renewcommand\thesection{\thepart.\arabic{section}}
\counterwithin{section}{part}
\begin{document}
\tableofcontents
\part{Test part one}
\section{Test section one one}
\section{Test section one two}
\part{Test part two}
\section{Test section two one}
\section{Test section two two}
\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Report vs. Article
Great, except parts are numbered with roman numerals and sections are displayed as I.1, II.1, etc. in the TOC. I would like either parts as arabic and sections as 1.1, 2.1, etc. in the TOC or parts as roman and sections as 1.1, 2.1, etc.gmedina wrote:Hi,
you can do a redefinition of the representation of the section counter and some adjustment to make this counter restart with every new part; an example:
Code: Select all
\documentclass{report} \usepackage{chngcntr} \renewcommand\thesection{\thepart.\arabic{section}} \counterwithin{section}{part} \begin{document} \tableofcontents \part{Test part one} \section{Test section one one} \section{Test section one two} \part{Test part two} \section{Test section two one} \section{Test section two two} \end{document}
As long as section are pure arabic, parts can be roman or arabic. How do I go about it?
Report vs. Article
Code: Select all
\renewcommand\thepart{\arabic{part}}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Report vs. Article
Ahhhh great! That worked perfectly. Thank you very much.gmedina wrote:Code: Select all
\renewcommand\thepart{\arabic{part}}
If I understand correctly, the above command (re)sets part numbers to arabic.
However what I don't understand is the \counterwithin command, is it a TOC-specific command?
Thanks again!
Re: Report vs. Article
\counterwithin{<count1>}{<count2>} forces <count1> to restart whenever <count2> is increased.
1,1,2,3,5,8,13,21,34,55,89,144,233,...