I am creating my own beamer
theme, and the way I have conceived the title page needs the title to be inside a tikzpicture
node, in this form:
\node [anchor=center] (title) at ($(box)+(0,.25)$) {%
\color{white}
{\usebeamerfont{title}\inserttitle}
};
It works perfectly until I need to insert long titles and need to break the lines…
If I do:
\title[academic background \& research experience]
{Academic background \& \\ Research experience}
I get the error:
! LaTeX Error: Something's wrong--perhaps a missing \item.
And if I do:
\usepackage{pbox}
\title[academic background \& research experience]
{\pbox{20cm}{Academic background \& \\ Research experience}}
I get the warning:
Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):
(hyperref) removing `\pbox '
Does anybody know what is happening here?
EDIT: Please find a MWE below (I have the relevant lines in a .sty
file, but adding them inside \mode<presentation>{}
works as well)
\documentclass[ignorenonframetext]{beamer}
\mode<presentation> {
\usetheme{Berkeley}
\usecolortheme{albatross}
%PACKAGES, LIBRARIES AND ENVIRONMENTS HERE
\usepackage{tikz}
\usetikzlibrary{calc}
\title[academic background \& research experience]{Academic background \& Research experience}
\author{Name Surname}
\date[\today]{\today}
\setbeamertemplate{title page}{
\begin{tikzpicture}[remember picture,overlay, every node/.style={inner sep=0,outer sep=0}]
\node [rectangle, fill=gray, anchor=north east, minimum width=.86\paperwidth, minimum height=3cm] (box) at (current page.north east){};
\node [anchor=center] (title) at ($(box)+(0,.25)$) {%
\color{white}
{\usebeamerfont{title}\inserttitle}
};
\ifx\insertauthor\@empty
\else
\node [anchor=west] (author) at ($(title.south west)-(0,.5)$) {%
\color{white}
{\usebeamerfont{author}\insertauthor}
};
\fi
\ifx\insertdate\@empty
\else
\node [anchor=west] (date) at ($(title.south west)-(-.2,2)$) {%
\color{blue}
{\usebeamerfont{date}\insertdate}
};
\fi
\end{tikzpicture}
}
}
\begin{document}
\begin{frame}[plain]
%\frametitle{SCB Departmental WIP - July 2013}
\titlepage % Print the title page as the first slide
\end{frame}
\end{document}
Best Answer
Simply pass the
align=<value>
key to thetitle
node and/or usetext width=<length>
, so line breaks are allowed.Here's a little example completing your snippets to a complete example:
Aldo, modifications to the font of the contents of a node are better done using the
font
key (as in my example) instead of doing them directly in the node contents (as in your code).