> For the complete documentation index, see [llms.txt](https://overleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://overleaf-pro.ayaka.space/latex/fonts/01-font-sizes-families-and-styles.md).

# Font sizes, families, and styles

## Introduction

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.

The following example shows how to use the smallest available font size in LaTeX (`\tiny`) and the small caps (`\textsc{...}`) font style:

```latex
This is a simple example, {\tiny this will show different font sizes} and also \textsc{different font styles}.
```

[Open this example in Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Font+sizes+and+styles\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cbegin%7Bdocument%7D%0AThis+is+a+simple+example%2C+%7B%5Ctiny+this+will+show+different+font+sizes%7D+and+also+%5Ctextsc%7Bdifferent+font+styles%7D.%0A%5Cend%7Bdocument%7D)

The following image shows the output produced by the example above: ![FontStyles.png](/files/IxM9ktP7wZwnumB4kLdp)

## Font sizes

Font sizes are identified by special names, the actual size is not absolute but relative to the font size declared in the `\documentclass` statement (see [Creating a document in LaTeX](/latex/latex-basics/01-learn-latex-in-30-minutes.md)).

In the following example, `{\huge huge font size}` declares that the text inside the braces must be formatted in a *huge* font size. For a complete list of available font sizes see the [reference guide](#reference-guide).

```latex
In this example the {\huge huge font size} is set and
the {\footnotesize Foot note size also}. There's a fairly
large set of font sizes.
```

[Open this example in Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Huge+font+size\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cbegin%7Bdocument%7D%0AIn+this+example+the+%7B%5Chuge+huge+font+size%7D+is+set+and+%0Athe+%7B%5Cfootnotesize+Foot+note+size+also%7D.+There%27s+a+fairly+%0Alarge+set+of+font+sizes.%0A%5Cend%7Bdocument%7D)

The following image shows the output produced by the example above: ![FontSizesOLV2.png](/files/Xx3VDc215t83lFEvAUlW)

## Font families

By default, in standard LaTeX classes the default style for text is usually a Roman (upright) serif font. To use other styles (**families**) such as sans serif, typewriter (monospace) etc. you need to use some specific LaTeX commands, as shown in the example below:

```latex
In this example, a command and a switch are used.
\texttt{A command is used to change the style
of a sentence}.

\sffamily
A switch changes the style from this point to
the end of the document unless another switch is used.
```

[Open this example in Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Choosing+type+styles\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cbegin%7Bdocument%7D%0AIn+this+example%2C+a+command+and+a+switch+are+used.+%0A%5Ctexttt%7BA+command+is+used+to+change+the+style+%0Aof+a+sentence%7D.%0A%0A%5Csffamily%0AA+switch+changes+the+style+from+this+point+to+%0Athe+end+of+the+document+unless+another+switch+is+used.%0A%5Cend%7Bdocument%7D)

The following image shows the output produced by the example above:

![UsingFontStyles2.png](/files/5OV4xUGRpBgoybmNqmtH)

You can set up the use of sans font as a default in a LaTeX document by using the command:

```latex
 \renewcommand{\familydefault}{\sfdefault}
```

Similarly, for using roman font as a default:

```latex
 \renewcommand{\familydefault}{\rmdefault}
```

## Font styles

The most common font styles in LaTeX are [bold, italics and underlined](/latex/latex-basics/03-bold-italics-and-underlining.md), but there are a few more.

In the following example the `\textsl` command sets the text in a *slanted* style which makes the text look a bit like *italics*, but not quite. See the [reference guide](#reference-guide) for a complete list of font styles.

```latex
Part of this text is written \textsl{in a different
font style} to highlight it.
```

[Open this example in Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Using+slanted+text\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cbegin%7Bdocument%7D%0APart+of+this+text+is+written+%5Ctextsl%7Bin+a+different+%0Afont+style%7D+to+highlight+it.%0A%5Cend%7Bdocument%7D)

The following image shows the output produced by the example above:

![UsingSlantedText.png](/files/cDw7mLMTuF9oWkS79rpd)

If you want to go back to "normal" font style (default for the LaTeX class you are using), this can be done by using the `\textnormal{...}` command or the `\normalfont` switch command.

## Putting it all together

The following example combines together the various LaTeX code fragments used in this article.

```latex
\documentclass{article}
\begin{document}
%Example of different font sizes and types
This is a simple example, {\tiny this will show different font sizes} and also \textsc{different font styles}.

\vspace{1cm}

%Example of different font sizes and types
In this example the {\huge huge font size} is set and the {\footnotesize Foot note size also}. There's a fairly large set of font sizes.

\vspace{1cm}

%Example of different font sizes and types
In this example, a command and a switch are used. \texttt{A command is used to change the style of a sentence}.

\sffamily
A switch changes the style from this point to the end of the document unless another switch is used.
\rmfamily

\vspace{1cm}

%Example of different font sizes and types
Part of this text is written \textsl{in different font style} to highlight it.
\end{document}
```

[Open this example in Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Example+using+font+styles%2C+sizes+and+famlies\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cbegin%7Bdocument%7D%0A%25Example+of+different+font+sizes+and+types%0AThis+is+a+simple+example%2C+%7B%5Ctiny+this+will+show+different+font+sizes%7D+and+also+%5Ctextsc%7Bdifferent+font+styles%7D.+%0A%0A%5Cvspace%7B1cm%7D%0A%0A%25Example+of+different+font+sizes+and+types%0AIn+this+example+the+%7B%5Chuge+huge+font+size%7D+is+set+and+the+%7B%5Cfootnotesize+Foot+note+size+also%7D.+There%27s+a+fairly+large+set+of+font+sizes.%0A%0A%5Cvspace%7B1cm%7D%0A%0A%25Example+of+different+font+sizes+and+types%0AIn+this+example%2C+a+command+and+a+switch+are+used.+%5Ctexttt%7BA+command+is+used+to+change+the+style+of+a+sentence%7D.%0A%0A%5Csffamily%0AA+switch+changes+the+style+from+this+point+to+the+end+of+the+document+unless+another+switch+is+used.%0A%5Crmfamily%0A%0A%5Cvspace%7B1cm%7D%0A%0A%25Example+of+different+font+sizes+and+types%0APart+of+this+text+is+written+%5Ctextsl%7Bin+different+font+style%7D+to+highlight+it.%0A%5Cend%7Bdocument%7D)

## Reference guide

**Font sizes**

| Command       | Output                                             |
| ------------- | -------------------------------------------------- |
| \tiny         | ![F-tiny.png](/files/HAgyaDw3VVZh83sDNjZM)         |
| \scriptsize   | ![F-scriptsize.png](/files/OXITluMsfYWY6UwMuM1P)   |
| \footnotesize | ![F-footnotesize.png](/files/BSKu682gNg8RQ24oE95Q) |
| \small        | ![F-small.png](/files/hknhWqEJRxgjWaRbjpbP)        |
| \normalsize   | ![F-normalsize.png](/files/qVrXEvRRifNzRiul6mGI)   |
| \large        | ![F-large.png](/files/YlAuzZzvfADPOoKegJ2G)        |
| \Large        | ![F-large2.png](/files/Sj0IfoNu7zG21qp5Z27U)       |
| \LARGE        | ![F-large3.png](/files/e2ThTwMMorPVf733yHq7)       |
| \huge         | ![F-huge.png](/files/Um8xL9CyFeDPAL5LYs6Q)         |
| \Huge         | ![F-huge2.png](/files/U9OD4OEOj5a8lhNfcdnY)        |

**Default font families**

| typeface = family      | command                     | switch command | output                                       |
| ---------------------- | --------------------------- | -------------- | -------------------------------------------- |
| serif (roman)          | `\textrm{Sample Text 0123}` | `\rmfamily`    | ![F-textrm.png](/files/VHSQ6Ya3oH877waFDS7q) |
| sans serif             | `\textsf{Sample Text 0123}` | `\sffamily`    | ![F-textsf.png](/files/fc62IOfjpwUTpMTIXMpO) |
| typewriter (monospace) | `\texttt{Sample Text 0123}` | `\ttfamily`    | ![F-texttt.png](/files/GQHnspWOjQpXZR0xtG0l) |

**Font styles**

| style      | command                     | switch command | output                                        |
| ---------- | --------------------------- | -------------- | --------------------------------------------- |
| medium     | `\textmd{Sample Text 0123}` | `\mdseries`    | ![F-textmd.png](/files/gJiX3j10A06InYEcofDN)  |
| bold       | `\textbf{Sample Text 0123}` | `\bfseries`    | ![F-textbf.png](/files/if43NLjqDSXpbHtgQQeD)  |
| upright    | `\textup{Sample Text 0123}` | `\upshape`     | ![F-textrm.png](/files/VHSQ6Ya3oH877waFDS7q)  |
| italic     | `\textit{Sample Text 0123}` | `\itshape`     | ![F-textit2.png](/files/a00B9OBneAdygph115l0) |
| slanted    | `\textsl{Sample Text 0123}` | `\slshape`     | ![F-textsl.png](/files/ImHMbKSRElXziRDZGSGO)  |
| small caps | `\textsc{Sample Text 0123}` | `\scshape`     | ![F-textsc.png](/files/3cm42nZ9tfH5wlRODua7)  |

## Further reading

For more information see:

* [Font typefaces](/latex/fonts/02-font-typefaces.md)
* [Supporting modern fonts with XeLaTeX](/latex/fonts/03-xelatex.md)
* [Bold, italics and underlining](/latex/latex-basics/03-bold-italics-and-underlining.md)
* [Text alignment](/latex/formatting/06-text-alignment.md)
* [Multiple columns](/latex/formatting/09-multiple-columns.md)
* [Paragraph formatting](/latex/formatting/04-articles-how-to-change-paragraph-spacing-in-latex.md)
* [Line breaks and blank spaces](/latex/formatting/05-line-breaks-and-blank-spaces.md)
* [International language support](/latex/languages/03-international-language-support.md)
* [The not so short introduction to LaTeX2ε](http://www.ctan.org/tex-archive/info/lshort/)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://overleaf-pro.ayaka.space/latex/fonts/01-font-sizes-families-and-styles.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
