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}
Comments are in-code:
\documentclass{beamer}
\usetheme[width=1cm]{PaloAlto} %controls the width of the sidebar
\setbeamercolor{frametitle}{bg=red} %controls the color of the headline
\setbeamercolor{sidebar}{bg=red} %controls the color of the sidebar
\setbeamercolor{logo}{bg=red!70!black} %controls the color of the logo area
\makeatletter
\beamer@headheight=1.5\baselineskip %controls the height of the headline, default is 2.5
\makeatother
\begin{document}
\section{test}
\subsection{test}
\begin{frame}{a frame}
\framesubtitle{title}
test
\end{frame}
\end{document}
If you need a more drastic color restyling, i.e. affecting everything, consider using a specific color theme via \usecolortheme{<color theme name>}
How to find out what parameters need to be changed to customize a theme
There is no simple answer to this question. As a general procedure you could do the following:
- Check the Beamer user guide (in this case it tells us about the
width
theme option
If the beamer manual does not provide the info you are looking for, you need to check the source code.
- Check the theme file, located in
texmf-dist/tex/latex/beamer/themes/theme/
- The theme file will tell you what outer theme is used, so you can check that too:
texmf-dist/tex/latex/beamer/themes/outer/
The outer theme file is where the templates for the "look" of the presentation are generally stored. In this case, the sidebar
outer theme is used, which defines its own headline
template where the colors, width, ecc. are specified.
When you gain some confidence with the source code it is usually easy to go straight to the file that contains the relevant template.
Edit 2
\setbeamercolor{section in sidebar}{fg=...} %color of the active section
\setbeamercolor{section in sidebar shaded}{fg=...} %color of the inactive section
\setbeamercolor{subsection in sidebar}{fg=...} %color of the active subsection
\setbeamercolor{subsection in sidebar shaded}{fg=...} %color of the inactive subsection
\setbeamercolor{title in sidebar}{fg=...} %color of the presentation title
\setbeamercolor{author in sidebar}{fg=...} %color of the author
Best Answer
The title page sets the title content vertically centred using a
approach. You can replace the first
\vfill
with a fixed\vspace
. This replacement can be performed usingetoolbox
's\patchcmd
on thetitle page
beamer template (stored in\beamer@@tmpl@title page
). Add the following to your document preamble:You need to specify an appropriate value for
<len>
above. Here is the difference between the default (without the patch) and if you useĀ-15mm
: