# Using multiple system fonts

I'd like to use 3-4 different specific system fonts (e.g., Georgia, HelveticaNeui Light, and Lucida Sans) with certain font sizes for different sections of a page. How would I do this?

Edit: Thanks for the responses. I saw the fontspec package but the examples I found defined in the preamble \setmainfont{}, \setsansfont{}, etc. I couldn't figure out how to define a fontfamily and then reference it for a particular section. Here's an example:

\documentclass[12pt]{article}

\usepackage{fontspec}

\begin{document}

\section{Georgia}%here define font

This text shows in Georgia.

\section{Lucida Sans}%

This text shows in Lucida Sans

\section{HelveticaNeue Light}%here define font

This text shows in Helvetica Neue Light

\end{document}

• Welcome to TeX.sx! – Peter Jansson Apr 14 '13 at 20:00
• Have you looked into the \newfontfamily directive of the fontspec package? – Mico Apr 14 '13 at 20:15
• Here's an example of pretty much exactly what you want to do: Change section fonts. – Alan Munn Apr 14 '13 at 20:32
• Thanks, Alan. I saw that example which defines the formatting by section, subsection, etc. I'm looking to specify formatting for different sections - I'm used to styling in HTML/CSS where to do this you'd assign each paragraph to different classes and then for each of those classes define the font size, font family, color, margin, etc. – jack Apr 14 '13 at 21:01
• @Jack The principle is the same. You can define various section-like headings using titlesec. I'll post an example shortly. But reading your question more carefully, I'm wondering, do you want the text within a section to be of a different font, or the section heading, or both? – Alan Munn Apr 14 '13 at 21:08

If you just want chunks of text to be a different font you can simply set up environments for them using whatever semantics makes sense for your document. The main thing to remember is that you should use \newfontfamily to define a font switching command for each font rather than using the \fontspec command directly. For example:

% Compile with XeLaTeX or LuaLaTeX
\documentclass[12pt]{article}
\usepackage{fontspec}
\defaultfontfeatures{Ligatures=TeX}

\newfontfamily\calibrifont{Calibri}
\newfontfamily\cambriafont{Cambria}
\newfontfamily\georgiafont{Georgia}

\newenvironment{calibri}{\calibrifont}{\par}
\newenvironment{cambria}{\cambriafont}{\par}
\newenvironment{georgia}{\georgiafont}{\par}

\begin{document}
\begin{calibri}
This text is in Calibri
\end{calibri}
\begin{cambria}
This text is in Cambria
\end{cambria}
\begin{georgia}
This text is in Georgia
\end{georgia}
\end{document}


• What happens if you use pdflatex? – Mario S. E. Sep 30 '13 at 16:14
• @MarioS.E. You don't. fontspec requires either XeLaTeX or LuaLaTeX. – Alan Munn Sep 30 '13 at 19:06