You are missing a final closing brace in the headline
definition:
\documentclass{beamer}
\usetheme{CambridgeUS}
\makeatletter
\setbeamertemplate{headline}{
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=\paperwidth,ht=2.75ex,dp=1ex,center]{author in head/foot}%
\usebeamerfont{section in head/foot}\insertshorttitle\hspace*{2ex}
\end{beamercolorbox}}% <- this closing brace was missing
}
\setbeamertemplate{footline}{
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
\usebeamerfont{title in head/foot}\insertshortauthor
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
\usebeamerfont{title in head/foot}\insertshortinstitute
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,right]{date in head/foot}%
\usebeamerfont{date in head/foot}\insertshortdate{}\hspace*{2em}
\insertframenumber{} / \inserttotalframenumber\hspace*{2ex}
\end{beamercolorbox}}%
\vskip0pt%
}
\makeatother
\author{The Author}
\title{The Title}
\institute{The Institute}
\begin{document}
\begin{frame}
test
\end{frame}
\end{document}
I took the liberty to slightly increase the height for the box in the headline (this is just a suggestion, of course, and you can revert to your original settings).
To suppress the headline
and footline
, use the plain
option for frame
; to suppress one template only, redefine it locally to be empty:
\documentclass{beamer}
\usetheme{CambridgeUS}
\makeatletter
\setbeamertemplate{headline}{
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=\paperwidth,ht=2.75ex,dp=1ex,center]{author in head/foot}%
\usebeamerfont{section in head/foot}\insertshorttitle\hspace*{2ex}
\end{beamercolorbox}}%
}
\setbeamertemplate{footline}{
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
\usebeamerfont{title in head/foot}\insertshortauthor
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
\usebeamerfont{title in head/foot}\insertshortinstitute
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,right]{date in head/foot}%
\usebeamerfont{date in head/foot}\insertshortdate{}\hspace*{2em}
\insertframenumber{} / \inserttotalframenumber\hspace*{2ex}
\end{beamercolorbox}}%
\vskip0pt%
}
\makeatother
\author{The Author}
\title{The Title}
\institute{The Institute}
\begin{document}
\begin{frame}[plain]
test
\end{frame}
\begingroup
\setbeamertemplate{headline}{}
\begin{frame}
test
\end{frame}
\endgroup
\begingroup
\setbeamertemplate{footline}{}
\begin{frame}
test
\end{frame}
\endgroup
\begin{frame}
test
\end{frame}
\end{document}
The only way I see to this is to define your own title page template.
The beamer
documentation claims that your example should not insert space for the institute, but that is not the observed behaviour.
Setting up your own title page template is fortunately not too complex: use \setbeamertemplate{title page}
and place the beamer
generated commands such as \inserttitle
etc. in a center
environment.
\documentclass{beamer}
\title{This is the title}
\author{The name}
\date{The date}
\titlegraphic{%
\begin{center}
\includegraphics[width=0.5\textwidth]{example-image-a}
\end{center}}
\setbeamertemplate{title page}
{\begin{center}
{\usebeamerfont{title}\usebeamercolor[fg]{title}\inserttitle}\\[1ex]
{\usebeamerfont{author}\usebeamercolor[fg]{author}\insertauthor}\\[1ex]
\insertdate\\
\inserttitlegraphic
\end{center}
}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\end{document}
Update
You now tell us you are using the CambridgeUS
theme. This loads the innertheme
rounded
which in turn calls the default title page
template with extra options colsep=-4bp,rounded=true,shadow=\beamer@themerounded@shadow
.
The best thing to do in this situation is to take the default template, defined in beamerinnerthemedefault.sty
, and define a new title page
template by removing the beamercolorbox
for the institute
. Calling this new template noinstitute
you can then set the title page up with
\makeatletter
\setbeamertemplate{title page}[noinstitute][colsep=-4bp,rounded=true,shadow=\beamer@themerounded@shadow]
\makeatother
The \makeatletter...\makeatother
is need because of the @
characters used in the internal names.
\documentclass{beamer}
\usetheme{CambridgeUS}
\title{This is the title}
\author{The name}
\date{The date}
\titlegraphic{%
\begin{center}
\includegraphics[width=0.5\textwidth]{example-image-a}
\end{center}}
\defbeamertemplate{title page}{noinstitute}[1][]
{
\vbox{}
\vfill
\begingroup
\centering
\begin{beamercolorbox}[sep=8pt,center,#1]{title}
\usebeamerfont{title}\inserttitle\par%
\ifx\insertsubtitle\@empty%
\else%
\vskip0.25em%
{\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle\par}%
\fi%
\end{beamercolorbox}%
\vskip1em\par
\begin{beamercolorbox}[sep=8pt,center,#1]{author}
\usebeamerfont{author}\insertauthor
\end{beamercolorbox}
\begin{beamercolorbox}[sep=8pt,center,#1]{date}
\usebeamerfont{date}\insertdate
\end{beamercolorbox}\vskip0.5em
{\usebeamercolor[fg]{titlegraphic}\inserttitlegraphic\par}
\endgroup
\vfill
}
\makeatletter
\setbeamertemplate{title page}[noinstitute][colsep=-4bp,rounded=true,shadow=\beamer@themerounded@shadow]
\makeatother
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\end{document}
Best Answer
The changes compared to the default title page are marked with comments: