Что делает manyfoot с multicol, чего не делает fnpara?

Что делает manyfoot с multicol, чего не делает fnpara?

Если я использую fnparaпакет для сносок к абзацам:

\documentclass{article}
\usepackage{multicol}
\usepackage{lipsum}
\usepackage{fnpara}
\begin{document}
\begin{multicols}{2}
\lipsum[1]
\footnote{This is a test.}\footnote{This is a test.}\footnote{This is a test.}
\footnote{This is a test.}\footnote{This is a test.}\footnote{This is a test.}
\footnote{This is a test.}\footnote{This is a test.}\footnote{This is a test.}
\footnote{This is a test.}\footnote{This is a test.}\footnote{This is a test.}
\footnote{This is a test.}\footnote{This is a test.}\footnote{This is a test.}
\footnote{This is a test.}\footnote{This is a test.}\footnote{This is a test.}
\footnote{This is a test.}\footnote{This is a test.}\footnote{This is a test.}
\footnote{This is a test.}\footnote{This is a test.}\footnote{This is a test.}
\footnote{This is a test.}\footnote{This is a test.}\footnote{This is a test.}
\footnote{This is a test.}\footnote{This is a test.}\footnote{This is a test.}
\footnote{This is a test.}\footnote{This is a test.}\footnote{This is a test.}
\footnote{This is a test.}\footnote{This is a test.}\footnote{This is a test.}
\footnote{This is a test.}\footnote{This is a test.}\footnote{This is a test.}
\footnote{This is a test.}\footnote{This is a test.}\footnote{This is a test.}
\footnote{This is a test.}\footnote{This is a test.}\footnote{This is a test.}
\footnote{This is a test.}\footnote{This is a test.}\footnote{This is a test.}
\footnote{This is a test.}\footnote{This is a test.}\footnote{This is a test.}
\footnote{This is a test.}\footnote{This is a test.}\footnote{This is a test.}
\lipsum[1-10]
\end{multicols}
\end{document}

то сноски перекрывают нижний колонтитул. footmiscпакет страдает от той же проблемы. Однако этого не происходит с manyfootпакетом

\documentclass{article}
\usepackage{multicol}
\usepackage{lipsum}
\usepackage[para]{manyfoot}
\DeclareNewFootnote[para]{A}
\begin{document}
\begin{multicols}{2}
\lipsum[1]
\footnoteA{This is a test.}\footnoteA{This is a test.}\footnoteA{This is a test.}
\footnoteA{This is a test.}\footnoteA{This is a test.}\footnoteA{This is a test.}
\footnoteA{This is a test.}\footnoteA{This is a test.}\footnoteA{This is a test.}
\footnoteA{This is a test.}\footnoteA{This is a test.}\footnoteA{This is a test.}
\footnoteA{This is a test.}\footnoteA{This is a test.}\footnoteA{This is a test.}
\footnoteA{This is a test.}\footnoteA{This is a test.}\footnoteA{This is a test.}
\footnoteA{This is a test.}\footnoteA{This is a test.}\footnoteA{This is a test.}
\footnoteA{This is a test.}\footnoteA{This is a test.}\footnoteA{This is a test.}
\footnoteA{This is a test.}\footnoteA{This is a test.}\footnoteA{This is a test.}
\footnoteA{This is a test.}\footnoteA{This is a test.}\footnoteA{This is a test.}
\footnoteA{This is a test.}\footnoteA{This is a test.}\footnoteA{This is a test.}
\footnoteA{This is a test.}\footnoteA{This is a test.}\footnoteA{This is a test.}
\footnoteA{This is a test.}\footnoteA{This is a test.}\footnoteA{This is a test.}
\footnoteA{This is a test.}\footnoteA{This is a test.}\footnoteA{This is a test.}
\footnoteA{This is a test.}\footnoteA{This is a test.}\footnoteA{This is a test.}
\footnoteA{This is a test.}\footnoteA{This is a test.}\footnoteA{This is a test.}
\footnoteA{This is a test.}\footnoteA{This is a test.}\footnoteA{This is a test.}
\footnoteA{This is a test.}\footnoteA{This is a test.}\footnoteA{This is a test.}
\lipsum[1-10]
\end{multicols}
\end{document}

Что делает manyfootpackage, multicolчего fnparaне делает? Как можно исправить эту проблему с помощью fnparaпакетов footmisc?

решение1

fnpara и footmisc используют один и тот же алгоритм (более или менее) изначально из примера Дона Кнута в TeXbook. В какой-то момент они объединяют все собранные сноски на странице и распаковывают их в абзац (команда, делающая это, называется \makefootnoteparagraph). Ширина этого абзаца явно задается в макросе как

 \hsize=\columnwidth

Это обычно правильно в LaTeX, так как в двухколоночном режиме вы хотите, чтобы такой абзац был шириной столбца. Однако в многоколоночном режиме ожидается, что сноски будут охватывать все столбцы, поэтому в этом случае абзац должен быть установлен на \textwidth.

Поэтому возможным решением является исправление этой команды для использования \textwidthвместо нее, т.е.

\usepackage{etoolbox}
\patchcmd{\makefootnoteparagraph}
   {\columnwidth}{\textwidth}
   {\typeout{Success}}{\typeout{patch failed}}

который работает как для fnpara, так и для footmisc.

Но учтите, что это не универсальный патч, т. е. будет неправильно, если вы не используете multicol, а вместо этого используете \twocolumnопцию twocolumn для класса!

P.S. не проверял, как это делается в manyfoot. Этот пакет делает гораздо более сложные манипуляции и, вероятно, использует другой алгоритм для получения сносок абзацев и, следовательно, не сталкивается с проблемой.

Связанный контент