I am trying to get the footnote to appear on the same page (1st) as the reference of it in the main text but it appears on the next page (2nd) instead.
The closest to my problem I can find is Footnote appears on next page. Why? but my problem does not seem to be too little space on the page. In fact, when I add something to the paragraph to make it longer and reduce the space at the bottom of the page, the footnote can then appear on the 1st page with pretty much nothing else changed about the layout.
The reduced source code is the following,
\documentclass[letter]{article}
\usepackage{setspace}
\begin{document}
\small \rm
\setstretch{2.0}
a aj jfskdj pojsdf jasdfj jjiaosdjf jaisdojf ajsidfj oaijds fsojijf sd,
\vspace{11cm}
a aj jfskdj pojsdf jasdfj jjiaosdjf jaisdojf ajsid\footnote{fasu tuthwery ;xncdnbcd},
jpaisdjpfoiadsj fpajdspfiajsdpoijfapodsfjpoiadj
fpoiajsdfpoiajdskajsdpof fiosd f asd faijdf a df a jfpo oiaf pa pfoija
jpaisdjpfoiadsj fpajdspfiajsdpoijfapodsfjpoiadj
fpoiajsdfpoiajdskajsdpof fiosd f asd faijdf a df a jfpo oiaf pa pfoija
jpaisdjpfoiadsj fpajdspfiajsdpoijfapodsfjpoiadj
fpoiajsdfpoiajdskajsdpof fiosd f asd faijdf a df a jfpo oiaf pa pfoija
jpaisdjpfoiadsj fpajdspfiajsdpoijfapodsfjpoiadj
fpoiajsdfpoiajdskajsdpof fiosd f asd faijdf a df a jfpo oiaf pa pfoija
% Uncomment the following to fix the problem...
% jpaisdjpfoiadsj fpajdspfiajsdpoijfapodsfjpoiadjjpaisdjpfoiadsj fpajdspfiajsdpoijfapodsfjpoiadj
% fpoiajsdfpoiajdskajsdpof fiosd f asd faijdf a df a jfpo oiaf pa pfoija
\subsubsection{jpai sdjp foiadsj fpajdsp fia jsdpoij fapods fjpoiadj}
\begin{figure}
\centering
\caption{
JHLHL Jlkjaklsdf jalksjdf kja;d fa;skldjf ;aksdjf japisodf
jpaisdjpfoiadsj fpajdspfiajsdpoijfapodsfjpoiadj
fpoiajsdfpoiajdskajsdpof fiosd f asd faijdf a df a jfpo oiaf pa pfoija
pdo fpaisodf aosdjf ia psfj aspoidjaposifjpaiod fpiaos fpais pfoa sdpoif sdf}
\end{figure}
jpaisdjpfoiadsj fpajdspfiajsdpoijfapodsfjpoiadj
fpoiajsdfpoiajdskajsdpof fiosd f asd faijdf a df a jfpo oiaf pa pfoija
jpaisdjpfoiadsj fpajdspfiajsdpoijfapodsfjpoiadj
fpoiajsdfpoiajdskajsdpof fiosd f asd faijdf a df a jfpo oiaf pa pfoija
\end{document}
and I can reproduce this issue using either pdflatex
or xelatex
.
This comes out of a 200+ pages document so I would really like a robust and automatic solution so that I don't need to manually review the document everytime there's a change... I would also like to understand why this is happening. It really seems that the footnote can fit on the first page without any problems. Any notes about the internal or how to debug something like this will also be appreciated.
Note: This issue is sensitive to the space available at the bottom of the first page so it's fairly sensitive to how much space the content on the first page takes. I'm not really looking for advance on how to change that to avoid hitting this issue. If you made any change to the document that causes the issue to go away, try changing the vspace value a little to see if it merely stops triggering the issue due to the chang in the vertical position. The text before the section header should be on the first page with just enough room at the bottom of the page whereas the figure and the section should be on the second page. I'd like the footnote to be on the first page but it appears on the second one even when there's clearly enough space on the first one.
I'm using TeX Live 2020.57066 on Arch Linux. Also reproduced on overleaf using pdfLatex and texlive version 2020 (currently the default).
bigfoot
package somehow fixes this as a side effect. You can try that.