Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer 1

up vote 8 down vote accepted

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}
share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.