[Tex/LaTex] Change math font to sans-serif default in Beamer metropolis theme

beamerbeamer-metropolisfonts

I am using the Beamer metropolis theme, and I would like to change the math font to the default sans-serif font in Beamer presentations, while keeping the text font to be Fira Sans. Is there a simple way to do so (preferably in PDFLaTeX over XeLaTeX)?

I have tried similar approaches as here and here, but neither seems to work for me…

Best Answer

For the use with pdflatex:

\documentclass{beamer}

\usetheme{metropolis}

\usepackage[sfdefault,light]{FiraSans}
\def\mathfamilydefault{cmss}


\begin{document}

\begin{frame}
text

\[
x^2 abc
\]

\end{frame}

\end{document}

enter image description here

(I don't recommend mixing font families like this)