LaTeX Document Classes: article, report, book and Options
Quick answer
- Syntax:
\documentclass[options]{class}, the first line of every document. - Which class:
articlefor papers (no chapters),reportfor theses (chapters),bookfor books (chapters, two-sided),beamerfor slides. - Common options:
12pt,a4paper,twoside,twocolumn,draft,landscape,titlepage. - oneside vs twoside:
twosidemirrors the margins and headers of left and right pages for double-sided printing. - Alternatives: KOMA-Script (
scrartcl,scrreprt,scrbook) andmemoir.
\documentclass[12pt, a4paper, twoside]{report}
\begin{document}
\chapter{Introduction} % report and book have chapters
\section{Background}
Text of the first section.
\end{document}The document class is the first decision in every LaTeX file. It sets which structure is available (chapters or not), how the title is laid out, the default font size, paper size and margins, and whether the document is set for one-sided or two-sided printing. This guide compares the standard classes article, report and book, explains each class option including twoside, introduces KOMA-Script and memoir, and fixes the errors that come from choosing the wrong class or option.
LaTeX Document Classes Compared
| Class | Use for | \chapter | Title | Sides by default |
|---|---|---|---|---|
article | Papers, assignments, short reports | No | Above the text | oneside |
report | Theses, long reports | Yes | Own page | oneside |
book | Books | Yes, open on right pages | Own page | twoside |
letter | Letters | No | — | oneside |
beamer | Slides | No | Title frame | — |
scrartcl / scrreprt / scrbook | KOMA-Script versions of the three | As above | Configurable | As above |
memoir | Books and reports with many built-in features | Yes | Configurable | twoside |
standalone | A single figure or formula cropped to its content | No | — | — |
The sectioning commands below chapter are the same in every class: \section, \subsection, \subsubsection, \paragraph and \subparagraph (see sections). book also has \frontmatter, \mainmatter and \backmatter, which switch page numbering from roman to arabic and turn chapter numbers off and on. Slides with beamer have their own Beamer guide.
\documentclass{book}
\begin{document}
\frontmatter % roman page numbers, unnumbered chapters
\tableofcontents
\chapter{Preface}
Why this book exists.
\mainmatter % arabic page numbers, numbered chapters
\chapter{Getting Started}
\section{Installation}
First steps.
\backmatter
\chapter{Glossary}
Terms used in the book.
\end{document}Document Class Options
Options go in square brackets, separated by commas, in any order. They apply to the class and to every package that understands them, so a4paper in the class also reaches geometry. The standard classes accept:
| Option | Effect | Default |
|---|---|---|
10pt, 11pt, 12pt | Base font size | 10pt |
letterpaper, a4paper, a5paper, b5paper, legalpaper, executivepaper | Paper size | letterpaper |
oneside, twoside | One- or two-sided layout | oneside (book: twoside) |
onecolumn, twocolumn | Text in one or two columns | onecolumn |
titlepage, notitlepage | Title and abstract on a page of their own or not | notitlepage (report, book: titlepage) |
openright, openany | Chapters start on a right-hand page or on the next page | book: openright; report: openany |
draft, final | draft marks overfull lines with a black bar; graphicx shows images as boxes | final |
landscape | Swaps paper width and height | portrait |
leqno, fleqn | Equation numbers on the left; equations aligned left | right, centered |
\documentclass[11pt, a4paper, twocolumn, draft]{article}
\usepackage{graphicx}
\usepackage{lipsum}
\title{A Two-Column Paper}
\author{Ada Lovelace}
\begin{document}
\maketitle
\section{Introduction}
\lipsum[1]
\includegraphics[width=\linewidth]{example-image} % a box in draft mode
\lipsum[2]
\end{document}The class sets only three font sizes and a handful of paper sizes. For 14pt and larger, use extarticle or KOMA-Script (see font size); for exact margins, load geometry (see page size and margins). The landscape option only swaps the dimensions LaTeX uses; load geometry as well so the PDF pages themselves are turned.
oneside vs twoside in LaTeX
With twoside, LaTeX treats the document as printed on both sides of the paper and bound. Right-hand pages are odd and left-hand pages even, and the two are laid out as mirror images:
oneside | twoside | |
|---|---|---|
| Margins | Same on every page | Inner margin narrower, outer wider, mirrored on odd and even pages |
Running headers (\pagestyle{headings}) | Same on every page | Left pages: chapter; right pages: section (article: section and subsection) |
| Page numbers | Same position | Can go on the outer edge |
\cleardoublepage | Same as \clearpage | Continues on the next odd page, inserting a blank page if needed |
| Use for | Reading on screen, single-sided printing | Printed and bound theses and books |
Headers and footers for twoside layouts are easiest with fancyhdr, where E and O select even and odd pages:
\documentclass[12pt, a4paper, twoside]{report}
\usepackage[inner=3cm, outer=2cm]{geometry} % binding margin on the inside
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[LE]{\leftmark} % even pages: chapter, left
\fancyhead[RO]{\rightmark} % odd pages: section, right
\fancyfoot[LE,RO]{\thepage} % page number on the outer edge
\begin{document}
\chapter{Introduction}
\section{Motivation}
Text on page 1, a right-hand page.
\newpage
Text on page 2, a left-hand page.
\end{document}Two side effects surprise people. A twoside PDF viewed on screen seems to shift the text left and right from page to page; that is the mirrored margins, and correct for print. And with openright (the book default), a chapter that would start on a left page is pushed to the next right page, leaving a blank page before it. Add openany to avoid that, or use oneside for the PDF you submit online. Page number styles are covered in page numbering.
KOMA-Script and memoir
KOMA-Script replaces the standard classes one-for-one: scrartcl for article, scrreprt for report and scrbook for book. Its options take values, it calculates balanced margins from the paper and font size, and it uses a sans-serif font for headings by default.
\documentclass[fontsize=11pt, paper=a4, parskip=half, DIV=12]{scrartcl}
% parskip=half: space between paragraphs instead of indents
% DIV=12: a larger text area (smaller margins)
\begin{document}
\section{Introduction}
A KOMA-Script article with half-line paragraph spacing.
A second paragraph, separated by space.
\end{document}memoir is a single class for books and reports that includes the functions of many packages (headers, chapter styles, captions, page layout). It accepts the standard options plus sizes from 9pt to 60pt.
\documentclass[11pt, a4paper, twoside, openany]{memoir}
\chapterstyle{bianchi}
\setlrmarginsandblock{3cm}{2.5cm}{*}
\checkandfixthelayout
\begin{document}
\chapter{Getting Started}
memoir has built-in chapter styles and layout commands.
\end{document}If a journal, conference or university gives you a class file (IEEEtran, acmart, elsarticle, a thesis class), use it instead: the layout is fixed by the publisher.
Common Errors and Fixes
| Message or symptom | Cause | Fix |
|---|---|---|
| LaTeX Warning: Unused global option(s): [a4] | An option no class or package recognizes: a typo (a4, 12ptt) or an unsupported value (14pt in article) | Use the exact name (a4paper, 12pt), or a class that supports it (extarticle) |
Undefined control sequence at \chapter | article has no chapters | Switch to report, book or scrreprt, or use \section |
| LaTeX Error: File `artcle.cls' not found | Misspelled class or a custom class file missing from the project | Fix the name, or upload the .cls file next to the main file |
| LaTeX Error: Environment abstract undefined | The book class has no abstract environment | Use report, or a starred \chapter*{Abstract} |
| LaTeX Error: Two \documentclass or \documentstyle commands | A second \documentclass, often from an \input'ed file | Remove the preamble from included files |
| Blank pages before chapters | openright with twoside (book default) | Add openany, or use oneside |
| Margins alternate from page to page | twoside mirrors odd and even pages | Expected for print; use oneside for on-screen reading |
| Class-option font size larger than 12pt has no effect | Standard classes only define 10pt, 11pt, 12pt | extarticle, KOMA fontsize=14pt, or memoir |
Moving a document from article to report is a one-word change:
% Before: \documentclass[12pt]{article} with \chapter gives
% "Undefined control sequence"
\documentclass[12pt, a4paper]{report}
\begin{document}
\chapter{Results} % now defined
\section{Accuracy}
All section commands work as before.
\end{document}Frequently Asked Questions
What is the difference between article, report and book in LaTeX?
article has no chapters and puts the title above the text; it suits papers and short documents. report adds \chapter and a separate title page, for theses and longer reports. book adds front, main and back matter, is two-sided by default and starts chapters on right-hand pages. All three share the same options and section commands below chapter.
What does twoside do in LaTeX?
twoside lays the document out for double-sided printing: odd (right-hand) and even (left-hand) pages get mirrored margins, a wider outer margin and a narrower inner one, and running headers can differ between left and right pages. It is the default for book; article and report are oneside by default. In a PDF read on screen, twoside makes the text block appear to shift left and right.
How do I set the font size and paper size of a LaTeX document?
Pass them as class options: \documentclass[12pt, a4paper]{article}. The standard classes accept 10pt (default), 11pt and 12pt, and paper sizes letterpaper (default), a4paper, a5paper, b5paper, legalpaper and executivepaper. For other font sizes use extarticle or KOMA-Script; for exact margins use the geometry package.
Why do I get “Unused global option(s)”?
One of the options in \documentclass[...] was not recognized by the class or any package, usually a typo (a4 instead of a4paper) or a value the class does not support (14pt in article). LaTeX ignores it and warns. Fix the spelling or switch to a class that supports the option, such as extarticle for 14pt.
Why is \chapter undefined in my document?
The article class has no chapters. Use \section as the top level, or switch the class to report or book (or scrreprt, scrbook or memoir), which define \chapter. Changing the class is a one-word edit in \documentclass and keeps all other commands working.
Should I use KOMA-Script or memoir instead of the standard classes?
Both are drop-in alternatives with more built-in settings. KOMA-Script (scrartcl, scrreprt, scrbook) is designed with European typography in mind, sets type-area margins automatically and has options such as parskip=half. memoir is a single class for books and reports that bundles the features of dozens of packages. For a journal or university template, use the class it provides.
Next Steps
- Page Size & Margins – The geometry package for exact layouts
- LaTeX Font Size – Class size options and size commands
- Sections – Chapters, sections and numbering
- Page Numbering – Roman and arabic numbers, headers and footers
- Table of Contents – Contents for reports and books
- Learn LaTeX: Tutorial for Beginners – The basics, from the first document up
Free LaTeX Tools
- LaTeX Preview – Compare classes and options with a live PDF preview
- AI LaTeX Generator – Generate LaTeX from text descriptions
- LaTeX Symbols Reference – Browse math operators and special characters
Related Articles
Angle Brackets ⟨ ⟩: Symbol, Copy and Paste, and LaTeX
Compile LaTeX from Claude Code or Cursor with the Octree MCP Server
Diameter Symbol (⌀): Meaning, ⌀ vs Ø, and How to Type It on Windows, Mac, Word, LaTeX
LaTeX on iPad: How to Write and Compile LaTeX on a Tablet
Set up your document class with AI
Octree's AI editor picks the right class for a paper, thesis or book, converts a document between classes, and compiles your document in seconds.
Try Octree Free →