How to use Fira font and mathpazo within the metropolis theme?

In the Modern Toolchain

I personally recommend you use unicode-math when you can, and legacy fonts when you have to. Not everyone agrees, so I present the alternatives.

With the package unicode-math, you can use any OpenType fonts of your choice, including Fira Sans and its successor FiraGO. Asana Math is a Unicode math font based on mathpazo, but with many more symbols. There is, additionally, an experimental Fira Math font for use with unicode-math, but as of 2019, it is a work in progress.

This example additionally sets all letters and numerals in math mode to Fira Sans. You could change this to FiraGO as well, if you wanted. It supports the mathematical Greek OpenType feature.

\documentclass[10pt]{beamer}

\useinnertheme{metropolis}
\useoutertheme{metropolis}
\usecolortheme{metropolis}
\usefonttheme{professionalfonts}
\usepackage{unicode-math}

\defaultfontfeatures{ Scale = MatchUppercase }
\setmainfont{FiraGO}[Scale = 1.0]
\setsansfont{FiraGO}
\setmonofont{Fira Mono}
\setmathfont{Asana Math}
\setmathfont[range=up]{Fira Sans Regular}
\setmathfont[range=it]{Fira Sans Italic}
\setmathfont[range=bfup]{Fira Sans Bold}
\setmathfont[range=bfit]{Fira Sans Bold Italic}

\begin{document}

\begin{frame}{Math}
  \begin{equation*}
    \symup{e} = \lim_{n\to \infty} \left(1 + \frac{1}{n}\right)^n
  \end{equation*}
\end{frame}

\end{document}

Math Sample

Note that you want to enable \usefonttheme{professionalfonts} for certain math features to work (such as the resized parentheses in this example). Therefore, I overrode all the fonts. The metropolis theme also allows you to select the color theme of your choice.

Mixing OpenType with Legacy Math Fonts

If you want to use a legacy NFSS math package, such as mathpazo, or its successor newpxmath, or the sans-serif modification newtxsf, load the math package and use mathastext.

With XeLaTeX, you have the option to load mathspec and \setmathsfont{Fira Sans} or \setmathsfont{FiraGO}.

Or see @samcarter’s excellent answer.

Using only Legacy Fonts

You do not need to do this if you are using metropolis, but for completeness, you can also do this in PDFLaTeX:

\usepackage[T1]{fontenc}
\usepackage[sfdefault,scaled=.85]{FiraSans}
\usepackage{newtxsf}

As long as the metropolis theme is compiled with a suitable engine (e.g. xelatex) it uses fira fonts per default. So simply do not load any other packages or themes and you'll get fira font for text.

% !TeX TS-program = xelatex

\documentclass{beamer}
\usetheme{metropolis} % Use metropolis theme 


\usefonttheme[onlymath]{serif} 
\usepackage{mathpazo}

\begin{document}
 \begin{frame}{First Frame}
 Hello, world! Here some random math:
 \begin{equation*}
 s_{t}=\begin{cases}
 \bar{s}, & t\in \left\lbrace 0,\dots, T-1\right\rbrace  \\
 \tilde{s}, & t\geq T
 \end{cases}
 \end{equation*} 
\end{frame}
\end{document}

enter image description here


A version of the math font which plays nicer with xelatex:

% !TeX TS-program = xelatex

\documentclass{beamer}

\usetheme{metropolis} 
\usefonttheme{professionalfonts}
\usepackage{unicode-math}
\setmathfont{TeX Gyre Pagella Math}

\begin{document}
 \begin{frame}{First Frame}
 Hello, world! Here some random math:
 \begin{equation*}
 s_{t}=\begin{cases}
 \bar{s}, & t\in \left\lbrace 0,\dots, T-1\right\rbrace  \\
 \tilde{s}, & t\geq T
 \end{cases}
 \end{equation*} 
\end{frame}
\end{document}

enter image description here