Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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\headrulewidth{0pt}
\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?

share|improve this question
2  
Please provide a full minimal working example (MWE) that illustrates your problem. –  N.N. Sep 29 '11 at 9:31
1  
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
1  
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
1  
@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

1 Answer 1

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}}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.