In a latex-beamer document, I am using a custom headline template. It produces a headline only when in a section. Here is a stripped down version:
\documentclass{beamer}
\usepackage{times} % gets rid of fontsize warnings
\setbeamercolor{section in head}{bg=yellow!80!black,fg=structure}
%% \setbeamercolor{lower separation line head}{bg=yellow!50!black}
\setbeamertemplate{headline}{
\ifx\insertsection\empty\else
\usebeamerfont{section in head}
\begin{beamercolorbox}[ht=2ex,dp=1ex,leftskip=2ex]{section in head}
\insertsection
\end{beamercolorbox}
%%\begin{beamercolorbox}[colsep=0.5pt]{lower separation line head}\end{beamercolorbox}
\fi
\vspace*{5pt}
}
\begin{document}
\begin{frame}
% frame has empty headline
\end{frame}
\section{A Section}
\begin{frame}
% frame headline shows section title
\end{frame}
\end{document}
However, this code produces an "overfull vbox": Overfull \vbox (9.41396pt too high) has occurred while \output is active []
I could ignore it because the result looks fine, but I'd like to know why this is happening and how I could deal with it, mostly because it is irritatint to see this printed out over 200 times.
(Note: this does not happen when commenting out lines 6 and 12, the ones with \if and \fi.)
\ifx .. \fi
also causes the overfull vbox warning and I can't really see or understand why. I tried some variations but without success.