To write a book or dissertation in LaTeX, it is recommended that you change your document class to
. By using the article class book
, you can add chapters to your document. book
\documentclass{book}
Another document class that may be useful in writing longer documents with chapters is the report
class.
The ideal way to add chapters to your LaTeX document while writing a book is by creating a separate file for each chapter. These individual chapter files do not need a preamble. All you need to add at the beginning of each chapter file is the name of the chapter using the \chapter{..}
command.
\chapter{Introduction}
This is my first Chapter.
Using the \input{..}
command in your root document (titled main.tex
by default), you can add in your chapters.
\begin{document} \maketitle \input{Chapter1} \input{Chapter2} \input{Chapter3} \end{document}
You can further add a table of contents to your document using the \tableofcontents
command. This command automatically uses the information entered for each chapter to generate a table of contents for your document.
\begin{document} \maketitle \tableofcontents \input{Chapter1} \input{Chapter2} \input{Chapter3} \end{document}
Other useful sections to add to your book or dissertation could be a list of tables or figures.