[Tex/LaTex] SideBar in Beamer

beamer

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?

Best Answer

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