2

I stumbled across a weird problem. The following MWE produces an output where the section numbering starts with 0:

\documentclass{book}

\usepackage[english,ngerman]{babel}

\usepackage[T1]{fontenc}
\usepackage[unicode=true]{hyperref}

\begin{document}

\frontmatter{
        \tableofcontents
        \clearpage
        \listoffigures
        \clearpage
        \listoftables
        \clearpage
}

\chapter*{Symbolverzeichnis}


\pagenumbering{arabic}

\chapter{Einleitung}

\section{Motivation}

\section{Ziele dieser Arbeit}

\chapter{Theoretische Grundlagen}

\section{Charakteristische Kennzahlen}


\end{document}

If I comment this part:

\frontmatter{
        \tableofcontents
        \clearpage
        \listoffigures
        \clearpage
        \listoftables
        \clearpage
}

I get back the usual section numbering starting with "Kapitel 1" and so on but obviously without my table of content. Can someone tell me why I get this result and why it disappears when I comment that part?

  • 2
    \frontmatter is a switch-type command, not meant to be used with an argument. Correct that, and then change \pagenumbering{arabic} to \mainmatter (another switch-type command). – Paul Gessler Jan 10 '15 at 21:22
  • @PaulGessler Write an answer, adding that \chapter*{Symbolverzeichnis} should be with \chapter so it will go in the table of contents. – egreg Jan 10 '15 at 21:24
4

\frontmatter is a switch-type command that applies to everything after it. It doesn't take an argument. So in your code, the entire document is being treated as "front matter".

At the beginning of the document, "switch" to \frontmatter, then after the front matter, "switch" to \mainmatter, which takes care of the page numbering on its own.

A few other notes:

  • Chapters are unnumbered when \frontmatter is in effect, so you can use \chapter{Symbolverzeichnis} and it will appear in the ToC but without a number.
  • \tableofcontents and friends are chapter-level sectioning elements, so they each include their own \clearpage and your \clearpages are unnecessary.

Here's the corrected code:

\documentclass{book}

\usepackage[english,ngerman]{babel}

\usepackage[T1]{fontenc}
\usepackage[unicode=true]{hyperref}

\begin{document}

\frontmatter % switch to front matter

\tableofcontents
\listoffigures
\listoftables

\chapter{Symbolverzeichnis}

\mainmatter % switch to main matter

\chapter{Einleitung}

\section{Motivation}

\section{Ziele dieser Arbeit}

\chapter{Theoretische Grundlagen}

\section{Charakteristische Kennzahlen}

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.