# Beamer template setbeamerfont bfseries

I have a problem regarding the \setbeamerfont command related to alerted text. The usage is:

\setbeamerfont{alerted text}{series=\bfseries}


However, bfseries does not work in math mode - what can I do to obtain the same effect for alerted text in math mode?

To use \bf was one thing I found during my search, but \bf is deprecated and should not be used, as it was told to be unstable in certain cases.

Minimal example:

beamerthemeTest.sty:

\mode<presentation>
\usepackage{mathptmx}

\useinnertheme{rectangles}
\usefonttheme[onlymath]{serif}
\usefonttheme{professionalfonts}
\mode
<all>


Document:

\documentclass{beamer}
\usetheme{Test}
\begin{document}
\begin{frame}
\alert{$x^2$} cannot be alerted.
\end{frame}
\end{document}

• Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – user36296 Apr 2 '15 at 9:21
• A tip: If you indent lines by 4 spaces or enclose words in backticks , they'll be marked as code, as can be seen in my edit. You can also highlight the code and click the "code" button (with "{}" on it). – user36296 Apr 2 '15 at 9:22
• @aronadaal I don't see how this solves my problem, please elaborate further – Modass Apr 2 '15 at 11:20
• sry, I was a bit too fast. Here is now a working example. – aronadaal Apr 2 '15 at 12:08

Sorry, I was a bit too fast with my answer. Use \usefonttheme[onlymath]{serif} for serif font in math mode and \boldmath for bold font - again only in math mode.

\documentclass{beamer}
\usefonttheme[onlymath]{serif}
\begin{document}
\begin{frame}
\begin{columns}
\column{.5\textwidth}
\centering
$x = 5 - 2$
\column{.5\textwidth}
\centering
\boldmath
$x = 5 - 2$
\end{columns}
\end{frame}
\end{document}


EDIT: Ok, now with the your example I understand the problem. Solves this one your problem?

The theme:

\mode<presentation>
\mode
<all>


The document:

\documentclass{beamer}
\usetheme{Test}
\begin{document}
\begin{frame}
\alert{$x^2$} can be alerted, too! % math inside \alert{}
`