I'm trying to typeset footnotes using reledmac
in a twocolumned document (based on multicol
). For simplicity, let's say that I use only one series of 'familiar footnotes' in reledmac
, but these footnotes are double-columned so that the weight of their vertical space needs to be counted only single, not double.
I'm trying to patch the multicol
package accordingly, but there are often weird corner cases in which a footnote lands on the wrong page (one page before its anchor in the text). In this case, multicol
posts the warning "I moved some lines to the next page. Footnotes on page x might be wrong on input line xx."
I wonder: Did I do anything wrong (or incomplete) in patching? Does anyone know how I could improve the following MWE?
\documentclass{scrbook}
\setlength{\parskip}{0pt}
\RequirePackage{polyglossia}
\setmainlanguage{latin}
\RequirePackage{multicol}
\RequirePackage{reledmac}
\newseries{T}
\arrangementX[T]{twocol}
\setlength{\skip\footinsT}{1\baselineskip plus 10mm}%
\hsizetwocolX[T]{75mm}
\let\footnote\footnoteT
%%%%%%%%%% patching multicol.sty for twocolumn footnotes %%%%%%%%%
\makeatletter
\count\footinsT1000
\def\init@mult@footins{%
\count\footinsT1000
}
\def\reinsert@footnotes{\ifvoid\footinsT\else
\insert\footinsT{}\fi}
\patchcmd\multi@column@out{\divide\skip\footins\col@number}{}{}{}
\patchcmd\multi@column@out{\footins}{\footinsT}{}{}
\patchcmd\multi@column@out{\footins}{\footinsT}{}{}
\def\leave@mult@footins{%
\advance\dimen@-2\skip\footinsT%
\advance\[email protected]\ht\footinsT%
}
\makeatother
\usepackage{lipsum}
\begin{document}
\mainmatter
\begin{multicols}{2}[\chapter{Chapter Headline}]
\lipsum*[3]\footnote{Fn 1}
\lipsum*[3]\footnote{Fn 2}
\lipsum*[3]\footnote{Fn 3}
\lipsum*[3]\footnote{Fn 4}
\lipsum*[5]%\footnote{Fn 5}
\lipsum*[6]\footnote{Fn 5}%\footnote{Fn 6}
\lipsum*[7]\footnote{Fn 7}
\lipsum*[8]\footnote{Fn 8}
\lipsum*[9]\footnote{Fn 9}
\lipsum*[10]\footnote{Fn 10}
\lipsum*[6]\footnote{Fn 5}%\footnote{Fn 6}
\lipsum*[7]\footnote{Fn 7}
\end{multicols}
\end{document}
This produces the corner case where you see the error (misplaced footnote 4):
Addendum: I'm aware that multicol was not designed for double-columned footnotes and that this is a hard problem to solve – this is mentioned in so many posts on this matter. So I'm not asking for the perfect solution but for any ideas what I could do better in my patching to improve the result. The MWE I gave above does already deliver perfect results in a majority of cases, but maybe someone with more insights into the internal magic of multicol
can say if there is another tweak I might add.