15

I found Using fancyhdr to create an image based header and footer which is helpful and gave some ideas but I want to basically put in the bottom right or center of the footer a different image file (pdf or jpg) for each page in a latex document.

Any suggestions?

Thanks a lot!

P.S. Sorry, I typically use article class with lots of mathtools in latex or xelatex, but I am very flexible!

1
  • 8
    Name your image file as image-1.png, image-2.jpg, etc and input them via \includegraphics{image-\arabic{page}}
    – JLDiaz
    Dec 13, 2012 at 0:36

1 Answer 1

20

As JLDiaz mentioned in his comment, you can name your images image-1.png, image-2.png, etc. and then use the fancyhdr package to include them using

\includegraphics[<options>]{image-\arabic{page}}

from the graphicx package. A complete example:

\documentclass{article}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{lipsum}% just to generate text for the example

\setlength\footskip{40pt}

\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{\thepage}
\fancyfoot[C]{\includegraphics[height=30pt]{image-\arabic{page}}}

\begin{document}

\lipsum[2-23]

\end{document}

enter image description here

Here's another possibility, using this time the background package:

\documentclass{article}
\usepackage{graphicx}
\usepackage[bottom]{background}
\usepackage{lipsum}% just to generate text for the example

\SetBgScale{1}
\SetBgContents{\includegraphics[height=30pt]{onebit-\arabic{page}}}
\SetBgVshift{40pt}
\SetBgOpacity{1}

\begin{document}

\lipsum[2-23]

\end{document}

enter image description here

Make sure to have as least as much images as the number of pages in your document.

After a comment, the idea is to have the images to the right, on the footer, but outside the text area; this can be accomplished, in the fancyhdr example, using \fancyfootoffset; a little example:

\documentclass{article}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{lipsum}% just to generate text for the example

\setlength\footskip{40pt}

\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{\thepage}
\fancyfoot[R]{\includegraphics[height=30pt]{image-\arabic{page}}}
\fancyfootoffset[R]{4cm}

\begin{document}

\lipsum[2-23]

\end{document}

enter image description here

With the background approach, one can use \SetBgHshift{<length>}.

2
  • @Medina Well it worked, but I was wanting to place it in the far right corner and the option [R] only places it on the right of the footer. The cite I quoted had the image all the way across. Similarly, is it possible to place these figures even right of the typical footer?
    – nate
    Dec 13, 2012 at 2:47
  • @nate please see the last example in my updated answer. Dec 13, 2012 at 2:54

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.