[Tex/LaTex] How to change the frametitle / footline height in metropolis theme

beamerbeamer-metropolispresentations

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}

Best Answer

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