3

I am currently finishing a book project, and there it sometimes happens that the text of the footnote appears a page too early, meaning not on the same page as the footnote reference but one before that.

LaTeX seems to do this as a last resort when there is no other way of constructing the page (since it only happens with long, rather complex texts, I was unable to come with a MWE).

The only remedy is in most cases simply to change the texts (or sometimes the arrangement of figures). What I am looking for is not a way to avoid this, but to spot this behaviour more easily. Is it possible to make LaTeX track such footnotes and mark them in some way so they are easy to spot?

EDIT

Here is now a MWE which shows the problem. The text of the footnote is on the second page while the reference is on the third.

\documentclass{scrbook}
\usepackage{geometry}
\geometry{paperheight=22.5cm, 
paperwidth=15.5cm,
inner=1.9cm,
outer=2.2cm,
bottom=1.8cm,
top=1.83cm,
}
\usepackage{graphicx}
\usepackage{mwe}
\usepackage{bigfoot}
\begin{document}
\blindtext
\blindtext 
\begin{figure}[!t]
\noindent\includegraphics[width=\textwidth]{example-image-a}
\end{figure}
\blindtext\blindtext Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam lobortis facilisis sem. Nullam nec mi et neque p \footnote{\blindtext\blindtext}
\end{document}

Note: This is not about resolving this issue but about making it easier to spot it.

0

2 Answers 2

1

This solution uses the ifoddpage package, As with everything involving the aux file, you have to run it twice.

\documentclass{scrbook}
\usepackage{geometry}
\geometry{paperheight=22.5cm, 
paperwidth=15.5cm,
inner=1.9cm,
outer=2.2cm,
bottom=1.8cm,
top=1.83cm,
}
\usepackage{graphicx}
\usepackage{mwe}
\usepackage{bigfoot}

\usepackage{ifoddpage}
\newcounter{checkfoot}
\makeatletter
\newcommand{\checkmark}{\checkoddpage
  \stepcounter{checkfoot}%
  \expandafter\xdef\csname checkfoot\thecheckfoot\endcsname{\oddpage@page}}
\newcommand{\checknote}{\checkoddpage
  \ifnum\csname checkfoot\thecheckfoot\endcsname=\oddpage@page\relax\else
    WARNING: footnote is on another page.\par
  \fi}
\makeatother


\begin{document}
\blindtext
\blindtext 
\begin{figure}[!t]
\noindent\includegraphics[width=\textwidth]{example-image-a}
\end{figure}
\blindtext\blindtext Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam lobortis facilisis sem. Nullam nec mi et neque p 
\checkmark\footnote{\checknote\blindtext\blindtext}

\end{document}
2
  • Thanks. I 'automated' this by adding it to the footnote command and turning it into an option of my document class. It works very well now. Is it possible to put the warning into a sidenote? Simply adding \marginpar does not work since it does not work inside footnotes.
    – Simifilm
    Commented Oct 31, 2018 at 9:15
  • \marginnote (marginnote package) should work. Commented Oct 31, 2018 at 11:40
1

You can add labels like

\documentclass{scrbook}
\usepackage{geometry}
\geometry{paperheight=22.5cm, 
paperwidth=15.5cm,
inner=1.9cm,
outer=2.2cm,
bottom=1.8cm,
top=1.83cm,
}
\usepackage{graphicx}
\usepackage{mwe}
\usepackage{bigfoot}
\begin{document}
\blindtext
\blindtext 
\begin{figure}[!t]
\noindent\includegraphics[width=\textwidth]{example-image-a}
\end{figure}
\blindtext\blindtext Lorem ipsum dolor sit amet, consectetuer
adipiscing elit. Etiam lobortis facilisis sem. Nullam nec mi et neque
p\label{fnotemarkaaa}\footnote{\leavevmode\label{fnoteaaa}\blindtext\blindtext}
\end{document}

probably by using a custom macro that adds both labels and and the footnotetext.

then you just need to check in the aux file that every fnotemark label comes before the corresponding fnote label, but in this case you see

\newlabel{fnoteaaa}{{1}{2}}
\newlabel{fnotemarkaaa}{{}{3}}

showing that the mark is on page 3 but the text of the note is on page 2.

You could get tex to compare these and give an error but possibly simpler just to check externally.

1
  • unrelated but I removed the space before the footnote otherwise you could get a line or page break before the mark. Commented Oct 22, 2018 at 22:44

You must log in to answer this question.

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