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> [2015/09/05 v1.3a
34 %<flafter> Standard LaTeX floats after reference (FMi)]
35 %<fltrace> Tracing LaTeX floats algorithm (FMi)]
39 \ProvidesFile{ltoutput.dtx}
40 [2015/09/05 v1.3a LaTeX Kernel (Output Routine)]
42 \documentclass{ltxdoc}
43 \GetFileInfo{ltoutput.dtx}
46 \author{Leslie Lamport, Frank Mittelbach, Chris Rowley}
48 \MaintainedByLaTeXTeam{latex}
60 % Copyright (C) 1992 by Leslie Lamport
61 % Copyright (C) 1994-2000 by Leslie Lamport, LaTeX3 project
63 % LaTeX 2e kernel file for the output routine.
65 % Part of this file is the latest (not greatest, it still
66 % deserves its name) version of kludge.sty.
68 % It also contains a few enhancements and many changes (corrections
69 % and tidyings) to the float mechanism and other parts of the output
72 % The tracing in the file at present is mainly to help in testing the
73 % code but it may well be developed into a full float tracing
76 % ============================
79 % \changes{v1.1p}{1995/08/25}{Support autoloading feature (FMi).}
80 % \task{CAR}{Update documentation.}
81 % \changes{v1.0k}{1994/02/08}{Documentation and tasks tidied.}
82 % \changes{v1.0l}{1994/03/15}{Driver added and further tidying.}
83 % \changes{v1.0l}{1994/03/15}{Some boxmaxdepth settings removed.}
84 % \changes{v1.0l}{1994/03/15}{Added some warnings when page gets full of
86 % \changes{v1.0l}{1994/03/15}{Removed duplicated code and corrected
88 % \changes{v1.0m}{1994/04/24}{Removed some long lines and other
90 % \changes{v1.0m}{1994/04/24}{Corrected unverbed commands in
92 % \changes{v1.0m}{1994/04/24}{Changed \cs{@normalsize} to
94 % \changes{v1.0m}{1994/04/24}{Warning messages changed/corrected.}
95 % \changes{v1.0n}{1994/04/30}{Added \cs{col@number}.}
96 % \changes{v1.0n}{1994/04/30}{Fixed bug from \cs{dblfigrule} with
98 % \changes{v1.0n}{1994/04/30}{Documentation tidied.}
99 % \changes{v1.0n}{1994/04/30}{\cs{@activechar@warning} changed to an
101 % \changes{v1.0n}{1994/04/30}{Full of floats action improved.}
102 % \changes{v1.0n}{1994/04/30}{Empty column action added.}
103 % \changes{v1.0o}{1994/05/02}{Code of \cs{@resethfps} shortened.}
104 % \changes{v1.0p}{1994/05/12}{\cs{normalcolor}added in various
106 % \changes{v1.0q}{1994/05/16}{Changed setting of accents (FMi).}
107 % \changes{v1.0s}{1994/05/20}{Added setting of \cs{protect}
108 % during \cs{shipout}.}
109 % \changes{v1.0t}{1994/05/22}{Changed warnings and infos to
111 % \changes{v1.0u}{1994/05/23}{Added \cs{MessageBreak}.}
112 % \changes{v1.0u}{1994/05/23}{Changed resetting of \cs{protect} after
114 % \changes{v1.0v}{1994/05/25}{Extra documentation.}
115 % \changes{v1.0w}{1994/06/01}{Tidied up typesetting.}
117 % \changes{v1.1f}{1994/11/14}{Removed old definition of \cs{@testfp}.}
118 % \changes{v1.1h}{1994/11/17}
119 % {\cs{@tempa} to \cs{reserved@a}.}
120 % \changes{v1.1m}{1995/05/07}{Use \cs{hb@xt@}.}
121 % \changes{v1.2n}{2015/02/21}
122 % {Removed autoload code}
129 % \section{Output Routine}
131 % \subsection{Floats}
133 % The `2ekernel' code ensures that a |\usepackage{autoout1}| is
134 % essentially ignored if a `full' format is being used that has
135 % the autoload file mode already in the format.
139 %<defx>\nfss@catcodes
140 %<2ekernel>\expandafter\let\csname ver@autoout1.sty\endcsname\fmtversion
144 % \begin{oldcomments}
149 % ****************************************
151 % ****************************************
154 % PAGE LAYOUT PARAMETERS
156 % \topmargin : Extra space added to top of page.
157 % @twoside : boolean. T if two-sided printing
158 % \oddsidemargin : IF @twoside = T
159 % THEN extra space added to left of odd-numbered
161 % ELSE extra space added to left of all pages.
162 % \evensidemargin : IF @twoside = T
163 % THEN extra space added to left of even-numbered
165 % \headheight : height of head
166 % \headsep : separation between head and text
167 % \footskip : distance separation between baseline of last
168 % line of text and baseline of foot.
169 % Note difference between \footSKIP and \headSEP.
170 % \textheight : height of text on page, excluding head and foot
171 % \textwidth : width of printing on page
172 % \columnsep : IF @twocolumn = T
173 % THEN width of space between columns
174 % \columnseprule : IF @twocolumn = T
175 % THEN width of rule between columns (0 if none).
176 % \columnwidth : IF @twocolumn = T
177 % THEN (\textwidth - \columnsep)/2
179 % It is set by the \twocolumn and
180 % \onecolumn commands.
181 % \@textbottom : Command executed at bottom of vbox holding text of
182 % page (including figures). The \raggedbottom
183 % command almost \let's this to \vfil (actually sets
184 % it to \vskip \z@ plus.0001fil).
185 % Should have depth 0pt.
187 % \@texttop : Command executed at top of vbox holding text of
188 % page (including figures). Used by letter style;
189 % can also be used to produce centered pages.
190 % Let to \relax by \raggedbottom and \flushbottom.
192 % Page layout must initialize \@colht and \@colroom to \textheight.
194 % PAGE STYLE PARAMETERS:
196 % \floatsep : Space left between floats.
197 % \textfloatsep : Space between last top float or first bottom float
199 % \topfigrule : Command to place rule (or whatever) between floats
200 % at top of page and text. Executed in inner
201 % vertical mode right before the \textfloatsep skip
202 % separating the floats from the text. Must occupy
203 % zero vertical space. (See \footnoterule.)
204 % \botfigrule : Same as \topfigrule, but put after the
205 % \textfloatsep skip separating text from the
206 % floats at bottom of page.
207 % \intextsep : Space left on top and bottom of an in-text float.
208 % \dblfloatsep : Space between double-column floats.
209 % \dbltextfloatsep : Space between top double-column floats
211 % \dblfigrule : Similar to \topfigrule, but for double-column
213 % \@fptop : Glue to go at top of float column -- must be 0pt +
215 % \@fpsep : Glue to go between floats in a float column.
216 % \@fpbot : Glue to go at bottom of float column
219 % \@dblfptop, \@dblfpsep, \@dblfpbot
220 % : Analogous for double-column float page in
223 % FOOTNOTES: As in PLAIN, footnotes use \insert\footins.
225 % PAGE LAYOUT SWITCHES AND MACROS
227 % @twocolumn : Boolean. T if two columns per page globally.
229 % PAGE STYLE MACROS AND SWITCHES
231 % \@oddhead : IF @twoside = T
232 % THEN macro to generate head of odd-numbered
234 % ELSE macro to generate head of all pages.
235 % \@evenhead : IF @twoside = T
236 % THEN macro to generate head of even-numbered
238 % \@oddfoot : IF @twoside = T
239 % THEN macro to generate foot of odd-numbered
241 % ELSE macro to generate foot of all pages.
242 % \@evenfoot : IF @twoside = T
243 % THEN macro to generate foot of even-numbered
245 % @specialpage : boolean. T if current page is to have a special
247 % \@specialstyle : If its value is foo then
248 % IF @specialpage = T
249 % THEN the command \ps@foo is executed to
250 % temporarily reset the page style parameters
251 % before composing the current page.
252 % This command should execute only \def's and
253 % \edef's, making only local definitions.
255 % FLOAT PLACEMENT PARAMETERS
257 % The following parameters are set by the macro \@floatplacement.
258 % When \@floatplacement is called,
259 % \@colht is the height of the page or column being built. I.e.:
260 % * For single-column page it equals \textheight.
261 % * For double-column page it equals \textheight - height
262 % of double-column floats on page.
263 % Note that some are set globally and some locally:
264 % \@topnum :=G Maximum number of floats allowed on the top of a
266 % \@toproom :=G Maximum amount of top of column devoted to floats--
267 % excluding \textfloatsep separation below the floats
268 % and \floatsep separation between them. For
269 % two-column output, should be computed as a function
271 % \@botnum, \@botroom
272 % : Analogous to above.
273 % \@colnum :=G Maximum number of floats allowed in a column,
274 % including in-text floats.
275 % \@textmin :=L Minimum amount of text (excluding footnotes) that
276 % must appear on a text page.
277 % %% 27 Sep 85 : made local to
278 % %% \@addtocurcol and \@addtonextcol
279 % It is now also used locally in processing double
281 % \@fpmin :=L Minimum height of floats in a float column.
283 % The macro \@dblfloatplacement sets the following parameters.
284 % \@dbltopnum :=G Maximum number of double-column floats allowed at
285 % the top of a two-column page.
286 % \@dbltoproom :=G Maximum height of double-column floats allowed at
287 % top of two-column page.
288 % \@fpmin :=L Minimum height of floats in a float column.
289 % It should also perform the following local assignments where necessary
290 % -- i.e., where the new value differs from the old one:
291 % \@fptop :=L \@dblfptop
292 % \@fpsep :=L \@dblfpsep
293 % \@fpbot :=L \@dblfpbot
295 % OUTPUT ROUTINE VARIABLES
297 % \@colht : The total height of the current column. In single column
298 % style, it equals \textheight. In two-column style, it is
299 % \textheight minus the height of the double-column floats
300 % on the current page. MUST BE INITIALIZED TO \textheight.
302 % \@colroom : The height available in the current column for text and
303 % footnotes. It equals \@colht minus the height of all
304 % floats committed to the top and bottom of the current
307 % \@textfloatsheight : The total height of in-text floats on the
310 % \footins : Footnote insertion number.
312 % \@maxdepth : Saved value of TeX's \maxdepth. Must be set
313 % when any routine sets \maxdepth.
315 % CALLING THE OUTPUT ROUTINE
316 % --------------------------
318 % The output routine is called either by TeX's normal page-breaking
319 % mechanism, or by a macro putting a penalty < or = -10000 in the output
320 % list. In the latter case, the penalty indicates why the output
321 % routine was called, using the following code.
327 % -10001 \clearpage (\penalty -10000 \vbox{} \penalty -10001)
328 % -10002 float insertion, called from horizontal mode
329 % -10003 float insertion, called from vertical mode.
330 % -10004 float insertion.
332 % Note: A float or marginpar puts the following sequence in the output
333 % list: (i) a penalty of -10004,
335 % (iii) a penalty of -10002 or -10003.
336 % This solves two special problems:
337 % 1. If the float comes right after a \newpage or \clearpage,
338 % then the first penalty is ignored, but the second one
339 % invokes the output routine.
340 % 2. If there is a split footnote on the page, the second 'page'
341 % puts out the rest of the footnote.
346 % FUNCTIONS USED IN THE OUTPUT ROUTINE:
348 % \@outputpage : Produces an output page with the contents of box
349 % \@outputbox as the text part.
350 % Also sets \@colht :=G \textheight.
351 % The page style is determined as follows.
352 % IF @thispagestyle = true
353 % THEN use \thispagestyle style
354 % ELSE use ordinary page style.
356 % \@tryfcolumn\FLIST : Tries to form a float column composed of floats
357 % from \FLIST (if nonempty) with the following parameters:
358 % \@colht : height of box
359 % \@fpmin : minimum height of floats in the box
360 % \@fpsep : interfloat space
361 % \@fptop : glue at top of box
362 % \@fpbot : glue at bottom of box.
363 % If it succeeds, then it does the following:
364 % * \@outputbox :=L the composed float box.
365 % * @fcolmade :=G true
366 % * \FLIST :=G \FLIST - floats put in box
367 % * \@freelist :=G \@freelist + floats put in box
369 % * @fcolmade :=G false
370 % NOTE: BIT MUST BE A SINGLE TOKEN!
372 % \@makefcolumn \FLIST : Same as \@tryfcolumn except that it
373 % fails to make a float column only if \FLIST is empty.
374 % Otherwise, it makes a float column containing at least
375 % the first box in \FLIST, disregarding \@fpmin.
378 % Calls \@tryfcolumn\@deferlist. If \@tryfcolumn returns with
379 % (globally set) @fcolmade = false, then:
380 % * Globally sets \@toplist and \@botlist to floats
381 % from \@deferlist to go at top and bottom of column,
382 % deleting them from \@deferlist. It does
383 % this using \@colht as the total height, the page
384 % style parameters \@floatsep and \@textfloatsep, and
385 % the float placement parameters \@topnum, \@toproom,
386 % \@botnum, \@botroom, \@colnum and \textfraction.
387 % * Globally sets \@colroom to \@colht minus the height
388 % of the added floats.
391 % Calls \@tryfcolumn\@dbldeferlist{8}. If \@tryfcolumn returns
392 % with (globally set) @fcolmade = false, then:
393 % * Globally sets \@dbltoplist to floats from
394 % \@dbldeferlist to go at top and bottom of column,
395 % deleting them from \@dbldeferlist.
396 % It does this using \textheight as the
397 % total height, and the parameters \@dblfloatsep, etc.
398 % * Globally sets \@colht to \textheight minus the height
399 % of the added floats.
401 % \@combinefloats : Combines the text from box
402 % \@outputbox with the floats from \@toplist and \@botlist,
403 % putting the new box in \@outputbox. It uses \floatsep
404 % and \textfloatsep for the appropriate separations.
405 % It puts the elements of \TOPLIST and \BOTLIST onto
406 % \@freelist, and makes those lists null.
408 % \@makecol : Makes the contents of \box255 plus the accumulated
409 % footnotes, plus the floats in \@toplist and \@botlist,
410 % into a single column of height \@colht (unless the page
411 % height has been locally changed), which it puts
412 % into box \@outputbox. It puts boxes in \@midlist back
413 % onto \@freelist and restores \maxdepth.
415 % \@opcol : Outputs a column whose text is in box \@outputbox
416 % If @twocolumn = false, then it calls \@outputpage,
417 % sets \@colht :=G \textheight, and calls \@floatplacement.
419 % If @twocolumn = true, then:
420 % If @firstcolumn = true, then it puts box \@outputbox
421 % into \@leftcolumn and sets @firstcolumn :=G false.
423 % If @firstcolumn = false, then it puts out the current
424 % two-column page, any possible two-column float pages,
425 % and determines \@dbltoplist for the next page.
429 % USER COMMANDS THAT CALL OR AFFECT THE OUTPUT ROUTINE
430 % ----------------------------------------------------
432 % \newpage == BEGIN \par\vfil\penalty -10000 END
434 % \clearpage == BEGIN \newpage
435 % \write -1{} % Part of hack to make sure no
436 % \vbox{} % \write's get lost.
440 % \cleardoublepage == BEGIN \clearpage
441 % if @twoside = true and c@page is even
442 % then \hbox{} \newpage fi
446 % \twocolumn[BOX] : starts a new page, changing to twocolumn setting
447 % and puts BOX in a parbox of width \textwidth across the top.
448 % Useful for full-width titles for double-column pages.
449 % SURPRISE: The stretch from \@dbltextfloatsep will be inserted
450 % between the BOX and the top of the two columns.
453 % FLOAT-HANDLING MECHANISMS
454 % -------------------------
456 % The float environment obtains an insertion number B from the
457 % \@freelist (see below for a description of list manipulation), puts
458 % the float into box B and sets \count B to a FLOAT SPECIFIER. For
459 % a normal (not double-column) float, it then causes a page break
460 % in one of the following two ways:
461 % - In outer hmode: \vadjust{\penalty -10002}
462 % - In vmode : \penalty -10003.
463 % For a double-column float, it puts B onto the \@dbldeferlist.
464 % The float specifier has two components:
465 % * A PLACEMENT SPECIFICATION, describing where the float may
467 % * A TYPE, which is a power of two--e.g., figures might be
468 % type 1 floats, tables type 2 floats, programs type 4 floats, etc.
469 % The float specifier is encoded as follows, where bit 0 is the least
474 % 0 1 iff the float may go where it appears in the text.
475 % 1 1 iff the float may go on the top of a page.
476 % 2 1 iff the float may go on the bottom of a page.
477 % 3 1 iff the float may go on a float page.
478 % 4 1 unless the PLACEMENT includes a !
479 % 5 1 iff a type 1 float
480 % 6 1 iff a type 2 float
483 % A negative float specifier is used to indicate a marginal note.
485 % MACROS AND DATA STRUCTURES FOR PROCESSING FLOATS
486 % ------------------------------------------------
488 % A FLOAT LIST consisting of the floats in boxes \boxa ... \boxN has
490 % \@elt \boxa ... \@elt \boxN
491 % where \boxI is defined by
493 % Normally, \@elt is \let to \relax. A test can be performed on the
494 % entire float list by locally \def'ing \@elt appropriately and
495 % executing the list.
496 % This is a lot more efficient than looping through the list.
498 % The following macros are used for manipulating float lists.
500 % \@next \CS \LIST {NONEMPTY}{EMPTY} == %% NOTE: ASSUME \@elt = \relax
501 % BEGIN assume that \LIST == \@elt \B1 ... \@elt \Bn
505 % \LIST :=G \@elt \B2 ... \@elt \Bn
511 % \@bitor\NUM\LIST : Globally sets switch @test to the disjunction for
512 % all I of bit log2 \NUM of the float specifiers of all the
514 % I.e., @test is set to true iff there is at least one
515 % float in \LIST having bit log2 \NUM of its float specifier
518 % Note: log2 [(\count I)/32] is the bit number corresponding to the
519 % type of float I. To see if there is any float in \LIST having
520 % the same type as float I, you run \@bitor with
521 % \NUM = [(\count I)/32] * 32.
523 % \@bitor\NUM\LIST ==
526 % { \@elt \CTR == if \NUM <> 0 then
527 % if \count\CTR / \NUM is odd
528 % then @test := true fi fi
534 % \@cons\LIST\NUM : Globally sets \LIST := \LIST * \@elt \NUM
537 % BEGIN { \@elt == \relax
538 % \LIST :=G \LIST \@elt \NUM
541 % BOX LISTS FOR FLOAT-PLACEMENT ALGORITHMS
543 % \@freelist : List of empty boxes for placing new floats.
544 % \@toplist : List of floats to go at top of current column.
545 % \@midlist : List of floats in middle of current column.
546 % \@botlist : List of floats to go at bottom of current column.
547 % \@deferlist : List of floats to go after current column.
548 % \@dbltoplist : List of double-col. floats to go at top of current
550 % \@dbldeferlist : List of double-column floats to go on subsequent
553 % FLOAT-PLACEMENT ALGORITHMS
556 % \@addtobot : Tries to put insert \@currbox on \@botlist.
558 % * \ht BOX < \@colroom
559 % * type of \@currbox not on \@deferlist
562 % If it succeeds, then:
563 % * sets @insert true
564 % * decrements \@botroom by \ht BOX
565 % * decrements \@botnum and \@colnum by 1
566 % * decrements \@colroom by \ht BOX + either \floatsep
567 % or \textfloatsep, as appropriate.
568 % * sets \maxdepth to 0pt
570 % \@addtotoporbot : Tries to put insert \@currbox on \@toplist or
572 % Called only under same conditions as \@addtobot.
573 % If it succeeds, then:
574 % * sets @insert true
575 % * decrements \@toproom or \@botroom by \ht BOX
576 % * decrements \@colnum and either \@topnum or
578 % * decrements \@colroom by \ht BOX + \floatsep
579 % or \textfloatsep, as appropriate.
581 % \@addtocurcol : Tries to add \@currbox to current column, setting
582 % @insert true if it succeeds, false otherwise.
583 % It will add \@currbox to top only if bit 0 of
584 % \count \@currbox is 0, and to the bottom only if
585 % bit 0 = 0 or an earlier float of the same type is
587 % If the float is put in the text, then
588 % \penalty\interlinepenalty is put
589 % right after the float, before the following \vskip,
590 % and \outputpenalty :=L 0.
592 % \@addtonextcol : Tries to add \@currbox to the next column, setting
593 % @insert true if it succeeds, false otherwise.
595 % \@addtodblcol : Tries to add \@currbox to the next double-column page,
596 % adding it to \@dbltoplist if it succeeds and
597 % \@dbldeferlist if it fails.
602 % if \@currlist nonempty
603 % then remove \@marbox from \@currlist
604 % add \@marbox and \@currbox to \@freelist
605 % %% NOTE: \@currbox = left box
606 % else LaTeX error: ? %% shouldn't happen
608 % \@tempcnta := 1 %% 1 = right, -1 = left
609 % if @twocolumn = true
610 % then if @firstcolumn = true
611 % then \@tempcnta := -1
613 % else if @mparswitch = true
615 % else \@tempcnta := -1
618 % if @reversemargin = true
619 % then \@tempcnta := -\@tempcnta
622 % if \@tempcnta < 0 then \box\@marbox :=G \box\@currbox
624 % \@tempdima :=L maximum(\@mparbottom - \@pageht
625 % + ht of \@marbox, 0)
626 % if \@tempdima > 0 then LaTeX warning: 'marginpar moved' fi
627 % \@mparbottom :=G \@pageht + \@tempdima + depth of \@marbox
629 % \@tempdima :=L \@tempdima - ht of \@marbox
630 % \box\@marbox :=G \box\@currbox
631 % \vbox { \vskip \@tempdima
634 % height of \@marbox :=G depth of \@marbox :=G 0
637 % \hbox{ if @tempcnta > 0 then \hskip \columnwidth
638 % \hskip \marginparsep
639 % else \hskip -\marginparsep
640 % \hskip -\marginparwidth
646 % \hbox{\vrule height 0 width 0 depth \@pagedp}
649 % 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
779 % \begin{macro}{\AtBeginDvi}
780 % \changes{v1.1c}{1994/11/05}
782 % \begin{macro}{\@begindvibox}
783 % \changes{v1.1c}{1994/11/05}
785 % \changes{v1.1f}{1994/11/14}{Use normal box register: why a box?}
786 % \changes{v1.1l}{1995/04/24}{Add \cs{vbox} latex/1392}
788 % We use a box register in which to put
789 % stuff that must appear before anything else in the
792 % The stuff in the box should not add any typeset material to the
793 % page when it is unboxed.
796 \def \AtBeginDvi #1{%
797 \global \setbox \@begindvibox
798 \vbox{\unvbox \@begindvibox #1}%
804 % \begin{macro}{\@maxdepth}
805 % This is not the right place to set this; it needs to be set in a
806 % class/style file when |\maxdepth| is set.
808 % Also, many settings to |\maxdepth| should be to |\@maxdepth|,
810 % \task{All}{Sort out maxdepth: both should be set in the class files.}
813 \@maxdepth = \maxdepth
816 % \begin{macro}{\paperheight}
817 % \changes{v0.1a}{1993/11/23}{Register added}
818 % \begin{macro}{\paperwidth}
819 % \changes{v0.1a}{1993/11/23}{Register added}
820 % New |\paper|\ldots\ registers.
822 \newdimen\paperheight
828 % \begin{macro}{\if@insert}
829 % \begin{macro}{\if@fcolmade}
830 % \begin{macro}{\if@specialpage}
831 % \begin{macro}{\if@firstcolumn}
832 % \begin{macro}{\if@twocolumn}
833 % \begin{macro}{\if@twoside}
834 % \begin{macro}{\if@reversemarginpar}
835 % \begin{macro}{\if@mparswitch}
836 % \begin{macro}{\col@number}
837 % \changes{v1.0n}{1994/04/30}{Added \cs{col@number}}
838 % Local switches first:
842 % These should definitely be global:
845 \newif \if@specialpage \@specialpagefalse
847 % These should be global but are not always set globally in other
850 \newif \if@firstcolumn \@firstcolumntrue
851 \newif \if@twocolumn \@twocolumnfalse
853 % Not sure about these: two questions.
854 % Should things which must apply to a whole document be local or
855 % global (they probably should be `preamble only' commands)?
856 % Are these three such things?
858 \newif \if@twoside \@twosidefalse
859 \newif \if@reversemargin \@reversemarginfalse
860 \newif \if@mparswitch \@mparswitchfalse
862 % This counter has been imported from `multicol'.
864 \newcount \col@number
877 % \begin{oldcomments}
884 \newdimen\@dbltoproom
894 \newdimen\@mparbottom \@mparbottom\z@
902 \def\@thehead{\@oddhead} % initialization
903 \def\@thefoot{\@oddfoot}
907 % \begin{macro}{\clearpage}
908 % \changes{v1.1r}{1995/10/11}{Added a check so that it does not lose
909 % the argument of \cs{twocolumn[...]}}
911 % The tests at the beginning are an experimental attempt to avoid a
912 % completely empty page after a |\twocolumn[...]|. This prevents the
913 % text from the argument vanishing into a float box, never to be seen
914 % again. We hope that it does not produce wrong formatting in other
916 % \changes{v1.1v}{1996/07/26}{add number of missing percents}
920 \ifnum \@dbltopnum =\m@ne
921 \ifdim \pagetotal <\topskip
934 % \begin{macro}{\cleardoublepage}
937 \def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
938 \hbox{}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi}
943 % \begin{macro}{\onecolumn}
944 % \changes{v1.0n}{1994/04/30}{Added setting of \cs{col@number}}
949 \global\columnwidth\textwidth
950 \global\hsize\columnwidth
951 \global\linewidth\columnwidth
952 \global\@twocolumnfalse
958 % \begin{macro}{\newpage}
959 % \changes{v1.1x}{1996/09/29}{Checks for noskipsec and inlabel added}
960 % \changes{v1.1x}{1996/09/29}{Checks for noskipsec and inlabel added}
961 % \changes{v1.1y}{1996/09/30}{Checks for noskipsec and inlabel removed
962 % pending further tests}
963 % \changes{v1.1z}{1996/10/24}{Better checks for noskipsec and
964 % inlabel added, plus nobreak}
965 % \changes{v1.2a}{1996/10/25}{Reset all flags explicitly}
966 % The two checks at the beginning ensure that an item label or
967 % run-in section title immediately before a |\newpage| get printed
968 % on the correct page, the one before the page break.
970 % All three tests are largely to make error processing more robust;
971 % that is why they all reset the flags explicitly, even when it
972 % would appear that this would be done by a |\leavevmode|.
976 \ifx \@nodocument\relax
978 \global \@noskipsecfalse
983 \global \@inlabelfalse
985 \if@nobreak \@nobreakfalse \everypar{}\fi
992 % \begin{macro}{\@emptycol}
993 % \changes{v1.0n}{1994/04/30}{Empty column action added:
995 % It may be better to use an invisible rule rather than an empty
998 \def \@emptycol {\vbox{}\penalty -\@M}
1002 % \begin{macro}{\twocolumn}
1003 % \begin{macro}{\@topnewpage}
1004 % \changes{v1.0f}{1993/12/05}{Commands changed}
1005 % \changes{v1.0g}{1993/12/06}{\cs{@floatplacement} placement bug
1007 % \changes{v1.0j}{1993/12/17}{check for vsize too small added}
1008 % \changes{v1.2c}{1997/11/09}{Documentation of vsize check enhanced}
1009 % There are several bug fixes to the two-column stuff here.
1011 % \changes{v1.0n}{1994/04/30}{Added setting of \cs{col@number}}
1015 \global\columnwidth\textwidth
1016 \global\advance\columnwidth-\columnsep
1017 \global\divide\columnwidth\tw@
1018 \global\hsize\columnwidth
1019 \global\linewidth\columnwidth
1020 \global\@twocolumntrue
1021 \global\@firstcolumntrue
1024 % There is no reason to put a |\@dblfloatplacement| here since
1025 % |\@topnewpage| ignores these settings.
1026 % The |\@floatplacement| is needed in case this comes after some
1028 % \changes{v1.0h}{1993/12/12}{braces removed}
1030 \@ifnextchar [\@topnewpage\@floatplacement
1034 % Note that here, getting a box from the freelist can assume
1035 % success since this comes just after a |\clearpage|.
1036 % \changes{v1.0n}{1994/04/30}{Added setting of \cs{col@number}}
1037 % \changes{v1.1a}{1994/10/31}
1038 % {(DPC/CAR) Use \cs{color@begingroup} for colour}
1039 % \changes{v1.1a}{1994/10/31}
1040 % {(DPC/CAR) Use \cs{normalcolor}}
1041 % \changes{v1.1a}{1994/10/31}
1042 % {(DPC/CAR) Extra box added to remove colour resetting from vmode}
1043 % \changes{v1.1b}{1994/11/05}
1044 % {Use new \cs{color@hbox} concept.}
1045 % \changes{v1.1i}{1994/11/21}{Changed to \cs{color@vbox}}
1046 % \changes{v1.1z}{1996/10/24}{Added \cs{@nodocument} to trap
1047 % \cs{twocolumn} in the preamble}
1049 \long\def \@topnewpage [#1]{%
1051 \@next\@currbox\@freelist{}{}%
1052 \global \setbox\@currbox
1060 \vskip -\dbltextfloatsep
1064 % Added size test and warning message; perhaps we should use
1066 % \changes{v1.0l}{1994/03/15}{Corrected and amended warning message}
1067 % \changes{v1.0m}{1994/04/24}{Warning message removed as it will be
1070 \ifdim \ht\@currbox>\textheight
1071 \ht\@currbox \textheight
1074 % This next line is not essential but it is more robust to make this
1075 % value non-zero, in case of weird errors.
1077 % This next bit is what is needed from |\@addtodblcol|, plus some
1078 % extra checks for error trapping.
1080 \global \count\@currbox \tw@
1081 \@tempdima -\ht\@currbox
1082 \advance \@tempdima -\dbltextfloatsep
1083 \global \advance \@colht \@tempdima
1084 \ifx \@dbltoplist \@empty
1086 \@latexerr{Float(s) lost}\@ehb
1087 \let \@dbltoplist \@empty
1089 \@cons \@dbltoplist \@currbox
1091 % This setting of |\@dbltopnum| is used only to change the
1092 % typesetting in\\ |\@combinedblfloats|.
1094 \global \@dbltopnum \m@ne
1096 \fl@trace{dbltopnum set to -1 (= \the \@dbltopnum) (topnewpage)}%
1099 % At points such as this we need to check that there is still a
1100 % minimal amount of room left on the page; this uses an arbitrary
1101 % small value at present; but note that this value is larger than
1102 % that used when checking that page is too full of normal floats.
1104 % If there is little room left we just force a page-break, OK?
1105 % This involves producing two empty columns. The second empty
1106 % column may be produced by |\output|, in which case an extra,
1107 % misleading, warning will be generated, OK? (This happens only
1108 % when there is too little room left on the page for any float.)
1109 % Otherwise (\ie if the size is such that it is allowed as a normal
1110 % float) the extra |\@emptycol| will be invoked in the second
1111 % column by the conditional code guarded by the |\if@firstcolumn|
1114 % I now think that the cut-off point here should be |3\baselineskip|,
1115 % but we make it a bit less so that 3 lines of text will be
1118 % Since this happens only when there is nothing on the page but the
1119 % `top-box', the empty box should not cause any problem other than
1120 % some overfull box messages, which is not entirely misleading.
1122 % Here we need two page-ends since both columns need to be empty.
1123 % \task{???}{Make it less arbitrary?}
1124 % \changes{v1.0j}{1993/12/17}{Page room test added}
1125 % \changes{v1.0l}{1994/03/15}{Warning added: it should be improved}
1126 % \changes{v1.0m}{1994/04/24}{Message changed to give more info}
1127 % \changes{v1.0n}{1994/04/30}{Message changed for Frank}
1128 % \changes{v1.0n}{1994/04/30}{Empty column action added:
1130 % \changes{v1.0n}{1994/04/30}{Cut-off point changed to
1131 % 3\cs{baselineskip}}
1132 % \changes{v1.1t}{1996/05/24}{Cut-off point changed to
1133 % 2.5\cs{baselineskip}}
1135 \ifdim \@colht<2.5\baselineskip
1136 \@latex@warning@no@line {Optional argument of \noexpand\twocolumn
1137 too tall on page \thepage}%
1144 \global \vsize \@colht
1145 \global \@colroom \@colht
1154 % \begin{macro}{\output}
1155 % \changes{v1.0f}{1993/12/05}{Command changed}
1156 % \begin{macro}{\@specialoutput}
1157 % \changes{v0.1c}{1993/11/23}{Command changed}
1158 % \changes{v1.0f}{1993/12/06}{Unboxing of 255 added to rescue writes}
1159 % This needs some small adjustments. We cannot
1160 % guarantee that the float mechanism will interact correctly with
1161 % this stuff, but that mechanism does not always work properly
1162 % with footnotes already.
1166 % added reset of |\par| to the output routine.
1167 % This avoids problems when the output routine is
1168 % called within a list where |\par| may be a no-op.
1173 \ifnum \outputpenalty<-\@M
1179 % Moved to |\@opcol|: |\@floatplacement|.
1183 % This loop could be replaced by an |\expandafter| tail
1184 % recursion in |\@startcolumn|.
1186 \@whilesw \if@fcolmade \fi
1189 \fl@trace{PAGE: float \if@twocolumn column \else page \fi
1192 \@opcol\@startcolumn}%
1194 \ifnum \outputpenalty>-\@Miv
1196 % At points such as this we need to check that there is still a
1197 % minimal amount of room left on the page; this uses an arbitrary
1198 % small value at present. If there is little room left we just
1199 % force a page-break, OK?
1201 % This bit is essential only if a float has just been processed so
1202 % maybe it should be moved; but this is the natural place at which
1203 % to set the vsize and a test would need to be done anyway. A
1204 % check has been added to ensure that there really has been a
1205 % change in the value of |\@colroom|.
1207 % Since this happens only when there is nothing on the page but
1208 % floats, the empty box should not cause any problem other than
1209 % some overfull box messages, which is not entirely misleading.
1211 % The twocolumn case does not need any extra code here since this
1212 % is the |\output| itself; in the second column there will still
1213 % not be enough room left so |\@emptycol| will be executed again
1214 % when the OR is called by the-page builder when it gets to the
1215 % penalty inserted by the first execution. (The page-builder is
1216 % never invoked whilst the OR is being executed since it builds a
1217 % inner vlist; thus any conditional code for the two-column case
1218 % within |\output| may not get executed with the correct value of
1219 % |\if@firstcolumn|.
1221 % \task{???}{Make it less arbitrary?}
1222 % \changes{v1.0j}{1993/12/17}{Page room test added}
1223 % \changes{v1.0m}{1994/04/24}{Message changed to give more info and
1225 % \changes{v1.0n}{1994/04/30}{Extra empty column added for
1226 % twocolumn case (wrong, see below)}
1227 % \changes{v1.0n}{1994/04/30}{Extra empty column added for
1229 % \changes{v1.0n}{1994/04/30}{Empty column action added:
1231 % \changes{v1.0n}{1994/04/30}{Cut-off point changed to
1232 % 2\cs{baselineskip}}
1233 % \changes{v1.1t}{1996/05/24}{Cut-off point changed to
1234 % 1.5\cs{baselineskip}}
1235 % \changes{v1.1t}{1996/05/24}{Check that \cs{@colroom} is less
1236 % than \cs{vsize}, indicating that a float has been added}
1237 % \changes{v1.1u}{1996/05/25}{Correct the above check}
1238 % \changes{v1.2c}{1997/11/09}{Remove incorrect code: only one
1239 % \cs{@emptycol} is needed here}
1241 \ifdim \@colroom<1.5\baselineskip
1242 \ifdim \@colroom<\textheight
1243 \@latex@warning@no@line {Text page \thepage\space
1244 contains only floats}%
1253 \global \vsize \@colroom
1256 \global \vsize \@colroom
1259 \global \vsize \maxdimen
1264 % \begin{oldcomments}
1265 % CHANGES TO \@specialoutput:
1266 % * \penalty\z@ changed to \penalty\interlinepenalty so \samepage
1267 % works properly with figure and table environments.
1268 % (Changed 23 Oct 86)
1270 % * Definition of \@specialoutput changed 26 Feb 88 so \@pageht and
1271 % \@pagedp aren't changed for a marginal note.
1272 % (Change suggested by Chris Rowley.)
1276 \gdef\@specialoutput{%
1277 \ifnum \outputpenalty>-\@Mii
1280 \ifnum \outputpenalty<-\@Miii
1281 \ifnum \outputpenalty<-\@MM \deadcycles \z@ \fi
1282 \global \setbox\@holdpg \vbox {\unvbox\@cclv}%
1285 % Note that |\boxmaxdepth| should not be set here since we wish to
1286 % record the natural depth of the holdpg box.
1288 % This is changed so as to not lose anything, such as writes
1289 % and marks, which may get into box 255 and should be returned to
1290 % the list. This should only happen when the first penalty in the
1291 % mechanism is discarded and therefore |\@holdpg| should always be
1292 % void in this case. This can happen because a penalty is
1293 % discarded whenever there is no box on the list.
1295 % It was just: |\setbox\@tempboxa \box \@cclv|.
1297 % The last box which is removed is the box put there by the
1298 % double-penalty mechanism. The |\unskip| then removes the
1299 % |\topskip| which is put there since the box is the first on the
1301 % \task{CAR/FMi}{Is it more efficient to check whether the holdpg box
1302 % is void and then act accordingly?}
1304 \global \setbox\@holdpg \vbox{%
1308 % We must now remove the box added by the float mechanism and the
1309 % |\topskip| glue therefore added above it by \TeX.
1311 \setbox\@tempboxa \lastbox
1315 % These two are needed as separate dimensions only by
1316 % |\@addmarginpar|; for other purposes we put the whole size into
1317 % |\@pageht| (see below).
1319 \@pagedp \dp\@holdpg
1320 \@pageht \ht\@holdpg
1322 \@next\@currbox\@currlist{%
1323 \ifnum \count\@currbox>\z@
1325 % Putting the whole size into |\@pageht| (see above).
1327 \advance \@pageht \@pagedp
1328 \ifvoid\footins \else
1329 \advance \@pageht \ht\footins
1330 \advance \@pageht \skip\footins
1331 \advance \@pageht \dp\footins
1335 % We want to make the adjustment due to this insert only if the
1336 % non-star form is used. The *-form will probably not work with
1337 % floats, but maybe it still could make some adjustment here even
1340 \ifdim \wd\@kludgeins=\z@
1341 \advance \@pageht \ht\@kludgeins
1343 \fl@trace {Extra size added: \the \ht\@kludgeins}%
1348 % This version puts the inserts back just before the additional
1349 % material; it could be moved earlier, before unboxing the
1350 % page-so-far. Neither is guaranteed not to put things on the wrong
1351 % page. This version is similar to the original version.
1361 % A 2e change: use |\addpenalty| instead of |\penalty| here. Some
1362 % penalty is needed to create a potential break-point immediately
1363 % after the reinserts (or the marginal). Otherwise there can be no
1364 % possibility to break here and this can cause the reinserts or the
1365 % marginal to appear on the next page (which is often incorrect).
1366 % However, if the nobreak flag is true, a |\nobreak| must be
1368 % \changes{v1.1i}{1994/11/21}{Added \cs{if@nobreak} test}
1369 % \changes{v1.1z}{1996/10/24}{Added \cs{nobreak} as appropriate}
1371 \ifnum \outputpenalty<\z@
1375 \addpenalty \interlinepenalty
1381 %</2ekernel|fltrace>
1386 % \begin{macro}{\@testwrongwidth}
1387 % \begin{macro}{\f@depth}
1388 % \changes{v1.2n}{2015/02/21}{macro added(latexrelease)}
1390 % Test if the float box has the wrong width when trying to place it
1391 % into some area. (Actually
1392 % the test is for a conventional depth setting rather than for the
1393 % width of the float. For that reason the box depth was explicitly
1394 % tailored when the float was created).
1396 %<latexrelease>\IncludeInRelease{2015/01/01}%
1397 %<latexrelease> {\@testwrongwidth}{float order in 2-column}%
1398 %<*2ekernel|latexrelease|fltrace>
1402 \def\@testwrongwidth #1{%
1403 \ifdim\dp#1=\f@depth
1406 \ifdim\f@depth=\z@ single \else double \fi
1407 column float -- ok}%
1413 \ifdim\f@depth=\z@ double \else single \fi
1414 column float -- wrong}%
1419 % Normally looking for single column floats, which have zero depth.
1425 %</2ekernel|latexrelease|fltrace>
1426 %<latexrelease>\EndIncludeInRelease
1427 %<latexrelease>\IncludeInRelease{0000/00/00}%
1428 %<latexrelease> {\@testwrongwidth}{float order in 2-column}%
1429 %<latexrelease>\let\@testwrongwidth\@undefined
1430 %<latexrelease>\let\f@depth\@undefined
1431 %<latexrelease>\EndIncludeInRelease
1437 % \begin{macro}{\@doclearpage}
1438 % \task{CAR/FMi}{Investigate better float clearance}
1439 % \task{CAR/FMi}{Put non-boxes back in the `right place', or nowhere?}
1440 % This is a very much an emergency action, just dumping everything:
1441 % footnotes first then floats. A more sophisticated version is
1442 % needed; but even more urgent is a bug-free version (see, for
1443 % example, pr/3528).
1445 % Also, it puts any left-over non-boxes (writes, specials, etc.) back
1446 % after any float pages created: this is a very bad bug since,
1447 % for example, a kludge insert will be in quite the wrong place
1448 % and, worse, be irremovable and uncancelable.
1450 % \changes{v1.2n}{2015/01/14}{float order in 2-column (latexrelease)}
1451 % All the remaining changes are replacing the double column defer list
1452 % or inserting the extra test |\@testwrongwidth|\marg{box} at suitable
1453 % places. That is at places where a box is taken off the deferlist.
1455 %<latexrelease>\IncludeInRelease{2015/01/01}{\@doclearpage}%
1456 %<latexrelease> {float order in 2-column}%
1457 %<*2ekernel|latexrelease>
1458 \def \@doclearpage {%
1461 % \changes{v1.2n}{2015/01/14}{Empty kludgeins box if necessary, pr/3528}
1464 {\setbox \@tempboxa \box \@kludgeins}%
1466 \fl@trace {kludgeins box made void}%
1469 \setbox\@tempboxa\vsplit\@cclv to\z@ \unvbox\@tempboxa
1470 \setbox\@tempboxa\box\@cclv
1471 \xdef\@deferlist{\@toplist\@botlist\@deferlist}%
1472 \global \let \@toplist \@empty
1473 \global \let \@botlist \@empty
1474 \global \@colroom \@colht
1475 \ifx \@currlist\@empty
1477 \@latexerr{Float(s) lost}\@ehb
1478 \global \let \@currlist \@empty
1480 \@makefcolumn\@deferlist
1481 \@whilesw\if@fcolmade \fi{\@opcol\@makefcolumn\@deferlist}%
1487 \xdef\@deferlist{\@dbltoplist\@deferlist}%
1491 \global \let \@dbltoplist \@empty
1492 \global \@colht \textheight
1498 \@makefcolumn\@deferlist
1499 \@whilesw\if@fcolmade \fi{\@outputpage
1500 \@makefcolumn\@deferlist}%
1510 % the next line is needed to avoid losing floats in certain
1511 % circumstances a single call to the original |\doclearpage|
1512 % will now no longer output all floats.
1513 % \changes{v1.2b}{2000/09/24}{FMi: ensure \cs{doclearpage}
1514 % is called again until all floats are output.}
1516 \ifx\@deferlist\@empty \else\clearpage \fi
1518 \setbox\@cclv\vbox{\box\@cclv\vfil}%
1523 %</2ekernel|latexrelease>
1524 %<latexrelease>\EndIncludeInRelease
1525 %<latexrelease>\IncludeInRelease{0000/00/00}{\@doclearpage}%
1526 %<latexrelease> {float order in 2-column}%
1527 %<latexrelease>\def \@doclearpage {%
1528 %<latexrelease> \ifvoid\footins
1530 % \changes{v1.2l}{2004/02/07}{Empty kludgeins box if necessary, pr/3528}
1531 % We empty any left over kludge insert box here; this is a temporary fix.
1532 % It should perhaps be applied to one page of cleared floats, but
1533 % who cares? The whole of this stuff needs completely redoing for
1534 % many such reasons.
1536 %<latexrelease> \ifvbox\@kludgeins
1537 %<latexrelease> {\setbox \@tempboxa \box \@kludgeins}%
1539 %<latexrelease> \fl@trace {kludgeins box made void}%
1542 %<latexrelease> \setbox\@tempboxa\vsplit\@cclv to\z@ \unvbox\@tempboxa
1543 %<latexrelease> \setbox\@tempboxa\box\@cclv
1544 %<latexrelease> \xdef\@deferlist{\@toplist\@botlist\@deferlist}%
1546 % \changes{v1.0h}{1993/12/12}{defs changed to lets}
1548 %<latexrelease> \global \let \@toplist \@empty
1549 %<latexrelease> \global \let \@botlist \@empty
1550 %<latexrelease> \global \@colroom \@colht
1551 %<latexrelease> \ifx \@currlist\@empty
1552 %<latexrelease> \else
1553 %<latexrelease> \@latexerr{Float(s) lost}\@ehb
1555 % \changes{v1.0h}{1993/12/12}{defs changed to lets}
1557 %<latexrelease> \global \let \@currlist \@empty
1559 %<latexrelease> \@makefcolumn\@deferlist
1560 %<latexrelease> \@whilesw\if@fcolmade \fi
1561 %<latexrelease> {\@opcol\@makefcolumn\@deferlist}%
1562 %<latexrelease> \if@twocolumn
1563 %<latexrelease> \if@firstcolumn
1564 %<latexrelease> \xdef\@dbldeferlist{\@dbltoplist\@dbldeferlist}%
1566 % \changes{v1.0h}{1993/12/12}{defs changed to lets}
1568 %<latexrelease> \global \let \@dbltoplist \@empty
1569 %<latexrelease> \global \@colht \textheight
1570 %<latexrelease> \begingroup
1571 %<latexrelease> \@dblfloatplacement
1572 %<latexrelease> \@makefcolumn\@dbldeferlist
1573 %<latexrelease> \@whilesw\if@fcolmade \fi
1574 %<latexrelease> {\@outputpage\@makefcolumn\@dbldeferlist}%
1575 %<latexrelease> \endgroup
1576 %<latexrelease> \else
1577 %<latexrelease> \vbox{}\clearpage
1580 %<latexrelease> \else
1581 %<latexrelease> \setbox\@cclv\vbox{\box\@cclv\vfil}%
1582 %<latexrelease> \@makecol\@opcol
1583 %<latexrelease> \clearpage
1586 %<latexrelease>\EndIncludeInRelease
1590 % \begin{macro}{\@opcol}
1591 % \changes{v1.0f}{1993/12/05}{Command changed}
1592 % \changes{v1.0f}{1993/12/05}{Hook added}
1593 % \changes{v1.0j}{1993/12/17}{Hook removed}
1594 % Several changes in detail here.
1597 %<*2ekernel|fltrace>
1604 \fl@trace{PAGE: one column (float? see above) page completed}%
1607 % Not needed since it comes after |\@outputpage|:
1609 % \global\@colht\textheight
1612 % These do not need to be done every time |\@opcol| is used: they
1613 % should be grouped together since they all need to be done at the
1614 % end of the non-special output routine, or at the end of a clearpage
1617 \global \@mparbottom \z@ \global \@textfloatsheight \z@
1620 %</2ekernel|fltrace>
1625 % \begin{macro}{\@makecol}
1626 % \changes{v0.1c}{1993/11/23}{Command changed}
1627 % \changes{v1.0b}{1993/11/29}{\cs{@makespecialcolbox} added}
1628 % We must rewrite this macro to alllow for variations in page-makeup
1629 % required by changes in page-length.
1631 % This uses a different macro if a special-length column is being
1638 \setbox\@outputbox \box\@cclv
1640 \setbox\@outputbox \vbox {%
1642 % This |\boxmaxdepth| setting is to ensure that deep footnotes
1643 % do not overwrite the footer (on account of the negative skip
1644 % added later): it should use |\@maxdepth| otherwise the change is
1645 % pointless when there are footnotes.
1646 % \task{CAR}{Investigate providing an option to put the footnotes
1647 % below the bottom floats.}
1649 % But see also its use when combining floats.
1650 % \changes{v1.0l}{1994/03/15}{\cs{maxdepth} changed to \cs{@maxdepth}}
1652 \boxmaxdepth \@maxdepth
1655 % \changes{v1.2e}{1999/01/06}{Added negative vskip, as when processing
1656 % outputbox below: suggested by Fred Bartlett pr/2892}
1657 % \changes{1.2i}{2000/07/12}{Removed negative vskip, as it gives
1658 % unacceptable results when the depth is large: pr/3189}
1659 % \changes{v1.2m}{2004/10/20}{Removed dead code}
1660 % \task{CAR}{As can be seen from the above two changes, getting a good
1661 % layout here is difficult: fix!}
1663 % \@tempdima\dp\@cclv
1666 \vskip \skip\footins
1668 % \changes{v1.1a}{1994/10/31}
1669 % {(DPC/CAR) Colour resetting moved to here}
1679 % The h floats have now been finally committed to this page so we
1680 % can reset their list. The top and bottom floats are then added
1682 % \changes{v1.2k}{2003/12/16}{Ensure that \cs{@elt} has a defined
1686 \xdef\@freelist{\@freelist\@midlist}%
1688 % \changes{v1.0h}{1993/12/12}{defs changed to lets}
1690 \global \let \@midlist \@empty
1693 % The variations start here in case |\enlargethispage| has
1700 % This extra reboxing is only needed to add the
1701 % |\@texttop| and |\@textbotttom| but this could be done earlier,
1702 % when the floats are added.
1704 % The |\boxmaxdepth| resetting here will have no effect unless
1705 % |\@textbottom| ends with a box or rule. So is this (or possibly
1706 % |\@maxdepth|) the correct value?
1708 % The |\vskip -\dimen@|
1709 % ensures that the visible depth of the box does not
1710 % affect the placement of anything on the page.
1711 % Thus very deep pages will overprint the footer; but these should
1712 % have been prevented by suitable settings of the maxdepths at
1713 % appropriate times.
1715 % If |\@textbottom| ends with a box or rule of non-zero depth
1716 % then this skip adjustment should be done again after it.
1718 % I think that the final boxing of the main text page could have a
1719 % common ending which may make it simpler to see what is going on.
1721 % This needs further investigation, especially in the `special
1723 % \task{CAR}{Further investigation of makecol}
1725 % Also, the |\boxmaxdepth| setting here affects what happens within
1726 % |\@texttop| and |\@textbottom|, should it? Is it needed at all?
1727 % \changes{v1.0l}{1994/03/15}{Removed boxmaxdepth setting.}
1729 % RmS 91/10/22: Replaced |\dimen128| by |\dimen@|.
1732 \setbox\@outputbox \vbox to\@colht {%
1733 % \boxmaxdepth \maxdepth %??
1735 \dimen@ \dp\@outputbox
1741 \global \maxdepth \@maxdepth
1746 % \begin{macro}{\@reinserts}
1747 % \changes{v1.0e}{1993/12/01}{Command added}
1748 % This is the code which reinserts the inserts. It puts them all
1749 % in one place; this can make some of them come out on the wrong
1751 % It has been put into a separate macro to expedite experimentation.
1754 \ifvoid\footins\else\insert\footins{\unvbox\footins}\fi
1755 \ifvbox\@kludgeins\insert\@kludgeins
1756 {\unvbox\@kludgeins}\fi
1764 % \begin{macro}{\@makespecialcolbox}
1765 % \changes{v1.0b}{1993/11/29}{Command added}
1766 % This implements certain variations in page-makeup.
1768 %<*2ekernel|fltrace>
1769 \gdef \@makespecialcolbox {%
1771 \fl@trace{Kludgeins ht \the\ht\@kludgeins\space
1772 dp \the\dp\@kludgeins\space
1773 wd \the\wd\@kludgeins}%
1776 % First we find the natural height of the column.
1778 % See above for discussion of what is happening here.
1780 % This needs further investigation, especially in this `special
1782 % \changes{v1.0k}{1994/02/08}{boxmaxdepth setting removed}
1784 \setbox\@outputbox \vbox {%
1786 \dimen@ \dp\@outputbox
1791 \ifdim \wd\@kludgeins>\z@
1793 % Note that in this case (the *-version), the height of the
1794 % |\@kludgeins| box is not used since its value is somewhat
1795 % arbitrary: it need only be big enough to ensure that the
1796 % page-break is not taken prematurely.
1798 % Here we calculate how much vertical space needs to be added in
1799 % order to enable the column to fit into a box of size |\@colht|
1800 % using the best information we have about the amount of shrink
1801 % available (another thing which is known internally about a box,
1802 % but cannot be accessed at the \TeX{} level!).
1804 % This needs \TeX3 otherwise |\pageshrink| is zero anyway; it may
1805 % not be exactly the figure we wish as it is the total available
1806 % from the all the material collected before the page-break
1807 % decision is made. It will, we think, always be an overestimate
1808 % of the actual shrink in the box; therefore this should always
1809 % force the shortest possible column with the possibility of an
1812 % This should work for bothe flush- and ragged-bottom setting since
1813 % it makes the contents no smaller than the size (|\@colht|) of the
1814 % box into which they are put.
1816 % Their should perhaps be an upper limit, of 0pt?, on the extra
1817 % space added to force shrinking.
1818 % \task{CAR}{Further investigation of kludge-* space}
1820 % See above for a discussion of the |\boxmaxdepth| setting here.
1822 % \changes{v1.0k}{1994/02/08}{boxmaxdepth setting added}
1823 % \changes{v1.0l}{1994/03/15}{Removed boxmaxdepth setting.}
1825 \advance \@tempdima -\ht\@outputbox
1826 \advance \@tempdima \pageshrink
1828 \fl@trace {Natural ht of col: \the \ht\@outputbox}%
1829 \fl@trace {\string \@colht: \the \@colht}%
1830 \fl@trace {Pageshrink added: \the \pageshrink}%
1831 \fl@trace {Hence, space added: \the \@tempdima}%
1833 \setbox\@outputbox \vbox to \@colht {%
1834 % \boxmaxdepth \maxdepth
1840 % For the unstarred version, the final size of the page is
1841 % precisely specified. Therefore, at least for the flush-bottom
1842 % case, we need to ensure that, visually, it has this size exactly.
1844 % Thus we calculate this size and set the material in a box of this
1845 % size, which is then put into a box of size |\@colht| with |\vss|
1849 \advance \@tempdima -\ht\@kludgeins
1851 \fl@trace {Natural ht of col: \the \ht\@outputbox}%
1852 \fl@trace {\string \@colht: \the \@colht}%
1853 \fl@trace {Extra size added: -\the \ht \@kludgeins}%
1854 \fl@trace {Hence, height of inner box: \the \@tempdima}%
1855 \fl@trace {Max? pageshrink available: \the \pageshrink}%
1858 % This type of final packaging could be done always; this may
1859 % simplify all of this page-makeup.
1861 % It is not necessary to set |\boxmaxdepth| here since the
1862 % |\@outputbox| ends with glue.
1863 % \changes{v1.0k}{1994/02/03}{correct mistakes in the documentation}
1865 \setbox \@outputbox \vbox to \@colht {%
1866 \vbox to \@tempdima {%
1872 % Finally we need to explicitly make the insert box void.
1874 {\setbox \@tempboxa \box \@kludgeins}%
1876 \fl@trace {kludgeins box made void}%
1879 %</2ekernel|fltrace>
1883 % \begin{macro}{\@texttop}
1884 % \begin{macro}{\@textbottom}
1885 % These do nothing as a default.
1888 \let \@texttop \relax
1889 \let \@textbottom \relax
1894 % \begin{macro}{\@resetactivechars}
1895 % \begin{macro}{\@activechar@info}
1897 % \changes{v1.0n}{1994/04/30}{\cs{@activechar@warning} changed to
1898 % \cs{@activechar@info}}
1900 % added hook to protect against certain active characters in the
1901 % output routine. Default checks are for active space and end-of-line.
1902 % \changes{v1.0u}{1994/05/23}{Added \cs{MessageBreak}}
1904 \def\@activechar@info #1{%
1905 \@latex@info@no@line {Active #1 character found while
1906 output routine is active
1908 This may be a bug in a package file
1913 % Do not put any spaces in this next bit!
1914 % \changes{1.2f}{1999/10/09}{Reset definition of active prime
1915 % character (used in math mode)}
1918 \obeylines\obeyspaces%
1920 \gdef\@resetactivechars{%
1921 \def^^M{\@activechar@info{EOL}\space}%
1922 \def {\@activechar@info{space}\space}%
1923 \let'\active@math@prime}%
1929 % \begin{macro}{\@outputpage}
1930 % \changes{v1.0f}{1993/12/05}{Command changed}
1931 % \begin{macro}{\@shipoutsetup}
1932 % \changes{v1.0f}{1993/12/05}{Command added}
1933 % \changes{v1.1s}{1995/11/10}{Command removed}
1934 % \begin{macro}{\@writesetup}
1935 % \changes{v1.1s}{1995/11/10}{Command removed}
1936 % \changes{v1.1o}{1995/07/21}{Command added}
1937 % \changes{v1.0f}{1993/12/05}{\cs{@startpagehook} added}
1938 % \changes{v1.0j}{1993/12/17}{---and then removed}
1939 % \changes{v1.0p}{1994/05/12}{\cs{normalcolor}added}
1940 % \changes{v1.0s}{1994/05/20}{Added setting of \cs{protect}
1941 % during \cs{shipout}.}
1942 % \changes{v1.0u}{1994/05/23}{Changed resetting of \cs{protect} after
1943 % shipout to use \cs{aftergroup}}
1944 % \changes{v1.1b}{1994/11/05}
1945 % {Use new \cs{color@hbox} concept.}
1946 % \changes{v1.1b}{1994/11/05}
1947 % {Change protect settings for new-style, protect-free
1949 % \changes{v1.1c}{1994/11/05}
1950 % {Add new \cs{AtBeginDvi} concept}
1951 % \changes{v1.1e}{1994/11/10}
1952 % {Modify \cs{protect} setting}
1953 % \changes{v1.1f}{1994/11/14}
1954 % {Modify new \cs{AtBeginDvi} concept}
1955 % \changes{v1.1o}{1995/07/21}
1956 % {New, experimental, versions: need in-lining}
1957 % \changes{v1.1s}{1995/11/10}{In-lined}
1958 % \changes{v1.1w}{1996/09/21}{Added \cs{@parboxrestore} and made
1959 % consequent deletions: wait for the howls of protest}
1961 % The |\color@hbox| hooks here are used to avoid putting just a
1962 % colour special into an otherwise empty box (in a header or
1963 % footer). These boxes are often set to be completely empty and so
1964 % adding a special produces a very underfull box message.
1966 % There has been extensive tidying up of the old code here;
1967 % including the removal of a level of grouping.
1969 % The setting of |\protect| immediately before the |\shipout|
1970 % is needed so that protected commands within |\write|s are
1971 % handled correctly.
1973 % Within shipout's vbox it is reset to its default value, |\relax|.
1975 % Resetting it to its default value after the shipout has been
1976 % completed (and the contents of the writes have been expanded)
1977 % must be done by use of |\aftergroup|.
1978 % This is because it must have the value |\relax|
1979 % before macros coming from other uses of |\aftergroup| within
1980 % this box are expanded.
1982 % Putting this into the |\aftergroup| token list does not affect
1983 % the definition used in expanding the |\write|s because the
1984 % aftergroup token list is only constructed when popping the
1985 % save-stack, it is not expanded until after the shipout is
1988 % Question: should things from an |\aftergroup| within the shipped
1989 % out box be executed in the environment set up for the writes, or
1990 % after it finishes?
1992 % A lot of this code has been in-lined tp prevent mis-use of
1993 % internal commands as hooks.
1996 \begingroup % the \endgroup is put in by \aftergroup
1998 % Now all the set-up stuff has been in-lined for Frank.
2000 % First the stuff for the writes.
2002 % From here \ldots\ was in the command |\@writesetup|.
2004 \let \protect \noexpand
2007 % RmS 93/08/19: Redefined accents to allow changes in font encoding;
2008 % but exactly why was this needed?
2010 % The |\catcode`\ = 10| was removed as it was considered useless
2011 % (presumably because nothing gets tokenised during shipout).
2013 % This was put in as some error produced active spaces in a mark, I
2016 % Why was the hyphen reset?
2021 % If a page break happens between the start of a list and its first
2022 % item the |@newlist| will be true and this will mess up any list
2023 % that is used in the header or footer of the page. So we have to
2025 % \changes{v1.2h}{2000/07/19}
2026 % {Reset and restore \cs{@if@newlist} for internal/3231}
2027 % \changes{v1.2j}{2001/01/07}
2028 % {And do it in the right macro! (pr/3286)}
2030 \global\let\@@if@newlist\if@newlist
2031 \global\@newlistfalse
2034 % \changes{v1.0q}{1994/05/16}{Changed setting of accents (FMi):
2035 % with the new encoding setup they can use \cs{let}.
2036 % It could also use the new internal commands?}
2037 % \changes{v1.1l}{1995/04/24}{Reset \cmd\\ latex/1451 (DPC)}
2038 % This next hook replaces the following:
2041 % \let\'\@acci\let\`\@accii\let\=\@acciii
2043 % \let\par\@@par %% 15 Sep 87 (this was once inside the box)
2045 % and it does more than they did; in particular it sets:
2052 % \parfillskip\@flushglue
2053 % \lineskip\normallineskip
2054 % \baselineskip\normalbaselineskip
2061 % \ldots\ to here was in the command |\@writesetup|.
2064 \set@typeset@protect
2065 \aftergroup \endgroup
2066 \aftergroup \set@typeset@protect
2067 % correct? or just restore by ending
2070 % This first bit has been moved inside the shipped out box.
2072 % Now the setup inside the shipped out box; this should contain all
2073 % the stuff that could only affect typesetting; other stuff may need
2074 % to be reset for the writes also.
2076 % From here \ldots\ was in the command |\@shipoutsetup|.
2079 \global\@specialpagefalse\@nameuse{ps@\@specialstyle}%
2082 \ifodd\count\z@ \let\@thehead\@oddhead \let\@thefoot\@oddfoot
2083 \let\@themargin\oddsidemargin
2084 \else \let\@thehead\@evenhead
2085 \let\@thefoot\@evenfoot \let\@themargin\evensidemargin
2090 % The rest was always inside the box.
2092 % RmS 91/08/15: aded this line:
2096 % RmS 93/08/06 Added |\lineskiplimit=0pt| to guard against it being
2097 % nonzero: e.g. by |\offinterlineskip| being in effect.
2099 % There are probably lots of other things that may need resetting.
2104 % Reset the space factors.
2105 % \changes{v1.2b}{1997/04/14}
2106 % {Call \cs{normalsfcodes} (from patch file) latex/2404}
2111 % Reset these here (previously reset separately for head and foot)
2112 % \changes{v1.2b}{1997/04/14}
2113 % {Move \cs{label} and \cs{index} (from patch file)}
2117 \let\glossary\@gobble
2121 \baselineskip\z@skip \lineskip\z@skip \lineskiplimit\z@
2123 % \ldots\ to here was in the command |\@shipoutsetup|.
2127 \moveright\@themargin \vbox {%
2128 \setbox\@tempboxa \vbox to\headheight{%
2132 \hb@xt@\textwidth{\@thehead}%
2139 \baselineskip \footskip
2142 \hb@xt@\textwidth{\@thefoot}%
2147 % |\endgroup| now inserted by |\aftergroup|
2149 % Restore |\if@newlist|
2151 \global\let\if@newlist\@@if@newlist
2155 \global \@colht \textheight
2158 % It is now clear that this does something useful, thanks to Piet
2159 % van Oostrum. It is needed because a float page is made without
2160 % using TeX's page-builder; thus the output routine is never called
2161 % so the marks are not updated.
2163 \let\firstmark\botmark
2170 % \begin{macro}{\@begindvi}
2171 % \changes{v1.1c}{1994/11/05}
2173 % \changes{v1.1f}{1994/11/14}{Use normal box register: why a box?}
2175 % This unboxes stuff that must appear before anything else in the
2176 % |.dvi| file, then returns that box register to the free list and
2179 % The stuff in the box should not add any typeset material to the
2183 \unvbox \@begindvibox
2184 \global\let \@begindvi \@empty
2189 % \begin{macro}{\@combinefloats}
2190 % \begin{macro}{\@cflt}
2191 % \changes{v1.0h}{1993/12/12}{name changed}
2192 % \begin{macro}{\@cflb}
2193 % The |\boxmaxdepth| setting here was not made local to
2194 % a box so was dangerous. It is needed only within the box made
2195 % by |\@cflt| (and not normally even there), so it has been
2196 % moved there; this also agrees with the original pseudocode.
2198 % \changes{v1.0h}{1993/12/12}{boxmaxdepth setting moved}
2200 \def \@combinefloats {%
2201 % \boxmaxdepth \maxdepth
2202 \ifx \@toplist\@empty \else \@cflt \fi
2203 \ifx \@botlist\@empty \else \@cflb \fi
2207 % \changes{v1.0h}{1993/12/12}{defs changed to lets}
2210 \let \@elt \@comflelt
2211 \setbox\@tempboxa \vbox{}%
2213 \setbox\@outputbox \vbox{%
2214 \boxmaxdepth \maxdepth
2218 \vskip \textfloatsep
2222 \xdef\@freelist{\@freelist\@toplist}%
2223 \global\let\@toplist\@empty
2230 \setbox\@tempboxa \vbox{}%
2232 \setbox\@outputbox \vbox{%
2234 \vskip \textfloatsep
2240 \xdef\@freelist{\@freelist\@botlist}%
2241 \global \let \@botlist\@empty
2248 % \begin{macro}{\@comflelt}
2249 % \begin{macro}{\@comdblflelt}
2250 % \begin{macro}{\@combinedblfloats}
2253 \def\@comflelt#1{\setbox\@tempboxa
2254 \vbox{\unvbox\@tempboxa\box #1\vskip\floatsep}}
2258 \def\@comdblflelt#1{\setbox\@tempboxa
2259 \vbox{\unvbox\@tempboxa\box #1\vskip\dblfloatsep}}
2263 \def \@combinedblfloats{%
2264 \ifx \@dbltoplist \@empty
2266 \setbox\@tempboxa \vbox{}%
2267 \let \@elt \@comdblflelt
2270 \xdef \@freelist {\@freelist\@dbltoplist}%
2271 \global\let \@dbltoplist \@empty
2272 \setbox\@outputbox \vbox to\textheight
2275 % The setting of |\boxmaxdepth| here has no effect since the
2276 % |\@outputbox| should already have depth zero. Even so, it would
2277 % have no effect on the layout of the page.
2278 % \changes{v1.0l}{1994/03/15}{Removed boxmaxdepth setting.}
2280 {%\boxmaxdepth\maxdepth %% probably not needed, CAR
2281 \unvbox\@tempboxa\vskip-\dblfloatsep
2283 % Here we need different typesetting if the top float comes from
2285 % \changes{v1.0n}{1994/04/30}{Removed rule in topnewpage case}
2287 \ifnum \@dbltopnum>\m@ne
2290 \vskip \dbltextfloatsep
2302 % \begin{macro}{\@startcolumn}
2303 % \changes{v1.0f}{1993/12/05}{Command changed}
2304 % \begin{macro}{\@startdblcolumn}
2305 % \changes{v1.0f}{1993/12/05}{Command changed}
2307 % We could combine (most of) these two into |\@startcol <list>|.
2308 % Note that |\@xstartcol| was only used once (\ie in
2309 % |\@startcolumn|); it has therefore been removed. This is not quite
2310 % as efficient but it now has the same structure as
2311 % |\@startdblcolumn|.
2313 % The empty-list test has been moved to |\@tryfcolumn|.
2316 %<*2ekernel|fltrace>
2317 \def \@startcolumn {%
2318 \global \@colroom \@colht
2319 \@tryfcolumn \@deferlist
2322 \fl@trace{PAGE: float \if@twocolumn column \else page \fi
2327 % \changes{v1.0h}{1993/12/12}{defs changed to lets}
2330 \let \reserved@b \@deferlist
2331 \global \let \@deferlist \@empty
2332 \let \@elt \@scolelt
2339 % This one does not need to set |\@colht|.
2341 % \changes{v1.2n}{2015/01/14}{float order in 2-column (latexrelease)}
2343 %</2ekernel|fltrace>
2344 %<latexrelease|fltrace>\IncludeInRelease{2015/01/01}%
2345 %<latexrelease|fltrace> {\@startdblcolumn}{float order in 2-column}%
2346 %<*2ekernel|latexrelease|fltrace>
2347 \def \@startdblcolumn {%
2348 \@tryfcolumn \@deferlist
2350 %<fltrace> \fl@trace{PAGE: double float page completed}%
2353 \let \reserved@b \@deferlist
2354 \global \let \@deferlist \@empty
2355 \let \@elt \@sdblcolelt
2360 %</2ekernel|latexrelease|fltrace>
2361 %<latexrelease|fltrace>\EndIncludeInRelease
2362 %<latexrelease|fltrace>\IncludeInRelease{0000/00/00}%
2363 %<latexrelease|fltrace> {\@startdblcolumn}{float order in 2-column}%
2364 %<latexrelease|fltrace>\def \@startdblcolumn {%
2366 % Not needed since this always comes after |\@outputpage|:
2368 %<latexrelease|fltrace>% \global \@colht \textheight
2369 %<latexrelease|fltrace> \@tryfcolumn \@dbldeferlist
2370 %<latexrelease|fltrace> \if@fcolmade
2372 %<latexrelease|fltrace> \fl@trace{PAGE: double float page completed}%
2374 %<latexrelease|fltrace> \else
2376 % \changes{v1.0h}{1993/12/12}{defs changed to lets}
2378 %<latexrelease|fltrace> \begingroup
2379 %<latexrelease|fltrace> \let \reserved@b \@dbldeferlist
2380 %<latexrelease|fltrace> \global \let \@dbldeferlist \@empty
2381 %<latexrelease|fltrace> \let \@elt \@sdblcolelt
2382 %<latexrelease|fltrace> \reserved@b
2383 %<latexrelease|fltrace> \endgroup
2384 %<latexrelease|fltrace> \fi
2385 %<latexrelease|fltrace>}%
2386 %<latexrelease|fltrace>\EndIncludeInRelease
2387 %<*2ekernel|fltrace>
2392 % \begin{macro}{\@tryfcolumn}
2393 % \changes{v1.0f}{1993/12/05}{Command changed}
2394 % Now tests if its list is empty before any further exertion.
2397 \def \@tryfcolumn #1{%
2398 \global \@fcolmadefalse
2402 \fl@trace{PAGE: try float \if@twocolumn column/page\else page\fi
2404 \fl@trace{----- \string #1: #1}%
2407 % \changes{v1.0h}{1993/12/12}{defs changed to lets}
2410 \global \let \@failedlist \@empty
2412 \let \@elt \@xtryfc \@trylist
2419 %</2ekernel|fltrace>
2428 % \begin{macro}{\@scolelt}
2430 \def\@scolelt#1{\def\@currbox{#1}\@addtonextcol}
2434 % \begin{macro}{\@sdblcolelt}
2436 \def\@sdblcolelt#1{\def\@currbox{#1}\@addtodblcol}
2440 % \begin{macro}{\@vtryfc}
2441 % \changes{v1.2d}{1997/11/19}{Reindent code, to be understandable(DPC).}
2444 \global\setbox\@outputbox\vbox{}%
2447 \global\setbox\@outputbox \vbox to\@colht{%
2453 \xdef #1{\@failedlist\@flfail}%
2454 \xdef\@freelist{\@freelist\@flsucceed}}
2458 % \begin{macro}{\@wtryfc}
2461 \global\setbox\@outputbox\vbox{%
2468 % \begin{macro}{\@xtryfc}
2469 % \changes{v1.1v}{1996/07/26}{remove \cs{global} before \cs{@test...}}
2470 % \changes{v1.2n}{2015/01/14}{float order in 2-column (latexrelease)}
2473 %<latexrelease>\IncludeInRelease{2015/01/01}{\@xtryfc}%
2474 %<latexrelease> {float order in 2-column}%
2475 %<*2ekernel|latexrelease>
2477 \@next\reserved@a\@trylist{}{}%
2478 \@currtype \count #1%
2479 \divide\@currtype\@xxxii
2480 \multiply\@currtype\@xxxii
2481 \@bitor \@currtype \@failedlist
2486 \@testwrongwidth #1%
2490 \ifdim \ht #1>\@colht
2494 \@cons\@failedlist #1%
2498 %</2ekernel|latexrelease>
2499 %<latexrelease>\EndIncludeInRelease
2500 %<latexrelease>\IncludeInRelease{0000/00/00}{\@xtryfc}%
2501 %<latexrelease> {float order in 2-column}%
2502 %<latexrelease>\def\@xtryfc #1{%
2503 %<latexrelease> \@next\reserved@a\@trylist{}{}%
2504 %<latexrelease> \@currtype \count #1%
2505 %<latexrelease> \divide\@currtype\@xxxii
2506 %<latexrelease> \multiply\@currtype\@xxxii
2507 %<latexrelease> \@bitor \@currtype \@failedlist
2508 %<latexrelease> \@testfp #1%
2509 %<latexrelease> \ifdim \ht #1>\@colht
2510 %<latexrelease> \@testtrue
2512 %<latexrelease> \if@test
2513 %<latexrelease> \@cons\@failedlist #1%
2514 %<latexrelease> \else
2515 %<latexrelease> \@ytryfc #1%
2516 %<latexrelease> \fi}%
2517 %<latexrelease>\EndIncludeInRelease
2522 % \begin{macro}{\@ytryfc}
2526 \gdef\@flsucceed{\@elt #1}%
2527 \global\let\@flfail\@empty
2531 \ifdim \@tempdima >\@fpmin
2532 \global\@fcolmadetrue
2534 \@cons\@failedlist #1%
2543 % \begin{macro}{\@ztryfc}
2544 % \changes{v1.1v}{1996/07/26}{remove \cs{global} before \cs{@test...}}
2545 % \changes{v1.2n}{2015/01/14}{float order in 2-column (latexrelease)}
2548 %<latexrelease>\IncludeInRelease{2015/01/01}{@ztryfc}%
2549 %<latexrelease> {float order in 2-column}%
2550 %<*2ekernel|latexrelease>
2552 \@tempcnta\count #1%
2553 \divide\@tempcnta\@xxxii
2554 \multiply\@tempcnta\@xxxii
2555 \@bitor \@tempcnta {\@failedlist \@flfail}%
2561 \@testwrongwidth #1%
2565 \@tempdimb\@tempdima
2566 \advance\@tempdimb\ht #1%
2567 \advance\@tempdimb\@fpsep
2568 \ifdim \@tempdimb >\@colht
2574 \@cons\@flsucceed #1%
2575 \@tempdima\@tempdimb
2577 %</2ekernel|latexrelease>
2578 %<latexrelease>\EndIncludeInRelease
2579 %<latexrelease>\IncludeInRelease{0000/00/00}{@ztryfc}%
2580 %<latexrelease> {float order in 2-column}%
2581 %<latexrelease>\def\@ztryfc #1{%
2582 %<latexrelease> \@tempcnta \count#1%
2583 %<latexrelease> \divide\@tempcnta\@xxxii
2584 %<latexrelease> \multiply\@tempcnta\@xxxii
2585 %<latexrelease> \@bitor \@tempcnta {\@failedlist \@flfail}%
2586 %<latexrelease> \@testfp #1%
2587 %<latexrelease> \@tempdimb\@tempdima
2588 %<latexrelease> \advance\@tempdimb \ht#1%
2589 %<latexrelease> \advance\@tempdimb\@fpsep
2590 %<latexrelease> \ifdim \@tempdimb >\@colht
2591 %<latexrelease> \@testtrue
2593 %<latexrelease> \if@test
2594 %<latexrelease> \@cons\@flfail #1%
2595 %<latexrelease> \else
2596 %<latexrelease> \@cons\@flsucceed #1%
2597 %<latexrelease> \@tempdima\@tempdimb
2598 %<latexrelease> \fi}%
2599 %<latexrelease>\EndIncludeInRelease
2604 % The major changes for float suppression and the changes to the float
2605 % mechanism to make it conform to the documentation are in these next
2608 % \begin{macro}{\@addtobot}
2609 % \changes{v1.0f}{1993/12/05}{Command changed}
2613 %<*2ekernel|fltrace>
2616 \fl@trace{***Start addtobot}%
2620 \fl@trace{fpstype \ifodd \@tempcnta OK \else not \fi bot:
2627 \@flcheckspace \@botroom \@botlist
2630 % This next line means that this page is produced with box 255
2631 % having depth zero, rather than the normal maxdepth: is this
2633 % \task{CAR/FMi}{Investigate resetting of maxdepth: I do not think it is
2634 % necessary here; Frank does.}
2636 \global \maxdepth \z@
2637 \@flupdates \@botnum \@botroom \@botlist
2639 \fl@trace{colroom (after-bot) = \the \@colroom}%
2640 \fl@trace{colnum (after-bot) = \the \@colnum}%
2641 \fl@trace{botnum (after-bot) = \the \@botnum}%
2642 \fl@trace{***Success: bot}%
2648 \fl@trace{Fail: botnum = \the \@botnum:
2649 fpstype \the \@fpstype=ORD?}%
2650 \ifnum \@fpstype<\sixt@@n
2651 \fl@trace{ERROR: !b float not successful (addtobot)}%
2660 % \begin{macro}{\@addtotoporbot}
2661 % \changes{v1.0f}{1993/12/05}{Command changed}
2665 \def \@addtotoporbot {%
2667 \fl@trace{***Start addtotoporbot}%
2671 \fl@trace{fpstype \ifodd \@tempcnta OK \else not \fi top:
2678 \@flcheckspace \@toproom \@toplist
2680 \@bitor\@currtype{\@midlist\@botlist}%
2682 \fl@trace{(mid+bot)list: \@midlist, \@botlist:
2683 (addtotoporbot-before)}%
2687 \fl@trace{type already on list: mid or bot---sent to addtobot}%
2690 \@flupdates \@topnum \@toproom \@toplist
2692 \fl@trace{colroom (after-top) = \the \@colroom}%
2693 \fl@trace{colnum (after-top) = \the \@colnum}%
2694 \fl@trace{topnum (after-top) = \the \@topnum}%
2695 \fl@trace{***Success: top}%
2702 \fl@trace{Fail: topnum = \the \@topnum: fpstype
2703 \the \@fpstype=ORD?}%
2704 \ifnum \@fpstype<\sixt@@n
2705 \fl@trace{ERROR: !t float not successful (addtotoporbot)}%
2713 \fl@trace{sent to addtobot (addtotoporbot)}%
2718 %</2ekernel|fltrace>
2722 % \begin{macro}{\@addtocurcol}
2723 % \changes{v1.0f}{1993/12/05}{Command changed}
2724 % \task{CAR}{Add rules around h floats for FMi}
2725 % \task{CAR}{Investigate pagebreak option possibilities}
2728 % \changes{v1.2n}{2015/01/14}{float order in 2-column (latexrelease)}
2730 %<latexrelease|fltrace|flafter>\IncludeInRelease{2015/01/01}%
2731 %<latexrelease|fltrace|flafter> {\@addtocurcol}{float order in 2-column}%
2732 %<*2ekernel|latexrelease|fltrace|flafter>
2733 \def \@addtocurcol {%
2735 \fl@trace{***Start addtocurcol}%
2738 \@setfloattypecounts
2741 \fl@trace{fpstype !p only (addtocurcol): \the \@fpstype = 8?}%
2746 \fl@trace{fpstype p only (addtocurcol): \the \@fpstype = 24?}%
2751 % This is a new adjustment which is quite a major change in
2752 % functionality; but it implements the documentation.
2753 % Note that |\@reqcolroom| will include the whole of the
2754 % page-so-far, and hence includes |\@textfloatsheight| of floats,
2755 % so before comparing it with |\@textmin|, we add this to
2759 \fl@trace{textfloatsheight (before) = \the \@textfloatsheight}%
2761 \advance \@textmin \@textfloatsheight
2762 \@reqcolroom \@pageht
2764 % This line must be removed since |\@specialoutput| changed.
2766 % \advance \@reqcolroom \@pagedp
2768 \fl@trace{textmin + textfloatsheight: \the \@textmin}%
2769 \fl@trace{page-so-far: \the \@reqcolroom}%
2771 \ifdim \@textmin>\@reqcolroom
2772 \@reqcolroom \@textmin
2774 \fl@trace{ORD? textmin being used}%
2777 \advance \@reqcolroom \ht\@currbox
2779 \fl@trace{float size = \the \ht \@currbox (addtocurcol)}%
2780 \fl@trace{colroom = \the \@colroom (addtocurcol)}%
2781 \fl@trace{reqcolroom = \the \@reqcolroom (addtocurcol)}%
2783 \ifdim \@colroom>\@reqcolroom
2786 \@bitor\@currtype\@deferlist
2788 % We need to defer the float also if its width
2790 % \changes{v1.2n}{2000/09/24}{FMi: test for wide float was
2793 \@testwrongwidth\@currbox
2798 \fl@trace{deferlist: \@deferlist: (addtocurcol-before)}%
2802 \fl@trace{type already on list: defer (addtocurcol)}%
2805 \@bitor\@currtype\@botlist
2807 \fl@trace{botlist: \@botlist: (addtocurcol-before)}%
2811 \fl@trace{type already on list: bot---sent to addtobot}%
2816 \fl@trace{fpstype \ifodd \@tempcnta OK \else not \fi
2817 here: \the \@fpstype}%
2819 \ifodd \count\@currbox
2820 \advance \@reqcolroom \intextsep
2821 \ifdim \@colroom>\@reqcolroom
2822 \global \advance \@colnum \m@ne
2823 \global \advance \@textfloatsheight \ht\@currbox
2825 % This may sometimes give an overestimate.
2827 \global \advance \@textfloatsheight 2\intextsep
2828 \@cons \@midlist \@currbox
2830 \fl@trace{***Success: here}%
2831 \fl@trace{textfloatsheight (after-here) =
2832 \the \@textfloatsheight}%
2833 \fl@trace{colnum (after-here) = \the \@colnum}%
2837 % CHANGE TO |\@addtocurcol|:
2839 % |\penalty\z@| changed to |\penalty\interlinepenalty| so |\samepage|
2840 % works properly with figure and table environments.
2841 % (Changed 23 Oct 86)
2843 % There is also an |\addpenalty\interlinepenalty| above.
2845 % Since in 2e |\samepage| is no longer supported, these could be
2848 % Although it is best to use |\addvspace| in case two h floats come
2849 % together, this makes other spacing more difficult to adjust; whereas
2850 % if a user specifies two h floats together then they can more easily
2851 % get the spacing correct by ad hoc commands.
2853 % It is necessary to adjust for the addition of |\parskip| here in
2854 % case the float is added between paragraphs (\ie when in vertical
2857 % If the nobreak switch is true we need to reset it and clear
2858 % |\everypar| since the float may not reset the flag and cannot reset
2859 % the |\everypar| globally.
2860 % \changes{v1.0l}{1994/03/15}{Changed \cs{addvspace} to \cs{vskip}}
2861 % \changes{v1.1i}{1994/11/21}
2862 % {Added \cs{if@nobreak} test before float box}
2863 % \changes{v1.1z}{1996/10/24}{Added \cs{nobreak}, etc as appropriate}
2865 % Typesetting starts here (we are in vertical mode).
2872 \addpenalty \interlinepenalty
2876 \penalty\interlinepenalty
2878 \ifnum\outputpenalty <-\@Mii \vskip -\parskip\fi
2880 % Typesetting ends here.
2886 \fl@trace{Fail---no room at 2nd test of colroom
2887 (addtocorcol \string\intextsep)}%
2894 % Next set of docstrip guards are a bit weird, essentially
2895 % |\@addtotoporbot| ends up inside the kernel and the
2896 % \texttt{fltrace} package and |\@addtobot| shows up in the
2897 % \texttt{flafter} package. Guess that could have been done a bit
2900 %<*2ekernel|fltrace|latexrelease>
2902 \fl@trace{not here: sent to addtotoporbot}%
2905 %</2ekernel|fltrace|latexrelease>
2906 %<*!2ekernel&!fltrace&!latexrelease>
2908 \fl@trace{not here: sent to addtobot}%
2911 %</!2ekernel&!fltrace&!latexrelease>
2917 \fl@trace{Fail: colnum = \the \@colnum:
2918 fpstype \the \@fpstype=ORD?}%
2919 \ifnum \@fpstype<\sixt@@n
2920 \fl@trace{ERROR: BANG float not successful (addtocurcol)}%
2926 \fl@trace{Fail---no room: fl box ht: \the \ht \@currbox
2936 \fl@trace{put on deferlist (addtocurcol)}%
2938 \@cons\@deferlist\@currbox
2940 \fl@trace{deferlist: \@deferlist: (addtocurcol-after)}%
2944 %</2ekernel|latexrelease|fltrace|flafter>
2945 %<latexrelease|fltrace|flafter>\EndIncludeInRelease
2946 %<latexrelease|fltrace|flafter>\IncludeInRelease{0000/00/00}%
2947 %<latexrelease|fltrace|flafter> {\@addtocurcol}{float order in 2-column}%
2948 %<latexrelease|fltrace|flafter>\def \@addtocurcol {%
2950 %<latexrelease|fltrace|flafter> \fl@trace{***Start addtocurcol}%
2952 %<latexrelease|fltrace|flafter> \@insertfalse
2953 %<latexrelease|fltrace|flafter> \@setfloattypecounts
2954 %<latexrelease|fltrace|flafter> \ifnum \@fpstype=8
2956 %<latexrelease|fltrace|flafter> \fl@trace{fpstype !p only (addtocurcol):
2957 %<latexrelease|fltrace|flafter> \the \@fpstype = 8?}%
2959 %<latexrelease|fltrace|flafter> \else
2960 %<latexrelease|fltrace|flafter> \ifnum \@fpstype=24
2962 %<latexrelease|fltrace|flafter> \fl@trace{fpstype p only (addtocurcol):
2963 %<latexrelease|fltrace|flafter> \the \@fpstype = 24?}%
2965 %<latexrelease|fltrace|flafter> \else
2966 %<latexrelease|fltrace|flafter> \@flsettextmin
2968 % This is a new adjustment which is quite a major change in
2969 % functionality; but it implements the documentation.
2970 % Note that |\@reqcolroom| will include the whole of the
2971 % page-so-far, and hence includes |\@textfloatsheight| of floats,
2972 % so before comparing it with |\@textmin|, we add this to
2976 %<latexrelease|fltrace|flafter> \fl@trace{textfloatsheight (before) =
2977 %<latexrelease|fltrace|flafter> \the \@textfloatsheight}%
2979 %<latexrelease|fltrace|flafter> \advance \@textmin \@textfloatsheight
2980 %<latexrelease|fltrace|flafter> \@reqcolroom \@pageht
2982 % This line must be removed since |\@specialoutput| changed.
2984 % \advance \@reqcolroom \@pagedp
2986 %<latexrelease|fltrace|flafter> \fl@trace{textmin + textfloatsheight:
2987 %<latexrelease|fltrace|flafter> \the \@textmin}%
2988 %<latexrelease|fltrace|flafter> \fl@trace{page-so-far: \the \@reqcolroom}%
2989 %<latexrelease|fltrace|flafter>
2991 %<latexrelease|fltrace|flafter> \ifdim \@textmin>\@reqcolroom
2992 %<latexrelease|fltrace|flafter> \@reqcolroom \@textmin
2994 %<latexrelease|fltrace|flafter> \fl@trace{ORD? textmin being used}%
2996 %<latexrelease|fltrace|flafter> \fi
2997 %<latexrelease|fltrace|flafter> \advance \@reqcolroom \ht\@currbox
2999 %<latexrelease|fltrace|flafter> \fl@trace{float size =
3000 %<latexrelease|fltrace|flafter> \the \ht \@currbox (addtocurcol)}%
3001 %<latexrelease|fltrace|flafter> \fl@trace{colroom =
3002 %<latexrelease|fltrace|flafter> \the \@colroom (addtocurcol)}%
3003 %<latexrelease|fltrace|flafter> \fl@trace{reqcolroom =
3004 %<latexrelease|fltrace|flafter> \the \@reqcolroom (addtocurcol)}%
3006 %<latexrelease|fltrace|flafter> \ifdim \@colroom>\@reqcolroom
3007 %<latexrelease|fltrace|flafter> \@flsetnum \@colnum
3008 %<latexrelease|fltrace|flafter> \ifnum \@colnum>\z@
3009 %<latexrelease|fltrace|flafter> \@bitor\@currtype\@deferlist
3011 %<latexrelease|fltrace|flafter> \fl@trace{deferlist:
3012 %<latexrelease|fltrace|flafter> \@deferlist: (addtocurcol-before)}%
3014 %<latexrelease|fltrace|flafter> \if@test
3016 %<latexrelease|fltrace|flafter> \fl@trace{type already on list:
3017 %<latexrelease|fltrace|flafter> defer (addtocurcol)}%
3019 %<latexrelease|fltrace|flafter> \else
3020 %<latexrelease|fltrace|flafter> \@bitor\@currtype\@botlist
3022 %<latexrelease|fltrace|flafter> \fl@trace{botlist: \@botlist:
3023 %<latexrelease|fltrace|flafter> (addtocurcol-before)}%
3025 %<latexrelease|fltrace|flafter> \if@test
3027 %<latexrelease|fltrace|flafter> \fl@trace{type already on list:
3028 %<latexrelease|fltrace|flafter> bot---sent to addtobot}%
3030 %<latexrelease|fltrace|flafter> \@addtobot
3031 %<latexrelease|fltrace|flafter> \else
3033 %<latexrelease|fltrace|flafter> \fl@trace{fpstype
3034 %<latexrelease|fltrace|flafter> \ifodd \@tempcnta OK \else not \fi
3035 %<latexrelease|fltrace|flafter> here: \the \@fpstype}%
3037 %<latexrelease|fltrace|flafter> \ifodd \count\@currbox
3038 %<latexrelease|fltrace|flafter> \advance \@reqcolroom \intextsep
3039 %<latexrelease|fltrace|flafter> \ifdim \@colroom>\@reqcolroom
3040 %<latexrelease|fltrace|flafter> \global \advance \@colnum \m@ne
3041 %<latexrelease|fltrace|flafter> \global \advance
3042 %<latexrelease|fltrace|flafter> \@textfloatsheight\ht\@currbox
3044 % This may sometimes give an overestimate.
3046 %<latexrelease|fltrace|flafter> \global \advance
3047 %<latexrelease|fltrace|flafter> \@textfloatsheight 2\intextsep
3048 %<latexrelease|fltrace|flafter> \@cons \@midlist \@currbox
3050 %<latexrelease|fltrace|flafter> \fl@trace{***Success: here}%
3051 %<latexrelease|fltrace|flafter> \fl@trace{textfloatsheight
3052 %<latexrelease|fltrace|flafter> (after-here) =
3053 %<latexrelease|fltrace|flafter> \the \@textfloatsheight}%
3054 %<latexrelease|fltrace|flafter> \fl@trace{colnum (after-here) =
3055 %<latexrelease|fltrace|flafter> \the \@colnum}%
3059 % CHANGE TO |\@addtocurcol|:
3061 % |\penalty\z@| changed to |\penalty\interlinepenalty| so |\samepage|
3062 % works properly with figure and table environments.
3063 % (Changed 23 Oct 86)
3065 % There is also an |\addpenalty\interlinepenalty| above.
3067 % Since in 2e |\samepage| is no longer supported, these could be
3070 % Although it is best to use |\addvspace| in case two h floats come
3071 % together, this makes other spacing more difficult to adjust; whereas
3072 % if a user specifies two h floats together then they can more easily
3073 % get the spacing correct by ad hoc commands.
3075 % It is necessary to adjust for the addition of |\parskip| here in
3076 % case the float is added between paragraphs (\ie when in vertical
3079 % If the nobreak switch is true we need to reset it and clear
3080 % |\everypar| since the float may not reset the flag and cannot reset
3081 % the |\everypar| globally.
3082 % \changes{v1.0l}{1994/03/15}{Changed \cs{addvspace} to \cs{vskip}}
3083 % \changes{v1.1i}{1994/11/21}
3084 % {Added \cs{if@nobreak} test before float box}
3085 % \changes{v1.1z}{1996/10/24}{Added \cs{nobreak}, etc as appropriate}
3087 % Typesetting starts here (we are in vertical mode).
3089 %<latexrelease|fltrace|flafter> \if@nobreak
3090 %<latexrelease|fltrace|flafter> \nobreak
3091 %<latexrelease|fltrace|flafter> \@nobreakfalse
3092 %<latexrelease|fltrace|flafter> \everypar{}%
3093 %<latexrelease|fltrace|flafter> \else
3094 %<latexrelease|fltrace|flafter> \addpenalty\interlinepenalty
3095 %<latexrelease|fltrace|flafter> \fi
3096 %<latexrelease|fltrace|flafter> \vskip \intextsep
3097 %<latexrelease|fltrace|flafter> \box\@currbox
3098 %<latexrelease|fltrace|flafter> \penalty\interlinepenalty
3099 %<latexrelease|fltrace|flafter> \vskip\intextsep
3100 %<latexrelease|fltrace|flafter> \ifnum\outputpenalty
3101 %<latexrelease|fltrace|flafter> <-\@Mii \vskip
3102 %<latexrelease|fltrace|flafter> -\parskip\fi
3104 % Typesetting ends here.
3106 %<latexrelease|fltrace|flafter> \outputpenalty \z@
3107 %<latexrelease|fltrace|flafter> \@inserttrue
3109 %<latexrelease|fltrace|flafter> \else
3110 %<latexrelease|fltrace|flafter> \fl@trace{Fail---no room at 2nd test of colroom
3111 %<latexrelease|fltrace|flafter> (addtocorcol \string\intextsep)}%
3113 %<latexrelease|fltrace|flafter> \fi
3114 %<latexrelease|fltrace|flafter> \fi
3115 %<latexrelease|fltrace|flafter> \if@insert
3116 %<latexrelease|fltrace|flafter> \else
3118 % Next set of docstrip guards are a bit weird, essentially
3119 % |\@addtotoporbot| ends up inside the kernel and the
3120 % \texttt{fltrace} package and |\@addtotoporbot| shows up in the
3121 % \texttt{flafter} package. Guess that could have been done a bit
3124 %<*2ekernel|fltrace>
3126 %<latexrelease|fltrace|flafter> \fl@trace{not here: sent to addtotoporbot}%
3128 %<latexrelease|fltrace|flafter> \@addtotoporbot
3129 %</2ekernel|fltrace>
3130 %<*!2ekernel&!autoload&!fltrace>
3132 %<latexrelease|fltrace|flafter> \fl@trace{not here: sent to addtobot}%
3134 %<latexrelease|fltrace|flafter> \@addtobot
3135 %</!2ekernel&!autoload&!fltrace>
3136 %<latexrelease|fltrace|flafter> \fi
3137 %<latexrelease|fltrace|flafter> \fi
3138 %<latexrelease|fltrace|flafter> \fi
3140 %<latexrelease|fltrace|flafter> \else
3141 %<latexrelease|fltrace|flafter> \fl@trace{Fail: colnum = \the \@colnum:
3142 %<latexrelease|fltrace|flafter> fpstype \the \@fpstype=ORD?}%
3143 %<latexrelease|fltrace|flafter> \ifnum \@fpstype<\sixt@@n
3144 %<latexrelease|fltrace|flafter> \fl@trace{ERROR: BANG float not successful
3145 %<latexrelease|fltrace|flafter> (addtocurcol)}%
3146 %<latexrelease|fltrace|flafter> \fi
3148 %<latexrelease|fltrace|flafter> \fi
3150 %<latexrelease|fltrace|flafter> \else
3151 %<latexrelease|fltrace|flafter> \fl@trace{Fail---no room: fl box ht:
3152 %<latexrelease|fltrace|flafter> \the \ht \@currbox (addtocurcol)}%
3154 %<latexrelease|fltrace|flafter> \fi
3155 %<latexrelease|fltrace|flafter> \fi
3156 %<latexrelease|fltrace|flafter> \fi
3157 %<latexrelease|fltrace|flafter> \if@insert
3158 %<latexrelease|fltrace|flafter> \else
3159 %<latexrelease|fltrace|flafter> \@resethfps
3161 %<latexrelease|fltrace|flafter> \fl@trace{put on deferlist (addtocurcol)}%
3163 %<latexrelease|fltrace|flafter> \@cons\@deferlist\@currbox
3165 %<latexrelease|fltrace|flafter> \fl@trace{deferlist: \@deferlist:
3166 %<latexrelease|fltrace|flafter> (addtocurcol-after)}%
3168 %<latexrelease|fltrace|flafter> \fi
3169 %<latexrelease|fltrace|flafter> }%
3170 %<latexrelease|fltrace|flafter>\EndIncludeInRelease
3174 % \begin{macro}{\@addtonextcol}
3175 % \changes{v1.0f}{1993/12/05}{Command changed}
3178 % \changes{v1.2n}{2015/01/14}{float order in 2-column (latexrelease)}
3180 %<latexrelease|fltrace>\IncludeInRelease{2015/01/01}
3181 %<latexrelease|fltrace> {\@addtonextcol}{float order in 2-column}%
3182 %<*2ekernel|fltrace>
3183 \def\@addtonextcol{%
3186 \fl@trace{***Start addtonextcol}%
3189 \@setfloattypecounts
3192 \fl@trace{fpstype not curcol: \the \@fpstype = 8?}%
3197 \fl@trace{fpstype not curcol: \the \@fpstype = 24?}%
3202 \fl@trace{text-so-far: 0pt (top of col)}%
3204 \@reqcolroom \ht\@currbox
3206 \fl@trace{float size: \the \@reqcolroom (addtonextcol)}%
3208 \advance \@reqcolroom \@textmin
3210 \fl@trace{colroom = \the \@colroom (addtonextcol)}%
3211 \fl@trace{reqcolroom = \the \@reqcolroom (addtonextcol)}%
3213 \ifdim \@colroom>\@reqcolroom
3216 \@bitor\@currtype\@deferlist
3218 \fl@trace{deferlist: \@deferlist: (addtonextcol-before)}%
3223 \@testwrongwidth\@currbox
3229 \fl@trace{type already on list: defer (addtonextcol)}%
3233 \fl@trace{sent to addtotoporbot (addtonextcol)}%
3240 \fl@trace{Fail---no room: fl box ht: \the \ht \@currbox
3249 \fl@trace{put back on deferlist (addtonextcol)}%
3251 \@cons\@deferlist\@currbox
3253 \fl@trace{deferlist: \@deferlist: (addtonextcol-after)}%
3257 \fl@trace{End of addtonextcol -- locally counts:}%
3258 \fl@trace{col: \the\@colnum. top: \the \@topnum. bot: \the \@botnum.}%
3262 \fl@trace{End of addtonextcol -- globally counts:}%
3263 \fl@trace{col: \the\@colnum. top: \the \@topnum. bot: \the \@botnum.}%
3266 %</2ekernel|fltrace>
3267 %<latexrelease|fltrace>\EndIncludeInRelease
3268 %<latexrelease|fltrace>\IncludeInRelease{0000/00/00}%
3269 %<latexrelease|fltrace> {\@addtonextcol}{float order in 2-column}%
3270 %<latexrelease|fltrace>\def\@addtonextcol{%
3271 %<latexrelease|fltrace> \begingroup
3273 %<latexrelease|fltrace> \fl@trace{***Start addtonextcol}%
3275 %<latexrelease|fltrace> \@insertfalse
3276 %<latexrelease|fltrace> \@setfloattypecounts
3277 %<latexrelease|fltrace> \ifnum \@fpstype=8
3279 %<latexrelease|fltrace> \fl@trace{fpstype not curcol:
3280 %<latexrelease|fltrace> \the \@fpstype = 8?}%
3282 %<latexrelease|fltrace> \else
3283 %<latexrelease|fltrace> \ifnum \@fpstype=24
3285 %<latexrelease|fltrace> \fl@trace{fpstype not curcol:
3286 %<latexrelease|fltrace> \the \@fpstype = 24?}%
3288 %<latexrelease|fltrace> \else
3289 %<latexrelease|fltrace> \@flsettextmin
3291 %<latexrelease|fltrace> \fl@trace{text-so-far: 0pt (top of col)}%
3293 %<latexrelease|fltrace> \@reqcolroom \ht\@currbox
3295 %<latexrelease|fltrace> \fl@trace{float size:
3296 %<latexrelease|fltrace> \the \@reqcolroom (addtonextcol)}%
3297 %<latexrelease|fltrace>
3299 %<latexrelease|fltrace> \advance \@reqcolroom \@textmin
3301 %<latexrelease|fltrace> \fl@trace{colroom =
3302 %<latexrelease|fltrace> \the \@colroom (addtonextcol)}%
3303 %<latexrelease|fltrace> \fl@trace{reqcolroom =
3304 %<latexrelease|fltrace> \the \@reqcolroom (addtonextcol)}%
3306 %<latexrelease|fltrace> \ifdim \@colroom>\@reqcolroom
3307 %<latexrelease|fltrace> \@flsetnum \@colnum
3308 %<latexrelease|fltrace> \ifnum\@colnum>\z@
3309 %<latexrelease|fltrace> \@bitor\@currtype\@deferlist
3311 %<latexrelease|fltrace> \fl@trace{deferlist: \@deferlist:
3312 %<latexrelease|fltrace> (addtonextcol-before)}%
3314 %<latexrelease|fltrace> \if@test
3316 %<latexrelease|fltrace> \fl@trace{type already on list:
3317 %<latexrelease|fltrace> defer (addtonextcol)}%
3319 %<latexrelease|fltrace> \else
3321 %<latexrelease|fltrace> \fl@trace{sent to addtotoporbot
3322 %<latexrelease|fltrace> (addtonextcol)}%
3324 %<latexrelease|fltrace> \@addtotoporbot
3325 %<latexrelease|fltrace> \fi
3326 %<latexrelease|fltrace> \fi
3328 %<latexrelease|fltrace> \else
3329 %<latexrelease|fltrace> \fl@trace{Fail---no room: fl box ht:
3330 %<latexrelease|fltrace> \the \ht \@currbox (addtonextcol)}%
3332 %<latexrelease|fltrace> \fi
3333 %<latexrelease|fltrace> \fi
3334 %<latexrelease|fltrace> \fi
3335 %<latexrelease|fltrace> \if@insert
3336 %<latexrelease|fltrace> \else
3338 %<latexrelease|fltrace> \fl@trace{put back on deferlist
3339 %<latexrelease|fltrace> (addtonextcol)}%
3341 %<latexrelease|fltrace> \@cons\@deferlist\@currbox
3343 %<latexrelease|fltrace> \fl@trace{deferlist: \@deferlist:
3344 %<latexrelease|fltrace> (addtonextcol-after)}%
3346 %<latexrelease|fltrace> \fi
3348 %<latexrelease|fltrace> \fl@trace{End of addtonextcol --
3349 %<latexrelease|fltrace> locally counts:}%
3350 %<latexrelease|fltrace> \fl@trace{col: \the \@colnum.
3351 %<latexrelease|fltrace> top: \the \@topnum. bot: \the \@botnum.}%
3353 %<latexrelease|fltrace> \endgroup
3355 %<latexrelease|fltrace> \fl@trace{End of addtonextcol --
3356 %<latexrelease|fltrace> globally counts:}%
3357 %<latexrelease|fltrace> \fl@trace{col: \the \@colnum.
3358 %<latexrelease|fltrace> top: \the \@topnum. bot: \the \@botnum.}%
3360 %<latexrelease|fltrace>}%
3361 %<latexrelease|fltrace>\EndIncludeInRelease
3366 % \begin{macro}{\@addtodblcol}
3367 % \changes{v1.0f}{1993/12/05}{Command changed}
3370 % \changes{v1.2n}{2015/01/14}{float order in 2-column (latexrelease)}
3372 %<latexrelease|fltrace>\IncludeInRelease{2015/01/01}%
3373 %<latexrelease|fltrace> {\@addtodblcol}{float order in 2-column}%
3374 %<*2ekernel|latexrelease|fltrace>
3378 \fl@trace{***Start addtodblcol}%
3381 \@setfloattypecounts
3384 \fl@trace{fpstype \ifodd \@tempcnta OK \else not \fi dbltop:
3388 \@flsetnum \@dbltopnum
3389 \ifnum \@dbltopnum>\z@
3391 \ifdim \@dbltoproom>\ht\@currbox
3394 \fl@trace{Space OK: \@dbltoproom =
3395 \the \@dbltoproom > \the \ht \@currbox
3400 \fl@trace{fpstype: \the \@fpstype (addtodblcol)}%
3402 \ifnum \@fpstype<\sixt@@n
3404 \fl@trace{BANG float ignoring \@dbltoproom}%
3405 \fl@trace{\@spaces \@dbltoproom = \the \@dbltoproom.
3406 Ht float: \the \ht \@currbox-BANG}%
3409 % Need to check that there is room on the page, using the local value
3410 % of |\@textmin| to make the necessary adjustment to |\@dbltoproom|.
3412 \advance \@dbltoproom \@textmin
3414 \fl@trace{Local value of texmin: \the\@textmin}%
3415 \fl@trace{\@spaces space on page = \the \@dbltoproom.
3416 Ht float: \the \ht \@currbox-BANG}%
3418 \ifdim \@dbltoproom>\ht\@currbox
3421 \fl@trace{Space OK BANG: space on page =
3422 \the \@dbltoproom > \the \ht \@currbox}%
3424 \fl@trace{fpstype: \the \@fpstype}%
3425 \fl@trace{Fail---no room dbltoproom-BANG?:}%
3426 \fl@trace{\@spaces space on page = \the \@dbltoproom.
3427 Ht float: \the \ht \@currbox}%
3430 \advance \@dbltoproom -\@textmin
3433 \fl@trace{fpstype: \the \@fpstype}%
3434 \fl@trace{Fail---no room dbltoproom-ORD?:}%
3435 \fl@trace{\@spaces \@dbltoproom = \the \@dbltoproom.
3436 Ht float: \the \ht \@currbox}%
3441 \@bitor \@currtype \@deferlist
3443 \fl@trace{(dbl)deferlist: \@deferlist: (before)}%
3449 \@testwrongwidth\@currbox
3455 \fl@trace{type already on list: (dbl)defer}%
3458 \@tempdima -\ht\@currbox
3460 -\ifx \@dbltoplist\@empty \dbltextfloatsep \else
3462 \global \advance \@dbltoproom \@tempdima
3463 \global \advance \@colht \@tempdima
3464 \global \advance \@dbltopnum \m@ne
3465 \@cons \@dbltoplist \@currbox
3467 \fl@trace{dbltopnum (after) = \the \@dbltopnum}%
3468 \fl@trace{***Success: dbltop}%
3475 \fl@trace{Fail: dbltopnum = \the \@dbltopnum: fpstype
3476 \the \@fpstype=ORD?}%
3477 \ifnum \@fpstype<\sixt@@n
3478 \fl@trace{ERROR: !t float not successful (addtodblcol)}%
3486 \fl@trace{put on deferlist}%
3488 \@cons\@deferlist\@currbox
3490 \fl@trace{(dbl)deferlist: \@deferlist: (after)}%
3494 \fl@trace{End of addtodblcol -- locally count:}%
3495 \fl@trace{ dbltop: \the \@dbltopnum.}%
3499 \fl@trace{End of addtodblcol -- globally count:}%
3500 \fl@trace{dbltop: \the \@dbltopnum.}%
3503 %</2ekernel|latexrelease|fltrace>
3504 %<latexrelease|fltrace>\EndIncludeInRelease
3505 %<latexrelease|fltrace>\IncludeInRelease{0000/00/00}%
3506 %<latexrelease|fltrace> {\@addtodblcol}{float order in 2-column}%
3507 %<latexrelease|fltrace>\def\@addtodblcol{%
3508 %<latexrelease|fltrace> \begingroup
3510 %<latexrelease|fltrace> \fl@trace{***Start addtodblcol}%
3512 %<latexrelease|fltrace> \@insertfalse
3513 %<latexrelease|fltrace> \@setfloattypecounts
3514 %<latexrelease|fltrace> \@getfpsbit \tw@
3516 %<latexrelease|fltrace> \fl@trace{fpstype \ifodd \@tempcnta OK
3517 %<latexrelease|fltrace> \else not \fi dbltop: \the \@fpstype}%
3519 %<latexrelease|fltrace> \ifodd\@tempcnta
3520 %<latexrelease|fltrace> \@flsetnum \@dbltopnum
3521 %<latexrelease|fltrace> \ifnum \@dbltopnum>\z@
3522 %<latexrelease|fltrace> \@tempswafalse
3523 %<latexrelease|fltrace> \ifdim \@dbltoproom>\ht\@currbox
3524 %<latexrelease|fltrace> \@tempswatrue
3526 %<latexrelease|fltrace> \fl@trace{Space OK: \@dbltoproom =
3527 %<latexrelease|fltrace> \the \@dbltoproom > \the \ht \@currbox
3528 %<latexrelease|fltrace> (dbltoproom)}%
3530 %<latexrelease|fltrace> \else
3532 %<latexrelease|fltrace> \fl@trace{fpstype: \the \@fpstype (addtodblcol)}%
3534 %<latexrelease|fltrace> \ifnum \@fpstype<\sixt@@n
3536 %<latexrelease|fltrace> \fl@trace{BANG float ignoring \@dbltoproom}%
3537 %<latexrelease|fltrace> \fl@trace{\@spaces \@dbltoproom =
3538 %<latexrelease|fltrace> \the \@dbltoproom.
3539 %<latexrelease|fltrace> Ht float: \the \ht \@currbox-BANG}%
3542 % Need to check that there is room on the page, using the local value
3543 % of |\@textmin| to make the necessary adjustment to |\@dbltoproom|.
3545 %<latexrelease|fltrace> \advance \@dbltoproom \@textmin
3547 %<latexrelease|fltrace> \fl@trace{Local value of texmin: \the\@textmin}%
3548 %<latexrelease|fltrace> \fl@trace{\@spaces space on page =
3549 %<latexrelease|fltrace> \the \@dbltoproom.
3550 %<latexrelease|fltrace> Ht float: \the \ht \@currbox-BANG}%
3552 %<latexrelease|fltrace> \ifdim \@dbltoproom>\ht\@currbox
3553 %<latexrelease|fltrace> \@tempswatrue
3555 %<latexrelease|fltrace> \fl@trace{Space OK BANG: space on page =
3556 %<latexrelease|fltrace> \the\@dbltoproom > \the\ht\@currbox}%
3557 %<latexrelease|fltrace> \else
3558 %<latexrelease|fltrace> \fl@trace{fpstype: \the \@fpstype}%
3559 %<latexrelease|fltrace> \fl@trace{Fail---no room dbltoproom-BANG?:}%
3560 %<latexrelease|fltrace> \fl@trace{\@spaces space on page =
3561 %<latexrelease|fltrace> \the \@dbltoproom.
3562 %<latexrelease|fltrace> Ht float: \the \ht \@currbox}%
3564 %<latexrelease|fltrace> \fi
3565 %<latexrelease|fltrace> \advance \@dbltoproom -\@textmin
3567 %<latexrelease|fltrace> \else
3568 %<latexrelease|fltrace> \fl@trace{fpstype: \the \@fpstype}%
3569 %<latexrelease|fltrace> \fl@trace{Fail---no room dbltoproom-ORD?:}%
3570 %<latexrelease|fltrace> \fl@trace{\@spaces \@dbltoproom =
3571 %<latexrelease|fltrace> \the \@dbltoproom.
3572 %<latexrelease|fltrace> Ht float: \the \ht \@currbox}%
3574 %<latexrelease|fltrace> \fi
3575 %<latexrelease|fltrace> \fi
3576 %<latexrelease|fltrace> \if@tempswa
3577 %<latexrelease|fltrace> \@bitor \@currtype \@dbldeferlist
3579 %<latexrelease|fltrace> \fl@trace{dbldeferlist:
3580 %<latexrelease|fltrace> \@dbldeferlist: (before)}%
3582 %<latexrelease|fltrace> \if@test
3584 %<latexrelease|fltrace> \fl@trace{type already on list: dbldefer}%
3586 %<latexrelease|fltrace> \else
3587 %<latexrelease|fltrace> \@tempdima -\ht\@currbox
3588 %<latexrelease|fltrace> \advance\@tempdima
3589 %<latexrelease|fltrace> -\ifx \@dbltoplist\@empty
3590 %<latexrelease|fltrace> \dbltextfloatsep
3591 %<latexrelease|fltrace> \else \dblfloatsep \fi
3592 %<latexrelease|fltrace> \global \advance \@dbltoproom \@tempdima
3593 %<latexrelease|fltrace> \global \advance \@colht \@tempdima
3594 %<latexrelease|fltrace> \global \advance \@dbltopnum \m@ne
3595 %<latexrelease|fltrace> \@cons \@dbltoplist \@currbox
3597 %<latexrelease|fltrace> \fl@trace{dbltopnum (after) =
3598 %<latexrelease|fltrace> \the \@dbltopnum}%
3599 %<latexrelease|fltrace> \fl@trace{***Success: dbltop}%
3601 %<latexrelease|fltrace> \@inserttrue
3602 %<latexrelease|fltrace> \fi
3603 %<latexrelease|fltrace> \fi
3605 %<latexrelease|fltrace> \else
3606 %<latexrelease|fltrace> \fl@trace{Fail: dbltopnum = \the \@dbltopnum:
3607 %<latexrelease|fltrace> fpstype \the \@fpstype=ORD?}%
3608 %<latexrelease|fltrace> \ifnum \@fpstype<\sixt@@n
3609 %<latexrelease|fltrace> \fl@trace{ERROR: !t float not successful
3610 %<latexrelease|fltrace> (addtodblcol)}%
3611 %<latexrelease|fltrace> \fi
3613 %<latexrelease|fltrace> \fi
3614 %<latexrelease|fltrace> \fi
3615 %<latexrelease|fltrace> \if@insert
3616 %<latexrelease|fltrace> \else
3618 %<latexrelease|fltrace> \fl@trace{put on dbldeferlist}%
3620 %<latexrelease|fltrace> \@cons\@dbldeferlist\@currbox
3622 %<latexrelease|fltrace> \fl@trace{dbldeferlist: \@dbldeferlist: (after)}%
3624 %<latexrelease|fltrace> \fi
3626 %<latexrelease|fltrace> \fl@trace{End of addtodblcol -- locally count:}%
3627 %<latexrelease|fltrace> \fl@trace{ dbltop: \the \@dbltopnum.}%
3629 %<latexrelease|fltrace> \endgroup
3631 %<latexrelease|fltrace> \fl@trace{End of addtodblcol -- globally count:}%
3632 %<latexrelease|fltrace> \fl@trace{dbltop: \the \@dbltopnum.}%
3634 %<latexrelease|fltrace>}%
3635 %<latexrelease|fltrace>\EndIncludeInRelease
3641 % \begin{macro}{\@addmarginpar}
3644 \def\@addmarginpar{\@next\@marbox\@currlist{\@cons\@freelist\@marbox
3645 \@cons\@freelist\@currbox}\@latexbug\@tempcnta\@ne
3647 \if@firstcolumn \@tempcnta\m@ne \fi
3650 \ifodd\c@page \else\@tempcnta\m@ne \fi
3652 \if@reversemargin \@tempcnta -\@tempcnta \fi
3654 \ifnum\@tempcnta <\z@ \global\setbox\@marbox\box\@currbox \fi
3655 \@tempdima\@mparbottom
3656 \advance\@tempdima -\@pageht
3657 \advance\@tempdima\ht\@marbox
3658 \ifdim\@tempdima >\z@
3659 \@latex@warning@no@line {Marginpar on page \thepage\space moved}%
3663 \global\@mparbottom\@pageht
3664 \global\advance\@mparbottom\@tempdima
3665 \global\advance\@mparbottom\dp\@marbox
3666 \global\advance\@mparbottom\marginparpush
3667 \advance\@tempdima -\ht\@marbox
3669 % Putting box movement inside the `marbox':
3671 \global\setbox \@marbox
3672 \vbox {\vskip \@tempdima
3674 \global \ht\@marbox \z@
3675 \global \dp\@marbox \z@
3677 % Sticking (rather than gluing:-) the `marbox' to the line above,
3678 % changed vskip to kern:
3683 {\ifnum \@tempcnta >\z@
3684 \hskip\columnwidth \hskip\marginparsep
3686 \hskip -\marginparsep \hskip -\marginparwidth
3690 % For this reason the following code can vanish:
3692 % \nobreak %% No longer needed. CAR92/12
3693 % \vskip -\@tempdima %% No longer needed. CAR92/12
3697 \hbox{\vrule \@height\z@ \@width\z@ \@depth\@pagedp}}
3701 % \subsubsection{Kludgeins}
3703 % This part of the file is part of the implementation of the following
3704 % two new commands for \LaTeX2e{}.
3708 % \enlargethispage{<dim>}
3711 % Adds |<dim>| to the height of the current column only. On the printed
3712 % page the bottom of this column is extended downwards by exactly
3713 % |<dim>| without having any effect on the placement of the footer; this
3714 % may result in an overprinting.
3717 % \enlargethispage*{<dim>}
3720 % Similar to |\enlargethispage| but it tries to squeeze the column to
3721 % be printed in as small a space as possible, ie it uses any
3722 % shrinkability in the column. If the column was not explicitly broken
3723 % (\eg with |\pagebreak|) this may result in an overfull box message but
3724 % execpt for this it will come out as expected (if you know what to
3727 % The star form of this command is dedicated to Leslie Lamport, the
3728 % other we need for ourselves (FMi, CAR).
3730 % These commands may well have unwanted effects if used soon
3731 % before a |\clearpage|: please give keep them clear of such places.
3733 % \begin{macro}{\@kludgeins}
3734 % \changes{v0.1c}{1993/11/23}{Insert added}
3735 % The insert which makes \TeX{} do a lot of the necessary work.
3736 % All we need to put into it is the amount by which the pagegoal
3737 % should be changed.
3739 \newinsert \@kludgeins
3740 \global\dimen\@kludgeins \maxdimen
3741 \global\count\@kludgeins 1000
3746 % \begin{macro}{\enlargethispage}
3747 % \begin{macro}{\enlargethispage*}
3748 % \changes{v0.1c}{1993/11/23}{Commands added}
3751 \gdef \enlargethispage {%
3755 \fl@trace{Enlarging page height * }%
3757 \@enlargepage{\hbox{\kern\p@}}}%
3760 \fl@trace{Enlarging page height exactly---}%
3762 \@enlargepage\@empty}%
3769 % \begin{macro}{\@enlargepage}
3770 % \changes{v0.1c}{1993/11/23}{Command added}
3771 % This actually inserts the insert, after checking for extreme
3772 % values of the change.
3774 \gdef\@enlargepage#1#2{%
3776 \fl@trace{\@spaces\@spaces by #2}%
3779 \ifdim \@tempskipa>.5\maxdimen
3780 \@latexerr{Suggested\space extra\space height\space
3781 (\the\@tempskipa)\space dangerously\space
3784 \ifdim \vsize<.5\maxdimen
3786 \fl@trace {Kludgeins added--pagegoal before: \the\pagegoal}%
3789 \insert\@kludgeins{#1\vskip-\@tempskipa}%
3792 % This next bit is for tracing only:
3796 \fl@trace {Kludgeins added--pagegoal after: \the \pagegoal}%
3800 \@latexerr{Page\space height\space already\space
3801 too\space large}\@eha
3809 % \subsubsection{Float control}
3811 % This part implements controllable floats and other changes
3812 % to the float mechanism.
3814 % It provides, at the document level, the following command for
3815 % inclusion in \LaTeX2e{}.
3821 % This suppresses all further floats on the current page.
3823 % With an optional argument it suppresses only floats only in certain
3824 % positions on the current page.
3826 % |[t]|\quad suppresses only floats at the top of the page
3827 % |[b]|\quad suppresses only floats at the bottom of the page
3830 % It also enables the use of an extra specifier, {\tt !}, in the
3831 % location optional argument of a float. If this is present then,
3832 % just for this particular float, whenever it is processed by the float
3833 % mechanism the followinhg are ignored:
3836 % \item all restrictions on the number of floats which can appear;
3837 % \item all explicit restrictions on the amount of space which should
3838 % (not) be occupied by floats and/or text.
3841 % The mechanism will still attempt to ensure that pages are not
3844 % These specifiers override, for the single float, the suppression
3845 % commands described above.
3848 % In its current form, it also supplies a reasonably exhaustive, and
3849 % somewhat baroque, means of tracing some aspects of the float
3853 % \begin{macro}{\fl@trace}
3854 % \begin{macro}{\tracefloatsoff}
3855 % \begin{macro}{\tracefloats}
3856 % \begin{macro}{\fl@traceval}
3857 % \begin{macro}{\tracefloatvals}
3858 % \begin{macro}{\fl@tracemessage}
3859 % \changes{v1.0c}{1993/11/30}{Commands added}
3860 % \changes{v1.0h}{1993/12/12}{Commands changed}
3861 % \changes{v1.0j}{1993/12/17}{tracefloatvals made a document command}
3862 % Set-up tracing for floats independent of other tracing as it
3863 % produces mega-output. Default is no tracing.
3864 % \changes{v1.1j}{1995/04/24}
3865 % {Do not add to kernel unless `trace' specified}
3866 % \changes{v1.2n}{2014/04/24}
3867 % {Renamed internal trace commands; provide as package}
3871 \def \fl@tracemessage #1{{\let\@elt\@empty\typeout{LaTeX2e: #1}}}
3872 \def \tracefloats{\let \fl@trace \fl@tracemessage}
3873 \def \tracefloatsoff {\let \fl@trace \@gobble}
3875 \def \fl@traceval #1{\fl@trace{\string #1 = \the #1}}
3876 \IncludeInRelease{2015/01/01}{\tracefloatvals}%
3878 \def \tracefloatvals{%
3880 % As |\@dblfloatplacement| sets |\f@depth| it needs to be run
3881 % inside a group, otherwise the float placement will test for the
3882 % wrong value.\footnote{This is a somewhat questionable design.}
3887 \fl@trace{***Float placement parameters:}%
3888 \fl@traceval\@colnum
3889 \fl@traceval\@colroom
3890 \fl@traceval\@topnum
3891 \fl@traceval\@toproom
3892 \fl@traceval\@botnum
3893 \fl@traceval\@botroom
3895 \fl@trace{\string\textfraction = \textfraction}%
3896 \fl@traceval\@dbltopnum
3897 \fl@traceval\@dbltoproom
3898 \fl@trace{\string\textfraction = \textfraction}%
3899 \fl@trace{toplist: \@toplist}%
3900 \fl@trace{botlist: \@botlist}%
3901 \fl@trace{midlist: \@midlist}%
3902 \fl@trace{deferlist: \@deferlist}%
3903 \fl@trace{dbltoplist: \@dbltoplist}%
3904 %FMi \fl@trace{dbldeferlist: \@dbldeferlist}%
3907 \EndIncludeInRelease
3908 \IncludeInRelease{0000/00/00}{\tracefloatvals}%
3910 \def \tracefloatvals{%
3914 \fl@trace{***Float placement parameters:}%
3915 \fl@traceval\@colnum
3916 \fl@traceval\@colroom
3917 \fl@traceval\@topnum
3918 \fl@traceval\@toproom
3919 \fl@traceval\@botnum
3920 \fl@traceval\@botroom
3922 \fl@trace{\string\textfraction = \textfraction}%
3923 \fl@traceval\@dbltopnum
3924 \fl@traceval\@dbltoproom
3925 \fl@trace{\string\textfraction = \textfraction}%
3926 \fl@trace{toplist: \@toplist}%
3927 \fl@trace{botlist: \@botlist}%
3928 \fl@trace{midlist: \@midlist}%
3929 \fl@trace{deferlist: \@deferlist}%
3930 \fl@trace{dbltoplist: \@dbltoplist}%
3931 % next line only in old releases
3932 \fl@trace{dbldeferlist: \@dbldeferlist}%
3935 \EndIncludeInRelease
3937 % We need to make sure that \texttt{fltrace} comes before
3938 % \texttt{flafter} to make the tracing work.
3940 \@ifpackageloaded{flafter}
3941 {\PackageWarningNoLine
3942 {fltrace}{Load 'fltrace' before 'flafter'\MessageBreak
3943 Attempting to recover by reloading 'flafter'}%
3945 % Hide the fact that \texttt{flafter} was already loaded and then
3947 % \changes{v1.2m}{2015/01/20}{Reset \cs{IncludeInRelease} flags}
3949 \expandafter\let\csname ver@flafter.sty\endcsname\relax
3951 \expandafter\let\csname\string#1+flafter+IIR\endcsname\relax}%
3952 \reserved@a\@addtocurcol
3953 \reserved@a\@addtonextcol
3954 \RequirePackage{flafter}}{}
3957 % As the code for \texttt{flafter} will contain tracing calls so
3958 % that it works in conjunction with \texttt{fltrace} we need to
3959 % provide a dummy definition for |\fl@trace| in that package.
3962 \providecommand\fl@trace[1]{}
3972 % \begin{macro}{\suppressfloats}
3973 % \begin{macro}{\@flstop}
3974 % \changes{v1.0f}{1993/12/05}{Commands added}
3975 % Float suppression commands: these set the relevant counter
3976 % globally to zero. Thus they are overridden for a particular float
3977 % by an ! specifier.
3981 \def \suppressfloats {%
3984 {\global \@colnum \z@}%
3987 % Maybe this should be a loop over |#1|?
3989 \def \@flstop [#1]{%
3991 \global \@topnum \z@
3994 \global \@botnum \z@
4002 % Manipulation of float placement and type; both their strings and the
4003 % corresponding count registers.
4005 % \begin{macro}{\@fpstype}
4006 % \begin{macro}{\@reqcolroom}
4007 % \begin{macro}{\@textfloatsheight}
4008 % \changes{v1.0f}{1993/12/05}{Commands added}
4009 % First a new count register to go with |\@currtype|.
4011 % Then a new skip register, for information needed to remove the
4012 % |\@maxsep| conservatism: it is possible that this could use a
4013 % temporary register.
4015 % Finally a dimension register to hold the total height of in-text
4016 % floats on the current page. This is needed to implement a
4017 % major change in the functionality of |\@addtocurcol| which is,
4018 % nevertheless, a bug fix.
4019 % It is not local and therefore cannot be a temporary register.
4023 \newdimen \@reqcolroom
4024 \newdimen \@textfloatsheight
4031 % \begin{macro}{\@fpsadddefault}
4032 % \changes{v1.0f}{1993/12/05}{Command added}
4033 % Adds the default placement to what is already there.
4035 % Should not need to change this, but could do it as follows:
4037 %\def \@fpsadddefault {%
4038 % \@temptokena \expandafter\expandafter\expandafter
4039 % {\csname fps@\@captype \endcsname}%
4040 % \edef \reserved@a {\the\@temptokena}%
4041 % \@onelevel@sanitize \reserved@a
4042 % \edef \@fps {\@fps\reserved@a}%
4047 %<*2ekernel|fltrace>
4048 \def \@fpsadddefault {%
4050 \fl@trace{fps changed from: \@fps}%
4052 \edef \@fps {\@fps\csname fps@\@captype \endcsname}%
4054 No positions in optional float specifier.\MessageBreak
4055 Default added (so using `\@fps')}%
4060 % \begin{macro}{\@setfloattypecounts}
4061 % \changes{v1.0f}{1993/12/05}{Command added}
4062 % Sets counters |\@fpstype| and |\@currtype|.
4064 % BANG $==$ bit4 of $|\count\@currbox| = 0$.
4067 \def \@setfloattypecounts {%
4068 \@currtype \count\@currbox
4069 \@fpstype \count\@currbox
4070 \divide\@currtype\@xxxii \multiply\@currtype\@xxxii
4071 \advance \@fpstype -\@currtype
4073 \fl@trace{(mod 32) fpstype: \the \@fpstype}%
4074 \fl@trace{(mult of 32) currtype: \the \@currtype}%
4075 % Tracing only: but some should be changed into real errors/warnings?
4076 \ifnum \@fpstype<\sixt@@n
4077 \ifnum \@fpstype=\z@
4078 \fl@trace{ERROR: no PLACEMENT, fpstype = \the \@fpstype = 0?}%
4080 \ifnum \@fpstype=\@ne
4081 \fl@trace{WARNING: only h, fpstype = \the \@fpstype = 1?}%
4083 \fl@trace{BANG float}%
4085 \ifnum \@fpstype=\sixt@@n
4086 \fl@trace{ERROR: no PLACEMENT, fpstype = \the \@fpstype = 16?}%
4089 \fl@trace{WARNING: only h, fpstype = \the \@fpstype = 17?}%
4091 \fl@trace{ORD float}%
4095 %</2ekernel|fltrace>
4099 % Macros for getting, testing and setting bits of the fps.
4102 % \begin{macro}{\@getfpsbit}
4103 % \changes{v1.0f}{1993/12/05}{Command added}
4104 % Sets |\@tempcnta| to required bit of |\count\@currbox|.
4109 \@boxfpsbit \@currbox
4115 % \begin{macro}{\@boxfpsbit}
4116 % \changes{v1.0f}{1993/12/05}{Command added}
4119 \def \@boxfpsbit #1#2{%
4120 \@tempcnta \count#1%
4121 \divide \@tempcnta #2\relax
4126 % \begin{macro}{\@testfp}
4127 % \changes{v1.0f}{1993/12/05}{Command added}
4128 % New definition of the float page test.
4130 % \changes{v1.1v}{1996/07/26}{remove \cs{global} before \cs{@test...}}
4133 \@boxfpsbit #18\relax % Really `#1 8' for human readers!
4143 % \begin{macro}{\@setfpsbit}
4144 % \changes{v1.0f}{1993/12/05}{Command added}
4145 % Sets required bit of |\@tempcnta| (to 1).
4148 \def \@setfpsbit #1{%
4149 \@tempcntb \@tempcnta
4150 \divide \@tempcntb #1\relax
4153 \advance \@tempcnta #1\relax
4161 % \begin{macro}{\@resethfps}
4162 % \changes{v1.0f}{1993/12/05}{Command added}
4163 % \changes{v1.0h}{1993/12/12}{Warnings added: minimal}
4164 % \changes{v1.0m}{1994/04/24}{Warning changed}
4165 % \changes{v1.0m}{1994/04/24}{Number 2 changed to \cs{tw@}}
4166 % \changes{v1.0o}{1994/05/02}{Code shortened}
4167 % Globally adds t as a possible location for an h or !h only placement:
4168 % this must be done using the count.
4170 % Although it will leave |\@fpstype| set to 17 even if it was
4171 % originally 1, this does not matter since it is the last thing in
4174 %<*2ekernel|fltrace>
4176 \let\reserved@a\@empty
4177 \ifnum \@fpstype=\@ne
4178 \def \reserved@a {!}%
4182 \global \advance \count\@currbox \tw@
4183 \@latex@warning@no@line {%
4184 `\reserved@a h' float specifier changed to `\reserved@a ht'}%
4187 `t' added to `\reserved@a h'- new Count: \the \count\@currbox}%
4195 % Special stuff for BANG floats.
4197 % \begin{macro}{\@flsetnum}
4198 % \changes{v1.0f}{1993/12/05}{Command added}
4200 % Ignores any zero float counter value in case BANG.
4202 % It uses a local assignment to the normally global counter: a bit
4205 % These assignments are safe so long as the counter involved is only
4206 % consulted once (\ie only for the `bang float') with the changed value.
4207 % This is the case within |\@addtocurcol| because it is used only
4208 % once within a call of the output routine (which forms a group).
4210 % For |\@addtonextcol| this is achieved by putting a group around its
4211 % code; this is needed because it is called (by |\@startcolumn|) for
4212 % each float which was on the deferlist. Almost identical
4213 % considerations pertain to |\@addtodblcol|. There may be more
4214 % efficient ways to handle this, but the group seems to be the simplest.
4216 % \changes{v1.0n}{1994/04/30}{Rogue space removed}
4218 \def \@flsetnum #1{%
4220 \fl@trace{fpstype: \the \@fpstype (flsetnum \string#1)}%
4222 \ifnum \@fpstype<\sixt@@n
4225 \fl@trace{BANG float resetting \string#1 to 1}%
4231 \fl@trace{#1 (before) = \the #1}%
4238 % \begin{macro}{\@flsettextmin}
4239 % \changes{v1.0f}{1993/12/05}{Command added}
4240 % This ignores |\textfraction| space restriction in case BANG.
4243 \def \@flsettextmin {%
4245 \fl@trace{fpstype: \the \@fpstype (flsettextmin)}%
4247 \ifnum \@fpstype<\sixt@@n
4249 \fl@trace{BANG ignoring textmin}%
4253 \@textmin \textfraction\@colht
4255 \fl@trace{ORD textmin = \the \@textmin}%
4263 % \begin{macro}{\@flcheckspace}
4264 % \changes{v1.0f}{1993/12/05}{Command added}
4265 % This ignores space restriction in case BANG; this is still slightly
4266 % conservative since it does not allow for the fact that, if there is
4267 % no text in the column then |\textfloatsep| is not needed.
4268 % Sets |@tempswa| true if there is room for |\@currbox|.
4271 \def \@flcheckspace #1#2{%
4272 \advance \@reqcolroom
4273 \ifx #2\@empty \textfloatsep \else \floatsep \fi
4275 \fl@trace{colroom = \the \@colroom
4276 (flcheckspace \string#1 \string#2)}%
4277 \fl@trace{reqcolroom = \the \@reqcolroom
4278 (flcheckspace \string#1 \string#2)}%
4280 \ifdim \@colroom>\@reqcolroom
4281 \ifdim #1>\ht\@currbox
4284 \fl@trace{Space OK: #1 = \the #1 > \the \ht \@currbox
4285 (flcheckspace \string#1 \string#2)}%
4289 \fl@trace{fpstype: \the \@fpstype
4290 (flcheckspace \string#1 \string#2)}%
4292 \ifnum \@fpstype<\sixt@@n
4294 \fl@trace{BANG float ignoring #1
4295 (flcheckspace \string#1 \string#2):}%
4296 \fl@trace{\@spaces #1 = \the #1. Ht float: \the \ht \@currbox
4302 \fl@trace{Fail---no room (flcheckspace \string#1 \string#2)
4303 (fpstype \the \@fpstype=ORD?):}%
4304 \fl@trace{\@spaces #1 = \the #1. Ht float: \the \ht \@currbox
4311 \fl@trace{Fail---no room at 2nd test of colroom
4312 (flcheckspace \string#1 \string#2)}%
4316 %</2ekernel|fltrace>
4321 % \begin{macro}{\@flupdates}
4322 % \changes{v1.0f}{1993/12/05}{Command added}
4323 % This updates everything when a float is placed.
4327 \def \@flupdates #1#2#3{%
4328 \global \advance #1\m@ne
4329 \global \advance \@colnum \m@ne
4330 \@tempdima -\ht\@currbox
4332 -\ifx #3\@empty \textfloatsep \else \floatsep \fi
4333 \global \advance #2\@tempdima
4334 \global \advance \@colroom \@tempdima
4342 % Interesting facts about float mechanisms past and present, together
4343 % with a summary of various features, some unresolved:
4346 % \item The value |\textfraction| does not affect the processing
4347 % of doublecol floats: this seems sensible, but should be
4349 % \item |\twocolumn| floatplacement was wrong: dbl not needed, ord
4351 % \item |\@floatplacement| was not called after |\@startdblcol|
4352 % or |\@topnewpage|. This has been changed; it is clearly a bug
4354 % \item The use |\@topnewpage| when |\dblfigrule| is non-trivial
4355 % produced a rule in the wrong place. This has been fixed by not
4356 % using |\dblfigrule| when processing the `float' from
4358 % \item If the specifier was just h and the float could not be put
4359 % here, it went on the deferlist and stayed there until a clearpage.
4360 % It now gets changed to a `th': this is only an error-recovery
4361 % action, putting just h or !h should be deprecated.
4362 % \item |\@dblmaxsep| was `the maximum of |\dblfloatsep| and
4363 % |\dbltexfloatsep|'. But it was never used! Now gone completely,
4365 % \item After an h float is put on a page, it was counted as text when
4366 % applying the |\textfraction| test; this is possibly too big a
4367 % change although it is a bug fix?
4368 % \item Two consecutive h floats are separated by twice |\intextsep|:
4369 % this could be changed to one by use of |\addvspace|, OK?
4370 % Note that it would also mean that less space is put in if an h
4371 % float immediately follows other spaces. This is also possibly
4372 % too big a change, at least for compatibility mode?
4373 % Or it may be simply wrong! It has not been changed.
4374 % \item Now |\@addtocurcol| checks first for just p fps. I think
4375 % that this is an increase in efficiency, but maybe the coding
4376 % should be made even more efficient.
4377 % \item |\@tryfcolumn| now tests if the list is empty first, otherwise
4378 % lots of wasted time! Thus this test has been removed from
4380 % As Frank pointed out, this makes |\@startcolumn| less
4381 % efficient. But it is now the same as |\@startdblcolumn|: I can
4382 % see no reason why they should be different, but which is best?
4383 % \item Why is |\@colroom| set in |\@doclearpage|?
4384 % \item Footnotes. Check what |\clearpage| does when footnotes are
4385 % left over. Footnotes are not put on float pages and, also,
4386 % |\@addtonextcol| ignores the existence of held-over footnotes
4387 % in deciding what floats can go on the page. Not changed.
4388 % \item |\clearpage| can still lose non-boxes, at least when floats
4389 % are involved. It also moves some to the `wrong page', but this
4390 % may be a coding problem.
4391 % \item The ! option makes it necessary to check in |\output| that
4392 % there is enough room left on the page after adding a float. (This
4393 % would have been necessary anyway if anyone set |\@textmin| too
4394 % close to zero! A similar danger existed also if the text in a
4395 % |\twocolumn[text]| entity gets too large.)
4396 % The current implementation of this also makes the normal case a
4397 % little less efficient, OK?
4398 % Not enough room means, at present, less than |\baselineskip|,
4399 % with a warning: is this OK? Should it be made generic (another
4401 % \item There are four possibilities for supporting this:
4403 % |\twocolumn[\maketitle more text]|
4406 % |\maketitle| slightly to allow this. Another is to change
4407 % |\@topnewpage| so that more than one |\twocolumn[]| command is
4408 % allowed; in this case |\maketitle\twocolumn[more text]| will work.
4409 % The former is more robust from the user's viewpoint, but makes the
4410 % code for |\maketitle| rather ad hoc (maybe it is already?).
4411 % Another is to misuse the global twocolumn flag locally within
4413 % Yet another is to move the column count register from the multicol
4414 % package into the kernel. This has been done.
4415 % \item Where should the reinserts be put to maximise the
4416 % probability that footmotes come out on the correct page?
4417 % Or should we go for as much compatibility as possible (but see
4419 % \item Should we continue to support (as much as possible)
4420 % |\samepage|? Some of its intended functionality is now advertised
4421 % as being provided by |\enlargethispage|. Use of either is likely
4422 % to result in wrongly placed footnotes, marginals, etc.
4423 % Which should have priority: obeying the pagination instructions,
4424 % or correct placement of notes/marginalia?
4425 % \item Is the adjustment of space to cause shrinking in the
4426 % kludge-* case correct? Should it be limited to 0pt?
4427 % \item Is the setting of |\boxmaxdepth| in makecol and friends
4428 % needed? It only has any effect if |\@textbottom| ends with a box
4429 % or rule, in which case the vskip to allow for its depth should
4430 % also be added. If it is kept, it should probably be the last
4431 % thing in the box. It has now been removed.
4433 % It would perhaps be better to document that |\@textbottom|
4434 % and |\@texttop| must have natural height 0pt.
4435 % \item I cannot see why the vskip adjustment for the depth
4436 % is needed if boxmaxdepth is used to ensure that there is never
4438 % \item The value of |\boxmaxdepth| should be explicitly set
4439 % whenever necessary: it is too risky to assume that it has any
4440 % particular value. Care is needed in deciding what to set it to.
4442 % It is interesting to note that the value of |\boxmaxdepth| is
4443 % unique in being read before the local settings for the box group
4444 % are reset; all other parameter settings which affect the box
4445 % construction use their values outside the box group.
4446 % \item Should |\@maxdepth| store the setting of |\maxdepth| from
4447 % lplain? Or should we provide a proper interface to class files
4448 % for setting these?
4451 % An analysis of various other macros.
4453 % |\@opcol| should do |\@floatplacement|, but where? Right at the
4454 % end, since it always occurs at the start of a column.
4457 % % Why is this done first?
4458 % \global \@mparbottom \z@
4463 % % This is not needed since it is done at the end of
4465 % \global \@colht \textheight
4469 % Only tracing has been added to these.
4472 %<*2ekernel|fltrace>
4473 \def\@makefcolumn #1{%
4476 \let \@testfp \@gobble
4481 \fl@trace{PAGE: in \string\clearpage
4482 \if@twocolumn ---twocolumn\fi---}%
4483 \fl@trace{----- float column/page completed from \string#1}%
4488 % This will line up the last baselines in the two
4489 % columns provided they are constructed in the normal way: \ie ending
4490 % in a skip of minus the original depth, with |\@textbottom| adding
4493 % Thus again it is essential for |\@textbottom| to have depth 0pt.
4494 % \changes{1.2g}{2000/07/12}{Ensure that rule is in \cs{normalcolor}}
4495 % \changes{v1.2m}{2014/12/30}{Command updated (latexrelease)}
4497 %</2ekernel|fltrace>
4498 %<latexrelease|fltrace>\IncludeInRelease{2015/01/01}%
4499 %<latexrelease|fltrace> {\@outputdblcol}{2 column marks}%
4500 %<*2ekernel|fltrace|latexrelease>
4504 % This is just a change to the single command |\@outputdblcol|
4505 % so that it saves mark information for the first column and restores
4506 % it in the second column.
4508 \def\@outputdblcol{%
4510 \global\@firstcolumnfalse
4512 % Save the left column
4514 \global\setbox\@leftcolumn\copy\@outputbox
4515 %<fltrace> \fl@trace{PAGE: first column boxed}%
4518 % Remember the marks from the first column
4520 \splitmaxdepth\maxdimen
4523 % In case of |\enlargethispage| we will have infinite negative glue
4524 % at the bottom of the page (coming from |\vss|) and that will earn
4525 % us an error message if we |\vsplit| to get at the marks. So we
4526 % need to remove thek last glue (if any) at the end of |\@outputbox|
4527 % as we are only interested in marks that change doesn't matter.
4528 % \changes{v1.1o}{2014/04/18}{Handle infinite glue from
4529 % \cs{enlargethispage} (pr/4023)}
4531 \setbox\@outputbox\vbox{\unvbox\@outputbox\unskip}%
4532 \setbox\@outputbox\vsplit\@outputbox to\maxdimen
4535 % One minor difference from the current |fixmarks| package, pass the
4536 % marks through a token register to stop any |#| tokens causing an
4537 % error in a |\def|.
4539 \toks@\expandafter{\topmark}%
4540 \xdef\@firstcoltopmark{\the\toks@}%
4541 \toks@\expandafter{\splitfirstmark}%
4542 \xdef\@firstcolfirstmark{\the\toks@}%
4545 % This test does not work if truly empty marks have been inserted, but
4546 % \LaTeX\ marks should always have (at least) two brace groups.
4547 % (Except before the first mark is used, when the marks are empty,
4548 % but that is OK here.)
4550 \ifx\@firstcolfirstmark\@empty
4551 \global\let\@setmarks\relax
4554 \let\firstmark\@firstcolfirstmark
4555 \let\topmark\@firstcoltopmark}%
4562 \global\@firstcolumntrue
4563 \setbox\@outputbox\vbox{%
4565 \hb@xt@\columnwidth{\box\@leftcolumn \hss}%
4568 % \changes{v1.1m}{2006/09/13}{Ensure that rule is in \cs{normalcolor}}
4569 % The color of the \cs{vrule} should be \cs{normalcolor} as to not
4570 % inherit the color from the column.
4572 {\normalcolor\vrule \@width\columnseprule}%
4574 \hb@xt@\columnwidth{\box\@outputbox \hss}}}%
4575 %<fltrace> \fl@trace{PAGE: second column also boxed}%
4578 % Override current first and top with those of first column if necessary
4585 %<fltrace> \fl@trace{PAGE: two column page completed}%
4589 \@whilesw\if@fcolmade \fi{\@outputpage
4590 %<fltrace> \fl@trace{PAGE: double float page completed}%
4597 %<latexrelease|fltrace>\EndIncludeInRelease
4598 %<latexrelease|fltrace>\IncludeInRelease{0000/00/00}%
4599 %<latexrelease|fltrace> {\@outputdblcol}{2 column marks}%
4600 %<latexrelease|fltrace>\def\@outputdblcol{%
4601 %<latexrelease|fltrace> \if@firstcolumn
4602 %<latexrelease|fltrace> \global \@firstcolumnfalse
4603 %<latexrelease|fltrace> \global \setbox\@leftcolumn \box\@outputbox
4605 %<latexrelease|fltrace> \fl@trace{PAGE: first column boxed}%
4607 %<latexrelease|fltrace> \else
4608 %<latexrelease|fltrace> \global \@firstcolumntrue
4609 %<latexrelease|fltrace> \setbox\@outputbox \vbox {%
4610 %<latexrelease|fltrace> \hb@xt@\textwidth {%
4611 %<latexrelease|fltrace> \hb@xt@\columnwidth {%
4612 %<latexrelease|fltrace> \box\@leftcolumn \hss}%
4613 %<latexrelease|fltrace> \hfil
4614 %<latexrelease|fltrace> {\normalcolor\vrule
4615 %<latexrelease|fltrace> \@width\columnseprule}%
4616 %<latexrelease|fltrace> \hfil
4617 %<latexrelease|fltrace> \hb@xt@\columnwidth {%
4618 %<latexrelease|fltrace> \box\@outputbox \hss}%
4619 %<latexrelease|fltrace> }%
4620 %<latexrelease|fltrace> }%
4622 %<latexrelease|fltrace> \fl@trace{PAGE: second column also boxed}%
4624 %<latexrelease|fltrace> \@combinedblfloats
4625 %<latexrelease|fltrace> \@outputpage
4627 %<latexrelease|fltrace> \fl@trace{PAGE: two column page completed}%
4629 %<latexrelease|fltrace> \begingroup
4630 %<latexrelease|fltrace> \@dblfloatplacement
4631 %<latexrelease|fltrace> \@startdblcolumn
4633 % This loop could be replaced by an |\expandafter| tail
4634 % recursion in\\ |\@startdblcolumn|.
4636 %<latexrelease|fltrace> \@whilesw\if@fcolmade \fi
4637 %<latexrelease|fltrace> {\@outputpage
4639 %<latexrelease|fltrace> \fl@trace{PAGE: double float page completed}%
4641 %<latexrelease|fltrace> \@startdblcolumn}%
4642 %<latexrelease|fltrace> \endgroup
4643 %<latexrelease|fltrace> \fi
4644 %<latexrelease|fltrace>}%
4645 %<latexrelease|fltrace>\EndIncludeInRelease
4646 %</2ekernel|fltrace|latexrelease>
4649 % \subsubsection{Float placement parameters}
4650 % \changes{v1.0i}{1993/12/14}{Section added to declare all parameters}
4652 % The main purpose of this section is to ensure that all the
4653 % float-placement parameters which need to be set in a class file or
4654 % package have been declared. It also describes their use and sets
4655 % values for them which are reasonable for typical documents using
4656 % US letter or A4 sized paper.
4658 % \paragraph{Limits for the placement of floating objects}
4660 % \begin{macro}{\c@topnumber}
4661 % This counter holds the maximum number of
4662 % floats that can appear at the top of a text page or column.
4665 \newcount\c@topnumber
4666 \setcounter{topnumber}{2}
4670 % \begin{macro}{\topfraction}
4671 % This macro holds the maximum proportion (as a decimal number) of
4672 % a text page or column that can be occupied by floats at the top.
4674 \newcommand\topfraction{.7}
4678 % \begin{macro}{\c@bottomnumber}
4679 % This counter holds the maximum number of
4680 % floats that can appear at the bottom of a text page or column.
4682 \newcount\c@bottomnumber
4683 \setcounter{bottomnumber}{1}
4687 % \begin{macro}{\bottomfraction}
4688 % This macro holds the maximum proportion (as a decimal number) of
4689 % a text page or column that can be occupied by floats at the bottom.
4691 \newcommand\bottomfraction{.3}
4695 % \begin{macro}{\c@totalnumber}
4696 % This counter holds the maximum number of floats that can appear on
4697 % any text page or column.
4699 \newcount\c@totalnumber
4700 \setcounter{totalnumber}{3}
4704 % \begin{macro}{\textfraction}
4705 % This macro holds the minimum proportion (as a decimal number) of
4706 % a text page or column that must be occupied by text.
4708 \newcommand\textfraction{.2}
4712 % \begin{macro}{\floatpagefraction}
4713 % This macro holds the minimum proportion (as a decimal number) of
4714 % a page or column that must be occupied by floating objects before a
4715 % `float page' is produced.
4717 \newcommand\floatpagefraction{.5}
4721 % \begin{macro}{\c@dbltopnumber}
4722 % This counter holds the maximum number of double-column floats that
4723 % can appear on the top of a two-column text page.
4725 \newcount\c@dbltopnumber
4726 \setcounter{dbltopnumber}{2}
4730 % \begin{macro}{\dbltopfraction}
4731 % This macro holds the maximum proportion (as a decimal number) of
4732 % a two-column text page that can be occupied by double-column floats
4735 \newcommand\dbltopfraction{.7}
4739 % \begin{macro}{\dblfloatpagefraction}
4740 % This macro holds the minimum proportion (as a decimal number) of
4741 % a page that must be occupied by double-column floating objects
4742 % before a `double-column float page' is produced.
4744 \newcommand\dblfloatpagefraction{.5}
4748 % \paragraph{Floats on a text page}
4750 % \begin{macro}{\floatsep}
4751 % \begin{macro}{\textfloatsep}
4752 % \begin{macro}{\intextsep}
4753 % When a floating object is placed on a page with text, these
4754 % parameters control the separation between the float and the other
4755 % objects on the page. These parameters are used for both
4756 % one-column mode and single-column floats in two-column mode.
4757 % They are all rubber lengths.
4759 % |\floatsep| is the space between adjacent floats that are placed
4760 % at the top or bottom of the text page or column.
4762 % |\textfloatsep| is the space between the main text and floats
4763 % at the top or bottom of the page or column.
4765 % |\intextsep| is the space between in-text floats and the text.
4768 \newskip\textfloatsep
4770 \setlength\floatsep {12\p@ \@plus 2\p@ \@minus 2\p@}
4771 \setlength\textfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@}
4772 \setlength\intextsep {12\p@ \@plus 2\p@ \@minus 2\p@}
4778 % \begin{macro}{\dblfloatsep}
4779 % \begin{macro}{\dbltextfloatsep}
4780 % When double-column floats (floating objects that span the whole
4781 % |\textwidth|) are placed at the top of a text page in two-column
4782 % mode, the separation between the float and the text is controlled
4783 % by |\dblfloatsep| and |\dbltextfloatsep|. They are rubber lengths.
4785 % |\dblfloatsep| is the space between adjacent double-column floats
4786 % placed at the top of the text page.
4788 % |\dbltextfloatsep| is the space between the main text and
4789 % double-column floats at the top of the page.
4791 \newskip\dblfloatsep
4792 \newskip\dbltextfloatsep
4793 \setlength\dblfloatsep {12\p@ \@plus 2\p@ \@minus 2\p@}
4794 \setlength\dbltextfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@}
4799 % \paragraph{Floats on their own page or column}
4801 % \begin{macro}{\@fptop}
4802 % \begin{macro}{\@fpsep}
4803 % \begin{macro}{\@fpbot}
4804 % When floating objects are placed on a separate page or column,
4805 % called a `float page', the layout of the page is controlled by
4806 % these parameters, which are rubber lengths.
4808 % At the top of the page |\@fptop| is inserted;
4809 % typically this supplies some stretchable whitespace.
4810 % At the bottom of the page |\@fpbot| ais inserted.
4811 % Between adjacent floats |\@fpsep| is inserted.
4813 % These parameters are used for all floating objects on a
4814 % `float page' in one-column mode, and for single-column
4815 % floats in two-column mode.
4817 % Note that at least one of the two parameters |\@fptop| and
4818 % |\@fpbot| should contain a |plus ...fil| so as to fill the
4819 % remaining empty space.
4824 \setlength\@fptop{0\p@ \@plus 1fil}
4825 \setlength\@fpsep{8\p@ \@plus 2fil}
4826 \setlength\@fpbot{0\p@ \@plus 1fil}
4832 % \begin{macro}{\@dblfptop}
4833 % \begin{macro}{\@dblfpsep}
4834 % \begin{macro}{\@dblfpbot}
4835 % Double-column `float pages' in two-column mode use similar
4841 \setlength\@dblfptop{0\p@ \@plus 1fil}
4842 \setlength\@dblfpsep{8\p@ \@plus 2fil}
4843 \setlength\@dblfpbot{0\p@ \@plus 1fil}
4849 % \begin{macro}{\topfigrule}
4850 % \begin{macro}{\botfigrule}
4851 % \begin{macro}{\dblfigrule}
4852 % The macros can be used to put in rules between floats and text;
4853 % whatever they insert should be vertical mode material which takes
4855 % \task{CAR}{Add more rules (for Frank in addtocurcol)}
4857 \let\topfigrule=\relax
4858 \let\botfigrule=\relax
4859 \let\dblfigrule=\relax