1

I want to create a presentation in beamer. Like this question, I want to have two logos in opposite side on beamer, but my template have sidebar too. I also used this question to prevent logo from title page in beamer class. But the problem is one of the logos goes out of the slide.

I tried \centering command then add space between logos, so they get set on opposite sides but it didn't help. I think one possible solution is using PGF package, but that is my last resort.

\documentclass{beamer}
\usetheme{Berkeley}

\logo{%
  \makebox[0.2\paperwidth]{%
    \includegraphics[width=1cm,keepaspectratio]{example-image-a}%
    \hfill%
    \includegraphics[width=1cm,keepaspectratio]{example-image-b}%
  }%
}

\title{The Title}
\author{The Author}
\institute{The Institute}

\begin{document}

{
\setbeamertemplate{logo}{}
\begin{frame}
\maketitle
\end{frame}
}

\begin{frame}
test
\end{frame}

\end{document}

What I want is something like this.

Desired result

  • I don't quite understand where you want the logos to be. Can you make an image showing the desired result? – jens_bo Dec 4 '14 at 8:47
  • @Harald it looks like a duplicate. PaloAlto and Berkeley use the sidebar outer theme. The only difference between the linked and my solution seem to be, that the other one repeats the vrule and hskip lines to get the darker background on the right too. – jens_bo Dec 4 '14 at 10:25
  • @jens_bo maybe we should move the answers to the old question and close this one? – Harald Dec 4 '14 at 10:26
  • @Harald, that would be fine with me. – jens_bo Dec 4 '14 at 10:31
1

This might work:

I will add a longer explanation how I came to this solution (and I am by far a Beamer expert), so other can see how to approach problems like this.

First you see that the used theme is "Berkeley", so going into the definition file beamerthemeBerkeley.sty (just google it and you'll find the code).

There we can see that the outer theme (the one responsible for the sidebar and title and all) is "sidebar", so next we take a look at beamerouterthemesidebar.sty and search for the keyword logo and see that it is used in the headline definition.

What I did then is edit the definition to add another logo (logoright) the the right side (by copy and paste with an \hfill inbetween) and define some commands to set the logo. Just adjust the size of the images to your liking.

enter image description here

\documentclass{beamer}
\usetheme{Berkeley}

\def\insertlogoright{\usebeamertemplate*{logoright}}
\def\logoright{\setbeamertemplate{logoright}}

\makeatletter
  \defbeamertemplate*{headline}{mycustom theme}
  {%
    \begin{beamercolorbox}[wd=\paperwidth]{frametitle}
      \ifx\beamer@sidebarside\beamer@lefttext%
      \else%
        \hfill%
      \fi%
      \ifdim\beamer@sidebarwidth>0pt%  
        \usebeamercolor[bg]{logo}%
        \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}%
        \hfill%
        \hbox to \beamer@sidebarwidth{%
        \hss%
        \vbox to \beamer@headheight{%
        \vss\hbox{\color{fg}\insertlogoright}\vss%
        }%
        \hss}%
      \else%
        \vrule width0pt height \beamer@headheight%  
      \fi%
    \end{beamercolorbox}
  }
\makeatother

\logo{\includegraphics[width=1.2cm,keepaspectratio]{example-image-a}}
\logoright{\includegraphics[width=1.2cm,keepaspectratio]{example-image-b}}


\title{The Title}
\author{The Author}
\institute{The Institute}

\begin{document}

{
 \setbeamertemplate{logo}{}
 \setbeamertemplate{logoright}{}
 \begin{frame}
  \maketitle
 \end{frame}
}

\begin{frame}{this}
 test
\end{frame}

\end{document}
1

Its a dirty hack, but If you want to avoid pgf, try this

\logo{%
  \makebox[1.85\paperwidth]{%
        \hfill%
        \hspace{3em}
        \includegraphics[width=1cm,keepaspectratio]{example-image-a}%
        \hfill%
        \includegraphics[width=1cm,keepaspectratio]{example-image-b}%
  }%
}

The idea: the logo is centered in the top left corner. If you make the box big enough (around 2 times the page width) it will extend to the top right corner. Then place the logo in the center and right end of the box.

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