# How to ensure footnotes being at the same height on every page?

I have added a footnote to the text but I also have some "unbreakable" code listings. Because of that the footnote gets dragged "higher" in the page.

As you can see there's more space between page number and the text in the second picture. How can I ensure that footnotes are always on the same height ?

-
Can you reproduce this behaviour in the form of a minimal working example (MWE)? –  Werner Jan 13 '14 at 19:03

Package footmisc provides option bottom that forces the footnotes to the bottom of the page (useful for \raggedbottom).

\usepackage[bottom]{footmisc}

-
Works as a charm thanks :) –  Patryk Jan 13 '14 at 19:12

Adding a \vfill as part of the \footnoterule redefinition will push the footnote to the bottom of the page.

\documentclass{article}
\usepackage{lipsum}
\let\svfootnoterule\footnoterule
\renewcommand\footnoterule{\vfill\svfootnoterule}
\begin{document}
\lipsum[1-3]
This is a test\footnote{My footnote}
\lipsum[4]
\clearpage
\lipsum[1-3]
This is a test\footnote{My footnote}
\lipsum[3-4]
\end{document}


To clarify the approach, in response to a comment, the \let\svfootnoterule\footnoterule stores a copy the original definition of \footnoterule (which is the horizontal line above the footnote) under a new name for later use. Then, \renewcommand\footnoterule{\vfill\svfootnoterule} redefines the \footnoterule by adding stretchable glue (\vfill) and then reinvoking the saved definition.

-
This example also works but can you explain exactly what each line (word) of those 2 lines making the rule means ? –  Patryk Jan 13 '14 at 19:14
@Patryk Done, as requested. –  Steven B. Segletes Jan 13 '14 at 19:18
Thanks for that :) Although for me Heiko's answer provides easier approach. –  Patryk Jan 13 '14 at 19:31