1

I am using a beamer theme with bold headers (namely, metropolis). It looks great... except when I have a formula in frame header, because mathematical symbols don't get bolded. I can force them using \bm:

\documentclass[12pt]{beamer}
\usepackage{bm}
\usetheme{metropolis}

\begin{document}
    \begin{frame}[fragile]{A $A$} % bad result
    \end{frame}

    \begin{frame}[fragile]{A $\bm{A}$} % better
    \end{frame}
\end{document}

Remembering always to do this is inconvenient. Is there a way to always get bold symbols there? Maybe not with bm but some other package, or by changing the theme in some way?

2

The metropolis theme uses \bfseries for frametitle font, so you can redefine \bfseries to work in both text-mode and math-mode as below:

\documentclass[12pt]{beamer}
\usepackage{bm}
\usetheme{metropolis}

\makeatletter
\DeclareRobustCommand*{\bfseries}{%
   \not@math@alphabet\bfseries\mathbf
   \fontseries\bfdefault\selectfont
   \boldmath
}
\makeatother

\begin{document}
    \begin{frame}[fragile]{A $A$} % bad result
    \end{frame}

    \begin{frame}[fragile]{A $\bm{A}$} % better
    \end{frame}
\end{document}

enter image description here

3

You might (ab-?)use \setbeamerfont to issue \boldmath in addition to \bfseries

\documentclass[12pt]{beamer}
\usetheme{metropolis}
\setbeamerfont{frametitle}{series=\bfseries\boldmath}

\begin{document}

\begin{frame}{A $\mathsf{A}$ $A$} 
x
\end{frame}

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.