LaTeX Library

All examples

Books

Book and Long Report

Chapters, front matter, table of contents, and a consistent long-document structure.

Engine
pdfLaTeX
Level
Intermediate
Explore the source
Book and Long Report compiled PDF preview
Compiled PDF preview

Use this example

  1. Create a project and copy the source below into main.tex.
  2. Select pdfLaTeX as the LaTeX engine.
  3. Compile, review the PDF, and adapt the content.
Open My projects

LaTeX source

main.tex
\documentclass[11pt,openany]{book}
\usepackage[a4paper,margin=3cm]{geometry}
\title{A Short Book}
\author{LatexDesk Example}
\date{\today}
\begin{document}
\frontmatter
\maketitle
\chapter*{Preface}
This original example introduces front matter, chapters, and appendices.
\tableofcontents
\mainmatter
\chapter{Beginning}
Books divide long ideas into chapters, sections, and subsections.
\section{A clear structure}
Each chapter can later move into a separate file with \verb|\input|.
\chapter{Development}
Consistent headings and page numbering are handled automatically.
\appendix
\chapter{Supporting Material}
Appendices keep detailed material outside the main narrative.
\backmatter
\chapter*{About this example}
Created for the LatexDesk learning library.
\end{document}