Icon for parent category 'Writing'

Document Classes

Document classes aren’t something to “understand”. You just need to know what’s out there and what options you have. Setting the right document class before creating the rest of the document is crucial. Some commands will be available, others won’t be. Choosing the wrong one means you’re fighting Latex to make it look like you want, instead of allowing it to take care of the important stuff for you.

For this, I provide several nice tables.

Class Names

1\documentclass{article}
NameDescription
articleFor articles, such as presentations, short reports, scientific journals.
procFor proceedings based on the article class
minimalOnly sets a page size and a base font—as small as it gets. Mainly used for debugging purposes
reportFor long reports containing several chapters, small books, PhD theses, etcetera.
bookFor actual books
slidesFor slides. Uses big sans-serif letters.
beamerFor writing presentations
memoirBased on the book class, but you can create any kind of document with it.
letterFor letters

Class Options

1\documentclass[10pt, twoside, leqno]{article}
OptionsDescription
10pt, 11pt, 12ptSets the size of the main font in the document. If not specified, 10pt is assumed.
a4paper, letterpaper, …Defines the paper size. Used to be letterpaper, but now a4paper is default almost everywhere.

Other options are a5paper, b5paper, executivepaper and legalpaper
fleqnTypesets formulas left-aligned, instead of centred
leqnoPlaces numbering of formulas on the left hand side, instead of the right
titlepage, notitlepageSpecifies whether a new page should be started after the document title or not. The article class doesn’t do this by default, while the report and book class do.
twocolumnTypesets the document in two columns instead of one
twoside, onesideSpecifies whether double or single sided output should be compiled. The article and report classes are single sided, while the book class is double sided by default.

Keep in mind: you still need to tell the printer you’re using to make a two-sided printout.
landscapeChanges the layout to landscape (horizontal) mode
openright, openanyMakes chapters begin either only on right hand pages, or on the next page available. The book class starts on the right by default, while the report class doesn’t. The article class doesn’t know chapters and can’t use this.
draftMakes LaTeX indicate hyphenation and justification problems by adding a small square in the right-hand margin of the problem line. Also suppresses inclusion of images and shows only a frame.

Page Styles

Every document class supports three predefined header/footer combinations called page styles. To set one for the entire document, use

1\pagestyle{style}

The styles to choose from are

OptionDescription
plainPrints the page numbers on the bottom of the page, centred within the footer. This is default.
headingsPrints current chapter heading and page number in the header on each page. The footer remains empty.
emptyFooter and header are empty.

To change the style for one specific page, use \thispagestyle{style} while on that page.

1\documentclass{article}
2
3\pagestyle{headings}
4
5\begin{document}
6\section{First Section} Lorem ipsum...
7\end{document} 
Code left > output right
Code left > output right
Continue with this course
Support me and this website!

Want to support me?

Buy one of my projects. You get something nice, I get something nice.

Donate through a popular platform using the link below.

Simply giving feedback or spreading the word is also worth a lot.