我正在尝试在 Plain TeX 中将脚注设置为两列。这是我的最小工作示例:
%!TEX TS-program = pdftex
\output{\ifvoid\footins\else\vskip\skip\footins\rigidbalance\footins 2 7pt
\fi\plainoutput}
\newcount\k \newdimen\h % registers used by the \rigidbalance routine
\def\rigidbalance#1#2 #3 {\setbox0=\box#1 \k=#2 \h=#3
\line{\splittopskip=\h \vbadness=10000 \hfilneg
\valign{##\vfil\cr\dosplits}}}
\def\dosplits{\ifnum\k>0 \noalign{\hfil}\splitoff
\global\advance\k-1\cr\dosplits\fi}
\def\splitoff{\dimen0=\ht0
\divide\dimen0 by\k \advance\dimen0 by\h
\vsplit0 to \dimen0 }
\catcode`\@=11
\def\vfootnote#1{\insert\footins\bgroup
\interlinepenalty\interfootnotelinepenalty
\splittopskip\ht\strutbox % top baseline for broken footnotes
\splitmaxdepth\dp\strutbox \floatingpenalty\@MM
\leftskip\z@skip \rightskip\z@skip \spaceskip\z@skip \xspaceskip\z@skip
\count\footins 500
\multiply\dimen\footins by 2
\hsize .45\hsize
\parindent=0pt
\tolerance=5000
\raggedright
\textindent{#1}\footstrut\futurelet\next\fo@t}
\catcode`\@=12
\noindent
The entire set of footnotes could be set in two (or more) columns, with
a ragged right margin. For example, the ten footnotes
we have been considering might appear as follows:\footnote{$^1$}{First footnote.}
And some more.\footnote{$^2$}{Second footnote. (Every once in a while a long
footnote might occur, just to make things difficult.)}
And some more.
And some more.\footnote{$^3$}{Third footnote.}$N,$\footnote{$^4$}{Fourth footnote.}
And some more.
And some more.\footnote{$^5$}{Fifth footnote. (This is incredibly boring, but it's just an
example.)}$N,$\footnote{$^6$}{Another.}
And some more.
And some more.
And some more.\footnote{$^7$}{And another.}$N,$\footnote{$^8$}{Ho
hum.}$N,$\footnote{$^9$}{Umpteenth
footnote.}$N,$\footnote{$^{10}$}{Oodles of them.}
\bye
大部分内容来自 TeXbook 的第 395–398 页,部分内容来自 EDMAC Critical Edition 宏。 \rigidbalance 是将脚注材料分成两列(或更多列)的宏。我修改了 Plain \vfootnote 宏,将脚注格式化为两列。
一切正常,只是脚注不是出现在当前页面的底部,而是出现在下一页的顶部。
我认为问题与 \output 有关。我不太擅长使用 \output。如能得到任何帮助,我将不胜感激。
答案1
您不需要重新定义\output
例程,只需重新定义宏即可。并且,如果是两列脚注,则\pagecontents
必须将脚注重置为 500。\count\footins
将您的替换\output{...}
为:
\def\pagecontents{\ifvoid\topins\else\unvbox\topins\fi
\dimen1=\dp255 \unvbox255 % open up \box255
\ifvoid\footins\else\vskip\skip\footins
\footnoterule
\rigidbalance\footins 2 7pt
\fi
\csname ifr@ggedbottom\endcsname \kern-\dimen1 \vfil\fi}
\count\footins=500