10

I'm using PaloAlto theme. I would like to have an image on the side of the slides instead of the navigation sidebar.

I tried :

\setbeamertemplate{sidebar}{
\includegraphics[scale=0.1]{image.jpg}
}

but there is still the sidebar with the navigation. How should I do this?

21

Firs set the sidebar canvas left template to be empty and then include the image using the sidebar left template:

\documentclass{beamer}
\usetheme[width=1.5cm]{PaloAlto}

\makeatletter
\setbeamertemplate{sidebar canvas left}{}
\setbeamertemplate{sidebar left}{%
  \vspace*{\fill}
  \includegraphics[width=1.5cm,height=5cm]{ctanlion}
  \vspace*{\fill}
}
\makeatother

\begin{document}

\frame{CTAN lion drawing by Duane Bibby.}

\end{document}

enter image description here

If you also want to remove the darker square in the upper left corner, add to the preamble the lines

\makeatletter
\setlength\beamer@sidebarwidth{0cm}
\makeatother

Now, as a new requirement in a comment, the OP decided that he/she needs a black sidebar, with an image in the middle and the author name in the botton. Here's the new code:

\documentclass{beamer}
\newlength\mywd
\setlength\mywd{1.5cm}
\usetheme[width=\mywd]{PaloAlto}

\makeatletter
\setbeamertemplate{sidebar canvas left}[vertical shading][top=black,middle=black,bottom=black]

\setbeamertemplate{sidebar left}{%
  \vspace*{\fill}
  \includegraphics[width=\mywd,height=3cm]{ctanlion}\par
  \vfill
  \parbox{\mywd}{\centering\textcolor{white}{\insertauthor}}
  \vspace*{0.6cm}
}
\setlength\beamer@sidebarwidth{0cm}
\makeatother

\author{The Author}
\begin{document}

\frame{CTAN lion drawing by Duane Bibby.}

\end{document}

enter image description here

If the black stripe must extend all the way up, an additional redefinition of the headline template will be necessary:

\documentclass{beamer}
\newlength\mywd
\setlength\mywd{1.5cm}
\usetheme[width=\mywd]{PaloAlto}

\makeatletter
\setbeamertemplate{sidebar canvas left}[vertical shading][top=black,middle=black,bottom=black]

\setbeamertemplate{sidebar left}{%
  \vspace*{\fill}
  \includegraphics[width=\mywd,height=3cm]{ctanlion}\par
  \vfill
  \parbox{\mywd}{\centering\textcolor{white}{\insertauthor}}
  \vspace*{0.6cm}
}
 \setbeamertemplate{headline}
  {%
    \begin{beamercolorbox}[wd=\paperwidth]{frametitle}
      \ifx\beamer@sidebarside\beamer@lefttext%
      \else%
        \hfill%
      \fi%
      \ifdim\beamer@sidebarwidth>0pt%
        \color{black}
        \vrule width\beamer@sidebarwidth height \beamer@headheight%
        \hskip-\beamer@sidebarwidth%
        \hbox to \beamer@sidebarwidth{\hss\vbox to
          \beamer@headheight{\vss\hbox{\color{fg}\insertlogo}\vss}\hss}%
      \else%
        \vrule width0pt height \beamer@headheight%  
      \fi%
    \end{beamercolorbox}
  }
\makeatother

\author{The Author}
\begin{document}

\frame{CTAN lion drawing by Duane Bibby.}

\end{document}

enter image description here

  • Thx, I would like the sidebar to be a bit larger than the logo. I need the logo to be in the center of the sidebar. How can I handle it? thank you – user17602 Aug 15 '12 at 14:05
  • Actually, I need a black sidebar with the logo in the middle and the author name in the bottom... – user17602 Aug 15 '12 at 14:13
  • 1
    @user17602 I updated my answer with the necessary adjustments. Plase, don't forget to accept my answer; in case of doubt on how/why to accept answers see How do you accept an answer?. – Gonzalo Medina Aug 15 '12 at 20:59
  • 1
    @user17602 please be a good citizen of this website and mark the answer as correct, if it is so. – Ricardo Cruz Nov 26 '15 at 17:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.