Written and maintained by CASRAI Editorial Board
Published · Last updated
On this page
Short answer: the default font in LaTeX is Computer Modern. The main body text uses the roman family cmr, the sans-serif family is cmss and the typewriter family is cmtt. The body font is whatever \rmdefault names, so changing that one macro (or loading a font package) changes the whole document. This guide is for researchers and thesis writers who need to know what LaTeX uses out of the box, where that choice is defined, and how to replace it under pdfLaTeX, XeLaTeX or LuaLaTeX.
What the default font in LaTeX is used for in research writing
Journals, funders and universities often specify a typeface for manuscripts and theses, and most LaTeX templates inherit the default unless the class or a package overrides it. Knowing the default lets you tell whether a font you see in a PDF comes from your own preamble, from a template, or from LaTeX itself.
Per Overleaf’s Font typefaces article (read 2026-11-08), LaTeX typesets documents with the Computer Modern typeface family by default. The same default is why the question appears under several wordings, including latex font default, latex default font and default latex font: they all point to the same set of macros described below.
Where the default is defined
The LaTeX Project’s LaTeX2e font selection guide (fntguide.pdf, read 2026-11-08) defines the defaults through a small set of macros. The table below restates what that guide says.
| Role | Macro that names the default family | Default family | How to override |
|---|---|---|---|
Roman (main text, \textrm, \rmfamily) |
\rmdefault |
Computer Modern Roman (cmr) |
\renewcommand{\rmdefault}{ptm} |
| Sans serif | \sfdefault |
Computer Modern Sans (cmss) |
\renewcommand{\sfdefault}{phv} |
| Typewriter | \ttdefault |
Computer Modern Typewriter (cmtt) |
\renewcommand{\ttdefault}{pcr} |
| Main body font family | \familydefault |
\rmdefault |
Change \rmdefault, or redefine \familydefault |
The guide also states that \encodingdefault, \familydefault, \seriesdefault and \shapedefault set the encoding, family, series and shape of the main body font, and that by default these are OT1, \rmdefault, m and n. Because the default family is \rmdefault, changing \rmdefault changes the main body font. The Computer Modern roman family for the OT1 encoding is described in the font definition file ot1cmr.fd.
The guide’s own example, \renewcommand{\rmdefault}{ptm}, \renewcommand{\sfdefault}{phv} and \renewcommand{\ttdefault}{pcr}, sets Times, Helvetica and Courier as the three defaults. Font packages such as times do this kind of substitution for you by loading other fonts.
How to install or access it
Computer Modern needs no installation: it is the default. Alternatives come from your TeX distribution or from Overleaf, which provides the packages used in its own examples. Package documentation is hosted on CTAN, the Comprehensive TeX Archive Network. For the XeLaTeX and LuaLaTeX route, the fontspec manual is on CTAN at mirrors.ctan.org/macros/unicodetex/latex/fontspec/fontspec.pdf (read 2026-11-08).
Step-by-step: change the default font
Option A: pdfLaTeX with a font package
- Compile with pdfLaTeX (see How to Compile LaTeX if you are unsure which engine your editor uses).
- In the preamble, load
fontencbefore the font package:\usepackage[T1]{fontenc}. Overleaf’s examples load fontenc first. - Load a font package. Overleaf shows
\usepackage{tgbonum}for TeX Gyre Bonum, and thelmodernpackage for the Latin Modern faces (lmrLatin Modern Roman,lmssLatin Modern Sans). - Recompile and check the PDF.
Option B: pdfLaTeX by redefining the default macros
- In the preamble, redefine one or more of the defaults using the pattern from the font selection guide:
\renewcommand{\rmdefault}{ptm} \renewcommand{\sfdefault}{phv} \renewcommand{\ttdefault}{pcr} - Because
\familydefaultis\rmdefaultby default, the body text changes with\rmdefault. To make the sans-serif family the body font instead, redefine\familydefaultto\sfdefault(an application of the macro roles above, not a separate rule from the guide).
Option C: XeLaTeX or LuaLaTeX with fontspec
- Compile with XeLaTeX or LuaLaTeX.
- Load
\usepackage{fontspec}. - Set the fonts with
\setmainfont,\setsansfontand\setmonofont. The fontspec manual’s example is\setmainfont{texgyrebonum-regular.otf}followed by\setsansfont{lmsans10-regular.otf}[Scale=MatchLowercase]. Fonts can be loaded by name or by filename.
Output and how to read it
After recompiling, the body text in the PDF should reflect the new roman family; sans-serif and monospaced text (\textsf, \texttt) follow \sfdefault and \ttdefault. If nothing changed, the default is still in effect: Computer Modern with the OT1 encoding.
Troubleshooting
- Only the body font changed, or only the headings changed. The roles are separate:
\rmdefault,\sfdefaultand\ttdefaulteach control one family, and the body uses whichever the\familydefaultpoints to. - The font package seems to do nothing. Load
fontencbefore the font package, as in Overleaf’s examples. - XeLaTeX or LuaLaTeX pauses on the first run. The fontspec manual notes that with LuaTeX, name-based font loading may need
luaotfload-tool, and a first run can pause for several minutes while the font database builds.
Free alternatives to Computer Modern
| Option | Engine | How it is loaded | Source |
|---|---|---|---|
Latin Modern (lmr, lmss) |
pdfLaTeX | \usepackage[T1]{fontenc} and \usepackage{lmodern} |
Overleaf, Font typefaces |
| TeX Gyre Bonum | pdfLaTeX | \usepackage[T1]{fontenc} and \usepackage{tgbonum} |
Overleaf, Font typefaces |
| Times, Helvetica, Courier | pdfLaTeX | \renewcommand of \rmdefault, \sfdefault, \ttdefault to ptm, phv, pcr |
LaTeX2e font selection guide |
| Fonts installed on your system, or OpenType files | XeLaTeX, LuaLaTeX | fontspec with \setmainfont, \setsansfont, \setmonofont |
fontspec manual (CTAN) |
For a presentation class, the Beamer font settings are separate; see LaTeX Beamer font. For heading and caption sizes rather than typefaces, see Overleaf font sizes.
FAQ
What is the default font in LaTeX?
Computer Modern. Roman text uses cmr, sans serif uses cmss and typewriter text uses cmtt, with the OT1 encoding by default (LaTeX2e font selection guide; Overleaf, read 2026-11-08).
What is the latex font default for the body text?
The body font is \familydefault, which is \rmdefault unless you change it, so the body text is Computer Modern Roman by default.
How do I change the default LaTeX font?
Under pdfLaTeX, load a font package after fontenc or redefine \rmdefault, \sfdefault and \ttdefault. Under XeLaTeX or LuaLaTeX, use fontspec and \setmainfont.
Is the default latex font the same as Latin Modern?
No. Latin Modern is a separate set of faces, loaded with the lmodern package. The default under pdfLaTeX is Computer Modern with OT1 encoding.
Sources
- LaTeX Project, LaTeX2e font selection (fntguide.pdf), read 2026-11-08.
- Overleaf, Font typefaces, read 2026-11-08.
- CTAN, fontspec manual, read 2026-11-08.







