3

Using beamer when I change a font size in a frame title line and/or footline to the preferred height, the height of these lines is not automatically adjusted to the font height. How to achieve that effect?

I started to use the metropolis theme.

As I was asked, I created a MWE now. BTW, what is the name of a standard color of a frametitle?

\documentclass{beamer}

\usetheme[numbering=none]{metropolis}

\setbeamerfont{frametitle}{size=\normalsize,series=\bfseries}
\setbeamerfont{frametitle}{size=\small,series=\normalfont}

\setbeamercolor{footline}{bg=black!80,fg=white}
\setbeamertemplate{frame footer}{A footline}

\begin{document}

\begin{frame}{A frame title in a small size}
 \begin{block}{Some itemize}
  \begin{itemize}
   \item Item 1
   \item Item 2
  \end{itemize}
 \end{block}
 \begin{block}{Some maths}
 \[\sum_{n=1}^{\infty}\frac{1}{n^2}=\frac{\pi^2}{6}=\zeta(2)\]
\end{block}
\end{frame}

\end{document}
  • 1
    can you make a minimal working example (MWE)? – user36296 Aug 6 '18 at 20:28
  • In a moment. :-) – szw1710 Aug 6 '18 at 20:31
  • 1
    The easy question first: the default colours for the frametitle in the metropolis theme are fg=black!2, bg=mDarkTeal – user36296 Aug 6 '18 at 21:03
  • Of course, it works. You are right, my question is not so easy. I was not able to solve a problem by myself. I have spend at least 2 hours to try and look for a solution in the earlier posts. – szw1710 Aug 6 '18 at 21:07
2

Taking the font size into account will only marginally influence the height of the frametitle. Most of height is determined by the padding around the font and is hard coded in the metropolis theme. However you can adjust the numbers as in the following example.

\documentclass{beamer}

\usetheme[numbering=none]{metropolis}

\setbeamerfont{frametitle}{size=\small,series=\normalfont}
\setbeamercolor{footline}{bg=black!80,fg=white}
\setbeamertemplate{frame footer}{A footline}

\makeatletter
\setlength{\metropolis@frametitle@padding}{1.6ex}% <- default 2.2 ex

\setbeamertemplate{footline}{%
  \begin{beamercolorbox}[wd=\textwidth, sep=1.5ex]{footline}% <- default 3ex
    \usebeamerfont{page number in head/foot}%
    \usebeamertemplate*{frame footer}
    \hfill%
    \usebeamertemplate*{frame numbering}
  \end{beamercolorbox}%
}
\makeatother

\begin{document}

\begin{frame}{A frame title in a small size}
 \begin{block}{Some itemize}
  \begin{itemize}
   \item Item 1
   \item Item 2
  \end{itemize}
 \end{block}
 \begin{block}{Some maths}
 \[\sum_{n=1}^{\infty}\frac{1}{n^2}=\frac{\pi^2}{6}=\zeta(2)\]
\end{block}
\end{frame}

\end{document}

enter image description here

  • Thank you very much for a nice solution with an explanation. Of course this works excellently. – szw1710 Aug 6 '18 at 21:31

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.