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}
Here two pages: the "Vorwort" (wrong page number): with the table of content: and the the table of content: The two chapters are correctly 'page-numbered'.
What am I doing wrong?