[Tex/LaTex] How to add image to beamer footline and keep it align with the text

beamergraphicsheader-footer

I want to add an image to my footline and aligned with the text of the same footline.

I have the following in my beamertheme.

\def\logo{%
\resizebox{!}{2.5ex}{\includegraphics{logo-small.png}}
}

\mode<presentation>
\defbeamertemplate*{footline}{example theme}
{%
    \begin{beamercolorbox}[wd=\paperwidth,ht=2.5ex,dp=1.125ex,%
        leftskip=.3cm,rightskip=.3cm plus1fil]{separation line}
        \usebeamerfont{section in head/foot}%
        \insertshortauthor\hfill\insertshorttitle\hfill\logo
    \end{beamercolorbox}
}
\mode

Best Answer

You can modify the image height using \raisebox{<amount>}{<content>}. The \resizebox{!}{2.5ex}{...} is actually not required, you can use the width key of \includegraphics macro for the resizing:

\def\logo{%
  \raisebox{<amount>}{\includegraphics[width=2.5ex]{logo-small.png}}%
}

You could also load the adjustbox package with the export option, then you can use the raise key with \includegraphics:

\def\logo{%
  \includegraphics[width=2.5ex,raise=<amount>]{logo-small.png}%
}