# fancyhdr with image and flowing text

I want to add a flipbook to my document. Everything seems to work (adding the write pictures. The only thing I'm looking for is making the text flow on every page around the image inserted with fancyfoot. Here's what I got.

\documentclass[twoside]{report}

\usepackage{fancyhdr}
\newcounter{flipbook_counter}
\fancyfoot[RO]{\setlength{\unitlength}{1mm}
\begin{picture}(0,-10)
\put(-24,-14){\includegraphics[width=5cm]{./flipbook/snia_frame\arabic{flipbook_counter}.png}}
\end{picture}
\stepcounter{flipbook_counter}
}

\begin{document}
\end{document}


MEW:

\documentclass[10pt,twoside,openright, pdftex]{report}

\usepackage{lipsum}
\usepackage{blindtext}
\usepackage[english]{babel}
\usepackage{fancyhdr}
\newcounter{flipbook_counter}

\pagestyle{fancy}
\usepackage[twoside=true]{geometry}
\geometry{%
driver=pdftex,%
b5paper,%
includefoot,%
twoside,%
inner=2cm,%
outer=1cm,%
vmargin={1cm,1cm},%
driver=pdftex%
}

\fancyfoot[RO]{\setlength{\unitlength}{1mm}
\begin{picture}(0,-10)
\put(-24,-14){\rule{5cm}{3cm}}
\end{picture}
\stepcounter{flipbook_counter}
}

\begin{document}
\Blinddocument
\end{document}

-
While code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. –  Peter Grill Nov 29 '11 at 22:40
agreed in most cases when debugging. But here I guess I just want to know about a way, how this could be possible. I can't provide a minimal working example as it is not really a problem. thx for the input though. –  Wolfgang Kerzendorf Nov 29 '11 at 23:48
I was suggesting that you add \documentclass, \begin{document}, \end{document} and any packages so that we can just cut and paste to see what you are talking about as opposed to reading code. –  Peter Grill Nov 29 '11 at 23:55
Note that you also have to set the pagestyle to fancy: \pagestyle{fancy} and use \usepackage{graphicx}. So, if I understand correctly, you have a full document and have some pictures you're inserting in the footer and you want the main document elements to wrap around the footer image? –  Werner Nov 30 '11 at 0:32
@Werner: Yes that is right. I now included \rule instead of include graphics. I have created an MWE. I hope that helps. –  Wolfgang Kerzendorf Nov 30 '11 at 0:44

It is possible to change the \textheight on even and odd pages using the everyshi package (Every Shipout). The code below uses the idea from

Different \marginparsep for odd and even pages?

It sounds like ideally you would like the text to wrap around the figure at the bottom of the text- my solution does not achieve this, but it might get you closer to what you want (or perhaps a guru on this site would know how to improve this).

\documentclass[twoside]{article}
\usepackage[textheight=15cm]{geometry}
\usepackage{lipsum}
\usepackage[demo]{graphicx}
\usepackage{fancyhdr}
\usepackage{everyshi}
\usepackage{xifthen}

\newcounter{flipbookcount}
\setcounter{flipbookcount}{1}

\fancyfoot[RO]{\setlength{\unitlength}{1mm}
\begin{picture}(0,10)
\put(-24,-34){\includegraphics[width=5cm]{mypic\theflipbookcount.png}}
\end{picture}
\stepcounter{flipbookcount}
}

\EveryShipout{%
\ifthenelse{\isodd{\value{page}}}%
{\global\textheight=20cm}% Next page is even
{\global\textheight=15cm}% Next page is odd
}

\begin{document}
\pagestyle{fancy}
\lipsum
\lipsum
\lipsum
\lipsum
\lipsum

\end{document}

-
@Werner: Thanks for the edit, forgot to remove them from testing :) –  cmhughes Dec 1 '11 at 0:02
Thank you very much. That is getting very close to what I want. Thanks for all the help I am wondering if I can significantly alter the geometry of the page. Have a rectangle missing on the lower edge. –  Wolfgang Kerzendorf Dec 1 '11 at 15:45
I want to give you guys credits for answering this question. But if I accept this answer no-one will look into it anymore? Do I just accept this and ask a new question about the geometry things on the page? –  Wolfgang Kerzendorf Dec 1 '11 at 15:54
@WolfgangKerzendorf Perhaps a new question is in order- a lot of people probably focused on the image side of things here. If you pose a new question, try and include a screenshot detailing exactly what you want :) –  cmhughes Dec 1 '11 at 17:03
I opened a new question tex.stackexchange.com/questions/36848/non-rectangular-geometry I also have trouble getting your example to work in my document. As it seems to always set the textheight to the smaller one. Do I need to get rid of \global ? I will play around with it a bit, more. –  Wolfgang Kerzendorf Dec 1 '11 at 21:18
show 1 more comment

I would just increase the bottom area to about 30mm and have the picture inserted as:

\fancyfoot[RO]{\setlength{\unitlength}{1mm}
\begin{picture}(0,-10)
\put(-24,-22){\rule{5cm}{3cm}}
\end{picture}
\stepcounter{flipbook_counter}
}


What you are asking as Werner noted in the comments, is not possible with LaTeX.

-
At least show how you would "increase the bottom area", perhaps also by constructing an MWE. –  Werner Nov 30 '11 at 3:45
Not possible and LaTeX are fortunatley not often in the same sentence. Unfortunatley that seems to be the case in my example. Anyways, I am interested in knowing how to increase the bottom area on every odd page. –  Wolfgang Kerzendorf Nov 30 '11 at 4:18
So I tried to change the bottom margins on even and odd pages, by adding a \newgeometry{bottom=5cm} on the \fancyfoot[RO] which did not work. any suggestions? –  Wolfgang Kerzendorf Nov 30 '11 at 15:49