The three most commonly used standard document-classes in LaTeX include: article
, report
and book
. A number of global options allows customization of certain elements of the document by the author. Different document-classes might have different default settings. The following post illustrates available options with figures, provides alternatives and highlights the default option for each document-class.
To change the default behavior, the option is provided as an optional parameter to the documentclass
command.
\documentclass[option1, option2, etc.]{article}
Font size
LaTeX knows three standard font sizes:
10pt (default)
11pt
12pt
Other global and local font sizes are available through various packages.
The following example sets the global document font size to 12pt. The picture below compares the three LaTeX standard font sizes.
\documentclass[12pt]{article} \usepackage{blindtext} \begin{document} \blindtext \end{document}
Paper size and format
Different regions of the world use different standard physical paper sizes. Available are:
a4paper (default)
letterpaper (default in some distributions)
a5paper
b5paper
executivepaper
legalpaper
The following example compares (from left to right): legal, A4, Letter and A5.
\documentclass[a4paper]{article} \usepackage{showframe} \begin{document} \begin{center}{\Huge A4 paper}\end{center} \end{document}
The geometry package provides similar options and additional flexibility for paper size and margins.
Draft mode
Setting the draft
option will speed up typesetting, because figures are not loaded, just indicated by a frame. LaTeX will also display hyphenation (Overfull hbox warning) and justification problems with a small black square. Delete the draft
option or replace it with final
in the final document version.
Multiple columns
onecolumn (default)
twocolumn
By default, text is typeset in a single column (onecolumn
). LaTeX provides an easy way to switch to two columns through the document-class option twocolumn
.
The multicol package allows creating more than two columns globally as well as locally.
Formula-specific options
fleqn
: left-alignment of formulasleqno
: labels formulas on the left-hand side instead of right
These are two independent options manipulating the alignment and label position of formulas.
The top figure illustrates the default case with neither option set. The bottom figure shows how formulas are typeset when both options, fleqn
and leqno
, are set.
Landscape print mode
The landscape
option changes the page layout to landscape mode. This, however, does not change the page margins accordingly (first page in figure), which is why for landscape documents with landscape content the pdflscape or geometry packages (second page in figure and code) are more suitable.
\documentclass[a4paper]{article} \usepackage{blindtext, showframe} \usepackage[landscape]{geometry} \begin{document} \blindtext \end{document}
Single- and double-sided documents
oneside (default for article and report)
twoside (default for book)
In single-sided documents (oneside
), the left and right margins are symmetric and headers are exactly the same on every page. In other words, the document does not distinguish between inner and outer margin. Twoside, on the other hand, generates double-sided content. The outer margin (even page: left; odd page: right) is wider by default (see figure below). It might appear that the header “switches” sides, but that because they are placed with respect to the margins. The twoside
option is usually set for bound texts such as theses or books.
\documentclass[twoside]{report} \usepackage{blindtext, showframe, fancyhdr} \pagestyle{fancy} \begin{document} \chapter{First chapter} \section{First section} \blindtext \clearpage \Blindtext \end{document}
Titlepage behavior
notitlepage (default for article)
titlepage (default for report and book)
The option titlepage
ends the page after \maketitle
and restarts on the next page. In article
, the content starts right after \maketitle
. The titlepage
option is quivalent to:
\maketitle \clearpage
The example below illustrates the default behavior of article
.
\documentclass{article} \usepackage{blindtext} \title{This is an article} \begin{document} \maketitle \begin{abstract} \blindtext \end{abstract} \end{document}
Chapter opening page
openany (default for report)
openright (default for book)
Finally, the option openright
always starts a chapter on the right (odd pages), leaving one page blank in case the last paragraph of the previous chapter ended on an odd page. It only works and makes sense with the twoside
option set. The openany
option starts the chapter on the next page (even or odd).
The openany
, openright
options are not available in article
as it does not support \chapter
!
\documentclass[twoside, openright]{report} \usepackage{blindtext} \begin{document} \chapter{First chapter} \blindtext \chapter{Second chapter} \blindtext \end{document}