4

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 ?

1

2 Answers 2

7

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

\usepackage[bottom]{footmisc}
0
3

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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .