I'm making a title slide using the tikzpicture
environment, and I'm left with some mystery margins on the top and on the left of the title slide. How can I fix this properly (i.e., not by simply futzing with hspace
and vpace
[unless by "informed futzing"])? I'm using the Copenhagen theme, which uses the split
outer theme. The split
outer theme defines a headline
element with height 2.5ex
, but I'm not sure how to use this information or how to determine the source of the left margin.
Here is the example:
File: main.tex
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetheme{Copenhagen}
\setbeamertemplate{navigation symbols}{}
\setbeamercolor{background canvas}{bg=yellow}
\defbeamertemplate*{title page}{customtitlepage}{%
\begin{tikzpicture}
\fill[color=red, draw=none] (0,0.5\paperheight) rectangle(\paperwidth, \paperheight);
\node[text width=\paperwidth, align=center, draw=green]
at (0.5\paperwidth,1.0cm)
{\color{black}\footnotesize\insertdate};
\node[text width=\paperwidth, align=center, draw=green]
at (0.5\paperwidth,2.0cm)
{\color{black}\normalsize\insertinstitute};
\node[text width=\paperwidth, align=center, draw=green]
at (0.5\paperwidth,2.5cm)
{\color{black}\Large\insertauthor};
\node[anchor=north west, text width=0.5\paperwidth,align=right,draw=green]
at (0.5\paperwidth,0.5\paperheight)
{\color{black}\footnotesize\insertsubtitle};
\node[anchor=south, text width=\paperwidth,align=left,draw=green]
at (0.5\paperwidth,0.5\paperheight)
{\color{yellow}\Large{\bf\inserttitle}};
\end{tikzpicture}
}
\makeatletter
\def\maketitle{%
\ifbeamer@inframe
\thispagestyle{empty}\titlepage
\else
\frame{\thispagestyle{empty}\titlepage}
\fi
}
\makeatother
\author{Joe Shmoe}
\title{The Battle of Turtle Gut Inlet}
\subtitle{The first privateer battle of the American Revolutionary War}
\institute{Continental Navy}
\date{July 4th, 1776}
\begin{document}
\begin{frame}
\maketitle
\end{frame}
\section{Normal Section}
\subsection{Normal Subsection}
\begin{frame}{Normal Frame}
Normal things
\end{frame}
\end{document}
The output is below. The red rectangle, as well as the bounding boxes of all the text nodes (except the subtitle node), should be flush with the left edge of the slide, but they are not. Also, the red rectangle should be flush with the top edge of the slide, but it is not.
Title slide:
Normal slide (for context):