Introduction
Learn how to customize the font sizes, families, and styles in your documents to create a professional and consistent look. Our comprehensive guides cover everything from choosing the right fonts and adjusting their sizes, to applying bold, italic, and other formatting options. Whether you are creating a simple document or a complex layout, these tips and tricks will help you get the most out of your text.
Font sizes, families, and styles
Latex normally chooses the appropriate font and font size based on the logical structure of the document (e.g. sections). In some cases, you may want to set fonts and sizes by hand so LaTeX provides several commands for formatting text, including font styles and sizes.
Font size
By default, LaTeX uses the following standard font size for different components of a document:
Document Component | Font Size |
---|---|
ordinary text | 12 |
chapter numbering and title | 16 |
section | 14 |
subsection | 13 |
subsubsection | 12 |
If you need different font sizes for regular text, the following commands can be used:
Font Size | Command | Output |
---|---|---|
tiny size | \tiny{LaTeX Document} | |
script size | \scriptsize{LaTeX Document} | |
footnote size | \footnotesize{LaTeX Document} | |
small size | \small{LaTeX Document} | |
normal size | \normalsize{LaTeX Document} | |
large size | \large{LaTeX Document} | |
larger size | \Large{LaTeX Document} | |
largest size | \LARGE{LaTeX Document} | |
huge size | \huge{LaTeX Document} |
Font style
Font styles and effects are usually not applied in technical documents. Anyway, to change the font style, if needed, you can use the following commands:
Font Style | Command | Output |
---|---|---|
italic | \textit{texready} | |
bold | \textbf{texready} | |
underline | \underline{texready} | |
small caps | \textsc{texready} | |
slanted | \textsl{texready} | |
emphasize | \emph{texready} | |
typewriter | \texttt{texready} | |
san serif | \textsf{texready} | |
roman | \textrm{texready} |
if necessary, the font style commands can be embeded into each others, as shown below:
\textit{\textbf{ItalicBoldTexReady}}
\textsc{\underline{SmallcapitalsUnderlineTexReady}}
This example generates the following output:
Font color
By default, LaTeX uses black color for texts. To change the color of specific text, an additional package, \usepackage{color}
, must be added in the preamble.
The font color can be changed using the color command:
\color{color}{text}
The following table shows different color commands:
Font Color | Command | Output |
---|---|---|
blue | {\color{blue}BlueTexReady} | |
green | {\color{green}GreenTexReady} | |
yellow | {\color{yellow}YellowTexReady} | |
red | {\color{red}RedTexReady} |
There are many standard color names available to be used in LaTeX color command, if the color you want is not available you can define it using:
\definecolor{my_violet}{rgb}{127,0,255}
Notes
-
In the above example, the last argument represent the color's RGB values (red, green, blue) ranging from 0 to 255.
-
The
\definecolor
command must be placed before the\color
command. A best practice is to define all the colors you plan to use in the preamble section of your document.