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}

manyfoot包有什麼作用multicol,而fnpara沒有什麼作用?如何使用fnpara和軟體包解決這個問題footmisc

答案1

fnpara 和 footmisc 使用相同的演算法(或多或少),最初來自 TeXbook 中 Don Knuth 的範例。在某些時候,它們將頁面上收集的所有腳註組合起來,並將它們拆箱成一個段落(執行此操作的命令稱為\makefootnoteparagraph) 該段落的寬度在巨集中明確設置為

 \hsize=\columnwidth

這在 LaTeX 中通常是正確的,因為在兩列模式下,您希望這樣的段落是列的寬度。然而,在多列中,期望腳註跨越所有列,因此在這種情況下,段落應設定為\textwidth

因此,一個可能的解決方法是修補該命令以\textwidth代替使用,即

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

適用於 fnpara 和 footmisc。

但請注意,這不是一個通用補丁,即,如果您不使用 multicol,而是使用類別的\twocolumn或twocolumn 選項,那將是錯誤的!

PS 沒有檢查它是如何在 Manyfoot 中完成的。該套件進行了更複雜的操作,並且可能使用不同的演算法來獲取段落腳註,因此不會遇到問題。

相關內容