Change the font size in LaTeX (large, small, 12pt)
The base size of a document is a class option: \documentclass[12pt]{article}. Inside the text, ten commands from \tiny to \Huge change the size relative to it, and \fontsize{14pt}{17pt}\selectfont sets an exact size.
Base size of the document
The standard classes article, report and book accept 10pt (the default), 11pt and 12pt. Headings, footnotes and all size commands scale with this value.
Complete document:
\documentclass[12pt]{article}
\begin{document}
This document uses 12 pt as its base size.
\end{document}The ten size commands
A size command changes all text up to the end of the group, so put it in braces together with the text. With a base size of 10 pt the commands give 5, 7, 8, 9, 10, 12, 14.4, 17.28, 20.74 and 24.88 pt.
{\tiny tiny} {\scriptsize scriptsize} {\footnotesize footnotesize}
{\small small} {\normalsize normalsize} {\large large} {\Large Large}
{\LARGE LARGE} {\huge huge} {\Huge Huge}A whole paragraph in another size
LaTeX fixes the line spacing of a paragraph at the moment the paragraph ends. End it with \par or an empty line before the closing brace; otherwise the small text keeps the line spacing of the normal size.
{\small
This whole paragraph is set in the small size. Its lines are closer
together than those of the normal text, because the paragraph ends
inside the group.
\par}An exact size
The first argument of \fontsize is the font size, the second the distance between two baselines, usually about 1.2 times the size. \selectfont puts the change into effect.
{\fontsize{14pt}{17pt}\selectfont Text in 14 pt.}Other base sizes
The extsizes classes extarticle, extreport and extbook also accept 8pt, 9pt, 14pt, 17pt and 20pt. The KOMA-Script classes take any value: \documentclass[fontsize=13pt]{scrartcl}.
Complete document:
\documentclass[14pt]{extarticle}
\begin{document}
This document uses 14 pt as its base size.
\end{document}Pitfalls
\documentclass[14pt]{article}does not change the size. The standard classes do not know the option, and the log shows "Unused global option(s): [14pt]".- The default Computer Modern fonts exist only in fixed sizes. A size in between, such as 13 pt, produces the warning "Font shape ... in size <13> not available" and LaTeX takes the nearest size. Load
lmodernorfix-cmto get every size.
Compiled with pdfLaTeX from TeX Live 2023.
Related pages
- Package
lmodern - How-to Change the font in LaTeX
- How-to Bold, italic and underlined text in LaTeX
- How-to Line spacing in LaTeX
- Error Font shape `OT1/cmr/bx/sc' undefined