Text FormattingHow to start writing a book

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
gooly
Posts: 3
Joined: Wed Jul 06, 2022 2:33 pm

How to start writing a book

Post by gooly »

Hi,
I want to write a book (with the TeXStudio), and after some searches today I end up with this:

Code: Select all

\documentclass[ngerman,12pt,a5paper]{book}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{thmtools}
\usepackage{xcolor}
\usepackage{nameref}
\usepackage{babel}
\usepackage{hyperref}

%\documentclass[titlepage]{book}
%\usepackage{makeidx}\makeindex

\title{Titel}
\author{Autor}
\date{2025}

\includeonly{%
	% frontcover,
	preface,
	chap1,
	% appenA,
}
\begin{document}
	\maketitle
	\tableofcontents %\newpage
	\chapter*{Vorwort}
	\addcontentsline{toc}{chapter}{\protect\numberline{}Vorwort}
	\chapter*{Einführung}
	\addcontentsline{toc}{chapter}{\protect\numberline{}Einführung}
	\chapter*{Chapter 1}
	\addcontentsline{toc}{chapter}{\protect\numberline{}Chapter 1}
	\chapter*{Chapter 2}
	\addcontentsline{toc}{chapter}{\protect\numberline{}Chapter 2}
	
\end{document}
But the created V"view" of this 'book' has a table of content with wrong page numbers (I guess), the left pages are headlined with "Inhaltsverzeichnis" (German of "table of content") even in the various chapters ...

Here two pages: the "Vorwort" (wrong page number): with the table of content:
2024_1pref.png
2024_1pref.png (5.38 KiB) Viewed 13779 times
and the the table of content:
tab.png
tab.png (6.29 KiB) Viewed 13779 times
The two chapters are correctly 'page-numbered'.

What am I doing wrong?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

Post Reply