Debian Codegraph @

texmf-dist/tex/latex-dev/tools/afterpage.sty

raw
1 %%
2 %% This is file `afterpage.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% afterpage.dtx (with options: `package')
8 %%
9 %% This is a generated file.
10 %%
11 %% The source is maintained by the LaTeX Project team and bug
12 %% reports for it can be opened at https://latex-project.org/bugs/
13 %% (but please observe conditions on bug reports sent to that address!)
14 %%
15 %% Copyright (C) 1993-2026
16 %% The LaTeX Project and any individual authors listed elsewhere
17 %% in this file.
18 %%
19 %% This file was generated from file(s) of the Standard LaTeX `Tools Bundle'.
20 %% --------------------------------------------------------------------------
21 %%
22 %% It may be distributed and/or modified under the
23 %% conditions of the LaTeX Project Public License, either version 1.3c
24 %% of this license or (at your option) any later version.
25 %% The latest version of this license is in
26 %% https://www.latex-project.org/lppl.txt
27 %% and version 1.3c or later is part of all distributions of LaTeX
28 %% version 2005/12/01 or later.
29 %%
30 %% This file may only be distributed together with a copy of the LaTeX
31 %% `Tools Bundle'. You may however distribute the LaTeX `Tools Bundle'
32 %% without such generated files.
33 %%
34 %% The list of all files belonging to the LaTeX `Tools Bundle' is
35 %% given in the file `manifest.txt'.
36 %%
37 %% File: afterpage.dtx Copyright (C) 1994 1994 1995 David Carlisle
38 \NeedsTeXFormat{LaTeX2e}
39 \ProvidesPackage{afterpage}
40 [2023/07/04 v1.08 After-Page Package (DPC)]
41 \newtoks\AP@output
42 \global\AP@output\expandafter{\the\output}
43 \newbox\AP@partial
44 \newbox\AP@footins
45 \def\AP@savetop{%
46 \ifvmode
47 \let\AP@noindent\empty
48 \else\ifhmode
49 \setbox\z@\lastbox
50 \edef\AP@noindent
51 {{\everypar{}\ifvoid\z@\noindent\else\indent\fi}}%
52 \par
53 \else
54 \abovedisplayshortskip\z@\abovedisplayskip\z@
55 \belowdisplayshortskip\z@\belowdisplayskip\z@
56 \xdef\AP@disp{%
57 \predisplaysize\the\predisplaysize
58 \prevgraf\the\prevgraf\relax}%
59 $$\vskip-\baselineskip\vskip-\parskip
60 \edef\AP@noindent{%
61 \toks@{\the\everydisplay}\everydisplay{}%
62 {\everypar{}\noindent}$$\AP@disp\aftergroup\noexpand\AP@ed}%
63 \fi\fi
64 \begingroup
65 \nointerlineskip\null
66 \output{%
67 \global\setbox\AP@partial\vbox{%
68 \unvbox\@cclv
69 \global\setbox\@ne\lastbox}%
70 \global\setbox\AP@footins\box\footins}%
71 \eject
72 \endgroup}
73 \let\AP@\relax
74 \def\AP@ed{\everydisplay\expandafter{\the\toks@}\ignorespaces}
75 \def\AP@@{%
76 \AP@savetop
77 \global\expandafter\let\expandafter\AP@\expandafter\relax\AP@
78 \par
79 \addboxcontents\AP@partial
80 \ifvoid\AP@footins\else
81 \insert\footins{\unvbox\AP@footins}\fi
82 \AP@noindent}
83 \long\def\afterpage#1{%
84 \ifx\AP@\relax
85 \gdef\AP@{{#1\par}}%
86 \global\output{%
87 \the\AP@output
88 \ifnum\outputpenalty>-\@Mi
89 \global\output\expandafter{\the\AP@output}%
90 \aftergroup\AP@@
91 \fi}%
92 \else
93 \expandafter\gdef\expandafter\AP@\expandafter{\AP@{#1\par}}%
94 \fi}
95 \let\AP@clearpage\clearpage
96 \def\clearpage{%
97 \ifx\AP@\relax
98 \AP@clearpage
99 \else
100 \global\output\expandafter{\the\AP@output}%
101 \AP@clearpage
102 \global\expandafter\let\expandafter\AP@\expandafter\relax
103 \expandafter\expandafter\AP@
104 \fi}
105 \let\AP@enddocument\enddocument
106 \def\enddocument{%
107 \ifx\AP@\relax\else
108 \global\output\expandafter{\the\AP@output}%
109 \AP@clearpage
110 \global\expandafter\let\expandafter\AP@\expandafter\relax
111 \expandafter\expandafter\AP@
112 \fi
113 \AP@enddocument}
114
115 \def\addboxcontents#1{{%
116 \splittopskip\z@
117 \splitmaxdepth\maxdimen
118 \setbox#1\vbox{\break\unvbox#1}%
119 \setbox\z@\vsplit#1to\z@
120 \setbox#1\vbox{\break\unvbox#1}%
121 \skip@\ht#1%
122 \splittopskip\vsize
123 \setbox\z@\vsplit#1to\z@
124 \advance\skip@-\ht#1%
125 \skip\tw@\skip@
126 \advance\skip@\splittopskip
127 \advance\skip@\prevdepth
128 \advance\skip@-\baselineskip
129 \advance\skip\tw@\ifdim-\skip@<\lineskiplimit\lineskip\else-\skip@\fi
130 \vskip\skip\tw@
131 \global\dimen@i\dp#1%
132 \unvbox#1}%
133 \prevdepth\dimen@i}
134 \endinput
135 %%
136 %% End of file `afterpage.sty'.