You can use a minipage
, if you know the width of the sidebar. Then, \centering
works as expected.
\documentclass[serif]{beamer}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage[spanish]{babel}
\usepackage{mathpazo}
\linespread{1.05}
\author{Lorem ipsum}
\title{Lorem ipsum}
\setbeamertemplate{navigation symbols}{}
\usetheme[hideallsubsections,left,width=2cm]{Marburg}
\usecolortheme{rose}
\setbeamercolor{titlelike}{bg=structure,fg=white}
\logo{ \rule{1.4cm}{1.5cm}}%\includegraphics[height=1.5cm]{Logo.png}}
\setbeamertemplate{sidebar left}{
\begin{minipage}{2cm}
\centering
\vspace{-2\baselineskip}
\insertlogo
\vspace{\baselineskip}
\color{white}{\insertshorttitle[width={2cm},center,respectlinebreaks]}
\insertshortauthor[width={2cm},center,respectlinebreaks] \vspace{\baselineskip}
\insertverticalnavigation{2cm}
\vspace{4\baselineskip}
\insertframenumber
\end{minipage}
}
\begin{document}
\section{Lorem Ipsum}
\begin{frame}
\begin{minipage}[t]{0.45\textwidth}
fgns
\end{minipage}
\hfil
\begin{minipage}[t]{0.45\textwidth}
dtyjdy
\end{minipage}
\end{frame}
\section{Lorem Ipsum1}
\begin{frame}
\begin{minipage}[t]{0.45\textwidth}
fgns
\end{minipage}
\hfil
\begin{minipage}[t]{0.45\textwidth}
dtyjdy
\end{minipage}
\end{frame}
\end{document}
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}
Best Answer
You can use some of the already existing commands to add the information; for example, you can say something like