LaTeX Document Classes: article, report, book and Options

Quick answer

  • Syntax: \documentclass[options]{class}, the first line of every document.
  • Which class: article for papers (no chapters), report for theses (chapters), book for books (chapters, two-sided), beamer for slides.
  • Common options: 12pt, a4paper, twoside, twocolumn, draft, landscape, titlepage.
  • oneside vs twoside: twoside mirrors the margins and headers of left and right pages for double-sided printing.
  • Alternatives: KOMA-Script (scrartcl, scrreprt, scrbook) and memoir.
\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

ClassUse for\chapterTitleSides by default
articlePapers, assignments, short reportsNoAbove the textoneside
reportTheses, long reportsYesOwn pageoneside
bookBooksYes, open on right pagesOwn pagetwoside
letterLettersNo—oneside
beamerSlidesNoTitle frame—
scrartcl / scrreprt / scrbookKOMA-Script versions of the threeAs aboveConfigurableAs above
memoirBooks and reports with many built-in featuresYesConfigurabletwoside
standaloneA single figure or formula cropped to its contentNo——

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:

OptionEffectDefault
10pt, 11pt, 12ptBase font size10pt
letterpaper, a4paper, a5paper, b5paper, legalpaper, executivepaperPaper sizeletterpaper
oneside, twosideOne- or two-sided layoutoneside (book: twoside)
onecolumn, twocolumnText in one or two columnsonecolumn
titlepage, notitlepageTitle and abstract on a page of their own or notnotitlepage (report, book: titlepage)
openright, openanyChapters start on a right-hand page or on the next pagebook: openright; report: openany
draft, finaldraft marks overfull lines with a black bar; graphicx shows images as boxesfinal
landscapeSwaps paper width and heightportrait
leqno, fleqnEquation numbers on the left; equations aligned leftright, 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:

onesidetwoside
MarginsSame on every pageInner margin narrower, outer wider, mirrored on odd and even pages
Running headers (\pagestyle{headings})Same on every pageLeft pages: chapter; right pages: section (article: section and subsection)
Page numbersSame positionCan go on the outer edge
\cleardoublepageSame as \clearpageContinues on the next odd page, inserting a blank page if needed
Use forReading on screen, single-sided printingPrinted 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 symptomCauseFix
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 \chapterarticle has no chaptersSwitch to report, book or scrreprt, or use \section
LaTeX Error: File `artcle.cls' not foundMisspelled class or a custom class file missing from the projectFix the name, or upload the .cls file next to the main file
LaTeX Error: Environment abstract undefinedThe book class has no abstract environmentUse report, or a starred \chapter*{Abstract}
LaTeX Error: Two \documentclass or \documentstyle commandsA second \documentclass, often from an \input'ed fileRemove the preamble from included files
Blank pages before chaptersopenright with twoside (book default)Add openany, or use oneside
Margins alternate from page to pagetwoside mirrors odd and even pagesExpected for print; use oneside for on-screen reading
Class-option font size larger than 12pt has no effectStandard classes only define 10pt, 11pt, 12ptextarticle, 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

Free LaTeX Tools

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 →