Chapter 11 – Developing Large Documents

Splitting the input

Preamble file:

% !TEX none
\usepackage{lmodern} 
\usepackage{microtype} 
\usepackage{natbib} 
\usepackage{tocbibind} 
\usepackage{amsmath} 
\usepackage{amsthm} 
\newtheorem{thm}{Theorem}[chapter] 
\newtheorem{lem}[thm]{Lemma} 
\theoremstyle{definition} 
\newtheorem{dfn}[thm]{Definition}

Chapter 1:

% !TEX none
\chapter{Equations}
\section{Quadratic equations}
\begin{dfn}
  A quadratic equation is an equation of the form
  \begin{equation}
    \label{quad}
    ax^2 + bx + c = 0
  \end{equation}
  where \( a, b \) and \( c \) are constants and \( a \neq 0 \).
\end{dfn}

Chapter 2:

% !TEX none
\chapter{Equation Systems}
\section{Linear Systems}
...
\section{Non-linear Systems}
...

Main document:

\documentclass{book}
\input{preamble}
\begin{document}
\tableofcontents
\include{chapter1}
\include{chapter2}
\end{document}

Creating front and back matter

Dedication file:

\chapter{Dedication}
This book is dedicated to one of the greatest mathematicians of
all time: Carl Friedrich Gauss. Without him, this book wouldn't
have been possible.

Proofs file:

% !TEX none
\chapter{Proofs}
...

Main document:

% !TEX bibtex document
\documentclass{book}
\input{preamble}
\input{example}% only here on the website to create the example.bib file
\begin{document}
\frontmatter
\include{dedication}
\tableofcontents
\listoftables
\listoffigures
\mainmatter
\include{chapter1}
\include{chapter2}
\backmatter
\include{proofs}
\nocite{*}
\bibliographystyle{plainnat}
\bibliography{example}
\end{document}

Designing a title page

Title file:

% !TEX none
\begin{titlepage}
  \raggedleft
  {\Large The Author\\[1in]}
  {\large The Big Book of\\}
  {\Huge\scshape Equations\\[.2in]}
  {\large Packed with hundreds of examples and solutions\\}
  \vfill
  {\itshape 2011, Publishing company}
\end{titlepage}

Main document:

% !TEX bibtex document
\documentclass{book}
\usepackage[a5paper]{geometry}% could go to the preamble instead
\input{preamble}
\input{example}% only here on the website to create the example.bib file
\begin{document}
\frontmatter
\include{title}
\include{dedication}
\tableofcontents
\listoftables
\listoffigures
\mainmatter
\include{chapter1}
\include{chapter2}
\backmatter
\include{proofs}
\nocite{*}
\bibliographystyle{plainnat}
\bibliography{example}
\end{document}

Working with templates

\documentclass[fontsize=12pt, paper=a4]{scrlttr2}
\usepackage[utf8]{inputenc}
\setkomavar{fromname}{My name} % your name
\setkomavar{fromaddress}{Street, City}
\setkomavar{signature}{Name} % printed after the \closing
\setkomavar{subject}{Invoice 1/2021} % subject of the letter
\setkomavar{place}{Place}
\setkomavar{date}{January 1, 2021 }
\begin{document}
\begin{letter}{Customer Name\\ Street No. X \\ City \\ Zipcode}
  \opening{To whom it may concern} % eg. Hello
  Text follows \ldots
  \bigskip
  \closing{With kind regards} %eg. Regards
\end{letter}
\end{document}

Working with dummy text / blind text

\documentclass{article}
\usepackage[english]{babel}
\usepackage{blindtext}
\begin{document}
\begin{abstract}
\blindtext
\end{abstract}
\Blinddocument
\end{document}