Mini-titlepages

Another strange problem. I am teaching LaTeX and I usually have slides that say “write this” and “get this”, e.g., write \textbf{bold text} and get bold text.

So I wanted to do the same for the part where I teach beamer. Of course my slides are beamer slides, so I was curious what would happen if I simply include a title page or a table of content inside a minipage. Yes, it works, it inserts the part with the title respectively the table of contents. Of course what is missing is the frame layout, so I had to do a bit of adjusting there. But in the end I have a miniature version of the actual title page and table of content right there in the slide. This is how it works:

First, I used a minipage to get the frame aspect ratio right:

\begin{minipage}[c][0.7\textwidth][c]{\textwidth}
\end{minipage}

Around that a resizebox so that it comfortably fits onto my page below the code that explains how to do it, and an fbox to get some “frame feeling”.

\fbox{\resizebox{0.4\textwidth}{!}{
\begin{minipage}[c][0.7\textwidth][c]{\textwidth}
\end{minipage}
}}

And basically that’s it for the title page, only a bit more space below the text:

\fbox{\resizebox{0.4\textwidth}{!}{
\begin{minipage}[c][0.7\textwidth][c]{\textwidth}
\titlepage
\vfill
\end{minipage}
}}

For the table of contents I had to re-make the frame layout with the navigation bars and the frametitle. The theme is Madrid, which is pretty simple, so I only had to do a blue bar on top and another one at the bottom. For that I used a beamercolorbox which I guess is also used in the theme itself. The values for height and the rest are pure trial and error. I didn’t include the title, author, date etc. at the bottom, although that shouldn’t be too difficult.

\fbox{\resizebox{0.4\textwidth}{!}{
\begin{minipage}[c][0.7\textwidth][c]{\textwidth}
\vspace{-0.55\baselineskip}
\begin{beamercolorbox}[dp=1ex, ht=3ex, wd=1.065\textwidth]{frametitle}
\usebeamerfont{frametitle}Outline
\end{beamercolorbox}
\vspace{\baselineskip}
\vfill
\tableofcontents
\vfill
\begin{beamercolorbox}[ht=1.5ex, wd=1.065\textwidth]{frametitle}
\end{beamercolorbox}
\vspace{-0.6\baselineskip}
\end{minipage}
}}

Maybe not useful, but really cool to have on the slides!

This entry was posted in LaTeX and tagged , , by swk. Bookmark the permalink.

About swk

I am a software developr, data scientist, computational linguist, teacher of computer science and above all a huge fan of LaTeX. I use LaTeX for everything, including things you never wanted to do with LaTeX. My latest love is lilypond, aka LaTeX for music. I'll post at irregular intervals about cool stuff, stupid hacks and annoying settings I want to remember for the future.