About
Shop
LaTeX
Software
Books
Gallery
News
Contact
Blog
Settings
Account
Latest news 2024-10-15: New blog post: Tales for Our Times Book Launch.


5.3 Chapters, Sections, Subsections ...

Chapters, sections, subsections etc can be inserted using the commands:

\part[<short title>]{<title>}
\chapter[<short title>]{<title>}
\section[<short title>]{<title>}
\subsection[<short title>]{<title>}
\subsubsection[<short title>]{<title>}
\paragraph[<short title>]{<title>}
\subparagraph[<short title>]{<title>}

All these commands have a moving argument, so fragile commands will need to be protected using \protect. [How to create a \subsubsubsection]The final two commands in the above list, \paragraph and \subparagraph, represent subsubsubsections and subsubsubsubsections, although most class files typeset their arguments as unnumbered running titles.

Note that the availability of these commands depends on the class file you are using. For example, the scrartcl class file that we have been using is designed for articles, so the \chapter command is not defined in that class, whereas it is defined in the scrreprt and scrbook class files.

Each of the commands above has a mandatory argument <title> and an optional argument <short title>. The mandatory argument <title> is simply the title of the chapter/section/subsection etc. For example:

\section{Introduction}

If you are using the scrartcl class file, the output will look like:

Image: The text '1 Introduction' is typeset in a
large bold font

Note that you don't specify the section number as LaTeX does this automatically. This means that you can insert a new section or chapter or swap sections around or even change a section to a subsection etc, without having to worry about updating all the section numbers[The style of section headings].

If you are using a class file that contains chapters as well as sections, the section number will depend on the chapter. So, for example, the current section is the 3rd section of chapter 5, so the section number is 5.3. [Why are my sections numbered 0.1 ...?](Note that if you are using a class file where the section number depends on the chapter number, you must have a \chapter command before your first \section command, otherwise your section numbers will come out as 0.1, 0.2 etc.)

Unnumbered chapters/sections etc are produced by placing an asterisk * after the command name. For example:

\chapter*{Acknowledgements}

You can switch to appendices using the command

\appendix

then continue using \chapter, \section etc[Appendixes]. For example (using the scrreprt class file):

\appendix
\chapter{Derivations}
Some derivations.

\chapter{Tables}
Some tables.

Note:

The KOMA-Script classes have another type of sectioning command:

\minisec{<heading>}

This provides an unnumbered heading not associated with any of the structuring levels. For example, the above was produce using:

\minisec{Note:}
The KOMA-Script classes have another type of sectioning command:

The next note below was produced using:

\minisec{Important Note:}
If you want to change the font style used by headings,
\emph{\bfseries do not} use font declarations in the sectioning
command arguments.

Important Note:

If you want to change the font style used by headings, do not use font declarations in the sectioning command arguments. Don't do, for example:


\chapter{\itshape Introduction}
The KOMA-Script classes provide the command:

\addtokomafont{<element>}{<commands>}

where <element> is the name of a structuring element (no backslash) and <commands> is the list of font changing declarations (see Table 4.6) to apply to that element style. For example, the PDF version of this document uses the commands:

Exercise 10: Creating Chapters, Sections etc

Let's try editing our document so that it now has chapters, sections and an appendix. Since the scrartcl class file doesn't have chapters, let's change to the scrreprt class. Changes from our previous document are shown like this.


\documentclass[12pt]{scrreprt}

\usepackage{datetime}

\title{A Simple Document}
\author{Me}

\begin{document}
\maketitle

\begin{abstract}
A brief document to illustrate how to use \LaTeX.
\end{abstract}

\chapter{Introduction}

\section{The First Section}
This is a simple \LaTeX\␣document.
Here is the first paragraph.

\section{The Next Section}
Here is the second paragraph\footnote{with a footnote}.
As you can see it's a rather short paragraph, but not
as short as the previous one. This document was
created on: \today\␣at \currenttime.

\chapter{Another Chapter}

Here’s another very interesting chapter.
We’re going to put a picture here later.

\chapter*{Acknowledgements}

I would like to acknowledge all those
very helpful people who have assisted me in my work.

\appendix

\chapter{Tables}
We will turn this tabular environment into a table later.

\begin{tabular}{lrr}
 & \multicolumn{2}{c}{\bfseries Expenditure}\\
 & \multicolumn{1}{c}{Year1} & \multicolumn{1}{c}{Year2}\\
\bfseries Travel & 100,000 & 110,000\\
\bfseries Equipment & 50,000 & 60,000
\end{tabular}

\end{document}

(You can download a copy of this file if you like, but I recommend that you try editing the file yourself to give you practice.)


This book is also available as A4 PDF or 12.8cm x 9.6cm PDF or paperback (ISBN 978-1-909440-00-5).

© 2012 Dickimaw Books. "Dickimaw", "Dickimaw Books" and the Dickimaw parrot logo are trademarks. The Dickimaw parrot was painted by Magdalene Pritchett.

Terms of Use Privacy Policy Cookies Site Map FAQs