Skip to content
Marei Peischl edited this page Apr 3, 2022 · 1 revision

Increase available space on beamer slides

The Corporate Design requires a quite large frametitle block. For some usecases there might be the requirement to increase available space on slides. This as discussed in https://github.com/tudace/tuda_latex_templates/issues/125 (in German) and this entry will provide a layout adjustment which could be helpful.

Both variants reduce the distance between frame title and frame content. This is against the design guideline and therefore cannot be officially supported.

The adjustment should be inserted after loading the beamer theme and before \begin{document} or might also be used for local adjustments for a limited number of frames. In that case grouping would help to enclose the change.

without logo

\makeatletter
\setbeamertemplate{frametitle}{%
\nointerlineskip%
\begin{beamercolorbox}[
  sep=.5\TUDa@beamer@logosep,
  wd=\dimexpr\TUDa@beamer@linewidth+2\TUDa@beamer@extraindent\relax,
  leftskip=\dimexpr-.5\TUDa@beamer@logosep+\TUDa@beamer@extraindent\relax,
	]{frametitle}%
		\usebeamerfont{frametitle}\strut\insertframetitle
		\ifx\insertframesubtitle\@empty
		\else
		\par
		\usebeamercolor[fg]{framesubtitle}%
		\usebeamerfont{framesubtitle}%
		\insertframesubtitle
		\fi
\end{beamercolorbox}%
\nointerlineskip
\TUDa@beamer@rule
}
\makeatother

with logo

\ExplSyntaxOn
\makeatletter
\setbeamertemplate{frametitle}%
\nointerlineskip%
\begin{beamercolorbox}[
  sep=.5\TUDa@beamer@logosep,
  wd=\dimexpr\TUDa@beamer@linewidth+2\TUDa@beamer@extraindent\relax,
  rightskip=-.5\TUDa@beamer@logosep,
  leftskip=\dimexpr-.5\TUDa@beamer@logosep+\TUDa@beamer@extraindent\relax,
	]{frametitle}%
	\hbox_set:Nn \l_TUDa_frametitle_box {%
	\parbox[t]%
		{\dimexpr\linewidth- \wd\TUDa@logobox-1em\relax\relax}{%
		\usebeamerfont{frametitle}\strut\insertframetitle%
		\ifx\insertframesubtitle\@empty%
		\else%
		\par%
		\usebeamercolor[fg]{framesubtitle}%
		\usebeamerfont{framesubtitle}%
		\insertframesubtitle%
		\fi%
	}}%
	\leavevmode%
	\bool_if:NTF \g_TUDa_centerframetitle_bool%
		{\raisebox{\dimexpr-.5\height+.5\depth}}%
		{\use:n}%
			{\box_use:N \l_TUDa_frametitle_box}%
	\hfill%
	\bool_if:NTF \g_TUDa_centerframetitle_bool%
		{\raisebox{\dimexpr-.5\height+.5\depth}}%
		{\raisebox{\dimexpr-\height+\ht\strutbox}}%
		{\usebox\TUDa@logobox}%
\end{beamercolorbox}%
\nointerlineskip%
\leavevmode\color{black}\hspace*{-\TUDa@beamer@extraindent}\TUDa@beamer@rule%
}
\makeatother
\ExplSyntaxOff
Clone this wiki locally