PlainTeX:自定义输出例程丢失浮点数

PlainTeX:自定义输出例程丢失浮点数

我使用 PlainTex,因为我喜欢它的简单性,而且我几乎能理解它的每一行代码。当我查看 LaTeX 的输出例程时,我只理解了一点点。

因此我尝试自己向 PlainTex 添加浮点数,我的第一次尝试可以在这里看到: 如何保持 Plain TeX 中浮点数的顺序?

我希望获得与 LaTeX 类似的浮点处理,但同时又能理解代码。由于没有更复杂的输出例程的文档,我现在有一个问题。

看看我的 MWE:

% Plain LuaTeX (for other engines: \protected\def\glet{\global\let})
\font\testfont=cmr17 at 20 pt% to show the problem better

\testfont
\normalbaselineskip24pt
\normalbaselines

\catcode`\@=11
\parskip\z@
\raggedbottom
% The sizes have to be calculated in \output.
\newdimen\fullhsize
\newdimen\fullvsize
\fullhsize\hsize
\fullvsize\vsize

\newdimen\@colroom
\@colroom\fullvsize
% Float boxes as in latex.ltx
\newinsert\bx@A
\newinsert\bx@B
\newinsert\bx@C
\newinsert\bx@D
\newinsert\bx@E
\newinsert\bx@F
\newinsert\bx@G
\newinsert\bx@H
\newinsert\bx@I
\newinsert\bx@J
% Float handling parameters:
\newcount\@topnum
\newcount\maxtopnum \maxtopnum\thr@@
\newdimen\@toproom
\newdimen\maxtoproom \maxtoproom.4\fullvsize

\newcount\@botnum
\newcount\maxbotnum \maxbotnum\tw@
\newdimen\@botroom
\newdimen\maxbotroom \maxbotroom.3\fullvsize

\newif\if@insert
\newif\if@trybottom
\def\@empty{}
% Similar to latex.ltx:
\def\@freelist{\bx@A\bx@B\bx@C\bx@D\bx@E\bx@F\bx@G\bx@H\bx@I\bx@J}
\let\@toplist\@empty
\let\@botlist\@empty
\let\@deferlist\@empty
% List handling macros:
\def\@additem#1#2{%
    \expandafter\gdef\expandafter#1\expandafter{#1#2}}

\def\@takefirstitem#1{%
    \expandafter\@@takefirstitem#1!%
    \glet#1=\@tempa}

\def\@@takefirstitem#1#2!{\gdef\@currbox{#1}%
    \def\@tempa{#2}}
% A primitive definiton of a float:
\def\float#1{% #1=1 -> top float, 2 -> top or bottom float, 3 -> bottom float
    \@takefirstitem\@freelist
    \global\count\@currbox#1\relax
    \global\setbox\@currbox\vbox\bgroup
    \parskip\z@}

\def\endfloat{\par\vskip\z@\egroup
    \penalty-40000\relax
    \dimen@\prevdepth
    \vbox{}
    \prevdepth\dimen@
    \penalty-30000\relax}

\def\@nextboxcnt{% type of the next float on deferlist
    \expandafter\expandafter\expandafter
    \count\expandafter\@firstofmany\@deferlist!}

\def\@nextboxht{% height of the next float on deferlist
    \expandafter\expandafter\expandafter
    \ht\expandafter\@firstofmany\@deferlist!}

\def\@firstofmany#1#2!{#1}

% Output routine
\output{\myoutput}
\def\myoutput{%
    \ifnum\outputpenalty=-40000\relax
%   \ifvoid\footins\else\insert\footins{\unvbox\footins}\fi
    \global\setbox\@ne\vbox{\unvbox\@cclv}%
    \else
    \ifnum\outputpenalty=-30000\relax
    \setbox8\box\@cclv
    \unvbox\@ne
    \ifvoid\footins\else\insert\footins{\unvbox\footins}\fi
    %\unvbox\@cclv
    %
    \ifcase\count\@currbox\or%1 top float
    \@inserttrue
    \ifx\@deferlist\@empty \else \@insertfalse\fi
    \ifx\@botlist\@empty \else \@insertfalse\fi
    \ifnum\@topnum<\maxtopnum \else \@insertfalse\fi
    \ifnum\@topnum>\z@ \ifdim\maxtoproom<\dimexpr\@toproom+\ht\@currbox\relax \@insertfalse\fi\fi
    \if@insert
    \expandafter\@additem\expandafter\@toplist\@currbox
    \global\advance\@colroom-\ht\@currbox
    \global\advance\@toproom\ht\@currbox
    \global\advance\@topnum\@ne
    \else
    \expandafter\@additem\expandafter\@deferlist\@currbox
    \fi
    %
    \or%2 top or bottom float
    \@inserttrue
    \@trybottomfalse
    \ifx\@deferlist\@empty \else \@insertfalse\fi
    \ifx\@botlist\@empty \else \@insertfalse\fi
    \ifnum\@topnum<\maxtopnum \else \@insertfalse\fi
    \ifnum\@topnum>\z@
    \ifdim\maxtoproom<\dimexpr\@toproom+\ht\@currbox\relax \@insertfalse\fi\fi
    \if@insert
    \expandafter\@additem\expandafter\@toplist\@currbox
    \global\advance\@colroom-\ht\@currbox
    \global\advance\@toproom\ht\@currbox
    \global\advance\@topnum\@ne
    \else
    \ifx\@deferlist\@empty \@trybottomtrue
    \else \expandafter\@additem\expandafter\@deferlist\@currbox\fi
    \fi
    %
    \if@trybottom
    \@inserttrue
    \ifdim\ht\@currbox>\@colroom \@insertfalse\fi
    \ifnum\@botnum<\maxbotnum \else \@insertfalse\fi
    \ifnum\@botnum>\z@
  \ifdim\maxbotroom<\dimexpr\@botroom+\ht\@currbox\relax \@insertfalse\fi\fi
    \if@insert
    \expandafter\@additem\expandafter\@botlist\@currbox
    \global\advance\@colroom-\ht\@currbox
    \global\advance\@botroom\ht\@currbox
    \global\advance\@botnum\@ne
    \else
    \expandafter\@additem\expandafter\@deferlist\@currbox
    \fi
    %
    \fi
    %
    \or%3 bottom float
    \@inserttrue
    \ifx\@deferlist\@empty \else \@insertfalse\fi
    \ifdim\ht\@currbox>\@colroom \@insertfalse\fi
    \ifnum\@botnum<\maxbotnum \else \@insertfalse\fi
    \ifnum\@botnum>\z@
  \ifdim\maxbotroom<\dimexpr\@botroom+\ht\@currbox\relax \@insertfalse\fi\fi
    \if@insert
    \expandafter\@additem\expandafter\@botlist\@currbox
    \global\advance\@colroom-\ht\@currbox
    \global\advance\@botroom\ht\@currbox
    \global\advance\@botnum\@ne
    \else
    \expandafter\@additem\expandafter\@deferlist\@currbox
    \fi
    %    
    \fi
    %
    \else
    \shipout\vbox{\makeheadline\pagebody\makefootline}%
    \advancepageno
    % Prepare next page/column:
    \global\@colroom\fullvsize
    \global\@topnum\z@
    \global\@toproom\z@
    \global\@botnum\z@
    \global\@botroom\z@
    %
    \ifx\@deferlist\@empty\else
    % Top floats
    \loop
    \@inserttrue
    \ifnum\@nextboxcnt<\z@ \@insertfalse\fi
    \ifnum\@nextboxcnt>\tw@ \@insertfalse\fi
    \ifnum\@topnum<\maxtopnum \else \@insertfalse\fi
    \ifnum\@topnum>\z@
   \ifdim\maxtoproom<\dimexpr\@toproom+\@nextboxht\relax \@insertfalse\fi\fi
    \if@insert
    \@takefirstitem\@deferlist
    \expandafter\@additem\expandafter\@toplist\@currbox
    \global\advance\@colroom-\ht\@currbox
    \global\advance\@toproom\ht\@currbox
    \global\advance\@topnum\@ne
    \fi
    \ifx\@deferlist\@empty \@insertfalse\fi
    \if@insert
    \repeat
    %
    \fi
    %
    \ifx\@deferlist\empty\else
    % Bottom floats:
    \loop
    \@inserttrue
    \ifnum\@nextboxcnt<\tw@ \@insertfalse\fi
    \ifdim\@nextboxht>\@colroom \@insertfalse\fi
    \ifnum\@botnum<\maxbotnum \else \@insertfalse\fi
    \ifnum\@botnum>\z@
   \ifdim\maxbotroom<\dimexpr\@botroom+\@nextboxht\relax \@insertfalse\fi\fi
    \if@insert
    \@takefirstitem\@deferlist
    \expandafter\@additem\expandafter\@botlist\@currbox
    \global\advance\@colroom-\ht\@currbox
    \global\advance\@botroom\ht\@currbox
    \global\advance\@botnum\@ne
    \fi
    \ifx\@deferlist\@empty \@insertfalse\fi
    \if@insert
    \repeat
    %
    \fi
    %
    \ifnum\outputpenalty=-\@MM \dosupereject\fi
    \fi
    \fi
    \ifnum\outputpenalty<-30000\relax
        \global\vsize\maxdimen\else\global\vsize\@colroom\fi}

\def\pagebody{\vbox to\fullvsize{\boxmaxdepth\maxdepth \pagecontents}}

%\pagecontents that insert top and bottom floats:
\def\pagecontents{\ifx\@toplist\@empty\else
    \loop
    \@takefirstitem\@toplist
    \expandafter\@additem\expandafter\@freelist\@currbox
    \box\@currbox
    \unless\ifx\@toplist\@empty\repeat
    \fi
    %
    \dimen@=\dp\@cclv \unvbox\@cclv % open up \box255
    %
    \ifx\@botlist\@empty\else
    \loop
    \@takefirstitem\@botlist
    \expandafter\@additem\expandafter\@freelist\@currbox
    \box\@currbox
    \unless\ifx\@botlist\@empty\repeat
    \fi
    \ifvoid\footins\else % footnote info is present
    \vskip\skip\footins
    \footnoterule
    \unvbox\footins\fi
    \ifr@ggedbottom \kern-\dimen@ \vfil \fi}

1. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

\float1 ABCD1 \vskip20pt\endfloat

\float1 ABCD2 \vskip20pt\endfloat

\float1 ABCD3 \vskip20pt\endfloat

\float1 ABCD4 \vskip20pt\endfloat

\float1 ABCD5 \vskip20pt\endfloat

\float1 ABCD6 \vskip20pt\endfloat

2. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.%

\float1 ABCD7 \vskip20pt\endfloat% disappears

\float1 ABCD8 \vskip20pt\endfloat

3. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

4. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

5. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

\bye

如图所示,第 7 个浮动消失了。这是分页符附近的一个已知问题。我知道 LaTeX 通过添加 2 个惩罚来解决这个问题。我也试过这个,但\penalty-40000没有成功。

我究竟做错了什么?

(编辑:更好的输出程序,相同的结果。)

在此处输入图片描述

答案1

当 TeX 调用输出例程时,惩罚\outputpenalty值为 10000(除了在残局中),并且 TeX 有\supereject使用值 -20000 的命令。每个小于 -10000 的惩罚值都可用于输出例程,如果需要通知输出例程调用的原因,建议使用值 -10001、-10002 等。

TeXbook 附录 D 第 400 页指出:

有时输出例程需要知道为什么调用它,因此存在与程序其余部分进行信息通信的问题。TeX 提供了一般\mark操作,但标记并不总是能提供正确的线索。然后是\outputpenalty,可以测试它以查看断点处发生了什么惩罚;任何 -10000、-10001、-10002 或更小的惩罚都会迫使输出例程采取行动,因此可以使用不同的惩罚值来传递不同的消息。

好的;如果一个框中填满了浮点数,则使用 -30000 来触发输出例程。在输出例程中,将检查此输出惩罚,并将该框放置在两个列表之一中。现在 TeX 已读取第七个浮点数,并且它发现收集的材料超出了它所需的范围。如果您激活 tracingpages,您会看到以下行

% t=565.88889 加 60.0 g=542.21104 b=* p=-30000 c=*

其成本是无限的。因此 TeX 会提前中断;前面几行是

% t=493.88889 加 60.0 g=542.21104 b=52 p=0 c=52#

% t=517.88889 加 60.0 g=542.21104 b=7 p=0 c=7#

% t=541.88889 加 60.0 g=542.21104 b=0 p=150 c=150

并且中断的成本为 c=7,输出惩罚设置为 10000。框 bx@G 已填满,但在输出例程中并未清空。@currbox 获取新内容,并且与 bx@G 的连接丢失。

在新页面上,TeX 以

%% 目标高度=542.21104,最大深度=4.0

% t=13.88889 加 60.0 g=542.21104 b=10000 p=150 c=100000#

% t=37.88889 加 60.0 g=542.21104 b=10000 p=-30000 c=-30000#

因为还有一行\float ABCD7 \vskip20pt\endfloat要完成。但现在 @currbox 包含 bx@F 而不是 bx@G。这个盒子永久丢失,永远不会再使用,因为它没有放在任何列表中。bx@F 后来在空闲列表中出现了两次。

如何解决这个问题?创建一个 newif\if@currboxfilled并在\endfloatafter中将其设置为 true \egroup。接下来放入\if@currboxfilledbefore \ifx\@deferlist\@empty。然后将\else-30000 的 then-case 的 after 替换为:

    \global\@currboxfilledfalse
    \fi
%
    \else
    \if@currboxfilled
       \expandafter\@additem\expandafter\@deferlist\@currbox
       \global\@currboxfilledfalse
    \fi

如果调用 TeX 时输出惩罚不同于 -30000 但是框已填充,则将其放置在 @deferlist 上。

答案2

感谢@Udo Wermuth,现在我很清楚该宏\@currbox在输出例程中被多次使用。因此在这种情况下它具有另一种含义。如果我对每种情况都使用自己的宏,问题也会消失:

完整 MWE:

\font\testfont=cmr17 at 20 pt

\testfont
\normalbaselineskip24pt
\normalbaselines

\catcode`\@=11

\parskip\z@
\raggedbottom

\newdimen\fullhsize
\newdimen\fullvsize

\fullhsize\hsize
\fullvsize\vsize

\newdimen\@colroom
\@colroom\fullvsize

\newinsert\bx@A
\newinsert\bx@B
\newinsert\bx@C
\newinsert\bx@D
\newinsert\bx@E
\newinsert\bx@F
\newinsert\bx@G
\newinsert\bx@H
\newinsert\bx@I
\newinsert\bx@J

\newcount\@topnum
\newcount\maxtopnum \maxtopnum\thr@@
\newdimen\@toproom
\newdimen\maxtoproom \maxtoproom.4\fullvsize

\newcount\@botnum
\newcount\maxbotnum \maxbotnum\tw@
\newdimen\@botroom
\newdimen\maxbotroom \maxbotroom.3\fullvsize

\newcount\@dbltopnum
\newcount\maxdbltopnum \maxdbltopnum\tw@
\newdimen\@dbltoproom
\newdimen\maxdbltoproom \maxdbltoproom.4\fullvsize

\newcount\@botnum
\newcount\maxbotnum \maxbotnum\tw@
\newdimen\@botroom
\newdimen\maxbotroom \maxbotroom.3\fullvsize

\newcount\@dblbotnum
\newcount\maxdblbotnum \maxdblbotnum\tw@
\newdimen\@dblbotroom
\newdimen\maxdblbotroom \maxdblbotroom.3\fullvsize

\newif\if@insert
\newif\if@trybottom

\def\@empty{}

\def\@freelist{\bx@A\bx@B\bx@C\bx@D\bx@E\bx@F\bx@G\bx@H\bx@I\bx@J}
\let\@toplist\@empty
\let\@botlist\@empty
\let\@deferlist\@empty

\def\@additem#1#2{% #1: list, #2: token
    \expandafter\gdef\expandafter#1\expandafter{#1#2}}

\def\@takenextbox#1#2{% #1: macro for storing the box, #2: list
    \def\@tempa{#1}%
    \expandafter\@@takenextbox#2!%
    \glet#2=\@tempb}

\def\@@takenextbox#1#2!{\expandafter\gdef\@tempa{#1}%
    \def\@tempb{#2}}

\def\float#1{%
    \@takenextbox\@currbox\@freelist
    \global\count\@currbox#1\relax
    \global\setbox\@currbox\vbox\bgroup
    \parindent\z@ \parskip\z@}

\def\endfloat{\par\vskip\z@\egroup
    \penalty-40000\relax
    \dimen@\prevdepth
    \vbox{}
    \prevdepth\dimen@
    \penalty-30000\relax}

\def\@nextboxcnt{% type (count) of the next float on \@deferlist
    \expandafter\expandafter\expandafter
    \count\expandafter\@firstofmany\@deferlist!}

\def\@nextboxht{% height of the next float on deferlist
    \expandafter\expandafter\expandafter
    \ht\expandafter\@firstofmany\@deferlist!}

\def\@firstofmany#1#2!{#1}

\output{\myoutput}
\def\myoutput{%
    \ifnum\outputpenalty=-40000\relax
    \global\setbox\@ne\vbox{\unvbox\@cclv}%
    \else
    \ifnum\outputpenalty=-30000\relax
    \setbox8\box\@cclv
    \unvbox\@ne
    \ifvoid\footins\else\insert\footins{\unvbox\footins}\fi
    %
    \ifcase\count\@currbox\or%1
    \@inserttrue
    \ifx\@deferlist\@empty \else \@insertfalse\fi
    \ifx\@botlist\@empty \else \@insertfalse\fi
    \ifnum\@topnum<\maxtopnum \else \@insertfalse\fi
    \ifnum\@topnum>\z@
      \ifdim\maxtoproom<\dimexpr\@toproom+\ht\@currbox\relax \@insertfalse\fi\fi
    \if@insert
    \expandafter\@additem\expandafter\@toplist\@currbox
    \global\advance\@colroom-\ht\@currbox
    \global\advance\@toproom\ht\@currbox
    \global\advance\@topnum\@ne
    \else
    \expandafter\@additem\expandafter\@deferlist\@currbox
    \fi
    %
    \or%2
    \@inserttrue
    \@trybottomfalse
    \ifx\@deferlist\@empty \else \@insertfalse\fi
    \ifx\@botlist\@empty \else \@insertfalse\fi
    \ifnum\@topnum<\maxtopnum \else \@insertfalse\fi
    \ifnum\@topnum>\z@
    \ifdim\maxtoproom<\dimexpr\@toproom+\ht\@currbox\relax \@insertfalse\fi\fi
    \if@insert
    \expandafter\@additem\expandafter\@toplist\@currbox
    \global\advance\@colroom-\ht\@currbox
    \global\advance\@toproom\ht\@currbox
    \global\advance\@topnum\@ne
    \else
    \ifx\@deferlist\@empty \@trybottomtrue
    \else \expandafter\@additem\expandafter\@deferlist\@currbox\fi
    \fi
    %
    \if@trybottom
    \@inserttrue
    \ifdim\ht\@currbox>\@colroom \@insertfalse\fi
    \ifnum\@botnum<\maxbotnum \else \@insertfalse\fi
    \ifnum\@botnum>\z@
      \ifdim\maxbotroom<\dimexpr\@botroom+\ht\@currbox\relax \@insertfalse\fi\fi
    \if@insert
    \expandafter\@additem\expandafter\@botlist\@currbox
    \global\advance\@colroom-\ht\@currbox
    \global\advance\@botroom\ht\@currbox
    \global\advance\@botnum\@ne
    \else
    \expandafter\@additem\expandafter\@deferlist\@currbox
    \fi
    %
    \fi
    %
    \or%3
    \@inserttrue
    \ifx\@deferlist\@empty \else \@insertfalse\fi
    \ifdim\ht\@currbox>\@colroom \@insertfalse\fi
    \ifnum\@botnum<\maxbotnum \else \@insertfalse\fi
    \ifnum\@botnum>\z@
      \ifdim\maxbotroom<\dimexpr\@botroom+\ht\@currbox\relax \@insertfalse\fi\fi
    \if@insert
    \expandafter\@additem\expandafter\@botlist\@currbox
    \global\advance\@colroom-\ht\@currbox
    \global\advance\@botroom\ht\@currbox
    \global\advance\@botnum\@ne
    \else
    \expandafter\@additem\expandafter\@deferlist\@currbox
    \fi
    %    
    \fi
    %
    \else
    \shipout\vbox{\makeheadline\pagebody\makefootline}%
    \advancepageno
    %
    \global\@colroom\fullvsize
    \global\@topnum\z@
    \global\@toproom\z@
    \global\@botnum\z@
    \global\@botroom\z@
    %
    \ifx\@deferlist\@empty\else
    % Top floats, do not use \@currbox here!
    \loop
    \@inserttrue
    \ifnum\@nextboxcnt<\z@ \@insertfalse\fi
    \ifnum\@nextboxcnt>\tw@ \@insertfalse\fi
    \ifnum\@topnum<\maxtopnum \else \@insertfalse\fi
    \ifnum\@topnum>\z@
       \ifdim\maxtoproom<\dimexpr\@toproom+\@nextboxht\relax \@insertfalse\fi\fi
    \if@insert
    \@takenextbox\@nextbox\@deferlist
    \expandafter\@additem\expandafter\@toplist\@nextbox
    \global\advance\@colroom-\ht\@nextbox
    \global\advance\@toproom\ht\@nextbox
    \global\advance\@topnum\@ne
    \fi
    \ifx\@deferlist\@empty \@insertfalse\fi
    \if@insert
    \repeat
    %
    \fi
    %
    \ifx\@deferlist\empty\else
    % Bottom floats:
    \loop
    \@inserttrue
    \ifnum\@nextboxcnt<\tw@ \@insertfalse\fi
    \ifdim\@nextboxht>\@colroom \@insertfalse\fi
    \ifnum\@botnum<\maxbotnum \else \@insertfalse\fi
    \ifnum\@botnum>\z@
       \ifdim\maxbotroom<\dimexpr\@botroom+\@nextboxht\relax \@insertfalse\fi\fi
    \if@insert
    \@takenextbox\@nextbox\@deferlist
    \expandafter\@additem\expandafter\@botlist\@nextbox
    \global\advance\@colroom-\ht\@nextbox
    \global\advance\@botroom\ht\@nextbox
    \global\advance\@botnum\@ne
    \fi
    \ifx\@deferlist\@empty \@insertfalse\fi
    \if@insert
    \repeat
    %
    \fi
    %
    \ifnum\outputpenalty=-\@MM \dosupereject\fi
    \fi
    \fi
    \ifnum\outputpenalty<-30000\relax
        \global\vsize\maxdimen\else\global\vsize\@colroom\fi}

\def\pagebody{\vbox to\fullvsize{\boxmaxdepth\maxdepth \pagecontents}}

\def\pagecontents{\ifx\@toplist\@empty\else% Do not use \@currbox here!
    \loop
    \@takenextbox\@nexttopbox\@toplist
    \expandafter\@additem\expandafter\@freelist\@nexttopbox
    \box\@nexttopbox
    \unless\ifx\@toplist\@empty\repeat
    \fi
    %
    \dimen@=\dp\@cclv \unvbox\@cclv % open up \box255
    %
    \ifx\@botlist\@empty\else
    \loop
    \@takenextbox\@nextbotbox\@botlist
    \expandafter\@additem\expandafter\@freelist\@nextbotbox
    \box\@nextbotbox
    \unless\ifx\@botlist\@empty\repeat
    \fi
    \ifvoid\footins\else % footnote info is present
    \vskip\skip\footins
    \footnoterule
    \unvbox\footins\fi
    \ifr@ggedbottom \kern-\dimen@ \vfil \fi}

1. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

\float1 ABCD1 \vskip20pt\endfloat

\float1 ABCD2 \vskip20pt\endfloat

\float1 ABCD3 \vskip20pt\endfloat

\float1 ABCD4 \vskip20pt\endfloat

\float1 ABCD5 \vskip20pt\endfloat

\float1 ABCD6 \vskip20pt\endfloat

2. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.

\float1 ABCD7 \vskip20pt\endfloat% works now

\float1 ABCD8 \vskip20pt\endfloat

3. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

4. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

5. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

\bye

相关内容