2

I have used \setbeamercolor{math text}{fg=blue} to turn all my text in math mode in blue. However I have also math in block titles and I would prefer the formulas to have the same color as the block titles instead of blue.

\documentclass{beamer}
\usetheme{Warsaw}

\setbeamercolor{math text}{fg=blue}

\begin{document}
\begin{frame}
  \begin{block}{A title with math text $f(x)=y$}
     Block body with math text $f(x)=y$.
  \end{block}
\end{frame}

\end{document}

It looks like this:

enter image description here

I want it looks like this:

enter image description here

I found a solution that modifies math text color in frame titles using \donotcoloroutermaths by setting \addtobeamertemplate{frametitle}{\donotcoloroutermaths}. But simplify changing the frametitle to blocktitle causes errors.

1

1 Answer 1

1

You could redefine the block begin template like this:

\documentclass{beamer}
\usetheme{Warsaw}

\setbeamercolor{math text}{fg=blue}

\setbeamertemplate{block begin}{%
  \par\vskip\medskipamount%
  \begin{beamerboxesrounded}[upper=block title,lower=block body,shadow=true]%
    {\raggedright\usebeamerfont*{block title}\donotcoloroutermaths\insertblocktitle}%
    \raggedright%
    \usebeamerfont{block body}%
}

\begin{document}
\begin{frame}
  \begin{block}{A title with math text $f(x)=y$}
     Block body with math text $f(x)=y$.
  \end{block}
\end{frame}

\end{document}

enter image description here

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .