# TexLive Documents **Document class** is the first line in every LaTeX file and sets the document type. The three standard classes are `article` (for papers and short documents), `book` (for long documents with chapters), and `report` (for reports and theses). Each class defines default margins, font sizes, section hierarchy, and spacing. ```latex \documentclass{article} \title{My Paper} \author{Author Name} \date{2026-08-19} \begin{document} \maketitle \section{Introduction} Content here. \end{document} ``` `\maketitle` generates a title page with title, author, and date. Omit `\date{...}` to use today's date; use `\date{}` to omit the date entirely. **Document options** modify class behavior. Pass them in square brackets: `\documentclass[12pt, twoside]{book}`. Common options: `11pt` or `12pt` (font size, default 10pt), `twoside` (left/right margins differ for binding), `twocolumn` (two-column layout), `landscape` (rotate to landscape). `article` defaults to single-sided; `book` defaults to two-sided. **Book documents** use chapters: `\chapter{Chapter Title}` (level 1), `\section{Section}` (level 2), `\subsection{Subsection}` (level 3). Articles use `\section`, `\subsection`, `\subsubsection` (no chapters). Reports are similar to articles. **Front matter** in books uses `\frontmatter`, `\mainmatter`, `\backmatter` to set page numbering and numbering reset: ```latex \documentclass{book} \begin{document} \frontmatter % i, ii, iii, iv (Roman numerals) \chapter{Preface} \mainmatter % 1, 2, 3, ... (Arabic numerals, chapter 1 = page 1) \chapter{Introduction} \backmatter % continues numbering, no chapter numbers \chapter{Appendix} \end{document} ``` Without `\frontmatter` and `\mainmatter`, all pages use the same numbering scheme. **Abstract** in articles: use the `abstract` environment: ```latex \begin{abstract} Summary of paper. \end{abstract} ``` This generates a centered, indented block. Books don't have a standard abstract command; create one manually or use a custom environment. **Table of contents** is generated automatically from section headings: ```latex \tableofcontents ``` This must be compiled twice to resolve references (first pass generates `.toc` file, second pass reads it). The TOC appears where you place this command—usually after `\maketitle` but before the first section. Starred versions like `\section*{Unnumbered}` create sections that don't appear in the TOC and aren't numbered.