1 % \iffalse meta-comment
4 % The LaTeX3 Project and any individual authors listed elsewhere
7 % This file is part of the LaTeX base system.
8 % -------------------------------------------
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 % http://www.latex-project.org/lppl.txt
15 % and version 1.3c or later is part of all distributions of LaTeX
16 % version 2005/12/01 or later.
18 % This file has the LPPL maintenance status "maintained".
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
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.
30 %%% From File: ltoutput.dtx
31 %<flafter>\ProvidesPackage{flafter}
32 %<fltrace>\ProvidesPackage{fltrace}
33 %<flafter,fltrace> [2017/03/10 v1.3c
34 %<flafter> Standard LaTeX floats after reference (FMi)]
35 %<fltrace> Tracing LaTeX floats algorithm (FMi)]
39 \ProvidesFile{ltoutput.dtx}
40 [2017/03/10 v1.3c LaTeX Kernel (Output Routine)]
42 \documentclass{ltxdoc}
43 \GetFileInfo{ltoutput.dtx}
46 \author{Leslie Lamport, Frank Mittelbach, Chris Rowley}
48 \MaintainedByLaTeXTeam{latex}
59 % Copyright (C) 1992 by Leslie Lamport
60 % Copyright (C) 1994-2000 by Leslie Lamport, LaTeX3 project
62 % LaTeX 2e kernel file for the output routine.
64 % Part of this file is the latest (not greatest, it still
65 % deserves its name) version of kludge.sty.
67 % It also contains a few enhancements and many changes (corrections
68 % and tidyings) to the float mechanism and other parts of the output
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
75 % ============================
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
85 % \changes{v1.0l}{1994/03/15}{Removed duplicated code and corrected
87 % \changes{v1.0m}{1994/04/24}{Removed some long lines and other
89 % \changes{v1.0m}{1994/04/24}{Corrected unverbed commands in
91 % \changes{v1.0m}{1994/04/24}{Changed \cs{@normalsize} to
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
97 % \changes{v1.0n}{1994/04/30}{Documentation tidied.}
98 % \changes{v1.0n}{1994/04/30}{\cs{@activechar@warning} changed to an
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
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
110 % \changes{v1.0u}{1994/05/23}{Added \cs{MessageBreak}.}
111 % \changes{v1.0u}{1994/05/23}{Changed resetting of \cs{protect} after
113 % \changes{v1.0v}{1994/05/25}{Extra documentation.}
114 % \changes{v1.0w}{1994/06/01}{Tidied up typesetting.}
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}
128 % \section{Output Routine}
130 % \subsection{Floats}
132 % The `2ekernel' code ensures that a |\usepackage{autoout1}| is
133 % essentially ignored if a `full' format is being used that has
134 % the autoload file mode already in the format.
138 %<defx>\nfss@catcodes
139 %<2ekernel>\expandafter\let\csname ver@autoout1.sty\endcsname\fmtversion
143 % \begin{oldcomments}
148 % ****************************************
150 % ****************************************
153 % PAGE LAYOUT PARAMETERS
155 % \topmargin : Extra space added to top of page.
156 % @twoside : boolean. T if two-sided printing
157 % \oddsidemargin : IF @twoside = T
158 % THEN extra space added to left of odd-numbered
160 % ELSE extra space added to left of all pages.
161 % \evensidemargin : IF @twoside = T
162 % THEN extra space added to left of even-numbered
164 % \headheight : height of head
165 % \headsep : separation between head and text
166 % \footskip : distance separation between baseline of last
167 % line of text and baseline of foot.
168 % Note difference between \footSKIP and \headSEP.
169 % \textheight : height of text on page, excluding head and foot
170 % \textwidth : width of printing on page
171 % \columnsep : IF @twocolumn = T
172 % THEN width of space between columns
173 % \columnseprule : IF @twocolumn = T
174 % THEN width of rule between columns (0 if none).
175 % \columnwidth : IF @twocolumn = T
176 % THEN (\textwidth - \columnsep)/2
178 % It is set by the \twocolumn and
179 % \onecolumn commands.
180 % \@textbottom : Command executed at bottom of vbox holding text of
181 % page (including figures). The \raggedbottom
182 % command almost \let's this to \vfil (actually sets
183 % it to \vskip \z@ plus.0001fil).
184 % Should have depth 0pt.
186 % \@texttop : Command executed at top of vbox holding text of
187 % page (including figures). Used by letter style;
188 % can also be used to produce centered pages.
189 % Let to \relax by \raggedbottom and \flushbottom.
191 % Page layout must initialize \@colht and \@colroom to \textheight.
193 % PAGE STYLE PARAMETERS:
195 % \floatsep : Space left between floats.
196 % \textfloatsep : Space between last top float or first bottom float
198 % \topfigrule : Command to place rule (or whatever) between floats
199 % at top of page and text. Executed in inner
200 % vertical mode right before the \textfloatsep skip
201 % separating the floats from the text. Must occupy
202 % zero vertical space. (See \footnoterule.)
203 % \botfigrule : Same as \topfigrule, but put after the
204 % \textfloatsep skip separating text from the
205 % floats at bottom of page.
206 % \intextsep : Space left on top and bottom of an in-text float.
207 % \dblfloatsep : Space between double-column floats.
208 % \dbltextfloatsep : Space between top double-column floats
210 % \dblfigrule : Similar to \topfigrule, but for double-column
212 % \@fptop : Glue to go at top of float column -- must be 0pt +
214 % \@fpsep : Glue to go between floats in a float column.
215 % \@fpbot : Glue to go at bottom of float column
218 % \@dblfptop, \@dblfpsep, \@dblfpbot
219 % : Analogous for double-column float page in
222 % FOOTNOTES: As in PLAIN, footnotes use \insert\footins.
224 % PAGE LAYOUT SWITCHES AND MACROS
226 % @twocolumn : Boolean. T if two columns per page globally.
228 % PAGE STYLE MACROS AND SWITCHES
230 % \@oddhead : IF @twoside = T
231 % THEN macro to generate head of odd-numbered
233 % ELSE macro to generate head of all pages.
234 % \@evenhead : IF @twoside = T
235 % THEN macro to generate head of even-numbered
237 % \@oddfoot : IF @twoside = T
238 % THEN macro to generate foot of odd-numbered
240 % ELSE macro to generate foot of all pages.
241 % \@evenfoot : IF @twoside = T
242 % THEN macro to generate foot of even-numbered
244 % @specialpage : boolean. T if current page is to have a special
246 % \@specialstyle : If its value is foo then
247 % IF @specialpage = T
248 % THEN the command \ps@foo is executed to
249 % temporarily reset the page style parameters
250 % before composing the current page.
251 % This command should execute only \def's and
252 % \edef's, making only local definitions.
254 % FLOAT PLACEMENT PARAMETERS
256 % The following parameters are set by the macro \@floatplacement.
257 % When \@floatplacement is called,
258 % \@colht is the height of the page or column being built. I.e.:
259 % * For single-column page it equals \textheight.
260 % * For double-column page it equals \textheight - height
261 % of double-column floats on page.
262 % Note that some are set globally and some locally:
263 % \@topnum :=G Maximum number of floats allowed on the top of a
265 % \@toproom :=G Maximum amount of top of column devoted to floats--
266 % excluding \textfloatsep separation below the floats
267 % and \floatsep separation between them. For
268 % two-column output, should be computed as a function
270 % \@botnum, \@botroom
271 % : Analogous to above.
272 % \@colnum :=G Maximum number of floats allowed in a column,
273 % including in-text floats.
274 % \@textmin :=L Minimum amount of text (excluding footnotes) that
275 % must appear on a text page.
276 % %% 27 Sep 85 : made local to
277 % %% \@addtocurcol and \@addtonextcol
278 % It is now also used locally in processing double
280 % \@fpmin :=L Minimum height of floats in a float column.
282 % The macro \@dblfloatplacement sets the following parameters.
283 % \@dbltopnum :=G Maximum number of double-column floats allowed at
284 % the top of a two-column page.
285 % \@dbltoproom :=G Maximum height of double-column floats allowed at
286 % top of two-column page.
287 % \@fpmin :=L Minimum height of floats in a float column.
288 % It should also perform the following local assignments where necessary
289 % -- i.e., where the new value differs from the old one:
290 % \@fptop :=L \@dblfptop
291 % \@fpsep :=L \@dblfpsep
292 % \@fpbot :=L \@dblfpbot
294 % OUTPUT ROUTINE VARIABLES
296 % \@colht : The total height of the current column. In single column
297 % style, it equals \textheight. In two-column style, it is
298 % \textheight minus the height of the double-column floats
299 % on the current page. MUST BE INITIALIZED TO \textheight.
301 % \@colroom : The height available in the current column for text and
302 % footnotes. It equals \@colht minus the height of all
303 % floats committed to the top and bottom of the current
306 % \@textfloatsheight : The total height of in-text floats on the
309 % \footins : Footnote insertion number.
311 % \@maxdepth : Saved value of TeX's \maxdepth. Must be set
312 % when any routine sets \maxdepth.
314 % CALLING THE OUTPUT ROUTINE
315 % --------------------------
317 % The output routine is called either by TeX's normal page-breaking
318 % mechanism, or by a macro putting a penalty < or = -10000 in the output
319 % list. In the latter case, the penalty indicates why the output
320 % routine was called, using the following code.
326 % -10001 \clearpage (\penalty -10000 \vbox{} \penalty -10001)
327 % -10002 float insertion, called from horizontal mode
328 % -10003 float insertion, called from vertical mode.
329 % -10004 float insertion.
331 % Note: A float or marginpar puts the following sequence in the output
332 % list: (i) a penalty of -10004,
334 % (iii) a penalty of -10002 or -10003.
335 % This solves two special problems:
336 % 1. If the float comes right after a \newpage or \clearpage,
337 % then the first penalty is ignored, but the second one
338 % invokes the output routine.
339 % 2. If there is a split footnote on the page, the second 'page'
340 % puts out the rest of the footnote.
345 % FUNCTIONS USED IN THE OUTPUT ROUTINE:
347 % \@outputpage : Produces an output page with the contents of box
348 % \@outputbox as the text part.
349 % Also sets \@colht :=G \textheight.
350 % The page style is determined as follows.
351 % IF @thispagestyle = true
352 % THEN use \thispagestyle style
353 % ELSE use ordinary page style.
355 % \@tryfcolumn\FLIST : Tries to form a float column composed of floats
356 % from \FLIST (if nonempty) with the following parameters:
357 % \@colht : height of box
358 % \@fpmin : minimum height of floats in the box
359 % \@fpsep : interfloat space
360 % \@fptop : glue at top of box
361 % \@fpbot : glue at bottom of box.
362 % If it succeeds, then it does the following:
363 % * \@outputbox :=L the composed float box.
364 % * @fcolmade :=G true
365 % * \FLIST :=G \FLIST - floats put in box
366 % * \@freelist :=G \@freelist + floats put in box
368 % * @fcolmade :=G false
369 % NOTE: BIT MUST BE A SINGLE TOKEN!
371 % \@makefcolumn \FLIST : Same as \@tryfcolumn except that it
372 % fails to make a float column only if \FLIST is empty.
373 % Otherwise, it makes a float column containing at least
374 % the first box in \FLIST, disregarding \@fpmin.
377 % Calls \@tryfcolumn\@deferlist. If \@tryfcolumn returns with
378 % (globally set) @fcolmade = false, then:
379 % * Globally sets \@toplist and \@botlist to floats
380 % from \@deferlist to go at top and bottom of column,
381 % deleting them from \@deferlist. It does
382 % this using \@colht as the total height, the page
383 % style parameters \@floatsep and \@textfloatsep, and
384 % the float placement parameters \@topnum, \@toproom,
385 % \@botnum, \@botroom, \@colnum and \textfraction.
386 % * Globally sets \@colroom to \@colht minus the height
387 % of the added floats.
390 % Calls \@tryfcolumn\@dbldeferlist{8}. If \@tryfcolumn returns
391 % with (globally set) @fcolmade = false, then:
392 % * Globally sets \@dbltoplist to floats from
393 % \@dbldeferlist to go at top and bottom of column,
394 % deleting them from \@dbldeferlist.
395 % It does this using \textheight as the
396 % total height, and the parameters \@dblfloatsep, etc.
397 % * Globally sets \@colht to \textheight minus the height
398 % of the added floats.
400 % \@combinefloats : Combines the text from box
401 % \@outputbox with the floats from \@toplist and \@botlist,
402 % putting the new box in \@outputbox. It uses \floatsep
403 % and \textfloatsep for the appropriate separations.
404 % It puts the elements of \TOPLIST and \BOTLIST onto
405 % \@freelist, and makes those lists null.
407 % \@makecol : Makes the contents of \box255 plus the accumulated
408 % footnotes, plus the floats in \@toplist and \@botlist,
409 % into a single column of height \@colht (unless the page
410 % height has been locally changed), which it puts
411 % into box \@outputbox. It puts boxes in \@midlist back
412 % onto \@freelist and restores \maxdepth.
414 % \@opcol : Outputs a column whose text is in box \@outputbox
415 % If @twocolumn = false, then it calls \@outputpage,
416 % sets \@colht :=G \textheight, and calls \@floatplacement.
418 % If @twocolumn = true, then:
419 % If @firstcolumn = true, then it puts box \@outputbox
420 % into \@leftcolumn and sets @firstcolumn :=G false.
422 % If @firstcolumn = false, then it puts out the current
423 % two-column page, any possible two-column float pages,
424 % and determines \@dbltoplist for the next page.
428 % USER COMMANDS THAT CALL OR AFFECT THE OUTPUT ROUTINE
429 % ----------------------------------------------------
431 % \newpage == BEGIN \par\vfil\penalty -10000 END
433 % \clearpage == BEGIN \newpage
434 % \write -1{} % Part of hack to make sure no
435 % \vbox{} % \write's get lost.
439 % \cleardoublepage == BEGIN \clearpage
440 % if @twoside = true and c@page is even
441 % then \hbox{} \newpage fi
445 % \twocolumn[BOX] : starts a new page, changing to twocolumn setting
446 % and puts BOX in a parbox of width \textwidth across the top.
447 % Useful for full-width titles for double-column pages.
448 % SURPRISE: The stretch from \@dbltextfloatsep will be inserted
449 % between the BOX and the top of the two columns.
452 % FLOAT-HANDLING MECHANISMS
453 % -------------------------
455 % The float environment obtains an insertion number B from the
456 % \@freelist (see below for a description of list manipulation), puts
457 % the float into box B and sets \count B to a FLOAT SPECIFIER. For
458 % a normal (not double-column) float, it then causes a page break
459 % in one of the following two ways:
460 % - In outer hmode: \vadjust{\penalty -10002}
461 % - In vmode : \penalty -10003.
462 % For a double-column float, it puts B onto the \@dbldeferlist.
463 % The float specifier has two components:
464 % * A PLACEMENT SPECIFICATION, describing where the float may
466 % * A TYPE, which is a power of two--e.g., figures might be
467 % type 1 floats, tables type 2 floats, programs type 4 floats, etc.
468 % The float specifier is encoded as follows, where bit 0 is the least
473 % 0 1 iff the float may go where it appears in the text.
474 % 1 1 iff the float may go on the top of a page.
475 % 2 1 iff the float may go on the bottom of a page.
476 % 3 1 iff the float may go on a float page.
477 % 4 1 unless the PLACEMENT includes a !
478 % 5 1 iff a type 1 float
479 % 6 1 iff a type 2 float
482 % A negative float specifier is used to indicate a marginal note.
484 % MACROS AND DATA STRUCTURES FOR PROCESSING FLOATS
485 % ------------------------------------------------
487 % A FLOAT LIST consisting of the floats in boxes \boxa ... \boxN has
489 % \@elt \boxa ... \@elt \boxN
490 % where \boxI is defined by
492 % Normally, \@elt is \let to \relax. A test can be performed on the
493 % entire float list by locally \def'ing \@elt appropriately and
494 % executing the list.
495 % This is a lot more efficient than looping through the list.
497 % The following macros are used for manipulating float lists.
499 % \@next \CS \LIST {NONEMPTY}{EMPTY} == %% NOTE: ASSUME \@elt = \relax
500 % BEGIN assume that \LIST == \@elt \B1 ... \@elt \Bn
504 % \LIST :=G \@elt \B2 ... \@elt \Bn
510 % \@bitor\NUM\LIST : Globally sets switch @test to the disjunction for
511 % all I of bit log2 \NUM of the float specifiers of all the
513 % I.e., @test is set to true iff there is at least one
514 % float in \LIST having bit log2 \NUM of its float specifier
517 % Note: log2 [(\count I)/32] is the bit number corresponding to the
518 % type of float I. To see if there is any float in \LIST having
519 % the same type as float I, you run \@bitor with
520 % \NUM = [(\count I)/32] * 32.
522 % \@bitor\NUM\LIST ==
525 % { \@elt \CTR == if \NUM <> 0 then
526 % if \count\CTR / \NUM is odd
527 % then @test := true fi fi
533 % \@cons\LIST\NUM : Globally sets \LIST := \LIST * \@elt \NUM
536 % BEGIN { \@elt == \relax
537 % \LIST :=G \LIST \@elt \NUM
540 % BOX LISTS FOR FLOAT-PLACEMENT ALGORITHMS
542 % \@freelist : List of empty boxes for placing new floats.
543 % \@toplist : List of floats to go at top of current column.
544 % \@midlist : List of floats in middle of current column.
545 % \@botlist : List of floats to go at bottom of current column.
546 % \@deferlist : List of floats to go after current column.
547 % \@dbltoplist : List of double-col. floats to go at top of current
549 % \@dbldeferlist : List of double-column floats to go on subsequent
552 % FLOAT-PLACEMENT ALGORITHMS
555 % \@addtobot : Tries to put insert \@currbox on \@botlist.
557 % * \ht BOX < \@colroom
558 % * type of \@currbox not on \@deferlist
561 % If it succeeds, then:
562 % * sets @insert true
563 % * decrements \@botroom by \ht BOX
564 % * decrements \@botnum and \@colnum by 1
565 % * decrements \@colroom by \ht BOX + either \floatsep
566 % or \textfloatsep, as appropriate.
567 % * sets \maxdepth to 0pt
569 % \@addtotoporbot : Tries to put insert \@currbox on \@toplist or
571 % Called only under same conditions as \@addtobot.
572 % If it succeeds, then:
573 % * sets @insert true
574 % * decrements \@toproom or \@botroom by \ht BOX
575 % * decrements \@colnum and either \@topnum or
577 % * decrements \@colroom by \ht BOX + \floatsep
578 % or \textfloatsep, as appropriate.
580 % \@addtocurcol : Tries to add \@currbox to current column, setting
581 % @insert true if it succeeds, false otherwise.
582 % It will add \@currbox to top only if bit 0 of
583 % \count \@currbox is 0, and to the bottom only if
584 % bit 0 = 0 or an earlier float of the same type is
586 % If the float is put in the text, then
587 % \penalty\interlinepenalty is put
588 % right after the float, before the following \vskip,
589 % and \outputpenalty :=L 0.
591 % \@addtonextcol : Tries to add \@currbox to the next column, setting
592 % @insert true if it succeeds, false otherwise.
594 % \@addtodblcol : Tries to add \@currbox to the next double-column page,
595 % adding it to \@dbltoplist if it succeeds and
596 % \@dbldeferlist if it fails.
601 % if \@currlist nonempty
602 % then remove \@marbox from \@currlist
603 % add \@marbox and \@currbox to \@freelist
604 % %% NOTE: \@currbox = left box
605 % else LaTeX error: ? %% shouldn't happen
607 % \@tempcnta := 1 %% 1 = right, -1 = left
608 % if @twocolumn = true
609 % then if @firstcolumn = true
610 % then \@tempcnta := -1
612 % else if @mparswitch = true
614 % else \@tempcnta := -1
617 % if @reversemargin = true
618 % then \@tempcnta := -\@tempcnta
621 % if \@tempcnta < 0 then \box\@marbox :=G \box\@currbox
623 % \@tempdima :=L maximum(\@mparbottom - \@pageht
624 % + ht of \@marbox, 0)
625 % if \@tempdima > 0 then LaTeX warning: 'marginpar moved' fi
626 % \@mparbottom :=G \@pageht + \@tempdima + depth of \@marbox
628 % \@tempdima :=L \@tempdima - ht of \@marbox
629 % \box\@marbox :=G \box\@currbox
630 % \vbox { \vskip \@tempdima
633 % height of \@marbox :=G depth of \@marbox :=G 0
636 % \hbox{ if @tempcnta > 0 then \hskip \columnwidth
637 % \hskip \marginparsep
638 % else \hskip -\marginparsep
639 % \hskip -\marginparwidth
645 % \hbox{\vrule height 0 width 0 depth \@pagedp}
648 % Floats and marginpars add a lot of dead cycles.
659 \def\@next#1#2#3#4{\ifx#2\@empty #4\else
660 \expandafter\@xnext #2\@@#1#2#3\fi}
664 \def\@xnext \@elt #1#2\@@#3#4{\def#3{#1}\gdef#4{#2}}
667 % \changes{v1.1v}{1996/07/26}{put \cs{global} into definition}
669 \def\@testfalse{\global\let\if@test\iffalse}
670 \def\@testtrue {\global\let\if@test\iftrue}
674 % \changes{v1.1v}{1996/07/26}{remove \cs{global} before \cs{@test...}}
676 \def\@bitor#1#2{\@testfalse {\let\@elt\@xbitor
677 \@tempcnta #1\relax #2}}
679 % RmS 91/11/22: Added test for |\count#1 = 0|.
680 % Suggested by Chris Rowley.
683 % \changes{v1.1v}{1996/07/26}{remove \cs{global} before \cs{@test...}}
685 \def\@xbitor #1{\@tempcntb \count#1
686 \ifnum \@tempcnta =\z@
688 \divide\@tempcntb\@tempcnta
689 \ifodd\@tempcntb \@testtrue\fi
693 % DEFINITION OF FLOAT BOXES:
694 % \changes{v1.3a}{2015/09/205}
695 % {extended \cs{@freelist}}
698 %<latexrelease>\IncludeInRelease{2015/10/01}%
699 %<latexrelease> {\bx@ZZ}{Extended float list}%
700 %<*2ekernel|latexrelease>
704 \@elt\bx@A\@elt\bx@B\@elt\bx@C\@elt\bx@D\@elt\bx@E
705 \@elt\bx@F\@elt\bx@G\@elt\bx@H\@elt\bx@I\@elt\bx@J
706 \@elt\bx@K\@elt\bx@L\@elt\bx@M\@elt\bx@N
707 \@elt\bx@O\@elt\bx@P\@elt\bx@Q\@elt\bx@R}
710 \ifx\numexpr\@undefined\else
712 \@elt\bx@S\@elt\bx@T\@elt\bx@U\@elt\bx@V
713 \@elt\bx@W\@elt\bx@X\@elt\bx@Y\@elt\bx@Z
714 \@elt\bx@AA\@elt\bx@BB\@elt\bx@CC\@elt\bx@DD\@elt\bx@EE
715 \@elt\bx@FF\@elt\bx@GG\@elt\bx@HH\@elt\bx@II\@elt\bx@JJ
716 \@elt\bx@KK\@elt\bx@LL\@elt\bx@MM\@elt\bx@NN
717 \@elt\bx@OO\@elt\bx@PP\@elt\bx@QQ\@elt\bx@RR
718 \@elt\bx@SS\@elt\bx@TT\@elt\bx@UU\@elt\bx@VV
719 \@elt\bx@WW\@elt\bx@XX\@elt\bx@YY\@elt\bx@ZZ}
721 \def\@elt{\noexpand\@elt\noexpand}
722 \edef\@freelist{\@freelist\reserved@a}
724 \let\reserved@a\relax
726 %</2ekernel|latexrelease>
727 %<latexrelease>\EndIncludeInRelease
728 %<latexrelease>\IncludeInRelease{0000/00/00}%
729 %<latexrelease> {\bx@ZZ}{Extended float list}%
730 %<latexrelease>\def\@freelist{%
731 %<latexrelease> \@elt\bx@A\@elt\bx@B\@elt\bx@C\@elt\bx@D\@elt\bx@E
732 %<latexrelease> \@elt\bx@F\@elt\bx@G\@elt\bx@H\@elt\bx@I\@elt\bx@J
733 %<latexrelease> \@elt\bx@K\@elt\bx@L\@elt\bx@M\@elt\bx@N
734 %<latexrelease> \@elt\bx@O\@elt\bx@P\@elt\bx@Q\@elt\bx@R}
735 %<latexrelease> \insc@unt=234
736 %<latexrelease>\EndIncludeInRelease
748 % \changes{v1.2m}{2015/03/12}
749 % {initialise \cs{@dbldeferlist} again}
750 % The new algorithm stores page wide floats together with column floats
751 % in a single |\@deferlist| list. We keep |\@dbldeferlist|
752 % initialised as empty so that packages that are testing for
753 % deferred floats can use the same code for old or new float
756 \gdef\@dbldeferlist{}
759 % PAGE LAYOUT PARAMETERS
762 \newdimen\oddsidemargin
763 \newdimen\evensidemargin
764 \let\@themargin=\oddsidemargin
770 \newdimen\columnwidth
772 \newdimen\columnseprule
773 \newdimen\marginparwidth
774 \newdimen\marginparsep
775 \newdimen\marginparpush
778 % \begin{macro}{\AtBeginDvi}
779 % \changes{v1.1c}{1994/11/05}
781 % \begin{macro}{\@begindvibox}
782 % \changes{v1.1c}{1994/11/05}
784 % \changes{v1.1f}{1994/11/14}{Use normal box register: why a box?}
785 % \changes{v1.1l}{1995/04/24}{Add \cs{vbox} latex/1392}
787 % We use a box register in which to put
788 % stuff that must appear before anything else in the
791 % The stuff in the box should not add any typeset material to the
792 % page when it is unboxed.
795 \def \AtBeginDvi #1{%
796 \global \setbox \@begindvibox
797 \vbox{\unvbox \@begindvibox #1}%
803 % \begin{macro}{\@maxdepth}
804 % This is not the right place to set this; it needs to be set in a
805 % class/style file when |\maxdepth| is set.
807 % Also, many settings to |\maxdepth| should be to |\@maxdepth|,
809 % \task{All}{Sort out maxdepth: both should be set in the class files.}
812 \@maxdepth = \maxdepth
815 % \begin{macro}{\paperheight}
816 % \changes{v0.1a}{1993/11/23}{Register added}
817 % \begin{macro}{\paperwidth}
818 % \changes{v0.1a}{1993/11/23}{Register added}
819 % New |\paper|\ldots\ registers.
821 \newdimen\paperheight
827 % \begin{macro}{\if@insert}
828 % \begin{macro}{\if@fcolmade}
829 % \begin{macro}{\if@specialpage}
830 % \begin{macro}{\if@firstcolumn}
831 % \begin{macro}{\if@twocolumn}
832 % \begin{macro}{\if@twoside}
833 % \begin{macro}{\if@reversemarginpar}
834 % \begin{macro}{\if@mparswitch}
835 % \begin{macro}{\col@number}
836 % \changes{v1.0n}{1994/04/30}{Added \cs{col@number}}
837 % Local switches first:
841 % These should definitely be global:
844 \newif \if@specialpage \@specialpagefalse
846 % These should be global but are not always set globally in other
849 \newif \if@firstcolumn \@firstcolumntrue
850 \newif \if@twocolumn \@twocolumnfalse
852 % Not sure about these: two questions.
853 % Should things which must apply to a whole document be local or
854 % global (they probably should be `preamble only' commands)?
855 % Are these three such things?
857 \newif \if@twoside \@twosidefalse
858 \newif \if@reversemargin \@reversemarginfalse
859 \newif \if@mparswitch \@mparswitchfalse
861 % This counter has been imported from `multicol'.
863 \newcount \col@number
876 % \begin{oldcomments}
883 \newdimen\@dbltoproom
893 \newdimen\@mparbottom \@mparbottom\z@
901 \def\@thehead{\@oddhead} % initialization
902 \def\@thefoot{\@oddfoot}
906 % \begin{macro}{\clearpage}
907 % \changes{v1.1r}{1995/10/11}{Added a check so that it does not lose
908 % the argument of \cs{twocolumn[...]}}
910 % The tests at the beginning are an experimental attempt to avoid a
911 % completely empty page after a |\twocolumn[...]|. This prevents the
912 % text from the argument vanishing into a float box, never to be seen
913 % again. We hope that it does not produce wrong formatting in other
915 % \changes{v1.1v}{1996/07/26}{add number of missing percents}
919 \ifnum \@dbltopnum =\m@ne
920 \ifdim \pagetotal <\topskip
933 % \begin{macro}{\cleardoublepage}
936 \def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
937 \hbox{}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi}
942 % \begin{macro}{\onecolumn}
943 % \changes{v1.0n}{1994/04/30}{Added setting of \cs{col@number}}
948 \global\columnwidth\textwidth
949 \global\hsize\columnwidth
950 \global\linewidth\columnwidth
951 \global\@twocolumnfalse
957 % \begin{macro}{\newpage}
958 % \changes{v1.1x}{1996/09/29}{Checks for noskipsec and inlabel added}
959 % \changes{v1.1x}{1996/09/29}{Checks for noskipsec and inlabel added}
960 % \changes{v1.1y}{1996/09/30}{Checks for noskipsec and inlabel removed
961 % pending further tests}
962 % \changes{v1.1z}{1996/10/24}{Better checks for noskipsec and
963 % inlabel added, plus nobreak}
964 % \changes{v1.2a}{1996/10/25}{Reset all flags explicitly}
965 % The two checks at the beginning ensure that an item label or
966 % run-in section title immediately before a |\newpage| get printed
967 % on the correct page, the one before the page break.
969 % All three tests are largely to make error processing more robust;
970 % that is why they all reset the flags explicitly, even when it
971 % would appear that this would be done by a |\leavevmode|.
975 \ifx \@nodocument\relax
977 \global \@noskipsecfalse
982 \global \@inlabelfalse
984 \if@nobreak \@nobreakfalse \everypar{}\fi
991 % \begin{macro}{\@emptycol}
992 % \changes{v1.0n}{1994/04/30}{Empty column action added:
994 % It may be better to use an invisible rule rather than an empty
997 \def \@emptycol {\vbox{}\penalty -\@M}
1001 % \begin{macro}{\twocolumn}
1002 % \begin{macro}{\@topnewpage}
1003 % \changes{v1.0f}{1993/12/05}{Commands changed}
1004 % \changes{v1.0g}{1993/12/06}{\cs{@floatplacement} placement bug
1006 % \changes{v1.0j}{1993/12/17}{check for vsize too small added}
1007 % \changes{v1.2c}{1997/11/09}{Documentation of vsize check enhanced}
1008 % There are several bug fixes to the two-column stuff here.
1010 % \changes{v1.0n}{1994/04/30}{Added setting of \cs{col@number}}
1014 \global\columnwidth\textwidth
1015 \global\advance\columnwidth-\columnsep
1016 \global\divide\columnwidth\tw@
1017 \global\hsize\columnwidth
1018 \global\linewidth\columnwidth
1019 \global\@twocolumntrue
1020 \global\@firstcolumntrue
1023 % There is no reason to put a |\@dblfloatplacement| here since
1024 % |\@topnewpage| ignores these settings.
1025 % The |\@floatplacement| is needed in case this comes after some
1027 % \changes{v1.0h}{1993/12/12}{braces removed}
1029 \@ifnextchar [\@topnewpage\@floatplacement
1033 % Note that here, getting a box from the freelist can assume
1034 % success since this comes just after a |\clearpage|.
1035 % \changes{v1.0n}{1994/04/30}{Added setting of \cs{col@number}}
1036 % \changes{v1.1a}{1994/10/31}
1037 % {(DPC/CAR) Use \cs{color@begingroup} for colour}
1038 % \changes{v1.1a}{1994/10/31}
1039 % {(DPC/CAR) Use \cs{normalcolor}}
1040 % \changes{v1.1a}{1994/10/31}
1041 % {(DPC/CAR) Extra box added to remove colour resetting from vmode}
1042 % \changes{v1.1b}{1994/11/05}
1043 % {Use new \cs{color@hbox} concept.}
1044 % \changes{v1.1i}{1994/11/21}{Changed to \cs{color@vbox}}
1045 % \changes{v1.1z}{1996/10/24}{Added \cs{@nodocument} to trap
1046 % \cs{twocolumn} in the preamble}
1048 \long\def \@topnewpage [#1]{%
1050 \@next\@currbox\@freelist{}{}%
1051 \global \setbox\@currbox
1059 \vskip -\dbltextfloatsep
1063 % Added size test and warning message; perhaps we should use
1065 % \changes{v1.0l}{1994/03/15}{Corrected and amended warning message}
1066 % \changes{v1.0m}{1994/04/24}{Warning message removed as it will be
1069 \ifdim \ht\@currbox>\textheight
1070 \ht\@currbox \textheight
1073 % This next line is not essential but it is more robust to make this
1074 % value non-zero, in case of weird errors.
1076 % This next bit is what is needed from |\@addtodblcol|, plus some
1077 % extra checks for error trapping.
1079 \global \count\@currbox \tw@
1080 \@tempdima -\ht\@currbox
1081 \advance \@tempdima -\dbltextfloatsep
1082 \global \advance \@colht \@tempdima
1083 \ifx \@dbltoplist \@empty
1085 \@latexerr{Float(s) lost}\@ehb
1086 \let \@dbltoplist \@empty
1088 \@cons \@dbltoplist \@currbox
1090 % This setting of |\@dbltopnum| is used only to change the
1091 % typesetting in\\ |\@combinedblfloats|.
1093 \global \@dbltopnum \m@ne
1095 \fl@trace{dbltopnum set to -1 (= \the \@dbltopnum) (topnewpage)}%
1098 % At points such as this we need to check that there is still a
1099 % minimal amount of room left on the page; this uses an arbitrary
1100 % small value at present; but note that this value is larger than
1101 % that used when checking that page is too full of normal floats.
1103 % If there is little room left we just force a page-break, OK?
1104 % This involves producing two empty columns. The second empty
1105 % column may be produced by |\output|, in which case an extra,
1106 % misleading, warning will be generated, OK? (This happens only
1107 % when there is too little room left on the page for any float.)
1108 % Otherwise (\ie if the size is such that it is allowed as a normal
1109 % float) the extra |\@emptycol| will be invoked in the second
1110 % column by the conditional code guarded by the |\if@firstcolumn|
1113 % I now think that the cut-off point here should be |3\baselineskip|,
1114 % but we make it a bit less so that 3 lines of text will be
1117 % Since this happens only when there is nothing on the page but the
1118 % `top-box', the empty box should not cause any problem other than
1119 % some overfull box messages, which is not entirely misleading.
1121 % Here we need two page-ends since both columns need to be empty.
1122 % \task{???}{Make it less arbitrary?}
1123 % \changes{v1.0j}{1993/12/17}{Page room test added}
1124 % \changes{v1.0l}{1994/03/15}{Warning added: it should be improved}
1125 % \changes{v1.0m}{1994/04/24}{Message changed to give more info}
1126 % \changes{v1.0n}{1994/04/30}{Message changed for Frank}
1127 % \changes{v1.0n}{1994/04/30}{Empty column action added:
1129 % \changes{v1.0n}{1994/04/30}{Cut-off point changed to
1130 % 3\cs{baselineskip}}
1131 % \changes{v1.1t}{1996/05/24}{Cut-off point changed to
1132 % 2.5\cs{baselineskip}}
1134 \ifdim \@colht<2.5\baselineskip
1135 \@latex@warning@no@line {Optional argument of \noexpand\twocolumn
1136 too tall on page \thepage}%
1143 \global \vsize \@colht
1144 \global \@colroom \@colht
1153 % \begin{macro}{\output}
1154 % \changes{v1.0f}{1993/12/05}{Command changed}
1155 % \begin{macro}{\@specialoutput}
1156 % \changes{v0.1c}{1993/11/23}{Command changed}
1157 % \changes{v1.0f}{1993/12/06}{Unboxing of 255 added to rescue writes}
1158 % This needs some small adjustments. We cannot
1159 % guarantee that the float mechanism will interact correctly with
1160 % this stuff, but that mechanism does not always work properly
1161 % with footnotes already.
1165 % added reset of |\par| to the output routine.
1166 % This avoids problems when the output routine is
1167 % called within a list where |\par| may be a no-op.
1172 \ifnum \outputpenalty<-\@M
1178 % Moved to |\@opcol|: |\@floatplacement|.
1182 % This loop could be replaced by an |\expandafter| tail
1183 % recursion in |\@startcolumn|.
1185 \@whilesw \if@fcolmade \fi
1188 \fl@trace{PAGE: float \if@twocolumn column \else page \fi
1191 \@opcol\@startcolumn}%
1193 \ifnum \outputpenalty>-\@Miv
1195 % At points such as this we need to check that there is still a
1196 % minimal amount of room left on the page; this uses an arbitrary
1197 % small value at present. If there is little room left we just
1198 % force a page-break, OK?
1200 % This bit is essential only if a float has just been processed so
1201 % maybe it should be moved; but this is the natural place at which
1202 % to set the vsize and a test would need to be done anyway. A
1203 % check has been added to ensure that there really has been a
1204 % change in the value of |\@colroom|.
1206 % Since this happens only when there is nothing on the page but
1207 % floats, the empty box should not cause any problem other than
1208 % some overfull box messages, which is not entirely misleading.
1210 % The twocolumn case does not need any extra code here since this
1211 % is the |\output| itself; in the second column there will still
1212 % not be enough room left so |\@emptycol| will be executed again
1213 % when the OR is called by the-page builder when it gets to the
1214 % penalty inserted by the first execution. (The page-builder is
1215 % never invoked whilst the OR is being executed since it builds a
1216 % inner vlist; thus any conditional code for the two-column case
1217 % within |\output| may not get executed with the correct value of
1218 % |\if@firstcolumn|.
1220 % \task{???}{Make it less arbitrary?}
1221 % \changes{v1.0j}{1993/12/17}{Page room test added}
1222 % \changes{v1.0m}{1994/04/24}{Message changed to give more info and
1224 % \changes{v1.0n}{1994/04/30}{Extra empty column added for
1225 % twocolumn case (wrong, see below)}
1226 % \changes{v1.0n}{1994/04/30}{Extra empty column added for
1228 % \changes{v1.0n}{1994/04/30}{Empty column action added:
1230 % \changes{v1.0n}{1994/04/30}{Cut-off point changed to
1231 % 2\cs{baselineskip}}
1232 % \changes{v1.1t}{1996/05/24}{Cut-off point changed to
1233 % 1.5\cs{baselineskip}}
1234 % \changes{v1.1t}{1996/05/24}{Check that \cs{@colroom} is less
1235 % than \cs{vsize}, indicating that a float has been added}
1236 % \changes{v1.1u}{1996/05/25}{Correct the above check}
1237 % \changes{v1.2c}{1997/11/09}{Remove incorrect code: only one
1238 % \cs{@emptycol} is needed here}
1240 \ifdim \@colroom<1.5\baselineskip
1241 \ifdim \@colroom<\textheight
1242 \@latex@warning@no@line {Text page \thepage\space
1243 contains only floats}%
1252 \global \vsize \@colroom
1255 \global \vsize \@colroom
1258 \global \vsize \maxdimen
1263 % \begin{oldcomments}
1264 % CHANGES TO \@specialoutput:
1265 % * \penalty\z@ changed to \penalty\interlinepenalty so \samepage
1266 % works properly with figure and table environments.
1267 % (Changed 23 Oct 86)
1269 % * Definition of \@specialoutput changed 26 Feb 88 so \@pageht and
1270 % \@pagedp aren't changed for a marginal note.
1271 % (Change suggested by Chris Rowley.)
1275 \gdef\@specialoutput{%
1276 \ifnum \outputpenalty>-\@Mii
1279 \ifnum \outputpenalty<-\@Miii
1280 \ifnum \outputpenalty<-\@MM \deadcycles \z@ \fi
1281 \global \setbox\@holdpg \vbox {\unvbox\@cclv}%
1284 % Note that |\boxmaxdepth| should not be set here since we wish to
1285 % record the natural depth of the holdpg box.
1287 % This is changed so as to not lose anything, such as writes
1288 % and marks, which may get into box 255 and should be returned to
1289 % the list. This should only happen when the first penalty in the
1290 % mechanism is discarded and therefore |\@holdpg| should always be
1291 % void in this case. This can happen because a penalty is
1292 % discarded whenever there is no box on the list.
1294 % It was just: |\setbox\@tempboxa \box \@cclv|.
1296 % The last box which is removed is the box put there by the
1297 % double-penalty mechanism. The |\unskip| then removes the
1298 % |\topskip| which is put there since the box is the first on the
1300 % \task{CAR/FMi}{Is it more efficient to check whether the holdpg box
1301 % is void and then act accordingly?}
1303 \global \setbox\@holdpg \vbox{%
1307 % We must now remove the box added by the float mechanism and the
1308 % |\topskip| glue therefore added above it by \TeX.
1310 \setbox\@tempboxa \lastbox
1314 % These two are needed as separate dimensions only by
1315 % |\@addmarginpar|; for other purposes we put the whole size into
1316 % |\@pageht| (see below).
1318 \@pagedp \dp\@holdpg
1319 \@pageht \ht\@holdpg
1321 \@next\@currbox\@currlist{%
1322 \ifnum \count\@currbox>\z@
1324 % Putting the whole size into |\@pageht| (see above).
1326 \advance \@pageht \@pagedp
1327 \ifvoid\footins \else
1328 \advance \@pageht \ht\footins
1329 \advance \@pageht \skip\footins
1330 \advance \@pageht \dp\footins
1334 % We want to make the adjustment due to this insert only if the
1335 % non-star form is used. The *-form will probably not work with
1336 % floats, but maybe it still could make some adjustment here even
1339 \ifdim \wd\@kludgeins=\z@
1340 \advance \@pageht \ht\@kludgeins
1342 \fl@trace {Extra size added: \the \ht\@kludgeins}%
1347 % This version puts the inserts back just before the additional
1348 % material; it could be moved earlier, before unboxing the
1349 % page-so-far. Neither is guaranteed not to put things on the wrong
1350 % page. This version is similar to the original version.
1360 % A 2e change: use |\addpenalty| instead of |\penalty| here. Some
1361 % penalty is needed to create a potential break-point immediately
1362 % after the reinserts (or the marginal). Otherwise there can be no
1363 % possibility to break here and this can cause the reinserts or the
1364 % marginal to appear on the next page (which is often incorrect).
1365 % However, if the nobreak flag is true, a |\nobreak| must be
1367 % \changes{v1.1i}{1994/11/21}{Added \cs{if@nobreak} test}
1368 % \changes{v1.1z}{1996/10/24}{Added \cs{nobreak} as appropriate}
1370 \ifnum \outputpenalty<\z@
1374 \addpenalty \interlinepenalty
1380 %</2ekernel|fltrace>
1385 % \begin{macro}{\@testwrongwidth}
1386 % \begin{macro}{\f@depth}
1387 % \changes{v1.2n}{2015/02/21}{macro added(latexrelease)}
1389 % Test if the float box has the wrong width when trying to place it
1390 % into some area. (Actually
1391 % the test is for a conventional depth setting rather than for the
1392 % width of the float. For that reason the box depth was explicitly
1393 % tailored when the float was created).
1395 %<latexrelease>\IncludeInRelease{2015/01/01}%
1396 %<latexrelease> {\@testwrongwidth}{float order in 2-column}%
1397 %<*2ekernel|latexrelease|fltrace>
1401 \def\@testwrongwidth #1{%
1402 \ifdim\dp#1=\f@depth
1405 \ifdim\f@depth=\z@ single \else double \fi
1406 column float -- ok}%
1412 \ifdim\f@depth=\z@ double \else single \fi
1413 column float -- wrong}%
1418 % Normally looking for single column floats, which have zero depth.
1424 %</2ekernel|latexrelease|fltrace>
1425 %<latexrelease>\EndIncludeInRelease
1426 %<latexrelease>\IncludeInRelease{0000/00/00}%
1427 %<latexrelease> {\@testwrongwidth}{float order in 2-column}%
1428 %<latexrelease>\let\@testwrongwidth\@undefined
1429 %<latexrelease>\let\f@depth\@undefined
1430 %<latexrelease>\EndIncludeInRelease
1436 % \begin{macro}{\@doclearpage}
1437 % \task{CAR/FMi}{Investigate better float clearance}
1438 % \task{CAR/FMi}{Put non-boxes back in the `right place', or nowhere?}
1439 % This is a very much an emergency action, just dumping everything:
1440 % footnotes first then floats. A more sophisticated version is
1441 % needed; but even more urgent is a bug-free version (see, for
1442 % example, pr/3528).
1444 % Also, it puts any left-over non-boxes (writes, specials, etc.) back
1445 % after any float pages created: this is a very bad bug since,
1446 % for example, a kludge insert will be in quite the wrong place
1447 % and, worse, be irremovable and uncancelable.
1449 % \changes{v1.2n}{2015/01/14}{float order in 2-column (latexrelease)}
1450 % All the remaining changes are replacing the double column defer list
1451 % or inserting the extra test |\@testwrongwidth|\marg{box} at suitable
1452 % places. That is at places where a box is taken off the deferlist.
1454 %<latexrelease>\IncludeInRelease{2015/01/01}{\@doclearpage}%
1455 %<latexrelease> {float order in 2-column}%
1456 %<*2ekernel|latexrelease>
1457 \def \@doclearpage {%
1460 % \changes{v1.2n}{2015/01/14}{Empty kludgeins box if necessary, pr/3528}
1463 {\setbox \@tempboxa \box \@kludgeins}%
1465 \fl@trace {kludgeins box made void}%
1468 \setbox\@tempboxa\vsplit\@cclv to\z@ \unvbox\@tempboxa
1469 \setbox\@tempboxa\box\@cclv
1470 \xdef\@deferlist{\@toplist\@botlist\@deferlist}%
1471 \global \let \@toplist \@empty
1472 \global \let \@botlist \@empty
1473 \global \@colroom \@colht
1474 \ifx \@currlist\@empty
1476 \@latexerr{Float(s) lost}\@ehb
1477 \global \let \@currlist \@empty
1479 \@makefcolumn\@deferlist
1480 \@whilesw\if@fcolmade \fi{\@opcol\@makefcolumn\@deferlist}%
1486 \xdef\@deferlist{\@dbltoplist\@deferlist}%
1490 \global \let \@dbltoplist \@empty
1491 \global \@colht \textheight
1497 \@makefcolumn\@deferlist
1498 \@whilesw\if@fcolmade \fi{\@outputpage
1499 \@makefcolumn\@deferlist}%
1509 % the next line is needed to avoid losing floats in certain
1510 % circumstances a single call to the original |\doclearpage|
1511 % will now no longer output all floats.
1512 % \changes{v1.2b}{2000/09/24}{FMi: ensure \cs{doclearpage}
1513 % is called again until all floats are output.}
1515 \ifx\@deferlist\@empty \else\clearpage \fi
1517 \setbox\@cclv\vbox{\box\@cclv\vfil}%
1522 %</2ekernel|latexrelease>
1523 %<latexrelease>\EndIncludeInRelease
1524 %<latexrelease>\IncludeInRelease{0000/00/00}{\@doclearpage}%
1525 %<latexrelease> {float order in 2-column}%
1526 %<latexrelease>\def \@doclearpage {%
1527 %<latexrelease> \ifvoid\footins
1529 % \changes{v1.2l}{2004/02/07}{Empty kludgeins box if necessary, pr/3528}
1530 % We empty any left over kludge insert box here; this is a temporary fix.
1531 % It should perhaps be applied to one page of cleared floats, but
1532 % who cares? The whole of this stuff needs completely redoing for
1533 % many such reasons.
1535 %<latexrelease> \ifvbox\@kludgeins
1536 %<latexrelease> {\setbox \@tempboxa \box \@kludgeins}%
1538 %<latexrelease> \fl@trace {kludgeins box made void}%
1541 %<latexrelease> \setbox\@tempboxa\vsplit\@cclv to\z@ \unvbox\@tempboxa
1542 %<latexrelease> \setbox\@tempboxa\box\@cclv
1543 %<latexrelease> \xdef\@deferlist{\@toplist\@botlist\@deferlist}%
1545 % \changes{v1.0h}{1993/12/12}{defs changed to lets}
1547 %<latexrelease> \global \let \@toplist \@empty
1548 %<latexrelease> \global \let \@botlist \@empty
1549 %<latexrelease> \global \@colroom \@colht
1550 %<latexrelease> \ifx \@currlist\@empty
1551 %<latexrelease> \else
1552 %<latexrelease> \@latexerr{Float(s) lost}\@ehb
1554 % \changes{v1.0h}{1993/12/12}{defs changed to lets}
1556 %<latexrelease> \global \let \@currlist \@empty
1558 %<latexrelease> \@makefcolumn\@deferlist
1559 %<latexrelease> \@whilesw\if@fcolmade \fi
1560 %<latexrelease> {\@opcol\@makefcolumn\@deferlist}%
1561 %<latexrelease> \if@twocolumn
1562 %<latexrelease> \if@firstcolumn
1563 %<latexrelease> \xdef\@dbldeferlist{\@dbltoplist\@dbldeferlist}%
1565 % \changes{v1.0h}{1993/12/12}{defs changed to lets}
1567 %<latexrelease> \global \let \@dbltoplist \@empty
1568 %<latexrelease> \global \@colht \textheight
1569 %<latexrelease> \begingroup
1570 %<latexrelease> \@dblfloatplacement
1571 %<latexrelease> \@makefcolumn\@dbldeferlist
1572 %<latexrelease> \@whilesw\if@fcolmade \fi
1573 %<latexrelease> {\@outputpage\@makefcolumn\@dbldeferlist}%
1574 %<latexrelease> \endgroup
1575 %<latexrelease> \else
1576 %<latexrelease> \vbox{}\clearpage
1579 %<latexrelease> \else
1580 %<latexrelease> \setbox\@cclv\vbox{\box\@cclv\vfil}%
1581 %<latexrelease> \@makecol\@opcol
1582 %<latexrelease> \clearpage
1585 %<latexrelease>\EndIncludeInRelease
1589 % \begin{macro}{\@opcol}
1590 % \changes{v1.0f}{1993/12/05}{Command changed}
1591 % \changes{v1.0f}{1993/12/05}{Hook added}
1592 % \changes{v1.0j}{1993/12/17}{Hook removed}
1593 % Several changes in detail here.
1596 %<*2ekernel|fltrace>
1603 \fl@trace{PAGE: one column (float? see above) page completed}%
1606 % Not needed since it comes after |\@outputpage|:
1608 % \global\@colht\textheight
1611 % These do not need to be done every time |\@opcol| is used: they
1612 % should be grouped together since they all need to be done at the
1613 % end of the non-special output routine, or at the end of a clearpage
1616 \global \@mparbottom \z@ \global \@textfloatsheight \z@
1619 %</2ekernel|fltrace>
1624 % \begin{macro}{\@makecol}
1625 % \changes{v0.1c}{1993/11/23}{Command changed}
1626 % \changes{v1.0b}{1993/11/29}{\cs{@makespecialcolbox} added}
1627 % We must rewrite this macro to alllow for variations in page-makeup
1628 % required by changes in page-length.
1630 % This uses a different macro if a special-length column is being
1637 \setbox\@outputbox \box\@cclv
1639 \setbox\@outputbox \vbox {%
1641 % This |\boxmaxdepth| setting is to ensure that deep footnotes
1642 % do not overwrite the footer (on account of the negative skip
1643 % added later): it should use |\@maxdepth| otherwise the change is
1644 % pointless when there are footnotes.
1645 % \task{CAR}{Investigate providing an option to put the footnotes
1646 % below the bottom floats.}
1648 % But see also its use when combining floats.
1649 % \changes{v1.0l}{1994/03/15}{\cs{maxdepth} changed to \cs{@maxdepth}}
1651 \boxmaxdepth \@maxdepth
1654 % \changes{v1.2e}{1999/01/06}{Added negative vskip, as when processing
1655 % outputbox below: suggested by Fred Bartlett pr/2892}
1656 % \changes{1.2i}{2000/07/12}{Removed negative vskip, as it gives
1657 % unacceptable results when the depth is large: pr/3189}
1658 % \changes{v1.2m}{2004/10/20}{Removed dead code}
1659 % \task{CAR}{As can be seen from the above two changes, getting a good
1660 % layout here is difficult: fix!}
1662 % \@tempdima\dp\@cclv
1665 \vskip \skip\footins
1667 % \changes{v1.1a}{1994/10/31}
1668 % {(DPC/CAR) Colour resetting moved to here}
1678 % The h floats have now been finally committed to this page so we
1679 % can reset their list. The top and bottom floats are then added
1681 % \changes{v1.2k}{2003/12/16}{Ensure that \cs{@elt} has a defined
1685 \xdef\@freelist{\@freelist\@midlist}%
1687 % \changes{v1.0h}{1993/12/12}{defs changed to lets}
1689 \global \let \@midlist \@empty
1692 % The variations start here in case |\enlargethispage| has
1699 % This extra reboxing is only needed to add the
1700 % |\@texttop| and |\@textbotttom| but this could be done earlier,
1701 % when the floats are added.
1703 % The |\boxmaxdepth| resetting here will have no effect unless
1704 % |\@textbottom| ends with a box or rule. So is this (or possibly
1705 % |\@maxdepth|) the correct value?
1707 % The |\vskip -\dimen@|
1708 % ensures that the visible depth of the box does not
1709 % affect the placement of anything on the page.
1710 % Thus very deep pages will overprint the footer; but these should
1711 % have been prevented by suitable settings of the maxdepths at
1712 % appropriate times.
1714 % If |\@textbottom| ends with a box or rule of non-zero depth
1715 % then this skip adjustment should be done again after it.
1717 % I think that the final boxing of the main text page could have a
1718 % common ending which may make it simpler to see what is going on.
1720 % This needs further investigation, especially in the `special
1722 % \task{CAR}{Further investigation of makecol}
1724 % Also, the |\boxmaxdepth| setting here affects what happens within
1725 % |\@texttop| and |\@textbottom|, should it? Is it needed at all?
1726 % \changes{v1.0l}{1994/03/15}{Removed boxmaxdepth setting.}
1728 % RmS 91/10/22: Replaced |\dimen128| by |\dimen@|.
1731 \setbox\@outputbox \vbox to\@colht {%
1732 % \boxmaxdepth \maxdepth %??
1734 \dimen@ \dp\@outputbox
1740 \global \maxdepth \@maxdepth
1745 % \begin{macro}{\@reinserts}
1746 % \changes{v1.0e}{1993/12/01}{Command added}
1747 % This is the code which reinserts the inserts. It puts them all
1748 % in one place; this can make some of them come out on the wrong
1750 % It has been put into a separate macro to expedite experimentation.
1753 \ifvoid\footins\else\insert\footins{\unvbox\footins}\fi
1754 \ifvbox\@kludgeins\insert\@kludgeins
1755 {\unvbox\@kludgeins}\fi
1763 % \begin{macro}{\@makespecialcolbox}
1764 % \changes{v1.0b}{1993/11/29}{Command added}
1765 % This implements certain variations in page-makeup.
1767 %<*2ekernel|fltrace>
1768 \gdef \@makespecialcolbox {%
1770 \fl@trace{Kludgeins ht \the\ht\@kludgeins\space
1771 dp \the\dp\@kludgeins\space
1772 wd \the\wd\@kludgeins}%
1775 % First we find the natural height of the column.
1777 % See above for discussion of what is happening here.
1779 % This needs further investigation, especially in this `special
1781 % \changes{v1.0k}{1994/02/08}{boxmaxdepth setting removed}
1783 \setbox\@outputbox \vbox {%
1785 \dimen@ \dp\@outputbox
1790 \ifdim \wd\@kludgeins>\z@
1792 % Note that in this case (the *-version), the height of the
1793 % |\@kludgeins| box is not used since its value is somewhat
1794 % arbitrary: it need only be big enough to ensure that the
1795 % page-break is not taken prematurely.
1797 % Here we calculate how much vertical space needs to be added in
1798 % order to enable the column to fit into a box of size |\@colht|
1799 % using the best information we have about the amount of shrink
1800 % available (another thing which is known internally about a box,
1801 % but cannot be accessed at the \TeX{} level!).
1803 % This needs \TeX3 otherwise |\pageshrink| is zero anyway; it may
1804 % not be exactly the figure we wish as it is the total available
1805 % from the all the material collected before the page-break
1806 % decision is made. It will, we think, always be an overestimate
1807 % of the actual shrink in the box; therefore this should always
1808 % force the shortest possible column with the possibility of an
1811 % This should work for bothe flush- and ragged-bottom setting since
1812 % it makes the contents no smaller than the size (|\@colht|) of the
1813 % box into which they are put.
1815 % Their should perhaps be an upper limit, of 0pt?, on the extra
1816 % space added to force shrinking.
1817 % \task{CAR}{Further investigation of kludge-* space}
1819 % See above for a discussion of the |\boxmaxdepth| setting here.
1821 % \changes{v1.0k}{1994/02/08}{boxmaxdepth setting added}
1822 % \changes{v1.0l}{1994/03/15}{Removed boxmaxdepth setting.}
1824 \advance \@tempdima -\ht\@outputbox
1825 \advance \@tempdima \pageshrink
1827 \fl@trace {Natural ht of col: \the \ht\@outputbox}%
1828 \fl@trace {\string \@colht: \the \@colht}%
1829 \fl@trace {Pageshrink added: \the \pageshrink}%
1830 \fl@trace {Hence, space added: \the \@tempdima}%
1832 \setbox\@outputbox \vbox to \@colht {%
1833 % \boxmaxdepth \maxdepth
1839 % For the unstarred version, the final size of the page is
1840 % precisely specified. Therefore, at least for the flush-bottom
1841 % case, we need to ensure that, visually, it has this size exactly.
1843 % Thus we calculate this size and set the material in a box of this
1844 % size, which is then put into a box of size |\@colht| with |\vss|
1848 \advance \@tempdima -\ht\@kludgeins
1850 \fl@trace {Natural ht of col: \the \ht\@outputbox}%
1851 \fl@trace {\string \@colht: \the \@colht}%
1852 \fl@trace {Extra size added: -\the \ht \@kludgeins}%
1853 \fl@trace {Hence, height of inner box: \the \@tempdima}%
1854 \fl@trace {Max? pageshrink available: \the \pageshrink}%
1857 % This type of final packaging could be done always; this may
1858 % simplify all of this page-makeup.
1860 % It is not necessary to set |\boxmaxdepth| here since the
1861 % |\@outputbox| ends with glue.
1862 % \changes{v1.0k}{1994/02/03}{correct mistakes in the documentation}
1864 \setbox \@outputbox \vbox to \@colht {%
1865 \vbox to \@tempdima {%
1871 % Finally we need to explicitly make the insert box void.
1873 {\setbox \@tempboxa \box \@kludgeins}%
1875 \fl@trace {kludgeins box made void}%
1878 %</2ekernel|fltrace>
1882 % \begin{macro}{\@texttop}
1883 % \begin{macro}{\@textbottom}
1884 % These do nothing as a default.
1887 \let \@texttop \relax
1888 \let \@textbottom \relax
1893 % \begin{macro}{\@resetactivechars}
1894 % \begin{macro}{\@activechar@info}
1896 % \changes{v1.0n}{1994/04/30}{\cs{@activechar@warning} changed to
1897 % \cs{@activechar@info}}
1899 % added hook to protect against certain active characters in the
1900 % output routine. Default checks are for active space and end-of-line.
1901 % \changes{v1.0u}{1994/05/23}{Added \cs{MessageBreak}}
1903 \def\@activechar@info #1{%
1904 \@latex@info@no@line {Active #1 character found while
1905 output routine is active
1907 This may be a bug in a package file
1912 % Do not put any spaces in this next bit!
1913 % \changes{1.2f}{1999/10/09}{Reset definition of active prime
1914 % character (used in math mode)}
1917 \obeylines\obeyspaces%
1919 \gdef\@resetactivechars{%
1920 \def^^M{\@activechar@info{EOL}\space}%
1921 \def {\@activechar@info{space}\space}%
1922 \let'\active@math@prime}%
1928 % \begin{macro}{\@outputpage}
1929 % \changes{v1.0f}{1993/12/05}{Command changed}
1930 % \begin{macro}{\@shipoutsetup}
1931 % \changes{v1.0f}{1993/12/05}{Command added}
1932 % \changes{v1.1s}{1995/11/10}{Command removed}
1933 % \begin{macro}{\@writesetup}
1934 % \changes{v1.1s}{1995/11/10}{Command removed}
1935 % \changes{v1.1o}{1995/07/21}{Command added}
1936 % \changes{v1.0f}{1993/12/05}{\cs{@startpagehook} added}
1937 % \changes{v1.0j}{1993/12/17}{---and then removed}
1938 % \changes{v1.0p}{1994/05/12}{\cs{normalcolor}added}
1939 % \changes{v1.0s}{1994/05/20}{Added setting of \cs{protect}
1940 % during \cs{shipout}.}
1941 % \changes{v1.0u}{1994/05/23}{Changed resetting of \cs{protect} after
1942 % shipout to use \cs{aftergroup}}
1943 % \changes{v1.1b}{1994/11/05}
1944 % {Use new \cs{color@hbox} concept.}
1945 % \changes{v1.1b}{1994/11/05}
1946 % {Change protect settings for new-style, protect-free
1948 % \changes{v1.1c}{1994/11/05}
1949 % {Add new \cs{AtBeginDvi} concept}
1950 % \changes{v1.1e}{1994/11/10}
1951 % {Modify \cs{protect} setting}
1952 % \changes{v1.1f}{1994/11/14}
1953 % {Modify new \cs{AtBeginDvi} concept}
1954 % \changes{v1.1o}{1995/07/21}
1955 % {New, experimental, versions: need in-lining}
1956 % \changes{v1.1s}{1995/11/10}{In-lined}
1957 % \changes{v1.1w}{1996/09/21}{Added \cs{@parboxrestore} and made
1958 % consequent deletions: wait for the howls of protest}
1960 % The |\color@hbox| hooks here are used to avoid putting just a
1961 % colour special into an otherwise empty box (in a header or
1962 % footer). These boxes are often set to be completely empty and so
1963 % adding a special produces a very underfull box message.
1965 % There has been extensive tidying up of the old code here;
1966 % including the removal of a level of grouping.
1968 % The setting of |\protect| immediately before the |\shipout|
1969 % is needed so that protected commands within |\write|s are
1970 % handled correctly.
1972 % Within shipout's vbox it is reset to its default value, |\relax|.
1974 % Resetting it to its default value after the shipout has been
1975 % completed (and the contents of the writes have been expanded)
1976 % must be done by use of |\aftergroup|.
1977 % This is because it must have the value |\relax|
1978 % before macros coming from other uses of |\aftergroup| within
1979 % this box are expanded.
1981 % Putting this into the |\aftergroup| token list does not affect
1982 % the definition used in expanding the |\write|s because the
1983 % aftergroup token list is only constructed when popping the
1984 % save-stack, it is not expanded until after the shipout is
1987 % Question: should things from an |\aftergroup| within the shipped
1988 % out box be executed in the environment set up for the writes, or
1989 % after it finishes?
1991 % A lot of this code has been in-lined to prevent mis-use of
1992 % internal commands as hooks.
1995 %<latexrelease>\IncludeInRelease{2017/03/10}%
1996 %<latexrelease> {\@outputpage}{Reset language for hyphenation}%
1997 %<*2ekernel|latexrelease>
2000 % The |\endgroup| is put in by |\aftergroup|.
2004 % Now all the set-up stuff has been in-lined for Frank.
2006 % First the stuff for the writes.
2008 % From here \ldots\ was in the command |\@writesetup|.
2010 \let \protect \noexpand
2013 % RmS 93/08/19: Redefined accents to allow changes in font encoding;
2014 % but exactly why was this needed?
2016 % \changes{v1.3c}{2017/03/10}{Reset \cs{language}}
2017 % Reset |\language| to the value current at |\begin{document}|.
2018 % In particular this ensures that a pagebreak in |verbatim| does not
2019 % prevent hyphenation in the page head.
2021 \language\document@default@language
2024 % The |\catcode`\ = 10| was removed as it was considered useless
2025 % (presumably because nothing gets tokenised during shipout).
2027 % This was put in as some error produced active spaces in a mark, I
2030 % Why was the hyphen reset?
2035 % If a page break happens between the start of a list and its first
2036 % item the |@newlist| will be true and this will mess up any list
2037 % that is used in the header or footer of the page. So we have to
2039 % \changes{v1.2h}{2000/07/19}
2040 % {Reset and restore \cs{@if@newlist} for internal/3231}
2041 % \changes{v1.2j}{2001/01/07}
2042 % {And do it in the right macro! (pr/3286)}
2044 \global\let\@@if@newlist\if@newlist
2045 \global\@newlistfalse
2048 % \changes{v1.0q}{1994/05/16}{Changed setting of accents (FMi):
2049 % with the new encoding setup they can use \cs{let}.
2050 % It could also use the new internal commands?}
2051 % \changes{v1.1l}{1995/04/24}{Reset \cmd\\ latex/1451 (DPC)}
2052 % This next hook replaces the following:
2055 % \let\'\@acci\let\`\@accii\let\=\@acciii
2057 % \let\par\@@par %% 15 Sep 87 (this was once inside the box)
2059 % and it does more than they did; in particular it sets:
2066 % \parfillskip\@flushglue
2067 % \lineskip\normallineskip
2068 % \baselineskip\normalbaselineskip
2075 % \ldots\ to here was in the command |\@writesetup|.
2078 \set@typeset@protect
2079 \aftergroup \endgroup
2081 % Correct? or just restore by ending the group?
2083 \aftergroup \set@typeset@protect
2085 % This first bit has been moved inside the shipped out box.
2087 % Now the setup inside the shipped out box; this should contain all
2088 % the stuff that could only affect typesetting; other stuff may need
2089 % to be reset for the writes also.
2091 % From here \ldots\ was in the command |\@shipoutsetup|.
2094 \global\@specialpagefalse\@nameuse{ps@\@specialstyle}%
2097 \ifodd\count\z@ \let\@thehead\@oddhead \let\@thefoot\@oddfoot
2098 \let\@themargin\oddsidemargin
2099 \else \let\@thehead\@evenhead
2100 \let\@thefoot\@evenfoot \let\@themargin\evensidemargin
2105 % The rest was always inside the box.
2107 % RmS 91/08/15: aded this line:
2111 % RmS 93/08/06 Added |\lineskiplimit=0pt| to guard against it being
2112 % nonzero: e.g. by |\offinterlineskip| being in effect.
2114 % There are probably lots of other things that may need resetting.
2119 % Reset the space factors.
2120 % \changes{v1.2b}{1997/04/14}
2121 % {Call \cs{normalsfcodes} (from patch file) latex/2404}
2126 % Reset these here (previously reset separately for head and foot)
2127 % \changes{v1.2b}{1997/04/14}
2128 % {Move \cs{label} and \cs{index} (from patch file)}
2132 \let\glossary\@gobble
2136 \baselineskip\z@skip \lineskip\z@skip \lineskiplimit\z@
2138 % \ldots\ to here was in the command |\@shipoutsetup|.
2142 \moveright\@themargin \vbox {%
2143 \setbox\@tempboxa \vbox to\headheight{%
2147 \hb@xt@\textwidth{\@thehead}%
2157 \baselineskip \footskip
2160 \hb@xt@\textwidth{\@thefoot}%
2165 % |\endgroup| now inserted by |\aftergroup|
2167 % Restore |\if@newlist|
2169 \global\let\if@newlist\@@if@newlist
2173 \global \@colht \textheight
2176 % It is now clear that this does something useful, thanks to Piet
2177 % van Oostrum. It is needed because a float page is made without
2178 % using TeX's page-builder; thus the output routine is never called
2179 % so the marks are not updated.
2181 \let\firstmark\botmark
2183 %</2ekernel|latexrelease>
2184 %<latexrelease>\EndIncludeInRelease
2185 %<latexrelease>\IncludeInRelease{0000/00/00}%
2186 %<latexrelease> {\@outputpage}{Reset language for hyphenation}%
2187 %<latexrelease>\def\@outputpage{%
2188 %<latexrelease>\begingroup
2189 %<latexrelease> \let \protect \noexpand
2190 %<latexrelease> \@resetactivechars
2191 %<latexrelease> \global\let\@@if@newlist\if@newlist
2192 %<latexrelease> \global\@newlistfalse
2193 %<latexrelease> \@parboxrestore
2194 %<latexrelease> \shipout \vbox{%
2195 %<latexrelease> \set@typeset@protect
2196 %<latexrelease> \aftergroup \endgroup
2197 %<latexrelease> \aftergroup \set@typeset@protect
2198 %<latexrelease> \if@specialpage
2199 %<latexrelease> \global\@specialpagefalse\@nameuse{ps@\@specialstyle}%
2201 %<latexrelease> \if@twoside
2202 %<latexrelease> \ifodd\count\z@
2203 %<latexrelease> \let\@thehead\@oddhead \let\@thefoot\@oddfoot
2204 %<latexrelease> \let\@themargin\oddsidemargin
2205 %<latexrelease> \else \let\@thehead\@evenhead
2206 %<latexrelease> \let\@thefoot\@evenfoot \let\@themargin\evensidemargin
2209 %<latexrelease> \reset@font
2210 %<latexrelease> \normalsize
2211 %<latexrelease> \normalsfcodes
2212 %<latexrelease> \let\label\@gobble
2213 %<latexrelease> \let\index\@gobble
2214 %<latexrelease> \let\glossary\@gobble
2215 %<latexrelease> \baselineskip\z@skip \lineskip\z@skip \lineskiplimit\z@
2216 %<latexrelease> \@begindvi
2217 %<latexrelease> \vskip \topmargin
2218 %<latexrelease> \moveright\@themargin \vbox {%
2219 %<latexrelease> \setbox\@tempboxa \vbox to\headheight{%
2220 %<latexrelease> \vfil
2221 %<latexrelease> \color@hbox
2222 %<latexrelease> \normalcolor
2223 %<latexrelease> \hb@xt@\textwidth{\@thehead}%
2224 %<latexrelease> \color@endbox
2226 %<latexrelease> \dp\@tempboxa \z@
2227 %<latexrelease> \box\@tempboxa
2228 %<latexrelease> \vskip \headsep
2229 %<latexrelease> \box\@outputbox
2230 %<latexrelease> \baselineskip \footskip
2231 %<latexrelease> \color@hbox
2232 %<latexrelease> \normalcolor
2233 %<latexrelease> \hb@xt@\textwidth{\@thefoot}%
2234 %<latexrelease> \color@endbox
2237 %<latexrelease> \global\let\if@newlist\@@if@newlist
2238 %<latexrelease> \global \@colht \textheight
2239 %<latexrelease> \stepcounter{page}%
2240 %<latexrelease> \let\firstmark\botmark
2248 % \begin{macro}{\@begindvi}
2249 % \changes{v1.1c}{1994/11/05}
2251 % \changes{v1.1f}{1994/11/14}{Use normal box register: why a box?}
2253 % This unboxes stuff that must appear before anything else in the
2254 % |.dvi| file, then returns that box register to the free list and
2257 % The stuff in the box should not add any typeset material to the
2261 \unvbox \@begindvibox
2262 \global\let \@begindvi \@empty
2267 % \begin{macro}{\@combinefloats}
2268 % \begin{macro}{\@cflt}
2269 % \changes{v1.0h}{1993/12/12}{name changed}
2270 % \begin{macro}{\@cflb}
2271 % The |\boxmaxdepth| setting here was not made local to
2272 % a box so was dangerous. It is needed only within the box made
2273 % by |\@cflt| (and not normally even there), so it has been
2274 % moved there; this also agrees with the original pseudocode.
2276 % \changes{v1.0h}{1993/12/12}{boxmaxdepth setting moved}
2278 \def \@combinefloats {%
2279 % \boxmaxdepth \maxdepth
2280 \ifx \@toplist\@empty \else \@cflt \fi
2281 \ifx \@botlist\@empty \else \@cflb \fi
2285 % \changes{v1.0h}{1993/12/12}{defs changed to lets}
2288 \let \@elt \@comflelt
2289 \setbox\@tempboxa \vbox{}%
2291 \setbox\@outputbox \vbox{%
2292 \boxmaxdepth \maxdepth
2296 \vskip \textfloatsep
2300 \xdef\@freelist{\@freelist\@toplist}%
2301 \global\let\@toplist\@empty
2308 \setbox\@tempboxa \vbox{}%
2310 \setbox\@outputbox \vbox{%
2312 \vskip \textfloatsep
2318 \xdef\@freelist{\@freelist\@botlist}%
2319 \global \let \@botlist\@empty
2326 % \begin{macro}{\@comflelt}
2327 % \begin{macro}{\@comdblflelt}
2328 % \begin{macro}{\@combinedblfloats}
2331 \def\@comflelt#1{\setbox\@tempboxa
2332 \vbox{\unvbox\@tempboxa\box #1\vskip\floatsep}}
2336 \def\@comdblflelt#1{\setbox\@tempboxa
2337 \vbox{\unvbox\@tempboxa\box #1\vskip\dblfloatsep}}
2341 \def \@combinedblfloats{%
2342 \ifx \@dbltoplist \@empty
2344 \setbox\@tempboxa \vbox{}%
2345 \let \@elt \@comdblflelt
2348 \xdef \@freelist {\@freelist\@dbltoplist}%
2349 \global\let \@dbltoplist \@empty
2350 \setbox\@outputbox \vbox to\textheight
2353 % The setting of |\boxmaxdepth| here has no effect since the
2354 % |\@outputbox| should already have depth zero. Even so, it would
2355 % have no effect on the layout of the page.
2356 % \changes{v1.0l}{1994/03/15}{Removed boxmaxdepth setting.}
2358 {%\boxmaxdepth\maxdepth %% probably not needed, CAR
2359 \unvbox\@tempboxa\vskip-\dblfloatsep
2361 % Here we need different typesetting if the top float comes from
2363 % \changes{v1.0n}{1994/04/30}{Removed rule in topnewpage case}
2365 \ifnum \@dbltopnum>\m@ne
2368 \vskip \dbltextfloatsep
2380 % \begin{macro}{\@startcolumn}
2381 % \changes{v1.0f}{1993/12/05}{Command changed}
2382 % \begin{macro}{\@startdblcolumn}
2383 % \changes{v1.0f}{1993/12/05}{Command changed}
2385 % We could combine (most of) these two into |\@startcol <list>|.
2386 % Note that |\@xstartcol| was only used once (\ie in
2387 % |\@startcolumn|); it has therefore been removed. This is not quite
2388 % as efficient but it now has the same structure as
2389 % |\@startdblcolumn|.
2391 % The empty-list test has been moved to |\@tryfcolumn|.
2394 %<*2ekernel|fltrace>
2395 \def \@startcolumn {%
2396 \global \@colroom \@colht
2397 \@tryfcolumn \@deferlist
2400 \fl@trace{PAGE: float \if@twocolumn column \else page \fi
2405 % \changes{v1.0h}{1993/12/12}{defs changed to lets}
2408 \let \reserved@b \@deferlist
2409 \global \let \@deferlist \@empty
2410 \let \@elt \@scolelt
2417 % This one does not need to set |\@colht|.
2419 % \changes{v1.2n}{2015/01/14}{float order in 2-column (latexrelease)}
2421 %</2ekernel|fltrace>
2422 %<latexrelease|fltrace>\IncludeInRelease{2015/01/01}%
2423 %<latexrelease|fltrace> {\@startdblcolumn}{float order in 2-column}%
2424 %<*2ekernel|latexrelease|fltrace>
2425 \def \@startdblcolumn {%
2426 \@tryfcolumn \@deferlist
2428 %<fltrace> \fl@trace{PAGE: double float page completed}%
2431 \let \reserved@b \@deferlist
2432 \global \let \@deferlist \@empty
2433 \let \@elt \@sdblcolelt
2438 %</2ekernel|latexrelease|fltrace>
2439 %<latexrelease|fltrace>\EndIncludeInRelease
2440 %<latexrelease|fltrace>\IncludeInRelease{0000/00/00}%
2441 %<latexrelease|fltrace> {\@startdblcolumn}{float order in 2-column}%
2442 %<latexrelease|fltrace>\def \@startdblcolumn {%
2444 % Not needed since this always comes after |\@outputpage|:
2446 %<latexrelease|fltrace>% \global \@colht \textheight
2447 %<latexrelease|fltrace> \@tryfcolumn \@dbldeferlist
2448 %<latexrelease|fltrace> \if@fcolmade
2450 %<latexrelease|fltrace> \fl@trace{PAGE: double float page completed}%
2452 %<latexrelease|fltrace> \else
2454 % \changes{v1.0h}{1993/12/12}{defs changed to lets}
2456 %<latexrelease|fltrace> \begingroup
2457 %<latexrelease|fltrace> \let \reserved@b \@dbldeferlist
2458 %<latexrelease|fltrace> \global \let \@dbldeferlist \@empty
2459 %<latexrelease|fltrace> \let \@elt \@sdblcolelt
2460 %<latexrelease|fltrace> \reserved@b
2461 %<latexrelease|fltrace> \endgroup
2462 %<latexrelease|fltrace> \fi
2463 %<latexrelease|fltrace>}%
2464 %<latexrelease|fltrace>\EndIncludeInRelease
2465 %<*2ekernel|fltrace>
2470 % \begin{macro}{\@tryfcolumn}
2471 % \changes{v1.0f}{1993/12/05}{Command changed}
2472 % Now tests if its list is empty before any further exertion.
2475 \def \@tryfcolumn #1{%
2476 \global \@fcolmadefalse
2480 \fl@trace{PAGE: try float \if@twocolumn column/page\else page\fi
2482 \fl@trace{----- \string #1: #1}%
2485 % \changes{v1.0h}{1993/12/12}{defs changed to lets}
2488 \global \let \@failedlist \@empty
2490 \let \@elt \@xtryfc \@trylist
2497 %</2ekernel|fltrace>
2506 % \begin{macro}{\@scolelt}
2508 \def\@scolelt#1{\def\@currbox{#1}\@addtonextcol}
2512 % \begin{macro}{\@sdblcolelt}
2514 \def\@sdblcolelt#1{\def\@currbox{#1}\@addtodblcol}
2518 % \begin{macro}{\@vtryfc}
2519 % \changes{v1.2d}{1997/11/19}{Reindent code, to be understandable(DPC).}
2522 \global\setbox\@outputbox\vbox{}%
2525 \global\setbox\@outputbox \vbox to\@colht{%
2531 \xdef #1{\@failedlist\@flfail}%
2532 \xdef\@freelist{\@freelist\@flsucceed}}
2536 % \begin{macro}{\@wtryfc}
2539 \global\setbox\@outputbox\vbox{%
2546 % \begin{macro}{\@xtryfc}
2547 % \changes{v1.1v}{1996/07/26}{remove \cs{global} before \cs{@test...}}
2548 % \changes{v1.2n}{2015/01/14}{float order in 2-column (latexrelease)}
2551 %<latexrelease>\IncludeInRelease{2015/01/01}{\@xtryfc}%
2552 %<latexrelease> {float order in 2-column}%
2553 %<*2ekernel|latexrelease>
2555 \@next\reserved@a\@trylist{}{}%
2556 \@currtype \count #1%
2557 \divide\@currtype\@xxxii
2558 \multiply\@currtype\@xxxii
2559 \@bitor \@currtype \@failedlist
2564 \@testwrongwidth #1%
2568 \ifdim \ht #1>\@colht
2572 \@cons\@failedlist #1%
2576 %</2ekernel|latexrelease>
2577 %<latexrelease>\EndIncludeInRelease
2578 %<latexrelease>\IncludeInRelease{0000/00/00}{\@xtryfc}%
2579 %<latexrelease> {float order in 2-column}%
2580 %<latexrelease>\def\@xtryfc #1{%
2581 %<latexrelease> \@next\reserved@a\@trylist{}{}%
2582 %<latexrelease> \@currtype \count #1%
2583 %<latexrelease> \divide\@currtype\@xxxii
2584 %<latexrelease> \multiply\@currtype\@xxxii
2585 %<latexrelease> \@bitor \@currtype \@failedlist
2586 %<latexrelease> \@testfp #1%
2587 %<latexrelease> \ifdim \ht #1>\@colht
2588 %<latexrelease> \@testtrue
2590 %<latexrelease> \if@test
2591 %<latexrelease> \@cons\@failedlist #1%
2592 %<latexrelease> \else
2593 %<latexrelease> \@ytryfc #1%
2594 %<latexrelease> \fi}%
2595 %<latexrelease>\EndIncludeInRelease
2600 % \begin{macro}{\@ytryfc}
2604 \gdef\@flsucceed{\@elt #1}%
2605 \global\let\@flfail\@empty
2609 \ifdim \@tempdima >\@fpmin
2610 \global\@fcolmadetrue
2612 \@cons\@failedlist #1%
2621 % \begin{macro}{\@ztryfc}
2622 % \changes{v1.1v}{1996/07/26}{remove \cs{global} before \cs{@test...}}
2623 % \changes{v1.2n}{2015/01/14}{float order in 2-column (latexrelease)}
2626 %<latexrelease>\IncludeInRelease{2015/01/01}{@ztryfc}%
2627 %<latexrelease> {float order in 2-column}%
2628 %<*2ekernel|latexrelease>
2630 \@tempcnta\count #1%
2631 \divide\@tempcnta\@xxxii
2632 \multiply\@tempcnta\@xxxii
2633 \@bitor \@tempcnta {\@failedlist \@flfail}%
2639 \@testwrongwidth #1%
2643 \@tempdimb\@tempdima
2644 \advance\@tempdimb\ht #1%
2645 \advance\@tempdimb\@fpsep
2646 \ifdim \@tempdimb >\@colht
2652 \@cons\@flsucceed #1%
2653 \@tempdima\@tempdimb
2655 %</2ekernel|latexrelease>
2656 %<latexrelease>\EndIncludeInRelease
2657 %<latexrelease>\IncludeInRelease{0000/00/00}{@ztryfc}%
2658 %<latexrelease> {float order in 2-column}%
2659 %<latexrelease>\def\@ztryfc #1{%
2660 %<latexrelease> \@tempcnta \count#1%
2661 %<latexrelease> \divide\@tempcnta\@xxxii
2662 %<latexrelease> \multiply\@tempcnta\@xxxii
2663 %<latexrelease> \@bitor \@tempcnta {\@failedlist \@flfail}%
2664 %<latexrelease> \@testfp #1%
2665 %<latexrelease> \@tempdimb\@tempdima
2666 %<latexrelease> \advance\@tempdimb \ht#1%
2667 %<latexrelease> \advance\@tempdimb\@fpsep
2668 %<latexrelease> \ifdim \@tempdimb >\@colht
2669 %<latexrelease> \@testtrue
2671 %<latexrelease> \if@test
2672 %<latexrelease> \@cons\@flfail #1%
2673 %<latexrelease> \else
2674 %<latexrelease> \@cons\@flsucceed #1%
2675 %<latexrelease> \@tempdima\@tempdimb
2676 %<latexrelease> \fi}%
2677 %<latexrelease>\EndIncludeInRelease
2682 % The major changes for float suppression and the changes to the float
2683 % mechanism to make it conform to the documentation are in these next
2686 % \begin{macro}{\@addtobot}
2687 % \changes{v1.0f}{1993/12/05}{Command changed}
2691 %<*2ekernel|fltrace>
2694 \fl@trace{***Start addtobot}%
2698 \fl@trace{fpstype \ifodd \@tempcnta OK \else not \fi bot:
2705 \@flcheckspace \@botroom \@botlist
2708 % This next line means that this page is produced with box 255
2709 % having depth zero, rather than the normal maxdepth: is this
2711 % \task{CAR/FMi}{Investigate resetting of maxdepth: I do not think it is
2712 % necessary here; Frank does.}
2714 \global \maxdepth \z@
2715 \@flupdates \@botnum \@botroom \@botlist
2717 \fl@trace{colroom (after-bot) = \the \@colroom}%
2718 \fl@trace{colnum (after-bot) = \the \@colnum}%
2719 \fl@trace{botnum (after-bot) = \the \@botnum}%
2720 \fl@trace{***Success: bot}%
2726 \fl@trace{Fail: botnum = \the \@botnum:
2727 fpstype \the \@fpstype=ORD?}%
2728 \ifnum \@fpstype<\sixt@@n
2729 \fl@trace{ERROR: !b float not successful (addtobot)}%
2738 % \begin{macro}{\@addtotoporbot}
2739 % \changes{v1.0f}{1993/12/05}{Command changed}
2743 \def \@addtotoporbot {%
2745 \fl@trace{***Start addtotoporbot}%
2749 \fl@trace{fpstype \ifodd \@tempcnta OK \else not \fi top:
2756 \@flcheckspace \@toproom \@toplist
2758 \@bitor\@currtype{\@midlist\@botlist}%
2760 \fl@trace{(mid+bot)list: \@midlist, \@botlist:
2761 (addtotoporbot-before)}%
2765 \fl@trace{type already on list: mid or bot---sent to addtobot}%
2768 \@flupdates \@topnum \@toproom \@toplist
2770 \fl@trace{colroom (after-top) = \the \@colroom}%
2771 \fl@trace{colnum (after-top) = \the \@colnum}%
2772 \fl@trace{topnum (after-top) = \the \@topnum}%
2773 \fl@trace{***Success: top}%
2780 \fl@trace{Fail: topnum = \the \@topnum: fpstype
2781 \the \@fpstype=ORD?}%
2782 \ifnum \@fpstype<\sixt@@n
2783 \fl@trace{ERROR: !t float not successful (addtotoporbot)}%
2791 \fl@trace{sent to addtobot (addtotoporbot)}%
2796 %</2ekernel|fltrace>
2800 % \begin{macro}{\@addtocurcol}
2801 % \changes{v1.0f}{1993/12/05}{Command changed}
2802 % \task{CAR}{Add rules around h floats for FMi}
2803 % \task{CAR}{Investigate pagebreak option possibilities}
2806 % \changes{v1.2n}{2015/01/14}{float order in 2-column (latexrelease)}
2808 %<latexrelease|fltrace|flafter>\IncludeInRelease{2015/01/01}%
2809 %<latexrelease|fltrace|flafter> {\@addtocurcol}{float order in 2-column}%
2810 %<*2ekernel|latexrelease|fltrace|flafter>
2811 \def \@addtocurcol {%
2813 \fl@trace{***Start addtocurcol}%
2816 \@setfloattypecounts
2819 \fl@trace{fpstype !p only (addtocurcol): \the \@fpstype = 8?}%
2824 \fl@trace{fpstype p only (addtocurcol): \the \@fpstype = 24?}%
2829 % This is a new adjustment which is quite a major change in
2830 % functionality; but it implements the documentation.
2831 % Note that |\@reqcolroom| will include the whole of the
2832 % page-so-far, and hence includes |\@textfloatsheight| of floats,
2833 % so before comparing it with |\@textmin|, we add this to
2837 \fl@trace{textfloatsheight (before) = \the \@textfloatsheight}%
2839 \advance \@textmin \@textfloatsheight
2840 \@reqcolroom \@pageht
2842 % This line must be removed since |\@specialoutput| changed.
2844 % \advance \@reqcolroom \@pagedp
2846 \fl@trace{textmin + textfloatsheight: \the \@textmin}%
2847 \fl@trace{page-so-far: \the \@reqcolroom}%
2849 \ifdim \@textmin>\@reqcolroom
2850 \@reqcolroom \@textmin
2852 \fl@trace{ORD? textmin being used}%
2855 \advance \@reqcolroom \ht\@currbox
2857 \fl@trace{float size = \the \ht \@currbox (addtocurcol)}%
2858 \fl@trace{colroom = \the \@colroom (addtocurcol)}%
2859 \fl@trace{reqcolroom = \the \@reqcolroom (addtocurcol)}%
2861 \ifdim \@colroom>\@reqcolroom
2864 \@bitor\@currtype\@deferlist
2866 % We need to defer the float also if its width
2868 % \changes{v1.2n}{2000/09/24}{FMi: test for wide float was
2871 \@testwrongwidth\@currbox
2876 \fl@trace{deferlist: \@deferlist: (addtocurcol-before)}%
2880 \fl@trace{type already on list: defer (addtocurcol)}%
2883 \@bitor\@currtype\@botlist
2885 \fl@trace{botlist: \@botlist: (addtocurcol-before)}%
2889 \fl@trace{type already on list: bot---sent to addtobot}%
2894 \fl@trace{fpstype \ifodd \@tempcnta OK \else not \fi
2895 here: \the \@fpstype}%
2897 \ifodd \count\@currbox
2898 \advance \@reqcolroom \intextsep
2899 \ifdim \@colroom>\@reqcolroom
2900 \global \advance \@colnum \m@ne
2901 \global \advance \@textfloatsheight \ht\@currbox
2903 % This may sometimes give an overestimate.
2905 \global \advance \@textfloatsheight 2\intextsep
2906 \@cons \@midlist \@currbox
2908 \fl@trace{***Success: here}%
2909 \fl@trace{textfloatsheight (after-here) =
2910 \the \@textfloatsheight}%
2911 \fl@trace{colnum (after-here) = \the \@colnum}%
2915 % CHANGE TO |\@addtocurcol|:
2917 % |\penalty\z@| changed to |\penalty\interlinepenalty| so |\samepage|
2918 % works properly with figure and table environments.
2919 % (Changed 23 Oct 86)
2921 % There is also an |\addpenalty\interlinepenalty| above.
2923 % Since in 2e |\samepage| is no longer supported, these could be
2926 % Although it is best to use |\addvspace| in case two h floats come
2927 % together, this makes other spacing more difficult to adjust; whereas
2928 % if a user specifies two h floats together then they can more easily
2929 % get the spacing correct by ad hoc commands.
2931 % It is necessary to adjust for the addition of |\parskip| here in
2932 % case the float is added between paragraphs (\ie when in vertical
2935 % If the nobreak switch is true we need to reset it and clear
2936 % |\everypar| since the float may not reset the flag and cannot reset
2937 % the |\everypar| globally.
2938 % \changes{v1.0l}{1994/03/15}{Changed \cs{addvspace} to \cs{vskip}}
2939 % \changes{v1.1i}{1994/11/21}
2940 % {Added \cs{if@nobreak} test before float box}
2941 % \changes{v1.1z}{1996/10/24}{Added \cs{nobreak}, etc as appropriate}
2943 % Typesetting starts here (we are in vertical mode).
2950 \addpenalty \interlinepenalty
2954 \penalty\interlinepenalty
2956 \ifnum\outputpenalty <-\@Mii \vskip -\parskip\fi
2958 % Typesetting ends here.
2964 \fl@trace{Fail---no room at 2nd test of colroom
2965 (addtocorcol \string\intextsep)}%
2972 % Next set of docstrip guards are a bit weird, essentially
2973 % |\@addtotoporbot| ends up inside the kernel and the
2974 % \texttt{fltrace} package and |\@addtobot| shows up in the
2975 % \texttt{flafter} package. Guess that could have been done a bit
2978 %<*2ekernel|fltrace|latexrelease>
2980 \fl@trace{not here: sent to addtotoporbot}%
2983 %</2ekernel|fltrace|latexrelease>
2984 %<*!2ekernel&!fltrace&!latexrelease>
2986 \fl@trace{not here: sent to addtobot}%
2989 %</!2ekernel&!fltrace&!latexrelease>
2995 \fl@trace{Fail: colnum = \the \@colnum:
2996 fpstype \the \@fpstype=ORD?}%
2997 \ifnum \@fpstype<\sixt@@n
2998 \fl@trace{ERROR: BANG float not successful (addtocurcol)}%
3004 \fl@trace{Fail---no room: fl box ht: \the \ht \@currbox
3014 \fl@trace{put on deferlist (addtocurcol)}%
3016 \@cons\@deferlist\@currbox
3018 \fl@trace{deferlist: \@deferlist: (addtocurcol-after)}%
3022 %</2ekernel|latexrelease|fltrace|flafter>
3023 %<latexrelease|fltrace|flafter>\EndIncludeInRelease
3024 %<latexrelease|fltrace|flafter>\IncludeInRelease{0000/00/00}%
3025 %<latexrelease|fltrace|flafter> {\@addtocurcol}{float order in 2-column}%
3026 %<latexrelease|fltrace|flafter>\def \@addtocurcol {%
3028 %<latexrelease|fltrace|flafter> \fl@trace{***Start addtocurcol}%
3030 %<latexrelease|fltrace|flafter> \@insertfalse
3031 %<latexrelease|fltrace|flafter> \@setfloattypecounts
3032 %<latexrelease|fltrace|flafter> \ifnum \@fpstype=8
3034 %<latexrelease|fltrace|flafter> \fl@trace{fpstype !p only (addtocurcol):
3035 %<latexrelease|fltrace|flafter> \the \@fpstype = 8?}%
3037 %<latexrelease|fltrace|flafter> \else
3038 %<latexrelease|fltrace|flafter> \ifnum \@fpstype=24
3040 %<latexrelease|fltrace|flafter> \fl@trace{fpstype p only (addtocurcol):
3041 %<latexrelease|fltrace|flafter> \the \@fpstype = 24?}%
3043 %<latexrelease|fltrace|flafter> \else
3044 %<latexrelease|fltrace|flafter> \@flsettextmin
3046 % This is a new adjustment which is quite a major change in
3047 % functionality; but it implements the documentation.
3048 % Note that |\@reqcolroom| will include the whole of the
3049 % page-so-far, and hence includes |\@textfloatsheight| of floats,
3050 % so before comparing it with |\@textmin|, we add this to
3054 %<latexrelease|fltrace|flafter> \fl@trace{textfloatsheight (before) =
3055 %<latexrelease|fltrace|flafter> \the \@textfloatsheight}%
3057 %<latexrelease|fltrace|flafter> \advance \@textmin \@textfloatsheight
3058 %<latexrelease|fltrace|flafter> \@reqcolroom \@pageht
3060 % This line must be removed since |\@specialoutput| changed.
3062 % \advance \@reqcolroom \@pagedp
3064 %<latexrelease|fltrace|flafter> \fl@trace{textmin + textfloatsheight:
3065 %<latexrelease|fltrace|flafter> \the \@textmin}%
3066 %<latexrelease|fltrace|flafter> \fl@trace{page-so-far: \the \@reqcolroom}%
3067 %<latexrelease|fltrace|flafter>
3069 %<latexrelease|fltrace|flafter> \ifdim \@textmin>\@reqcolroom
3070 %<latexrelease|fltrace|flafter> \@reqcolroom \@textmin
3072 %<latexrelease|fltrace|flafter> \fl@trace{ORD? textmin being used}%
3074 %<latexrelease|fltrace|flafter> \fi
3075 %<latexrelease|fltrace|flafter> \advance \@reqcolroom \ht\@currbox
3077 %<latexrelease|fltrace|flafter> \fl@trace{float size =
3078 %<latexrelease|fltrace|flafter> \the \ht \@currbox (addtocurcol)}%
3079 %<latexrelease|fltrace|flafter> \fl@trace{colroom =
3080 %<latexrelease|fltrace|flafter> \the \@colroom (addtocurcol)}%
3081 %<latexrelease|fltrace|flafter> \fl@trace{reqcolroom =
3082 %<latexrelease|fltrace|flafter> \the \@reqcolroom (addtocurcol)}%
3084 %<latexrelease|fltrace|flafter> \ifdim \@colroom>\@reqcolroom
3085 %<latexrelease|fltrace|flafter> \@flsetnum \@colnum
3086 %<latexrelease|fltrace|flafter> \ifnum \@colnum>\z@
3087 %<latexrelease|fltrace|flafter> \@bitor\@currtype\@deferlist
3089 %<latexrelease|fltrace|flafter> \fl@trace{deferlist:
3090 %<latexrelease|fltrace|flafter> \@deferlist: (addtocurcol-before)}%
3092 %<latexrelease|fltrace|flafter> \if@test
3094 %<latexrelease|fltrace|flafter> \fl@trace{type already on list:
3095 %<latexrelease|fltrace|flafter> defer (addtocurcol)}%
3097 %<latexrelease|fltrace|flafter> \else
3098 %<latexrelease|fltrace|flafter> \@bitor\@currtype\@botlist
3100 %<latexrelease|fltrace|flafter> \fl@trace{botlist: \@botlist:
3101 %<latexrelease|fltrace|flafter> (addtocurcol-before)}%
3103 %<latexrelease|fltrace|flafter> \if@test
3105 %<latexrelease|fltrace|flafter> \fl@trace{type already on list:
3106 %<latexrelease|fltrace|flafter> bot---sent to addtobot}%
3108 %<latexrelease|fltrace|flafter> \@addtobot
3109 %<latexrelease|fltrace|flafter> \else
3111 %<latexrelease|fltrace|flafter> \fl@trace{fpstype
3112 %<latexrelease|fltrace|flafter> \ifodd \@tempcnta OK \else not \fi
3113 %<latexrelease|fltrace|flafter> here: \the \@fpstype}%
3115 %<latexrelease|fltrace|flafter> \ifodd \count\@currbox
3116 %<latexrelease|fltrace|flafter> \advance \@reqcolroom \intextsep
3117 %<latexrelease|fltrace|flafter> \ifdim \@colroom>\@reqcolroom
3118 %<latexrelease|fltrace|flafter> \global \advance \@colnum \m@ne
3119 %<latexrelease|fltrace|flafter> \global \advance
3120 %<latexrelease|fltrace|flafter> \@textfloatsheight\ht\@currbox
3122 % This may sometimes give an overestimate.
3124 %<latexrelease|fltrace|flafter> \global \advance
3125 %<latexrelease|fltrace|flafter> \@textfloatsheight 2\intextsep
3126 %<latexrelease|fltrace|flafter> \@cons \@midlist \@currbox
3128 %<latexrelease|fltrace|flafter> \fl@trace{***Success: here}%
3129 %<latexrelease|fltrace|flafter> \fl@trace{textfloatsheight
3130 %<latexrelease|fltrace|flafter> (after-here) =
3131 %<latexrelease|fltrace|flafter> \the \@textfloatsheight}%
3132 %<latexrelease|fltrace|flafter> \fl@trace{colnum (after-here) =
3133 %<latexrelease|fltrace|flafter> \the \@colnum}%
3137 % CHANGE TO |\@addtocurcol|:
3139 % |\penalty\z@| changed to |\penalty\interlinepenalty| so |\samepage|
3140 % works properly with figure and table environments.
3141 % (Changed 23 Oct 86)
3143 % There is also an |\addpenalty\interlinepenalty| above.
3145 % Since in 2e |\samepage| is no longer supported, these could be
3148 % Although it is best to use |\addvspace| in case two h floats come
3149 % together, this makes other spacing more difficult to adjust; whereas
3150 % if a user specifies two h floats together then they can more easily
3151 % get the spacing correct by ad hoc commands.
3153 % It is necessary to adjust for the addition of |\parskip| here in
3154 % case the float is added between paragraphs (\ie when in vertical
3157 % If the nobreak switch is true we need to reset it and clear
3158 % |\everypar| since the float may not reset the flag and cannot reset
3159 % the |\everypar| globally.
3160 % \changes{v1.0l}{1994/03/15}{Changed \cs{addvspace} to \cs{vskip}}
3161 % \changes{v1.1i}{1994/11/21}
3162 % {Added \cs{if@nobreak} test before float box}
3163 % \changes{v1.1z}{1996/10/24}{Added \cs{nobreak}, etc as appropriate}
3165 % Typesetting starts here (we are in vertical mode).
3167 %<latexrelease|fltrace|flafter> \if@nobreak
3168 %<latexrelease|fltrace|flafter> \nobreak
3169 %<latexrelease|fltrace|flafter> \@nobreakfalse
3170 %<latexrelease|fltrace|flafter> \everypar{}%
3171 %<latexrelease|fltrace|flafter> \else
3172 %<latexrelease|fltrace|flafter> \addpenalty\interlinepenalty
3173 %<latexrelease|fltrace|flafter> \fi
3174 %<latexrelease|fltrace|flafter> \vskip \intextsep
3175 %<latexrelease|fltrace|flafter> \box\@currbox
3176 %<latexrelease|fltrace|flafter> \penalty\interlinepenalty
3177 %<latexrelease|fltrace|flafter> \vskip\intextsep
3178 %<latexrelease|fltrace|flafter> \ifnum\outputpenalty
3179 %<latexrelease|fltrace|flafter> <-\@Mii \vskip
3180 %<latexrelease|fltrace|flafter> -\parskip\fi
3182 % Typesetting ends here.
3184 %<latexrelease|fltrace|flafter> \outputpenalty \z@
3185 %<latexrelease|fltrace|flafter> \@inserttrue
3187 %<latexrelease|fltrace|flafter> \else
3188 %<latexrelease|fltrace|flafter> \fl@trace{Fail---no room at 2nd test of colroom
3189 %<latexrelease|fltrace|flafter> (addtocorcol \string\intextsep)}%
3191 %<latexrelease|fltrace|flafter> \fi
3192 %<latexrelease|fltrace|flafter> \fi
3193 %<latexrelease|fltrace|flafter> \if@insert
3194 %<latexrelease|fltrace|flafter> \else
3196 % Next set of docstrip guards are a bit weird, essentially
3197 % |\@addtotoporbot| ends up inside the kernel and the
3198 % \texttt{fltrace} package and |\@addtotoporbot| shows up in the
3199 % \texttt{flafter} package. Guess that could have been done a bit
3202 %<*2ekernel|fltrace>
3204 %<latexrelease|fltrace|flafter> \fl@trace{not here: sent to addtotoporbot}%
3206 %<latexrelease|fltrace|flafter> \@addtotoporbot
3207 %</2ekernel|fltrace>
3208 %<*!2ekernel&!autoload&!fltrace>
3210 %<latexrelease|fltrace|flafter> \fl@trace{not here: sent to addtobot}%
3212 %<latexrelease|fltrace|flafter> \@addtobot
3213 %</!2ekernel&!autoload&!fltrace>
3214 %<latexrelease|fltrace|flafter> \fi
3215 %<latexrelease|fltrace|flafter> \fi
3216 %<latexrelease|fltrace|flafter> \fi
3218 %<latexrelease|fltrace|flafter> \else
3219 %<latexrelease|fltrace|flafter> \fl@trace{Fail: colnum = \the \@colnum:
3220 %<latexrelease|fltrace|flafter> fpstype \the \@fpstype=ORD?}%
3221 %<latexrelease|fltrace|flafter> \ifnum \@fpstype<\sixt@@n
3222 %<latexrelease|fltrace|flafter> \fl@trace{ERROR: BANG float not successful
3223 %<latexrelease|fltrace|flafter> (addtocurcol)}%
3224 %<latexrelease|fltrace|flafter> \fi
3226 %<latexrelease|fltrace|flafter> \fi
3228 %<latexrelease|fltrace|flafter> \else
3229 %<latexrelease|fltrace|flafter> \fl@trace{Fail---no room: fl box ht:
3230 %<latexrelease|fltrace|flafter> \the \ht \@currbox (addtocurcol)}%
3232 %<latexrelease|fltrace|flafter> \fi
3233 %<latexrelease|fltrace|flafter> \fi
3234 %<latexrelease|fltrace|flafter> \fi
3235 %<latexrelease|fltrace|flafter> \if@insert
3236 %<latexrelease|fltrace|flafter> \else
3237 %<latexrelease|fltrace|flafter> \@resethfps
3239 %<latexrelease|fltrace|flafter> \fl@trace{put on deferlist (addtocurcol)}%
3241 %<latexrelease|fltrace|flafter> \@cons\@deferlist\@currbox
3243 %<latexrelease|fltrace|flafter> \fl@trace{deferlist: \@deferlist:
3244 %<latexrelease|fltrace|flafter> (addtocurcol-after)}%
3246 %<latexrelease|fltrace|flafter> \fi
3247 %<latexrelease|fltrace|flafter> }%
3248 %<latexrelease|fltrace|flafter>\EndIncludeInRelease
3252 % \begin{macro}{\@addtonextcol}
3253 % \changes{v1.0f}{1993/12/05}{Command changed}
3256 % \changes{v1.2n}{2015/01/14}{float order in 2-column (latexrelease)}
3258 %<latexrelease|fltrace>\IncludeInRelease{2015/01/01}
3259 %<latexrelease|fltrace> {\@addtonextcol}{float order in 2-column}%
3260 %<*2ekernel|fltrace>
3261 \def\@addtonextcol{%
3264 \fl@trace{***Start addtonextcol}%
3267 \@setfloattypecounts
3270 \fl@trace{fpstype not curcol: \the \@fpstype = 8?}%
3275 \fl@trace{fpstype not curcol: \the \@fpstype = 24?}%
3280 \fl@trace{text-so-far: 0pt (top of col)}%
3282 \@reqcolroom \ht\@currbox
3284 \fl@trace{float size: \the \@reqcolroom (addtonextcol)}%
3286 \advance \@reqcolroom \@textmin
3288 \fl@trace{colroom = \the \@colroom (addtonextcol)}%
3289 \fl@trace{reqcolroom = \the \@reqcolroom (addtonextcol)}%
3291 \ifdim \@colroom>\@reqcolroom
3294 \@bitor\@currtype\@deferlist
3296 \fl@trace{deferlist: \@deferlist: (addtonextcol-before)}%
3301 \@testwrongwidth\@currbox
3307 \fl@trace{type already on list: defer (addtonextcol)}%
3311 \fl@trace{sent to addtotoporbot (addtonextcol)}%
3318 \fl@trace{Fail---no room: fl box ht: \the \ht \@currbox
3327 \fl@trace{put back on deferlist (addtonextcol)}%
3329 \@cons\@deferlist\@currbox
3331 \fl@trace{deferlist: \@deferlist: (addtonextcol-after)}%
3335 \fl@trace{End of addtonextcol -- locally counts:}%
3336 \fl@trace{col: \the\@colnum. top: \the \@topnum. bot: \the \@botnum.}%
3340 \fl@trace{End of addtonextcol -- globally counts:}%
3341 \fl@trace{col: \the\@colnum. top: \the \@topnum. bot: \the \@botnum.}%
3344 %</2ekernel|fltrace>
3345 %<latexrelease|fltrace>\EndIncludeInRelease
3346 %<latexrelease|fltrace>\IncludeInRelease{0000/00/00}%
3347 %<latexrelease|fltrace> {\@addtonextcol}{float order in 2-column}%
3348 %<latexrelease|fltrace>\def\@addtonextcol{%
3349 %<latexrelease|fltrace> \begingroup
3351 %<latexrelease|fltrace> \fl@trace{***Start addtonextcol}%
3353 %<latexrelease|fltrace> \@insertfalse
3354 %<latexrelease|fltrace> \@setfloattypecounts
3355 %<latexrelease|fltrace> \ifnum \@fpstype=8
3357 %<latexrelease|fltrace> \fl@trace{fpstype not curcol:
3358 %<latexrelease|fltrace> \the \@fpstype = 8?}%
3360 %<latexrelease|fltrace> \else
3361 %<latexrelease|fltrace> \ifnum \@fpstype=24
3363 %<latexrelease|fltrace> \fl@trace{fpstype not curcol:
3364 %<latexrelease|fltrace> \the \@fpstype = 24?}%
3366 %<latexrelease|fltrace> \else
3367 %<latexrelease|fltrace> \@flsettextmin
3369 %<latexrelease|fltrace> \fl@trace{text-so-far: 0pt (top of col)}%
3371 %<latexrelease|fltrace> \@reqcolroom \ht\@currbox
3373 %<latexrelease|fltrace> \fl@trace{float size:
3374 %<latexrelease|fltrace> \the \@reqcolroom (addtonextcol)}%
3375 %<latexrelease|fltrace>
3377 %<latexrelease|fltrace> \advance \@reqcolroom \@textmin
3379 %<latexrelease|fltrace> \fl@trace{colroom =
3380 %<latexrelease|fltrace> \the \@colroom (addtonextcol)}%
3381 %<latexrelease|fltrace> \fl@trace{reqcolroom =
3382 %<latexrelease|fltrace> \the \@reqcolroom (addtonextcol)}%
3384 %<latexrelease|fltrace> \ifdim \@colroom>\@reqcolroom
3385 %<latexrelease|fltrace> \@flsetnum \@colnum
3386 %<latexrelease|fltrace> \ifnum\@colnum>\z@
3387 %<latexrelease|fltrace> \@bitor\@currtype\@deferlist
3389 %<latexrelease|fltrace> \fl@trace{deferlist: \@deferlist:
3390 %<latexrelease|fltrace> (addtonextcol-before)}%
3392 %<latexrelease|fltrace> \if@test
3394 %<latexrelease|fltrace> \fl@trace{type already on list:
3395 %<latexrelease|fltrace> defer (addtonextcol)}%
3397 %<latexrelease|fltrace> \else
3399 %<latexrelease|fltrace> \fl@trace{sent to addtotoporbot
3400 %<latexrelease|fltrace> (addtonextcol)}%
3402 %<latexrelease|fltrace> \@addtotoporbot
3403 %<latexrelease|fltrace> \fi
3404 %<latexrelease|fltrace> \fi
3406 %<latexrelease|fltrace> \else
3407 %<latexrelease|fltrace> \fl@trace{Fail---no room: fl box ht:
3408 %<latexrelease|fltrace> \the \ht \@currbox (addtonextcol)}%
3410 %<latexrelease|fltrace> \fi
3411 %<latexrelease|fltrace> \fi
3412 %<latexrelease|fltrace> \fi
3413 %<latexrelease|fltrace> \if@insert
3414 %<latexrelease|fltrace> \else
3416 %<latexrelease|fltrace> \fl@trace{put back on deferlist
3417 %<latexrelease|fltrace> (addtonextcol)}%
3419 %<latexrelease|fltrace> \@cons\@deferlist\@currbox
3421 %<latexrelease|fltrace> \fl@trace{deferlist: \@deferlist:
3422 %<latexrelease|fltrace> (addtonextcol-after)}%
3424 %<latexrelease|fltrace> \fi
3426 %<latexrelease|fltrace> \fl@trace{End of addtonextcol --
3427 %<latexrelease|fltrace> locally counts:}%
3428 %<latexrelease|fltrace> \fl@trace{col: \the \@colnum.
3429 %<latexrelease|fltrace> top: \the \@topnum. bot: \the \@botnum.}%
3431 %<latexrelease|fltrace> \endgroup
3433 %<latexrelease|fltrace> \fl@trace{End of addtonextcol --
3434 %<latexrelease|fltrace> globally counts:}%
3435 %<latexrelease|fltrace> \fl@trace{col: \the \@colnum.
3436 %<latexrelease|fltrace> top: \the \@topnum. bot: \the \@botnum.}%
3438 %<latexrelease|fltrace>}%
3439 %<latexrelease|fltrace>\EndIncludeInRelease
3444 % \begin{macro}{\@addtodblcol}
3445 % \changes{v1.0f}{1993/12/05}{Command changed}
3448 % \changes{v1.2n}{2015/01/14}{float order in 2-column (latexrelease)}
3450 %<latexrelease|fltrace>\IncludeInRelease{2015/01/01}%
3451 %<latexrelease|fltrace> {\@addtodblcol}{float order in 2-column}%
3452 %<*2ekernel|latexrelease|fltrace>
3456 \fl@trace{***Start addtodblcol}%
3459 \@setfloattypecounts
3462 \fl@trace{fpstype \ifodd \@tempcnta OK \else not \fi dbltop:
3466 \@flsetnum \@dbltopnum
3467 \ifnum \@dbltopnum>\z@
3469 \ifdim \@dbltoproom>\ht\@currbox
3472 \fl@trace{Space OK: \@dbltoproom =
3473 \the \@dbltoproom > \the \ht \@currbox
3478 \fl@trace{fpstype: \the \@fpstype (addtodblcol)}%
3480 \ifnum \@fpstype<\sixt@@n
3482 \fl@trace{BANG float ignoring \@dbltoproom}%
3483 \fl@trace{\@spaces \@dbltoproom = \the \@dbltoproom.
3484 Ht float: \the \ht \@currbox-BANG}%
3487 % Need to check that there is room on the page, using the local value
3488 % of |\@textmin| to make the necessary adjustment to |\@dbltoproom|.
3490 \advance \@dbltoproom \@textmin
3492 \fl@trace{Local value of texmin: \the\@textmin}%
3493 \fl@trace{\@spaces space on page = \the \@dbltoproom.
3494 Ht float: \the \ht \@currbox-BANG}%
3496 \ifdim \@dbltoproom>\ht\@currbox
3499 \fl@trace{Space OK BANG: space on page =
3500 \the \@dbltoproom > \the \ht \@currbox}%
3502 \fl@trace{fpstype: \the \@fpstype}%
3503 \fl@trace{Fail---no room dbltoproom-BANG?:}%
3504 \fl@trace{\@spaces space on page = \the \@dbltoproom.
3505 Ht float: \the \ht \@currbox}%
3508 \advance \@dbltoproom -\@textmin
3511 \fl@trace{fpstype: \the \@fpstype}%
3512 \fl@trace{Fail---no room dbltoproom-ORD?:}%
3513 \fl@trace{\@spaces \@dbltoproom = \the \@dbltoproom.
3514 Ht float: \the \ht \@currbox}%
3519 \@bitor \@currtype \@deferlist
3521 \fl@trace{(dbl)deferlist: \@deferlist: (before)}%
3527 \@testwrongwidth\@currbox
3533 \fl@trace{type already on list: (dbl)defer}%
3536 \@tempdima -\ht\@currbox
3538 -\ifx \@dbltoplist\@empty \dbltextfloatsep \else
3540 \global \advance \@dbltoproom \@tempdima
3541 \global \advance \@colht \@tempdima
3542 \global \advance \@dbltopnum \m@ne
3543 \@cons \@dbltoplist \@currbox
3545 \fl@trace{dbltopnum (after) = \the \@dbltopnum}%
3546 \fl@trace{***Success: dbltop}%
3553 \fl@trace{Fail: dbltopnum = \the \@dbltopnum: fpstype
3554 \the \@fpstype=ORD?}%
3555 \ifnum \@fpstype<\sixt@@n
3556 \fl@trace{ERROR: !t float not successful (addtodblcol)}%
3564 \fl@trace{put on deferlist}%
3566 \@cons\@deferlist\@currbox
3568 \fl@trace{(dbl)deferlist: \@deferlist: (after)}%
3572 \fl@trace{End of addtodblcol -- locally count:}%
3573 \fl@trace{ dbltop: \the \@dbltopnum.}%
3577 \fl@trace{End of addtodblcol -- globally count:}%
3578 \fl@trace{dbltop: \the \@dbltopnum.}%
3581 %</2ekernel|latexrelease|fltrace>
3582 %<latexrelease|fltrace>\EndIncludeInRelease
3583 %<latexrelease|fltrace>\IncludeInRelease{0000/00/00}%
3584 %<latexrelease|fltrace> {\@addtodblcol}{float order in 2-column}%
3585 %<latexrelease|fltrace>\def\@addtodblcol{%
3586 %<latexrelease|fltrace> \begingroup
3588 %<latexrelease|fltrace> \fl@trace{***Start addtodblcol}%
3590 %<latexrelease|fltrace> \@insertfalse
3591 %<latexrelease|fltrace> \@setfloattypecounts
3592 %<latexrelease|fltrace> \@getfpsbit \tw@
3594 %<latexrelease|fltrace> \fl@trace{fpstype \ifodd \@tempcnta OK
3595 %<latexrelease|fltrace> \else not \fi dbltop: \the \@fpstype}%
3597 %<latexrelease|fltrace> \ifodd\@tempcnta
3598 %<latexrelease|fltrace> \@flsetnum \@dbltopnum
3599 %<latexrelease|fltrace> \ifnum \@dbltopnum>\z@
3600 %<latexrelease|fltrace> \@tempswafalse
3601 %<latexrelease|fltrace> \ifdim \@dbltoproom>\ht\@currbox
3602 %<latexrelease|fltrace> \@tempswatrue
3604 %<latexrelease|fltrace> \fl@trace{Space OK: \@dbltoproom =
3605 %<latexrelease|fltrace> \the \@dbltoproom > \the \ht \@currbox
3606 %<latexrelease|fltrace> (dbltoproom)}%
3608 %<latexrelease|fltrace> \else
3610 %<latexrelease|fltrace> \fl@trace{fpstype: \the \@fpstype (addtodblcol)}%
3612 %<latexrelease|fltrace> \ifnum \@fpstype<\sixt@@n
3614 %<latexrelease|fltrace> \fl@trace{BANG float ignoring \@dbltoproom}%
3615 %<latexrelease|fltrace> \fl@trace{\@spaces \@dbltoproom =
3616 %<latexrelease|fltrace> \the \@dbltoproom.
3617 %<latexrelease|fltrace> Ht float: \the \ht \@currbox-BANG}%
3620 % Need to check that there is room on the page, using the local value
3621 % of |\@textmin| to make the necessary adjustment to |\@dbltoproom|.
3623 %<latexrelease|fltrace> \advance \@dbltoproom \@textmin
3625 %<latexrelease|fltrace> \fl@trace{Local value of texmin: \the\@textmin}%
3626 %<latexrelease|fltrace> \fl@trace{\@spaces space on page =
3627 %<latexrelease|fltrace> \the \@dbltoproom.
3628 %<latexrelease|fltrace> Ht float: \the \ht \@currbox-BANG}%
3630 %<latexrelease|fltrace> \ifdim \@dbltoproom>\ht\@currbox
3631 %<latexrelease|fltrace> \@tempswatrue
3633 %<latexrelease|fltrace> \fl@trace{Space OK BANG: space on page =
3634 %<latexrelease|fltrace> \the\@dbltoproom > \the\ht\@currbox}%
3635 %<latexrelease|fltrace> \else
3636 %<latexrelease|fltrace> \fl@trace{fpstype: \the \@fpstype}%
3637 %<latexrelease|fltrace> \fl@trace{Fail---no room dbltoproom-BANG?:}%
3638 %<latexrelease|fltrace> \fl@trace{\@spaces space on page =
3639 %<latexrelease|fltrace> \the \@dbltoproom.
3640 %<latexrelease|fltrace> Ht float: \the \ht \@currbox}%
3642 %<latexrelease|fltrace> \fi
3643 %<latexrelease|fltrace> \advance \@dbltoproom -\@textmin
3645 %<latexrelease|fltrace> \else
3646 %<latexrelease|fltrace> \fl@trace{fpstype: \the \@fpstype}%
3647 %<latexrelease|fltrace> \fl@trace{Fail---no room dbltoproom-ORD?:}%
3648 %<latexrelease|fltrace> \fl@trace{\@spaces \@dbltoproom =
3649 %<latexrelease|fltrace> \the \@dbltoproom.
3650 %<latexrelease|fltrace> Ht float: \the \ht \@currbox}%
3652 %<latexrelease|fltrace> \fi
3653 %<latexrelease|fltrace> \fi
3654 %<latexrelease|fltrace> \if@tempswa
3655 %<latexrelease|fltrace> \@bitor \@currtype \@dbldeferlist
3657 %<latexrelease|fltrace> \fl@trace{dbldeferlist:
3658 %<latexrelease|fltrace> \@dbldeferlist: (before)}%
3660 %<latexrelease|fltrace> \if@test
3662 %<latexrelease|fltrace> \fl@trace{type already on list: dbldefer}%
3664 %<latexrelease|fltrace> \else
3665 %<latexrelease|fltrace> \@tempdima -\ht\@currbox
3666 %<latexrelease|fltrace> \advance\@tempdima
3667 %<latexrelease|fltrace> -\ifx \@dbltoplist\@empty
3668 %<latexrelease|fltrace> \dbltextfloatsep
3669 %<latexrelease|fltrace> \else \dblfloatsep \fi
3670 %<latexrelease|fltrace> \global \advance \@dbltoproom \@tempdima
3671 %<latexrelease|fltrace> \global \advance \@colht \@tempdima
3672 %<latexrelease|fltrace> \global \advance \@dbltopnum \m@ne
3673 %<latexrelease|fltrace> \@cons \@dbltoplist \@currbox
3675 %<latexrelease|fltrace> \fl@trace{dbltopnum (after) =
3676 %<latexrelease|fltrace> \the \@dbltopnum}%
3677 %<latexrelease|fltrace> \fl@trace{***Success: dbltop}%
3679 %<latexrelease|fltrace> \@inserttrue
3680 %<latexrelease|fltrace> \fi
3681 %<latexrelease|fltrace> \fi
3683 %<latexrelease|fltrace> \else
3684 %<latexrelease|fltrace> \fl@trace{Fail: dbltopnum = \the \@dbltopnum:
3685 %<latexrelease|fltrace> fpstype \the \@fpstype=ORD?}%
3686 %<latexrelease|fltrace> \ifnum \@fpstype<\sixt@@n
3687 %<latexrelease|fltrace> \fl@trace{ERROR: !t float not successful
3688 %<latexrelease|fltrace> (addtodblcol)}%
3689 %<latexrelease|fltrace> \fi
3691 %<latexrelease|fltrace> \fi
3692 %<latexrelease|fltrace> \fi
3693 %<latexrelease|fltrace> \if@insert
3694 %<latexrelease|fltrace> \else
3696 %<latexrelease|fltrace> \fl@trace{put on dbldeferlist}%
3698 %<latexrelease|fltrace> \@cons\@dbldeferlist\@currbox
3700 %<latexrelease|fltrace> \fl@trace{dbldeferlist: \@dbldeferlist: (after)}%
3702 %<latexrelease|fltrace> \fi
3704 %<latexrelease|fltrace> \fl@trace{End of addtodblcol -- locally count:}%
3705 %<latexrelease|fltrace> \fl@trace{ dbltop: \the \@dbltopnum.}%
3707 %<latexrelease|fltrace> \endgroup
3709 %<latexrelease|fltrace> \fl@trace{End of addtodblcol -- globally count:}%
3710 %<latexrelease|fltrace> \fl@trace{dbltop: \the \@dbltopnum.}%
3712 %<latexrelease|fltrace>}%
3713 %<latexrelease|fltrace>\EndIncludeInRelease
3719 % \begin{macro}{\@addmarginpar}
3722 \def\@addmarginpar{\@next\@marbox\@currlist{\@cons\@freelist\@marbox
3723 \@cons\@freelist\@currbox}\@latexbug\@tempcnta\@ne
3725 \if@firstcolumn \@tempcnta\m@ne \fi
3728 \ifodd\c@page \else\@tempcnta\m@ne \fi
3730 \if@reversemargin \@tempcnta -\@tempcnta \fi
3732 \ifnum\@tempcnta <\z@ \global\setbox\@marbox\box\@currbox \fi
3733 \@tempdima\@mparbottom
3734 \advance\@tempdima -\@pageht
3735 \advance\@tempdima\ht\@marbox
3736 \ifdim\@tempdima >\z@
3737 \@latex@warning@no@line {Marginpar on page \thepage\space moved}%
3741 \global\@mparbottom\@pageht
3742 \global\advance\@mparbottom\@tempdima
3743 \global\advance\@mparbottom\dp\@marbox
3744 \global\advance\@mparbottom\marginparpush
3745 \advance\@tempdima -\ht\@marbox
3747 % Putting box movement inside the `marbox':
3749 \global\setbox \@marbox
3750 \vbox {\vskip \@tempdima
3752 \global \ht\@marbox \z@
3753 \global \dp\@marbox \z@
3755 % Sticking (rather than gluing:-) the `marbox' to the line above,
3756 % changed vskip to kern:
3761 {\ifnum \@tempcnta >\z@
3762 \hskip\columnwidth \hskip\marginparsep
3764 \hskip -\marginparsep \hskip -\marginparwidth
3768 % For this reason the following code can vanish:
3770 % \nobreak %% No longer needed. CAR92/12
3771 % \vskip -\@tempdima %% No longer needed. CAR92/12
3775 \hbox{\vrule \@height\z@ \@width\z@ \@depth\@pagedp}}
3779 % \subsubsection{Kludgeins}
3781 % This part of the file is part of the implementation of the following
3782 % two new commands for \LaTeX2e{}.
3786 % \enlargethispage{<dim>}
3789 % Adds |<dim>| to the height of the current column only. On the printed
3790 % page the bottom of this column is extended downwards by exactly
3791 % |<dim>| without having any effect on the placement of the footer; this
3792 % may result in an overprinting.
3795 % \enlargethispage*{<dim>}
3798 % Similar to |\enlargethispage| but it tries to squeeze the column to
3799 % be printed in as small a space as possible, ie it uses any
3800 % shrinkability in the column. If the column was not explicitly broken
3801 % (\eg with |\pagebreak|) this may result in an overfull box message but
3802 % execpt for this it will come out as expected (if you know what to
3805 % The star form of this command is dedicated to Leslie Lamport, the
3806 % other we need for ourselves (FMi, CAR).
3808 % These commands may well have unwanted effects if used soon
3809 % before a |\clearpage|: please give keep them clear of such places.
3811 % \begin{macro}{\@kludgeins}
3812 % \changes{v0.1c}{1993/11/23}{Insert added}
3813 % The insert which makes \TeX{} do a lot of the necessary work.
3814 % All we need to put into it is the amount by which the pagegoal
3815 % should be changed.
3817 \newinsert \@kludgeins
3818 \global\dimen\@kludgeins \maxdimen
3819 \global\count\@kludgeins 1000
3824 % \begin{macro}{\enlargethispage}
3825 % \begin{macro}{\enlargethispage*}
3826 % \changes{v0.1c}{1993/11/23}{Commands added}
3829 \gdef \enlargethispage {%
3833 \fl@trace{Enlarging page height * }%
3835 \@enlargepage{\hbox{\kern\p@}}}%
3838 \fl@trace{Enlarging page height exactly---}%
3840 \@enlargepage\@empty}%
3847 % \begin{macro}{\@enlargepage}
3848 % \changes{v0.1c}{1993/11/23}{Command added}
3849 % This actually inserts the insert, after checking for extreme
3850 % values of the change.
3852 \gdef\@enlargepage#1#2{%
3854 \fl@trace{\@spaces\@spaces by #2}%
3857 \ifdim \@tempskipa>.5\maxdimen
3858 \@latexerr{Suggested\space extra\space height\space
3859 (\the\@tempskipa)\space dangerously\space
3862 \ifdim \vsize<.5\maxdimen
3864 \fl@trace {Kludgeins added--pagegoal before: \the\pagegoal}%
3867 \insert\@kludgeins{#1\vskip-\@tempskipa}%
3870 % This next bit is for tracing only:
3874 \fl@trace {Kludgeins added--pagegoal after: \the \pagegoal}%
3878 \@latexerr{Page\space height\space already\space
3879 too\space large}\@eha
3887 % \subsubsection{Float control}
3889 % This part implements controllable floats and other changes
3890 % to the float mechanism.
3892 % It provides, at the document level, the following command for
3893 % inclusion in \LaTeX2e{}.
3899 % This suppresses all further floats on the current page.
3901 % With an optional argument it suppresses only floats only in certain
3902 % positions on the current page.
3904 % |[t]|\quad suppresses only floats at the top of the page
3905 % |[b]|\quad suppresses only floats at the bottom of the page
3908 % It also enables the use of an extra specifier, {\tt !}, in the
3909 % location optional argument of a float. If this is present then,
3910 % just for this particular float, whenever it is processed by the float
3911 % mechanism the followinhg are ignored:
3914 % \item all restrictions on the number of floats which can appear;
3915 % \item all explicit restrictions on the amount of space which should
3916 % (not) be occupied by floats and/or text.
3919 % The mechanism will still attempt to ensure that pages are not
3922 % These specifiers override, for the single float, the suppression
3923 % commands described above.
3926 % In its current form, it also supplies a reasonably exhaustive, and
3927 % somewhat baroque, means of tracing some aspects of the float
3931 % \begin{macro}{\fl@trace}
3932 % \begin{macro}{\tracefloatsoff}
3933 % \begin{macro}{\tracefloats}
3934 % \begin{macro}{\fl@traceval}
3935 % \begin{macro}{\tracefloatvals}
3936 % \begin{macro}{\fl@tracemessage}
3937 % \changes{v1.0c}{1993/11/30}{Commands added}
3938 % \changes{v1.0h}{1993/12/12}{Commands changed}
3939 % \changes{v1.0j}{1993/12/17}{tracefloatvals made a document command}
3940 % Set-up tracing for floats independent of other tracing as it
3941 % produces mega-output. Default is no tracing.
3942 % \changes{v1.1j}{1995/04/24}
3943 % {Do not add to kernel unless `trace' specified}
3944 % \changes{v1.2n}{2014/04/24}
3945 % {Renamed internal trace commands; provide as package}
3949 \def \fl@tracemessage #1{{\let\@elt\@empty\typeout{LaTeX2e: #1}}}
3950 \def \tracefloats{\let \fl@trace \fl@tracemessage}
3951 \def \tracefloatsoff {\let \fl@trace \@gobble}
3953 \def \fl@traceval #1{\fl@trace{\string #1 = \the #1}}
3954 \IncludeInRelease{2015/01/01}{\tracefloatvals}%
3956 \def \tracefloatvals{%
3958 % As |\@dblfloatplacement| sets |\f@depth| it needs to be run
3959 % inside a group, otherwise the float placement will test for the
3960 % wrong value.\footnote{This is a somewhat questionable design.}
3965 \fl@trace{***Float placement parameters:}%
3966 \fl@traceval\@colnum
3967 \fl@traceval\@colroom
3968 \fl@traceval\@topnum
3969 \fl@traceval\@toproom
3970 \fl@traceval\@botnum
3971 \fl@traceval\@botroom
3973 \fl@trace{\string\textfraction = \textfraction}%
3974 \fl@traceval\@dbltopnum
3975 \fl@traceval\@dbltoproom
3976 \fl@trace{\string\textfraction = \textfraction}%
3977 \fl@trace{toplist: \@toplist}%
3978 \fl@trace{botlist: \@botlist}%
3979 \fl@trace{midlist: \@midlist}%
3980 \fl@trace{deferlist: \@deferlist}%
3981 \fl@trace{dbltoplist: \@dbltoplist}%
3982 %FMi \fl@trace{dbldeferlist: \@dbldeferlist}%
3985 \EndIncludeInRelease
3986 \IncludeInRelease{0000/00/00}{\tracefloatvals}%
3988 \def \tracefloatvals{%
3992 \fl@trace{***Float placement parameters:}%
3993 \fl@traceval\@colnum
3994 \fl@traceval\@colroom
3995 \fl@traceval\@topnum
3996 \fl@traceval\@toproom
3997 \fl@traceval\@botnum
3998 \fl@traceval\@botroom
4000 \fl@trace{\string\textfraction = \textfraction}%
4001 \fl@traceval\@dbltopnum
4002 \fl@traceval\@dbltoproom
4003 \fl@trace{\string\textfraction = \textfraction}%
4004 \fl@trace{toplist: \@toplist}%
4005 \fl@trace{botlist: \@botlist}%
4006 \fl@trace{midlist: \@midlist}%
4007 \fl@trace{deferlist: \@deferlist}%
4008 \fl@trace{dbltoplist: \@dbltoplist}%
4009 % next line only in old releases
4010 \fl@trace{dbldeferlist: \@dbldeferlist}%
4013 \EndIncludeInRelease
4015 % We need to make sure that \texttt{fltrace} comes before
4016 % \texttt{flafter} to make the tracing work.
4018 \@ifpackageloaded{flafter}
4019 {\PackageWarningNoLine
4020 {fltrace}{Load 'fltrace' before 'flafter'\MessageBreak
4021 Attempting to recover by reloading 'flafter'}%
4023 % Hide the fact that \texttt{flafter} was already loaded and then
4025 % \changes{v1.2m}{2015/01/20}{Reset \cs{IncludeInRelease} flags}
4027 \expandafter\let\csname ver@flafter.sty\endcsname\relax
4029 \expandafter\let\csname\string#1+flafter+IIR\endcsname\relax}%
4030 \reserved@a\@addtocurcol
4031 \reserved@a\@addtonextcol
4032 \RequirePackage{flafter}}{}
4035 % As the code for \texttt{flafter} will contain tracing calls so
4036 % that it works in conjunction with \texttt{fltrace} we need to
4037 % provide a dummy definition for |\fl@trace| in that package.
4040 \providecommand\fl@trace[1]{}
4050 % \begin{macro}{\suppressfloats}
4051 % \begin{macro}{\@flstop}
4052 % \changes{v1.0f}{1993/12/05}{Commands added}
4053 % Float suppression commands: these set the relevant counter
4054 % globally to zero. Thus they are overridden for a particular float
4055 % by an ! specifier.
4059 \def \suppressfloats {%
4062 {\global \@colnum \z@}%
4065 % Maybe this should be a loop over |#1|?
4067 \def \@flstop [#1]{%
4069 \global \@topnum \z@
4072 \global \@botnum \z@
4080 % Manipulation of float placement and type; both their strings and the
4081 % corresponding count registers.
4083 % \begin{macro}{\@fpstype}
4084 % \begin{macro}{\@reqcolroom}
4085 % \begin{macro}{\@textfloatsheight}
4086 % \changes{v1.0f}{1993/12/05}{Commands added}
4087 % First a new count register to go with |\@currtype|.
4089 % Then a new skip register, for information needed to remove the
4090 % |\@maxsep| conservatism: it is possible that this could use a
4091 % temporary register.
4093 % Finally a dimension register to hold the total height of in-text
4094 % floats on the current page. This is needed to implement a
4095 % major change in the functionality of |\@addtocurcol| which is,
4096 % nevertheless, a bug fix.
4097 % It is not local and therefore cannot be a temporary register.
4101 \newdimen \@reqcolroom
4102 \newdimen \@textfloatsheight
4109 % \begin{macro}{\@fpsadddefault}
4110 % \changes{v1.0f}{1993/12/05}{Command added}
4111 % Adds the default placement to what is already there.
4113 % Should not need to change this, but could do it as follows:
4115 %\def \@fpsadddefault {%
4116 % \@temptokena \expandafter\expandafter\expandafter
4117 % {\csname fps@\@captype \endcsname}%
4118 % \edef \reserved@a {\the\@temptokena}%
4119 % \@onelevel@sanitize \reserved@a
4120 % \edef \@fps {\@fps\reserved@a}%
4125 %<*2ekernel|fltrace>
4126 \def \@fpsadddefault {%
4128 \fl@trace{fps changed from: \@fps}%
4130 \edef \@fps {\@fps\csname fps@\@captype \endcsname}%
4132 No positions in optional float specifier.\MessageBreak
4133 Default added (so using `\@fps')}%
4138 % \begin{macro}{\@setfloattypecounts}
4139 % \changes{v1.0f}{1993/12/05}{Command added}
4140 % Sets counters |\@fpstype| and |\@currtype|.
4142 % BANG $==$ bit4 of $|\count\@currbox| = 0$.
4145 \def \@setfloattypecounts {%
4146 \@currtype \count\@currbox
4147 \@fpstype \count\@currbox
4148 \divide\@currtype\@xxxii \multiply\@currtype\@xxxii
4149 \advance \@fpstype -\@currtype
4151 \fl@trace{(mod 32) fpstype: \the \@fpstype}%
4152 \fl@trace{(mult of 32) currtype: \the \@currtype}%
4153 % Tracing only: but some should be changed into real errors/warnings?
4154 \ifnum \@fpstype<\sixt@@n
4155 \ifnum \@fpstype=\z@
4156 \fl@trace{ERROR: no PLACEMENT, fpstype = \the \@fpstype = 0?}%
4158 \ifnum \@fpstype=\@ne
4159 \fl@trace{WARNING: only h, fpstype = \the \@fpstype = 1?}%
4161 \fl@trace{BANG float}%
4163 \ifnum \@fpstype=\sixt@@n
4164 \fl@trace{ERROR: no PLACEMENT, fpstype = \the \@fpstype = 16?}%
4167 \fl@trace{WARNING: only h, fpstype = \the \@fpstype = 17?}%
4169 \fl@trace{ORD float}%
4173 %</2ekernel|fltrace>
4177 % Macros for getting, testing and setting bits of the fps.
4180 % \begin{macro}{\@getfpsbit}
4181 % \changes{v1.0f}{1993/12/05}{Command added}
4182 % Sets |\@tempcnta| to required bit of |\count\@currbox|.
4187 \@boxfpsbit \@currbox
4193 % \begin{macro}{\@boxfpsbit}
4194 % \changes{v1.0f}{1993/12/05}{Command added}
4197 \def \@boxfpsbit #1#2{%
4198 \@tempcnta \count#1%
4199 \divide \@tempcnta #2\relax
4204 % \begin{macro}{\@testfp}
4205 % \changes{v1.0f}{1993/12/05}{Command added}
4206 % New definition of the float page test.
4208 % \changes{v1.1v}{1996/07/26}{remove \cs{global} before \cs{@test...}}
4211 \@boxfpsbit #18\relax % Really `#1 8' for human readers!
4221 % \begin{macro}{\@setfpsbit}
4222 % \changes{v1.0f}{1993/12/05}{Command added}
4223 % Sets required bit of |\@tempcnta| (to 1).
4226 \def \@setfpsbit #1{%
4227 \@tempcntb \@tempcnta
4228 \divide \@tempcntb #1\relax
4231 \advance \@tempcnta #1\relax
4239 % \begin{macro}{\@resethfps}
4240 % \changes{v1.0f}{1993/12/05}{Command added}
4241 % \changes{v1.0h}{1993/12/12}{Warnings added: minimal}
4242 % \changes{v1.0m}{1994/04/24}{Warning changed}
4243 % \changes{v1.0m}{1994/04/24}{Number 2 changed to \cs{tw@}}
4244 % \changes{v1.0o}{1994/05/02}{Code shortened}
4245 % Globally adds t as a possible location for an h or !h only placement:
4246 % this must be done using the count.
4248 % Although it will leave |\@fpstype| set to 17 even if it was
4249 % originally 1, this does not matter since it is the last thing in
4252 %<*2ekernel|fltrace>
4254 \let\reserved@a\@empty
4255 \ifnum \@fpstype=\@ne
4256 \def \reserved@a {!}%
4260 \global \advance \count\@currbox \tw@
4261 \@latex@warning@no@line {%
4262 `\reserved@a h' float specifier changed to `\reserved@a ht'}%
4265 `t' added to `\reserved@a h'- new Count: \the \count\@currbox}%
4273 % Special stuff for BANG floats.
4275 % \begin{macro}{\@flsetnum}
4276 % \changes{v1.0f}{1993/12/05}{Command added}
4278 % Ignores any zero float counter value in case BANG.
4280 % It uses a local assignment to the normally global counter: a bit
4283 % These assignments are safe so long as the counter involved is only
4284 % consulted once (\ie only for the `bang float') with the changed value.
4285 % This is the case within |\@addtocurcol| because it is used only
4286 % once within a call of the output routine (which forms a group).
4288 % For |\@addtonextcol| this is achieved by putting a group around its
4289 % code; this is needed because it is called (by |\@startcolumn|) for
4290 % each float which was on the deferlist. Almost identical
4291 % considerations pertain to |\@addtodblcol|. There may be more
4292 % efficient ways to handle this, but the group seems to be the simplest.
4294 % \changes{v1.0n}{1994/04/30}{Rogue space removed}
4296 \def \@flsetnum #1{%
4298 \fl@trace{fpstype: \the \@fpstype (flsetnum \string#1)}%
4300 \ifnum \@fpstype<\sixt@@n
4303 \fl@trace{BANG float resetting \string#1 to 1}%
4309 \fl@trace{#1 (before) = \the #1}%
4316 % \begin{macro}{\@flsettextmin}
4317 % \changes{v1.0f}{1993/12/05}{Command added}
4318 % This ignores |\textfraction| space restriction in case BANG.
4321 \def \@flsettextmin {%
4323 \fl@trace{fpstype: \the \@fpstype (flsettextmin)}%
4325 \ifnum \@fpstype<\sixt@@n
4327 \fl@trace{BANG ignoring textmin}%
4331 \@textmin \textfraction\@colht
4333 \fl@trace{ORD textmin = \the \@textmin}%
4341 % \begin{macro}{\@flcheckspace}
4342 % \changes{v1.0f}{1993/12/05}{Command added}
4343 % This ignores space restriction in case BANG; this is still slightly
4344 % conservative since it does not allow for the fact that, if there is
4345 % no text in the column then |\textfloatsep| is not needed.
4346 % Sets |@tempswa| true if there is room for |\@currbox|.
4349 \def \@flcheckspace #1#2{%
4350 \advance \@reqcolroom
4351 \ifx #2\@empty \textfloatsep \else \floatsep \fi
4353 \fl@trace{colroom = \the \@colroom
4354 (flcheckspace \string#1 \string#2)}%
4355 \fl@trace{reqcolroom = \the \@reqcolroom
4356 (flcheckspace \string#1 \string#2)}%
4358 \ifdim \@colroom>\@reqcolroom
4359 \ifdim #1>\ht\@currbox
4362 \fl@trace{Space OK: #1 = \the #1 > \the \ht \@currbox
4363 (flcheckspace \string#1 \string#2)}%
4367 \fl@trace{fpstype: \the \@fpstype
4368 (flcheckspace \string#1 \string#2)}%
4370 \ifnum \@fpstype<\sixt@@n
4372 \fl@trace{BANG float ignoring #1
4373 (flcheckspace \string#1 \string#2):}%
4374 \fl@trace{\@spaces #1 = \the #1. Ht float: \the \ht \@currbox
4380 \fl@trace{Fail---no room (flcheckspace \string#1 \string#2)
4381 (fpstype \the \@fpstype=ORD?):}%
4382 \fl@trace{\@spaces #1 = \the #1. Ht float: \the \ht \@currbox
4389 \fl@trace{Fail---no room at 2nd test of colroom
4390 (flcheckspace \string#1 \string#2)}%
4394 %</2ekernel|fltrace>
4399 % \begin{macro}{\@flupdates}
4400 % \changes{v1.0f}{1993/12/05}{Command added}
4401 % This updates everything when a float is placed.
4405 \def \@flupdates #1#2#3{%
4406 \global \advance #1\m@ne
4407 \global \advance \@colnum \m@ne
4408 \@tempdima -\ht\@currbox
4410 -\ifx #3\@empty \textfloatsep \else \floatsep \fi
4411 \global \advance #2\@tempdima
4412 \global \advance \@colroom \@tempdima
4420 % Interesting facts about float mechanisms past and present, together
4421 % with a summary of various features, some unresolved:
4424 % \item The value |\textfraction| does not affect the processing
4425 % of doublecol floats: this seems sensible, but should be
4427 % \item |\twocolumn| floatplacement was wrong: dbl not needed, ord
4429 % \item |\@floatplacement| was not called after |\@startdblcol|
4430 % or |\@topnewpage|. This has been changed; it is clearly a bug
4432 % \item The use |\@topnewpage| when |\dblfigrule| is non-trivial
4433 % produced a rule in the wrong place. This has been fixed by not
4434 % using |\dblfigrule| when processing the `float' from
4436 % \item If the specifier was just h and the float could not be put
4437 % here, it went on the deferlist and stayed there until a clearpage.
4438 % It now gets changed to a `th': this is only an error-recovery
4439 % action, putting just h or !h should be deprecated.
4440 % \item |\@dblmaxsep| was `the maximum of |\dblfloatsep| and
4441 % |\dbltexfloatsep|'. But it was never used! Now gone completely,
4443 % \item After an h float is put on a page, it was counted as text when
4444 % applying the |\textfraction| test; this is possibly too big a
4445 % change although it is a bug fix?
4446 % \item Two consecutive h floats are separated by twice |\intextsep|:
4447 % this could be changed to one by use of |\addvspace|, OK?
4448 % Note that it would also mean that less space is put in if an h
4449 % float immediately follows other spaces. This is also possibly
4450 % too big a change, at least for compatibility mode?
4451 % Or it may be simply wrong! It has not been changed.
4452 % \item Now |\@addtocurcol| checks first for just p fps. I think
4453 % that this is an increase in efficiency, but maybe the coding
4454 % should be made even more efficient.
4455 % \item |\@tryfcolumn| now tests if the list is empty first, otherwise
4456 % lots of wasted time! Thus this test has been removed from
4458 % As Frank pointed out, this makes |\@startcolumn| less
4459 % efficient. But it is now the same as |\@startdblcolumn|: I can
4460 % see no reason why they should be different, but which is best?
4461 % \item Why is |\@colroom| set in |\@doclearpage|?
4462 % \item Footnotes. Check what |\clearpage| does when footnotes are
4463 % left over. Footnotes are not put on float pages and, also,
4464 % |\@addtonextcol| ignores the existence of held-over footnotes
4465 % in deciding what floats can go on the page. Not changed.
4466 % \item |\clearpage| can still lose non-boxes, at least when floats
4467 % are involved. It also moves some to the `wrong page', but this
4468 % may be a coding problem.
4469 % \item The ! option makes it necessary to check in |\output| that
4470 % there is enough room left on the page after adding a float. (This
4471 % would have been necessary anyway if anyone set |\@textmin| too
4472 % close to zero! A similar danger existed also if the text in a
4473 % |\twocolumn[text]| entity gets too large.)
4474 % The current implementation of this also makes the normal case a
4475 % little less efficient, OK?
4476 % Not enough room means, at present, less than |\baselineskip|,
4477 % with a warning: is this OK? Should it be made generic (another
4479 % \item There are four possibilities for supporting this:
4481 % |\twocolumn[\maketitle more text]|
4484 % |\maketitle| slightly to allow this. Another is to change
4485 % |\@topnewpage| so that more than one |\twocolumn[]| command is
4486 % allowed; in this case |\maketitle\twocolumn[more text]| will work.
4487 % The former is more robust from the user's viewpoint, but makes the
4488 % code for |\maketitle| rather ad hoc (maybe it is already?).
4489 % Another is to misuse the global twocolumn flag locally within
4491 % Yet another is to move the column count register from the multicol
4492 % package into the kernel. This has been done.
4493 % \item Where should the reinserts be put to maximise the
4494 % probability that footmotes come out on the correct page?
4495 % Or should we go for as much compatibility as possible (but see
4497 % \item Should we continue to support (as much as possible)
4498 % |\samepage|? Some of its intended functionality is now advertised
4499 % as being provided by |\enlargethispage|. Use of either is likely
4500 % to result in wrongly placed footnotes, marginals, etc.
4501 % Which should have priority: obeying the pagination instructions,
4502 % or correct placement of notes/marginalia?
4503 % \item Is the adjustment of space to cause shrinking in the
4504 % kludge-* case correct? Should it be limited to 0pt?
4505 % \item Is the setting of |\boxmaxdepth| in makecol and friends
4506 % needed? It only has any effect if |\@textbottom| ends with a box
4507 % or rule, in which case the vskip to allow for its depth should
4508 % also be added. If it is kept, it should probably be the last
4509 % thing in the box. It has now been removed.
4511 % It would perhaps be better to document that |\@textbottom|
4512 % and |\@texttop| must have natural height 0pt.
4513 % \item I cannot see why the vskip adjustment for the depth
4514 % is needed if boxmaxdepth is used to ensure that there is never
4516 % \item The value of |\boxmaxdepth| should be explicitly set
4517 % whenever necessary: it is too risky to assume that it has any
4518 % particular value. Care is needed in deciding what to set it to.
4520 % It is interesting to note that the value of |\boxmaxdepth| is
4521 % unique in being read before the local settings for the box group
4522 % are reset; all other parameter settings which affect the box
4523 % construction use their values outside the box group.
4524 % \item Should |\@maxdepth| store the setting of |\maxdepth| from
4525 % lplain? Or should we provide a proper interface to class files
4526 % for setting these?
4529 % An analysis of various other macros.
4531 % |\@opcol| should do |\@floatplacement|, but where? Right at the
4532 % end, since it always occurs at the start of a column.
4535 % % Why is this done first?
4536 % \global \@mparbottom \z@
4541 % % This is not needed since it is done at the end of
4543 % \global \@colht \textheight
4547 % Only tracing has been added to these.
4550 %<latexrelease|fltrace>\IncludeInRelease{2017/01/01}%
4551 %<latexrelease|fltrace> {\@makefcolumn}{negative height floats}%
4552 %<*2ekernel|fltrace|latexrelease>
4553 \def\@makefcolumn #1{%
4556 % \changes{v1.3b}{2017/01/01}{make fpmin negative so ignored even if float height is negative}
4562 \let \@testfp \@gobble
4567 \fl@trace{PAGE: in \string\clearpage
4568 \if@twocolumn ---twocolumn\fi---}%
4569 \fl@trace{----- float column/page completed from \string#1}%
4576 %<latexrelease|fltrace>\EndIncludeInRelease
4577 %<latexrelease|fltrace>\IncludeInRelease{0000/00/00}%
4578 %<latexrelease|fltrace> {\@makefcolumn}{negative height floats}%
4579 %<latexrelease|fltrace>\def\@makefcolumn #1{%
4580 %<latexrelease|fltrace> \begingroup
4581 %<latexrelease|fltrace> \@fpmin \z@
4582 %<latexrelease|fltrace> \let \@testfp \@gobble
4583 %<latexrelease|fltrace> \@tryfcolumn #1%
4584 %<latexrelease|fltrace> \endgroup
4586 %<latexrelease|fltrace> \if@fcolmade
4587 %<latexrelease|fltrace> \fl@trace{PAGE: in \string\clearpage
4588 %<latexrelease|fltrace> \if@twocolumn ---twocolumn\fi---}%
4589 %<latexrelease|fltrace> \fl@trace{----- float column/page completed
4590 %<latexrelease|fltrace> from \string#1}%
4591 %<latexrelease|fltrace> \fi
4593 %<latexrelease|fltrace>}
4594 %<latexrelease|fltrace>\EndIncludeInRelease
4595 %</2ekernel|fltrace|latexrelease>
4597 % This will line up the last baselines in the two
4598 % columns provided they are constructed in the normal way: \ie ending
4599 % in a skip of minus the original depth, with |\@textbottom| adding
4602 % Thus again it is essential for |\@textbottom| to have depth 0pt.
4603 % \changes{1.2g}{2000/07/12}{Ensure that rule is in \cs{normalcolor}}
4604 % \changes{v1.2m}{2014/12/30}{Command updated (latexrelease)}
4606 %<latexrelease|fltrace>\IncludeInRelease{2015/01/01}%
4607 %<latexrelease|fltrace> {\@outputdblcol}{2 column marks}%
4608 %<*2ekernel|fltrace|latexrelease>
4612 % This is just a change to the single command |\@outputdblcol|
4613 % so that it saves mark information for the first column and restores
4614 % it in the second column.
4616 \def\@outputdblcol{%
4618 \global\@firstcolumnfalse
4620 % Save the left column
4622 \global\setbox\@leftcolumn\copy\@outputbox
4623 %<fltrace> \fl@trace{PAGE: first column boxed}%
4626 % Remember the marks from the first column
4628 \splitmaxdepth\maxdimen
4631 % In case of |\enlargethispage| we will have infinite negative glue
4632 % at the bottom of the page (coming from |\vss|) and that will earn
4633 % us an error message if we |\vsplit| to get at the marks. So we
4634 % need to remove thek last glue (if any) at the end of |\@outputbox|
4635 % as we are only interested in marks that change doesn't matter.
4636 % \changes{v1.1o}{2014/04/18}{Handle infinite glue from
4637 % \cs{enlargethispage} (pr/4023)}
4639 \setbox\@outputbox\vbox{\unvbox\@outputbox\unskip}%
4640 \setbox\@outputbox\vsplit\@outputbox to\maxdimen
4643 % One minor difference from the current |fixmarks| package, pass the
4644 % marks through a token register to stop any |#| tokens causing an
4645 % error in a |\def|.
4647 \toks@\expandafter{\topmark}%
4648 \xdef\@firstcoltopmark{\the\toks@}%
4649 \toks@\expandafter{\splitfirstmark}%
4650 \xdef\@firstcolfirstmark{\the\toks@}%
4653 % This test does not work if truly empty marks have been inserted, but
4654 % \LaTeX\ marks should always have (at least) two brace groups.
4655 % (Except before the first mark is used, when the marks are empty,
4656 % but that is OK here.)
4658 \ifx\@firstcolfirstmark\@empty
4659 \global\let\@setmarks\relax
4662 \let\firstmark\@firstcolfirstmark
4663 \let\topmark\@firstcoltopmark}%
4670 \global\@firstcolumntrue
4671 \setbox\@outputbox\vbox{%
4673 \hb@xt@\columnwidth{\box\@leftcolumn \hss}%
4676 % \changes{v1.1m}{2006/09/13}{Ensure that rule is in \cs{normalcolor}}
4677 % The color of the \cs{vrule} should be \cs{normalcolor} as to not
4678 % inherit the color from the column.
4680 {\normalcolor\vrule \@width\columnseprule}%
4682 \hb@xt@\columnwidth{\box\@outputbox \hss}}}%
4683 %<fltrace> \fl@trace{PAGE: second column also boxed}%
4686 % Override current first and top with those of first column if necessary
4693 %<fltrace> \fl@trace{PAGE: two column page completed}%
4697 \@whilesw\if@fcolmade \fi{\@outputpage
4698 %<fltrace> \fl@trace{PAGE: double float page completed}%
4705 %<latexrelease|fltrace>\EndIncludeInRelease
4706 %<latexrelease|fltrace>\IncludeInRelease{0000/00/00}%
4707 %<latexrelease|fltrace> {\@outputdblcol}{2 column marks}%
4708 %<latexrelease|fltrace>\def\@outputdblcol{%
4709 %<latexrelease|fltrace> \if@firstcolumn
4710 %<latexrelease|fltrace> \global \@firstcolumnfalse
4711 %<latexrelease|fltrace> \global \setbox\@leftcolumn \box\@outputbox
4713 %<latexrelease|fltrace> \fl@trace{PAGE: first column boxed}%
4715 %<latexrelease|fltrace> \else
4716 %<latexrelease|fltrace> \global \@firstcolumntrue
4717 %<latexrelease|fltrace> \setbox\@outputbox \vbox {%
4718 %<latexrelease|fltrace> \hb@xt@\textwidth {%
4719 %<latexrelease|fltrace> \hb@xt@\columnwidth {%
4720 %<latexrelease|fltrace> \box\@leftcolumn \hss}%
4721 %<latexrelease|fltrace> \hfil
4722 %<latexrelease|fltrace> {\normalcolor\vrule
4723 %<latexrelease|fltrace> \@width\columnseprule}%
4724 %<latexrelease|fltrace> \hfil
4725 %<latexrelease|fltrace> \hb@xt@\columnwidth {%
4726 %<latexrelease|fltrace> \box\@outputbox \hss}%
4727 %<latexrelease|fltrace> }%
4728 %<latexrelease|fltrace> }%
4730 %<latexrelease|fltrace> \fl@trace{PAGE: second column also boxed}%
4732 %<latexrelease|fltrace> \@combinedblfloats
4733 %<latexrelease|fltrace> \@outputpage
4735 %<latexrelease|fltrace> \fl@trace{PAGE: two column page completed}%
4737 %<latexrelease|fltrace> \begingroup
4738 %<latexrelease|fltrace> \@dblfloatplacement
4739 %<latexrelease|fltrace> \@startdblcolumn
4741 % This loop could be replaced by an |\expandafter| tail
4742 % recursion in\\ |\@startdblcolumn|.
4744 %<latexrelease|fltrace> \@whilesw\if@fcolmade \fi
4745 %<latexrelease|fltrace> {\@outputpage
4747 %<latexrelease|fltrace> \fl@trace{PAGE: double float page completed}%
4749 %<latexrelease|fltrace> \@startdblcolumn}%
4750 %<latexrelease|fltrace> \endgroup
4751 %<latexrelease|fltrace> \fi
4752 %<latexrelease|fltrace>}%
4753 %<latexrelease|fltrace>\EndIncludeInRelease
4754 %</2ekernel|fltrace|latexrelease>
4757 % \subsubsection{Float placement parameters}
4758 % \changes{v1.0i}{1993/12/14}{Section added to declare all parameters}
4760 % The main purpose of this section is to ensure that all the
4761 % float-placement parameters which need to be set in a class file or
4762 % package have been declared. It also describes their use and sets
4763 % values for them which are reasonable for typical documents using
4764 % US letter or A4 sized paper.
4766 % \paragraph{Limits for the placement of floating objects}
4768 % \begin{macro}{\c@topnumber}
4769 % This counter holds the maximum number of
4770 % floats that can appear at the top of a text page or column.
4773 \newcount\c@topnumber
4774 \setcounter{topnumber}{2}
4778 % \begin{macro}{\topfraction}
4779 % This macro holds the maximum proportion (as a decimal number) of
4780 % a text page or column that can be occupied by floats at the top.
4782 \newcommand\topfraction{.7}
4786 % \begin{macro}{\c@bottomnumber}
4787 % This counter holds the maximum number of
4788 % floats that can appear at the bottom of a text page or column.
4790 \newcount\c@bottomnumber
4791 \setcounter{bottomnumber}{1}
4795 % \begin{macro}{\bottomfraction}
4796 % This macro holds the maximum proportion (as a decimal number) of
4797 % a text page or column that can be occupied by floats at the bottom.
4799 \newcommand\bottomfraction{.3}
4803 % \begin{macro}{\c@totalnumber}
4804 % This counter holds the maximum number of floats that can appear on
4805 % any text page or column.
4807 \newcount\c@totalnumber
4808 \setcounter{totalnumber}{3}
4812 % \begin{macro}{\textfraction}
4813 % This macro holds the minimum proportion (as a decimal number) of
4814 % a text page or column that must be occupied by text.
4816 \newcommand\textfraction{.2}
4820 % \begin{macro}{\floatpagefraction}
4821 % This macro holds the minimum proportion (as a decimal number) of
4822 % a page or column that must be occupied by floating objects before a
4823 % `float page' is produced.
4825 \newcommand\floatpagefraction{.5}
4829 % \begin{macro}{\c@dbltopnumber}
4830 % This counter holds the maximum number of double-column floats that
4831 % can appear on the top of a two-column text page.
4833 \newcount\c@dbltopnumber
4834 \setcounter{dbltopnumber}{2}
4838 % \begin{macro}{\dbltopfraction}
4839 % This macro holds the maximum proportion (as a decimal number) of
4840 % a two-column text page that can be occupied by double-column floats
4843 \newcommand\dbltopfraction{.7}
4847 % \begin{macro}{\dblfloatpagefraction}
4848 % This macro holds the minimum proportion (as a decimal number) of
4849 % a page that must be occupied by double-column floating objects
4850 % before a `double-column float page' is produced.
4852 \newcommand\dblfloatpagefraction{.5}
4856 % \paragraph{Floats on a text page}
4858 % \begin{macro}{\floatsep}
4859 % \begin{macro}{\textfloatsep}
4860 % \begin{macro}{\intextsep}
4861 % When a floating object is placed on a page with text, these
4862 % parameters control the separation between the float and the other
4863 % objects on the page. These parameters are used for both
4864 % one-column mode and single-column floats in two-column mode.
4865 % They are all rubber lengths.
4867 % |\floatsep| is the space between adjacent floats that are placed
4868 % at the top or bottom of the text page or column.
4870 % |\textfloatsep| is the space between the main text and floats
4871 % at the top or bottom of the page or column.
4873 % |\intextsep| is the space between in-text floats and the text.
4876 \newskip\textfloatsep
4878 \setlength\floatsep {12\p@ \@plus 2\p@ \@minus 2\p@}
4879 \setlength\textfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@}
4880 \setlength\intextsep {12\p@ \@plus 2\p@ \@minus 2\p@}
4886 % \begin{macro}{\dblfloatsep}
4887 % \begin{macro}{\dbltextfloatsep}
4888 % When double-column floats (floating objects that span the whole
4889 % |\textwidth|) are placed at the top of a text page in two-column
4890 % mode, the separation between the float and the text is controlled
4891 % by |\dblfloatsep| and |\dbltextfloatsep|. They are rubber lengths.
4893 % |\dblfloatsep| is the space between adjacent double-column floats
4894 % placed at the top of the text page.
4896 % |\dbltextfloatsep| is the space between the main text and
4897 % double-column floats at the top of the page.
4899 \newskip\dblfloatsep
4900 \newskip\dbltextfloatsep
4901 \setlength\dblfloatsep {12\p@ \@plus 2\p@ \@minus 2\p@}
4902 \setlength\dbltextfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@}
4907 % \paragraph{Floats on their own page or column}
4909 % \begin{macro}{\@fptop}
4910 % \begin{macro}{\@fpsep}
4911 % \begin{macro}{\@fpbot}
4912 % When floating objects are placed on a separate page or column,
4913 % called a `float page', the layout of the page is controlled by
4914 % these parameters, which are rubber lengths.
4916 % At the top of the page |\@fptop| is inserted;
4917 % typically this supplies some stretchable whitespace.
4918 % At the bottom of the page |\@fpbot| ais inserted.
4919 % Between adjacent floats |\@fpsep| is inserted.
4921 % These parameters are used for all floating objects on a
4922 % `float page' in one-column mode, and for single-column
4923 % floats in two-column mode.
4925 % Note that at least one of the two parameters |\@fptop| and
4926 % |\@fpbot| should contain a |plus ...fil| so as to fill the
4927 % remaining empty space.
4932 \setlength\@fptop{0\p@ \@plus 1fil}
4933 \setlength\@fpsep{8\p@ \@plus 2fil}
4934 \setlength\@fpbot{0\p@ \@plus 1fil}
4940 % \begin{macro}{\@dblfptop}
4941 % \begin{macro}{\@dblfpsep}
4942 % \begin{macro}{\@dblfpbot}
4943 % Double-column `float pages' in two-column mode use similar
4949 \setlength\@dblfptop{0\p@ \@plus 1fil}
4950 \setlength\@dblfpsep{8\p@ \@plus 2fil}
4951 \setlength\@dblfpbot{0\p@ \@plus 1fil}
4957 % \begin{macro}{\topfigrule}
4958 % \begin{macro}{\botfigrule}
4959 % \begin{macro}{\dblfigrule}
4960 % The macros can be used to put in rules between floats and text;
4961 % whatever they insert should be vertical mode material which takes
4963 % \task{CAR}{Add more rules (for Frank in addtocurcol)}
4965 \let\topfigrule=\relax
4966 \let\botfigrule=\relax
4967 \let\dblfigrule=\relax