# How to Use Different Fonts on Overleaf

Hongtao Hao / 2020-11-13

## Two steps #

Using different fonts is much easier than I thought. It involves two steps:

1. Change the Compiler from LaTex or pdfLatex to either XeLaTex or LuaLaTex. To make this change, click the Menu button on the upper-left corner of your Overleaf project. In Settings, you’ll see a drop list in Compiler.

\usepackage{fontspec}


Where to find the fonts that were supported via fontspec? Read this list , which I think is quite comprehensive. It contains many modern fonts, including those you can find in Google fonts.

## Several fonts in a document #

According to this post , instead of using \setmainfont{Choose Your Own Font}, you can do this:

\setromanfont{first font choice}
\setsansfont{second font choice}
\setmonofont{third font choice}


The second choice can be activated by \ssfamily, and the third by

\begin{verbatim}
...
\end{verbatim}