How can the line-spacing inside the headline
-template be adjusted?
Consider the following code, if it is used inside a normal frame I can control the line-spacing by modifying the baselineskip
in \fontsize{size}{baselineskip}
.
But if I try to use it within the headline
-template, changing the baselineskip
does not make any difference.
\documentclass[t]{beamer}
% Fonts
\setbeamerfont{title}{series=\bfseries,size=\fontsize{16}{24}}
% Headline
\setbeamertemplate{headline}{%
\begin{minipage}[b][0mm][t]{85mm}%
\usebeamerfont{title}{%
\inserttitle
}%
\end{minipage}%
}
\title{Really long title to test all the three possible lines is not yet long enough but know}
\begin{document}
\begin{frame}[t]
\end{frame}
\setbeamertemplate{headline}{}
\begin{frame}[t]
\begin{minipage}[b][0mm][t]{85mm}%
\usebeamerfont{title}{%
\inserttitle
}%
\end{minipage}%
\end{frame}
\end{document}
I also tried the answer https://tex.stackexchange.com/a/66208/36296, but the line-spacing remains unchanged.
\documentclass[t]{beamer}
\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%
}
% Fonts
\setbeamerfont{title}{series=\bfseries,size=\fontsize{16}{24}}
% Headline
\setbeamertemplate{headline}{%
\begin{minipage}[b][0mm][t]{85mm}%
\usebeamerfont{title}{%
\linespread{3.}
\inserttitle \par
}%
\end{minipage}%
}
\title{Really long title to test all the three possible lines is not yet long enough but know}
\begin{document}
\begin{frame}[t]
\end{frame}
\setbeamertemplate{headline}{}
\begin{frame}[t]
\begin{minipage}[b][0mm][t]{85mm}%
\usebeamerfont{title}{%
\inserttitle
}%
\end{minipage}%
\end{frame}
\end{document}
Best Answer
Before inserting a headline template
beamer
issues\offinterlineskip
which has the effect of preventing the change of baselines you wish to achieve. You can restore the usual line spacing behaviour with\normalbaselines
:The
beamer
command that typesets the header is\beamer@typesetheadorfoot
defined inbeamerbasecomponents.sty
.