Your support for our advertisers helps cover the cost of hosting, research, and maintenance of this document

Formatting Information — An introduction to typesetting with LATEX

### In this section…

1. Section numbering

LATEX provides seven levels of division or sectioning for you to use in structuring your text. They are all optional: it is perfectly possible to write a document consisting solely of paragraphs of unstructured text. But even novels are normally divided into chapters, although short stories are often made up just of paragraphs.

### Table 2.1: LATEX’s sectioning commands

 Depth Division Command Notes −1 Part \part Not in letters 0 Chapter \chapter Books, reports 1 Section \section Not in letters 2 Subsection \subsection Not in letters 3 Subsubsection \subsubsection Not in letters 4 Titled paragraph \paragraph Not in letters 5 Titled subparagraph \subparagraph Not in letters

Chapters are only available in the book and report document classes, because they don’t have any meaning in articles and letters. Parts are also undefined in letters.

In each case the title of the part, chapter, section, etc goes in curly braces after the command. LATEX automatically calculates the correct numbering and prints the title in bold. You can turn section numbering off at a specific depth: details in § 2.6.1.

There are packages to let you control the typeface, style, spacing, and appearance of section headings: it’s much easier to use them than to try and reprogram the headings manually. Two of the most popular are section and sectsty.

```\section{New recruitment policies}
...
\subsection{Effect on staff turnover}
...
```

```\section[Effect on staff turnover]{An analysis of the
effects of the revised corporate recruitment policies
on staff turnover at divisional headquarters}
```

### Exercise 5: Start your document text

1. Add a \chapter command after your Abstract or Summary, giving the title of your first chapter.

2. If you’re planning ahead, add a few more \chapter commands for subsequent chapters. Leave a few blank lines between them to make it easier to add paragraphs of text later.

3. Typeset the document.

### 2.6.1 Section numbering

All document divisions get numbered automatically. Parts get Roman numerals (Part I, Part II, etc); chapters and sections get decimal numbering like this document, and Appendixes (which are just a special case of chapters, and share the same structure) are lettered (A, B, C, etc). You can easily change this default if you want some special scheme.

You can change the depth to which section numbering occurs, so you can turn it off selectively. In this document the depth is set to 3, using the depth column in Table 2.1. If you only want parts, chapters, and sections numbered, not subsections, subsubsections, or lower levels, you can change the value of the secnumdepth counter using the the \setcounter command, giving the depth value from Table 2.1:

```\setcounter{secnumdepth}{1}
```

Notice that the \setcounter command, like \renewcommand which we saw earlier, has two arguments: the name of the counter you want to set, and the number you want to set it to.

A related counter is tocdepth, which specifies what depth to take the Table of Contents to. It can be reset independently, in exactly the same way as secnumdepth. The setting for this document is 2.

```\setcounter{tocdepth}{3}
```

To get a one-time (special case) unnumbered section heading which does not go into the Table of Contents, follow the command name with an asterisk before the opening curly brace:

```\subsection*{Shopping List}
```

All the divisional commands from \part* to \subparagraph* have this ‘starred’ version which can be used in isolated circumstances for an unnumbered heading when the setting of secnumdepth would normally mean it would be numbered.

1. It is arguable that chapters also have no place in reports, either, as these are conventionally divided into sections as the top-level division. LATEX, however, assumes your reports have chapters, but this is only the default, and can be changed very simply (see § 7.6).