1
2
3
4
5
6
7
8
9
10
11
12
13
14\writestatus { loading }{ ConTeXt Page Macros Page Streams }
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32\registerctxluafile { page str }{}
33
34\unprotect
35
36\let \currentoutputstream \empty
37\newif \ifinoutputstream
38\newtoks \everyenableoutputstream
39
40\appendtoks
41 \page_otr_command_flush_side_floats
42\to \everyenableoutputstream
43
44\unexpanded \def \initializeoutputstreams
45 { \clf_initializestream
46 \glet \initializeoutputstreams \relax }
47
48\unexpanded \def \enableoutputstream [# 1 ]
49 { \initializeoutputstreams
50 \the \everyenableoutputstream
51 \inoutputstreamtrue
52 \xdef \currentoutputstream { # 1 }
53 \clf_enablestream { # 1 }
54 \prevdepth \zeropoint
55 }
56
57\unexpanded \def \disableoutputstream
58 { \inoutputstreamfalse
59 \glet \currentoutputstream \s!default
60 \clf_disablestream }
61
62\unexpanded \def \startoutputstream [# 1 ]
63 { \begingroup
64 \initializeoutputstreams
65 \the \everyenableoutputstream
66 \inoutputstreamtrue
67 \xdef \currentoutputstream { # 1 }
68 \clf_startstream { # 1 }}
69
70\unexpanded \def \stopoutputstream
71 { \clf_stopstream
72 \endgroup }
73
74\unexpanded \def \startoutputsubstream [# 1 ]
75 { \globalpushmacro\currentoutputstream
76 \enableoutputstream [# 1 ] }
77
78\unexpanded \def \stopoutputsubstream
79 { \globalpopmacro\currentoutputstream
80 \enableoutputstream [ \currentoutputstream ] }
81
82\def \flushoutputstream [# 1 ] { \clf_flushstream { # 1 }}
83\def \outputstreambox [# 1 ] { \vbox { \clf_flushstream { # 1 }}}
84\def \outputstreamcopy [# 1 ] { \vbox { \clf_flushstreamcopy { # 1 }}}
85\def \outputstreamunvbox [# 1 ] { \clf_flushstream { # 1 }}
86\def \outputstreamunvcopy [# 1 ] { \clf_flushstreamcopy { # 1 }}
87\def \synchronizestreams [# 1 ] { \clf_synchronizestream { # 1 }}
88\def \dopushoutputstream [# 1 ] { \clf_pushstream { # 1 }}
89
90\unexpanded \def \pushoutputstream
91 { \dosingleempty \dopushoutputstream }
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115\protect \endinput
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156 |