From 1f0979fa57cd969ee8c75fe958874acc6237a233 Mon Sep 17 00:00:00 2001 From: Anno Knierim Date: Tue, 21 Mar 2023 11:12:20 +0100 Subject: [PATCH] Added command to add institute logo instead of name This adds a `\institutelogo` command that allows to add a logo instead of the short name of the institute to the right side of the header. --- beamerthemetudo.sty | 9 ++++++++- example.tex | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/beamerthemetudo.sty b/beamerthemetudo.sty index bb30a4a..00a17bb 100644 --- a/beamerthemetudo.sty +++ b/beamerthemetudo.sty @@ -18,6 +18,9 @@ \setbeamersize{text margin left=15pt, text margin right=15pt} \usefonttheme{professionalfonts} +% Adds an institute logo to the header +\newcommand*\theinstitutelogo{} +\newcommand*\institutelogo[1]{\renewcommand\theinstitutelogo{#1}} % If xelatex or lualatex, use fontspec to set fonts \newif\if@fontspec\@fontspecfalse @@ -80,7 +83,11 @@ leftskip=1em, rightskip=\beamer@rightmargin, ]{headline}% - \usebeamerfont{institute in head/foot}\hfill\insertshortinstitute[respectlinebreaks] + \ifx\theinstitutelogo\empty + \usebeamerfont{institute in head/foot}\hfill\insertshortinstitute[respectlinebreaks] + \else% + \hfill\theinstitutelogo + \fi% \end{beamercolorbox}% \vskip2ex% \ifnum\insertframenumber=1% diff --git a/example.tex b/example.tex index b2b7f78..4377678 100644 --- a/example.tex +++ b/example.tex @@ -38,6 +38,8 @@ \institute[Kurzform Lehrstuhl]{Names des Lehrstuhls \\ Name der Fakultät} \titlegraphic{\includegraphics[width=0.7\textwidth]{images/tudo-title-2.jpg}} +%% Add your institute logo to the header instead of short form of the institute name, e.g. +%\institutelogo{\includegraphics[height=\headerheight]{}} \begin{document}