Specify Font Family, Font Shape, and Font Series in LaTeX
Jan. 12, 2025
There are five common properties determining the display effect of a certain font, that is font size, font encoding, font family, font shape, and font series (which usually refers to the font weight and width). Considering that font size is always separately specified1 and font encoding is rarely set directly, the last three ones are used most2. So, the following content shows different values of these three font properties and resulting text.
(1) Font family
- Roman font family:
\rmfamily{}
,\rmfamily
; - Sans serif font family:
\sffamily{}
,\sffamily
; - Typewriter font family:
\ttfamily{}
,\ttfamily
;
(2) Font shape
- Upright shape:
\textup{}
,\upshape
; - Italic shape:
\textit{}
,\itshape
; - Slanted shape:
\textsl{}
,\slshape
; - Small capitals shape:
\textsc{}
,\scshape
;
(3) Font series
- Medium series:
\textmd{}
,\mdseries
; - Bold extended series:
\textbf{}
,\bfseries
;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
\documentclass[a4paper]{article}
\begin{document}
\begin{table}
\caption{Font family}\vspace{1em}
\begin{tabular}{|l|l|l|}
\hline
Roman font family (default) & \rmfamily{Roman font family} & {\rmfamily Roman font family}\\ \hline
Sans serif font family & \sffamily{Sans serif font family} & {\sffamily Sans serif font family}\\ \hline
Typewriter font family & \ttfamily{Typewriter font family} & {\ttfamily Typewriter font family}\\ \hline
\end{tabular}
\end{table}
\begin{table}
\caption{Font shape}\vspace{1em}
\begin{tabular}{|l|l|l|}
\hline
Upright shape (default) & \textup{Upright shape} & {\upshape Upright shape}\\ \hline
Italic shape & \textit{Italic shape} & {\itshape Italic shape}\\ \hline
Slanted shape & \textsl{Slanted shape} & {\slshape Slanted shape}\\ \hline
Small capitals shape & \textsc{Small capitals shape} & {\scshape Small capitals shape}\\ \hline
\end{tabular}
\end{table}
\begin{table}
\caption{Font series}\vspace{1em}
\begin{tabular}{|l|l|l|}
\hline
Medium series (default) & \textmd{Medium series} & {\mdseries Medium series}\\ \hline
Bold extended series & \textbf{Bold extended series} & {\bfseries Bold extended series}\\ \hline
\end{tabular}
\end{table}
\end{document}
References