4

I am making a presentation in which I need two logos at the bottom of a beamer. I manage to make it work with

\logo{%
  \makebox[1\paperwidth]{%
    \includegraphics[height=1cm,keepaspectratio]{ntnu.pdf}%
    %\hspace{390pt}
    \hfill%
    \includegraphics[height=1cm,keepaspectratio]{rose.pdf}%
  }%
}

or

\logo{%
  \makebox[1\paperwidth]{%  <--- THIS ONE IS IMPORTANT TOO
    \makebox[0pt][l]{\includegraphics[height=1cm]{example-image}}%
    %\hspace{440pt}
    \hfill%
    \makebox[0pt][r]{\includegraphics[height=1cm]{example-image}}%
  }%
}

However, alas, they are not perfectly aligned. The right logo is not as close to the edge as the left one (see the red area in the image below). image

\hfill is used to show to exemplify the problem but in reality I would like to use, for example, \hspace{} so that they are not completely at the edges.

\documentclass[aspectratio=169]{beamer}
\usetheme[compress]{Singapore}
\usepackage{graphicx}
\graphicspath{ {figures/} }
\usefonttheme{serif}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{graphicx}
\setbeamertemplate{caption}[numbered]
\setbeamersize{text margin left=14mm,text margin right=14mm} 
\setbeamertemplate{navigation symbols}{}

\title{ON GENERAL RELATIVITY}

\author{John Doe\inst{1}}

\institute[Eidgenössische Technische Hochschule Zürich (ETH)]
{
  \inst{1}%
  {PhD Candidate at the Department of Physics\\
  Eidgenössische Technische Hochschule Zürich (ETH)}}

\date{\today}

\subject{General relativity}

\newcommand{\nologo}{\setbeamertemplate{logo}{}}

% \logo{%
%   \makebox[1\paperwidth]{%
%     \includegraphics[height=1cm,keepaspectratio]{example-image}%
%     %\hspace{390pt}
%     \hfill%
%     \includegraphics[height=1cm,keepaspectratio]{example-image}%
%   }%
% }

\logo{%
  \makebox[1\paperwidth]{%
    \makebox[0pt][l]{\includegraphics[height=1cm]{example-image}}%
    \hspace{440pt}
    \hfill%
    \makebox[0pt][r]{\includegraphics[height=1cm]{example-image}}%
  }%
}

\begin{document}

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

\section*{OUTLINE}

\begin{frame}{OUTLINE}

\tableofcontents

\end{frame}

\section{INTRODUCTION}

\begin{frame}{INTRODUCTION}

INSERT INTRODUCTION.

\end{frame}

\section{THEORY}

\begin{frame}{THEORY}

INSERT THEORY.

\end{frame}

\section{METHOD(S)}

\begin{frame}{METHOD(S)}

INSERT METHOD(S).

\end{frame}

\section{RESULTS}

\begin{frame}{RESULTS}

INSERT RESULTS.

\end{frame}

\section{DISCUSSION}

\begin{frame}{DISCUSSION)}

INSERT DISCUSSION.

\end{frame}

\section{CONCLUSION}

\begin{frame}{CONCLUSION}

INSERT CONCLUSION.

\end{frame}

\section*{BIBLIOGRAPHY}

\nologo{
\begin{frame}{BIBLIOGRAPHY}

INSERT BIBLIOGRAPHY

\end{frame}

\section*{ACKNOWLEDGEMENTS}

\begin{frame}{ACKNOWLEDGEMENTS}

\centering{
\includegraphics[height=3cm,keepaspectratio]{example-image}%
\hspace{30pt}
\includegraphics[height=3cm,keepaspectratio]{example-image}%
}

\end{frame}
}

\end{document}
  • How do I make the two logos perfectly aligned (with constant separation from the edges on each side)?
  • Bonus: How do I remove certain sections from the navigation pane on the top? In this example, I would like to remove OUTLINE, BIBLIOGRAPHY, and ACKNOWLEDGEMENTS.
2
  • 1
    Someone already found out that the margin on the right side of the logo is 2.5pt. You can use this iinformation to position the logos exactly, I guess. Commented Dec 20, 2021 at 14:50
  • 1
    You can kern the logo by that 2.5pt, as in \logo{% \makebox[1\paperwidth]{% \makebox[0pt][l]{\includegraphics[height=1cm]{example-image}}% \hspace{440pt} \hfill% \makebox[0pt][r]{\includegraphics[height=1cm]{example-image}}% }\kern-2.5pt% } Commented Dec 20, 2021 at 14:54

1 Answer 1

2

I was wondering where this margin is defined and I finally found it in the defintion of sidebar right in the default outer theme, that is, in the file beamerouterthemedefault.sty:

\defbeamertemplate*{sidebar right}{default}
{
  \vfill%
  \llap{\insertlogo\hskip0.1cm}%
  \vskip2pt%
  \llap{\usebeamertemplate***{navigation symbols}\hskip0.1cm}%
  \vskip2pt%
}

You can see that this margin is set to 0.1cm (which is about 2.8pt). With this knowledge, it is now fairly easy to come up with an exact alignment of the two logos:

\documentclass[aspectratio=169]{beamer}
\usetheme[compress]{Singapore}
\usepackage{graphicx}
\graphicspath{ {figures/} }
\usefonttheme{serif}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{graphicx}
\setbeamertemplate{caption}[numbered]
\setbeamersize{text margin left=14mm,text margin right=14mm} 
\setbeamertemplate{navigation symbols}{}

\title{ON GENERAL RELATIVITY}

\author{John Doe\inst{1}}

\institute[Eidgenössische Technische Hochschule Zürich (ETH)]{
  \inst{1}%
  {PhD Candidate at the Department of Physics\\
  Eidgenössische Technische Hochschule Zürich (ETH)}}

\date{\today}

\subject{Frequency dependent wave velocities in sediments and sedimentary rocks}

\newcommand{\nologo}{\setbeamertemplate{logo}{}}

\logo{%
    \makebox[\paperwidth]{%
    \includegraphics[height=1cm]{example-image}%
    \hfill%
    \includegraphics[height=1cm]{example-image}%
    }\hskip-.1cm%
}

\show\hss

\begin{document}

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

\end{document}

enter image description here

3
  • Thank you for a third time, @Jasper Habicht! I also appreciate you taking the time to explain the default sidebar margin. Commented Dec 20, 2021 at 15:36
  • Again, I know I am annoyinging and asking too much, but do you know of a way to hide certain sections from the navigation pane at the top? I would like to hide outline, bibliography, and acknowledgements. If I simple do not use section for these, they will suddenly appear as points in the previous section. A bit off-topic, I know. Commented Dec 20, 2021 at 15:47
  • 1
    Exactly: You should post a new question. I have the feeling that it is not as simple as we might think if I look into the existing questions on this site ... =/ Commented Dec 20, 2021 at 16:18

You must log in to answer this question.

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