3

How can I align logo and page number at the same level? Now it seems logo on top of page number.

\documentclass[t]{beamer}
\beamertemplatenavigationsymbolsempty
\setbeamertemplate{footline}[frame number]
\logo{\makebox[1\paperwidth]{\includegraphics[width=.5cm,keepaspectratio]{logo.png}}}

\begin{document}

\begin{frame}[c]{Hello world}
\begin{itemize}
\item item 1
\item item 2
\item item 3
\end{itemize}
\end{frame}

\end{document}

Output:

enter image description here

1
  • Do you want to move the logo "downwards" so as to be at the same level with the frame number () or do you want to just move it to the right (as in the answer below) so the logo and the frame number are both aligned to the right? Feb 13, 2015 at 13:16

3 Answers 3

3

If you want the logo to appear centered in the footline, you need to redefine the footline template as implemented by the frame number option (original code in beamerbaseauxtemplates.sty) and to set the sidebar right template to be empty (this is the template where the logo goes in the default theme). The following example shows this redefinition (you might need to adjust the lengths in the \raisebox to suit your needs):

\documentclass[t]{beamer}
\beamertemplatenavigationsymbolsempty
\setbeamertemplate{footline}[frame number]
\logo{\includegraphics[width=.5cm,keepaspectratio]{tux}}

\setbeamertemplate{sidebar right}{}
\defbeamertemplate*{footline}{logo-frame number}
{
  \rlap{\raisebox{-1.75ex}[0pt][0pt]{\makebox[\paperwidth]{\insertlogo}}}%
  \hfill%
  \usebeamercolor[fg]{page number in head/foot}%
  \usebeamerfont{page number in head/foot}%
  \insertframenumber\,/\,  \inserttotalframenumber\kern1em\vskip2pt%
}

\begin{document}

\begin{frame}[c]{Hello world}
\begin{itemize}
\item item 1
\item item 2
\item item 3
\end{itemize}
\end{frame}

\end{document}

The result:

enter image description here

If all you want to do is to flush the logo to the left, all you have to do is to get ride of your \makebox:

\documentclass[t]{beamer}
\beamertemplatenavigationsymbolsempty
\setbeamertemplate{footline}[frame number]
\logo{\includegraphics[width=.5cm,keepaspectratio]{tux}}

\begin{document}

\begin{frame}[c]{Hello world}
\begin{itemize}
\item item 1
\item item 2
\item item 3
\end{itemize}
\end{frame}

\end{document}

The result:

enter image description here

3
  • I wish to put the logo at top right corner, is it possible?
    – lucky1928
    Feb 13, 2015 at 23:38
  • @lucky1928 Sure it's possible. Feel free to open a fresh new question (your request is not directly related to the issue discussed here). Don't forget to mention the theme(s) used and the exact desired position for the logo. Feb 14, 2015 at 0:01
  • Thanks, create a new topic put logo on top right corner in beamer
    – lucky1928
    Feb 14, 2015 at 1:01
3

By default \makebox has center alignment. So you have to use

\makebox[\paperwidth][r]{....}

to flush things to the right. Another simpler way is this:

\pgfdeclareimage[height=0.5cm]{logo}{logo.png}
\logo{\pgfuseimage{logo}\quad}

I have added `\quad to push the image little to the left so as to align with the page number.

\documentclass[t]{beamer}
\beamertemplatenavigationsymbolsempty
\setbeamertemplate{footline}[frame number]
%\logo{\makebox[\paperwidth][r]{\includegraphics[width=.5cm,keepaspectratio]{logo.png}\quad}}
\pgfdeclareimage[height=0.5cm]{logo}{logo.png}
\logo{\pgfuseimage{logo}\quad}

\begin{document}

\begin{frame}[c]{Hello world}
\begin{itemize}
\item item 1
\item item 2
\item item 3
\end{itemize}
\end{frame}

\end{document}

enter image description here

1

To put logo at any place you wish, we can use pgf as below:

\documentclass[t]{beamer}
\beamertemplatenavigationsymbolsempty
\setbeamertemplate{footline}[frame number]

\usepackage{pgf}  
\logo{\pgfputat{\pgfxy(0,7)}{\pgfbox[right,base]{\includegraphics[width=1.6cm]{logo.png}}}}

\begin{document}

\begin{frame}[t]{Hello world}
\begin{itemize}
\item item 1 Test line with loooooooooooooooooooooong text to cross the image 
\item item 2
\item item 3
\end{itemize}
\end{frame}

\end{document}

Output:

enter image description here

Still few questions:

  • pgf coordinate seems strange, (0,7) now located at top right corner.
  • Wish to use a page height variable to replace 7, but still not got it.
4
  • That's what I want.
    – lucky1928
    Feb 14, 2015 at 22:00
  • Please, don't use answers to ask new questions. Use a fresh new proper question for this. Feb 14, 2015 at 22:33
  • Sorry about that, but I don't want new question being duplicated so just ask it here!it actually current question's solution but still need some improve I think.
    – Beatlej
    Feb 14, 2015 at 22:43
  • @Beatlej I don't think your new question will be a duplicate; in any case, asking new questions in an answer is not an accepted or encouraged practice around here; furthermore, not many people will see your question and it will barely receive any attention. I'd advise you to open a new question. Feb 15, 2015 at 1:19

You must log in to answer this question.

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