4

Can anyone explain why the second argument in \fontsize \textbox in the example is ignored in the footer template?

\documentclass{beamer}
\usepackage[T1]{fontenc}
\usepackage{fix-cm}

\newcommand\testbox{\parbox[b]{30mm}{%
        \fontsize{4mm}{10mm}\selectfont\bfseries
        A\\B}%
}

\defbeamertemplate*{footline}{test}
{%
  \leavevmode%
  \hbox{%
    \testbox
  }%
  \vskip0pt%
}

\begin{document}
  \begin{frame}
    \testbox
  \end{frame}
\end{document}

enter image description here

  • Interesting. ;-) – egreg Jul 17 '15 at 14:10
  • The same effect can be observed in the headline template, but in the frametitle template, for example` the value for \baselineskip has the desired effect. – Gonzalo Medina Jul 17 '15 at 14:16
  • @egreg, well not the world I'd use. And it is more natural to set the baselineskip between to lines and having to fiddle with \vskip – daleif Jul 17 '15 at 14:17
2

The culprit is \offinterlineskip in the code that typesets the headline or footline (the effect can also be observed in the headline template); this is used several times when building the header/footer:

\def\beamer@typesetheadorfoot#1{% typeset the head or footline
  {\parskip0pt\offinterlineskip%
    \hbox{%
      \hskip-\Gm@lmargin%
      \hbox{%
        \vbox{%
          \@tempdima=\textwidth%
          \textwidth=\paperwidth%
          \hsize=\textwidth%
          \def\\{,}%
          \usebeamertemplate***{#1}%
        }}%
      \hskip-\Gm@rmargin%
    }}\hfil%
}

and

 \def\@oddfoot{%
    \vbox{\offinterlineskip\hbox{\beamer@typesetheadorfoot{footline}%
    \hfil}\hbox{}}\hfil
  }%

in beamerbaseframecomponents.sty.

  • And what do we do to fix it? I had to go and look it up, did not know that macro – daleif Jul 17 '15 at 14:27
  • Hmm, might be worth a bug report. – daleif Jul 17 '15 at 14:30
  • @daleif I imagine one could change the settings in the definition, but this will have effects in the way the footline is installed by the outer themes, so a change in the definition would imply changing the way the templates are installed by the themes. Seems a lot of work. – Gonzalo Medina Jul 17 '15 at 14:30
  • On the other hand saying that baselineskip cannot be changed in a multiline "footline" is a strange requirement – daleif Jul 17 '15 at 14:32
  • 1
    Seems enough to just add \lineskiplimit=0pt inside the wrapping minipage – daleif Jul 17 '15 at 14:39

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.