Debian Codegraph @

texmf-dist/source/latex-dev/base/ltoutput.dtx

raw
1 % \iffalse meta-comment
2 %
3 % Copyright (C) 1993-2026
4 % The LaTeX Project and any individual authors listed elsewhere
5 % in this file.
6 %
7 % This file is part of the LaTeX base system.
8 % -------------------------------------------
9 %
10 % It may be distributed and/or modified under the
11 % conditions of the LaTeX Project Public License, either version 1.3c
12 % of this license or (at your option) any later version.
13 % The latest version of this license is in
14 % https://www.latex-project.org/lppl.txt
15 % and version 1.3c or later is part of all distributions of LaTeX
16 % version 2008 or later.
17 %
18 % This file has the LPPL maintenance status "maintained".
19 %
20 % The list of all files belonging to the LaTeX base distribution is
21 % given in the file `manifest.txt'. See also `legal.txt' for additional
22 % information.
23 %
24 % The list of derived (unpacked) files belonging to the distribution
25 % and covered by LPPL is defined by the unpacking scripts (with
26 % extension .ins) which are part of the distribution.
27 %
28 % \fi
29 % \iffalse
30 %%% From File: ltoutput.dtx
31 %<flafter>\ProvidesPackage{flafter}
32 %<fltrace>\ProvidesPackage{fltrace}
33 %<flafter,fltrace> [2025/08/22 v1.4z
34 %<flafter> Standard LaTeX floats after reference (FMi)]
35 %<fltrace> Tracing LaTeX floats algorithm (FMi)]
36 %
37 %<*driver>
38 % \fi
39 \ProvidesFile{ltoutput.dtx}
40 [2025/08/22 v1.4z LaTeX Kernel (Output Routine)]
41 % \iffalse
42 \documentclass{ltxdoc}
43 \GetFileInfo{ltoutput.dtx}
44 \title{\filename}
45 \date{\filedate}
46 \author{Leslie Lamport, Frank Mittelbach, Chris Rowley}
47 \begin{document}
48 \MaintainedByLaTeXTeam{latex}
49 \maketitle \tableofcontents
50 \DocInput{\filename}
51 \end{document}
52 %</driver>
53 % \fi
54 %
55 %
56 %
57 % \iffalse
58 % LATEX VERSION 2e
59 % Copyright (C) 1992 Leslie Lamport
60 % Copyright (C) 1994-2000 Leslie Lamport, LaTeX Project
61 %
62 % LaTeX 2e kernel file for the output routine.
63 %
64 % Part of this file is the latest (not greatest, it still
65 % deserves its name) version of kludge.sty.
66 %
67 % It also contains a few enhancements and many changes (corrections
68 % and tidyings) to the float mechanism and other parts of the output
69 % routine.
70 %
71 % The tracing in the file at present is mainly to help in testing the
72 % code but it may well be developed into a full float tracing
73 % package one day.
74 %
75 % ============================
76 % \fi
77 %
78 % \changes{v1.1p}{1995/08/25}{Support autoloading feature (FMi).}
79 % \task{CAR}{Update documentation.}
80 % \changes{v1.0k}{1994/02/08}{Documentation and tasks tidied.}
81 % \changes{v1.0l}{1994/03/15}{Driver added and further tidying.}
82 % \changes{v1.0l}{1994/03/15}{Some boxmaxdepth settings removed.}
83 % \changes{v1.0l}{1994/03/15}{Added some warnings when page gets full of
84 % top floats.}
85 % \changes{v1.0l}{1994/03/15}{Removed duplicated code and corrected
86 % docstrip options.}
87 % \changes{v1.0m}{1994/04/24}{Removed some long lines and other
88 % aesthetic changes.}
89 % \changes{v1.0m}{1994/04/24}{Corrected unverbed commands in
90 % documentation.}
91 % \changes{v1.0m}{1994/04/24}{Changed \cs{@normalsize} to
92 % \cs{normalsize}.}
93 % \changes{v1.0m}{1994/04/24}{Warning messages changed/corrected.}
94 % \changes{v1.0n}{1994/04/30}{Added \cs{col@number}.}
95 % \changes{v1.0n}{1994/04/30}{Fixed bug from \cs{dblfigrule} with
96 % \cs{@topnewpage}.}
97 % \changes{v1.0n}{1994/04/30}{Documentation tidied.}
98 % \changes{v1.0n}{1994/04/30}{\cs{@activechar@warning} changed to an
99 % info message.}
100 % \changes{v1.0n}{1994/04/30}{Full of floats action improved.}
101 % \changes{v1.0n}{1994/04/30}{Empty column action added.}
102 % \changes{v1.0o}{1994/05/02}{Code of \cs{@resethfps} shortened.}
103 % \changes{v1.0p}{1994/05/12}{\cs{normalcolor}added in various
104 % places (DPC).}
105 % \changes{v1.0q}{1994/05/16}{Changed setting of accents (FMi).}
106 % \changes{v1.0s}{1994/05/20}{Added setting of \cs{protect}
107 % during \cs{shipout}.}
108 % \changes{v1.0t}{1994/05/22}{Changed warnings and infos to
109 % new commands.}
110 % \changes{v1.0u}{1994/05/23}{Added \cs{MessageBreak}.}
111 % \changes{v1.0u}{1994/05/23}{Changed resetting of \cs{protect} after
112 % shipout.}
113 % \changes{v1.0v}{1994/05/25}{Extra documentation.}
114 % \changes{v1.0w}{1994/06/01}{Tidied up typesetting.}
115 %
116 % \changes{v1.1f}{1994/11/14}{Removed old definition of \cs{@testfp}.}
117 % \changes{v1.1h}{1994/11/17}
118 % {\cs{@tempa} to \cs{reserved@a}.}
119 % \changes{v1.1m}{1995/05/07}{Use \cs{hb@xt@}.}
120 % \changes{v1.2n}{2015/02/21}
121 % {Removed autoload code}
122 %
123 % \MaybeStop{}
124 %
125 % \def \ie {i.e.~}
126 % \def \eg {e.g.~}
127 %
128 % \section{Output Routine and float handling}
129 %
130 %
131 % \begin{macrocode}
132 %<*2ekernel>
133 \message{output,}
134 % \end{macrocode}
135 %
136 % \subsection{Historical notes on the algorithm and commands}
137 %
138 %
139 % \begin{oldcomments}
140 % ****************************************
141 % * OUTPUT *
142 % ****************************************
143 %
144 %
145 % PAGE LAYOUT PARAMETERS
146 %
147 % \topmargin : Extra space added to top of page.
148 % @twoside : boolean. T if two-sided printing
149 % \oddsidemargin : IF @twoside = T
150 % THEN extra space added to left of odd-numbered
151 % pages.
152 % ELSE extra space added to left of all pages.
153 % \evensidemargin : IF @twoside = T
154 % THEN extra space added to left of even-numbered
155 % pages.
156 % \headheight : height of head
157 % \headsep : separation between head and text
158 % \footskip : distance separation between baseline of last
159 % line of text and baseline of foot.
160 % Note difference between \footSKIP and \headSEP.
161 % \textheight : height of text on page, excluding head and foot
162 % \textwidth : width of printing on page
163 % \columnsep : IF @twocolumn = T
164 % THEN width of space between columns
165 % \columnseprule : IF @twocolumn = T
166 % THEN width of rule between columns (0 if none).
167 % \columnwidth : IF @twocolumn = T
168 % THEN (\textwidth - \columnsep)/2
169 % ELSE \textwidth
170 % It is set by the \twocolumn and
171 % \onecolumn commands.
172 % \@textbottom : Command executed at bottom of vbox holding text of
173 % page (including figures). The \raggedbottom
174 % command almost \let's this to \vfil (actually sets
175 % it to \vskip \z@ plus.0001fil).
176 % Should have depth 0pt.
177 %
178 % \@texttop : Command executed at top of vbox holding text of
179 % page (including figures). Used by letter style;
180 % can also be used to produce centered pages.
181 % Let to \relax by \raggedbottom and \flushbottom.
182 %
183 % Page layout must initialize \@colht and \@colroom to \textheight.
184 %
185 % PAGE STYLE PARAMETERS:
186 %
187 % \floatsep : Space left between floats.
188 % \textfloatsep : Space between last top float or first bottom float
189 % and the text.
190 % \topfigrule : Command to place rule (or whatever) between floats
191 % at top of page and text. Executed in inner
192 % vertical mode right before the \textfloatsep skip
193 % separating the floats from the text. Must occupy
194 % zero vertical space. (See \footnoterule.)
195 % \botfigrule : Same as \topfigrule, but put after the
196 % \textfloatsep skip separating text from the
197 % floats at bottom of page.
198 % \intextsep : Space left on top and bottom of an in-text float.
199 % \dblfloatsep : Space between double-column floats.
200 % \dbltextfloatsep : Space between top double-column floats
201 % and text.
202 % \dblfigrule : Similar to \topfigrule, but for double-column
203 % floats.
204 % \@fptop : Glue to go at top of float column -- must be 0pt +
205 % stretch
206 % \@fpsep : Glue to go between floats in a float column.
207 % \@fpbot : Glue to go at bottom of float column
208 % -- must be 0pt +
209 % stretch
210 % \@dblfptop, \@dblfpsep, \@dblfpbot
211 % : Analogous for double-column float page in
212 % two-column format.
213 %
214 % FOOTNOTES: As in PLAIN, footnotes use \insert\footins.
215 %
216 % PAGE LAYOUT SWITCHES AND MACROS
217 %
218 % @twocolumn : Boolean. T if two columns per page globally.
219 %
220 % PAGE STYLE MACROS AND SWITCHES
221 %
222 % \@oddhead : IF @twoside = T
223 % THEN macro to generate head of odd-numbered
224 % pages.
225 % ELSE macro to generate head of all pages.
226 % \@evenhead : IF @twoside = T
227 % THEN macro to generate head of even-numbered
228 % pages.
229 % \@oddfoot : IF @twoside = T
230 % THEN macro to generate foot of odd-numbered
231 % pages.
232 % ELSE macro to generate foot of all pages.
233 % \@evenfoot : IF @twoside = T
234 % THEN macro to generate foot of even-numbered
235 % pages.
236 % @specialpage : boolean. T if current page is to have a special
237 % format.
238 % \@specialstyle : If its value is foo then
239 % IF @specialpage = T
240 % THEN the command \ps@foo is executed to
241 % temporarily reset the page style parameters
242 % before composing the current page.
243 % This command should execute only \def's and
244 % \edef's, making only local definitions.
245 %
246 % FLOAT PLACEMENT PARAMETERS
247 %
248 % The following parameters are set by the macro \@floatplacement.
249 % When \@floatplacement is called,
250 % \@colht is the height of the page or column being built. I.e.:
251 % * For single-column page it equals \textheight.
252 % * For double-column page it equals \textheight - height
253 % of double-column floats on page.
254 % Note that some are set globally and some locally:
255 % \@topnum :=G Maximum number of floats allowed on the top of a
256 % column.
257 % \@toproom :=G Maximum amount of top of column devoted to floats--
258 % excluding \textfloatsep separation below the floats
259 % and \floatsep separation between them. For
260 % two-column output, should be computed as a function
261 % of \@colht.
262 % \@botnum, \@botroom
263 % : Analogous to above.
264 % \@colnum :=G Maximum number of floats allowed in a column,
265 % including in-text floats.
266 % \@textmin :=L Minimum amount of text (excluding footnotes) that
267 % must appear on a text page.
268 % %% 27 Sep 85 : made local to
269 % %% \@addtocurcol and \@addtonextcol
270 % It is now also used locally in processing double
271 % floats.
272 % \@fpmin :=L Minimum height of floats in a float column.
273 %
274 % The macro \@dblfloatplacement sets the following parameters.
275 % \@dbltopnum :=G Maximum number of double-column floats allowed at
276 % the top of a two-column page.
277 % \@dbltoproom :=G Maximum height of double-column floats allowed at
278 % top of two-column page.
279 % \@fpmin :=L Minimum height of floats in a float column.
280 % It should also perform the following local assignments where necessary
281 % -- i.e., where the new value differs from the old one:
282 % \@fptop :=L \@dblfptop
283 % \@fpsep :=L \@dblfpsep
284 % \@fpbot :=L \@dblfpbot
285 %
286 % OUTPUT ROUTINE VARIABLES
287 %
288 % \@colht : The total height of the current column. In single column
289 % style, it equals \textheight. In two-column style, it is
290 % \textheight minus the height of the double-column floats
291 % on the current page. MUST BE INITIALIZED TO \textheight.
292 %
293 % \@colroom : The height available in the current column for text and
294 % footnotes. It equals \@colht minus the height of all
295 % floats committed to the top and bottom of the current
296 % column.
297 %
298 % \@textfloatsheight : The total height of in-text floats on the
299 % current page.
300 %
301 % \footins : Footnote insertion number.
302 %
303 % \@maxdepth : Saved value of TeX's \maxdepth. Must be set
304 % when any routine sets \maxdepth.
305 %
306 % CALLING THE OUTPUT ROUTINE
307 % --------------------------
308 %
309 % The output routine is called either by TeX's normal page-breaking
310 % mechanism, or by a macro putting a penalty < or = -10000 in the output
311 % list. In the latter case, the penalty indicates why the output
312 % routine was called, using the following code.
313 %
314 % penalty reason
315 % ------- ------
316 % -10000 \pagebreak
317 % \newpage
318 % -10001 \clearpage (\penalty -10000 \vbox{} \penalty -10001)
319 % -10002 float insertion, called from horizontal mode
320 % -10003 float insertion, called from vertical mode.
321 % -10004 float insertion.
322 %
323 % Note: A float or marginpar puts the following sequence in the output
324 % list: (i) a penalty of -10004,
325 % (ii) a null \vbox
326 % (iii) a penalty of -10002 or -10003.
327 % This solves two special problems:
328 % 1. If the float comes right after a \newpage or \clearpage,
329 % then the first penalty is ignored, but the second one
330 % invokes the output routine.
331 % 2. If there is a split footnote on the page, the second 'page'
332 % puts out the rest of the footnote.
333 %
334 % THE OUTPUT ROUTINE
335 % ------------------
336 %
337 % FUNCTIONS USED IN THE OUTPUT ROUTINE:
338 %
339 % \@outputpage : Produces an output page with the contents of box
340 % \@outputbox as the text part.
341 % Also sets \@colht :=G \textheight.
342 % The page style is determined as follows.
343 % IF @thispagestyle = true
344 % THEN use \thispagestyle style
345 % ELSE use ordinary page style.
346 %
347 % \@tryfcolumn\FLIST : Tries to form a float column composed of floats
348 % from \FLIST (if nonempty) with the following parameters:
349 % \@colht : height of box
350 % \@fpmin : minimum height of floats in the box
351 % \@fpsep : interfloat space
352 % \@fptop : glue at top of box
353 % \@fpbot : glue at bottom of box.
354 % If it succeeds, then it does the following:
355 % * \@outputbox :=L the composed float box.
356 % * @fcolmade :=G true
357 % * \FLIST :=G \FLIST - floats put in box
358 % * \@freelist :=G \@freelist + floats put in box
359 % If it fails, then:
360 % * @fcolmade :=G false
361 % NOTE: BIT MUST BE A SINGLE TOKEN!
362 %
363 % \@makefcolumn \FLIST : Same as \@tryfcolumn except that it
364 % fails to make a float column only if \FLIST is empty.
365 % Otherwise, it makes a float column containing at least
366 % the first box in \FLIST, disregarding \@fpmin.
367 %
368 % \@startcolumn :
369 % Calls \@tryfcolumn\@deferlist. If \@tryfcolumn returns with
370 % (globally set) @fcolmade = false, then:
371 % * Globally sets \@toplist and \@botlist to floats
372 % from \@deferlist to go at top and bottom of column,
373 % deleting them from \@deferlist. It does
374 % this using \@colht as the total height, the page
375 % style parameters \@floatsep and \@textfloatsep, and
376 % the float placement parameters \@topnum, \@toproom,
377 % \@botnum, \@botroom, \@colnum and \textfraction.
378 % * Globally sets \@colroom to \@colht minus the height
379 % of the added floats.
380 %
381 % \@startdblcolumn :
382 % Calls \@tryfcolumn\@dbldeferlist{8}. If \@tryfcolumn returns
383 % with (globally set) @fcolmade = false, then:
384 % * Globally sets \@dbltoplist to floats from
385 % \@dbldeferlist to go at top and bottom of column,
386 % deleting them from \@dbldeferlist.
387 % It does this using \textheight as the
388 % total height, and the parameters \@dblfloatsep, etc.
389 % * Globally sets \@colht to \textheight minus the height
390 % of the added floats.
391 %
392 % \@combinefloats : Combines the text from box
393 % \@outputbox with the floats from \@toplist and \@botlist,
394 % putting the new box in \@outputbox. It uses \floatsep
395 % and \textfloatsep for the appropriate separations.
396 % It puts the elements of \TOPLIST and \BOTLIST onto
397 % \@freelist, and makes those lists null.
398 %
399 % \@makecol : Makes the contents of \box255 plus the accumulated
400 % footnotes, plus the floats in \@toplist and \@botlist,
401 % into a single column of height \@colht (unless the page
402 % height has been locally changed), which it puts
403 % into box \@outputbox. It puts boxes in \@midlist back
404 % onto \@freelist and restores \maxdepth.
405 %
406 % \@opcol : Outputs a column whose text is in box \@outputbox
407 % If @twocolumn = false, then it calls \@outputpage,
408 % sets \@colht :=G \textheight, and calls \@floatplacement.
409 %
410 % If @twocolumn = true, then:
411 % If @firstcolumn = true, then it puts box \@outputbox
412 % into \@leftcolumn and sets @firstcolumn :=G false.
413 %
414 % If @firstcolumn = false, then it puts out the current
415 % two-column page, any possible two-column float pages,
416 % and determines \@dbltoplist for the next page.
417 %
418 %
419 %
420 % USER COMMANDS THAT CALL OR AFFECT THE OUTPUT ROUTINE
421 % ----------------------------------------------------
422 %
423 % \newpage == BEGIN \par\vfil\penalty -10000 END
424 %
425 % \clearpage == BEGIN \newpage
426 % \write -1{} % Part of hack to make sure no
427 % \vbox{} % \write's get lost.
428 % \penalty -10001
429 % END
430 %
431 % \cleardoublepage == BEGIN \clearpage
432 % if @twoside = true and c@page is even
433 % then \hbox{} \newpage fi
434 % END
435 %
436 %
437 % \twocolumn[BOX] : starts a new page, changing to twocolumn setting
438 % and puts BOX in a parbox of width \textwidth across the top.
439 % Useful for full-width titles for double-column pages.
440 % SURPRISE: The stretch from \@dbltextfloatsep will be inserted
441 % between the BOX and the top of the two columns.
442 %
443 %
444 % FLOAT-HANDLING MECHANISMS
445 % -------------------------
446 %
447 % The float environment obtains an insertion number B from the
448 % \@freelist (see below for a description of list manipulation), puts
449 % the float into box B and sets \count B to a FLOAT SPECIFIER. For
450 % a normal (not double-column) float, it then causes a page break
451 % in one of the following two ways:
452 % - In outer hmode: \vadjust{\penalty -10002}
453 % - In vmode : \penalty -10003.
454 % For a double-column float, it puts B onto the \@dbldeferlist.
455 % The float specifier has two components:
456 % * A PLACEMENT SPECIFICATION, describing where the float may
457 % be placed.
458 % * A TYPE, which is a power of two--e.g., figures might be
459 % type 1 floats, tables type 2 floats, programs type 4 floats, etc.
460 % The float specifier is encoded as follows, where bit 0 is the least
461 % significant bit.
462 %
463 % Bit Meaning
464 % --- -------
465 % 0 1 iff the float may go where it appears in the text.
466 % 1 1 iff the float may go on the top of a page.
467 % 2 1 iff the float may go on the bottom of a page.
468 % 3 1 iff the float may go on a float page.
469 % 4 1 unless the PLACEMENT includes a !
470 % 5 1 iff a type 1 float
471 % 6 1 iff a type 2 float
472 % etc.
473 %
474 % A negative float specifier is used to indicate a marginal note.
475 %
476 % MACROS AND DATA STRUCTURES FOR PROCESSING FLOATS
477 % ------------------------------------------------
478 %
479 % A FLOAT LIST consisting of the floats in boxes \boxa ... \boxN has
480 % the form:
481 % \@elt \boxa ... \@elt \boxN
482 % where \boxI is defined by
483 % \newinsert\boxI
484 % Normally, \@elt is \let to \relax. A test can be performed on the
485 % entire float list by locally \def'ing \@elt appropriately and
486 % executing the list.
487 % This is a lot more efficient than looping through the list.
488 %
489 % The following macros are used for manipulating float lists.
490 %
491 % \@next \CS \LIST {NONEMPTY}{EMPTY} == %% NOTE: ASSUME \@elt = \relax
492 % BEGIN assume that \LIST == \@elt \B1 ... \@elt \Bn
493 % if n = 0
494 % then EMPTY
495 % else \CS :=L \B1
496 % \LIST :=G \@elt \B2 ... \@elt \Bn
497 % NONEMPTY
498 % fi
499 % END
500 %
501 %
502 % \@bitor\NUM\LIST : Globally sets switch @test to the disjunction for
503 % all I of bit log2 \NUM of the float specifiers of all the
504 % floats in \LIST.
505 % I.e., @test is set to true iff there is at least one
506 % float in \LIST having bit log2 \NUM of its float specifier
507 % equal to 1.
508 %
509 % Note: log2 [(\count I)/32] is the bit number corresponding to the
510 % type of float I. To see if there is any float in \LIST having
511 % the same type as float I, you run \@bitor with
512 % \NUM = [(\count I)/32] * 32.
513 %
514 % \@bitor\NUM\LIST ==
515 % BEGIN
516 % @test :=G false
517 % { \@elt \CTR == if \NUM <> 0 then
518 % if \count\CTR / \NUM is odd
519 % then @test := true fi fi
520 % \LIST
521 % }
522 % END
523 %
524 %
525 % \@cons\LIST\NUM : Globally sets \LIST := \LIST * \@elt \NUM
526 %
527 % \@cons\LIST\NUM ==
528 % BEGIN { \@elt == \relax
529 % \LIST :=G \LIST \@elt \NUM
530 % }
531 %
532 % BOX LISTS FOR FLOAT-PLACEMENT ALGORITHMS
533 %
534 % \@freelist : List of empty boxes for placing new floats.
535 % \@toplist : List of floats to go at top of current column.
536 % \@midlist : List of floats in middle of current column.
537 % \@botlist : List of floats to go at bottom of current column.
538 % \@deferlist : List of floats to go after current column.
539 % \@dbltoplist : List of double-col. floats to go at top of current
540 % page.
541 % \@dbldeferlist : List of double-column floats to go on subsequent
542 % pages.
543 %
544 % FLOAT-PLACEMENT ALGORITHMS
545 %
546 %
547 % \@addtobot : Tries to put insert \@currbox on \@botlist.
548 % Called only when:
549 % * \ht BOX < \@colroom
550 % * type of \@currbox not on \@deferlist
551 % * \@colnum > 0
552 % * @insert = false
553 % If it succeeds, then:
554 % * sets @insert true
555 % * decrements \@botroom by \ht BOX
556 % * decrements \@botnum and \@colnum by 1
557 % * decrements \@colroom by \ht BOX + either \floatsep
558 % or \textfloatsep, as appropriate.
559 % * sets \maxdepth to 0pt % <-- as of 2025/06/01
560 % % no longer the case
561 %
562 % \@addtotoporbot : Tries to put insert \@currbox on \@toplist or
563 % \@botlist.
564 % Called only under same conditions as \@addtobot.
565 % If it succeeds, then:
566 % * sets @insert true
567 % * decrements \@toproom or \@botroom by \ht BOX
568 % * decrements \@colnum and either \@topnum or
569 % \@botnum by 1
570 % * decrements \@colroom by \ht BOX + \floatsep
571 % or \textfloatsep, as appropriate.
572 %
573 % \@addtocurcol : Tries to add \@currbox to current column, setting
574 % @insert true if it succeeds, false otherwise.
575 % It will add \@currbox to top only if bit 0 of
576 % \count \@currbox is 0, and to the bottom only if
577 % bit 0 = 0 or an earlier float of the same type is
578 % put on the bottom.
579 % If the float is put in the text, then
580 % \penalty\interlinepenalty is put
581 % right after the float, before the following \vskip,
582 % and \outputpenalty :=L 0.
583 %
584 % \@addtonextcol : Tries to add \@currbox to the next column, setting
585 % @insert true if it succeeds, false otherwise.
586 %
587 % \@addtodblcol : Tries to add \@currbox to the next double-column page,
588 % adding it to \@dbltoplist if it succeeds and
589 % \@dbldeferlist if it fails.
590 %
591 %
592 % \@addmarginpar ==
593 % BEGIN
594 % if \@currlist nonempty
595 % then remove \@marbox from \@currlist
596 % add \@marbox and \@currbox to \@freelist
597 % %% NOTE: \@currbox = left box
598 % else LaTeX error: ? %% shouldn't happen
599 % fi
600 % \@tempcnta := 1 %% 1 = right, -1 = left
601 % if @twocolumn = true
602 % then if @firstcolumn = true
603 % then \@tempcnta := -1
604 % fi
605 % else if @mparswitch = true
606 % then if count0 odd
607 % else \@tempcnta := -1
608 % fi
609 % fi
610 % if @reversemargin = true
611 % then \@tempcnta := -\@tempcnta
612 % fi
613 % fi
614 % if \@tempcnta < 0 then \box\@marbox :=G \box\@currbox
615 % fi
616 % \@tempdima :=L maximum(\@mparbottom - \@pageht
617 % + ht of \@marbox, 0)
618 % if \@tempdima > 0 then LaTeX warning: 'marginpar moved' fi
619 % \@mparbottom :=G \@pageht + \@tempdima + depth of \@marbox
620 % + \marginparpush
621 % \@tempdima :=L \@tempdima - ht of \@marbox
622 % \box\@marbox :=G \box\@currbox
623 % \vbox { \vskip \@tempdima
624 % \box\@marbox
625 % }
626 % height of \@marbox :=G depth of \@marbox :=G 0
627 % \kern -\@pagedp
628 % \nointerlineskip
629 % \hbox{ if @tempcnta > 0 then \hskip \columnwidth
630 % \hskip \marginparsep
631 % else \hskip -\marginparsep
632 % \hskip -\marginparwidth
633 % fi
634 % \box\@marbox \hss
635 % }
636 % \nobreak
637 % \nointerlineskip
638 % \hbox{\vrule height 0 width 0 depth \@pagedp}
639 % END
640 % \end{oldcomments}
641 %
642 %
643 %
644 % \subsection{Core definitions}
645 %
646 % Floats and marginpars add a lot of dead cycles.
647 % \begin{macrocode}
648 \maxdeadcycles = 100
649 % \end{macrocode}
650 %
651 % \begin{macrocode}
652 \let\@elt\relax
653 % \end{macrocode}
654 %
655 % \begin{macrocode}
656 \def\@next#1#2#3#4{\ifx#2\@empty #4\else
657 \expandafter\@xnext #2\@@#1#2#3\fi}
658 % \end{macrocode}
659 %
660 % \begin{macrocode}
661 \def\@xnext \@elt #1#2\@@#3#4{\def#3{#1}\gdef#4{#2}}
662 % \end{macrocode}
663 %
664 % \changes{v1.1v}{1996/07/26}{put \cs{global} into definition}
665 % \begin{macrocode}
666 \def\@testfalse{\global\let\if@test\iffalse}
667 \def\@testtrue {\global\let\if@test\iftrue}
668 \@testfalse
669 % \end{macrocode}
670 %
671 % \changes{v1.1v}{1996/07/26}{remove \cs{global} before \cs{@test...}}
672 % \begin{macrocode}
673 \def\@bitor#1#2{\@testfalse {\let\@elt\@xbitor
674 \@tempcnta #1\relax #2}}
675 % \end{macrocode}
676 % RmS 91/11/22: Added test for |\count#1 = 0|.
677 % Suggested by Chris Rowley.
678 %
679 %
680 % \changes{v1.1v}{1996/07/26}{remove \cs{global} before \cs{@test...}}
681 % \begin{macrocode}
682 \def\@xbitor #1{\@tempcntb \count#1
683 \ifnum \@tempcnta =\z@
684 \else
685 \divide\@tempcntb\@tempcnta
686 \ifodd\@tempcntb \@testtrue\fi
687 \fi}
688 % \end{macrocode}
689 %
690 %
691 % \subsubsection{Definition of float boxes}
692 %
693 %
694 % \changes{v1.3a}{2015/09/205}
695 % {extended \cs{@freelist}}
696 % \changes{v2.3m}{2025/04/14}{Always use extended free list}
697 % \begin{macrocode}
698 \let\@elt\newinsert
699 \def\@freelist{%
700 \@elt\bx@A\@elt\bx@B\@elt\bx@C\@elt\bx@D\@elt\bx@E
701 \@elt\bx@F\@elt\bx@G\@elt\bx@H\@elt\bx@I\@elt\bx@J
702 \@elt\bx@K\@elt\bx@L\@elt\bx@M\@elt\bx@N
703 \@elt\bx@O\@elt\bx@P\@elt\bx@Q\@elt\bx@R}
704 \@freelist
705 \def\reserved@a{%
706 \@elt\bx@S\@elt\bx@T\@elt\bx@U\@elt\bx@V
707 \@elt\bx@W\@elt\bx@X\@elt\bx@Y\@elt\bx@Z
708 \@elt\bx@AA\@elt\bx@BB\@elt\bx@CC\@elt\bx@DD\@elt\bx@EE
709 \@elt\bx@FF\@elt\bx@GG\@elt\bx@HH\@elt\bx@II\@elt\bx@JJ
710 \@elt\bx@KK\@elt\bx@LL\@elt\bx@MM\@elt\bx@NN
711 \@elt\bx@OO\@elt\bx@PP\@elt\bx@QQ\@elt\bx@RR
712 \@elt\bx@SS\@elt\bx@TT\@elt\bx@UU\@elt\bx@VV
713 \@elt\bx@WW\@elt\bx@XX\@elt\bx@YY\@elt\bx@ZZ}
714 \reserved@a
715 \def\@elt{\noexpand\@elt\noexpand}
716 \edef\@freelist{\@freelist\reserved@a}
717 \let\reserved@a\relax
718 \let\@elt\relax
719 % \end{macrocode}
720 %
721 % \begin{macrocode}
722 \gdef\@toplist{}
723 \gdef\@botlist{}
724 \gdef\@midlist{}
725 \gdef\@currlist{}
726 \gdef\@deferlist{}
727 \gdef\@dbltoplist{}
728 % \end{macrocode}
729 % \changes{v1.2m}{2015/03/12}
730 % {initialise \cs{@dbldeferlist} again}
731 % The new algorithm stores page wide floats together with column floats
732 % in a single |\@deferlist| list. We keep |\@dbldeferlist|
733 % initialised as empty so that packages that are testing for
734 % deferred floats can use the same code for old or new float
735 % handling.
736 % \begin{macrocode}
737 \gdef\@dbldeferlist{}
738 % \end{macrocode}
739 %
740 %
741 %
742 % \subsubsection{Page layout parameters}
743 %
744 %
745 % \begin{macrocode}
746 \newdimen\topmargin
747 \newdimen\oddsidemargin
748 \newdimen\evensidemargin
749 \let\@themargin=\oddsidemargin
750 \newdimen\headheight
751 \newdimen\headsep
752 \newdimen\footskip
753 \newdimen\textheight
754 \newdimen\textwidth
755 \newdimen\columnwidth
756 \newdimen\columnsep
757 \newdimen\columnseprule
758 \newdimen\marginparwidth
759 \newdimen\marginparsep
760 \newdimen\marginparpush
761 % \end{macrocode}
762 %
763 % \begin{macro}{\AtBeginDvi}
764 % \changes{v1.1c}{1994/11/05}
765 % {Added macro}
766 % \begin{macro}{\@begindvibox}
767 % \changes{v1.1c}{1994/11/05}
768 % {Added macro}
769 % \changes{v1.1f}{1994/11/14}{Use normal box register: why a box?}
770 % \changes{v1.1l}{1995/04/24}{Add \cs{vbox} latex/1392}
771 % \changes{v1.4e}{2019/08/27}{Make \cs{AtBeginDvi} robust}
772 %
773 % We use a box register in which to put
774 % stuff that must appear before anything else in the
775 % |.dvi| file.
776 %
777 % The stuff in the box should not add any typeset material to the
778 % page when it is unboxed.
779 %
780 % This interface is no longer used. Instead a new one is inside
781 % \texttt{ltshipout.dtx}. We only keep the box in case some old
782 % code refers to it directly (or we do some rollback).
783 % \changes{v1.4f}{2020/08/21}{Integration of new hook management interface}
784 % \begin{macrocode}
785 \newbox\@begindvibox
786 %\DeclareRobustCommand \AtBeginDvi [1]{%
787 % \global \setbox \@begindvibox
788 % \vbox{\unvbox \@begindvibox #1}%
789 %}
790 % \end{macrocode}
791 % \end{macro}
792 % \end{macro}
793 %
794 % \begin{macro}{\@maxdepth}
795 % This is not the right place to set this; it needs to be set in a
796 % class/style file when |\maxdepth| is set.
797 %
798 % Also, many settings to |\maxdepth| should be to |\@maxdepth|,
799 % probably?
800 % \task{All}{Sort out maxdepth: both should be set in the class files.}
801 % \begin{macrocode}
802 \newdimen\@maxdepth
803 \@maxdepth = \maxdepth
804 % \end{macrocode}
805 % \end{macro}
806 % \begin{macro}{\paperheight}
807 % \changes{v0.1a}{1993/11/23}{Register added}
808 % \begin{macro}{\paperwidth}
809 % \changes{v0.1a}{1993/11/23}{Register added}
810 % New |\paper|\ldots\ registers.
811 % \begin{macrocode}
812 \newdimen\paperheight
813 \newdimen\paperwidth
814 % \end{macrocode}
815 % \end{macro}
816 % \end{macro}
817 % \begin{macro}{\stockheight}
818 % \changes{v1.4j}{2022/08/20}{Register added}
819 % \begin{macro}{\stockwidth}
820 % \changes{v1.4j}{2022/08/20}{Register added}
821 % New |\stock|\ldots\ registers.
822 % \begin{macrocode}
823 \newdimen\stockheight
824 \newdimen\stockwidth
825 % \end{macrocode}
826 % \end{macro}
827 % \end{macro}
828 %
829 % \begin{macro}{\if@insert}
830 % \begin{macro}{\if@fcolmade}
831 % \begin{macro}{\if@specialpage}
832 % \begin{macro}{\if@firstcolumn}
833 % \begin{macro}{\if@twocolumn}
834 % \begin{macro}{\if@twoside}
835 % \begin{macro}{\if@reversemargin}
836 % \begin{macro}{\if@mparswitch}
837 % \begin{macro}{\col@number}
838 % \changes{v1.0n}{1994/04/30}{Added \cs{col@number}}
839 % Local switches first:
840 % \begin{macrocode}
841 \newif \if@insert
842 % \end{macrocode}
843 % These should definitely be global:
844 % \begin{macrocode}
845 \newif \if@fcolmade
846 \newif \if@specialpage \@specialpagefalse
847 % \end{macrocode}
848 % These should be global but are not always set globally in other
849 % files.
850 % \begin{macrocode}
851 \newif \if@firstcolumn \@firstcolumntrue
852 \newif \if@twocolumn \@twocolumnfalse
853 % \end{macrocode}
854 % Not sure about these: two questions.
855 % Should things which must apply to a whole document be local or
856 % global (they probably should be `preamble only' commands)?
857 % Are these three such things?
858 % \begin{macrocode}
859 \newif \if@twoside \@twosidefalse
860 \newif \if@reversemargin \@reversemarginfalse
861 \newif \if@mparswitch \@mparswitchfalse
862 % \end{macrocode}
863 % This counter has been imported from `multicol'.
864 % \begin{macrocode}
865 \newcount \col@number
866 \col@number \@ne
867 % \end{macrocode}
868 % \end{macro}
869 % \end{macro}
870 % \end{macro}
871 % \end{macro}
872 % \end{macro}
873 % \end{macro}
874 % \end{macro}
875 % \end{macro}
876 % \end{macro}
877 %
878 %
879 %
880 %
881 % \subsubsection{Internal registers}
882 %
883 %
884 %
885 % \begin{macrocode}
886 \newcount\@topnum
887 \newdimen\@toproom
888 \newcount\@dbltopnum
889 \newdimen\@dbltoproom
890 \newcount\@botnum
891 \newdimen\@botroom
892 \newcount\@colnum
893 \newdimen\@textmin
894 \newdimen\@fpmin
895 \newdimen\@colht
896 \newdimen\@colroom
897 \newdimen\@pageht
898 \newdimen\@pagedp
899 \newdimen\@mparbottom \@mparbottom\z@
900 \newcount\@currtype
901 \newbox\@outputbox
902 \newbox\@leftcolumn
903 \newbox\@holdpg
904 % \end{macrocode}
905 %
906 % \begin{macrocode}
907 \def\@thehead{\@oddhead} % initialization
908 \def\@thefoot{\@oddfoot}
909 % \end{macrocode}
910 %
911 %
912 %
913 %
914 % \subsubsection{Page break commands}
915 %
916 % \begin{macro}{\clearpage}
917 % \changes{v1.1r}{1995/10/11}{Added a check so that it does not lose
918 % the argument of \cs{twocolumn[...]}}
919 %
920 % The tests at the beginning are an experimental attempt to avoid a
921 % completely empty page after a |\twocolumn[...]|. This prevents the
922 % text from the argument vanishing into a float box, never to be seen
923 % again. We hope that it does not produce wrong formatting in other
924 % cases.
925 % \changes{v1.1v}{1996/07/26}{add number of missing percents}
926 % \begin{macrocode}
927 \def\clearpage{%
928 \ifvmode
929 \ifnum \@dbltopnum =\m@ne
930 \ifdim \pagetotal <\topskip
931 \hbox{}%
932 \fi
933 \fi
934 \fi
935 \newpage
936 % \end{macrocode}
937 %
938 % After the above \cs{newpage} there may be some still unwritten
939 % \cs{write}'s issued in the output routine and we need to make
940 % sure that they are not lost when \cs{@doclearpage} produces float
941 % pages. Therefore the following trick is applied: We add a
942 % harmless \cs{write} followed by an empty \cs{vbox} and then call
943 % the output routine again through a special penalty. That
944 % triggers \cs{@doclearpage} in the OR which splits off a
945 % zero-sized chunk from box 255 (which should go up to, but not
946 % including, the \cs{vbox}), then \cs{unvbox} that (which should
947 % contain any \cs{write}'s, and then throw away the rest of 255
948 % (which should just contain the \cs{vbox}). That explains the
949 % strange \cs{write}\texttt{-1\{\}}: that statement introduces a
950 % necessary breakpoint so that the split is done before the
951 % \cs{vbox}. If it would not be there and \emph{there are no real
952 % \cs{write}'s}, then the split would grab the whole of 255 and so
953 % would put the \cs{vbox} back on the page and we would end with an
954 % extra page only containing that empty \cs{vbox}.
955 %
956 % Deep breath---the above is my (Frank's) attempt of a slightly longer
957 % version of Leslie's cryptic comment earlier in the file that
958 % this \cs{write} is \enquote{part of a hack to make sure that no
959 % \cs{write}'s are lost}.
960 %
961 % This \cs{write} needs to be non-immediate even if we are
962 % supposedly already past the last page because it has to end up on
963 % the page sent to the output routine if for some reason that
964 % happens.
965 % \changes{v1.4p}{2025/03/05}{Make sure this is a normal write in all
966 % circumstances}
967 % \begin{macrocode}
968 \@@write\m@ne{}%
969 \vbox{}%
970 \penalty -\@Mi
971 }
972 % \end{macrocode}
973 %
974 % \changes{v1.4p}{2025/03/05}{A \LaTeXe{} name for \cs{write} in case
975 % it gets changed after the last page}
976 % \begin{macrocode}
977 \let\@@write\write
978 % \end{macrocode}
979 % \end{macro}
980 %
981 % \begin{macro}{\cleardoublepage}
982 %
983 % \begin{macrocode}
984 \def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
985 \hbox{}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi}
986 %</2ekernel>
987 % \end{macrocode}
988 % \end{macro}
989 %
990 % \begin{macro}{\onecolumn}
991 % \changes{v1.0n}{1994/04/30}{Added setting of \cs{col@number}}
992 % \begin{macrocode}
993 %<*2ekernel|fltrace>
994 \def\onecolumn{%
995 \clearpage
996 \global\columnwidth\textwidth
997 \global\hsize\columnwidth
998 \global\linewidth\columnwidth
999 \global\@twocolumnfalse
1000 \col@number \@ne
1001 \@floatplacement}
1002 % \end{macrocode}
1003 % \end{macro}
1004 %
1005 % \begin{macro}{\newpage}
1006 % \changes{v1.1x}{1996/09/29}{Checks for noskipsec and inlabel added}
1007 % \changes{v1.1x}{1996/09/29}{Checks for noskipsec and inlabel added}
1008 % \changes{v1.1y}{1996/09/30}{Checks for noskipsec and inlabel removed
1009 % pending further tests}
1010 % \changes{v1.1z}{1996/10/24}{Better checks for noskipsec and
1011 % inlabel added, plus nobreak}
1012 % \changes{v1.2a}{1996/10/25}{Reset all flags explicitly}
1013 % \changes{v2.4a}{2017/04/11}{account for the depth of the last row of the page}
1014 % The two checks at the beginning ensure that an item label or
1015 % run-in section title immediately before a |\newpage| get printed
1016 % on the correct page, the one before the page break.
1017 %
1018 % All three tests are largely to make error processing more robust;
1019 % that is why they all reset the flags explicitly, even when it
1020 % would appear that this would be done by a |\leavevmode|.
1021 % \begin{macrocode}
1022 %</2ekernel|fltrace>
1023 %<latexrelease>\IncludeInRelease{2025/06/01}%
1024 %<latexrelease> {\newpage}{Check depth of page}%
1025 %<*2ekernel|latexrelease|fltrace>
1026 \def \newpage {%
1027 \if@noskipsec
1028 \ifx \@nodocument\relax
1029 \leavevmode
1030 \global \@noskipsecfalse
1031 \fi
1032 \fi
1033 \if@inlabel
1034 \leavevmode
1035 \global \@inlabelfalse
1036 \fi
1037 \if@nobreak \@nobreakfalse \everypar{}\fi
1038 % \end{macrocode}
1039 % The |\vfil| at the end of the macro before the break penalty will
1040 % normally result in the page being run short, even with |\flushbottom|
1041 % in effect (in contrast to the behavior
1042 % of |\pagebreak|). However, if there
1043 % is some explicit stretch on the page, say, a |\vfill|, it has the undesired
1044 % side-effect, that the last line will not align at its baseline if it
1045 % contains characters going below the baseline, as the value of |\prevdepth|
1046 % is no longer taken into account by \TeX{}. So we have to back up by that amount
1047 % (or by |\maxdepth| if it is really huge), to mimic the normal behavior
1048 % without the |\newpage|.
1049 %
1050 % In 2017 this was fixed by doing the backing-up here. However, the
1051 % problem with that is that if the page contains footnotes the
1052 % \cs{skip}\cs{\footins} is measured from the baseline of the last
1053 % line and not (as on all other pages) from the bottom of the last
1054 % line. One can argue that measuring from the baseline is better,
1055 % but if that is done it should be done everywhere not just on some
1056 % pages.
1057 %
1058 % Thus this backing up should only happen when there are no
1059 % footnotes. The problem is that, at the point when \cs{newpage} is
1060 % called, it is not known whether or not there are footnotes;
1061 % that is only determined in the output routine. We have therefore
1062 % moved this code to the newly introduced output routine sockets.
1063 % \changes{v1.4q}{2025/03/20}{Remove skip added in 2.4a (footmisc/19)}
1064 %
1065 % An explicit \cs{par} token is required so that after environments
1066 % like lists \cs{par} is reset to its standard meaning and does not
1067 % suppress indentation on the next page.
1068 % \changes{v1.4x}{2025/04/13}{reinserted par token (github/1712)}
1069 % \begin{macrocode}
1070 \par
1071 % \ifdim\prevdepth>\z@
1072 % \vskip -%
1073 % \ifdim\prevdepth>\maxdepth
1074 % \maxdepth
1075 % \else
1076 % \prevdepth
1077 % \fi
1078 % \fi
1079 \vfil
1080 \penalty -\@M}
1081 %</2ekernel|latexrelease|fltrace>
1082 %<latexrelease>\EndIncludeInRelease
1083 % \end{macrocode}
1084 %
1085 % \begin{macrocode}
1086 %<latexrelease>\IncludeInRelease{2017/04/15}%
1087 %<latexrelease> {\newpage}{Check depth of page}%
1088 %<latexrelease>\def \newpage {%
1089 %<latexrelease> \if@noskipsec
1090 %<latexrelease> \ifx \@nodocument\relax
1091 %<latexrelease> \leavevmode
1092 %<latexrelease> \global \@noskipsecfalse
1093 %<latexrelease> \fi
1094 %<latexrelease> \fi
1095 %<latexrelease> \if@inlabel
1096 %<latexrelease> \leavevmode
1097 %<latexrelease> \global \@inlabelfalse
1098 %<latexrelease> \fi
1099 %<latexrelease> \if@nobreak \@nobreakfalse \everypar{}\fi
1100 %<latexrelease> \par
1101 %<latexrelease> \ifdim\prevdepth>\z@
1102 %<latexrelease> \vskip -%
1103 %<latexrelease> \ifdim\prevdepth>\maxdepth
1104 %<latexrelease> \maxdepth
1105 %<latexrelease> \else
1106 %<latexrelease> \prevdepth
1107 %<latexrelease> \fi
1108 %<latexrelease> \fi
1109 %<latexrelease> \vfil
1110 %<latexrelease> \penalty -\@M}
1111 % \end{macrocode}
1112 %
1113 % \begin{macrocode}
1114 %<latexrelease>\EndIncludeInRelease
1115 %<latexrelease>\IncludeInRelease{0000/00/00}%
1116 %<latexrelease> {\newpage}{Check depth of page}%
1117 %<latexrelease>\def \newpage {%
1118 %<latexrelease> \if@noskipsec
1119 %<latexrelease> \ifx \@nodocument\relax
1120 %<latexrelease> \leavevmode
1121 %<latexrelease> \global \@noskipsecfalse
1122 %<latexrelease> \fi
1123 %<latexrelease> \fi
1124 %<latexrelease> \if@inlabel
1125 %<latexrelease> \leavevmode
1126 %<latexrelease> \global \@inlabelfalse
1127 %<latexrelease> \fi
1128 %<latexrelease> \if@nobreak \@nobreakfalse \everypar{}\fi
1129 %<latexrelease> \par
1130 %<latexrelease> \vfil
1131 %<latexrelease> \penalty -\@M}
1132 %<latexrelease>\EndIncludeInRelease
1133 %<*2ekernel|fltrace>
1134 % \end{macrocode}
1135 % \end{macro}
1136 %
1137 % \begin{macro}{\@emptycol}
1138 % \changes{v1.0n}{1994/04/30}{Empty column action added:
1139 % \cs{@emptycol}}
1140 % It may be better to use an invisible rule rather than an empty
1141 % box here.
1142 % \begin{macrocode}
1143 \def \@emptycol {\vbox{}\penalty -\@M}
1144 % \end{macrocode}
1145 % \end{macro}
1146 %
1147 % \begin{macro}{\twocolumn}
1148 % \begin{macro}{\@topnewpage}
1149 % \changes{v1.0f}{1993/12/05}{Commands changed}
1150 % \changes{v1.0g}{1993/12/06}{\cs{@floatplacement} placement bug
1151 % fixed}
1152 % \changes{v1.0j}{1993/12/17}{check for vsize too small added}
1153 % \changes{v1.2c}{1997/11/09}{Documentation of vsize check enhanced}
1154 % There are several bug fixes to the two-column stuff here.
1155 %
1156 % \changes{v1.0n}{1994/04/30}{Added setting of \cs{col@number}}
1157 % \begin{macrocode}
1158 \def \twocolumn {%
1159 \clearpage
1160 \global\columnwidth\textwidth
1161 \global\advance\columnwidth-\columnsep
1162 \global\divide\columnwidth\tw@
1163 \global\hsize\columnwidth
1164 \global\linewidth\columnwidth
1165 \global\@twocolumntrue
1166 \global\@firstcolumntrue
1167 \col@number \tw@
1168 % \end{macrocode}
1169 % There is no reason to put a |\@dblfloatplacement| here since
1170 % |\@topnewpage| ignores these settings.
1171 % The |\@floatplacement| is needed in case this comes after some
1172 % changes.
1173 % \changes{v1.0h}{1993/12/12}{braces removed}
1174 % \begin{macrocode}
1175 \@ifnextchar [\@topnewpage\@floatplacement
1176 }
1177 % \end{macrocode}
1178 %
1179 % Note that here, getting a box from the freelist can assume
1180 % success since this comes just after a |\clearpage|.
1181 % \changes{v1.0n}{1994/04/30}{Added setting of \cs{col@number}}
1182 % \changes{v1.1a}{1994/10/31}
1183 % {(DPC/CAR) Use \cs{color@begingroup} for colour}
1184 % \changes{v1.1a}{1994/10/31}
1185 % {(DPC/CAR) Use \cs{normalcolor}}
1186 % \changes{v1.1a}{1994/10/31}
1187 % {(DPC/CAR) Extra box added to remove colour resetting from vmode}
1188 % \changes{v1.1b}{1994/11/05}
1189 % {Use new \cs{color@hbox} concept.}
1190 % \changes{v1.1i}{1994/11/21}{Changed to \cs{color@vbox}}
1191 % \changes{v1.1z}{1996/10/24}{Added \cs{@nodocument} to trap
1192 % \cs{twocolumn} in the preamble}
1193 % \begin{macrocode}
1194 \long\def \@topnewpage [#1]{%
1195 \@nodocument
1196 \@next\@currbox\@freelist{}{}%
1197 \global \setbox\@currbox
1198 \color@vbox
1199 \normalcolor
1200 \vbox {%
1201 \hsize\textwidth
1202 \@parboxrestore
1203 \col@number \@ne
1204 #1%
1205 \vskip -\dbltextfloatsep
1206 }%
1207 \color@endbox
1208 % \end{macrocode}
1209 % Added size test and warning message; perhaps we should use
1210 % an error message.
1211 % \changes{v1.0l}{1994/03/15}{Corrected and amended warning message}
1212 % \changes{v1.0m}{1994/04/24}{Warning message removed as it will be
1213 % generated later}
1214 % \begin{macrocode}
1215 \ifdim \ht\@currbox>\textheight
1216 \ht\@currbox \textheight
1217 \fi
1218 % \end{macrocode}
1219 % This next line is not essential but it is more robust to make this
1220 % value non-zero, in case of weird errors.
1221 %
1222 % This next bit is what is needed from |\@addtodblcol|, plus some
1223 % extra checks for error trapping.
1224 % \begin{macrocode}
1225 \global \count\@currbox \tw@
1226 \@tempdima -\ht\@currbox
1227 \advance \@tempdima -\dbltextfloatsep
1228 \global \advance \@colht \@tempdima
1229 \ifx \@dbltoplist \@empty
1230 \else
1231 \@latex@error{Float(s) lost}\@ehb
1232 \let \@dbltoplist \@empty
1233 \fi
1234 \@cons \@dbltoplist \@currbox
1235 % \end{macrocode}
1236 % This setting of |\@dbltopnum| is used only to change the
1237 % typesetting in\\ |\@combinedblfloats|.
1238 % \begin{macrocode}
1239 \global \@dbltopnum \m@ne
1240 %<*trace>
1241 \fl@trace{dbltopnum set to -1 (= \the \@dbltopnum) (topnewpage)}%
1242 %</trace>
1243 % \end{macrocode}
1244 % At points such as this we need to check that there is still a
1245 % minimal amount of room left on the page; this uses an arbitrary
1246 % small value at present; but note that this value is larger than
1247 % that used when checking that page is too full of normal floats.
1248 %
1249 % If there is little room left we just force a page-break, OK?
1250 % This involves producing two empty columns. The second empty
1251 % column may be produced by |\output|, in which case an extra,
1252 % misleading, warning will be generated, OK? (This happens only
1253 % when there is too little room left on the page for any float.)
1254 % Otherwise (\ie if the size is such that it is allowed as a normal
1255 % float) the extra |\@emptycol| will be invoked in the second
1256 % column by the conditional code guarded by the |\if@firstcolumn|
1257 % test.
1258 %
1259 % I now think that the cut-off point here should be |3\baselineskip|,
1260 % but we make it a bit less so that 3 lines of text will be
1261 % allowed, OK?
1262 %
1263 % Since this happens only when there is nothing on the page but the
1264 % `top-box', the empty box should not cause any problem other than
1265 % some overfull box messages, which is not entirely misleading.
1266 %
1267 % Here we need two page-ends since both columns need to be empty.
1268 % \task{???}{Make it less arbitrary?}
1269 % \changes{v1.0j}{1993/12/17}{Page room test added}
1270 % \changes{v1.0l}{1994/03/15}{Warning added: it should be improved}
1271 % \changes{v1.0m}{1994/04/24}{Message changed to give more info}
1272 % \changes{v1.0n}{1994/04/30}{Message changed for Frank}
1273 % \changes{v1.0n}{1994/04/30}{Empty column action added:
1274 % \cs{@emptycol}}
1275 % \changes{v1.0n}{1994/04/30}{Cut-off point changed to
1276 % 3\cs{baselineskip}}
1277 % \changes{v1.1t}{1996/05/24}{Cut-off point changed to
1278 % 2.5\cs{baselineskip}}
1279 % \begin{macrocode}
1280 \ifdim \@colht<2.5\baselineskip
1281 \@latex@warning@no@line {Optional argument of \noexpand\twocolumn
1282 too tall on page \thepage}%
1283 \@emptycol
1284 \if@firstcolumn
1285 \else
1286 \@emptycol
1287 \fi
1288 \else
1289 \global \vsize \@colht
1290 \global \@colroom \@colht
1291 \@floatplacement
1292 \fi
1293 }
1294 % \end{macrocode}
1295 % \end{macro}
1296 % \end{macro}
1297 %
1298 %
1299 %
1300 % \section{The \LaTeX{} output routine}
1301 %
1302 % \subsection{Hooks and replaceable code blocks}
1303 %
1304 % To support packages that want to augment aspects of the output
1305 % routine we offer a number of hooks (where several packages can
1306 % add code) as well as some sockets (that can only be changed by
1307 % one package or through options like those of the \pkg{footmisc}
1308 % package).
1309 %
1310 %
1311 % \subsubsection{Output routine hooks}
1312 %
1313 % \begin{description}
1314 %
1315 % \item[\hook{build/page/before}, \hook{build/page/after}]
1316 % These two hooks enable packages to prepend or append code to
1317 % the page processing in the output routine. They are
1318 % implemented as mirrored hooks.
1319 %
1320 % Technically, they are executed at the start and the end of the internal
1321 % \LaTeXe{} \cs{@outputpage} command, respectively.
1322 %
1323 %
1324 % \item[\hook{build/page/reset}]
1325 % Packages that set up special conventions for text in the main
1326 % galley (such as catcode changes, etc.)\ can use this hook to
1327 % undo these changes within the output routine, so that they
1328 % aren't applied to unrelated material, e.g., the text for
1329 % running header or footers.
1330 %
1331 % \item[\hook{build/column/before}, \hook{build/column/after}]
1332 % These two hooks enable packages to prepend or append code to
1333 % the column processing in the output routine. They are
1334 % implemented as mirrored hooks.
1335 %
1336 % Technically, they are executed at the start and the end of the internal
1337 % \LaTeXe{} \cs{@makecol} command, respectively.
1338 %
1339 % \end{description}
1340 %
1341 % \subsubsection{Replaceable code blocks (sockets)}
1342 %
1343 % To cater for different layouts with respect to text, footnotes,
1344 % and bottom-floats placements there are sockets for
1345 % now. They are sockets not hooks, because the overall layout can only be
1346 % controlled by one package, i.e., the last setting wins.
1347 %
1348 % \begin{description}
1349 % \item[\socket{build/column/outputbox} (0 arguments)]
1350 %
1351 % In code for this socket the \cs{@outputbox} (holding the
1352 % galley text for the current column or page) is augmented by
1353 % attaching floats and footnote areas together with appropriate
1354 % spacing.
1355 %
1356 % Prior to calling the socket the output routine has already
1357 % decided which floats go into which area and which get deferred.
1358 % Therefore, the assumption is that the code in the socket attaches all
1359 % areas that contain floats. If this is not done, then the order
1360 % of floats is likely to be screwed up unless unused floats
1361 % are moved to the defer list in an appropriate way (for now we
1362 % don't offer any interface for that scenario).
1363 %
1364 % Before the code in the socket is run, any existing glue at the bottom
1365 % of the \cs{@outputbox} is removed and stored in a safe
1366 % place. If needed, it can be reinserted with one of the helper
1367 % commands.
1368 %
1369 % To support setting this up the following helper commands are available:
1370 % \begin{description}
1371 % \item[\cs{@outputbox@append} (1 argument)]
1372 %
1373 % \DescribeMacro[noprint]{@outputbox@append}
1374 %
1375 % This general purpose command alters the \cs{@outputbox} box by
1376 % appending material to it.
1377 %
1378 % \item[\cs{@outputbox@appendfil} (0 arguments)]
1379 %
1380 % Append a \cs{vfil} to the \cs{@outputbox}. Based on the plug
1381 % in \socket{build/column/baselineattach} either measured from
1382 % the bottom or from the baseline of the last line in the box.
1383 %
1384 % \item[\cs{@outputbox@appendfootnotes} (0 arguments)]
1385 %
1386 % \DescribeMacro[noprint]{@outputbox@appendfootnotes}
1387 %
1388 % This command appends the footnotes to the \cs{@outputbox} (if
1389 % there are any). If not, then it does nothing.
1390 %
1391 % \item[\cs{@outputbox@attachfloats} (0 arguments)]
1392 % \item[\cs{@outputbox@attachtopfloats} (0 arguments)]
1393 % \item[\cs{@outputbox@attachbottomfloats} (0 arguments)]
1394 %
1395 % \DescribeMacro[noprint]{@outputbox@attachfloats}
1396 % \DescribeMacro[noprint]{@outputbox@attachtopfloats}
1397 % \DescribeMacro[noprint]{@outputbox@attachbottomfloats}
1398 %
1399 % Attaching top and bottom floats can usually be done in one
1400 % go, but for special layouts we might want more control so we
1401 % provide also separate commands.
1402 %
1403 % \item[\cs{@outputbox@reinsertbskip} (0 arguments)]
1404 %
1405 % \DescribeMacro[noprint]{@outputbox@reinsertbskip}
1406 %
1407 % Reinsert the bottom skip of the \cs{@outputbox} that was
1408 % saved before in \cs{@makecol}.
1409 %
1410 % \item[Testing for existence of material]
1411 %
1412 % \DescribeMacro[noprint]{@if@footnotes@TF}
1413 % \DescribeMacro[noprint]{@if@bottomfloats@TF}
1414 %
1415 % There are a number of helpers to run conditional code
1416 % depending on whether or not there are footnotes or bottom
1417 % floats. They are \cs{@if@footnotes@TF} and
1418 % \cs{@if@bottomfloats@TF}
1419 % (names are likely to change).
1420 %
1421 % \end{description}
1422 %
1423 % \task{fmi}{Decide on names for these helper commands. We could keep
1424 % them similar to the above (because they are only supposed to be
1425 % used by a few packages). However, we could alternatively use
1426 % CamelCase names, under the assumption that classes may also
1427 % directly define a plug for the socket, instead of loading a
1428 % support package such as \pkg{footmisc} (or in addition
1429 % to). --- decide}
1430 %
1431 % This socket cannot be empty but needs appropriate code; a set
1432 % of suitable plugs for it are already given in the kernel. These
1433 % are
1434 % \begin{description}
1435 % \item[\plug{space-footnotes-floats}]
1436 %
1437 % After the galley text there is a vertical \cs{vfil}
1438 % followed by any footnotes followed by the bottom floats, if any.
1439 %
1440 % \item[\plug{footnotes-space-floats}]
1441 %
1442 % As before but the \cs{vfil} is between footnotes and floats.
1443 %
1444 % \item[\plug{floats-space-footnotes}]
1445 %
1446 % Floats are directly after the text, then a space and then
1447 % footnotes at the bottom.
1448 %
1449 % \item[\plug{space-floats-footnotes}]
1450 %
1451 % Both floats and footnotes are pushed to the bottom with
1452 % footnotes last.\footnote{There are two more permutations,
1453 % but neither of them has ever been requested so they aren't
1454 % set up by default --- doing that in a class would be trivial
1455 % though.}
1456 %
1457 % \item[\plug{floats-footnotes}]
1458 %
1459 % All excess space is distributed across the existing
1460 % glue on the page, e.g., within the text galley, the
1461 % separation between blocks, etc.
1462 % The order is text, floats, footnotes.
1463 %
1464 % \item[\plug{footnotes-floats}]
1465 %
1466 % As the previous one but floats and footnotes are
1467 % swapped. This is the \LaTeX{} default for newer document,
1468 % i.e., this plug is assigned to the socket when
1469 % \cs{DocumentMetadata} is used.
1470 %
1471 % \item[\plug{footnotes-floats-legacy}]
1472 %
1473 % As the previous one but \LaTeX{}'s bottom skip bug is not
1474 % corrected, i.e., in ragged bottom designs where footnotes
1475 % are supposed to be directly attached to the text, they suddenly
1476 % appear at the bottom of the page when the page is ended with
1477 % \cs{newpage} or \cs{clearpage}.
1478 % While this is clearly a bug, it was the case since the days
1479 % of \LaTeX~2.09; thus for
1480 % compatibility we continue to support this behavior.
1481 %
1482 % \end{description}
1483 %
1484 %
1485 % \item[\socket{build/column/footnotes} (0 arguments)]
1486 %
1487 % This socket is used to manipulate the footnote
1488 % material inside \cs{box}\cs{footins}. It if contains code, it
1489 % is supposed to do some processing of that box and then write
1490 % the result back into it (and nothing else!). By default it
1491 % does nothing, i.e., has the \plug{noop} assigned.
1492 %
1493 % If (short) footnotes are run as a paragraph this socket gets
1494 % the plug \plug{para} assigned which is defined elsewhere.
1495 %
1496 % \item[\socket{build/column/baselineattach} (0 arguments)]
1497 %
1498 % By default, footnotes are attached after the last line of text
1499 % by adding a \cs{vskip}\cs{skip}\cs{footins}, i.e., the space
1500 % is measured from the bottom of \cs{@outputbox} (plug
1501 % \plug{off}). Bottom floats are attached in a similar way by
1502 % using \cs{vskip}\cs{textfloatsep}.
1503 %
1504 % The socket can get the plug \plug{on} assigned, in which case
1505 % the skip starts at the baseline of the last line in
1506 % \cs{@outputbox}, if there is one; otherwise it starts still
1507 % from the bottom of the box.
1508 %
1509 % \end{description}
1510 %
1511 % \subsubsection{Tagging sockets}
1512 %
1513 % The following sockets are used to implement tagging. They are used
1514 % via \cs{UseTaggingSocket} which turns them off when tagging is
1515 % disabled.
1516 % For each of them a \plug{default} plug is implemented that holds the tagging code.
1517 %
1518 % \begin{description}
1519 %
1520 % \item[\socket{build/column/outputbox} (0 arguments)]
1521 % This socket is used to add any missing tagging structures to the
1522 % \cs{@outputbox} box, if necessary.
1523 %
1524 % \item[\socket{build/column/footins} (0 arguments)]
1525 % This socket is used to add any missing tagging structures to
1526 % \cs{footins} box, if necessary.
1527 %
1528 % \item[\socket{build/page/header} (2 arguments)]
1529 %
1530 % This socket receives the content of the formatted page header
1531 % as its second argument and adds the necessary tagging around
1532 % it. The first argument is empty as no special setup is
1533 % necessary.
1534 %
1535 % \item[\socket{build/page/footer} (2 arguments)]
1536 %
1537 % This socket receives the content of the formatted page footer
1538 % as its second argument and adds the necessary tagging around
1539 % it. The first argument is empty as no special setup is
1540 % necessary.
1541 %
1542 % \end{description}
1543 %
1544 %
1545 %
1546 %
1547 %
1548 % \subsubsection{Output routine commands}
1549 %
1550 %
1551 %
1552 %
1553 % \begin{macro}{\output}
1554 % \changes{v1.0f}{1993/12/05}{Command changed}
1555 % \begin{macro}{\@specialoutput}
1556 % \changes{v0.1c}{1993/11/23}{Command changed}
1557 % \changes{v1.0f}{1993/12/06}{Unboxing of 255 added to rescue writes}
1558 % This needs some small adjustments. We cannot
1559 % guarantee that the float mechanism will interact correctly with
1560 % this stuff, but that mechanism does not always work properly
1561 % with footnotes already.
1562 %
1563 % RmS 91/09/29:
1564 %
1565 % added reset of |\par| to the output routine.
1566 % This avoids problems when the output routine is
1567 % called within a list where |\par| may be a no-op.
1568 %
1569 % \begin{macrocode}
1570 \output {%
1571 \let \par \@@par
1572 \ifnum \outputpenalty<-\@M
1573 \@specialoutput
1574 \else
1575 \@makecol
1576 \@opcol
1577 % \end{macrocode}
1578 % Moved to |\@opcol|: |\@floatplacement|.
1579 % \begin{macrocode}
1580 \@startcolumn
1581 % \end{macrocode}
1582 % This loop could be replaced by an |\expandafter| tail
1583 % recursion in |\@startcolumn|.
1584 % \begin{macrocode}
1585 \@whilesw \if@fcolmade \fi
1586 {%
1587 %<*trace>
1588 \fl@trace{PAGE: float \if@twocolumn column \else page \fi
1589 completed}%
1590 %</trace>
1591 \@opcol\@startcolumn}%
1592 \fi
1593 \ifnum \outputpenalty>-\@Miv
1594 % \end{macrocode}
1595 % At points such as this we need to check that there is still a
1596 % minimal amount of room left on the page; this uses an arbitrary
1597 % small value at present. If there is little room left we just
1598 % force a page-break, OK?
1599 %
1600 % This bit is essential only if a float has just been processed so
1601 % maybe it should be moved; but this is the natural place at which
1602 % to set the vsize and a test would need to be done anyway. A
1603 % check has been added to ensure that there really has been a
1604 % change in the value of |\@colroom|.
1605 %
1606 % Since this happens only when there is nothing on the page but
1607 % floats, the empty box should not cause any problem other than
1608 % some overfull box messages, which is not entirely misleading.
1609 %
1610 % The twocolumn case does not need any extra code here since this
1611 % is the |\output| itself; in the second column there will still
1612 % not be enough room left so |\@emptycol| will be executed again
1613 % when the OR is called by the-page builder when it gets to the
1614 % penalty inserted by the first execution. (The page-builder is
1615 % never invoked whilst the OR is being executed since it builds a
1616 % inner vlist; thus any conditional code for the two-column case
1617 % within |\output| may not get executed with the correct value of
1618 % |\if@firstcolumn|.
1619 %
1620 % \task{???}{Make it less arbitrary?}
1621 % \changes{v1.0j}{1993/12/17}{Page room test added}
1622 % \changes{v1.0m}{1994/04/24}{Message changed to give more info and
1623 % `top' removed}
1624 % \changes{v1.0n}{1994/04/30}{Extra empty column added for
1625 % twocolumn case (wrong, see below)}
1626 % \changes{v1.0n}{1994/04/30}{Extra empty column added for
1627 % twocolumn case}
1628 % \changes{v1.0n}{1994/04/30}{Empty column action added:
1629 % \cs{@emptycol}}
1630 % \changes{v1.0n}{1994/04/30}{Cut-off point changed to
1631 % 2\cs{baselineskip}}
1632 % \changes{v1.1t}{1996/05/24}{Cut-off point changed to
1633 % 1.5\cs{baselineskip}}
1634 % \changes{v1.1t}{1996/05/24}{Check that \cs{@colroom} is less
1635 % than \cs{vsize}, indicating that a float has been added}
1636 % \changes{v1.1u}{1996/05/25}{Correct the above check}
1637 % \changes{v1.2c}{1997/11/09}{Remove incorrect code: only one
1638 % \cs{@emptycol} is needed here}
1639 % \begin{macrocode}
1640 \ifdim \@colroom<1.5\baselineskip
1641 \ifdim \@colroom<\textheight
1642 \@latex@warning@no@line {Text page \thepage\space
1643 contains only floats}%
1644 \@emptycol
1645 % \if@twocolumn
1646 % \if@firstcolumn
1647 % \else
1648 % \@emptycol
1649 % \fi
1650 % \fi
1651 \else
1652 \global \vsize \@colroom
1653 \fi
1654 \else
1655 \global \vsize \@colroom
1656 \fi
1657 \else
1658 \global \vsize \maxdimen
1659 \fi
1660 }
1661 % \end{macrocode}
1662 %
1663 % \begin{oldcomments}
1664 % CHANGES TO \@specialoutput:
1665 % * \penalty\z@ changed to \penalty\interlinepenalty so \samepage
1666 % works properly with figure and table environments.
1667 % (Changed 23 Oct 86)
1668 %
1669 % * Definition of \@specialoutput changed 26 Feb 88 so \@pageht and
1670 % \@pagedp aren't changed for a marginal note.
1671 % (Change suggested by Chris Rowley.)
1672 % \end{oldcomments}
1673 %
1674 % \begin{macrocode}
1675 \gdef\@specialoutput{%
1676 \ifnum \outputpenalty>-\@Mii
1677 \@doclearpage
1678 \else
1679 \ifnum \outputpenalty<-\@Miii
1680 \ifnum \outputpenalty<-\@MM \deadcycles \z@ \fi
1681 \global \setbox\@holdpg \vbox {\unvbox\@cclv}%
1682 \else
1683 % \end{macrocode}
1684 % Note that |\boxmaxdepth| should not be set here since we wish to
1685 % record the natural depth of the holdpg box.
1686 %
1687 % This is changed so as to not lose anything, such as writes
1688 % and marks, which may get into box 255 and should be returned to
1689 % the list. This should only happen when the first penalty in the
1690 % mechanism is discarded and therefore |\@holdpg| should always be
1691 % void in this case. This can happen because a penalty is
1692 % discarded whenever there is no box on the list.
1693 %
1694 % It was just: |\setbox\@tempboxa \box \@cclv|.
1695 %
1696 % The last box which is removed is the box put there by the
1697 % double-penalty mechanism. The |\unskip| then removes the
1698 % |\topskip| which is put there since the box is the first on the
1699 % page.
1700 % \task{CAR/FMi}{Is it more efficient to check whether the holdpg box
1701 % is void and then act accordingly?}
1702 % \begin{macrocode}
1703 \global \setbox\@holdpg \vbox{%
1704 \unvbox\@holdpg
1705 \unvbox\@cclv
1706 % \end{macrocode}
1707 % We must now remove the box added by the float mechanism and the
1708 % |\topskip| glue therefore added above it by \TeX.
1709 % \begin{macrocode}
1710 \setbox\@tempboxa \lastbox
1711 \unskip
1712 }%
1713 % \end{macrocode}
1714 % These two are needed as separate dimensions only by
1715 % |\@addmarginpar|; for other purposes we put the whole size into
1716 % |\@pageht| (see below).
1717 % \begin{macrocode}
1718 \@pagedp \dp\@holdpg
1719 \@pageht \ht\@holdpg
1720 \unvbox \@holdpg
1721 \@next\@currbox\@currlist{%
1722 \ifnum \count\@currbox>\z@
1723 % \end{macrocode}
1724 % Putting the whole size into |\@pageht| (see above).
1725 % \begin{macrocode}
1726 \advance \@pageht \@pagedp
1727 \ifvoid\footins \else
1728 \advance \@pageht \ht\footins
1729 \advance \@pageht \skip\footins
1730 \advance \@pageht \dp\footins
1731 \fi
1732 \ifvbox \@kludgeins
1733 % \end{macrocode}
1734 % We want to make the adjustment due to this insert only if the
1735 % non-star form is used. The *-form will probably not work with
1736 % floats, but maybe it still could make some adjustment here even
1737 % so?
1738 % \begin{macrocode}
1739 \ifdim \wd\@kludgeins=\z@
1740 \advance \@pageht \ht\@kludgeins
1741 %<*trace>
1742 \fl@trace {Extra size added: \the \ht\@kludgeins}%
1743 %</trace>
1744 \fi
1745 \fi
1746 % \end{macrocode}
1747 % This version puts the inserts back just before the additional
1748 % material; it could be moved earlier, before unboxing the
1749 % page-so-far. Neither is guaranteed not to put things on the wrong
1750 % page. This version is similar to the original version.
1751 % \begin{macrocode}
1752 \@reinserts
1753 \@addtocurcol
1754 \else
1755 \@reinserts
1756 \@addmarginpar
1757 \fi
1758 }\@latexbug
1759 % \end{macrocode}
1760 % A 2e change: use |\addpenalty| instead of |\penalty| here. Some
1761 % penalty is needed to create a potential break-point immediately
1762 % after the reinserts (or the marginal). Otherwise there can be no
1763 % possibility to break here and this can cause the reinserts or the
1764 % marginal to appear on the next page (which is often incorrect).
1765 % However, if the nobreak flag is true, a |\nobreak| must be
1766 % correct.
1767 % \changes{v1.1i}{1994/11/21}{Added \cs{if@nobreak} test}
1768 % \changes{v1.1z}{1996/10/24}{Added \cs{nobreak} as appropriate}
1769 % \begin{macrocode}
1770 \ifnum \outputpenalty<\z@
1771 \if@nobreak
1772 \nobreak
1773 \else
1774 \addpenalty \interlinepenalty
1775 \fi
1776 \fi
1777 \fi
1778 \fi
1779 }
1780 %</2ekernel|fltrace>
1781 % \end{macrocode}
1782 % \end{macro}
1783 % \end{macro}
1784 %
1785 % \begin{macro}{\@testwrongwidth}
1786 % \begin{macro}{\f@depth}
1787 % \changes{v1.2n}{2015/02/21}{macro added(latexrelease)}
1788 %
1789 % Test if the float box has the wrong width when trying to place it
1790 % into some area. (Actually
1791 % the test is for a conventional depth setting rather than for the
1792 % width of the float. For that reason the box depth was explicitly
1793 % tailored when the float was created).
1794 % \begin{macrocode}
1795 %<latexrelease>\IncludeInRelease{2015/01/01}%
1796 %<latexrelease> {\@testwrongwidth}{float order in 2-column}%
1797 %<*2ekernel|latexrelease|fltrace>
1798 % \end{macrocode}
1799 %
1800 % \begin{macrocode}
1801 \def\@testwrongwidth #1{%
1802 \ifdim\dp#1=\f@depth
1803 %<*trace>
1804 \fl@trace{\string#1
1805 \ifdim\f@depth=\z@ single \else double \fi
1806 column float -- ok}%
1807 %</trace>
1808 \else
1809 \global\@testtrue
1810 %<*trace>
1811 \fl@trace{\string#1
1812 \ifdim\f@depth=\z@ double \else single \fi
1813 column float -- wrong}%
1814 %</trace>
1815 \fi}%
1816 % \end{macrocode}
1817 %
1818 % Normally looking for single column floats, which have zero depth.
1819 % \begin{macrocode}
1820 \let\f@depth\z@
1821 % \end{macrocode}
1822 %
1823 % \begin{macrocode}
1824 %</2ekernel|latexrelease|fltrace>
1825 %<latexrelease>\EndIncludeInRelease
1826 %<latexrelease>\IncludeInRelease{0000/00/00}%
1827 %<latexrelease> {\@testwrongwidth}{float order in 2-column}%
1828 %<latexrelease>\let\@testwrongwidth\@undefined
1829 %<latexrelease>\let\f@depth\@undefined
1830 %<latexrelease>\EndIncludeInRelease
1831 % \end{macrocode}
1832 % \end{macro}
1833 % \end{macro}
1834 %
1835 %
1836 % \begin{macro}{\@doclearpage}
1837 % \task{CAR/FMi}{Investigate better float clearance}
1838 % \task{CAR/FMi}{Put non-boxes back in the `right place', or nowhere?}
1839 % This is a very much an emergency action, just dumping everything:
1840 % footnotes first then floats. A more sophisticated version is
1841 % needed; but even more urgent is a bug-free version (see, for
1842 % example, pr/3528).
1843 %
1844 % Also, it puts any left-over non-boxes (writes, specials, etc.) back
1845 % after any float pages created: this is a very bad bug since,
1846 % for example, a kludge insert will be in quite the wrong place
1847 % and, worse, be irremovable and uncancelable.
1848 %
1849 % \changes{v1.2n}{2015/01/14}{float order in 2-column (latexrelease)}
1850 % All the remaining changes are replacing the double column defer list
1851 % or inserting the extra test |\@testwrongwidth|\marg{box} at suitable
1852 % places. That is at places where a box is taken off the deferlist.
1853 % \begin{macrocode}
1854 %<latexrelease>\IncludeInRelease{2015/01/01}{\@doclearpage}%
1855 %<latexrelease> {float order in 2-column}%
1856 %<*2ekernel|latexrelease>
1857 \def \@doclearpage {%
1858 \ifvoid\footins
1859 % \end{macrocode}
1860 % \changes{v1.2n}{2015/01/14}{Empty kludgeins box if necessary, pr/3528}
1861 % \begin{macrocode}
1862 \ifvbox\@kludgeins
1863 {\setbox \@tempboxa \box \@kludgeins}%
1864 %<*trace>
1865 \fl@trace {kludgeins box made void}%
1866 %</trace>
1867 \fi
1868 \setbox\@tempboxa\vsplit\@cclv to\z@ \unvbox\@tempboxa
1869 \setbox\@tempboxa\box\@cclv
1870 \xdef\@deferlist{\@toplist\@botlist\@deferlist}%
1871 \global \let \@toplist \@empty
1872 \global \let \@botlist \@empty
1873 \global \@colroom \@colht
1874 \ifx \@currlist\@empty
1875 \else
1876 \@latex@error{Float(s) lost}\@ehb
1877 \global \let \@currlist \@empty
1878 \fi
1879 \@makefcolumn\@deferlist
1880 \@whilesw\if@fcolmade \fi{\@opcol\@makefcolumn\@deferlist}%
1881 \if@twocolumn
1882 \if@firstcolumn
1883 % \end{macrocode}
1884 %
1885 % \begin{macrocode}
1886 \xdef\@deferlist{\@dbltoplist\@deferlist}%
1887 % \end{macrocode}
1888 %
1889 % \begin{macrocode}
1890 \global \let \@dbltoplist \@empty
1891 \global \@colht \textheight
1892 \begingroup
1893 \@dblfloatplacement
1894 % \end{macrocode}
1895 %
1896 % \begin{macrocode}
1897 \@makefcolumn\@deferlist
1898 \@whilesw\if@fcolmade \fi{\@outputpage
1899 \@makefcolumn\@deferlist}%
1900 % \end{macrocode}
1901 %
1902 % \begin{macrocode}
1903 \endgroup
1904 \else
1905 \vbox{}\clearpage
1906 \fi
1907 \fi
1908 % \end{macrocode}
1909 % the next line is needed to avoid losing floats in certain
1910 % circumstances a single call to the original |\doclearpage|
1911 % will now no longer output all floats.
1912 % \changes{v1.2b}{2000/09/24}{FMi: ensure \cs{doclearpage}
1913 % is called again until all floats are output.}
1914 % \begin{macrocode}
1915 \ifx\@deferlist\@empty \else\clearpage \fi
1916 \else
1917 \setbox\@cclv\vbox{\box\@cclv\vfil}%
1918 \@makecol\@opcol
1919 \clearpage
1920 \fi
1921 }%
1922 %</2ekernel|latexrelease>
1923 %<latexrelease>\EndIncludeInRelease
1924 %<latexrelease>\IncludeInRelease{0000/00/00}{\@doclearpage}%
1925 %<latexrelease> {float order in 2-column}%
1926 %<latexrelease>\def \@doclearpage {%
1927 %<latexrelease> \ifvoid\footins
1928 % \end{macrocode}
1929 % \changes{v1.2l}{2004/02/07}{Empty kludgeins box if necessary, pr/3528}
1930 % We empty any left over kludge insert box here; this is a temporary fix.
1931 % It should perhaps be applied to one page of cleared floats, but
1932 % who cares? The whole of this stuff needs completely redoing for
1933 % many such reasons.
1934 % \begin{macrocode}
1935 %<latexrelease> \ifvbox\@kludgeins
1936 %<latexrelease> {\setbox \@tempboxa \box \@kludgeins}%
1937 %<*trace>
1938 %<latexrelease> \fl@trace {kludgeins box made void}%
1939 %</trace>
1940 %<latexrelease> \fi
1941 %<latexrelease> \setbox\@tempboxa\vsplit\@cclv to\z@ \unvbox\@tempboxa
1942 %<latexrelease> \setbox\@tempboxa\box\@cclv
1943 %<latexrelease> \xdef\@deferlist{\@toplist\@botlist\@deferlist}%
1944 % \end{macrocode}
1945 % \changes{v1.0h}{1993/12/12}{defs changed to lets}
1946 % \begin{macrocode}
1947 %<latexrelease> \global \let \@toplist \@empty
1948 %<latexrelease> \global \let \@botlist \@empty
1949 %<latexrelease> \global \@colroom \@colht
1950 %<latexrelease> \ifx \@currlist\@empty
1951 %<latexrelease> \else
1952 %<latexrelease> \@latexerr{Float(s) lost}\@ehb
1953 % \end{macrocode}
1954 % \changes{v1.0h}{1993/12/12}{defs changed to lets}
1955 % \begin{macrocode}
1956 %<latexrelease> \global \let \@currlist \@empty
1957 %<latexrelease> \fi
1958 %<latexrelease> \@makefcolumn\@deferlist
1959 %<latexrelease> \@whilesw\if@fcolmade \fi
1960 %<latexrelease> {\@opcol\@makefcolumn\@deferlist}%
1961 %<latexrelease> \if@twocolumn
1962 %<latexrelease> \if@firstcolumn
1963 %<latexrelease> \xdef\@dbldeferlist{\@dbltoplist\@dbldeferlist}%
1964 % \end{macrocode}
1965 % \changes{v1.0h}{1993/12/12}{defs changed to lets}
1966 % \begin{macrocode}
1967 %<latexrelease> \global \let \@dbltoplist \@empty
1968 %<latexrelease> \global \@colht \textheight
1969 %<latexrelease> \begingroup
1970 %<latexrelease> \@dblfloatplacement
1971 %<latexrelease> \@makefcolumn\@dbldeferlist
1972 %<latexrelease> \@whilesw\if@fcolmade \fi
1973 %<latexrelease> {\@outputpage\@makefcolumn\@dbldeferlist}%
1974 %<latexrelease> \endgroup
1975 %<latexrelease> \else
1976 %<latexrelease> \vbox{}\clearpage
1977 %<latexrelease> \fi
1978 %<latexrelease> \fi
1979 %<latexrelease> \else
1980 %<latexrelease> \setbox\@cclv\vbox{\box\@cclv\vfil}%
1981 %<latexrelease> \@makecol\@opcol
1982 %<latexrelease> \clearpage
1983 %<latexrelease> \fi
1984 %<latexrelease> }%
1985 %<latexrelease>\EndIncludeInRelease
1986 % \end{macrocode}
1987 % \end{macro}
1988 %
1989 % \begin{macro}{\@opcol}
1990 % \changes{v1.0f}{1993/12/05}{Command changed}
1991 % \changes{v1.0f}{1993/12/05}{Hook added}
1992 % \changes{v1.0j}{1993/12/17}{Hook removed}
1993 % Several changes in detail here.
1994 %
1995 % \begin{macrocode}
1996 %<*2ekernel|fltrace>
1997 \def \@opcol {%
1998 \if@twocolumn
1999 % \end{macrocode}
2000 % \changes{v1.ih}{2022/04/03}{Interface with new mark mechanism}
2001 % The funny-looking internal commands are interfacing with the new
2002 % marks mechanism. We make sure (elsewhere) that those are always
2003 % defined, even when we roll back, so here we add them
2004 % unconditionally. This still need turning into a hook or config
2005 % point eventually:
2006 % \begin{macrocode}
2007 \@expl@@@mark@update@dblcol@structures@@
2008 \@outputdblcol
2009 \else
2010 \@expl@@@mark@update@singlecol@structures@@
2011 \@outputpage
2012 %<*trace>
2013 \fl@trace{PAGE: one column (float? see above) page completed}%
2014 %</trace>
2015 % \end{macrocode}
2016 % Not needed since it comes after |\@outputpage|:
2017 % \begin{macrocode}
2018 % \global\@colht\textheight
2019 \fi
2020 % \end{macrocode}
2021 % These do not need to be done every time |\@opcol| is used: they
2022 % should be grouped together since they all need to be done at the
2023 % end of the non-special output routine, or at the end of a clearpage
2024 % one.
2025 % \begin{macrocode}
2026 \global \@mparbottom \z@ \global \@textfloatsheight \z@
2027 \@floatplacement
2028 }
2029 %</2ekernel|fltrace>
2030 % \end{macrocode}
2031 % \end{macro}
2032 %
2033 %
2034 % \begin{macrocode}
2035 %<*2ekernel|latexrelease>
2036 %<latexrelease>\IncludeInRelease{2025/06/01}%
2037 %<latexrelease> {\@makecol}{\@makecol adding hooks/sockets}%
2038 % \end{macrocode}
2039 %
2040 % \begin{macro}{\@makecol}
2041 % \changes{v0.1c}{1993/11/23}{Command changed}
2042 % \changes{v1.0b}{1993/11/29}{\cs{@makespecialcolbox} added}
2043 % \changes{v1.4m}{2025/02/14}{Use sockets and hooks}
2044 %
2045 % \cs{@makecol} is shortened a lot, basically all the hardwired
2046 % code in the middle has moved into a socket.
2047 % \begin{macrocode}
2048 \def \@makecol {%
2049 % \end{macrocode}
2050 % A number of packages want to prepend code to \cs{@makecol}; this
2051 % is the hook for that:
2052 % \begin{macrocode}
2053 \UseHook {build/column/before}%
2054 % \end{macrocode}
2055 % Save away box 255 as \cs{@outputbox} to make it available for further adjustments.
2056 % \begin{macrocode}
2057 \setbox\@outputbox \box\@cclv
2058 % \end{macrocode}
2059 % The only real addition is the next command which either does
2060 % nothing or removes an infinite glue from the bottom of the
2061 % \cs{@outputbox}.
2062 % \begin{macrocode}
2063 \@outputbox@removebskip
2064 % \end{macrocode}
2065 % Now a kernel hook for tagging that adjusts the content of
2066 % \cs{@outputbox}, if necessary. At this point it just contains the material from
2067 % the galley.
2068 % \begin{macrocode}
2069 \UseTaggingSocket{build/column/outputbox}%
2070 % \end{macrocode}
2071 % When this code is run any ``here'' floats in the \cs{@outputbox}
2072 % are already handled, so we recycle their registers and put them
2073 % back to the \cs{@freelist}.
2074 % \changes{v1.0h}{1993/12/12}{defs changed to lets}
2075 % \changes{v1.2k}{2003/12/16}{Ensure that \cs{@elt} has a defined
2076 % state (pr/3586)}
2077 % \begin{macrocode}
2078 \let\@elt\relax
2079 \xdef\@freelist{\@freelist\@midlist}%
2080 \global \let \@midlist \@empty
2081 % \end{macrocode}
2082 % Here we have the configurable part. This socket is supposed to
2083 % add floats, footnotes and stretchable vertical space as
2084 % appropriate to the \cs{@outputbox}. It is used by packages such
2085 % as \pkg{footmisc} to implement different layout, e.g., footnotes
2086 % above or below bottom floats, etc.
2087 % \begin{macrocode}
2088 \UseSocket {build/column/outputbox}%
2089 % \end{macrocode}
2090 % Then we deal with any \cs{enlargethispage} or run the normal code
2091 % to build a column.
2092 % \begin{macrocode}
2093 \ifvbox\@kludgeins
2094 \@make@specialcolbox
2095 \else
2096 \@make@normalcolbox
2097 \fi
2098 \global \maxdepth \@maxdepth
2099 % \end{macrocode}
2100 % Finally, another hook for external packages or classes that want
2101 % to augment or alter the output routine by appending to \cs{@makecol}.
2102 % \begin{macrocode}
2103 \UseHook {build/column/after}%
2104 }
2105 % \end{macrocode}
2106 % \end{macro}
2107 %
2108 % \begin{macro}{\@outputbox@depth}
2109 % \changes{v1.4m}{2025/02/14}{Macro added}
2110 % We need to know the depth of \cs{@outputbox} once in a
2111 % while. Rather than using a temp dimen (as it was done in the
2112 % past), we give it a proper register.
2113 %
2114 % The value of this register is only correct inside of
2115 % \cs{outputbox@append}, elsewhere you can't rely on it!
2116 % \begin{macrocode}
2117 \newdimen\@outputbox@depth
2118 % \end{macrocode}
2119 % \end{macro}
2120 %
2121 %
2122 % \begin{macro}{\@make@normalcolbox}
2123 % \changes{v1.4m}{2025/02/14}{Macro added}
2124 % Taken out of \cs{@makecol} for readability.
2125 %
2126 % \changes{v1.0l}{1994/03/15}{Removed boxmaxdepth setting.}
2127 % \begin{macrocode}
2128 \def \@make@normalcolbox {%
2129 \setbox\@outputbox \vbox to\@colht {%
2130 \@texttop
2131 \@outputbox@depth \dp\@outputbox
2132 \unvbox \@outputbox
2133 % \end{macrocode}
2134 % The |\vskip -\@outputbox@depth@| ensures that the visible depth
2135 % of the box does not affect the placement of anything on the page.
2136 % Thus very deep pages will overprint the footer; but these should
2137 % have been prevented by suitable settings of the maxdepths at
2138 % appropriate times.
2139 %
2140 % If |\@textbottom| ends with a box or rule of non-zero depth then
2141 % this skip adjustment should be done again after it.
2142 % \begin{macrocode}
2143 \vskip -\@outputbox@depth
2144 \@textbottom
2145 }%
2146 }
2147 % \end{macrocode}
2148 % \end{macro}
2149 %
2150 % \begin{macro}{\@make@specialcolbox}
2151 % \changes{v1.4m}{2025/02/14}{Macro added}
2152 % Make the colbox when \cs{enlargethispage} was used.
2153 % \begin{macrocode}
2154 %</2ekernel|latexrelease>
2155 %<*2ekernel|latexrelease|fltrace>
2156 \def \@make@specialcolbox {%
2157 %<*trace>
2158 \fl@trace{Kludgeins ht \the\ht\@kludgeins\space
2159 dp \the\dp\@kludgeins\space
2160 wd \the\wd\@kludgeins}%
2161 %</trace>
2162 \@outputbox@append {\vskip-\@outputbox@depth}%
2163 \@tempdima \@colht
2164 % \end{macrocode}
2165 %
2166 % \begin{macrocode}
2167 \ifdim \wd\@kludgeins>\z@
2168 % \end{macrocode}
2169 % Note that in this case (the *-version), the height of the
2170 % |\@kludgeins| box is not used since its value is somewhat
2171 % arbitrary: it need only be big enough to ensure that the
2172 % page-break is not taken prematurely.
2173 %
2174 % Here we calculate how much vertical space needs to be added in
2175 % order to enable the column to fit into a box of size |\@colht|
2176 % using the best information we have about the amount of shrink
2177 % available (another thing which is known internally about a box,
2178 % but cannot be accessed at the \TeX{} level!).
2179 %
2180 % This needs \TeX3 otherwise |\pageshrink| is zero anyway; it may
2181 % not be exactly the figure we wish as it is the total available
2182 % from the all the material collected before the page-break
2183 % decision is made. It will, we think, always be an overestimate
2184 % of the actual shrink in the box; therefore this should always
2185 % force the shortest possible column with the possibility of an
2186 % overfull box.
2187 %
2188 % This should work for both flush- and ragged-bottom setting since
2189 % it makes the contents no smaller than the size (|\@colht|) of the
2190 % box into which they are put.
2191 %
2192 % Their should perhaps be an upper limit, of 0pt?, on the extra
2193 % space added to force shrinking.
2194 % \task{CAR}{Further investigation of kludge-* space}
2195 %
2196 % \begin{macrocode}
2197 \advance \@tempdima -\ht\@outputbox
2198 \advance \@tempdima \pageshrink
2199 %<*trace>
2200 \fl@trace {Natural ht of col: \the \ht\@outputbox}%
2201 \fl@trace {\string \@colht: \the \@colht}%
2202 \fl@trace {Pageshrink added: \the \pageshrink}%
2203 \fl@trace {Hence, space added: \the \@tempdima}%
2204 %</trace>
2205 \setbox\@outputbox \vbox to \@colht {%
2206 \unvbox\@outputbox
2207 \vskip \@tempdima
2208 \@textbottom
2209 }%
2210 % \end{macrocode}
2211 % For the unstarred version, the final size of the page is
2212 % precisely specified. Therefore, at least for the flush-bottom
2213 % case, we need to ensure that, visually, it has this size exactly.
2214 %
2215 % Thus we calculate this size and set the material in a box of this
2216 % size, which is then put into a box of size |\@colht| with |\vss|
2217 % at the bottom.
2218 % \begin{macrocode}
2219 \else
2220 \advance \@tempdima -\ht\@kludgeins
2221 %<*trace>
2222 \fl@trace {Natural ht of col: \the \ht\@outputbox}%
2223 \fl@trace {\string \@colht: \the \@colht}%
2224 \fl@trace {Extra size added: -\the \ht \@kludgeins}%
2225 \fl@trace {Hence, height of inner box: \the \@tempdima}%
2226 \fl@trace {Max? pageshrink available: \the \pageshrink}%
2227 %</trace>
2228 % \end{macrocode}
2229 % This type of final packaging could be done always; this may
2230 % simplify all of this page-makeup.
2231 %
2232 % It is not necessary to set |\boxmaxdepth| here since the
2233 % |\@outputbox| ends with glue.
2234 % \changes{v1.0k}{1994/02/03}{correct mistakes in the documentation}
2235 % \begin{macrocode}
2236 \setbox \@outputbox \vbox to \@colht {%
2237 \vbox to \@tempdima {%
2238 \unvbox\@outputbox
2239 \@textbottom}%
2240 \vss}%
2241 \fi
2242 {\setbox \@tempboxa \box \@kludgeins}%
2243 %<*trace>
2244 \fl@trace {kludgeins box made void}%
2245 %</trace>
2246 }
2247 %</2ekernel|latexrelease|fltrace>
2248 %<*2ekernel|latexrelease>
2249 % \end{macrocode}
2250 % \end{macro}
2251 %
2252 %
2253 %
2254 %
2255 % \begin{macro}{\@outputbox@removebskip}
2256 % \changes{v1.4m}{2025/02/14}{Macro added}
2257 % \changes{v1.4m}{2025/02/14}{Finally fix bottom skip bug (from 2.09)}
2258 %
2259 % This is really a bug fix for the kernel (from the 2.09 days) but
2260 % one we only make by default in new documents that are using
2261 % \cs{DocumentMetadata}. If \cs{raggedbottom} is in force,
2262 % footnotes get attached to the main galley at a distance of
2263 % \cs{footskip} on all pages except on those that are ended by
2264 % \cs{newpage} or \cs{clearpage} where the \cs{vfil} from
2265 % \cs{newpage} pushes the footnotes to the very bottom.
2266 %
2267 % This is kind of a weird difference to a page ending with
2268 % \cs{pagebreak}---in that case the page is also run
2269 % short, but the footnotes are not pushed to the bottom.
2270 %
2271 % In \pkg{footmisc} \cs{@outputbox@removebskip} is only applied when
2272 % \pkg{footmisc} is called with an option specifying the
2273 % footnote placement, i.e., not in the default case.
2274 % In new documents we apply it always.
2275 % \changes{v1.4q}{2025/03/20}{Remove a `fil' bottom skip even if we
2276 % are in ragged bottom typesetting (footmisc/19)}
2277 % \begin{macrocode}
2278 \def\@outputbox@removebskip{%
2279 % \end{macrocode}
2280 % In some special circumstances the \cs{@outputbox} might be
2281 % void. As \cs{@outputbox@append} below would change this, we
2282 % handle this case by leaving it unchanged,
2283 % because otherwise we can no longer detect that situation
2284 % (needed, for example, in \pkg{ftnright}).
2285 % \begin{macrocode}
2286 \ifvoid \@outputbox
2287 \global\let\@outputbox@reinsertbskip\relax
2288 \else
2289 % \end{macrocode}
2290 % If it is not void then we drop the final skip at the end of \cs{@outputbox}
2291 % provided there is one and it has a glue stretch
2292 % order of 1 or more (i.e., contains a \texttt{fil} or \texttt{fill} part).
2293 % \begin{macrocode}
2294 \@outputbox@append{%
2295 \@tempskipa\lastskip
2296 \ifnum \gluestretchorder\@tempskipa>\z@
2297 \unskip
2298 % \end{macrocode}
2299 %
2300 % \begin{macro}{\@outputbox@reinsertbskip}
2301 % We also prepare for reinserting the skip we removed elsewhere on the page.
2302 % As we have to do this globally, we also need to
2303 % explicitly reset \cs{@outputbox@reinsertbskip} if we don't find any such glue.
2304 % \begin{macrocode}
2305 \xdef\@outputbox@reinsertbskip
2306 {%
2307 % \end{macrocode}
2308 % Everything is done inside \cs{@outputbox@append} so that a call
2309 % to \cs{@outputbox@reinsertbskip} will update the box. If there
2310 % are no footnotes and no bottom floats that still needs to be
2311 % attached we first backup by the depth of the
2312 % \cs{@outputbox} so that the skip we add starts from the baseline
2313 % of the last line inside (if there is one). As it is a
2314 % \texttt{fil}, \texttt{fill}, or \texttt{filll} glue this normally
2315 % makes no differences, but if the box itself contains a fill skip
2316 % of higher order our fill is ignored and text is pushed to the
2317 % bottom of the page. In that case and without backing up first,
2318 % the last line would not be with its baseline on the bottom, but
2319 % slightly too high if it has characters with descenders.
2320 % \changes{v1.4r}{2025/03/25}{Back out the depth if we have no
2321 % footnotes and no bottom floats (footmisc/19)}
2322 % \begin{macrocode}
2323 \noexpand\@outputbox@append{%
2324 \noexpand\@if@footnotes@TF
2325 {}%
2326 {%
2327 \noexpand\@if@bottomfloats@TF
2328 {}%
2329 {\noexpand\@backup@outputbox@depth}%
2330 }%
2331 \vskip\the\@tempskipa}}%
2332 \else
2333 \global\let\@outputbox@reinsertbskip\relax
2334 \fi
2335 }%
2336 \fi
2337 }
2338 % \end{macrocode}
2339 % We need a trivial top-level definition for
2340 % \cs{@outputbox@reinsertbskip} in case the first page has no
2341 % bottom glue and the command gets called.
2342 % \begin{macrocode}
2343 \let \@outputbox@reinsertbskip \relax
2344 % \end{macrocode}
2345 % \end{macro}
2346 % \end{macro}
2347 %
2348 %
2349 %
2350 % \begin{macro}{\@backup@outputbox@depth}
2351 % In some places we have to make the depth of the \cs{@outputbox}
2352 % zero by backing up by its current depth. This is done by
2353 % \cs{@backup@outputbox@depth}. The macro can only be used inside
2354 % of \cs{@outputbox@append} (or after you have manually set the
2355 % \cs{@outputbox@depth} to the right value).
2356 %
2357 % If the depth is zero, there is no point in doing anything, and if
2358 % the depth is negative it must have been deliberately set to this
2359 % value, so in this case we also do not back up and change it.
2360 %
2361 % If it is positive we back up by the minimum of
2362 % \cs{@outputbox@depth} and \cs{maxdepth}, i.e., if the depth is
2363 % unusually large we do not perform a full backup.
2364 %
2365 % \changes{v1.4r}{2025/03/25}{Macro added (footmisc/19)}
2366 % \begin{macrocode}
2367 \def\@backup@outputbox@depth{%
2368 % \typeout{--> @backup@outputbox@depth : \the \@outputbox@depth}%
2369 \ifdim\@outputbox@depth>\z@
2370 \vskip -%
2371 \ifdim\@outputbox@depth>\maxdepth
2372 \maxdepth
2373 \else
2374 \@outputbox@depth
2375 \fi
2376 % \end{macrocode}
2377 % After the skip was added the depth of the box will become zero
2378 % but this is not immediately reflected in
2379 % \cs{@outputbox@depth}. Thus, if there is further code in the same
2380 % \cs{@outputbox@append} testing the register it would make a wrong
2381 % conclusion. We therefore set it locally to zero.
2382 % \begin{macrocode}
2383 \@outputbox@depth\z@
2384 \fi
2385 }
2386 % \end{macrocode}
2387 % \end{macro}
2388 %
2389 % \subsection{The output routine configuration components}
2390 %
2391 % Here we provide the comands that are used to define code for the
2392 % socket \socket{build/column/outputbox}. The all manipulate the
2393 % \cs{@outputbox} box in one way or another.
2394 %
2395 %
2396 % \begin{macro}{\@outputbox@append}
2397 % \changes{v1.4m}{2025/02/14}{Macro added}
2398 %
2399 % This general purpose command alters the \cs{@outputbox} box by
2400 % appending material to it. As this is a box typesetting operation
2401 % we make sure that the last line of the box reflects the true
2402 % depth of the last line (in case that is needed later). We also
2403 % expose the current depth of \cs{@outputbox} as
2404 % \cs{@outputbox@depth} before unboxing so that its value can be
2405 % used by \verb=#1= if wanted.
2406 % \begin{macrocode}
2407 \def\@outputbox@append #1{%
2408 \setbox\@outputbox \vbox {%
2409 % \end{macrocode}
2410 % This |\boxmaxdepth| setting is to ensure that deep footnotes
2411 % do not overwrite the footer (on account of the negative skip
2412 % added later): it should use |\@maxdepth| otherwise the change is
2413 % pointless when there are footnotes.
2414 %
2415 % But see also its use when combining floats.
2416 % \changes{v1.0l}{1994/03/15}{\cs{maxdepth} changed to \cs{@maxdepth}}
2417 % \begin{macrocode}
2418 \boxmaxdepth \@maxdepth
2419 \@outputbox@depth\dp\@outputbox % if needed in #1
2420 \unvbox \@outputbox
2421 #1%
2422 }%
2423 }
2424 % \end{macrocode}
2425 % \end{macro}
2426 %
2427 %
2428 %
2429 % \begin{macro}{\@outputbox@appendfil}
2430 % Append a \cs{vfil} to the \cs{@outputbox}. Depending on the plug
2431 % in the \socket{build/column/baselineattach} either from the
2432 % bottom of the box or the baseline of the last line.
2433 % \begin{macrocode}
2434 \def\@outputbox@appendfil{\@outputbox@append
2435 {\UseSocket{build/column/baselineattach}\vfil}}
2436 % \end{macrocode}
2437 % \end{macro}
2438 %
2439 %
2440 % \begin{macro}{\@outputbox@appendfootnotes}
2441 % \changes{v1.4m}{2025/02/14}{Macro added}
2442 %
2443 % This command appends the footnotes to the \cs{@outputbox} (if
2444 % there are any). If not, then it does nothing.
2445 % \begin{macrocode}
2446 \def\@outputbox@appendfootnotes {%
2447 \ifvoid\footins \else
2448 % \end{macrocode}
2449 % Handling split footnotes need further work so this is for the
2450 % moment just a dummy that does nothing. It might vanish and get
2451 % replaced by a socket eventually.
2452 % \task{fmi}{The code for handling split footnotes will get revised as part
2453 % of socket handling in the future}
2454 % \begin{macrocode}
2455 \@makecol@handlesplitfootnotes
2456 % \end{macrocode}
2457 %
2458 % The following socket can be used to manipulate the material in
2459 % \cs{footins} box, for example, if the footnotes are to be presented
2460 % all together in a single paragraph. By default it does nothing.
2461 % \begin{macrocode}
2462 \UseSocket{build/column/footnotes}%
2463 % \end{macrocode}
2464 % Then the footnotes are appended:
2465 % \begin{macrocode}
2466 \@outputbox@append{%
2467 % \end{macrocode}
2468 % First we call a socket which controls whether or not we back up by the depth
2469 % of the \cs{@outputbox} so that the skip that seperates the
2470 % footnotes from the text starts at the baseline
2471 % of the last text line.
2472 % \changes{v1.4q}{2025/03/20}{Add experimental socket for baseline
2473 % attachment of footnotes -- subject to change (footmisc/19)}
2474 % \begin{macrocode}
2475 \UseSocket{build/column/baselineattach}%
2476 \vskip \skip\footins
2477 % \end{macrocode}
2478 % The next socket adjusts the tagging of the \cs{footins} box, if necessary.
2479 % \begin{macrocode}
2480 \UseTaggingSocket{build/column/footins}%
2481 % \end{macrocode}
2482 %
2483 % \begin{macrocode}
2484 \color@begingroup
2485 \normalcolor
2486 \footnoterule
2487 % \end{macrocode}
2488 % Support for \pkg{pdfcolfoot}; eventually this can go once color
2489 % is properly supported. The csname is constructed in case the command
2490 % is not defined, i.e., the package not loaded.
2491 % \task{fmi}{Fix when no longer needed}
2492 % \begin{macrocode}
2493 \csname pdfcolfoot@current\endcsname
2494 \unvbox \footins
2495 \color@endgroup
2496 }%
2497 \fi
2498 }
2499 % \end{macrocode}
2500 % \end{macro}
2501 %
2502 %
2503 % \begin{macro}{\@makecol@handlesplitfootnotes}
2504 % For future extensions \ldots
2505 % \begin{macrocode}
2506 \let \@makecol@handlesplitfootnotes \@empty
2507 % \end{macrocode}
2508 % \end{macro}
2509 %
2510 % \begin{macro}{\@outputbox@attachfloats}
2511 % \changes{v1.4m}{2025/02/14}{Macro added}
2512 % \begin{macro}{\@outputbox@attachtopfloats}
2513 % \changes{v1.4m}{2025/02/14}{Macro added}
2514 % \begin{macro}{\@outputbox@attachbottomfloats}
2515 % \changes{v1.4m}{2025/02/14}{Macro added}
2516 % Attaching top and bottom floats can usually be done in one go,
2517 % but for special layouts we might want more control so we provide
2518 % also separate commands.
2519 %
2520 % The next command was called \cs{@combinefloats} in the past.
2521 % \begin{macrocode}
2522 \def \@outputbox@attachfloats {%
2523 \@outputbox@attachtopfloats
2524 \@outputbox@attachbottomfloats
2525 }
2526 % \end{macrocode}
2527 %
2528 % \begin{macrocode}
2529 \def \@outputbox@attachtopfloats {%
2530 \ifx \@toplist\@empty \else \@cflt \fi
2531 }
2532 % \end{macrocode}
2533 % Before we append the bottom floats we run the
2534 % \socket{build/column/baselineattach} so that the
2535 % \cs{textfloatsep} is measured from the baseline if that is desired.
2536 % \changes{v1.4s}{2025/03/29}{Add socket (footmisc/19)}
2537 % \begin{macrocode}
2538 \def \@outputbox@attachbottomfloats {%
2539 \ifx \@botlist\@empty \else
2540 \@outputbox@append{\UseSocket{build/column/baselineattach}}%
2541 \@cflb
2542 \fi
2543 }
2544 % \end{macrocode}
2545 % \end{macro}
2546 % \end{macro}
2547 % \end{macro}
2548 %
2549 %
2550 % The next three conditionals might be useful when setting up running
2551 % headers and footers so perhaps they should be change to CamelCase
2552 % names. For now they are internal.
2553 %
2554 % \begin{macro}{\@if@flushbottom@TF}
2555 % \changes{v1.4m}{2025/02/14}{Macro added}
2556 % Test for \cs{flushbottom} (currently not used).
2557 % \begin{macrocode}
2558 \def\@if@flushbottom@TF{%
2559 \ifx\@textbottom\relax
2560 \expandafter\@firstoftwo
2561 \else
2562 \expandafter\@secondoftwo
2563 \fi
2564 }
2565 % \end{macrocode}
2566 % \end{macro}
2567 %
2568 %
2569 % \begin{macro}{\@if@footnotes@TF}
2570 % \changes{v1.4m}{2025/02/14}{Macro added}
2571 % Test if footnotes are present on the current page or column and
2572 % not yet added to the \cs{@outputbox}.
2573 % \begin{macrocode}
2574 \def\@if@footnotes@TF{%
2575 \ifvoid\footins
2576 \expandafter\@secondoftwo
2577 \else
2578 \expandafter\@firstoftwo
2579 \fi
2580 }
2581 % \end{macrocode}
2582 % \end{macro}
2583 %
2584 %
2585 % \begin{macro}{\@if@bottomfloats@TF}
2586 % \changes{v1.4m}{2025/02/14}{Macro added}
2587 % Test if bottom floats are around and not yet added to the
2588 % \cs{@outputbox}.
2589 % \begin{macrocode}
2590 \def\@if@bottomfloats@TF{%
2591 \ifx \@botlist\@empty
2592 \expandafter\@secondoftwo
2593 \else
2594 \expandafter\@firstoftwo
2595 \fi
2596 }
2597 % \end{macrocode}
2598 % \end{macro}
2599 %
2600 %
2601 %
2602 %
2603 %
2604 %
2605 %
2606 % \changes{v1.4m}{2025/02/14}{Use sockets and hooks in OR}
2607 %
2608 % \begin{socketdecl}{build/column/outputbox}
2609 % \changes{v1.4m}{2025/02/14}{Socket added}
2610 % We have one socket that is supposed to augment the \cs{@outputbox}
2611 % by attaching floats and footnotes with appropriate spacing.
2612 % \begin{macrocode}
2613 \NewSocket{build/column/outputbox}{0}
2614 % \end{macrocode}
2615 % \end{socketdecl}
2616 %
2617 %
2618 % The following plugs are available for
2619 % this socket:
2620 %
2621 % \begin{plugdecl}{space-footnotes-floats}
2622 % After the galley text there is a vertical \cs{vfil} followed by
2623 % any footnotes followed by the bottom floats, if any.
2624 % \begin{macrocode}
2625 \NewSocketPlug {build/column/outputbox}{space-footnotes-floats} {%
2626 \@if@footnotes@TF
2627 {\@outputbox@appendfil}%
2628 {\@if@bottomfloats@TF
2629 {\@outputbox@appendfil}%
2630 {\@outputbox@reinsertbskip}%
2631 }%
2632 \@outputbox@appendfootnotes
2633 \@outputbox@attachfloats
2634 }
2635 % \end{macrocode}
2636 % \end{plugdecl}
2637 %
2638 % \begin{plugdecl}{footnotes-space-floats}
2639 % As before but the \cs{vfil} is between footnotes and floats.
2640 % \begin{macrocode}
2641 \NewSocketPlug {build/column/outputbox}{footnotes-space-floats} {%
2642 \@outputbox@appendfootnotes
2643 \@if@bottomfloats@TF
2644 {\@outputbox@appendfil}%
2645 {\@outputbox@reinsertbskip}%
2646 \@outputbox@attachfloats
2647 }
2648 % \end{macrocode}
2649 % \end{plugdecl}
2650 %
2651 % \begin{plugdecl}{floats-space-footnotes}
2652 % Floats immediately after the galley text and footnotes at the bottom.
2653 % \begin{macrocode}
2654 \NewSocketPlug {build/column/outputbox}{floats-space-footnotes} {%
2655 \@outputbox@attachfloats
2656 \@if@footnotes@TF
2657 {\@outputbox@appendfil}%
2658 {\@outputbox@reinsertbskip}%
2659 \@outputbox@appendfootnotes
2660 }
2661 % \end{macrocode}
2662 % \end{plugdecl}
2663 %
2664 % \begin{plugdecl}{space-floats-footnotes}
2665 % Both floats and footnotes are pushed to the bottom with
2666 % footnotes last.\footnote{There are two more
2667 % permutations, but neither of them has ever been requested so
2668 % they aren't set up by default --- doing that in a class
2669 % would be trivial though.}
2670 % \begin{macrocode}
2671 \NewSocketPlug {build/column/outputbox}{space-floats-footnotes} {%
2672 \@if@bottomfloats@TF
2673 {\@outputbox@appendfil}%
2674 {\@if@footnotes@TF
2675 {\@outputbox@appendfil}%
2676 {\@outputbox@reinsertbskip}}%
2677 \@outputbox@attachfloats
2678 \@outputbox@appendfootnotes
2679 }
2680 % \end{macrocode}
2681 % \end{plugdecl}
2682 %
2683 %
2684 %
2685 % \begin{plugdecl}{floats-footnotes}
2686 % All excess space has to be distributed across the existing
2687 % glue on the page, e.g., within the text galley, the
2688 % separation between blocks, etc.
2689 % The order is text, floats, footnotes.
2690 % \begin{macrocode}
2691 \NewSocketPlug {build/column/outputbox}{floats-footnotes} {%
2692 \@outputbox@attachfloats
2693 \@outputbox@appendfootnotes
2694 % \end{macrocode}
2695 % We do reinsert the bottom skip from \cs{newpage} if it
2696 % was taken out earlier. This is, strictly speaking, not necessary
2697 % in most cases, but it is a \cs{vfil} while \cs{raggedbottom} is
2698 % only generating \verb=\vspace{0pt plus .0001fil}=, so if you have
2699 % several \cs{vfil} on the page before the \cs{newpage} you would
2700 % alter the space distribution if one is taken out.
2701 % \begin{macrocode}
2702 \@outputbox@reinsertbskip
2703 }
2704 % \end{macrocode}
2705 %
2706 % \end{plugdecl}
2707 %
2708 % \begin{plugdecl}{footnotes-floats}
2709 % \begin{macrocode}
2710 \NewSocketPlug {build/column/outputbox}{footnotes-floats} {%
2711 \@outputbox@appendfootnotes
2712 \@outputbox@attachfloats
2713 \@outputbox@reinsertbskip
2714 }
2715 % \end{macrocode}
2716 % The \texttt{footnote-floats} plug implements the layout used by
2717 % \LaTeX{} but with the bottom skip bug corrected. This will be
2718 % the default when \cs{DocumentMetadata} is used; it can be
2719 % overwritten either through \pkg{footmisc} or by assigning any of
2720 % the other plugs (or by coding yet another plug for the socket).
2721 % \end{plugdecl}
2722 %
2723 % \begin{plugdecl}{footnotes-floats-legacy}
2724 % This implements the 2.09 layout (including its bottom skip bug).
2725 % \begin{macrocode}
2726 \NewSocketPlug {build/column/outputbox}{footnotes-floats-legacy} {%
2727 % \end{macrocode}
2728 % In the legacy case we don't really want to take out the bottom
2729 % skip, but rather than altering \cs{@outputbox@removebskip} in
2730 % \cs{makecol} to do nothing, which we would then have to undo in
2731 % every other layout, we immediately reinsert the dropped skip
2732 % again.
2733 %
2734 % In the legacy case there is, however, one other thing that needs
2735 % doing: if there was a \cs{vfil} at the bottom of the page (e.g.,
2736 % from \cs{newpage}) and there are no footnotes, then we need to back up
2737 % by the depth of the last line in the page box. Otherwise you
2738 % might end up with incorrect alignment if there is a higher-order
2739 % fill on the page (e.g., \cs{vfill}) that pushes the text material
2740 % to the bottom, since in such cases the depth will not be taken into
2741 % account by \TeX{}.
2742 %
2743 % This is done automatically by \cs{@outputbox@reinsertbskip} as
2744 % long as there are no footnotes waiting to be placed.
2745 % If there are footnotes, the operation is not done because by
2746 % default the \cs{skip}\cs{footins} separation is measured from the
2747 % bottom of the line not from the baseline.
2748 % But if the user has asked to change this behavior we should honor
2749 % it and that is done by putting the experimental socket
2750 % \socket{build/column/baselineattach} in which performs the
2751 % backing up if desired. This should happen only if footnotes are
2752 % actually present, so we test for this. Otherwise, there may be
2753 % bottom floats and the \cs{textfloatsep} should be measured
2754 % from the bottom of the last line and if not then any necessary
2755 % back up is done by \cs{@outputbox@reinsertbskip}.
2756 %
2757 % Note that after this code has backed up, the depth of
2758 % \cs{@outputbox} will be zero as there is a skip at its bottom. So
2759 % even if the same code is executed a second time (in
2760 % \cs{@outputbox@reinsertbskip} or in
2761 % \cs{@outputbox@appendfootnotes}) it will not alter the box further.
2762 %
2763 % \changes{v1.4r}{2025/03/25}{Add support for attaching footnotes
2764 % with a skip starting at the baseline of the last text line (footmisc/19)}
2765 % \begin{macrocode}
2766 \@if@footnotes@TF
2767 {\@outputbox@append{%
2768 \UseSocket{build/column/baselineattach}}%
2769 }{%
2770 % \end{macrocode}
2771 % If there are no footnotes but there are bottom floats we execute
2772 % the socket \socket{build/column/baselineattach} so that
2773 % \cs{textfloatsep} is measured from the baseline if that is being
2774 % asked for.
2775 % \changes{v1.4s}{2025/03/29}{Add socket (footmisc/19)}
2776 % \begin{macrocode}
2777 \@if@bottomfloats@TF
2778 {\@outputbox@append{%
2779 \UseSocket{build/column/baselineattach}}%
2780 }{}%
2781 }%
2782 \@outputbox@reinsertbskip
2783 \@outputbox@appendfootnotes
2784 \@outputbox@attachfloats
2785 }
2786 % \end{macrocode}
2787 % The \texttt{footnote-floats-legacy} plug is the default used by
2788 % \LaTeX{} when \cs{DocumentMetadata} is not used; it can be
2789 % overwritten
2790 % either through \pkg{footmisc} or
2791 % by assigning any of the other plugs (or by coding yet another
2792 % plug for the socket).
2793 % \begin{macrocode}
2794 \AssignSocketPlug {build/column/outputbox}{footnotes-floats-legacy}
2795 % \end{macrocode}
2796 % \end{plugdecl}
2797 %
2798 %
2799 %
2800 %
2801 % \begin{socketdecl}{build/column/footnotes}
2802 %
2803 % The socket allowing the manipulation of \cs{footins} box
2804 % (result needs to be moved back in there). Used when footnotes are
2805 % reformatted into a single paragraph by the
2806 % \texttt{para} option of \pkg{footmisc}. By default it does nothing.
2807 % \begin{macrocode}
2808 \NewSocket{build/column/footnotes}{0}
2809 % \end{macrocode}
2810 % \end{socketdecl}
2811 %
2812 %
2813 % \begin{socketdecl}{build/column/baselineattach}
2814 %
2815 % \changes{v1.4q}{2025/03/20}{Add experimental socket for baseline
2816 % attachment of footnotes -- subject to change (footmisc/19)}
2817 %
2818 % Socket that allows backing up by the depth of the
2819 % outputbox (but not more than \cs{maxdepth} before attaching any
2820 % footnotes or floats.
2821 % \begin{macrocode}
2822 \NewSocket{build/column/baselineattach}{0}
2823 % \end{macrocode}
2824 % \end{socketdecl}
2825 %
2826 % \begin{plugdecl}{on}
2827 % \begin{macrocode}
2828 \NewSocketPlug {build/column/baselineattach}{on} {%
2829 % \end{macrocode}
2830 % We do nothing if the depth is not positive, and we never back up
2831 % by more than \cs{maxdepth}.
2832 % \changes{v1.4r}{2025/03/25}{ (footmisc/19)}
2833 % \begin{macrocode}
2834 \@backup@outputbox@depth
2835 }
2836 % \end{macrocode}
2837 % \end{plugdecl}
2838 %
2839 % \begin{plugdecl}{off}
2840 % The \plug{off} plug is actually identical to the \plug{noop} plug
2841 % which is automatically made available; but offering that it under
2842 % the name \plug{off} makes the interface a bit nicer.
2843 % \begin{macrocode}
2844 \NewSocketPlug {build/column/baselineattach}{off}{}
2845 % \end{macrocode}
2846 % This feature is not turned on by default to preserve the behavior
2847 % of old documents.
2848 % With new documents using \cs{DocumentMetadata} it may become the
2849 % default.
2850 % \begin{macrocode}
2851 \AssignSocketPlug {build/column/baselineattach}{off}
2852 % \end{macrocode}
2853 % \end{plugdecl}
2854 %
2855 %
2856 %
2857 %
2858 %
2859 %
2860 %
2861 %
2862 % \begin{hookdecl}{build/page/before,
2863 % build/page/after}
2864 % \changes{v1.4m}{2025/02/14}{Hook added}
2865 % Hooks at the start and end of \cs{@outputpage} for use by packages.
2866 % \begin{macrocode}
2867 \NewMirroredHookPair{build/page/before}{build/page/after}
2868 % \end{macrocode}
2869 % \end{hookdecl}
2870 %
2871 %
2872 %
2873 % \begin{hookdecl}{build/page/reset}
2874 % \changes{v1.4m}{2025/02/14}{Hook added}
2875 % Hook in \cs{@outputpage} to reset special galley conventions
2876 % within the output routine. \LaTeX{} does a lot of resetting in
2877 % front of this hook, so by default it is empty. They are not made
2878 % part of the hook (which would have been possible) to ensure that
2879 % the kernel resets always come first and can be overwritten without the
2880 % need to apply hook rules unnecessarily.
2881 % \begin{macrocode}
2882 \NewHook {build/page/reset}
2883 % \end{macrocode}
2884 % \end{hookdecl}
2885 %
2886 %
2887 %
2888 % \begin{hookdecl}{build/column/before,build/column/after}
2889 % \changes{v1.4m}{2025/02/14}{Hook added}
2890 % Hooks at the start and end of \cs{@makecol} for use by packages.
2891 % \begin{macrocode}
2892 \NewMirroredHookPair{build/column/before}{build/column/after}
2893 % \end{macrocode}
2894 % \end{hookdecl}
2895 %
2896 %
2897 %
2898 % \begin{macrocode}
2899 %</2ekernel|latexrelease>
2900 %<latexrelease>\EndIncludeInRelease
2901 %<latexrelease>\IncludeInRelease{0000/00/00}%
2902 %<latexrelease> {\@makecol}{\@makecol adding hooks/sockets}%
2903 %<latexrelease>
2904 %<latexrelease>\gdef \@makecol {%
2905 %<latexrelease> \ifvoid\footins
2906 %<latexrelease> \setbox\@outputbox \box\@cclv
2907 %<latexrelease> \else
2908 %<latexrelease> \setbox\@outputbox \vbox {%
2909 %<latexrelease> \boxmaxdepth \@maxdepth
2910 %<latexrelease> \unvbox \@cclv
2911 %<latexrelease> \vskip \skip\footins
2912 %<latexrelease> \color@begingroup
2913 %<latexrelease> \normalcolor
2914 %<latexrelease> \footnoterule
2915 %<latexrelease> \unvbox \footins
2916 %<latexrelease> \color@endgroup
2917 %<latexrelease> }%
2918 %<latexrelease> \fi
2919 %<latexrelease> \let\@elt\relax
2920 %<latexrelease> \xdef\@freelist{\@freelist\@midlist}%
2921 %<latexrelease> \global \let \@midlist \@empty
2922 %<latexrelease> \@combinefloats
2923 %<latexrelease> \ifvbox\@kludgeins
2924 %<latexrelease> \@makespecialcolbox
2925 %<latexrelease> \else
2926 %<latexrelease> \setbox\@outputbox \vbox to\@colht {%
2927 %<latexrelease> \@texttop
2928 %<latexrelease> \dimen@ \dp\@outputbox
2929 %<latexrelease> \unvbox \@outputbox
2930 %<latexrelease> \vskip -\dimen@
2931 %<latexrelease> \@textbottom
2932 %<latexrelease> }%
2933 %<latexrelease> \fi
2934 %<latexrelease> \global \maxdepth \@maxdepth
2935 %<latexrelease>}
2936 %<latexrelease>
2937 %<latexrelease>\gdef \@makespecialcolbox {%
2938 %<latexrelease> \setbox\@outputbox \vbox {%
2939 %<latexrelease> \@texttop
2940 %<latexrelease> \dimen@ \dp\@outputbox
2941 %<latexrelease> \unvbox\@outputbox
2942 %<latexrelease> \vskip-\dimen@
2943 %<latexrelease> }%
2944 %<latexrelease> \@tempdima \@colht
2945 %<latexrelease> \ifdim \wd\@kludgeins>\z@
2946 %<latexrelease> \advance \@tempdima -\ht\@outputbox
2947 %<latexrelease> \advance \@tempdima \pageshrink
2948 %<latexrelease> \setbox\@outputbox \vbox to \@colht {%
2949 %<latexrelease> \unvbox\@outputbox
2950 %<latexrelease> \vskip \@tempdima
2951 %<latexrelease> \@textbottom
2952 %<latexrelease> }%
2953 %<latexrelease> \else
2954 %<latexrelease> \advance \@tempdima -\ht\@kludgeins
2955 %<latexrelease> \setbox \@outputbox \vbox to \@colht {%
2956 %<latexrelease> \vbox to \@tempdima {%
2957 %<latexrelease> \unvbox\@outputbox
2958 %<latexrelease> \@textbottom}%
2959 %<latexrelease> \vss}%
2960 %<latexrelease> \fi
2961 %<latexrelease> {\setbox \@tempboxa \box \@kludgeins}%
2962 %<latexrelease>}
2963 %<latexrelease>
2964 %<latexrelease> \let \@make@normalcolbox \@undefined
2965 %<latexrelease> \let \@make@specialcolbox \@undefined
2966 %<latexrelease> \let \@outputbox@removebskip \@undefined
2967 %<latexrelease> \let \@outputbox@reinsertbskip \@undefined
2968 %<latexrelease>
2969 %<latexrelease> \let \@outputbox@append \@undefined
2970 %<latexrelease> \let \@outputbox@appendfootnotes \@undefined
2971 %<latexrelease> \let \@outputbox@attachfloats \@undefined
2972 %<latexrelease> \let \@outputbox@attachtopfloats \@undefined
2973 %<latexrelease> \let \@outputbox@attachbottomfloats \@undefined
2974 %<latexrelease>
2975 % \end{macrocode}
2976 % If we roll back we also need to restore this definition.
2977 % \begin{macrocode}
2978 %<latexrelease> \def \@combinefloats {%
2979 %<latexrelease> \ifx \@toplist\@empty \else \@cflt \fi
2980 %<latexrelease> \ifx \@botlist\@empty \else \@cflb \fi
2981 %<latexrelease> }
2982 %<latexrelease>
2983 %<latexrelease> \let \@if@flushbottom@TF \@undefined
2984 %<latexrelease> \let \@if@footnotes@TF \@undefined
2985 %<latexrelease> \let \@if@bottomfloats@TF \@undefined
2986 %<latexrelease>
2987 %<latexrelease>\EndIncludeInRelease
2988 %<*2ekernel>
2989 % \end{macrocode}
2990 %
2991 % \begin{macro}{\@reinserts}
2992 % \changes{v1.0e}{1993/12/01}{Command added}
2993 % This is the code which reinserts the inserts. It puts them all
2994 % in one place; this can make some of them come out on the wrong
2995 % page.
2996 % It has been put into a separate macro to expedite experimentation.
2997 % \begin{macrocode}
2998 \gdef \@reinserts{%
2999 \ifvoid\footins\else\insert\footins{\unvbox\footins}\fi
3000 \ifvbox\@kludgeins\insert\@kludgeins
3001 {\unvbox\@kludgeins}\fi
3002 }
3003 % \end{macrocode}
3004 % \end{macro}
3005 %
3006 %
3007 %
3008 %
3009 % \begin{macro}{\@texttop}
3010 % \begin{macro}{\@textbottom}
3011 % These do nothing as a default.
3012 % \begin{macrocode}
3013 \let \@texttop \relax
3014 \let \@textbottom \relax
3015 % \end{macrocode}
3016 % \end{macro}
3017 % \end{macro}
3018 %
3019 % \begin{macro}{\@resetactivechars}
3020 % \begin{macro}{\@activechar@info}
3021 %
3022 % \changes{v1.0n}{1994/04/30}{\cs{@activechar@warning} changed to
3023 % \cs{@activechar@info}}
3024 % RmS 93/09/06:
3025 % added hook to protect against certain active characters in the
3026 % output routine. Default checks are for active space and end-of-line.
3027 % \changes{v1.0u}{1994/05/23}{Added \cs{MessageBreak}}
3028 % \begin{macrocode}
3029 \def\@activechar@info #1{%
3030 \@latex@info@no@line {Active #1 character found while
3031 output routine is active
3032 \MessageBreak
3033 This may be a bug in a package file
3034 you are using}%
3035 }
3036 % \end{macrocode}
3037 %
3038 % Do not put any spaces in this next bit!
3039 % \changes{1.2f}{1999/10/09}{Reset definition of active prime
3040 % character (used in math mode)}
3041 % \begin{macrocode}
3042 \begingroup
3043 \obeylines\obeyspaces%
3044 \catcode`\'\active%
3045 \gdef\@resetactivechars{%
3046 \def^^M{\@activechar@info{EOL}\space}%
3047 \def {\@activechar@info{space}\space}%
3048 \let'\active@math@prime}%
3049 \endgroup
3050 % \end{macrocode}
3051 % \end{macro}
3052 % \end{macro}
3053 %
3054 % \begin{macro}{\@outputpage}
3055 % \changes{v1.0f}{1993/12/05}{Command changed}
3056 % \begin{macro}{\@shipoutsetup}
3057 % \changes{v1.0f}{1993/12/05}{Command added}
3058 % \changes{v1.1s}{1995/11/10}{Command removed}
3059 % \begin{macro}{\@writesetup}
3060 % \changes{v1.1s}{1995/11/10}{Command removed}
3061 % \changes{v1.1o}{1995/07/21}{Command added}
3062 % \changes{v1.0f}{1993/12/05}{\cs{@startpagehook} added}
3063 % \changes{v1.0j}{1993/12/17}{---and then removed}
3064 % \changes{v1.0p}{1994/05/12}{\cs{normalcolor}added}
3065 % \changes{v1.0s}{1994/05/20}{Added setting of \cs{protect}
3066 % during \cs{shipout}.}
3067 % \changes{v1.0u}{1994/05/23}{Changed resetting of \cs{protect} after
3068 % shipout to use \cs{aftergroup}}
3069 % \changes{v1.1b}{1994/11/05}
3070 % {Use new \cs{color@hbox} concept.}
3071 % \changes{v1.1b}{1994/11/05}
3072 % {Change protect settings for new-style, protect-free
3073 % aux-files.}
3074 % \changes{v1.1c}{1994/11/05}
3075 % {Add new \cs{AtBeginDvi} concept}
3076 % \changes{v1.1e}{1994/11/10}
3077 % {Modify \cs{protect} setting}
3078 % \changes{v1.1f}{1994/11/14}
3079 % {Modify new \cs{AtBeginDvi} concept}
3080 % \changes{v1.1o}{1995/07/21}
3081 % {New, experimental, versions: need in-lining}
3082 % \changes{v1.1s}{1995/11/10}{In-lined}
3083 % \changes{v1.1w}{1996/09/21}{Added \cs{@parboxrestore} and made
3084 % consequent deletions: wait for the howls of protest}
3085 % \changes{v1.4m}{2025/02/14}{Hooks and sockets added}
3086 %
3087 % The |\color@hbox| hooks here are used to avoid putting just a
3088 % colour special into an otherwise empty box (in a header or
3089 % footer). These boxes are often set to be completely empty and so
3090 % adding a special produces a very underfull box message.
3091 %
3092 % There has been extensive tidying up of the old code here;
3093 % including the removal of a level of grouping.
3094 %
3095 % The setting of |\protect| immediately before the |\shipout|
3096 % is needed so that protected commands within |\write|s are
3097 % handled correctly.
3098 %
3099 % Within shipout's vbox it is reset to its default value, |\relax|.
3100 %
3101 % Resetting it to its default value after the shipout has been
3102 % completed (and the contents of the writes have been expanded)
3103 % must be done by use of |\aftergroup|.
3104 % This is because it must have the value |\relax|
3105 % before macros coming from other uses of |\aftergroup| within
3106 % this box are expanded.
3107 %
3108 % Putting this into the |\aftergroup| token list does not affect
3109 % the definition used in expanding the |\write|s because the
3110 % aftergroup token list is only constructed when popping the
3111 % save-stack, it is not expanded until after the shipout is
3112 % completed.
3113 %
3114 % Question: should things from an |\aftergroup| within the shipped
3115 % out box be executed in the environment set up for the writes, or
3116 % after it finishes?
3117 %
3118 % A lot of this code has been in-lined to prevent mis-use of
3119 % internal commands as hooks.
3120 % \begin{macrocode}
3121 %</2ekernel>
3122 %<latexrelease>\IncludeInRelease{2025/06/01}%
3123 %<latexrelease> {\@outputpage}{Use new mark mechanism}%
3124 %<*2ekernel|latexrelease>
3125 % \end{macrocode}
3126 % Temp definition to vanish again when something is offered by the backend:
3127 % \begin{macrocode}
3128 \protected \def \pdfannot@link@on@@ { \csname pdfannot_link_on:\endcsname }
3129 \protected \def \pdfannot@link@off@@ { \csname pdfannot_link_off:\endcsname }
3130 % \end{macrocode}
3131 %
3132 % \begin{macrocode}
3133 \def \@outputpage {%
3134 % \end{macrocode}
3135 % We start with a hook available to packages that want to prepend
3136 % code to \cs{@outputpage}.
3137 % \begin{macrocode}
3138 \UseHook {build/page/before}%
3139 % \end{macrocode}
3140 % The |\endgroup| is put in by |\aftergroup|.
3141 % \begin{macrocode}
3142 \begingroup
3143 % \end{macrocode}
3144 % Now all the set-up stuff has been in-lined for Frank.
3145 %
3146 % First the stuff for the writes.
3147 %
3148 % From here on was orginially in the command |\@writesetup|.
3149 %
3150 % RmS 93/08/19: Redefined accents to allow changes in font encoding;
3151 % but exactly why was this needed?
3152 %
3153 % \changes{v1.3c}{2017/03/10}{Reset \cs{language}}
3154 % Reset |\language| to the value current at |\begin{document}|.
3155 % In particular this ensures that a pagebreak in |verbatim| does not
3156 % prevent hyphenation in the page head.
3157 % \begin{macrocode}
3158 \language\document@default@language
3159 % \end{macrocode}
3160 %
3161 % Now a few more resets for things that may have changed during
3162 % galley processing. We start with resetting some active character definitions.
3163 % \begin{macrocode}
3164 \@resetactivechars
3165 % \end{macrocode}
3166 % Then we deal with catcodes that might got altered by
3167 % \texttt{verbatim} or similar environments and reset them to
3168 % standard values.
3169 % \changes{v1.4o}{2025/02/25}{Reset various catcodes to their default
3170 % values in case a pagebreak occurs while a special catcode scheme
3171 % is in force (gh/600)}
3172 % \changes{v1.4y}{2025/06/07}{Reset catcode of CR (gh/1766)}
3173 % \changes{v1.4y}{2025/06/08}{Reset catcode of TAB (gh/1766)}
3174 % \changes{v1.4z}{2025/08/22}{Don't use \cs{nfss@catcodes} + updates,
3175 % but spell everything out explicitly}
3176 % \begin{macrocode}
3177 \catcode`\\\z@
3178 \catcode`\{\@ne
3179 \catcode`\}\tw@
3180 \catcode`\$\thr@@
3181 \catcode`\&4\relax
3182 \catcode`\^^M5\relax
3183 \catcode`\#6\relax
3184 \catcode`\^7\relax
3185 \catcode`\_8\relax
3186 \catcode`\ 10\relax
3187 \catcode`\^^I10\relax
3188 \@makeother\<%
3189 \@makeother\>%
3190 \@makeother\*%
3191 \@makeother\.%
3192 \@makeother\-%
3193 \@makeother\/%
3194 \@makeother\[%
3195 \@makeother\]%
3196 \@makeother\`%
3197 \@makeother\'%
3198 \@makeother\"%
3199 \catcode`\~13\relax
3200 \catcode`\%14\relax
3201 % \end{macrocode}
3202 % If a page break happens between the start of a list and its first
3203 % item then |@newlist| will be true and this will mess up any list
3204 % that is used in the header or footer of the page. So we have to
3205 % reset that flag.
3206 % \changes{v1.2h}{2000/07/19}
3207 % {Reset and restore \cs{@if@newlist} for internal/3231}
3208 % \changes{v1.2j}{2001/01/07}
3209 % {And do it in the right macro! (pr/3286)}
3210 % \begin{macrocode}
3211 \global\let\@@if@newlist\if@newlist
3212 \global\@newlistfalse
3213 % \end{macrocode}
3214 %
3215 % \changes{v1.0q}{1994/05/16}{Changed setting of accents (FMi):
3216 % with the new encoding setup they can use \cs{let}.
3217 % It could also use the new internal commands?}
3218 % \changes{v1.1l}{1995/04/24}{Reset \cmd\\ latex/1451 (DPC)}
3219 % This next hook replaces the following:
3220 % \begin{verbatim}
3221 % \let\-\@dischyph
3222 % \let\'\@acci\let\`\@accii\let\=\@acciii
3223 % \let\\\@normalcr
3224 % \let\par\@@par %% 15 Sep 87 (this was once inside the box)
3225 % \end{verbatim}
3226 % and it does more than they did; in particular it sets:
3227 % \begin{verbatim}
3228 % \parindent\z@
3229 % \parskip\z@skip
3230 % \everypar{}%
3231 % \leftskip\z@skip
3232 % \rightskip\z@skip
3233 % \parfillskip\@flushglue
3234 % \lineskip\normallineskip
3235 % \baselineskip\normalbaselineskip
3236 % \sloppy
3237 % \end{verbatim}
3238 %
3239 % \begin{macrocode}
3240 \@parboxrestore
3241 % \end{macrocode}
3242 % \ldots\ to here was in the command |\@writesetup|.
3243 %
3244 % Hook to allow adding resets local to the output routine processing, e.g.,
3245 % in \cs{write} or running headers/footers, for packages that set
3246 % up special conventions in the main galley that should not leak
3247 % into the page production just because a page break happens in the
3248 % middle of such an environment.
3249 % \begin{macrocode}
3250 \UseHook {build/page/reset}%
3251 % \end{macrocode}
3252 %
3253 % The following definition of \cs{protect} is the one active during
3254 % the \cs{write} statement that migrate out of the \cs{shipout}
3255 % box, so even though it is immediately changed below (inside
3256 % \cs{shipout} it still has to be here!
3257 % \changes{v1.4z}{2025/08/22}{Move setting of \cs{protect} after all hooks
3258 % so that only the \cs{write} statements are affected (gh/1845)}
3259 % \begin{macrocode}
3260 \let \protect \noexpand
3261 % \end{macrocode}
3262 %
3263 % \begin{macrocode}
3264 \shipout \vbox{%
3265 % \end{macrocode}
3266 % Inside the \cs{shipout} box we have a different setting for \cs{protect}.
3267 % \begin{macrocode}
3268 \set@typeset@protect
3269 \aftergroup \endgroup
3270 % \end{macrocode}
3271 % Once the \cs{shipout} boxs ends \cs{protect} is again
3272 % \cs{noexpand} which is correct for any \cs{write} statements, but
3273 % once they are processed we want to get back to the following setting:
3274 % \begin{macrocode}
3275 \aftergroup \set@typeset@protect
3276 % \end{macrocode}
3277 %
3278 % Now the setup inside the shipped out box; this should contain all
3279 % the stuff that could only affect typesetting; other stuff may need
3280 % to be reset for the writes also.
3281 %
3282 % From here \ldots\ was in the command |\@shipoutsetup|.
3283 % \begin{macrocode}
3284 \if@specialpage
3285 \global \@specialpagefalse
3286 \@nameuse {ps@\@specialstyle}%
3287 \fi
3288 \if@twoside
3289 \ifodd\count\z@
3290 \let \@thehead \@oddhead
3291 \let \@thefoot \@oddfoot
3292 \let \@themargin \oddsidemargin
3293 \else
3294 \let \@thehead \@evenhead
3295 \let \@thefoot \@evenfoot
3296 \let \@themargin \evensidemargin
3297 \fi
3298 \fi
3299 % \end{macrocode}
3300 %
3301 % The rest was always inside the box.
3302 %
3303 % RmS 91/08/15: added this line:
3304 % \begin{macrocode}
3305 \reset@font
3306 % \end{macrocode}
3307 % RmS 93/08/06 Added |\lineskiplimit=0pt| to guard against it being
3308 % nonzero: e.g. by |\offinterlineskip| being in effect.
3309 %
3310 % There are probably lots of other things that may need resetting.
3311 %
3312 % \begin{macrocode}
3313 \normalsize
3314 % \end{macrocode}
3315 % Reset the space factors.
3316 % \changes{v1.2b}{1997/04/14}
3317 % {Call \cs{normalsfcodes} (from patch file) latex/2404}
3318 % \begin{macrocode}
3319 \normalsfcodes
3320 % \end{macrocode}
3321 %
3322 % Reset these here (previously reset separately for head and foot)
3323 % \changes{v1.2b}{1997/04/14}
3324 % {Move \cs{label} and \cs{index} (from patch file)}
3325 % \changes{v1.4l}{2025/01/21}{Support extended syntax
3326 % for \cs{label}, \cs{index}, and \cs{glossary} (gh/311)}
3327 % \changes{v1.4m}{2025/01/23}
3328 % {Make \cs{label}, \cs{index} and \cs{glossary} truely invisible
3329 % when typesetting (gh/1638)}
3330 % \begin{macrocode}
3331 \let \label \@gobble@with@sphack@om
3332 \let \index \@gobble@with@sphack@som
3333 \let \glossary \@gobble@with@sphack@om
3334 % \end{macrocode}
3335 %
3336 % \begin{macrocode}
3337 \baselineskip \z@skip
3338 \lineskip \z@skip
3339 \lineskiplimit \z@
3340 % \end{macrocode}
3341 % \ldots\ to here was in the command |\@shipoutsetup|.
3342 % \begin{macrocode}
3343 \@begindvi
3344 \vskip \topmargin
3345 \moveright\@themargin \vbox {%
3346 \setbox\@tempboxa \vbox to\headheight {%
3347 \vfil
3348 % \end{macrocode}
3349 % Tagging socket that receives the header in its second argument to
3350 % surround the header with appropriate tagging structures (first
3351 % argument is unused). If tagging is disabled it returns the
3352 % content of the second argument.
3353 % \begin{macrocode}
3354 \pdfannot@link@off@@
3355 \UseTaggingSocket{build/page/header}{}%
3356 {
3357 \color@hbox
3358 \normalcolor
3359 \hb@xt@ \textwidth {\@thehead }%
3360 \color@endbox
3361 }
3362 \pdfannot@link@on@@
3363 }
3364 \dp \@tempboxa \z@
3365 \box \@tempboxa
3366 \vskip \headsep
3367 \box \@outputbox
3368 \baselineskip \footskip
3369 % \end{macrocode}
3370 % Tagging socket that receives the footer in its second argument to
3371 % surround the footer with appropriate tagging structures (first
3372 % argument is unused). If tagging is disabled it returns the
3373 % content of the second argument.
3374 % \begin{macrocode}
3375 \pdfannot@link@off@@
3376 \UseTaggingSocket{build/page/footer}{}%
3377 {
3378 \color@hbox
3379 \normalcolor
3380 \hb@xt@ \textwidth {\@thefoot }%
3381 \color@endbox
3382 }
3383 \pdfannot@link@on@@
3384 }
3385 }
3386 % \end{macrocode}
3387 % |\endgroup| now inserted by |\aftergroup|
3388 %
3389 % Restore |\if@newlist|
3390 % \begin{macrocode}
3391 \global \let \if@newlist \@@if@newlist
3392 % \end{macrocode}
3393 %
3394 % \begin{macrocode}
3395 \global \@colht \textheight
3396 \stepcounter{page}%
3397 % \end{macrocode}
3398 % Another hook for packages that want to append material to \cs{@outputpage}.
3399 % \begin{macrocode}
3400 \UseHook {build/page/after}%
3401 }
3402 %<latexrelease>\EndIncludeInRelease
3403 % \end{macrocode}
3404 %
3405 % \begin{macrocode}
3406 %<latexrelease>\IncludeInRelease{2017/04/15}%
3407 %<latexrelease> {\@outputpage}{Reset language for hyphenation}%
3408 %<latexrelease>\def\@outputpage{%
3409 %<latexrelease>\begingroup
3410 %<latexrelease> \let \protect \noexpand
3411 %<latexrelease> \language\document@default@language
3412 %<latexrelease> \@resetactivechars
3413 %<latexrelease> \global\let\@@if@newlist\if@newlist
3414 %<latexrelease> \global\@newlistfalse
3415 %<latexrelease> \@parboxrestore
3416 %<latexrelease> \shipout \vbox{%
3417 %<latexrelease> \set@typeset@protect
3418 %<latexrelease> \aftergroup \endgroup
3419 %<latexrelease> \aftergroup \set@typeset@protect
3420 %<latexrelease> \if@specialpage
3421 %<latexrelease> \global\@specialpagefalse\@nameuse{ps@\@specialstyle}%
3422 %<latexrelease> \fi
3423 %<latexrelease> \if@twoside
3424 %<latexrelease> \ifodd\count\z@ \let\@thehead\@oddhead \let\@thefoot\@oddfoot
3425 %<latexrelease> \let\@themargin\oddsidemargin
3426 %<latexrelease> \else \let\@thehead\@evenhead
3427 %<latexrelease> \let\@thefoot\@evenfoot \let\@themargin\evensidemargin
3428 %<latexrelease> \fi
3429 %<latexrelease> \fi
3430 %<latexrelease> \reset@font
3431 %<latexrelease> \normalsize
3432 %<latexrelease> \normalsfcodes
3433 %<latexrelease> \let\label\@gobble
3434 %<latexrelease> \let\index\@gobble
3435 %<latexrelease> \let\glossary\@gobble
3436 %<latexrelease> \baselineskip\z@skip \lineskip\z@skip \lineskiplimit\z@
3437 %<latexrelease> \@begindvi
3438 %<latexrelease> \vskip \topmargin
3439 %<latexrelease> \moveright\@themargin \vbox {%
3440 %<latexrelease> \setbox\@tempboxa \vbox to\headheight{%
3441 %<latexrelease> \vfil
3442 %<latexrelease> \color@hbox
3443 %<latexrelease> \normalcolor
3444 %<latexrelease> \hb@xt@\textwidth{\@thehead}%
3445 %<latexrelease> \color@endbox
3446 %<latexrelease> }%
3447 %<latexrelease> \dp\@tempboxa \z@
3448 %<latexrelease> \box\@tempboxa
3449 %<latexrelease> \vskip \headsep
3450 %<latexrelease> \box\@outputbox
3451 %<latexrelease> \baselineskip \footskip
3452 %<latexrelease> \color@hbox
3453 %<latexrelease> \normalcolor
3454 %<latexrelease> \hb@xt@\textwidth{\@thefoot}%
3455 %<latexrelease> \color@endbox
3456 %<latexrelease> }%
3457 %<latexrelease> }%
3458 %<latexrelease> \global\let\if@newlist\@@if@newlist
3459 %<latexrelease> \global \@colht \textheight
3460 %<latexrelease> \stepcounter{page}%
3461 % \end{macrocode}
3462 % It is now clear that this does something useful (in the old mark
3463 % mechanism), thanks to Pieter van Oostrum pointing this out. It
3464 % is needed because a float page is made without using TeX's
3465 % page-builder; thus the output routine is never called so the
3466 % marks are not updated.
3467 % \begin{macrocode}
3468 %<latexrelease> \let\firstmark\botmark
3469 %<latexrelease>}
3470 %</2ekernel|latexrelease>
3471 %<latexrelease>\EndIncludeInRelease
3472 % \end{macrocode}
3473 %
3474 % \begin{macrocode}
3475 %<latexrelease>\IncludeInRelease{0000/00/00}%
3476 %<latexrelease> {\@outputpage}{Reset language for hyphenation}%
3477 %<latexrelease>\def\@outputpage{%
3478 %<latexrelease>\begingroup
3479 %<latexrelease> \let \protect \noexpand
3480 %<latexrelease> \@resetactivechars
3481 %<latexrelease> \global\let\@@if@newlist\if@newlist
3482 %<latexrelease> \global\@newlistfalse
3483 %<latexrelease> \@parboxrestore
3484 %<latexrelease> \shipout \vbox{%
3485 %<latexrelease> \set@typeset@protect
3486 %<latexrelease> \aftergroup \endgroup
3487 %<latexrelease> \aftergroup \set@typeset@protect
3488 %<latexrelease> \if@specialpage
3489 %<latexrelease> \global\@specialpagefalse\@nameuse{ps@\@specialstyle}%
3490 %<latexrelease> \fi
3491 %<latexrelease> \if@twoside
3492 %<latexrelease> \ifodd\count\z@
3493 %<latexrelease> \let\@thehead\@oddhead \let\@thefoot\@oddfoot
3494 %<latexrelease> \let\@themargin\oddsidemargin
3495 %<latexrelease> \else \let\@thehead\@evenhead
3496 %<latexrelease> \let\@thefoot\@evenfoot \let\@themargin\evensidemargin
3497 %<latexrelease> \fi
3498 %<latexrelease> \fi
3499 %<latexrelease> \reset@font
3500 %<latexrelease> \normalsize
3501 %<latexrelease> \normalsfcodes
3502 %<latexrelease> \let\label\@gobble
3503 %<latexrelease> \let\index\@gobble
3504 %<latexrelease> \let\glossary\@gobble
3505 %<latexrelease> \baselineskip\z@skip \lineskip\z@skip \lineskiplimit\z@
3506 %<latexrelease> \@begindvi
3507 %<latexrelease> \vskip \topmargin
3508 %<latexrelease> \moveright\@themargin \vbox {%
3509 %<latexrelease> \setbox\@tempboxa \vbox to\headheight{%
3510 %<latexrelease> \vfil
3511 %<latexrelease> \color@hbox
3512 %<latexrelease> \normalcolor
3513 %<latexrelease> \hb@xt@\textwidth{\@thehead}%
3514 %<latexrelease> \color@endbox
3515 %<latexrelease> }%
3516 %<latexrelease> \dp\@tempboxa \z@
3517 %<latexrelease> \box\@tempboxa
3518 %<latexrelease> \vskip \headsep
3519 %<latexrelease> \box\@outputbox
3520 %<latexrelease> \baselineskip \footskip
3521 %<latexrelease> \color@hbox
3522 %<latexrelease> \normalcolor
3523 %<latexrelease> \hb@xt@\textwidth{\@thefoot}%
3524 %<latexrelease> \color@endbox
3525 %<latexrelease> }%
3526 %<latexrelease> }%
3527 %<latexrelease> \global\let\if@newlist\@@if@newlist
3528 %<latexrelease> \global \@colht \textheight
3529 %<latexrelease> \stepcounter{page}%
3530 %<latexrelease> \let\firstmark\botmark
3531 %<latexrelease>}
3532 %<latexrelease>\EndIncludeInRelease
3533 %<*2ekernel>
3534 % \end{macrocode}
3535 % \end{macro}
3536 % \end{macro}
3537 % \end{macro}
3538 %
3539 % \begin{macro}{\@begindvi}
3540 % \changes{v1.1c}{1994/11/05}
3541 % {Added macro}
3542 % \changes{v1.1f}{1994/11/14}{Use normal box register: why a box?}
3543 %
3544 % This unboxes stuff that must appear before anything else in the
3545 % |.dvi| file, then returns that box register to the free list and
3546 % cancels itself.
3547 %
3548 % The stuff in the box should not add any typeset material to the
3549 % page.
3550 % \begin{macrocode}
3551 \def \@begindvi{%
3552 \unvbox \@begindvibox
3553 \global\let \@begindvi \@empty
3554 }
3555 % \end{macrocode}
3556 % \end{macro}
3557 %
3558 %
3559 %
3560 %
3561 %
3562 %
3563 % \subsubsection{Dealing with floats}
3564 %
3565 %
3566 %
3567 % \begin{macro}{\@combinefloats}
3568 % \changes{v1.4m}{2025/02/14}{Macro got a new name}
3569 % Old name for what is now called \cs{@outputbox@attachfloats};
3570 % kept to support legacy packages.
3571 % \begin{macrocode}
3572 \let \@combinefloats \@outputbox@attachfloats
3573 % \end{macrocode}
3574 % \end{macro}
3575 %
3576 %
3577
3578 % \begin{macro}{\@cflt}
3579 % \changes{v1.0h}{1993/12/12}{name changed}
3580 % \begin{macro}{\@cflb}
3581 % The |\boxmaxdepth| setting here was not made local to
3582 % a box so was dangerous. It is needed only within the box made
3583 % by |\@cflt| (and not normally even there), so it has been
3584 % moved there; this also agrees with the original pseudocode.
3585 %
3586 % \changes{v1.0h}{1993/12/12}{boxmaxdepth setting moved}
3587 % \changes{v1.0h}{1993/12/12}{defs changed to lets}
3588 % \begin{macrocode}
3589 \def \@cflt{%
3590 \let \@elt \@comflelt
3591 \setbox\@tempboxa \vbox{}%
3592 \@toplist
3593 \setbox\@outputbox \vbox{%
3594 \boxmaxdepth \maxdepth
3595 \unvbox\@tempboxa
3596 \vskip -\floatsep
3597 \topfigrule
3598 \vskip \textfloatsep
3599 \unvbox\@outputbox
3600 }%
3601 \let\@elt\relax
3602 \xdef\@freelist{\@freelist\@toplist}%
3603 \global\let\@toplist\@empty
3604 }
3605 % \end{macrocode}
3606 %
3607 % \begin{macrocode}
3608 \def \@cflb {%
3609 \let\@elt\@comflelt
3610 \setbox\@tempboxa \vbox{}%
3611 \@botlist
3612 \setbox\@outputbox \vbox{%
3613 \unvbox\@outputbox
3614 \vskip \textfloatsep
3615 \botfigrule
3616 \unvbox\@tempboxa
3617 \vskip -\floatsep
3618 }%
3619 \let\@elt\relax
3620 \xdef\@freelist{\@freelist\@botlist}%
3621 \global \let \@botlist\@empty
3622 }
3623 % \end{macrocode}
3624 % \end{macro}
3625 % \end{macro}
3626 %
3627 %
3628 % \begin{macro}{\@comflelt}
3629 % \begin{macro}{\@comdblflelt}
3630 % \begin{macro}{\@combinedblfloats}
3631 %
3632 % \begin{macrocode}
3633 \def\@comflelt#1{\setbox\@tempboxa
3634 \vbox{\unvbox\@tempboxa\box #1\vskip\floatsep}}
3635 % \end{macrocode}
3636 %
3637 % \begin{macrocode}
3638 \def\@comdblflelt#1{\setbox\@tempboxa
3639 \vbox{\unvbox\@tempboxa\box #1\vskip\dblfloatsep}}
3640 % \end{macrocode}
3641 %
3642 % \begin{macrocode}
3643 \def \@combinedblfloats{%
3644 \ifx \@dbltoplist \@empty
3645 \else
3646 \setbox\@tempboxa \vbox{}%
3647 \let \@elt \@comdblflelt
3648 \@dbltoplist
3649 \let \@elt \relax
3650 \xdef \@freelist {\@freelist\@dbltoplist}%
3651 \global\let \@dbltoplist \@empty
3652 \setbox\@outputbox \vbox to\textheight
3653 % \end{macrocode}
3654 %
3655 % The setting of |\boxmaxdepth| here has no effect since the
3656 % |\@outputbox| should already have depth zero. Even so, it would
3657 % have no effect on the layout of the page.
3658 % \changes{v1.0l}{1994/03/15}{Removed boxmaxdepth setting.}
3659 % \begin{macrocode}
3660 {%
3661 \unvbox\@tempboxa\vskip-\dblfloatsep
3662 % \end{macrocode}
3663 % Here we need different typesetting if the top float comes from
3664 % |\@topnewpage|.
3665 % \changes{v1.0n}{1994/04/30}{Removed rule in topnewpage case}
3666 % \begin{macrocode}
3667 \ifnum \@dbltopnum>\m@ne
3668 \dblfigrule
3669 \fi
3670 \vskip \dbltextfloatsep
3671 % \end{macrocode}
3672 % If pdf links are present in the galley and those links get broken
3673 % across pages they have to end up being on the same level of boxing
3674 % (even if not actually in the same structure) due to some engine
3675 % restrictions in pdf\TeX\ and Lua\TeX. We therefore unbox
3676 % |\@outputbox| here (which only contains a single |\hbox|) so that
3677 % this case has the same boxing level as a normal twocolumn page
3678 % without top floats.
3679 % \changes{v1.4d}{2018/11/28}{Unbox \cs{@outputbox} to preserve boxing
3680 % level (github/94)}
3681 % \begin{macrocode}
3682 \unvbox\@outputbox
3683 }%
3684 \fi
3685 }
3686 %</2ekernel>
3687 % \end{macrocode}
3688 % \end{macro}
3689 % \end{macro}
3690 % \end{macro}
3691 %
3692 %
3693 % \begin{macro}{\@startcolumn}
3694 % \changes{v1.0f}{1993/12/05}{Command changed}
3695 % \begin{macro}{\@startdblcolumn}
3696 % \changes{v1.0f}{1993/12/05}{Command changed}
3697 %
3698 % We could combine (most of) these two into |\@startcol <list>|.
3699 % Note that |\@xstartcol| was only used once (\ie in
3700 % |\@startcolumn|); it has therefore been removed. This is not quite
3701 % as efficient but it now has the same structure as
3702 % |\@startdblcolumn|.
3703 %
3704 % The empty-list test has been moved to |\@tryfcolumn|.
3705 %
3706 % \begin{macrocode}
3707 %<*2ekernel|fltrace>
3708 \def \@startcolumn {%
3709 \global \@colroom \@colht
3710 \@tryfcolumn \@deferlist
3711 \if@fcolmade
3712 %<*trace>
3713 \fl@trace{PAGE: float \if@twocolumn column \else page \fi
3714 completed}%
3715 %</trace>
3716 \else
3717 % \end{macrocode}
3718 % \changes{v1.0h}{1993/12/12}{defs changed to lets}
3719 % \begin{macrocode}
3720 \begingroup
3721 \let \reserved@b \@deferlist
3722 \global \let \@deferlist \@empty
3723 \let \@elt \@scolelt
3724 \reserved@b
3725 \endgroup
3726 \fi
3727 }
3728 % \end{macrocode}
3729 %
3730 % This one does not need to set |\@colht|.
3731 %
3732 % \changes{v1.2n}{2015/01/14}{float order in 2-column (latexrelease)}
3733 % \begin{macrocode}
3734 %</2ekernel|fltrace>
3735 %<latexrelease|fltrace>\IncludeInRelease{2015/01/01}%
3736 %<latexrelease|fltrace> {\@startdblcolumn}{float order in 2-column}%
3737 %<*2ekernel|latexrelease|fltrace>
3738 \def \@startdblcolumn {%
3739 \@tryfcolumn \@deferlist
3740 \if@fcolmade
3741 %<fltrace> \fl@trace{PAGE: double float page completed}%
3742 \else
3743 \begingroup
3744 \let \reserved@b \@deferlist
3745 \global \let \@deferlist \@empty
3746 \let \@elt \@sdblcolelt
3747 \reserved@b
3748 \endgroup
3749 \fi
3750 }%
3751 %</2ekernel|latexrelease|fltrace>
3752 %<latexrelease|fltrace>\EndIncludeInRelease
3753 %<latexrelease|fltrace>\IncludeInRelease{0000/00/00}%
3754 %<latexrelease|fltrace> {\@startdblcolumn}{float order in 2-column}%
3755 %<latexrelease|fltrace>\def \@startdblcolumn {%
3756 % \end{macrocode}
3757 % Not needed since this always comes after |\@outputpage|:
3758 % \begin{macrocode}
3759 %<latexrelease|fltrace>% \global \@colht \textheight
3760 %<latexrelease|fltrace> \@tryfcolumn \@dbldeferlist
3761 %<latexrelease|fltrace> \if@fcolmade
3762 %<*trace>
3763 %<latexrelease|fltrace> \fl@trace{PAGE: double float page completed}%
3764 %</trace>
3765 %<latexrelease|fltrace> \else
3766 % \end{macrocode}
3767 % \changes{v1.0h}{1993/12/12}{defs changed to lets}
3768 % \begin{macrocode}
3769 %<latexrelease|fltrace> \begingroup
3770 %<latexrelease|fltrace> \let \reserved@b \@dbldeferlist
3771 %<latexrelease|fltrace> \global \let \@dbldeferlist \@empty
3772 %<latexrelease|fltrace> \let \@elt \@sdblcolelt
3773 %<latexrelease|fltrace> \reserved@b
3774 %<latexrelease|fltrace> \endgroup
3775 %<latexrelease|fltrace> \fi
3776 %<latexrelease|fltrace>}%
3777 %<latexrelease|fltrace>\EndIncludeInRelease
3778 %<*2ekernel|fltrace>
3779 % \end{macrocode}
3780 % \end{macro}
3781 % \end{macro}
3782 %
3783 % \begin{macro}{\@tryfcolumn}
3784 % \changes{v1.0f}{1993/12/05}{Command changed}
3785 % Now tests if its list is empty before any further exertion.
3786 %
3787 % \begin{macrocode}
3788 \def \@tryfcolumn #1{%
3789 \global \@fcolmadefalse
3790 \ifx #1\@empty
3791 \else
3792 %<*trace>
3793 \fl@trace{PAGE: try float \if@twocolumn column/page\else page\fi
3794 ---\string #1}%
3795 \fl@trace{----- \string #1: #1}%
3796 %</trace>
3797 % \end{macrocode}
3798 % \changes{v1.0h}{1993/12/12}{defs changed to lets}
3799 % \begin{macrocode}
3800 \xdef\@trylist{#1}%
3801 \global \let \@failedlist \@empty
3802 \begingroup
3803 \let \@elt \@xtryfc \@trylist
3804 \endgroup
3805 \if@fcolmade
3806 \@vtryfc #1%
3807 \fi
3808 \fi
3809 }
3810 %</2ekernel|fltrace>
3811 % \end{macrocode}
3812 %
3813 % \end{macro}
3814 %
3815 % \begin{macrocode}
3816 %<*2ekernel>
3817 % \end{macrocode}
3818 %
3819 % \begin{macro}{\@scolelt}
3820 % \begin{macrocode}
3821 \def\@scolelt#1{\def\@currbox{#1}\@addtonextcol}
3822 % \end{macrocode}
3823 % \end{macro}
3824 %
3825 % \begin{macro}{\@sdblcolelt}
3826 % \begin{macrocode}
3827 \def\@sdblcolelt#1{\def\@currbox{#1}\@addtodblcol}
3828 % \end{macrocode}
3829 % \end{macro}
3830 %
3831 % \begin{macro}{\@vtryfc}
3832 % \changes{v1.2d}{1997/11/19}{Reindent code, to be understandable(DPC).}
3833 % \begin{macrocode}
3834 \def\@vtryfc #1{%
3835 \global\setbox\@outputbox\vbox{}%
3836 \let\@elt\@wtryfc
3837 \@flsucceed
3838 \global\setbox\@outputbox \vbox to\@colht{%
3839 \vskip \@fptop
3840 \vskip -\@fpsep
3841 \unvbox \@outputbox
3842 \vskip \@fpbot}%
3843 \let\@elt\relax
3844 \xdef #1{\@failedlist\@flfail}%
3845 \xdef\@freelist{\@freelist\@flsucceed}}
3846 % \end{macrocode}
3847 % \end{macro}
3848 %
3849 % \begin{macro}{\@wtryfc}
3850 % \begin{macrocode}
3851 \def\@wtryfc #1{%
3852 \global\setbox\@outputbox\vbox{%
3853 \unvbox\@outputbox
3854 \vskip\@fpsep
3855 \box #1}}
3856 % \end{macrocode}
3857 % \end{macro}
3858 %
3859 % \begin{macro}{\@xtryfc}
3860 % \changes{v1.1v}{1996/07/26}{remove \cs{global} before \cs{@test...}}
3861 % \changes{v1.2n}{2015/01/14}{float order in 2-column (latexrelease)}
3862 % \begin{macrocode}
3863 %</2ekernel>
3864 %<latexrelease>\IncludeInRelease{2015/01/01}{\@xtryfc}%
3865 %<latexrelease> {float order in 2-column}%
3866 %<*2ekernel|latexrelease>
3867 \def\@xtryfc #1{%
3868 \@next\reserved@a\@trylist{}{}%
3869 \@currtype \count #1%
3870 \divide\@currtype\@xxxii
3871 \multiply\@currtype\@xxxii
3872 \@bitor \@currtype \@failedlist
3873 \@testfp #1%
3874 % \end{macrocode}
3875 %
3876 % \begin{macrocode}
3877 \@testwrongwidth #1%
3878 % \end{macrocode}
3879 %
3880 % \begin{macrocode}
3881 \ifdim \ht #1>\@colht
3882 \@testtrue
3883 \fi
3884 \if@test
3885 \@cons\@failedlist #1%
3886 \else
3887 \@ytryfc #1%
3888 \fi}%
3889 %</2ekernel|latexrelease>
3890 %<latexrelease>\EndIncludeInRelease
3891 %<latexrelease>\IncludeInRelease{0000/00/00}{\@xtryfc}%
3892 %<latexrelease> {float order in 2-column}%
3893 %<latexrelease>\def\@xtryfc #1{%
3894 %<latexrelease> \@next\reserved@a\@trylist{}{}%
3895 %<latexrelease> \@currtype \count #1%
3896 %<latexrelease> \divide\@currtype\@xxxii
3897 %<latexrelease> \multiply\@currtype\@xxxii
3898 %<latexrelease> \@bitor \@currtype \@failedlist
3899 %<latexrelease> \@testfp #1%
3900 %<latexrelease> \ifdim \ht #1>\@colht
3901 %<latexrelease> \@testtrue
3902 %<latexrelease> \fi
3903 %<latexrelease> \if@test
3904 %<latexrelease> \@cons\@failedlist #1%
3905 %<latexrelease> \else
3906 %<latexrelease> \@ytryfc #1%
3907 %<latexrelease> \fi}%
3908 %<latexrelease>\EndIncludeInRelease
3909 %<*2ekernel>
3910 % \end{macrocode}
3911 % \end{macro}
3912 %
3913 % \begin{macro}{\@ytryfc}
3914 % \begin{macrocode}
3915 \def\@ytryfc #1{%
3916 \begingroup
3917 \gdef\@flsucceed{\@elt #1}%
3918 \global\let\@flfail\@empty
3919 \@tempdima\ht #1%
3920 \let\@elt\@ztryfc
3921 \@trylist
3922 \ifdim \@tempdima >\@fpmin
3923 \global\@fcolmadetrue
3924 \else
3925 \@cons\@failedlist #1%
3926 \fi
3927 \endgroup
3928 \if@fcolmade
3929 \let\@elt\@gobble
3930 \fi}
3931 % \end{macrocode}
3932 % \end{macro}
3933 %
3934 % \begin{macro}{\@ztryfc}
3935 % \changes{v1.1v}{1996/07/26}{remove \cs{global} before \cs{@test...}}
3936 % \changes{v1.2n}{2015/01/14}{float order in 2-column (latexrelease)}
3937 % \begin{macrocode}
3938 %</2ekernel>
3939 %<latexrelease>\IncludeInRelease{2015/01/01}{@ztryfc}%
3940 %<latexrelease> {float order in 2-column}%
3941 %<*2ekernel|latexrelease>
3942 \def\@ztryfc #1{%
3943 \@tempcnta\count #1%
3944 \divide\@tempcnta\@xxxii
3945 \multiply\@tempcnta\@xxxii
3946 \@bitor \@tempcnta {\@failedlist \@flfail}%
3947 \@testfp #1%
3948 % \end{macrocode}
3949 %
3950 % not in fixfloats?
3951 % \begin{macrocode}
3952 \@testwrongwidth #1%
3953 % \end{macrocode}
3954 %
3955 % \begin{macrocode}
3956 \@tempdimb\@tempdima
3957 \advance\@tempdimb\ht #1%
3958 \advance\@tempdimb\@fpsep
3959 \ifdim \@tempdimb >\@colht
3960 \@testtrue
3961 \fi
3962 \if@test
3963 \@cons\@flfail #1%
3964 \else
3965 \@cons\@flsucceed #1%
3966 \@tempdima\@tempdimb
3967 \fi}%
3968 %</2ekernel|latexrelease>
3969 %<latexrelease>\EndIncludeInRelease
3970 %<latexrelease>\IncludeInRelease{0000/00/00}{@ztryfc}%
3971 %<latexrelease> {float order in 2-column}%
3972 %<latexrelease>\def\@ztryfc #1{%
3973 %<latexrelease> \@tempcnta \count#1%
3974 %<latexrelease> \divide\@tempcnta\@xxxii
3975 %<latexrelease> \multiply\@tempcnta\@xxxii
3976 %<latexrelease> \@bitor \@tempcnta {\@failedlist \@flfail}%
3977 %<latexrelease> \@testfp #1%
3978 %<latexrelease> \@tempdimb\@tempdima
3979 %<latexrelease> \advance\@tempdimb \ht#1%
3980 %<latexrelease> \advance\@tempdimb\@fpsep
3981 %<latexrelease> \ifdim \@tempdimb >\@colht
3982 %<latexrelease> \@testtrue
3983 %<latexrelease> \fi
3984 %<latexrelease> \if@test
3985 %<latexrelease> \@cons\@flfail #1%
3986 %<latexrelease> \else
3987 %<latexrelease> \@cons\@flsucceed #1%
3988 %<latexrelease> \@tempdima\@tempdimb
3989 %<latexrelease> \fi}%
3990 %<latexrelease>\EndIncludeInRelease
3991 % \end{macrocode}
3992 % \end{macro}
3993 %
3994 %
3995 % The major changes for float suppression and the changes to the float
3996 % mechanism to make it conform to the documentation are in these next
3997 % macros.
3998 %
3999 % \begin{macro}{\@addtobot}
4000 % \changes{v1.0f}{1993/12/05}{Command changed}
4001 % Lots of changes.
4002 %
4003 % \begin{macrocode}
4004 %<*2ekernel|fltrace>
4005 \def \@addtobot {%
4006 %<*trace>
4007 \fl@trace{***Start addtobot}%
4008 %</trace>
4009 \@getfpsbit 4\relax
4010 %<*trace>
4011 \fl@trace{fpstype \ifodd \@tempcnta OK \else not \fi bot:
4012 \the \@fpstype}%
4013 %</trace>
4014 \ifodd \@tempcnta
4015 \@flsetnum \@botnum
4016 \ifnum \@botnum>\z@
4017 \@tempswafalse
4018 \@flcheckspace \@botroom \@botlist
4019 \if@tempswa
4020 % \end{macrocode}
4021 % \changes{v1.4r}{2025/03/25}{Don't set \cs{maxdepth}
4022 % to zero any more (footmisc/19)}
4023 % \begin{macrocode}
4024 % \global \maxdepth \z@
4025 \@flupdates \@botnum \@botroom \@botlist
4026 %<*trace>
4027 \fl@trace{colroom (after-bot) = \the \@colroom}%
4028 \fl@trace{colnum (after-bot) = \the \@colnum}%
4029 \fl@trace{botnum (after-bot) = \the \@botnum}%
4030 \fl@trace{***Success: bot}%
4031 %</trace>
4032 \@inserttrue
4033 \fi
4034 %<*trace>
4035 \else
4036 \fl@trace{Fail: botnum = \the \@botnum:
4037 fpstype \the \@fpstype=ORD?}%
4038 \ifnum \@fpstype<\sixt@@n
4039 \fl@trace{ERROR: !b float not successful (addtobot)}%
4040 \fi
4041 %</trace>
4042 \fi
4043 \fi
4044 }
4045 % \end{macrocode}
4046 % \end{macro}
4047 %
4048 % \begin{macro}{\@addtotoporbot}
4049 % \changes{v1.0f}{1993/12/05}{Command changed}
4050 % Lots of changes.
4051 %
4052 % \begin{macrocode}
4053 \def \@addtotoporbot {%
4054 %<*trace>
4055 \fl@trace{***Start addtotoporbot}%
4056 %</trace>
4057 \@getfpsbit \tw@
4058 %<*trace>
4059 \fl@trace{fpstype \ifodd \@tempcnta OK \else not \fi top:
4060 \the \@fpstype}%
4061 %</trace>
4062 \ifodd \@tempcnta
4063 \@flsetnum \@topnum
4064 \ifnum \@topnum>\z@
4065 \@tempswafalse
4066 \@flcheckspace \@toproom \@toplist
4067 \if@tempswa
4068 \@bitor\@currtype{\@midlist\@botlist}%
4069 %<*trace>
4070 \fl@trace{(mid+bot)list: \@midlist, \@botlist:
4071 (addtotoporbot-before)}%
4072 %</trace>
4073 \if@test
4074 %<*trace>
4075 \fl@trace{type already on list: mid or bot---sent to addtobot}%
4076 %</trace>
4077 \else
4078 \@flupdates \@topnum \@toproom \@toplist
4079 %<*trace>
4080 \fl@trace{colroom (after-top) = \the \@colroom}%
4081 \fl@trace{colnum (after-top) = \the \@colnum}%
4082 \fl@trace{topnum (after-top) = \the \@topnum}%
4083 \fl@trace{***Success: top}%
4084 %</trace>
4085 \@inserttrue
4086 \fi
4087 \fi
4088 %<*trace>
4089 \else
4090 \fl@trace{Fail: topnum = \the \@topnum: fpstype
4091 \the \@fpstype=ORD?}%
4092 \ifnum \@fpstype<\sixt@@n
4093 \fl@trace{ERROR: !t float not successful (addtotoporbot)}%
4094 \fi
4095 %</trace>
4096 \fi
4097 \fi
4098 \if@insert
4099 \else
4100 %<*trace>
4101 \fl@trace{sent to addtobot (addtotoporbot)}%
4102 %</trace>
4103 \@addtobot
4104 \fi
4105 }
4106 %</2ekernel|fltrace>
4107 % \end{macrocode}
4108 % \end{macro}
4109 %
4110 % \begin{macro}{\@addtocurcol}
4111 % \changes{v1.0f}{1993/12/05}{Command changed}
4112 % \task{CAR}{Add rules around h floats for FMi}
4113 % \task{CAR}{Investigate pagebreak option possibilities}
4114 % Lots of changes.
4115 %
4116 % \changes{v1.2n}{2015/01/14}{float order in 2-column (latexrelease)}
4117 % \begin{macrocode}
4118 %<latexrelease|fltrace|flafter>\IncludeInRelease{2025/06/01}%
4119 %<latexrelease|fltrace|flafter> {\@addtocurcol}{float order in 2-column}%
4120 %<*2ekernel|latexrelease|fltrace|flafter>
4121 \def \@addtocurcol {%
4122 %<*trace>
4123 \fl@trace{***Start addtocurcol}%
4124 %</trace>
4125 \@insertfalse
4126 \@setfloattypecounts
4127 \ifnum \@fpstype=8
4128 %<*trace>
4129 \fl@trace{fpstype !p only (addtocurcol): \the \@fpstype = 8?}%
4130 %</trace>
4131 \else
4132 \ifnum \@fpstype=24
4133 %<*trace>
4134 \fl@trace{fpstype p only (addtocurcol): \the \@fpstype = 24?}%
4135 %</trace>
4136 \else
4137 \@flsettextmin
4138 % \end{macrocode}
4139 % This is a new adjustment which is quite a major change in
4140 % functionality; but it implements the documentation.
4141 % Note that |\@reqcolroom| will include the whole of the
4142 % page-so-far, and hence includes |\@textfloatsheight| of floats,
4143 % so before comparing it with |\@textmin|, we add this to
4144 % |\@textmin| also.
4145 % \begin{macrocode}
4146 %<*trace>
4147 \fl@trace{textfloatsheight (before) = \the \@textfloatsheight}%
4148 %</trace>
4149 \advance \@textmin \@textfloatsheight
4150 \@reqcolroom \@pageht
4151 % \end{macrocode}
4152 % This line must be removed since |\@specialoutput| changed.
4153 % \begin{macrocode}
4154 % \advance \@reqcolroom \@pagedp
4155 %<*trace>
4156 \fl@trace{textmin + textfloatsheight: \the \@textmin}%
4157 \fl@trace{page-so-far: \the \@reqcolroom}%
4158 %</trace>
4159 \ifdim \@textmin>\@reqcolroom
4160 \@reqcolroom \@textmin
4161 %<*trace>
4162 \fl@trace{ORD? textmin being used}%
4163 %</trace>
4164 \fi
4165 \advance \@reqcolroom \ht\@currbox
4166 % \end{macrocode}
4167 % We save the current value of \cs{@reqcolroom} so that we can
4168 % return to this value later, in case a test fails that may have added
4169 % something to it.
4170 % \changes{v1.4n}{2025/01/29}{Save current value of \cs{@reqcolroom} (gh/1645)}
4171 % \begin{macrocode}
4172 \saved@reqcolroom \@reqcolroom
4173 %<*trace>
4174 \fl@trace{float size = \the \ht \@currbox (addtocurcol)}%
4175 \fl@trace{colroom = \the \@colroom (addtocurcol)}%
4176 \fl@trace{reqcolroom = \the \@reqcolroom (addtocurcol)}%
4177 %</trace>
4178 \ifdim \@colroom>\@reqcolroom
4179 \@flsetnum \@colnum
4180 \ifnum \@colnum>\z@
4181 \@bitor\@currtype\@deferlist
4182 % \end{macrocode}
4183 % We need to defer the float also if its width
4184 % doesn't fit.
4185 % \changes{v1.2n}{2000/09/24}{FMi: test for wide float was
4186 % in wrong place}
4187 % \begin{macrocode}
4188 \@testwrongwidth\@currbox
4189 % \end{macrocode}
4190 %
4191 % \begin{macrocode}
4192 %<*trace>
4193 \fl@trace{deferlist: \@deferlist: (addtocurcol-before)}%
4194 %</trace>
4195 \if@test
4196 %<*trace>
4197 \fl@trace{type already on list: defer (addtocurcol)}%
4198 %</trace>
4199 \else
4200 \@bitor\@currtype\@botlist
4201 %<*trace>
4202 \fl@trace{botlist: \@botlist: (addtocurcol-before)}%
4203 %</trace>
4204 \if@test
4205 %<*trace>
4206 \fl@trace{type already on list: bot---sent to addtobot}%
4207 %</trace>
4208 \@addtobot
4209 \else
4210 %<*trace>
4211 \fl@trace{fpstype \ifodd \@tempcnta OK \else not \fi
4212 here: \the \@fpstype}%
4213 %</trace>
4214 \ifodd \count\@currbox
4215 \advance \@reqcolroom \intextsep
4216 \ifdim \@colroom>\@reqcolroom
4217 \global \advance \@colnum \m@ne
4218 \global \advance \@textfloatsheight \ht\@currbox
4219 % \end{macrocode}
4220 % This may sometimes give an overestimate.
4221 % \begin{macrocode}
4222 \global \advance \@textfloatsheight 2\intextsep
4223 \@cons \@midlist \@currbox
4224 %<*trace>
4225 \fl@trace{***Success: here}%
4226 \fl@trace{textfloatsheight (after-here) =
4227 \the \@textfloatsheight}%
4228 \fl@trace{colnum (after-here) = \the \@colnum}%
4229 %</trace>
4230 % \end{macrocode}
4231 %
4232 % CHANGE TO |\@addtocurcol|:
4233 %
4234 % |\penalty\z@| changed to |\penalty\interlinepenalty| so |\samepage|
4235 % works properly with figure and table environments.
4236 % (Changed 23 Oct 86)
4237 %
4238 % There is also an |\addpenalty\interlinepenalty| above.
4239 %
4240 % Although it is best to use |\addvspace| in case two h floats come
4241 % together, this makes other spacing more difficult to adjust; whereas
4242 % if a user specifies two h floats together then they can more easily
4243 % get the spacing correct by ad hoc commands.
4244 %
4245 % It is necessary to adjust for the addition of |\parskip| here in
4246 % case the float is added between paragraphs (\ie when in vertical
4247 % mode).
4248 %
4249 % If the nobreak switch is true we need to reset it and clear
4250 % |\everypar| since the float may not reset the flag and cannot reset
4251 % the |\everypar| globally.
4252 % \changes{v1.0l}{1994/03/15}{Changed \cs{addvspace} to \cs{vskip}}
4253 % \changes{v1.1i}{1994/11/21}
4254 % {Added \cs{if@nobreak} test before float box}
4255 % \changes{v1.1z}{1996/10/24}{Added \cs{nobreak}, etc as appropriate}
4256 %
4257 % Typesetting starts here (we are in vertical mode).
4258 % \begin{macrocode}
4259 \if@nobreak
4260 \nobreak
4261 \@nobreakfalse
4262 \everypar{}%
4263 \else
4264 \addpenalty \interlinepenalty
4265 \fi
4266 \vskip \intextsep
4267 \box\@currbox
4268 \penalty\interlinepenalty
4269 \vskip\intextsep
4270 \ifnum\outputpenalty <-\@Mii \vskip -\parskip\fi
4271 % \end{macrocode}
4272 % Typesetting ends here.
4273 % \begin{macrocode}
4274 \outputpenalty \z@
4275 \@inserttrue
4276 %<*trace>
4277 \else
4278 \fl@trace{Fail---no room at 2nd test of colroom
4279 (addtocorcol \string\intextsep)}%
4280 %</trace>
4281 \fi
4282 \fi
4283 \if@insert
4284 \else
4285 % \end{macrocode}
4286 % Next set of docstrip guards are a bit weird, essentially
4287 % |\@addtotoporbot| ends up inside the kernel and the
4288 % \texttt{fltrace} package and |\@addtobot| shows up in the
4289 % \texttt{flafter} package. Guess that could have been done a bit
4290 % more obvious :-)
4291 % \begin{macrocode}
4292 %<*2ekernel|fltrace|latexrelease>
4293 %<*trace>
4294 \fl@trace{not here: sent to addtotoporbot}%
4295 %</trace>
4296 \@addtotoporbot
4297 %</2ekernel|fltrace|latexrelease>
4298 %<*!2ekernel&!fltrace&!latexrelease>
4299 %<*trace>
4300 \fl@trace{not here: sent to addtobot}%
4301 %</trace>
4302 \@addtobot
4303 %</!2ekernel&!fltrace&!latexrelease>
4304 \fi
4305 \fi
4306 \fi
4307 %<*trace>
4308 \else
4309 \fl@trace{Fail: colnum = \the \@colnum:
4310 fpstype \the \@fpstype=ORD?}%
4311 \ifnum \@fpstype<\sixt@@n
4312 \fl@trace{ERROR: BANG float not successful (addtocurcol)}%
4313 \fi
4314 %</trace>
4315 \fi
4316 %<*trace>
4317 \else
4318 \fl@trace{Fail---no room: fl box ht: \the \ht \@currbox
4319 (addtocurcol)}%
4320 %</trace>
4321 \fi
4322 \fi
4323 \fi
4324 \if@insert
4325 \else
4326 \@resethfps
4327 %<*trace>
4328 \fl@trace{put on deferlist (addtocurcol)}%
4329 %</trace>
4330 \@cons\@deferlist\@currbox
4331 %<*trace>
4332 \fl@trace{deferlist: \@deferlist: (addtocurcol-after)}%
4333 %</trace>
4334 \fi
4335 }%
4336 %</2ekernel|latexrelease|fltrace|flafter>
4337 %<latexrelease|fltrace|flafter>\EndIncludeInRelease
4338 % \end{macrocode}
4339 % The rollback code is rather complicated as it has to account for
4340 % the fact that we roll back not just the kernel but also the
4341 % packages \pkg{flafter} and \pkg{fltrace}.
4342 % \begin{macrocode}
4343 %<latexrelease|fltrace|flafter>\IncludeInRelease{2015/01/01}%
4344 %<latexrelease|fltrace|flafter> {\@addtocurcol}{float order in 2-column}%
4345 %<latexrelease|fltrace|flafter>\def \@addtocurcol {%
4346 %<*trace>
4347 %<latexrelease|fltrace|flafter> \fl@trace{***Start addtocurcol}%
4348 %</trace>
4349 %<latexrelease|fltrace|flafter> \@insertfalse
4350 %<latexrelease|fltrace|flafter> \@setfloattypecounts
4351 %<latexrelease|fltrace|flafter> \ifnum \@fpstype=8
4352 %<*trace>
4353 %<latexrelease|fltrace|flafter> \fl@trace{fpstype !p only (addtocurcol): \the \@fpstype = 8?}%
4354 %</trace>
4355 %<latexrelease|fltrace|flafter> \else
4356 %<latexrelease|fltrace|flafter> \ifnum \@fpstype=24
4357 %<*trace>
4358 %<latexrelease|fltrace|flafter> \fl@trace{fpstype p only (addtocurcol): \the \@fpstype = 24?}%
4359 %</trace>
4360 %<latexrelease|fltrace|flafter> \else
4361 %<latexrelease|fltrace|flafter> \@flsettextmin
4362 %<*trace>
4363 %<latexrelease|fltrace|flafter> \fl@trace{textfloatsheight (before) = \the \@textfloatsheight}%
4364 %</trace>
4365 %<latexrelease|fltrace|flafter> \advance \@textmin \@textfloatsheight
4366 %<latexrelease|fltrace|flafter> \@reqcolroom \@pageht
4367 %<*trace>
4368 %<latexrelease|fltrace|flafter> \fl@trace{textmin + textfloatsheight: \the \@textmin}%
4369 %<latexrelease|fltrace|flafter> \fl@trace{page-so-far: \the \@reqcolroom}%
4370 %</trace>
4371 %<latexrelease|fltrace|flafter> \ifdim \@textmin>\@reqcolroom
4372 %<latexrelease|fltrace|flafter> \@reqcolroom \@textmin
4373 %<*trace>
4374 %<latexrelease|fltrace|flafter> \fl@trace{ORD? textmin being used}%
4375 %</trace>
4376 %<latexrelease|fltrace|flafter> \fi
4377 %<latexrelease|fltrace|flafter> \advance \@reqcolroom \ht\@currbox
4378 %<*trace>
4379 %<latexrelease|fltrace|flafter> \fl@trace{float size = \the \ht \@currbox (addtocurcol)}%
4380 %<latexrelease|fltrace|flafter> \fl@trace{colroom = \the \@colroom (addtocurcol)}%
4381 %<latexrelease|fltrace|flafter> \fl@trace{reqcolroom = \the \@reqcolroom (addtocurcol)}%
4382 %</trace>
4383 %<latexrelease|fltrace|flafter> \ifdim \@colroom>\@reqcolroom
4384 %<latexrelease|fltrace|flafter> \@flsetnum \@colnum
4385 %<latexrelease|fltrace|flafter> \ifnum \@colnum>\z@
4386 %<latexrelease|fltrace|flafter> \@bitor\@currtype\@deferlist
4387 %<latexrelease|fltrace|flafter> \@testwrongwidth\@currbox
4388 %<*trace>
4389 %<latexrelease|fltrace|flafter> \fl@trace{deferlist: \@deferlist: (addtocurcol-before)}%
4390 %</trace>
4391 %<latexrelease|fltrace|flafter> \if@test
4392 %<*trace>
4393 %<latexrelease|fltrace|flafter> \fl@trace{type already on list: defer (addtocurcol)}%
4394 %</trace>
4395 %<latexrelease|fltrace|flafter> \else
4396 %<latexrelease|fltrace|flafter> \@bitor\@currtype\@botlist
4397 %<*trace>
4398 %<latexrelease|fltrace|flafter> \fl@trace{botlist: \@botlist: (addtocurcol-before)}%
4399 %</trace>
4400 %<latexrelease|fltrace|flafter> \if@test
4401 %<*trace>
4402 %<latexrelease|fltrace|flafter> \fl@trace{type already on list: bot---sent to addtobot}%
4403 %</trace>
4404 %<latexrelease|fltrace|flafter> \@addtobot
4405 %<latexrelease|fltrace|flafter> \else
4406 %<*trace>
4407 %<latexrelease|fltrace|flafter> \fl@trace{fpstype \ifodd \@tempcnta OK \else not \fi
4408 %<latexrelease|fltrace|flafter> here: \the \@fpstype}%
4409 %</trace>
4410 %<latexrelease|fltrace|flafter> \ifodd \count\@currbox
4411 %<latexrelease|fltrace|flafter> \advance \@reqcolroom \intextsep
4412 %<latexrelease|fltrace|flafter> \ifdim \@colroom>\@reqcolroom
4413 %<latexrelease|fltrace|flafter> \global \advance \@colnum \m@ne
4414 %<latexrelease|fltrace|flafter> \global \advance \@textfloatsheight \ht\@currbox
4415 %<latexrelease|fltrace|flafter> \global \advance \@textfloatsheight 2\intextsep
4416 %<latexrelease|fltrace|flafter> \@cons \@midlist \@currbox
4417 %<*trace>
4418 %<latexrelease|fltrace|flafter> \fl@trace{***Success: here}%
4419 %<latexrelease|fltrace|flafter> \fl@trace{textfloatsheight (after-here) =
4420 %<latexrelease|fltrace|flafter> \the \@textfloatsheight}%
4421 %<latexrelease|fltrace|flafter> \fl@trace{colnum (after-here) = \the \@colnum}%
4422 %</trace>
4423 %<latexrelease|fltrace|flafter> \if@nobreak
4424 %<latexrelease|fltrace|flafter> \nobreak
4425 %<latexrelease|fltrace|flafter> \@nobreakfalse
4426 %<latexrelease|fltrace|flafter> \everypar{}%
4427 %<latexrelease|fltrace|flafter> \else
4428 %<latexrelease|fltrace|flafter> \addpenalty \interlinepenalty
4429 %<latexrelease|fltrace|flafter> \fi
4430 %<latexrelease|fltrace|flafter> \vskip \intextsep
4431 %<latexrelease|fltrace|flafter> \box\@currbox
4432 %<latexrelease|fltrace|flafter> \penalty\interlinepenalty
4433 %<latexrelease|fltrace|flafter> \vskip\intextsep
4434 %<latexrelease|fltrace|flafter> \ifnum\outputpenalty <-\@Mii \vskip -\parskip\fi
4435 %<latexrelease|fltrace|flafter> \outputpenalty \z@
4436 %<latexrelease|fltrace|flafter> \@inserttrue
4437 %<*trace>
4438 %<latexrelease|fltrace|flafter> \else
4439 %<latexrelease|fltrace|flafter> \fl@trace{Fail---no room at 2nd test of colroom
4440 %<latexrelease|fltrace|flafter> (addtocorcol \string\intextsep)}%
4441 %</trace>
4442 %<latexrelease|fltrace|flafter> \fi
4443 %<latexrelease|fltrace|flafter> \fi
4444 %<latexrelease|fltrace|flafter> \if@insert
4445 %<latexrelease|fltrace|flafter> \else
4446 %<*trace>
4447 %<fltrace|latexrelease> \fl@trace{not here: sent to addtotoporbot}%
4448 %</trace>
4449 %<fltrace|latexrelease> \@addtotoporbot
4450 %<*trace>
4451 %<flafter> \fl@trace{not here: sent to addtobot}%
4452 %</trace>
4453 %<flafter> \@addtobot
4454 %<latexrelease|fltrace|flafter> \fi
4455 %<latexrelease|fltrace|flafter> \fi
4456 %<latexrelease|fltrace|flafter> \fi
4457 %<*trace>
4458 %<latexrelease|fltrace|flafter> \else
4459 %<latexrelease|fltrace|flafter> \fl@trace{Fail: colnum = \the \@colnum:
4460 %<latexrelease|fltrace|flafter> fpstype \the \@fpstype=ORD?}%
4461 %<latexrelease|fltrace|flafter> \ifnum \@fpstype<\sixt@@n
4462 %<latexrelease|fltrace|flafter> \fl@trace{ERROR: BANG float not successful (addtocurcol)}%
4463 %<latexrelease|fltrace|flafter> \fi
4464 %</trace>
4465 %<latexrelease|fltrace|flafter> \fi
4466 %<*trace>
4467 %<latexrelease|fltrace|flafter> \else
4468 %<latexrelease|fltrace|flafter> \fl@trace{Fail---no room: fl box ht: \the \ht \@currbox
4469 %<latexrelease|fltrace|flafter> (addtocurcol)}%
4470 %</trace>
4471 %<latexrelease|fltrace|flafter> \fi
4472 %<latexrelease|fltrace|flafter> \fi
4473 %<latexrelease|fltrace|flafter> \fi
4474 %<latexrelease|fltrace|flafter> \if@insert
4475 %<latexrelease|fltrace|flafter> \else
4476 %<latexrelease|fltrace|flafter> \@resethfps
4477 %<*trace>
4478 %<latexrelease|fltrace|flafter> \fl@trace{put on deferlist (addtocurcol)}%
4479 %</trace>
4480 %<latexrelease|fltrace|flafter> \@cons\@deferlist\@currbox
4481 %<*trace>
4482 %<latexrelease|fltrace|flafter> \fl@trace{deferlist: \@deferlist: (addtocurcol-after)}%
4483 %</trace>
4484 %<latexrelease|fltrace|flafter> \fi
4485 %<latexrelease|fltrace|flafter>}%
4486 % \end{macrocode}
4487 %
4488 % \begin{macrocode}
4489 %<latexrelease|fltrace|flafter>\EndIncludeInRelease
4490 %<latexrelease|fltrace|flafter>\IncludeInRelease{0000/00/00}%
4491 %<latexrelease|fltrace|flafter> {\@addtocurcol}{float order in 2-column}%
4492 %<latexrelease|fltrace|flafter>\def \@addtocurcol {%
4493 %<*trace>
4494 %<latexrelease|fltrace|flafter> \fl@trace{***Start addtocurcol}%
4495 %</trace>
4496 %<latexrelease|fltrace|flafter> \@insertfalse
4497 %<latexrelease|fltrace|flafter> \@setfloattypecounts
4498 %<latexrelease|fltrace|flafter> \ifnum \@fpstype=8
4499 %<*trace>
4500 %<latexrelease|fltrace|flafter> \fl@trace{fpstype !p only (addtocurcol):
4501 %<latexrelease|fltrace|flafter> \the \@fpstype = 8?}%
4502 %</trace>
4503 %<latexrelease|fltrace|flafter> \else
4504 %<latexrelease|fltrace|flafter> \ifnum \@fpstype=24
4505 %<*trace>
4506 %<latexrelease|fltrace|flafter> \fl@trace{fpstype p only (addtocurcol):
4507 %<latexrelease|fltrace|flafter> \the \@fpstype = 24?}%
4508 %</trace>
4509 %<latexrelease|fltrace|flafter> \else
4510 %<latexrelease|fltrace|flafter> \@flsettextmin
4511 % \end{macrocode}
4512 % This is a new adjustment which is quite a major change in
4513 % functionality; but it implements the documentation.
4514 % Note that |\@reqcolroom| will include the whole of the
4515 % page-so-far, and hence includes |\@textfloatsheight| of floats,
4516 % so before comparing it with |\@textmin|, we add this to
4517 % |\@textmin| also.
4518 % \begin{macrocode}
4519 %<*trace>
4520 %<latexrelease|fltrace|flafter> \fl@trace{textfloatsheight (before) =
4521 %<latexrelease|fltrace|flafter> \the \@textfloatsheight}%
4522 %</trace>
4523 %<latexrelease|fltrace|flafter> \advance \@textmin \@textfloatsheight
4524 %<latexrelease|fltrace|flafter> \@reqcolroom \@pageht
4525 % \end{macrocode}
4526 % This line must be removed since |\@specialoutput| changed.
4527 % \begin{macrocode}
4528 % \advance \@reqcolroom \@pagedp
4529 %<*trace>
4530 %<latexrelease|fltrace|flafter> \fl@trace{textmin + textfloatsheight:
4531 %<latexrelease|fltrace|flafter> \the \@textmin}%
4532 %<latexrelease|fltrace|flafter> \fl@trace{page-so-far: \the \@reqcolroom}%
4533 %<latexrelease|fltrace|flafter>
4534 %</trace>
4535 %<latexrelease|fltrace|flafter> \ifdim \@textmin>\@reqcolroom
4536 %<latexrelease|fltrace|flafter> \@reqcolroom \@textmin
4537 %<*trace>
4538 %<latexrelease|fltrace|flafter> \fl@trace{ORD? textmin being used}%
4539 %</trace>
4540 %<latexrelease|fltrace|flafter> \fi
4541 %<latexrelease|fltrace|flafter> \advance \@reqcolroom \ht\@currbox
4542 %<*trace>
4543 %<latexrelease|fltrace|flafter> \fl@trace{float size =
4544 %<latexrelease|fltrace|flafter> \the \ht \@currbox (addtocurcol)}%
4545 %<latexrelease|fltrace|flafter> \fl@trace{colroom =
4546 %<latexrelease|fltrace|flafter> \the \@colroom (addtocurcol)}%
4547 %<latexrelease|fltrace|flafter> \fl@trace{reqcolroom =
4548 %<latexrelease|fltrace|flafter> \the \@reqcolroom (addtocurcol)}%
4549 %</trace>
4550 %<latexrelease|fltrace|flafter> \ifdim \@colroom>\@reqcolroom
4551 %<latexrelease|fltrace|flafter> \@flsetnum \@colnum
4552 %<latexrelease|fltrace|flafter> \ifnum \@colnum>\z@
4553 %<latexrelease|fltrace|flafter> \@bitor\@currtype\@deferlist
4554 %<*trace>
4555 %<latexrelease|fltrace|flafter> \fl@trace{deferlist:
4556 %<latexrelease|fltrace|flafter> \@deferlist: (addtocurcol-before)}%
4557 %</trace>
4558 %<latexrelease|fltrace|flafter> \if@test
4559 %<*trace>
4560 %<latexrelease|fltrace|flafter> \fl@trace{type already on list:
4561 %<latexrelease|fltrace|flafter> defer (addtocurcol)}%
4562 %</trace>
4563 %<latexrelease|fltrace|flafter> \else
4564 %<latexrelease|fltrace|flafter> \@bitor\@currtype\@botlist
4565 %<*trace>
4566 %<latexrelease|fltrace|flafter> \fl@trace{botlist: \@botlist:
4567 %<latexrelease|fltrace|flafter> (addtocurcol-before)}%
4568 %</trace>
4569 %<latexrelease|fltrace|flafter> \if@test
4570 %<*trace>
4571 %<latexrelease|fltrace|flafter> \fl@trace{type already on list:
4572 %<latexrelease|fltrace|flafter> bot---sent to addtobot}%
4573 %</trace>
4574 %<latexrelease|fltrace|flafter> \@addtobot
4575 %<latexrelease|fltrace|flafter> \else
4576 %<*trace>
4577 %<latexrelease|fltrace|flafter> \fl@trace{fpstype
4578 %<latexrelease|fltrace|flafter> \ifodd \@tempcnta OK \else not \fi
4579 %<latexrelease|fltrace|flafter> here: \the \@fpstype}%
4580 %</trace>
4581 %<latexrelease|fltrace|flafter> \ifodd \count\@currbox
4582 %<latexrelease|fltrace|flafter> \advance \@reqcolroom \intextsep
4583 %<latexrelease|fltrace|flafter> \ifdim \@colroom>\@reqcolroom
4584 %<latexrelease|fltrace|flafter> \global \advance \@colnum \m@ne
4585 %<latexrelease|fltrace|flafter> \global \advance
4586 %<latexrelease|fltrace|flafter> \@textfloatsheight\ht\@currbox
4587 % \end{macrocode}
4588 % This may sometimes give an overestimate.
4589 % \begin{macrocode}
4590 %<latexrelease|fltrace|flafter> \global \advance
4591 %<latexrelease|fltrace|flafter> \@textfloatsheight 2\intextsep
4592 %<latexrelease|fltrace|flafter> \@cons \@midlist \@currbox
4593 %<*trace>
4594 %<latexrelease|fltrace|flafter> \fl@trace{***Success: here}%
4595 %<latexrelease|fltrace|flafter> \fl@trace{textfloatsheight
4596 %<latexrelease|fltrace|flafter> (after-here) =
4597 %<latexrelease|fltrace|flafter> \the \@textfloatsheight}%
4598 %<latexrelease|fltrace|flafter> \fl@trace{colnum (after-here) =
4599 %<latexrelease|fltrace|flafter> \the \@colnum}%
4600 %</trace>
4601 % \end{macrocode}
4602 %
4603 % CHANGE TO |\@addtocurcol|:
4604 %
4605 % |\penalty\z@| changed to |\penalty\interlinepenalty| so |\samepage|
4606 % works properly with figure and table environments.
4607 % (Changed 23 Oct 86)
4608 %
4609 % There is also an |\addpenalty\interlinepenalty| above.
4610 %
4611 % Although it is best to use |\addvspace| in case two h floats come
4612 % together, this makes other spacing more difficult to adjust; whereas
4613 % if a user specifies two h floats together then they can more easily
4614 % get the spacing correct by ad hoc commands.
4615 %
4616 % It is necessary to adjust for the addition of |\parskip| here in
4617 % case the float is added between paragraphs (\ie when in vertical
4618 % mode).
4619 %
4620 % If the nobreak switch is true we need to reset it and clear
4621 % |\everypar| since the float may not reset the flag and cannot reset
4622 % the |\everypar| globally.
4623 % \changes{v1.0l}{1994/03/15}{Changed \cs{addvspace} to \cs{vskip}}
4624 % \changes{v1.1i}{1994/11/21}
4625 % {Added \cs{if@nobreak} test before float box}
4626 % \changes{v1.1z}{1996/10/24}{Added \cs{nobreak}, etc as appropriate}
4627 %
4628 % Typesetting starts here (we are in vertical mode).
4629 % \begin{macrocode}
4630 %<latexrelease|fltrace|flafter> \if@nobreak
4631 %<latexrelease|fltrace|flafter> \nobreak
4632 %<latexrelease|fltrace|flafter> \@nobreakfalse
4633 %<latexrelease|fltrace|flafter> \everypar{}%
4634 %<latexrelease|fltrace|flafter> \else
4635 %<latexrelease|fltrace|flafter> \addpenalty\interlinepenalty
4636 %<latexrelease|fltrace|flafter> \fi
4637 %<latexrelease|fltrace|flafter> \vskip \intextsep
4638 %<latexrelease|fltrace|flafter> \box\@currbox
4639 %<latexrelease|fltrace|flafter> \penalty\interlinepenalty
4640 %<latexrelease|fltrace|flafter> \vskip\intextsep
4641 %<latexrelease|fltrace|flafter> \ifnum\outputpenalty
4642 %<latexrelease|fltrace|flafter> <-\@Mii \vskip
4643 %<latexrelease|fltrace|flafter> -\parskip\fi
4644 % \end{macrocode}
4645 % Typesetting ends here.
4646 % \begin{macrocode}
4647 %<latexrelease|fltrace|flafter> \outputpenalty \z@
4648 %<latexrelease|fltrace|flafter> \@inserttrue
4649 %<*trace>
4650 %<latexrelease|fltrace|flafter> \else
4651 %<latexrelease|fltrace|flafter> \fl@trace{Fail---no room at 2nd test of colroom
4652 %<latexrelease|fltrace|flafter> (addtocorcol \string\intextsep)}%
4653 %</trace>
4654 %<latexrelease|fltrace|flafter> \fi
4655 %<latexrelease|fltrace|flafter> \fi
4656 %<latexrelease|fltrace|flafter> \if@insert
4657 %<latexrelease|fltrace|flafter> \else
4658 % \end{macrocode}
4659 % Next set of docstrip guards are a bit weird, essentially
4660 % |\@addtotoporbot| ends up inside the kernel and the
4661 % \texttt{fltrace} package and |\@addtotoporbot| shows up in the
4662 % \texttt{flafter} package. Guess that could have been done a bit
4663 % more obvious :-)
4664 % \begin{macrocode}
4665 %<*2ekernel|fltrace>
4666 %<*trace>
4667 %<latexrelease|fltrace|flafter> \fl@trace{not here: sent to addtotoporbot}%
4668 %</trace>
4669 %<latexrelease|fltrace|flafter> \@addtotoporbot
4670 %</2ekernel|fltrace>
4671 %<*!2ekernel&!autoload&!fltrace>
4672 %<*trace>
4673 %<latexrelease|fltrace|flafter> \fl@trace{not here: sent to addtobot}%
4674 %</trace>
4675 %<latexrelease|fltrace|flafter> \@addtobot
4676 %</!2ekernel&!autoload&!fltrace>
4677 %<latexrelease|fltrace|flafter> \fi
4678 %<latexrelease|fltrace|flafter> \fi
4679 %<latexrelease|fltrace|flafter> \fi
4680 %<*trace>
4681 %<latexrelease|fltrace|flafter> \else
4682 %<latexrelease|fltrace|flafter> \fl@trace{Fail: colnum = \the \@colnum:
4683 %<latexrelease|fltrace|flafter> fpstype \the \@fpstype=ORD?}%
4684 %<latexrelease|fltrace|flafter> \ifnum \@fpstype<\sixt@@n
4685 %<latexrelease|fltrace|flafter> \fl@trace{ERROR: BANG float not successful
4686 %<latexrelease|fltrace|flafter> (addtocurcol)}%
4687 %<latexrelease|fltrace|flafter> \fi
4688 %</trace>
4689 %<latexrelease|fltrace|flafter> \fi
4690 %<*trace>
4691 %<latexrelease|fltrace|flafter> \else
4692 %<latexrelease|fltrace|flafter> \fl@trace{Fail---no room: fl box ht:
4693 %<latexrelease|fltrace|flafter> \the \ht \@currbox (addtocurcol)}%
4694 %</trace>
4695 %<latexrelease|fltrace|flafter> \fi
4696 %<latexrelease|fltrace|flafter> \fi
4697 %<latexrelease|fltrace|flafter> \fi
4698 %<latexrelease|fltrace|flafter> \if@insert
4699 %<latexrelease|fltrace|flafter> \else
4700 %<latexrelease|fltrace|flafter> \@resethfps
4701 %<*trace>
4702 %<latexrelease|fltrace|flafter> \fl@trace{put on deferlist (addtocurcol)}%
4703 %</trace>
4704 %<latexrelease|fltrace|flafter> \@cons\@deferlist\@currbox
4705 %<*trace>
4706 %<latexrelease|fltrace|flafter> \fl@trace{deferlist: \@deferlist:
4707 %<latexrelease|fltrace|flafter> (addtocurcol-after)}%
4708 %</trace>
4709 %<latexrelease|fltrace|flafter> \fi
4710 %<latexrelease|fltrace|flafter> }%
4711 %<latexrelease|fltrace|flafter>\EndIncludeInRelease
4712 % \end{macrocode}
4713 % \end{macro}
4714 %
4715 % \begin{macro}{\@addtonextcol}
4716 % \changes{v1.0f}{1993/12/05}{Command changed}
4717 % Lots of changes.
4718 %
4719 % \changes{v1.2n}{2015/01/14}{float order in 2-column (latexrelease)}
4720 % \changes{v1.4b}{2017/12/17}{fix doc guards}
4721 % \begin{macrocode}
4722 %<latexrelease|fltrace>\IncludeInRelease{2025/06/01}
4723 %<latexrelease|fltrace> {\@addtonextcol}{float order in 2-column}%
4724 %<*2ekernel|latexrelease|fltrace>
4725 \def\@addtonextcol{%
4726 \begingroup
4727 %<*trace>
4728 \fl@trace{***Start addtonextcol}%
4729 %</trace>
4730 \@insertfalse
4731 \@setfloattypecounts
4732 \ifnum \@fpstype=8
4733 %<*trace>
4734 \fl@trace{fpstype not curcol: \the \@fpstype = 8?}%
4735 %</trace>
4736 \else
4737 \ifnum \@fpstype=24
4738 %<*trace>
4739 \fl@trace{fpstype not curcol: \the \@fpstype = 24?}%
4740 %</trace>
4741 \else
4742 \@flsettextmin
4743 %<*trace>
4744 \fl@trace{text-so-far: 0pt (top of col)}%
4745 %</trace>
4746 \@reqcolroom \ht\@currbox
4747 %<*trace>
4748 \fl@trace{float size: \the \@reqcolroom (addtonextcol)}%
4749 %</trace>
4750 \advance \@reqcolroom \@textmin
4751 % \end{macrocode}
4752 %
4753 % \changes{v1.4n}{2025/01/29}{Save current value of \cs{@reqcolroom} (gh/1645)}
4754 % \begin{macrocode}
4755 \saved@reqcolroom \@reqcolroom
4756 %<*trace>
4757 \fl@trace{colroom = \the \@colroom (addtonextcol)}%
4758 \fl@trace{reqcolroom = \the \@reqcolroom (addtonextcol)}%
4759 %</trace>
4760 \ifdim \@colroom>\@reqcolroom
4761 \@flsetnum \@colnum
4762 \ifnum\@colnum>\z@
4763 \@bitor\@currtype\@deferlist
4764 %<*trace>
4765 \fl@trace{deferlist: \@deferlist: (addtonextcol-before)}%
4766 %</trace>
4767 % \end{macrocode}
4768 %
4769 % \begin{macrocode}
4770 \@testwrongwidth\@currbox
4771 % \end{macrocode}
4772 %
4773 % \begin{macrocode}
4774 \if@test
4775 %<*trace>
4776 \fl@trace{type already on list: defer (addtonextcol)}%
4777 %</trace>
4778 \else
4779 %<*trace>
4780 \fl@trace{sent to addtotoporbot (addtonextcol)}%
4781 %</trace>
4782 \@addtotoporbot
4783 \fi
4784 \fi
4785 %<*trace>
4786 \else
4787 \fl@trace{Fail---no room: fl box ht: \the \ht \@currbox
4788 (addtonextcol)}%
4789 %</trace>
4790 \fi
4791 \fi
4792 \fi
4793 \if@insert
4794 \else
4795 %<*trace>
4796 \fl@trace{put back on deferlist (addtonextcol)}%
4797 %</trace>
4798 \@cons\@deferlist\@currbox
4799 %<*trace>
4800 \fl@trace{deferlist: \@deferlist: (addtonextcol-after)}%
4801 %</trace>
4802 \fi
4803 %<*trace>
4804 \fl@trace{End of addtonextcol -- locally counts:}%
4805 \fl@trace{col: \the\@colnum. top: \the \@topnum. bot: \the \@botnum.}%
4806 %</trace>
4807 \endgroup
4808 %<*trace>
4809 \fl@trace{End of addtonextcol -- globally counts:}%
4810 \fl@trace{col: \the\@colnum. top: \the \@topnum. bot: \the \@botnum.}%
4811 %</trace>
4812 }%
4813 %</2ekernel|latexrelease|fltrace>
4814 %<latexrelease|fltrace>\EndIncludeInRelease
4815 % \end{macrocode}
4816 %
4817 % \begin{macrocode}
4818 %<latexrelease|fltrace>\IncludeInRelease{2015/01/01}
4819 %<latexrelease|fltrace> {\@addtonextcol}{float order in 2-column}%
4820 %<latexrelease|fltrace>\def\@addtonextcol{%
4821 %<latexrelease|fltrace> \begingroup
4822 %<*trace>
4823 %<latexrelease|fltrace> \fl@trace{***Start addtonextcol}%
4824 %</trace>
4825 %<latexrelease|fltrace> \@insertfalse
4826 %<latexrelease|fltrace> \@setfloattypecounts
4827 %<latexrelease|fltrace> \ifnum \@fpstype=8
4828 %<*trace>
4829 %<latexrelease|fltrace> \fl@trace{fpstype not curcol: \the \@fpstype = 8?}%
4830 %</trace>
4831 %<latexrelease|fltrace> \else
4832 %<latexrelease|fltrace> \ifnum \@fpstype=24
4833 %<*trace>
4834 %<latexrelease|fltrace> \fl@trace{fpstype not curcol: \the \@fpstype = 24?}%
4835 %</trace>
4836 %<latexrelease|fltrace> \else
4837 %<latexrelease|fltrace> \@flsettextmin
4838 %<*trace>
4839 %<latexrelease|fltrace> \fl@trace{text-so-far: 0pt (top of col)}%
4840 %</trace>
4841 %<latexrelease|fltrace> \@reqcolroom \ht\@currbox
4842 %<*trace>
4843 %<latexrelease|fltrace> \fl@trace{float size: \the \@reqcolroom (addtonextcol)}%
4844 %</trace>
4845 %<latexrelease|fltrace> \advance \@reqcolroom \@textmin
4846 %<*trace>
4847 %<latexrelease|fltrace> \fl@trace{colroom = \the \@colroom (addtonextcol)}%
4848 %<latexrelease|fltrace> \fl@trace{reqcolroom = \the \@reqcolroom (addtonextcol)}%
4849 %</trace>
4850 %<latexrelease|fltrace> \ifdim \@colroom>\@reqcolroom
4851 %<latexrelease|fltrace> \@flsetnum \@colnum
4852 %<latexrelease|fltrace> \ifnum\@colnum>\z@
4853 %<latexrelease|fltrace> \@bitor\@currtype\@deferlist
4854 %<*trace>
4855 %<latexrelease|fltrace> \fl@trace{deferlist: \@deferlist: (addtonextcol-before)}%
4856 %</trace>
4857 %<latexrelease|fltrace> \@testwrongwidth\@currbox
4858 %<latexrelease|fltrace> \if@test
4859 %<*trace>
4860 %<latexrelease|fltrace> \fl@trace{type already on list: defer (addtonextcol)}%
4861 %</trace>
4862 %<latexrelease|fltrace> \else
4863 %<*trace>
4864 %<latexrelease|fltrace> \fl@trace{sent to addtotoporbot (addtonextcol)}%
4865 %</trace>
4866 %<latexrelease|fltrace> \@addtotoporbot
4867 %<latexrelease|fltrace> \fi
4868 %<latexrelease|fltrace> \fi
4869 %<*trace>
4870 %<latexrelease|fltrace> \else
4871 %<latexrelease|fltrace> \fl@trace{Fail---no room: fl box ht: \the \ht \@currbox
4872 %<latexrelease|fltrace> (addtonextcol)}%
4873 %</trace>
4874 %<latexrelease|fltrace> \fi
4875 %<latexrelease|fltrace> \fi
4876 %<latexrelease|fltrace> \fi
4877 %<latexrelease|fltrace> \if@insert
4878 %<latexrelease|fltrace> \else
4879 %<*trace>
4880 %<latexrelease|fltrace> \fl@trace{put back on deferlist (addtonextcol)}%
4881 %</trace>
4882 %<latexrelease|fltrace> \@cons\@deferlist\@currbox
4883 %<*trace>
4884 %<latexrelease|fltrace> \fl@trace{deferlist: \@deferlist: (addtonextcol-after)}%
4885 %</trace>
4886 %<latexrelease|fltrace> \fi
4887 %<*trace>
4888 %<latexrelease|fltrace> \fl@trace{End of addtonextcol -- locally counts:}%
4889 %<latexrelease|fltrace> \fl@trace{col: \the\@colnum. top: \the \@topnum. bot: \the \@botnum.}%
4890 %</trace>
4891 %<latexrelease|fltrace> \endgroup
4892 %<*trace>
4893 %<latexrelease|fltrace> \fl@trace{End of addtonextcol -- globally counts:}%
4894 %<latexrelease|fltrace> \fl@trace{col: \the\@colnum. top: \the \@topnum. bot: \the \@botnum.}%
4895 %</trace>
4896 %<latexrelease|fltrace>}%
4897 %<latexrelease|fltrace>\EndIncludeInRelease
4898 % \end{macrocode}
4899 %
4900 % \begin{macrocode}
4901 %<latexrelease|fltrace>\IncludeInRelease{0000/00/00}%
4902 %<latexrelease|fltrace> {\@addtonextcol}{float order in 2-column}%
4903 %<latexrelease|fltrace>\def\@addtonextcol{%
4904 %<latexrelease|fltrace> \begingroup
4905 %<*trace>
4906 %<latexrelease|fltrace> \fl@trace{***Start addtonextcol}%
4907 %</trace>
4908 %<latexrelease|fltrace> \@insertfalse
4909 %<latexrelease|fltrace> \@setfloattypecounts
4910 %<latexrelease|fltrace> \ifnum \@fpstype=8
4911 %<*trace>
4912 %<latexrelease|fltrace> \fl@trace{fpstype not curcol:
4913 %<latexrelease|fltrace> \the \@fpstype = 8?}%
4914 %</trace>
4915 %<latexrelease|fltrace> \else
4916 %<latexrelease|fltrace> \ifnum \@fpstype=24
4917 %<*trace>
4918 %<latexrelease|fltrace> \fl@trace{fpstype not curcol:
4919 %<latexrelease|fltrace> \the \@fpstype = 24?}%
4920 %</trace>
4921 %<latexrelease|fltrace> \else
4922 %<latexrelease|fltrace> \@flsettextmin
4923 %<*trace>
4924 %<latexrelease|fltrace> \fl@trace{text-so-far: 0pt (top of col)}%
4925 %</trace>
4926 %<latexrelease|fltrace> \@reqcolroom \ht\@currbox
4927 %<*trace>
4928 %<latexrelease|fltrace> \fl@trace{float size:
4929 %<latexrelease|fltrace> \the \@reqcolroom (addtonextcol)}%
4930 %<latexrelease|fltrace>
4931 %</trace>
4932 %<latexrelease|fltrace> \advance \@reqcolroom \@textmin
4933 %<*trace>
4934 %<latexrelease|fltrace> \fl@trace{colroom =
4935 %<latexrelease|fltrace> \the \@colroom (addtonextcol)}%
4936 %<latexrelease|fltrace> \fl@trace{reqcolroom =
4937 %<latexrelease|fltrace> \the \@reqcolroom (addtonextcol)}%
4938 %</trace>
4939 %<latexrelease|fltrace> \ifdim \@colroom>\@reqcolroom
4940 %<latexrelease|fltrace> \@flsetnum \@colnum
4941 %<latexrelease|fltrace> \ifnum\@colnum>\z@
4942 %<latexrelease|fltrace> \@bitor\@currtype\@deferlist
4943 %<*trace>
4944 %<latexrelease|fltrace> \fl@trace{deferlist: \@deferlist:
4945 %<latexrelease|fltrace> (addtonextcol-before)}%
4946 %</trace>
4947 %<latexrelease|fltrace> \if@test
4948 %<*trace>
4949 %<latexrelease|fltrace> \fl@trace{type already on list:
4950 %<latexrelease|fltrace> defer (addtonextcol)}%
4951 %</trace>
4952 %<latexrelease|fltrace> \else
4953 %<*trace>
4954 %<latexrelease|fltrace> \fl@trace{sent to addtotoporbot
4955 %<latexrelease|fltrace> (addtonextcol)}%
4956 %</trace>
4957 %<latexrelease|fltrace> \@addtotoporbot
4958 %<latexrelease|fltrace> \fi
4959 %<latexrelease|fltrace> \fi
4960 %<*trace>
4961 %<latexrelease|fltrace> \else
4962 %<latexrelease|fltrace> \fl@trace{Fail---no room: fl box ht:
4963 %<latexrelease|fltrace> \the \ht \@currbox (addtonextcol)}%
4964 %</trace>
4965 %<latexrelease|fltrace> \fi
4966 %<latexrelease|fltrace> \fi
4967 %<latexrelease|fltrace> \fi
4968 %<latexrelease|fltrace> \if@insert
4969 %<latexrelease|fltrace> \else
4970 %<*trace>
4971 %<latexrelease|fltrace> \fl@trace{put back on deferlist
4972 %<latexrelease|fltrace> (addtonextcol)}%
4973 %</trace>
4974 %<latexrelease|fltrace> \@cons\@deferlist\@currbox
4975 %<*trace>
4976 %<latexrelease|fltrace> \fl@trace{deferlist: \@deferlist:
4977 %<latexrelease|fltrace> (addtonextcol-after)}%
4978 %</trace>
4979 %<latexrelease|fltrace> \fi
4980 %<*trace>
4981 %<latexrelease|fltrace> \fl@trace{End of addtonextcol --
4982 %<latexrelease|fltrace> locally counts:}%
4983 %<latexrelease|fltrace> \fl@trace{col: \the \@colnum.
4984 %<latexrelease|fltrace> top: \the \@topnum. bot: \the \@botnum.}%
4985 %</trace>
4986 %<latexrelease|fltrace> \endgroup
4987 %<*trace>
4988 %<latexrelease|fltrace> \fl@trace{End of addtonextcol --
4989 %<latexrelease|fltrace> globally counts:}%
4990 %<latexrelease|fltrace> \fl@trace{col: \the \@colnum.
4991 %<latexrelease|fltrace> top: \the \@topnum. bot: \the \@botnum.}%
4992 %</trace>
4993 %<latexrelease|fltrace>}%
4994 %<latexrelease|fltrace>\EndIncludeInRelease
4995 % \end{macrocode}
4996 %
4997 % \end{macro}
4998 %
4999 % \begin{macro}{\@addtodblcol}
5000 % \changes{v1.0f}{1993/12/05}{Command changed}
5001 % Lots of changes.
5002 %
5003 % \changes{v1.2n}{2015/01/14}{float order in 2-column (latexrelease)}
5004 % \begin{macrocode}
5005 %<latexrelease|fltrace>\IncludeInRelease{2015/01/01}%
5006 %<latexrelease|fltrace> {\@addtodblcol}{float order in 2-column}%
5007 %<*2ekernel|latexrelease|fltrace>
5008 \def\@addtodblcol{%
5009 \begingroup
5010 %<*trace>
5011 \fl@trace{***Start addtodblcol}%
5012 %</trace>
5013 \@insertfalse
5014 \@setfloattypecounts
5015 \@getfpsbit \tw@
5016 %<*trace>
5017 \fl@trace{fpstype \ifodd \@tempcnta OK \else not \fi dbltop:
5018 \the \@fpstype}%
5019 %</trace>
5020 \ifodd\@tempcnta
5021 \@flsetnum \@dbltopnum
5022 \ifnum \@dbltopnum>\z@
5023 \@tempswafalse
5024 \ifdim \@dbltoproom>\ht\@currbox
5025 \@tempswatrue
5026 %<*trace>
5027 \fl@trace{Space OK: \@dbltoproom =
5028 \the \@dbltoproom > \the \ht \@currbox
5029 (dbltoproom)}%
5030 %</trace>
5031 \else
5032 %<*trace>
5033 \fl@trace{fpstype: \the \@fpstype (addtodblcol)}%
5034 %</trace>
5035 \ifnum \@fpstype<\sixt@@n
5036 %<*trace>
5037 \fl@trace{BANG float ignoring \@dbltoproom}%
5038 \fl@trace{\@spaces \@dbltoproom = \the \@dbltoproom.
5039 Ht float: \the \ht \@currbox-BANG}%
5040 %</trace>
5041 % \end{macrocode}
5042 % Need to check that there is room on the page, using the local value
5043 % of |\@textmin| to make the necessary adjustment to |\@dbltoproom|.
5044 % \begin{macrocode}
5045 \advance \@dbltoproom \@textmin
5046 %<*trace>
5047 \fl@trace{Local value of texmin: \the\@textmin}%
5048 \fl@trace{\@spaces space on page = \the \@dbltoproom.
5049 Ht float: \the \ht \@currbox-BANG}%
5050 %</trace>
5051 \ifdim \@dbltoproom>\ht\@currbox
5052 \@tempswatrue
5053 %<*trace>
5054 \fl@trace{Space OK BANG: space on page =
5055 \the \@dbltoproom > \the \ht \@currbox}%
5056 \else
5057 \fl@trace{fpstype: \the \@fpstype}%
5058 \fl@trace{Fail---no room dbltoproom-BANG?:}%
5059 \fl@trace{\@spaces space on page = \the \@dbltoproom.
5060 Ht float: \the \ht \@currbox}%
5061 %</trace>
5062 \fi
5063 \advance \@dbltoproom -\@textmin
5064 %<*trace>
5065 \else
5066 \fl@trace{fpstype: \the \@fpstype}%
5067 \fl@trace{Fail---no room dbltoproom-ORD?:}%
5068 \fl@trace{\@spaces \@dbltoproom = \the \@dbltoproom.
5069 Ht float: \the \ht \@currbox}%
5070 %</trace>
5071 \fi
5072 \fi
5073 \if@tempswa
5074 \@bitor \@currtype \@deferlist
5075 %<*trace>
5076 \fl@trace{(dbl)deferlist: \@deferlist: (before)}%
5077 %</trace>
5078 % \end{macrocode}
5079 %
5080 % not in fixfloats?
5081 % \begin{macrocode}
5082 \@testwrongwidth\@currbox
5083 % \end{macrocode}
5084 %
5085 % \begin{macrocode}
5086 \if@test
5087 %<*trace>
5088 \fl@trace{type already on list: (dbl)defer}%
5089 %</trace>
5090 \else
5091 \@tempdima -\ht\@currbox
5092 \advance\@tempdima
5093 -\ifx \@dbltoplist\@empty \dbltextfloatsep \else
5094 \dblfloatsep \fi
5095 \global \advance \@dbltoproom \@tempdima
5096 \global \advance \@colht \@tempdima
5097 \global \advance \@dbltopnum \m@ne
5098 \@cons \@dbltoplist \@currbox
5099 %<*trace>
5100 \fl@trace{dbltopnum (after) = \the \@dbltopnum}%
5101 \fl@trace{***Success: dbltop}%
5102 %</trace>
5103 \@inserttrue
5104 \fi
5105 \fi
5106 %<*trace>
5107 \else
5108 \fl@trace{Fail: dbltopnum = \the \@dbltopnum: fpstype
5109 \the \@fpstype=ORD?}%
5110 \ifnum \@fpstype<\sixt@@n
5111 \fl@trace{ERROR: !t float not successful (addtodblcol)}%
5112 \fi
5113 %</trace>
5114 \fi
5115 \fi
5116 \if@insert
5117 \else
5118 %<*trace>
5119 \fl@trace{put on deferlist}%
5120 %</trace>
5121 \@cons\@deferlist\@currbox
5122 %<*trace>
5123 \fl@trace{(dbl)deferlist: \@deferlist: (after)}%
5124 %</trace>
5125 \fi
5126 %<*trace>
5127 \fl@trace{End of addtodblcol -- locally count:}%
5128 \fl@trace{ dbltop: \the \@dbltopnum.}%
5129 %</trace>
5130 \endgroup
5131 %<*trace>
5132 \fl@trace{End of addtodblcol -- globally count:}%
5133 \fl@trace{dbltop: \the \@dbltopnum.}%
5134 %</trace>
5135 }%
5136 %</2ekernel|latexrelease|fltrace>
5137 %<latexrelease|fltrace>\EndIncludeInRelease
5138 %<latexrelease|fltrace>\IncludeInRelease{0000/00/00}%
5139 %<latexrelease|fltrace> {\@addtodblcol}{float order in 2-column}%
5140 %<latexrelease|fltrace>\def\@addtodblcol{%
5141 %<latexrelease|fltrace> \begingroup
5142 %<*trace>
5143 %<latexrelease|fltrace> \fl@trace{***Start addtodblcol}%
5144 %</trace>
5145 %<latexrelease|fltrace> \@insertfalse
5146 %<latexrelease|fltrace> \@setfloattypecounts
5147 %<latexrelease|fltrace> \@getfpsbit \tw@
5148 %<*trace>
5149 %<latexrelease|fltrace> \fl@trace{fpstype \ifodd \@tempcnta OK
5150 %<latexrelease|fltrace> \else not \fi dbltop: \the \@fpstype}%
5151 %</trace>
5152 %<latexrelease|fltrace> \ifodd\@tempcnta
5153 %<latexrelease|fltrace> \@flsetnum \@dbltopnum
5154 %<latexrelease|fltrace> \ifnum \@dbltopnum>\z@
5155 %<latexrelease|fltrace> \@tempswafalse
5156 %<latexrelease|fltrace> \ifdim \@dbltoproom>\ht\@currbox
5157 %<latexrelease|fltrace> \@tempswatrue
5158 %<*trace>
5159 %<latexrelease|fltrace> \fl@trace{Space OK: \@dbltoproom =
5160 %<latexrelease|fltrace> \the \@dbltoproom > \the \ht \@currbox
5161 %<latexrelease|fltrace> (dbltoproom)}%
5162 %</trace>
5163 %<latexrelease|fltrace> \else
5164 %<*trace>
5165 %<latexrelease|fltrace> \fl@trace{fpstype: \the \@fpstype (addtodblcol)}%
5166 %</trace>
5167 %<latexrelease|fltrace> \ifnum \@fpstype<\sixt@@n
5168 %<*trace>
5169 %<latexrelease|fltrace> \fl@trace{BANG float ignoring \@dbltoproom}%
5170 %<latexrelease|fltrace> \fl@trace{\@spaces \@dbltoproom =
5171 %<latexrelease|fltrace> \the \@dbltoproom.
5172 %<latexrelease|fltrace> Ht float: \the \ht \@currbox-BANG}%
5173 %</trace>
5174 % \end{macrocode}
5175 % Need to check that there is room on the page, using the local value
5176 % of |\@textmin| to make the necessary adjustment to |\@dbltoproom|.
5177 % \begin{macrocode}
5178 %<latexrelease|fltrace> \advance \@dbltoproom \@textmin
5179 %<*trace>
5180 %<latexrelease|fltrace> \fl@trace{Local value of texmin: \the\@textmin}%
5181 %<latexrelease|fltrace> \fl@trace{\@spaces space on page =
5182 %<latexrelease|fltrace> \the \@dbltoproom.
5183 %<latexrelease|fltrace> Ht float: \the \ht \@currbox-BANG}%
5184 %</trace>
5185 %<latexrelease|fltrace> \ifdim \@dbltoproom>\ht\@currbox
5186 %<latexrelease|fltrace> \@tempswatrue
5187 %<*trace>
5188 %<latexrelease|fltrace> \fl@trace{Space OK BANG: space on page =
5189 %<latexrelease|fltrace> \the\@dbltoproom > \the\ht\@currbox}%
5190 %<latexrelease|fltrace> \else
5191 %<latexrelease|fltrace> \fl@trace{fpstype: \the \@fpstype}%
5192 %<latexrelease|fltrace> \fl@trace{Fail---no room dbltoproom-BANG?:}%
5193 %<latexrelease|fltrace> \fl@trace{\@spaces space on page =
5194 %<latexrelease|fltrace> \the \@dbltoproom.
5195 %<latexrelease|fltrace> Ht float: \the \ht \@currbox}%
5196 %</trace>
5197 %<latexrelease|fltrace> \fi
5198 %<latexrelease|fltrace> \advance \@dbltoproom -\@textmin
5199 %<*trace>
5200 %<latexrelease|fltrace> \else
5201 %<latexrelease|fltrace> \fl@trace{fpstype: \the \@fpstype}%
5202 %<latexrelease|fltrace> \fl@trace{Fail---no room dbltoproom-ORD?:}%
5203 %<latexrelease|fltrace> \fl@trace{\@spaces \@dbltoproom =
5204 %<latexrelease|fltrace> \the \@dbltoproom.
5205 %<latexrelease|fltrace> Ht float: \the \ht \@currbox}%
5206 %</trace>
5207 %<latexrelease|fltrace> \fi
5208 %<latexrelease|fltrace> \fi
5209 %<latexrelease|fltrace> \if@tempswa
5210 %<latexrelease|fltrace> \@bitor \@currtype \@dbldeferlist
5211 %<*trace>
5212 %<latexrelease|fltrace> \fl@trace{dbldeferlist:
5213 %<latexrelease|fltrace> \@dbldeferlist: (before)}%
5214 %</trace>
5215 %<latexrelease|fltrace> \if@test
5216 %<*trace>
5217 %<latexrelease|fltrace> \fl@trace{type already on list: dbldefer}%
5218 %</trace>
5219 %<latexrelease|fltrace> \else
5220 %<latexrelease|fltrace> \@tempdima -\ht\@currbox
5221 %<latexrelease|fltrace> \advance\@tempdima
5222 %<latexrelease|fltrace> -\ifx \@dbltoplist\@empty
5223 %<latexrelease|fltrace> \dbltextfloatsep
5224 %<latexrelease|fltrace> \else \dblfloatsep \fi
5225 %<latexrelease|fltrace> \global \advance \@dbltoproom \@tempdima
5226 %<latexrelease|fltrace> \global \advance \@colht \@tempdima
5227 %<latexrelease|fltrace> \global \advance \@dbltopnum \m@ne
5228 %<latexrelease|fltrace> \@cons \@dbltoplist \@currbox
5229 %<*trace>
5230 %<latexrelease|fltrace> \fl@trace{dbltopnum (after) =
5231 %<latexrelease|fltrace> \the \@dbltopnum}%
5232 %<latexrelease|fltrace> \fl@trace{***Success: dbltop}%
5233 %</trace>
5234 %<latexrelease|fltrace> \@inserttrue
5235 %<latexrelease|fltrace> \fi
5236 %<latexrelease|fltrace> \fi
5237 %<*trace>
5238 %<latexrelease|fltrace> \else
5239 %<latexrelease|fltrace> \fl@trace{Fail: dbltopnum = \the \@dbltopnum:
5240 %<latexrelease|fltrace> fpstype \the \@fpstype=ORD?}%
5241 %<latexrelease|fltrace> \ifnum \@fpstype<\sixt@@n
5242 %<latexrelease|fltrace> \fl@trace{ERROR: !t float not successful
5243 %<latexrelease|fltrace> (addtodblcol)}%
5244 %<latexrelease|fltrace> \fi
5245 %</trace>
5246 %<latexrelease|fltrace> \fi
5247 %<latexrelease|fltrace> \fi
5248 %<latexrelease|fltrace> \if@insert
5249 %<latexrelease|fltrace> \else
5250 %<*trace>
5251 %<latexrelease|fltrace> \fl@trace{put on dbldeferlist}%
5252 %</trace>
5253 %<latexrelease|fltrace> \@cons\@dbldeferlist\@currbox
5254 %<*trace>
5255 %<latexrelease|fltrace> \fl@trace{dbldeferlist: \@dbldeferlist: (after)}%
5256 %</trace>
5257 %<latexrelease|fltrace> \fi
5258 %<*trace>
5259 %<latexrelease|fltrace> \fl@trace{End of addtodblcol -- locally count:}%
5260 %<latexrelease|fltrace> \fl@trace{ dbltop: \the \@dbltopnum.}%
5261 %</trace>
5262 %<latexrelease|fltrace> \endgroup
5263 %<*trace>
5264 %<latexrelease|fltrace> \fl@trace{End of addtodblcol -- globally count:}%
5265 %<latexrelease|fltrace> \fl@trace{dbltop: \the \@dbltopnum.}%
5266 %</trace>
5267 %<latexrelease|fltrace>}%
5268 %<latexrelease|fltrace>\EndIncludeInRelease
5269 % \end{macrocode}
5270 % \end{macro}
5271 %
5272 %
5273 %
5274 % \begin{macro}{\@addmarginpar}
5275 % \begin{macrocode}
5276 %<*2ekernel>
5277 \def\@addmarginpar{\@next\@marbox\@currlist{\@cons\@freelist\@marbox
5278 \@cons\@freelist\@currbox}\@latexbug\@tempcnta\@ne
5279 \if@twocolumn
5280 \if@firstcolumn \@tempcnta\m@ne \fi
5281 \else
5282 \if@mparswitch
5283 \ifodd\c@page \else\@tempcnta\m@ne \fi
5284 \fi
5285 \if@reversemargin \@tempcnta -\@tempcnta \fi
5286 \fi
5287 \ifnum\@tempcnta <\z@ \global\setbox\@marbox\box\@currbox \fi
5288 \@tempdima\@mparbottom
5289 \advance\@tempdima -\@pageht
5290 \advance\@tempdima\ht\@marbox
5291 \ifdim\@tempdima >\z@
5292 \@latex@warning@no@line {Marginpar on page \thepage\space moved}%
5293 \else
5294 \@tempdima\z@
5295 \fi
5296 \global\@mparbottom\@pageht
5297 \global\advance\@mparbottom\@tempdima
5298 \global\advance\@mparbottom\dp\@marbox
5299 \global\advance\@mparbottom\marginparpush
5300 \advance\@tempdima -\ht\@marbox
5301 % \end{macrocode}
5302 % Putting box movement inside the `marbox':
5303 % \begin{macrocode}
5304 \global\setbox \@marbox
5305 \vbox {\vskip \@tempdima
5306 \box \@marbox}%
5307 \global \ht\@marbox \z@
5308 \global \dp\@marbox \z@
5309 % \end{macrocode}
5310 % Sticking (rather than gluing:-) the `marbox' to the line above,
5311 % changed vskip to kern:
5312 % \begin{macrocode}
5313 \kern -\@pagedp
5314 \nointerlineskip
5315 \hb@xt@\columnwidth
5316 {\ifnum \@tempcnta >\z@
5317 \hskip\columnwidth \hskip\marginparsep
5318 \else
5319 \hskip -\marginparsep \hskip -\marginparwidth
5320 \fi
5321 \box\@marbox \hss}%
5322 % \end{macrocode}
5323 % For this reason the following code can vanish:
5324 %\begin{verbatim}
5325 % \nobreak %% No longer needed. CAR92/12
5326 % \vskip -\@tempdima %% No longer needed. CAR92/12
5327 %\end{verbatim}
5328 % \begin{macrocode}
5329 \nointerlineskip
5330 \hbox{\vrule \@height\z@ \@width\z@ \@depth\@pagedp}}
5331 % \end{macrocode}
5332 % \end{macro}
5333 %
5334 % \subsubsection{Kludgeins}
5335 %
5336 % This part of the file is part of the implementation of the following
5337 % two new commands for \LaTeX2e{}.
5338 %
5339 %\begin{verbatim}
5340 % \enlargethispage{<dim>}
5341 %\end{verbatim}
5342 % Adds |<dim>| to the height of the current column only. On the printed
5343 % page the bottom of this column is extended downwards by exactly
5344 % |<dim>| without having any effect on the placement of the footer; this
5345 % may result in an overprinting.
5346 %
5347 %\begin{verbatim}
5348 % \enlargethispage*{<dim>}
5349 %\end{verbatim}
5350 %% Similar to |\enlargethispage| but it tries to squeeze the column to
5351 % be printed in as small a space as possible, ie it uses any
5352 % shrinkability in the column. If the column was not explicitly broken
5353 % (\eg with |\pagebreak|) this may result in an overfull box message but
5354 % except for this it will come out as expected (if you know what to
5355 % expect).
5356 %
5357 % The star form of this command is dedicated to Leslie Lamport, the
5358 % other we need for ourselves (FMi, CAR).
5359 %
5360 % These commands may well have unwanted effects if used soon
5361 % before a |\clearpage|: please give keep them clear of such places.
5362 %
5363 % \begin{macro}{\@kludgeins}
5364 % \changes{v0.1c}{1993/11/23}{Insert added}
5365 % The insert which makes \TeX{} do a lot of the necessary work.
5366 % All we need to put into it is the amount by which the pagegoal
5367 % should be changed.
5368 % \begin{macrocode}
5369 \newinsert \@kludgeins
5370 \global\dimen\@kludgeins \maxdimen
5371 \global\count\@kludgeins 1000
5372 % \end{macrocode}
5373 % \end{macro}
5374 %
5375 %
5376 % \begin{macro}{\enlargethispage}
5377 % \begin{macro}{\enlargethispage*}
5378 % \changes{v0.1c}{1993/11/23}{Commands added}
5379 % The user command.
5380 % \begin{macrocode}
5381 \gdef \enlargethispage {%
5382 \@ifstar
5383 {%
5384 %<*trace>
5385 \fl@trace{Enlarging page height * }%
5386 %</trace>
5387 \@enlargepage{\hbox{\kern\p@}}}%
5388 {%
5389 %<*trace>
5390 \fl@trace{Enlarging page height exactly---}%
5391 %</trace>
5392 \@enlargepage\@empty}%
5393 }
5394 % \end{macrocode}
5395 % \end{macro}
5396 % \end{macro}
5397 %
5398 %
5399 % \begin{macro}{\@enlargepage}
5400 % \changes{v0.1c}{1993/11/23}{Command added}
5401 % This actually inserts the insert, after checking for extreme
5402 % values of the change.
5403 % \begin{macrocode}
5404 \gdef\@enlargepage#1#2{%
5405 %<*trace>
5406 \fl@trace{\@spaces\@spaces by #2}%
5407 %</trace>
5408 \@tempskipa#2\relax
5409 \ifdim \@tempskipa>.5\maxdimen
5410 \@latex@error{Suggested\space extra\space height\space
5411 (\the\@tempskipa)\space dangerously\space
5412 large}\@eha
5413 \else
5414 \ifdim \vsize<.5\maxdimen
5415 %<*trace>
5416 \fl@trace {Kludgeins added--pagegoal before: \the\pagegoal}%
5417 %</trace>
5418 \@bsphack
5419 \insert\@kludgeins{#1\vskip-\@tempskipa}%
5420 \@esphack
5421 % \end{macrocode}
5422 % This next bit is for tracing only:
5423 % \begin{macrocode}
5424 %<*trace>
5425 \ifvmode \par
5426 \fl@trace {Kludgeins added--pagegoal after: \the \pagegoal}%
5427 \fi
5428 %</trace>
5429 \else
5430 \@latex@error{Page\space height\space already\space
5431 too\space large}\@eha
5432 \fi
5433 \fi
5434 }
5435 % \end{macrocode}
5436 % \end{macro}
5437 %
5438 %
5439 %
5440 %
5441 %
5442 % \begin{macro}{\ShowFloat}
5443 % This command provides some information about the contenta of a
5444 % float register. Float registers have internal names of the form
5445 % \cs{bx@}\meta{Uppercase-letter(s)-or numbers} and you specify just this
5446 % letter or letters as the argument, e.g., \verb=\ShowFloat{A}=.
5447 % (There is not much error recovery if you specify something that
5448 % isn't a float.)
5449 % \changes{v1.4g}{2021/07/31}{Macro added}
5450 % \changes{v1.4h}{2021/09/03}{Renamed, original name never distributed}
5451 % \begin{macrocode}
5452 %</2ekernel>
5453 %<*2ekernel|latexrelease>
5454 %<latexrelease>\IncludeInRelease{2021/11/15}%
5455 %<latexrelease> {\ShowFloat}{Show float register contents}%
5456 \def\ShowFloat#1{\begingroup
5457 \let \fl@trace \fl@tracemessage
5458 \fl@trace{***Float #1 details:}%
5459 \ifcsname bx@#1\endcsname
5460 \expandafter\fl@ShowFloat\csname bx@#1\endcsname
5461 \else
5462 \fl@trace{Not a float!}%
5463 \fi
5464 \endgroup
5465 }
5466 \def\fl@ShowFloat#1{%
5467 \fl@traceval{\count#1}% % this here should be interpreted on day
5468 \fl@traceval{\ht#1}%
5469 \fl@traceval{\dp#1}%
5470 \fl@traceval{\wd#1}%
5471 {\tracingonline1\showboxbreadth10\showboxdepth3\showbox#1}%
5472 }
5473 % \end{macrocode}
5474 % Here are two definitions from \texttt{fltrace} that make the above
5475 % code work:
5476 % \begin{macrocode}
5477 \def \fl@traceval #1{\fl@trace{\string #1 = \the #1}}
5478 \def \fl@tracemessage #1{{\let\@elt\@empty\typeout{LaTeX2e: #1}}}
5479 %</2ekernel|latexrelease>
5480 %<latexrelease>\EndIncludeInRelease
5481 % \end{macrocode}
5482 %
5483 % \begin{macrocode}
5484 %<latexrelease>\IncludeInRelease{0000/00/00}%
5485 %<latexrelease> {\ShowFloat}{Show float register contents}%
5486 %<latexrelease>
5487 %<latexrelease>\let\ShowFloat\@undefined
5488 %<latexrelease>\let\fl@ShowFloat\@undefined
5489 %<latexrelease>\let\fl@traceval\@undefined
5490 %<latexrelease>\let\fl@tracemessage\@undefined
5491 %<latexrelease>\EndIncludeInRelease
5492 % \end{macrocode}
5493 % \end{macro}
5494 %
5495 %
5496 %
5497 %
5498 % \subsubsection{Float control}
5499 %
5500 % This part implements controllable floats and other changes
5501 % to the float mechanism.
5502 %
5503 % It provides, at the document level, the following command for
5504 % inclusion in \LaTeX2e{}.
5505 %
5506 % \begin{verbatim}
5507 % \suppressfloats
5508 % \end{verbatim}
5509 %
5510 % This suppresses all further floats on the current page.
5511 %
5512 % With an optional argument it suppresses only floats only in certain
5513 % positions on the current page.
5514 % \begin{quote}
5515 % |[t]|\quad suppresses only floats at the top of the page
5516 % |[b]|\quad suppresses only floats at the bottom of the page
5517 % \end{quote}
5518 %
5519 % It also enables the use of an extra specifier, {\tt !}, in the
5520 % location optional argument of a float. If this is present then,
5521 % just for this particular float, whenever it is processed by the float
5522 % mechanism the following are ignored:
5523 %
5524 % \begin{itemize}
5525 % \item all restrictions on the number of floats which can appear;
5526 % \item all explicit restrictions on the amount of space which should
5527 % (not) be occupied by floats and/or text.
5528 % \end{itemize}
5529 %
5530 % The mechanism will still attempt to ensure that pages are not
5531 % overfull.
5532 %
5533 % These specifiers override, for the single float, the suppression
5534 % commands described above.
5535 %
5536 %
5537 % In its current form, it also supplies a reasonably exhaustive, and
5538 % somewhat baroque, means of tracing some aspects of the float
5539 % mechanism.
5540 %
5541 % More tracing.
5542 % \begin{macro}{\fl@trace}
5543 % \begin{macro}{\tracefloatsoff}
5544 % \begin{macro}{\tracefloats}
5545 % \begin{macro}{\fl@traceval}
5546 % \begin{macro}{\tracefloatvals}
5547 % \begin{macro}{\fl@tracemessage}
5548 % \changes{v1.0c}{1993/11/30}{Commands added}
5549 % \changes{v1.0h}{1993/12/12}{Commands changed}
5550 % \changes{v1.0j}{1993/12/17}{tracefloatvals made a document command}
5551 % Set-up tracing for floats independent of other tracing as it
5552 % produces mega-output. Default is no tracing.
5553 % \changes{v1.1j}{1995/04/24}
5554 % {Do not add to kernel unless `trace' specified}
5555 % \changes{v1.2n}{2014/04/24}
5556 % {Renamed internal trace commands; provide as package}
5557 %
5558 % \begin{macrocode}
5559 %<*fltrace>
5560 \def \fl@tracemessage #1{{\let\@elt\@empty\typeout{LaTeX2e: #1}}}
5561 \def \tracefloats{\let \fl@trace \fl@tracemessage}
5562 \def \tracefloatsoff {\let \fl@trace \@gobble}
5563 \tracefloatsoff
5564 \def \fl@traceval #1{\fl@trace{\string #1 = \the #1}}
5565 \IncludeInRelease{2015/01/01}{\tracefloatvals}%
5566 {trace float vals}%
5567 \def \tracefloatvals{%
5568 % \end{macrocode}
5569 % As |\@dblfloatplacement| sets |\f@depth| it needs to be run
5570 % inside a group, otherwise the float placement will test for the
5571 % wrong value.\footnote{This is a somewhat questionable design.}
5572 % \begin{macrocode}
5573 \begingroup
5574 % \end{macrocode}
5575 % When the user requests \cs{tracefloatvals} then they should show
5576 % regardless of the tracing state, so locally we make sure that it
5577 % is activated.
5578 % \changes{v1.4e}{2021/07/31}{Enable display when doing \cs{tracefloatvals}}
5579 % \begin{macrocode}
5580 \tracefloats
5581 % \end{macrocode}
5582 %
5583 % \begin{macrocode}
5584 \@dblfloatplacement
5585 \@floatplacement
5586 \fl@trace{***Float placement parameters:}%
5587 \fl@traceval\@colnum
5588 \fl@traceval\@colroom
5589 \fl@traceval\@topnum
5590 \fl@traceval\@toproom
5591 \fl@traceval\@botnum
5592 \fl@traceval\@botroom
5593 \fl@traceval\@fpmin
5594 \fl@trace{\string\textfraction = \textfraction}%
5595 \fl@traceval\@dbltopnum
5596 \fl@traceval\@dbltoproom
5597 \fl@trace{\string\textfraction = \textfraction}%
5598 \fl@trace{toplist: \@toplist}%
5599 \fl@trace{botlist: \@botlist}%
5600 \fl@trace{midlist: \@midlist}%
5601 \fl@trace{deferlist: \@deferlist}%
5602 \fl@trace{dbltoplist: \@dbltoplist}%
5603 %FMi \fl@trace{dbldeferlist: \@dbldeferlist}%
5604 \endgroup
5605 }
5606 \EndIncludeInRelease
5607 \IncludeInRelease{0000/00/00}{\tracefloatvals}%
5608 {trace float vals}%
5609 \def \tracefloatvals{%
5610 \begingroup
5611 \tracefloats
5612 \@dblfloatplacement
5613 \@floatplacement
5614 \fl@trace{***Float placement parameters:}%
5615 \fl@traceval\@colnum
5616 \fl@traceval\@colroom
5617 \fl@traceval\@topnum
5618 \fl@traceval\@toproom
5619 \fl@traceval\@botnum
5620 \fl@traceval\@botroom
5621 \fl@traceval\@fpmin
5622 \fl@trace{\string\textfraction = \textfraction}%
5623 \fl@traceval\@dbltopnum
5624 \fl@traceval\@dbltoproom
5625 \fl@trace{\string\textfraction = \textfraction}%
5626 \fl@trace{toplist: \@toplist}%
5627 \fl@trace{botlist: \@botlist}%
5628 \fl@trace{midlist: \@midlist}%
5629 \fl@trace{deferlist: \@deferlist}%
5630 \fl@trace{dbltoplist: \@dbltoplist}%
5631 % next line only in old releases
5632 \fl@trace{dbldeferlist: \@dbldeferlist}%
5633 \endgroup
5634 }
5635 \EndIncludeInRelease
5636 % \end{macrocode}
5637 %
5638 %
5639 %
5640 %
5641 % We need to make sure that \texttt{fltrace} comes before
5642 % \texttt{flafter} to make the tracing work.
5643 % \begin{macrocode}
5644 \@ifpackageloaded{flafter}
5645 {\PackageWarningNoLine
5646 {fltrace}{Load 'fltrace' before 'flafter'\MessageBreak
5647 Attempting to recover by reloading 'flafter'}%
5648 % \end{macrocode}
5649 % Hide the fact that \texttt{flafter} was already loaded and then
5650 % request it anew.
5651 % \changes{v1.2m}{2015/01/20}{Reset \cs{IncludeInRelease} flags}
5652 % \begin{macrocode}
5653 \expandafter\let\csname [email protected]\endcsname\relax
5654 \def\reserved@a#1{%
5655 \expandafter\let\csname\string#1+flafter+IIR\endcsname\relax}%
5656 \reserved@a\@addtocurcol
5657 \reserved@a\@addtonextcol
5658 \RequirePackage{flafter}}{}
5659 %</fltrace>
5660 % \end{macrocode}
5661 % As the code for \texttt{flafter} will contain tracing calls so
5662 % that it works in conjunction with \texttt{fltrace} we need to
5663 % provide a dummy definition for |\fl@trace| in that package.
5664 % \begin{macrocode}
5665 %<*flafter>
5666 \providecommand\fl@trace[1]{}
5667 %</flafter>
5668 % \end{macrocode}
5669 % \end{macro}
5670 % \end{macro}
5671 % \end{macro}
5672 % \end{macro}
5673 % \end{macro}
5674 % \end{macro}
5675 %
5676 % \begin{macro}{\suppressfloats}
5677 % \begin{macro}{\@flstop}
5678 % \changes{v1.0f}{1993/12/05}{Commands added}
5679 % Float suppression commands: these set the relevant counter
5680 % globally to zero. Thus they are overridden for a particular float
5681 % by an ! specifier.
5682 %
5683 % \begin{macrocode}
5684 %<*2ekernel>
5685 \def \suppressfloats {%
5686 \@ifnextchar [%
5687 \@flstop
5688 {\global \@colnum \z@}%
5689 }
5690 % \end{macrocode}
5691 % Maybe this should be a loop over |#1|?
5692 % \begin{macrocode}
5693 \def \@flstop [#1]{%
5694 \if t#1%
5695 \global \@topnum \z@
5696 \fi
5697 \if b#1%
5698 \global \@botnum \z@
5699 \fi
5700 }
5701 % \end{macrocode}
5702 % \end{macro}
5703 % \end{macro}
5704 %
5705 %
5706 % Manipulation of float placement and type; both their strings and the
5707 % corresponding count registers.
5708 %
5709 % \begin{macro}{\@fpstype}
5710 % \begin{macro}{\@reqcolroom}
5711 % \begin{macro}{\@textfloatsheight}
5712 % \changes{v1.0f}{1993/12/05}{Commands added}
5713 % First a new count register to go with |\@currtype|.
5714 %
5715 % Then a new skip register, for information needed to remove the
5716 % |\@maxsep| conservatism: it is possible that this could use a
5717 % temporary register.
5718 %
5719 % Finally a dimension register to hold the total height of in-text
5720 % floats on the current page. This is needed to implement a
5721 % major change in the functionality of |\@addtocurcol| which is,
5722 % nevertheless, a bug fix.
5723 % It is not local and therefore cannot be a temporary register.
5724 %
5725 % \begin{macrocode}
5726 \newcount \@fpstype
5727 \newdimen \@reqcolroom
5728 \newdimen \@textfloatsheight
5729 % \end{macrocode}
5730 % \end{macro}
5731 % \end{macro}
5732 % \end{macro}
5733 %
5734 %
5735 % \begin{macro}{\saved@reqcolroom}
5736 % Saved value of \cs{@reqcolroom}; this is needed when making several tests.
5737 % \begin{macrocode}
5738 %</2ekernel>
5739 %<*2ekernel|latexrelease>
5740 %<latexrelease>\IncludeInRelease{2025/06/01}%
5741 %<latexrelease> {\saved@reqcolroom}{float placement calculation}%
5742 \newdimen \saved@reqcolroom
5743 %</2ekernel|latexrelease>
5744 %<latexrelease>\EndIncludeInRelease
5745 %<latexrelease>\IncludeInRelease{0000/00/00}%
5746 %<latexrelease> {\saved@reqcolroom}{float placement calculation}%
5747 %<latexrelease>\let \saved@reqcolroom \@undefined
5748 %<latexrelease>\EndIncludeInRelease
5749 % \end{macrocode}
5750 % \end{macro}
5751 %
5752 % \begin{macro}{\@fpsadddefault}
5753 % \changes{v1.0f}{1993/12/05}{Command added}
5754 % Adds the default placement to what is already there.
5755 %
5756 % Should not need to change this, but could do it as follows:
5757 % \begin{verbatim}
5758 %\def \@fpsadddefault {%
5759 % \@temptokena \expandafter\expandafter\expandafter
5760 % {\csname fps@\@captype \endcsname}%
5761 % \edef \reserved@a {\the\@temptokena}%
5762 % \@onelevel@sanitize \reserved@a
5763 % \edef \@fps {\@fps\reserved@a}%
5764 %}
5765 % \end{verbatim}
5766 %
5767 % \begin{macrocode}
5768 %<*2ekernel|fltrace>
5769 \def \@fpsadddefault {%
5770 %<*trace>
5771 \fl@trace{fps changed from: \@fps}%
5772 %</trace>
5773 \edef \@fps {\@fps\csname fps@\@captype \endcsname}%
5774 \@latex@warning {%
5775 No positions in optional float specifier.\MessageBreak
5776 Default added (so using `\@fps')}%
5777 }
5778 % \end{macrocode}
5779 % \end{macro}
5780 %
5781 % \begin{macro}{\@setfloattypecounts}
5782 % \changes{v1.0f}{1993/12/05}{Command added}
5783 % Sets counters |\@fpstype| and |\@currtype|.
5784 %
5785 % BANG $==$ bit4 of $|\count\@currbox| = 0$.
5786 %
5787 % \begin{macrocode}
5788 \def \@setfloattypecounts {%
5789 \@currtype \count\@currbox
5790 \@fpstype \count\@currbox
5791 \divide\@currtype\@xxxii \multiply\@currtype\@xxxii
5792 \advance \@fpstype -\@currtype
5793 %<*trace>
5794 \fl@trace{(mod 32) fpstype: \the \@fpstype}%
5795 \fl@trace{(mult of 32) currtype: \the \@currtype}%
5796 % Tracing only: but some should be changed into real errors/warnings?
5797 \ifnum \@fpstype<\sixt@@n
5798 \ifnum \@fpstype=\z@
5799 \fl@trace{ERROR: no PLACEMENT, fpstype = \the \@fpstype = 0?}%
5800 \fi
5801 \ifnum \@fpstype=\@ne
5802 \fl@trace{WARNING: only h, fpstype = \the \@fpstype = 1?}%
5803 \fi
5804 \fl@trace{BANG float}%
5805 \else
5806 \ifnum \@fpstype=\sixt@@n
5807 \fl@trace{ERROR: no PLACEMENT, fpstype = \the \@fpstype = 16?}%
5808 \fi
5809 \ifnum \@fpstype=17
5810 \fl@trace{WARNING: only h, fpstype = \the \@fpstype = 17?}%
5811 \fi
5812 \fl@trace{ORD float}%
5813 \fi
5814 %</trace>
5815 }
5816 %</2ekernel|fltrace>
5817 % \end{macrocode}
5818 % \end{macro}
5819 %
5820 % Macros for getting, testing and setting bits of the fps.
5821 %
5822 %
5823 % \begin{macro}{\@getfpsbit}
5824 % \changes{v1.0f}{1993/12/05}{Command added}
5825 % Sets |\@tempcnta| to required bit of |\count\@currbox|.
5826 %
5827 % \begin{macrocode}
5828 %<*2ekernel>
5829 \def \@getfpsbit {%
5830 \@boxfpsbit \@currbox
5831 }
5832 % \end{macrocode}
5833 % \end{macro}
5834 %
5835 %
5836 % \begin{macro}{\@boxfpsbit}
5837 % \changes{v1.0f}{1993/12/05}{Command added}
5838 % Used above.
5839 % \begin{macrocode}
5840 \def \@boxfpsbit #1#2{%
5841 \@tempcnta \count#1%
5842 \divide \@tempcnta #2\relax
5843 }
5844 % \end{macrocode}
5845 % \end{macro}
5846 %
5847 % \begin{macro}{\@testfp}
5848 % \changes{v1.0f}{1993/12/05}{Command added}
5849 % New definition of the float page test.
5850 %
5851 % \changes{v1.1v}{1996/07/26}{remove \cs{global} before \cs{@test...}}
5852 % \begin{macrocode}
5853 \def \@testfp #1{%
5854 \@boxfpsbit #18\relax % Really `#1 8' for human readers!
5855 \ifodd \@tempcnta
5856 \else
5857 \@testtrue
5858 \fi
5859 }
5860 % \end{macrocode}
5861 % \end{macro}
5862 %
5863 %
5864 % \begin{macro}{\@setfpsbit}
5865 % \changes{v1.0f}{1993/12/05}{Command added}
5866 % Sets required bit of |\@tempcnta| (to 1).
5867 %
5868 % \begin{macrocode}
5869 \def \@setfpsbit #1{%
5870 \@tempcntb \@tempcnta
5871 \divide \@tempcntb #1\relax
5872 \ifodd \@tempcntb
5873 \else
5874 \advance \@tempcnta #1\relax
5875 \fi
5876 }
5877 %</2ekernel>
5878 % \end{macrocode}
5879 % \end{macro}
5880 %
5881 %
5882 % \begin{macro}{\@resethfps}
5883 % \changes{v1.0f}{1993/12/05}{Command added}
5884 % \changes{v1.0h}{1993/12/12}{Warnings added: minimal}
5885 % \changes{v1.0m}{1994/04/24}{Warning changed}
5886 % \changes{v1.0m}{1994/04/24}{Number 2 changed to \cs{tw@}}
5887 % \changes{v1.0o}{1994/05/02}{Code shortened}
5888 % Globally adds t as a possible location for an h or !h only placement:
5889 % this must be done using the count.
5890 %
5891 % Although it will leave |\@fpstype| set to 17 even if it was
5892 % originally 1, this does not matter since it is the last thing in
5893 % |\@addtocurcol|.
5894 % \begin{macrocode}
5895 %<*2ekernel|fltrace>
5896 \def \@resethfps {%
5897 \let\reserved@a\@empty
5898 \ifnum \@fpstype=\@ne
5899 \def \reserved@a {!}%
5900 \@fpstype 17
5901 \fi
5902 \ifnum \@fpstype=17
5903 \global \advance \count\@currbox \tw@
5904 \@latex@warning@no@line {%
5905 `\reserved@a h' float specifier changed to `\reserved@a ht'}%
5906 %<*trace>
5907 \fl@trace{%
5908 `t' added to `\reserved@a h'- new Count: \the \count\@currbox}%
5909 %</trace>
5910 \fi
5911 }
5912 % \end{macrocode}
5913 % \end{macro}
5914 %
5915 %
5916 % Special stuff for BANG floats.
5917 %
5918 % \begin{macro}{\@flsetnum}
5919 % \changes{v1.0f}{1993/12/05}{Command added}
5920 %
5921 % Ignores any zero float counter value in case BANG.
5922 %
5923 % It uses a local assignment to the normally global counter: a bit
5924 % naughty, perhaps?
5925 %
5926 % These assignments are safe so long as the counter involved is only
5927 % consulted once (\ie only for the `bang float') with the changed value.
5928 % This is the case within |\@addtocurcol| because it is used only
5929 % once within a call of the output routine (which forms a group).
5930 %
5931 % For |\@addtonextcol| this is achieved by putting a group around its
5932 % code; this is needed because it is called (by |\@startcolumn|) for
5933 % each float which was on the deferlist. Almost identical
5934 % considerations pertain to |\@addtodblcol|. There may be more
5935 % efficient ways to handle this, but the group seems to be the simplest.
5936 %
5937 % \changes{v1.0n}{1994/04/30}{Rogue space removed}
5938 % \begin{macrocode}
5939 \def \@flsetnum #1{%
5940 %<*trace>
5941 \fl@trace{fpstype: \the \@fpstype (flsetnum \string#1)}%
5942 %</trace>
5943 \ifnum \@fpstype<\sixt@@n
5944 \ifnum #1=\z@
5945 %<*trace>
5946 \fl@trace{BANG float resetting \string#1 to 1}%
5947 %</trace>
5948 #1\@ne
5949 \fi
5950 \fi
5951 %<*trace>
5952 \fl@trace{#1 (before) = \the #1}%
5953 %</trace>
5954 }
5955 % \end{macrocode}
5956 % \end{macro}
5957 %
5958 %
5959 % \begin{macro}{\@flsettextmin}
5960 % \changes{v1.0f}{1993/12/05}{Command added}
5961 % This ignores |\textfraction| space restriction in case BANG.
5962 %
5963 % \begin{macrocode}
5964 \def \@flsettextmin {%
5965 %<*trace>
5966 \fl@trace{fpstype: \the \@fpstype (flsettextmin)}%
5967 %</trace>
5968 \ifnum \@fpstype<\sixt@@n
5969 %<*trace>
5970 \fl@trace{BANG ignoring textmin}%
5971 %</trace>
5972 \@textmin \z@
5973 \else
5974 \@textmin \textfraction\@colht
5975 %<*trace>
5976 \fl@trace{ORD textmin = \the \@textmin}%
5977 %</trace>
5978 \fi
5979 }
5980 % \end{macrocode}
5981 % \end{macro}
5982 %
5983 %
5984 % \begin{macro}{\@flcheckspace}
5985 % \changes{v1.0f}{1993/12/05}{Command added}
5986 % This ignores space restriction in case BANG; this is still slightly
5987 % conservative since it does not allow for the fact that, if there is
5988 % no text in the column then |\textfloatsep| is not needed.
5989 % Sets |@tempswa| true if there is room for |\@currbox|.
5990 %
5991 % \begin{macrocode}
5992 %</2ekernel|fltrace>
5993 %<*2ekernel|fltrace|latexrelease>
5994 %<latexrelease|fltrace>\IncludeInRelease{2025/06/01}%
5995 %<latexrelease|fltrace> {\@flcheckspace}{float placement calculation}%
5996 \def \@flcheckspace #1#2{%
5997 % \end{macrocode}
5998 % When this test is executed, the value of \cs{@reqcolroom} may
5999 % no longer be correct due to a previous test that altered it. We
6000 % therefore reset it to a value saved earlier.
6001 % \changes{v1.4n}{2025/01/29}{Reset current value of \cs{@reqcolroom} (gh/1645)}
6002 % \begin{macrocode}
6003 \@reqcolroom \saved@reqcolroom
6004 \advance \@reqcolroom
6005 \ifx #2\@empty \textfloatsep \else \floatsep \fi
6006 %<*trace>
6007 \fl@trace{colroom = \the \@colroom
6008 (flcheckspace \string#1 \string#2)}%
6009 \fl@trace{reqcolroom = \the \@reqcolroom
6010 (flcheckspace \string#1 \string#2)}%
6011 %</trace>
6012 \ifdim \@colroom>\@reqcolroom
6013 \ifdim #1>\ht\@currbox
6014 \@tempswatrue
6015 %<*trace>
6016 \fl@trace{Space OK: #1 = \the #1 > \the \ht \@currbox
6017 (flcheckspace \string#1 \string#2)}%
6018 %</trace>
6019 \else
6020 %<*trace>
6021 \fl@trace{fpstype: \the \@fpstype
6022 (flcheckspace \string#1 \string#2)}%
6023 %</trace>
6024 \ifnum \@fpstype<\sixt@@n
6025 %<*trace>
6026 \fl@trace{BANG float ignoring #1
6027 (flcheckspace \string#1 \string#2):}%
6028 \fl@trace{\@spaces #1 = \the #1. Ht float: \the \ht \@currbox
6029 \space BANG}%
6030 %</trace>
6031 \@tempswatrue
6032 %<*trace>
6033 \else
6034 \fl@trace{Fail---no room (flcheckspace \string#1 \string#2)
6035 (fpstype \the \@fpstype=ORD?):}%
6036 \fl@trace{\@spaces #1 = \the #1. Ht float: \the \ht \@currbox
6037 \space ORD?}%
6038 %</trace>
6039 \fi
6040 \fi
6041 %<*trace>
6042 \else
6043 \fl@trace{Fail---no room at 2nd test of colroom
6044 (flcheckspace \string#1 \string#2)}%
6045 %</trace>
6046 \fi
6047 }
6048 %</2ekernel|fltrace|latexrelease>
6049 % \end{macrocode}
6050 %
6051 % \begin{macrocode}
6052 %<latexrelease|fltrace>\EndIncludeInRelease
6053 %<latexrelease|fltrace>\IncludeInRelease{0000/00/00}%
6054 %<latexrelease|fltrace> {\@flcheckspace}{float placement calculation}%
6055 %<latexrelease|fltrace>
6056 %<latexrelease|fltrace>\def \@flcheckspace #1#2{%
6057 %<latexrelease|fltrace> \advance \@reqcolroom
6058 %<latexrelease|fltrace> \ifx #2\@empty \textfloatsep \else \floatsep \fi
6059 %<*trace>
6060 %<latexrelease|fltrace> \fl@trace{colroom = \the \@colroom
6061 %<latexrelease|fltrace> (flcheckspace \string#1 \string#2)}%
6062 %<latexrelease|fltrace> \fl@trace{reqcolroom = \the \@reqcolroom
6063 %<latexrelease|fltrace> (flcheckspace \string#1 \string#2)}%
6064 %</trace>
6065 %<latexrelease|fltrace> \ifdim \@colroom>\@reqcolroom
6066 %<latexrelease|fltrace> \ifdim #1>\ht\@currbox
6067 %<latexrelease|fltrace> \@tempswatrue
6068 %<*trace>
6069 %<latexrelease|fltrace> \fl@trace{Space OK: #1 = \the #1 > \the \ht \@currbox
6070 %<latexrelease|fltrace> (flcheckspace \string#1 \string#2)}%
6071 %</trace>
6072 %<latexrelease|fltrace> \else
6073 %<*trace>
6074 %<latexrelease|fltrace> \fl@trace{fpstype: \the \@fpstype
6075 %<latexrelease|fltrace> (flcheckspace \string#1 \string#2)}%
6076 %</trace>
6077 %<latexrelease|fltrace> \ifnum \@fpstype<\sixt@@n
6078 %<*trace>
6079 %<latexrelease|fltrace> \fl@trace{BANG float ignoring #1
6080 %<latexrelease|fltrace> (flcheckspace \string#1 \string#2):}%
6081 %<latexrelease|fltrace> \fl@trace{\@spaces #1 = \the #1. Ht float: \the \ht \@currbox
6082 %<latexrelease|fltrace> \space BANG}%
6083 %</trace>
6084 %<latexrelease|fltrace> \@tempswatrue
6085 %<*trace>
6086 %<latexrelease|fltrace> \else
6087 %<latexrelease|fltrace> \fl@trace{Fail---no room (flcheckspace \string#1 \string#2)
6088 %<latexrelease|fltrace> (fpstype \the \@fpstype=ORD?):}%
6089 %<latexrelease|fltrace> \fl@trace{\@spaces #1 = \the #1. Ht float: \the \ht \@currbox
6090 %<latexrelease|fltrace> \space ORD?}%
6091 %</trace>
6092 %<latexrelease|fltrace> \fi
6093 %<latexrelease|fltrace> \fi
6094 %<*trace>
6095 %<latexrelease|fltrace> \else
6096 %<latexrelease|fltrace> \fl@trace{Fail---no room at 2nd test of colroom
6097 %<latexrelease|fltrace> (flcheckspace \string#1 \string#2)}%
6098 %</trace>
6099 %<latexrelease|fltrace> \fi
6100 %<latexrelease|fltrace>}
6101 %<latexrelease|fltrace>\EndIncludeInRelease
6102 % \end{macrocode}
6103 % \end{macro}
6104 %
6105 %
6106 % \begin{macro}{\@flupdates}
6107 % \changes{v1.0f}{1993/12/05}{Command added}
6108 % This updates everything when a float is placed.
6109 %
6110 % \begin{macrocode}
6111 %<*2ekernel>
6112 \def \@flupdates #1#2#3{%
6113 \global \advance #1\m@ne
6114 \global \advance \@colnum \m@ne
6115 \@tempdima -\ht\@currbox
6116 \advance \@tempdima
6117 -\ifx #3\@empty \textfloatsep \else \floatsep \fi
6118 \global \advance #2\@tempdima
6119 \global \advance \@colroom \@tempdima
6120 \@cons #3\@currbox
6121 }
6122 %</2ekernel>
6123 % \end{macrocode}
6124 % \end{macro}
6125 %
6126 %
6127 % Interesting facts about float mechanisms past and present, together
6128 % with a summary of various features, some unresolved:
6129 %
6130 % \begin{enumerate}
6131 % \item The value |\textfraction| does not affect the processing
6132 % of doublecol floats: this seems sensible, but should be
6133 % documented.
6134 % \item |\twocolumn| floatplacement was wrong: dbl not needed, ord
6135 % needed.
6136 % \item |\@floatplacement| was not called after |\@startdblcol|
6137 % or |\@topnewpage|. This has been changed; it is clearly a bug
6138 % fix.
6139 % \item The use |\@topnewpage| when |\dblfigrule| is non-trivial
6140 % produced a rule in the wrong place. This has been fixed by not
6141 % using |\dblfigrule| when processing the `float' from
6142 % |\@topnewpage|.
6143 % \item If the specifier was just h and the float could not be put
6144 % here, it went on the deferlist and stayed there until a clearpage.
6145 % It now gets changed to a `th': this is only an error-recovery
6146 % action, putting just h or !h should be deprecated.
6147 % \item |\@dblmaxsep| was `the maximum of |\dblfloatsep| and
6148 % |\dbltexfloatsep|'. But it was never used! Now gone completely,
6149 % like |\@maxsep|.
6150 % \item After an h float is put on a page, it was counted as text when
6151 % applying the |\textfraction| test; this is possibly too big a
6152 % change although it is a bug fix?
6153 % \item Two consecutive h floats are separated by twice |\intextsep|:
6154 % this could be changed to one by use of |\addvspace|, OK?
6155 % Note that it would also mean that less space is put in if an h
6156 % float immediately follows other spaces. This is also possibly
6157 % too big a change, at least for compatibility mode?
6158 % Or it may be simply wrong! It has not been changed.
6159 % \item Now |\@addtocurcol| checks first for just p fps. I think
6160 % that this is an increase in efficiency, but maybe the coding
6161 % should be made even more efficient.
6162 % \item |\@tryfcolumn| now tests if the list is empty first, otherwise
6163 % lots of wasted time! Thus this test has been removed from
6164 % |\@startcolumn|.
6165 % As Frank pointed out, this makes |\@startcolumn| less
6166 % efficient. But it is now the same as |\@startdblcolumn|: I can
6167 % see no reason why they should be different, but which is best?
6168 % \item Why is |\@colroom| set in |\@doclearpage|?
6169 % \item Footnotes. Check what |\clearpage| does when footnotes are
6170 % left over. Footnotes are not put on float pages and, also,
6171 % |\@addtonextcol| ignores the existence of held-over footnotes
6172 % in deciding what floats can go on the page. Not changed.
6173 % \item |\clearpage| can still lose non-boxes, at least when floats
6174 % are involved. It also moves some to the `wrong page', but this
6175 % may be a coding problem.
6176 % \item The ! option makes it necessary to check in |\output| that
6177 % there is enough room left on the page after adding a float. (This
6178 % would have been necessary anyway if anyone set |\@textmin| too
6179 % close to zero! A similar danger existed also if the text in a
6180 % |\twocolumn[text]| entity gets too large.)
6181 % The current implementation of this also makes the normal case a
6182 % little less efficient, OK?
6183 % Not enough room means, at present, less than |\baselineskip|,
6184 % with a warning: is this OK? Should it be made generic (another
6185 % parameter)?
6186 % \item There are four possibilities for supporting this:
6187 %
6188 % |\twocolumn[\maketitle more text]|
6189 %
6190 % One is to change
6191 % |\maketitle| slightly to allow this. Another is to change
6192 % |\@topnewpage| so that more than one |\twocolumn[]| command is
6193 % allowed; in this case |\maketitle\twocolumn[more text]| will work.
6194 % The former is more robust from the user's viewpoint, but makes the
6195 % code for |\maketitle| rather ad hoc (maybe it is already?).
6196 % Another is to misuse the global twocolumn flag locally within
6197 % |\@topnewpage|.
6198 % Yet another is to move the column count register from the multicol
6199 % package into the kernel. This has been done.
6200 % \item Where should the reinserts be put to maximise the
6201 % probability that footnotes come out on the correct page?
6202 % Or should we go for as much compatibility as possible (but see
6203 % next item)?
6204 % \item Should we continue to support (as much as possible)
6205 % |\samepage|? Some of its intended functionality is now advertised
6206 % as being provided by |\enlargethispage|. Use of either is likely
6207 % to result in wrongly placed footnotes, marginals, etc.
6208 % Which should have priority: obeying the pagination instructions,
6209 % or correct placement of notes/marginalia?
6210 % \item Is the adjustment of space to cause shrinking in the
6211 % kludge-* case correct? Should it be limited to 0pt?
6212 % \item Is the setting of |\boxmaxdepth| in makecol and friends
6213 % needed? It only has any effect if |\@textbottom| ends with a box
6214 % or rule, in which case the vskip to allow for its depth should
6215 % also be added. If it is kept, it should probably be the last
6216 % thing in the box. It has now been removed.
6217 %
6218 % It would perhaps be better to document that |\@textbottom|
6219 % and |\@texttop| must have natural height 0pt.
6220 % \item I cannot see why the vskip adjustment for the depth
6221 % is needed if boxmaxdepth is used to ensure that there is never
6222 % a too deep box.
6223 % \item The value of |\boxmaxdepth| should be explicitly set
6224 % whenever necessary: it is too risky to assume that it has any
6225 % particular value. Care is needed in deciding what to set it to.
6226 %
6227 % It is interesting to note that the value of |\boxmaxdepth| is
6228 % unique in being read before the local settings for the box group
6229 % are reset; all other parameter settings which affect the box
6230 % construction use their values outside the box group.
6231 % \item Should |\@maxdepth| store the setting of |\maxdepth| from
6232 % lplain? Or should we provide a proper interface to class files
6233 % for setting these?
6234 % \end{enumerate}
6235 %
6236 % An analysis of various other macros.
6237 %
6238 % |\@opcol| should do |\@floatplacement|, but where? Right at the
6239 % end, since it always occurs at the start of a column.
6240 % \begin{verbatim}
6241 % \def\@opcol{%
6242 % % Why is this done first?
6243 % \global \@mparbottom \z@
6244 % \if@twocolumn
6245 % \@outputdblcol
6246 % \else
6247 % \@outputpage
6248 % % This is not needed since it is done at the end of
6249 % % |\@outputpage|:
6250 % \global \@colht \textheight
6251 % \fi}
6252 % \end{verbatim}
6253 %
6254 % Only tracing has been added to these.
6255 %
6256 % \begin{macrocode}
6257 %<latexrelease|fltrace>\IncludeInRelease{2017/01/01}%
6258 %<latexrelease|fltrace> {\@makefcolumn}{negative height floats}%
6259 %<*2ekernel|fltrace|latexrelease>
6260 \def\@makefcolumn #1{%
6261 \begingroup
6262 % \end{macrocode}
6263 % \changes{v1.3b}{2017/01/01}{make fpmin negative so ignored even if float height is negative}
6264 % \begin{macrocode}
6265 \@fpmin -\maxdimen
6266 % \end{macrocode}
6267 %
6268 % \begin{macrocode}
6269 \let \@testfp \@gobble
6270 \@tryfcolumn #1%
6271 \endgroup
6272 %<*trace>
6273 \if@fcolmade
6274 \fl@trace{PAGE: in \string\clearpage
6275 \if@twocolumn ---twocolumn\fi---}%
6276 \fl@trace{----- float column/page completed from \string#1}%
6277 \fi
6278 %</trace>
6279 }
6280 % \end{macrocode}
6281 %
6282 % \begin{macrocode}
6283 %<latexrelease|fltrace>\EndIncludeInRelease
6284 %<latexrelease|fltrace>\IncludeInRelease{0000/00/00}%
6285 %<latexrelease|fltrace> {\@makefcolumn}{negative height floats}%
6286 %<latexrelease|fltrace>\def\@makefcolumn #1{%
6287 %<latexrelease|fltrace> \begingroup
6288 %<latexrelease|fltrace> \@fpmin \z@
6289 %<latexrelease|fltrace> \let \@testfp \@gobble
6290 %<latexrelease|fltrace> \@tryfcolumn #1%
6291 %<latexrelease|fltrace> \endgroup
6292 %<*trace>
6293 %<latexrelease|fltrace> \if@fcolmade
6294 %<latexrelease|fltrace> \fl@trace{PAGE: in \string\clearpage
6295 %<latexrelease|fltrace> \if@twocolumn ---twocolumn\fi---}%
6296 %<latexrelease|fltrace> \fl@trace{----- float column/page completed
6297 %<latexrelease|fltrace> from \string#1}%
6298 %<latexrelease|fltrace> \fi
6299 %</trace>
6300 %<latexrelease|fltrace>}
6301 %<latexrelease|fltrace>\EndIncludeInRelease
6302 %</2ekernel|fltrace|latexrelease>
6303 % \end{macrocode}
6304 % This will line up the last baselines in the two
6305 % columns provided they are constructed in the normal way: \ie ending
6306 % in a skip of minus the original depth, with |\@textbottom| adding
6307 % nothing.
6308 %
6309 % Thus again it is essential for |\@textbottom| to have depth 0pt.
6310 % \changes{1.2g}{2000/07/12}{Ensure that rule is in \cs{normalcolor}}
6311 % \changes{v1.2m}{2014/12/30}{Command updated (latexrelease)}
6312 % \begin{macrocode}
6313 %<latexrelease|fltrace>\IncludeInRelease{2025/06/01}%
6314 %<latexrelease|fltrace> {\@outputdblcol}{Use new mark mechanism}%
6315 %<*2ekernel|fltrace|latexrelease>
6316 % \end{macrocode}
6317 %
6318 % \begin{macrocode}
6319 \def\@outputdblcol{%
6320 \if@firstcolumn
6321 \global\@firstcolumnfalse
6322 % \end{macrocode}
6323 % Save the left column
6324 % \begin{macrocode}
6325 \global\setbox\@leftcolumn\copy\@outputbox
6326 %<fltrace> \fl@trace{PAGE: first column boxed}%
6327 % \end{macrocode}
6328 %
6329 % \begin{macrocode}
6330 \else
6331 \global\@firstcolumntrue
6332 \setbox\@outputbox\vbox{%
6333 \hb@xt@\textwidth{%
6334 \hb@xt@\columnwidth{\box\@leftcolumn \hss}%
6335 \hfil
6336 % \end{macrocode}
6337 % \changes{v1.1m}{2006/09/13}{Ensure that rule is in \cs{normalcolor}}
6338 % The color of the \cs{vrule} should be \cs{normalcolor} as to not
6339 % inherit the color from the column.
6340 % \begin{macrocode}
6341 {\normalcolor\vrule \@width\columnseprule}%
6342 \hfil
6343 \hb@xt@\columnwidth{\box\@outputbox \hss}}}%
6344 %<fltrace> \fl@trace{PAGE: second column also boxed}%
6345 \@combinedblfloats
6346 \@outputpage
6347 %<fltrace> \fl@trace{PAGE: two column page completed}%
6348 \begingroup
6349 \@dblfloatplacement
6350 \@startdblcolumn
6351 \@whilesw\if@fcolmade \fi{\@outputpage
6352 %<fltrace> \fl@trace{PAGE: double float page completed}%
6353 \@startdblcolumn}%
6354 \endgroup
6355 \fi}%
6356 % \end{macrocode}
6357 %
6358 % \begin{macrocode}
6359 %<latexrelease|fltrace>\EndIncludeInRelease
6360 %<latexrelease|fltrace>\IncludeInRelease{2015/01/01}%
6361 %<latexrelease|fltrace> {\@outputdblcol}{2 column marks}%
6362 %<latexrelease|fltrace>\def\@outputdblcol{%
6363 %<latexrelease|fltrace> \if@firstcolumn
6364 %<latexrelease|fltrace> \global\@firstcolumnfalse
6365 %<latexrelease|fltrace> \global\setbox\@leftcolumn\copy\@outputbox
6366 %<latexrelease|fltrace> \splitmaxdepth\maxdimen
6367 %<latexrelease|fltrace> \vbadness\maxdimen
6368 %<latexrelease|fltrace> \setbox\@outputbox\vbox{\unvbox\@outputbox\unskip}%
6369 %<latexrelease|fltrace> \setbox\@outputbox\vsplit\@outputbox to\maxdimen
6370 %<latexrelease|fltrace> \toks@\expandafter{\topmark}%
6371 %<latexrelease|fltrace> \xdef\@firstcoltopmark{\the\toks@}%
6372 %<latexrelease|fltrace> \toks@\expandafter{\splitfirstmark}%
6373 %<latexrelease|fltrace> \xdef\@firstcolfirstmark{\the\toks@}%
6374 %<latexrelease|fltrace> \ifx\@firstcolfirstmark\@empty
6375 %<latexrelease|fltrace> \global\let\@setmarks\relax
6376 %<latexrelease|fltrace> \else
6377 %<latexrelease|fltrace> \gdef\@setmarks{%
6378 %<latexrelease|fltrace> \let\firstmark\@firstcolfirstmark
6379 %<latexrelease|fltrace> \let\topmark\@firstcoltopmark}%
6380 %<latexrelease|fltrace> \fi
6381 %<latexrelease|fltrace> \else
6382 %<latexrelease|fltrace> \global\@firstcolumntrue
6383 %<latexrelease|fltrace> \setbox\@outputbox\vbox{%
6384 %<latexrelease|fltrace> \hb@xt@\textwidth{%
6385 %<latexrelease|fltrace> \hb@xt@\columnwidth{\box\@leftcolumn \hss}%
6386 %<latexrelease|fltrace> \hfil
6387 %<latexrelease|fltrace> {\normalcolor\vrule \@width\columnseprule}%
6388 %<latexrelease|fltrace> \hfil
6389 %<latexrelease|fltrace> \hb@xt@\columnwidth{\box\@outputbox \hss}}}%
6390 %<latexrelease|fltrace> \@combinedblfloats
6391 %<latexrelease|fltrace> \@setmarks
6392 %<latexrelease|fltrace> \@outputpage
6393 %<latexrelease|fltrace> \begingroup
6394 %<latexrelease|fltrace> \@dblfloatplacement
6395 %<latexrelease|fltrace> \@startdblcolumn
6396 %<latexrelease|fltrace> \@whilesw\if@fcolmade \fi{\@outputpage
6397 %<latexrelease|fltrace> \@startdblcolumn}%
6398 %<latexrelease|fltrace> \endgroup
6399 %<latexrelease|fltrace> \fi}
6400 %<latexrelease|fltrace>\EndIncludeInRelease
6401 % \end{macrocode}
6402 %
6403 % \begin{macrocode}
6404 %<latexrelease|fltrace>\IncludeInRelease{0000/00/00}%
6405 %<latexrelease|fltrace> {\@outputdblcol}{2 column marks}%
6406 %<latexrelease|fltrace>\def\@outputdblcol{%
6407 %<latexrelease|fltrace> \if@firstcolumn
6408 %<latexrelease|fltrace> \global \@firstcolumnfalse
6409 %<latexrelease|fltrace> \global \setbox\@leftcolumn \box\@outputbox
6410 %<*trace>
6411 %<latexrelease|fltrace> \fl@trace{PAGE: first column boxed}%
6412 %</trace>
6413 %<latexrelease|fltrace> \else
6414 %<latexrelease|fltrace> \global \@firstcolumntrue
6415 %<latexrelease|fltrace> \setbox\@outputbox \vbox {%
6416 %<latexrelease|fltrace> \hb@xt@\textwidth {%
6417 %<latexrelease|fltrace> \hb@xt@\columnwidth {%
6418 %<latexrelease|fltrace> \box\@leftcolumn \hss}%
6419 %<latexrelease|fltrace> \hfil
6420 %<latexrelease|fltrace> {\normalcolor\vrule
6421 %<latexrelease|fltrace> \@width\columnseprule}%
6422 %<latexrelease|fltrace> \hfil
6423 %<latexrelease|fltrace> \hb@xt@\columnwidth {%
6424 %<latexrelease|fltrace> \box\@outputbox \hss}%
6425 %<latexrelease|fltrace> }%
6426 %<latexrelease|fltrace> }%
6427 %<*trace>
6428 %<latexrelease|fltrace> \fl@trace{PAGE: second column also boxed}%
6429 %</trace>
6430 %<latexrelease|fltrace> \@combinedblfloats
6431 %<latexrelease|fltrace> \@outputpage
6432 %<*trace>
6433 %<latexrelease|fltrace> \fl@trace{PAGE: two column page completed}%
6434 %</trace>
6435 %<latexrelease|fltrace> \begingroup
6436 %<latexrelease|fltrace> \@dblfloatplacement
6437 %<latexrelease|fltrace> \@startdblcolumn
6438 % \end{macrocode}
6439 % This loop could be replaced by an |\expandafter| tail
6440 % recursion in\\ |\@startdblcolumn|.
6441 % \begin{macrocode}
6442 %<latexrelease|fltrace> \@whilesw\if@fcolmade \fi
6443 %<latexrelease|fltrace> {\@outputpage
6444 %<*trace>
6445 %<latexrelease|fltrace> \fl@trace{PAGE: double float page completed}%
6446 %</trace>
6447 %<latexrelease|fltrace> \@startdblcolumn}%
6448 %<latexrelease|fltrace> \endgroup
6449 %<latexrelease|fltrace> \fi
6450 %<latexrelease|fltrace>}%
6451 %<latexrelease|fltrace>\EndIncludeInRelease
6452 %</2ekernel|fltrace|latexrelease>
6453 % \end{macrocode}
6454 %
6455 % \subsubsection{Float placement parameters}
6456 % \changes{v1.0i}{1993/12/14}{Section added to declare all parameters}
6457 %
6458 % The main purpose of this section is to ensure that all the
6459 % float-placement parameters which need to be set in a class file or
6460 % package have been declared. It also describes their use and sets
6461 % values for them which are reasonable for typical documents using
6462 % US letter or A4 sized paper.
6463 %
6464 % \paragraph{Limits for the placement of floating objects}
6465 %
6466 % \begin{macro}{\c@topnumber}
6467 % This counter holds the maximum number of
6468 % floats that can appear at the top of a text page or column.
6469 % \begin{macrocode}
6470 %<*2ekernel>
6471 \newcount\c@topnumber
6472 \setcounter{topnumber}{2}
6473 % \end{macrocode}
6474 % \end{macro}
6475 %
6476 % \begin{macro}{\topfraction}
6477 % This macro holds the maximum proportion (as a decimal number) of
6478 % a text page or column that can be occupied by floats at the top.
6479 % \begin{macrocode}
6480 \newcommand\topfraction{.7}
6481 % \end{macrocode}
6482 % \end{macro}
6483 %
6484 % \begin{macro}{\c@bottomnumber}
6485 % This counter holds the maximum number of
6486 % floats that can appear at the bottom of a text page or column.
6487 % \begin{macrocode}
6488 \newcount\c@bottomnumber
6489 \setcounter{bottomnumber}{1}
6490 % \end{macrocode}
6491 % \end{macro}
6492 %
6493 % \begin{macro}{\bottomfraction}
6494 % This macro holds the maximum proportion (as a decimal number) of
6495 % a text page or column that can be occupied by floats at the bottom.
6496 % \begin{macrocode}
6497 \newcommand\bottomfraction{.3}
6498 % \end{macrocode}
6499 % \end{macro}
6500 %
6501 % \begin{macro}{\c@totalnumber}
6502 % This counter holds the maximum number of floats that can appear on
6503 % any text page or column.
6504 % \begin{macrocode}
6505 \newcount\c@totalnumber
6506 \setcounter{totalnumber}{3}
6507 % \end{macrocode}
6508 % \end{macro}
6509 %
6510 % \begin{macro}{\textfraction}
6511 % This macro holds the minimum proportion (as a decimal number) of
6512 % a text page or column that must be occupied by text.
6513 % \begin{macrocode}
6514 \newcommand\textfraction{.2}
6515 % \end{macrocode}
6516 % \end{macro}
6517 %
6518 % \begin{macro}{\floatpagefraction}
6519 % This macro holds the minimum proportion (as a decimal number) of
6520 % a page or column that must be occupied by floating objects before a
6521 % `float page' is produced.
6522 % \begin{macrocode}
6523 \newcommand\floatpagefraction{.5}
6524 % \end{macrocode}
6525 % \end{macro}
6526 %
6527 % \begin{macro}{\c@dbltopnumber}
6528 % This counter holds the maximum number of double-column floats that
6529 % can appear on the top of a two-column text page.
6530 % \begin{macrocode}
6531 \newcount\c@dbltopnumber
6532 \setcounter{dbltopnumber}{2}
6533 % \end{macrocode}
6534 % \end{macro}
6535 %
6536 % \begin{macro}{\dbltopfraction}
6537 % This macro holds the maximum proportion (as a decimal number) of
6538 % a two-column text page that can be occupied by double-column floats
6539 % at the top.
6540 % \begin{macrocode}
6541 \newcommand\dbltopfraction{.7}
6542 % \end{macrocode}
6543 % \end{macro}
6544 %
6545 % \begin{macro}{\dblfloatpagefraction}
6546 % This macro holds the minimum proportion (as a decimal number) of
6547 % a page that must be occupied by double-column floating objects
6548 % before a `double-column float page' is produced.
6549 % \begin{macrocode}
6550 \newcommand\dblfloatpagefraction{.5}
6551 % \end{macrocode}
6552 % \end{macro}
6553 %
6554 % \paragraph{Floats on a text page}
6555 %
6556 % \begin{macro}{\floatsep}
6557 % \begin{macro}{\textfloatsep}
6558 % \begin{macro}{\intextsep}
6559 % When a floating object is placed on a page with text, these
6560 % parameters control the separation between the float and the other
6561 % objects on the page. These parameters are used for both
6562 % one-column mode and single-column floats in two-column mode.
6563 % They are all rubber lengths.
6564 %
6565 % |\floatsep| is the space between adjacent floats that are placed
6566 % at the top or bottom of the text page or column.
6567 %
6568 % |\textfloatsep| is the space between the main text and floats
6569 % at the top or bottom of the page or column.
6570 %
6571 % |\intextsep| is the space between in-text floats and the text.
6572 % \begin{macrocode}
6573 \newskip\floatsep
6574 \newskip\textfloatsep
6575 \newskip\intextsep
6576 \setlength\floatsep {12\p@ \@plus 2\p@ \@minus 2\p@}
6577 \setlength\textfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@}
6578 \setlength\intextsep {12\p@ \@plus 2\p@ \@minus 2\p@}
6579 % \end{macrocode}
6580 % \end{macro}
6581 % \end{macro}
6582 % \end{macro}
6583 %
6584 % \begin{macro}{\dblfloatsep}
6585 % \begin{macro}{\dbltextfloatsep}
6586 % When double-column floats (floating objects that span the whole
6587 % |\textwidth|) are placed at the top of a text page in two-column
6588 % mode, the separation between the float and the text is controlled
6589 % by |\dblfloatsep| and |\dbltextfloatsep|. They are rubber lengths.
6590 %
6591 % |\dblfloatsep| is the space between adjacent double-column floats
6592 % placed at the top of the text page.
6593 %
6594 % |\dbltextfloatsep| is the space between the main text and
6595 % double-column floats at the top of the page.
6596 % \begin{macrocode}
6597 \newskip\dblfloatsep
6598 \newskip\dbltextfloatsep
6599 \setlength\dblfloatsep {12\p@ \@plus 2\p@ \@minus 2\p@}
6600 \setlength\dbltextfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@}
6601 % \end{macrocode}
6602 % \end{macro}
6603 % \end{macro}
6604 %
6605 % \paragraph{Floats on their own page or column}
6606 %
6607 % \begin{macro}{\@fptop}
6608 % \begin{macro}{\@fpsep}
6609 % \begin{macro}{\@fpbot}
6610 % When floating objects are placed on a separate page or column,
6611 % called a `float page', the layout of the page is controlled by
6612 % these parameters, which are rubber lengths.
6613 %
6614 % At the top of the page |\@fptop| is inserted;
6615 % typically this supplies some stretchable whitespace.
6616 % At the bottom of the page |\@fpbot| is inserted.
6617 % Between adjacent floats |\@fpsep| is inserted.
6618 %
6619 % These parameters are used for all floating objects on a
6620 % `float page' in one-column mode, and for single-column
6621 % floats in two-column mode.
6622 %
6623 % Note that at least one of the two parameters |\@fptop| and
6624 % |\@fpbot| should contain a |plus ...fil| so as to fill the
6625 % remaining empty space.
6626 % \begin{macrocode}
6627 \newskip\@fptop
6628 \newskip\@fpsep
6629 \newskip\@fpbot
6630 \setlength\@fptop{0\p@ \@plus 1fil}
6631 \setlength\@fpsep{8\p@ \@plus 2fil}
6632 \setlength\@fpbot{0\p@ \@plus 1fil}
6633 % \end{macrocode}
6634 % \end{macro}
6635 % \end{macro}
6636 % \end{macro}
6637 %
6638 % \begin{macro}{\@dblfptop}
6639 % \begin{macro}{\@dblfpsep}
6640 % \begin{macro}{\@dblfpbot}
6641 % Double-column `float pages' in two-column mode use similar
6642 % parameters.
6643 % \begin{macrocode}
6644 \newskip\@dblfptop
6645 \newskip\@dblfpsep
6646 \newskip\@dblfpbot
6647 \setlength\@dblfptop{0\p@ \@plus 1fil}
6648 \setlength\@dblfpsep{8\p@ \@plus 2fil}
6649 \setlength\@dblfpbot{0\p@ \@plus 1fil}
6650 % \end{macrocode}
6651 % \end{macro}
6652 % \end{macro}
6653 % \end{macro}
6654 %
6655 % \begin{macro}{\topfigrule}
6656 % \begin{macro}{\botfigrule}
6657 % \begin{macro}{\dblfigrule}
6658 % The macros can be used to put in rules between floats and text;
6659 % whatever they insert should be vertical mode material which takes
6660 % up zero space.
6661 % \task{CAR}{Add more rules (for Frank in addtocurcol)}
6662 % \begin{macrocode}
6663 \let\topfigrule=\relax
6664 \let\botfigrule=\relax
6665 \let\dblfigrule=\relax
6666 %</2ekernel>
6667 % \end{macrocode}
6668 % \end{macro}
6669 % \end{macro}
6670 % \end{macro}
6671 %
6672 %
6673 % \Finale
6674 \endinput