4

I am just starting to do my presentations with LaTex beamer, so I am not so familiar with all the concepts. Right now I have the problem, that the logo changes its position, when the frametitle is so long, that it has to split into two lines. I insert the logo with:

\addtobeamertemplate{frametitle}{}{%
       \begin{textblock*}{100mm}(.81\textwidth,7.2cm)
        \includegraphics[width=2cm]{logo.png}
        \end{textblock*}}

I want it to stay where it is indepenedet of the length of the framtitle. Can somebody explain me the problem? Thank you! Here is a minimal example without titlepage etc.

\documentclass[10pt]{beamer}
\usepackage[utf8x]{inputenc}
\usepackage{textpos}
\usepackage{graphicx, caption, subcaption, tabularx, tikz, textpos}
\usepackage{appendixnumberbeamer}

\usetheme{Hannover}
\usecolortheme{rose}
\useoutertheme{infolines}

\useinnertheme{circles}
\logo{\includegraphics[width = 3.5cm]{logo.png}}

\begin{document}

\setbeamertemplate{footline}
{
  \leavevmode%
  \hbox{%

  \begin{beamercolorbox}[wd=\paperwidth,ht=2.25ex,dp=1ex,right]{date in head/foot}%
    \usebeamerfont{date in head/foot}\insertshortdate{}\hspace*{2em}
     \insertframenumber{} / \inserttotalframenumber\hspace*{2ex} 
  \end{beamercolorbox}}%
  \vskip0pt%
}

\setbeamertemplate{navigation symbols}{}


\setbeamertemplate{headline}{} 




\addtobeamertemplate{frametitle}{}{%
   \begin{textblock*}{100mm}(.81\textwidth,7.2cm)
    \includegraphics[width=2cm]{logo.png}
    \end{textblock*}}
\begin{frame}
   \frametitle{LIBS and Raman spectroscopy}
\end{frame}

\begin{frame}
   \frametitle{LIBS and Raman spectroscopy for Solar System exploration}
\end{frame}

   \end{document}

First slide where everthing is fine Second slide where the logo is moved down

3

Quick hack: Instead of abusing the frametitle to add your logo, abuse the navigation symbols

Also please don't load packages multiple times and you don't need graphicx with beamer.

\documentclass[10pt]{beamer}
\usepackage[utf8x]{inputenc}
%\usepackage{textpos}
%\usepackage{graphicx}
\usepackage{caption, subcaption, tabularx, tikz, textpos}
\usepackage{appendixnumberbeamer}

\usetheme{Hannover}
\usecolortheme{rose}
\useoutertheme{infolines}

\useinnertheme{circles}
\logo{\includegraphics[width = 3.5cm]{logo.png}}

\setbeamertemplate{footline}{
  \leavevmode%
  \hbox{%
  \begin{beamercolorbox}[wd=\paperwidth,ht=2.25ex,dp=1ex,right]{date in head/foot}%
    \usebeamerfont{date in head/foot}\insertshortdate{}\hspace*{2em}
     \insertframenumber{} / \inserttotalframenumber\hspace*{2ex} 
  \end{beamercolorbox}}%
  \vskip0pt%
}

\setbeamertemplate{navigation symbols}{\includegraphics[width=2cm]{example-image}}
\setbeamertemplate{headline}{} 

\begin{document}

\begin{frame}
   \frametitle{LIBS and Raman spectroscopy}
\end{frame}

\begin{frame}
   \frametitle{LIBS and Raman spectroscopy for Solar System exploration}
\end{frame}

   \end{document}
  • Can you explain what you corrected? :) – AndréC Aug 20 '18 at 9:19
  • @AndréC I corrected nothing, just replaced one hack with another :) – user36296 Aug 20 '18 at 9:22
  • I misspoke, I'm sorry. The question code written by @Tini doesn't work, yours works, what did you do to make it work? – AndréC Aug 20 '18 at 9:27
  • @AndréC Other than missing images, the code in the OP works for me. What errors do you get? – user36296 Aug 20 '18 at 9:32
  • I can no longer see the image on the second slide of the slide show. – AndréC Aug 20 '18 at 9:33

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.