josephwright / beamer

A LaTeX class for producing presentations and slides
Other
1.35k stars 139 forks source link

Font inheritance in blocks #891

Open samcarter opened 3 months ago

samcarter commented 3 months ago

The inheritance of fonts in blocks seems a bit inconsistent, maybe this can be unified...

\documentclass{beamer}

\setbeamerfont{block body}{series=\itshape}

\begin{document}

\begin{frame}
  \begin{block}{title}
  content...
  \end{block}
  \begin{exampleblock}{title}
  content...
  \end{exampleblock}
  \begin{alertblock}{title}
  content...
  \end{alertblock}
\end{frame}

\end{document}

document-1

louisstuart96 commented 3 months ago

In beamerfontthemedefault.sty, in the vicinity of Line 80:

\setbeamerfont{block body}{}
# These two font template don't have a parent
\setbeamerfont{block body alerted}{}
\setbeamerfont{block body example}{}
# but this one does
\setbeamerfont{block title}{size=\large,parent={structure,block body}}
\setbeamerfont{block title alerted}{parent={block title,alerted text}}
\setbeamerfont{block title example}{parent={block title,example text}}

Therefore, two possible solutions:

  1. Let these two font templates, block body altered and block body example, inherit block body;
  2. Remove the inheritance relation between block title and block body.