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.

Due to the limitations of the number of subsubsections, subsubsubsections that we can use, I notice that I could replace that with the command \paragraph. Now when I use that, I am amazed by its function and would like to consult two things:

  1. In my first \paragraph command of Chapter 2, section 2.2, the numbering appear as 2.2.0.1. May I know if it is possible to change it to 2.2.1? If it is possible, may I know how it can be done?

  2. I notice \paragraph command doesn't add the heading to the table of contents. May I know how to incorporate the Title 1 from \paragraph{Title 1} into the table of contents?

Thank You.

share|improve this question
4  
The command \paragraph is semantically speaking below \subsubsection, so if you skip the latter its number is still at 0. Second, to get paragraph-level (and subparagraph-level) entries to show up in the TOC, issue the instruction \setcounter{tocdepth}{5} –  Mico Jun 25 '12 at 1:52
1  
@Mico Please make this an answer. I was about to say the same when I saw your comment. –  Christian Jun 25 '12 at 6:30
    
@Christian: Done! :-) –  Mico Jun 25 '12 at 10:48

1 Answer 1

up vote 8 down vote accepted

The command \paragraph is, semantically speaking, subordinated to the \subsubsection command. Each time a LaTeX sectioning command is used, two things happen (inter alia): First, the counter associated with its level -- part, chapter, section, subsection, subsubsection, paragraph, and subparagraph -- is incremented by 1; second, the counters of all subordinated sectioning levels are reset to 0. (Just for completeness, I should note that there's an exception to this rule: the \part command does not reset the chapter counter.)

Why does this matter for your document? Well, in most "standard" LaTeX document classes --such as article, report, and book -- the default style is to display the sectioning header's "number" as a composite of the counters of the current sectioning level and all higher level sectioning groupings (except, usually, the part level). So what happens when LaTeX encounters a sequence of commands such as

\section{Big ideas}
\subsection{Preliminaries}
\paragraph{Exciting details}

Because no \subsubsection command is provided in this example between \subsection and \paragraph, the counter for the subsubsection level is still at 0, and the other counters will be at 1. Therefore, when LaTeX processes the \paragraph command, its header will be constructed as

1.1.0.1 Exciting details

Moral of the story: Don't skip higher-level sectioning commands when using lower-level sectioning commands such as \paragraph or \subparagraph.


Regarding your second question, on how to get paragraph-level headers displayed in the Table of Contents (ToC). LaTeX has a parameter called tocdepth, which controls the depth of sectioning levels that will be shown in the ToC. Most document classes I'm familiar with set this parameter to 3, which means that only sectioning commands up to and including subsubsection will be shown (but not paragraph and subparagraph, because their associated sectioning levels are set at 4 and 5, respectively). To get paragraph and subparagraph headers to be listed in the ToC, just set

\setcounter{tocdepth}{5}

in the document's preamble. Happy TeXing!

share|improve this answer
    
Thanks alot Mico. –  Sandra Jun 25 '12 at 13:13
    
@Sandra - you're welcome! :-) –  Mico Jun 25 '12 at 13:18

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.