[Tex/LaTex] How to make a sidebar to the bottom in beamer

beamerthemes

I am on my way to create a beamer template according to the powerpoint template from my institute.

For the theme I need the possibility to use a footline plus a left sidebar. The problem is that the sidebar should go to the bottom and not to the top line of the footline. The sidebar should only be a slim line on the left side for estetic reasons. No relevant content.

What I did get so far is in the picture: Page created with the theme

The colors will be set later correctly. I want the black block go to the bottom end of the page. The green is the footline (for correct identification).

I created the black block using (\ILEA@Sidebar@Width is a fixed, pre-defined length in the theme)

\defbeamertemplate*{sidebar left}{ILEA}{%
\rule{\ILEA@Sidebar@Width}{\textheight}%
}

I first thought of calculating the height of the foot line and then to enlarge the rule height by that but the gap between the black rule and the green background will not be included, will it?

If I disable the footline (make it empty), the gap is still there. So it seems to be not the raw footline, that inserts the space here. I"ll give you a (more or less) minimal working example to reproduce what I did:

\documentclass{beamer}
\setbeamersize{sidebar width left=12pt}
\setbeamercolor*{footline}{fg=red,bg=green}
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{footline}{%
\begin{beamercolorbox}{footline}%
~\hfill \insertframenumber\hspace{10pt}\vspace{1ex}%
\end{beamercolorbox}}
\setbeamertemplate{sidebar left}{%
\rule{10pt}{\textheight}}
\begin{document}
\begin{frame}
\frametitle{Der Titel}
Mein Text
\end{frame}
\end{document}

EDIT:

I want to avoid hardcodeing some length values other than estetic ones into the template. Otherwise it might quickly happen, that any modification to let's say the font size might lead to destruction of the template. So I'd like to let latex calculate this required length.

If you put instead \setbeamertemplate{sidebar left}{a \vfill b} you see, that latex seems to know the correct height of the availabe space. As far as I know, \textheight represents the length of the vertical availabe space. So I tried this length.

Is there a better way to handle things?

Best Answer

Try \paperheight

\documentclass{beamer}
\usepackage{calc}
\setbeamersize{sidebar width left=12pt}
\setbeamercolor*{footline}{fg=red,bg=green}
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{footline}{%
\begin{beamercolorbox}[sep=2pt]{footline}%
~\hfill \insertframenumber\hspace{10pt}\vspace{1ex}%
\end{beamercolorbox}}
%
\newlength\mytep
\setlength\mytep{\paperheight-10.7pt}
\setbeamertemplate{sidebar left}{%
\begin{beamercolorbox}[ht=\mytep, wd=10pt, dp=0pt]{footline}%

\end{beamercolorbox}
%
}
\begin{document}
\begin{frame}
\frametitle{Der Titel}
Mein Text
\end{frame}
\end{document}

To avoid any overfull vertical boxes one should calculate the width of all elements and subtract this form the height of the sidebar. In this example i have added a manual adjustment since an automatic version would need a real life example. (Another possibility is to use the sidebar theme.)

You also may find the sidebar section in the beameruserguide intressting.

If one does not want to care about heights and errors, one could use the sidebar canvas left template. (This does not clip but will raise so errors. see beameruserguide)

\documentclass{beamer}

\setbeamersize{sidebar width left=12pt}

\setbeamercolor*{footline}{fg=red,bg=green}

\setbeamertemplate{footline}{%
\begin{beamercolorbox}[sep=2pt]{footline}%
~\hfill \insertframenumber\hspace{10pt}\vspace{1ex}%
\end{beamercolorbox}}
\setbeamertemplate{sidebar left}{%

%
}

\setbeamertemplate{sidebar canvas left}{\color{red}\rule{12pt}{\paperheight}}

\begin{document}
\begin{frame}
\frametitle{Der Titel}
Mein Text
\end{frame}
\end{document}