7

I need to customize either the Berkeley or PaloAlto themes, or just the sidebar outer theme, in order to keep the logo in its default position (upper-left corner) while removing the sidebar. At the moment I have only been able to remove the sidebar (by using the width=0 option, but this removes the logo as well.

As a side issue, I would also like to add an horizontal gray rectangle along the bottom of the slides, that would be immaterial to content layout, that is, that its presence does not alter the output of any contents in the slides, in the sense of scaling or rearranging it anyhow.

1 Answer 1

5

You can redefine the headline and frametitle templates; an auxiliary length can be used to save the original sidebar width for later use. For the horizontal rectangle at the bottom, define the footline template using a beamercolorbox of the desired width, height (and depth) and use a previously defined color:

\documentclass{beamer}
\usetheme{PaloAlto}

\setbeamercolor{footlinebox}{fg=gray,bg=gray!60}

\makeatletter
\newdimen\tmpsbwd
\tmpsbwd=\beamer@sidebarwidth
\beamer@sidebarwidth=0pt
\setbeamertemplate{headline}
{%
  \begin{beamercolorbox}[wd=\paperwidth]{frametitle}
    \usebeamercolor[bg]{logo}%
    \hbox to \tmpsbwd{\hss\vbox to
      \beamer@headheight{\vss\hbox{\color{fg}\insertlogo}\vss}\hss}%
 \end{beamercolorbox}
}
\setbeamertemplate{frametitle}
{%
  \nointerlineskip%
  \vskip-\beamer@headheight%
  \vbox to \beamer@headheight{%
    \vfil
    \leftskip=-\beamer@leftmargin%
    \advance\leftskip by\tmpsbwd%
    \advance\leftskip by0.3cm%
    \rightskip=-\beamer@rightmargin%
    \advance\rightskip by0.3cm plus1fil%
    {\usebeamercolor[fg]{frametitle}\usebeamerfont{frametitle}\insertframetitle\par}%
    {\usebeamercolor[fg]
{framesubtitle}\usebeamerfont{framesubtitle}\insertframesubtitle\par}%
    \vbox{}%
    \vskip-1em%
    \vfil
  }%
}
\setbeamertemplate{footline}
{%
  \begin{beamercolorbox}[wd=\paperwidth,ht=1ex,dp=1ex]{footlinebox}
  \end{beamercolorbox}
}
\makeatother

\setbeamersize{sidebar width left=0cm}

\logo{\includegraphics[width=1.5cm]{cat}}

\begin{document}

\begin{frame}
\frametitle{Test title}
\framesubtitle{Test subtitle}
Test frame
\end{frame}

\end{document}

enter image description here

5
  • Thanks @GonzaloMedina ! What should I modify in order to set the height of the title bar? It looks to me it is set in terms of predefined variables like \vskip.
    – Luis E.
    Jun 19, 2012 at 16:31
  • @LuisE. the value controlling this height is \beamer@headheight; you can change this value and possibly will have to make some other adjustments. Jun 19, 2012 at 16:35
  • That worked well. Now for the footline, I don't get any visible output out of it. I have tried this: \setbeamertemplate{footline} {% \begin{beamercolorbox}[wd=\paperwidth,ht=1ex,dp=1ex]{footlinebox} \color{gray} \end{beamercolorbox} }
    – Luis E.
    Jun 19, 2012 at 16:49
  • @LuisE. comments are not the best place to write code. You can edit your original question and add the new problem. Jun 19, 2012 at 16:51
  • I had not seen the edit you made, adding definitions for fg and bg in the footlinebox. This now works as well. Thanks for the exceedingly quick help!
    – Luis E.
    Jun 19, 2012 at 17:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .