9

I try to redefine the header of my frames, but for some mysterious reason I get an overfull hbox of 1.6 points or slightly more:

\documentclass{beamer}
\usepackage{times}

\setbeamertemplate{headline}{\relax
 \hbox{\relax
   \begin{beamercolorbox}[wd=.25\paperwidth]{section in head/foot}%
   \end{beamercolorbox}%
   \begin{beamercolorbox}[wd=.75\paperwidth]{section in head/foot}%
   \end{beamercolorbox}
 }%
}%

\begin{document}
\begin{frame}\frametitle{Normal}
\end{frame}
\begin{frame}[fragile]\frametitle{Fragile}
\end{frame}
\end{document}
  • The problem must be related to the font I use, since if I remove the \usepackage{times} directive, the overfull hbox is of different size.

  • I tried changing out the relative sizes of the two beamercolorboxes, but then the deader does not cover the entire frame, which is very obvious when the header is of a different color.

9

You're missing a % at the end of \end{beamercolorbox}:

\documentclass{beamer}
\usepackage{times}

\setbeamertemplate{headline}{\relax
 \hbox{\relax
   \begin{beamercolorbox}[wd=.25\paperwidth]{section in head/foot}%
   \end{beamercolorbox}%
   \begin{beamercolorbox}[wd=.75\paperwidth]{section in head/foot}%
   \end{beamercolorbox}% <----- HERE!
 }%
}%

\begin{document}
\begin{frame}\frametitle{Normal}
\end{frame}
\begin{frame}[fragile]\frametitle{Fragile}
\end{frame}
\end{document}
  • Gee, you are right. This is so embarrassing! – Yossi Gil Dec 14 '13 at 21:51
  • 5
    @YossiGil Whenever the length changes with the font, suspect a spurious space. – egreg Dec 14 '13 at 21:52

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.