# Align text and logo in footer

I can't seem to be able to align our logo and page number in the footer. I have the code below:

``````\pagestyle{fancy} % enable fancy page style
\renewcommand\footrulewidth{0pt}
\fancyhf{} % clear header and footer
\fancyhead[L]{\leftmark} % leftmark shows the chapter, rightmark shows the section.
\fancyfoot[C]{\thepage}
\fancyfoot[R]{ % right
\includegraphics[scale=0.5]{general_images/logo.png}
}
``````

How can I align the page number and the logo? Any ideas?

-
Please provide a full minimal working example (MWE) that illustrates your problem. – N.N. Sep 29 '11 at 9:31
You want them aligned how? We can't see your logo image. How big is the logo? Should the bottom of the logo align with the baseline of the text? Should the top of the logo align with the baseline plus the ex height? Explain what you want. "align" is pretty vague... – Seamus Sep 29 '11 at 9:36
If I'm understanding your question correctly, there's another question asking about the same thing: tex.stackexchange.com/questions/2440/…. Please let us know if that solves your problem. If so, we'll probably close this question as a duplicate. – doncherry Sep 29 '11 at 15:27
@doncherry: Now I see your link--yes, very similar question. If the answer here (with calculation for different alignment) would be a bit more useful, we might mark the other existing question as duplicate instead. – Stefan Kottwitz Sep 29 '11 at 15:49
Thanks you can close this question if you like. – Dimitris Sep 30 '11 at 13:37

With `\includegraphics`, the base line for alignment is at the bottom. You could use `\raisebox` to raise or to lower the image. The `calc` package can help in calculating if required. For example for top alignment

``````\usepackage{calc}
\fancyfoot[R]{
\raisebox{1.2ex-\height}{\includegraphics{logo.png}}}
``````

or with more calculation

``````\usepackage{calc}
\newlength{\myheight}
\fancyfoot[R]{
\settoheight{\myheight}{\thepage}
\raisebox{\myheight-\height}{\includegraphics{logo.png}}}
``````

or for middle alignment instead

``````\raisebox{.5\myheight-.5\height}{\includegraphics{logo.png}}
``````
-