23. Formatting chapter sections

## A note about file structure

If a document consists of multiple chapters, then it is good practice to create one .tex filer per chapter. For example:

• chapterone.tex
• chaptertwo.tex
• chapterthree.tex
• chapterfour.tex

Then you define the title and other information at the top of each chapter using specific commands. Furthermore, the document’s TOC (Table of Contents) are built using the chapter title and each chapter’s section headings. You can also add index entries for the chapter.

## Defining a chapter title

Each chapter begins with the following elements:

• The first line requires you to define the title of the chapter. This is used in the headers and in the Table of Contents.

• The second line is used for cross-referencing to this chapter. It serves as a marker or anchor.

• The third line is used by the index.

For example:

## Section headings

Creating a section headings is quite easy - use the section command. Second and third level headings are just as easy. These levels use subsection and subsubsection commands. For example:

Note: Three levels of headings are best. Any more and you may need to rewrite sections so they are at most third level deep. If you must, then just use a bolded paragraph for a fourth level heading.

## Paragraphs

Paragraphs are entered without markup tags. Adding a new paragraph simply requires a blank line between paragraphs.

## Comments

You can add comments to a .tex file as required using the % character.

## Paragraph line breaks

You can add a line break into text by adding a backslash {\} or using the \newline command. However, these two commands are not entirely identical. The backslash provides two optional parameters.

The following command tells LaTeX to start a new line.

The following command tells LaTeX not to start a new page after the line by issuing a \nobreak.

The following command specifies the vertical space <len> to be inserted before the next line. This value can also be negative.

Note: The above two can also be mixed. That is, using both a starred + optional argument combination \*[<len>].

The following command is similar to the backslash.

## Indenting paragraphs in lists

You can define the indentation value of paragraphs within lists in the stylesheet then apply the command where needed.

Then Use myindentpar in the document flow to indent a paragraph based on the settings.

Note that you can adjust the indent in this command as required.

Click to continue.