# Add logos in upper left and right corner of Malmoe theme in beamer

I'm trying to add a logo into the upper left and upper right corners of the Malmoe theme. I'm sure it doesn't matter, but just in case, I'm using the Whale color theme. I've tried several things, but the following is what got me the closest to what I want:

\documentclass{beamer}
\usetheme{Malmoe}
\usecolortheme{whale}
\title{can't get this to work}
\usepackage[absolute,overlay]{textpos}

\begin{document}

\begin{frame}
\titlepage
\end{frame}

\begin{textblock*}{25mm}(0,0.25cm)
\includegraphics[width=1.5cm,keepaspectratio]{psumarks/pms287-noBorder.png}
\end{textblock*}}

\section{Section 1}
\begin{frame}{Title}
Why isn't this working?
\end{frame}

\end{document}


However, the color in the section of the slide that I want to put the logo in disappears. I've attached an example below. The upper left should be black, not white. And yes, I realize that the logo in this particular example is larger than the section itself would be, but that's not the case for the presentation that I'm trying to use this for. Any help would be much appreciated.

Also, ignore the black border around the slide.

• But then the logos will interfere with the headline and the eventual frame title. Are you sure this is the desired position using this theme? – Gonzalo Medina Jul 22 '14 at 21:28

Here's one option, defining a headline template to accomodate the logos at the desired locations:

\documentclass{beamer}
\usetheme{Malmoe}
\usecolortheme{whale}

\def\includelogoi{\includegraphics[width=1.5cm,keepaspectratio]{example-image-a}}
\def\includelogoii{\includegraphics[width=1.5cm,keepaspectratio]{example-image-b}}

\makeatletter
{%
\leavevmode%
\@tempdimb=2.4375ex%
\ifnum\beamer@subsectionmax<\beamer@sectionmax%
\multiply\@tempdimb by\beamer@sectionmax%
\else%
\multiply\@tempdimb by\beamer@subsectionmax%
\fi%
\ifdim\@tempdimb>0pt%
\vbox to\@tempdimb{%
\smash{\raisebox{-\height}{\includelogoi}}%
}%
\end{beamercolorbox}%
\vbox to\@tempdimb{%
\hfill\smash{\raisebox{-\height}{\includelogoii}}
}%
\end{beamercolorbox}%
\fi%
}
\makeatother

\begin{document}

\begin{frame}
\titlepage
\end{frame}

\section{Section}
\begin{frame}
test
\end{frame}
\subsection{Subsection}
\begin{frame}
test
\end{frame}

\section{Section}
\begin{frame}
test
\end{frame}
\subsection{Subsection}
\begin{frame}
test
\end{frame}

\section{Section}
\begin{frame}
test
\end{frame}
\subsection{Subsection}
\begin{frame}
test
\end{frame}

\section{Section}
\begin{frame}
test
\end{frame}
\subsection{Subsection}
\begin{frame}
test
\end{frame}

\section{Section}
\begin{frame}
test
\end{frame}
\subsection{Subsection}
\begin{frame}
test
\end{frame}

\section{Section}
\begin{frame}
test
\end{frame}
\subsection{Subsection}
\begin{frame}
test
\end{frame}

\end{document}


• Thanks Gonzalo. In my actual presentation, there's enough sections and the logo is small enough that, if I can get it to work, the logo should be completely contained within the section and subsection bars and not interfere with anything else. – Cody Messick Jul 23 '14 at 0:14
• I tried your solution, and in my small example tex file it worked if I comment out the insertsubsectionnavigationhorizontal lines. If I don't though, I get these error messages: i740.photobucket.com/albums/xx41/cody_messick/… i740.photobucket.com/albums/xx41/cody_messick/… – Cody Messick Jul 23 '14 at 0:20
• @CodyMessick the error message is not the best thing to provide. Please compose a little complete document (like the one in my answer) allowing us to reproduce the problem and add it as an edit to your question. – Gonzalo Medina Jul 23 '14 at 0:28
• Oh that makes sense. It looks like the code I have is too long for the character limit, is there a way around that? – Cody Messick Jul 23 '14 at 1:05
• @CodyMessick Try reducing the code to a minimum but still allowing us to reproduce the problem. Otherwise, you can upload the code elsewhere and provide a link in your next comment so I can take a look at it in some hours. – Gonzalo Medina Jul 23 '14 at 1:34