移動底部邊距以為註腳騰出空間

移動底部邊距以為註腳騰出空間

我看到很多類似的問題,但沒有看到任何回應。我希望腳註出現在文字主體下方,而不改變主體的大小。僅在腳註太大的情況下(它應該有自己的下邊距,低於正文的邊距),我希望它將文字主體向上移動。這是我正在尋找的大致想法(抱歉我的繪畫技巧)頁面佈局

這是迄今為止我最接近的

\begin{luacode}
function enlarge_page()
  tex.print("\\enlargethispage{\\custom_distance}")
end
\end{luacode}

\let\oldfootnote\footnote
\renewcommand{\footnote}[1]{%
  \directlua{enlarge_page()} % Call the Lua function to enlarge the page
  \oldfootnote{#1}%
}

也就是說,不是很遠:位移距離不正確,沒有考慮腳註中的行數、第一個腳註和文字之間以及腳註本身之間的不同間距。任何包含更多詳細資訊的嘗試都會導致錯誤訊息。我正在使用回憶錄課程。有什麼辦法可以實現這一點嗎?

UPD:我不在其他地方使用Lua,所以如果XeLaTex中有解決方案,我可以使用它

UPD2:這大致是我正在尋找的邏輯:

if footnote in page : lower bottom margin by a specific constant amount
for every footnote in page : lower bottom margin by distance between footnotes + (footnote length/55)* line height 
% There are roughly 55 characters per line in the footnotes
if bottom margin < the lowest possible point: bottom margin = the lowest possible point.

我認為這在 Lua 中應該是可能的,考慮到我設法降低了每個腳註的邊距。

相關內容