3

using the beamer class theme metropolis, I stumbled over the physics package's \dv{} command. This MWE illustrates the issue:

\documentclass{beamer}
\usetheme{metropolis}
\usepackage{physics}
\begin{document}
    \begin{frame}
        Usual math is sans-serif: $12 + 4 = x^2$.

        Physics package not necessarily: $\dv{x}{y} \neq \pdv{i}{k}$.
    \end{frame}
\end{document}

Usually, the theme takes good care of its math font and typesetting everything sans-serif. Yet, the physics package seems to use a completely different, serif font. How do I fix this?

1 Answers1

3

The physics packages uses \mathrm in the definition of \diffd, this will force serif font even if the rest of the presentation is in sans serif. You could change the definition of \diffd:

\documentclass{beamer}
\usetheme{moloch}% modern fork of the metropolis theme
\usepackage{physics}

\def\diffd{\textup{d}}

\begin{document} \begin{frame} Usual math is sans-serif: $12 + 4 = x^2$.

    Physics package not necessarily: $\dv{x}{y} \neq \pdv{i}{k}$.
\end{frame}

\end{document}

enter image description here