I'm trying to create a custom beamer template. However, I can't make the navigation bar to correctly behave in the title page
.
As shown in the image, where the navigation bar is supposed to be I get a white bar instead of the navigation bar. How can I make it totally invisible, so the background fill the entire frame? And while maintaining the navigation bar on the other slides.
As you can see, I tried several things:
- To rewrite the
\titlepage
command to automatically redefine theheadline
part, but it didn't work. BONUS: I would really like a solution on these lines, as it allows me to also removefootlines
, or other tweaks that need to be removed from thetitle page
. However, I can't control the expansion of the declared macros. - To manually reset
headline
before calling it in the example. However, I would prefer an automatic solution. - To add a condition (
\ifnum\thepage>1\relax
) on the headline to behave differently for the first page, but it removes the navigation bar from the first slide too. This was the closest to a solution I got.
The code is:
\documentclass[compress]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\title{There Is No Largest Prime Number}
\date[ISPN ’80]{27th International Symposium of Prime Numbers}
\author[Euclid]{Euclid of Alexandria \texttt{euclid@alexandria.edu}}
%\usetheme{udp}
%% Color theme
\definecolor{frontColor}{RGB}{119,95,85}%MedianBrown
\definecolor{firstColor}{RGB}{148,182,210}%MedianLightBlue
\definecolor{secondColor}{RGB}{221,128,71}%MedianOrange
% Settings
\setbeamercolor*{title page header}{fg=white}
\setbeamercolor*{author}{fg=white}
\setbeamercolor*{date}{fg=white}
\setbeamercolor*{item}{fg=secondColor}
%color for the navigation bar
\setbeamercolor*{section in head/foot}{fg=white,bg=black}
%% beameroutertheme
%headline with navigation bar
% I need to change this to behave differently on the title page
\setbeamertemplate{headline}
{%
%\ifnum\thepage>1\relax%
\begin{beamercolorbox}[wd=\the\paperwidth,ht=0.6cm]{section in head/foot}
\begin{tikzpicture}
\useasboundingbox[fill=white](0,0) rectangle(\the\paperwidth,0.6);
\fill[secondColor] (0,0) rectangle(0.3,0.6);
\fill[firstColor] (0.35,0) rectangle(\the\paperwidth,0.6);
\node[anchor= west, white] at (0.3,0.3){\insertnavigation{0.85\paperwidth}};%
\end{tikzpicture}
\end{beamercolorbox}
%\fi
}
% Frame title
\defbeamertemplate*{frametitle}{udp}[1][]
{%
\vskip-1pt%skip after the begginning of the slide
\begin{beamercolorbox}[wd=\paperwidth,ht=0.6cm]{frametitle}
\begin{tikzpicture}
\useasboundingbox[fill=white](0,0) rectangle(\the\paperwidth,0.6);
\fill[secondColor] (0,0) rectangle(0.3,1);
\fill[firstColor] (0.35,0) rectangle(\the\paperwidth,0.6);
{\node[anchor=west, white,font=\large] at (0.4,0.3){\insertframetitle};}
\end{tikzpicture}
\end{beamercolorbox}
}
%% beamerinnertheme
\setbeamertemplate{background}{
\begin{tikzpicture}
\useasboundingbox (0,0) rectangle(\the\paperwidth,\the\paperheight);
\fill[color=frontColor] (0,2) rectangle (\the\paperwidth,\the\paperheight);
\fill[color=secondColor] (0,0) rectangle(2.95,1.9);
\fill[color=firstColor] (3.05,0) rectangle(\the\paperwidth,1.9);
\ifnum\thepage>1\relax%
\fill[white,opacity=1] (0,0) rectangle(\the\paperwidth,\the\paperheight);
\fi
\end{tikzpicture}
}
% Title page
\defbeamertemplate*{title page}{udp}[1][]
{%
%do the title page
\vskip0.5cm%
\begin{minipage}[r]{\linewidth}
\begin{flushright}
% logo goes here
\end{flushright}
\end{minipage}
\vskip0.5cm%
\begin{minipage}[t][5cm][b]{\textwidth}
\begin{beamercolorbox}[wd=\the\paperwidth,leftskip=3cm,sep=8pt,#1]{title page header}
\usebeamerfont{title}\inserttitle\par%
\end{beamercolorbox}%
\end{minipage}
\vskip0.5cm%
\begin{minipage}[c][1.6cm][c]{\textwidth}
\begin{beamercolorbox}[wd=\the\paperwidth,leftskip=3.5cm,#1]{author}
\usebeamerfont{author}\insertauthor%
\end{beamercolorbox}
\vskip0.2cm%
\begin{beamercolorbox}[wd=\the\paperwidth,leftskip=3.5cm,#1]{date}
\usebeamerfont{author}\insertdate%
\end{beamercolorbox}
\end{minipage}
\vfill
}
% I also tried to fix the title page navigation bar by redefining the title command
%\def\oldtitlepage\titlepage
%\def\titlepage{\setbeamertemplate{headline}{test}\oldtitlepage}
% Items
\setbeamertemplate{items}[square]
\setbeamertemplate{sections/subsections in toc}[square]
\begin{document}
{% I tried to remove the headline here
\setbeamertemplate{headline}{}
\begin{frame}
\titlepage
\end{frame}
}
\section{First section}
\subsection{1}
\begin{frame}
\frametitle{There Is No Largest Prime Number}
\framesubtitle{The proof uses \textit{reductio ad absurdum}.}
\begin{theorem}
There is no largest prime number. \end{theorem}
\end{frame}
\begin{frame}
\frametitle{There Is No Largest Prime Number}
\framesubtitle{The proof uses \textit{reductio ad absurdum}.}
\begin{theorem}
There is no largest prime number. \end{theorem}
\end{frame}
\end{document}