1

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}
\setbeamerfont{alerted text}{series=\bfseries\boldmath}
\setbeamercolor{alerted text}{fg=blue}
\mode
<all>

Document:

\documentclass{beamer}
\usetheme{Test}
\begin{document}
\begin{frame}
  \alert{This text is alerted.}
  \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
  • question already answered in tex.stackexchange.com/questions/34265/… – aronadaal Apr 2 '15 at 10:27
  • @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
2

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}

enter image description here

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

The theme:

\mode<presentation>
\setbeamerfont{alerted text}{series=\bfseries\boldmath}
\setbeamercolor{alerted text}{fg=blue}
\mode
<all>

The document:

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

enter image description here

  • Okay - but how do I set this inside a beamertemplate? Maybe I was not precise enough: What I want is that whenever I use '\alert{Stuff}' I want Stuff to be bold and colored, no matter which mode I am in – Modass Apr 2 '15 at 12:46
  • please provide a working/non-working minimal example minimalbeispiel.de/mini-en.html – aronadaal Apr 2 '15 at 12:52
  • Ok, extended the question – Modass Apr 2 '15 at 13:04
  • answer extended, too – aronadaal Apr 2 '15 at 14:22
  • Okay, this removes the error, but in my case the font is not bold - I will figure that out and report. – Modass Apr 8 '15 at 11:14

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.