# Footnote marks missplaced with bigfoot

With big foot package sometimes footnote text is placed on other page then corresponding footnote mark. MWE:

\documentclass[11pt, b5paper, final]{memoir}

\usepackage[english]{babel}
\usepackage[pangram]{blindtext}

\usepackage{bigfoot}
\DeclareNewFootnote{default}
\DeclareNewFootnote{B}[roman]

\begin{document}
\blindtext[10]\footnote{\blindtext[20]}
\blindtext[5]\footnote{
\blindtext[10]\footnoteB{\blindtext[1]}
\blindtext[30]}
\blindtext[10]\footnote{\blindtext[40]}
\end{document}


Preview:

However if I create similar document without bigfoot it works as expected. MWE

\documentclass[11pt, b5paper, final]{memoir}

\usepackage[english]{babel}
\usepackage[pangram]{blindtext}

\begin{document}
\blindtext[10]\footnote{\blindtext[20]}
\blindtext[5]\footnote{
\blindtext[10]
\blindtext[30]}
\blindtext[10]\footnote{\blindtext[40]}
\end{document}


Preview:

Question how can I fix bigfoot that marks appear on same page as text? I can choose other package for footnotes, but i need insert second level footnotes into first level footnote (as in bigfoot MWE).

A simpler example for the problem is

\documentclass[11pt]{article}
\usepackage{bigfoot}
\usepackage{kantlipsum}
\begin{document}
abc
\footnote{abc\kant[1-8]}

\newpage
abc
\footnote{blub}

\end{document}


bigfoot has obviously a problem with long footnotes followed by more footnotes.

The problem appears the first time in texlive 2015, and this indicates the source of the problem: at that time latex change the allocation system for extended registers and bigfoot adjusted to this change by not loading etex anymore. But bigfoot tests in one place \count266 which with etex contained the marks allocation, while in the new system \count256 should be used.

Correcting this number solves the problem:

\documentclass[11pt]{article}
\usepackage{bigfoot}
\usepackage{kantlipsum}

\usepackage{xpatch}
\makeatletter
\patchcmd\FN@allmarks{266}{256}{}{\fail}
\makeatother
\begin{document}
abc
\footnote{abc\kant[1-8]}

\newpage
abc
\footnote{blub}

\end{document}


Inform the maintainer so that he adjusts bigfoot.

• Already wrote a letter to maintainer with this bug. And will send a follow up with your fix. Thanks. – Denys Potapov Jan 31 at 13:02