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 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.

enter image description here

enter image description here

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 ?

share|improve this question
    
Can you reproduce this behaviour in the form of a minimal working example (MWE)? –  Werner Jan 13 at 19:03
add comment

2 Answers

up vote 7 down vote accepted

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

\usepackage[bottom]{footmisc}
share|improve this answer
    
Works as a charm thanks :) –  Patryk Jan 13 at 19:12
add comment

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.

enter image description here

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

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.