如何用非浮动边注代替脚注?
footmisc
我曾尝试使用包选项将脚注替换为旁注side
,但它们仍然是浮动的,就像每个一样\marginpar
。我不希望它们浮动在锚点周围:我希望这些边注从页面顶部流到底部,并能够在需要时在页面之间拆分(因为其中一些可能太长,或者可能太多)。
答案1
编辑原始版本使用新分配的盒子寄存器,位于末尾。此版本使用\footins
插入寄存器,利用原始插入功能为每页拾取正确的注释。
\documentclass[twoside]{article}
\newcounter{f}
\addtolength\textheight{-20\baselineskip}
\def\z{\stepcounter{f}\Roman{f}
\roman{f} \alph{f} \roman{f} \roman{f} \roman{f}
\roman{f} \roman{f} \alph{f} \roman{f} \roman{f}
\roman{f} \roman{f} \roman{f} \alph{f} \roman{f}
\roman{f} \roman{f} \roman{f} \roman{f} \alph{f}}
\def\a{One two three.}
\def\b{\a\ \a\ Four five. \a}
\def\c{\b\ \b\ Red green blue. \b\footnote{\z} \a}
\def\d{\c\ \c\ \c\ \c}
\makeatletter
\skip\footins\z@
\count\footins\z@
\dimen\footins\textheight
\long\def\@footnotetext#1{%
\insert\footins{%
\reset@font\footnotesize
\interlinepenalty\interfootnotelinepenalty
\splitmaxdepth \dp\strutbox \floatingpenalty \@MM
\hsize\marginparwidth \@parboxrestore
\protected@edef\@currentlabel{%
\csname p@footnote\endcsname\@thefnmark
}%
\color@begingroup
\@makefntext{%
\rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
\color@endgroup}}%
\gdef \@makecol {%
\ifvoid\footins
\setbox\@outputbox \box\@cclv
\else
\setbox\@outputbox \vbox {%
\hbox{\color@begingroup
\if@twoside\ifodd\c@page
\box\@cclv\rlap{\kern\marginparsep\vbox to \textheight{\unvbox\footins}}
\else
\llap{\vbox to \textheight{\unvbox\footins}\kern\marginparsep}\box\@cclv
\fi
\color@endgroup}}%
\let\@elt\relax
\xdef\@freelist{\@freelist\@midlist}%
\global \let \@midlist \@empty
\@combinefloats
\ifvbox\@kludgeins
\@makespecialcolbox
\else
\setbox\@outputbox \vbox to\@colht {%
\@texttop
\dimen@ \dp\@outputbox
\unvbox \@outputbox
\vskip -\dimen@
\@textbottom
}%
\fi
\global \maxdepth \@maxdepth
}
\makeatother
\begin{document}
\d\ Nine ten. \d
Five four three two one. \d\ \d
Red blue green. \d\ Yellow blue. \d
\end{document}
我认为是这样的(已更新twoside
)......
\documentclass[twoside]{article}
\newcounter{f}
\addtolength\textheight{-20\baselineskip}
\def\z{\stepcounter{f}\Roman{f}
\roman{f} \alph{f} \roman{f} \roman{f} \roman{f}
\roman{f} \roman{f} \alph{f} \roman{f} \roman{f}
\roman{f} \roman{f} \roman{f} \alph{f} \roman{f}
\roman{f} \roman{f} \roman{f} \roman{f} \alph{f}}
\def\a{One two three.}
\def\b{\a\ \a\ Four five. \a}
\def\c{\b\ \b\ Red green blue. \b\footnote{\z} \a}
\def\d{\c\ \c\ \c\ \c}
\newbox\ftbox
\setbox\ftbox\vbox{}
\makeatletter
\long\def\@footnotetext#1{%
\global\setbox\ftbox\vbox{%
\unvbox\ftbox
\reset@font\footnotesize
\interlinepenalty\interfootnotelinepenalty
\splitmaxdepth \dp\strutbox \floatingpenalty \@MM
\hsize\marginparwidth \@parboxrestore
\protected@edef\@currentlabel{%
\csname p@footnote\endcsname\@thefnmark
}%
\color@begingroup
\@makefntext{%
\rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
\color@endgroup}}%
\gdef \@makecol {%
\ifvoid\footins
\setbox\@outputbox \box\@cclv
\else
\setbox\@outputbox \vbox {%
\boxmaxdepth \@maxdepth
\unvbox \@cclv
\vskip \skip\footins
\color@begingroup
\normalcolor
\footnoterule
\unvbox \footins
\color@endgroup
}%
\fi
\global\setbox\@ne\vsplit\ftbox to \textheight
\if@twoside\ifodd\c@page
\setbox\@outputbox\vbox{\hbox{\box\@outputbox\rlap{\kern\marginparsep\box\@ne}}}%
\else
\setbox\@outputbox\vbox{\hbox{\llap{\box\@ne\kern\marginparsep}\box\@outputbox}}%
\fi
\else
\setbox\@outputbox\vbox{\hbox{\box\@outputbox\rlap{\kern\marginparsep\box\@ne}}}%
\fi
\let\@elt\relax
\xdef\@freelist{\@freelist\@midlist}%
\global \let \@midlist \@empty
\@combinefloats
\ifvbox\@kludgeins
\@makespecialcolbox
\else
\setbox\@outputbox \vbox to\@colht {%
\@texttop
\dimen@ \dp\@outputbox
\unvbox \@outputbox
\vskip -\dimen@
\@textbottom
}%
\fi
\global \maxdepth \@maxdepth
}
\makeatother
\begin{document}
\d\ Nine ten. \d
Five four three two one. \d\ \d
Red blue green. \d\ Yellow blue. \d
\end{document}