josephwright / beamer

A LaTeX class for producing presentations and slides
Other
1.4k stars 141 forks source link

Overfull \vbox errors with beamer, newcent and split outer theme #668

Open polgab opened 3 years ago

polgab commented 3 years ago

The following ECM produces Overfull \vbox errors.

\documentclass{beamer}
\usepackage{newcent}
\useoutertheme{split}
\begin{document}
\section{s1}
\section{s2}
\section{s3}
\section{s4}
\begin{frame}
\end{frame}
\end{document}

Errors from .log:

Overfull \vbox (0.70264pt too high) detected at line 5
Overfull \vbox (0.70264pt too high) has occurred while \output

Here is a workaround:

\newlength\myfontsize
\setlength\myfontsize{5.96pt}
\setbeamerfont*{section in head/foot}{size*={\myfontsize}{\myfontsize}}
\setbeamerfont*{subsection in head/foot}{size*={\myfontsize}{\myfontsize}}

There is no longer an error message but the value of \myfontsize is found by trial and error. In addition, it changes if we change the size of the default font (o use another font).

I tried to modify the header template defined by split theme (in beamerouterthemesplit.sty) but without success.

PS: from https://tex.stackexchange.com/q/586622/14500

samcarter commented 3 years ago

These are all warnings and not errors.

I think the problem is that AvantGarde Book has a much, much bigger spacing between lines than normal fonts, so the 2.4375ex beamer estimates per line are not enough

samcarter commented 3 years ago

You can avoid the warning if you give more room for the navigation, but personally I would rather use another font than cluttering half the page with navigation...

\documentclass{beamer}
\usepackage{newcent}
\useoutertheme{split}

\makeatletter
\setbeamertemplate{headline}{%
  \leavevmode%
  \@tempdimb=2.453ex% <- adjust here
  \ifnum\beamer@subsectionmax<\beamer@sectionmax%
    \multiply\@tempdimb by\beamer@sectionmax%
  \else%
    \multiply\@tempdimb by\beamer@subsectionmax%
  \fi%
  \ifdim\@tempdimb>0pt%
    \advance\@tempdimb by 1.825ex%
    \begin{beamercolorbox}[wd=.5\paperwidth,ht=\@tempdimb]{section in head/foot}%
      \vbox to\@tempdimb{\vfil\insertsectionnavigation{.5\paperwidth}\vfil}%
    \end{beamercolorbox}%
    \begin{beamercolorbox}[wd=.5\paperwidth,ht=\@tempdimb]{subsection in head/foot}%
      \vbox to\@tempdimb{\vfil\insertsubsectionnavigation{.5\paperwidth}\vfil}%
    \end{beamercolorbox}%
  \fi%
}
\makeatother

\begin{document}
\section{s1}
\section{s2}
\section{s3}
\section{s4}
\begin{frame}
f
\end{frame}
\end{document}
polgab commented 3 years ago

Could the correct value of \@tempdimb be automatically deduced from dimensions of the chosen font?

polgab commented 3 years ago

This issue is related to this other issue: https://github.com/josephwright/beamer/issues/595

josephwright commented 3 years ago

I think not in beamer: perhaps a 'new beamer' might do that.