Debian Codegraph @

texmf-dist/source/latex/paracol/impl.dtx

raw
1 % \section{Overview}
2 % \label{sec:imp-ovv}
3 %
4 % \subsection{Column-Pages}
5 % \label{sec:imp-ovv-colpage}
6 %
7 % In our parallel multi-column typesetting, a column may grow independently
8 % of other columns and may cross its page boundary asynchronously with
9 % others. Therefore, we cannot throw away the contents of a column in a
10 % page, or a {\em\Uidx\colpage} in short, when a page break occurs in the
11 % column. Instead, we have to keep \colpage{}s until all columns are
12 % {\em\Uidx\sync{}ed} implicitly or explicitly.
13 %
14 % An {\em\Uidx\imsync} takes place when all columns in a page see
15 % page-breaks to let the page is shipped out. In general, all columns but
16 % the last one which arrives the page-break have completed \colpage{}s in the
17 % page in question and some of them may have succeeding \colpage{}s.
18 % Therefore, we maintain the list of completed \colpage{}s
19 % $\Uidx\S_c=|\pcol@shipped|{\cdot}c$
20 % 
21 % \SpecialArrayMainIndex{c}{\pcol@shipped}
22 % 
23 % for each column $c\In0\C$, where $\Uidx\C=\!\pcol@ncol!$ is the number of
24 % columns given through the argument of \env{paracol} environment, and the
25 % set of them $\Uidx\SS=\Set{\S_c}{c\In0\C}$.
26 %
27 % Each element $\Uidx\s_c(p)$ of a list $\S_c$ is an \!\insert! whose
28 % \!\vbox! contains the
29 % $p$-th completed \colpage\footnote{
30 % 
31 % Other registers such as \cs{count} are not used.},
32 % 
33 % where $p=0$ for the first \colpage{} produced in \env{paracol}
34 % environment or that following a page flushing macro \!\flushpage!,
35 % \!\clearpage! or \!\cleardoublepage!. That is, $\S_c$ is defined as
36 % follows, where $\Uidx\pbase=\!\pcol@basepage!$ is the zero-origin ordinal
37 % of the {\em\Uidx\bpage} being the oldest page not shipped out yet.
38 % 
39 % \begin{eqnarray*}
40 % \S_c&=&(\s_c(\pbase),\s_c(\pbase{+}1),\ldots,\s_c(\pbase{+}k{-}1))\\
41 % &=&\!\@elt!\,\s_c(\pbase)\;\!\@elt!\,\s_c(\pbase{+}1)\;\cdots\;
42 % \!\@elt!\,\s_c(\pbase{+}k{-}1)
43 % \end{eqnarray*}
44 % 
45 % Note that a list $\S_c$ can be empty and all members in $\SS$ may be empty.
46 %
47 % The other type of \sync{}ation, {\em\Uidx\exsync}, takes place by
48 % \!\switchcolumn!|*| or the beginning of starred \csenv{}s, by
49 % \Endparacol, or by one of page flushing macros \!\flushpage!,
50 % \!\clearpage! and \!\cleardoublepage!. A flushing \exsync{} ships out the
51 % pages from $\pbase$ to $\Uidx\ptop=\!\pcol@toppage!$ being the ordinal of
52 % the {\em\Uidx\tpage} to which the most advanced {\em\Uidx\lcolumn} has
53 % reached. On the other hand, other non-flushing \exsync{} keeps the page
54 % $\ptop$ from being shipped out because the \colpage{}s in it or the page
55 % itself will grow further.
56 %
57 %
58 %
59 % \subsection{Current Column-Pages and Their Contexts}
60 % \label{sec:imp-ovv-ccol}
61 % \changes{v1.3-4}{2013/09/17}
62 % {Remove $\mu$ for \cs{@mparbottom} from column-context because it is
63 % now in page context.}
64 %
65 % We also have to maintain another type of \colpage{}s which are currently
66 % built, or {\em\Uidx\ccolpage{}s} in short, to switch from a column to
67 % another. Since each column may have its own {\em context} for the
68 % typesetting of it, or {\em\Uidx\cctext} in short, it were perfect to save
69 % the context when we leave from a
70 % column and to restore that when we revisit the column if we could.
71 % However, \TeX{} and \LaTeX{} has a tremendously large number of context
72 % variables and the number becomes virtually boundless when we take variables
73 % defined in various styles and by users themselves into account.
74 % Therefore, we had to abandon to keep the whole context of the column but
75 % carefully chose a small subset comprising variables automatically modified
76 % outside of users' control. That is, the \cctext{}
77 % $\Uidx\cc_c=|\pcol@col|{\cdot}c$
78 % 
79 % \SpecialArrayMainIndex{c}{\pcol@col}
80 % 
81 % of a column $c$ consists of the following elements, each of which named
82 % $e$ is referred to as $\cc_c(e)$ hereafter.
83 % 
84 % \begin{itemize}
85 % \item $\Uidx\vb$
86 % represents $\!\insert!{\cdot}\vb$ containing the followings.
87 % 
88 % \begin{itemize}
89 % \item
90 % $\vb^b=\!\box!{\cdot}\vb=\!\@holdpg!$ is the \!\vbox! containing the main
91 % vertical list which has already contributed to the \ccolpage{}.
92 %
93 % \item
94 % $\vb^p=\!\count!{\cdot}\vb=\!\pcol@page!$ means the \ccolpage{} belongs to
95 % the page $\vb^p$.
96 %
97 % \item
98 % $\vb^r=\!\dimen!{\cdot}\vb=\!\@colroom!$ is the room of the column.
99 % \end{itemize}
100 %
101 % \item $\Uidx\ft=\Midx{\!\pcol@currfoot!}$
102 % is the \!\insert! containing the footnotes added in the \ccolpage, if
103 % \Mcfnote{} typesetting is in effect. Its constituent \!\box!, \!\count!,
104 % \!\dimen! and \!\skip! are denoted as $\ft^b$, $\ft^c$, $\ft^d$ and
105 % $\ft^s$ respectively. On the other hand, if \Scfnote{} typesetting is in
106 % effect, $\ft$ is always empty\footnote{
107 % 
108 % But the macro \cs{pcol@currfoot} is used to keep \Scfnote{}s temporarily.}.
109 %
110 % \item $\Uidx\pd=\!\pcol@prevdepth!$
111 % is the depth of the last vertical item in $\vb^b$ obtained by
112 % \!\prevdepth!.
113 %
114 % \item $\Uidx\tl=\!\@toplist!$
115 % is the list of top floats inserted in the \ccolpage.
116 %
117 % \item $\Uidx\ml=\!\@midlist!$
118 % is the list of mid floats inserted in the \ccolpage.
119 %
120 % \item $\Uidx\bl=\!\@botlist!$
121 % is the list of bottom floats inserted in the \ccolpage.
122 %
123 % \item $\Uidx\dl=\!\@deferlist!$
124 % is the list of \cwise{} floats deferred to the next \colpage.
125 %
126 % \item $\Uidx\tf=\!\pcol@textfloatsep!$
127 % is the vertical skip used instead of \!\textfloatsep! for top floats in the
128 % \ccolpage{} if it has \sync{}ation points, or $\infty$ otherwise.
129 %
130 % \item $\Uidx\fh=\!\@textfloatsheight!$
131 % is the total height of mid floats and their separators in the \ccolpage.
132 %
133 % \item $\Uidx\tn=\!\@topnum!$
134 % is the maximum number of top floats which the \ccolpage{} can accommodate
135 % further.
136 %
137 % \item $\Uidx\tr=\!\@toproom!$
138 % is the room for top floats in the \ccolpage.
139 %
140 % \item $\Uidx\bn=\!\@botnum!$
141 % is the maximum number of bottom floats which the \ccolpage{} can accommodate
142 % further.
143 %
144 % \item $\Uidx\br=\!\@botroom!$
145 % is the room for bottom floats in the \ccolpage.
146 %
147 % \item $\Uidx\cn=\!\@colnum!$
148 % is the maximum total number of floats which the \ccolpage{} can accommodate
149 % further.
150 %
151 % \item $\Uidx\sw$
152 % is the following encoding of \CSIndex{if@nobreak} and
153 % \CSIndex{if@afterindent} at the time we left from the column $c$.
154 % $$
155 % \sw=\cases{0&$\CSIndex{if@nobreak}=\false$\cr
156 % 1&$\CSIndex{if@nobreak}=\true\;\land\;
157 % \CSIndex{if@afterindent}=\true$\cr
158 % 2&$\CSIndex{if@nobreak}=\true\;\land\;
159 % \CSIndex{if@afterindent}=\false$}
160 % $$
161 % Note that we have only three states because \CSIndex{if@afterindent} is
162 % meaningful only when $\CSIndex{if@nobreak}=\true$\footnote{
163 % 
164 % If only with the standard \LaTeX{} and so far.}.
165 %
166 % \item $\Uidx\ep=\!\everypar!$
167 % is the tokens stored in \!\everypar! at the time we left from the column
168 % $c$.
169 % \end{itemize}
170 % 
171 % \changes{v1.1}{2012/05/11}
172 % {Add description of $w_c\EQ\cs{pcol@columnwidth}{\cdot}c$.}
173 % 
174 % In addition, we have special context variables
175 % $\Uidx\w_c=|\pcol@columnwidth|{\cdot}c$
176 % 
177 % \SpecialArrayMainIndex{c}{\pcol@columnwidth}
178 % 
179 % in which we keep \!\columnwidth! for the column $c$.
180 %
181 % Note that we could add other variables to the saved context and/or provide
182 % some API macro to define them by users, but abandon them because it should
183 % be too complicated for users\footnote{
184 % 
185 % And for the author if we include save/restore of macros, though it could
186 % be done with a \cs{toks} containing the \cs{def}initions of macros.}.
187 % 
188 % Also note that we provide a save/restore mechanism for \lcounter{}s as
189 % discussed in \secref{sec:imp-ovv-counter}.
190 %
191 %
192 %
193 % \subsection{Pages and Their Contexts}
194 % \label{sec:imp-ovv-page}
195 % \changes{v1.2-2}{2013/05/11}
196 % {Redesign page context and its implementation.}
197 % \changes{v1.3-3}{2013/09/17}
198 % {Add $\pi^s(p)$ to the page context of $p$ for column-separating
199 % rule drawing and background painting.}
200 % \changes{v1.3-4}{2013/09/17}
201 % {Add $\pi^m(p)$ to the page context of $p$ for marginal note
202 % placement.}
203 %
204 % Besides the \colpage{}s, we have to keep track each whole page not yet
205 % shipped out but has some complete or incomplete (i.e., current) \colpage{}s.
206 % We maintain the list;
207 % 
208 % \SpecialMainIndex{\pcol@pages}
209 % 
210 % \begin{eqnarray*}
211 % \Uidx\PP
212 % &=&\!\pcol@pages!=(\Uidx\pp(\pbase),\pp(\pbase{+}1),\ldots\pp(\ptop{-}1))\\
213 % &=&\!\@elt!\,\pp(\pbase)\;\!\@elt!\,\pp(\pbase{+}1)\;\cdots\;
214 % \!\@elt!\,\pp(\ptop{-}1)\\
215 % \pp(p)&=&|{|\pp^p(p)|}|\pp^i(p)\pp^f(p)|{|\pp^s(p)|}||{|\pp^m(p)|}|
216 % \end{eqnarray*}
217 % 
218 % where $\pp(p)$ is the {\em\Uidx\pctext} of $p$ and its elements $\pp^p(p)$,
219 % $\pp^i(p)$, $\pp^f(p)$, $\pp^s(p)$ and $\pp^m(p)$ have the followings.
220 % 
221 % \begin{itemize}
222 % \item
223 % $\pp^p(p)=\Uidx\page(p)$ is the value of the counter \counter{page}
224 % (i.e. \!\c@page!) for the page $p$.
225 %
226 % \item
227 % Iff $\pp^i(p)\neq\bot$, the page $p$ has \pwise{} floats or the
228 % single-column {\em\Uidx\preenv} preceding \beginparacol{} in the
229 % {\em\Uidx\spage} where it resides and spanning all columns. In this case
230 % $\pp^i(p)=i$ represents $\!\insert!{\cdot}i$, often {\em cached}
231 % in the macro \!\pcol@spanning!, for such {\em\Uidx\spanning}
232 % whose registers have the followings.
233 % 
234 % \begin{itemize}
235 % \item
236 % $\pp^b(p)=\!\box!{\cdot}i$ contains the \spanning.
237 %
238 % \item
239 % $\pp^h(p)=\!\dimen!{\cdot}i=\!\@colht!$ if positive for the height of
240 % columns shrunk by the \spanning. If negative, the page is only for
241 % the \spanning, i.e. a {\em\Uidx\fpage}. We use the notation $\pp^h(p)$
242 % for the pages $\pp^i(p)=\bot$ to mean \!\textheight!.
243 %
244 % \item
245 % $\pp^t(p)=\!\skip!{\cdot}i=\!\pcol@topskip!$ being the value of
246 % \!\topskip! at \beginparacol{} to be inserted at the top of each column in
247 % each non-first page. Otherwise, i.e., for the columns in the \spage{}
248 % following the \preenv{}, it has 0 to prevent the \!\topskip! insertion.
249 % We use the notation $\pp^t(p)$ for the pages $\pp^i(p)=\bot$ to
250 % mean \!\pcol@topskip!.
251 % \end{itemize}
252 %
253 % \item
254 % Iff $\pp^f(p)\neq\bot$, \Scfnote{} typesetting, discussed in
255 % \secref{sec:imp-ovv-scfnote}, is in effect and the page $p$ has some
256 % footnotes in $\!\box!\cdot\pp^f(p)$. This element is often {\em cached}
257 % in the macro \Midx{\!\pcol@footins!}.
258 % 
259 % \SpecialMainIndex{\pcol@pages}
260 %
261 % \item
262 % $\pp^s(p)=(\Uidx\spt(H_1,h_1),\ldots,\spt(H_n,h_n))=
263 % \!\@elt!\Arg{H_1,h_1}\ldots\!\@elt!\Arg{H_n,h_n}$ is the list of \mctext{}s
264 % in the page $p$, where $i$-th one's top edge is at $H_i$ from the top of
265 % the page (excluding \spanning) and its height-plus-depth is $h_i$, where
266 % $H_i$ and $h_i$ are represented in the form of integers. Therefore, it is
267 % emptied by \!\pcol@startpage!, and then the elements are added by
268 % \!\pcol@makecol! (only for the last one) and \!\pcol@output@switch!
269 % whenever they find a \mctext{} completes. The element is often {\em
270 % cached} in the macro \!\pcol@sptextlist! and is referred to by
271 % \!\pcol@buildcolseprule! to draw \cseprule{} and to paint columns and
272 % \csepgap{} leaving spaces for \mctext{}s. The usage of this element is
273 % discussed in \secref{sec:imp-ovv-cswap} a little bit more detailedly.
274 %
275 % \item
276 % $\pp^m(p)=\Arg{\Uidx\mpb_L^l}\Arg{\mpb_L^r}\Arg{\mpb_R^l}\Arg{\mpb_R^r}$
277 % is the set of lists of marginal notes in the left ($l$) and right
278 % ($r$) margins and in the left ($L$) and right ($R$) \parapag{}es. The
279 % words left and right of margins mean physical left and right, while left
280 % and right of \parapag{}es mean the logical ones, i.e., the page where the
281 % column-0 resides is left. Each element $\mpb_{\{L,R\}}^{\{l,r\}}$ has a
282 % list $(\Uidx\mpar(t_1,b_1),\ldots,\mpar(t_n,b_n))=
283 % \!\@elt!\Arg{t_1}\Arg{b_1}\ldots\!\@elt!\Arg{t_n}\Arg{b_n}$ of marginal
284 % notes whose top and bottom are at $t_i$ and $b_i$ from the top of the
285 % column area, where $t_i$ and $b_i$ are represented in the form of
286 % integers. Each element can be empty of course, and $\pp^m(p)$ itself can
287 % be so as well to mean all elements are empty\footnote{
288 % 
289 % To minimize the possibility of miscoding for emptying and save a small
290 % amount of memory for pages having no marginal notes.}.
291 % 
292 % Therefore, $\pp^m(p)$ is emptied by
293 % \!\pcol@startpage!, and then examined and modified by
294 % \!\pcol@addmarginpar! when it adds a marginal note through macros
295 % \!\pcol@getmparbottom! and \!\pcol@setmpbelt!. Another modifier
296 % \!\pcol@output@start! initializes one of the element $\mpb_L^{\{l,r\}}$
297 % with the value representing the last marginal note in \preenv{}, while
298 % another examiner \!\pcol@output@end! lets the outside \!\@mparbottom! have
299 % a value based on $b_n$ of one of the element, according to \LaTeX's
300 % setting of marginal note placement. The whole element $\pp^m(p)$ is often
301 % {\em cached} in the macro \!\pcol@mparbottom!. The usage of this
302 % element is discussed in \secref{sec:imp-ovv-cswap} a little bit more
303 % detailedly.
304 % \end{itemize}
305 % 
306 % Note that even in \parapag{}ing and in \npaired{} one in particular,
307 % a page $p$ consists of all columns $c\In0\C$. Therefore, the term {\em
308 % left\slash right \parapag{}e} $p$ always mean the left and right component
309 % of a \parapag{}e (pair) $p$.
310 %
311 % The reason why we keep track of $\page(p)$ is that page numbering is not
312 % necessary to be consecutive. If such a {\em jump} occurs randomly in any
313 % columns explicitly updating \counter{page}, it is very tough to give a
314 % consistent view of the page number of a specific page to all columns.
315 % Therefore we suppose jumps occur only in the leftmost column 0\footnote{
316 % 
317 % But we neither inhibit nor nullify a jump in non-leftmost column and thus
318 % the update can be seen referring to \texttt{page} counter explicitly.}
319 % 
320 % which controls the page numbering, while non-leftmost columns are expected
321 % to refer the \counter{page} passively.
322 %
323 % This page numbering is implemented as follows. Each time a \colpage{} at
324 % $p$ of the leftmost column is completed to start a new \colpage{},
325 % $\page(p)$ is fixed to be the value of \counter{page} and
326 % $\page(q)=\pp^p(q)$ for all $q\in[p,\ptop]$ are let be $\page(p)+(q-p)$ in
327 % usual cases but $\page(p)+2(q-p)$ in \npaired{} \parapag{}ing.
328 % This update also takes place on \cswitch{} from the leftmost \colpage{} at
329 % $p$ to another column so that a jump happening before the switching is
330 % notified to other columns. On the other hand, starting or \cswitch{} to a
331 % non-leftmost \colpage{} at $p$ lets \counter{page} have $\page(p)$
332 % referring to $\pp(p)$, unless the column starts the most advanced \tpage.
333 % In this new \tpage{} case, $\pp(\ptop{+}1)$ is added to $\PP$ with the
334 % temporary setting $\pp^p(\ptop+1)=\page(\ptop+1)=\page(\ptop)+1$ usually but
335 % $\pp^p(\ptop+1)=\page(\ptop+1)=\page(\ptop)+2$ in \npaired{}
336 % \parapag{}ing, and $\ptop$ is incremented.
337 %
338 % Note that this management is imperfect because direct references of
339 % \counter{page} in non-leftmost columns can give inconsistent results if
340 % \counter{page} is modified in a non-leftmost column or the reference occurs
341 % in a page $p$ after that the leftmost column modifies \counter{page} in a
342 % page $q$ such that $q\leq p$. In addition to them, this mechanism in
343 % \npaired{} \parapag{}ing always gives incorrect page number to the
344 % columns in a right \parapag{}e because $\pp^p(p)$ always has $\page(p)$
345 % for the left \parapag{}e. However, it is expected that the progress of
346 % the leftmost column usually precedes other columns to give consistent
347 % \counter{page} reference even with jumps, unless the reference is made by
348 % a column in a right \npaired{} \parapag{}e. More importantly, it is
349 % assured that indirect references through |.aux| records and page numbers
350 % recorded in |.toc|, |.idx|, and so on are always consistent because of the
351 % lazy evaluation of $\counter{page}=\page(p)$ at ship-out of an ordinary
352 % page $p$ or a left \parapag{}e $p$, while the counter is let have
353 % $\page(p)+1$ when a right \npaired{} \parapag{}e $p$ is shipped out.
354 %
355 % Also note that we also keep $\pp(\ptop)$ in \Midx{\!\pcol@currpage!}
356 % which is initialized by \!\pcol@output@start! to let $\pp^i(\ptop)$ have
357 % the \preenv. Then the macro is redefined to have the value representing
358 % the new page possibly with $\pp^i(\ptop)$ for \pwise{} floats in
359 % \!\pcol@startpage! by the macro \!\pcol@defcurrpage!. Another
360 % \!\def!inition is done in \!\pcol@output@switch! also with
361 % \!\pcol@defcurrpage! to let $\pp^f(\ptop)$ have \Scfnote{}s built in
362 % \!\footins! if \scfnote{} typesetting is in effect and the \cswitch{}
363 % leaves the column in $\ptop$\footnote{
364 % 
365 % The \!\def!inition of \!\pcol@currpage! in \!\pcol@setpnoelt!, and
366 % emptying it in \!\pcol@output@start! and \!\pcol@freshpage! are for coding
367 % trick and thus not for giving a really new \!\def!initions.}.
368 % 
369 % We denote the concatenation of $\PP$ and $\pp(\ptop)$ as $\Uidx\PPP$ to
370 % represent all pages {\em on-the-fly}.
371 %
372 %
373 %
374 % \subsection{Counters}
375 % \label{sec:imp-ovv-counter}
376 %
377 % Besides the context variables discussed in \secref{sec:imp-ovv-ccol}, we
378 % need to make counters local to each column except for those declared to be
379 % global by \!\globalcounter!. Let $\Uidx\CC$ be the set (list) of all
380 % counters declared before \beginparacol, i.e., $\CC=\!\cl@@ckpt!$, and
381 % $$
382 % \Uidx\CG=\!\pcol@gcounters!=\{\Uidx\cg_1,\ldots\}=\!\@elt!|{|\cg_1|}|\cdots
383 % $$
384 % be the set of {\em\Uidx\gcounter{}s} which have declared so by
385 % \!\globalcounter!|{|$\cg_i$|}|. Then the set of {\em\Uidx\lcounter{}s}
386 % $\Uidx\CTL$ is defined as follows.
387 % 
388 % \SpecialMainIndex{\pcol@counters}
389 % $$
390 % \CTL=\CC-\CG=\!\pcol@counters!=\{\Uidx\cl_1,\ldots\}=\!\@elt!|{|\cl_1|}|\cdots
391 % $$
392 %
393 % Since each column has its own values in \lcounter{}s, we have to keep the
394 % set of counter\slash value pairs
395 % 
396 % \SpecialArrayMainIndex{c}{\pcol@counters}
397 % $$
398 % \Uidx\Cc_c=\!\pcol@counters!{\cdot}c=\{\<\cl_1,\val_c(\cl_1)\>,\ldots\}
399 % =\!\@elt!|{|\cl_1|}||{|\val_c(\cl_1)|}|\cdots
400 % $$
401 % for each column $c$, where $\Uidx\val_c(\cl_i)$ is the value of a counter
402 % $\cl_i$ local to $c$. That is, whenever we switch from a column $c$ to
403 % $d$, we save $\<\cl_i,\val_c(\cl_i)\>$ in $\Cc_c$ and restore $\cl_i$ for
404 % $d$ by letting it have $\val_d(\cl_i)$ in $\Cc_d$, for all $\cl_i\in\CTL$.
405 %
406 % A \gcounter{} is free from these save\slash restore operations but needs
407 % another special operation when it is incremented by \!\stepcounter!. That
408 % is, the invocation of \!\stepcounter! for a \gcounter{} $\cg_i$ may clear
409 % \lcounter{}s in its set of descendant counters
410 % $\Uidx\clist(\cg_i)=|\pcol@cl@|{\cdot}\cg_i$
411 % 
412 % \SpecialArrayMainIndex{\theta}{\pcol@cl@}
413 % 
414 % and this clearing must be performed on the all instances of
415 % $\cl_j\in\clist(\cg_i)$ saved in $\Cc_c$ for all $c\In0\C$. Therefore, on
416 % the \!\stepcounter!, we do the followings for all $c\In0\C$; temporarily
417 % restore all $\cl_k\in\CTL$ from $\Cc_c$; clear all $\cl_j\in\clist(\cg_i)$;
418 % and then save $\<\cl_k,\val_c(\cl_k)\>$ back to $\Cc_c$.
419 %
420 % The other item we maintain for a \lcounter{} $\cl$ is its {\em\Uidx\lrep}
421 % $\arg{rep}$ in a column $c$ defined by
422 % $\!\definethecounter!\<\cl\>\<c\>\arg{rep}$. The \lrep{} $\arg{rep}$ is
423 % kept in $|\pcol@thectr@|{\cdot}\cl{\cdot}c$ and is made \!\let!-equal to
424 % $|\the|{\cdot}\cl$ when the column $c$ is visited.
425 % 
426 % \SpecialArrayMainIndex{\theta{\cdot}c}{\pcol@thectr@}
427 % \SpecialArrayIndex{\theta}{\the}
428 %
429 %
430 %
431 % \subsection{Page-Wise and Merged Footnotes}
432 % \label{sec:imp-ovv-scfnote}
433 % \changes{v1.2-2}{2013/05/11}
434 % {Add the subsection ``Single-Columned and Merged Footnotes''.}
435 % \changes{v1.3-6}{2013/09/17}
436 % {Change the title from ``Single-Columned and Merged Footnotes'' to
437 % ``Page-Wise and Merged Footnotes'' according to the new naming.}
438 %
439 % \Uidx{\Index{page-wise footnote}}{\em Page-wise footnote}
440 % typesetting is completely different from ordinary {\em\Mcfnote}
441 % typesetting.
442 %
443 % When a \colpage{} in the \tpage{} is built, \!\footins! keeps all footnotes
444 % \!\insert!ed by \!\footnote! or \!\footnotetext! in {\em any} columns in
445 % the page. Therefore, \!\footnote! and \!\footnotetext! in the \tpage{}
446 % act as usual to add the footnote to \!\footins!. Then if a \cswitch{}
447 % takes place to leave the column, \!\footins! is saved into $\pp^f(\ptop)$
448 % by \!\pcol@output@switch!, so that $\pp^f(\ptop)$ is \!\insert!ed to
449 % \!\footins! again by \!\pcol@restartcolumn! when it visits a column in
450 % $\ptop$, or by \!\pcol@startcolumn! when it finds a column proceeds to
451 % $\ptop$.
452 %
453 % Then, when a \colpage{} in the \tpage{} completes advancing $\ptop$,
454 % \!\footins! is kept in $\pp^f(\ptop{-}1)$ by \!\pcol@startpage!, rather
455 % than being combined with the \colpage{}. This saving into
456 % $\pp^f(\ptop{-}1)$ {\em fixes} the footnotes in $\ptop{-}1$ so that
457 % $\pp^f(\ptop{-}1)$ is combined with other materials in the page by
458 % \!\pcol@outputelt! or \!\pcol@makeflushedpage! through \!\pcol@putfootins!
459 % when the page is shipped out.
460 %
461 % Fixing $\pp^f(p)$ for $p<\ptop$ makes it impossible to add footnotes in a
462 % column in the page $p$ not only to $\pp^f(p)$ but also to \!\footins!
463 % for the page $p$ because we have at least one fixed \colpage{} $\s_c(p)$
464 % unable to shrink to have such additional footnotes in $p$\footnote{
465 % 
466 % The \colpage{} $\s_c(p)$ could have some space at its bottom produced by,
467 % for example, \cs{newpage}, but exploitation of such space is extremely
468 % hard.}.
469 % 
470 % Therefore, such a footnote addition is {\em deferred} and is thrown into
471 % $\pp^f(\ptop)$ through a list;
472 % $$
473 % \Uidx\df=\!\pcol@topfnotes!=
474 % (f_1,f_2,\ldots,f_n)=\!\vbox!|{|f_1\;f_2\;\cdots\;f_n|}|
475 % $$
476 % where $f_i$ is a \!\vbox! containing the deferred footnote preceded by
477 % \!\penalty!\!\interlinepenalty! to allow \TeX{} to break footnotes to place
478 % them in two (or more) pages. That is, \!\footnote! or \!\footnotetext! in
479 % $p<\ptop$ adds an element for the footnote to $\df$, then all the elements
480 % 
481 % \footnote{More accurately, some trailing elements may be left in $\df$ if
482 % its total height is too large, as discussed in
483 % \secref{sec:imp-sout-scfnote}.}
484 % 
485 % are \!\insert!ed to \!\footins! by \!\pcol@deferredfootins! invoked in
486 % \!\pcol@restartcolumn! when it visits a column in $\ptop$, or in
487 % \!\pcol@startcolumn! when it starts a \colpage{} in $\ptop$. The macro
488 % \!\pcol@output@end! also do the \!\insert!ion by itself with \Mgfnote{}
489 % typesetting to let deferred footnotes be a part of \postenv.
490 %
491 % The reference to $\pp^f(p)$ for $p<\ptop$ is also made in
492 % \!\pcol@restartcolumn! and \!\pcol@flushcolumn!. The former \!\insert!s
493 % $\pp^f(p)$ to \!\footins! so that the \colpage{} which the macro restarts
494 % is built as if it has the footnotes in $\pp^f(p)$ to make the \colpage{}
495 % broken leaving the space for the footnotes. However, \!\footins! is never
496 % grown because it has been fixed and thus additional footnotes will go
497 % to $\df$ as discussed above. Then \!\footins! is discarded by
498 % \!\pcol@makecol! when the \colpage{} completes, or by
499 % \!\pcol@output@switch! when it leaves the column.
500 %
501 % The reference to $\pp^f(p)$ by the latter macro \!\pcol@flushcolumn! is to
502 % build the ship-out image of the \colpage{} to be flushed. When this macro
503 % and other macros, namely \!\pcol@makecol! and \!\pcol@makeflushedpage!,
504 % build the ship-out image in a page $p$ having $\pp^f(p)$ using
505 % \!\@makecol!, we have to be careful of the fact that the \colpage{} has
506 % been build as if it has footnotes in $\pp^f(p)$ but the footnotes are not
507 % included in its ship-out image but that of the page. Therefore,
508 % \!\@colht! referred in \!\@makecol! should be shrunk by the sum of
509 % height and depth of $\pp^f(p)$ and $\!\skip!\cdot\pp^f(p)$ by
510 % \!\pcol@shrinkcolbyfn!. Other and more subtle adjustment is to add the
511 % stretch and shrink factors of $\!\skip!\cdot\pp^f(p)$ at the tail of the
512 % \colpage{} by \!\pcol@unvbox@cclv!. This is necessary because \TeX{} has
513 % broken the \colpage{} taking account of the stretch and, more essentially,
514 % shrink factors, and thus without the factors the main vertical list in the
515 % \colpage{} could be a little bit taller than \!\@colht! causing overfull.
516 %
517 % The feature gathering footnotes in all columns in a page brings a problem
518 % to \exsync{}, because a column whose contents fit the \tpage{} at the
519 % last visit may be too tall on the \sync{}ation because other columns have
520 % put some footnotes after the last visit. That is, we cannot simply build
521 % the \tpage{} combining $\s_c(\ptop)$ for all $c\In0\C$ and $\pp^f(\ptop)$
522 % because there could be $\s_c(\ptop)$ too tall to reside in $\ptop$ with
523 % $\pp^f(\ptop)$.
524 %
525 % To solve this problem, we perform the following operations prior to fix
526 % the contents of $\ptop$ having an \exsync{} point in it. First one is
527 % {\em\Uidx\cscan} to visit all columns by \cswitch{} prior to the
528 % \sync{}ation so that \TeX's page builder has opportunities to break too
529 % tall \colpage{}s. Since this scan could merely break footnotes rather
530 % than the main vertical lists in the \colpage{}s and the broken footnotes
531 % will be reconnected when the \!\output!-routine is invoked for the
532 % \sync{}ation, we then examine if all $\s_c(\ptop)$ are accommodated in
533 % $\ptop$ with $\pp^f(p)$.
534 %
535 % This examination for a \sync{}ation by \!\switchcolumn!|*| or its
536 % relatives is done as a part of the inherent \sync{}ing procedure to see if
537 % the combination of the tallest {\em top} items, i.e., top floats and the
538 % main vertical list, and the tallest {\em bottom} items, i.e., bottom
539 % floats and \Mcfnote{}s, is too large causing page flushing. As for page
540 % flushing and environment closing, this {\em\Uidx\pfcheck} requires a
541 % special kind of \sync{}ed \cswitch{} by which we flush pages up to
542 % $\ptop-1$ and examine if there is a too tall column.
543 %
544 % Then if too tall columns are found, in either cases, we move to the {\em
545 % tallest} column to force a page break in the column so that we have a new
546 % page with shorter columns and shorter \Scfnote{}s as well. In the
547 % \sync{}ation by \!\switchcolumn!|*| or its relatives, this forced page
548 % break is then applied to all other columns so that new \colpage{}s have
549 % top floats, if any, below which we should place the \sync{}ation point.
550 % This examination and forced page break is repeated until we have a page
551 % without any too tall columns, because a page break may bring deferred
552 % floats and footnotes which may result in a too tall column.
553 %
554 %
555 %
556 % \subsection{Text Coloring}
557 % \label{sec:imp-ovv-color}
558 % \changes{v1.2-1}{2013/05/11}
559 % {Add the subsection ``Coloring''.}
560 % \changes{v1.3-5}{2013/09/17}
561 % {Change the subsection title from ``Coloring'' to ``Text Coloring''
562 % to distinguish it from background painting clearly.}
563 %
564 % \subsubsection{Fundamental Mechanism}
565 % \label{sec:imp-ovv-color-fundamental}
566 % \changes{v1.34}{2018/05/07}
567 % {Revise the description of \Sec1.6.1 according to the new
568 % implementation with \cs{insert}.}
569 %
570 % Text coloring done by \textsf{color} package and its relatives using
571 % \!\special! stands on the fact that the main vertical list is {\em
572 % printed} in the order of occurrence in the source |.tex|. That is, a
573 % command such as \!\color!|{red}| puts
574 % \!\special!|{color push [1 0 0]}|\footnote{
575 % 
576 % If \texttt{.dvi} is processed by \texttt{dvips}, or other
577 % printer-dependent command corresponding to it.}
578 % 
579 % into |.dvi| to make all stuff in the main vertical list colored red until
580 % other coloring \!\special! inserted by other coloring macro appears in
581 % |.dvi|. This simple mechanism works well even when the pair of coloring
582 % \!\special!s are in different pages and/or columns because, with respect
583 % to the main vertical list, everything between them in |.tex| is also
584 % surrounded by the \!\special! pair in |.dvi|. As for other stuff such as
585 % header, footer, floats and footnotes, \LaTeX{} surrounds them by
586 % \!\color@begingroup! and \!\color@endgroup! or other similar constructs so
587 % that they are colored without interference with the coloring of the main
588 % vertical list.
589 %
590 % In \env{paracol} environment, however, the orders of the main vertical list
591 % in |.tex| and |.dvi| are not always same. When a column encounters a page
592 % break, in |.dvi| the other column should intervene between the stuff in
593 % the broken pair of \colpage{}s possibly changing the color of the second
594 % \colpage. A \cswitch{} from $c_1$ to $c_2$ also makes the main vertical
595 % list out-of-order to cause another unexpected coloring because a coloring
596 % command in $c_2$ will have no effect when $c_1$ is revisited after that
597 % following its pre-switching stuff in |.dvi| which was put before the
598 % coloring. Therefore, we have to make {\em\Uidx\colorctext{}s} in both
599 % |.tex| and |.dvi| coherent inserting appropriate \!\special!s into |.dvi|
600 % whenever an out-of-order {\em jump} occurs in |.dvi| by a page break or in
601 % |.tex| by a \cswitch{}.
602 %
603 % The \textsf{color} package and its relatives\footnote{
604 % 
605 % And all other coloring mechanism compliant with \LaTeXe{}, hopefully and
606 % believingly.}
607 % 
608 % assume that {\em printers} have a stack for coloring and thus a coloring
609 % \!\special! pushes the new color into the stack while it is popped by
610 % another \!\special! which will be inserted by \!\aftergroup! mechanism
611 % when a group surrounding the coloring \!\special! is closed. Therefore we
612 % have to keep track of the \colorctext{} with {\em\Uidx\colorstack}
613 % $$
614 % \Uidx\cst=
615 % (\Uidx\celt_1,\celt_1,\ldots,\celt_n)=
616 % \!\vbox!|{|\celt_1\;\celt_2\;\ldots\;\celt_n|}|
617 % $$
618 % where $\celt_i$ is a \!\vbox! of 1\,|sp| tall, 0 deep and 0 wide containing
619 % a coloring \!\special! which \!\set@color! puts into the main vertical
620 % list. That is, when \!\set@color! is invoked we push $\celt$ to the tail
621 % of $\cst$, while when the corresponding \!\reset@color! appears we pop it
622 % from $\cst$\@. Then when we encounter an out-of-order jump, at first we
623 % rewind the \colorstack{} in |.dvi| by putting \!\special!s which
624 % \!\reset@color! would put, and then reestablish the \colorstack{} by
625 % putting \!\special!s in $\celt_i$ as if \!\set@color! for it is invoked
626 % for all $\celt_i\in\cst$. Therefore from the viewpoint of a {\em
627 % printer}, it will see stack-rewinding at the end of each \colpage{} and
628 % the leaving points of \cswitch{}, while the beginning of each \colpage{}
629 % and the entry points of \cswitch{} should have the sequence of coloring
630 % \!\special!s to regain the \colorstack{} which the {\em printer} must have
631 % at each of the points.
632 %
633 % \SpecialArrayMainIndex{c}{\pcol@columncolor@box}
634 % 
635 % In addition, for each column $c$ we keep
636 % $\Uidx\Celt^c=|\pcol@columncolor@box|\cdot c$ as the {\em default} color
637 % of the column $c$, optionally given by the API macro \!\columncolor! or
638 % \!\normalcolumncolor!. If given for $c$, it is assumed to be at the bottom
639 % of the \colorstack{} denoted by
640 % $\Uidx\CST^c=(\Celt^c,\celt_1,\ldots,\celt_n)$ which we rewind\slash
641 % reestablish at each out-of-order jump in the column $c$.
642 %
643 %
644 %
645 % \subsubsection{Coloring in Horizontal Mode}
646 % \label{sec:imp-ovv-color-hmode}
647 % \changes{v1.22}{2013/06/30}
648 % {Add the subsection ``Coloring in Horizontal Mode''.}
649 % \changes{v1.34}{2018/05/07}
650 % {Revise the description of \Sec1.6.2 according to the new
651 % implementation with \cs{insert}.}
652 %
653 % We have to pay attention to the fact a coloring command can appear in
654 % horizontal mode of course, and thus push/pop operations in a \colpage{}
655 % would be done {\em before} the \colpage{} starts when \!\set@color! or
656 % \!\reset@color! is in the second half of a page-crossing paragraph and if
657 % we immediately performed push\slash pop of the \colorstack{} in these
658 % macros. In addition, even in vertical mode these macros can appear before
659 % \TeX{} finds a page break after which they must be in effect, if they are
660 % preceded by a sequence of non-breakable vertical items by which \TeX{}'s
661 % examination of the page break is {\em delayed} as well as the invocation
662 % of \!\output! at the break.
663 %
664 % In order to solve the problem of push/pop timing, we perform push\slash
665 % pop operations through \!\insert! to our own register set
666 % \!\pcol@colorins!. That is, we \!\insert! $\celt$ to \!\pcol@colorins!
667 % when we encounter a \!\set@color! for $\celt$, while its corresponding
668 % \!\reset@color! also \!\insert!s another \!\vbox! $\Uidx\celtpop$ of
669 % null-height\slash depth\slash width having a \!\special! which the
670 % \!\reset@color! puts into the main vertical list. Since we let
671 % $\!\count!\!\pcol@colorins!=0$ and $\!\skip!\!\pcol@colorins!=0$ to keep
672 % the \!\insert!ion from affecting the growth of \!\pagetotal!, it is
673 % guaranteed that an inserted $\celt$ or $\celtpop$ is given to \!\output!
674 % through \!\pcol@colorins! together with |\box255| containing the
675 % corresponding \!\special!.
676 %
677 % When \!\output! is invoked, \!\pcol@colorins! has $\Uidx\cstraw$
678 % containing $\celt_i$ and possibly its corresponding $\celtpop_i$.
679 % Therefore, if \!\output! is for a page break or a \cswitch, we remove all
680 % pairs of $\celt_i$ and $\celtpop_i$ from \!\pcol@colorins! to let it have
681 % $\cst$ only with $\celt_j$ whose corresponding $\celt_j^-$ is not in
682 % $\cstraw$. For this removal, we scan $\cstraw$ from its tail
683 % incrementing\slash decrementing a counter $\Uidx\npop$ which we initialize
684 % to 0 before scanning. In the scan, we remove all $\celtpop$
685 % unconditionally incrementing $\npop$, and $\celt$ such that $\npop>0$ on
686 % the encounter with it decrementing $\npop$. This scan is done by
687 % \!\pcol@clearcolorstack!, invoked from \!\pcol@opcol! for a page break and
688 % \!\pcol@output@switch! for a \cswitch{} through \!\pcol@clearcst@unvbox!,
689 % and is for rewinding the \colorstack{}
690 % $(\Celt^c,\cstraw)=\Uidx\CSTraw^c$. Therefore, for each $\celt$ to be kept
691 % because of $\npop=0$ on the encounter with it we put \!\special! for
692 % \!\reset@color!. Note that on another scan for stack reestablishment,
693 % \!\pcol@colorins! has $\cst$ and is kept unchanged. Also note that other
694 % \!\output! invocations such as that for floats do not touch $\cstraw$ to
695 % allow it grows with $\celt$ and $\celtpop$ corresponding to \!\set@color!
696 % and \!\reset@color! in the \colpage{} in which the invocation
697 % happens\footnote{
698 % 
699 % Unlike \cs{footins} which becomes void by putting its contents back to the
700 % main vertical list to reexamine the footnote placement possibly with
701 % splitting.}.
702 %
703 % The mechanism above especially for horizontal mode has subtle issues as
704 % follows.
705 % 
706 % \begin{itemize}
707 % \item
708 % If \!\set@color! appears in a \!\vbox!, the \!\insert!ion for pushing
709 % is not effective but corresponding \!\reset@color! can be outside of the
710 % \!\vbox! to make pushes and pops unbalanced because \!\aftergroup! for it
711 % inserts it just after the closing of the \!\vbox! if \!\set@color! is not
712 % surrounded by an inner group.
713 %
714 % \item
715 % If we are in vertical mode, we can know if we are in a \!\vbox! by
716 % \CSIndex{ifinner}. However, in horizontal or math mode, \CSIndex{ifinner}
717 % cannot help us because it is true iff we are in a \!\hbox! or in an
718 % in-text math. In short, \TeX{} does not provide us with any convenient
719 % means to know if we are in a \!\vbox!.
720 % \end{itemize}
721 % 
722 % To solve the problem above, we introduced a trick with \!\everyvbox! to
723 % turn a switch $\CSIndex{ifpcol@inner}=\true$ at the beginning of every
724 % \!\vbox! in a \env{paracol} environment, by which we suppress the
725 % \!\insert!ion for \!\set@color! because a \!\vbox! cannot cross a
726 % page boundary. As for that of \!\reset@color!, we suppress it by not
727 % reserving our own macro \!\pcol@reset@color@pop! for the \!\insert!ion by
728 % \!\aftergroup!. That is, we reserve both \!\reset@color! and
729 % \!\pcol@reset@color@pop! with \!\aftergroup! if we are outside of any
730 % \!\vbox!es, while does the former only otherwise. By the same reason, we
731 % suppress the \!\insert!ion if we are in restricted horizontal mode, i.e.,
732 % if both \CSIndex{ifhmode} and \CSIndex{ifinner} are true. On the other
733 % hand, we cannot suppress the \!\insert!ion when we are in an in-text math
734 % because it can cross a page boundary\footnote{
735 % 
736 % If an in-text math is in a \cs{hbox}, \cs{insert}ion is not
737 % necessary because the math cannot cross a page boundary. Though we can
738 % detect it by a trick with \!\everyhbox!, we abandon this idea because the
739 % request is not harmful. Another and more serious issue of coloring in
740 % math mode will be discussed shortly.}.
741 % 
742 % Note that the detailed implementation shown in \secref{sec:imp-startenv}
743 % does not interfere the use of \!\everyvbox! inside/outside of
744 % \env{paracol} environments or is not affected by the use.
745 %
746 % Another attention we should pay is that \!\color! will leave \!\aftergroup!
747 % tokens of \!\reset@color! and thus they are invoked just after
748 % \Endparacol. However, since we have completed all \colpage{}s in the
749 % \lpage, the \colorstack{} in |.dvi| should be empty. Therefore to avoid
750 % stack underflow, we should reestablish $\cst$ (not $\CST^c$) so that
751 % elements in the stack are popped by \!\reset@color! invoked with the
752 % \!\aftergroup! mechanism. We also take care of our own \colorstack{}
753 % popper \!\pcol@reset@color@pop! which must do nothing, i.e., must not make
754 % an \!\insert!ion, after we completed the \lpage, i.e., if
755 % \CSIndex{ifpcol@output} is $\false$.
756 %
757 %
758 %
759 % \subsubsection{Changing Default Column Color}
760 % \label{sec:imp-ovv-color-colcolor}
761 % \changes{v1.34}{2018/05/07}
762 % {Split the description of \cs{columncolor} from \Sec1.6.2 to have
763 % new \Sec1.6.3 ``Changing Default Column Color'' because we have
764 % several new issues in the new implementation with \cs{insert}.}
765 %
766 % The implementation of \!\columncolor! and \!\normalcolumncolor! is
767 % relatively easy for the cases that they appear outside
768 % \env{paracol} environment or they define the default color of a
769 % column different from the current column. That is, for the default color
770 % of a column $c$ we simply \!\def!ine
771 % ${\Uidx\Celtshadow}^c=|pcol@columncolor|\cdot c$ to let it have what
772 % \!\current@color! has for the color. Then, in \beginparacol{} in the
773 % former case or immediately in the latter, we let
774 % $\Celt^c=|pcol@coloumncolor@box|\cdot c$ have the coloring \!\special! for
775 % the color acquiring an \!\insert! from \!\@freelist! if the box is
776 % $\bot$.
777 % 
778 % \SpecialArrayMainIndex{c}{\pcol@columncolor}
779 % \SpecialArrayIndex{c}{\pcol@columncolor@box}
780 %
781 % On the other hand, when the API commands are to define the default color
782 % of the current column $c$, we need to place the coloring at the bottom of
783 % \colorstack{}s in terms of |.tex| and |.dvi|. That is, for the former we
784 % have to rewind and reestablish the stack which can be different from
785 % $\CST^c$ because the API command can follow a page break which \TeX{} does
786 % not yet find. Therefore, we maintain a {\em shadow} of $\cst$ namely;
787 % $$
788 % {\Uidx\cstshadow}={\Midx{\!\pcol@colorstack@shadow!}}
789 % =({\Uidx\celtshadow}_1,\celtshadow_2,\ldots,\celtshadow_n)
790 % =\!\@elt!\Arg{\celtshadow_1}\;\!\@elt!\Arg{\celtshadow_2}\;\cdots\;
791 % \!\@elt!\Arg{\celtshadow_n}
792 % $$
793 % to which our version of \!\set@color! pushes $\celtshadow_i$ being
794 % \!\current@color! which the original one defines, while popping is done
795 % automatically by \TeX's grouping mechanism because pushes are done by
796 % \!\edef! rather than \!\xdef!. Then before we \!\def!ine $\Celtshadow^c$
797 % we rewind
798 % ${\Uidx\CSTshadow}^c=(\Celtshadow^c,\celtshadow_1,\ldots,\celtshadow_n)$
799 % putting \!\special! for pop to the main vertical list for each elements,
800 % and then after the \!\def!initon of $\Celtshadow^c$ we reestablish
801 % $\CSTshadow^c$ putting coloring \!\special! for each element.
802 %
803 % As for placing $\Celt^c$ at the bottom of $\CST^c$, we must ensure that
804 % the placement is done for the \colpage{} in which the API command
805 % belongs to, as we did in ordinary push\slash pop of the \colorstack.
806 % Therefore the API command \!\insert!s $\Celt^c$ to $\cstraw$ in the form
807 % of a \!\vbox!, whose height and depth are 1\,|sp| and width is 0,
808 % containing the coloring \!\special! for $\Celt^c$. Then when $\cstraw$ is
809 % scanned for rewinding in \!\output!, this \!\vbox! is found to let
810 % $\Celt^c$ have the \!\special! acquiring an \!\insert! from \!\@freelist!
811 % it was $\bot$. Note that $\cstraw$ may have multiple \!\vbox!es to update
812 % $\Celt^c$ and if so the last one is effective.
813 %
814 %
815 %
816 % \subsubsection{Coloring in Math Mode}
817 % \label{sec:imp-ovv-color-mmode}
818 % \changes{v1.24}{2013/07/27}
819 % {Add the subsection ``Coloring in Math Mode''.}
820 % \changes{v1.34}{2018/05/07}
821 % {Revise the description of \Sec1.6.4 according to the new
822 % implementation with \cs{insert}.}
823 %
824 % Unfortunately the solution above is imperfect because \TeX{} builds an
825 % implicit \!\hbox! for a |{|\textit{math stuff}|}| construct in math mode
826 % and an \!\insert! in the construct does not contribute to
827 % the main vertical list at all\footnote{
828 % 
829 % The contents is not thrown away but \cs{insert}ion itself is added
830 % to the list rather than given to \cs{output}.}.
831 % 
832 % Since the implicit \!\hbox! does not care about \!\everyhbox!, we cannot
833 % use the trick similar to that with \!\everyvbox!. Another bad news is
834 % that built-in \cs{if}s for mode checking cannot help us because we always
835 % have $\CSIndex{ifvmode}=\CSIndex{ifhmode}=\false$ and
836 % $\CSIndex{ifmmode}=\true$ while $\CSIndex{ifinner}$ is $\true$ or $\false$
837 % when we are in in-text or displayed math mode respectively. Therefore, we
838 % have to take care of the potential loss of \!\insert!ion for pushes and
839 % thus unmatched pops in $\cstraw$.
840 %
841 % For example, we have to remember that, in the cases like
842 % |${|\!\color!$\Arg{c}\textit{text}$|}$| or
843 % |$|\!\textcolor!$\~\Arg{c}\ARg{text}$|$| expanded to the former, the
844 % \!\insert!ion for push is lost while its counterpart for pop survives
845 % making it necessary to check the existence of pushing counterpart for each
846 % pop in $\cstraw$\footnote{
847 % 
848 % Since a pop is always in a group one level outer from its push
849 % counterpart, the pop request should be presented if the push does.}.
850 % 
851 % Note that the fact that the pop in the examples is in the in-text math
852 % does not help us, because the pop in
853 % |$|\!\begingroup!\!\color!\Arg{c}\textit{text}\!\endgroup!|$| is also in
854 % the in-text math while its pushing counterpart performs an effective
855 % \!\insert!ion, and two \!\insert!ions must be presented in $\cstraw$
856 % because we can have a page-break in \textit{text}. Therefore, we have to
857 % find a means to examine whether a pop $\celtpop_i$ has its counterpart
858 % $\celt_i$ in $\cstraw$ to remove $\celt_i$ from $\cstraw$ if exists or to
859 % ignore $\celtpop_i$ otherwise. That is, we have to attach an identifier
860 % $m$ to $\celt_i$ and $\celtpop_i$, i.e., to make them $\Uidx\mcelt_{i,m}$
861 % and $\Uidx\mceltpop_{i,m}$.
862 %
863 % Since the only means we have for the communication with \!\output! routine
864 % is what we \!\insert! to $\cstraw$, the \!\insert!ed \!\vbox! must carry an
865 % identifier $m$ for a push\slash pop in math mode. To do that, we make
866 % \!\vbox! $m$\,|sp| wide ($m>0$) if our version of \!\set@color! is in math
867 % mode to represent $\mcelt_{i,m}$ and $\mceltpop_{i,m}$, while the width is
868 % 0 otherwise as described in \secref{sec:imp-ovv-color-hmode}. Then in the
869 % scan of $\cstraw$ for rewinding in \!\output!, we suppress
870 % incrementing\slash decrementing $\npop$ for $\mcelt_{i,m}$ and
871 % $\mceltpop_{i,m}$, but remove $\mcelt_{i,m}$ if $\mceltpop_{i,m}$ is in
872 % $\cstraw$ as a successor while we keep it in $\cstraw$ otherwise putting a
873 % \!\special! of pop for it to the main vertical list.
874 %
875 % To ensure that $\mcelt_{i,m}$ has its counterpart $\mceltpop_{i,m}$ in
876 % $\cstraw$ iff the push and pop are in a \colpage, we maintain the counter
877 % \!\pcol@mcid! incremented before (the attempt of) the \!\insert!ion of
878 % $\mcelt_{i,m}$ with $m=\!\pcol@mcid!$ and the \!\aftergroup! reservation
879 % for that of $\mceltpop_{i,m}$. Then the counter is zero-cleared by
880 % \!\output! routine in order to keep it less than
881 % $\!\pcol@mcpushlimit!=1000$ unless, roughly speaking, a \colpage{} has a
882 % unexpectedly large number of math constructs having coloring commands in
883 % them. Note that this zero-clearing does not ensure that an identifier $m$
884 % is unique in $\cstraw$. That is, it can happen that $\cstraw$ has
885 % $\mcelt_{i,m}$, $\mceltpop_{i,m}$, $\mcelt_{j,m}$ and/or $\mceltpop_{j,m}$
886 % in this order for $i<j$, when two math constructs with coloring for $i$
887 % and $j$ are in different paragraphs and \!\output! is invoked at or after
888 % the end of the paragraph with the math for $i$. This potential
889 % duplication is, however, unharmful because of the following.
890 % 
891 % \begin{itemize}
892 % \item
893 % Since a math construct cannot have immediate \!\output! invocations in it,
894 % the order of the elements in $\cstraw$ must be $\mcelt_{i,m}$,
895 % $\mceltpop_{i,m}$, $\mcelt_{j,m}$ and $\mceltpop_{j,m}$ from its bottom to
896 % top, though some of them could be missing. Therefore, if
897 % $\mceltpop_{i,m}$ is in $\cstraw$, then $\mcelt_{j,m}$ must follow it if
898 % it exists not causing accidental matching with $\mceltpop_{i,m}$.
899 %
900 % \item
901 % If $\mcelt_{i,m}$ is in $\cstraw$ but $\mceltpop_{i,m}$ is not, it means
902 % we have a page break between vertical items corresponding to
903 % $\mcelt_{i,m}$ and $\mceltpop_{i,m}$ to keep the \!\insert!ion of
904 % $\mceltpop_{i,m}$ and anything following it from appended into $\cstraw$.
905 % Therefore, $\cstraw$ cannot have $\mceltpop_{j,m}$ not causing accidental
906 % matching with $\mcelt_{i,m}$.
907 % \end{itemize}
908 %
909 %
910 %
911 % \subsubsection{Emptiness of a Column-Page}
912 % \label{sec:imp-ovv-color-emptycol}
913 %
914 % The mechanism above works well with respect to coloring, but it has a
915 % problem that a \colpage{} created by, for example, a forced page break may
916 % not be perfectly empty but can have some coloring \!\special!s for
917 % \colorstack{} reestablishing and rewinding. They are of course invisible
918 % but affect the examination of \colpage{} emptiness for \exsync. That is,
919 % we examine if a \colpage{} does not have anything by a tricky way by
920 % \!\pcol@ifempty! but the existence of coloring \!\special!s makes the
921 % examination failed even if no other ordinary stuff such as boxes and skips
922 % are in the \colpage.
923 %
924 % Therefore we need to put coloring \!\special!s for \colorstack{}
925 % establishing and rewinding a little bit more carefully to avoid empty
926 % \colpage{}s just having such \!\special!s as follows. When we start a new
927 % \colpage{}, we don't put \!\special!s for establishing immediately but
928 % save the \colorstack{} $\CST^c$ into
929 % $\Uidx\csts=\!\pcol@colorstack@saved!$. Then when we leave the
930 % \colpage{} by switching or page breaking, we examine the emptiness of the
931 % \colpage{} and if so we do nothing, while otherwise we put the
932 % \!\special!s for reestablishing $\csts$ at the top of the \colpage{} and
933 % those for rewinding $\cstraw$ at the bottom. Similarly, when we revisit a
934 % \colpage, we examine its emptiness and if so we save $\CST^c$ into
935 % $\csts$, while otherwise we put \!\special!s for reestablishing $\CST^c$
936 % and nullify $\csts$ so that nothing will be put at the top of the
937 % \colpage{} when we leave it. By these mechanisms, an empty \colpage{}
938 % should not have coloring \!\special!s, while non-empty ones should have a
939 % sequence of triples; reestablishing \!\special!s; ordinary main vertical
940 % list items including coloring \!\special!s inserted by \!\color! etc.; and
941 % then rewinding \!\special!s.
942 %
943 %
944 %
945 % \subsection
946 % [Parallel-Paging, Column-Swapping, Column-Separating Rule
947 % Drawing and Background Painting]
948 % {Parallel-Paging, Column-Swapping, Column-Separating\\Rule
949 % Drawing and Background Painting}
950 % \label{sec:imp-ovv-cswap}
951 % \changes{v1.2-4}{2013/05/11}
952 % {Add the subsection ``Column-Swapping''}
953 % \changes{v1.3-1}{2013/09/17}
954 % {Change the section title from ``Column-Swapping'' to
955 % ``Parallel-Paging, Column-Swapping, Column-Separating Rule Drawing
956 % and Background Painting'' to discuss related issues together''.}
957 % \changes{v1.3-2}{2013/09/17}
958 % {Add overview description of parallel-paging.}
959 % \changes{v1.3-3}{2013/09/17}
960 % {Add overview description of column-separating rule drawing and
961 % background painting.}
962 % 
963 % We have the following four extensions, which are correlated to each other,
964 % from the basic parallel-columning.
965 % 
966 % \paragraph{\em Parallel-paging}\UsageIndex{parallel-paging}\hskip-.5em
967 % to extend the concept of parallel-columning in a page to a pair of
968 % adjacent pages. A {\em left} \parapag{}e starts from column-0, has
969 % $\Uidx\CL$ columns where $\CL$ is given by the first optional argument of
970 % \beginparacol, while a {\em right} \parapag{}e starts from column-$\CL$
971 % and has $\C-\CL$ columns. Since we let $\CL=\C$ when \parapag{}ing is not
972 % in effect, we may ship out columns $c\In0\CL$ always and then, if
973 % $\CL<\C$, ship out columns $c\In\CL\C$ as a right \parapag{}e.
974 %
975 % The pair of \parapag{}es can be {\em\Uidx\paired} to comprise a virtual
976 % page $p$ and thus has common page number $\page(p)$, while
977 % {\em\Uidx\npaired} \parapag{}ing produces two individual pages from a
978 % internal page $p$ (i.e., set of all columns $\Set{c}{c\In0\C}$) whose
979 % left and right components have page numbers $\page(p)$ and $\page(p)+1$
980 % respectively. Since a page $p$ is internally considered as the set of all
981 % columns $c\In0\C$ always, regardless of \paired{} or \npaired{}
982 % \parapag{}ing, the difference between them arises only in two-sided
983 % ship-out process in which the header, footer and left-margin are common
984 % for left\slash right \paired{} \parapag{}s while they have to depend on
985 % the parity of the number of each \npaired{} \parapag{}e. Note that
986 % \textsf{paracol} does not specify the parity of a left \npaired{}
987 % \parapag{}e number, but the number is decided by the page from which a
988 % \parapag{}ed \env{paracol} environment starts.
989 %
990 % In ship-out process, we build the ship-out image of a right \parapag{}e in
991 % our own \!\box! register \!\pcol@rightpage! instead of the usual
992 % \!\@outputbox!. The register, however, must {\em survive} after
993 % \Endparacol{} to keep the columns in the last right \parapag{}e,
994 % 
995 % \Index{last page}
996 % 
997 % so that it is shipped out when the whole of last page including \postenv{}
998 % is shipped out, or, more complicatedly, to be passed to the next
999 % \env{paracol} environment as a part of its \preenv.
1000 %
1001 % {\em Page-wise stuff}
1002 % \UsageIndex{page-wise stuff}
1003 % spanning all columns, i.e., \spanning{} being \preenv{} or \pwise{}
1004 % floats, \mctext{}s, \scfnote{} footnotes and \postenv{} are always placed
1005 % in a left \parapag{}e, while the corresponding regions for them in a right
1006 % \parapag{}e are always blank\footnote{
1007 % 
1008 % So far. In some future, we could implement a special setting to let
1009 % \preenv{}, \postenv{} and \scfnote{} footnotes are split into both
1010 % \parapag{}es, and to make it possible that a \pwise{} float or a
1011 % \mctext{} has its counterpart placed in the corresponding right
1012 % \parapag{}e.}
1013 % 
1014 % unless \preenv{} has the \lpage{} of the previous \env{paracol}
1015 % environment.
1016 %
1017 % \paragraph{\em Column-swapping}\UsageIndex{column-swapping}\hskip-.5em
1018 % to reverse the order of columns in even numbered pages from left-to-right
1019 % to right-to-left. It is enabled by the specifier `|c|' of
1020 % \!\twosided!\footnote{
1021 % 
1022 % Or the backward compatible macro \!\swapcolumninevenpages!.}.
1023 % 
1024 % Though it is fundamentally simple because we just need to reverse the
1025 % scanning order of columns from left-to-right (i.e., 0 to $\C-1$) to
1026 % right-to-left (i.e., $\C-1$ to 0) in the ship-out process of an even
1027 % numbered page, there are a few complications in the implementation of
1028 % related functionalities.
1029 %
1030 % First, a \paired{} \parapag{}e should also be swapped so that a
1031 % \emph{physical} left (resp.\ right) \parapag{}e has columns $\C-1$ to
1032 % $\CL$ (resp.\ $\CL-1$ to 0) in this order. Note that this \parapag{}e
1033 % swapping also swaps the page in which \pwstuff{} are placed. That is, if
1034 % both \paired{} \parapag{}ing and \cswap{} are in effect, \pwstuff{} are
1035 % placed in the physical right \parapag{}e, or in other words they always
1036 % placed in the page in which column-0 resides. Note that since \cswap{}
1037 % with \npaired{} \parapag{}ing is meaningless and thus \cswap{} is
1038 % disabled.
1039 %
1040 % Second, the side margin to which a marginal note goes can be swapped but
1041 % enabling this swap is independent of \cswap{} and done by the specifier
1042 % `|m|' of \!\twosided!, though almost all users will specify both swapping
1043 % consistently. Since the side margin for a marginal note is decided in
1044 % \!\output! routine by \!\pcol@addmarginpar! being our own version of
1045 % \LaTeX's macro for marginal notes \!\@addmarginpar!, the page in which the
1046 % marginal note resides has been fixed. However, the number of the page and
1047 % thus its parity may not have been fixed yet due to the possible jump in
1048 % column-0 taking place afterward, unlike \cswap{} for which the page number
1049 % has been fixed because it is performed in ship-out process. Since it is
1050 % too costly to avoid this possibly wrong placement, we have to accept the
1051 % possibility as \LaTeX{} itself does. Also unlike \cswap, the swapping of
1052 % marginal notes is not disabled in \npaired{} \parapag{}ing because it is
1053 % meaningful.
1054 %
1055 % Another remark for marginal notes is that two ore more columns may {\em
1056 % share} a margin, inevitably if a (parallel) page has three or more columns
1057 % or intentionally with a setting of \!\marginparthreshold!. Therefore, the
1058 % context of marginal notes cannot be in \cctext{} but should be in \pctext,
1059 % or cannot simply give the bottom of the last marginal note (i.e., \LaTeX's
1060 % \!\@mparbottom!) but should show all marginal notes in margins in a
1061 % page\footnote{
1062 % 
1063 % Before version 1.3, we have \!\@mparbottom! in \cctext{} because a column
1064 % has its own area for marginal notes, which can be the gap between columns
1065 % rather than a margin of a page.}.
1066 % 
1067 % Therefore, each \pctext{} has all marginal notes in the form of lists of
1068 % their top and bottom positions in all margins as $\pp^m(p)$, so that we
1069 % find a space for a marginal note in a column to add it to not only to the
1070 % bottom but also into a space between two marginal notes having already
1071 % been put by other columns.
1072 %
1073 % Third and finally, we have to take care the placement of \mctext{}s. In
1074 % version 1.2 to which \cswap{} is introduced, we let a \mctext{} belong to
1075 % column-$(\C-1)$ instead usual column-0 so that its left edge is aligned to
1076 % the left edge of the leftmost column, i.e., that of the text area.
1077 % However this simple solution has a severe problem that, if a \mctext{} is
1078 % broken into two pages, its second half should be put in the rightmost
1079 % column. In addition, even when a \mctext{} does not have page break in
1080 % it, such wrong placement may happen if the text is followed by \!\nobreak!
1081 % and thus a page break is made above the text but {\em after} the text is
1082 % processed.
1083 %
1084 % In version 1.3, this problem is solved by capturing the first half of a
1085 % \mctext{} in \!\output! routine for the page break in the text, and the
1086 % second half or the whole of it in that for \sync{}ed \cswitch{} to close
1087 % the text. Since an invocation of \!\output! routine means that it has been
1088 % fixed which page the \mctext{} or its part resides in, we can place the
1089 % text much more reliably expecting the parity of the page number has also
1090 % been fixed. In addition, this decision making in \!\output! routine allows
1091 % (or forces) us to let \mctext{}s always belong to column-0 preserving the
1092 % consistency of, for example, local counter values referred to in them,
1093 % while we need to shift a text to the left edge of the text area if it
1094 % resides in an even numbered page. Furthermore, this \mctext{} capturing
1095 % enables to measure the vertical size of the captured text together with the
1096 % vertical position of its top edge to record them in the list $\pp^s(p)$,
1097 % so that we draw \cseprule{}s skipping the text and painting its \bground{}
1098 % with a specific color different from colors of columns and \csepgap{}s, as
1099 % discussed shortly.
1100 %
1101 % \paragraph{\em Column-separating rule drawing}
1102 % \UsageIndex{column-separating rule}\hskip-.5em
1103 % to draw a vertical rule in {\em\Uidx\csepgap} is correlated with a part of
1104 % {\em\bgpaint} to paint each region in a page with a color specific to the
1105 % region. Thanks to the list of \mctext{}s $\pp^s(p)=(\spt(H_i,h_i))_i^n$, we
1106 % can draw \cseprule{}s skipping \mctext{}s in the page $p$ as the sequence
1107 % of;
1108 % 
1109 % \begingroup
1110 % \def\RULE{\mathit{rule}}\def\GAP{\mathit{gap}}
1111 % \begin{eqnarray*}
1112 % &&\RULE(H'_1),\GAP(h_1),\ldots,\RULE(H'_n),\GAP(H'_n),\RULE(H'_{n+1})\\
1113 % &&H'_i=H_i-(H_{i-1}+h_{i-1})
1114 % \qquad H_0=h_0=0
1115 % \qquad H_{n+1}=\pp^h(p)
1116 % \end{eqnarray*}
1117 % \endgroup
1118 % 
1119 % where $\mathit{rule}(H')$ is a vertical rule of $H'$ high and
1120 % $\mathit{gap}(h)$ is a vertical space of $h$. A rule may be colored with
1121 % the color specified by \!\colseprulecolor! for each \csepgap{} or all
1122 % of them. Note that if \cswap{} is in effect, a column $c$ is {\em
1123 % preceded} by $c$-th \csepgap{} which may have its own width and color for
1124 % its rule, rather than being followed by it.
1125 %
1126 % \paragraph{\em Background painting}\UsageIndex{background painting}\hskip-.5em
1127 % also uses the list $\pp^s(p)$ to paint the \bground{} of each column-$c$
1128 % with the color $\Uidx\bgc_c^c$, each \csepgap{} following the column-$c$
1129 % with $\bgc_g^c$, and \mctext{}s with $\bgc_s$ and $\bgc_S$, where
1130 % $\bgc_a^{[c]}$ is specified by the second argument of
1131 % $\!\backgroundcolor!\Arg{\hbox{\ttfamily\itshape a}|[|c|]|}\~\Arg{color}$
1132 % ($\hbox{\ttfamily\itshape a}\in\{|c|,|g|,|s|,|S|\}$) and kept in the macro
1133 % $|\pcol@bg@color@|{\cdot}a[|@|{\cdot}c]$.
1134 % 
1135 % \SpecialArrayMainIndex{a}{\pcol@bg@color@}
1136 % \SpecialArrayMainIndex{a{\cdot}\string\texttt{@}{\cdot}c}{\pcol@bg@color@}
1137 % 
1138 % The region to be painted for each item is as follows where
1139 % $[(x_0,y_0)(x_1,y_1)]$ means the region
1140 % $\Set{(x,y)}{x\In{x_0}{x_1},\;y\In{y_0}{y_1}}$ of the top-down
1141 % $xy$-coordinate whose origin is at the left-top corner of the leftmost
1142 % column.
1143 % 
1144 % \begingroup\def\sS{{\{s,S\}}}
1145 % \begin{eqnarray*}
1146 % \Uidx\bgr_c^c(i)&=&[(\Uidx\W_c,\;H_{i-1}+h_{i-1})\;
1147 % (\W_c+w_c,\;H_i+d_{c/g})]\\
1148 % \bgr_g^c(i)&=&[(\W_c+w_c,\;H_{i-1}+h_{i-1})\;(\W_{c+1},\;H_i+d_{c/g})]\\
1149 % \bgr_\sS(i)&=&[(0,\;H_i)\;(\Uidx\WT,\;H_i+h_i+d_s)]\\
1150 % \W_{c}&=&\sum_{d=c_0}^{c-1}(w_c+g_c)\qquad
1151 % c_0=\cases{0&$c<\CL$\cr
1152 % \CL&$c\geq\CL$}\qquad
1153 % \WT=\!\textwidth!\\
1154 % d_{c/g}&=&\cases{\!\maxdepth!&$i=n+1\;\land\;H'_{n+1}>0\;\land\;$non-\lpage\cr
1155 % 0&otherwise}\\[1ex]
1156 % d_s&=&\cases{H_{n+1}-(H_n+h_n)+\!\maxdepth!&
1157 % $i=n\;\land\;H'_{n+1}=0\;\land\;$non-\lpage\cr
1158 % 0&otherwise}
1159 % \end{eqnarray*}
1160 % \endgroup
1161 % 
1162 % In the specifications above, $\w_c$ and $\Uidx\gap_c$ is the width of the
1163 % column $c$ and that of the \csepgap{} following it, defined by
1164 % \!\columnratio! or \!\setcolumnwidth! and stored in
1165 % $|\pcol@columnwidth|{\cdot}c$ and $|\pcol@columnsep|{\cdot}c$
1166 % respectively.
1167 % 
1168 % \SpecialArrayIndex{c}{\pcol@columnwidth}
1169 % \SpecialArrayMainIndex{c}{\pcol@columnsep}
1170 % 
1171 % The additions of $d_{c/g}$ and $d_s$ are to extend the bottom edge of each
1172 % region down to the bottom of text area. In addition, for each
1173 % $\bgr_a^{[c]}=[(x_0,y_0)(x_1,y_1)]$, {\em\Uidx\bgext}s
1174 % $\Uidx{\bge}_a^{[c]}(\{x,y\}^\pm)$ can be specified to shift the base
1175 % points $x_0$, $y_0$, $x_1$ and $y_1$ left ($x^-$), right ($x^+$), upward
1176 % ($y^-$) and downward ($y^+$) respectively. That is, a region is defined
1177 % as;
1178 % $$
1179 % \bgr_a^{[c]}=[(x_0-\bge_a^{[c]}(x^-),\;y_0-\bge_a^{[c]}(y^-))\;
1180 % (x_1+\bge_a^{[c]}(x^+),\;y_1+\bge_a^{[c]}(y^+))]
1181 % $$
1182 % \begingroup\par\hfuzz0.9pt\noindent
1183 % with the optional shifts specified by the first argument of
1184 % \!\backgroundcolor! as
1185 % \Arg{\hbox{\ttfamily\itshape{a}}\oarg{c}$|(|x^\pm|,|y^\pm|)|$} (for both
1186 % $x^-$/$y^-$ and $x^+$/$y^+$) or \Arg{\hbox{\ttfamily\itshape
1187 % a}\oarg{c}$|(|x^-|,|y^-|)||(|x^+|,|y^+|)|$} and kept in macros
1188 % $|\pcol@bg@ext@|{\cdot}\~d{\cdot}|@|{\cdot}a[{\cdot}|@|{\cdot}c]$
1189 % 
1190 % \SpecialArrayIndex{d{\cdot}\string\texttt{@}{\cdot}a}{\pcol@bg@ext@}
1191 % \SpecialArrayIndex
1192 % {d{\cdot}\string\texttt{@}{\cdot}a{\cdot}\string\texttt{@}{\cdot}c}
1193 % {\pcol@bg@ext@}
1194 % 
1195 % where $d\in\{|l|,|r|,|t|,|b|\}$ for $x^-$ (|l|), $x^+$ (|r|), $y^-$ (|t|)
1196 % and $y^+$ (|b|). Note that $\bge_a^{[c]}(\{x,y\}^\pm)$ can be extremely
1197 % large, namely greater than or equal to 9000pt, to mean the region is
1198 % extended to a border near by the corresponding paper edge. More
1199 % specifically, by this {\em\Uidx\bginfext}, each $xy$ coordinate in
1200 % $[(x_0,y_0)(x_1,y_1)]$ is defined as follows to represent a coordinate
1201 % being $10000\PT-\bge_a^{[c]}(\{x,y\}^\pm)+\!\pagerim!$ inside from the page
1202 % edge;
1203 % \par\endgroup
1204 % 
1205 % \begingroup \def\feven{f_{\mathit{even}}}
1206 % \begin{eqnarray*}
1207 % x_0&=&-\WM+(10000\PT-\bge_a^{[c]}(x^-)+\WR)\\
1208 % y_0&=&-(\HS+\HM)+(10000\PT-\bge_a^{[c]}(y^-)+\HR)\\
1209 % x_1&=&(\WP-\WM)-(10000\PT-\bge_a^{[c]}(x^+)+\WR)\\
1210 % y_1&=&(\HP-\HS-\HM)-(10000\PT-\bge_a^{[c]}(y^+)+\HR)\\
1211 % \Uidx\WP&=&\!\paperwidth!\\
1212 % \Uidx\WM&=&1|in|+\cases{\!\oddsidemargin!&$\lnot\feven$\cr
1213 % \!\evensidemargin!&$\feven$}\\
1214 % \Uidx\WR&=&\Uidx\HR=\!\pagerim!\\
1215 % \Uidx\HP&=&\!\paperheight!\\
1216 % \Uidx\HM&=&\!\headsep!+\!\headheight!+\!\topmargin!+1|in|\\
1217 % \Uidx\HS&=&\mathit{height}(\pp^b(p))+\mathit{depth}(\pp^b(p))
1218 % \end{eqnarray*}
1219 % \endgroup
1220 % 
1221 % where $f_{\mathit{even}}$ is $\true$ iff we are in an even numbered page
1222 % and two-sided typesetting is specified by the optional argument of
1223 % \!\documentclass! or by the specifier `|p|' of \!\twosided! explicitly or
1224 % implicitly.
1225 %
1226 % Another remark is that \cswap{} affects $\bgr_c^c(i)$ and $\bgr_s^c(i)$ to
1227 % {\em\Uidx\mirror} the region making a reflection-symmetric transformation
1228 % on it using a vertical edge of a page as the axis. That is,
1229 % $[(x_0,y_0)(x_1,y_1)]$ for a region is transformed to
1230 % $[(\WT-x_1,y_0)(\WT-x_0,y_1)]$ if $x_{\{0,1\}}$ is not extended infinitely.
1231 % With \bginfext{} on the other hand, before this transformation $x_0$ and/or
1232 % $x_1$ are calculated by the rule above replacing $\WM$ with
1233 % $\WP-(\WM+\WT)$ to represent the width of the right margin rather than the
1234 % left.
1235 %
1236 % On the other hand, the \mirror{}ing of $\bgr_{\{s,S\}}$ is enabled by the
1237 % specifier `|b|' of \!\twosided!, together with other regions being top
1238 % margin ($t,T$), bottom margin ($b,B$), left margin ($l,L$), right margin
1239 % ($r,R$), \pwise{} floats ($f,F$) and \scfnote{} footnotes ($n,N$). The
1240 % geometrical specifications $\bgr_a$ for those regions are given as follows,
1241 % but the coordinate origin is at the top-left corner of text area (rather
1242 % than the leftmost column).
1243 % 
1244 % \begin{eqnarray*}
1245 % \bgr_{\{t,T\}}&=&[(-\WM+\WR,\;-\HM+\HR),\;(\WP-\WM-\WR,\;0)]\\
1246 % \bgr_{\{b,B\}}&=&[(-\WM+\WR,\;\HT-\HM),\;(\WP-\WM-\WR,\;\HP-\HM-\HR)]\\
1247 % \bgr_{\{l,L\}}&=&[(-\WM+\WR,\;0),\;(0,\HT)]\\
1248 % \bgr_{\{r,R\}}&=&[(\WT,\;0),\;(\WP-\WM-\WR,\;\HT)]\\
1249 % \bgr_{\{f,F\}}&=&[(0.\;0),\;(\WT,\;\HS)]\\
1250 % \bgr_{\{n,N\}}&=&[(0,\;\HT-\HN)\;(\WT,\;\HT)]\\
1251 % \Uidx\HT&=&\!\textheight!+\!\maxdepth!\\
1252 % \Uidx\HN&=&\!\skip!\!\footins!+\!\ht!\!\footins!+\!\dp!\!\footins!
1253 % \end{eqnarray*}
1254 % 
1255 % Note that, since we use text area coordinates, in the calculation of
1256 % \bginfext{} $\HS$ is let be 0.
1257 %
1258 % We have other regions for columns and \csepgap{}s, namely $\bgr_C^c$ and
1259 % $\bgr_G^c$, which vertically span all over text area regardless existence
1260 % of any \pwstuff. Therefore, their geometrical specifications are as
1261 % follows with text area coordinates.
1262 % 
1263 % \begin{eqnarray*}
1264 % \bgr_C^c&=&[(\W_{c-1},\;0),\:(\W_{c-1}+w_c,\;\HT)]\\
1265 % \bgr_G^c&=&[(\W_{c-1}+w_c,\:0),\;(\W_c,\;\HT)]
1266 % \end{eqnarray*}
1267 % 
1268 % In addition, we have to paint \preenv{} and \postenv{} with color
1269 % $\bgc_{\{p,P\}}$. The region $\bgr_{\{p,P\}}$ for them is defined as
1270 % follows with text area coordinates where $\Uidx\HB$ is the $y$-coordinate
1271 % of the bottom of previous \env{paracol} environment if any, or 0
1272 % otherwise.
1273 % $$
1274 % \bgr_{\{p,P\}}=\cases{
1275 % [(0,\;\HB)\;(\WT,\;\HS)]& \preenv\cr
1276 % [(0,\;\HB)\;(\WT,\;\HT)]& \postenv}
1277 % $$
1278 % Note that painting of \postenv{} is done {\em outside} \env{paracol}
1279 % environment when the \postenv{} encounters a page break, unless another
1280 % \env{paracol} environment starts in the page and thus the \postenv{}
1281 % becomes \preenv{} of the second (or subsequent) environment.
1282 %
1283 % Finally, we define the order of \bgpaint{} as follows, where $a$, $a(i)$,
1284 % $a^c$ and $a^c(i)$ mean $\bgr_a$, $\bgr_a(i)$, $\bgr_a^c$ and
1285 % $\bgr_a^c(i)$ respectively, so that a succeeding region is {\em overlaid}
1286 % on preceding regions.
1287 % 
1288 % \begin{eqnarray*}
1289 % T&\to&B\to L\to R\\
1290 % &\to&G^0\to\cdots\to G^{\C-2}\to C^0\to\cdots\to C^{\C-1}\\
1291 % &\to&t\to b\to l\to r\to N\to n\to\{F,P\}\to\{f,p\}\footnotemark\\
1292 % &\to&S(1)\to\cdots\to\S(n)\\
1293 % &\to&g^0(1)\to\cdots\to g^{\C-2}(1)\to c^0(1)\to\cdots\to c^{\C-1}(1)\to
1294 % s(1)\\
1295 % &\to&\cdots\\
1296 % &\to&g^0(n)\to\cdots\to g^{\C-2}(n)\to c^0(n)\to\cdots\to c^{\C-1}(n)\to
1297 % s(n)\\
1298 % &\to&g^0(n{+}1)\to\cdots\to g^{\C-2}(n{+}1)
1299 % \to c^0(n{+}1)\to\cdots\to c^{\C-1}(n{+}1)
1300 % \end{eqnarray*}
1301 % 
1302 % \footnotetext{In column flushing, the order is $\{F,P\}\to\{f,p\}\to N\to
1303 % n$ but this reversion should have no effect (almost always).}
1304 %
1305 %
1306 %
1307 % \subsection{Page-wise Float Placement}
1308 % \label{sec:imp-ovv-float}
1309 % \changes{v1.32-3}{2015/10/10}
1310 % {Add the section ``Page-wise Float Placement'' to discuss the
1311 % page-wise float problem.}
1312 %
1313 % In the release on 2015/01/10, \LaTeX{}'s float placement mechanism was
1314 % drastically changed to avoid {\em out-of-order\/} appearance of \pwise{}
1315 % floats as follows. Since the cause of overtaking of a \pwise{} float by a
1316 % \cwise{} float is that they are in two separated lists \!\@dbldeferlist!
1317 % for the former and \!\@deferlist! for the latter, in the new implementation
1318 % the two lists are merged to let all floats go to \!\@deferlist!. To
1319 % distinguish \pwise{} and \cwise{} floats in the list, \!\end@dblfloat!
1320 % lets the \pwise{} float processed by the macro have a special depth of
1321 % |1sp|, while depth of \cwise{} floats are 0 since \!\@endfloatbox! add a
1322 % \!\vskip! of 0 at the end of the box of floats.
1323 %
1324 % Then all float placement macros invoked in \!\output!-routine examine the
1325 % depth of floats in the list they are working on against a newly introduced
1326 % macro \!\f@depth! by also newly introduced \!\@testwrongwidth!, so that
1327 % they process only floats of a page/column category specified by
1328 % \!\f@depth!, while those not matching to \!\f@depth! are let go to
1329 % \!\@deferlist! to inhibit succeeding floats of the same type from
1330 % overtaking them. The \!\def!inition of \!\f@depth! is done only by
1331 % modified \!\@dblfloatplacement!, always invoked in a group, to let it have
1332 % |1sp| so that float placement macros usually work on \cwise{} ones with
1333 % the default setting of $\!\f@depth!=\!\z@!$ except for special occasions
1334 % in which the placement of \pwise{} floats is tried.
1335 %
1336 % Though the mechanism should work well with {\em ordinary\/} multi-columned
1337 % documents, it is incompatible with \Paracol{} almost inherently. That is,
1338 % in the first place we have to separate float-related lists into the sets
1339 % of them corresponding to columns as we do\footnote{
1340 % 
1341 % If counters \counter{figure} and \counter{table} are global and we have to
1342 % avoid inter-column overtaking with respect to, for example, the partial
1343 % ordering rooted by the top-left corner, merging \cwise{} lists together
1344 % with the merge of \cs{@deferlist} and \cs{@dbldeferlist} might be a
1345 % solution to let the depth of a \cwise{} float be $c\,\texttt{sp}$ while
1346 % that of \pwise{} is $\C$\,\texttt{sp}. However such implementation is not
1347 % only tough but also doubtful to be worthwhile.}.
1348 % 
1349 % Therefore, it is obviously nonsense to merge the list for \pwise{} floats,
1350 % i.e., \!\@dbldeferlist!, to \!\@deferlist! of a particular column, and
1351 % thus we have to stick with the conventional implementation to process
1352 % \pwise{} and \cwise{} floats separately as follows.
1353 % 
1354 % \begin{enumerate}\def\labelenumi{(\arabic{enumi})}
1355 % \item
1356 % \label{item:ovv-float-end@dblfloat}
1357 % We \!\def!ine our own \!\end@dblfloat! namely \!\pcol@end@dblfloat!
1358 % whose definition is exactly same as the old version of \!\end@dblfloat!,
1359 % and replace the new version with it by \!\let!ting them equivalent in
1360 % \!\pcol@zparacol! by which start \env{paracol} environments. Therefore,
1361 % \pwise{} floats composed in a \env{paracol} environment is processed in
1362 % the traditional way, i.e., being included in \!\@dbldeferlist! rather than
1363 % \!\@deferlist! and having ordinary depth 0.
1364 %
1365 % \item
1366 % \label{item:ovv-float-@dblfloatplacement}
1367 % Each invocation of \!\@dblfloatplacement! in our own \!\output!-routine is
1368 % followed by a \!\let! to nullify the setting of $\!\f@depth!=|1sp|$ done
1369 % by \!\@dblfloatplacement! by doing \!\f@depth!=\!\z@!. By this setting,
1370 % \!\@tryfcolumn! in \!\pcol@startpage! and \!\@makefcolumn! in
1371 % \!\pcol@output@clear! work on their argument \!\@dbldeferlist! in the way
1372 % exactly same as in 2014 or before.
1373 %
1374 % \item
1375 % \label{item:ovv-float-@addtodblcol}
1376 % Among \LaTeX's macros in its \!\output!-routine which we use in our own
1377 % one as well, only \!\@addtodblcol! changed its target from
1378 % \!\@dbldeferlist! to \!\@deferlist!. That is, if the macro fails to put a
1379 % \pwise{} float to the page we just have started by \!\pcol@startpage!,
1380 % the float is added to \!\@deferlist! rather than \!\@dbldeferlist!.
1381 % Therefore, when we apply \!\@sdblcolelt! to the copy of \!\@dbldeferlist!
1382 % to invoke \!\@addtodblcol! for each of its element float, we have to save
1383 % \!\@deferlist! somewhere, to \!\reserved@c! in reality, and clear it prior
1384 % to the application. Then after all elements are processed, we have to let
1385 % \!\@dbldeferlist! have what \!\@deferlist! have, while \!\@deferlist!
1386 % should regain its original contents from the saved place. A subtle issue
1387 % is that we might work with \LaTeX{} of 2014 or older in which the floats
1388 % are returned to \!\@dbldeferlist!. Therefore to make \Paracol{}
1389 % compatible with both of new and old versions, we have to {\em add}
1390 % \!\@deferlist! to \!\@dbldeferlist! rather than replacing
1391 % \!\@dbldeferlist! with \!\@deferlist!. This addition should work well,
1392 % because we clear both lists before the application of \!\@sdblcolelt! and
1393 % then one of them will have the still-deferred floats after the application
1394 % while the other remains empty.
1395 %
1396 % \item
1397 % \label{item:ovv-float-@output@start}
1398 % We convert \!\@deferlist! to \!\@dbldeferlist! in \!\pcol@output@start! to
1399 % start a \env{paracol} environment, and perform the reverse operation in
1400 % \!\pcol@output@end! to close the environment. Though it is very unlikely
1401 % (or maybe impossible) that the \!\@deferlist! {\em imported\/} in the
1402 % former operation has \LaTeX's (i.e., not \Paracol's) double-column floats
1403 % of |1sp| deep, we make such floats old-fashioned making their depth 0 so
1404 % that they can be put in a page built in the \env{paracol} environment. On
1405 % the other hand, the latter cannot {\em export\/} a list having floats of
1406 % |1sp| deep because they have been produced in the closing \env{paracol}
1407 % environment or have passed our {\em custom\/} \!\pcol@output@start! when
1408 % they were imported\footnote{
1409 % 
1410 % Therefore, if one try to {\em smuggle\/} a double-column float of the new
1411 % scheme into a \env{paracol} and to pass it through the environment to
1412 % another double-column world, the float will become a single-column one.
1413 % Even if such guy a really exists and complains about this transformation,
1414 % however, we have good right to say ``don't do that''.}.
1415 % \end{enumerate}
1416 % 
1417 % Note that the operations (1), (2) and (4) are fully compatible with 2014
1418 % or older version of \LaTeX{}, because with the old version; (1)
1419 % \!\pcol@end@dblfloat! is equivalent to \!\end@dblfloat!; (2) modification
1420 % of \!\f@depth! cannot be seen because it does not exist; and (4) we
1421 % virtually do nothing in the importation. As for (3), we explicitly take
1422 % care of the compatibility as shown above.
1423 %
1424 %
1425 %
1426 % \section{Interaction with \TeX{} and \LaTeX{}}
1427 % \label{sec:imp-tex}
1428 %
1429 % The macros of \Paracol{} interacts with \TeX{} and \LaTeX{} through
1430 % various registers and macros as discussed in this section.
1431 %
1432 % \subsection{Registers}
1433 % \label{sec:imp-tex-reg}
1434 %
1435 % \subsubsection{Insertion Registers}
1436 %
1437 % \begin{description}
1438 % \item[\Uidx{\!\footins!}]
1439 % is used to \!\insert! footnotes through it by \!\footnote! and
1440 % \!\footnotetext!, and then in \!\output! routine the footnotes
1441 % \!\insert!ed in a page is presented in the register. The register is
1442 % referred to by the following macros.
1443 % 
1444 % \begin{itemize}
1445 % \item
1446 % \!\pcol@makecol! examines if the register has \Scfnote{}s and, if so,
1447 % saves it into $\pp^f(p)$ if $p=\ptop$ or discards it otherwise.
1448 %
1449 % \item
1450 % \!\pcol@startcolumn! \!\insert!s $\pp^f(p)$ into the \colpage{} to be
1451 % created through the register.
1452 %
1453 % \item
1454 % \!\pcol@specialoutput! logs the contents of the register for debugging.
1455 %
1456 % \item
1457 % \!\pcol@output@start! examines if the register has footnotes to be merged
1458 % with those in \env{paracol} environment, refers to its height plus depth to
1459 % calculate effective \!\@colht!, and/or \!\insert!s its contents through
1460 % itself to the main vertical list as the first part of \Mgfnote{}s.
1461 %
1462 % \item
1463 % \!\pcol@makenormalcol! combines footnotes in the register to other
1464 % \preenv{} to make a \spanning, or makes save\slash restore of the register
1465 % to/from \!\@tempboxa! to exclude footnotes from \spanning{} when
1466 % \mgfnote{}-footnote typesetting is specified.
1467 %
1468 % \item
1469 % \!\pcol@output@switch! saves the register into $\pp^f(p)$ or $\cc_c(\ft)$,
1470 % or discards its contents, when we leave from the column $c$ with footnotes.
1471 %
1472 % \item
1473 % \!\pcol@restartcolumn! restores $\cc_d(\ft)$ or $\pp^f(p)$ to the register
1474 % and then \!\insert!s the contents of \!\box!\!\footins! into itself so
1475 % that it contributes to the main vertical list to be rebuilt for the column
1476 % $d$.
1477 %
1478 % \item
1479 % \!\pcol@getcurrfoot! for column $d$ lets the register have $\cc_d(\ft)$.
1480 %
1481 % \item
1482 % \!\pcol@savefootins! saves the register into an \!\insert! for $\pp^f(p)$
1483 % or $\cc_c(\ft)$.
1484 %
1485 % \item
1486 % \!\pcol@deferredfootins! refers the \!\skip! component of the register to
1487 % have the vertical skip above \Scfnote{}s and \!\insert!s deferred
1488 % footnotes through the register.
1489 %
1490 % \item
1491 % \!\pcol@output@end! \!\insert!s $\pp^f(p)$ into the \lpage{} through the
1492 % register.
1493 %
1494 % \item
1495 % \!\pcol@fntexttop!\marg{text} \!\insert!s the footnote $\arg{text}$ and a
1496 % penalty through the register.
1497 %
1498 % \item
1499 % \!\pcol@fntextbody!\marg{text} refers to the \!\skip! component of the
1500 % register to cap the height of the footnote $\arg{text}$.
1501 % \end{itemize}
1502 %
1503 % \item[\rm\Uidx{\!\bx@A!}, \ldots, \Uidx{\!\bx@R!}]
1504 % have floats created by \!\@xfloat! in the ordinary usage of {\em
1505 % fundamental\/} \LaTeX{} of 2014 or earlier or that without the extension
1506 % of e-\TeX{} or its relatives. On the other hand, in \LaTeX{} of 2015 or
1507 % later and with e-\TeX{} or its relatives, the set is \!\bx@A!, \ldots,
1508 % \Uidx{\!\bx@Z!}, \Uidx{\!\bx@AA!}, \ldots, \Uidx{\!\bx@ZZ!}\@. In addition
1509 % to the use in \LaTeX, we use these registers for completed \colpage{}s
1510 % $s_c(p)$ (\!\pcol@opcol!, \!\pcol@flushcolumn!), main vertical list
1511 % $\cc_c(\vb)$ (\!\pcol@output@start!, \!\pcol@output@switch!,
1512 % \!\pcol@flushcolumn!) and \Mcfnote{}s $\cc_c(\ft)$
1513 % (\!\pcol@output@switch!) in \ccolpage{}s, \spanning{} including \preenv{}
1514 % $\pp^i(p)$ (\!\pcol@startpage!, \!\pcol@output@start!) and \Scfnote{}s
1515 % $\pp^f(p)$ (\!\pcol@makecol!, \!\pcol@output@switch!) in pages,
1516 % \mvlfloat{}s for main vertical lists in \sync{}ed pages
1517 % (\!\pcol@synccolumn!), and \pwise{} floats deferred from \env{paracol} to
1518 % \postenv{} (\!\pcol@output@end!).
1519 % \end{description}
1520 %
1521 %
1522 %
1523 % \subsubsection{Integer Registers}
1524 %
1525 % \begin{description}
1526 % \item[\Uidx{\!\deadcycles!}]
1527 % is \TeX's primitive register to count the number of \!\output! requests
1528 % made between two \!\shipout! operations. It is zero-cleared by
1529 % \!\pcol@invokeoutput! because it can have a large number in a
1530 % \env{paracol} environment.
1531 %
1532 % \item[\Uidx{\!\outputpenalty!}]
1533 % is \TeX's primitive register to have the page-break penalty with which
1534 % \!\output! routine is invoked. It is referred to by \!\pcol@output! to
1535 % know whether it has special code less than $-10000$, and by
1536 % \!\pcol@specialoutput! in detail for the dispatch according to the code.
1537 % The register is also used for the communication from the latter, which lets
1538 % it be $-10000$ for our own special \!\output! routines, to the former to
1539 % determine \!\vsize! according to if the register has a value greater than
1540 % $-10004$ or not.
1541 %
1542 % \item[\Uidx{\!\interlinepenalty!}]
1543 % is \TeX's primitive register to have the page-break penalty inserted
1544 % between two lines. The register is referred to in the following macros.
1545 % 
1546 % \begin{itemize}
1547 % \item
1548 % \!\pcol@output@start! to make \Preenv{} \Mgfnote{}s followed by this
1549 % \!\penalty! on the \!\insert!ion, and to insert it to start the first
1550 % \colpage{} allowing page-break before the start unless it is inhibited
1551 % by $\CSIndex{if@nobreak}=\true$.
1552 %
1553 % \item
1554 % \!\pcol@restartcolumn! to insert this \!\penalty! to resume a \colpage{}
1555 % allowing page-break if $\CSIndex{if@nobreak}=\false$.
1556 %
1557 % \item
1558 % \!\pcol@deferredfootins! to let the second half of split $\df$ have this
1559 % \!\penalty! as the very first element.
1560 %
1561 % \item
1562 % \!\pcol@fntexttop!\marg{text} to make the footnote $\arg{text}$ followed
1563 % by this \!\penalty! on the \!\insert!ion.
1564 %
1565 % \item
1566 % \!\pcol@fntextother!\marg{text} to make the footnote $\arg{text}$ preceded
1567 % by this \!\penalty! in $\df$.
1568 %
1569 % \item
1570 % \!\pcol@fntextbody! to let the register have \!\interfootnotelinepenalty!.
1571 % \end{itemize}
1572 %
1573 % \item[\Uidx{\!\floatingpenalty!}]
1574 % is \TeX's primitive register to have the page-break penalty added to
1575 % \!\insertpenalties! if an \!\insert! is moved to the page next to the page
1576 % in which the line having the \!\insert! resides. It is let have 20000 in
1577 % \!\pcol@fntextbody! for footnote typesetting.
1578 %
1579 % \item[\Uidx{\!\vbadness!}]
1580 % is \TeX's primitive register to have the threshold of the badness of
1581 % \!\vbox! construction with underfull messages. That is, if the badness
1582 % exceeds the threshold on a \!\vbox! construction, \TeX{} will complain
1583 % showing an underfull message. In \!\pcol@makenormalcol! and
1584 % \!\pcol@deferredfootins!, the register is temporarily let have 10000 to
1585 % avoid that \!\@makecol! invoked in the former and \!\vsplit! done in the
1586 % latter causes the message with inevitable underfull.
1587 %
1588 % \item[\Uidx{\!\showboxdepth!}]
1589 % is \TeX's primitive register to determine the maximum depth of box
1590 % structure to be shown in logging etc. The register is let have 10000 in
1591 % \!\pcol@ShowBox! for full logging.
1592 %
1593 % \item[\Uidx{\!\showboxbreadth!}]
1594 % is \TeX's primitive register to determine the maximum breadth of box
1595 % structure to be shown in logging etc. The register is let have 10000 in
1596 % \!\pcol@ShowBox! for full logging.
1597 %
1598 % \item[\Uidx{\!\interfootnotelinepenalty!}]
1599 % is an API \!\count! register to have \!\interlinepenalty! for footnotes.
1600 % It is used in \!\pcol@fntextbody! to let \!\interlinepenalty! have it.
1601 %
1602 % \item[\Uidx{\!\@ne!}]
1603 % is a \!\chardef! register to have 1. The register is referred to by the
1604 % following macros mainly for incrementing another register.
1605 % 
1606 % \begin{quote}\raggedright
1607 % \!\pcol@F@count!,
1608 % \!\pcol@output!,
1609 % \!\pcol@opcol!,
1610 % \!\pcol@setpnoelt!,
1611 % \!\pcol@nextpage!,
1612 % \!\pcol@nextpelt!,
1613 % \!\pcol@startpage!,
1614 % \!\pcol@checkshipped!,
1615 % \!\pcol@outputelt!,
1616 % \!\pcol@ioutputelt!,
1617 % \!\@outputpage!,
1618 % \!\pcol@bg@paint@ii!,
1619 % \!\pcol@output@start!,
1620 % \!\pcol@makenormalcol!,
1621 % \!\pcol@output@switch!,
1622 % \!\pcol@setcurrcol!,
1623 % \!\pcol@iscancst!,
1624 % \!\pcol@addmarginpar!,
1625 % \!\pcol@do@mpbout@i!,
1626 % \!\pcol@sync!,
1627 % \!\pcol@flushcolumn!,
1628 % \!\pcol@measurecolumn!,
1629 % \!\pcol@synccolumn!,
1630 % \!\pcol@makeflushedpage!,
1631 % \!\pcol@imakeflushedpage!,
1632 % \!\pcol@iflushfloats!,
1633 % \!\pcol@freshpage!,
1634 % \!\pcol@output@end!,
1635 % \!\pcol@invokeoutput!,
1636 % \!\pcol@zparacol!,
1637 % \!\pcol@setcolwidth@r!,
1638 % \!\pcol@setcolwidth@s!,
1639 % \!\pcol@setcw@scan!,
1640 % \!\pcol@setcw@calcf!,
1641 % \!\pcol@synccounter!,
1642 % \!\pcol@com@syncallcounters!,
1643 % \!\pcol@stepcounter!,
1644 % \!\pcol@com@switchcolumn!,
1645 % \!\pcol@sptext!,
1646 % \!\pcol@visitallcols!,
1647 % \!\pcol@ifootnote!,
1648 % \!\pcol@ifootnotemark!.
1649 % \!\pcol@swapcolumn!,
1650 % \!\pcol@set@color@push!,
1651 % \end{quote}
1652 %
1653 % \item[\Uidx{\!\tw@!}]
1654 % is a \!\chardef! register to have 2. It is used in \!\pcol@setcurrcol! to
1655 % let $\cc_c(\sw)=2$ when $\CSIndex{if@nobreak}=\true$ but
1656 % $\CSIndex{if@afterindent}=\false$, in
1657 % $\!\pcol@setcw@calcf!\<x\>\<y\>\<z\>$ to calculate $x\cdot2^k$, $y/2^k$
1658 % and $(x/y)\cdot2^k$ with various $k$, and in \!\pcol@swapcolumn! to
1659 % calculate $\Cto-(c'-\Cfrom)-2=c-1=c^g$ for the \csepgap{} ordinal $c^g$
1660 % physically following the column $c$ at the position $c'$.
1661 %
1662 % \item[\Uidx{\!\m@ne!}]
1663 % is a \!\count! register to have $-1$. It is used in the following macros.
1664 % 
1665 % \begin{itemize}
1666 % \item
1667 % \!\pcol@setpnoelt!, \!\pcol@nextpelt!, \!\pcol@getpelt! and
1668 % \!\pcol@setmpbelt! to decrement
1669 % \!\@tempcnta! which initially has $p-\pbase$ for a page $p$.
1670 %
1671 % \item
1672 % \!\pcol@bg@paint@i! to decrement $\CBto$ by one locally to have the column
1673 % scanning range $\LBRP\CBfrom{\CBto{-}1}$.
1674 %
1675 % \item
1676 % \!\pcol@iscancst! to decrement $\npop$ by one.
1677 %
1678 % \item
1679 % \!\pcol@do@mpbout@i! to let \!\@tempcnta! have it to indicate left margin.
1680 %
1681 % \item
1682 % \!\pcol@setcolwidth@r! to calculate $\Cto-\Cfrom-1$.
1683 %
1684 % \item
1685 % $\!\pcol@setcw@calcf!\<x\>\<y\>\<z\>$ in \!\@whilenum! loops to
1686 % calculate $z'/2^k$ and $z'/2{k-16}$ where $z'/2^k\approx x/y$.
1687 %
1688 % \item
1689 % \!\pcol@iadjustfnctr! to decrement \!\c@footnote!.
1690 % \end{itemize}
1691 %
1692 % \item[\Uidx{\!\sixt@@n!}]
1693 % is a \!\chardef! register to have 16. It is used in
1694 % $\!\pcol@setcw@calcf!\<x\>\<y\>\<z\>$ to calculate
1695 % $Z=z\times1\,|pt|=z'\cdot2^{16-k}$ where $z'/2^k\approx x/y$.
1696 %
1697 % \item[\Uidx{\!\@m!}]
1698 % is a \!\mathchardef! register to have 1000. It is used in
1699 % \!\pcol@synccolumn! and \!\pcol@output@end! to let
1700 % $\!\prevdepth!=1000\,|pt|$ on a \sync{}ation or the closing \env{paracol}
1701 % environment with an empty main vertical list, and in
1702 % \!\pcol@setcw@getspec@i! to add 1000\,|pt| to stretch and shrink
1703 % components of \!\@tempskipa! having a column\slash gap specification to
1704 % make it sure the skip register has those components.
1705 %
1706 % \item[\Uidx{\!\@M!}]
1707 % is a \!\mathchardef! register to have 10000. It is used in the following
1708 % macros
1709 % 
1710 % \begin{itemize}
1711 % \item
1712 % \!\pcol@ShowBox! to let \!\showboxdepth! and \!\showboxbreadth! have
1713 % 10000 for full logging of a box.
1714 %
1715 % \item
1716 % \!\pcol@output! to examine if $\!\outputpenalty!<-10000$ to mean a special
1717 % \!\output! request.
1718 %
1719 % \item
1720 % \!\pcol@specialoutput! to let $\!\outputpenalty!=-10000$ to tell
1721 % \!\pcol@output! that the special \!\output! request is our own.
1722 %
1723 % \item
1724 % \!\pcol@makenormalcol! and \!\pcol@deferredfootins! to let \!\vbadness!
1725 % have 10000 temporarily to avoid underfull messages.
1726 %
1727 % \item
1728 % \!\pcol@synccolumn! to bias \!\pcol@textfloatsep! by 10000\,|pt| to
1729 % indicate a \colpage{} has an \mvlfloat{} and in \!\pcol@cflt! and
1730 % \!\pcol@addflhd! to remove the bias.
1731 %
1732 % \item
1733 % \!\pcol@switchcol! and \!\pcol@flushclear! to put \!\penalty!|-10000| for
1734 % forced page break.
1735 %
1736 % \item
1737 % $\!\pcol@setcw@calcf!\<x\>\<y\>\<z\>$ to let $Z=z\times1\,|pt|=10000\,|pt|$
1738 % if $x/y$ is too large.
1739 % \end{itemize}
1740 %
1741 % \item[\Uidx{\!\@Mii!}]
1742 % is a \!\mathchardef! register to have 10002. It is used in
1743 % \!\pcol@end@dblfloat! to examine if $\!\@floatpenalty!=-10002$ to mean the
1744 % float environment to be closed is given in horizontal mode.
1745 %
1746 % \item[\Uidx{\!\@Miv!}]
1747 % is a \!\mathchardef! register to have 10004. It is used in \!\pcol@output!
1748 % to examine if $\!\outputpenalty!=-10004$ for a dummy \!\output! request
1749 % made by \LaTeX's float-related macros and our \!\pcol@invokeoutput! to
1750 % ensure the real request is not eliminated when it is made at the very
1751 % beginning of a page or a \colpage. It is also used in
1752 % \!\pcol@specialoutput! for footnote logging when
1753 % $\!\outputpenalty!=-10004$.
1754 %
1755 % \item[\Uidx{\!\@MM!}]
1756 % is a \!\mathchardef! register to have 20000. It is used in
1757 % \!\pcol@fntextbody! to let \!\floatingpenalty! have it for footnote
1758 % typesetting.
1759 %
1760 % \item[\Uidx{\!\@beginparpenalty!}]
1761 % is a \!\count! register to have the page-break penalty inserted before the
1762 % first \!\item! of each \env{list}-like environment. The penalty is
1763 % determined in class files and is, for example, $-\!\@lowpenalty!=-51$ with
1764 % \textsf{article.cls}. It is referred to and inserted by \!\pcol@zparacol!
1765 % when it finds the \env{paracol} environment to start is at the very
1766 % beginning of a \env{list}-like environment.
1767 %
1768 % \item[\Uidx{\!\@floatpenalty!}]
1769 % is a \!\count! register to have the penalty code -10002 or -10003 given by
1770 % \!\@xfloat! at the beginning of a float environment according to the
1771 % environment is in horizontal or vertical mode respectively, or by
1772 % \!\marginpar! for a marginal note in the same meaning. It is
1773 % referred to by \!\pcol@end@dblfloat! to insert the penalty, and by
1774 % \!\pcol@xympar! to confirm \!\marginpar! is error free.
1775 %
1776 % \item[\Uidx{\!\@topnum!}]
1777 % is a \!\count! register to have the maximum number of top floats which the
1778 % \ccolpage{} can accept further. It is used in \!\pcol@setcurrcol!
1779 % and \!\pcol@iigetcurrcol! to save\slash restore it into\slash from
1780 % $\cc_c(\tn)$. The macro \!\pcol@synccolumn! also lets $\!\@topnum!=0$ to
1781 % inhibit top-float insertions in the \ccolpage{} any more after a
1782 % \sync{}ation.
1783 %
1784 % \item[\Uidx{\!\@botnum!}]
1785 % is a \!\count! register to have the maximum number of bottom floats which
1786 % the \ccolpage{} can accept further. It is used in \!\pcol@setcurrcol!
1787 % and \!\pcol@iigetcurrcol! to save\slash restore it into\slash from
1788 % $\cc_c(\bn)$.
1789 %
1790 % \item[\Uidx{\!\@colnum!}]
1791 % is a \!\count! register to have the maximum total number of floats which
1792 % the \ccolpage{} can accept further. It is used in \!\pcol@setcurrcol!
1793 % and \!\pcol@iigetcurrcol! to save\slash restore it into\slash from
1794 % $\cc_c(\cn)$.
1795 %
1796 % \item[\Uidx{\!\col@number!}]
1797 % is a \!\count! register to have the number of columns. It is let have 1
1798 % by \!\pcol@zparacol! and \!\pcol@sptext! regardless the real number of
1799 % columns $\C$ in order to keep \!\maketitle! from putting the title by
1800 % \!\twocolumn!.
1801 %
1802 % \item[\Uidx{\!\c@page!}]
1803 % is \LaTeX's counter \Uidx{\counter{page}} being a \!\count! register to
1804 % have the page number. It is referred to by \!\pcol@setpnoelt!, and
1805 % \!\pcol@output@start! to let $\pp^p(p)=\page(p)$. The macro
1806 % \!\pcol@startpage! reload the register from $\pp^p(\ptop{-}1)$ and then
1807 % increment it by one usually but two in \npaired{} \parapag{}ing, and
1808 % repeat $\pp^p(\ptop)=\page(\ptop)$ and incrementing $\page(p)$ for each
1809 % \fpage{}s of \pwise{} floats. Reloading $\page(p)$ to the register from
1810 % $\pp^p(p)$ is also done by \!\pcol@getpelt! for macros using
1811 % \!\pcol@getcurrpage!, and by \!\pcol@outputelt!, \!\pcol@sync! and
1812 % \!\pcol@makeflushedpage! by \!\pcol@getcurrpinfo!. Then the register is
1813 % referred to by the following macros to examine its parity.
1814 % 
1815 % \begin{itemize}
1816 % \item
1817 % Our own \!\@outputpage! to give $\page(p)$ or $\page(p)+1$ to
1818 % \!\pcol@outputpage@l! and \!\pcol@outputpage@r! which finally let the
1819 % register have the value to be referred to by \!\pcol@@outputpage! being
1820 % \LaTeX's \!\@outputpage!.
1821 %
1822 % \item
1823 % \begin{Sloppy}{2800}%
1824 % \!\pcol@bg@swappage! to determine the values of \!\pcol@bg@leftmargin!
1825 % and \CSIndex{ifpcol@bg@@swap} with other factors.
1826 % \end{Sloppy}
1827 %
1828 % \item
1829 % \!\pcol@shiftspanning! to decide the necessity of shifting \mctext{} left
1830 % with \cswap{}, examining {\em raw} \!\c@page! at the \!\output! request to
1831 % close the \mctext{} rather than $\pp^p(\ptop)$ which will have the correct
1832 % value with respect to possible jump {\em after} the macro completes its
1833 % work.
1834 %
1835 % \item
1836 % \!\pcol@addmarginpar! to determine the margin to which a marginal note
1837 % goes.
1838 %
1839 % \item
1840 % \!\pcol@do@mpbout@i! to determine which of $\mpb_L^l$ or $\mpb_L^r$ is the
1841 % target of the operation specified by \!\pcol@do@mpbout@elem!.
1842 %
1843 % \item
1844 % $\!\pcol@swapcolumn!\<c_1\>\<c_2\>\<\Cfrom\>\<\Cto\>$ to determine $c_2$
1845 % for $c_1$ if \cswap{} is in effect.
1846 % \end{itemize}
1847 % 
1848 % In addition, to do the parity examination in \!\pcol@bg@swappage! above
1849 % correctly, the macros \!\pcol@ioutputelt!, \!\pcol@makeflushedpage!,
1850 % \!\pcol@imakeflushedpage!, \!\pcol@iflushfloats! and \!\pcol@output@end!
1851 % temporarily increment the register by one when they are working on a right
1852 % \npaired{} \parapag{}e.
1853 %
1854 % The other users are \!\localcounter!\marg{ctr} to check
1855 % $\arg{ctr}\neq\counter{page}$, \!\pcol@remctrelt! to let
1856 % $|\cl@|{\cdot}\theta=\!\pcol@stepcounter!\Arg{\theta}$
1857 % 
1858 % \SpecialArrayIndex{\theta}{\cl@}
1859 % 
1860 % unless $\theta=\counter{page}$, and \!\pcol@FF! to write it to a log file
1861 % as a part the logging information of memory leak debugging.
1862 %
1863 % \item[\Uidx{\!\c@footnote!}]
1864 % is \LaTeX's counter \Uidx{\counter{footnote}} being a \!\count! register
1865 % to have the footnote number. It is referred to by \!\pcol@zparacol! to
1866 % let $\bf=\!\pcol@footnotebase!$ have its value, by \!\pcol@calcfnctr! to
1867 % calculate the footnote ordinal which the one of its invoker
1868 % \!\pcol@iadjustfnctr! sets into the register, and by \!\endparacol! to let
1869 % the register have $\bf+\nf=\!\pcol@footnotebase!+\!\pcol@nfootnotes!$.
1870 %
1871 % \item[$\cs{c@}{\cdot}\theta$]
1872 % \SpecialArrayUsageIndex{\theta}{\c@}
1873 % 
1874 % is a \!\count! register being \LaTeX's counter $\theta$. It is referred
1875 % to by \!\pcol@savectrelt! to let $\val_c(\theta)=\Val(\theta)$ for saving
1876 % it in $\Cc_c$, by \!\pcol@cmpctrelt! to examine if
1877 % $\val_0(\theta)=\Val(\theta)$ to detect a modification outside
1878 % \env{paracol} environment, and by \!\pcol@syncctrelt! to let
1879 % $\val_c(\theta)=\Val(\theta)$ for all $c$ for \csync{}. It is also
1880 % referred to by \!\pcol@remctrelt! and \!\localcounter! to examine if
1881 % $\theta=\counter{page}$. The macros \!\pcol@setctrelt! and
1882 % \!\pcol@stpldelt! restore the value of the counter from $\val_c(\theta)$,
1883 % while \!\pcol@stpclelt! lets $\Val(\theta)=0$ for zero-clearing of
1884 % descendent counters.
1885 %
1886 % \item[\Uidx{\!\count@!}]
1887 % is a \!\count! register for temporary use. It is used in
1888 % \!\pcol@iscancst! to have $m$ of $\mcelt_{i,m}$,
1889 % \!\pcol@addmarginpar! to have the physical column position of the current
1890 % column $c$ in which \!\marginpar! is given, and in
1891 % $\!\pcol@extract@fil@i!\<s\>\!\@nil!$ to extract the unit of the stretch
1892 % component $s$ of a glue.
1893 %
1894 % \item[\Uidx{\!\@tempcnta!}]
1895 % is a \!\count! register for temporary use. The usages of this register
1896 % are as follows.
1897 % 
1898 % \begin{itemize}
1899 % \item
1900 % In \!\pcol@F@count!, it is used to measure the cardinality of
1901 % \!\@freelist!.
1902 %
1903 % \item
1904 % In \!\pcol@makecol!, it is used to keep $\page(\ptop)$ gotten by
1905 % \!\pcol@getcurrpinfo! until we store it back by \!\pcol@defcurrpage!.
1906 %
1907 % \item\begin{Sloppy}{3700}
1908 % In \!\pcol@setpageno!, \!\pcol@setpnoelt!, \!\pcol@nextpage!,
1909 % \!\pcol@nextpelt!, \!\pcol@getcurrpage!, \!\pcol@getpelt!,
1910 % \!\pcol@addmarginpar! and \!\pcol@setmpbelt!, it has $p-q$ when we scan
1911 % $\pp(q)$ for all $q\in[\pbase,\ptop]$ and the \ccolpage{} is at $p$.
1912 % \end{Sloppy}
1913 %
1914 % \item
1915 % In \!\pcol@checkshipped!, it has $c$ when we scan $\S_c$ for all
1916 % $c\In0\C$ to examine if all of them are not empty and thus we have pages
1917 % to be shipped out.
1918 %
1919 % \item
1920 % In \!\pcol@ioutputelt!, it has $c'$ when we scan $\s_c(q)$ for all
1921 % $c\In0\CL$ or $c\In\CL\C$ to build the shipping out image of a page $q$,
1922 % where $c=c'$ or $c=\Cto-1-(c'-\Cfrom)$ where
1923 % $(\Cfrom,\Cto)\in\{(0,\CL),(\CL,\C)\}$.
1924 %
1925 % \item
1926 % In \!\@outputpage!, it has $\page(p)$ or $\page(p)+1$ to be given to
1927 % \!\pcol@outputpage@l! or \!\pcol@outputpage@r! as their argument when they
1928 % are used to ship out the second (not always right) component of a
1929 % \parapag{}e pair.
1930 %
1931 % \item
1932 % In \!\pcol@bg@columnleft!, it has a value in $\LBRP\CBfrom{c}$ to sum up
1933 % the width of columns and \csepgap{}s in the range.
1934 %
1935 % \item
1936 % In \!\pcol@output@switch!, it is used to have $\page(p)$ obtained by
1937 % \!\pcol@getcurrp~info! and simply to store the value in $\pp^p(p)$ by
1938 % \!\pcol@defcurrpage! when we use these macros to add an element to
1939 % $\pp^s(p)$ and/or let $\pp^f(p)=\!\footins!$.
1940 %
1941 % \item
1942 % In \!\pcol@setcurrcol!, it has the code calculated from
1943 % \CSIndex{if@nobreak} and |\if@after|\~|indent| to be saved in
1944 % $\cc_c(\sw)$.
1945 % 
1946 % \SpecialIndex{\if@afterindent}
1947 %
1948 % \item
1949 % In $\!\pcol@scancst!\arg{box}$, it is let have
1950 % $\arg{box}\in\{\!\pcol@colorins!,|\pcol@color|\~|stack@saved|\}$ and then is
1951 % referred to in \!\pcol@iscancst!.
1952 % \SpecialIndex{\pcol@colorstack@saved}
1953 %
1954 % \item
1955 % In \!\pcol@addmarginpar! besides the page scan shown above, it is used to
1956 % scan all columns whose physical position is left from the current
1957 % column $c$ to measure the distance between the left edges of the leftmost
1958 % column and $c$.
1959 %
1960 % \item
1961 % In \!\pcol@do@mpbout@i!, it has $\pm1$ according to the margin ($\rm
1962 % left=-1$) which marginal notes outside \env{paracol} environments goes
1963 % to.
1964 %
1965 % \item
1966 % In \!\pcol@flushcolumn!, it is used to throw $\page(\ptop)$ away when we
1967 % get it by \!\pcol@getcurrpinfo! because we don't need it.
1968 %
1969 % \item
1970 % In \!\pcol@setcolwidth@r!, it has $c$ to scan fractions $r_d$ where
1971 % $d=c-\Cfrom$ in its argument $\arg{ratio}$ specified by \!\columnratio!,
1972 % and then to distribute the unspecified portion of \!\textwidth! evenly to
1973 % $\w_c$ for all $c\In{\Cfrom{+}k{+}1}\Cto$, where $k$ is the number of
1974 % fractions and $(\Cfrom,\Cto)\in\{(0,\CL),(\CL,\C)\}$.
1975 %
1976 % \item
1977 % In $\!\pcol@setcw@scan!\<\Cfrom\>\<\Cto\>\Arg{spec}$, it has $c$ for two
1978 % loops for $c\In\Cfrom\Cto$ to add `|,|' to the tail of $\arg{spec}$ as
1979 % many as $k=\Cto-\Cfrom$ and then to process first $k$ elements in
1980 % $\arg{spec}$, and is referred to by \!\pcol@setcw@set! invoked in the
1981 % second loop.
1982 %
1983 % \item
1984 % In $\!\pcol@setcw@calcf!\<x\>\<y\>\<z\>$, it used to calculate and to have
1985 % $k$ such that $z'/2^k\approx x/y$.
1986 %
1987 % \item
1988 % In \!\pcol@cmpctrelt!, it has $\Val(\theta)$ of a counter $\theta$ to be
1989 % compared with $\val_0(\theta)$.
1990 %
1991 % \item
1992 % In \!\pcol@com@switchcolumn!, it has $(c+1)\bmod\C$ being the target of
1993 % \cswitch{}.
1994 %
1995 % \item
1996 % In \!\pcol@sptext!, it temporarily has $d$ being the target of \cswitch{}
1997 % during we let \!\pcol@nextcol! have 0 to visit the leftmost column
1998 % to put a \mctext{}.
1999 %
2000 % \item
2001 % In \!\pcol@visitallcols!, it has $d\In0\C-\{c\}$ being the columns to be
2002 % visited for \cscan{}ning.
2003 %
2004 % \item
2005 % In \!\definecolumnpreamble!\marg{c}\marg{pream}, $c$ is assigned to the
2006 % register to ensure $c$ is a number.
2007 %
2008 % \item
2009 % In \!\pcol@calcfnctr!, it has the footnote ordinal calculated by the
2010 % macro to be referred to by the invokers \!\pcol@iadjustfnctr! and
2011 % \!\pcol@iifootnotetext!.
2012 %
2013 % \item
2014 % In $\!\marginparthreshold!\Arg{t_l}|[|t_r|]|$ it is let have $t_l$, while
2015 % in the related macro $\!\pcol@marginparthreshold!|[|t_r|]|$ it is let have
2016 % $t_r$.
2017 % \end{itemize}
2018 %
2019 % \item[\Uidx{\!\@tempcntb!}]
2020 % is a \!\count! register for temporary use. It is used in the following
2021 % macros.
2022 % 
2023 % \begin{itemize}
2024 % \item
2025 % In \!\pcol@ioutputelt! it has $c$, while in \!\pcol@imakeflushedpage! and
2026 % \!\pcol@iflushfloats! it has $c'$, to have $c=c'$ or $c=\Cto-1-(c'-\Cfrom)$
2027 % according to \cswap{} for $c'$-th iteration of column scanning loop for
2028 % $c'\In\Cfrom\Cto$, where $(\Cfrom,\Cto)\in\{(0,\CL),(\CL,\C)\}$.
2029 %
2030 % \item
2031 % In \!\pcol@scancst! and \!\pcol@iscancst!, it has $\npop$.
2032 %
2033 % \item
2034 % In \!\pcol@addmarginpar!, it is let have the column number $d$ whose
2035 % physical position is left from the current column $c$ to measure the
2036 % distance between the left edges of the leftmost column and $c$.
2037 %
2038 % \item
2039 % In \!\pcol@sync! and \!\pcol@measurecolumn!, it has the (so-far) tallest
2040 % column which gives $\VP$.
2041 %
2042 % \item
2043 % In \!\pcol@setcolwidth@r!, it has $\Cto-\Cfrom-1$ then $\Cto-1$ and
2044 % finally $\Cto-\min(\Cfrom{+}k,\,\Cto{-}1)$, where $k$ is the number of
2045 % fractions given in the argument of \!\columnratio! and
2046 % $(\Cfrom,\Cto)\in\{(0,\CL),(\CL,\C)\}$.
2047 %
2048 % \item
2049 % In $\!\pcol@setcw@calcf!\<x\>\<y\>\<z\>$, at first it is used to calculate
2050 % $z'/2^k\approx x/y$ and then to calculate
2051 % $Z=z\times1\,|pt|=z'\cdot2^{16-k}$.
2052 %
2053 % \item
2054 % In \!\pcol@visitallcols!, it has $c=\!\pcol@currcol!$ to exclude it from
2055 % the \cscan{} targets.
2056 % \end{itemize}
2057 % \end{description}
2058 %
2059 %
2060 %
2061 % \subsubsection{Dimension Registers}
2062 %
2063 % \begin{description}
2064 % \item[\Uidx{\!\vsize!}]
2065 % is \TeX's primitive register to have the height of a page or a \colpage{}
2066 % being built. It is let be \!\@colroom! or \!\maxdimen! by
2067 % \!\pcol@output!.
2068 %
2069 % \item[\Uidx{\!\hsize!}]
2070 % is \TeX's primitive register to have the width of a page or a \colpage{}
2071 % being built. It is let be $\w_c$ by \!\pcol@invokeoutput! to restart (or
2072 % stay in) the column $c$, be \!\textwidth! by \!\pcol@sptext! for \mctext,
2073 % and be either of \!\textwidth! or $\w_c$ by \!\pcol@fntextbody! according
2074 % to the footnote typesetting being \scfnote{} or \mcfnote{} respectively.
2075 %
2076 % \item[\Uidx{\!\maxdepth!}]
2077 % is \TeX's primitive register to have the maximum depth of the page being
2078 % built. In \LaTeX, it is assumed that its value is fixed at
2079 % \beginenv{document}, in which the value is saved into \!\@maxdepth!, for
2080 % the typesetting throughout the document, unless a bottom float is added to
2081 % a page in which the register is let have 0 until it is shipped out. This
2082 % temporary setting for a page with bottom floats has some reasonability but
2083 % its implementation for \env{paracol} environments having \cswitch{}
2084 % from/to a \colpage{} with bottom floats to/from another one without
2085 % them is too costly\footnote{
2086 % 
2087 % That is, we would need to incorporate \cs{maxdepth} as a member of
2088 % \cctext, but we don't because the idea of temporary setting itself is too
2089 % vague to pay the effort and a precious membership in \cctext.}.
2090 % 
2091 % Therefore, we let the register have \!\@maxdepth! in \!\pcol@output! and
2092 % \!\pcol@combinefloats! to cancel the temporary setting done in
2093 % \!\@addtobot! for the references by \TeX's page builder and \!\@cflt!
2094 % respectively.
2095 %
2096 % \item[\Uidx{\!\boxmaxdepth!}]
2097 % is \TeX's primitive register to have the maximum depth of \!\vbox!es.
2098 % The macros \!\pcol@cflt!, \!\pcol@opcol!,
2099 % \!\pcol@ioutputelt!, \!\pcol@combine~floats!, \!\pcol@output@flush! and
2100 % \!\pcol@output@clear! let it be \!\@maxdepth! for the boxes having a
2101 % completed \colpage{} or page to cap the depth of the box. The macro
2102 % $\!\pcol@@makecol!\<d\>$ also do that when $d=\!\@maxdepth!$ but it can be
2103 % $d=0$ when it is invoked to build \lpage{}.
2104 %
2105 % \item[\Uidx{\!\splitmaxdepth!}]
2106 % is \TeX's primitive register to have the maximum depth of the \!\vbox!
2107 % being the first half of a box being split. It is used in
2108 % \!\pcol@deferredfootins! to cap the depth of the first half of deferred
2109 % footnotes split from $\df$, and in \!\pcol@fntextbody! to let it have the
2110 % depth of \!\strutbox!.
2111 %
2112 % \item[\Uidx{\!\prevdepth!}]
2113 % is \TeX's primitive register to have the depth of the box which just has
2114 % been added to a vertical list, or to be given to \TeX's vertical list
2115 % builder for the calculation of the vertical skip inserted below the last
2116 % box. The macro \!\pcol@invokeoutput! refers to it to save its value in
2117 % \!\pcol@prevdepth! before putting a dummy \!\vbox! and making a \!\output!
2118 % request, and then let it have \!\pcol@prevdepth! which is given by
2119 % \!\output! routine for the column that we resume. The macro
2120 % \!\pcol@zparacol! also refers to it to save it in \!\pcol@firstprevdepth!
2121 % for the \preenv.
2122 %
2123 % \item[\Uidx{\!\vfuzz!}]
2124 % is \TeX's primitive register to have the threshold height of overfull
2125 % messaging. It is set to 0 in $\!\pcol@ShowBox!\arg{b}$ to ensure overfull
2126 % for any \!\box! $b$ of non-null height.
2127 %
2128 % \item[\Uidx{\!\maxdimen!}]
2129 % is a \!\dimen! register to have $16383.99999\,|pt|$ being the largest
2130 % legal dimensional value. The usages of this register are as follows.
2131 % 
2132 % \begin{itemize}
2133 % \item
2134 % For the \!\insert! register set $\!\pcol@colorins!=\cstraw$,
2135 % \!\dimen!\!\pcol@colorins! is let be \!\maxdimen! for the consistency with
2136 % our intention that a \colpage{} can have virtually infinite number of
2137 % \!\insert!ions for text coloring.
2138 %
2139 % \item
2140 % In \!\pcol@output!, it is set into \!\vsize! when $\!\outputpenalty!=-10004$
2141 % for the dummy \!\output! request so that no page break should occur
2142 % between the dummy and real requests.
2143 %
2144 % \item
2145 % Our own \!\dimen! register \!\pcol@textfloatsep! has \!\maxdimen! if a
2146 % \colpage{} does not have \sync{}ation points to let top floats are
2147 % inserted in usual way. Therefore, \!\pcol@floatplacement! and
2148 % \!\pcol@zparacol! let the register have \!\maxdimen! as the initial
2149 % value. Then the macros \!\pcol@makecol! and \!\pcol@combinefloats!
2150 % examine if $\!\pcol@textfloatsep!=\!\maxdimen!$ to determine the operation
2151 % type of top float insertion, while \!\pcol@synccolumn! does that to know
2152 % if it is flushing a \colpage{} with a \sync{}ation point or is setting the
2153 % first \sync{}ation point in the \colpage{}. The macro \!\pcol@addflhd!
2154 % also examines it for the measurement of the combined height of top and
2155 % bottom floats, while \!\pcol@measurecolumn! gives it \!\maxdimen! as its
2156 % third argument for bottom floats.
2157 %
2158 % \item
2159 % The \pctext{} $\pp^h(p)$ has $-\!\maxdimen!$ if the page is a \fpage{}.
2160 % The macro \!\pcol@startpage! makes that when it creates such a page.
2161 %
2162 % \item
2163 % Our own \!\pcol@prevdepth! and that saved in $\cc_c(\pd)$ have
2164 % \!\maxdimen! if the main vertical list is empty at a \sync{}ation. The
2165 % macro \!\pcol@measurecolumn! makes that when it finds an empty list.
2166 %
2167 % \item
2168 % The \cctext{} $\cc_c(\tr)$ may have \!\maxdimen! if the column $c$ has a
2169 % \fcolumn{} in the \lpage{} of a \env{paracol} environment and the floats in
2170 % it can be put as top floats. The macro \!\pcol@makefcolumn! makes this
2171 % special assignment, and \!\pcol@flushcolumn! and \!\pcol@imakeflushedpage!
2172 % examine it.
2173 %
2174 % \item
2175 % The macro \!\pcol@makefcolelt! let the room for floats in a \fpage{} be
2176 % $-\!\maxdimen!$ if it finds no further floats can be added to the page.
2177 %
2178 % \item
2179 % At a \sync{}ation, we measure the maximum combined size of top floats and
2180 % the main vertical list $\VT$, that of footnotes and bottom floats $\VB$,
2181 % that of four items $\VP$, and $\VPP$ being $\VP$ or $\VP+\!\textfloatsep!$
2182 % according to the existence of bottom floats. We also let $\DT$ and $\DP$
2183 % be the minimum depth of the \colpage{}s which gives $\VT$ and $\VPP$
2184 % respectively. For the measurement, the macro \!\pcol@sync! lets
2185 % $\VT=\VB=\VP=\VPP=-\!\maxdimen!$ and $\DT=\DP=\!\maxdimen!$ as their
2186 % initial values. Then the macro \!\pcol@synccolumn! examines if
2187 % $\DT=\!\maxdimen!$ to mean the \sync{}ation point is set just below the
2188 % top floats of a column whose main vertical list is empty. On the other
2189 % hand, \!\pcol@makeflushedpage! and \!\pcol@output@end! examine if
2190 % $\VPP=-\!\maxdimen!$ to mean the last \colpage{}s are empty.
2191 % \end{itemize}
2192 %
2193 % \item[\Uidx{\!\linewidth!}]
2194 % is a \!\dimen! register for an API parameter of \LaTeX{} to have the width
2195 % of a line possibly shorter than \!\columnwidth! in \env{list}-like
2196 % environments. It is let have $\w_c-\lrm$ by
2197 % \!\pcol@invokeoutput! for the outermost paragraphs in \env{paracol}
2198 % environment, where $\lrm=\!\pcol@lrmargin!=\!\textwidth!-l$ which
2199 % \!\pcol@zparacol! lets have to represent the left-plus-right margin of the
2200 % \env{list}-like environment, whose \!\linewidth! is $l$, enclosing
2201 % \env{paracol} if any. The macro \!\pcol@sptext! also sets the register
2202 % temporarily for \mctext{}s but letting it have $\!\textwidth!-\lrm$.
2203 %
2204 % \item[\Uidx{\!\footnotesep!}]
2205 % is a \!\dimen! register for an API parameter of \LaTeX{} to have the
2206 % vertical space inserted in a footnote when it is split into two or more
2207 % pages. It is used in \!\pcol@fntextbody! to \!\splittopskip! have it,
2208 % and to make the first line of the footnote is at least as tall as the
2209 % amount in the register.
2210 %
2211 % \item[\Uidx{\!\topmargin!}]
2212 % is a \!\dimen! register for an API parameter of \LaTeX{} to have the width
2213 % (height) of the top margin minus 1\,inch. The register is used as an
2214 % element of \!\pcol@bg@pagetop! to calculate the distance from the origin
2215 % at the left-top corner of text area to the top edge of a page. The
2216 % other users are \!\pcol@ioutputelt! and \!\pcol@makeflushedpage!
2217 % temporarily add the height-plus-depth of $\pp^b(p)$ to the register to
2218 % make the calculation biased shifting the origin to the left-top corner of
2219 % column area, i.e., below $\pp^b(p)$. The macro \!\@outputpage! also
2220 % refers to the register together with \!\headheight! and \!\headsep! to
2221 % calculate the distance from the page top (ignoring 1\,inch shift) to the
2222 % text area top.
2223 %
2224 % \item[\Uidx{\!\oddsidemargin!}]
2225 % is a \!\dimen! register for an API parameter of \LaTeX{} to have the width
2226 % of the left margin minus 1\,inch for two-sided odd-numbered pages and
2227 % all single-sided pages. The register is used together with
2228 % \!\evensidemargin! in \!\pcol@outputpage@l!, \!\pcol@outputpage@r! and
2229 % \!\pcol@bg@swappage! to decide the left margin of the page they are
2230 % working on.
2231 %
2232 % \item[\Uidx{\!\evensidemargin!}]
2233 % is a \!\dimen! register for an API parameter of \LaTeX{} to have the width
2234 % of the left margin minus 1\,inch for two-sided even-numbered pages. The
2235 % register is used together with \!\oddsidemargin! in \!\pcol@outputpage@l!,
2236 % \!\pcol@outputpage@r! and \!\pcol@bg@swappage! to decide the left margin
2237 % of the page they are working on.
2238 %
2239 % \item[\Uidx{\!\headheight!}]
2240 % is a \!\dimen! register for an API parameter of \LaTeX{} to have the
2241 % height of page headers. The register is used together with \!\topmargin!
2242 % and \!\headsep! as an element of \!\pcol@bg@pagetop! and in \!\@outputpage!
2243 % to calculate the distance from the real and imaginary page top to the text
2244 % area top respectively.
2245 %
2246 % \item[\Uidx{\!\headsep!}]
2247 % is a \!\dimen! register for an API parameter of \LaTeX{} to have the
2248 % vertical distance from the bottom of a page header to the text area top.
2249 % The register is used together with \!\topmargin! and \!\headheight! as an
2250 % element of \!\pcol@bg@pagetop! and in \!\@outputpage! to calculate the
2251 % distance from the real and imaginary page top to the text area top
2252 % respectively.
2253 %
2254 % \item[\Uidx{\!\textheight!}]
2255 % is a \!\dimen! register for an API parameter of \LaTeX{} to have the
2256 % height of text area in a page. The register is referred to by
2257 % \!\pcol@output! to examine if a page is very short, by \!\pcol@getpinfo!,
2258 % \!\pcol@startpage!, \!\pcol@flushfloats! and \!\pcol@output@end! to let
2259 % \!\@colht! be it for a page without \spanning{} (so far), by
2260 % \!\pcol@outputelt!, \!\@outputpage!, \!\pcol@output@flush! and
2261 % \!\pcol@output@clear! to build a page to be shipped out, by
2262 % \!\pcol@bg@textheight! to calculate $\HT$, and by \!\pcol@fntextbody! to
2263 % cap the height of a footnote.
2264 %
2265 % \item[\Uidx{\!\textwidth!}]
2266 % is a \!\dimen! register for an API parameter of \LaTeX{} to have the width
2267 % of a page, which we occasionally refer to as $\WT$. The register is
2268 % referred to by \!\pcol@ioutputelt!, \!\pcol@imakeflushedpage! and
2269 % \!\pcol@iflushfloats! to build a \!\hbox! of \!\textwidth! wide to have
2270 % all columns (in a left or right \parapag{}e). It also referred to by
2271 % following macros; \!\pcol@bg@swappage! to calculate the right margin for
2272 % \mirror{}ed \bgpaint; \!\pcol@bg@@r!, \!\pcol@bg@@f!, \!\pcol@bg@@n!,
2273 % \!\pcol@bg@@p! and \!\pcol@bg@@s! to specify the width of \bground{} of
2274 % \pwstuff{} to be painted; \!\pcol@shiftspanning! to calculate the
2275 % left-shift amount of a \mctext{} in \cswap; \!\pcol@addmarginpar! to
2276 % measure the distance between the right edges of the rightmost and current
2277 % columns; \!\pcol@zparacol! for the calculation of
2278 % $\lrm=\!\pcol@lrmargin!$; \!\pcol@setcolwidth@r! for the calculation of
2279 % $\w_c$ for all $c\In0\CL$ or $c\In\CL\C$; \!\pcol@setcw@calcfactors! for
2280 % the calculation of $\WT/W$ and $(\WT-W)/F$; \!\pcol@sptext!,
2281 % \!\footnoterule! of \env{paracol}'s local and \!\endparacol! to set it
2282 % in \!\columnwidth!; and \!\pcol@fntextbody! to set it in \!\hsize! if
2283 % \Scfnote{} typesetting is in effect.
2284 %
2285 % \item[\Uidx{\!\columnwidth!}]
2286 % is a \!\dimen! register for an API parameter of \LaTeX{} to have the width
2287 % of a column. The register is let have $\w_c$ by \!\pcol@getcurrcol! for
2288 % the column $c$, then is referred to by the following macros;
2289 % \!\pcol@shiftspanning! to calculate the left-shift amount of a \mctext{} in
2290 % \cswap; \!\pcol@addmarginpar! to measure the distance between the right
2291 % edges of the rightmost and current columns; \!\pcol@imakeflushedpage! and
2292 % \!\pcol@iflushfloats! to put each \colpage{} into a \!\hbox! of $\w_c$ wide
2293 % for shipping a page out; \!\pcol@invokeoutput! to let \!\linewidth! and
2294 % \!\hsize! have the value of or based on it; and \!\pcol@fntextbody! to
2295 % let \!\hsize! have it for \Mcfnote{} typesetting. The register is also
2296 % let have \!\textwidth! by \!\footnoterule! of \env{paracol}'s local
2297 % defined in \!\pcol@zparacol! if \Scfnote{} typesetting is in effect, by
2298 % \!\pcol@sptext! for \mctext{}s, and by \!\endparacol! for \postenv.
2299 %
2300 % \item[\Uidx{\!\columnsep!}]
2301 % is a \!\dimen! register for an API parameter of \LaTeX{} to have the width
2302 % of \csepgap{}s. It is referred to by \!\pcol@setcolwidth@r! to
2303 % calculate $\w_c$ for all $c\In0\CL$ or $c\In\CL\C$, and by
2304 % \!\pcol@setcw@getspec! as the default width of \csepgap{}s.
2305 %
2306 % \item[\Uidx{\!\columnseprule!}]
2307 % is a \!\dimen! register for an API parameter of \LaTeX{} to have the width
2308 % of the rules to be drawn in \csepgap{}s. It is referred to by
2309 % \!\pcol@buildcolseprule! and \!\pcol@buildcselt! to draw the rule, and by
2310 % \!\pcol@hfil! to examine if it is positive to mean the rule is really
2311 % drawn and if so to add skips of $-\!\columnseprule!/2$ to surround the
2312 % rule to nullify the width of the rule.
2313 %
2314 % \item[\Uidx{\!\marginparwidth!}]
2315 % is a \!\dimen! register for an API parameter of \LaTeX{} to have the width
2316 % of a marginal note. It is temporarily modified by \!\pcol@addmarginpar!
2317 % so that a left marginal note is placed appropriately.
2318 %
2319 % \item[\Uidx{\!\marginparsep!}]
2320 % is a \!\dimen! register for an API parameter of \LaTeX{} to have the
2321 % distance between a marginal note and text area. It is temporarily
2322 % modified by \!\pcol@addmarginpar! so that a right marginal note is placed
2323 % appropriately.
2324 %
2325 % \item[\Uidx{\!\marginparpush!}]
2326 % is a \!\dimen! register for an API parameter of \LaTeX{} to have the
2327 % minimum vertical distance between two marginal notes. It is referred to
2328 % by \!\pcol@addmarginpar! to find a place for a marginal note and remember
2329 % the place in $\pp^m(p)$.
2330 %
2331 % \item[\Uidx{\!\paperheight!}]
2332 % is a \!\dimen! register for an API parameter of \LaTeX{} to have the height
2333 % of physical pages $\HP$. It is referred to by \!\pcol@bg@paperheight!
2334 % to calculate $\HP-2\WR$.
2335 %
2336 % \item[\Uidx{\!\paperwidth!}]
2337 % is a \!\dimen! register for an API parameter of \LaTeX{} to have the width
2338 % of physical pages $\WP$. It is referred to by \!\pcol@bg@swappage! to
2339 % calculate the right margin for \mirror{}ed \bgpaint, and by
2340 % \!\pcol@bg@paperwidth! to calculate $\WP-2\WR$.
2341 %
2342 % \item[\Uidx{\!\z@!}]
2343 % is a \!\dimen! register to have 0\,|pt| to initialize \!\pagerim!,
2344 % \!\belowfootnoteskip! and \!\skip!\!\pcol@colorins! at their declarations,
2345 % and is used in the following macros.
2346 % 
2347 % \begin{quote}\raggedright
2348 % \!\pcol@ShowBox!,
2349 % \!\pcol@makecol!,
2350 % \!\pcol@combinefloats!,
2351 % \!\pcol@nextpelt!,
2352 % \!\pcol@floatplacement!,
2353 % \!\pcol@startpage!,
2354 % \!\pcol@restartcolumn!,
2355 % \!\pcol@outputelt!,
2356 % \!\pcol@ioutputelt!,
2357 % \!\pcol@buildcolseprule!,
2358 % \!\pcol@buildcselt@S!,
2359 % \!\pcol@buildcselt!,
2360 % \!\@outputpage!,
2361 % \!\pcol@startcolumn!,
2362 % \!\pcol@bg@paint@i!,
2363 % \!\pcol@bg@paintregion!,
2364 % \!\pcol@output@start!,
2365 % \!\pcol@putbackmvl!,
2366 % \!\pcol@iscancst!,
2367 % \!\pcol@deferredfootins!,
2368 % \!\pcol@combinefootins!,
2369 % \!\pcol@addmarginpar!,
2370 % \!\pcol@getmparbottom!,
2371 % \!\pcol@sync!,
2372 % \!\pcol@measurecolumn!,
2373 % \!\pcol@synccolumn!,
2374 % \!\pcol@makeflushedpage!,
2375 % \!\pcol@imakeflushedpage!,
2376 % \!\pcol@output@end!,
2377 % \!\pcol@invokeoutput!,
2378 % \!\pcol@setcolwidth@s!,
2379 % \!\pcol@setcw@calcfactors!,
2380 % \!\pcol@setcw@calcf!,
2381 % \!\pcol@extract@fil@ii!,
2382 % \!\pcol@sptext!,
2383 % \!\pcol@fntextbody!.
2384 % \!\pcol@marginpar!,
2385 % \!\pcol@icolumncolor!,
2386 % \!\pcol@set@color@push!,
2387 % \!\pcol@reset@color@pop!,
2388 % \!\pcol@reset@color@mpop!,
2389 % \!\pcol@backgroundcolor@iii!.
2390 % \end{quote}
2391 % 
2392 % It is also used to give the number 0 for the initializations of
2393 % \!\pcol@currcol!, \!\pcol@ncol!, \!\pcol@ncolleft! and
2394 % \!\count!\!\pcol@colorins! at their declarations, and in the following
2395 % macros.
2396 % 
2397 % \begin{quote}\raggedright
2398 % \!\pcol@ShowBox!,
2399 % \!\pcol@F@count!,
2400 % \!\pcol@makecol!,
2401 % \!\pcol@opcol!,
2402 % \!\pcol@setpnoelt!,
2403 % \!\pcol@nextpelt!,
2404 % \!\pcol@checkshipped!,
2405 % \!\pcol@getpelt!,
2406 % \!\pcol@outputelt!,
2407 % \!\pcol@ioutputelt!,
2408 % \!\@outputpage!,
2409 % \!\pcol@startcolumn!,
2410 % \!\pcol@output@start!,
2411 % \!\pcol@output@switch!,
2412 % \!\pcol@setcurrcol!,
2413 % \!\pcol@iscancst!,
2414 % \!\pcol@addmarginpar!,
2415 % \!\pcol@setmpbelt!,
2416 % \!\pcol@do@mpbout@i!,
2417 % \!\pcol@sync!,
2418 % \!\pcol@synccolumn!,
2419 % \!\pcol@makeflushedpage!,
2420 % \!\pcol@imakeflushedpage!,
2421 % \!\pcol@flushfloats!,
2422 % \!\pcol@iflushfloats!,
2423 % \!\pcol@freshpage!,
2424 % \!\pcol@output@end!,
2425 % \!\pcol@zparacol!,
2426 % \!\pcol@setcolwidth@r!,
2427 % \!\pcol@setcw@calcf!,
2428 % \!\pcol@synccounter!,
2429 % \!\pcol@com@syncallcounters!,
2430 % \!\pcol@stepcounter!,
2431 % \!\pcol@stpclelt!,
2432 % \!\pcol@com@switchcolumn!,
2433 % \!\pcol@switchcolumn!,
2434 % \!\pcol@sptext!,
2435 % \!\pcol@switchcol!,
2436 % \!\pcol@visitallcols!,
2437 % \!\pcol@xympar!,
2438 % \!\endparacol!.
2439 % \end{quote}
2440 %
2441 % \item[\Uidx{\!\p@!}]
2442 % \begin{Sloppy}{3950}%
2443 % is a \!\dimen! register to have 1\,|pt|. It is used in \!\pcol@ShowBox!,
2444 % \!\pcol@cflt!, \!\pcol@addflhd!, \!\pcol@synccolumn!, \!\pcol@output@end!,
2445 % \!\pcol@setcolwidth@s!, \!\pcol@setcw@getspec@i!, \!\pcol@setcw@fill! and
2446 % \!\pcol@setcw@calcf!, and the top level assignment to \!\@tempskipa! for
2447 % the invocation of \!\pcol@defkw!, as the shorthand of |pt|.
2448 % \end{Sloppy}
2449 %
2450 % \item[\Uidx{\!\@totalleftmargin!}]
2451 % is a \!\dimen! register to have the total size of the left margins of a
2452 % \env{list}-like environment and those surrounding it. It is given to
2453 % \!\parshape! by \!\pcol@invokeoutput! and \!\pcol@sptext! if \env{paracol}
2454 % is enclosed in a \env{list}-like environment.
2455 %
2456 % \item[\Uidx{\!\@themargin!}]
2457 % is a control sequence \!\let!-equal to \!\evensidemargin! for two-sided
2458 % even numbered pages or \!\oddsidemargin! for others. In
2459 % \!\pcol@outputpage@l! and \!\pcol@outputpage@r! it is bound to one of
2460 % \!\dimen! registers for the references in \!\pcol@outputpage@ev!\footnote{
2461 % 
2462 % The reference in \CSIndex{pcol@@outputpage} being \LaTeX's
2463 % \CSIndex{@outputpage} is done after the macro itself makes the assignment,
2464 % which is of course consistent with those in our macros.}.
2465 %
2466 % \item[\Uidx{\!\@maxdepth!}]
2467 % is a \!\dimen! register to have \!\maxdepth! at \beginenv{document} to
2468 % recover the temporary update of \!\maxdepth! with 0 by \!\@addtobot! for
2469 % bottom float incorporation in a page. As discussed in the explanation of
2470 % \!\maxdepth!, in \env{paracol} environments \!\maxdepth! is let have
2471 % \!\@maxdepth! always by the assignments in \!\pcol@output! and
2472 % \!\pcol@combinefloats!. Other users, \!\pcol@cflt!, \!\pcol@opcol!,
2473 % \!\pcol@ioutputelt!, \!\pcol@combinefootins!, \!\pcol@output@flush! and
2474 % \!\pcol@output@clear!, let \!\boxmaxdepth! have \!\@maxdepth! so as to
2475 % limit the depth of boxes for a completed \colpage{} or page to the value
2476 % for page typesetting, while \!\pcol@flushcolumn! and
2477 % \!\pcol@imakeflushedpage! do that by \!\pcol@@makecol! giving the register
2478 % to it. The other usage of the register is to calculate \bgpaint{}
2479 % parameter $\HT$ by \!\pcol@bg@textheight!, and to determine the bottom
2480 % edge of the \bground{}s of columns and \csepgap{}s through the argument of
2481 % \!\pcol@buildcolseprule! given by \!\pcol@ioutputelt!,
2482 % \!\pcol@imakeflushedpage! and \!\pcol@iflushfloats!. The register is also
2483 % referred to by \!\pcol@unvbox@cclv! to go back the last baseline of the
2484 % main vertical list in \!\box!|255|, and by \!\pcol@deferredfootins! to let
2485 % \!\splitmaxdepth! have its value to cap the depth of the first half of
2486 % footnotes split from $\df$.
2487 %
2488 % \item[\Uidx{\!\@colht!}]
2489 % is a \!\dimen! register to have the height of columns in a page possibly
2490 % shrunk from \!\textheight! by \spanning. The usages of the register
2491 % are as follows.
2492 % 
2493 % \begin{itemize}
2494 % \item\begin{Sloppy}{1600}
2495 % In \!\pcol@startpage!, \!\pcol@output@start!, \!\pcol@flushfloats! and
2496 % \!\pcol@output@end!, it is initialized to \!\textheight!. In first two,
2497 % the value of the register is reduced to reflect \spanning{} if exists and
2498 % then set into $\pp^h(p)$, while the setting by the third is referred to by
2499 % its callee \!\pcol@iflushfloats!.
2500 % \end{Sloppy}
2501 %
2502 % \item
2503 % In \!\pcol@getpelt!, \!\pcol@sync!, \!\pcol@flushcolumn!,
2504 % \!\pcol@makeflushedpage! and \!\pcol@imakeflushedpage!, it is let have
2505 % $\pp^h(p)$. In addition \!\pcol@sync! examines if
2506 % $\!\@colht!<\VT+\VB+v(f)$, and \!\pcol@makefcolumn! uses it to initialize
2507 % the room of a \fcolumn{} as well as the height of $\cc_c(\vb)$ for it.
2508 %
2509 % \item
2510 % In \!\pcol@opcol!, it is used to add \!\pcol@clearcolorstack! to the
2511 % bottom of $\cc_c(\vb)$ whose height is \!\@colht!.
2512 %
2513 % \item
2514 % In \!\pcol@startcolumn!(*), \!\pcol@flushcolumn!(*) and
2515 % \!\pcol@freshpage!, it is used to let \!\@colroom! have it.
2516 %
2517 % \item
2518 % In \!\pcol@restartcolumn!(*), it is saved and restored for the use as the
2519 % height cap of deferred footnote \!\insert!ion in \!\pcol@deferredfootins!
2520 % because it can be shrunk by the non-deferred \Scfnote{}s.
2521 %
2522 % \item
2523 % In \!\pcol@output@flush! and \!\pcol@output@clear!, it is given to
2524 % \!\pcol@make~flushed~page! as its argument. The macro
2525 % \!\pcol@makeflushedpage!(*) lets \!\@colht! be the argument if it is less
2526 % than \!\@colht! and thus is given by \!\pcol@output@end!.
2527 % \end{itemize}
2528 % 
2529 % In addition, in the macros with `(*)' above and \!\pcol@makecol!, the
2530 % register is passed to \!\pcol@shrinkcolbyfn! to shrink the height in it
2531 % temporarily to keep the space required to put \Scfnote{}s in the page they
2532 % are working on, for the reference by starred macros themselves or
2533 % \!\@makecol! invoked in \!\pcol@makecol!.
2534 %
2535 % \item[\Uidx{\!\@colroom!}]
2536 % is a \!\dimen! register to have the height of a column possibly shrunk
2537 % from \!\@colht! by top and bottom floats. The register is initialized to
2538 % have \!\@colht! by \!\pcol@startcolumn!, \!\pcol@output@start!,
2539 % \!\pcol@flushcolumn! and \!\pcol@freshpage!, the last three of which also
2540 % save it into $\cc_c(\vb^r)$. This save operation is also done by
2541 % \!\pcol@output@switch! while restoring from it done by
2542 % \!\pcol@restartcolumn!, but the latter macro may shrink the amount in its
2543 % callee \!\pcol@putbackmvl! to capture a \mctext{} while the former cancel
2544 % this shrinkage. The macros \!\pcol@output! and \!\pcol@output@start! also
2545 % refer to this register to let \!\vsize! have it in the former and to
2546 % calculate the room for each \colpage{} in the \spage{} in the latter. The
2547 % macro \!\pcol@output@end! lets the register have \!\textheight! for the
2548 % \postenv{} because the \colpage{}s above it simply precedes the stuff in
2549 % the main vertical list. The other users \!\pcol@makefcolumn! and
2550 % \!\pcol@makefcolelt! use this register to accumulate the total size of
2551 % floats to be put in a \fcolumn{} temporarily.
2552 %
2553 % \item[\Uidx{\!\@pageht!}]
2554 % is a \!\dimen! register to be used in \LaTeX's \!\@specialoutput! to have
2555 % the height of \!\@holdpg!. It is referred to by \!\pcol@addmarginpar! to
2556 % determine the position at which a marginal note is placed.
2557 % We also use it as a scratchpad to have $\VP$ in \!\pcol@sync! and
2558 % \!\pcol@measurecolumn!, and to save $\pp^h(\ptop)$ in \!\pcol@flushcolumn!
2559 % for the reference in itself, and to do so in \!\pcol@makeflushedpage! for
2560 % \!\pcol@imakeflushedpage!.
2561 %
2562 % \item[\Uidx{\!\@pagedp!}]
2563 % is a \!\dimen! register to be used in \LaTeX's \!\@specialoutput! to have
2564 % the depth of \!\@holdpg!. However, we use it as a scratchpad in
2565 % \!\pcol@sync! and \!\pcol@measurecolumn! to have $\DP$, and in
2566 % \!\pcol@output@end! to have the value to be set in \!\pcol@prevdepth!.
2567 %
2568 % \item[\Uidx{\!\@toproom!}]
2569 % is a \!\dimen! register to have the room for top floats. The register is
2570 % saved in $\cc_c(\tr)$ by \!\pcol@setcurrcol! and restored from it by
2571 % \!\pcol@iigetcurrcol!. The macro \!\pcol@makefcolumn! uses this register
2572 % as a flag to indicate that $\cc_c(\tl)$ of the column $c$ having
2573 % $\cc_c(\tr)=\infty$ contains floats to be put in its last \fcolumn{}
2574 % possibly as top floats so that it is examined by \!\pcol@flushcolumn! and
2575 % \!\pcol@imakeflushedpage!, the former of which then lets $\cc_c(\tr)=0$ to
2576 % mean the floats are put in a \fcolumn{} in a non-\lpage{} by the macro.
2577 %
2578 % \item[\Uidx{\!\@botroom!}]
2579 % is a \!\dimen! register to have the room for bottom floats. The register
2580 % is saved in $\cc_c(\br)$ by \!\pcol@setcurrcol! and restored from it by
2581 % \!\pcol@iigetcurrcol!.
2582 %
2583 % \item[\Uidx{\!\@fpmin!}]
2584 % is a \!\dimen! register to have $\!\floatpagefraction!\times\!\@colht!$
2585 % being the minimum total size of floats for which an ordinary (not flushed)
2586 % \fcolumn{} can be build. It is referred to by \!\pcol@makefcolumn! as the
2587 % threshold below which floats in the last \fcolumn{} can be put as top
2588 % floats.
2589 %
2590 % \item[\Uidx{\!\@mparbottom!}]
2591 % is a \!\dimen! register to have the bottom position of the last
2592 % \!\marginpar! stuff. Its value at \beginparacol{} is referred to by
2593 % \!\pcol@output@start! to let $\mpb_L^l$ or $\mpb_L^r$ of $\pp^m(0)$ has an
2594 % element based on it, while the tail of one of the lists in $\pp^m(\ptop)$
2595 % defines the value at \Endparacol{} which \!\pcol@output@end! lets the
2596 % register have. The register is also updated by \!\pcol@getmparbottom! and
2597 % \!\pcol@getmpbelt! to let \!\pcol@@addmarginpar! being \LaTeX's original
2598 % \!\@addmarginpar! know the uppermost available position for the marginal
2599 % note to be added. This update is, however, just for communication between
2600 % these macros and thus is ineffective for typesetting posterior to that, as
2601 % well as the update in \!\pcol@@addmarginpar!, because whole information
2602 % for marginal note placement is kept in $\pp^m(p)$ in $\PPP$.
2603 %
2604 % \item[\Uidx{\!\@textfloatsheight!}]
2605 % is a \!\dimen! register to have the combined height of mid floats and
2606 % their separators. It is initialize to be 0 by \!\pcol@floatplacement!,
2607 % saved in $\cc_c(\fh)$ by \!\pcol@setcurrcol!, and restored from it by
2608 % \!\pcol@iigetcurrcol!.
2609 %
2610 % \item[\Uidx{\!\dimen@!}]
2611 % is a \!\dimen! register for temporary use. It is used in the following
2612 % macros.
2613 % 
2614 % \begin{itemize}
2615 % \item
2616 % \!\pcol@buildcolseprule!, \!\pcol@buildcselt@S! and \!\pcol@buildcselt! to
2617 % have the argument $d\in\{\!\@maxdepth!,0\}$ of the first macro.
2618 %
2619 % \item
2620 % \!\pcol@bg@paintregion@i! to have $y_1$ of $\bgr_a^{[c]}$.
2621 %
2622 % \item
2623 % $\!\pcol@bias@mpbout@i!\Arg{y}\Arg{t}\Arg{b}$ to have $t$ and then $t+y$.
2624 %
2625 % \item
2626 % \!\pcol@output@switch! to have the height of \prespan{} in
2627 % \!\pcol@prespan!, or 0 if it is $\bot$.
2628 %
2629 % \item
2630 % \!\pcol@sync! to have $V$ or $V-\DT+\VE$.
2631 %
2632 % \item
2633 % \!\pcol@addflhd! and \!\pcol@hdflelt! to measure the height of top and
2634 % bottom floats, \!\pcol@makecol! and \!\pcol@output@switch! to measure
2635 % the height of \prespan{} including the top floats, and
2636 % \!\pcol@measurecolumn! for top and bottom floats and $\VT$, $\VB$ and
2637 % $\VP$.
2638 %
2639 % \item
2640 % \!\pcol@setcolwidth@s! and \!\pcol@setcw@accumwd! to accumulate $W$ being
2641 % the sum of natural widths of column\slash gap specifications, and then
2642 % used by \!\pcol@setcw@calcfactors! to calculate $W/\WT$ and $W-\WT$.
2643 % \end{itemize}
2644 %
2645 % \item[\Uidx{\!\dimen@ii!}]
2646 % is a \!\dimen! register for temporary use. It is used in the following
2647 % macros.
2648 % 
2649 % \begin{itemize}
2650 % \item
2651 % \!\pcol@makecol! to measure the total height of top floats by
2652 % \!\pcol@addflhd!.
2653 %
2654 % \item
2655 % \!\pcol@bg@addext! to have
2656 % $e=|pcol@bg@ext@|{\cdot}d{\cdot}|@|{\cdot}\{a{\cdot}|@|{\cdot}c,a\}$
2657 % 
2658 % \SpecialArrayIndex{d{\cdot}\string\texttt{@}
2659 % {\cdot}a{\cdot}\string\texttt{@}{\cdot}c}{\pcol@bg@ext@}
2660 % \SpecialArrayIndex{d{\cdot}\string\texttt{@}{\cdot}a}{\pcol@bg@ext@}
2661 % 
2662 % and then $10000\PT-e$ to calculate an \bgext{} of \bgpaint.
2663 %
2664 % \item
2665 % $\!\pcol@bias@mpbout@i!\Arg{y}\Arg{t}\Arg{b}$ to have $b$ and then $b+y$.
2666 %
2667 % \item
2668 % \!\pcol@measurecolumn! to measure $\VT$, $\VP$ and $\DP$.
2669 %
2670 % \item
2671 % \!\pcol@setcolwidth@s! and \!\pcol@setcw@accumwd! to accumulate $F$ being
2672 % the sum of infinite stretch factors in column\slash gap specifications with
2673 % the unit of pt, and then used by \!\pcol@setcw@calcfactors! to calculate
2674 % $(W-\WT)/F$, where $W$ is the sum of natural widths.
2675 %
2676 % \item
2677 % \!\pcol@setcw@calcfactors! to have $(W-\WT)/F$ above or 0 to be used in
2678 % \!\pcol@def@extract@fil@iii! through \!\pcol@setcw@filunit! made
2679 % \!\let!-equal to the register by \!\pcol@setcolwidth@s!.
2680 % \end{itemize}
2681 %
2682 % \item[\Uidx{\!\@tempdima!}]
2683 % is a \!\dimen! register for temporary use. The usages of this register
2684 % are as follows.
2685 % 
2686 % \begin{itemize}
2687 % \item
2688 % In \!\pcol@makecol! and \!\pcol@startpage!, it is used to throw
2689 % $\pp^h(\ptop)$ away when we get it by \!\pcol@getcurrpinfo! because we
2690 % don't need it.
2691 %
2692 % \item
2693 % In \!\pcol@outputelt!, it has $\pp^h(p)$ to examine if $p$ is a \fpage.
2694 %
2695 % \item
2696 % In \!\pcol@ioutputelt!, it has $\pp^h(p)$ possibly shrunk by \Scfnote{}s
2697 % to know the \bground{}s to be painted for columns etc. After that it has
2698 % $\w_c$ being the width of each \!\hbox! into which the \colpage{} of each
2699 % column $c$ is put.
2700 %
2701 % \item
2702 % In \!\pcol@buildcolseprule! and its callees \!\pcol@buildcselt@S! and
2703 % \!\pcol@buildcselt!, the register has the first argument $H=\pp^h(p)$ of
2704 % the caller macro.
2705 %
2706 % \item
2707 % In \!\pcol@hfil!$\<c\>$, it has $\gap_c=|\pcol@columnsep|{\cdot}c$.
2708 % 
2709 % \SpecialArrayIndex{c}{\pcol@columnsep}
2710 %
2711 % \item
2712 % In \!\@outputpage!, it has the sum of \!\topmargin!, \!\headheight! and
2713 % \!\headsep! being the distance between tops of imaginary page and its text
2714 % area.
2715 %
2716 % \item
2717 % In \!\pcol@startcolumn!, it is used to save \!\@colht! which can be shrunk
2718 % temporarily by \Scfnote{}s.
2719 %
2720 % \item
2721 % In \!\pcol@bg@paintregion@i!, it is let have $x_0$ of $\bgr_a^{[c]}$.
2722 %
2723 % \item
2724 % In \!\pcol@output@start!, it is used to have the room for each \colpage{}
2725 % in the \spage, and then the height-plus-depth of the \preenv.
2726 %
2727 % \item
2728 % In \!\pcol@output@switch!, it is used to throw $\pp^h(p)$ away when
2729 % we get it by \!\pcol@getcurrpinfo! because we don't need it.
2730 %
2731 % \item
2732 % In \!\pcol@shiftspanning!, it is let have the left-shift amount of a
2733 % \mctext{} in \cswap.
2734 %
2735 % \item
2736 % In \!\pcol@restartcolumn!, it is used to save \!\@colht! which can be
2737 % shrunk temporarily by \Scfnote{}s.
2738 %
2739 % \item
2740 % In \!\pcol@unvbox@cclv!$\arg{ins}$, it has the depth of \!\box!|255| for
2741 % going back to the baseline of the box, and then has the natural component
2742 % of $\!\skip!\arg{ins}$ to add its stretch and shrink components only.
2743 %
2744 % \item
2745 % In \!\pcol@addmarginpar!, at first it has the distance between left edges
2746 % of the leftmost and current columns. Then it is let have the distance
2747 % between top edges of the column and the marginal text to be put.
2748 %
2749 % \item
2750 % In $\!\pcol@getmparbottom!\<t\>\<h\>$ and
2751 % $\!\pcol@getmpbelt!\<t_i\>\<b_i\>$, it at first has $t$ and then is
2752 % let have $b_i$ when the marginal note cannot be put at $t$.
2753 %
2754 % \item
2755 % In \!\pcol@sync!, \!\pcol@measurecolumn! and \!\pcol@synccolumn!, it has
2756 % $\VT$ being the maximum combined height of top floats and the main
2757 % vertical list.
2758 %
2759 % \item
2760 % In \!\pcol@makefcolumn! and \!\pcol@makefcolelt!, it has the room for
2761 % floats to be put in a \fcolumn{}.
2762 %
2763 % \item
2764 % In \!\pcol@makeflushedpage!, it has the height-plus-depth of \spanning in
2765 % $\pp^i(\ptop)$.
2766 %
2767 % \item
2768 % In \!\pcol@output@end!, at first it is let have $\VPP-H$, where $H$ is the
2769 % height(-plus-depth) of \!\@outputbox! having the ship-out image of the
2770 % \lpage, being the negative counterpart of the height-plus-depth of
2771 % \spanning{} in the \lpage{} for setting $\mpbout$, and then have $H$ to be
2772 % set in \!\pcol@bg@preposttop! for the \bgpaint{} of \postenv.
2773 %
2774 % \item
2775 % In \!\pcol@setcolwidth@r!, it has
2776 % $\!\textwidth!-(\Cto-\Cfrom-1)\!\columnsep!$ being the base of $\w_c$.
2777 %
2778 % \item
2779 % In \!\pcol@setcw@getspec@i!, it is let have the natural width of a
2780 % column\slash gap specification, to be used in \!\pcol@setcolwidth@s!,
2781 % \!\pcol@setcw@accumwd! and \!\pcol@setcw@set!, while in the last of them
2782 % it finally has $\w_c$ or $\gap_c$.
2783 %
2784 % \item
2785 % In $\!\pcol@setcw@calcf!\<x\>\<y\>\<z\>$, at first it has $y$, then
2786 % $y/2^{k_2}$, and then $\lceil y/2^{k_2+k_3}\rceil$, where $k_2$ and $k_3$
2787 % are scaling parameters for good approximation.
2788 %
2789 % \item
2790 % In \!\pcol@switchcol!, it is let have what \!\pcol@ensurevspace! has so
2791 % that the dimensional expression in it is evaluated in the macro and the
2792 % evaluation result is assigned to $\VE=\!\pcol@@ensurevspace!$.
2793 %
2794 % \item
2795 % In $\!\ensurevspace!\ARg{space}$, it is let have $\arg{space}$ to ensure
2796 % the argument is a dimension including forced one.
2797 %
2798 % \item
2799 % In \!\pcol@fntextbody!, it has the height-plus-depth of the \!\vbox! in
2800 % which the footnote is encapsulated.
2801 %
2802 % \item
2803 % In \!\pcol@set@color@push!, it has the width of the \!\vbox! to be
2804 % \!\insert!ed, which is $m$\,|sp| for a math-mode push of $\mcelt_{i,m}$ or
2805 % 0 for a non-math one $\celt_i$.
2806 %
2807 % \item
2808 % In $\!\pcol@bg@defext!\Arg{d}\Arg{e}$, it is let have $e$ to confirm $e$
2809 % is a proper dimension.
2810 % \end{itemize}
2811 %
2812 % \item[\Uidx{\!\@tempdimb!}]
2813 % is a \!\dimen! register for temporary use. The usages of this register
2814 % are as follows.
2815 % 
2816 % \begin{itemize}
2817 % \item
2818 % In \!\pcol@makecol!, it is used to measure the height-plus-depth $h_i$ of
2819 % decapsulated \!\box!|255| and its original form to add an element
2820 % $\spt(H_i,h_i)$ to $\pp^s(\ptop)$ for a \mctext{} captured in the box.
2821 %
2822 % \item
2823 % In \!\pcol@ioutputelt!, if has the height-plus-depth of \spanning{}
2824 % $\pp^b(q)$ to be temporarily added to \!\topmargin!.
2825 %
2826 % \item
2827 % In \!\pcol@buildcolseprule! it has $H_0+h_0$, while in its callee
2828 % $\!\pcol@buildcselt!\<H_i\>\~\<h_i\>$ it has $H_{i-1}+h_{i-1}$ and then
2829 % $H_i+h_i$ where $\spt(H_i,h_i)\in\pp^s(p)$.
2830 %
2831 % \item
2832 % In \!\pcol@bg@paintregion@i!, it is let have $y_0$ of $\bgr_a^{[c]}$.
2833 %
2834 % \item
2835 % In \!\pcol@output@switch!, it is let have the height-plus-depth $h_i$ of
2836 % \!\@holdpg! having a \mctext{} to add an element $\spt(H_i,h_i)$ to
2837 % $\pp^s(\ptop)$.
2838 %
2839 % \item
2840 % In \!\pcol@shrinkcolbyfn!, it is let have the inverse of the \!\skip!
2841 % component of the argument \!\insert! register of the macro, so that in
2842 % \!\pcol@startcolumn! and \!\pcol@restartcolumn! it has that of $\pp^f(p)$
2843 % if $p$ has \Scfnote{}s, or 0 otherwise, and then is referred to by
2844 % \!\pcol@deferredfootins! which then lets the register have the height cap
2845 % of $\df$ splitting.
2846 %
2847 % \item
2848 % In \!\pcol@addmarginpar!, \!\pcol@getmparbottom! and \!\pcol@getmpbelt!,
2849 % it is let have the vertical space to be occupied
2850 % by the marginal text to be put, being the second argument of
2851 % \!\pcol@getmparbottom!.
2852 %
2853 % \item
2854 % In \!\pcol@sync! and \!\pcol@measurecolumn!, it has $\VB$ and then, in the
2855 % former, it has $\VP+v(f)$, $\VT$ or $\VT+\VB+v(f)$ according to the
2856 % contents of the page to be \sync{}ed.
2857 %
2858 % \item
2859 % In \!\pcol@makefcolelt!, it has the size of vertical space consumed by a
2860 % float.
2861 %
2862 % \item
2863 % In \!\pcol@synccolumn!, it has $\VT-\vc(t)$ being the vertical space from
2864 % the bottom of $\cc_c(\vb^b)$ to the \sync{}ation point. If the
2865 % \sync{}ation point is defined by a column without main vertical list but
2866 % with top floats, then the register is let have
2867 % $\VT-\vc(t)+\!\textfloatsep!-\!\floatsep!+10000\,|pt|$ to be set in
2868 % $\cc_c(\tf)=\!\pcol@textfloatsep!$ as the space below the \mvlfloat{}
2869 % biased by 10000\,|pt| to indicate the last float is the \mvlfloat{}.
2870 %
2871 % \item
2872 % In \!\pcol@setcolwidth@r!, it has
2873 % $\!\textwidth!-(\Cto-\Cfrom-1)\!\columnsep!-\sum_{d=0}^{k-1}w_d$ being the
2874 % base of $\w_c$ for $c\In{\Cfrom{+}k}{\,\Cto}$ where $k$ is the number of
2875 % fractions given in the argument of \!\columnratio!.
2876 %
2877 % \item
2878 % In $\!\pcol@setcw@calcf!\<x\>\<y\>\<z\>$, at first it is let have $x$,
2879 % then $x\cdot2^{k_1}$, then
2880 % $z'=\break\lfloor(x\cdot2^{k_1})/\lceil{}y/2^{k_2+k_3}\rceil\rfloor$, and
2881 % finally
2882 % $Z=z\times1\,|pt|=z'\cdot2^{16-k}$ referred to by
2883 % \!\pcol@setcw@calcfactors! as $\phi_f=(\WT-W)/F$, where $k_1$, $k_2$ and
2884 % $k_3$ are scaling parameters for good approximation and $k=k_1+k_2+k_3$.
2885 %
2886 % \item
2887 % In \!\pcol@extract@fil@ii! and \!\pcol@extract@fil@iii!, it is let have
2888 % the infinite stretch factor of a column\slash gap specification
2889 % represented with the unit \!\pcol@setcw@filunit!, to be used in
2890 % \!\pcol@setcolwidth@s!, \!\pcol@setcw@accumwd!, and \!\pcol@setcw@set!.
2891 %
2892 % \item
2893 % In \!\pcol@fntextbody!, it has $\!\textheight!-\!\skip!\!\footins!$ as the
2894 % cap of the footnote.
2895 % \end{itemize}
2896 %
2897 %
2898 % \item[\Uidx{\!\@tempdimc!}]
2899 % is a \!\dimen! register for temporary use. It is let have values as
2900 % follows.
2901 % 
2902 % \begin{itemize}
2903 % \item
2904 % $H_i-(H_{i-1}+h_{i-1})$ in $\!\pcol@buildcselt!\<H_i\>\<h_i\>$.
2905 %
2906 % \item
2907 % $x_1$ of $\bgr_a^{[c]}$ in \!\pcol@bg@paintregion@i!.
2908 %
2909 % \item
2910 % $t+h$ in $\!\pcol@getmparbottom!\<t\>\<h\>$.
2911 %
2912 % \item
2913 % $\max(t,b_{i-1})+h$ in $\!\pcol@getmpbelt!\<t_i\>\<b_i\>$ invoked from
2914 % $\!\pcol@getmparbottom!\<t\>\~\<h\>$.
2915 %
2916 % \item
2917 % $\DT$ in \!\pcol@sync!, \!\pcol@measurecolumn! and \!\pcol@synccolumn!.
2918 %
2919 % \item
2920 % \!\floatsep! or \!\@fpsep! in \!\pcol@makefcolumn! and
2921 % \!\pcol@makefcolelt!.
2922 %
2923 % \item
2924 % $\w_c$ being the width of column $c$ in \!\pcol@setcolwidth@r!.
2925 %
2926 % \item
2927 % $\WT-W$ in \!\pcol@setcw@calcfactors!.
2928 %
2929 % \item
2930 % At first for calculation of $y/2^{k_2}$ and then $z'/2^k\approx x/y$
2931 % in $\!\pcol@setcw@calcf!\<x\>\<y\>\~\<z\>$ where $k_2$ and $k$ are scaling
2932 % parameters for good approximation.
2933 % \end{itemize}
2934 % \end{description}
2935 %
2936 %
2937 %
2938 % \subsubsection{Skip Registers}
2939 %
2940 % \begin{description}
2941 % \item[\Uidx{\!\baselineskip!}]
2942 % is \TeX's primitive register to have the vertical skip to separate
2943 % adjacent baselines. It is referred to by \!\pcol@output! and
2944 % \!\pcol@output@start! to examine if \!\@colroom! is unexpectedly small,
2945 % and by \!\pcol@switchcol! to give it to \!\ensurevspace! to let
2946 % \!\pcol@ensurevspace! have the default value.
2947 %
2948 % \item[\Uidx{\!\topskip!}]
2949 % is \TeX's primitive register to have the vertical skip from the top edge
2950 % of a page to the baseline of its first vertical item. It is let be 0 by
2951 % \!\pcol@output@start! if we have \preenv{} and is saved in $\pp^t(0)$,
2952 % while \!\pcol@startpage! lets it be \!\pcol@topskip!, into which
2953 % \!\pcol@zparacol! saves the value outside \env{paracol} environment,
2954 % saving the value in $\pp^t(p)$. Then the register is restored from
2955 % $\pp^t(p)$ by \!\pcol@getpelt! and \!\pcol@sync!, while
2956 % \!\pcol@synccolumn! refers to the value restored by the latter to adjust a
2957 % \sync{}ation point. The macro \!\pcol@putbackmvl! lets the register have
2958 % 0 when it starts a \mctext{} because it originally follows \prespan{} in
2959 % the \colpage{} to be restarted rather than at the page top. The macro
2960 % \!\pcol@output@end! temporarily lets the register have 0 if we have
2961 % non-empty columns in the last page, while \!\endparacol! restores it from
2962 % \!\pcol@topskip! for the pages outside \env{paracol} environment.
2963 %
2964 % \item[\Uidx{\!\splittopskip!}]
2965 % is \TeX's primitive register to have the vertical skip inserted at the
2966 % beginning of the second half of the box split by \!\vsplit! or \TeX's
2967 % internal operation for splitting an \!\insert! at a page break. The
2968 % register is temporarily let have 0 by \!\pcol@deferredfootins! when it
2969 % splits $\df$ so that the second half does not have any skip at the top.
2970 % The register is also let have \!\footnotesep! in \!\pcol@fntextbody! for
2971 % footnote typesetting.
2972 %
2973 % \item[\Uidx{\!\parskip!}]
2974 % is \TeX's primitive register to have the vertical skip inserted above each
2975 % paragraph. It is referred to by \!\pcol@zparacol! to nullify the
2976 % insertion going to be made by the first \!\item! of a \env{list}-like
2977 % environment, when the macro finds the \env{paracol} environment to start
2978 % is at the very beginning of a \env{list}-like environment.
2979 %
2980 % \item[\Uidx{\!\fill!}]
2981 % is an API \!\skip! register to have a skip 0\,|pt| |plus| 1\,|fill|. In
2982 % our macros, however, it is used as a keyword in \!\pcol@setcw@getspec!,
2983 % \!\pcol@setcw@getspec@i! and \!\pcol@setcw@fill! to extract the infinite
2984 % stretch factor $f$ given as $f\!\fill!$ in the specification.
2985 %
2986 % \item[\Uidx{\!\itemsep!}]
2987 % is an API \!\skip! register to have the vertical skip inserted above each
2988 % non-first \!\item! in \env{list}-like environments. It is referred to by
2989 % \!\pcol@zparacol! to nullify the insertion going to be made by the first
2990 % \!\item! of a \env{list}-like environment, when the macro finds the
2991 % \env{paracol} environment to start is at the very beginning of a
2992 % \env{list}-like environment.
2993 %
2994 % \item[\Uidx{\!\floatsep!}]
2995 % is an API \!\skip! register to have the vertical skip between adjacent floats.
2996 % It is referred to by \!\pcol@cflt! to cancel the skip following the last
2997 % float, by \!\pcol@makefcolumn! to let \!\pcol@makefcolelt! examine the
2998 % capacity of a \fcolumn{} in the \lpage, by \!\pcol@addflhd! and
2999 % \!\pcol@hdflelt! to measure the total height of top and bottom floats,
3000 % and by \!\pcol@sync! to calculate the space below the \mvlfloat.
3001 %
3002 % \item[\Uidx{\!\textfloatsep!}]
3003 % is an API \!\skip! register to have the vertical skip between the main
3004 % vertical list and top\slash bottom floats. It is referred to by
3005 % \!\pcol@output@start! to calculate the room for each \colpage{} in the
3006 % \spage{} with bottom floats in the \preenv{}, by \!\pcol@combinefloats! to
3007 % insert a skip below the bottom floats in the \preenv{} and \lpage{},
3008 % by \!\pcol@measurecolumn! to take this skip into account in the
3009 % calculation of $\VPP$, by \!\pcol@addflhd! to measure the vertical space
3010 % for top and bottom floats, and by \!\pcol@synccolumn! to calculate the
3011 % \sync{}ation point for columns with top floats.
3012 %
3013 % \item[\Uidx{\!\dblfloatsep!}]
3014 % is an API \!\skip! register to have the vertical skip between adjacent
3015 % \pwise{} floats, and is used in \!\pcol@startpage! to cancel the skip
3016 % below the last float.
3017 %
3018 % \item[\Uidx{\!\dbltextfloatsep!}]
3019 % is an API \!\skip! register to have the vertical skip between the last
3020 % \pwise{} float and the top of columns, and is used in
3021 % \!\pcol@startpage! to put the skip.
3022 %
3023 % \item[\Uidx{\!\@topsep!}]
3024 % is a \!\skip! register to have the vertical skip inserted above the first
3025 % \!\item! of a \env{list}-like environment. The actual value is determined
3026 % by \!\@trivlist! from API parameters \!\topsep!, \!\partopsep! and
3027 % \!\parskip! depending on how the environment appears. The skip in the
3028 % register is inserted by \!\pcol@zparacol! when it finds the \env{paracol}
3029 % environment to start is at the very beginning of a \env{list}-like
3030 % environment.
3031 %
3032 % \item[\Uidx{\!\@fptop!}]
3033 % is a \!\skip! register to have the vertical skip inserted at the top of
3034 % a \fcolumn, and is used in \!\pcol@makefcolpage!.
3035 %
3036 % \item[\Uidx{\!\@fpsep!}]
3037 % is a \!\skip! register to have the vertical skip between adjacent floats
3038 % in a \fcolumn, and is used in \!\pcol@makefcolpage!.
3039 %
3040 % \item[\Uidx{\!\@fpbot!}]
3041 % is a \!\skip! register to have the vertical skip inserted at the bottom of
3042 % a \fcolumn, and is used in \!\pcol@makefcolpage!.
3043 %
3044 % \item[\Uidx{\!\@tempskipa!}]
3045 % is a \!\skip! register for temporary use. It is used in the following
3046 % macros.
3047 % 
3048 % \begin{itemize}
3049 % \item
3050 % \begin{Sloppy}{2400}%
3051 % \!\pcol@makecol!, \!\pcol@startpage!, \!\pcol@outputelt!,
3052 % \!\pcol@output@switch!, \!\pcol@flushcolumn! and \!\pcol@makeflushedpage!
3053 % to throw $\pp^t(p)$ away because we don't need it.
3054 % \end{Sloppy}
3055 %
3056 % \item
3057 % \!\pcol@output@start! to determine \!\topskip! for the \spage.
3058 %
3059 % \item
3060 % \!\pcol@setcw@getspec@i! and \!\pcol@setcw@fill! to have the width
3061 % specification of a column or gap.
3062 % \end{itemize}
3063 % It is also used in the top level invocation of \!\pcol@defkw! with a glue
3064 % of $0\,|pt|\ |plus|\ 1\,|fil|\~\ |minus|\ 1\,|fil|$.
3065 % \end{description}
3066 %
3067 %
3068 %
3069 % \subsubsection{Box Registers}
3070 %
3071 % \begin{description}
3072 % \item[\Uidx{\!\strutbox!}]
3073 % is an API \!\box! register to have the strut for the current font size.
3074 % It is used in \!\pcol@fntextbody!\marg{text} to let \!\splitmaxdepth! have
3075 % its depth, and to let the last line of the footnote $\arg{text}$ have its
3076 % depth at shallowest.
3077 %
3078 % \item[\Uidx{\!\@cclv!}]
3079 % is a \!\box! register but \TeX{} defines that it has the main vertical
3080 % list when \!\output! routine is invoked. It is referred to by
3081 % \!\pcol@makecol! when it has a broken \mctext{} to measure its
3082 % height-plus-depth for the element to be added to $\pp^s(\ptop)$ and to
3083 % update it combining its contents with \prespan{} optionally shifting it
3084 % left by passing the register to \!\pcol@shiftspanning!. The macro also
3085 % uses the register together with its callee \!\pcol@unvbox@cclv! to add
3086 % stretch\slash shrink factor of \!\skip!\!\footins! at its bottom for a
3087 % \colpage{} in a page having \Scfnote{}s. The macro \!\pcol@specialoutput!
3088 % examines the register to discard the dummy \!\vbox! inserted in it by
3089 % \!\pcol@invokeoutput!. The other users \!\pcol@output@start!,
3090 % \!\pcol@makenormalcol!, \!\pcol@flushcolumn! and \!\pcol@imakeflushedpage!
3091 % let the register have the main vertical list of \preenv{} or a column to
3092 % be passed to \!\@makecol!, and \!\pcol@flushcolumn! also takes care the
3093 % skip above \Scfnote{}s.
3094 %
3095 % \item[\Uidx{\!\voidb@x!}]
3096 % is a \!\box! register to be void ($\bot$) always. It is used to
3097 % initialize \!\pcol@prespan! and \!\pcol@rightpage! at their declaration,
3098 % and is referred to by the following macros.
3099 % 
3100 % \begin{itemize}
3101 % \item
3102 % \!\pcol@makecol! to make \!\pcol@currfoot! void unless \Scfnote{}s in
3103 % \!\foot~ins! is saved into $\pp^f(p)$.
3104 %
3105 % \item
3106 % \!\pcol@startpage! to let
3107 % $\pp^i(\ptop)=\bot$ if the new \tpage{} does not have \spanning{} and
3108 % $\pp^f(\ptop)=\bot$ for all \fpage{}s and the new \tpage.
3109 %
3110 % \item
3111 % \!\pcol@outputelt! to initialize \!\@outputbox!.
3112 %
3113 % \item
3114 % \!\pcol@ioutputelt! to examine if $\S_c$ is empty.
3115 %
3116 % \item
3117 % \!\pcol@output@start! to let $\pp^f(0)=\bot$, and $\Celt^c=\bot$ if
3118 % $\Celtshadow^c$ is undefined.
3119 %
3120 % \item
3121 % \!\pcol@output@switch! to let $\cc_c(\ft^b)=\bot$ if the column does
3122 % not have \Mcfnote{}s.
3123 %
3124 % \item
3125 % \!\pcol@getcurrfoot! to let \!\footins! be void if so.
3126 %
3127 % \item
3128 % \!\pcol@setcurrcolnf! to let $\cc_c(\ft^b)=\bot$ because the column $c$
3129 % does not have \Mcfnote{}s.
3130 %
3131 % \item
3132 % \!\pcol@putbackmvl! to let $\!\pcol@prespan!=\bot$ if a \mctext{} really
3133 % starts from the top of a \colpage, and $\csts=\bot$ if the \colpage{}
3134 % $\cc_c(\vb)$ to be restarted is non-empty.
3135 %
3136 % \item
3137 % \!\pcol@savecolorstack! to let $\csts=\bot$ or its first item be $\bot$ if
3138 % $\CST^c$ or $\Celt^c$ is $\bot$, respectively.
3139 %
3140 % \item
3141 % \!\pcol@savefootins! to let its argument macro have a void box if
3142 % \!\@freelist! is exhausted.
3143 %
3144 % \item
3145 % \!\pcol@makeflushedpage! to initialize \!\@outputbox! and
3146 % \!\pcol@rightpage! to be $\bot$ if the flushed page does not have
3147 % \spanning{}, and to let $\pp^f(\ptop)=\bot$ after putting it in the
3148 % \lpage{} so that \!\pcol@output@end! will be unaware of the \scfnote{} and
3149 % non-\Mgfnote{}s.
3150 %
3151 % \item
3152 % \!\pcol@flushfloats! to let $\!\pcol@rightpage!=\bot$ if \parapag{}ing is
3153 % not in effect.
3154 %
3155 % \item
3156 % \!\pcol@output@end! to let $\!\pcol@rightpage!=\bot$ if
3157 % the last page has nothing other than \spanning{} being \pwise{} floats
3158 % and thus we don't have the right \parapag{}e. The macro also lets
3159 % $\Celt^c=\bot$ for all $c$ and $\cst=\bot$.
3160 %
3161 % \item
3162 % \!\pcol@com@flushpage! and \!\pcol@com@clearpage! gives the void box to
3163 % \!\pcol@flushclear! as its argument to mean these macros are only aware
3164 % of \CSIndex{ifpcol@flush} as the result of \pfcheck. The macro
3165 % \!\endparacol! also does that if the footnote typesetting is \mgfnote.
3166 % \end{itemize}
3167 %
3168 % \item[\Uidx{\!\@holdpg!}]
3169 % is a \!\box! register to have the main vertical list when \!\output! is
3170 % invoked with a special \!\penalty! code. It is let have that by
3171 % \!\pcol@specialoutput!, and is referred to by \!\pcol@output@start! and
3172 % \!\pcol@makenormalcol! for \preenv{}, and by \!\pcol@output@switch! for the
3173 % column from which we are leaving.
3174 %
3175 % \item[\Uidx{\!\@outputbox!}]
3176 % is a \!\box! register to have a partial or the complete ship-out image
3177 % of a column or a page. The usages of the register are as follows.
3178 % 
3179 % \begin{itemize}
3180 % \item
3181 % In \!\pcol@@makecol!, it has a \colpage{} made by \!\@makecol! for
3182 % \!\pcol@flush~column! and \!\pcol@imakeflushedpage!.
3183 %
3184 % \item
3185 % In \!\pcol@combinefloats!, it has a \colpage{} to which top and bottom
3186 % floats are combined.
3187 %
3188 % \item
3189 % In \!\pcol@cflt!, it has a \colpage{} to which top floats are combined.
3190 %
3191 % \item
3192 % In \!\pcol@opcol!, it has the complete \colpage{} built by \!\@makecol!.
3193 %
3194 % \item
3195 % In \!\pcol@startpage!, it has the complete \fpage{} built by \!\@tryfcolumn!.
3196 %
3197 % \item
3198 % In \!\pcol@outputelt!, it has the complete (left parallel-) page to be
3199 % shipped out by \!\@outputpage!.
3200 % \Index{parallel-paging}
3201 %
3202 % \item
3203 % In \!\pcol@outputpage@r!, it is temporarily made \!\let!-equal to
3204 % \!\pcol@rightpage! so that the box is shipped out by \!\pcol@@outputpage!
3205 % being \LaTeX's \!\@outputpage! instead of the real \!\@outputbox!.
3206 %
3207 % \item\begin{Sloppy}{1700}
3208 % In \!\pcol@output@start!, it has the \preenv{} built by
3209 % \!\pcol@makenormalcol!.
3210 % \end{Sloppy}
3211 %
3212 % \item
3213 % In \!\pcol@combinefootins!, it is let have the \preenv{} with footnotes.
3214 %
3215 % \item
3216 % In \!\pcol@flushcolumn!, it has a flushed \colpage{} built by \!\@makecol!
3217 % or a \fcolumn{} built by \!\@makefcolumn!.
3218 %
3219 % \item
3220 % In \!\pcol@output@flush! and \!\pcol@output@clear!, it has a flushed page
3221 % built by \!\pcol@makeflushedpage! and \!\pcol@imakeflushedpage! in which
3222 % it has each of flushed \colpage{} built by \!\@makecol!.
3223 %
3224 % \item
3225 % In \!\pcol@flushfloats!, it has the complete (left parallel) page for
3226 % flushed \fcolumn{}s.
3227 % 
3228 % \Index{parallel-paging}
3229 %
3230 % \item
3231 % In \!\pcol@iflushfloats!, it has a \fcolumn{} built by
3232 % \!\pcol@makefcolumn!.
3233 %
3234 % \item
3235 % In \!\pcol@output@end!, it has the ship-out image of the \lpage{} of a
3236 % \env{paracol} environment built by \!\pcol@makeflushedpage! and
3237 % \!\pcol@imakeflushedpage!.
3238 % \end{itemize}
3239 %
3240 % \item[\Uidx{\!\@tempboxa!}]
3241 % is a \!\box! register for temporary use. The usages of the register are
3242 % as follows.
3243 % 
3244 % \begin{itemize}
3245 % \item
3246 % In \!\pcol@makecol!, it is used to decapsulate \!\box!|255| containing a
3247 % broken \mctext{}. In the macro and \!\pcol@output@switch!, it is also
3248 % used as a waste basket to make \!\footins! void when it contains
3249 % \Scfnote{}s in a non-\tpage.
3250 %
3251 % \item\begin{Sloppy}{2100}
3252 % In \!\pcol@cflt! and \!\pcol@startpage!, it has top column-\slash
3253 % \pwise{} floats combined by the application of
3254 % \!\@comflelt!\slash\!\@comdblflelt! to \!\@toplist!\slash\!\@dbltoplist!
3255 % respectively.
3256 % \end{Sloppy}
3257 %
3258 % \item
3259 % In \!\pcol@phantom!$\<b\>$, it has an empty box whose height and depth are
3260 % equal to those of the argument box $b$.
3261 %
3262 % \item
3263 % By \!\pcol@buildcolseprule! and its callees \!\pcol@buildcselt@S! and
3264 % \!\pcol@buildcselt!, it is let have the painted \bground{}s for columns,
3265 % \csepgap{}s and \mctext{}s in a page, and then is put into the ship-out
3266 % image of the page by \!\pcol@ioutputelt!, \!\pcol@imakeflushedpage! or
3267 % \!\pcol@iflushfloats!.
3268 %
3269 % \item
3270 % In \!\@outputpage!, it is let have the painted \bground{} of the right
3271 % page referred to by its callee \!\pcol@outputpage@r!.
3272 %
3273 % \item
3274 % In $\!\pcol@bg@paint@i!\Arg{body}$, it is let have painted \bground{}s
3275 % built by $\arg{body}$.
3276 %
3277 % \item
3278 % In $\!\pcol@bg@paintregion!\arg{a}\arg{c}$, it is let have painted
3279 % \bground{} of the region $\bgr_a^{[c]}$.
3280 %
3281 % \item
3282 % In \!\pcol@specialoutput!, it is used to discard the dummy \!\vbox! put by
3283 % \!\pcol@invokeoutput!.
3284 %
3285 % \item
3286 % In \!\pcol@makenormalcol!, it is used to save \!\footins! into it and make
3287 % it $\bot$ temporarily to exclude \mgfnote{} footnotes from \spanning{} for
3288 % \preenv.
3289 %
3290 % \item
3291 % In \!\pcol@ifempty!$\arg{box}\arg{then}\arg{else}$, it is used to examine
3292 % if $\arg{box}$ is empty.
3293 %
3294 % \item
3295 % In $\!\pcol@scancst!\arg{box}$ and \!\pcol@iscancst!, it is used to have
3296 % what $\cst$ or $\csts$ has after the scan of $\arg{box}\in\{\cst,\csts\}$.
3297 %
3298 % \item
3299 % In \!\pcol@savecolorstack!, it is used to have the \!\vbox! for $\Celt^c$
3300 % to be placed at the top of $\csts$.
3301 %
3302 % \item
3303 % In \!\pcol@deferredfootins!, it is used to have the first half split from
3304 % $\df$ being the deferred footnotes to be \!\insert!ed.
3305 %
3306 % \item
3307 % In \!\pcol@fntextbody!\marg{text}, it is used to encapsulate $\arg{text}$
3308 % in it.
3309 %
3310 % \item
3311 % In \!\pcol@icolumncolor!, it is used to have a \!\vbox! to be \!\insert!ed
3312 % for the update of $\Celt^c$.
3313 %
3314 % \item
3315 % In \!\pcol@set@color@push!, it is used to have a \!\vbox! to be \!\insert!ed
3316 % to push $\celt_i$ or $\mcelt_{i,m}$ to $\cstraw$.
3317 %
3318 % \item
3319 % In \!\pcol@reset@color@pop! and \!\pcol@reset@color@mpop!, it is used to
3320 % have a \!\vbox! to be \!\insert!ed to add $\celtpop_i$ or
3321 % $\mceltpop_{i,m}$ to $\cstraw$.
3322 % \end{itemize}
3323 % \end{description}
3324 %
3325 %
3326 %
3327 % \subsubsection{Token Registers}
3328 %
3329 % \begin{description}
3330 % \item[\Uidx{\!\output!}]
3331 % is \TeX's primitive to have \!\output! routine. It is let have
3332 % \!\pcol@output! as its sole token by \!\pcol@zparacol!.
3333 %
3334 % \item[\Uidx{\!\everypar!}]
3335 % is \TeX's primitive to have tokens inserted at the beginning of each
3336 % paragraph. In \!\pcol@sptext! and \!\pcol@com@endcolumn!, it is
3337 % \!\global!ized to keep its contents after the end of a group. In
3338 % \!\pcol@output@switch!, its contents are broadcasted to $\cc_c(\ep)$ for
3339 % all $c\In0\C$ if columns are \sync{}ed with a \mctext. Then these values
3340 % or that simply given in a column are saved into $\cc_c(\ep)$ by
3341 % \!\pcol@setcurrcol!, and then restored from it by \!\pcol@iigetcurrcol!.
3342 %
3343 % \item[\Uidx{\!\everyvbox!}]
3344 % is \TeX's primitive to have tokens inserted at the beginning of each
3345 % \!\vbox!. In \!\pcol@zparacol!, after tokens in it are saved into
3346 % \!\pcol@everyvbox!, it is let have a \!\the!-reference to
3347 % \!\pcol@everyvbox! and |\pcol@innertrue| to turn
3348 % $\CSIndex{ifpcol@inner}=\true$, and then the register itself is made
3349 % \!\let!-equal to \!\pcol@everyvbox!. In addition, it is let have tokens
3350 % in \!\pcol@everyvbox! if a \!\global! assignment to the register is made
3351 % in the \env{paracol} just having been closed. Another usage of this
3352 % register is to insert a painted page \bground{} to the \!\vbox! to be
3353 % \!\shipout! by \!\pcol@@outputpage! being \LaTeX's \!\@outputpage!, and is
3354 % used for this purpose by \!\pcol@outputpage@l! and \!\pcol@outputpage@r!,
3355 % and by \!\pcol@outputpage@ev! to nullify this special function for other
3356 % inside \!\vbox!es.
3357 %
3358 % \item[\Uidx{\!\@temptokena!}]
3359 % is a \!\toks! register for temporary use. It is used in
3360 % \!\pcol@output@switch! to broadcast \!\everypar! to $\cc_c(\ep)$ for all
3361 % $c\In0\C$.
3362 %
3363 % \end{description}
3364 %
3365 %
3366 %
3367 % \subsubsection{Switches}
3368 %
3369 % \begin{description}
3370 % \item[\Uidx{\CSIndex{if@twocolumn}}]
3371 % is a switch to be $\true$ iff multi-column pages are being typeset. It is
3372 % turned $\true$ by \!\pcol@zparacol!, and then turned $\false$ by
3373 % \!\endparacol!. In addition, it is turned $\false$ when \!\pcol@output!
3374 % finds that the \!\output! request for a page break outside \env{paracol}
3375 % is sneaked into our own \!\output! routine, in order to avoid that
3376 % \LaTeX's original \!\output! routine misunderstands it is working on a
3377 % two-columned document. The switch is examined by \LaTeX's own macros
3378 % including old \!\end@dblfloat! kept in our own \!\pcol@end@dblfloat!. It
3379 % is also examined by \!\pcol@zparacol! before being turned $\true$ to
3380 % ensure it is $\false$ or to complain about the inappropriateness otherwise.
3381 %
3382 % \item[\Uidx{\CSIndex{if@firstcolumn}}]
3383 % is a switch to be $\true$ iff the first column is being typeset. Its
3384 % truth value is determined by \!\pcol@addmarginpar! to tell
3385 % \!\pcol@@addmarginpar!, \!\pcol@getmparbottom@i! and \!\pcol@setmpbelt@i!
3386 % the margin which a marginal note goes to.
3387 %
3388 % \item[\Uidx{\CSIndex{if@twoside}}]
3389 % is a switch to be $\true$ iff two-sided page typesetting is in effect and
3390 % thus even numbered page may have their own left margins, headers and
3391 % footers different from those for odd numbered pages. Besides the
3392 % initialization by the main class file such as \textsf{article.cls}
3393 % according to the class option |twoside|, the switch is \!\global!ly turned
3394 % $\false$ by \!\pcol@twosided! for the case in which API macro \!\twosided!
3395 % does not have `|p|' in its optional argument, and then \!\global!ly turned
3396 % $\true$ by \!\pcol@twosided@p! which is invoked when the argument contains
3397 % `|p|', or the API macro does not have the argument at all. Then the
3398 % switch is referred to by \!\pcol@outputpage@l!, \!\pcol@outputpage@r! and
3399 % \!\pcol@bg@swappage! to decide the left margin of even numbered pages,
3400 % i.e., \!\evensidemargin! if the switch is $\true$ or \!\oddsidemargin!
3401 % otherwise. The switch is also referred to by \!\pcol@com@cleardoublepage!
3402 % to have a blank page if the switch is $\true$ and the command
3403 % \!\cleardoublepage! is used in an odd-numbered page.
3404 %
3405 % \item[\Uidx{\CSIndex{if@reversemargin}}]
3406 % is a switch to be $\true$ iff \!\reversemarginpar! is specified to reverse
3407 % the side which marginal notes go to. It is examined by
3408 % \!\pcol@addmarginpar! as a factor to decide the margin which a marginal
3409 % note goes to, and by \!\pcol@do@mpbout@i! for the same purpose but for
3410 % marginal notes in pre-environment or \postenv.
3411 % 
3412 % \Index{pre-environment stuff}
3413 %
3414 % \item[\Uidx{\CSIndex{if@mparswitch}}]
3415 % is a switch to be $\true$ iff it is specified by, for example,
3416 % \texttt{twoside} option of a class such as \textsf{article}, that marginal
3417 % notes in even numbered pages go to the left margin. It is examined by
3418 % \!\pcol@do@mpbout@i! as a factor to decide the margin which a marginal note
3419 % goes to in pre-environment or \postenv{}.
3420 % 
3421 % \Index{pre-environment stuff}
3422 %
3423 % \item[\Uidx{\CSIndex{if@nobreak}}]
3424 % is a switch to be $\true$ iff the last paragraph is for a sectioning
3425 % command. The switch is saved into $\cc_c(\sw)$ together with
3426 % \CSIndex{if@afterindent} by \!\pcol@setcurrcol!, and then restored from
3427 % it by \!\pcol@iigetcurrcol!. The macro \!\pcol@output@switch! refers to
3428 % it to broadcast its value set by a \mctext{} to $\cc_c(\sw)$ for all
3429 % $c\In0\C$, while \!\pcol@output@start! and \!\pcol@restartcolumn! insert
3430 % $\!\penalty!=10000$ by \!\nobreak! if the switch is $\true$. This
3431 % conditional \!\nobreak! is also done by \!\pcol@icolumncolor!,
3432 % \!\pcol@set@color@push!, \!\pcol@reset@color@pop! and
3433 % \!\pcol@reset@color@mpop! to avoid a break after an \!\insert!. The macro
3434 % \!\pcol@zparacol! also examines the switch, but with the truth value in it
3435 % given outside \env{paracol} environment, to invoke \!\@nbitem! if $\true$
3436 % when the macro finds the \env{paracol} environment to start is at the very
3437 % beginning of a \env{list}-like environment.
3438 %
3439 % \item[\Uidx{\CSIndex{if@newlist}}]
3440 % is a switch to be $\true$ in the duration after a \env{list}-like
3441 % environment starts and until its first \!\item! appears. The switch is
3442 % examined by \!\pcol@zparacol! to know if the \env{paracol} environment to
3443 % start is at the very beginning of a \env{list}-like environment and, if
3444 % so, is turned $\false$ by the macro after it inserts vertical skips
3445 % pretending the first \!\item! is given.
3446 %
3447 % \item[\Uidx{\CSIndex{if@inlabel}}]
3448 % is a switch to be $\true$ in the duration after an \!\item! appears and
3449 % until its first paragraph is given. The switch is examined by
3450 % \!\pcol@zparacol! together with \CSIndex{if@newlist} to know if the
3451 % \env{paracol} environment to start is at the very beginning of a
3452 % \env{list}-like environment ($\false$) and not \env{trivlist}-like one
3453 % ($\true$).
3454 %
3455 % \item[\Uidx{\CSIndex{if@afterindent}}]
3456 % is a switch to be $\true$ iff a sectioning command tells that the first
3457 % paragraph following it is to be indented. The switch is saved into
3458 % $\cc_c(\sw)$ together with \CSIndex{if@nobreak} by \!\pcol@setcurrcol!,
3459 % and then restored from it by \!\pcol@iigetcurrcol!. The macro
3460 % \!\pcol@output@switch! refers to it to broadcast its value set by a
3461 % \mctext{} to $\cc_c(\sw)$ for all $c\In0\C$.
3462 %
3463 % \item[\Uidx{\CSIndex{if@fcolmade}}]
3464 % is a switch to be $\true$ iff a \fcolumn{} or \fpage{} is built by
3465 % \!\@tryfcolumn! or \!\@makefcolumn!. The value is set by \!\@tryfcolumn!
3466 % for $\cc_c(\dl)$ is referred to by \!\pcol@output!, \!\pcol@startcolumn!
3467 % and \!\pcol@freshpage!, while that for \!\@dbldeferlist! is referred to by
3468 % \!\pcol@startpage!. The value set by \!\@makefcolumn! for $\cc_c(\dl)$ is
3469 % referred to by \!\pcol@flushcolumn!, while that for \!\@dbldeferlist! is
3470 % referred to by \!\pcol@output@clear!. The macros \!\pcol@flushfloats! and
3471 % \!\pcol@iflushfloats! also refer to the switch to build pages having only
3472 % \fcolumn{}s and turn the switch $\true$ or $\false$ by themselves to know
3473 % such pages are still to be built or not. The macro \!\pcol@output@end!
3474 % also turns the switch $\true$ if a \lpage{} will be followed by page(s)
3475 % having \fcolumn{}s to tell that to \!\pcol@flushfloats!.
3476 %
3477 % \item[\Uidx{\CSIndex{if@tempswa}}]
3478 % is a switch for temporary use. The usages of the switch are as follows.
3479 % 
3480 % \begin{itemize}
3481 % \item
3482 % In \!\pcol@checkshipped!, it is turned $\true$ iff $\S_c$ for all
3483 % $c\In0\C$ have \colpage{}s to be shipped out, and then it is examined by
3484 % \!\pcol@opcol!.
3485 %
3486 % \item
3487 % In \!\pcol@nextpage! and \!\pcol@nextpelt!, it is $\true$ until
3488 % \!\pcol@nextpelt! finds the first $q$ such that $q>p$ and
3489 % $\pp^h(q)\geq0$ to mean $q$ is not for a \fpage{}, so that we let $p=q$
3490 % to skip \fpage{}s following to the old $p$ if any.
3491 %
3492 % \item
3493 % In \!\pcol@outputcolumns! and \!\pcol@outputelt!, it is $\true$ until
3494 % \!\pcol@outputelt! finds the first $q$ such that $q\geq\pbase$ and
3495 % $\pp^h(q)\geq0$ to mean $q$ is not for a \fpage{}, and the argument of
3496 % \!\pcol@outputcolumns! is 0 to mean that it is not for page flushing, so that
3497 % we ship out $q$ and all \fpage{}s following it if any.
3498 %
3499 % \item
3500 % In \!\@outputpage! it is let have the value of \CSIndex{ifpcol@bg@painted}
3501 % indicating if \bgpaint{} for the left page is done, and then it is
3502 % examined by \!\pcol@outputpage@l! to determine whether the \bground{} is
3503 % put into the final ship-out image.
3504 %
3505 % \item
3506 % In \!\pcol@makenormalcol!, it is $\true$ iff the footnotes in \preenv{} is
3507 % included in \!\@outputbox! which the macro builds.
3508 %
3509 % \item
3510 % In \!\pcol@output@switch!, at first it holds \CSIndex{if@nobreak} of the
3511 % \mctext{} if columns are \sync{}ed with it to broadcast
3512 % \CSIndex{if@nobreak} to all $\cc_c(\sw)$. Then it is turned $\true$ iff
3513 % $\CSIndex{ifpcol@sync}=\true$ for \sync{}ation or
3514 % $\CSIndex{ifpcol@clear}={\true}$ for flushing, so as to invoke
3515 % \!\pcol@sync!. And finally, it is turned $\true$ iff
3516 % $\CSIndex{ifpcol@clear}={\false}$ or $\CSIndex{ifpcol@sync}=\true$, so as
3517 % to invoke \!\pcol@restartcolumn!.
3518 %
3519 % \item
3520 % In \!\pcol@restartcolumn!, it is turned $\true$ iff footnote typesetting
3521 % is \scfnote{} and $p<\ptop$.
3522 %
3523 % \item
3524 % In \!\pcol@scancst!, it is initialized to be $\true$. Then it is referred
3525 % to by \!\pcol@iscancst! for each $\celt\in\cstraw$ to update $\Celt^c$ and
3526 % then turned $\false$ when the first one is found.
3527 %
3528 % \item
3529 % In \!\pcol@savecolorstack!, it is $\true$ iff either $\cst\neq\bot$ or
3530 % $\Celt^c\neq\bot$, i.e., $\CST^c$ to be saved is not $\bot$.
3531 %
3532 % \item
3533 % In \!\pcol@getmparbottom!, it is initialized to be $\false$ and then may be
3534 % turned $\true$ by \!\pcol@getmpbelt! if it finds a gap between two marginal
3535 % notes to accommodate that to be added, and then examined by
3536 % \!\pcol@getmparbottom! to know the fact.
3537 %
3538 % \item
3539 % In \!\pcol@sync!, it is turned $\true$ iff the \sync{}ed or flushed page
3540 % can be built by \!\pcol@synccolumn!.
3541 %
3542 % \item
3543 % In \!\pcol@makefcolumn! having non-empty $\cc_c(\tl)$, it is turned
3544 % $\false$ iff the macro is acting on a column in the \lpage{}, $\cc_c(\dl)$
3545 % is emptied by the macro itself, and the total size of the floats to be put
3546 % in the \fcolumn{} being built by the macro is less than \!\@fpmin!, to
3547 % mean it is possible that the floats in $\cc_c(\tl)$ is put in the
3548 % \fcolumn{} as top floats.
3549 %
3550 % \item
3551 % In \!\pcol@measurecolumn! and \!\pcol@addflhd!, it is set to be $\false$
3552 % iff both top floats and the main vertical list are empty, so that
3553 % \!\pcol@measureupdate! examines it for the update of $\VT$ and $\DT$.
3554 % Then it is kept $\false$ iff both of footnotes and bottom floats are
3555 % empty, so that \!\pcol@measurecolumn! examines it for the update of $\VP$
3556 % and \!\pcol@measureupdate! does for $\VPP$ and $\DP$.
3557 %
3558 % \item
3559 % In \!\pcol@makeflushedpage!, it is made $\false$ iff $\ptop$ is the
3560 % \lpage{}, $\VPP=-\infty$ to mean all columns are empty and
3561 % $\pp^f(\ptop)=\bot$, so as to make the \spanning{} in $\pp^i(\ptop)$ a
3562 % float in \postenv{} if \CSIndex{ifpcol@dfloats} also $\false$. Then it is
3563 % kept $\false$ if $\CSIndex{ifpcol@dfloats}=\false$ or $\pp^i(\ptop)=\bot$
3564 % to mean nothing is shipped out for \lpage{}. Then it is made $\false$ iff
3565 % $\ptop$ is the \lpage{} without deferred floats and \Mgfnote{}
3566 % typesetting is in effect, i.e., the switch is $\true$ iff \Scfnote{}s are
3567 % put in the page to be flushed.
3568 %
3569 % \item
3570 % In \!\pcol@imakeflushedpage!, it is turned $\true$ iff $\cc_c(\tr)=\infty$
3571 % and $\VPP=\pp^h(\ptop)$ to mean the floats in $\cc_c(\tl)$ should be put in
3572 % a \fcolumn{} in the \lpage{} as usual.
3573 %
3574 % \item
3575 % In \!\pcol@iflushfloats!, it is turned $\true$ iff one or more columns have
3576 % non-empty $\cc_c(\dl)$ after shipping a page for \fcolumn{}s out, so that
3577 % \CSIndex{if@fcolmade} is let have its value after scanning all columns.
3578 %
3579 % \item
3580 % In \!\pcol@output@end!, it is turned $\true$ iff we built \fcolumn{}s, or
3581 % the main vertical list in the \lpage{} is empty and the page is not the
3582 % \spage, so that we create a new page for the \postenv.
3583 %
3584 % \item
3585 % In \!\globalcounter!\marg{ctr}, it is turned $\true$ iff $\arg{ctr}\in\CG$
3586 % already.
3587 %
3588 % \item
3589 % In $\!\pcol@cmpctrelt!\arg{\theta}$, it is turned $\true$ iff $\theta$ is
3590 % not in $\Cc_0$ or $\Val(\theta)\neq\val_0(\theta)$, so that $\theta$ is
3591 % added to \!\@gtempa! being the list of \lcounter{}s to be synchronized.
3592 %
3593 % \item
3594 % In \!\pcol@switchcolumn!$|[|d|]|$, it is turned $\false$ iff $0\leq d<\C$
3595 % so that we complain $c$ is invalid if the switch is $\true$.
3596 %
3597 % \item
3598 % In $\!\pcol@ac@caption@def!\arg{s}\arg{t}$, \CSIndex{@tempswatrue} or
3599 % \CSIndex{@tempswafalse} is given as its first argument $s$ by
3600 % $\!\pcol@ac@caption@enable!$ or $\!\pcol@ac@caption@disable!$ respectively,
3601 % so that $|\if@ac@caption@if@|{\cdot}t$ is made \!\let!-equal to $s$ and
3602 % \!\pcol@ac@caption! examines it for enabling\slash disabling
3603 % \!\addcontentsline! respectively. The macros \!\pcol@ac@caption@if@lof!
3604 % and \!\pcol@ac@caption@if@lot! are initialized to be \!\let!-equal to
3605 % \!\@tempswatrue! as the default.
3606 %
3607 % \item
3608 % In \!\pcol@icolumncolor!, it is turned $\true$ iff we are in a \!\vbox! or
3609 % in restricted horizontal or math mode.
3610 %
3611 % \item
3612 % In \!\pcol@backgroundcolor@i!, it is examined if the root of the
3613 % invocation chain is \!\backgroundcolor! which turns the switch $\true$, or
3614 % \!\nobackgroundcolor! which turns it $\false$, to determine whether the
3615 % \bground{} of a region is painted or not.
3616 % \end{itemize}
3617 % \end{description}
3618 %
3619 %
3620 %
3621 % \subsection{Macros}
3622 % \label{sec:imp-tex-macro}
3623 %
3624 % \subsubsection{Procedural Macros}
3625 %
3626 % \begin{description}
3627 % \item[\Uidx{\CSIndex{par}}]
3628 % is \TeX's primitive to end\slash start paragraphs, but may be modified by
3629 % \LaTeX{} to have some special functionality occasionally. The macro
3630 % \!\pcol@output! makes it \!\let!-equal to \hbox{\!\@@par!} in which the
3631 % \TeX's original definition is kept, while \!\pcol@zparacol! and
3632 % \!\pcol@par! use it as is.
3633 %
3634 % \item[\Uidx{\!\space!}]
3635 % is an API macro to have a space token. It is used in \!\pcol@output!,
3636 % \!\pcol@icolumncolor!, \!\pcol@defcseprulecolor@i! and
3637 % \!\pcol@backgroundcolor@ii! for warning messages, and in
3638 % \!\pcol@def@extract@fil! to \!\def!ine the macro \!\pcol@extract@fil!
3639 % having spaces in its argument specification.
3640 %
3641 % \item[\Uidx{\!\nointerlineskip!}]
3642 % is an API macro to let $\!\prevdepth!=-1000$\,pt to inhibit \TeX's
3643 % baseline progress mechanism. It is used in \!\pcol@ioutputelt!,
3644 % \!\pcol@makeflushedpage! and \!\pcol@imakeflushedpage! to joint boxes
3645 % without \!\baselineskip! between them, in \!\pcol@outputpage@ev! to
3646 % suppress the \!\baselineskip! insertion after the first box of painted
3647 % \bground{} in the final ship-out image, and in \!\pcol@bg@paint@i!
3648 % for the same purpose for the box having painted \bground{}s.
3649 %
3650 % \item[\Uidx{\!\offinterlineskip!}]
3651 % is an API macro to let $\!\baselineskip!=-1000$\,pt, $\!\lineskip!=0$ and
3652 % $\!\lineskiplimit!=\!\maxdimen!$ to suppress \!\baselineskip! insertion for
3653 % all boxes following this macro. It is used in \!\pcol@bg@paint@i! to do
3654 % that in the box in which painted \bground{}s are built.
3655 %
3656 % \item[\Uidx{\!\thepage!}]
3657 % is an API macro to have the representation of the counter \counter{page}.
3658 % It is used in \!\pcol@output! for a warning message.
3659 %
3660 % \item[\Uidx{$\cs{the}{\cdot}\theta$}]
3661 % \SpecialArrayIndex{\theta}{\the}
3662 % 
3663 % is an API macro to have the representation of the counter $\theta$. The
3664 % macro is kept in $|\pcol@thectr@|{\cdot}\theta$
3665 % 
3666 % \SpecialArrayIndex{\theta}{\pcol@thectr@}
3667 % 
3668 % by \!\pcol@thectrelt! which also makes the macro \!\let!-equal to
3669 % $|\pcol@thectr@|{\cdot}\theta{\cdot}0$
3670 % 
3671 % \SpecialArrayIndex{\theta{\cdot}c}{\pcol@thectr@}
3672 % 
3673 % if the \lrep{} of $\theta$ in the column 0 is defined by
3674 % \!\definethecounter!. The macro \!\pcol@setctrelt! also makes this
3675 % overriding for the column $c$ to which the macro belongs if
3676 % $|\pcol@thectr@|{\cdot}\theta{\cdot}c$
3677 % 
3678 % \SpecialArrayIndex{\theta{\cdot}c}{\pcol@thectr@}
3679 % 
3680 % being the \lrep{} for $c$ is defined, while it makes $|\the|{\cdot}\theta$
3681 % 
3682 % \SpecialArrayIndex{\theta}{\the}
3683 % 
3684 % \!\let!-equal to $|\pcol@thectr@|{\cdot}\theta$
3685 % 
3686 % \SpecialArrayIndex{\theta}{\pcol@thectr@}
3687 % 
3688 % otherwise to give it its original definition.
3689 %
3690 % \item[\Uidx{$\!\stepcounter!\<\theta\>$}]
3691 % is an API macro to increment the counter $\theta$ and zero-clear its
3692 % descendant counters. It is used in \!\pcol@startpage! for the counter
3693 % \counter{page}, and in \!\pcol@iifootnotetext! for \counter{footnote}.
3694 %
3695 % \item[\Uidx{\!\nobreak!}]
3696 % is an API macro to insert $\!\penalty!=10000$ to inhibit line or page
3697 % breaks. It is used in \!\pcol@output@start!, \!\pcol@restartcolumn!,
3698 % \!\pcol@icolumncolor!, \!\pcol@set@color@push!, \!\pcol@reset@color@pop!
3699 % and \!\pcol@reset@color@mpop! to meet the page-break inhibition request
3700 % made by $\CSIndex{if@nobreak}=\true$. In \!\pcol@set@color@push! it is
3701 % additionally used to add a non-breakable zero-width space after the
3702 % color special.
3703 %
3704 % \item[\Uidx{$\!\addvspace!$\marg{skip}}]
3705 % is an API macro to insert a vertical $\arg{skip}$ if
3706 % $\!\lastskip!<\arg{skip}$, or a skip of $\arg{skip}+\!\lastskip!$
3707 % otherwise. The macro is used in \!\pcol@zparacol! when it finds the
3708 % \env{paracol} environment to start is at the very beginning of a
3709 % \env{list}-like environment, to insert \!\@topsep! instead of
3710 % $\!\parskip!+\!\itemsep!$ going to be inserted by the first \!\item!.
3711 %
3712 % \item[\Uidx{$\!\addpenalty!\arg{pen}$}]
3713 % is an API macro to insert a page break $\!\penalty!=\arg{pen}$ if
3714 % $\CSIndex{if@nobreak}={\false}$. The \!\penalty! is inserted removing the
3715 % last vertical skip which is reinserted after the \!\penalty!. The macro
3716 % is used in \!\pcol@output@start! and \!\pcol@restartcolumn! to insert
3717 % \!\interlinepenalty! if $\CSIndex{if@nobreak}=\false$, while
3718 % \!\pcol@zparacol! uses it to insert \!\@beginparpenalty! when it finds the
3719 % \env{paracol} environment to start is at the very beginning of a
3720 % \env{list}-like environment.
3721 %
3722 % \item[\Uidx{\!\footnotesize!}]
3723 % is an API macro to set the font size for footnotes. It is used in
3724 % \!\pcol@fntextbody! for footnote typesetting.
3725 %
3726 % \item[\Uidx{\!\rule!\oarg{\mbox{$r$}}$\Arg{w}\Arg{h}$}]
3727 % is an API macro to draw a vertical rule of $w$ width and $h$ tall,
3728 % optionally raised by $r$. It is used in \!\pcol@fntextbody! to have the
3729 % rule of $w=r=0$ and $h=\!\footnotesep!$ to make the first line of the
3730 % footnote is at least as tall as \!\footnotesep!.
3731 %
3732 % \item[\Uidx{$\!\addcontentsline!\arg{file}\arg{sec}\arg{entry}$}]
3733 % is an API macro to put \!\addtocontents! for the arguments to |.aux| file.
3734 % The original definition of the macro is kept in
3735 % \!\pcol@addcontentsline! so that \!\pcol@ac@disable@toc! and
3736 % \!\pcol@ac@caption! make the macro regain its original definition after
3737 % temporarily disabling its function by making it \!\let!-equal to
3738 % \!\pcol@gobblethree!.
3739 %
3740 % \item[\Uidx{\!\marginpar!}\oarg{left}\marg{right}]
3741 % is an API macro to put marginal note $\arg{left}$ or $\arg{right}$ to the
3742 % left or right margin. In \!\pcol@zparacol! it is made \!\let!-equal to
3743 % \!\pcol@marginpar! for the emulation of \!\marginnote!, while its original
3744 % version is kept in \!\pcol@@marginpar!.
3745 %
3746 % \item[\Uidx{\!\footnote!}\oarg{num}\marg{text}]
3747 % is an API macro to give a footnote $\arg{text}$ optionally with its number
3748 % $\arg{num}$. In \!\pcol@zparacol! it is made \!\let!-equal to
3749 % \!\pcol@footnote! to implement its starred version and the adjustment of
3750 % \counter{footnote} at \Endparacol, while its original version is kept in
3751 % \!\pcol@@footnote!.
3752 %
3753 % \item[\Uidx{\!\footnotemark!}\oarg{num}]
3754 % is an API macro to give a footnote mark optionally with the number
3755 % $\arg{num}$ which the mark represents. In \!\pcol@zparacol! it is made
3756 % \!\let!-equal to \!\pcol@footnotemark! to implement its starred version
3757 % and the adjustment of \counter{footnote} at \Endparacol, while its
3758 % original version is kept in \!\pcol@@footnotemark!.
3759 %
3760 % \item[\Uidx{\!\footnotetext!}\oarg{num}\marg{text}]
3761 % is an API macro to give a footnote $\arg{text}$ optionally with its number
3762 % $\arg{num}$ but without putting the mark in the footnoted text. In
3763 % \!\pcol@zparacol! it is made \!\let!-equal to \!\pcol@footnotetext! to
3764 % implement its starred version, while its original version is kept in
3765 % \!\pcol@@footnotetext!.
3766 %
3767 % \item[\Uidx{\!\footnoterule!}]
3768 % is an API macro to draw a horizontal line above footnotes, or to insert
3769 % whatever it has above them. With \Scfnote{} typesetting, it is redefined
3770 % in \!\pcol@zparacol! so that it refers to \!\textwidth! instead of
3771 % \!\columnwidth! for drawing the horizontal line or whatever defined, while
3772 % the original version is kept in \!\pcol@footnoterule!. Then it is used in
3773 % \!\pcol@putfootins! to separate footnotes from the stuff above them, with
3774 % the original or modified definition.
3775 %
3776 % \item[\Uidx{\!\newpage!}]
3777 % is an API macro to break a page. It is used in \!\pcol@switchcol! as the
3778 % argument of \!\pcol@visitallcols! to break the \colpage{}s visited in the
3779 % \cscan{} when the \sync{}ed \cswitch{} requires explicit page breaks.
3780 %
3781 % \item[\Uidx{\!\dblfigrule!}]
3782 % is an API macro to draw a horizontal line between the last \pwise{}
3783 % floats and the main vertical list, or to insert whatever it has between
3784 % them. The macro is used in \!\pcol@startpage! to build \spanning{} in
3785 % the page $p$ in $\pp^b(p)$.
3786 %
3787 % \item[\Uidx{\!\topfigrule!}]
3788 % is an API macro to draw a horizontal line between the last \cwise{}
3789 % top float and the main vertical list, or to insert whatever it has between
3790 % them. The macro is used in \!\pcol@cflt! and \!\pcol@synccolumn! to
3791 % insert it below the last (real) top float. It is also made \!\let!-equal
3792 % to \!\relax! temporarily by \!\pcol@imakeflushedpage! when it put floats in
3793 % a \fcolumn{} as top floats. Note that the macro and its bottom
3794 % counterpart \!\botfigrule! should produce a vertical list whose total
3795 % height and depth is 0, because \LaTeX's float mechanism and thus our
3796 % macros believe so.
3797 %
3798 % \item[\Uidx{\!\normalcolor!}]
3799 % is an API macro to have color specification stuff for normal coloring.
3800 % The macro is used in \!\pcol@putfootins! to specify the color of footnotes
3801 % to be put in \!\@outputbox!, in \!\normalcolumncolor!\oarg{c} to
3802 % define that the default color of the column $c$ is the normal color,
3803 % in \!\normalcolseprulecolor! to specify that the color for \cseprule{}s is
3804 % \!\normalcolor!, and in the initial definition of \!\pcol@colseprulecolor!
3805 % to give the default color for \cseprule{}s.
3806 %
3807 % \item[\Uidx{\!\color!}\oarg{mode}\marg{color}]
3808 % is an API macro defined in coloring packages to start text coloring with
3809 % $\arg{color}$ optionally with $\arg{mode}$. The macro is used in
3810 % \!\pcol@xcolumncolor!\oarg{mode}\~\marg{color}\oarg{c} and
3811 % \!\pcol@ycolumncolor!\marg{color}\oarg{c} to define the default color of
3812 % the column $c$ is $\arg{color}$ optionally with $\arg{mode}$, in
3813 % \!\pcol@defcseprulecolor@x! and \!\pcol@defcseprulecolor@y! to define the
3814 % color of \cseprule{}s, and in \!\pcol@backgroundcolor@x! to define the
3815 % color for \bgpaint{} of a region.
3816 %
3817 % \item[\Uidx{\!\pfmtname!}]
3818 % is an API macro defined in p\LaTeX{} to have its format name |pLaTeX2e|
3819 % (so far). It is used in the top level assignment of the constant switch
3820 % \CSIndex{ifpcol@bfbottom}.
3821 %
3822 % \item[\Uidx{$\!\PackageError!\arg{pkg}\arg{msg}\arg{hlp}$}]
3823 % is a developer's API macro to stop the execution showing the error
3824 % message $\arg{msg}$ with the package identification $\arg{pkg}$ and the
3825 % help message $\arg{hlp}$. The macro is used in the following macros;
3826 % \!\pcol@ovf! on \!\@freelist! shortage; \!\pcol@set@color@push! on too
3827 % many math-mode colorings; in \!\pcol@zparacol! on two-column
3828 % typesetting outside \env{paracol} and illegal nesting of \env{paracol};
3829 % $\!\pcol@setcw@calcf!\<x\>\<y\>\<z\>$ on too large $x/y$;
3830 % \!\pcol@switchcolumn! on invalid target column; \!\pcol@switchenv! on
3831 % illegal \cswitch{} commands\slash environments in a \csenv;
3832 % \!\addcontentsonly! on unknown contents type; \!\footnoteplacement! on
3833 % unknown layout; \!\pcol@twosided! on unknown two-sided typesetting
3834 % feature; \!\pcol@backgroundcolor! on unknown region of \bgpaint; and in
3835 % \!\pcol@backgroundcolor@i! on a region not being a column or \csepgap{}
3836 % but its ordinal being specified.
3837 %
3838 % \item[\Uidx{$\!\PackageWarning!\arg{pkg}\arg{msg}$}]
3839 % is a developer's API macro to report a warning message $\arg{msg}$ with
3840 % the package identification $\arg{pkg}$. The macro is used in
3841 % \!\pcol@ignore! to complain an API macro appears in \env{paracol}
3842 % inappropriately, in \!\pcol@fntextbody! if the footnote is taller than
3843 % $\!\textheight!-\!\skip!\!\footins!$, in \!\pcol@mn@warning! to show
3844 % \!\marginnote! is emulated, and in \!\pcol@icolumncolor!,
3845 % \!\pcol@defcseprulecolor@i! and \!\pcol@backgroundcolor@ii! to complain
3846 % \!\columncolor!\slash\!\normalcolumncolor!,
3847 % \!\colseprulecolor!\slash\!\normalcolseprulecolor! or \!\background~color!
3848 % is used without coloring packages respectively.
3849 %
3850 % \item[\Uidx{$\!\PackageInfo!\arg{pkg}\arg{msg}$}]
3851 % is a developer's API macro to report an informational message $\arg{msg}$
3852 % with the package identification $\arg{pkg}$. The macro is used if the
3853 % \textsf{footmisc} package is loaded to inform about the \!\footnotelayout!
3854 % alias being unavailable.
3855 %
3856 % \item[\Uidx{\!\@@par!}]
3857 % is an internal macro to keep \TeX's original primitive \CSIndex{par} in it.
3858 % The macro is used in \!\pcol@output! to let \CSIndex{par} act with its
3859 % original definition, and in \!\pcol@switchcol! and \!\pcol@flushclear! as
3860 % the argument given to \!\pcol@visitallcols! to give \TeX's page builder
3861 % the chance of page break in \cscan{}ning.
3862 %
3863 % \item[\Uidx{\!\@height!}]
3864 % is an internal macro having the keyword |height|. It is used in
3865 % \!\pcol@buildcolsep~rule!, \!\pcol@buildcselt!, \!\pcol@bg@paintregion@i!,
3866 % \!\pcol@output@start!, and \!\pcol@putbackmvl! to draw a \!\hrule! for
3867 % \cseprule{} in the first two, a \!\vrule! to be painted in the third, and
3868 % an invisible \!\hrule! in the fourth and last.
3869 %
3870 % \item[\Uidx{\!\@width!}]
3871 % is an internal macro having the keyword |width|. It is used in
3872 % \!\pcol@buildcolsep~rule!, \!\pcol@buildcselt!, \!\pcol@bg@paintregion@i!,
3873 % \!\pcol@output@start!, and \!\pcol@putbackmvl! to draw a \!\hrule! for
3874 % \cseprule{} in the first two, a \!\vrule! to be painted in the third, and
3875 % an invisible \!\hrule! in the fourth and last.
3876 %
3877 % \item[\Uidx{\!\@plus!}]
3878 % is an internal macro having the keyword |plus|. It is used in the
3879 % following macros.
3880 % 
3881 % \begin{itemize}
3882 % \item
3883 % \!\pcol@makecol! to \!\def!ine \!\@textbottom! with the body of a vertical
3884 % skip with small infinite stretch and shrink.
3885 %
3886 % \item
3887 % \!\pcol@combinefloats! for a skip of the same amount in \!\@textbottom!
3888 % above and that of negative amount to {\em move} the effect.
3889 %
3890 % \item
3891 % \!\pcol@hfil! for skips having 1\,|fil| infinite stretch with $\gap_c$ or
3892 % $\gap_c/2$ to make it sure the series of columns and \csepgap{}s does not
3893 % cause underfull.
3894 %
3895 % \item
3896 % \!\pcol@synccolumn! to put a $1\,|fil|$ infinite stretch below the
3897 % main vertical list together with a small infinite shrink in the \colpage{}
3898 % being flushed and having a \sync{}ation point, and a vertical skip with a
3899 % small infinite stretch to push up the main vertical list above a
3900 % \sync{}ation point.
3901 %
3902 % \item
3903 % \!\pcol@setcw@getspec@i! to add $0\,|pt|\ |plus|\ 1000\,|pt|\ |minus|\
3904 % 1000\,|pt|$ to \!\@tempskipa! to ensure the register have stretch and
3905 % shrink components.
3906 %
3907 % \item
3908 % \!\pcol@setcw@fill! to let $\!\@tempskipa!=0\,|pt|\ |plus|\ f\,|fil|$ as
3909 % the infinite stretch factor of $f$.
3910 % \end{itemize}
3911 % 
3912 % It is also used in the top level assignment of $0\,|pt|\ |plus|\ 1\,|fil|\
3913 % |minus|\ 1\,|fil|$ to \!\@tempskipa! for the invocation of \!\pcol@defkw!.
3914 %
3915 % \item[\Uidx{\!\@minus!}]
3916 % is an internal macro having the keyword |minus|. It is used in the
3917 % following macros.
3918 % 
3919 % \begin{itemize}
3920 % \item
3921 % \!\pcol@makecol! to \!\def!ine \!\@textbottom! with the body of a vertical
3922 % skip with small infinite stretch and shrink.
3923 %
3924 % \item
3925 % \!\pcol@combinefloats! for a skip of the same amount and that of negative
3926 % amount.
3927 %
3928 % \item
3929 % \!\pcol@synccolumn! to put a small infinite shrink together with a
3930 % stretch of $1\,|fil|$ at the bottom of the main vertical list in a
3931 % \colpage{} being flushed and having a \sync{}ation point.
3932 %
3933 % \item
3934 % \!\pcol@setcw@getspec@i! to add $0\,|pt|\ |plus|\ 1000\,|pt|\ |minus|\
3935 % 1000\,|pt|$ to \!\@tempskipa! to ensure the register have stretch and
3936 % shrink components.
3937 % \end{itemize}
3938 % 
3939 % It is also used in the top level assignment of $0\,|pt|\ |plus|\ 1\,|fil|\
3940 % |minus|\ 1\,|fil|$ to \!\@tempskipa! for the invocation of \!\pcol@defkw!.
3941 %
3942 % \item[\Uidx{\!\hb@xt@!}]
3943 % is an internal macro having the sequence ``\!\hbox!| to|''. It is used in
3944 % \!\pcol@ioutputelt!, \!\pcol@imakeflushedpage! and \!\pcol@iflushfloats! to
3945 % put each \colpage{} in a \!\hbox! of \!\columnwidth! wide and to enclose
3946 % all of them in a \!\hbox! of \!\textwidth! wide.
3947 %
3948 % \item[\Uidx{$\!\@namedef!\arg{cs}\arg{body}$}]
3949 % is an internal macro to do $\!\def!|\|\arg{cs}\Arg{body}$. It is used in
3950 % the following macros.
3951 % 
3952 % \begin{itemize}
3953 % \item
3954 % \!\pcol@zparacol! for \!\column*! and \!\pcol@com@column*!.
3955 %
3956 % \item
3957 % $\!\pcol@remctrelt!\<\theta\>$ for $|\cl@|{\cdot}\theta$.
3958 % 
3959 % \SpecialArrayIndex{\theta}{\cl@}
3960 %
3961 % \item
3962 % $\!\definethecounter!\<\theta\>\<c\>\arg{rep}$ for
3963 % $|\pcol@thectr@|{\cdot}\theta{\cdot}c$,
3964 % 
3965 % \SpecialArrayIndex{\theta{\cdot}c}{\pcol@thectr@}
3966 %
3967 % \item
3968 % $\!\pcol@loadctrelt!\<\theta\>\<\val_c(\theta)\>$ for
3969 % $|\pcol@ctr@|{\cdot}\theta$.
3970 % 
3971 % \SpecialArrayIndex{\theta}{\pcol@ctr@}
3972 %
3973 % \item
3974 % \!\pcol@defcolumn! for \!\pcol@com@column*!.
3975 %
3976 % \item
3977 % \!\pcol@defcseprulecolor@i! for $\!\pcol@colseprulecolor![{\cdot}c]$.
3978 % 
3979 % \SpecialArrayIndex{c}{\pcol@colseprulecolor}
3980 %
3981 % \end{itemize}
3982 % 
3983 % We also use this macro in top level \!\def!initions of
3984 % \!\pcol@com@nthcolumn*!, \!\pcol@com@leftcolumn*! and
3985 % \!\pcol@com@rightcolumn*! for the starter of the environments
3986 % \env{nthcolumn*}, \env{leftcolumn*} and \env{rightcolumn*}.
3987 %
3988 % \item[\Uidx{$\!\@nameuse!\arg{cs}$}]
3989 % is an internal macro to do $|\|\arg{cs}$. It is used in the following
3990 % macros.
3991 % 
3992 % \begin{itemize}
3993 % \item
3994 % $\!\pcol@bg@addext!\arg{z}\Arg{s}\Arg{d}$ for
3995 % $|\pcol@bg@ext@|{\cdot}d{\cdot}|@|{\cdot}\{a{\cdot}|@|{\cdot}c,a\}$.
3996 % 
3997 % \SpecialArrayIndex{d{\cdot}\string\texttt{@}
3998 % {\cdot}a{\cdot}\string\texttt{@}{\cdot}c}{\pcol@bg@ext@}
3999 % \SpecialArrayIndex{d{\cdot}\string\texttt{@}{\cdot}a}{\pcol@bg@ext@}
4000 %
4001 % \item
4002 % \!\pcol@bg@columnleft! for $|\pcol@columnwidth|{\cdot}c$ and
4003 % $|\pcol@columnsep|{\cdot}c$.
4004 % 
4005 % \SpecialArrayIndex{c}{\pcol@columnwidth}
4006 % \SpecialArrayIndex{c}{\pcol@columnsep}
4007 %
4008 % \item
4009 % \!\pcol@bg@columnwidth! for $|\pcol@columnwidth|{\cdot}c$.
4010 % 
4011 % \SpecialArrayIndex{c}{\pcol@columnwidth}
4012 %
4013 % \item
4014 % \!\pcol@bg@columnsep! for $|\pcol@columnsep|{\cdot}c$.
4015 % 
4016 % \SpecialArrayIndex{c}{\pcol@columnsep}
4017 %
4018 % \item
4019 % \!\pcol@ccuse! for
4020 % $\Celt^c=|\pcol@columncolor@box|{\cdot}c$ or
4021 % $\Celtshadow^c=|\pcol@columncolor|{\cdot}c$.
4022 % 
4023 % \SpecialArrayIndex{c}{\pcol@columncolor}
4024 % \SpecialArrayIndex{c}{\pcol@columncolor@box}
4025 %
4026 % \item
4027 % \!\column*! for \!\pcol@com@column*!.
4028 %
4029 % \item
4030 % \!\pcol@zparacol! for $|\pcol@colpream|{\cdot}0$.
4031 % 
4032 % \SpecialArrayIndex{c}{\pcol@colpream}
4033 %
4034 % \item
4035 % $\!\pcol@storectrelt!\<\theta\>$ for $|\pcol@ctr@|{\cdot}\theta$.
4036 % 
4037 % \SpecialArrayIndex{\theta}{\pcol@ctr@}
4038 %
4039 % \item
4040 % $\!\pcol@cmpctrelt!\<\theta\>$ for $|\c@|{\cdot}\theta$
4041 % 
4042 % \SpecialArrayIndex{\theta}{\c@}
4043 % 
4044 % and $|\pcol@ctr@|{\cdot}\theta$.
4045 % 
4046 % \SpecialArrayIndex{\theta}{\pcol@ctr@}
4047 %
4048 % \item
4049 % \!\pcol@synccounter! for $|\pcol@counters|{\cdot}c$ for the column $c$.
4050 % 
4051 % \SpecialArrayIndex{c}{\pcol@counters}
4052 %
4053 % \item
4054 % $\!\pcol@syncctrelt!\<\theta\>$ for $|\c@|{\cdot}\theta$.
4055 % 
4056 % \SpecialArrayIndex{\theta}{\c@}
4057 %
4058 % \item
4059 % $\!\pcol@stepcounter!\<\theta\>$ for $|\pcol@counters|{\cdot}c$ for the
4060 % column $c$,
4061 % 
4062 % \SpecialArrayIndex{c}{\pcol@counters}
4063 % 
4064 % and for $|\cl@|{\cdot}\theta$.
4065 % 
4066 % \SpecialArrayIndex{\theta}{\cl@}
4067 %
4068 % \item
4069 % \!\pcol@switchcol! to the column $c$ for $|\pcol@colpream|{\cdot}c$.
4070 % 
4071 % \SpecialArrayIndex{c}{\pcol@colpream}
4072 %
4073 % \item
4074 % $\!\pcol@aconlyelt!\<t\>\<c\>$ for $|\pcol@ac@def@|{\cdot}t$.
4075 % 
4076 % \SpecialIndex{\pcol@ac@def@lof}\SpecialIndex{\pcol@ac@def@lot}
4077 %
4078 % \item
4079 % $\!\pcol@ac@def@lof!\arg{eord}$ and $\!\pcol@ac@def@lot!\arg{eord}$
4080 % for $|\pcol@ac@caption@|{\cdot}\~\arg{eord}$.
4081 % 
4082 % \SpecialIndex{\pcol@ac@caption@enable}
4083 % \SpecialIndex{\pcol@ac@caption@disable}
4084 %
4085 % \item
4086 % $\!\pcol@ac@caption!\arg{type}|[|\arg{lcap}|]|\arg{cap}$ for
4087 % $|\pcol@ac@caption@if@|{\cdot}t$
4088 % 
4089 % \SpecialIndex{\pcol@ac@caption@if@lof}
4090 % \SpecialIndex{\pcol@ac@caption@if@lot}
4091 % 
4092 % and for $|\ext@|{\cdot}\~\arg{type}$.
4093 % 
4094 % \SpecialIndex{\ext@figure}\SpecialIndex{\ext@table}
4095 %
4096 % \item
4097 % $\!\footnoteplacement!\Arg{l}$ for $|pcol@fnlayout@|{\cdot}l$.
4098 % 
4099 % \SpecialArrayIndex{l}{\pcol@fnlayout@}
4100 % \SpecialIndex{\pcol@fnlayout@c}
4101 % \SpecialIndex{\pcol@fnlayout@p}
4102 % \SpecialIndex{\pcol@fnlayout@m}
4103 %
4104 % \item
4105 % $\!\pcol@twosided!|[|T|]|$ for $|pcol@twosided@|{\cdot}t$ where $t\in T$.
4106 % 
4107 % \SpecialArrayIndex{t}{\pcol@twosided@}
4108 % \SpecialIndex{\pcol@twosided@p}
4109 % \SpecialIndex{\pcol@twosided@c}
4110 % \SpecialIndex{\pcol@twosided@m}
4111 % \SpecialIndex{\pcol@twosided@b}
4112 % \end{itemize}
4113 %
4114 % \item[\Uidx{$\!\@gobble!\arg{arg}$}]
4115 % discards its argument $\arg{arg}$. It is used in \!\pcol@output@start!,
4116 % \!\pcol@icolumncolor! and \!\pcol@set@color@push! for temporarily letting
4117 % \!\aftergroup! be \!\@gobble! to nullify \!\aftergroup! with
4118 % \!\reset@color! invoked in \!\pcol@set@color!, being the original version
4119 % of \!\set@color!, and in \!\pcol@zparacol! to make \!\pcol@bg@paintbox!
4120 % \!\let!-equal to \!\@gobble! to nullify it if any coloring packages have
4121 % not been loaded. In addition, the macros \!\pcol@F! and \!\pcol@Fe! for
4122 % logging are made \!\let!-equal to \!\@gobble! at the top level to nullify
4123 % them.
4124 %
4125 % \item[\Uidx{$\!\@ifundefined!\arg{cs}\arg{then}\arg{else}$}]
4126 % \begin{Hfuzz}{0.8pt}%
4127 % is an internal macro to do $\arg{then}$ or $\arg{else}$ if $\arg{cs}$ is
4128 % undefined or defined respectively.
4129 % It is used in the following macros;
4130 % $\!\pcol@bg@paintregion!\arg{a}\arg{c}$ to examine if either
4131 % $|\pcol@bg@color@|{\cdot}a{\cdot}|@|{\cdot}c$ or
4132 % $|\pcol@bg@color@|{\cdot}a$ is defined;
4133 % 
4134 % \SpecialArrayIndex{a{\cdot}\string\texttt{@}{\cdot}c}{\pcol@bg@color@}
4135 % \SpecialArrayIndex{a}{\pcol@bg@color@}
4136 % 
4137 % \!\add~contents~only!$\<t\>\<c\>$ to stop the execution if
4138 % $|\pcol@ac@def@|{\cdot}t$ is not defined;
4139 % 
4140 % \SpecialArrayIndex{t}{\pcol@ac@def@}
4141 % 
4142 % \!\footnote~layout!$\Arg{l}$ to stop the execution if
4143 % $|\pcol@fnlayout@|{\cdot}l$ is not defined;
4144 % 
4145 % \SpecialArrayIndex{l}{\pcol@fnlayout@}
4146 % 
4147 % $\!\pcol@twosided!|[|T|]|$ to stop the execution if $T$ has $t$
4148 % such that $|\pcol@twosided@|{\cdot}t$ is not defined;
4149 % 
4150 % \SpecialArrayIndex{t}{\pcol@twosided@}
4151 % 
4152 % \!\pcol@backgroundcolor! to stop the execution if $|\pcol@bg@@|{\cdot}a$
4153 % is not defined for a region $a$;
4154 % 
4155 % \SpecialArrayIndex{a}{\pcol@bg@@}
4156 % 
4157 % and \!\pcol@backgroundcolor@i! to stop the execution if
4158 % $|\pcol@bg@mayhavecol|{\cdot}a$ is not defined for a region $a$.
4159 % \end{Hfuzz}
4160 %
4161 % \item[\Uidx{$\!\@ifnextchar!\arg{char}\arg{then}\arg{else}$}]
4162 % is an internal macro to do $\arg{then}$ or $\arg{else}$ if the character
4163 % following to the macro is $\arg{char}$ or not respectively. It is used in
4164 % the following macros to examine if they are followed by a `\texttt{\LB}'.
4165 % 
4166 % \begin{quote}\raggedright
4167 % \!\paracol!,
4168 % \!\pcol@zparacol!,
4169 % \!\columnratio!,
4170 % \!\pcol@com@column*!\hbox{ (initial definition)},
4171 % \!\pcol@com@switchcolumn!,
4172 % \!\pcol@iswitchcolumn!,
4173 % \!\pcol@adjustfnctr!,
4174 % \!\pcol@ifootnotetext!,
4175 % \!\twosided!,
4176 % \!\marginparthreshold!,
4177 % \!\columncolor!,
4178 % \!\pcol@columncolor!,
4179 % \!\normalcolumncolor!.
4180 % \!\colseprulecolor!,
4181 % \!\pcol@defcseprulecolor!,
4182 % \!\normalcolseprulecolor!,
4183 % \!\pcol@backgroundcolor!,
4184 % \!\pcol@backgroundcolor@w!.
4185 % \end{quote}
4186 % It is also used in \!\pcol@backgroundcolor@iii! and
4187 % \!\pcol@backgroundcolor@iv! if they are followed by a `\texttt{\LP}'.
4188 %
4189 % \item[\Uidx{$\!\@ifstar!\arg{then}\arg{else}$}]
4190 % is an internal macro to do $\arg{then}$ or $\arg{else}$ if the character
4191 % following to the macro is `|*|'. It is used in \!\pcol@yparacol!,
4192 % \!\globalcounter!, \!\pcol@switchcolumn!, \!\pcol@footnote!,
4193 % \!\pcol@footnotemark! and \!\pcol@footnotetext! to examine if the optional
4194 % `|*|' is specified.
4195 %
4196 % \item[\Uidx{$\!\@whilesw!\arg{sw}\cs{fi}\arg{body}$}]
4197 % is an internal macro to iterate $\arg{body}$ while the switch $\arg{sw}$
4198 % is $\true$. It is used in \!\pcol@output!, \!\pcol@startpage!,
4199 % \!\pcol@output@clear!, \!\pcol@flushfloats!, \!\pcol@freshpage! and
4200 % \!\pcol@output@end! to iterate building process of \fcolumn{}s or
4201 % \fpage{}s while $\CSIndex{if@fcolmade}=\true$, and in \!\pcol@switchcol!
4202 % and \!\pcol@flushclear! to iterate the height check of \sync{}ed or
4203 % flushed pages while $\CSIndex{ifpcol@flush}=\true$.
4204 %
4205 % \item[\Uidx{$\!\@whilenum!\arg{ifnum}\cs{do}\arg{body}$}]
4206 % is an internal macro to iterate $\arg{body}$ while the integer comparison
4207 % expression $\arg{ifnum}$ is $\true$. The macro is used in the following
4208 % macros to iterate their own procedures for all columns $c\In0\C$.
4209 % 
4210 % \begin{quote}\raggedright
4211 % \!\pcol@checkshipped!,
4212 % \!\pcol@output@start!,
4213 % \!\pcol@output@switch!,
4214 % \!\pcol@sync!,
4215 % \!\pcol@makeflushedpage!,
4216 % \!\pcol@freshpage!,
4217 % \!\pcol@output@end!,
4218 % \!\pcol@synccounter!,
4219 % \!\pcol@com@syncallcounters!,
4220 % \!\pcol@stepcounter!,
4221 % \!\pcol@visitallcols!.
4222 % \end{quote}
4223 % 
4224 % The macro is also used in the following macros for the ranges following
4225 % macro name, where $(\Cfrom,\Cto)\in\{(0,\CL),(\CL,\C)\}$ and $c$ is the
4226 % column they are working on.
4227 % 
4228 % \begin{quote}
4229 % \!\pcol@ioutputelt! $\LBRP\Cfrom\Cto$\\
4230 % \!\pcol@bg@paint@ii! $\LBRP\CBfrom{\Cto{-}1}$\\
4231 % \!\pcol@bg@columnleft! $\LBRP\CBfrom{c}$\\
4232 % \!\pcol@addmarginpar! $\LBRP\Cfrom{c'}$ ($c'\in\{c,\;\Cto-(c-\Cfrom)-1\}$)\\
4233 % \!\pcol@imakeflushedpage! $\LBRP\Cfrom\Cto$\\
4234 % \!\pcol@iflushfloats! $\LBRP\Cfrom\Cto$\\
4235 % \!\pcol@setcw@scan! $\LBRP\Cfrom\Cto$
4236 % \end{quote}
4237 % 
4238 % The other users have a little bit more complicated range as follows.
4239 % \begin{itemize}
4240 % \item
4241 % \!\pcol@flushcolumn! to iterate \fcolumn{} building for a column $c$ in
4242 % pages $q$ such that $q\in(\cc_c(\vb^p),\ptop)$.
4243 %
4244 % \item
4245 % \!\pcol@setcolwidth@r! to make assignment of $\w_c$ for
4246 % $c\In{\min(\Cfrom{+}k,\Cto{-}1)}{\,\Cto}$ where $k$ is the number of
4247 % fractions given as the first or second argument of
4248 % \!\columnratio! and kept in \!\pcol@columnratioleft! or
4249 % \!\pcol@columnratioright!, respectively.
4250 %
4251 % \item
4252 % $\!\pcol@setcw@calcf!\<x\>\<y\>\<z\>$ to calculate
4253 % $\lceil{y/2^{k_2+k_3}}\rceil$ finding $k_3$ by iterating $y/2$ until the
4254 % result becomes less than $2^{15}$, to calculate $z'/2^k$ with the range
4255 % $\LBRP0k$, to calculate $z'/2^{k-16}$ with the range $\LBRP0{\,k{-}16}$,
4256 % and to calculate $z'\cdot2^{16-k}$ with the range $\LBRP0{\,16{-}k}$,
4257 % where $z'\cdot2^{16-k}=Z=z\times1\,|pt|$ and $k_2$, $k_3$ and $k$ are
4258 % scaling parameters for good approximation.
4259 % \end{itemize}
4260 %
4261 % \item[\Uidx{$\!\@whiledim!\arg{ifdim}\cs{do}\arg{body}$}]
4262 % is an internal macro to iterate $\arg{body}$ while the dimensional
4263 % comparison expression $\arg{ifdim}$ is $\true$. The macro is used in
4264 % $\!\pcol@setcw@calcf!\<x\>\<y\>\<z\>$ twice, at first to find
4265 % $k_1=\min\Set{k}{x\cdot2^k\geq2^{13}\,|pt|}$ and to have $x\cdot2^{k_1}$,
4266 % and then to find $k_2=\max\Set{k}{y\bmod2^k=0}$ and to have $y/2^{k_2}$.
4267 %
4268 % \item[$\Uidx{\!\@for!}\arg{cs}\texttt{:=}\arg{list}\cs{do}\arg{body}$]
4269 % is an internal macro to iterate $\arg{body}$ for each element of the
4270 % comma-separated $\arg{list}$ letting $\arg{cs}$ have the element. The
4271 % macro is used in \!\pcol@setcolwidth@r! to scan its argument
4272 % $\arg{ratio}$ defined by \!\columnratio!, and in \!\pcol@setcw@scan! to
4273 % scan its argument $\arg{spec}$ defined by \!\setcolumnwidth!.
4274 %
4275 % \item[$\Uidx{\!\@tfor!}\arg{cs}|:=|\arg{list}\cs{do}\arg{body}$]
4276 % is an internal macro to iterate $\arg{body}$ for each non-space token in
4277 % $\arg{list}$ letting $\arg{cs}$ have the token. The macro is used in
4278 % \!\pcol@bg@paint@ii!, \!\pcol@setcw@getspec! and \!\pcol@twosided! to scan
4279 % their arguments, in \!\pcol@setcw@getspec@i! to scan a column\slash
4280 % gap specification to remove spaces from it, and in
4281 % $\!\pcol@twosided!|[|T|]|$ to scan all tokens being two-sided typesetting
4282 % features in $T$.
4283 %
4284 % \item[\Uidx{$\!\@next!\arg{elm}\arg{lst}\arg{suc}\arg{fail}$}]
4285 % is an internal macro to remove the first element from $\arg{lst}$,
4286 % \!\def!ine $\arg{elm}$ to have the first element, and then do $\arg{suc}$,
4287 % if $\arg{lst}$ is not empty. Otherwise, it performs $\arg{fail}$. The
4288 % macro is used in the following macros to obtain an \!\insert! from
4289 % \!\@freelist!.
4290 % 
4291 % \begin{itemize}
4292 % \item
4293 % \!\pcol@opcol! for the completed \colpage{}.
4294 %
4295 % \item
4296 % \!\pcol@startpage! for \fpage{}s and \spanning{} for \pwise{} top
4297 % floats.
4298 %
4299 % \item
4300 % \!\pcol@output@start! for the \preenv{}, and \colpage{}s and $\Celt^c$ of
4301 % all columns.
4302 %
4303 % \item
4304 % \!\pcol@output@switch! for the \colpage{} from which we are leaving.
4305 %
4306 % \item
4307 % \!\pcol@iscancst! for $\Celt^c$.
4308 %
4309 % \item
4310 % \!\pcol@savefootins! for footnotes.
4311 %
4312 % \item
4313 % \!\pcol@flushcolumn! for \fcolumn{}s and the empty \colpage{} in $\ptop$.
4314 %
4315 % \item
4316 % \!\pcol@synccolumn! for an \mvlfloat{} on a \sync{}ation if its point
4317 % defined by a column whose main vertical list is empty.
4318 %
4319 % \item
4320 % \!\pcol@output@end! for the \pwise{} floats in the \lpage{} if the
4321 % main vertical list of the page is empty.
4322 %
4323 % \item
4324 % \!\pcol@icolumncolor! for $\Celt^c$.
4325 % \end{itemize}
4326 % 
4327 % The macro is also used in \!\pcol@ioutputelt! to obtain completed
4328 % \colpage{}s from $\S_c$.
4329 %
4330 % \item[\Uidx{%
4331 % $\!\@xnext!\cs{@elt}\arg{car}\arg{cdr}\cs{@@}\arg{first}\arg{rest}$}]
4332 % is an internal macro to remove the first element $|\@elt|\arg{car}$ from a
4333 % list in the form of $|\@elt|\,e_1\,\cdots\,|\@elt|\,e_n$ where
4334 % $\arg{cdr}=|\@elt|\,e_2\,\cdots\~\,|\@elt|\,e_n$ and |\def|ine
4335 % $\arg{first}$ as $\arg{car}$ and globally |\def|ine $\arg{rest}$ as
4336 % $\arg{cdr}$. It is used in \!\pcol@addmarginpar! to get the first element
4337 % of \!\@currlist! being a \!\insert! for a right marginal note without
4338 % modifying \!\@currlist!.
4339 %
4340 % \item[\Uidx{$\!\@cons!\arg{lst}\arg{elm}$}]
4341 % is an internal macro to add $\!\@elt!\arg{elm}$ to the tail of $\arg{lst}$.
4342 % 
4343 % \begin{itemize}
4344 % \item
4345 % \!\pcol@makecol! to add $\spt(H,h)$ to the tail of $\pp^s(\ptop)$.
4346 %
4347 % \item
4348 % \!\pcol@opcol! to add the completed \ccolpage{} $\cc_c(\vb)$ to $\S_c$.
4349 %
4350 % \item
4351 % \!\pcol@startpage! to add $\pp(\ptop-1)$ and \fpage{}s to $\PP$.
4352 %
4353 % \item
4354 % \!\pcol@outputelt! to return \spanning{} $\pp^i(q)$ in a shipped-out \fpage{}
4355 % $q$ to \!\@freelist!, or to add $\pp(q)$ to $\PP$ if the page $q$ is kept.
4356 %
4357 % \item
4358 % \!\pcol@ioutputelt! to return \spanning{} $\pp^i(q)$, \Scfnote{}s
4359 % $\pp^f(q)$ and/or \colpage{}s $\s_c(q)$ for all $c\In0C$ in a shipped-out
4360 % page $q$ to \!\@freelist!.
4361 %
4362 % \item
4363 % \!\pcol@output@start! to return the \ccolpage{} $\cc_0(\vb)$ to
4364 % \!\@freelist!.
4365 %
4366 % \item
4367 % \!\pcol@output@switch! to add $\spt(H,h)$ to the tail of $\pp^s(\ptop)$.
4368 %
4369 % \item
4370 % \!\pcol@restartcolumn! to return the \ccolpage{} $\cc_c(\vb)$ to be resumed,
4371 % and its footnotes $\cc_c(\ft)$ if any, to \!\@freelist!.
4372 %
4373 % \item
4374 % $\!\pcol@getmparbottom!\<t\>\<h\>$ to add
4375 % $\mpar(\max(t,b_n),\max(t,b_n){+}h)$ to the tail of the list
4376 % $\mpb_{\{L,R\}}^{\{l,r\}}$, and its callee
4377 % $\!\pcol@getmpbelt!\<t_i\>\<b_i\>$ to add $\mpar(t_i,b_i)$ or
4378 % $\mpar(\max(t,b_{i-1}),\max(t,b_{i-1}){+}h)$ to the so-far tail of the
4379 % list in rebuilding.
4380 %
4381 % \item
4382 % \!\pcol@flushcolumn! to return footnotes $\cc_c(\ft)$ in the \ccolpage{}
4383 % of $c$ to be flushed to \!\@freelist! if any, and to add the flushed
4384 % \colpage{} and \fcolumn{}s to $\S_c$.
4385 %
4386 % \item
4387 % \!\pcol@makefcolelt! to add a float to \!\@toplist! or $\cc_c(\dl)$.
4388 %
4389 % \item
4390 % \!\pcol@synccolumn! to add an \mvlfloat{} for \sync{}ation to
4391 % $\cc_c(\tl)$.
4392 %
4393 % \item
4394 % \!\pcol@makeflushedpage! to return \spanning{} $\pp^i(\ptop)$ and/or
4395 % \Scfnote{}s $\pp^f(\ptop)$ in the top page to be flushed to \!\@freelist!
4396 % if any.
4397 %
4398 % \item
4399 % \!\pcol@imakeflushedpage! to return \Mcfnote{}s in $\cc_c(\ft)$ s.t.\
4400 % $\cc_c(\vb^p)=\ptop$ to \!\@freelist! if any.
4401 %
4402 % \item
4403 % \!\pcol@output@end! to return $\pp^f(\ptop)$, all \ccolpage{}s
4404 % $\cc_c(\vb)$, and all $\Celt^c\neq\bot$ to \!\@freelist!.
4405 %
4406 % \item
4407 % \!\pcol@end@dblfloat! to add a \pwise{} float in \!\@currbox! to
4408 % \!\@dbldeferlist!.
4409 %
4410 % \item
4411 % $\!\globalcounter!\<\theta\>$ to add a \gcounter{} $\theta$ to $\CG$.
4412 %
4413 % \item
4414 % $\!\pcol@iremctrelt!\<\theta\>$ to add a \lcounter{} $\theta$ to $\CTL$.
4415 %
4416 % \item
4417 % $\!\pcol@storectrelt!\<\theta\>$ to add a pair $\<\theta,\val_c(\theta)\>$
4418 % to $\Cc_c$ for a column $c$.
4419 %
4420 % \item
4421 % $\!\pcol@savectrelt!\<\theta\>$ to add a pair $\<\theta,\val(\theta)\>$ to
4422 % $\Cc_c$ for a column $c$.
4423 %
4424 % \item
4425 % $\!\pcol@cmpctrelt!\<\theta\>$ to add a counter $\theta$ to the list of
4426 % \lcounter{}s to be synchronized.
4427 %
4428 % \item
4429 % $\!\addcontentsonly!\<t\>\<c\>$ to add a pair $\<t,c\>$ to $\T$.
4430 %
4431 % \item
4432 % \!\pcol@backgroundcolor@ii! to add a region whose \bground{} is painted to
4433 % \!\pcol@bg@defined!.
4434 % \end{itemize}
4435 %
4436 % \item[\Uidx{$\!\@cdr!\<a_1\>\<a_2\>\cdots\<a_n\>\cs{@nil}$}]
4437 % is an internal macro to be expanded to $\<a_2\>\cdots\<a_n\>$. It is used
4438 % in $\!\pcol@getcurrpinfo!\arg{cs}$ to extract $\pp(\ptop)$ from
4439 % $\!\pcol@currpage!=\!\@elt!\arg{\pp(\ptop)}$ and to \!\def!ine $\arg{cs}$
4440 % letting it have $\pp(\ptop)$.
4441 %
4442 % \item[\Uidx{$\!\protected@edef!\arg{macro}$\marg{body}}]
4443 % is an internal macro to do \!\edef!$\arg{macro}$\marg{body} with the
4444 % \!\protect!ion so that \!\protect!$\arg{cs}$ is kept in the expansion. It
4445 % is used in \!\pcol@fntextbody! to \!\edef!ine \!\@currentlabel!.
4446 %
4447 % \item[\Uidx{$\!\@latex@warning@no@line!\arg{msg}$}]
4448 % is an internal macro to report a warning message $\arg{msg}$ without the
4449 % line number in which the cause lies. It is used in \!\pcol@output! if
4450 % a page with floats and very short main vertical list is built.
4451 %
4452 % \item[\Uidx{\!\@eha!}]
4453 % is an internal macro having a help message saying the command causing an
4454 % error is ignored. It is used in \!\pcol@zparacol!, \!\pcol@setcw@calcf!,
4455 % \!\pcol@switchcolumn!, \!\pcol@switchenv!, and \!\addcontentsonly! as the
4456 % argument of \!\PackageError!.
4457 %
4458 % \item[\Uidx{\!\@ehb!}]
4459 % is an internal macro having a help message saying the error causes a
4460 % serious problem. It is used in \!\pcol@ovf!, \!\pcol@zparacol! and
4461 % \!\pcol@set@color@push! as the argument of \!\PackageError!.
4462 %
4463 % \item[\Uidx{\!\@parmoderr!}]
4464 % is an internal macro to complain about misplacement of a macro or
4465 % environment which is expected to appear in ``outer par mode''.
4466 % It is used in \!\pcol@zparacol! if it finds $\CSIndex{ifinner}=\true$.
4467 %
4468 % \item[\Uidx{\!\@Esphack!}]
4469 % is an internal macro to put back the horizontal skip and space factor
4470 % saved by \!\@bsphack! at the end of an environment. It is used in
4471 % \!\pcol@end@dblfloat!.
4472 %
4473 % \item[\Uidx{\!\reset@font!}]
4474 % is an internal macro \!\let!-equal to \!\normalfont! to use a standard
4475 % font. It is used in \!\pcol@fntextbody! for footnote typesetting.
4476 %
4477 % \item[\Uidx{\!\set@color!}]
4478 % is an internal macro to start coloring of texts following it. By default
4479 % it is \!\relax! but may have a definition to put a \!\special! for
4480 % coloring with the color in \!\current@color!. In the following macros, it
4481 % is examined if $\!\set@color!=\!\relax!$ and/or some local definition is
4482 % given to \!\set@color!.
4483 % 
4484 % \begin{itemize}
4485 % \item
4486 % \!\pcol@output! lets $\!\set@color!=\!\pcol@set@color!$ i.e., lets it
4487 % regain its original definition because we don't need any special
4488 % operations in \!\output! routine.
4489 %
4490 % \item
4491 % \!\@outputpage! performs \bgpaint{} if $\!\set@color!\neq\!\relax!$.
4492 %
4493 % \item
4494 % \!\pcol@zparacol! performs set-up operations for text coloring, including
4495 % making \!\set@color! \!\let!-equal to \!\pcol@set@color@push! saving
4496 % its original definition into \!\pcol@set@color!, and enabling \bgpaint{}
4497 % macros if $\!\set@color!\neq\!\relax!$, while these \bgpaint{} macros are
4498 % nullified otherwise.
4499 %
4500 % \item
4501 % \!\pcol@icolumncolor! complains that no color packages have been loaded if
4502 % \!\set@color!${}={}$\!\relax!, and then otherwise temporarily lets it be
4503 % the original saved in \!\pcol@set@color! to \!\insert! a \!\vbox! to
4504 % update $\Celt^c$ or to do the update immediately.
4505 %
4506 % \item
4507 % \!\pcol@iicolumncolor! temporarily lets $\!\set@color!=\!\relax!$ so that
4508 % \!\color! or \!\normalcolor! invoked in the macro just defines
4509 % \!\current@color! to be set into $\Celtshadow^c$ without doing any other
4510 % coloring operations.
4511 %
4512 % \item
4513 % \!\pcol@defcseprulecolor@i! complains that no color packages have been
4514 % loaded if $\!\set@color!=\!\relax!$, while otherwise the macro temporarily
4515 % lets $\!\set@color!=\!\relax!$ to invoke \!\color! (or \!\normalcolor!) to
4516 % check if its arguments are properly given.
4517 %
4518 % \item
4519 % \!\pcol@backgroundcolor@ii! complains that no color packages have been
4520 % loaded if $\!\set@color!=\!\relax!$, while otherwise its descendent
4521 % \!\pcol@backgroundcolor@x! temporarily lets
4522 % $\!\set@color!=\!\pcol@backgroundcolor@y!$ to \!\def!ine
4523 % $|\pcol@bg@|\~|color@|a[|@|{\cdot}c]$ to be \!\current@color!.
4524 % 
4525 % \SpecialArrayIndex{a}{\pcol@bg@color@}
4526 % \SpecialArrayIndex{a{\cdot}\string\texttt{@}{\cdot}c}{\pcol@bg@color@}
4527 % \end{itemize}
4528 %
4529 % \item[\Uidx{\!\reset@color!}]
4530 % is an internal macro to finish text coloring started by \!\set@color!. By
4531 % default it is undefined but may have some definition to put a \!\special!
4532 % to finish coloring. It is used in \!\pcol@clearcolorstack! so as to apply
4533 % it to all elements in $\CST^c$, in \!\pcol@iscancst! to put it to the
4534 % main vertical list in the case that $\Celt^c$ was $\bot$ and then updated,
4535 % in \!\pcol@icolumncolor! to apply it to all elements in $\CSTshadow^c$,
4536 % and in \!\pcol@reset@color@pop! and \!\pcol@reset@color@mpop! to have an
4537 % uncoloring \!\special! in the \!\vbox! for $\celt_i$ and $\mcelt_{i,m}$.
4538 %
4539 % \item[\Uidx{\!\color@begingroup!}]
4540 % is an internal macro to open a group in which a color is specified. It is
4541 % used in \!\pcol@putfootins! to enclose footnotes with \!\normalcolor!, and
4542 % in \!\pcol@fntextbody!\marg{text} to enclose the coloring in the footnote
4543 % $\arg{text}$.
4544 %
4545 % \item[\Uidx{\!\color@endgroup!}]
4546 % is an internal macro to close a group in which a color is specified. It is
4547 % used in \!\pcol@putfootins! to enclose footnotes with \!\normalcolor!, and
4548 % in \!\pcol@fntextbody!\marg{text} to enclose the coloring in the footnote
4549 % $\arg{text}$.
4550 %
4551 % \item[\Uidx{$\!\@stpelt!\<\theta\>$}]
4552 % is an internal macro to zero-clear the counter $\theta$ for the
4553 % implementation of \!\stepcounter!. It is used in \!\pcol@stepcounter! to
4554 % clear the descendent counters of a \gcounter{} $\cg$ listed in
4555 % $|\pcol@cl@|{\cdot}\cg$.
4556 % 
4557 % \SpecialArrayIndex{\theta}{\pcol@cl@}
4558 %
4559 % \item[\Uidx{\!\@nbitem!}]
4560 % is an internal macro to insert a vertical skip of
4561 % $\!\@outerparskip!-\!\parskip!$ above the first \!\item! of a
4562 % \env{list}-like environment when $\CSIndex{if@nobreak}=\true$. It is used
4563 % by \!\pcol@zparacol! when it finds the \env{paracol} environment to start
4564 % is at the very beginning of a \env{list}-like environment and
4565 % $\CSIndex{if@nobreak}=\true$.
4566 %
4567 % \item[\Uidx{\!\@parboxrestore!}]
4568 % is an internal macro to set up typesetting parameters for paragraphs
4569 % encapsulated in a box. It is used in \!\pcol@fntextbody! for paragraphs
4570 % in a footnote.
4571 %
4572 % \item[\Uidx{\!\@finalstrut!}$\arg{box}$]
4573 % is an internal macro to add an invisible vertical rule whose depth is that
4574 % of a $\arg{box}$. It is used in \!\pcol@fntextbody! to make the last line
4575 % of the footnotes is as deep as \!\strutbox! at shallowest.
4576 %
4577 % \item[\Uidx{\!\@sect!}]
4578 % is an internal macro to implement sectioning commands. The original
4579 % definition of the macro is kept in \!\pcol@ac@enable@toc!, while
4580 % \!\pcol@ac@def@toc! makes it \!\let!-equal to \!\pcol@ac@enable@toc! or
4581 % \!\pcol@ac@disable@toc!, the latter of which uses the original version
4582 % temporarily disabling \!\addcontentsline!.
4583 %
4584 % \item[\Uidx{\!\@svsechd!}]
4585 % is an internal macro (locally) \!\def!ined in \!\@sect! and \!\@ssect! to
4586 % keep the section header of a sectioning command such as \!\paragraph!
4587 % which puts the header as the leading text of the paragraph following the
4588 % command rather than putting it as an individual paragraph. The macro is
4589 % \!\global!ized in \!\pcol@sptext! so that it is properly referred to in
4590 % \!\everypar! for the paragraph led by the text in case that a \mctext{}
4591 % has the sectioning command only and thus the \!\def!inition of the macro
4592 % must survive after we close the group in which the \mctext{} is put.
4593 %
4594 % \item[\Uidx{\!\@svsec!}]
4595 % is an internal macro (locally) \!\def!ined in \!\@sect! to keep
4596 % \!\thesection! etc.\ to be displayed as the leading part of the section
4597 % header. The macro is \!\global!ized in \!\pcol@sptext! together with
4598 % \!\@svsechd! because it is in the body of \!\@svsechd!.
4599 %
4600 % \item[\Uidx{\!\@caption!}]
4601 % is an internal macro to implement \!\caption!. The original definition of
4602 % the macro is kept in \!\pcol@ac@caption@latex!, while
4603 % \!\pcol@ac@caption@def! makes it \!\let!-equal to \!\pcol@ac@caption!
4604 % which uses the original version temporarily disabling \!\addcontentsline!
4605 % if necessary.
4606 %
4607 % \item[\Uidx{\!\end@float!}]
4608 % is an internal macro to close a \cwise{} float environment. It is used in
4609 % \!\pcol@end@dblfloat! (but never invoked because we have \cs{if@twocolumn}
4610 % true always).
4611 %
4612 % \item[\Uidx{\!\end@dblfloat!}]
4613 % is an internal macro to close a \pwise{} float environment. It is replaced
4614 % with our own \!\pcol@end@dblfloat!.
4615 %
4616 % \item[\Uidx{\!\@endfloatbox!}]
4617 % is an internal macro to close a \!\vbox! for a float. It is used in
4618 % \!\pcol@end@dblfloat!.
4619 %
4620 % \item[\Uidx{\!\@largefloatcheck!}]
4621 % is an internal macro to examine if a float is too large. It is used in
4622 % \!\pcol@end@dblfloat!.
4623 %
4624 % \item[\Uidx{\!\@floatplacement!}]
4625 % is an internal macro for \!\output! routine to reinitialize \cwise{}
4626 % float placement parameters. It is used in our own version of it,
4627 % \!\pcol@floatplacement!.
4628 %
4629 % \item[\Uidx{\!\@dblfloatplacement!}]
4630 % is an internal macro for \!\output! routine to reinitialize \pwise{}
4631 % float placement parameters. It is used in \!\pcol@startpage! and
4632 % \!\pcol@output@clear! prior to processing \pwise{} floats in
4633 % \!\@dbldeferlist!. As discussed in
4634 % item-(\ref{item:ovv-float-@dblfloatplacement}) of
4635 % \secref{sec:imp-ovv-float}, this macro in 2015 or later version of
4636 % \LaTeX{} lets $\!\f@depth!=|1sp|$.
4637 %
4638 % \item[\Uidx{\!\@xympar!}]
4639 % is an internal macro to perform the last operations for \!\marginpar!. In
4640 % \!\pcol@zparacol! it is made \!\let!-equal to \!\pcol@xympar! for the
4641 % emulation of \!\marginnote!, while its original version is kept in
4642 % \!\pcol@@xympar!.
4643 %
4644 % \item[\Uidx{\!\p@footnote!}]
4645 % is an internal macro to have the prefix to \!\thefootnote! in the printed
4646 % reference of the counter \counter{footnote}. It is used in
4647 % \!\pcol@fntextbody! to produce \!\@currentlabel!.
4648 %
4649 % \item[\Uidx{\!\@thefnmark!}]
4650 % is an internal macro to have \!\thefootnote!\footnote{
4651 % 
4652 % Or \cs{thempfootnote} in \env{minipage} environment.}.
4653 % 
4654 % It is used in \!\pcol@fntextbody! to produce \!\@currentlabel!.
4655 %
4656 % \item[\Uidx{\!\@footnotetext!}\marg{text}]
4657 % is an internal macro to implement \!\footnote! and \!\footnotetext! for
4658 % $\arg{text}$. In \!\pcol@zparacol!, it is made \!\let!-equal to
4659 % \!\pcol@fntext!.
4660 %
4661 % \item[\Uidx{\!\@makefntext!}\marg{fn}]
4662 % is an internal macro to typeset the footnote $\arg{fn}$. It is used in
4663 % \!\pcol@fntextbody!\marg{text} to typeset the footnote $\arg{text}$ with
4664 % some other stuff.
4665 %
4666 % \item[\Uidx{\!\@emptycol!}]
4667 % is an internal macro for \!\output! routine to put back an empty page to
4668 % the main vertical list. It is used \!\pcol@output! if a page with floats
4669 % and very short main vertical list is built.
4670 %
4671 % \item[\Uidx{\!\@specialoutput!}]
4672 % is an internal macro for \!\output! routine to process an \!\output!
4673 % request made by \LaTeX's original \!\clearpage!, $\!\end!\Arg{float}$ and
4674 % \!\marginpar!. It is used in \!\pcol@specialoutput! to process the
4675 % request for floats or marginal notes.
4676 %
4677 % \item[\Uidx{\!\@opcol!}]
4678 % is an internal macro for \!\output! routine to output a page or to keep
4679 % the first column until the second one is completed. This macro is used in
4680 % \!\pcol@output! to process a sneaked \!\output! request from outside of
4681 % \env{paracol}, and in \!\pcol@output@end! for the case \pwise{} floats
4682 % are left at \Endparacol{} and they are put in \fpage{}s.
4683 %
4684 % \item[\Uidx{\!\@makecol!}]
4685 % is an internal macro for \!\output! routine to build the ship-out
4686 % image of a column in \!\@outputbox! consisting of top floats, main
4687 % vertical list in \!\box!|255|, footnotes in \!\footins!, and bottom
4688 % floats\footnote{
4689 % 
4690 % In p\LaTeX, the order of footnotes and bottom floats are reversed.}.
4691 % 
4692 % It is used in \!\pcol@output! to process a sneaked \!\output! request
4693 % from outside of \env{paracol}, in \!\pcol@@makecol! for a \colpage{} to be
4694 % flushed by \!\pcol@flushcolumn! and \!\pcol@makeflushedpage!, in
4695 % \!\pcol@makecol! for an ordinary \colpage{}, and in \!\pcol@output@start!
4696 % and \!\pcol@makenormalcol! for \preenv{}.
4697 %
4698 % \item[\Uidx{\!\@textbottom!}]
4699 % is an internal macro for \!\output! routine to be put at the bottom of
4700 % \!\@outputbox! in which a \colpage{} is stored, by \!\@makecol!. This
4701 % macro is temporarily re\!\def!ined by \!\pcol@makecol! for a \colpage{}
4702 % having \sync{}ation points so that it has a vertical skip of infinite
4703 % stretch and shrink to push up/down the stuff below the last \sync{}ation
4704 % point in order to adjust its top to the point. After that, its original
4705 % definition kept in \!\pcol@textbottom! is restored. Another modifiers of
4706 % the macro are as follows; \!\pcol@makenormalcol! to make the macro
4707 % \!\let!-equal to \!\relax! temporarily to avoid the insertion of whatever
4708 % the macro has in \!\@makecol!; and \!\pcol@makeflushedpage! to let the
4709 % macro have \!\vfil! temporarily so that empty columns in a \lpage{} are
4710 % made {\em full size} without underfull.
4711 %
4712 % \item[\Uidx{\!\@outputpage!}]
4713 % is an internal macro for \!\output! routine to output a page kept in
4714 % \!\@outputbox! together with the header and footer. The original
4715 % definition of this macro is saved in \!\pcol@@outputpage! to be used in
4716 % \!\pcol@outputpage@l! and \!\pcol@outputpage@r! being callees of our own
4717 % revised version of \!\@outputpage!. Therefore, any \!\output! request to
4718 % result in page ship-out reaches our own \!\@outputpage! and then \LaTeX's
4719 % one after we perform operations for \parapag{}ing and \bgpaint{} onto the
4720 % ship-out image.
4721 %
4722 % \item[\Uidx{\!\@combinefloats!}]
4723 % is an internal macro for \!\output! routine to combine top and bottom
4724 % floats in \!\@toplist! and \!\@botlist! respectively with \!\@outputbox!
4725 % in which the main vertical list and footnotes\footnote{
4726 % 
4727 % In p\LaTeX, footnotes are not in \cs{@outputbox} because of the reversal of
4728 % footnotes and bottom floats.}
4729 % 
4730 % have been put by \!\@makecol!, and to have the result in \!\@outputbox!
4731 % again. In \!\pcol@zparacol!, it is made \!\let!-equal to our own
4732 % \!\pcol@combinefloats! so that \!\@makecol! and \!\pcol@makenormalcol!
4733 % uses it instead of the original one. However, if \!\pcol@output! finds
4734 % that the \!\output! request for a page break outside \env{paracol} is
4735 % sneaked into our own \!\output! routine, it makes this macro \!\let!-equal
4736 % to \!\pcol@@combinefloats! in which \LaTeX's version is kept so that
4737 % \LaTeX's original \!\output! routine works perfectly as original.
4738 %
4739 % \item[\Uidx{\!\@cflt!}]
4740 % is an internal macro for \!\output! routine to put all top floats in
4741 % \!\@toplist! and related stuff such as the vertical skip of
4742 % \!\textfloatsep! into \!\@outputbox! together with its old contents being
4743 % the main vertical list and footnotes
4744 % 
4745 % \addtocounter{footnote}{-1}\footnotemark.
4746 % 
4747 % It is used in \!\pcol@combinefloats! if the \colpage{} being processed
4748 % does not have \sync{}ation points.
4749 %
4750 % \item[\Uidx{\!\@cflb!}]
4751 % is an internal macro for \!\output! routine to put all bottom floats in
4752 % \!\@botlist! and related stuff such as the vertical skip of
4753 % \!\textfloatsep! into \!\@outputbox! together with its old contents being
4754 % top floats, the main vertical list and footnotes
4755 % 
4756 % \addtocounter{footnote}{-1}\footnotemark.
4757 % 
4758 % It is used in \!\pcol@combinefloats!.
4759 %
4760 % \item[\Uidx{$\!\@comflelt!\arg{flt}$}]
4761 % is an internal macro for \!\output! routine to put $\arg{flt}$ being a
4762 % \cwise{} top or bottom float to the tail of \!\@tempboxa! which
4763 % finally has all top\slash bottom floats in a column. It is used in
4764 % \!\pcol@cflt! to apply it to each element of \!\@toplist!.
4765 %
4766 % \item[\Uidx{$\!\@comdblflelt!\arg{flt}$}]
4767 % is an internal macro for \!\output! routine to put $\arg{flt}$ being a
4768 % \pwise{} float to the tail of \!\@tempboxa! which finally has the
4769 % \spanning{} for \pwise{} floats. It is used in \!\pcol@startpage! to
4770 % apply to each element of \!\@dbltoplist! to have the \spanning.
4771 %
4772 % \item[\Uidx{\!\@startcolumn!}]
4773 % is an internal macro for \!\output! routine which tries to build a
4774 % \fcolumn{} for the floats in \!\@deferlist! and, if the column
4775 % is not built, tries to move floats to \!\@toplist! and \!\@botlist!. This
4776 % macro is used in \!\pcol@output! to process a sneaked \!\output! request
4777 % from outside of \env{paracol}, and in \!\pcol@output@end! for the case
4778 % \pwise{} floats are left at \Endparacol{} after which they become
4779 % \cwise{} ones.
4780 %
4781 % \item[\Uidx{$\!\@tryfcolumn!\arg{lst}$}]
4782 % is an internal macro for \!\output! routine which examines if a \fcolumn{}
4783 % or a \fpage{} can be built with some floats in $\arg{lst}$ and, if so,
4784 % builds the page in \!\@outputbox! removing floats put in the page from
4785 % $\arg{lst}$. It is used in \!\pcol@startpage! for \pwise{} floats in
4786 % \!\@dbldeferlist!, and in \!\pcol@startcolumn! for \cwise{} floats in
4787 % $\cc_c(\dl)$.
4788 %
4789 % \item[\Uidx{$\!\@scolelt!\arg{flt}$}]
4790 % is an internal macro for \!\output! routine which examines if a
4791 % \cwise{} float $\arg{flt}$ can be added to \!\@toplist! or
4792 % \!\@botlist! being the list of the floats to be put at the top or bottom
4793 % of a page respectively. Then, if the examination succeeds, $\arg{flt}$ is
4794 % added to \!\@toplist! or \!\@botlist!, while it is added to
4795 % \!\@deferlist! otherwise. It is used in \!\pcol@trynextcolumn! to
4796 % apply to each element of (the copy of) $\cc_c(\dl)$.
4797 %
4798 % \item[\Uidx{$\!\@sdblcolelt!\arg{flt}$}]
4799 % is an internal macro for \!\output! routine which examines if a
4800 % \pwise{} float $\arg{flt}$ can be added to \!\@dbltoplist! being the
4801 % list of the floats to be put at the top of a page, and if so, adds
4802 % $\arg{flt}$ to \!\@dbltoplist!, while it is added to \!\@dbldeferlist! or
4803 % \!\@deferlist! depending on \LaTeX's version otherwise as discussed in
4804 % item-(\ref{item:ovv-float-@addtodblcol}) of \secref{sec:imp-ovv-float}.
4805 % It is used in \!\pcol@startpage! to apply to each element of (the copy of)
4806 % \!\@dbldeferlist!.
4807 %
4808 % \item[\Uidx{\!\@addmarginpar!}]
4809 % is an internal macro for \!\output! routine to add a marginal note. Its
4810 % original definition is kept in \!\pcol@@addmarginpar! and used in
4811 % \!\pcol@addmarginpar! being our own \!\@addmarginpar!.
4812 %
4813 % \item[\Uidx{$\!\@makefcolumn!\arg{lst}$}]
4814 % is an internal macro for \!\output! routine to build a \fcolumn{} with
4815 % some floats at the head of a float list $\arg{lst}$ and to remove the
4816 % floats from the list. It is used in \!\pcol@flushcolumn! and
4817 % \!\pcol@iflushfloats! for $\cc_c(\dl)$ of \cwise{} floats, and in
4818 % \!\pcol@output@clear! for \!\@dbldeferlist! of \pwise{} floats.
4819 % \end{description}
4820 %
4821 %
4822 %
4823 % \subsubsection{Structural Macros}
4824 %
4825 % \begin{description}
4826 % \item[\Uidx{$\!\@elt!\<a_1\>\cdots\<a_n\>$}]
4827 % is an internal control sequence to represent a list element having $n$
4828 % sub-elements. The sequence is often made \!\let!-equal to a macro which
4829 % processes $\<a_1\>\cdots\<a_n\>$ and is applied to all members in a list.
4830 % It is also made \!\let!-equal to \!\relax! on a manipulation of a list,
4831 % such as element addition and concatenation, by \!\edef! or \!\xdef!. The
4832 % usages of the sequence are as follows.
4833 % 
4834 % \begin{itemize}
4835 % \item
4836 % \!\pcol@F@count! \!\def!ines \!\@elt! as a macro to increment
4837 % \!\@tempcnta! by one to measure the cardinality of \!\@freelist!.
4838 %
4839 % \item
4840 % \!\pcol@cflt! lets $\!\@elt!=\!\@comflelt!$ for $\cc_c(\tl)$, and then
4841 % $\!\@elt!=\!\relax!$ to concatenate \!\@freelist! and $\cc_c(\tl)$.
4842 %
4843 % \item
4844 % \!\pcol@setpageno! lets $\!\@elt!=\!\pcol@setpnoelt!$ for $\PP$.
4845 %
4846 % \item
4847 % \!\pcol@setpnoelt! and \!\pcol@setmpbelt! let $\!\@elt!=\!\relax!$ to add
4848 % $\pp(q)$ to $\PP$. It also uses \!\@elt! to \!\def!ine \!\pcol@currpage!
4849 % with $\!\@elt!
4850 % \Arg{\pp^p(q)}\<\pp^i(q)\>\<\pp^f(q)\>\~\Arg{\pp^s(p)}\Arg{\pp^m(p)}$.
4851 %
4852 % \item
4853 % \!\pcol@defcurrpage! lets $\!\@elt!=\!\relax!$ to \!\xdef!ine
4854 % \!\pcol@currpage! with
4855 % $\!\@elt!\Arg{\pp^p(q)}\<\pp^i(q)\>\<\pp^f(q)\>\Arg{\pp^s(p)}\Arg{\pp^m(p)}$.
4856 %
4857 % \item
4858 % \!\pcol@nextpage! lets $\!\@elt!=\!\pcol@nextpelt!$ for $\PP$.
4859 %
4860 % \item
4861 % \!\pcol@getcurrpage! lets $\!\@elt!=\!\pcol@getpelt!$ for $\PPP$.
4862 %
4863 % \item
4864 % \!\pcol@startpage! lets $\!\@elt!=\!\@sdblcolelt!$ for (the copy of)
4865 % \!\@dbldeferlist!, and $\!\@elt!=\!\@comdblflelt!$ for \!\@dbltoplist!. It
4866 % also lets $\!\@elt!=\!\relax!$ for the concatenation of \!\@dbldeferlist!
4867 % and \!\@deferlist!, and that of \!\@freelist! and \!\@dbltoplist!.
4868 %
4869 % \item
4870 % \!\pcol@outputcolumns! lets $\!\@elt!=\!\pcol@outputelt!$ with two arguments
4871 % for (the copy of) $\PP$.
4872 %
4873 % \item
4874 % \begin{Sloppy}{2400}%
4875 % \!\pcol@ioutputelt! \!\def!ines \!\pcol@bg@footnoteheight! and
4876 % \!\pcol@bg@float~height! with \!\@elt! to let painting macros add elements
4877 % in them to have the height of the \bground{} regions $\bgr_{\{n,N\}}$ and
4878 % $\bgr_{\{f,F\}}$ to be painted.
4879 % \end{Sloppy}
4880 %
4881 % \item
4882 % \!\pcol@buildcolseprule! lets $\!\@elt!=\!\pcol@buildcselt@S!$ and then
4883 % $\!\@elt!=\!\pcol@buildcselt!$ for $\pp^s(p)$, and then \!\def!ines
4884 % \!\pcol@bg@columnheight! with \!\@elt! to add $H'_n$ and $\!\@maxdepth!$
4885 % or 0 for the \bground{} region $\bgr_{\{c,g\}}^c(n+1)$ where
4886 % $n=\Abs{\pp^s(p)}$.
4887 %
4888 % \item
4889 % \!\pcol@buildcselt@S! \!\def!ines \!\pcol@bg@spanningtop! and
4890 % \!\pcol@bg@spanning~height! with \!\@elt! to define the region
4891 % $\bgr_S(i)$.
4892 %
4893 % \item
4894 % \begin{Hfuzz}{0.55pt}
4895 % \!\pcol@buildcselt! \!\def!ines \!\pcol@bg@columnheight!,
4896 % \!\pcol@bg@spanningtop! and \!\pcol@bg@spanningheight! with \!\@elt! to
4897 % define regions $\bgr_{\{c,g\}}^c(i)$ and $\bgr_s(i)$.
4898 % \end{Hfuzz}
4899 %
4900 % \item
4901 % $\!\pcol@bg@calculate!\arg{z}\arg{z_0}\Arg{F}$ lets
4902 % $\!\@elt!=\!\pcol@bg@advance!$ to let $\!\@elt!\arg{f}$ in $F$ do
4903 % $z\gets z+f$.
4904 %
4905 % \item
4906 % $\!\pcol@bg@negative!\Arg{F^-}$ lets $\!\@elt!=\!\pcol@bg@nadvance!$ to
4907 % let $\!\@elt!\arg{f}$ in $F^-$ do $z\gets z-f$, and then lets
4908 % $\!\@elt!=\!\pcol@bg@advance!$ to go back to addition.
4909 %
4910 % \item
4911 % \!\pcol@output@start! lets all floats $f$ imported in \!\@dbldeferlist!
4912 % have depth 0 by \!\def!ining $\!\@elt!\arg{f}$ to do it, \!\edef!ines
4913 % \!\pcol@bg@textheight! with \!\@elt! having height-plus-depth of
4914 % \preenv{} for \bgpaint{} of it, and \!\def!ines $\pp^m(0)$ having one
4915 % element in $\mpb_L^l$ or $\mpb_L^r$ for \!\@mparbottom! in \preenv{}.
4916 %
4917 % \item
4918 % \!\pcol@makenormalcol! lets $\!\@elt!=\!\relax!$ to concatenate
4919 % \!\@freelist! and \!\@midlist!.
4920 %
4921 % \item
4922 % \!\pcol@trynextcolumn! lets $\!\@elt!=\!\@scolelt!$ for (the copy of)
4923 % $\cc_c(\dl)$.
4924 %
4925 % \item
4926 % \!\pcol@setcurrcol! lets $\!\@elt!=\!\relax!$ to \!\xdef!ine $\cc_c$ with
4927 % $\cc_c(\tl)=\!\@toplist!$, $\cc_c(\ml)=\!\@midlist!$,
4928 % $\cc_c(\bl)=\!\@botlist!$ and $\cc_c(\dl)=\!\@deferlist!$.
4929 %
4930 % \item
4931 % \!\pcol@scancst! and \!\pcol@iscancst! let $\!\@elt!=\!\relax!$ to
4932 % \!\edef!ine the list $M=(m\,\Bar\,\mceltpop_{j,m}\in\cstraw,\;j\geq i)$ for
4933 % $\mceltpop_{i,*}$, and then the latter \!\def!ines \!\@elt! as a macro with
4934 % an argument $m$ to examine $m\in M$ for $\mcelt_{i,m}$.
4935 %
4936 % \item
4937 % \!\pcol@addmarginpar! lets $\!\@elt!=\!\pcol@setmpbelt!$ for $\PPP$.
4938 %
4939 % \item
4940 % \!\pcol@getmparbottom! lets $\!\@elt!=\!\pcol@getmpbelt!$ for the list
4941 % $\mpb_{\{L,R\}}^{\{l,r\}}$. It also lets $\!\@elt!=\!\relax!$ for the
4942 % addition of $\mpar(h_i,t_i)$ to the list by itself and
4943 % \!\pcol@getmpbelt!.
4944 %
4945 % \item
4946 % \!\pcol@mparbottom@zero! has \!\@elt! in its body to have $\mpar(0,0)$ for
4947 % each $M\in\Set{\mpb_X^x}{X\in\{L,R\},x\in\{l,r\}}$ the macro has.
4948 %
4949 % \item
4950 % $\!\pcol@bias@mpbout@i!\Arg{y}\!\@elt!\Arg{t}\Arg{b}\!\@nil!$ has \!\@elt!
4951 % in its argument specification, and \!\def!ines \!\reserved@b! with
4952 % \!\@elt! for $\mpar(t+y,b+y)$.
4953 %
4954 % \item
4955 % \begingroup\def\,{\mskip0mu plus 2mu\relax}
4956 % $\!\pcol@getmparbottom@last@i!\,
4957 % \Arg{y}\,\mpar(t_1,b_1)\,\cdots\,\mpar(t_n,b_n)\,\!\@nil!$ at first
4958 % \!\def!\-ines \!\reserved@b! with \!\@elt! for $\mpar(y,y)$ and then
4959 % \!\def!ines \!\@elt! to do it for $\mpar(t_i,b_i)$ for all $i\in[1,n]$.
4960 % \endgroup
4961 %
4962 % \item
4963 % \!\pcol@makefcolumn! lets $\!\@elt!=\!\pcol@makefcolelt!$ for (the copy
4964 % of) $\cc_c(\dl)$ to examine if each float in it can be put in a \fcolumn{}
4965 % to be built, and then \!\def!ine it to put floats in $\cc_c(\tl)$ into
4966 % $\cc_c(\vb^b)$.
4967 %
4968 % \item
4969 % \!\pcol@addflhd! lets $\!\@elt!=\!\pcol@hdflelt!$ for its argument
4970 % $\cc_c(\tl)$ or $\cc_c(\bl)$, and then $\!\@elt!=\!\relax!$ to give the
4971 % default.
4972 %
4973 % \item
4974 % \!\pcol@makeflushedpage! \!\edef!ines \!\pcol@bg@floatheight! with
4975 % \!\@elt! letting it be \!\relax!.
4976 %
4977 % \item
4978 % \!\pcol@imakeflushedpage! \!\def!ines \!\pcol@bg@footnoteheight! with
4979 % \!\@elt!.
4980 %
4981 % \item
4982 % \!\pcol@output@end! uses \!\@elt! in the argument specification of the
4983 % \!\def!inition of \!\pcol@do@mpbout@elem!, lets $\!\@elt!=\!\relax!$ to
4984 % add the \spanning{} of the last page to the head of \!\@dbldeferlist!, and
4985 % uses it in the body of \!\pcol@bg@textheight! and
4986 % \!\pcol@bg@footnoteheight! to be \!\def!ined for \bgpaint{} of
4987 % \Scfnote{}s.
4988 %
4989 % \item
4990 % \begin{Hfuzz}{0.14pt}%
4991 % \!\pcol@zparacol! lets $\!\@elt!=\!\pcol@remctrelt!$ for $\CG$,
4992 % $\!\@elt!=\!\pcol@thectrelt!$ for $\CTL$, $\!\@elt!=\!\pcol@loadctrelt!$
4993 % for $\Cc_0$, $\!\@elt!=\!\pcol@cmpctrelt!$ for $\CTL$,
4994 % $\!\@elt!=\!\pcol@defcomelt!$ for \!\pcol@localcommands!, and then
4995 % $\!\@elt!=\!\relax!$ to give the default.
4996 % \end{Hfuzz}
4997 %
4998 % \item
4999 % \!\globalcounter!\marg{ctr} defines \!\@elt!\marg{\theta} for $\CG$ to
5000 % check if there is $\theta\in\CG$ such that $\theta=\arg{ctr}$.
5001 %
5002 % \item
5003 % \!\pcol@localcommands! has the sequence of $\!\@elt!\ARg{com}$ for all
5004 % \lcommand{}s $|\|\arg{com}$.
5005 %
5006 % \item
5007 % \!\pcol@gcounters! has \!\@elt!|{page}| as its initial definition.
5008 %
5009 % \item
5010 % $\!\pcol@removecounter!\arg{\Theta'}\arg{\theta}$ lets
5011 % $\!\@elt!=\!\pcol@iremctrelt!$ for (the copy of) its argument
5012 % $\mathit{\Theta}'$ to remove $\theta$ from it.
5013 %
5014 % \item
5015 % $\!\pcol@sscounters!\arg{elt}$ lets $\!\@elt!=\arg{elt}$, where
5016 % $\arg{elt}=\!\pcol@storectrelt!$ or $\arg{elt}=\!\pcol@savectrelt!$, for
5017 % $\CTL$, and then $\!\@elt!=\!\relax!$ to \!\xdef!ine $\Cc_c$.
5018 %
5019 % \item \begingroup\hfuzz1.4pt
5020 % $\!\pcol@com@synccounter!\<\theta\>$ gives $\!\@elt!\Arg{\theta}$ as the
5021 % argument of |\pcol@synccounter|.
5022 % 
5023 % \SpecialIndex{\pcol@synccounter}
5024 % \par\endgroup
5025 %
5026 % \item \begingroup\hfuzz0.51pt
5027 % $\!\pcol@synccounter!\arg{lst}$ lets $\!\@elt!=\!\relax!$ to have the list
5028 % $\arg{lst}$ in \!\reserved@a! by \!\edef!, $\!\@elt!=\!\pcol@loadctrelt!$
5029 % for $\CC_c$, and then $\!\@elt!=\!\pcol@syncctrelt!$ for $\arg{lst}$.
5030 % \par\endgroup
5031 %
5032 % \item
5033 % $\!\pcol@stepcounter!\<\theta\>$ lets $\!\@elt!=\!\pcol@stpldelt!$ for
5034 % $\CTL$, $\!\@elt!=|\pcol@|\~|stpclelt|$
5035 % 
5036 % \SpecialIndex{\pcol@stpclelt}
5037 % 
5038 % for $\clist(\theta)$, and then $\!\@elt!=\!\@stpelt!$ for
5039 % $\clist(\theta)$.
5040 %
5041 % \item
5042 % \!\pcol@switchcol! lets $\!\@elt!=\!\pcol@setctrelt!$ for $\CC_c$,
5043 % $\!\@elt!=|\pcol@|\~|aconlyelt|$
5044 % 
5045 % \SpecialIndex{\pcol@aconlyelt}
5046 % 
5047 % for $\T$, and then $\!\@elt!=\!\relax!$ to give the default.
5048 %
5049 % \item
5050 % \!\pcol@icolumncolor! \!\def!ines $\!\@elt!\arg{\celtshadow_i}$ to apply
5051 % \!\reset@color! for rewinding and \!\pcol@set@color! for reestablishing
5052 % to each $\celtshadow_i\in\CSTshadow^c=(\Celtshadow^c,\cstshadow)$
5053 % by \!\pcol@scancst@shadow!, in which \!\@elt! is explicitly applied to
5054 % $\Celtshadow^c$ if it is defined and then implicitly done to
5055 % $\cstshadow=\!\pcol@colorstack@shadow!$.
5056 %
5057 % \item
5058 % \!\pcol@set@color@push! lets $\!\@elt!=\!\relax!$ to push a color
5059 % information into $\cstshadow$, with save\slash restore of its original
5060 % value.
5061 %
5062 % \item
5063 % \!\resetbackgroundcolor! lets $\!\@elt!=\!\pcol@resetbackgroundcolor!$ to
5064 % scan \!\pcol@bg@defined! containing $\!\@elt!\Arg{a'_i}$ to let
5065 % $|\pcol@bg@color|{\cdot}a'_i$ for each of $i$.
5066 % 
5067 % \SpecialArrayIndex{a}{\pcol@bg@color@}
5068 % \SpecialArrayIndex{a{\cdot}\string\texttt{@}{\cdot}c}{\pcol@bg@color@}
5069 % \end{itemize}
5070 %
5071 % \item[\Uidx{\!\@empty!}]
5072 % is a macro always having nothing. Its major usages are to examine if a
5073 % macro often having a list is empty, and to make such a macro empty. The
5074 % following macros use \!\@empty! to examine the emptiness of the objects in
5075 % parentheses.
5076 % 
5077 % \begin{quote}
5078 % \!\pcol@combinefloats! ($\cc_c(\tl)$, $\cc_c(\bl)$)\\
5079 % \!\pcol@checkshipped! ($S_c$)\\
5080 % \!\pcol@startpage! ($\pp(\ptop)$, \!\@dbltoplist!)\\
5081 % \!\pcol@makenormalcol! (\!\@botlist! in \preenv)\\
5082 % \!\pcol@getmparbottom! ($\pp^m(p)$)\\
5083 % \!\pcol@getmparbottom@last! ($\pp^m(\ptop)$)\\
5084 % \!\pcol@setmpbelt! ($\pp^m(p)$)\\
5085 % \!\pcol@flushcolumn! ($\cc_c(\dl)$)\\
5086 % \!\pcol@makefcolumn! ($\cc_c(\tl)$, $\cc_c(\dl)$)\\
5087 % \!\pcol@measurecolumn! ($\cc_c(\bl),\cc_c(\dl)$)\\
5088 % \!\pcol@addflhd! ($\cc_c(\tl)$, $\cc_c(\bl)$)\\
5089 % \!\pcol@synccolumn! ($\cc_c(\tl)$)\\
5090 % \!\pcol@makeflushedpage! ($\cc_c(\dl)$)\\
5091 % \!\pcol@imakeflushedpage! ($\cc_c(\dl)$)\\
5092 % \!\pcol@iflushfloats! ($\cc_c(\dl)$)\\
5093 % $\!\pcol@setcw@getspec@i!\arg{default}\<x'_d\>$ ($x'_d$)\\
5094 % $\!\pcol@setcw@fill!\<f\>\!\fill!$ ($f$)
5095 % \end{quote}
5096 % 
5097 % The following macros use \!\@empty! to empty the objects in parentheses.
5098 % 
5099 % \begin{quote}
5100 % \!\pcol@cflt! ($\cc_c(\tl)$)\\
5101 % \!\pcol@setpageno! ($\PP$, $\pp(\ptop)$)\\
5102 % \!\pcol@startpage! ($\cc_c(\dl)$, \!\@dbldeferlist!, \!\@deferlist!,
5103 % \!\@dbltoplist!)\\
5104 % \!\pcol@trynextcolumn! ($\cc_c(\dl)$)\\
5105 % \!\pcol@output@start! ($\PP$, $\pp(\ptop)$, $\cc_c(\dl)$)\\
5106 % \!\pcol@makenormalcol! (\!\@midlist! in \preenv)\\
5107 % \!\pcol@addmarginpar! ($\PP$, $\pp(\ptop)$)\\
5108 % \!\pcol@getmparbottom! ($\mpb_{\{L,R\}}^{\{l,r\}}$)\\
5109 % \!\pcol@makefcolumn! ($\cc_c(\dl)$, $\cc_c(\tl)$)\\
5110 % \!\pcol@makeflushedpage! ($\cc_c(\tl)$)\\
5111 % \!\pcol@freshpage! ($\PP$, $\pp(\ptop)$)\\
5112 % \!\pcol@zparacol! (\!\@gtempa!)\\
5113 % \!\pcol@removecounter!$\<\mathit{\Theta}'\>\Arg{\theta}$
5114 % ($\mathit{\Theta}'\in\{\CG,\CL\}$)\\
5115 % \!\pcol@sscounters! ($\Cc_c$)
5116 % \end{quote}
5117 %
5118 % \item[\Uidx{\!\@currentlabel!}]
5119 % is an internal macro to have the reference to be associated with the
5120 % \!\label! following it. It is defined in \!\pcol@fntextbody! to have the
5121 % reference to the footnote with \!\@thefnmark!.
5122 %
5123 % \item[\Uidx{\!\ext@figure!}]
5124 % is an internal macro having ``|lof|'' being the extension of the file for
5125 % list of figures. It is used in
5126 % $\!\pcol@ac@caption!\arg{type}|[|\arg{lcap}|]|\<cap\>$ to have ``|lof|''
5127 % when $\arg{type}=|figure|$.
5128 %
5129 % \item[\Uidx{\!\ext@table!}]
5130 % is an internal macro having ``|lot|'' being the extension of the file for
5131 % list of tables. It is used in
5132 % $\!\pcol@ac@caption!\arg{type}|[|\arg{lcap}|]|\<cap\>$ to have ``|lot|''
5133 % when $\arg{type}=|table|$.
5134 %
5135 % \item[\Uidx{\!\@currbox!}]
5136 % is an internal macro which conventionally has an \!\insert! for floats,
5137 % etc. The following macros use \!\@currbox! having the objects in
5138 % parentheses.
5139 % 
5140 % \begin{quote}
5141 % \!\pcol@opcol! ($\cc_c(\vb)$)\\
5142 % \!\pcol@startpage! ($\pp^i(\ptop)$)\\
5143 % \!\pcol@ioutputelt! ($\s_c(q)$)\\
5144 % \!\pcol@output@start! ($\pp^i(0)$, $\cc_c(\vb)$, $\Celt^c$)\\
5145 % \!\pcol@output@switch! ($\cc_c(\vb)$)\\
5146 % \!\pcol@restartcolumn! ($\cc_c(\vb)$)\\
5147 % \!\pcol@igetcurrcol! ($\cc_c(\vb)$)\\
5148 % \!\pcol@setcurrcol! ($\cc_c(\vb)$)\\
5149 % \!\pcol@putbackmvl! ($\cc_c(\vb)$)\\
5150 % \!\pcol@iscancst! ($\Celt^c$)\\
5151 % \!\pcol@addmarginpar! (left marginal note)\\
5152 % \!\pcol@flushcolumn! ($\cc_c(\vb), \s_c(q)$)\\
5153 % \!\pcol@makefcolumn! ($\cc_c(\vb)$)\\
5154 % \!\pcol@measurecolumn! ($\cc_c(\vb)$)\\
5155 % \!\pcol@synccolumn! ($\cc_c(\vb)$)\\
5156 % \!\pcol@imakeflushedpage! ($\cc_c(\vb)$)\\
5157 % \!\pcol@freshpage! ($\cc_c(\vb)$)\\
5158 % \!\pcol@output@end! (top float, $\cc_c(\vb)$)\\
5159 % \!\pcol@end@dblfloat! (\pwise{} float)\\
5160 % \!\pcol@icolumncolor! ($\Celt^c$)
5161 % \end{quote}
5162 %
5163 % \item[\Uidx{\!\@marbox!}]
5164 % is an internal macro which has an \!\insert! for left marginal notes. It
5165 % is used in \!\pcol@xympar!.
5166 %
5167 % \item[\Uidx{\!\@currlist!}]
5168 % is an internal macro which has an list of \!\insert!s for floats and
5169 % marginal notes given to \!output!. It is used in \!\pcol@addmarginpar! to
5170 % get the right marginal note from its head.
5171 %
5172 % \item[\Uidx{\!\@freelist!}]
5173 % is an internal macro having available \!\insert!s for floats originally,
5174 % but also \colpage{}s, \spanning{}, footnotes and default column-color in
5175 % our usage. Besides the acquisition of an \!\insert! from it shown in the
5176 % description of \!\@next!, it is used by the following macros to return the
5177 % the objects in parentheses to \!\@freelist!.
5178 % 
5179 % \begin{quote}
5180 % \!\pcol@cflt! ($\cc_c(\tl)$)\\
5181 % \!\pcol@startpage! (\!\@dbltoplist!)\\
5182 % \!\pcol@outputelt! ($\pp^i(q)$)\\
5183 % \!\pcol@ioutputelt! ($\pp^i(q)$, $\pp^f(q)$, $\s_c(q)$)\\
5184 % \!\pcol@startcolumn! ($\pp^f(\ptop)$)\\
5185 % \!\pcol@output@start! ($\cc_0(\vb)$)\\
5186 % \!\pcol@makenormalcol! (\!\@midlist! in \preenv)\\
5187 % \!\pcol@restartcolumn! ($\cc_c(\vb)$, $\pp^f(p)$ or $\cc_c(\ft)$)\\
5188 % \!\pcol@savefootins! ($\pp^f(p)$ or $\cc_c(\ft)$)\\
5189 % \!\pcol@flushcolumn! ($\cc_c(\ft)$)\\
5190 % \!\pcol@makefcolpage! ($\cc_c(\tl)$)\\
5191 % \!\pcol@makeflushedpage! ($\pp^i(\ptop)$, $\pp^f(\ptop)$)\\
5192 % \!\pcol@imakeflushedpage! ($\cc_c(\ft)$)\\
5193 % \!\pcol@output@end! ($\pp^f(\ptop)$, $\cc_c(\vb)$, $\Celt^c$)
5194 % \end{quote}
5195 % 
5196 % In addition \!\pcol@F@count! scans its element to have its cardinality.
5197 %
5198 % \item[\Uidx{\!\@nil!}]
5199 % is an internal control sequence which is conventionally used to terminate
5200 % a variable length argument. It is used in the following macros.
5201 % 
5202 % \begin{itemize}
5203 % \item
5204 % \!\pcol@getcurrpinfo! for the invocation of \!\@cdr!.
5205 %
5206 % \item
5207 % $\!\pcol@bias@mpbout@i!\Arg{y}\!\@elt!\Arg{t}\Arg{b}\!\@nil!$ to capture
5208 % $t$ and $b$ following the convention in \!\pcol@do@mpb@all@ii!.
5209 %
5210 % \item
5211 % \begingroup\def\,{\mskip0mu plus 2mu\relax}
5212 % $\!\pcol@getmparbottom@last@i!\,
5213 % \Arg{y}\,\mpar(t_1,b_1)\,\cdots\,\mpar(t_n,b_n)\,\!\@nil!$ to capture
5214 % $\mpar(t_i,b_i)$ for all $i\in[1,n]$.
5215 % \endgroup
5216 %
5217 % \item
5218 % $\!\pcol@do@mpb@all@i!
5219 % \Arg{\mpb_L^l}\Arg{\mpb_L^r}\Arg{\mpb_R^l}\Arg{\mpb_R^r}$ to terminate the
5220 % list $M\in\Set{\mpb_X^x}{X\in\{L,R\},x\in\{l,r\}}$ in the invocation of
5221 % \!\pcol@do@mpb@all@ii!.
5222 %
5223 % \item
5224 % $\!\pcol@do@mpb@all@ii!
5225 % \Arg{y}\mpar(t_1,b_1)\cdots\mpar(t_n,b_n)\!\@nil!$ to capture
5226 % $\mpar(t_i,b_i)$ for all $i\in[1,n]$, and then to terminate them
5227 % passed to \!\pcol@bias@mpbout@i! or \!\pcol@getmparbottom@last!.
5228 %
5229 % \item
5230 % \!\pcol@setcw@scan! for the invocation of\\\mbox{}\qquad
5231 % $\!\pcol@setcw@getspec!\<w'_d\>|/|\<g'_d\>|/|\arg{garbage}\~\!\@nil!$.
5232 %
5233 % \item
5234 % \!\pcol@setcw@getspec@i! for the invocation of\\\mbox{}\qquad
5235 % $\!\pcol@extract@fil!\<n\>| plus |\<f\>| minus|\arg{garbage}\!\@nil!$\\
5236 % and thus in the \!\def!inition of it in \!\pcol@def@extract@fil!.
5237 %
5238 % \item
5239 % \!\pcol@defkw! has \!\@nil! in its argument specification to terminate the
5240 % argument $0\,|pt|\ |plus|\ 1\,|fil|\ |minus|\ 1\,|fil|$.
5241 %
5242 % \item
5243 % \!\pcol@extract@fil@i!, \!\pcol@extract@fil@ii! and
5244 % \!\pcol@extract@fil@iii! have \!\@nil! in their argument specifications as
5245 % the terminator, and thus \!\@nil! appears in their invocations in
5246 % \!\pcol@extract@fil!, \!\pcol@extract@fil@i! and \!\pcol@extract@fil@ii!
5247 % respectively, and in the \!\def!inition of \!\pcol@extract@fil@iii! in
5248 % \!\pcol@def@extract@fil@iii!.
5249 %
5250 % \item
5251 % \!\pcol@iadjustfnctr! and \!\pcol@iifootnotetext! to terminate their
5252 % argument |[|$[|+-|]\meta{disp}$|]| passed to \!\pcol@calcfnctr!.
5253 %
5254 % \item
5255 % \!\backgroundcolor! and \!\nobackgroundcolor! to terminate their first
5256 % argument given to \!\pcol@backgroundcolor! so that its descendants
5257 % \!\pcol@backgroundcolor@x! and \!\pcol@backgroundcolor@z! finally capture
5258 % everything not processed by their ancestors.
5259 % \end{itemize}
5260 %
5261 % \item[\Uidx{\!\current@color!}]
5262 % is an internal macro having color information to be put into |.dvi| as a
5263 % part of the argument of coloring \!\special!. It is referred to by
5264 % \!\pcol@bg@paintregion@i!,
5265 % \!\pcol@output@start!,
5266 % \!\pcol@icolumncolor!,
5267 % \!\pcol@iicolumncolor!, and
5268 % \!\pcol@set@color@push!,
5269 % \!\pcol@backgroundcolor@y!.
5270 %
5271 % \item[\Uidx{\!\@dbldeferlist!}]
5272 % is an internal macro having the list of \pwise{} floats whose page
5273 % appearance are not yet fixed. It is scanned and then updated in
5274 % \!\pcol@startpage! and \!\pcol@output@clear!, while \!\pcol@output@start!
5275 % lets it have \!\@deferlist! made before \beginparacol, and
5276 % \!\pcol@output@end! adds \pwise{} floats to be put in the empty
5277 % \lpage{} to it and then move the whole of the list to \!\@deferlist!.
5278 % As discussed in \secref{sec:imp-ovv-float}, 2015 or later version of
5279 % \LaTeX{} no longer uses this list, but we stick with it for \pwise{}
5280 % floats produced in \env{paracol} environments and thus have its top level
5281 % definition with empty body in \Paracol.
5282 %
5283 % \item[\Uidx{\!\@dbltoplist!}]
5284 % is an internal macro having the list of \pwise{} floats which
5285 % \!\@sdblcolelt! decided to be put in the new page. The macro
5286 % \!\pcol@startpage! scans it to put all floats into the page $\ptop$ as its
5287 % \spanning{} $\pp^i(\ptop)$, and then empties it after returning all floats
5288 % to \!\@freelist!.
5289 %
5290 % \item[\Uidx{\!\@deferlist!}]
5291 % is an internal macro having the list of \cwise{} floats whose page
5292 % appearance are not yet fixed. It is scanned and then updated in
5293 % \!\pcol@startcolumn!, \!\pcol@trynextcolumn!, \!\pcol@flushcolumn!,
5294 % \!\pcol@makefcolumn! and \!\pcol@iflushfloats!, while the following macros
5295 % also act on it.
5296 % 
5297 % \begin{itemize}
5298 % \item
5299 % \!\pcol@output@start! moves it to \!\@dbldeferlist! because it is created
5300 % before \beginparacol.
5301 %
5302 % \item
5303 % \!\pcol@startpage! uses it as the interface with \!\@addtodblcol! of 2015
5304 % or later version of \LaTeX{} as discussed in
5305 % item-(\ref{item:ovv-float-@addtodblcol}) of
5306 % \secref{sec:imp-ovv-float}.
5307 %
5308 % \item
5309 % \!\pcol@setcurrcol! and \!\pcol@igetcurrcol! saves\slash restores it
5310 % into/from $\cc_c(\dl)$, respectively.
5311 %
5312 % \item
5313 % \!\pcol@makefcolelt!$\arg{flt}$ returns $\arg{flt}$ to the list if
5314 % $\arg{flt}$ cannot be put in the \fcolumn{} which the macro is working on.
5315 %
5316 % \item
5317 % \!\pcol@measurecolumn! examines its emptiness to let
5318 % $\CSIndex{ifpcol@dfloats}=\true$ iff not empty.
5319 %
5320 % \item
5321 % \!\pcol@output@end! lets it have \!\@dbldeferlist! so that it processed as
5322 % \cwise{} floats after \Endparacol.
5323 % \end{itemize}
5324 %
5325 % \item[\Uidx{\!\@toplist!}]
5326 % is an internal macro having the list of \cwise{} floats which is
5327 % decided to be put at the top of the \ccolpage{} by float environments or by
5328 % \!\pcol@trynextcolumn!. This list is scanned by \!\pcol@cflt! if its
5329 % invoker \!\pcol@combinefloats! finds the macro is not empty. The list is
5330 % also scanned by \!\pcol@makecol!, \!\pcol@output@switch! and
5331 % \!\pcol@measurecolumn! using \!\pcol@addflhd! for the measurement of the
5332 % combined size of top floats, while \!\pcol@setcurrcol! and
5333 % \!\pcol@igetcurrcol! saves\slash restores the list into/from $\cc_c(\tl)$
5334 % respectively. In addition our macros may add an element or build the
5335 % entire list in the following two cases. One case is for a \sync{}ation
5336 % for which \!\pcol@synccolumn! lets the main vertical list in
5337 % $\cc_c(\vb^b)$ be a float, namely {\em\mvlfloat} to be added to this list.
5338 % Another case is for a \fcolumn{} in the \lpage{} for which
5339 % \!\pcol@makefcolumn! and \!\pcol@makefcolelt! build this list for deferred
5340 % floats. In the latter case, the list is scanned by \!\pcol@makefcolpage!
5341 % invoked from \!\pcol@makefcolumn! itself, \!\pcol@flushcolumn! and
5342 % \!\pcol@makeflushedpage!.
5343 %
5344 % \item[\Uidx{\!\@botlist!}]
5345 % is an internal macro having the list of \cwise{} floats which is
5346 % decided to be put at the bottom of the \ccolpage{} by float environments or
5347 % by \!\pcol@trynextcolumn!. The emptiness of this list examined by
5348 % \!\pcol@combinefloats! to invoke the scanner \!\@cflb! unless empty,
5349 % by \!\pcol@output@start! to calculate the room for each \colpage{} in the
5350 % \spage, and by \!\pcol@makenormalcol! to decide whether \!\@makecol! is
5351 % used or not for building \preenv. The list is also scanned by
5352 % \!\pcol@measurecolumn! for the measurement of the combined size of bottom
5353 % floats, while \!\pcol@setcurrcol! and \!\pcol@igetcurrcol! saves\slash
5354 % restores the list into/from $\cc_c(\bl)$ respectively.
5355 %
5356 % \item[\Uidx{\!\@midlist!}]
5357 % is an internal macro having the list of in-text floats which has already
5358 % been put in the \ccolpage{} but is kept to check the ordering of the
5359 % succeeding floats. The list is emptied by \!\pcol@makenormalcol! after
5360 % returning all elements in it to \!\@freelist!, while \!\pcol@setcurrcol!
5361 % and \!\pcol@igetcurrcol! saves\slash restores the list into/from
5362 % $\cc_c(\ml)$ respectively.
5363 %
5364 % \item[\Uidx{\!\f@depth!}]
5365 % is an internal macro having |1sp| or being \!\let!-equal to \!\z@! to
5366 % specify the float category, \pwise{} or \cwise{} respectively, which
5367 % float-related macros work on. As discussed in
5368 % item-(\ref{item:ovv-float-@dblfloatplacement}) of
5369 % \secref{sec:imp-ovv-float}, this feature introduced in 2015 version
5370 % of \LaTeX{} is nullified in \env{paracol} environments and thus the
5371 % setting with |1sp| done by \!\@dblfloatplacement! is overridden by
5372 % \!\pcol@startpage! and \!\pcol@output@clear! when they invoke the macro.
5373 %
5374 % \item[\Uidx{\!\cl@@ckpt!}]
5375 % is an internal macro having the list of all counters defined by
5376 % \!\newcounter! and the counter \counter{page}. The original usage of this
5377 % macro is to log the values of all counters into |.aux| by \!\include!, but
5378 % we use it to obtain all counters in \!\pcol@zparacol! and
5379 % \!\pcol@globalcounter@s!.
5380 %
5381 % \item[$\cs{cl@}{\cdot}\theta$]
5382 % is an internal macro having the list $\clist(\theta)$ of descendant
5383 % counters of the counter $\theta$ whose increment by \!\stepcounter! lets
5384 % them 0. The macro \!\pcol@remctrelt! moves it to
5385 % $|\pcol@cl@|{\cdot}\theta$
5386 % 
5387 % \Uidx{\SpecialArrayIndex{\theta}{\cl@}}
5388 % 
5389 % and re\!\def!ines it to have $\!\pcol@stepcounter!\Arg{\theta}$.
5390 %
5391 % \item[\Uidx{\!\reserved@a!}]
5392 % is an internal macro for temporary use. Its usages are as follows.
5393 % 
5394 % \begin{itemize}
5395 % \item
5396 % In \!\pcol@Fe!, it is used to keep the cardinality of \!\@freelist! in
5397 % \!\pcol@F@n! to log it by \!\pcol@FF! after \!\pcol@F@n! is let have
5398 % another measurement result.
5399 %
5400 % \item
5401 % In $\!\pcol@iLogLevel!\<l\>\arg{name}$, it is used to implement
5402 % $\!\let!|\|\arg{name}=|\|\arg{name}{\cdot}l'$ where $l'$ is the roman
5403 % representation of the level $l$.
5404 %
5405 % \item
5406 % In \!\pcol@setpageno!, it has $\PPP$ so that we update $\PP$ and
5407 % $\pp(\ptop)$ scanning their original contents.
5408 %
5409 % \item
5410 % In \!\pcol@getcurrpinfo!, it has $\pp(\ptop)$ so that we give its five
5411 % components to \!\pcol@getpinfo! as its first five arguments.
5412 %
5413 % \item
5414 % In \!\@outputpage!, it has a sequence of \bgpaint{} for both left and
5415 % right \parapag{}es to be shipped out outside \env{paracol} environment.
5416 %
5417 % \item
5418 % In \!\pcol@outputpage@ev!, it has the expansion result of
5419 % \!\meaning!\!\yoko! to be compared with \!\reserved@b! having
5420 % \!\string!\!\yoko! for examining if \!\yoko! is a primitive of underlying
5421 % \TeX{}.
5422 %
5423 % \item
5424 % In $\!\pcol@bg@paintregion!\arg{a}\arg{c}$, it is let have
5425 % $a'=a{\cdot}|@|{\cdot}c$ or $a'=a$, and then referred to by
5426 % \!\pcol@bg@paintregion@i! to use $|\pcol@bg@color|{\cdot}a'$, and by
5427 % $\!\pcol@bg@addext!\arg{z}\Arg{s}\Arg{d}$ to use
5428 % $|\pcol@bg@ext@|{\cdot}d{\cdot}|@|{\cdot}a'$.
5429 % 
5430 % \SpecialArrayIndex{a{\cdot}\string\texttt{@}{\cdot}c}{\pcol@bg@color@}
5431 % \SpecialArrayIndex{a}{\pcol@bg@color@}
5432 % \SpecialArrayIndex{d{\cdot}\string\texttt{@}
5433 % {\cdot}a{\cdot}\string\texttt{@}{\cdot}c}{\pcol@bg@ext@}
5434 % \SpecialArrayIndex{d{\cdot}\string\texttt{@}{\cdot}a}{\pcol@bg@ext@}
5435 %
5436 % \item
5437 % In \!\pcol@specialoutput!, it is \!\let!-equal to $|\pcol@output@|{\cdot}f$
5438 % corresponding to $\!\outputpenalty!=|\pcol@op@|{\cdot}f$, or
5439 % \!\@specialoutput!.
5440 %
5441 % \item
5442 % In \!\pcol@output@start!, it is let have a \bgpaint{} macro
5443 % \!\pcol@bg@paintbox! and the definition of a parameter
5444 % \!\pcol@bg@textheight! for it.
5445 %
5446 % \item
5447 % In \!\pcol@output@switch!, it is \!\let!-equal to \!\@nobreaktrue! or
5448 % \!\@nobreakfalse! according to \CSIndex{if@nobreak} in the leaving column
5449 % to broadcast it to other columns.
5450 %
5451 % \item
5452 % In \!\pcol@ifempty!$\arg{box}\arg{then}\arg{else}$, it has $\arg{then}$ or
5453 % $\arg{else}$ according to the emptiness of $\arg{box}$.
5454 %
5455 % \item
5456 % In \!\pcol@clearcolorstack!, it is \!\def!ined to put an uncoloring
5457 % \!\special! by \!\reset@color! for its argument $\celt_i$ in
5458 % \!\pcol@iscancst!.
5459 %
5460 % \item
5461 % In \!\pcol@restorecst!, it is \!\def!ined to put a coloring \!\special! in
5462 % its argument $\celt_i$ by \!\unvbox! done in \!\pcol@iscancst!.
5463 %
5464 % \item
5465 % In \!\pcol@addmarginpar!, at first it is made let equal to 0 or $\CL$
5466 % according to $c<\CL$ or not. Then it is let have $\PPP$ to be scanned to
5467 % find $\pp^m(p)$.
5468 %
5469 % \item
5470 % In \!\pcol@getmparbottom@i!, it is let have one of
5471 % $\mpb_{\{L,R\}}^{\{l,r\}}$ according to the side margin which the marginal
5472 % note to be added goes to, and then it is referred to by
5473 % \!\pcol@getmparbottom!.
5474 %
5475 % \item
5476 % In \!\pcol@setmpbelt@i!, it is let have what $\pp^m(p)$ should have after
5477 % the update of a list of marginal notes in it, and then \!\pcol@setmpbelt!
5478 % updates $\pp(p)$ with the new $\pp^m(p)$ in the macro.
5479 %
5480 % \item
5481 % In $\!\pcol@bias@mpbout!\Arg{y}$ and $\!\pcol@getmparbottom@last!\Arg{y}$,
5482 % it is let have $\!\pcol@bias@mpbout@i!\Arg{y}$ and
5483 % $\!\pcol@getmparbottom@last@i!\Arg{y}$ respectively, so that they are
5484 % invoked in \!\pcol@do@mpb@all@ii!.
5485 %
5486 % \item
5487 % In \!\pcol@makeflushedpage!, it is let have an invocation of
5488 % \!\pcol@bg@paintbox! for \pwise{} floats in $\pp^i(\ptop)$ together with
5489 % the condition of the \bgpaint.
5490 %
5491 % \item
5492 % In \!\pcol@output@end!, it is let have the invocation of
5493 % \!\pcol@bg@paintbox! for \bgpaint{} of \Scfnote{}s with the condition to
5494 % do it and a \!\def!inition of \!\pcol@bg@footnoteheight!.
5495 %
5496 % \item
5497 % In $\!\pcol@defcomelt!\arg{com}$, it is used to implement
5498 % $\!\let!|\|\arg{com}=|\pcol@com@|{\cdot}\~\arg{com}$.
5499 %
5500 % \item
5501 % In \!\pcol@setcolumnwidth!, it is made \!\let!-equal to
5502 % \!\pcol@setcolwidth@s! or \!\pcol@setcolwidth@r! according to
5503 % $\!\pcol@columnratioleft!=\!\relax!$ or not.
5504 %
5505 % \item
5506 % In \!\pcol@setcolwidth@r!, it is used to have the fraction $r_d$ being a
5507 % comma-separated list element in its argument $\arg{ratio}$ defined by
5508 % \!\columnratio! and scanned by a \!\@for! loop.
5509 %
5510 % \item
5511 % In $\!\pcol@setcw@scan!\<\Cfrom\>\<\Cto\>\Arg{spec}$, at first it is let
5512 % have $\arg{spec}$, then the result of adding `|,|' as many as
5513 % $\Cto-\Cfrom$ to the tail, and finally each element in the extended
5514 % $\arg{spec}$ in a \!\@for! loop.
5515 %
5516 % \item
5517 % In $\!\pcol@setcw@getspec@i!\arg{default}\<x'_d\>$, it is let have
5518 % $\<x'_d\>$ from which all space tokens are removed.
5519 %
5520 % \item
5521 % In \!\pcol@setcw@calcfactors!, it is used as a waste basket to throw away
5522 % $(\WT-W)/(F\times1\,|pt|)$ calculated by \!\pcol@setcw@calcf!.
5523 %
5524 % \item
5525 % In $\!\pcol@extract@fil@i!\<n\>|.|\<m{\cdot}\mathit{unit}\>\!\@nil!$, it has
5526 % $\<n\>|.|\<m{\cdot}\mathit{unit}\>$, and is referred to by
5527 % \!\pcol@extract@fil@ii!.
5528 %
5529 % \item
5530 % In \!\globalcounter!\marg{ctr}, it is used to have $\arg{ctr}$ for the
5531 % \CSIndex{ifx}-comparison with each $\theta\in\CG$.
5532 %
5533 % \item
5534 % In $\!\pcol@remctrelt!\<\theta\>$, it is used to implement
5535 % $\!\let!|\pcol@cl@|{\cdot}\theta=|\cl@|{\cdot}\theta$,
5536 % 
5537 % \SpecialArrayIndex{\theta}{\pcol@cl@}\SpecialArrayIndex{\theta}{\cl@}
5538 %
5539 % \item
5540 % In $\!\pcol@removecounter!\<\mathit{\Theta}'\>\Arg{\theta}$, it is used to
5541 % have $\theta$ for the \CSIndex{ifx}-comparison in \!\pcol@iremctrelt!.
5542 %
5543 % \item
5544 % In $\!\pcol@thectrelt!\<\theta\>$, it is used to implement
5545 % $\!\let!|\pcol@thectr@|{\cdot}\theta=|\the|{\cdot}\theta$,
5546 % 
5547 % \SpecialArrayIndex{\theta}{\pcol@thectr@}\SpecialArrayIndex{\theta}{\the}
5548 % 
5549 % and then is made \!\let!-equal to $|\pcol@thectr@|{\cdot}\theta{\cdot}0$.
5550 % 
5551 % \SpecialArrayIndex{\theta{\cdot}c}{\pcol@thectr@}
5552 %
5553 % \item
5554 % In $\!\pcol@synccounter!\arg{lst}$, it has $\arg{lst}$.
5555 %
5556 % \item
5557 % In $\!\pcol@setctrelt!\<\theta\>\<\val_c(\theta)\>$, it is made
5558 % \!\let!-equal to $|\pcol@thectr@|{\cdot}\theta$
5559 % 
5560 % \SpecialArrayIndex{\theta}{\pcol@thectr@}
5561 % 
5562 % or
5563 % $|\pcol@thectr@|{\cdot}\theta{\cdot}c$.
5564 % 
5565 % \SpecialArrayIndex{\theta{\cdot}c}{\pcol@thectr@}
5566 %
5567 % \item
5568 % In \!\pcol@switchenv!, it is used to save \!\switchcolumn! which is
5569 % redefined in the macro, and then to invoke \!\switchcolumn! with the
5570 % original definition.
5571 %
5572 % \item
5573 % In \!\pcol@fntext!\marg{text}, it is \!\let!-equal to \!\pcol@fntextother!
5574 % or \!\pcol@fntext~top! according to the footnote $\arg{text}$ is deferred
5575 % or not.
5576 %
5577 % \item
5578 % \begin{Hfuzz}{0.6pt}%
5579 % In \!\pcol@calcfnctr!$\arg{num}$\!\@nil!, it has the first token of
5580 % $\arg{num}$ for \CSIndex{ifx}-comparison with `|+|' and `|-|'.
5581 % \end{Hfuzz}
5582 %
5583 % \item
5584 % In $\!\pcol@twosided!|[|T|]|$, it is let have each non-space token in $T$
5585 % given by a \!\@tfor! loop.
5586 % \end{itemize}
5587 %
5588 % \item[\Uidx{\!\reserved@b!}]
5589 % is an internal macro for temporary use. It is used in the following
5590 % macros to keep a list shown in parentheses so that we update the list in
5591 % the scan of list elements.
5592 % 
5593 % \begin{quote}
5594 % \!\pcol@startpage! (\!\@dbldeferlist!)\\
5595 % \!\pcol@outputcolumns! ($\PP$)\\
5596 % \!\pcol@trynextcolumn! ($\cc_c(\dl)$)\\
5597 % \!\pcol@makefcolumn! ($\cc_c(\dl)$)\\
5598 % \!\pcol@removecounter!$\<\mathit{\Theta}'\>\Arg{\theta}$
5599 % ($\mathit{\Theta}'\in\{\CG,\CC\}$)
5600 % \end{quote}
5601 % 
5602 % In addition, it is used in the following macros.
5603 % 
5604 % \begin{itemize}
5605 % \item
5606 % In \!\pcol@outputpage@ev!, it has the expansion result of
5607 % \!\string!\!\yoko! to be compared with \!\reserved@a! having
5608 % \!\meaning!\!\yoko! for examining if \!\yoko! is a primitive of underlying
5609 % \TeX{}.
5610 %
5611 % \item
5612 % In \!\pcol@bg@paint@ii!, it has a token in the arguments $K_b$, $K_g$ and
5613 % $K_c$ of the macro scanned by \!\@tfor!.
5614 %
5615 % \item
5616 % In \!\pcol@output@switch!, it is \!\let!-equal to |\@afterindenttrue| or
5617 % \cs{@after\BB indent\BB false} according to \CSIndex{if@afterindent} in the
5618 % leaving column to broadcast it to other columns.
5619 %
5620 % \item
5621 % In \!\pcol@clearcolorstack!, it is \!\def!ined to put an uncoloring
5622 % \!\special! by \!\reset@color! for its argument $\Celt^c$ in
5623 % \!\pcol@scancst!.
5624 %
5625 % \item
5626 % In \!\pcol@restorecst!, it is \!\def!ined to put a coloring \!\special! in
5627 % its argument $\Celt^c$ by \!\unvcopy! done in \!\pcol@scancst!.
5628 %
5629 % \item
5630 % In \!\pcol@scancst! and \!\pcol@iscancst!, after the reference for the
5631 % purposes shown in the two items above, it has
5632 % $M=(m\,\Bar\,\mceltpop_{j,m}\in\cstraw,\;j\geq i)$ for $\mceltpop_{i,*}$
5633 % and in the latter is scanned to find $m$ for $\mcelt_{i,m}$ in $M$.
5634 %
5635 % \item
5636 % In \!\pcol@addmarginpar!, it is made let equal to $\CL$ or $\C$
5637 % according to $c<\CL$ or not.
5638 %
5639 % \item
5640 % In $\!\pcol@bias@mpbout@i!\Arg{y}\!\@elt!\Arg{t}\Arg{b}\!\@nil!$, it is
5641 % let have $\mpar(t+y,b+y)$, and in $\!\pcol@getmparbottom@last@i!
5642 % \Arg{y}\mpar(t_1,b_1)\cdots\mpar(t_n,b_n)\!\@nil!$ it is let have
5643 % $\mpar(y,y)$ or $\mpar(t_n,b_n)$, so that they are let be a
5644 % $\mpb_{\{L,R\}}^{\{l,r\}}$ by \!\pcol@do@mpb@all@ii!.
5645 %
5646 % \item
5647 % In $\!\pcol@setcw@getspec@i!\arg{default}\<x'_d\>$, it is let have each
5648 % non-space token in $\<x'_d\>$ to remove space tokens from it.
5649 %
5650 % \item
5651 % In $\!\pcol@setcw@fill!\<f\>\!\fill!$, it is let have $f$.
5652 %
5653 % \item
5654 % In $\!\pcol@extract@fil@ii!\arg{unit}\!\@nil!$, it is let have
5655 % $\arg{unit}$.
5656 %
5657 % \item
5658 % In \!\globalcounter!$\Arg{\theta}$, it has $\cg_i\in\CG$ for
5659 % \CSIndex{ifx}-comparison with $\theta$.
5660 %
5661 % \item
5662 % In $\!\pcol@iremctrelt!\<\mathit{\Theta}'\>\Arg\theta$, it has $\theta$ for
5663 % \CSIndex{ifx}-comparison with $\theta'$ to be removed from $\CG$ or $\CC$.
5664 %
5665 % \item
5666 % In \!\pcol@calcfnctr!$\arg{num}$\!\@nil!, it has `|+|' and then `|-|' for
5667 % \CSIndex{ifx}-comparison with the first token of $\arg{num}$.
5668 %
5669 % \item
5670 % In \!\pcol@backgroundcolor@ii!, it has \!\pcol@backgroundcolor@x! or
5671 % \!\pcol@back~ground~color@z! according that the region of \bgpaint{} and its
5672 % color is defined or undefined.
5673 % \end{itemize}
5674 %
5675 % \item[\Uidx{\!\reserved@c!}]
5676 % is an internal macro for temporary use. It is used in \!\pcol@startpage!
5677 % to save \!\@deferlist! in it and then to restore the list from it, and in
5678 % \!\pcol@iscancst! to have \!\relax! or the macro itself to iterate the
5679 % macro recursively.
5680 %
5681 % \item[\Uidx{\!\reserved@d!}]
5682 % is an internal macro for temporary use. It is used in
5683 % \!\pcol@iscancst! as a \!\chardef! register to have 0 if $m$ for
5684 % $\mcelt_{i,m}$ is not in the list
5685 % $M=(n\,\Bar\,\mceltpop_{j,n}\in\cstraw,\;j\geq i)$, or 1 if found.
5686 %
5687 % \item[\Uidx{\!\@gtempa!}]
5688 % is an internal macro used as a \!\global!ly modifiable scratchpad. Its
5689 % usages are as follows.
5690 % 
5691 % \begin{itemize}
5692 % \item
5693 % In \!\pcol@ifempty!$\arg{box}\arg{then}\arg{else}$, it has \!\lastpenalty!
5694 % in a \!\vbox! whose value is examined outside the \!\vbox! for the
5695 % emptiness check of $\arg{box}$.
5696 %
5697 % \item
5698 % In \!\pcol@addmarginpar!, it is given to \!\@xnext! as the target to have
5699 % the second and successive elements of \!\@currlist! which we cannot modify.
5700 %
5701 % \item
5702 % In \!\pcol@zparacol! and \!\pcol@cmpctrelt!, it has the list of counters
5703 % to be synchronized.
5704 %
5705 % \item
5706 % In $\!\pcol@setcw@getspec@i!\arg{default}\<x'_d\>$, it is made
5707 % \!\@empty! or \!\relax! according to $x'_d$ has \!\fill! or not.
5708 %
5709 % \item
5710 % In \!\pcol@storectrelt!, \!\pcol@savectrelt! and \!\pcol@sscounters!, it
5711 % has the new version of $\CC_c$.
5712 % \end{itemize}
5713 % \end{description}
5714 %
5715 %
5716 %
5717 %\iffalse
5718 %<*paracol>
5719 %\fi
5720 %
5721 % \section{Register Declaration}
5722 % \label{sec:imp-decl}
5723 %
5724 % \subsection{\cs{count} Registers}
5725 %
5726 % Here we declare registers and switches. The first group is for \!\count!
5727 % registers.
5728 % 
5729 % \begin{macro}{\pcol@currcol}
5730 % \changes{v1.2-1}{2013/05/11}
5731 % {Add initialization to 0 after the declaration.}
5732 % 
5733 % The register \!\pcol@currcol! has the zero-origin ordinal $c$ of the
5734 % column which we were in when \!\output! is invoked. Therefore, for
5735 % example, in the process of \!\switchcolumn!, the register has $c$ from
5736 % which we are switching to another column. The register is initialized to
5737 % be 0 by \!\pcol@output@start!, and then set to $\!\pcol@nextcol!=d$ by
5738 % \!\pcol@restartcolumn! to switch to (or stay in) $d$. Note that these two
5739 % assignments are \!\global! while other macros may {\em locally} use the
5740 % register to, for example, scan all columns $c\In0\C$. Besides two macros
5741 % above, the following macros refer to the register to know which column we
5742 % are in (or which column is processed by their invokers).
5743 % 
5744 % \begin{quote}\raggedright
5745 % \!\pcol@Log@iii!,
5746 % \!\pcol@Log@ii!,
5747 % \!\pcol@FF!,
5748 % \!\pcol@makecol!,
5749 % \!\pcol@opcol!,
5750 % \!\pcol@bg@columnleft!,
5751 % \!\pcol@bg@columnwidth!,
5752 % \!\pcol@bg@columnsep!,
5753 % \!\pcol@output@switch!,
5754 % \!\pcol@getcurrcol!,
5755 % \!\pcol@setcurrcol!,
5756 % \!\pcol@clearcolorstack!,
5757 % \!\pcol@restorecolorstack!,
5758 % \!\pcol@addmarginpar!,
5759 % \!\pcol@getmparbottom@i!,
5760 % \!\pcol@setmpbelt@i!,
5761 % \!\pcol@invokeoutput!\footnote{
5762 % 
5763 % Only for logging.},
5764 % 
5765 % \!\thecolumn!,
5766 % \!\pcol@sscounters!,
5767 % \!\pcol@setctrelt!,
5768 % \!\pcol@com@switchcolumn!,
5769 % \!\pcol@switchcol!,
5770 % \!\pcol@visitallcols!,
5771 % \!\pcol@aconlyelt!,
5772 % \!\pcol@flushclear!.
5773 % \!\pcol@columncolor!,
5774 % \!\normalcolumncolor!,
5775 % \!\pcol@icolumncolor!,
5776 % \end{quote}
5777 % 
5778 % Among the macros above, \!\columncolor! and \!\normalcolumncolor! could
5779 % refer to the register outside \env{paracol} environment and thus before
5780 % the initialization by \!\pcol@output@start!. Therefore, the register is
5781 % also initialized to be 0 after its declaration to assure safe reference.
5782 %
5783 % The following macros use the register for the scan of all $c\In0\C$ by
5784 % themselves or their invokers.
5785 % 
5786 % \begin{quote}\raggedright
5787 % \!\pcol@output@start!,
5788 % \!\pcol@output@switch!,
5789 % \!\pcol@sync!,
5790 % \!\pcol@flushcolumn!,
5791 % \!\pcol@measurecolumn!,
5792 % \!\pcol@synccolumn!,
5793 % \!\pcol@makeflushedpage!,
5794 % \!\pcol@flushfloats!,
5795 % \!\pcol@freshpage!,
5796 % \!\pcol@output@end!,
5797 % \!\pcol@synccounter!,
5798 % \!\pcol@com@syncallcounters!,
5799 % \!\pcol@stepcounter!.
5800 % \end{quote}
5801 % 
5802 % The macros \!\pcol@imakeflushedpage! and \!\pcol@iflushfloats! also use
5803 % the register for scanning but for $\LBRP\Cfrom\Cto$ given by their
5804 % arguments.
5805 %
5806 % In addition \!\pcol@ccuse!, \!\pcol@ifccdefined! and \!\pcol@ccxdef!
5807 % refer to the register to have the control sequence
5808 % $|\pcol@columncolor|\cdot c=\Celtshadow^c$ or
5809 % $|\pcol@columncolor@box|\cdot c=\Celt^c$ where $c$ is for the current
5810 % column or for all columns depending on their invokers.
5811 % 
5812 % \SpecialArrayIndex{c}{\pcol@columncolor}
5813 % \SpecialArrayIndex{c}{\pcol@columncolor@box}
5814 % \end{macro}
5815 % 
5816 % \begin{macro}{\pcol@nextcol}
5817 % The register \!\pcol@nextcol! has the zero-origin ordinal $d$ of the
5818 % column to which we are switching, or in which we are staying, to be set
5819 % into \!\pcol@currcol! by \!\pcol@restartcolumn!. The main usage of the
5820 % register is to set the switching target in \!\pcol@switchcolumn!, but
5821 % other macros use it to specify the (temporary) target of
5822 % \!\pcol@switchcol!; the tallest column in \!\pcol@sync!; 0 in
5823 % \!\pcol@zparacol!, \!\pcol@sptext! and \!\endparacol!; all in $\LBRP0\C$
5824 % but $c=\!\pcol@currcol!$ in \!\pcol@visitallcols!; and $c$ in
5825 % \!\pcol@flushclear! to stay in the current column $c$. The other user of
5826 % this register is \!\pcol@invokeoutput! but only for logging.
5827 % \end{macro}
5828 % 
5829 % \begin{macro}{\pcol@ncol}
5830 % \changes{v1.3-3}{2013/09/17}
5831 % {Add initial zero-clearing for safe reference in \cs{@outputpage}
5832 % invoked prior to the first \string\texttt{paracol}.}
5833 % \begin{macro}{\pcol@ncolleft}
5834 % \changes{v1.3-2}{2013/09/17}
5835 % {Introduced to specify the number of columns in left
5836 % parallel-pages.}
5837 % 
5838 % The register \!\pcol@ncol! has the number of columns $\C$ given as the
5839 % argument of \!\paracol!, whose callee \!\pcol@zparacol! being the sole
5840 % modifier of the register \!\global!ly assigns $C$ to the register to give
5841 % safe reference to \!\@outputbox! invoked after a \env{paracol} is closed.
5842 % In addition for the reference in \!\@outputbox! before the first
5843 % \env{paracol}, the register is initialized with zero after the declaration.
5844 %
5845 % The following macros refer to the register to scan all columns $c\In0\C$.
5846 % 
5847 % \begin{quote}\raggedright
5848 % \!\pcol@checkshipped!,
5849 % \!\pcol@output@start!,
5850 % \!\pcol@output@switch!,
5851 % \!\pcol@sync!,
5852 % \!\pcol@makeflushedpage!,
5853 % \!\pcol@freshpage!,
5854 % \!\pcol@output@end!,
5855 % \!\pcol@synccounter!,
5856 % \!\pcol@com@syncallcounters!,
5857 % \!\pcol@stepcounter!,
5858 % \!\pcol@visitallcols!.
5859 % \end{quote}
5860 % 
5861 % The register \!\pcol@ncolleft! has $\Uidx\CL$ being the number of columns
5862 % in the left {\em\Uidx\parapag{}e} if \parapag{}ing is in effect, or have
5863 % $\C$ otherwise. Similar to $\C$, the number $\CL$ is given as the
5864 % optional argument of \!\pcol@zparacol! and is \!\global!ly assigned to the
5865 % register by the sole modifier \!\pcol@zparacol!, unless the optional
5866 % argument is not less than $\C$ which is assigned to $\CL$ if this
5867 % exception is found. The reason of the \!\global! assignment and the
5868 % initial zero-clearing after the declaration is same as that for $C$, i.e.,
5869 % for the reference in \!\@outputpage! outside \env{paracol}.
5870 %
5871 % The following macros examines if $\Uidx\CL<\C$, i.e., if \parapag{}ing is
5872 % in effect.
5873 % 
5874 % \begin{quote}\raggedright
5875 % \!\pcol@outputelt!,
5876 % \!\@outputpage!,
5877 % \!\pcol@output@start!,
5878 % \!\pcol@output@flush!,
5879 % \!\pcol@output@clear!,
5880 % \!\pcol@makeflushedpage!,
5881 % \!\pcol@flushfloats!,
5882 % \!\pcol@output@end!,
5883 % \!\pcol@zparacol!,
5884 % \end{quote}
5885 % 
5886 % \begin{Sloppy}{2350}
5887 % In the macros listed above, \!\pcol@outputelt!, \!\pcol@makeflushedpage!
5888 % and \!\pcol@flushfloats! passes $\LBRP0\CL$ and $\LBRP\CL\C$ to their
5889 % respective callees \!\pcol@ioutputelt!, \!\pcol@imakeflushedpage! and
5890 % \!\pcol@iflushfloats! as their argument pair
5891 % $\LBRP{\Uidx\Cfrom}{\Uidx\Cto}$ to let them work on the left and right
5892 % \parapag{}es respectively. The callees above also pass the pair to
5893 % \!\pcol@swapcolumn! to swap the scanning order of columns if \cswap{} is
5894 % in effect.
5895 %
5896 % They also pass the pair to \!\pcol@buildcolseprule! which then passes it
5897 % to \!\pcol@bg@paintcolumns! and \!\pcol@bg@paintbox! by binding it to
5898 % $\LBRP\CBfrom\CBto=\LBRP{\!\pcol@bg@from!}{\~\!\pcol@bg@to!}$ referred to
5899 % by \!\pcol@bg@paint@i! and its callee \!\pcol@bg@paint@ii! to define the
5900 % range of columns to be painted is $\LBRP\CBfrom\CBto$. Similar passing is
5901 % done by (our own version of) \!\@outputpage!, but it directly uses
5902 % $\LBRP0\CL$ and $\LBRP\CL\C$ as the sources and the target painting macros
5903 % are \!\pcol@bg@paintpage!, \!\pcol@bg@@paintpage! and
5904 % \!\pcol@bg@paintbox!. Note that $\CBto$ is initialized to be
5905 % \!\let!-equal to $\C$ because it may be referred to without
5906 % binding\footnote{
5907 % 
5908 % This meaningless reference has no harmful side effects.}.
5909 % \end{Sloppy}
5910 %
5911 % The macro \!\pcol@addmarginpar! also refers to $\CL$ to know if the
5912 % column $c$ on which it is working on is in the left or right \parapag{}e,
5913 % i.e., $c<\CL$ or not, to decide the margin to which a marginal note is put,
5914 % and to pass $\LBRP0\CL$ or $\LBRP\CL\C$ to \!\pcol@swapcolumn! to
5915 % calculate the distance to the left or right margin from the column. The
5916 % examination of $c<\CL$ is also done in related macros
5917 % \!\pcol@getmparbottom@i! and \!\pcol@setmpbelt@i!.
5918 %
5919 % Similar column-range specification is done for the argument pair
5920 % $\LBRP\Cfrom\Cto$ of \!\pcol@setcolumnwidth! invoked from
5921 % \!\pcol@zparacol!. Then the arguments are passed to the callees
5922 % \!\pcol@setcolwidth@r! or \!\pcol@setcolwidth@s!, the latter of
5923 % which also passes them to its callee \!\pcol@setcw@scan!, to define the
5924 % width of columns in $\LBRP\Cfrom\Cto$ and their separators.
5925 %
5926 % The other references to $\C$ are made by \!\pcol@com@switchcolumn! and
5927 % \!\pcol@switchcolumn! to examine $c<\C$, to wraparound $\C-1$ to 0 for the
5928 % former and to complain if $c\geq\C$ for the latter.
5929 % \end{macro}\end{macro}
5930 % 
5931 % \begin{macro}{\pcol@page}
5932 % The register \!\pcol@page! has the zero-origin ordinal $p$ of the page
5933 % which we are in. The register is initialized to be 0 not only by
5934 % \!\pcol@output@start! to give the obvious starting point, but also by
5935 % \!\pcol@freshpage! for page flushing which clears $\PP=\!\pcol@pages!$ to
5936 % give us another type of starting point. Then the register is incremented
5937 % by \!\pcol@nextpage! to advance one page, by \!\pcol@nextpelt! to skip a
5938 % \fpage, and by \!\pcol@startpage! for a \fpage{} to be created. The other
5939 % type of updates of the register is done by \!\pcol@restartcolumn! which
5940 % lets $p$ be $\cc_c(\vb^p)$ when we revisit the column $c$ belonging to the
5941 % page $p$. Note that, besides these \!\global! updates,
5942 % \!\pcol@flushcolumn! locally updates the register to scan
5943 % $\PP=\!\pcol@pages!$, and \!\pcol@freshpage! also performs local updates
5944 % but in more weird manner. Besides the updates discussed above, the
5945 % macros \!\pcol@Log@iii!, \!\pcol@Log@ii!, \!\pcol@FF!, \!\pcol@makecol!,
5946 % \!\pcol@opcol!, \!\pcol@setpageno!, \!\pcol@getcurrpage!,
5947 % \!\pcol@startcolumn!, \!\pcol@output@switch!, \!\pcol@addmarginpar! and
5948 % \!\pcol@fntext! refer to the register to know which page they are
5949 % operating on.
5950 % \end{macro}
5951 % 
5952 % \begin{macro}{\pcol@basepage}
5953 % The register \!\pcol@basepage! has the ordinal $\pbase$ of the \bpage{}
5954 % being the oldest page not shipped out yet. The register is initialized to
5955 % be 0 by \!\pcol@output@start! and \!\pcol@freshpage! together with
5956 % \!\pcol@page!, and then incremented by \!\pcol@outputelt! when it ships
5957 % the page $\pbase$ out. The macros \!\pcol@setpageno!, \!\pcol@nextpage!,
5958 % \!\pcol@getcurrpage! and \!\pcol@addmarginpar! refer to the register in
5959 % their scans of $\PP$ or $\PPP$ to know the zero-origin ordinal of the
5960 % element for the current page $p$ is $p-\pbase$.
5961 % \end{macro}
5962 % 
5963 % \begin{macro}{\pcol@toppage}
5964 % \changes{v1.0}{2011/10/10}
5965 % {Renamed from \cs{pcol@maxpage}.}
5966 % 
5967 % The register \!\pcol@toppage! has the ordinal $\ptop$ of the \tpage{}
5968 % having the most advanced \colpage{}s, or {\em\Uidx\lcolpage{}s} in short.
5969 % The register is initialized to be 0 by \!\pcol@output@start! and
5970 % \!\pcol@freshpage! together with \!\pcol@page!, and then let be
5971 % $p=\!\pcol@page!$ by \!\pcol@startpage! to start a new page $p$. The
5972 % macros \!\pcol@makecol!, \!\pcol@opcol!, \!\pcol@startcolumn!,
5973 % \!\pcol@output@switch! and \!\pcol@restartcolumn! refer to the register
5974 % to examine if they are working on a \colpage{} in the \tpage, while
5975 % \!\pcol@flushcolumn! and \!\pcol@fntext! examines if the \ccolpage{} is
5976 % behind the \tpage. The register is also referred to by \!\pcol@Log@iii!,
5977 % \!\pcol@Log@ii! and \!\pcol@FF! for logging.
5978 % \end{macro}
5979 % 
5980 % \begin{macro}{\pcol@footnotebase}
5981 % \changes{v1.2-2}{2013/05/11}
5982 % {Introduced for page-wise footnotes.}
5983 % 
5984 % The register \!\pcol@footnotebase! is let have the value of \!\c@footnote!
5985 % at the start of a \env{paracol} environment by \!\pcol@zparacol! to give
5986 % the base value $\Uidx\bf$ for relative numbering of \counter{footnote}
5987 % done in \!\pcol@calcfnctr! for the starred versions of \!\footnote!,
5988 % \!\footnotemark! and \!\footnotetext!. The register is also referred to
5989 % by \!\endparacol! to let \!\c@footnote! have $\bf+\nf$ where
5990 % $\nf=\!\pcol@nfootnotes!$ shown below is the number of footnotes in the
5991 % \env{paracol} environment to be closed.
5992 % \end{macro}
5993 % 
5994 % \begin{macro}{\pcol@nfootnotes}
5995 % \changes{v1.2-2}{2013/05/11}
5996 % {Introduced for page-wise footnotes.}
5997 % 
5998 % The register \!\pcol@nfootnotes! is to accumulate the number of footnotes
5999 % $\Uidx\nf$ in a \env{paracol} environment. Therefore, it is zero-cleared
6000 % by \!\pcol@zparacol!, then incremented by \!\pcol@ifootnote! and
6001 % \!\pcol@ifootnotemark! for \!\footnote! and \!\footnotemark!, and finally
6002 % referred to by \!\endparacol! to let $\!\c@footnote!=\bf+\nf$.
6003 % \end{macro}
6004 % 
6005 % \begin{macro}{\pcol@mcid}
6006 % \changes{v1.24}{2013/07/27}
6007 % {Introduced for coloring specified in math mode.}
6008 % \changes{v1.34}{2018/05/07}
6009 % {Change its meaning and operations with it a little bit according to
6010 % the new text coloring with \cs{insert}.}
6011 % 
6012 % The register \!\pcol@mcid! has the number of pushes of
6013 % \colorstack{} by coloring commands in math mode between two consecutive
6014 % invocations of \!\output!. The register is
6015 % zero-cleared by \!\pcol@output! because we are definitely in the main
6016 % vertical mode and thus all pops corresponding to pushes in math mode must
6017 % have been applied to |.tex|'s \colorstack. Then the register
6018 % is referred to by \!\pcol@set@color@push! when it is invoked in math mode,
6019 % to increment it and then examine if it does not exceed the limit
6020 % \!\pcol@mcpushlimit! to mean the math-mode coloring still can be made. The
6021 % macro then uses the value of the register as the identifier of the push
6022 % operation given to \!\output! through an \!\insert!ion.
6023 % \end{macro}
6024 % \begin{macrocode}
6025
6026 %% Register Declaration
6027
6028 \newcount\pcol@currcol \global\pcol@currcol\z@
6029 \newcount\pcol@nextcol
6030 \newcount\pcol@ncol \global\pcol@ncol\z@
6031 \newcount\pcol@ncolleft \global\pcol@ncolleft\z@
6032 \newcount\pcol@page
6033 \newcount\pcol@basepage
6034 \newcount\pcol@toppage
6035 \newcount\pcol@footnotebase
6036 \newcount\pcol@nfootnotes
6037 \newcount\pcol@mcid
6038 % \end{macrocode}
6039 %
6040 %
6041 %
6042 % \subsection{Switches}
6043 %
6044 % The second declaration group is for switches.
6045 % 
6046 % \begin{macro}{\ifpcol@output}
6047 % \changes{v1.2-7}{2013/05/11}
6048 % {Introduced to solve the \cs{output} request sneaking.}
6049 % \changes{v1.22}{2013/06/30}
6050 % {Add a user \cs{pcol@reset@color@pop} to inhibit uncoloring if
6051 % $\mathit{false}$.}
6052 % \changes{v1.3-2}{2013/09/17}
6053 % {Add a user \cs{@outputpage} for parallel-paging.}
6054 % \changes{v1.3-3}{2013/09/17}
6055 % {Add a user \cs{@outputpage} for background-painting.}
6056 % 
6057 % The switch \CSIndex{ifpcol@output} is $\true$ iff \!\pcol@output@start!
6058 % which turns the switch $\true$ has been invoked but \!\pcol@output@end!
6059 % which does $\false$ has not yet. Then the switch is examined by
6060 % \!\pcol@output! to detect an \!\output! request sneaked from outside of
6061 % the \env{paracol} environment. The other users \!\@outputpage! and
6062 % \!\pcol@reset@color@pop! examine this switch to know if the macro is
6063 % invoked inside or outside of \env{paracol} environment, while the macro
6064 % \!\pcol@output@start! temporarily turns the switch $\false$ when it ships
6065 % out a page having \preenv{} only.
6066 % \end{macro}
6067 %
6068 % \begin{macro}{\ifpcol@nospan}
6069 % \changes{v1.0}{2011/10/10}
6070 % {Renamed from \cs{pcol@textonly}.}
6071 % 
6072 % The switch |\ifpcol@nospan| is $\true$ iff a page $p$ does not have
6073 % \spanning, i.e., $\pp^i(p)=\bot$. It is set by by
6074 % \!\pcol@getpinfo! for the examination in \!\pcol@ioutputelt!,
6075 % \!\pcol@makeflushedpage! and \!\pcol@output@end!.
6076 % \end{macro}
6077 % 
6078 % \begin{macro}{\ifpcol@sync}
6079 % \changes{v1.0}{2011/10/10}
6080 % {Add initialization to be $\string\mathit{false}$.}
6081 % \changes{v1.2-2}{2013/05/11}
6082 % {Add \cs{pcol@switchcol} and \cs{pcol@flushclear} to the macros
6083 % turning the switch $\string\mathit{true}$ due to column scanning
6084 % and pre-flushing column height check.}
6085 % 
6086 % The switch |\ifpcol@sync| is $\true$ iff \!\pcol@output@switch! is invoked
6087 % for \sync{}ed \cswitch{} by \!\switchcolumn!|*| or its relative
6088 % environment openers, or \pfcheck{} prior to page flushing or environment
6089 % closing. Therefore, the switch is \!\global!ly turned $\true$ by
6090 % \!\pcol@iswitchcolumn! and \!\pcol@sptext! for the \sync{}ing
6091 % \cswitch{}ing but then temporarily turned $\false$ by \!\pcol@switchcol!
6092 % invoked by them for \cscan{}ning and then turned $\true$ again by the
6093 % macro. For \pfcheck{}, the macro \!\pcol@flushclear! turns the switch
6094 % $\true$. The other macro turns this switch is \!\pcol@output@switch! at
6095 % the end of which the switch is turned $\false$ to go back to the default
6096 % state. The macros examining this switch are \!\pcol@output@switch!,
6097 % \!\pcol@putbackmvl!, \!\pcol@sync!, \!\pcol@invokeoutput! (for logging) and
6098 % \!\pcol@switchcol!.
6099 % \end{macro}
6100 % 
6101 % \begin{macro}{\ifpcol@sptextstart}
6102 % \changes{v1.3-1}{2013/09/17}
6103 % {Introduced to capture the starting point of a spanning text so that
6104 % the text is split from other main vertical list stuff.}
6105 % \begin{macro}{\ifpcol@sptext}
6106 % \changes{v1.0}{2011/10/10}
6107 % {Introduced to restrict the broadcast of \cs{if@nobreak} and
6108 % \cs{everypar} only when a column-switching is accompanied with
6109 % spanning text.}
6110 % \changes{v1.3-1}{2013/09/17}
6111 % {Renamed from \cs{ifpcol@mctext} following the naming convention, and
6112 % move the timing of turning $\string\mathit{true}$ from the end
6113 % of a spanning text to its beginning.}
6114 % 
6115 % The switch |\ifpcol@sptextstart| is $\true$ iff \!\pcol@output@switch! is
6116 % invoked from \!\pcol@sptext! prior to a \mctext. That is, the switch is
6117 % \!\global!ly\footnote{
6118 % 
6119 % Not necessary to be \cs{global}ly turned but we dare to do that to clearly
6120 % distinguish that from the local turning in \cs{pcol@putbackmvl}.}
6121 % 
6122 % let $\true$ and then $\false$ by \!\pcol@sptext! before and
6123 % after the invocation of \sync{}ed \!\pcol@switchcol! prior to the
6124 % \mctext. Then the switch is examined by \!\pcol@putbackmvl! after
6125 % the \sync{}ation to save the {\em\Uidx\prespan}, being all stuff in main
6126 % vertical list prior to the \sync{}ation, so that the \mctext{} is split
6127 % from the stuff and is captured afterward by \!\pcol@makecol! and/or
6128 % \!\pcol@output@switch!. The macro also locally turns the switch
6129 % $\false$ if it does not follow the \sync{}ation, i.e., its invocation is
6130 % for \cscan{}ning or is caused by pre-\sync{}ation page break, to do the
6131 % saving only when it follows the \sync{}ation. The switch is also examined
6132 % in \!\pcol@output! to inhibit the warning and forced page break even when
6133 % $\cc_0(\vb^r)=\!\@colroom!<1.5\!\baselineskip!$, because we may let it have
6134 % a small value when the \mctext{} starts near the page bottom to capture
6135 % the text portion in the page by \!\pcol@makecol!. In addition, it is
6136 % examined by \!\pcol@switchcol! to invoke $|\pcol@colpream|{\cdot}c$,
6137 % where $c=-1$ if $\true$ or $c=\!\pcol@currcol!$ otherwise.
6138 % 
6139 % \SpecialArrayIndex{c}{\pcol@colpream}
6140 %
6141 % The macro \!\pcol@sptext! then \!\global!ly turns another switch
6142 % \CSIndex{ifpcol@sptext} $\true$ before putting the \mctext{} into the main
6143 % vertical list so that \!\pcol@makecol! for the page break in the text and
6144 % \!\pcol@output@switch! for closing capture the text to place it
6145 % appropriately especially when \cswap{} is in effect. Then the switch
6146 % is \!\global!ly turned $\false$ by \!\pcol@output@switch! to give the
6147 % default state after it {\em broadcasts} \CSIndex{if@nobreak},
6148 % \CSIndex{if@afterindent} and \!\everypar! to all columns.
6149 % \end{macro}\end{macro}
6150 % 
6151 % \begin{macro}{\ifpcol@clear}
6152 % \changes{v1.0}{2011/10/10}
6153 % {Add initialization to be $\string\mathit{false}$.}
6154 % \changes{v1.2-2}{2013/05/11}
6155 % {Add \cs{pcol@flushclear} to the macros turning the switch
6156 % $\string\mathit{true}$ due to the pre-flushing column height
6157 % check.}
6158 % 
6159 % The switch |\ifpcol@clear| is $\true$ iff \!\pcol@output@switch! is
6160 % invoked for \pfcheck{}, page flushing or environment closing. Therefore,
6161 % the switch is turned $\true$ by \!\pcol@flushclear! in the first case, and
6162 % by \!\pcol@makeflushedpage! in the latter two. These two macros also
6163 % turned the switch $\false$ after the direct\slash indirect invocation of
6164 % \!\pcol@output@switch! to give the default state. The switch is examined
6165 % by \!\pcol@output@switch! and its descendants \!\pcol@sync!,
6166 % \!\pcol@flushcolumn! and \!\pcol@synccolumn! for \sync{}ation, and by
6167 % \!\pcol@invokeoutput! for logging.
6168 % \end{macro}
6169 % 
6170 % \begin{macro}{\ifpcol@flush}
6171 % \changes{v1.2-3}{2013/05/11}
6172 % {Introduced to fix the problem with a too-tall page at
6173 % synchronization.}
6174 % \changes{v1.2-2}{2013/05/11}
6175 % {Add uses for page-wise footnote functions.}
6176 % 
6177 % The switch |\ifpcol@flush| is turned $\true$ by \!\pcol@sync! iff it finds
6178 % that the page to be \sync{}ed or to be flushed is too tall because the
6179 % sum of the total height of top floats and main text in a column and that
6180 % of bottom floats and footnotes in another column is larger than
6181 % $\pp^h(\ptop)-v^f-\VE$, where $v^f$ is the total height-plus-depth of the
6182 % \Scfnote{}s if $\ptop$ has them or 0 otherwise, and $\VE$ is the amount
6183 % given by \!\ensurevspace! in \sync{}ation or 0 in flushing. Then the
6184 % switch is examined in \!\pcol@sync! itself to restart the tallest column
6185 % if $\true$, in \!\pcol@putbackmvl! to check if a \mctext{} is really to
6186 % start, in \!\pcol@switchcol! to have a explicit page break in each column
6187 % if $\true$, and in \!\pcol@flushclear! also to have a page break if
6188 % $\true$. The last examiner \!\pcol@flushclear! may turn the switch
6189 % $\true$ when it is invoked from \!\endparacol! if the last page leaves
6190 % deferred and non-merged \Scfnote{}s for which an explicit page break is
6191 % also required.
6192 % \end{macro}
6193 % 
6194 % \begin{macro}{\ifpcol@outputflt}
6195 % \changes{v1.0}{2011/10/10}
6196 % {Renamed from \cs{ifpcol@stopoutput} with the reversal.}
6197 % 
6198 % The switch |\ifpcol@outputflt| is used in \!\pcol@outputelt! to know
6199 % whether a \fpage{} is to be shipped out ($\true$) or not. The switch is
6200 % initialized to be $\true$ by \!\pcol@outputcolumns! which invokes
6201 % \!\pcol@outputelt! for all $\pp(p)\in\PP$. Then if \!\pcol@outputcolumns! is
6202 % invoked from \!\pcol@opcol! to ship the oldest page $\pbase$ out, the
6203 % switch is turned $\false$ when we visit the second non-\fpage. That is,
6204 % all \fpage{}s following the first (oldest) page are shipped out but others
6205 % are not. On the other hand, if \!\pcol@outputcolumns! is invoked from
6206 % \!\pcol@sync! to ship out all pages including \fpage{}s in $\PP$, the
6207 % switch is kept $\true$ throughout all invocations of \!\pcol@outputelt!.
6208 % \end{macro}
6209 % 
6210 % \begin{macro}{\ifpcol@lastpage}
6211 % \changes{v1.0}{2011/10/10}
6212 % {Introduced for special operations in the last page.}
6213 % \begin{macro}{\ifpcol@lastpagesave}
6214 % \changes{v1.2-7}{2013/05/11}
6215 % {Introduced to fix the bug that \cs{@makecol} and
6216 % \cs{pcol@makefcolumn} in \cs{pcol@flushcolumn} misunderstand that
6217 % non-last pages are last.}
6218 % 
6219 % The switch |\ifpcol@lastpage| is used to know whether the following macros
6220 % work on the {\em\Uidx\lpage} of a \env{paracol} environment to do special
6221 % operations if so.
6222 % 
6223 % \begin{itemize}
6224 % \item
6225 % \!\pcol@combinefloats! adds \!\textfloatsep! below bottom floats of each
6226 % column if any so that the floats are well separated from the \postenv.
6227 %
6228 % \item
6229 % \!\pcol@sync! examines $\VPP$ instead of $\VP$ for the \pfcheck.
6230 %
6231 % \item
6232 % \!\pcol@makefcolumn! tries to make deferred floats as top floats.
6233 %
6234 % \item
6235 % \!\pcol@makeflushedpage! builds a short page of $\VPP$ tall, leaves
6236 % \spanning{} from ship-out if $\VPP=\!\pcol@colht!=-\infty$ so that it
6237 % becomes a float in \postenv, and leaves \Scfnote{}s untouched if
6238 % \Mgfnote{} typesetting is in effect. This macro itself turns this switch
6239 % $\false$ if $\CSIndex{ifpcol@dfloats}=\true$ to mean one or more columns
6240 % in the \lpage{} have deferred \cwise{} floats and thus the \lpage{}
6241 % must be {\em full size}.
6242 %
6243 % \item
6244 % \!\pcol@imakeflushedpage! leaves the \bground{} of \Scfnote{}s unpainted,
6245 % and lets the depth of the \lpage{} be 0 in \bgpaint{} and packing of
6246 % \colpage{}s.
6247 % \end{itemize}
6248 % 
6249 % The switch is initialized to be $\false$ by \!\pcol@zparacol!, then turned
6250 % $\true$ by \!\endparacol!, and then finally turned $\false$ by
6251 % \!\pcol@output@end! again for
6252 % \fpage{}s following the \lpage{} if any. The macro \!\pcol@flushcolumn!
6253 % saves the switch into \CSIndex{ifpcol@lastpagesave} then turning it
6254 % $\false$ during it works on \colpage{}s in non-top and thus non-\lpage{}s
6255 % to keep \!\@makecol! and \!\pcol@makefcolumn! from misunderstanding the
6256 % pages are last, and then restore the switch when the macro reaches to the
6257 % \tpage. This saving and temporary turning $\false$ is also done in
6258 % \!\pcol@flushclear! when it forces a page break so that the \!\output!
6259 % routine working on the broken non-\lpage{} correctly recognizes that.
6260 % Another temporary turning is made by \!\pcol@makenormalcol! but in reverse
6261 % to let the switch be $\true$ so that its indirect callee
6262 % \!\pcol@combinefloats! puts a vertical skip of \!\textfloatsep! below the
6263 % bottom floats in \preenv.
6264 % \end{macro}\end{macro}
6265 % 
6266 % \begin{macro}{\ifpcol@scfnote}
6267 % \changes{v1.2-2}{2013/05/11}
6268 % {Introduced for page-wise footnote functions.}
6269 % 
6270 % The switch \!\ifpcol@scfnote! is turned $\true$ by \!\pcol@fnlayout@p!
6271 % and \!\pcol@fnlayout@m! (through \!\pcol@fnlayout@p!) to indicate
6272 % footnotes in all columns are merged and \scfnote, while
6273 % \!\pcol@fnlayout@c! turns it $\false$ to make footnote typesetting
6274 % \mcfnote{}, being default as well. The switch is examined by the
6275 % following macros to do special operations for \Scfnote{}s if
6276 % it is $\true$.
6277 % 
6278 % \begin{itemize}
6279 % \item
6280 % \!\pcol@makecol! shrinks \!\@colht! and put the stretch\slash shrink
6281 % factor of \!\skip!\!\footins! at the bottom of the \colpage{} to be built
6282 % by the macro if the page has footnotes. If the \colpage{} is in the
6283 % \tpage{} $\ptop$, the macro also saves \!\footins! into \!\pcol@currfoot!
6284 % which then will be saved into $\pp^f(\ptop)$ by \!\pcol@startpage!, or
6285 % \!\footins! is discarded otherwise.
6286 %
6287 % \item
6288 % \!\pcol@startcolumn!, if it is invoked from \!\pcol@output! to start a
6289 % \colpage{} in a page $p$, \!\insert!s $\pp^f(p)$ through \!\footins!, and
6290 % also the deferred footnotes in $\df$ by \!\pcol@deferredfootins!, if
6291 % $p=\ptop$.
6292 %
6293 % \item
6294 % \!\pcol@output@switch! saves \!\footins! into $\pp^f(\ptop)$ if the macro
6295 % is to leave a \colpage{} in the \tpage, or discards it otherwise.
6296 %
6297 % \item
6298 % \!\pcol@restartcolumn! to restart a \colpage{} in a page $p$ \!\insert!s
6299 % $\pp^f(p)$ through \!\footins!, and also the deferred footnotes in $\df$
6300 % by \!\pcol@deferredfootins!, if $p=\ptop$.
6301 %
6302 % \item
6303 % \!\pcol@sync! examines whether the total height of \Scfnote{}s is too
6304 % large to let them reside in the page to be synchronized or flushed as a
6305 % whole.
6306 %
6307 % \item
6308 % \!\pcol@zparacol! redefines \!\footnoterule! so that it refers to
6309 % \!\textwidth! rather than \!\column~width! to determine the width of the
6310 % rule above footnotes.
6311 %
6312 % \item
6313 % \!\pcol@fntext! invokes \!\pcol@fntextother! to add the footnote given to
6314 % it to $\df$ as a deferred footnote if $p<\ptop$.
6315 %
6316 % \item
6317 % \!\pcol@fntextbody! lets \!\hsize! be \!\textwidth! rather than
6318 % \!\columnwidth! to typeset the footnote given to it.
6319 % \end{itemize}
6320 % \end{macro}
6321 % 
6322 % \begin{macro}{\ifpcol@mgfnote}
6323 % \changes{v1.2-2}{2013/05/11}
6324 % {Introduced for page-wise footnote functions.}
6325 % 
6326 % The switch \!\ifpcol@mgfnote! is turned $\true$ by \!\pcol@fnlayout@m!
6327 % to indicate footnotes in the \spage{} and \lpage{} of a \env{paracol}
6328 % environment are merged with those in pre- and \postenv{}, while
6329 % \!\pcol@fnlayout@p! and \!\pcol@fnlayout@c! turn it $\false$ to
6330 % put them above\slash below the columns in the starting\slash\lpage{}
6331 % respectively, being default as well. The switch is examined by the
6332 % following macros to do special operations for \mgfnote{} \Scfnote{}s
6333 % if it is $\true$.
6334 % 
6335 % \Index{pre-environment stuff}
6336 % \Index{starting page}
6337 % 
6338 % \begin{itemize}
6339 % \item
6340 % \!\pcol@makenormalcol! leaves \!\footins! untouched rather than putting it
6341 % as a part of \preenv.
6342 %
6343 % \item
6344 % \!\pcol@makeflushedpage! leaves \!\footins! untouched rather than putting it
6345 % as a part of the \lpage{} of \env{paracol} if it works on the page.
6346 %
6347 % \item
6348 % \!\endparacol! does not let \!\pcol@flushclear! examine the existence of
6349 % deferred footnotes in \pfcheck{} for the \lpage.
6350 % \end{itemize}
6351 % \end{macro}
6352 % 
6353 % \begingroup\let\small\footnotesize
6354 % \begin{macro}{\ifpcol@fncounteradjustment}
6355 % \changes{v1.2-2}{2013/05/11}
6356 % {Introduced for page-wise footnote functions.}
6357 % 
6358 % The switch \!\ifpcol@fncounteradjustment! is turned $\true$ by the API
6359 % macro \!\fncounter~adjustment!, which is also invoked from
6360 % \!\pcol@fnlayout@p! and \!\pcol@fnlayout@m! (through \!\pcol@fnlayout@p!),
6361 % to let $\!\c@footnote!=\bf+\nf$ by \!\endparacol!. The macro
6362 % \!\nofncounter~adjustment! turns the switch $\false$ to give the default
6363 % state.
6364 % \end{macro}
6365 % \endgroup
6366 % 
6367 % \begin{macro}{\ifpcol@inner}
6368 % \changes{v1.22}{2013/06/30}
6369 % {Introduced to know if we are in a \cs{vbox}.}
6370 % 
6371 % The switch \cs{ifpcol@inner} is turned $\false$ by \!\pcol@zparacol! to
6372 % mean we are outside any \!\vbox!es, while the macro also lets
6373 % \!\everyvbox! in the \env{paracol} environment has the operation to turn
6374 % the switch $\true$ so that it is true whenever we are in a \!\vbox!. The
6375 % switch is examined by \!\pcol@set@color@push! and \!\pcol@icolumncolor!,
6376 % the former of which also turns it $\true$ if we are in restricted
6377 % horizontal mode, to make an \!\output! request for \colorstack{}
6378 % manipulation and, in the former, to reserve the stack popper by
6379 % \!\aftergroup!, iff the switch is $\false$.
6380 % \end{macro}
6381 % 
6382 % \begin{macro}{\ifpcol@firstpage}
6383 % \changes{v1.3-3}{2013/09/17}
6384 % {Introduced to know if a spanning stuff is pre-environment one.}
6385 % 
6386 % The switch \cs{ifpcol@firstpage} is \!\global!ly turned $\true$ or
6387 % $\false$ by \!\pcol@output@start! if it captures \preenv{} as a
6388 % \spanning{} or not because it is too large, respectively. Then the switch
6389 % is examined by \!\pcol@ioutputelt! or \!\pcol@makeflushedpage! when they
6390 % finds a \spanning{} to be combined to the page to be printed so as to
6391 % paint the \bground{} for the color of \pwise{} floats unless the switch is
6392 % $\true$ to mean the stuff is pre-environment one rather than floats. Then
6393 % \!\pcol@outputelt! or \!\pcol@makeflushedpage! itself \!\global!ly turns
6394 % the switch $\false$ after printing a page because we no longer have
6395 % \preenv{} in the \env{paracol} environment we are in.
6396 % \end{macro}
6397 % 
6398 % \begin{macro}{\ifpcol@havelastpage}
6399 % \changes{v1.3-3}{2013/09/17}
6400 % {Introduced to know if a page to be put has the last page of a
6401 % \string\texttt{paracol} environment.}
6402 % 
6403 % The switch \cs{ifpcol@havelastpage} is, after an initial $\false$,
6404 % \!\global!ly turned $\true$ by \!\pcol@output@end! if it finds the
6405 % \lpage{} of the \env{paracol} environment is connected to the \postenv, or
6406 % $\false$ otherwise. Then the switch is examined by (our own version of)
6407 % \!\@outputpage! which paints the \bground{} of the page to be printed iff
6408 % the switch is $\true$ because a part of the page was produced by a
6409 % \env{paracol} environment. Then the macro \!\global!ly turns the switch
6410 % $\false$ because so far \bgpaint{} should be disabled.
6411 % \end{macro}
6412 % 
6413 % \begin{macro}{\ifpcol@paired}
6414 % \changes{v1.3-2}{2013/09/17}
6415 % {Introduced for parallel-paging which has paired and non-paired mode.}
6416 % 
6417 % The switch \cs{ifpcol@paired} is $\true$ if the \parapag{}ed typesetting
6418 % should be done in {\em\paired} mode in which the pair of left and right
6419 % \parapag{}es comprises a virtual page, while it is $false$ if
6420 % \npaired{} to treat the left and right pages as individual ones.
6421 % Therefore, the switch is \!\global!ly turned $\false$ by \!\pcol@yparacol!
6422 % when \beginparacol{} has the optional argument for the number of columns
6423 % in the left \parapag{}e followed by |*|, or turned $\true$
6424 % otherwise by \!\paracol! for giving default or by \!\pcol@zparacol! if it
6425 % finds $\CL\geq\C$ to mean \parapag{}ing is not in effect
6426 % in reality\footnote{
6427 % 
6428 % The initialization to let the switch $\false$ is not necessary because it
6429 % is examined only after the first \cs{paracol} even in the
6430 % \cs{@outputpage} outside \texttt{paracol} environment, but we dare to do
6431 % this for the sake of clarity.}.
6432 %
6433 % Then the switch is examined by \!\pcol@setpnoelt! and \!\pcol@startpage!
6434 % so that, if the switch is $\false$, they let $\page(q)=\page(q-1)+2$ where
6435 % $\cc_0(\vb^p)<q\leq\ptop$ in the former and $q=\ptop$ in the latter,
6436 % instead of $\page(q)=\page(q-1)+1$ in the usual $\true$ case, because the
6437 % left\slash right pair of \parapag{}es is treated as two pages rather than
6438 % one.
6439 %
6440 % The other macros \!\pcol@ioutputelt!, (our own version of) \!\@outputpage!,
6441 % \!\pcol@output@start!, \!\pcol@imakeflushedpage!, \!\pcol@iflushfloats! and
6442 % \!\pcol@output@end! also refer to the switch so that, if $\false$, they
6443 % temporarily let $\!\c@page!=\page(p)+1$ in building the shipout image of
6444 % the right component of the \parapag{}e pair of the page $p$ in order to
6445 % have the appropriate page number parity for the right component. Among
6446 % them, \!\@outputpage! has another mode dependant operation, if the switch
6447 % is $\true$, to decrement \!\c@page! by one before shipping out the right
6448 % component to cancel the increment in the ship-out process of the left
6449 % component. The macro \!\pcol@addmarginpar! also examines the switch to
6450 % decide the margin for marginal notes in \npaired{} \parapag{}es. Another
6451 % examiner \!\pcol@zparacol! lets $\CSIndex{ifpcol@swapcolumn}=\false$
6452 % only in the \env{paracol} environment to start if the switch is $\true$
6453 % because \cswap{} is meaningless in \npaired{} \parapag{}ing.
6454 % \end{macro}
6455 % 
6456 % \begin{macro}{\ifpcol@swapcolumn}
6457 % \changes{v1.2-4}{2013/05/11}
6458 % {Introduced for column-swapping in even pages.}
6459 % \begin{macro}{\ifpcol@swapmarginpar}
6460 % \changes{v1.3-4}{2013/09/17}
6461 % {Introduced for marginal-note-swapping in even pages.}
6462 % \begin{macro}{\ifpcol@bg@swap}
6463 % \changes{v1.3-3}{2013/09/17}
6464 % {Introduced for mirrored background painting for even numbered
6465 % pages.}
6466 % \begin{macro}{\ifpcol@bg@@swap}
6467 % \changes{v1.3-3}{2013/09/17}
6468 % {Introduced for mirrored background painting for even numbered
6469 % pages.} 
6470 % 
6471 % The switch \cs{ifpcol@swapcolumn}, \cs{ifpcol@swapmarginpar} and
6472 % \cs{ifpcol@bg@swap} specify that, if $\true$, columns, marginal notes,
6473 % and \bgpaint{} in even numbered pages are swapped, respectively.
6474 % That is, \cs{ifpcol@swapcolumn} lets columns be put from right to left,
6475 % \cs{ifpcol@swapmarginpar} lets marginal notes go to the opposite side from
6476 % that in odd numbered pages, and \cs{ifpcol@bg@swap} makes \bgpaint{}
6477 % \mirror{}ed.
6478 %
6479 % Besides the initial setting to let them $\false$ \!\global!ly after the
6480 % declaration, the switches are \!\global!ly turned $\false$ by
6481 % \!\pcol@twosided! for the cases in which API macro \!\twosided! does not
6482 % have `|c|', `|m|' or `|b|' in its optional argument respectively, and then
6483 % \!\global!ly turned $\true$ by $|\pcol@twosided@|{\cdot}k$
6484 % ($k\in\{|c|,|m|,|b|\}$ )
6485 % 
6486 % \SpecialIndex{\pcol@twosided@c}
6487 % \SpecialIndex{\pcol@twosided@m}
6488 % \SpecialIndex{\pcol@twosided@b}
6489 % 
6490 % which is invoked when the argument contains `|c|', `|m|' or `|b|'
6491 % respectively, or the API macro does not have the argument at
6492 % all\footnote{
6493 % 
6494 % \cs{ifpcol@swapcolumn} is also turned $\true$ and $\false$ by backward
6495 % compatible API macros \cs{swap\BB column\BB in\BB even\BB pages} and
6496 % \cs{noswapcolumninevenpages} respectively.}.
6497 % 
6498 % \SpecialIndex{\swapcolumninevenpages}
6499 % \SpecialIndex{\noswapcolumninevenpages}
6500 % 
6501 % The switch \CSIndex{ifpcol@swapcolumn} is also turned $\false$ by
6502 % \!\pcol@zparacol! but locally if \npaired{} \parapag{}ing is specified
6503 % because \cswap{} is meaningless in the environment. Another modifier is (our
6504 % own version of) \!\@outputpage!, but setting and examining the switch in
6505 % this macro is also local and is to decide the ship-out order of left and
6506 % right \parapag{}es.
6507 %
6508 % Besides the local use by \!\@outputpage!, \CSIndex{ifpcol@swapcolumn} is
6509 % then examined by the following macros to do special operations if it is
6510 % $\true$ and we are in an even numbered page.
6511 % 
6512 % \begin{itemize}
6513 % \item
6514 % \!\pcol@swapcolumn! to reverse the order of column visiting in
6515 % \!\pcol@ioutputelt!, \!\pcol@imakeflushedpage! and \!\pcol@iflushfloats!.
6516 %
6517 % \item
6518 % \!\pcol@shiftspanning! to shift a \mctext{} to the left edge of text area.
6519 %
6520 % \item
6521 % \!\pcol@bg@paint@ii! to \mirror{} the \bgpaint{} of columns and \csepgap{}s.
6522 % \end{itemize}
6523 % 
6524 % On the other hand, examiners of \CSIndex{ifpcol@swapmarginpar} and
6525 % \CSIndex{ifpcol@bg@swap} are sole for each, namely \!\pcol@addmarginpar!
6526 % and \!\pcol@bg@paint@i! respectively. If each switch is $\true$ and we
6527 % are in an even numbered page, the former reverses \CSIndex{if@firstcolumn}
6528 % from the value having been set for non-swapping case, while the latter
6529 % \mirror{}s the \bgpaint{} of the regions excepting columns and
6530 % \csepgap{}s.
6531 %
6532 % A related switch \CSIndex{ifpcol@bg@@swap} is let be $\true$ if
6533 % \CSIndex{ifpcol@swapcolumn} or \cs{ifpcol@bg@}\~\texttt{swap}
6534 % 
6535 % \CSINDEX{ifpcol@bg@swap}
6536 % 
6537 % is $\true$ and we are working on a even numbered page by
6538 % \!\pcol@bg@swappage! for \mirror{}ed \bgpaint{} of columns and
6539 % \csepgap{}s, or other regions respectively, and then examined by
6540 % \!\pcol@bg@paintregion@i! for \mirror{}ing.
6541 % \end{macro}\end{macro}\end{macro}\end{macro}
6542 % 
6543 % \begin{macro}{\ifpcol@bg@painted}
6544 % \changes{v1.3-3}{2013/09/17}
6545 % {Introduced to examine if a set of regions are painted.}
6546 % 
6547 % The switch \cs{ifpcol@bg@painted} is \!\global!ly turned $\false$ at the
6548 % beginning of \!\pcol@bg@paint@i!, and then \!\global!ly turned $\true$ by
6549 % \!\pcol@bg@paintregion! if it paint the region specified by its argument,
6550 % i.e., \!\backgroundcolor! for the region is declared. Then the switch is
6551 % examined by \!\pcol@bg@paint@i! to combine the painted region with others,
6552 % by (our own version of) \!\@outputpage! and \!\pcol@outputpage@r! to
6553 % incorporate painted regions into ship-out image.
6554 % \end{macro}
6555 % 
6556 % \begin{macro}{\ifpcol@bfbottom}
6557 % \changes{v1.3-6}{2013/09/17}
6558 % {Introduced to know which column-wise footnotes or bottom floats
6559 % are put at the bottom of a column.}
6560 % 
6561 % The switch \cs{ifpcol@bfbottom} is $\true$ if \!\@makecol! puts bottom
6562 % floats at the bottom of a column as done by the macro in \LaTeX's standard
6563 % implementation, or $\false$ otherwise and thus bottom floats can be
6564 % followed by footnotes as done in p\LaTeX. Since we know only p\LaTeX{} is
6565 % exceptional, we let the switch $\false$ iff \!\pfmtname! is defined and
6566 % has |pLaTeX2e| in its body. The switch is examined by
6567 % \!\pcol@measurecolumn! to determine which footnotes or bottom floats
6568 % determine $\DP$ if both of them exist.
6569 % \end{macro}
6570 % 
6571 % \begin{macro}{\ifpcol@dfloats}
6572 % \changes{v1.3-6}{2013/09/17}
6573 % {Introduced to know if the last page has deferred column-wise floats.}
6574 % 
6575 % The switch \cs{ifpcol@dfloats} is $\true$ iff one or more columns (in a
6576 % \lpage) have deferred \cwise{} floats. Therefore, it is turned
6577 % $\false$ by \!\pcol@sync! before it invokes \!\pcol@measurecolumn! which
6578 % turns it $\true$ when it finds a column $c$ such that
6579 % $\cc_c(\dl)\neq\emptyset$. Then the switch is examined by
6580 % \!\pcol@makeflushedpage! to make a \lpage{} {\em full size}, and by
6581 % \!\pcol@output@end! to flush these floats.
6582 % \end{macro}
6583 % \begin{macrocode}
6584 \newif\ifpcol@output \global\pcol@outputfalse
6585 \newif\ifpcol@nospan
6586 \newif\ifpcol@sync \pcol@syncfalse
6587 \newif\ifpcol@sptextstart \pcol@sptextstartfalse
6588 \newif\ifpcol@sptext \pcol@sptextfalse
6589 \newif\ifpcol@clear \pcol@clearfalse
6590 \newif\ifpcol@flush
6591 \newif\ifpcol@outputflt
6592 \newif\ifpcol@lastpage
6593 \newif\ifpcol@lastpagesave
6594 \newif\ifpcol@scfnote \pcol@scfnotefalse
6595 \newif\ifpcol@mgfnote \pcol@mgfnotefalse
6596 \newif\ifpcol@fncounteradjustment \pcol@fncounteradjustmentfalse
6597 \newif\ifpcol@inner
6598 \newif\ifpcol@firstpage
6599 \newif\ifpcol@havelastpage \global\pcol@havelastpagefalse
6600 \newif\ifpcol@paired \global\pcol@pairedtrue
6601 \newif\ifpcol@swapcolumn \global\pcol@swapcolumnfalse
6602 \newif\ifpcol@swapmarginpar \global\pcol@swapmarginparfalse
6603 \newif\ifpcol@bg@swap \global\pcol@bg@swapfalse
6604 \newif\ifpcol@bg@@swap
6605 \newif\ifpcol@bg@painted
6606 \newif\ifpcol@bfbottom
6607 \def\reserved@a{pLaTeX2e}
6608 \ifx\reserved@a\pfmtname \pcol@bfbottomfalse \else \pcol@bfbottomtrue \fi
6609 \newif\ifpcol@dfloats
6610 % \end{macrocode}
6611 %
6612 %
6613 %
6614 % \subsection{\cs{dimen} and \cs{skip} Registers}
6615 %
6616 % The next declaration group is for six \!\dimen! and one \!\skip!
6617 % registers.
6618 % 
6619 % \begin{macro}{\pcol@prevdepth}
6620 % The \!\dimen! register \!\pcol@prevdepth! is set to the depth of the last
6621 % item added to the main vertical list of column $c$ from which we switch to
6622 % another column $d$, i.e., \!\prevdepth! seen in \!\pcol@invokeoutput!
6623 % before \!\output! request. The value of the register is then set into
6624 % \!\prevdepth! also by \!\pcol@invokeoutput! after \!\output! for the
6625 % column $d$. The value of the register is stored in $\cc_c(\pd)$ by
6626 % \!\pcol@setcurrcol! and then restored into the register by
6627 % \!\pcol@igetcurrcol! for the use in \!\pcol@invokeoutput! above and in
6628 % \!\pcol@measurecolumn!, which may let the register and $\cc_c(\pd)$ have
6629 % $\infty$ if the \colpage{} $c$ is empty. The register is also updated by
6630 % \!\pcol@synccolumn! for empty main vertical list case, and by
6631 % \!\pcol@output@end! to be set into \!\prevdepth! for the first vertical
6632 % item of \postenv.
6633 % \end{macro}
6634 % 
6635 % \begin{macro}{\pcol@colht}
6636 % The \!\dimen! register \!\pcol@colht! has $\VPP$ being the height of the
6637 % tallest column in the \lpage{} taking \!\textfloatsep! below bottom floats
6638 % into account if any. The register is initialized to be $-\!\maxdimen!$ by
6639 % \!\pcol@sync! and then is examined and updated in \!\pcol@measurecolumn!
6640 % to find the tallest column. Besides the internal use of this exploration,
6641 % its result is referred to by \!\pcol@sync! as the threshold of \pfcheck,
6642 % and by \!\pcol@makeflushedpage! through its argument given by
6643 % \!\pcol@output@end! to know the height of multi-column stuff in the
6644 % \lpage{}. The macro \!\pcol@makeflushedpage! also lets the register have
6645 % 0 if the \lpage{} has nothing but non-\mgfnote{} \Scfnote{}. The other
6646 % usage of this register is in \!\pcol@freshpage! to keep the value of
6647 % \!\@colht! of the page made by \!\flushpage! or \!\clearpage! so that it
6648 % is given to $\!\@colroom!=\cc_c(\vb^r)$ of each column $c$ in case a
6649 % column $c'$ s.t.\ $c'<c$ made another page for \fcolumn{}s updating
6650 % \!\@colht!.
6651 % \end{macro}
6652 % 
6653 % \begin{macro}{\pcol@textfloatsep}
6654 % \changes{v1.0}{2011/10/10}
6655 % {Introduced for the bug fix of float space enlargement.}
6656 % 
6657 % The \!\dimen! (not \!\skip!) register \!\pcol@textfloatsep! has
6658 % \!\maxdimen! if a \colpage{} does not have \sync{}ation points, to let top
6659 % floats are inserted in usual way. If it has, the register may hold the
6660 % vertical space amount inserted after top floats in a \colpage{} instead of
6661 % \!\textfloatsep! so that, if a column only with top floats defines the
6662 % first \sync{}ation point, the space for floats are extended to the
6663 % \sync{}ation point. In this extension case, the register has the amount
6664 % above biased by 10000\,|pt| to distinguish the case from another case with
6665 % ordinary top floats in which the register has non-biased \!\textfloatsep!.
6666 % In addition, if the register is less than \!\maxdimen! including a value
6667 % equal to \!\textfloatsep!, top floats are packed in a \!\vbox! so that
6668 % stretch\slash shrink factor of \!\floatsep! cannot move \sync{}ation
6669 % points. After the default setting to be \!\maxdimen! by \!\pcol@zparacol!
6670 % and \!\pcol@floatplacement!, the value of the register is stored in
6671 % $\cc_c(\tf)$ by \!\pcol@setcurrcol! and then restored into the register by
6672 % \!\pcol@igetcurrcol! for the use in \!\pcol@makecol!,
6673 % \!\pcol@combinefloats!, \!\pcol@cflt!, \!\pcol@output@switch!,
6674 % \!\pcol@measurecolumn!, \!\pcol@addflhd! and \!\pcol@synccolumn!.
6675 % \end{macro}
6676 % 
6677 % \begin{macro}{\pcol@lrmargin}
6678 % \changes{v1.2-5}{2013/05/11}
6679 % {Introduced to let \cs{linewidth} for each column has the value
6680 % according to $w_c$ and the list-like environment surrounding
6681 % \string\texttt{paracol} environment.}
6682 % \begin{macro}{\pcol@bg@leftmargin}
6683 % \changes{v1.3-3}{2013/09/17}
6684 % {Introduced for background painting.}
6685 % 
6686 % The \!\dimen! register \!\pcol@lrmargin! is let have
6687 % $\Uidx\lrm=\!\textwidth!-\!\linewidth!$ by \!\pcol@zparacol!, so that
6688 % \!\linewidth! for column $c$ is let have $\w_c-\lrm$ by
6689 % \!\pcol@invokeoutput!, which also sets \!\parshape! if $\lrm>0$.
6690 %
6691 % The other usage of this register is to have the left or right margin for
6692 % \bgpaint{} in the alias \!\pcol@bg@leftmargin! for strict local use in
6693 % \!\pcol@bg@paint@i! and its descendent macros for \bgpaint. That is, the
6694 % register is aliased as \!\pcol@bg@leftmargin! by \!\pcol@bg@paint@i!, let
6695 % have left or right margin by \!\pcol@bg@swappage!, and then referred to by
6696 % \!\pcol@bg@pageleft!.
6697 % \end{macro}\end{macro}
6698 % 
6699 % \begin{macro}{\pagerim}
6700 % \changes{v1.3-3}{2013/09/17}
6701 % {Introduced to specify the page rim size for background coloring.}
6702 % 
6703 % The API \!\dimen! register \!\pagerim! has the size of {\em\Uidx\prim{}s}
6704 % specified by users. Since the rims are the area for which \bgpaint{}
6705 % is inhibited, the register is used in area specification macros
6706 % \!\pcol@bg@paperwidth!, \!\pcol@bg@paperheight!, \!\pcol@bg@pageleft! and
6707 % \!\pcol@bg@pagetop!, in which the register has the negative counterpart of
6708 % the specified value set by \!\pcol@bg@paint@i!.
6709 % \end{macro}
6710 % 
6711 % \begin{macro}{\pcol@topskip}
6712 % The \!\skip! register \!\pcol@topskip! keeps the value of \!\topskip! at
6713 % \beginparacol{} for the ordinary usage of \!\topskip! which may have 0 in
6714 % the starting and \lpage{} temporarily. After the initialization by
6715 % \!\pcol@zparacol!, it is referred to by \!\pcol@getpinfo! for pages without
6716 % \spanning{} and thus \preenv, by \!\pcol@startpage! to let \!\topskip! and
6717 % $\pp^t(p)$ has it for non-\spage{} $p$, by \!\pcol@output@start! for the
6718 % second page if it finds \preenv{} is too large to combine with the
6719 % multi-column stuff, and by \!\endparacol! to recover \!\topskip! for the
6720 % pages following the \lpage.
6721 % \end{macro}
6722 % 
6723 % \begin{macro}{\belowfootnoteskip}
6724 % \changes{v1.35-4}{2018/12/31}
6725 % {Introduced to specify the additional space below the non-merged
6726 % pre-environment footnotes.}
6727 % 
6728 % The API \!\skip! register \!\belowfootnoteskip! has the amount of the space
6729 % added below non-merged \Preenv{} footnotes. The register is initialized
6730 % with the default 0\,pt, and then used in \!\pcol@output@start! to measure
6731 % the room in the first page, and in \!\pcol@combinefootins! to add the
6732 % space.
6733 % \end{macro}
6734 % 
6735 % \begin{macrocode}
6736 \newdimen\pcol@prevdepth
6737 \newdimen\pcol@colht
6738 \newdimen\pcol@textfloatsep
6739 \newdimen\pcol@lrmargin
6740 \newdimen\pagerim \pagerim\z@
6741 \newskip\pcol@topskip
6742 \newskip\belowfootnoteskip \belowfootnoteskip\z@
6743 % \end{macrocode}
6744 %
6745 %
6746 %
6747 % \subsection{\cs{box} Registers}
6748 %
6749 % The next declaration group is for the following \!\box! registers.
6750 % 
6751 % \begin{macro}{\pcol@topfnotes}
6752 % \changes{v1.2-2}{2013/05/11}
6753 % {Introduced for page-wise footnote functions.}
6754 % 
6755 % The \!\box! register \!\pcol@topfnotes! is the implementation of $\df$ to
6756 % have the list of deferred footnotes. The register is made void by
6757 % \!\pcol@output@start! and then is made grown by \!\pcol@fntextother! with
6758 % a deferred footnote added by the macro. The macro
6759 % \!\pcol@deferredfootins! invoked from \!\pcol@startcolumn! and
6760 % \!\pcol@restartcolumn! tries to \!\insert! the contents of the register
6761 % through \!\footins! but may keep some of trailing ones in it if the total
6762 % height of the footnotes is too large, while \!\pcol@output@end! does the
6763 % \!\insert!ion without height capping. The macro \!\endparacol! with
6764 % non-\mgfnote{} \Scfnote{} typesetting also refers to the register to pass
6765 % it to \!\pcol@flushclear! as its argument so as to make an explicit page
6766 % break if the register has some deferred footnotes.
6767 % \end{macro}
6768 % 
6769 % \begin{macro}{\pcol@prespan}
6770 % \changes{v1.3-1}{2013/09/17}
6771 % {Introduced to save pre-spanning-text stuff.}
6772 % 
6773 % The \!\box! register \!\pcol@prespan! keeps the \prespan{} during a
6774 % \mctext{} is processed by \TeX{} and our own \!\output! routine. That is,
6775 % the macro \!\pcol@putbackmvl! saves the contents $\cc_0(\vb^b)$ of
6776 % the column 0 to be restarted into the register instead of putting it back
6777 % to the main vertical list, or makes the register $\bot$ if the column has
6778 % nothing, when the restart follows the \sync{}ation with
6779 % $\CSIndex{ifpcol@sptextstart}=\true$. Then the contents of the register
6780 % is put back to the main vertical list together with the box having
6781 % \mctext{} after its vertical size is registered in the list $\pp^s(p)$ of
6782 % \mctext{} positions and heights, by \!\pcol@makecol! when the text sees a
6783 % page break, or by \!\pcol@output@switch! when the text is completed.
6784 % \end{macro}
6785 % 
6786 % \begin{macro}{\pcol@rightpage}
6787 % \changes{v1.3-2}{2013/09/17}
6788 % {Introduced to have the ship-out image of a right parallel-page.}
6789 % 
6790 % The \!\box! register \!\pcol@rightpage! is used to build (a part of) the
6791 % ship-out image of a right \parapag{}e in it. The macros;
6792 % 
6793 % \begin{quote}\raggedright
6794 % \!\pcol@outputelt!,
6795 % \!\pcol@ioutputelt!,
6796 % \!\pcol@makeflushedpage!,
6797 % \!\pcol@flushfloats!,
6798 % \!\pcol@output@flush!, and
6799 % \!\pcol@output@clear!
6800 % \end{quote}
6801 % 
6802 % work on the register together with \!\@outputbox! for
6803 % the left \parapag{}e to pass both of them to (our of version of)
6804 % \!\@outputpage!. The macro \!\pcol@output@end! also uses the register to
6805 % paint the \bground{} of the empty counterpart of non-merged \Scfnote{}s in
6806 % it, or to make the register $\bot$ when it have an empty \lpage{} but with
6807 % \spanning{} of \pwise{} floats. After closing a \env{paracol}
6808 % environment, the contents of the register
6809 % will be shipped out by
6810 % \!\@outputpage! invoked outside \env{paracol} environment when the
6811 % \postenv{} sees a page break, or referred to by \!\pcol@output@start! as
6812 % the \preenv{} in the right \parapag{}e. This right \preenv{} then will be
6813 % combined with \colpage{}s in the right \parapag{}e by \!\pcol@ioutputelt!
6814 % or \!\pcol@imakeflushedpage! for shipping-out, or by
6815 % the latter indirectly invoked from \!\pcol@output@end! as the
6816 % last\Index{last page}{} right \parapag{}e again. Therefore the \!\setbox!
6817 % of the register in \!\pcol@output@start!, \!\pcol@makeflushedpage!,
6818 % \!\pcol@imakeflushedpage! and \!\pcol@output@end! must be done
6819 % \!\global!ly\footnote{
6820 % 
6821 % The \!\global! setting in \!\pcol@makeflushedpage! and
6822 % \!\pcol@imakeflushedpage!, together with \!\@outputbox! which does not
6823 % need \!\global! assignment, is also required by the sake of simplicity in
6824 % its implementation, incidentally.}.
6825 % \end{macro}
6826 % 
6827 % \begin{macro}{\pcol@colorstack@saved}
6828 % \changes{v1.34}{2018/05/07}
6829 % {Introduced as $\mathit{\Gamma}_s$ to keep the color stack
6830 % $\mathit{\Gamma}^c$ until a column-page of $c$ becomes non-empty.}
6831 % 
6832 % The \!\box! register \!\pcol@colorstack@saved! is $\csts$ to keep the
6833 % \colorctext{} $\CST^c$ of column $c$ until its \ccolpage{} becomes non-empty
6834 % to avoid that the \colpage{} only has coloring \!\special!s for
6835 % \colorstack{} establishing and rewinding to let \!\pcol@ifempty! misjudge
6836 % the \colpage{} is non-empty. It is let have $\Celt^c$, if defined,
6837 % and $\cst$ by \!\pcol@savecolorstack! invoked from \!\pcol@startcolumn!
6838 % and \!\pcol@output@start!, and from \!\pcol@restartcolumn! through
6839 % \!\pcol@putbackmvl! when we know or find the (re)starting \colpage{} is
6840 % empty. The macro \!\pcol@putbackmvl! also makes the \!\box! register
6841 % $\bot$ when the restarting \colpage{} is not empty and thus the \colpage{}
6842 % has had coloring \!\special!s for establishing \colorctext{} at its
6843 % beginning. Then the register is given to \!\pcol@restorecst! by
6844 % \!\pcol@clearcst@unvbox! to put leading coloring \!\special!s for
6845 % establishing of the \colpage{} when we complete it by \!\pcol@opcol! or
6846 % leave from it by \!\pcol@output@switch!.
6847 % \end{macro}
6848 % 
6849 % \begin{macro}{\pcol@tempboxa}
6850 % \changes{v1.3-3}{2013/09/17}
6851 % {Introduced to have materials temporarily for column-separating rule
6852 % drawing or background painting.}
6853 % \changes{v1.34}{2018/05/07}
6854 % {Renamed from \cs{pcol@tempbox} because its relative
6855 % \cs{pcol@tempboxb} is introduced.}
6856 % \changes{v1.34}{2018/05/07}
6857 % {Add usage in \cs{pcol@scancst} and \cs{pcol@iscancst}.}
6858 % 
6859 % The \!\box! register \!\pcol@tempboxa! is used to have stuff temporarily as
6860 % follows.
6861 % 
6862 % \begin{itemize}
6863 % \item
6864 % The macro \!\pcol@buildcolseprule! and its callee \!\pcol@buildcselt!
6865 % builds the \cseprule{} in the register for a page to be shipped out, while
6866 % its contents is put into each \csepgap{} by \!\pcol@hfil!.
6867 %
6868 % \item
6869 % In (our own version of) \!\@outputpage!, the register has the \bgpaint{}
6870 % of the (left parallel-) page,
6871 % 
6872 % \Index{parallel-paging}
6873 % 
6874 % which is inserted into the ship-out image by its callee
6875 % \!\pcol@outputpage@l! through \!\everyvbox! and its contents
6876 % \!\pcol@outputpage@ev!.
6877 %
6878 % \item
6879 % In \!\pcol@scancst! and its callee \!\pcol@iscancst! to scan $\CSTraw^c$,
6880 % $\CST^c$ or $\csts$, the sequence of (un)coloring \!\special!s to be put
6881 % into the main vertical list is build in it.
6882 % \end{itemize}
6883 % \end{macro}
6884 % 
6885 % \begin{macro}{\pcol@tempboxb}
6886 % \changes{v1.34}{2018/05/07}
6887 % {Introduced to extract the top of color stack $\mathit{\Gamma}$,
6888 % $\mathit{\Gamma}_r$ or $\mathit{\Gamma}_s$.}
6889 % 
6890 % The \!\box! register \!\pcol@tempboxb! is used in \!\pcol@iscancst!
6891 % to extract the top (last) element of $\cst$, $\cstraw$ or $\csts$.
6892 % \end{macro}
6893 % 
6894 % \begin{macrocode}
6895 \newbox\pcol@topfnotes
6896 \newbox\pcol@prespan \setbox\pcol@prespan\box\voidb@x
6897 \newbox\pcol@rightpage \global\setbox\pcol@rightpage\box\voidb@x
6898 \newbox\pcol@colorstack@saved
6899 \newbox\pcol@tempboxa
6900 \newbox\pcol@tempboxb
6901 % \end{macrocode}
6902 %
6903 %
6904 %
6905 % \subsection{\cs{insert} Register Set}
6906 % \changes{v1.34}{2018/05/07}
6907 % {Add \Sec3.6 ``\cs{insert} Register Set'' for \cs{pcol@colorins}.}
6908 %
6909 % The next declaration is for the following \!\insert! register set.
6910 % 
6911 % \begin{macro}{\pcol@colorins}
6912 % \changes{v1.34}{2018/05/07}
6913 % {Introduced to present text-coloring operations to \cs{output}
6914 % synchronously with column-pages.}
6915 % 
6916 % The register set \!\pcol@colorins! is to \!\insert! a \!\vbox! containing a
6917 % (un)coloring \!\special! for color pushing or popping, or the definition
6918 % of a new default color of the current column. In order to make it sure
6919 % that an \!\insert!ion does not affect \!\pagetotal! and is given to
6920 % \!\output! with |\box255| containing the corresponding coloring
6921 % \!\special! put in the main vertical list, \!\count!\!\pcol@colorins! and
6922 % \!\skip!\!\pcol@colorins! are let be 0, while \!\dimen!\!\pcol@colorins! is
6923 % let be \!\maxdimen! to allow a \colpage{} to have virtually infinite number
6924 % of \!\insert!ions.
6925 %
6926 % The \!\insert!ion is done by \!\pcol@icolumncolor! for a default color
6927 % definition, \!\pcol@set@color@push! for color pushing, and
6928 % \!\pcol@reset@color@pop! and \!\pcol@reset@color@mpop! for color popping
6929 % in non-math and math mode respectively. Then \!\insert!ed \!\vbox!es are
6930 % packed into \!\box!\!\pcol@colorins! and is given to \!\output! as
6931 % $\cstraw$ to be scanned by \!\pcol@clearcolorstack! to reform it as
6932 % $\cst$, and then scanned by \!\pcol@restorecolorstack! or saved into
6933 % $\csts=\!\pcol@colorstack@saved!$ by \!\pcol@savecolorstack!. The
6934 % register is also referred to by $\!\pcol@scancst!\arg{box}$ to examine if
6935 % $\arg{box}$ is this register or \!\pcol@colorstack@saved!, and is made
6936 % $\bot$ by \!\pcol@output@end! after the final reestablishment of the
6937 % \colorstack.
6938 % 
6939 % \begin{macrocode}
6940 \newinsert\pcol@colorins
6941 \count\pcol@colorins\z@ \skip\pcol@colorins\z@ \dimen\pcol@colorins\maxdimen
6942 % \end{macrocode}
6943 % \end{macro}
6944 %
6945 %
6946 %
6947 % \subsection{\cs{toks} Register}
6948 %
6949 % The last declaration is for the following \!\toks! register.
6950 % 
6951 % \begin{macro}{\pcol@everyvbox}
6952 % \changes{v1.22}{2013/06/30}
6953 % {Introduced to keep \cs{everyvbox} work as usual while having
6954 % \cs{pcol@innertrue} in it always.}
6955 % 
6956 % The register \!\pcol@everyvbox! acts as \!\everyvbox! in \env{paracol}
6957 % environments. That is, by \!\pcol@zparacol!, \!\everyvbox! is made
6958 % \!\let!-equal to this register so that updates and references of
6959 % \!\everyvbox! is made to this register, while the real \!\everyvbox! is
6960 % let have the reference to the register and |\pcol@innertrue| to make
6961 % $\CSIndex{ifpcol@inner}=\true$ in every \!\vbox!. Besides
6962 % \!\pcol@zparacol!, the register is referred to by
6963 % \!\pcol@restoreeveryvbox! to examine if it has been \!\global!ly updated,
6964 % i.e., its contents is not \!\pcol@dummytoken!.
6965 % \end{macro}
6966 % 
6967 % \begin{macrocode}
6968 \newtoks\pcol@everyvbox
6969
6970 % \end{macrocode}
6971 %
6972 %
6973 %
6974 % \section{Logging Tools}
6975 % \label{sec:imp-logging}
6976 %
6977 % Prior to the \!\def!initions of macros to implement \textsf{paracol}'s
6978 % functions, we define a few macros for debug logging.
6979 % 
6980 % \begin{macro}{\pcol@ShowBox}
6981 % \changes{v1.2-2}{2013/05/11}
6982 % {Introduced for debugging page-wise footnote functions.}
6983 % \changes{v1.3-6}{2013/09/17}
6984 % {Change \cs{unvcopy} to \cs{copy} to make sure the argument box
6985 % causes overfull if its height is positive and even if it has
6986 % nothing.}
6987 % \changes{v1.34}{2018/05/07}
6988 % {Add messaging {\tt (VOID)} if $\langle b\rangle\EQ\bot$,
6989 % $\cs{vfuzz}\gets0$ to ensure overfull, and \cs{vskip} of 1\,{\tt
6990 % pt} if $\langle b\rangle$'s height is 0 to ensure overfull too.}
6991 % 
6992 % The macro $\!\pcol@ShowBox!\arg{b}$ puts a logging \!\message! showing the
6993 % height, depth and width of the \!\box! (or \!\insert!) register $b$, or
6994 % ``|(VOID)|'' if $b=\bot$. Then, if $b\neq\bot$, $b$'s contents is dumped
6995 % into |.log| file making overfull intentionally by putting $b$ into
6996 % \!\box!|0| of null height, together with \!\vskip! of 1\,|pt| if $b$'s
6997 % height is 0, with setting $\!\vfuzz!=0$.
6998 % \end{macro}
6999 % 
7000 % \KeepSpace{13}
7001 % \begin{macro}{\pcol@LogLevel}
7002 % \changes{v1.2-2}{2013/05/11}
7003 % {Introduced for debugging page-wise footnote functions.}
7004 % \begin{macro}{\pcol@iLogLevel}
7005 % \changes{v1.2-2}{2013/05/11}
7006 % {Introduced for debugging page-wise footnote functions.}
7007 % \begin{macro}{\pcol@Log}
7008 % \changes{v1.2-2}{2013/05/11}
7009 % {Introduced for debugging page-wise footnote functions.}
7010 % \begin{macro}{\pcol@Log@iii}
7011 % \changes{v1.2-2}{2013/05/11}
7012 % {Introduced for debugging page-wise footnote functions.}
7013 % \begin{macro}{\pcol@Log@ii}
7014 % \changes{v1.2-2}{2013/05/11}
7015 % {Introduced for debugging page-wise footnote functions.}
7016 % \begin{macro}{\pcol@Log@i}
7017 % \changes{v1.2-2}{2013/05/11}
7018 % {Introduced for debugging page-wise footnote functions.}
7019 % \begin{macro}{\pcol@Logstart}
7020 % \changes{v1.2-2}{2013/05/11}
7021 % {Introduced for debugging page-wise footnote functions.}
7022 % \begin{macro}{\pcol@Logstart@ii}
7023 % \changes{v1.2-2}{2013/05/11}
7024 % {Introduced for debugging page-wise footnote functions.}
7025 % \begin{macro}{\pcol@Logstart@i}
7026 % \changes{v1.2-2}{2013/05/11}
7027 % {Introduced for debugging page-wise footnote functions.}
7028 % \begin{macro}{\pcol@Logend}
7029 % \changes{v1.2-2}{2013/05/11}
7030 % {Introduced for debugging page-wise footnote functions.}
7031 % \begin{macro}{\pcol@Logend@ii}
7032 % \changes{v1.2-2}{2013/05/11}
7033 % {Introduced for debugging page-wise footnote functions.}
7034 % \begin{macro}{\pcol@Logend@i}
7035 % \changes{v1.2-2}{2013/05/11}
7036 % {Introduced for debugging page-wise footnote functions.}
7037 % \begin{macro}{\pcol@Logfn}
7038 % \changes{v1.2-2}{2013/05/11}
7039 % {Introduced for debugging page-wise footnote functions.}
7040 % \begin{macro}{\pcol@Logfn@ii}
7041 % \changes{v1.2-2}{2013/05/11}
7042 % {Introduced for debugging page-wise footnote functions.}
7043 % \begin{macro}{\pcol@Logfn@i}
7044 % \changes{v1.2-2}{2013/05/11}
7045 % {Introduced for debugging page-wise footnote functions.}
7046 % 
7047 % The macro $\!\pcol@LogLevel!\arg{l_1}\arg{l_2}\arg{l_3}$ defines the
7048 % detailedness of logging done by logging macros. It invokes
7049 % $\!\pcol@iLogLevel!\Arg{l_i}\Arg{cs}$ to let the following $|\|\arg{cs}$
7050 % be $|\|\arg{cs}|@|\arg{l'_i}$ where $l'_i$ is the \!\romannumeral!
7051 % representation of $l_i$.
7052 % 
7053 % \begin{itemize}
7054 % \item
7055 % $\!\pcol@Log!\arg{cs}\Arg{m}\arg{f}$ is to log the contents of the \!\insert!
7056 % register $f$ containing footnotes which is referred to by the macro
7057 % $\arg{cs}$ in a context shown by $m$. The macro \!\pcol@Log@iii!
7058 % ($l_1=3$) logs the detailed contents of $f$ by \!\pcol@ShowBox!, while
7059 % \!\pcol@Log@ii! ($l_1=2$) just shows the height of $f$ and \!\pcol@Log@i!
7060 % ($l_1=1$) does nothing.
7061 %
7062 % \item
7063 % $\!\pcol@Logstart!\Arg{m}$ and $\!\pcol@Logend!\Arg{m}$ put logging
7064 % \!\message!s `$|S:|m$' and `$|E:|m$' respectively to show the beginning
7065 % and end of a procedure in the macro whose name is at the head of $m$, if
7066 % $l_2=2$ and thus they are \!\let!-equal to \!\pcol@Logstart@ii! and
7067 % \!\pcol@Logend@ii!. If $l_2=1$, \!\pcol@Logstart@i! and \!\pcol@Logend@i!
7068 % do nothing.
7069 %
7070 % \item
7071 % $\!\pcol@Logfn!\Arg{m}$ puts a logging \!\message! $m$ whose head is the
7072 % macro name for footnotes whose information such as the ordinal number of
7073 % the footnote processed by the macro may be shown in $m$ as well, if
7074 % $l_3=2$ and thus it is \!\let!-equal to \!\pcol@Logfn@ii!. If $l_3=1$,
7075 % \!\pcol@Logfn@i! does nothing.
7076 % \end{itemize}
7077 % \end{macro}\end{macro}
7078 % \end{macro}\end{macro}\end{macro}\end{macro}
7079 % \end{macro}\end{macro}\end{macro}
7080 % \end{macro}\end{macro}\end{macro}
7081 % \end{macro}\end{macro}\end{macro}
7082 % 
7083 % \begin{macrocode}
7084 %% Logging Tools
7085
7086 \def\pcol@ShowBox#1{%
7087 \ifvoid#1\message{(VOID)}%
7088 \else
7089 \message{(\the\ht#1+\the\dp#1)x(\the\wd#1)}%
7090 {\vfuzz\z@ \showboxdepth\@M \showboxbreadth\@M
7091 \setbox\z@\vbox to\z@{\ifdim\ht#1=\z@ \vskip1\p@\fi \copy#1}}%
7092 \fi}
7093 \def\pcol@LogLevel#1#2#3{%
7094 \pcol@iLogLevel{#1}{pcol@Log}%
7095 \pcol@iLogLevel{#2}{pcol@Logstart}%
7096 \pcol@iLogLevel{#2}{pcol@Logend}%
7097 \pcol@iLogLevel{#3}{pcol@Logfn}}
7098 \def\pcol@iLogLevel#1#2{%
7099 \expandafter\let\expandafter\reserved@a
7100 \csname #2@\romannumeral#1\endcsname
7101 \expandafter\let\csname #2\endcsname\reserved@a}
7102 \def\pcol@Log@iii#1#2#3{\message{\string#1{#2%
7103 (\number\pcol@page:\number\pcol@currcol/\number\pcol@toppage)}}%
7104 \pcol@ShowBox#3\message{end\string#1}}
7105 \def\pcol@Log@ii#1#2#3{\message{\string#1{#2%
7106 (\number\pcol@page:\number\pcol@currcol/\number\pcol@toppage)}=\the\ht#3}}
7107 \def\pcol@Log@i#1#2#3{}
7108 \def\pcol@Logstart@ii#1{\message{S\string#1}}
7109 \def\pcol@Logend@ii#1{\message{E\string#1}}
7110 \def\pcol@Logstart@i#1{}
7111 \def\pcol@Logend@i#1{}
7112 \def\pcol@Logfn@ii#1{\message{\string#1}}
7113 \def\pcol@Logfn@i#1{}
7114 \pcol@LogLevel111
7115
7116 % \end{macrocode}
7117 %
7118 % \begin{macro}{\pcol@F@write}
7119 % \changes{v1.32-2}{2015/10/10}
7120 % {Introduced for debugging memory leak problems.}
7121 % \begin{macro}{\pcol@F}
7122 % \changes{v1.32-2}{2015/10/10}
7123 % {Introduced for debugging memory leak problems.}
7124 % \begin{macro}{\pcol@FF}
7125 % \changes{v1.32-2}{2015/10/10}
7126 % {Introduced for debugging memory leak problems.}
7127 % \begin{macro}{\pcol@F@count}
7128 % \changes{v1.32-2}{2015/10/10}
7129 % {Introduced for debugging memory leak problems.}
7130 % \begin{macro}{\pcol@F@n}
7131 % \changes{v1.32-2}{2015/10/10}
7132 % {Introduced for debugging memory leak problems.}
7133 % \begin{macro}{\pcol@Fb}
7134 % \changes{v1.32-2}{2015/10/10}
7135 % {Introduced for debugging memory leak problems.}
7136 % \begin{macro}{\pcol@Fe}
7137 % \changes{v1.32-2}{2015/10/10}
7138 % {Introduced for debugging memory leak problems.}
7139 % Another debugging tool is for investigating memory leak problems. Since
7140 % \Paracol{} uses \!\insert! registers for various purposes, management
7141 % operations of them especially that for proper release of them are crucial
7142 % for the correctness of the implementation. A source of toughness in
7143 % debugging {\em memory leak} caused by missing a release of a register back
7144 % to \!\@freelist! is that the resulting shortage is revealed long after the
7145 % leakage to make it hard to find the point of the leakage.
7146 %
7147 % The set of macros is to help such debugging by logging the acquire and
7148 % release of \!\insert! registers into a file named $\arg{job}|.fls|$
7149 % associated with \!\pcol@F@write! where $\arg{job}$ is given by
7150 % \!\jobname!. After opened when \Paracol{} is loaded, the file is written by
7151 % $\!\pcol@FF!\Arg{m_a}\Arg{m_b}$ with a line of the following form with
7152 % text messages $m_a$ and $m_b$, where $p=\!\pcol@page!$,
7153 % $c=\!\pcol@currcol!$, $\ptop=\!\pcol@toppage!$, $\pi=\page(p)=\!\c@page!$,
7154 % and $n_b=\!\pcol@F@n!$ is the cardinality of \!\@deferlist! counted by
7155 % \!\pcol@F@count!.
7156 % 
7157 % \begin{itemize}\item[]
7158 % $\arg{m_a}|(|\arg{p}|:|\arg{c}|/|\arg{\ptop}|:|\arg{\pi}|)=|
7159 % \arg{n_b}\arg{m_b}$
7160 % \end{itemize}
7161 % 
7162 % The argument $\arg{m_b}$ is empty when $\!\pcol@FF!$ is invoked from
7163 % $\!\pcol@F!\arg{m_a}$ for snapshot, while
7164 % $\arg{m_b}=\hbox{`|<=|$\arg{n_b}$'}$ when invoked from
7165 % $\!\pcol@Fe!\arg{m_a}$ paired by $\!\pcol@Fb!=\!\pcol@F@count!$ by which
7166 % the cardinality of \!\@freelist! is given to $\arg{n_b}$ through
7167 % \!\pcol@F@n! and then \!\reserved@a!. Therefore, by the pair of
7168 % \!\pcol@Fb! and \!\pcol@Fe!, the consumption or restitution in a series of
7169 % operations surrounded by the pair is logged in the file.
7170 %
7171 % In the production version, the logging is disabled of course by \!\let!ting
7172 % \!\pcol@F! and \!\pcol@Fe! be \!\@gobble! and \!\pcol@F! be \!\relax!,
7173 % while the open of \!\pcol@F@write! is disabled as well by a pair of
7174 % \cs{iffalse} and \cs{fi}.
7175 % \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
7176 % 
7177 % \begin{macrocode}
7178 \iffalse
7179 \newwrite\pcol@F@write
7180 \immediate\openout\pcol@F@write\jobname.fls
7181 \fi
7182 \def\pcol@F#1{\pcol@FF{#1}{}}
7183 \def\pcol@FF#1#2{\pcol@F@count
7184 \immediate\write\pcol@F@write{#1(\number\pcol@page:\number\pcol@currcol/%
7185 \number\pcol@toppage:\number\c@page)=\pcol@F@n #2}}
7186 \def\pcol@F@count{{\@tempcnta\z@
7187 \def\@elt##1{\advance\@tempcnta\@ne}\@freelist
7188 \xdef\pcol@F@n{\number\@tempcnta}}}
7189 \let\pcol@Fb\pcol@F@count
7190 \def\pcol@Fe#1{{\let\reserved@a\pcol@F@n \pcol@FF{#1}{<=\reserved@a}}}
7191 \let\pcol@F\@gobble
7192 \let\pcol@Fb\relax
7193 \let\pcol@Fe\@gobble
7194
7195 % \end{macrocode}
7196 %
7197 %
7198 %
7199 % \section{\cs{output} Routine}
7200 % \label{sec:imp-output}
7201 %
7202 % \begin{macro}{\pcol@ovf}
7203 % Before giving the definitions of macros in \!\output! routine, we define
7204 % the macro \!\pcol@ovf! invoked if \!\@freelist! is empty on an acquisition
7205 % of an \!\insert! by \!\@next! and thus we have to abort the execution by
7206 % \!\PackageError! with a message notifying the shortage. The additional
7207 % help message is \!\@ehb! as in \!\@fltovf!. This macro is used in
7208 % \!\pcol@opcol!, \!\pcol@startpage!, \!\pcol@output@start!,
7209 % \!\pcol@output@switch!, \!\pcol@iscancst!, \!\pcol@savefootins!,
7210 % \!\pcol@flushcolumn!, \!\pcol@synccolumn!, \!\pcol@output@end! and
7211 % \!\pcol@icolumncolor!.
7212 % \end{macro}
7213 % 
7214 % \begin{macrocode}
7215 %% \output Routine
7216
7217 \def\pcol@ovf{%
7218 \PackageError{paracol}{Too many unprocessed columns/floats}\@ehb}
7219
7220 % \end{macrocode}
7221 %
7222 % \begin{macro}{\pcol@output}
7223 % \changes{v1.2-2}{2013/05/11}
7224 % {Add \cs{pcol@Logstart} and \cs{pcol@Logend}.}
7225 % \changes{v1.2-7}{2013/05/11}
7226 % {Add the examination of \cs{ifpcol@output} and \protect\LaTeX's
7227 % original sequence for \cs{output} request sneaked from outside of
7228 % \texttt{paracol} environment.}
7229 % \changes{v1.2-7}{2013/05/11}
7230 % {Add the assignment of \cs{@maxdepth} to \cs{maxdepth} to nullify
7231 % the temporary setting done by \cs{@addtobot}.}
7232 % \changes{v1.33-2}{2016/11/19}
7233 % {Add a space after \cs{@opcol} to obey the coding convention.}
7234 % 
7235 % The macro \!\pcol@output! is the \Paracol's version of \!\output! which
7236 % is let have this macro as its sole token by \!\pcol@zparacol!. The
7237 % structure of this macro is same as that of \LaTeX's \!\output! but the
7238 % following replacements are made\footnote{.
7239 % 
7240 % Besides the logging with \cs{pcol@Logstart} and \cs{pcol@Logend}.}.
7241 % 
7242 % \begin{itemize}
7243 % \item
7244 % $\!\@specialoutput!\to\!\pcol@specialoutput!$ to process \LaTeX's genuine
7245 % functions including the customized marginal note placement, and \Paracol's
7246 % own special output functions; starting first page, \colorctext{} management,
7247 % \cswitch, page flushing with\slash without float flushing, and building the
7248 % multi-column part of the \lpage.
7249 %
7250 % \item
7251 % \changes{v1.0}{2011/10/10}
7252 % {Replace \cs{@makecol} with \cs{pcol@makecol} for a special care for
7253 % column-pages with synchronization points.}
7254 % 
7255 % $\!\@makecol!\to\!\pcol@makecol!$ for a special care for \ccolpage{} having
7256 % \sync{}ation point and/or \Scfnote{}s.
7257 %
7258 % \item
7259 % $\!\@opcol!\to\!\pcol@opcol!$ to hold the \ccolpage{} which just has
7260 % completed.
7261 %
7262 % \item
7263 % \changes{v1.2-2}{2013/05/11}
7264 % {Add an argument \cs{@ne} to \cs{pcol@startcolumn} to distinguish it
7265 % from the invocation in \cs{pcol@freshpage}.}
7266 % 
7267 % $\!\@startcolumn!\to\!\pcol@startcolumn!$ to create a new \colpage{}. The
7268 % argument \!\@ne! is to distinguish the invocation in this macro from
7269 % that in \!\pcol@freshpage! so that the \!\insert!ions of $\pp^f(p)$ and
7270 % $\df$ are done only when a new \colpage{} is created with ordinary page
7271 % break.
7272 % \end{itemize}
7273 % 
7274 % \changes{v1.22}{2013/06/30}
7275 % {Add reset of \cs{set@color}.}
7276 % \changes{v1.24}{2013/07/27}
7277 % {Add zero-clear of \cs{pcol@mcid}.}
7278 % \changes{v1.3-1}{2013/09/17}
7279 % {Add $\cs{ifpcol@sptextstart}\EQ\string\mathit{false}$ to the
7280 % condition for the warning of too small \cs{vsize}.}
7281 % 
7282 % In addition, before we start the main body of \!\output! routine, we add
7283 % two operations for coloring. One is to make
7284 % \!\set@color! \!\let!-equal to \!\pcol@set@color!, i.e, to let it regain
7285 % its original definition throughout \!\output! routine, because
7286 % no manipulation of \colorstack{} is necessary\footnote{
7287 % 
7288 % Though this operation is not necessary because \cs{everyvbox} should work
7289 % for any \cs{set@color} because they should be in a \cs{vbox}, we dare to
7290 % do it for clarity.}.
7291 % 
7292 % The other is to zero-clear the counter \!\pcol@mcid! because we are
7293 % definitely in the main (non-internal) vertical mode and thus all push/pop
7294 % pairs of the coloring in math mode have been processed.
7295 %
7296 % Further, before we start the sequence for non-special \!\output! request
7297 % on page breaks, we examine if $\CSIndex{ifpcol@output}=\true$ to mean
7298 % \!\pcol@output@start! has already been invoked in order to cope with
7299 % \!\output! request {\em sneaking}. This sneaking happens when
7300 % \beginparacol{} is at a critical position of page breaking at which the
7301 % \preenv{} has already exceeds \!\vsize! but \TeX{} cannot make the
7302 % \!\output! request for the page break at \CSIndex{par} at the beginning of
7303 % \!\pcol@zparacol! because it sees $\!\penalty!=10000$ due to, e.g., a
7304 % sectioning command just preceding \beginparacol. In this case, the
7305 % request is postponed until \TeX{} see a \!\penalty! less than 10000 and
7306 % thus it is made with some non-special \!\outputpenalty! greater than
7307 % $-10000$ when \TeX{} sees the dummy request of $\!\penalty!=-10004$ in
7308 % \!\pcol@invokeoutput! for \!\pcol@output@start!. At this timing,
7309 % \!\pcol@zparacol! has already let \!\output! have \!\pcol@output! of
7310 % course but the request must be processed by original \!\output! because it
7311 % is made {\em outside} of the \env{paracol} environment which has just
7312 % started. Therefore, if $\CSIndex{ifpcol@output}=\false$, we have to
7313 % perform the operation sequence as the original \!\output! does.
7314 % Furthermore, we have to take care of the fact that a few our own settings
7315 % related to \!\output! routine has already been made in \!\pcol@zparacol!,
7316 % namely $\CSIndex{if@twocolumn}=\true$ and
7317 % $\!\@combinefloats!=\!\pcol@combinefloats!$, which should make the macros
7318 % in the original sequence confused especially by the former. Therefore, we
7319 % turns $\CSIndex{if@twocolumn}=\false$ and let \!\@combinefloats! have the
7320 % original definition kept in \!\pcol@@combinefloats!\footnote{
7321 % 
7322 % Though we know \cs{pcol@combinefloats} acts exactly as \cs{@combinefloats}
7323 % because \cs{pcol@zparacol} initializes $\cs{pcol@textfloatsep}=\infty$ and
7324 % $\cs{ifpcol@lastpage}=\false$. On the other hand, we don't cancel the
7325 % re\cs{def}inition of \cs{footnoterule} because it should be
7326 % $\cs{textwidth}=\cs{columnwidth}$ outside of \env{paracol} environments.}
7327 % 
7328 % temporarily, i.e., only in the group automatically surrounding the
7329 % invocation of \!\output!.
7330 %
7331 % Another addition is to assign \!\@maxdepth! to \!\maxdepth! in order to
7332 % nullify the temporary setting to 0 done in \!\@addtobot!. By this
7333 % assignment, in \env{paracol} environments \TeX's page builder always
7334 % refers to the value in \!\@maxdepth!. Yet another addition is to add
7335 % $\CSIndex{ifpcol@sptextstart}=\false$ to the condition for the warning of
7336 % too short \!\vsize!, because a \mctext{} can start near the bottom of a
7337 % page with a small \!\@colroom! less than $1.5\times\!\baselineskip!$ and
7338 % thus the warning is unnecessary and inappropriate when
7339 % $\CSIndex{ifpcol@sptextstart}=\true$.
7340 % 
7341 % \begin{macrocode}
7342 \def\pcol@output{\let\par\@@par \let\set@color\pcol@set@color
7343 \global\pcol@mcid\z@
7344 \pcol@Logstart{\pcol@output\number\outputpenalty
7345 (\number\c@page:\number\pcol@currcol)}%
7346 \ifnum\outputpenalty<-\@M
7347 \pcol@specialoutput
7348 \else\ifpcol@output
7349 \pcol@makecol
7350 \pcol@opcol
7351 \pcol@startcolumn\@ne
7352 \@whilesw\if@fcolmade\fi{\pcol@opcol \pcol@startcolumn\@ne}%
7353 \else
7354 \@twocolumnfalse \let\@combinefloats\pcol@@combinefloats
7355 \@makecol
7356 \@opcol
7357 \@startcolumn
7358 \@whilesw\if@fcolmade\fi{\@opcol \@startcolumn}%
7359 \fi\fi
7360 \global\maxdepth\@maxdepth
7361 \ifnum\outputpenalty>-\@Miv
7362 \ifdim\@colroom<1.5\baselineskip
7363 \ifdim\@colroom<\textheight
7364 \ifpcol@sptextstart
7365 \global\vsize\@colroom
7366 \else
7367 \@latex@warning@no@line{Text page \thepage\space
7368 contains only floats}%
7369 \@emptycol
7370 \fi
7371 \else
7372 \global\vsize\@colroom
7373 \fi
7374 \else
7375 \global\vsize\@colroom
7376 \fi
7377 \else
7378 \global\vsize\maxdimen
7379 \fi
7380 \pcol@Logend\pcol@output}
7381
7382 % \end{macrocode}
7383 % \end{macro}
7384 %
7385 %
7386 %
7387 % \section{Completing Column-Page}
7388 % \label{sec:imp-opcol}
7389 %
7390 % \begin{macro}{\pcol@@makecol}
7391 % \changes{v1.2-7}{2013/05/11}
7392 % {Introduced to cope with the careless implementation of \cs{@makecol}
7393 % in p\string\LaTeX.}
7394 % \changes{v1.3-6}{2013/09/17}
7395 % {Add an argument $d$ to be assigned to \cs{boxmaxdepth} to let it
7396 % have 0 rather than \cs{@maxdepth} for last page.}
7397 % 
7398 % The macro $\!\pcol@@makecol!\<d\>$ is used in \!\pcol@flushcolumn! and
7399 % \!\pcol@imakeflushedpage! which simply require \LaTeX's original
7400 % \!\@makecol! to build the ship-out image of a \colpage. The reason why we
7401 % need our own version is that a variation of \LaTeX, namely p\LaTeX{} for
7402 % Japanese, carelessly implements its own \!\@makecol! to make the resulting
7403 % \!\@outputbox! has a depth larger than \!\@maxdepth! if the \colpage{} has
7404 % \Mcfnote{}s whose last line is unusually deep. To cope with the problem,
7405 % this macro at first invokes \!\@makecol!, and then reshape \!\@outputbox!
7406 % assigning $d=\!\@maxdepth!$ to \!\boxmaxdepth! to cap its depth, unless
7407 % this macro is used for the \lpage{} with $d=0$ because depth of the last
7408 % component of the \!\@outputbox! is incorporated in \!\@colht!.
7409 % 
7410 % \begin{macrocode}
7411 %% Completing Column-Page
7412
7413 \def\pcol@@makecol#1{\@makecol
7414 \setbox\@outputbox\vbox to\@colht{\boxmaxdepth#1\unvbox\@outputbox}}
7415 % \end{macrocode}
7416 % \end{macro}
7417 % 
7418 % \begin{macro}{\pcol@makecol}
7419 % \changes{v1.0}{2011/10/10}
7420 % {Introduced for special float handling in a column-page with
7421 % synchronization points.}
7422 % \changes{v1.2-2}{2013/05/11}
7423 % {Add save/discard of page-wise footnotes.}
7424 % \changes{v1.2-7}{2013/05/11}
7425 % {Remove unnecessary check of \cs{ifpcol@lastpage} on the
7426 % redefinition of \cs{@textbottom}.}
7427 % \changes{v1.3-1}{2013/09/17}
7428 % {Add a function to capture a broken spanning text, to combine it
7429 % with pre-spanning-text stuff, and to shift it left on
7430 % column-swapping.}
7431 % \changes{v1.3-3}{2013/09/17}
7432 % {Add the addition of the element to $\pi^s(p)$ for a broken
7433 % spanning text.}
7434 % \changes{v1.3-4}{2013/09/17}
7435 % {Add $\pi^m(p)\EQ\cs{pcol@mparbottom}$ to the argument of
7436 % \cs{pcol@defcurrpage}.}
7437 % \changes{v1.3-3}{2013/09/17}
7438 % {Add \cs{@colht} and \cs{relax} as the first and third argument of
7439 % \cs{pcol@shrinkcolbyfn}.}
7440 % \changes{v1.32-2}{2015/10/10}
7441 % {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
7442 % \changes{v1.33-2}{2016/11/19}
7443 % {Move down the \cs{def}inition of \cs{pcol@currfoot} with $\bot$ to
7444 % place it just before the \cs{ifpcol@scfnote}/\cs{fi} construct to
7445 % make it clear how \cs{pcol@currfoot} is \cs{def}ined.}
7446 % 
7447 % The macro \!\pcol@makecol! is invoked solely from \!\pcol@output! to build
7448 % the shipping image of the \ccolpage{} which just has completed in
7449 % \!\@outputbox!. This macro has two additional functions to its original
7450 % version \!\@makecol!\footnote{
7451 % 
7452 % Not \cs{pcol@@makecol} because the depth capping of \cs{@outputbox} is
7453 % done by \cs{pcol@opcol} when it saves the box into $\cc_c(\vb^b)$.}
7454 % 
7455 % invoked in this macro.
7456 %
7457 % First, if $\cc_c(\tf)\neq\infty$ to mean the \colpage{} has \sync{}ation
7458 % points, \!\@makecol! is invoked with a special \!\def!inition of
7459 % \!\@textbottom! to put a vertical skip having $1/10000\,|fil|$ as its
7460 % stretch and shrink. This modification is to nullify not only finite
7461 % stretches (as \!\raggedbottom! does) but also finite shrinks possibly
7462 % inserted just below the last \sync{}ation point to move up the first
7463 % visible item upward a little bit if active. Therefore, \!\flushbottom!
7464 % setting is nullified for \colpage{}s having \sync{}ation points and a
7465 % small excess from the bottom of a \colpage{} cannot be absorbed by
7466 % shrinks but visible at the bottom\footnote{
7467 % 
7468 % That is, the author gives higher priority to the perfect alignment of the
7469 % items following a \sync{}ation point.}.
7470 % 
7471 % Note that the original definition of \!\@textbottom! is saved in
7472 % \Midx{\!\pcol@textbottom!} before the invocation of \!\@makecol! and is
7473 % restored after that\footnote{
7474 % 
7475 % This save/restore cannot be done by a grouping because \!\@makecol! builds
7476 % \!\@outputbox! by local assignments.}.
7477 %
7478 % Second, if $\CSIndex{pcol@sptext}=\true$ and $c=0$ to mean a \mctext{}
7479 % encounters a page break, we have the first half (or second or succeeding
7480 % part if the text lays across three or more pages) of the text in
7481 % \!\box!|255|. Therefore, we add an element $\spt(H_n,h_n)$ to the tail of
7482 % the list of \mctext{}s $\pp^s(\ptop)=\!\pcol@sptextlist!$, where $H_n$ is
7483 % the height of \prespan{} in \!\pcol@prespan!\footnote{
7484 % 
7485 % Since we have a \sync{}ation point before a \mctext{} always, \prespan{}
7486 % or its sole contents \cs{vbox} has a vertical skip at its tail to make the
7487 % its depth 0 as discussed in \secref{sec:imp-sout-sync}.}
7488 % 
7489 % plus the total height of top floats calculated by \!\pcol@addflhd! with
7490 % $\cc_c(\tl)=\!\@toplist!$, and $h_n$ is the height-plus-depth of
7491 % \!\box!|255|. Note that $H_n$ and $h_n$ are represented in the form of
7492 % integer and thus we produce them by expansions with \!\number!.
7493 %
7494 % The addition, however, is not made if $h_n=0$ because painting its
7495 % \bground{} is harmful if an extension is specified to make the region
7496 % visible, while not painting or drawing a segment of \cseprule{} is very
7497 % natural. Note that this $h_n=0$ case includes that in which \!\box!|255|
7498 % has nothing but its height-plus-depth is non-zero because of discarding
7499 % leading skips of the \mctext{} as pre-break skips. This special case is
7500 % detected by decapsulating \!\box!|255| by \!\unvcopy! and examining the
7501 % height-plus-depth of the result\footnote{
7502 % 
7503 % We cannot do
7504 % \cs{setbox}\cs{@cclv}\cs{vbox}\texttt{\Arg{\cs{unvbox}\cs{@cclv}}}
7505 % because it erases the effect of pre-break skip following some visible
7506 % material.}.
7507 % 
7508 % Also note that the list to be added is always for the \tpage{}, i.e.,
7509 % $\pp^s(\ptop)$ and thus we get and update it by \!\pcol@getcurrpinfo! and
7510 % \!\pcol@defcurrpage!, because the \mctext{} immediately follows a
7511 % \sync{}ation point in $\ptop$. Then we let \!\box!|255| have the
7512 % \prespan{} followed by the \mctext{} being the original contents of
7513 % \!\box!|255|, which may be shifted left by
7514 % $\WT-w_c=\!\textwidth!-\!\columnwidth!$ by the macro
7515 % \!\pcol@shiftspanning! if \cswap{} is in effect so that its left edge is
7516 % aligned to that of the leftmost column, i.e., of the text area.
7517 %
7518 % The third addition is for \Scfnote{}s. If they are presented in
7519 % \!\footins!, we shrink \!\@colht! by its height plus depth
7520 % by \!\pcol@shrinkcolbyfn! and put the stretch and shrink factor of
7521 % \!\skip!\!\footins! at the bottom of \!\box!|255| by \!\pcol@unvbox@cclv!
7522 % to {\em remove} footnotes from the \colpage{} but keeping the
7523 % stretch\slash shrink contribution to the page breaking by their existence.
7524 % Then we save \!\footins! into a new \!\insert! to be referred to as
7525 % \!\pcol@currfoot!\footnote{
7526 % 
7527 % Not in \cs{pcol@footins} because it is destroyed in \cs{pcol@startpage}
7528 % just before saving operation into $\pp^f(p)$.}
7529 % 
7530 % by \!\pcol@savefootins! if $p=\ptop$ so that it is saved in $\pp^f(p)$ by
7531 % \!\pcol@startpage! afterward, or simply discard the contents of
7532 % \!\footins! otherwise because $\pp^f(p)$ has already been fixed. Note
7533 % that these saving\slash discarding make \!\footins! void and thus
7534 % \!\@makecol! will not put footnotes.
7535 %
7536 % On the other hand, if footnote typesetting is \mcfnote{}, \!\footins! is
7537 % kept unchanged so that its contents will be put by \!\@makecol! if it has
7538 % something. As for \!\pcol@currfoot!, it should have its default value
7539 % $\!\voidb@x!=\bot$ assigned to it beforehand, so that, if $p=\ptop$,
7540 % \!\pcol@startpage! will make $\pp^f(p)=\bot$ unless \Scfnote{s} are given
7541 % in \!\footins!.
7542 % 
7543 % \begin{macrocode}
7544 \def\pcol@makecol{\let\pcol@textbottom\@textbottom
7545 \ifdim\pcol@textfloatsep=\maxdimen\else
7546 \def\@textbottom{\vskip\z@\@plus.0001fil\@minus.0001fil}\fi
7547 \ifpcol@sptext \ifnum\pcol@currcol=\z@
7548 \pcol@getcurrpinfo\@tempcnta\@tempdima\@tempskipa
7549 \setbox\@tempboxa\vbox{\unvcopy\@cclv}%
7550 \@tempdimb\ht\@tempboxa \advance\@tempdimb\dp\@tempboxa
7551 \ifdim\@tempdimb>\z@
7552 \@tempdimb\ht\@cclv \advance\@tempdimb\dp\@cclv
7553 \dimen@\ht\pcol@prespan \pcol@addflhd\@toplist\pcol@textfloatsep
7554 \@cons\pcol@sptextlist{{\number\dimen@}{\number\@tempdimb}}%
7555 \fi
7556 \pcol@defcurrpage{\number\@tempcnta}\pcol@spanning\pcol@footins
7557 {\pcol@sptextlist}{\pcol@mparbottom}%
7558 \setbox\@cclv\vbox{\unvbox\pcol@prespan \pcol@shiftspanning\@cclv
7559 \unvbox\@cclv}%
7560 \fi\fi
7561 \def\pcol@currfoot{\voidb@x}%
7562 \ifpcol@scfnote \ifvoid\footins\else
7563 \pcol@shrinkcolbyfn\@colht\footins\relax
7564 \setbox\@cclv\vbox{\pcol@unvbox@cclv\footins}%
7565 \ifnum\pcol@page=\pcol@toppage
7566 \pcol@Log\pcol@makecol{save}\footins
7567 \pcol@Fb
7568 \pcol@savefootins\pcol@currfoot
7569 \pcol@Fe{makecol(pagefn)}%
7570 \else
7571 \pcol@Log\pcol@makecol{discard}\footins
7572 \setbox\@tempboxa\box\footins
7573 \fi
7574 \fi\fi
7575 \pcol@Logstart\pcol@makecol
7576 \ifvoid\footins\else \pcol@Log\@makecol{put}\footins \fi
7577 \@makecol
7578 \pcol@Logend\pcol@makecol
7579 \let\@textbottom\pcol@textbottom}
7580 % \end{macrocode}
7581 % \end{macro}
7582 % 
7583 % \KeepSpace{1}
7584 % \begin{macro}{\@combinefloats}
7585 % \begin{macro}{\pcol@combinefloats}
7586 % \changes{v1.0}{2011/10/10}
7587 % {Introduced for special float handling in a column-page with
7588 % synchronization points.}
7589 % \changes{v1.2-2}{2013/05/11}
7590 % {Remove the shrink of \cs{textfloatsep} because each column in the last
7591 % page is now made not taller than \cs{@colht} definitely by the
7592 % introduction of the pre-flushing column height check.}
7593 % \changes{v1.2-7}{2013/05/11}
7594 % {Add the assignment of \cs{@maxdepth} to \cs{maxdepth} to nullify
7595 % the temporary setting done by \cs{@addtobot}.}
7596 % \changes{v1.3-6}{2013/09/17}
7597 % {Add special operations for columns having synchronization point to
7598 % move the infinite stretch and shrink to let it follow bottom floats
7599 % rather than preceding them.}
7600 % \begin{macro}{\pcol@@combinefloats}
7601 % \changes{v1.2-7}{2013/05/11}
7602 % {Introduced to solve the \cs{output} request sneaking.}
7603 % 
7604 % The macro \!\pcol@combinefloats! being our own version of \!\@combinefloats!
7605 % is used in \LaTeX's \!\@makecol! because the original and our
7606 % own are made \!\let!-equal by \!\pcol@zparacol!, and also used in
7607 % \!\pcol@makenormalcol! explicitly. The customization is twofold for both
7608 % of top and bottom floats.
7609 %
7610 % For the top floats, we invoke the original \!\@cflt! if
7611 % $\cc_c(\tf)=\infty$ to mean the \colpage{} to be shipped out does not have
7612 % \sync{}ation points, or otherwise our own \!\pcol@cflt! which we will
7613 % discuss shortly. Prior to the invocation of \!\@cflt!, in addition, we
7614 % let $\!\maxdepth!=\!\@maxdepth!$ so that the macro refers to the value used
7615 % throughout a \env{paracol} environment instead of that modified by
7616 % \!\@addtobot! possibly affect the work in \!\@cflt! by the following
7617 % sequence.
7618 % 
7619 % \begin{eqnarray*}
7620 % \!\pcol@flushcolumn!(c)&\to&\!\pcol@trynextcolumn!\to\cdots\to\!\@addtobot!\\
7621 % &\to&\!\pcol@flushcolumn!(c{+}k)\to\!\pcol@@makecol!\to\!\@makecol!\\
7622 % &\to&\!\pcol@combinefloats!\to\!\@cflt!
7623 % \end{eqnarray*}
7624 %
7625 % For the bottom floats, we invoke the original \!\@cflb! always but, if
7626 % the \colpage{} has \sync{}ation points, we insert vertical skips of
7627 % $s=0\,|pt|\ |plus|\ 0.0001\,|fil|\ |minus|\ 0.0001\,|fil|$ and $-s$ before
7628 % and after the invocation respectively. Since \!\@textbottom! is let have
7629 % the skip of $s$ by \!\pcol@makecol! for a \colpage{} having \sync{}ation
7630 % points and is inserted below bottom floats by \!\@makecol!\footnote{
7631 % 
7632 % The insertion point is common to \LaTeX{} and p\LaTeX{}.},
7633 % 
7634 % the effect of \!\@textbottom! is canceled by the skip of $-s$ but looks
7635 % moved above bottom floats. Therefore, if the natural height of the
7636 % \colpage{} is smaller than \!\@colht!, bottom floats are flushed to the
7637 % page bottom as if \colpage{} itself is flushed by \!\newpage! etc. On the
7638 % other hand, if the natural height is larger, more importantly, all shrinks
7639 % below the last \sync{}ation point is canceled by the infinite shrink in
7640 % $s$ above the bottom float but we should have sufficient space for shrinks
7641 % there thanks to \!\textfloatsep! to avoid the interference between the
7642 % bottom text and bottom floats.
7643 %
7644 % In addition, if $\CSIndex{ifpcol@lastpage}=\true$ to mean the \colpage{} is
7645 % in the \lpage{}, we insert \!\textfloatsep! in \!\@outputbox! below the
7646 % bottom floats so that they are well separated from \postenv. The switch
7647 % is also $\true$ in the invocation from \!\pcol@makenormalcol! for
7648 % \preenv{}, so that the bottom floats in it are well separated from the top
7649 % of multi-column stuff in the \spage.
7650 %
7651 % On the other hand, the original \!\@combinefloats! saved in
7652 % \!\pcol@@combinefloats! by \!\pcol@zparacol! is used in \!\pcol@output! to
7653 % restore the original when it finds \!\output! request sneaking.
7654 % 
7655 % \begin{macrocode}
7656 \def\pcol@combinefloats{%
7657 \global\maxdepth\@maxdepth
7658 \ifx\@toplist\@empty\else
7659 \ifdim\pcol@textfloatsep=\maxdimen \@cflt \else \pcol@cflt \fi
7660 \fi
7661 \ifx\@botlist\@empty\else
7662 \ifdim\pcol@textfloatsep=\maxdimen \@cflb
7663 \else
7664 \setbox\@outputbox\vbox{\unvbox\@outputbox
7665 \vskip\z@\@plus.0001fil\@minus.0001fil}%
7666 \@cflb
7667 \setbox\@outputbox\vbox{\unvbox\@outputbox
7668 \vskip\z@\@plus-.0001fil\@minus-.0001fil}%
7669 \fi
7670 \ifpcol@lastpage
7671 \setbox\@outputbox\vbox{\box\@outputbox \vskip\textfloatsep}%
7672 \fi
7673 \fi}
7674 % \end{macrocode}
7675 % \end{macro}\end{macro}\end{macro}
7676 % 
7677 % \begin{macro}{\pcol@cflt}
7678 % \changes{v1.0}{2011/10/10}
7679 % {Introduced for special float handling in a column-page with
7680 % synchronization points.}
7681 % \changes{v1.2-7}{2013/05/11}
7682 % {Replace \cs{maxdepth} with \cs{@maxdepth}.}
7683 % \changes{v1.32-2}{2015/10/10}
7684 % {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
7685 % \changes{v1.33-2}{2016/11/19}
7686 % {Add {\tt\%} to the end of the line to open \cs{vbox} for
7687 % \cs{@outputbox} to obey the coding convention.}
7688 % 
7689 % The macro \!\pcol@cflt! is invoked solely from \!\pcol@combinefloats! if
7690 % the \colpage{} for which the macro combines the top floats has
7691 % \sync{}ation points. The macro has the same structure as \LaTeX's version
7692 % \!\@cflt! but has three modifications. The first one is that the floats
7693 % are packed in a \!\vbox! rather than listed in \!\@outputbox! to nullify
7694 % the stretch and shrink of \!\floatsep! to keep the \sync{}ation point from
7695 % moving by them\footnote{
7696 % 
7697 % Maybe unnecessary because of \!\@textbottom! inserted by \!\pcol@makecol!
7698 % but \ldots}.
7699 % 
7700 % The second is that we use \!\@maxdepth! instead of \!\maxdepth! to make it
7701 % clear we always use the value common throughout a \env{paracol}
7702 % environment. The third is that the \!\textfloatsep! is replaced with
7703 % $\!\pcol@textfloatsep!=\cc_c(\tf)$ (definitely finite) which can have a
7704 % value different from \!\textfloatsep! when the float space is enlarged for
7705 % \sync{}ation. If this enlargement is required, $\cc_c(\tf)$ is biased by
7706 % 10000\,|pt| and thus is assuredly\footnote{
7707 % 
7708 % Though not definitely in theoretical sense.}
7709 % 
7710 % larger than 5000\,|pt|. If so, the insertion of \!\topfigrule! should be
7711 % inhibited because it has already been inserted by \!\pcol@synccolumn! or
7712 % there are no real floats but we only have the float for main vertical list
7713 % prior to the \sync{}ation point, or {\em\Uidx\mvlfloat} in short.
7714 % 
7715 % \begin{macrocode}
7716 \def\pcol@cflt{%
7717 \let\@elt\@comflelt
7718 \setbox\@tempboxa\vbox{}%
7719 \@toplist
7720 \setbox\@outputbox\vbox{%
7721 \boxmaxdepth\@maxdepth
7722 \box\@tempboxa
7723 \vskip-\floatsep
7724 \ifdim\pcol@textfloatsep>5000\p@
7725 \advance\pcol@textfloatsep-\@M\p@
7726 \else
7727 \topfigrule
7728 \fi
7729 \vskip\pcol@textfloatsep
7730 \unvbox\@outputbox}%
7731 \let\@elt\relax
7732 \pcol@Fb
7733 \xdef\@freelist{\@freelist\@toplist}%
7734 \pcol@Fe{cflt}%
7735 \global\let\@toplist\@empty}
7736
7737 % \end{macrocode}
7738 % \end{macro}
7739 %
7740 % \begin{macro}{\pcol@opcol}
7741 % \changes{v1.0}{2011/10/10}
7742 % {Remove unnecessary assignment of \cs{@colht}.}
7743 % \changes{v1.0}{2011/10/10}
7744 % {Rename \cs{pcol@maxpage} as \cs{pcol@toppage}.}
7745 % \changes{v1.2-1}{2013/05/11}
7746 % {Add \cs{pcol@clearcst@unvbox} to add coloring \cs{special}s at the
7747 % top and bottom of the column-page to be shipped out, together with
7748 % the setting $\cs{boxmaxdepth}\EQ\cs{@maxdepth}$ for depth capping.}
7749 % \changes{v1.3-2}{2013/09/17}
7750 % {Rename \cs{pcol@outputpage} as \cs{pcol@outputcolumns}.}
7751 % \changes{v1.32-2}{2015/10/10}
7752 % {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
7753 % \changes{v1.33-2}{2016/11/19}
7754 % {Add {\tt\%} to the end of the line to open \cs{vbox} for
7755 % \cs{@currbox} to obey the coding convention.}
7756 % 
7757 % The macro \!\pcol@opcol! is invoked from \!\pcol@output! for the ordinary
7758 % completed \colpage{} built by \!\pcol@makecol!, or from the loop creating
7759 % \fcolumn{}s in \!\pcol@output! or \!\pcol@freshpage!. At first it
7760 % saves the \colpage{} of column $c$ in \!\@outputbox!, which
7761 % \!\pcol@makecol! or \!\@tryfcolumn! just has built for an ordinary or
7762 % \fcolumn{} respectively, in an \!\insert! acquired from \!\@freelist! by
7763 % \!\@next!, and then adds it to the tail of $\S_c=|\pcol@shipped|{\cdot}c$
7764 % 
7765 % \SpecialArrayIndex{c}{\pcol@shipped}
7766 % 
7767 % by \!\@cons!. In this saving operation, we add the sequence of uncoloring
7768 % \!\special!s at the bottom to clear \colorstack{} by
7769 % \!\pcol@clearcst@unvbox! giving it \!\@outputbox! to be \!\unvbox!ed and
7770 % possibly coloring \!\special!s for the \colpage{}'s \colorctext{} saved in
7771 % $\csts$ at the top, so that the succeeding \colpage{} in printing order
7772 % starts with its own \colorctext. For this addition, furthermore, we let
7773 % $\!\boxmaxdepth!=\!\@maxdepth!$ to keep the depth capping made in the box
7774 % builder from nullified\footnote{
7775 % 
7776 % Or to apply the capping dropped from p\LaTeX's \cs{@makecol}, or to do
7777 % nothing for the box made by \cs{@tryfcolumn} and thus being 0 deep.}.
7778 %
7779 % Then if $c=0$, we fix the page number of the page $p$ having the
7780 % \colpage{} and let $\pp^p(q)$ have $\page(p)+(q-p)$ usually but possibly
7781 % $\page(p)+2(q-p)$ with \npaired{} \parapag{}ing, for all
7782 % $q\in[p{+1},\ptop]$ by \!\pcol@setpageno!. After that, we invoke
7783 % \!\pcol@nextpage! to let $p=p'$ for the next \colpage{} of $c$, where
7784 % $p'=p+1$ usually but can be $p+k+1$ if we have consecutive $k$ \fpage{}s
7785 % from $p+1$.
7786 %
7787 % Next, we check if the oldest page $\pbase$ is made ready to be shipped out
7788 % by the participation of the completed \colpage{} by \!\pcol@checkshipped!.
7789 % If so, we invoke \!\pcol@outputcolumns! giving argument 0 to ship out
7790 % $\pbase$ and its successor \fpage{}s.
7791 %
7792 % Finally we set up the next page $p$ by \!\pcol@startpage! if $p>\ptop$
7793 % meaning it is new one, or by \!\pcol@getcurrpage! otherwise, and
7794 % reinitialize parameters for floats by \!\pcol@floatplacement! before
7795 % returning to the invoker.
7796 % 
7797 % \begin{macrocode}
7798 \def\pcol@opcol{%
7799 \pcol@Fb
7800 \@next\@currbox\@freelist{\global\setbox\@currbox\vbox to\@colht{%
7801 \boxmaxdepth\@maxdepth
7802 \pcol@clearcst@unvbox\@outputbox}}\pcol@ovf
7803 \pcol@Fe{opcol}%
7804 \expandafter\@cons\csname pcol@shipped\number\pcol@currcol\endcsname\@currbox
7805 \ifnum\pcol@currcol=\z@ \pcol@setpageno \fi
7806 \pcol@nextpage
7807 \pcol@checkshipped
7808 \if@tempswa \pcol@outputcolumns\z@ \fi
7809 \ifnum\pcol@page>\pcol@toppage \pcol@startpage
7810 \else \pcol@getcurrpage
7811 \fi
7812 \pcol@floatplacement}
7813
7814 % \end{macrocode}
7815 % \end{macro}
7816 %
7817 % \begin{macro}{\pcol@setpageno}
7818 % \changes{v1.33-2}{2016/11/19}
7819 % {Add \cs{let}\cs{@elt}\cs{relax} before \cs{edef} of \cs{reserved@a}
7820 % for the sake of clarity.}
7821 % \begin{macro}{\pcol@setpnoelt}
7822 % \changes{v1.0}{2011/10/10}
7823 % {Rename \cs{ifpcol@textonly} as \cs{ifpcol@nospan}.}
7824 % \changes{v1.2-2}{2013/05/11}
7825 % {Completely recode reflecting the redesign of page context.}
7826 % \changes{v1.3-2}{2013/09/17}
7827 % {Add an operation to increment $\string\mathit{page}(p)$ by two for
7828 % non-paired parallel-paging.}
7829 % \changes{v1.3-3}{2013/09/17}
7830 % {Revise reflecting the new page context element $\pi^s(p)$, and add a
7831 % invoker \cs{pcol@makecol}.}
7832 % \changes{v1.3-4}{2013/09/17}
7833 % {Revise reflecting the new page context element $\pi^m(p)$.}
7834 % 
7835 % The macro \!\pcol@setpageno! is invoked from \!\pcol@opcol! when it
7836 % processes the \colpage{} of the first column $c=0$ to fix the page number
7837 % $\page(p)\gets\counter{page}=\!\c@page!$ of the page $p=\!\pcol@page!$
7838 % having the \colpage{}. It is also invoked from \!\pcol@output@switch!
7839 % when it leaves from the first column to reflect a jump of \counter{page}
7840 % made in the column building. In both cases, the macro lets $\pp^p(q)$
7841 % have $\page'(q)=\page(p)+(q-p)$, except for the case of \npaired{}
7842 % \parapag{}ing in which $\page'(q)=\page(p)+2(q-p)$ instead, for all
7843 % $q\in[p,\ptop]$.
7844 %
7845 % Since we possibly have to update $\pp(q)$ such that $q\geq p$, at first we
7846 % temporarily let
7847 % $\Uidx\PPP=(\PP,\pp(\ptop))=\!\pcol@pages!\!\pcol@currpage!$ empty
7848 % after copying its original value into $\mathit{\Pi}'=\!\reserved@a!$.
7849 % Then we scan $\pi'(q)\in\mathit{\Pi}'$ for all $q\in[\pbase,\ptop]$ by
7850 % applying \!\pcol@setpnoelt! to each $\pi'(q)$ giving its five components
7851 % to the macro, so that the macro updates $\pp(q)$ by \!\pcol@defcurrpage!
7852 % letting $\pp^p(q)=\page'(q)$ if $q\geq p$, or equivalently $p-q\leq0$.
7853 % Note that we let \!\c@page! have $\page'(q)$, but this assignment is
7854 % temporary and \!\c@page! will regain the value $\page(p)$ after
7855 % \!\pcol@setpageno! finishes.
7856 % 
7857 % \begin{macrocode}
7858 \def\pcol@setpageno{\begingroup
7859 \@tempcnta\pcol@page \advance\@tempcnta-\pcol@basepage
7860 \let\@elt\relax \edef\reserved@a{\pcol@pages\pcol@currpage}%
7861 \global\let\pcol@pages\@empty \global\let\pcol@currpage\@empty
7862 \let\@elt\pcol@setpnoelt \reserved@a
7863 \endgroup}
7864 \def\pcol@setpnoelt#1#2#3#4#5{%
7865 {\let\@elt\relax \xdef\pcol@pages{\pcol@pages\pcol@currpage}}%
7866 \ifnum\@tempcnta>\z@ \gdef\pcol@currpage{\@elt{#1}#2#3{#4}{#5}}%
7867 \else \pcol@defcurrpage{\number\c@page}{#2}{#3}{#4}{#5}%
7868 \advance\c@page\@ne
7869 \ifpcol@paired\else \advance\c@page\@ne \fi
7870 \fi
7871 \advance\@tempcnta\m@ne}
7872 % \end{macrocode}
7873 % \end{macro}\end{macro}
7874 % 
7875 % \begin{macro}{\pcol@defcurrpage}
7876 % \changes{v1.2-2}{2013/05/11}
7877 % {Introduced by the redesign of page context, partly replacing
7878 % \cs{pcol@setordpage} which once we call \cs{pcol@settextpage}.}
7879 % \changes{v1.3-3}{2013/09/17}
7880 % {Revise reflecting the new page context element $\pi^s(p)$, and add a
7881 % invoker \cs{pcol@makecol}.}
7882 % \changes{v1.3-4}{2013/09/17}
7883 % {Revise reflecting the new page context element $\pi^m(p)$.}
7884 % 
7885 % The macro
7886 % $\!\pcol@defcurrpage!
7887 % \Arg{\pp^p(p)}\arg{\pp^i(p)}\arg{\pp^f(p)}\Arg{\pp^s(p)}\Arg{\pp^m(p)}$
7888 % is invoked from \!\pcol@makecol! to update $\pp^s(\ptop)$,
7889 % \!\pcol@setpnoelt! to update $\pp^p(p)$, \!\pcol@startpage! to initialize
7890 % a newly created page, \!\pcol@output@start! to initialize a \spage{},
7891 % \!\pcol@output@switch! to update $\pp^s(\ptop)$ and/or $\pp^f(\ptop)$, and
7892 % \!\pcol@setmpbelt! to update $\pp^m(p)$. The macro \!\xdef!ines
7893 % \!\pcol@currpage! letting it have the \pctext{} $\pp(p)$ given by the
7894 % arguments.
7895 % 
7896 % \begin{macrocode}
7897 \def\pcol@defcurrpage#1#2#3#4#5{{%
7898 \let\@elt\relax \xdef\pcol@currpage{\@elt{#1}#2#3{#4}{#5}}}}
7899
7900 % \end{macrocode}
7901 % \end{macro}
7902 %
7903 % \begin{macro}{\pcol@nextpage}
7904 % \changes{v1.2-7}{2013/05/11}
7905 % {Remove unnecessary scan of $\pi(p_t)$.}
7906 % \begin{macro}{\pcol@nextpelt}
7907 % \changes{v1.2-2}{2013/05/11}
7908 % {Revise reflecting the redesign of page context.}
7909 % \changes{v1.3-3}{2013/09/17}
7910 % {Revise reflecting the new page context element $\pi^s(p)$, and add a
7911 % invoker \cs{pcol@makecol}.}
7912 % \changes{v1.3-4}{2013/09/17}
7913 % {Revise reflecting the new page context element $\pi^m(p)$.}
7914 % \changes{v1.3-6}{2013/09/17}
7915 % {Fix the bug that $\pi^h(q)$ is not referred correctly.}
7916 % 
7917 % The macro \!\pcol@nextpage! is invoked solely in \!\pcol@opcol! to let
7918 % $p$ be $p+k+1$ where $k$ is the number of \fpage{}s directly following
7919 % $p$, i.e., $k=\Abs{\Set{q>p}{p<\forall q'\leq q:\pp(q')^h<0}}$. For
7920 % this update, the macro scans $\pp(q)\in\PP$ for all $q\In\pbase\ptop$
7921 % applying \!\pcol@nextpelt! to $\pp(q)$, to perform the following where
7922 % $p_0$ is $p$ before update and $f=\CSIndex{if@tempswa}$ being $\true$ at
7923 % initial, to let $p\gets p+k$, and then increments $p$ to have $p+k+1$.
7924 % $$
7925 % \<p,f\>\gets\cases{
7926 % \<p,f\>& $q\leq p_0$\cr
7927 % \<p{+}1,f\>& $q>p_0\;\land\;f\;\land\;\pp^i(q)\neq\bot\;\land\;
7928 % \pp^h(q)<0$\cr
7929 % \<p,\false\>& otherwise}
7930 % $$
7931 % 
7932 % \begin{macrocode}
7933 \def\pcol@nextpage{\begingroup
7934 \@tempcnta\pcol@page \advance\@tempcnta-\pcol@basepage
7935 \@tempswatrue
7936 \let\@elt\pcol@nextpelt \pcol@pages
7937 \global\advance\pcol@page\@ne
7938 \endgroup}
7939 \def\pcol@nextpelt#1#2#3#4#5{%
7940 \ifnum\@tempcnta<\z@
7941 \ifvoid#2\@tempswafalse
7942 \else\ifdim\dimen#2<\z@
7943 \if@tempswa \global\advance\pcol@page\@ne \fi
7944 \else \@tempswafalse
7945 \fi\fi
7946 \fi
7947 \advance\@tempcnta\m@ne}
7948
7949 % \end{macrocode}
7950 % \end{macro}\end{macro}
7951 %
7952 % \begin{macro}{\pcol@checkshipped}
7953 % The macro \!\pcol@checkshipped! is invoked solely in \!\pcol@opcol! to let
7954 % \CSIndex{if@tempswa} be $\true$ iff
7955 % $S_c=|\pcol@shipped|{\cdot}c\neq\emptyset$
7956 % 
7957 % \SpecialArrayIndex{c}{\pcol@shipped}
7958 % 
7959 % for all $c\In0\C$ to mean the oldest page $\pbase$ is ready to be shipped
7960 % out.
7961 % 
7962 % \begin{macrocode}
7963 \def\pcol@checkshipped{\@tempswatrue
7964 \@tempcnta\z@ \@whilenum\@tempcnta<\pcol@ncol\do{%
7965 \expandafter\ifx\csname pcol@shipped\number\@tempcnta\endcsname\@empty
7966 \@tempswafalse \fi
7967 \advance\@tempcnta\@ne}}
7968
7969 % \end{macrocode}
7970 % \end{macro}
7971 %
7972 % \KeepSpace{2}
7973 % \begin{macro}{\pcol@getcurrpage}
7974 % \changes{v1.3-4}{2013/09/17}
7975 % {Add a user \cs{pcol@addmarginpar}.}
7976 % \begin{macro}{\pcol@getpelt}
7977 % \changes{v1.2-2}{2013/05/11}
7978 % {Revise reflecting the redesign of page context.}
7979 % \begin{macro}{\pcol@getpinfo}
7980 % \changes{v1.0}{2011/10/10}
7981 % {Rename \cs{ifpcol@textonly} as \cs{ifpcol@nospan}.}
7982 % \changes{v1.2-2}{2013/05/11}
7983 % {Revise reflecting the redesign of page context.}
7984 % \begin{macro}{\pcol@getcurrpinfo}
7985 % \changes{v1.2-2}{2013/05/11}
7986 % {Revise reflecting the redesign of page context.}
7987 % \changes{v1.3-3}{2013/09/17}
7988 % {Revise reflecting the new page context element $\pi^s(p)$, and add a
7989 % invoker \cs{pcol@makecol}.}
7990 % \changes{v1.3-4}{2013/09/17}
7991 % {Revise reflecting the new page context element $\pi^m(p)$.}
7992 % 
7993 % The macro \!\pcol@getcurrpage! is invoked in \!\pcol@opcol!,
7994 % \!\pcol@restartcolumn!, \!\pcol@addmarginpar!, \!\pcol@flushcolumn! and
7995 % \!\pcol@freshpage! to let;
7996 % 
7997 % \begin{eqnarray*}
7998 % &&\!\c@page!=\pp^p(p)\quad
7999 % \!\@colht!=\pp^h(p)\quad
8000 % \!\topskip!=\pp^t(p)\quad
8001 % \CSIndex{ifpcol@nospan}=(\pp^i(p)=\bot)\\
8002 % &&\Midx{\!\pcol@spanning!}=\pp^i(p)\quad
8003 % \Midx{\!\pcol@footins!}=\pp^f(p)\quad
8004 % \Midx{\!\pcol@sptextlist!}=\pp^s(p)\\
8005 % &&\Midx{\!\pcol@mparbottom!}=\pp^m(p)
8006 % \end{eqnarray*}
8007 % 
8008 % for $p=\!\pcol@page!\in[p_b,p_t]$. To do that, the macro scans all
8009 % $\pp(q)\in\PPP=(\PP,\pp(\ptop))$ applying \!\pcol@getpelt! to
8010 % $\pp(q)=
8011 % \Arg{\pp^p(q)}\arg{\pp^i(q)}\arg{\pp^f(q)}\Arg{\pp^s(q)}\Arg{\pp^m(q)}$
8012 % to invoke
8013 % $$
8014 % \!\pcol@getpinfo!
8015 % \Arg{\pp^p(q)}\arg{\pp^i(q)}\arg{\pp^f(q)}\Arg{\pp^s(q)}\Arg{\pp^m(q)}
8016 % \arg{pg}\arg{ch}\arg{ts}
8017 % $$
8018 % with the following arguments for \!\global! assignments, if $q=p$.
8019 % $$
8020 % \arg{pg}=\!\global!\!\c@page!\quad
8021 % \arg{ch}=\!\global!\!\@colht!\quad\arg{ts}=\!\global!\!\topskip!
8022 % $$
8023 % Then the macro \!\pcol@getpinfo! do the obvious assignments to
8024 % \!\pcol@spanning!, \!\pcol@footins!, \!\pcol@sptextlist!,
8025 % \!\pcol@mparbottom! and $\arg{pg}$, and the following
8026 % conditional assignments.
8027 % 
8028 % \begin{eqnarray*}
8029 % &&\<\arg{ch},\arg{ts},\CSIndex{ifpcol@nospan}\>=
8030 % \left\{\begin{array}{llll}
8031 % \<\!\textheight!,&\!\pcol@topskip!,&\true\>&\quad\pp^i(q)=\bot\\
8032 % \<\pp^h(q),&\pp^t(q),&\false\>&\quad\pp^i(q)\neq\bot\end{array}\right.
8033 % \end{eqnarray*}
8034 % 
8035 % \begin{Sloppy}{2800}\noindent
8036 % The other macro $\!\pcol@getcurrpinfo!\arg{pg}\arg{ch}\arg{ts}$ is invoked
8037 % in \!\pcol@makecol!, \!\pcol@startpage!, \!\pcol@output@switch!,
8038 % \!\pcol@sync!, \!\pcol@flushcolumn! and \!\pcol@make~flushed~page! do the
8039 % similar assignments using \!\pcol@getpinfo!, but it is not for $\pp(p)$
8040 % but for $\pp(\ptop)={}$\!\pcol@currpage!. The macro \!\pcol@getpinfo!
8041 % also has a direct invoker \!\pcol@outputelt!.
8042 % \end{Sloppy}
8043 % 
8044 % \begin{macrocode}
8045 \def\pcol@getcurrpage{\begingroup
8046 \@tempcnta\pcol@page \advance\@tempcnta-\pcol@basepage
8047 \let\@elt\pcol@getpelt \pcol@pages\pcol@currpage
8048 \endgroup}
8049 \def\pcol@getpelt#1#2#3#4#5{%
8050 \ifnum\@tempcnta=\z@
8051 \pcol@getpinfo{#1}#2#3{#4}{#5}%
8052 {\global\c@page}{\global\@colht}{\global\topskip}%
8053 \fi
8054 \advance\@tempcnta\m@ne}
8055 \def\pcol@getpinfo#1#2#3#4#5#6#7#8{\pcol@nospantrue
8056 \gdef\pcol@spanning{#2}\gdef\pcol@footins{#3}\gdef\pcol@sptextlist{#4}%
8057 \gdef\pcol@mparbottom{#5}%
8058 #6#1\relax
8059 \ifvoid#2\relax #7\textheight #8\pcol@topskip
8060 \else #7\dimen#2\relax #8\skip#2\relax \pcol@nospanfalse
8061 \fi}
8062 \def\pcol@getcurrpinfo{%
8063 \edef\reserved@a{\expandafter\@cdr\pcol@currpage\@nil}%
8064 \expandafter\pcol@getpinfo\reserved@a}
8065
8066 % \end{macrocode}
8067 % \end{macro}\end{macro}\end{macro}\end{macro}
8068 %
8069 % \begin{macro}{\pcol@floatplacement}
8070 % \changes{v1.0}{2011/10/10}
8071 % {Add initialization of \cs{pcol@textfloatsep}.}
8072 % \changes{v1.3-4}{2013/09/17}
8073 % {Remove clearing operation on \cs{@mparbottom} because it is no
8074 % longer in column-context.}
8075 % 
8076 % The macro \!\pcol@floatplacement! is invoked from \!\pcol@opcol!,
8077 % \!\pcol@output@start!, \!\pcol@flushcolumn!, \!\pcol@freshpage! and
8078 % \!\pcol@output@end! to reinitialize the parameters of \cwise{} float
8079 % placement at the beginning of a \colpage{} or that of \postenv. The macro
8080 % lets \!\@textfloatsheight! be 0 and then invokes \!\@floatplacement!, as
8081 % \!\@opcol! does its tail\footnote{
8082 % 
8083 % But $\!\@mparbottom!=0$ is not done because it is meaningless now.}.
8084 % 
8085 % In addition, the macro lets \!\pcol@textfloatsep! be \!\maxdimen! to mean
8086 % the new \colpage{} does not have \sync{}ation point at initial.
8087 % 
8088 % \begin{macrocode}
8089 \def\pcol@floatplacement{%
8090 \global\@textfloatsheight\z@ \global\pcol@textfloatsep\maxdimen
8091 \@floatplacement}
8092
8093 % \end{macrocode}
8094 % \end{macro}
8095 %
8096 %
8097 %
8098 % \section{Starting New Page}
8099 % \label{sec:imp-startpage}
8100 %
8101 % \begin{macro}{\pcol@startpage}
8102 % \changes{v1.0}{2011/10/10}
8103 % {Add assignment of \cs{pcol@firstprevdepth} to be \cs{relax}.}
8104 % \changes{v1.0}{2011/10/10}
8105 % {Rename \cs{pcol@maxpage} as \cs{pcol@toppage}.}
8106 % \changes{v1.0}{2011/10/10}
8107 % {Rename \cs{pcol@settextpage} as \cs{pcol@setordpage}.}
8108 % \changes{v1.2-2}{2013/05/11}
8109 % {Revise reflecting the redesign of page context.}
8110 % \changes{v1.3-2}{2013/09/17}
8111 % {Duplicate \cs{stepcounter} of \cs{c@page} if non-paired
8112 % parallel-paging is in effect.}
8113 % \changes{v1.3-3}{2013/09/17}
8114 % {Revise reflecting the new page context element $\pi^s(p)$.}
8115 % \changes{v1.3-4}{2013/09/17}
8116 % {Revise reflecting the new page context element $\pi^m(p)$.}
8117 % \changes{v1.32-3}{2015/10/10}
8118 % {Add $\hbox{\cs{f@depth}}\EQ0$ to override
8119 % $\hbox{\cs{f@depth}}\EQ\hbox{\texttt{1sp}}$ done by
8120 % \cs{@dblfloatplacement}.}
8121 % \changes{v1.32-3}{2015/10/10}
8122 % {Modify the code to apply \cs{@sdblcolelt} to \cs{@dbldeferlist} so
8123 % as to work with both 2015 (or newer) and 2014 (or older) versions
8124 % of \LaTeX.}
8125 % \changes{v1.32-2}{2015/10/10}
8126 % {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
8127 % 
8128 % The macro \!\pcol@startpage! is invoked from \!\pcol@opcol! with
8129 % $\!\pcol@currpage!=\pp(p{-}1)$ to start a new page $p=\!\pcol@page!$, or
8130 % from \!\pcol@output@start! with a too large \preenv{} or
8131 % \!\pcol@freshpage! with $\!\pcol@currpage!=|{}|$ and $\!\c@page!=\page(p)$
8132 % to start a new page $p=0$.
8133 %
8134 % First, we let $\!\pcol@firstprevdepth!=\!\relax!$ to mean we have (had)
8135 % left from the \spage{} so that \!\pcol@output@end! will be informed of
8136 % that. Next we let $\ptop=p$ and then, if invoked from \!\pcol@opcol!,
8137 % obtain $\pp^p(p{-}1)$ by \!\pcol@getcurrpinfo! to have $\page(p{-}1)$ in
8138 % \!\c@page!, and let $\PP\gets\PPP=(\PP,\pp(p{-}1))$ with
8139 % $\pp^f(p{-}1)=\!\pcol@currfoot!$ into which \!\pcol@makecol! saved
8140 % \Scfnote{}s if any. Next we lets $\!\c@page!=\page(p{-}1)+1$ unless
8141 % \npaired{} \parapag{}ing is in effect or in other words if
8142 % $\CSIndex{ifpcol@paired}=\true$, or $\!\c@page!=\page(p{-}1)+2$ otherwise,
8143 % by \!\stepcounter!. Then we let $\!\@colht!=\!\textheight!$ as the base
8144 % value without \spanning, and $\!\topskip!=\!\pcol@topskip!$ because the
8145 % new page is the second or succeeding one built in \env{paracol}
8146 % environment.
8147 % 
8148 % \begin{macrocode}
8149 %% Starting New Page
8150
8151 \def\pcol@startpage{%
8152 \global\let\pcol@firstprevdepth\relax
8153 \global\pcol@toppage\pcol@page
8154 \ifx\pcol@currpage\@empty\else
8155 \pcol@getcurrpinfo{\global\c@page}\@tempdima\@tempskipa
8156 \@cons\pcol@pages
8157 {{\number\c@page}\pcol@spanning\pcol@currfoot
8158 {\pcol@sptextlist}{\pcol@mparbottom}}%
8159 \stepcounter{page}\ifpcol@paired\else \stepcounter{page}\fi
8160 \fi
8161 \global\@colht\textheight
8162 \global\topskip\pcol@topskip
8163 % \end{macrocode}
8164 %
8165 % Then, we build \fpage{}s if any as follows. First we invoke
8166 % \!\@dblfloatplacement! to reinitialize the parameters for \pwise{} float
8167 % placement. In addition, we let $\!\f@depth!=0$ to nullify the
8168 % setting $\!\f@depth!=|1sp|$ possibly done by \!\@dblfloatplacement! as
8169 % discussed in the item-(\ref{item:ovv-float-@dblfloatplacement}) of
8170 % \secref{sec:imp-ovv-float}. Then we repeat \!\@tryfcolumn! giving it
8171 % \!\@dbldeferlist! having \pwise{} floats not contributed to previous
8172 % pages yet, while $\CSIndex{if@fcolmade}=\true$ meaning it builds \fpage{}s
8173 % in \!\@outputbox!. For each \fpage{}, we acquire an \!\insert! from
8174 % \!\@freelist! by \!\@next! for $\pp^i(\ptop)$ to let it have the
8175 % followings to represent the \fpage{}.
8176 % 
8177 % \begin{eqnarray*}
8178 % \pp^p(\ptop)&=&\!\c@page!\quad
8179 % \pp^b(\ptop)=\!\@outputbox!\quad
8180 % \pp^h(\ptop)=-\!\maxdimen!\quad
8181 % \pp^t(\ptop)=\!\pcol@topskip!\\
8182 % \pp^f(\ptop)&=&\bot\quad
8183 % \pp^s(\ptop)=\emptyset\quad
8184 % \pp^m(\ptop)=\emptyset
8185 % \end{eqnarray*}
8186 % 
8187 % We also increment $p$ and $\ptop$, and also \!\c@page! by one or two
8188 % according to \CSIndex{ifpcol@paired} by \!\stepcounter!, to let them have
8189 % the values for the page following the \fpage{}s.
8190 % 
8191 % \begin{macrocode}
8192 \@dblfloatplacement \let\f@depth\z@
8193 \@tryfcolumn\@dbldeferlist
8194 \@whilesw\if@fcolmade\fi{%
8195 \pcol@Fb
8196 \@next\@currbox\@freelist{%
8197 \global\setbox\@currbox\box\@outputbox}\pcol@ovf
8198 \pcol@Fe{startpage(fcol)}%
8199 \global\dimen\@currbox-\maxdimen
8200 \global\skip\@currbox\pcol@topskip
8201 \@cons\pcol@pages{{\number\c@page}\@currbox\voidb@x{}{}}%
8202 \stepcounter{page}\ifpcol@paired\else \stepcounter{page}\fi
8203 \global\advance\pcol@page\@ne \global\pcol@toppage\pcol@page
8204 \@tryfcolumn\@dbldeferlist}%
8205 % \end{macrocode}
8206 %
8207 % Next, we copy \!\@dbldeferlist! containing \pwise{} floats which
8208 % could not be included in \fpage{}s to \!\reserved@b!, clear the list, and
8209 % then scan the copied list by applying \!\@sdblcolelt! to each list
8210 % element to invoke \!\@addtodblcol! for adding the element to \!\@dbltoplist!
8211 % or keeping it in \!\@dbldeferlist! or \!\@deferlist! depending on \LaTeX's
8212 % version, as \LaTeX's \!\@startdblcolumn! does. In addition, as discussed
8213 % in item-(\ref{item:ovv-float-@addtodblcol}) of
8214 % \secref{sec:imp-ovv-float}, we also clear \!\@deferlist! after saving it in
8215 % \!\reserved@c! prior to the scan, and then after the scan we concatenate
8216 % \!\@dbldeferlist! and \!\@deferlist! to let the former have the result and
8217 % restore \!\@deferlist! from \!\reserved@c!.
8218 %
8219 % Then If this scan results in empty \!\@dbltoplist! to mean the new page
8220 % does not have any \spanning, we invoke \!\pcol@defcurrpage! with
8221 % $\pp^i(\ptop)=\pp^f(\ptop)=\bot$ and $\pp^s(\ptop)=\pp^m(\ptop)=\emptyset$
8222 % so that $\pp(\ptop)$ represents a page perfectly empty.
8223 % 
8224 % \begin{macrocode}
8225 \begingroup
8226 \let\reserved@b\@dbldeferlist \let\reserved@c\@deferlist
8227 \global\let\@dbldeferlist\@empty \global\let\@deferlist\@empty
8228 \let\@elt\@sdblcolelt
8229 \reserved@b
8230 \let\@elt\relax \xdef\@dbldeferlist{\@dbldeferlist\@deferlist}%
8231 \global\let\@deferlist\reserved@c
8232 \endgroup
8233 \ifx\@dbltoplist\@empty
8234 \pcol@defcurrpage{\number\c@page}\voidb@x\voidb@x{}{}%
8235 % \end{macrocode}
8236 %
8237 % Otherwise, i.e., \!\@dbltoplist! is not empty, we scan all elements in it
8238 % by letting $\!\@elt!=\!\@comdblflelt!$ to have all \pwise{} floats in
8239 % \!\@tempboxa!. Then, after returning all elements to \!\@freelist!, we
8240 % acquire an \!\insert! from \!\@freelist! to be $\pp^i(\ptop)$ by \!\@next!
8241 % and store the contents of \!\@tempboxa! in $\pp^b(\ptop)$ after removing
8242 % the last vertical skip \!\dblfloatsep! and then adding \!\dblfigrule! and
8243 % the vertical skip \!\dbltextfloatsep!. The other elements of $\pp(\ptop)$
8244 % are set as follows to represent the page with \spanning{} which makes the
8245 % height of each column \!\@colht! shrunk from its initial value
8246 % \!\textheight! by the series of \!\@addtodblcol!.
8247 % 
8248 % \begin{eqnarray*}
8249 % \pp^p(\ptop)&=&\!\c@page!=\page(\ptop)\quad
8250 % \pp^h(\ptop)=\!\@colht!\quad
8251 % \pp^t(\ptop)=\!\pcol@topskip!\quad
8252 % \pp^f(\ptop)=\bot\\
8253 % \pp^s(\ptop)&=&\emptyset\quad
8254 % \pp^m(\ptop)=\emptyset\quad
8255 % \end{eqnarray*}
8256 %
8257 % Finally, regardless of the existence of the \pwise{} floats, we let
8258 % $\!\pcol@footins!=\bot$ to mean the \tpage{} does not have any \Scfnote{}s,
8259 % so far if footnote typesetting is \scfnote, or never otherwise.
8260 % 
8261 % \begin{macrocode}
8262 \else
8263 \setbox\@tempboxa\vbox{}%
8264 \begingroup
8265 \let\@elt\@comdblflelt
8266 \@dbltoplist
8267 \let\@elt\relax
8268 \pcol@Fb
8269 \xdef\@freelist{\@freelist\@dbltoplist}%
8270 \pcol@Fe{startpage(dbltop)}%
8271 \global\let\@dbltoplist\@empty
8272 \pcol@Fb
8273 \@next\@currbox\@freelist{\global\setbox\@currbox\vbox{%
8274 \unvbox\@tempboxa \vskip-\dblfloatsep \dblfigrule
8275 \vskip\dbltextfloatsep}}\pcol@ovf
8276 \pcol@Fe{startpage(spanning)}%
8277 \global\dimen\@currbox\@colht
8278 \global\skip\@currbox\pcol@topskip
8279 \pcol@defcurrpage{\number\c@page}\@currbox\voidb@x{}{}%
8280 \endgroup
8281 \fi
8282 \gdef\pcol@footins{\voidb@x}}
8283
8284 % \end{macrocode}
8285 % \end{macro}
8286 %
8287 %
8288 %
8289 % \section{Shipping Page Out}
8290 % \label{sec:imp-outputpage}
8291 %
8292 % \begin{macro}{\pcol@outputcolumns}
8293 % \changes{v1.0}{2011/10/10}
8294 % {Rename \cs{ifpcol@stopoutput} as \cs{ifpcol@outputflt}.}
8295 % \changes{v1.3-2}{2013/09/17}
8296 % {Rename \cs{pcol@outputpage} as \cs{pcol@outputcolumns}.}
8297 % 
8298 % The macro \!\pcol@outputcolumns!$\arg{all}$ is invoked from \!\pcol@opcol!
8299 % with $\arg{all}=0$ to ship out the page $\pbase$ and \fpage{}s following
8300 % it if any, or \!\pcol@sync! with $\arg{all}=1$ to ship out all pages in
8301 % $\PP$. It copies $\PP=\!\pcol@pages!$ into $\mathit{\Pi}'=\!\reserved@b!$
8302 % and clear $\PP$ once to remove pages shipped out from it. Then, after
8303 % initializing $f_o=\CSIndex{if@tempswa}=\true$ to ship out (the first)
8304 % ordinary page and $f_f=\CSIndex{ifpcol@outputflt}=\true$ to ship out
8305 % \fpage{}s (following the first page), it scans all
8306 % $\pp(q)\in\mathit{\Pi}'$ applying $\!\pcol@outputelt!\arg{all}$ to
8307 % $\pp(q)$ to ship it out or keep it in $\PP$.
8308 % 
8309 % \begin{macrocode}
8310 %% Shipping Page Out
8311
8312 \def\pcol@outputcolumns#1{\begingroup
8313 \def\@elt{\pcol@outputelt#1}\@tempswatrue \pcol@outputflttrue
8314 \let\reserved@b\pcol@pages \gdef\pcol@pages{}%
8315 \reserved@b
8316 \endgroup}
8317 % \end{macrocode}
8318 % \end{macro}
8319 % 
8320 % \begin{macro}{\pcol@outputelt}
8321 % \changes{v1.2-2}{2013/05/11}
8322 % {Revise reflecting the redesign of page context.}
8323 % \changes{v1.3-3}{2013/09/17}
8324 % {Revise reflecting the new page context element $\pi^s(p)$.}
8325 % \changes{v1.3-4}{2013/09/17}
8326 % {Revise reflecting the new page context element $\pi^m(p)$.}
8327 % 
8328 % The macro $\!\pcol@outputelt!
8329 % \arg{all}\Arg{\pp^p(q)}\arg{\pp^i(q)}\arg{\pp^f(q)}
8330 % \Arg{\pp^s(q)}\Arg{\pp^m(q)}$ ships out the ordinary or \fpage{} $q$ if
8331 % $f_o=\true$ or $f_f=\true$ respectively. After initializing
8332 % \!\@outputbox! to be $\bot$, we retrieve the page $q$'s information by
8333 % \!\pcol@getpinfo! to have $\page(q)$ in \!\c@page! locally, \!\textheight!
8334 % or $\pp^h(q)$ in $h=\!\@tempdima!$,
8335 % $f_{\it{}ns}=\CSIndex{ifpcol@nospan}=(\pp^i(q)=\bot)$, and
8336 % $\!\pcol@footins!={\pp^f(q)}$.
8337 % 
8338 % \begin{macrocode}
8339 \def\pcol@outputelt#1#2#3#4#5#6{%
8340 \setbox\@outputbox\box\voidb@x
8341 \pcol@getpinfo{#2}#3#4{#5}{#6}\c@page\@tempdima\@tempskipa
8342 % \end{macrocode}
8343 %
8344 % Then, we do one of the followings according to $h$ and $f_o$.
8345 % 
8346 % \begin{itemize}
8347 % \item $h<0$\\
8348 % It means $q$ is a \fpage{}. If $f_f=\true$, we let \!\@outputbox! have
8349 % $\pp^b(q)$ to be shipped out, paint its \bground{} with $\bgc_{\{F,f\}}$
8350 % by \!\pcol@bg@paintbox! letting the basic height \!\pcol@bg@floatheight!
8351 % of the paining region
8352 % $\bgr_{\{F,f\}}$ be
8353 % $\HT=\!\pcol@bg@textheight!=\!\textheight!+\!\maxdepth!$, and return
8354 % $\!\insert!{\cdot}\pp^i(q)$ to \!\@freelist! by \!\@cons! because it is no
8355 % longer necessary. Then if $\CL<\C$ to mean \parapag{}ing is in effect, we
8356 % let \!\pcol@rightpage! be an empty box but paint its \bground{} too, because
8357 % the right counterpart of left parallel float page should be always blank.
8358 % Note that we temporarily increment $\page(q)$ by one for \npaired{} right
8359 % \parapag{}es so that the painting macro performs page-parity dependent
8360 % operations correctly.
8361 % 
8362 % \Index{parallel-paging}
8363 % \Index{float page}
8364 %
8365 % On the other hand if $f_f=\false$, we simply return $\pp(q)$ back to $\PP$.
8366 % \end{itemize}
8367 % 
8368 % \changes{v1.0}{2011/10/10}
8369 % {Rename \cs{ifpcol@stopoutput} as \cs{ifpcol@outputflt}.}
8370 % \changes{v1.3-3}{2013/09/17}
8371 % {Add painting of page-wise float page.}
8372 % \changes{v1.3-2}{2013/09/17}
8373 % {Add building a empty right parallel float page.}
8374 % \changes{v1.32-2}{2015/10/10}
8375 % {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
8376 % 
8377 % \begin{macrocode}
8378 \ifdim\@tempdima<\z@
8379 \ifpcol@outputflt
8380 \def\pcol@bg@floatheight{\pcol@bg@textheight}%
8381 \setbox\@outputbox\vbox to\textheight{%
8382 \pcol@bg@paintbox{Ff}\unvbox\pcol@spanning}%
8383 \pcol@Fb
8384 \@cons\@freelist\pcol@spanning
8385 \pcol@Fe{outputelt(spanning)}%
8386 \ifnum\pcol@ncolleft<\pcol@ncol
8387 \setbox\pcol@rightpage\vbox to\textheight{%
8388 \ifpcol@paired\else \advance\c@page\@ne \fi
8389 \pcol@bg@paintbox{Ff}\vfil}%
8390 \fi
8391 \else
8392 \@cons\pcol@pages{{#2}#3#4{#5}{#6}}%
8393 \fi
8394 % \end{macrocode}
8395 % 
8396 % \begin{itemize}
8397 % \item $h\geq0\;\land\;f_o=\true$\\
8398 % It means $q$ is a non-\fpage{} to be shipped out. If $\arg{all}=0$, we
8399 % let $f_o=\false$ to keep succeeding non-\fpage{}s from being shipped out.
8400 % Then we build the ship-out image of the right \parapag{}e $q$ in
8401 % \!\pcol@rightpage! by \!\pcol@ioutputelt! giving it the box and the column
8402 % range $\LBRP\CL\C$ if $\CL<\C$ to mean \parapag{}ing, and then that of the
8403 % left \parapag{}e in \!\@outputbox! by \!\pcol@ioutputelt! again but giving
8404 % it $\LBRP0\CL$ and \!\@outputbox!. Note that the right-first left-second
8405 % order is essential, because in the process to build right \parapag{}e we
8406 % have to examine the existence of $\pp^i(q)$ and $\pp^f(q)$ and then refer
8407 % to their height and depth to make the region corresponding to them blank,
8408 % while the boxes of these \!\insert!s are made void in the building process
8409 % of the left \parapag{}e obviously.
8410 %
8411 % Then after the ship-out image building, we \!\global!ly let
8412 % $\CSIndex{ifpcol@firstpage}=\false$ to tell \!\pcol@ioutputelt! and
8413 % \!\pcol@makeflushedpage! that the pages they build are no longer first of
8414 % a \env{paracol} environment and thus $\pp^i(q)$ should have \pwise{}
8415 % floats rather than \preenv{} hereafter.
8416 % \end{itemize}
8417 % 
8418 % \changes{v1.0}{2011/10/10}
8419 % {Rename \cs{ifpcol@textonly} as \cs{ifpcol@nospan}.}
8420 % \changes{v1.1}{2012/05/11}
8421 % {Use $\cs{pcol@columnwidth}{\cdot}c$ instead of \cs{columnwidth} as
8422 % the width of $c$'s \cs{hbox}.}
8423 % \changes{v1.2-4}{2013/05/11}
8424 % {Add column-swapping for even pages if specified.}
8425 % \changes{v1.2-2}{2013/05/11}
8426 % {Add ship-out of page-wise footnote.}
8427 % \changes{v1.2-7}{2013/05/11}
8428 % {Add $\cs{boxmaxdepth}\EQ\cs{@maxdepth}$ for depth capping.}
8429 % \changes{v1.3-2}{2013/09/17}
8430 % {Move the core of ship-out image building to \cs{pcol@ioutputelt} for
8431 % parallel paging.}
8432 % 
8433 % \begin{macrocode}
8434 \else\if@tempswa
8435 \ifnum#1=\z@ \@tempswafalse \fi
8436 \ifnum\pcol@ncolleft<\pcol@ncol
8437 \pcol@Logstart{\pcol@outputelt{right}}%
8438 \pcol@ioutputelt\pcol@ncolleft\pcol@ncol\pcol@rightpage
8439 \pcol@Logend{\pcol@outputelt{right}}%
8440 \fi
8441 \pcol@Logstart{\pcol@outputelt{left}}%
8442 \pcol@ioutputelt\z@\pcol@ncolleft\@outputbox
8443 \pcol@Logend{\pcol@outputelt{left}}%
8444 \global\pcol@firstpagefalse
8445 % \end{macrocode}
8446 % 
8447 % \begin{itemize}
8448 % \item $h\geq0\;\land\;f_o=\false$\\
8449 % It means $q$ is a non-\fpage{} to be kept. Therefore, we let
8450 % $f_f=\false$ to keep \fpage{}s following it from being shipped out. Then
8451 % we return $\pp(q)$ to $\PP$ by \!\@cons!.
8452 % \end{itemize}
8453 % 
8454 % \begin{macrocode}
8455 \else
8456 \pcol@outputfltfalse
8457 \@cons\pcol@pages{{#2}#3#4{#5}{#6}}%
8458 \fi\fi
8459 % \end{macrocode}
8460 %
8461 % Finally, if $\!\@outputbox!\neq\bot$ to mean $\pp(q)$ is to be
8462 % shipped out, we invoke \!\@outputpage! to do it and increment $\pbase$ to
8463 % let it has $q+1$. Note that since we have let $\!\c@page!=\page(q)$, the
8464 % direct and indirect references to it in \!\@outputpage! are correctly done.
8465 % Also note that the \!\global! increment of it by \!\stepcounter! in
8466 % \!\@outputpage! will be overridden by the \!\global! assignment to it done
8467 % by \!\pcol@startpage! or \!\pcol@getcurrpage! invoked from \!\pcol@opcol!
8468 % if $\arg{all}=0$, or by \!\pcol@getcurrpinfo! invoked from \!\pcol@sync!
8469 % otherwise.
8470 % 
8471 % \begin{macrocode}
8472 \ifvoid\@outputbox\else
8473 \global\advance\pcol@basepage\@ne \@outputpage
8474 \fi}
8475
8476 % \end{macrocode}
8477 % \end{macro}
8478 %
8479 % \begin{macro}{\pcol@ioutputelt}
8480 % \changes{v1.3-2}{2013/09/17}
8481 % {Introduced for parallel-paging.}
8482 % \changes{v1.3-3}{2013/09/17}
8483 % {Add column-separating rule drawing and background painting.}
8484 % \changes{v1.3-4}{2013/09/17}
8485 % {Add a logic to cope with non-uniform column-separating gaps.}
8486 % 
8487 % The macro $\!\pcol@ioutputelt!\<\Cfrom\>\<\Cto\>\arg{b}$ is invoked solely
8488 % in \!\pcol@outputelt! but can be done twice with
8489 % $(\Cfrom,\Cto,b)=(\CL,\C,\!\pcol@rightpage!)$ if \parapag{}ing is in
8490 % effect and with $(\Cfrom,\Cto,b)=(0,\CL,\!\@outputbox!)$ always, to build
8491 % the ship-out image of the right or left \parapag{}e $q$ in the box $b$
8492 % respectively.
8493 %
8494 % After opening a \!\vbox! of \!\textheight! tall for $b$, at first we
8495 % increment $\page(q)$ by one for right \parapag{}e if it is \npaired, so
8496 % that painting macros perform page-parity dependent operations correctly.
8497 %
8498 % Next, we put materials to be shipped out in the box $b$ as follows.
8499 % First, if $\pp^f(q)\neq\bot$ to mean the page $q$ has \Scfnote{}, we paint
8500 % their \bground{} with $\bgc_{\{N,n\}}$ by \!\pcol@bg@paintbox! letting the
8501 % basic height \!\pcol@bg@footnoteheight! of the paining region
8502 % $\bgr_{\{N,n\}}$ be the height-plus-depth of $\pp^f(q)$.
8503 % We do the painting at this earliest stage of the image building in order
8504 % to use the left-top corner of the text area where we are now at as the
8505 % origin for painting, and to let the region may be overlaid by those of
8506 % columns and \csepgap{}s. We also let $h=\pp^h(q)=\!\@tempdima!$ shrunk by
8507 % the height-plus-depth by \!\pcol@shrinkcolbyfn!.
8508 % 
8509 % \begin{macrocode}
8510 \def\pcol@ioutputelt#1#2#3{\setbox#3\vbox to\textheight{%
8511 \ifpcol@paired\else\ifnum#1=\z@\else \advance\c@page\@ne \fi\fi
8512 \ifvoid\pcol@footins\else
8513 \def\pcol@bg@footnoteheight{\@elt{\ht\pcol@footins}\@elt{\dp\pcol@footins}}%
8514 \pcol@bg@paintbox{Nn}%
8515 \pcol@shrinkcolbyfn\@tempdima\pcol@footins\relax
8516 \fi
8517 % \end{macrocode}
8518 %
8519 % Second, if $f_{\it ns}=\false$ to mean $\pp(q)$ has \spanning{} in
8520 % $\pp^b(q)$, we do one of the followings.
8521 % 
8522 % \begin{itemize}
8523 % \item
8524 % If $\Cfrom=0$ to mean the target is the left \parapag{}e, $\pp^b(q)$ is
8525 % put by \!\unvbox!, painting its \bground{} with $\bgc_{\{F,f\}}$ by
8526 % \!\pcol@bg@paintbox! letting the basic height \!\pcol@bg@floatheight! of
8527 % the paining region $\bgr_{\{F,f\}}$ be the height-plus-depth of $\pp^b(q)$
8528 % if $q$ is not the first page and thus $\pp^b(q)$ has \pwise{} floats. We
8529 % also return the \!\insert! $\pp^i(q)$ to \!\@freelist! by \!\@cons!.
8530 %
8531 % \item
8532 % If $\Cfrom\neq0$ to mean right \parapag{}e and $q$ is the first page,
8533 % \!\pcol@rightpage! has \preenv{} in the right \parapag{}e. Therefore, we
8534 % simply put the box but making its height and depth equal to those of
8535 % $\pp^b(q)$, without painting because the box has already been painted, and
8536 % with \!\nointerlineskip! to prevent baseline-skip insertion below the box.
8537 %
8538 % \item
8539 % Otherwise, i.e., $\Cfrom\neq0$ and $q$ is not the first page, we put an
8540 % empty box whose height and depth equal to those of $\pp^b(q)$ by
8541 % \!\pcol@phantom!, with painting as done for floats in the left \parapag{}e
8542 % and with \!\nointerlineskip!.
8543 % \end{itemize}
8544 % 
8545 % Note that after putting \spanning{} and/or painting the \bground{}, we
8546 % temporarily increment \!\topmargin! by the height-plus-depth of
8547 % $\pp^b(q)$, so that painting macros for columns, \csepgap{}s and
8548 % \mctext{}s assume the top edge of column area as that of text area when
8549 % they extend the top edges of their regions upward to the page top.
8550 % 
8551 % \Index{extension of background painting region}
8552 % 
8553 % \changes{v1.32-2}{2015/10/10}
8554 % {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
8555 % 
8556 % \begin{macrocode}
8557 \ifpcol@nospan\else
8558 \def\pcol@bg@floatheight{%
8559 \@elt{\ht\pcol@spanning}\@elt{\dp\pcol@spanning}}%
8560 \@tempdimb\ht\pcol@spanning \advance\@tempdimb\dp\pcol@spanning
8561 \ifnum#1=\z@
8562 \ifpcol@firstpage\else \pcol@bg@paintbox{Ff}\fi
8563 \pcol@Fb
8564 \@cons\@freelist\pcol@spanning \unvbox\pcol@spanning
8565 \pcol@Fe{ioutputelt(spanning)}%
8566 \else\ifpcol@firstpage
8567 \ht\pcol@rightpage\ht\pcol@spanning
8568 \dp\pcol@rightpage\dp\pcol@spanning
8569 \box\pcol@rightpage \nointerlineskip
8570 \else
8571 \pcol@bg@paintbox{Ff}\pcol@phantom\pcol@spanning \nointerlineskip
8572 \fi\fi
8573 \advance\topmargin\@tempdimb
8574 \fi
8575 % \end{macrocode}
8576 %
8577 % Third, we invoke \!\pcol@buildcolseprule! giving it $h$ being $\pp^h(q)$
8578 % but possibly shrunk by \Scfnote{}s, the column range $\LBRP\Cfrom\Cto$,
8579 % and \!\@maxdepth! to mean $q$ is non-\lpage, to draw a \cseprule{}
8580 % possibly broken by the spaces for \mctext{}s in the box \!\pcol@tempboxa!
8581 % and to paint the \bground{}s of columns, \csepgap{}s and \mctext{} in the
8582 % box \!\@tempboxa! which we put into $b$ immediately.
8583 %
8584 % Fourth, we put a \!\hbox! of \!\textwidth! wide having \!\hbox!es
8585 % of $\w_c=|\pcol@columnwidth|{\cdot}c$
8586 % 
8587 % \SpecialArrayIndex{c}{\pcol@columnwidth}
8588 % 
8589 % wide containing $\sigma_c$ followed by \!\hss! for all $c\In\Cfrom\Cto$,
8590 % where $\sigma_c=\!\box!{\cdot}s_c(q)$ being the first element removed from
8591 % $\S_c$ by \!\@next! and then returned to \!\@freelist! by \!\@cons! if it
8592 % is not $\bot$, or \!\voidb@x! otherwise. We separate \!\hbox!es of
8593 % $\sigma_c$ by making each \!\hbox! preceded by \Midx{\!\pcol@@hfil!} being
8594 % \!\relax! for the first one and the macro \!\pcol@hfil! for others giving
8595 % it an argument $c^g=\!\pcol@colsepid!\in\{c,c{-}1\}$ which we discuss
8596 % shortly to put a gap of $\gap_{c^g}=|\pcol@columnsep|{\cdot}c^g$
8597 % 
8598 % \SpecialArrayIndex{c}{\pcol@columnsep}
8599 % 
8600 % wide optionally having a \cseprule{} and being painted.
8601 %
8602 % Note that the scanning order of $c\In\Cfrom\Cto$ is usually ascending of
8603 % course, but is descending if \cswap{} is specified and $\page(q)\bmod2=0$.
8604 % For this ordering, we invoke
8605 % $\!\pcol@swapcolumn!\arg{c'}\arg{c}\<\Cfrom\>\<\Cto\>$ to have $c$ for
8606 % the $(c'-\Cfrom)$-th iteration of the scanning where $c'=\!\@tempcnta!$
8607 % and $c=\!\@tempcntb!$. Another operation done by the macro is to let
8608 % $c^g=c-1$ if swapped or $c^g=c$ otherwise, because if swapped the
8609 % column-$c$ is followed by the gap which follows $c-1$ if not swapped.
8610 % 
8611 % \changes{v1.32-2}{2015/10/10}
8612 % {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
8613 % 
8614 % \begin{macrocode}
8615 \pcol@buildcolseprule\@tempdima#1#2\@maxdepth \unvbox\@tempboxa
8616 \hb@xt@\textwidth{%
8617 \let\pcol@@hfil\relax
8618 \@tempcnta#1\relax \@whilenum\@tempcnta<#2\do{%
8619 \pcol@swapcolumn\@tempcnta\@tempcntb#1#2\relax
8620 \expandafter\@next\expandafter\@currbox
8621 \csname pcol@shipped\number\@tempcntb\endcsname
8622 \relax{\let\@currbox\voidb@x}%
8623 \ifvoid\@currbox\else
8624 \pcol@Fb
8625 \@cons\@freelist\@currbox
8626 \pcol@Fe{ioutputelt(page)}%
8627 \fi
8628 \expandafter\@tempdima
8629 \csname pcol@columnwidth\number\@tempcntb \endcsname
8630 \pcol@@hfil \hb@xt@\@tempdima{\box\@currbox\hss}%
8631 \edef\pcol@@hfil{\noexpand\pcol@hfil{\pcol@colsepid}}%
8632 \advance\@tempcnta\@ne}}%
8633 % \end{macrocode}
8634 %
8635 % Fifth, if $\pp^f(q)\neq\bot$ to mean the page $q$ has \Scfnote{}s, we put
8636 % them at the bottom of \!\@outputbox! by \!\pcol@putfootins!, and return
8637 % $\pp^f(q)$ to \!\@freelist!, if $\Cfrom=0$ meaning left \parapag{}e.
8638 % Otherwise for the right \parapag{}e, we simply put an empty box whose
8639 % height and depth equal to those of $\pp^f(q)$ by \!\pcol@phantom!,
8640 % preceded by a vertical skip of $\!\skip!{\cdot}\pp^f(q)$ and then
8641 % \!\nointerlineskip! to inhibit baseline skip insertion above the box, and
8642 % followed by null \!\vskip! as done in \!\pcol@putfootins!.
8643 %
8644 % Sixth and finally\footnote{
8645 % 
8646 % Not necessary to be finally, but we placed this assignment at the end of
8647 % the box to make it clear the depth capping is only for the box.},
8648 % 
8649 % we let $\!\boxmaxdepth!=\!\@maxdepth!$ to cap the depth of $b$ which we
8650 % are now closing, as done for each \colpage{} and as expected to be applied
8651 % to \Scfnote{}s.
8652 % 
8653 % \changes{v1.32-2}{2015/10/10}
8654 % {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
8655 % 
8656 % \begin{macrocode}
8657 \ifvoid\pcol@footins\else
8658 \ifnum#1=\z@
8659 \pcol@Log\pcol@outputelt{output}\pcol@footins
8660 \pcol@putfootins\pcol@footins
8661 \pcol@Fb
8662 \@cons\@freelist\pcol@footins
8663 \pcol@Fe{ioutputelt(footins)}%
8664 \else
8665 \vskip\skip\pcol@footins \nointerlineskip
8666 \pcol@phantom\pcol@footins \vskip\z@
8667 \fi
8668 \fi
8669 \boxmaxdepth\@maxdepth}}
8670 % \end{macrocode}
8671 % \end{macro}
8672 % 
8673 % \begin{macro}{\pcol@phantom}
8674 % \changes{v1.3-2}{2013/09/17}
8675 % {Introduced for parallel-paging.}
8676 % 
8677 % The macro \!\pcol@phantom!$\<b\>$ is used in \!\pcol@ioutputelt!,
8678 % \!\pcol@makeflushedpage! and \!\pcol@output@end! to put an empty box, whose
8679 % height and depth are equal to that of the argument box $b$ being a kind of
8680 % \pwstuff, into \!\pcol@rightpage! for the right \parapag{}e whose left
8681 % counterpart has $b$ in it. That is, the macro is used to make a region
8682 % corresponding to $b$ blank. To put the empty box, we locally let
8683 % \!\@tempboxa! have it setting its height and depth to those of $b$ and
8684 % then put it.
8685 % 
8686 % \begin{macrocode}
8687 \def\pcol@phantom#1{{%
8688 \setbox\@tempboxa\vbox{}\ht\@tempboxa\ht#1\dp\@tempboxa\dp#1\box\@tempboxa}}
8689
8690 % \end{macrocode}
8691 % \end{macro}
8692 %
8693 % \KeepSpace{1}
8694 % \begin{macro}{\pcol@buildcolseprule}
8695 % \changes{v1.3-3}{2013/09/17}
8696 % {Introduced for column-separating rule drawing and background
8697 % painting for columns, column-separating gaps and spanning texts.}
8698 % \changes{v1.3-4}{2013/09/17}
8699 % {Introduced for non-uniform column-separating gaps.}
8700 % \changes{v1.34}{2018/05/07}
8701 % {Rename \cs{pcol@tempbox} as \cs{pcol@tempboxa}.}
8702 % \begin{macro}{\pcol@buildcselt@S}
8703 % \changes{v1.3-3}{2013/09/17}
8704 % {Introduced for background under-painting for spanning texts.}
8705 % \begin{macro}{\pcol@buildcselt}
8706 % \changes{v1.3-3}{2013/09/17}
8707 % {Introduced for column-separating rule drawing and background
8708 % painting for columns, column-separating gaps and spanning texts.}
8709 % \changes{v1.3-4}{2013/09/17}
8710 % {Introduced for non-uniform column-separating gaps.}
8711 % \changes{v1.34}{2018/05/07}
8712 % {Rename \cs{pcol@tempbox} as \cs{pcol@tempboxa}.}
8713 % 
8714 % The macro $\!\pcol@buildcolseprule!\<H_{n+1}\>\<\Cfrom\>\<\Cto\>\<d\>$ is
8715 % used in \!\pcol@ioutputelt!, \!\pcol@imakeflushedpage! and
8716 % \!\pcol@iflushfloats! to build a box containing \cseprule{} possibly
8717 % broken by \mctext{}s and to paint \bground{}s of columns and \csepgap{}s
8718 % for $c\In\Cfrom\Cto$ and \mctext{}s in the \lpage{} ($d=0$) or non-last
8719 % page ($d=\!\@maxdepth!$) $p$ having \colpage{}s of $H_{n+1}$ tall where
8720 % $n=\Abs{\pp^s(p)}$.
8721 %
8722 % For initializing the drawing and painting process, we let
8723 % $\!\@tempdimb!=H_0+h_0=0$,
8724 % $(\!\pcol@bg@from!,\!\pcol@bg@to!)=(\CBfrom,\CBto)=(\Cfrom,\Cto)$, and
8725 % make boxes $b_r=\!\pcol@tempboxa!$ for the rule and $b_b=\!\@tempboxa!$ for
8726 % the \bground{} empty. Then we apply
8727 % \!\pcol@buildcselt@S!$\<H_i\>\<h_i\>$ to each element $\spt(H_i,h_i)$ of
8728 % $\pp^s(p)$ to under-paint the \bground{} of each \mctext{} by
8729 % \!\pcol@bg@paintbox! defining its region $\bgr_S(i)$ by letting their top
8730 % edge positions $y_0=\!\pcol@bg@spanningtop!=H_i$, and height
8731 % $y_1-y_0=\!\pcol@bg@spanningheight!=h_i$ if $H_i+h_i<H_{n+1}$ to mean the
8732 % \mctext{} is non-last, or $(H_{n+1}-H_i)+d$ if last to fill the narrow
8733 % strip of $d=\!\@maxdepth!$ tall below the text for non-\lpage{}s.
8734 %
8735 % Then we scan $\pp^s(p)$ again but applying
8736 % $\!\pcol@buildcselt!\~\<H_i\>\<h_i\>$ to each element $\spt(H_i,h_i)$ to
8737 % do the followings.
8738 % 
8739 % \begin{enumerate}
8740 % \item
8741 % To $b_r$, add a vertical rule whose height is $H'_i=H_i-(H_{i-1}+h_{i-1})$
8742 % and width is \!\columnseprule! if $H'_i>0$, and then a vertical skip of
8743 % $h_i$, as the rule segment between $(i{-}1)$-th and $i$-th \mctext{}s.
8744 % Note that $H_i$ and $h_i$ are represented in the form of integers and thus
8745 % we need |sp| to use them as dimensions.
8746 %
8747 % \item
8748 % To $b_b$, add painted \bground{}s for all columns $c\In\Cfrom\Cto$ and
8749 % \csepgap{}s $c\In\Cfrom{\Cto{-}1}$ by \!\pcol@bg@paintcolumns! defining
8750 % their regions $\bgr_{\{c,g\}}^c(i)$ by letting common top edge position
8751 % $y_0=\!\pcol@bg@columntop!=H_{i-1}+h_{i-1}$ and common height
8752 % $y_1-y_0=\!\pcol@bg@columnheight!=H'_i$, if $H'_i>0$. Also add painted
8753 % \bground{} for the $i$-th \mctext{} by \!\pcol@bg@paintbox! as we did for
8754 % under-painting but this time the region is $\bgr_s(i)$.
8755 %
8756 % \item
8757 % Let $\!\@tempdimb!=H_i+h_i$ for the next element $\spt(H_{i+1},h_{i+1})$.
8758 % \end{enumerate}
8759 % 
8760 % Then if $H'_{n+1}>0$, we add the last rule segment of $H'_{n+1}$ tall to
8761 % $b_r$, and add painted \bground{}s for columns and \csepgap{}s as done in
8762 % the step\Tie2 above but letting $y_1-y_0=H'_{n+1}+d$ to let the common
8763 % bottom edge of the their regions reach the bottom of text area for
8764 % non-\lpage{}s.
8765 %
8766 % \begin{macrocode}
8767 \def\pcol@buildcolseprule#1#2#3#4{%
8768 \@tempdima#1\relax \dimen@#4\relax
8769 \let\pcol@bg@from#2\relax \let\pcol@bg@to#3\relax
8770 \setbox\pcol@tempboxa\vbox{}\setbox\@tempboxa\vbox{}%
8771 \let\@elt\pcol@buildcselt@S \pcol@sptextlist
8772 \@tempdimb\z@ \let\@elt\pcol@buildcselt \pcol@sptextlist
8773 \let\@elt\relax \advance\@tempdima-\@tempdimb
8774 \ifdim\@tempdima>\z@
8775 \setbox\pcol@tempboxa\vbox{\unvbox\pcol@tempboxa
8776 \hrule\@height\@tempdima\@width\columnseprule}%
8777 \setbox\@tempboxa\vbox{\unvbox\@tempboxa
8778 \let\@elt\relax
8779 \edef\pcol@bg@columntop{\number\@tempdimb sp}%
8780 \edef\pcol@bg@columnheight{%
8781 \@elt{\number\@tempdima sp}\@elt{\number\dimen@ sp}}%
8782 \pcol@bg@paintcolumns}%
8783 \fi}
8784 \def\pcol@buildcselt@S#1#2{%
8785 \setbox\@tempboxa\vbox{\unvbox\@tempboxa
8786 \let\@elt\relax
8787 \def\pcol@bg@spanningtop{\@elt{#1sp}}%
8788 \advance\@tempdima-#1sp\relax \advance\@tempdima-#2sp\relax
8789 \advance\dimen@\@tempdima
8790 \edef\pcol@bg@spanningheight{\@elt{#2sp}%
8791 \ifdim\@tempdima>\z@\else \@elt{\number\dimen@ sp}\fi}%
8792 \pcol@bg@paintbox{S}}}
8793 \def\pcol@buildcselt#1#2{%
8794 \@tempdimc#1sp \advance\@tempdimc-\@tempdimb
8795 \setbox\pcol@tempboxa\vbox{\unvbox\pcol@tempboxa
8796 \ifdim\@tempdimc>\z@ \hrule\@height\@tempdimc\@width\columnseprule \fi
8797 \vskip#2sp}%
8798 \setbox\@tempboxa\vbox{\unvbox\@tempboxa
8799 \let\@elt\relax
8800 \edef\pcol@bg@columntop{\number\@tempdimb sp}%
8801 \edef\pcol@bg@columnheight{\@elt{\number\@tempdimc sp}}%
8802 \ifdim\@tempdimc>\z@ \pcol@bg@paintcolumns \fi
8803 \def\pcol@bg@spanningtop{\@elt{#1sp}}%
8804 \advance\@tempdima-#1sp\relax \advance\@tempdima-#2sp\relax
8805 \advance\dimen@\@tempdima
8806 \edef\pcol@bg@spanningheight{\@elt{#2sp}%
8807 \ifdim\@tempdima>\z@\else \@elt{\number\dimen@ sp}\fi}%
8808 \pcol@bg@paintbox{s}}%
8809 \@tempdimb#1sp \advance\@tempdimb#2sp\relax}
8810
8811 % \end{macrocode}
8812 % \end{macro}\end{macro}\end{macro}
8813 %
8814 % \begin{macro}{\pcol@hfil}
8815 % \changes{v1.3-3}{2013/09/17}
8816 % {Introduced for column-separating rule drawing.}
8817 % \changes{v1.3-4}{2013/09/17}
8818 % {Introduced for non-uniform column-separating gaps.}
8819 % \changes{v1.34}{2018/05/07}
8820 % {Rename \cs{pcol@tempbox} as \cs{pcol@tempboxa}.}
8821 % 
8822 % The macro $\!\pcol@hfil!\<c\>$ is used in \!\pcol@ioutputelt!,
8823 % \!\pcol@imakeflushedpage! and \!\pcol@iflushfloats! to separate column
8824 % $c{+}1$ and $c$ or $c$ and $c{+}1$ according as the columns are
8825 % swapped or not in the page the caller macros are building.
8826 % 
8827 % \Index{column-swapping}
8828 % 
8829 % If $\!\columnseprule!=r>0$, the macro puts the followings; a horizontal
8830 % space of $\gap_{c}/2=|\pcol@columnsep|{\cdot}c/2$
8831 % 
8832 % \SpecialArrayIndex{c}{\pcol@columnsep}
8833 % 
8834 % followed by a skip $-r/2$ to nullify the width of the rule; the rule in
8835 % \!\pcol@tempboxa! which \!\pcol@buildcolseprule! built, with color
8836 % $|\pcol@colseprulecolor|{\cdot}c$
8837 % 
8838 % \SpecialArrayIndex{c}{\pcol@columnsep}
8839 % 
8840 % or \!\pcol@colseprulecolor! according as the former is defined or not,
8841 % i.e., \!\colseprulecolor!\oarg{mode}\ARg{color}$|[|c|]|$ is declared or
8842 % not; and $\gap_c/2$ again but preceded by $-r/2$. On the other hand if
8843 % $r=0$, we simply put a space of $\gap_c$. Note that the skips of
8844 % $\gap_c/2$ and $\gap_c$ are accompanied by 1\,|fil| infinite stretch to
8845 % avoid underfull when $\sum_{c=\Cfrom}^{\Cto-2}(\w_c+\gap_c)+\w_{\Cto-1}<\WT$
8846 % where $(\Cfrom,\Cto)=\{(0,\CL),(\CL,C)\}$, due to arithmetic errors in
8847 % calculations of $\w_c$ and $\gap_c$\footnote{
8848 % 
8849 % It is assured the sum of $w_c$ and $\gap_c$ cannot exceed $\WT$ even with
8850 % arithmetic errors and thus overfull never occurs.}.
8851 % 
8852 % \begin{macrocode}
8853 \def\pcol@hfil#1{{%
8854 \@tempdima\csname pcol@columnsep#1\endcsname\relax
8855 \ifdim\columnseprule>\z@
8856 \hskip.5\@tempdima\@plus1fil\relax
8857 \hskip-.5\columnseprule
8858 \@ifundefined{pcol@colseprulecolor#1}%
8859 {\pcol@colseprulecolor}{\@nameuse{pcol@colseprulecolor#1}}%
8860 \copy\pcol@tempboxa \hskip-.5\columnseprule
8861 \hskip.5\@tempdima\@plus1fil\relax
8862 \else \hskip\@tempdima\@plus1fil\relax
8863 \fi}}
8864
8865 % \end{macrocode}
8866 % \end{macro}
8867 %
8868 % \begin{macro}{\pcol@@outputpage}
8869 % \changes{v1.3-2}{2013/09/17}
8870 % {Introduced keep the original definition of \cs{@outputpage}.}
8871 % \changes{v1.3-3}{2013/09/17}
8872 % {Introduced keep the original definition of \cs{@outputpage}.}
8873 % \changes{v1.3-4}{2013/09/17}
8874 % {Introduced keep the original definition of \cs{@outputpage}.}
8875 % \begin{macro}{\@outputpage}
8876 % \changes{v1.3-2}{2013/09/17}
8877 % {Redefined for parallel-paging.}
8878 % \changes{v1.3-3}{2013/09/17}
8879 % {Redefined for background painting.}
8880 % \changes{v1.3-4}{2013/09/17}
8881 % {Redefined for marginal note placement.}
8882 % \changes{v1.34}{2018/05/07}
8883 % {Rename \cs{pcol@tempbox} as \cs{pcol@tempboxa}.}
8884 % 
8885 % The macro \!\@outputpage!, being our own version of \LaTeX's one kept in
8886 % \!\pcol@@outputpage!, ships out a page $p$ or \parapag{}e pair in $p$.
8887 % The reason why we redefine this macro is that we need a few special
8888 % operations for \parapag{}ing and \bgpaint{} {\em outside} of \env{paracol}
8889 % environments. Therefore, the macro is not only used in our own macros
8890 % \!\pcol@outputelt!, \!\pcol@output@start!, \!\pcol@output@flush!,
8891 % \!\pcol@output@clear!, \!\pcol@flushfloats! and \!\pcol@output@end!, but
8892 % also in \LaTeX's \!\@opcol! and \!\@doclearpage!\footnote{
8893 % 
8894 % And possibly in \CSIndex{@outputdblcol} if double-column typesetting is
8895 % done outside \env{paracol}.}
8896 % 
8897 % invoked from our own or \LaTeX's \!\output! routine.
8898 %
8899 % First we calculate $H'_M=\!\topmargin!+\!\headheight!+\!\headsep!$ to place
8900 % the origin of \bgpaint{} at the top edge of text area in what \LaTeX{}
8901 % assumes as a page, i.e., shifted 1\,inch down from the real page. Then if
8902 % $\CSIndex{ifpcol@output}=\true$ to mean this macro is used in a
8903 % \env{paracol} environment, we build the painted \bground{}s of left and
8904 % right \parapag{}es in $\!\pcol@tempboxa!=b_l$ and $\!\@tempboxa!=b_r$ by
8905 % putting a vertical skip of $H'_M$, and invoking \!\pcol@bg@paintpage!
8906 % with the setting $(\!\pcol@bg@from!,\!\pcol@bg@to!)=(\CBfrom,\CBto)$ be
8907 % $(0,\CL)$ and $(\CL,\C)$ respectively. Note that \!\pcol@bg@paintpage!
8908 % paints \bground{}s of regions $\bgr_a^{[c]}$ for all
8909 % $a\in\{T,B,L,R,C,S,t,b,l,r\}$ and $c\In\CBfrom\CBto$, and for $b_r$ we
8910 % temporarily increment $\page(p)$ by one if \npaired{} \parapag{}ing is in
8911 % effect.
8912 %
8913 % Otherwise, i.e., if $\CSIndex{ifpcol@output}=\false$ indicating outside
8914 % use, we build the painted \bground{}s in $b_l$ and $b_r$ similarly but
8915 % with the following differences; \bgpaint{} is done if
8916 % $\CSIndex{ifpcol@havelastpage}=\true$ to mean the page to be shipped has
8917 % the \lpage{} of closed \env{paracol} as its part and
8918 % $\!\set@color!\neq\!\relax!$ to mean some coloring package is loaded;
8919 % page \bground{} painting is done by \!\pcol@bg@@paintpage! because
8920 % \!\pcol@bg@paintpage! is not available outside \env{paracol} environments;
8921 % the \bground{} of \postenv{} is painted by \!\pcol@bg@@paintbox! for the
8922 % region $\bgr_{\{P,p\}}=[(0,\WT)(\HB,\HT)]$ where
8923 % $\HB=\!\pcol@bg@preposttop!
8924 % \in\{\!\pcol@bg@preposttop@left!,\!\pcol@bg@preposttop@right!\}$
8925 % having the bottom edge of the last
8926 % \env{paracol} environment (having right \parapag{}e for $b_r$). In
8927 % addition, we examine if $\!\pcol@rightpage!\neq\bot$ to mean the right
8928 % \parapag{}e was built by \!\pcol@output@end! when the last \env{paracol}
8929 % environment was closed and, if so, make the box \!\textheight! tall adding
8930 % \!\vfil! to its bottom.
8931 %
8932 % Then regardless of \CSIndex{ifpcol@output}, we do the followings; let the
8933 % height and depth of $b_l$ and $b_r$ be 0 because they cannot occupy any
8934 % real spaces in the ship-out image; temporarily let
8935 % $\CSIndex{ifpcol@swapcolumn}=\false$ if $\page(p)$ is odd, $\CL=\C$ to
8936 % mean \parapag{}ing is not in effect\footnote{
8937 % 
8938 % Since the assignments of $\CL$ and $\C$ in \CSIndex{pcol@zparacol} are
8939 % \CSIndex{global} and they are not modified anywhere else, examining their
8940 % equality outside \env{paracol} environments is safe and meaningful.},
8941 % 
8942 % \parapag{}ing is done in \npaired{} mode\footnote{
8943 % 
8944 % We need this examination because $\CSIndex{ifpcol@swapcolumn}=\false$ for
8945 % \npaired{} \parapag{}ing is made locally by \!\pcol@zparacol!.},
8946 % 
8947 % or we are outside \env{paracol} environments and the page does not have
8948 % anything produced in environments. That is, we let
8949 % $\CSIndex{ifpcol@swapcolumn}=\true$ if the page has something produced by
8950 % a \env{paracol} environment, \cswap{} and \parapag{}ing are specified for
8951 % the (last) environment\footnote{
8952 % 
8953 % Column-swapping may be enabled {\em after} the last \env{paracol}
8954 % environment was closed but we consider the enabling is effective for the
8955 % page having the environment.},
8956 % 
8957 % and the page number is even. Note that a page may have two or more
8958 % (\lpage{}s of) \env{paracol} environments whose \parapag{}ing style can
8959 % be inconsistent including the case some of them are not \parapag{}ed. If
8960 % this inconsistency happens the page is shipped out following the style of
8961 % the last environment. Also note that even if the last environment is not
8962 % \parapag{}ed, the right \parapag{}e kept in \!\pcol@rightpage! is assuredly
8963 % shipped out.
8964 %
8965 % Then if \cswap{} is in effect, we ship out the right \parapag{}e at first
8966 % by \!\pcol@outputpage@r! and then the left one by \!\pcol@outputpage@l! to
8967 % swap the left and right. Otherwise, the ship-out order is normal and thus
8968 % the invocation order is \!\pcol@outputpage@l! then \!\pcol@outputpage@r!.
8969 % Note that if \npaired{} \parapag{}ing is in effect, the page number to
8970 % given to \!\pcol@outputpage@r! as its argument is $\page(p)+1$ if it is
8971 % the second one, i.e., not swapped, while the argument in other cases and
8972 % of \!\pcol@outputpage@l! are always $\page(p)$. Then finally, we
8973 % \!\global!ly let $\CSIndex{ifpcol@havelastpage}=\false$ because so far the
8974 % next page does not have \env{paracol}'s \lpage{} especially when we are
8975 % outside it, let \!\pcol@bg@preposttop@left! and
8976 % \!\pcol@bg@preposttop@right! have 0 because, if we are outside, the next
8977 % \preenv{} should start from the top of a page, and let
8978 % $\mpbout=\!\pcol@mparbottom@out!$ be $\mpboutz=\!\pcol@mparbottom@zero!$
8979 % because so far we have no marginal notes given in \env{paracol}
8980 % environments\footnote{
8981 % 
8982 % This assignment in a \env{paracol} environment is meaningless because
8983 % $\mpbout$ is meaningless too, but not harmful.}.
8984 % 
8985 % \begin{macrocode}
8986 \let\pcol@@outputpage\@outputpage
8987 \def\@outputpage{\begingroup
8988 \@tempdima\topmargin \advance\@tempdima\headheight \advance\@tempdima\headsep
8989 \ifpcol@output
8990 \setbox\pcol@tempboxa\vtop{\vskip\@tempdima \global\pcol@bg@paintedfalse
8991 \let\pcol@bg@from\z@ \let\pcol@bg@to\pcol@ncolleft
8992 \pcol@bg@paintpage}%
8993 \ifpcol@bg@painted \@tempswatrue \else \@tempswafalse \fi
8994 \setbox\@tempboxa\vtop{\vskip\@tempdima \global\pcol@bg@paintedfalse
8995 \ifpcol@paired\else \advance\c@page\@ne \fi
8996 \let\pcol@bg@from\pcol@ncolleft \let\pcol@bg@to\pcol@ncol
8997 \pcol@bg@paintpage}%
8998 \else
8999 \def\reserved@a{\vskip\@tempdima \global\pcol@bg@paintedfalse
9000 \ifpcol@havelastpage \ifx\set@color\relax\else
9001 \pcol@bg@@paintpage \pcol@bg@@paintbox{Pp}%
9002 \fi\fi}%
9003 \setbox\pcol@tempboxa\vbox{%
9004 \let\pcol@bg@preposttop\pcol@bg@preposttop@left
9005 \let\pcol@bg@from\z@ \let\pcol@bg@to\pcol@ncolleft \reserved@a}%
9006 \ifpcol@bg@painted \@tempswatrue \else \@tempswafalse \fi
9007 \setbox\@tempboxa\vbox{\ifpcol@paired\else \advance\c@page\@ne \fi
9008 \let\pcol@bg@preposttop\pcol@bg@preposttop@right
9009 \let\pcol@bg@from\pcol@ncolleft \let\pcol@bg@to\pcol@ncol
9010 \reserved@a}%
9011 \ifvoid\pcol@rightpage\else
9012 \pcol@Logstart{\@outputpage{rightset}}%
9013 \setbox\pcol@rightpage\vbox to\textheight{\unvbox\pcol@rightpage \vfil}%
9014 \pcol@Logend{\@outputpage{rightset}}%
9015 \fi
9016 \fi
9017 \ht\pcol@tempboxa\z@ \dp\pcol@tempboxa\z@
9018 \ht\@tempboxa\z@ \dp\@tempboxa\z@
9019 \ifodd\c@page \pcol@swapcolumnfalse \fi
9020 \ifnum\pcol@ncolleft<\pcol@ncol\else \pcol@swapcolumnfalse \fi
9021 \ifpcol@output\else \ifpcol@havelastpage\else \pcol@swapcolumnfalse \fi\fi
9022 \@tempcnta\c@page
9023 \ifpcol@paired\else \advance\@tempcnta\@ne \pcol@swapcolumnfalse \fi
9024 \ifpcol@swapcolumn \pcol@outputpage@r\c@page \pcol@outputpage@l\@tempcnta
9025 \else \pcol@outputpage@l\c@page \pcol@outputpage@r\@tempcnta
9026 \fi
9027 \global\pcol@havelastpagefalse \gdef\pcol@bg@preposttop@left{0pt}%
9028 \global\let\pcol@bg@preposttop@right\pcol@bg@preposttop@left
9029 \global\let\pcol@mparbottom@out\pcol@mparbottom@zero
9030 \endgroup}
9031
9032 % \end{macrocode}
9033 % \end{macro}\end{macro}
9034 %
9035 % \KeepSpace{1}
9036 % \begin{macro}{\pcol@outputpage@l}
9037 % \changes{v1.3-2}{2013/09/17}
9038 % {Introduced for shipping out left parallel-pages.}
9039 % \changes{v1.3-3}{2013/09/17}
9040 % {Introduced for column-separating rule drawing and background
9041 % painting in left parallel-pages.}
9042 % \changes{v1.34}{2018/05/07}
9043 % {Rename \cs{pcol@tempbox} as \cs{pcol@tempboxa}.}
9044 % \begin{macro}{\pcol@outputpage@r}
9045 % \changes{v1.3-2}{2013/09/17}
9046 % {Introduced for shipping out right parallel-pages.}
9047 % \changes{v1.3-3}{2013/09/17}
9048 % {Introduced for column-separating rule drawing and background
9049 % painting in right parallel-pages.}
9050 % \begin{macro}{\pcol@outputpage@ev}
9051 % \changes{v1.3-3}{2013/09/17}
9052 % {Introduced for background painting.}
9053 % 
9054 % The macro $\!\pcol@outputpage@l!\arg{page}$, used solely in our own
9055 % version of \!\@outputpage!, at first lets \!\c@page! have $\arg{page}$
9056 % which definitely has the value that \!\c@page! had when we start
9057 % \!\@outputpage!. That is, even when this macro is invoked after
9058 % \!\pcol@outputpage@r! due to swapped \parapag{}ing,
9059 % 
9060 % \Index{column-swapping}
9061 % 
9062 % this assignment cancels the increment of \!\c@page! done in \LaTeX's
9063 % \!\@outputpage! or in other word \!\pcol@@outputpage! because in this case
9064 % \parapag{}es are \paired{}. Then we make \!\@themargin! \!\let!-equal to
9065 % \!\evensidemargin! if two-side typesetting is in effect and \!\c@page! is
9066 % even, or to \!\oddsidemargin! otherwise for the reference in
9067 % \!\pcol@outputpage@ev! as shown shortly.
9068 %
9069 % Next, if \bgpaint{} took place in \!\@outputpage!, we let \!\everyvbox!
9070 % have the macro invocation $\!\pcol@outputpage@ev!\<b_l\>$ to be expanded
9071 % to the following sequence so that they are the leading materials in the
9072 % \!\vbox! to be \!\shipout!; examination if the document is processed by a
9073 % Japanese \LaTeX{} named p\LaTeX{} and then, if so, a control sequence
9074 % \!\yoko! to put materials naturally; the painted \bground{} $b_l$ shifted
9075 % right by \!\@themargin!; \!\nointerlineskip! to inhibit \!\baselineskip!
9076 % insertion after $b_l$; emptying \!\everyvbox! to ensure nothing will be
9077 % inserted into internal \!\vbox!es; and the assignment of \!\yoko! to
9078 % \!\let! it be \!\relax! if necessary. This trick with \!\everyvbox! is
9079 % necessary\footnote{
9080 % 
9081 % Unless we rewrite \CSIndex{@outputpage}.}
9082 % 
9083 % because $b_l$ should be put {\em before} \!\pcol@@outputpage! puts the
9084 % page header, or the header would be overlaid by regions, e.g.,
9085 % $\bgr_{\{t,T\}}$ in natural cases.
9086 %
9087 % The tricky elements to handle \!\yoko! in the sequence is necessary for
9088 % p\LaTeX{} whose \!\@outputpage! has \!\yoko! as the first element of the
9089 % \!\vbox! to be \!\shipout!, because \!\yoko! must be the first element of
9090 % a box but our \!\everyvbox! to put \bground{} would make it non-first.
9091 % That is by the tricky elements, the \!\vbox! should have \!\yoko! as the
9092 % first element from \!\everyvbox! and then that put by p\LaTeX's
9093 % \!\@outputpage! is nullified by \!\let!\!\yoko!\!\relax! in the
9094 % \!\everyvbox! just for the \!\vbox! to be shipped out. On the other hand
9095 % in ordinary \LaTeX, \!\yoko! does not appear in the \!\vbox! or is
9096 % modified. The examination of the use of p\LaTeX{} is also trickily done
9097 % by comparing the expansion results of \!\meaning!\!\yoko! and
9098 % \!\string!\!\yoko!. Since the former results in the tokens ``\!\yoko!''
9099 % which \!\string!\!\yoko! gives us iff \!\yoko! is a primitive of
9100 % underlying \TeX{} being p\TeX{} if so, the comparison should give us
9101 % equality iff p\LaTeX{} is in use\footnote{
9102 % 
9103 % Unless some other \TeX{} has a primitive named \CSIndex{yoko}. This
9104 % examination is more strict than that with \CSIndex{pfmtname} for
9105 % \CSIndex{ifpcol@bfbottom}.}.
9106 %
9107 % Then we invoke \!\pcol@@outputpage! being (p)\LaTeX's original version of
9108 % \!\@outputpage! to ship out \!\@outputbox! finally.
9109 %
9110 % The macro \!\pcol@outputpage@r!$\arg{page}$ performs similar operations but
9111 % it does them only when $\!\pcol@rightpage!\neq\bot$ to mean we are in an
9112 % \env{paracol} environment with \parapag{}ing or outside it but in the page
9113 % in which it resides. Other differences are as follows; $\arg{page}$ can
9114 % be $\page(p)+1$ for \npaired{} right \parapag{}es; \!\@outputbox! is
9115 % locally made \!\let!-equal to \!\pcol@rightpage! prior to the invocation
9116 % of \!\pcol@@outputpage!; and $b_r$ is given to \!\pcol@outputpage@ev! as
9117 % its argument.
9118 % 
9119 % \begin{macrocode}
9120 \def\pcol@outputpage@l#1{%
9121 \pcol@Logstart{\@outputpage{left}}%
9122 \global\c@page#1\relax
9123 \let\@themargin\oddsidemargin
9124 \if@twoside\ifodd\c@page\else \let\@themargin\evensidemargin \fi\fi
9125 \if@tempswa \everyvbox{\pcol@outputpage@ev\pcol@tempboxa}\fi
9126 \pcol@@outputpage
9127 \pcol@Logend{\@outputpage{left}}}
9128 \def\pcol@outputpage@r#1{%
9129 \begingroup
9130 \ifvoid\pcol@rightpage\else
9131 \global\c@page#1\relax
9132 \let\@outputbox\pcol@rightpage
9133 \pcol@Logstart{\@outputpage{right}}%
9134 \let\@themargin\oddsidemargin
9135 \if@twoside\ifodd\c@page\else \let\@themargin\evensidemargin \fi\fi
9136 \ifpcol@bg@painted \everyvbox{\pcol@outputpage@ev\@tempboxa}\fi
9137 \pcol@@outputpage
9138 \pcol@Logend{\@outputpage{right}}%
9139 \fi
9140 \endgroup}
9141 \def\pcol@outputpage@ev#1{%
9142 \edef\reserved@a{\meaning\yoko}\edef\reserved@b{\string\yoko}%
9143 \ifx\reserved@a\reserved@b \yoko\fi
9144 \moveright\@themargin\box#1\nointerlineskip \everyvbox{}%
9145 \ifx\reserved@a\reserved@b \let\yoko\relax \fi}
9146
9147 % \end{macrocode}
9148 % \end{macro}\end{macro}\end{macro}
9149 %
9150 %
9151 %
9152 %
9153 % \section{Starting New Column-Page}
9154 % \label{sec:imp-startcolumn}
9155 %
9156 % \begin{macro}{\pcol@startcolumn}
9157 % \changes{v1.3-3}{2013/09/17}
9158 % {Add \cs{@colht} and \cs{@tempdimb} as the first and third argument of
9159 % \cs{pcol@shrinkcolbyfn}.}
9160 % \changes{v1.32-2}{2015/10/10}
9161 % {Fix the memory leak caused by mistakingly preserving $\pi^f(p)$
9162 % when $p\EQ p_t$.}
9163 % \changes{v1.32-2}{2015/10/10}
9164 % {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
9165 % 
9166 % The macro $\!\pcol@startcolumn!\arg{f}$ is invoked from \!\pcol@output!
9167 % with $f=1$ and \!\pcol@freshpage! with $f=0$ to start a new \colpage.
9168 % This macro has two additional functions to \LaTeX's \!\@startcolumn!, one
9169 % for \Scfnote{}s and the other for coloring.
9170 %
9171 % First, if the page $p$ in which the new \colpage{} resides has \Scfnote{}s
9172 % in $\pp^f(p)=\!\pcol@footins!$ because the column is not the leading one,
9173 % 
9174 % \Index{leading column}
9175 % 
9176 % we temporarily shrink \!\@colht! and \!\@colroom! by the space required to
9177 % put $\pp^f(p)$ by \!\pcol@shrinkcolbyfn! during the trial of deferred
9178 % float placement, remembering the existence of the footnotes by letting
9179 % $\!\@tempdimb!=-\!\skip!\!\pcol@footins!$ which should be 0 otherwise.
9180 % This shrinkage is essentially required when $p<\ptop$ because $\pp^f(p)$
9181 % has been fixed to be a part of $p$ and thus deferred floats cannot push
9182 % footnotes down to succeeding pages. In the case of $p=\ptop$, the
9183 % shrinkage is also desirable to avoid unnecessary pushing down of footnotes
9184 % which \TeX{} has decided to be in $p$.
9185 %
9186 % Then after trying put deferred floats in the \colpage{} by \!\@tryfcolumn!
9187 % and \!\pcol@trynextcolumn! as done in \LaTeX's \!\@startcolumn!, we
9188 % \!\insert! $\pp^f(p)$, if it is has some footnotes, by letting \!\footins!
9189 % have it by \!\pcol@getcurrfoot! so that \TeX{} will be aware of the
9190 % footnotes when it examines the page break of the \colpage{}. That is, if
9191 % $p<\ptop$ the \!\insert!ion is to keep the vertical space for $\pp^f(p)$ in
9192 % the building process of the \colpage{} in $p$ because any \Scfnote{s}
9193 % cannot be added to $p$ any more, and thus $\pp^f(p)$ is preserved until
9194 % the page $p$ is shipped out. On the other hand if $p=\ptop$, \Scfnote{s}
9195 % in $p$ can grow further and thus \!\insert!ed footnotes will be captured
9196 % again by \!\pcol@output@switch! or \!\pcol@startpage!. Therefore, if
9197 % $p=\ptop$, we release $\pp^f(p)$ to \!\@freelist!.
9198 %
9199 % Then if $p=\ptop$, we also \!\insert! deferred footnotes in $\df$ until
9200 % their total height reaches \!\@colht! by \!\pcol@deferredfootins! if $f=1$
9201 % to mean this macro is invoked from \!\pcol@output!\footnote{
9202 % 
9203 % The \cs{insert}ion of $\pp^f(p)$ also requires $f=1$ but this examination
9204 % is redundant because $\pp^f(p)=\bot$ definitely if $f=0$.}.
9205 % 
9206 % Note that the deferred footnote \!\insert!ion in the case of $f=0$ will
9207 % be done afterward when \!\pcol@freshpage! does \!\pcol@restartcolumn! at
9208 % its tail. Also note that \!\pcol@deferredfootins! examines if
9209 % $\!\@tempdimb!=0$ to mean $\pp^f(p)=\bot$ and thus \!\skip!\!\footins!
9210 % should be taken into account in its extraction of the footnotes from $\df$.
9211 %
9212 % Then after restoring \!\@colht! and canceling the temporary shrinkage of
9213 % \!\@colroom!, we invoke \!\pcol@savecolorstack! to save \colpage{}'s
9214 % \colorctext{} into $\csts$ so that coloring \!\special!s to reestablish
9215 % $\csts$ will be put at its top if it has something when we leave it.
9216 % 
9217 % \begin{macrocode}
9218 %% Starting New Column Page
9219
9220 \def\pcol@startcolumn#1{%
9221 \@tempdima\@colht \@tempdimb\z@
9222 \ifvoid\pcol@footins\else
9223 \pcol@shrinkcolbyfn\@colht\pcol@footins\@tempdimb
9224 \fi
9225 \global\@colroom\@colht
9226 \@tryfcolumn\@deferlist
9227 \if@fcolmade\else
9228 \pcol@trynextcolumn
9229 \ifpcol@scfnote \ifnum#1>\z@
9230 \ifvoid\pcol@footins\else
9231 \edef\pcol@currfoot{\pcol@footins}%
9232 \pcol@getcurrfoot\copy
9233 \pcol@Log\pcol@startcolumn{insert}\footins
9234 \insert\footins{\unvbox\footins}%
9235 \ifnum\pcol@page=\pcol@toppage
9236 \pcol@Fb
9237 \@cons\@freelist\pcol@footins
9238 \pcol@Fe{startcolumn(pagefn)}%
9239 \fi
9240 \fi
9241 \ifnum\pcol@page=\pcol@toppage
9242 \pcol@deferredfootins\pcol@startcolumn \fi
9243 \fi\fi
9244 \fi
9245 \advance\@tempdima-\@colht
9246 \global\advance\@colroom\@tempdima
9247 \global\advance\@colht\@tempdima
9248 \pcol@savecolorstack}
9249 % \end{macrocode}
9250 % \end{macro}
9251 % 
9252 % \begin{macro}{\pcol@trynextcolumn}
9253 % \changes{v1.2-2}{2013/05/11}
9254 % {No change in the code itself but its explanation is modified
9255 % according to the drastic redesign of \cs{pcol@startcolumn}.}
9256 % 
9257 % The macro \!\pcol@trynextcolumn! is invoked from \!\pcol@startcolumn! and
9258 % \!\pcol@flush~column! to try to move deferred floats in \!\@deferlist!
9259 % into \!\@toplist! or \!\@botlist!. The body of this macro is perfectly
9260 % equivalent to the \cs{else} part of \CSIndex{if@fcolmade} in \LaTeX's
9261 % \!\@startcolumn!.
9262 % 
9263 % \begin{macrocode}
9264 \def\pcol@trynextcolumn{\begingroup
9265 \let\reserved@b\@deferlist
9266 \global\let\@deferlist\@empty
9267 \let\@elt\@scolelt
9268 \reserved@b
9269 \endgroup}
9270
9271 % \end{macrocode}
9272 % \end{macro}
9273 %
9274 %
9275 %
9276 % \section{Background Painting}
9277 % \label{sec:imp-bgpaint}
9278 %
9279 % \begin{macro}{\pcol@bg@from}
9280 % \changes{v1.3-3}{2013/09/17}
9281 % {Introduced for background painting.}
9282 % \begin{macro}{\pcol@bg@to}
9283 % \changes{v1.3-3}{2013/09/17}
9284 % {Introduced for background painting.}
9285 % 
9286 % The control sequence pair
9287 % $(\!\pcol@bg@from!,\!\pcol@bg@to!)=(\Uidx\CBfrom,\Uidx\CBto)$ are made
9288 % \!\let!-equal to $(0,\CL)$ or $(\CL,\C)$ by \!\pcol@buildcolseprule! and
9289 % \!\@outputpage! for \bgpaint{} of columns and \csepgap{}s, and referred
9290 % to by column scanning loops in \!\pcol@bg@paint@ii! and
9291 % \!\pcol@bg@columnleft!. The control sequence \!\pcol@bg@to! is also
9292 % referred to by \!\pcol@bg@paint@i! to decrement it by one temporarily so
9293 % that the loop in \!\pcol@bg@paint@ii! scans $c\In\CBfrom{\CBto{-}1}$
9294 % rather than $\LBRP\CBfrom\CBto$. Since this decrement is done whenever a
9295 % painting macro is used regardless some setting of $\CBto$, \!\pcol@bg@to!
9296 % has default setting with $\C$ to avoid unbound reference at the
9297 % decrement. Note that since this decrement is done in a \!\vbox! and an
9298 % appropriate setting must have been done if $\CBto$ is referred in
9299 % \!\pcol@bg@paint@ii!, this decrement and default setting are safe.
9300 % 
9301 % \begin{macrocode}
9302 %% Background Painting
9303
9304 \let\pcol@bg@to\pcol@ncol
9305 % \end{macrocode}
9306 % \end{macro}\end{macro}
9307 % 
9308 % \KeepSpace{4}
9309 % \begin{macro}{\pcol@bg@paintpage}
9310 % \changes{v1.3-3}{2013/09/17}
9311 % {Introduced for background painting.}
9312 % \begin{macro}{\pcol@bg@@paintpage}
9313 % \changes{v1.3-3}{2013/09/17}
9314 % {Introduced for background painting.}
9315 % \begin{macro}{\pcol@bg@paintcolumns}
9316 % \changes{v1.3-3}{2013/09/17}
9317 % {Introduced for background painting.}
9318 % \begin{macro}{\pcol@bg@@paintcolumns}
9319 % \changes{v1.3-3}{2013/09/17}
9320 % {Introduced for background painting.}
9321 % \begin{macro}{\pcol@bg@paintbox}
9322 % \changes{v1.3-3}{2013/09/17}
9323 % {Introduced for background painting.}
9324 % \begin{macro}{\pcol@bg@@paintbox}
9325 % \changes{v1.3-3}{2013/09/17}
9326 % {Introduced for background painting.}
9327 % 
9328 % The macros \!\pcol@bg@@paintpage!, \!\pcol@bg@@paintcolumns! and
9329 % $\!\pcol@bg@@paintbox!\Arg{A}$ are made \!\let!-equal to their interface
9330 % counterparts \!\pcol@bg@paintpage!, \!\pcol@bg@paint~columns! and
9331 % \!\pcol@bg@paintbox! by \!\pcol@zparacol! if some coloring package has
9332 % been loaded. Otherwise, these interface macros are \!\let!-equal to
9333 % \!\relax! for first two and \!\@gobble! for the last, so that macros in
9334 % \!\output! routine freely use them unaware of coloring capability. One
9335 % exception is in \!\@outputpage! which uses \!\pcol@bg@@paintpage! and
9336 % \!\pcol@bg@@paintbox! explicitly when it is outside \env{paracol}
9337 % environments, examining the availability of coloring.
9338 %
9339 % The macro \!\pcol@bg@paintpage! and \!\pcol@bg@@paintpage! are used in
9340 % \!\@outputpage! to paint \bground{}s of regions $\bgr_a^{[c]}$ for all
9341 % $a\in\{T,B,L,R,G,C,t,b,l,r\}$ and $c\In\CBfrom\CBto$ for $a=C$ while
9342 % $c\In\CBfrom{\CBto{-}1}$ for $a=G$. Therefore, the macro invokes
9343 % \!\pcol@bg@paint@i! with two
9344 % $\!\pcol@bg@paint@ii!\Arg{A_b}\Arg{A_g}\Arg{A_c}$, letting
9345 % $A_b=|TBLR|$, $A_g=|G|$ and $A_c=|C|$ in the first invocation and then
9346 % $A_b=|tblr|$ and $A_g=A_c=\emptyset$ in the second.
9347 %
9348 % The macro \!\pcol@bg@paintcolumns! is used in \!\pcol@buildcolseprule! and
9349 % \!\pcol@buildcselt! to paint \bground{}s of regions $\bgr_g^c(i)$ for
9350 % $c\In\CBfrom{\CBto{-}1}$ and $\bgr_c^c(i)$ for $c\In\CBfrom\CBto$.
9351 % Therefore, the macro invokes \!\pcol@bg@paint@i! with \!\pcol@bg@paint@ii!
9352 % giving it $A_b=\emptyset$, $A_g=|g|$ and $A_c=|c|$.
9353 %
9354 % The macro $\!\pcol@bg@paintbox!\Arg{A}$ is used in the following macros
9355 % with $A$ shown in the parentheses to paint the \bground{}s of regions
9356 % $\bgr_{\{a_1,a_2\}}$ where $(a_1,a_2)\in\{(S,s),(F,f),(N,n),\~(P,p)\}$.
9357 % 
9358 % \begin{quote}\raggedright
9359 % \!\pcol@outputelt!\Tie(|Ff|),
9360 % \!\pcol@ioutputelt!\Tie(|Nn|, |Ff|),
9361 % \!\pcol@buildcselt!\Tie(|Ss|),
9362 % \!\pcol@output@start!\Tie(|Pp|),
9363 % \!\pcol@output@clear!\Tie(|Ff|),
9364 % \!\pcol@makeflushedpage!\Tie(|Ff|),
9365 % \!\pcol@imakeflushedpage!\Tie(|Nn|),
9366 % \!\pcol@output@end!\Tie(|Nn|).
9367 % \end{quote}
9368 % 
9369 % The macro \!\@outputpage! also uses the function but \!\pcol@bg@@paintbox!
9370 % explicitly with $A=|Pp|$. Therefore \!\pcol@bg@@paintbox! invokes
9371 % \!\pcol@bg@paint@i! with \!\pcol@bg@paint@ii! giving it $A_b=A$ and
9372 % $A_g=A_c=\emptyset$.
9373 % 
9374 % \begin{macrocode}
9375 \def\pcol@bg@@paintpage{%
9376 \pcol@bg@paint@i{%
9377 \pcol@bg@paint@ii{TBLR}{G}{C}\pcol@bg@paint@ii{tblr}{}{}}}
9378 \def\pcol@bg@@paintcolumns{\pcol@bg@paint@i{\pcol@bg@paint@ii{}{g}{c}}}
9379 \def\pcol@bg@@paintbox#1{\pcol@bg@paint@i{\pcol@bg@paint@ii{#1}{}{}}}
9380
9381 % \end{macrocode}
9382 % \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
9383 %
9384 % \begin{macro}{\pcol@bg@paint@i}
9385 % \changes{v1.3-3}{2013/09/17}
9386 % {Introduced for background painting.}
9387 % 
9388 % The macro $\!\pcol@bg@paint@i!\Arg{body}$ is used in
9389 % \!\pcol@bg@@paintpage!, \!\pcol@bg@@paint~columns! and
9390 % \!\pcol@bg@@paintbox! to paint \bground{}s by a sequence of
9391 % \!\pcol@bg@paint@ii! specified in $\arg{body}$. The painted \bground{} is
9392 % built in \!\@tempboxa! being a \!\vtop! having a null \!\vskip! as its
9393 % first element so that everything put in the box is below its reference
9394 % point at its top. Then, before invoking \!\pcol@bg@paint@ii! in
9395 % $\arg{body}$, we do the followings; \!\global!ly let
9396 % $\CSIndex{ifpcol@bg@painted}=\false$ to indicate so far any painted
9397 % \bground{} are produced; make \!\pcol@bg@leftmargin! \!\let!-equal
9398 % to \!\pcol@lrmargin! to use this \!\dimen! register locally with the
9399 % more appropriate alias; negate \!\pagerim! locally to calculate $\HT$
9400 % easily; decrement $\CBto$ by one locally for the column scanning loop for
9401 % $c\In\CBfrom{\CBto{-}1}$ in \!\pcol@bg@paint@ii!; and \!\offinterlineskip!
9402 % to inhibit inter-line \!\baselineskip! insertion in the box. Then after
9403 % the invocation of the sequence of \!\pcol@bg@paint@ii! in $\arg{body}$ and
9404 % closing the box, we let the height, depth and width of the box be 0 so
9405 % that it does not occupy any real space in the outer box in which the box
9406 % is put. Finally, if $\CSIndex{ifpcol@bg@painted}=\true$ meaning that some
9407 % painted \bground{}s are built in the box, we put the box into the outer
9408 % box surrounding it by \!\nointerlineskip! to inhibit inter-line
9409 % \!\baselineskip! insertion before and after it.
9410 % 
9411 % \begin{macrocode}
9412 \def\pcol@bg@paint@i#1{%
9413 \setbox\@tempboxa\vtop{\vskip\z@
9414 \global\pcol@bg@paintedfalse
9415 \let\pcol@bg@leftmargin\pcol@lrmargin
9416 \pagerim-\pagerim \advance\pcol@bg@to\m@ne
9417 \offinterlineskip #1}%
9418 \ht\@tempboxa\z@ \dp\@tempboxa\z@ \wd\@tempboxa\z@
9419 \ifpcol@bg@painted \nointerlineskip \box\@tempboxa \nointerlineskip \fi}
9420 % \end{macrocode}
9421 % \end{macro}
9422 % 
9423 % \begin{macro}{\pcol@bg@paint@ii}
9424 % \changes{v1.3-3}{2013/09/17}
9425 % {Introduced for background painting.}
9426 % 
9427 % The macro $\!\pcol@bg@paint@ii!\Arg{A_b}\Arg{A_g}\Arg{A_c}$ appears only
9428 % in the argument of \!\pcol@bg@paint@i! used in
9429 % \!\pcol@bg@@paintpage!, \!\pcol@bg@@paintcolumns! and
9430 % \!\pcol@bg@@paintbox! to paint \bground{}s of regions $\bgr_a$ for
9431 % $a\in{}A_b\subseteq\{T,B,L,R,S,F,N,P,t,b,l,r,s,f,n,p\}$, $\bgr_a^c$ for
9432 % $a\in{}A_g\subseteq\{G,g\}$ and $c\In\CBfrom{\Cto{-}1}$, and $\bgr_a^c$ for
9433 % $a\in A_c\subseteq\{C,c\}$ and $c\In\CBfrom\CBto$.
9434 %
9435 % First we invoke \!\pcol@bg@swappage! with \CSIndex{ifpcol@bg@swap} to
9436 % let \!\pcol@bg@left~margin! and \CSIndex{ifpcol@bg@@swap} have values
9437 % according to \CSIndex{ifpcol@bg@swap}, \CSIndex{if@twoside} and the parity
9438 % of $\page(p)$. Then we invoke $\!\pcol@bg@paintregion!\arg{a}\arg{c}$ for
9439 % all $a\in A_b$ and $c=-1$ to paint the \bground{} of $\bgr_a$. Second, we
9440 % invoke \!\pcol@bg@swappage! again but with \CSIndex{ifpcol@swapcolumn}
9441 % instead of \CSIndex{ifpcol@bg@swap}, and \!\pcol@bg@paintregion! as well
9442 % but for $a\in\{A_g,A_c\}$ and $c\In\CBfrom{\CBto{-}1}$. Third and
9443 % finally, we make yet another invocation of \!\pcol@bg@paintregion! for
9444 % $a\in A_c$ and $c=\CBto-1$.
9445 % 
9446 % \begin{macrocode}
9447 \def\pcol@bg@paint@ii#1#2#3{%
9448 \pcol@bg@swappage\ifpcol@bg@swap\fi
9449 \@tfor\reserved@b:=#1\do{\pcol@bg@paintregion\reserved@b\m@ne}%
9450 \pcol@bg@swappage\ifpcol@swapcolumn\fi
9451 \@tfor\reserved@b:=#2#3\do{%
9452 \pcol@currcol\pcol@bg@from \@whilenum\pcol@currcol<\pcol@bg@to\do{%
9453 \pcol@bg@paintregion\reserved@b\pcol@currcol
9454 \advance\pcol@currcol\@ne}}%
9455 \@tfor\reserved@b:=#3\do{\pcol@bg@paintregion\reserved@b\pcol@currcol}}
9456 % \end{macrocode}
9457 % \end{macro}
9458 % 
9459 % \begin{macro}{\pcol@bg@swappage}
9460 % \changes{v1.3-3}{2013/09/17}
9461 % {Introduced for background painting.}
9462 % 
9463 % The macro $\!\pcol@bg@swappage!\arg{if}\cs{fi}$ is used solely in
9464 % \!\pcol@bg@paint@ii! but twice with $\arg{if}=\CSIndex{ifpcol@bg@swap}$
9465 % and then with $\arg{if}=\CSIndex{ifpcol@swapcolumn}$, to let
9466 % \!\pcol@bg@leftmargin! and \CSIndex{ifpcol@bg@@swap} have values for
9467 % \mirror{}ing according to the truth values of $\arg{if}$ and
9468 % \CSIndex{if@twoside} and the parity of $\page(p)$ of the page $p$ for
9469 % which \bgpaint{} is taking place. That is, they are let have the values
9470 % as follows.
9471 % 
9472 % \begin{eqnarray*}
9473 % W&=&\cases{\CSIndex{oddsidemargin}&
9474 % $\page(p)\bmod2=1\;\lor\CSIndex{if@twoside}=\false$\cr
9475 % \CSIndex{evensidemargin}&
9476 % $\page(p)\bmod2=0\;\land\CSIndex{if@twoside}=\true$}\\
9477 % \rlap{$\displaystyle(\!\pcol@bg@leftmargin!,\CSIndex{ifpcol@bg@@swap})$}
9478 % \phantom{W}\\
9479 % &=&\cases{(W,\;\false)&$\page(p)\bmod2=1\lor\;\arg{if}=\false$\cr
9480 % (\WP-(W+\WT+2\,|in|),\;\true)&
9481 % $\page(p)\bmod2=\land\;\arg{if}=\true$}
9482 % \end{eqnarray*}
9483 % 
9484 % Note that $\WP-(W+\WT+2\,|in|)$ means the right margin width minus 1\,|in|
9485 % with given left margin width $W$, and thus
9486 % $\WM=\!\pcol@bg@leftmargin!+1\,|in|$ gives us the right margin width we
9487 % need in \mirror{}ed \bgpaint.
9488 % 
9489 % \begin{macrocode}
9490 \def\pcol@bg@swappage#1#2{%
9491 \pcol@bg@leftmargin\oddsidemargin \pcol@bg@@swapfalse
9492 \ifodd\c@page\else
9493 \if@twoside \pcol@bg@leftmargin\evensidemargin \fi
9494 #1% \ifpcol@{bg@swap,swapcolumn}
9495 \pcol@bg@@swaptrue
9496 \advance\pcol@bg@leftmargin\textwidth \advance\pcol@bg@leftmargin2in
9497 \advance\pcol@bg@leftmargin-\paperwidth
9498 \pcol@bg@leftmargin-\pcol@bg@leftmargin
9499 #2% \fi
9500 \fi}
9501
9502 % \end{macrocode}
9503 % \end{macro}
9504 % 
9505 % \begin{macro}{\pcol@bg@paintregion}
9506 % \changes{v1.3-3}{2013/09/17}
9507 % {Introduced for background painting.}
9508 % \begin{macro}{\pcol@bg@paintregion@i}
9509 % \changes{v1.3-3}{2013/09/17}
9510 % {Introduced for background painting.}
9511 % 
9512 % The macro $\!\pcol@bg@paintregion!\arg{a}\arg{c}$ is used only in
9513 % $\!\pcol@bg@paint@ii!\Arg{A_b}\Arg{A_g}\Arg{A_c}$ but as many times as
9514 % $\Abs{A_b}+\Abs{A_g}(\CBto-\CBfrom-1)+\Abs{A_c}(\CBto-\CBfrom)$ to paint
9515 % \bground{} region $\bgr_a^{[c]}$ specified by $|\pcol@bg@@|{\cdot}a$
9516 % 
9517 % \SpecialArrayIndex{a}{\pcol@bg@@}
9518 % 
9519 % with color $\bgc_a^c=|\pcol@bg@color@|{\cdot}a{\cdot}|@|{\cdot}c$
9520 % 
9521 % \SpecialArrayIndex{a{\cdot}\string\texttt{@}{\cdot}c}{\pcol@bg@color@}
9522 % 
9523 % or, if it is undefined, $\bgc_a=|\pcol@bg@color@|{\cdot}a$.
9524 % 
9525 % \SpecialArrayIndex{a}{\pcol@bg@color@}
9526 %
9527 % If $\bgr_a^c$ or $\bgr_a$ is defined, the painted \bground{} is built in
9528 % \!\@tempboxa! with \!\vtop! having null vertical skip at its top and by
9529 % $\!\pcol@bg@paintregion@i!\Arg{F_x}\Arg{F_y}\Arg{F_w}\Arg{F_h}$ where
9530 % the arguments are defined in the body of the macro $|\pcol@bg@@|{\cdot}a$
9531 % 
9532 % \SpecialArrayIndex{a}{\pcol@bg@@}
9533 % 
9534 % and thus we need triple \!\expandafter! to give them to the macro. Prior
9535 % to the invocation of the macro, we let $\!\reserved@a!=a'$ have
9536 % $a{\cdot}|@|{\cdot}c$ if $\bgc_a^c$ is defined for $a\in\{G,C,g,c\}$, or
9537 % $a$ otherwise definitely for $a\notin\{G,C,g,c\}$.
9538 %
9539 % Then \!\pcol@bg@paintregion@i! calculates $x_0=\!\@tempdima!$,
9540 % $y_0=\!\@tempdimb!$, $x_1=\!\@tempdimc!$ and $y_1=\!\dimen@!$ of the
9541 % region $\bgr_a^{[c]}$ by $\!\pcol@bg@calculate!\arg{z}\arg{z_0}\Arg{F}$
9542 % giving it
9543 % $(z,z_0,F)\in\{(x_0,0,F_x),(y_0,0,F_y),(x_1,x_0,F_w),(y_1,y_0,F_h)\}$,
9544 % where $(x_0,y_0)$ and $(x_1,y_1)$ is the left-top and right-bottom corner
9545 % of the painting region in the text-area coordinate, i.e., left-right and
9546 % top-down coordinate whose origin is at the left-top corner of the leftmost
9547 % column. Next we modify $\{x,y\}_{\{0,1\}}$ for \bgext{} by
9548 % $\!\pcol@bg@addext!\arg{z}\Arg{s}\Arg{d}$ with $(z,s,d)\in
9549 % \{(x_0,\hbox{`|-|'},|l|),(y_0,\hbox{`|-|'},|t|),
9550 % (x_1,\emptyset,|r|),\~(y_1,\emptyset,|b|)\}$.
9551 %
9552 % Now we have $[(x_0,y_0)(x_1,y_1)]$ and thus, if not \mirror{}ed, we place
9553 % $\bgr_a^{[c]}$ at $(x_0,y_0)$ by a vertical skip of $y_0$ and shifting a
9554 % \!\hbox! for the region right by $x_0$ by \!\moveright!, and paint the box
9555 % putting a \!\vrule! of $(x_1-x_0)$ wide and $(y_1-y_0)$ tall, letting
9556 % \!\current@color! have $\bgc_r^{[c]}=|\pcol@bg@colr|{\cdot}a'$ and then
9557 % invoking \!\pcol@set@color! being the original definition of
9558 % \!\set@color!.
9559 % 
9560 % \SpecialArrayIndex{a{\cdot}\string\texttt{@}{\cdot}c}{\pcol@bg@color@}
9561 % \SpecialArrayIndex{a}{\pcol@bg@color@}
9562 % 
9563 % On the other hand if \mirror{}ing is to be done, the region should be
9564 % $[(\WT{-}x_1,y_0)(\WT{-}x_0,y_1)]$ and thus the shift amount for
9565 % \!\moveright! of the \!\hbox! is $(\WT-x_1)$.
9566 %
9567 % Then after \!\pcol@bg@paintregion@i! finishes its work,
9568 % \!\pcol@bg@paintregion! lets the switch
9569 % \CSIndex{ifpcol@bg@painted}${}=\true$ because we painted $\bgr_a^{[c]}$,
9570 % lets the height, depth and width of \!\@tempboxa! be 0 to make it a
9571 % phantom, and then put it into the outside box opened by
9572 % \!\pcol@bg@paint@i!. On the other hand, if neither $\bgc_r^c$ nor
9573 % $\bgc_r$ defined to mean the \bgpaint{} of the region is not specified, we
9574 % do nothing.
9575 % 
9576 % \begin{macrocode}
9577 \def\pcol@bg@paintregion#1#2{%
9578 \@ifundefined{pcol@bg@color@#1@\number#2}%
9579 {\def\reserved@a{#1}}{\edef\reserved@a{#1@\number#2}}%
9580 \@ifundefined{pcol@bg@color@\reserved@a}\relax
9581 {\setbox\@tempboxa\vtop{\vskip\z@
9582 \expandafter\expandafter\expandafter
9583 \pcol@bg@paintregion@i\csname pcol@bg@@#1\endcsname}%
9584 \global\pcol@bg@paintedtrue
9585 \ht\@tempboxa\z@ \dp\@tempboxa\z@ \wd\@tempboxa\z@ \box\@tempboxa}}
9586 \def\pcol@bg@paintregion@i#1#2#3#4{%
9587 \pcol@bg@calculate\@tempdima\z@{#1}%
9588 \pcol@bg@calculate\@tempdimb\z@{#2}%
9589 \pcol@bg@calculate\@tempdimc\@tempdima{#3}%
9590 \pcol@bg@calculate\dimen@\@tempdimb{#4}%
9591 \pcol@bg@addext\@tempdima{-}{l}\pcol@bg@addext\@tempdimc{}{r}%
9592 \pcol@bg@addext\@tempdimb{-}{t}\pcol@bg@addext\dimen@{}{b}%
9593 \vskip\@tempdimb
9594 \ifpcol@bg@@swap
9595 \advance\@tempdima-\@tempdimc \@tempdima-\@tempdima
9596 \advance\@tempdimc-\textwidth \@tempdimc-\@tempdimc
9597 \moveright\@tempdimc\hbox{%
9598 \advance\dimen@-\@tempdimb
9599 \edef\current@color{\@nameuse{pcol@bg@color@\reserved@a}}\pcol@set@color
9600 \vrule\@width\@tempdima\@height\dimen@}%
9601 \else
9602 \moveright\@tempdima\hbox{%
9603 \advance\@tempdimc-\@tempdima \advance\dimen@-\@tempdimb
9604 \edef\current@color{\@nameuse{pcol@bg@color@\reserved@a}}\pcol@set@color
9605 \vrule\@width\@tempdimc\@height\dimen@}%
9606 \fi}
9607
9608 % \end{macrocode}
9609 % \end{macro}\end{macro}
9610 %
9611 % \KeepSpace{3}
9612 % \begin{macro}{\pcol@bg@calculate}
9613 % \changes{v1.3-3}{2013/09/17}
9614 % {Introduced for background painting.}
9615 % \begin{macro}{\pcol@bg@advance}
9616 % \changes{v1.3-3}{2013/09/17}
9617 % {Introduced for background painting.}
9618 % \begin{macro}{\pcol@bg@negative}
9619 % \changes{v1.3-3}{2013/09/17}
9620 % {Introduced for background painting.}
9621 % \begin{macro}{\pcol@bg@nadvance}
9622 % \changes{v1.3-3}{2013/09/17}
9623 % {Introduced for background painting.}
9624 % \begin{macro}{\pcol@bg@dimen}
9625 % \changes{v1.3-3}{2013/09/17}
9626 % {Introduced for background painting.}
9627 % 
9628 % The macro $\!\pcol@bg@calculate!\arg{z}\arg{z_0}\arg{F}$ is used in
9629 % \!\pcol@bg@paintregion@i! and \!\pcol@bg@addext! to accumulate dimensional
9630 % values specified in $F$ into a \!\dimen! register $z$ with initial value
9631 % $z_0$. The specification $F$ is a sequence of $\!\@elt!\Arg{f}$ to add $f$
9632 % to $z$, $\!\pcol@bg@negative!\Arg{F^-}$ to subtract the amount specified
9633 % by $F^-$ from $z$, or macros expanded to either of them.
9634 %
9635 % The macro makes \!\pcol@bg@dimen! \!\let!-equal to $z$ and \!\@elt! to
9636 % \!\pcol@bg@advance!, lets $z=z_0$, and then does what is specified in $F$\@.
9637 % Therefore, $\!\@elt!\arg{f}$ appearing directly or indirectly in $F$ does
9638 % $\!\advance!\arg{z}\arg{f}$ for the accumulation. On the other hand,
9639 % \!\pcol@bg@negative! makes \!\@elt! \!\let!-equal to \!\pcol@bg@nadvance!
9640 % to let $\!\@elt!\arg{f}$ do $\!\advance!\arg{z}{-}\arg{f}$ for
9641 % subtraction, does $F^-$, and then remake $\!\@elt!=\!\pcol@bg@advance!$.
9642 % Note that $f$ may be expanded to a negative amount having `|-|' its
9643 % beginning to results in $\!\@elt!\arg{f}$ expanded to
9644 % $\!\advance!\arg{z}{-}{-}\arg{f'}$ with some positive amount $f'$, but
9645 % this double negation is legitimate in \TeX{} and is equivalent to
9646 % $\!\advance!\arg{z}\arg{f'}$. The macro \!\pcol@bg@negative! is used in
9647 % the following macros.
9648 % 
9649 % \begin{quote}\raggedright
9650 % \!\pcol@bg@ext@inf@l!,
9651 % \!\pcol@bg@ext@inf@r!,
9652 % \!\pcol@bg@ext@inf@t!,
9653 % \!\pcol@bg@@t!,
9654 % \!\pcol@bg@@b!,
9655 % \!\pcol@bg@@l!,
9656 % \!\pcol@bg@@r!,
9657 % \!\pcol@bg@@n!,
9658 % \!\pcol@bg@@p!.
9659 % \end{quote}
9660 % 
9661 % \begin{macrocode}
9662 \def\pcol@bg@calculate#1#2#3{\let\pcol@bg@dimen#1\relax
9663 \let\@elt\pcol@bg@advance \pcol@bg@dimen#2\relax #3}
9664 \def\pcol@bg@negative#1{\let\@elt\pcol@bg@nadvance #1\relax
9665 \let\@elt\pcol@bg@advance}
9666 \def\pcol@bg@advance#1{\advance\pcol@bg@dimen#1\relax}
9667 \def\pcol@bg@nadvance#1{\advance\pcol@bg@dimen-#1\relax}
9668
9669 % \end{macrocode}
9670 % \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
9671 %
9672 % \KeepSpace{3}
9673 % \begin{macro}{\pcol@bg@addext}
9674 % \changes{v1.3-3}{2013/09/17}
9675 % {Introduced for background painting.}
9676 % \begin{macro}{\pcol@bg@ext@inf@l}
9677 % \changes{v1.3-3}{2013/09/17}
9678 % {Introduced for background painting.}
9679 % \begin{macro}{\pcol@bg@ext@inf@r}
9680 % \changes{v1.3-3}{2013/09/17}
9681 % {Introduced for background painting.}
9682 % \begin{macro}{\pcol@bg@ext@inf@t}
9683 % \changes{v1.3-3}{2013/09/17}
9684 % {Introduced for background painting.}
9685 % \begin{macro}{\pcol@bg@ext@inf@b}
9686 % \changes{v1.3-3}{2013/09/17}
9687 % {Introduced for background painting.}
9688 % 
9689 % The macro $\!\pcol@bg@addext!\arg{z}\Arg{s}\Arg{d}$ is used only in
9690 % \!\pcol@bg@paintregion@i! but four times with $(z,s,d)\in
9691 % \{(x_0,\hbox{`|-|'},|l|),(y_0,\hbox{`|-|'},|t|),
9692 % (x_1,\emptyset,|r|),\~(y_1,\emptyset,|b|)\}$, to perform \bgext{} on a
9693 % \!\dimen! register $z$.
9694 %
9695 % First the macro gets $e=|\pcol@bg@ext@|{\cdot}d{\cdot}|@|{\cdot}a'
9696 % \in e_a^{[c]}(\{x,y\}^{\{{+},{-}\}})$
9697 % 
9698 % \SpecialArrayIndex{d{\cdot}\string\texttt{@}
9699 % {\cdot}a{\cdot}\string\texttt{@}{\cdot}c}{\pcol@bg@ext@}
9700 % \SpecialArrayIndex{d{\cdot}\string\texttt{@}{\cdot}a}{\pcol@bg@ext@}
9701 % 
9702 % where $a'=\!\reserved@a!\~\in\{a{\cdot}|@|{\cdot}c,a\}$. Then if
9703 % $e<9000\PT$ being a finite \bgext, we let $z\gets z\pm e$
9704 % according to $s$, i.e. $+$ if $s=\emptyset$ while $-$ if $s={}$`|-|'.
9705 % Otherwise, i.e., $e\geq9000\PT$ for a infinite \bgext, let $e'$
9706 % be the value shown below by invoking $|\pcol@bg@ext@inf@|{\cdot}d$
9707 % 
9708 % \SpecialArrayMainIndex{d}{\pcol@bg@ext@inf@}
9709 % $$
9710 % e'=\cases{-(\WM-\WR)&$d=|l|$\cr
9711 % \WP-(\WM-\WR)&$d=|r|$\cr
9712 % -(\HM-\HR)&$d=|t|$\cr
9713 % \HP-(\HM-\HR)&$d=|b|$\cr}
9714 % $$
9715 % where $\WM-\WR$ is specified by \!\pcol@bg@pageleft! and $\HM-\HR$ by
9716 % \!\pcol@bg@pagetop!. Then we let $z=e'\pm(e-10000\PT)$ according to $s$
9717 % again, i.e., move $z$ {\em inside\/} by $(10000\PT-e)$ from $e'$.
9718 % 
9719 % \begin{macrocode}
9720 \def\pcol@bg@addext#1#2#3{%
9721 \dimen@ii\@nameuse{pcol@bg@ext@#3@\reserved@a}\relax
9722 \ifdim\dimen@ii<9000\p@\relax \advance#1#2\dimen@ii
9723 \else
9724 \pcol@bg@calculate#1\z@{\@nameuse{pcol@bg@ext@inf@#3}}%
9725 \advance\dimen@ii-\@M\p@ \advance#1#2\dimen@ii
9726 \fi}
9727 \def\pcol@bg@ext@inf@l{\pcol@bg@negative\pcol@bg@pageleft}
9728 \def\pcol@bg@ext@inf@r{\pcol@bg@negative\pcol@bg@pageleft
9729 \pcol@bg@paperwidth}
9730 \def\pcol@bg@ext@inf@t{\pcol@bg@negative\pcol@bg@pagetop}
9731 \def\pcol@bg@ext@inf@b{\pcol@bg@negative\pcol@bg@pagetop
9732 \pcol@bg@paperheight}
9733
9734 % \end{macrocode}
9735 % \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
9736 %
9737 % \KeepSpace{7}
9738 % \begin{macro}{\pcol@bg@paperwidth}
9739 % \changes{v1.3-3}{2013/09/17}
9740 % {Introduced for background painting.}
9741 % \begin{macro}{\pcol@bg@paperheight}
9742 % \changes{v1.3-3}{2013/09/17}
9743 % {Introduced for background painting.}
9744 % \begin{macro}{\pcol@bg@pageleft}
9745 % \changes{v1.3-3}{2013/09/17}
9746 % {Introduced for background painting.}
9747 % \begin{macro}{\pcol@bg@pagetop}
9748 % \changes{v1.3-3}{2013/09/17}
9749 % {Introduced for background painting.}
9750 % \begin{macro}{\pcol@bg@textheight}
9751 % \changes{v1.3-3}{2013/09/17}
9752 % {Introduced for background painting.}
9753 % \begin{macro}{\pcol@bg@columnleft}
9754 % \changes{v1.3-3}{2013/09/17}
9755 % {Introduced for background painting.}
9756 % \begin{macro}{\pcol@bg@columnright}
9757 % \changes{v1.3-3}{2013/09/17}
9758 % {Introduced for background painting.}
9759 % \begin{macro}{\pcol@bg@columnwidth}
9760 % \changes{v1.3-3}{2013/09/17}
9761 % {Introduced for background painting.}
9762 % \begin{macro}{\pcol@bg@columnsep}
9763 % \changes{v1.3-3}{2013/09/17}
9764 % {Introduced for background painting.}
9765 % 
9766 % The following macros specify the whole or a part of
9767 % $F\in\{F_x,F_y,F_w,F_h\}$ being the body of $|\pcol@bg@@|{\cdot}a$ for
9768 % \bgpaint{} regions $\bgr_a^{[c]}$.
9769 % 
9770 % \begin{eqnarray*}
9771 % \!\pcol@bg@paperwidth!&=& \WP-2\WR=\!\paperwidth!-2\!\pagerim!
9772 % \quad(t,T,b,B,r,R)\\
9773 % \!\pcol@bg@paperheight!&=& \HP-2\HR=\!\paperheight!-2\!\pagerim!
9774 % \quad(b,B)\\
9775 % \!\pcol@bg@pageleft!&=& \WM-\WR=
9776 % (\!\pcol@bg@leftmargin!+1\,|in|)-\!\pagerim!\\
9777 % & \rlap{$(t,T,b,B,l,L,r,R)$}\\
9778 % \!\pcol@bg@pagetop!&=& \HM-\WR\\
9779 % &=&(\!\topmargin!+\!\headheight!+\!\headsep!+1\,|in|)-\!\pagerim!\\
9780 % & \rlap{$(t,T,b,B)$}\\
9781 % \!\pcol@bg@textheight!&=& \HT=\!\textheight!+\!\@maxdepth!\\
9782 % & \rlap{$(b,B,l,L,r,R,C,G,n,N,p,P)$}\\
9783 % \!\pcol@bg@columnleft!&=& \W_c=\sum_{d=\CBfrom}^{c-1}(w_c+g_c)
9784 % \quad(c,C)\\
9785 % \!\pcol@bg@columnright!&=& \W_c+w_c=
9786 % \!\pcol@bg@columnleft!+\!\pcol@bg@columnwidth!\\
9787 % & \rlap{$(g,G)$}\\
9788 % \!\pcol@bg@columnwidth!&=& w_c=|\pcol@columnwidth|{\cdot}c
9789 % \quad(c,C)\\
9790 % \!\pcol@bg@columnsep!&=& g_c=|\pcol@columnsep|{\cdot}c
9791 % \quad(g,G)
9792 % \end{eqnarray*}
9793 % 
9794 % \SpecialArrayIndex{c}{\pcol@columnwidth}
9795 % \SpecialArrayIndex{c}{\pcol@columnsep}
9796 % 
9797 % Note that \!\pagerim! in $F$ means $-\!\pagerim!$ because its sign is
9798 % reversed by \!\pcol@bg@paint@i!. The macros are used in
9799 % $|\pcol@bg@@|{\cdot}a$
9800 % 
9801 % \SpecialArrayIndex{a}{\pcol@bg@@}
9802 % 
9803 % whose region identifier $a$ is shown in parentheses above, but besides them
9804 % \!\pcol@bg@paperwidth! is also used in \!\pcol@bg@ext@inf@r!,
9805 % \!\pcol@bg@paperheight! in \!\pcol@bg@ext@inf@b!, \!\pcol@bg@pageleft! in
9806 % \!\pcol@bg@ext@inf@l! and \!\pcol@bg@ext@inf@r!, and \!\pcol@bg@pagetop!
9807 % in \!\pcol@bg@ext@inf@t! and \!\pcol@bg@ext@inf@b!. Also note that
9808 % \!\pcol@bg@textheight! is used in \!\pcol@output@clear! while it is
9809 % temporarily redefined in \!\pcol@output@start! and \!\pcol@output@end!.
9810 %
9811 % \begin{macrocode}
9812 \def\pcol@bg@paperwidth{\@elt\paperwidth \@elt{2\pagerim}}
9813 \def\pcol@bg@paperheight{\@elt\paperheight \@elt{2\pagerim}}
9814 \def\pcol@bg@pageleft{\@elt{1in}\@elt\pcol@bg@leftmargin \@elt\pagerim}
9815 \def\pcol@bg@pagetop{\@elt{1in}\@elt\topmargin \@elt\headheight \@elt\headsep
9816 \@elt\pagerim}
9817 \def\pcol@bg@textheight{\@elt\textheight \@elt\@maxdepth}
9818 \def\pcol@bg@columnleft{%
9819 \@tempcnta\pcol@bg@from \@whilenum\@tempcnta<\pcol@currcol\do{%
9820 \@elt{\@nameuse{pcol@columnwidth\number\@tempcnta}}%
9821 \@elt{\@nameuse{pcol@columnsep\number\@tempcnta}}%
9822 \advance\@tempcnta\@ne}}
9823 \def\pcol@bg@columnright{\pcol@bg@columnleft \pcol@bg@columnwidth}
9824 \def\pcol@bg@columnwidth{\@elt{\@nameuse{pcol@columnwidth\number\pcol@currcol}}}
9825 \def\pcol@bg@columnsep{\@elt{\@nameuse{pcol@columnsep\number\pcol@currcol}}}
9826 % \end{macrocode}
9827 % \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
9828 % \end{macro}\end{macro}\end{macro}\end{macro}
9829 % 
9830 % \KeepSpace{7}
9831 % \begin{macro}{\pcol@bg@preposttop}
9832 % \changes{v1.3-3}{2013/09/17}
9833 % {Introduced for background painting.}
9834 % \begin{macro}{\pcol@bg@preposttop@left}
9835 % \changes{v1.3-3}{2013/09/17}
9836 % {Introduced for background painting.}
9837 % \begin{macro}{\pcol@bg@preposttop@right}
9838 % \changes{v1.3-3}{2013/09/17}
9839 % {Introduced for background painting.}
9840 % \begin{macro}{\pcol@bg@columntop}
9841 % \changes{v1.3-3}{2013/09/17}
9842 % {Introduced for background painting.}
9843 % \begin{macro}{\pcol@bg@columnheight}
9844 % \changes{v1.3-3}{2013/09/17}
9845 % {Introduced for background painting.}
9846 % \begin{macro}{\pcol@bg@floatheight}
9847 % \changes{v1.3-3}{2013/09/17}
9848 % {Introduced for background painting.}
9849 % \begin{macro}{\pcol@bg@footnoteheight}
9850 % \changes{v1.3-3}{2013/09/17}
9851 % {Introduced for background painting.}
9852 % \begin{macro}{\pcol@bg@spanningtop}
9853 % \changes{v1.3-3}{2013/09/17}
9854 % {Introduced for background painting.}
9855 % \begin{macro}{\pcol@bg@spanningheight}
9856 % \changes{v1.3-3}{2013/09/17}
9857 % {Introduced for background painting.}
9858 % 
9859 % Besides the macros shown above, $|\pcol@bg@@|{\cdot}a$ uses the following
9860 % macros defined by macros using \!\pcol@bg@paintpage!,
9861 % \!\pcol@bg@paintcolumns! or \!\pcol@bg@paintbox!.
9862 % 
9863 % \begin{itemize}
9864 % \item
9865 % \!\pcol@bg@preposttop! being \!\pcol@bg@preposttop@left! or
9866 % \!\pcol@bg@preposttop@right! for $a\in\{p,P\}$ by \!\@outputpage! and
9867 % \!\pcol@output@end!, the latter of which may define only the left one if
9868 % the closing environment is not \parapag{}ed. That is, both of left and
9869 % right macros are usually equivalent, but the right one can be smaller than
9870 % the left if we have two or more (\lpage{}s of) \env{paracol} environments
9871 % in a page and the closing environment is not \parapag{}ed while some
9872 % others are. In such case, \!\@outputpage! or \!\pcol@output@start!,
9873 % another macro referring to them, must paint the region below
9874 % \!\pcol@bg@preposttop@right! in the right page as a part of \preenv{} or
9875 % \postenv{} by \!\let!ting \!\pcol@bg@preposttop! be
9876 % \!\pcol@bg@preposttop@left! and \!\pcol@bg@preposttop@right! for the left
9877 % and right \parapag{}es respectively. Both macros have common initial
9878 % value 0.
9879 %
9880 % \item
9881 % \!\pcol@bg@columntop! and \!\pcol@bg@columnheight! for $a\in\{c,g\}$ by
9882 % \!\pcol@build~col~sep~rule! and \!\pcol@buildcselt!.
9883 %
9884 % \item
9885 % \!\pcol@bg@spanningtop! and \!\pcol@bg@spanningheight! for $a\in\{s,S\}$ by
9886 % \!\pcol@buildcselt!.
9887 %
9888 % \item
9889 % \!\pcol@bg@floatheight! for $a\in\{f,F\}$ by \!\pcol@outputelt!,
9890 % \!\pcol@ioutputelt!, \!\pcol@output@clear! and \!\pcol@makeflushedpage!
9891 %
9892 % \item
9893 % \!\pcol@bg@footnoteheight! for $a\in\{n,N\}$ by \!\pcol@ioutputelt!,
9894 % \!\pcol@imakeflushed~page! and \!\pcol@output@end!.
9895 % \end{itemize}
9896 %
9897 % \begin{macrocode}
9898 \def\pcol@bg@preposttop@left{0pt}
9899 \let\pcol@bg@preposttop@right\pcol@bg@preposttop@left
9900
9901 % \end{macrocode}
9902 % \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
9903 % \end{macro}\end{macro}\end{macro}\end{macro}
9904 %
9905 % \KeepSpace{18}
9906 % \begin{macro}{\pcol@bg@@c}
9907 % \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
9908 % \begin{macro}{\pcol@bg@@C}
9909 % \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
9910 % \begin{macro}{\pcol@bg@@g}
9911 % \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
9912 % \begin{macro}{\pcol@bg@@G}
9913 % \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
9914 % \begin{macro}{\pcol@bg@@s}
9915 % \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
9916 % \begin{macro}{\pcol@bg@@S}
9917 % \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
9918 % \begin{macro}{\pcol@bg@@t}
9919 % \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
9920 % \begin{macro}{\pcol@bg@@T}
9921 % \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
9922 % \begin{macro}{\pcol@bg@@b}
9923 % \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
9924 % \begin{macro}{\pcol@bg@@B}
9925 % \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
9926 % \begin{macro}{\pcol@bg@@l}
9927 % \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
9928 % \begin{macro}{\pcol@bg@@L}
9929 % \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
9930 % \begin{macro}{\pcol@bg@@r}
9931 % \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
9932 % \begin{macro}{\pcol@bg@@R}
9933 % \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
9934 % \begin{macro}{\pcol@bg@@f}
9935 % \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
9936 % \begin{macro}{\pcol@bg@@F}
9937 % \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
9938 % \begin{macro}{\pcol@bg@@n}
9939 % \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
9940 % \begin{macro}{\pcol@bg@@N}
9941 % \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
9942 % \begin{macro}{\pcol@bg@@p}
9943 % \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
9944 % \begin{macro}{\pcol@bg@@P}
9945 % \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
9946 % 
9947 % The macros $|\pcol@bg@@|{\cdot}a$
9948 % 
9949 % \SpecialArrayMainIndex{a}{\pcol@bg@@}
9950 % 
9951 % define arguments $F_x$, $F_y$, $F_w$ and $F_h$ to be passed to
9952 % \!\pcol@bg@paintregion@i! in their bodies to calculate $(x_0,y_0)$ and
9953 % $(x_1{-}x_0,y_1{-}y_0)$ for regions $\bgr_a^{[c]}$ as shown below in the
9954 % form of $(x_0,y_0)+(x_1{-}x_0,y_1{-}y_0)$ (to have $(x_1,y_1)$), where
9955 % $H^c=\!\pcol@bg@columntop!$, $h^c=\!\pcol@bg@columnheight!$,
9956 % $H^s=\!\pcol@bg@spanningtop!$, $h^s=\!\pcol@bg@spanningheight!$,
9957 % $h^f=\!\pcol@bg@floatheight!$, $h^n=\!\pcol@bg@footnoteheight!$ and
9958 % $H^p=\!\pcol@bg@preposttop!$ calculated by macros which invoke \bgpaint{}
9959 % macros, while $s^n=\!\skip!\!\footins!$.
9960 % 
9961 % \begin{eqnarray*}
9962 % \bgr_c^c&\;:\;&(\W_c\;,\;H^c)\ +\ (w_c\;,\;h^c)\\
9963 % \bgr_C^c&:&(\W_c\;,\;0)\ +\ (w_c\;,\;\HT)\\
9964 % \bgr_g^c&:&((\W_c+w_c)\;,\;H^c)\ +\ (g_c\;,\;h^c)\\
9965 % \bgr_G^c&:&((\W_c+w_c)\;,\;0)\ +\ (g_c\;,\;\HT)\\
9966 % \bgr_{\{s,S\}}&:&(0\;,\;H^s)\ +\ (\WT\;,\;h^s)\\
9967 % \bgr_{\{t,T\}}&:&(-(\WM-\WR)\;,\;-(\HM-\HR))\ +\ ((\WP-2\WR)\;,\;\HM-\HR)\\
9968 % \bgr_{\{b,B\}}&:&(-(\WM-\WR)\;,\;\HT)\ +\
9969 % ((\WP-2\WR)\;,\;(\HP-2\HR)-((\HM-\HR)+\HT))\\
9970 % \bgr_{\{l,L\}}&:&(-(\WM-\WR)\;,\;0)\ +\ ((\WM-\WR)\;,\;\HT)\\
9971 % \bgr_{\{r,R\}}&:&(\WT\;,\;0)\ +\ ((\WP-2\WR)-((\WM-\WR)+\WT)\;,\;\HT)\\
9972 % \bgr_{\{f,F\}}&:&(0\;,\;0)\ +\ (\WT\;,\;h^f)\\
9973 % \bgr_{\{n,N\}}&:&(0\;,\;\HT-(h^n+s^n))\ +\ (\WT\;,\;h^n+s^n)\\
9974 % \bgr_{\{p,P\}}&:&(0\;,\;H^p)\ +\ (\WT\;,\;\HT-H^p)
9975 % \end{eqnarray*}
9976 % 
9977 % \begin{macrocode}
9978 \def\pcol@bg@@c{%
9979 {\pcol@bg@columnleft}%
9980 {\@elt\pcol@bg@columntop}%
9981 {\pcol@bg@columnwidth}%
9982 {\pcol@bg@columnheight}}
9983 \def\pcol@bg@@C{%
9984 {\pcol@bg@columnleft}%
9985 {}%
9986 {\pcol@bg@columnwidth}%
9987 {\pcol@bg@textheight}}
9988 \def\pcol@bg@@g{%
9989 {\pcol@bg@columnright}%
9990 {\@elt\pcol@bg@columntop}%
9991 {\pcol@bg@columnsep}%
9992 {\pcol@bg@columnheight}}
9993 \def\pcol@bg@@G{%
9994 {\pcol@bg@columnright}%
9995 {}%
9996 {\pcol@bg@columnsep}%
9997 {\pcol@bg@textheight}}
9998 \def\pcol@bg@@s{%
9999 {}%
10000 {\pcol@bg@spanningtop}%
10001 {\@elt\textwidth}%
10002 {\pcol@bg@spanningheight}}
10003 \def\pcol@bg@@t{%
10004 {\pcol@bg@negative\pcol@bg@pageleft}%
10005 {\pcol@bg@negative\pcol@bg@pagetop}%
10006 {\pcol@bg@paperwidth}%
10007 {\pcol@bg@pagetop}}
10008 \def\pcol@bg@@b{%
10009 {\pcol@bg@negative\pcol@bg@pageleft}%
10010 {\pcol@bg@textheight}%
10011 {\pcol@bg@paperwidth}%
10012 {\pcol@bg@paperheight
10013 \pcol@bg@negative{\pcol@bg@pagetop \pcol@bg@textheight}}}
10014 \def\pcol@bg@@l{%
10015 {\pcol@bg@negative\pcol@bg@pageleft}%
10016 {}%
10017 {\pcol@bg@pageleft}%
10018 {\pcol@bg@textheight}}
10019 \def\pcol@bg@@r{%
10020 {\@elt\textwidth}%
10021 {}%
10022 {\pcol@bg@paperwidth
10023 \pcol@bg@negative{\pcol@bg@pageleft \@elt\textwidth}}%
10024 {\pcol@bg@textheight}}
10025 \def\pcol@bg@@f{%
10026 {}%
10027 {}%
10028 {\@elt\textwidth}%
10029 {\pcol@bg@floatheight}}
10030 \def\pcol@bg@@n{%
10031 {}%
10032 {\pcol@bg@textheight
10033 \pcol@bg@negative{\pcol@bg@footnoteheight \@elt{\skip\footins}}}%
10034 {\@elt\textwidth}%
10035 {\pcol@bg@footnoteheight \@elt{\skip\footins}}}
10036 \def\pcol@bg@@p{%
10037 {}%
10038 {\@elt\pcol@bg@preposttop}%
10039 {\@elt\textwidth}%
10040 {\pcol@bg@textheight \pcol@bg@negative{\@elt\pcol@bg@preposttop}}}
10041 \let\pcol@bg@@S\pcol@bg@@s
10042 \let\pcol@bg@@T\pcol@bg@@t
10043 \let\pcol@bg@@B\pcol@bg@@b
10044 \let\pcol@bg@@L\pcol@bg@@l
10045 \let\pcol@bg@@R\pcol@bg@@r
10046 \let\pcol@bg@@F\pcol@bg@@f
10047 \let\pcol@bg@@N\pcol@bg@@n
10048 \let\pcol@bg@@P\pcol@bg@@p
10049
10050 % \end{macrocode}
10051 % \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
10052 % \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
10053 % \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
10054 % \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
10055 %
10056 %
10057 %
10058 % \KeepSpace{10}
10059 % \section{Special Output Routines}
10060 % \label{sec:imp-sout}
10061 %
10062 % \subsection{Dispatcher}
10063 % \label{sec:imp-sout-disp}
10064 %
10065 % \changes{v1.22}{2013/06/30}
10066 % {\cs{pcol@op@cpush} was introduced for output request to push color
10067 % stack but removed in v1.34.}
10068 % \changes{v1.34}{2018/05/07}
10069 % {\cs{pcol@op@cpush} is removed according to the change of text
10070 % coloring from \cs{output} to \cs{insert}.}
10071 % \changes{v1.22}{2013/06/30}
10072 % {\cs{pcol@op@cpop} was introduced for output request to pop color
10073 % stack but removed in v1.34.}
10074 % \changes{v1.34}{2018/05/07}
10075 % {\cs{pcol@op@cpop} is removed according to the change of text
10076 % coloring from \cs{output} to \cs{insert}.}
10077 % \changes{v1.22}{2013/06/30}
10078 % {\cs{pcol@op@cset} was introduced for output request to set
10079 % $\gamma_0^c$ but removed in v1.34}
10080 % \changes{v1.34}{2018/05/07}
10081 % {\cs{pcol@op@cpop} is removed according to the change of text
10082 % coloring from \cs{output} to \cs{insert}.}
10083 %
10084 % \begin{macro}{\pcol@op@start}
10085 % \begin{macro}{\pcol@op@switch}
10086 % \begin{macro}{\pcol@op@flush}
10087 % \begin{macro}{\pcol@op@clear}
10088 % \begin{macro}{\pcol@op@end}
10089 % 
10090 % The macro $|\pcol@op@|{\cdot}f$ where $f\in
10091 % F=\{|start|,|switch|,|flush|,|clear|,|end|\}$ has
10092 % our own \!\outputpenalty! code less than $-10000$ to invoke the
10093 % corresponding macro $|\pcol@output@|{\cdot}f$. The code macros are given
10094 % to \!\pcol@invokeoutput! as its argument by \!\pcol@zparacol! ($f=|start|$),
10095 % \!\pcol@switchcol! ($f=|switch|$), \!\pcol@visitallcols! ($f=|switch|$),
10096 % \!\pcol@com@flushpage! ($f=|flush|$), \!\pcol@com@clearpage!
10097 % ($f=|clear|$), \!\pcol@flushclear! ($f=|switch|$), and \!\endparacol!
10098 % ($f=|end|$) to set one of them into \!\outputpenalty!, so that the other
10099 % user \!\pcol@specialoutput! examines which special function is invoked.
10100 % 
10101 % \SpecialIndex{\pcol@output@start}
10102 % \SpecialIndex{\pcol@output@switch}
10103 % \SpecialIndex{\pcol@output@flush}
10104 % \SpecialIndex{\pcol@output@clear}
10105 % \SpecialIndex{\pcol@output@end}
10106 % 
10107 % \begin{macrocode}
10108 %% Special Output Routines: Dispatcher
10109
10110 \def\pcol@op@start{-10010}
10111 \def\pcol@op@switch{-10011}
10112 \def\pcol@op@flush{-10012}
10113 \def\pcol@op@clear{-10013}
10114 \def\pcol@op@end{-10014}
10115
10116 % \end{macrocode}
10117 % \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
10118 %
10119 % \changes{v1.24}{2013/07/27}
10120 % {\cs{pcol@op@mcpush} was introduced for coloring specified in math
10121 % mode but removed in v1.34.}
10122 % \changes{v1.34}{2018/05/07}
10123 % {\cs{pcol@op@mcpush} is removed according to the change of text
10124 % coloring from \cs{output} to \cs{insert}.}
10125 % \changes{v1.24}{2013/07/27}
10126 % {\cs{pcol@op@mcpush@pone} was introduced for coloring specified in
10127 % math mode but removed in v1.34.}
10128 % \changes{v1.34}{2018/05/07}
10129 % {\cs{pcol@op@mcpush@pone} is removed according to the change of text
10130 % coloring from \cs{output} to \cs{insert}.}
10131 % \changes{v1.24}{2013/07/27}
10132 % {\cs{pcol@op@mcpop} was introduced for coloring specified in math
10133 % mode but removed in v1.34.}
10134 % \changes{v1.34}{2018/05/07}
10135 % {\cs{pcol@op@mcpop} is removed according to the change of text
10136 % coloring from \cs{output} to \cs{insert}.}
10137 % \changes{v1.24}{2013/07/27}
10138 % {\cs{pcol@op@mcpop@pone} was introduced for coloring specified in
10139 % math mode but removed in v1.34.}
10140 % \changes{v1.34}{2018/05/07}
10141 % {\cs{pcol@op@mcpop@pone} is removed according to the change of text
10142 % coloring from \cs{output} to \cs{insert}.}
10143 %
10144 % \begin{macro}{\pcol@specialoutput}
10145 % \changes{v1.0}{2011/10/10}
10146 % {Remove unnecessary \cs{pcol@latex@specialoutput}.}
10147 % \changes{v1.2-2}{2013/05/11}
10148 % {Add footnote logging if $\cs{outputpenalty}\EQ-10004$.}
10149 % \changes{v1.22}{2013/06/30}
10150 % {Add the invocation of \cs{pcol@output@}${\cdot}f$ for
10151 % $f\in\{\string\texttt{cpush},\string\texttt{cpop},
10152 % \string\texttt{cset}\}$}
10153 % \changes{v1.24}{2013/07/27}
10154 % {Add examination with $P_{\string\rm{push}}$ and $P_{\string\rm{pop}}$
10155 % and invocation of \cs{pcol@output@mcpush} and
10156 % \cs{pcol@output@mcpop}.}
10157 % \changes{v1.34}{2018/05/07}
10158 % {Remove examinations related to $f\in\{{\tt cpush},{\tt cpop},{\tt
10159 % mcpush},{\tt mcpop}\}$.}
10160 % 
10161 % The macro \!\pcol@specialoutput! is invoked solely in \!\pcol@output! to
10162 % invoke our own or \LaTeX's special output routine. It examines if
10163 % $P=\!\outputpenalty!\in\Set{\cs{pcol@op@}{\cdot}f}{f\in F}$ and then, if
10164 % so, before invoking $|\pcol@output@|{\cdot}f$, we rebuild \!\@holdpg!
10165 % removing \!\lastbox! and the last vertical skip as done in \LaTeX's
10166 % \!\@specialoutput!. We also let $\!\outputpenalty!=-10000$\footnote{
10167 % 
10168 % It can be any value larger than -10004.}
10169 % 
10170 % so that \!\vsize! is correctly set to \!\@colroom! in the second half of
10171 % \!\pcol@output! after this macro finishes.
10172 %
10173 % \hfuzz9pt
10174 % Otherwise, i.e., if $P\notin\Set{\cs{pcol@op@}{\cdot}f}{f\in{}F}$,
10175 % we simply invokes \LaTeX's \!\@specialoutput!\footnote{
10176 % 
10177 % With footnote logging if $\cs{outputpenalty}=-10004$.}.
10178 % 
10179 % \begin{macrocode}
10180 \def\pcol@specialoutput{%
10181 \ifnum\outputpenalty=\pcol@op@start\relax
10182 \let\reserved@a\pcol@output@start
10183 \else\ifnum\outputpenalty=\pcol@op@switch\relax
10184 \let\reserved@a\pcol@output@switch
10185 \else\ifnum\outputpenalty=\pcol@op@flush\relax
10186 \let\reserved@a\pcol@output@flush
10187 \else\ifnum\outputpenalty=\pcol@op@clear\relax
10188 \let\reserved@a\pcol@output@clear
10189 \else\ifnum\outputpenalty=\pcol@op@end\relax
10190 \let\reserved@a\pcol@output@end
10191 \else \let\reserved@a\@specialoutput
10192 \fi\fi\fi\fi\fi
10193 \ifnum\outputpenalty=-\@Miv\relax
10194 \ifvoid\footins\else \pcol@Log\dummy{dummy}\footins \fi
10195 \fi
10196 \ifx\reserved@a\@specialoutput\else
10197 \global\setbox\@holdpg\vbox{\unvbox\@holdpg \unvbox\@cclv
10198 \setbox\@tempboxa\lastbox \unskip}%
10199 \outputpenalty-\@M
10200 \fi
10201 \reserved@a}
10202
10203 % \end{macrocode}
10204 % \end{macro}
10205 %
10206 %
10207 %
10208 % \subsection{Building Starting Page} \label{sec:imp-sout-start}
10209 %
10210 % \begin{macro}{\pcol@output@start}
10211 % \changes{v1.0}{2011/10/10}
10212 % {Change the order of operations.}
10213 % \changes{v1.0}{2011/10/10}
10214 % {Rename \cs{pcol@maxpage} as \cs{pcol@toppage}.}
10215 % \changes{v1.0}{2011/10/10}
10216 % {Add special operation in case of too small room for column-pages.}
10217 % \changes{v1.2-2}{2013/05/11}
10218 % {Add initialization of $\string\mathit{\string\Phi}$ and
10219 % page-wise footnote output operations, and revise reflecting
10220 % the redesign of page context.}
10221 % \changes{v1.2-7}{2013/05/11}
10222 % {Add \cs{pcol@outputtrue} to solve the \cs{output} request sneaking.}
10223 % \changes{v1.2-7}{2013/05/11}
10224 % {Include the effect of the separation of pre-environment bottom
10225 % floats and columns in the starting page into the check of too large
10226 % pre-environment stuff.}
10227 % \changes{v1.3-6}{2013/09/17}
10228 % {Change the page builder for too tall pre-environment stuff from
10229 % \cs{pcol@makenormalcol} to \cs{@makecol} because the page should be
10230 % built by the ordinary mechanism.}
10231 % \changes{v1.3-3}{2013/09/17}
10232 % {Let $\cs{ifpcol@output}\EQ\string\mathit{false}$ temporarily before
10233 % the invocation of \cs{@outputpage} for too tall pre-environment
10234 % stuff because the page is considered as outside
10235 % \string\texttt{paracol} environments.}
10236 % \changes{v1.32-3}{2015/10/10}
10237 % {Add depth clearing of imported deferred floats in case that some of
10238 % them has \texttt{1sp}.}
10239 % \changes{v1.35-4}{2018/12/31}
10240 % {Add \cs{belowfootnoteskip} to $H_f$ being the space for the
10241 % non-merged pre-environment footnotes.}
10242 % 
10243 % The macro \!\pcol@output@start! is invoked solely from
10244 % \!\pcol@specialoutput! to process the special \!\output! request made in
10245 % \!\pcol@zparacol! and to build the {\em\Uidx\spage} from which parallel
10246 % columns start possibly with the stuff preceding \beginparacol{}, or
10247 % {\em\Uidx\preenv} in short. First, we turn
10248 % $\CSIndex{ifpcol@output}=\true$ so that \!\output! requests for page
10249 % breaks are processed by our own macros such as \!\pcol@makecol! hereafter.
10250 % Then we let $p=\pbase={\ptop}=0$ and $\PP=\emptyset$ because we have
10251 % nothing for $q<\ptop=0$. We also move \!\@deferlist! to \!\@dbldeferlist!
10252 % and then let \!\@deferlist! be empty because all \cwise{} deferred floats
10253 % become \pwise{}. In this float importation, as discussed in
10254 % item-(\ref{item:ovv-float-@output@start}) of
10255 % \secref{sec:imp-ovv-float}, we force all floats in the list have
10256 % depth 0 to ensure no one has |1sp| to conform our own and old-fashioned
10257 % \pwise{} float placement mechanism\footnote{
10258 % 
10259 % Though having \texttt{1sp} is almost impossible.}.
10260 % 
10261 % We then and let $\df=\bot$ because we don't have any deferred footnotes.
10262 %
10263 % Next we calculate $H=H_r-(H_m+H_f+H_b)$ where $H_r=\!\@colroom!$; $H_m$ is
10264 % the height-plus-depth of the main vertical list in \!\@holdpg!; $H_f$ is
10265 % the sum of \!\skip!\!\footins!, the height-plus-depth of \!\footins! and
10266 % \!\belowfootnoteskip!, if \!\footins! is not $\bot$ or 0 otherwise; and
10267 % $H_b=\!\textfloatsep!$ if the \preenv{} has bottom floats or 0 otherwise.
10268 % That is, $H$ is the room for each of \colpage{} in the \spage. Then we
10269 % examine if $H<1.5\times\!\baselineskip!$ to mean \!\pcol@output! would
10270 % force a page break with warning. If so, we assume we have a page break
10271 % before \beginparacol{} to ship out \preenv{} to avoid the warning.
10272 % Therefore, we invoke \LaTeX's \!\@makecol!\footnote{
10273 % 
10274 % \Sloppy{2500}%
10275 % We can be unaware of our customization for \sync{}ation in
10276 % \CSIndex{pcol@combinefloats} because \CSIndex{pcol@textfloatsep} is
10277 % made $\infty$ by \CSIndex{pcol@zparacol}.}
10278 % 
10279 % giving it \!\@holdpg! through \!\@cclv! to build the ship-out image in
10280 % \!\@outputbox!. Then the box is passed to \!\@outputbox! for which we
10281 % temporarily let $\CSIndex{ifpcol@output}=\false$ because the page is
10282 % assumed to be outside the \env{paracol} environment having just started.
10283 %
10284 % After that we invoke \!\pcol@startpage! to let it produce $\pp(\ptop)$ for
10285 % the \spage{} $\ptop=0$ letting $\!\pcol@currpage!$ be empty so that the
10286 % macro will not refer to it. The page $\pp(0)$ is usually empty but can
10287 % have non-empty $\pp^i(0)$ with imported deferred floats which are now
10288 % \pwise. Moreover, we can have two or more pages if deferred \pwise{}
10289 % floats produce \fpage{s}. However, we can be unaware of these effects of
10290 % floats because the resulting $\PP^+$ with them is correct of course.
10291 %
10292 % Then let $\!\topskip!=\!\pcol@topskip!$ being the value at \beginparacol,
10293 % and $\cs{ifpcol@}\~|firstpage|={\false}$, because we have the \spage{}
10294 % without \preenv{} and thus the first item of each column will be at its
10295 % top.
10296 % 
10297 % \CSINDEX{ifpcol@firstpage}
10298 % 
10299 % \begin{macrocode}
10300 %% Special Output Routines: Building First Page
10301
10302 \def\pcol@output@start{%
10303 \global\pcol@outputtrue
10304 \global\pcol@page\z@ \global\pcol@toppage\z@ \global\pcol@basepage\z@
10305 \global\let\pcol@pages\@empty
10306 \global\let\@dbldeferlist\@deferlist \global\let\@deferlist\@empty
10307 {\def\@elt##1{\global\dp##1\z@}\@dbldeferlist}%
10308 \setbox\z@\box\pcol@topfnotes
10309 \@tempdima\@colroom
10310 \advance\@tempdima-\ht\@holdpg \advance\@tempdima-\dp\@holdpg
10311 \ifvoid\footins\else
10312 \advance\@tempdima-\skip\footins
10313 \advance\@tempdima-\ht\footins \advance\@tempdima-\dp\footins
10314 \advance\@tempdima-\belowfootnoteskip
10315 \fi
10316 \ifx\@botlist\@empty\else \advance\@tempdima-\textfloatsep \fi
10317 \ifdim\@tempdima<1.5\baselineskip
10318 \setbox\@cclv\box\@holdpg \@makecol
10319 \pcol@outputfalse \@outputpage \pcol@outputtrue
10320 \global\let\pcol@currpage\@empty \pcol@startpage
10321 \global\topskip\pcol@topskip \global\pcol@firstpagefalse
10322 % \end{macrocode}
10323 %
10324 % Otherwise, i.e., if $H\geq1.5\times\!\baselineskip!$, we invoke
10325 % \!\pcol@makenormalcol! to make the \preenv{} as the \spanning{} of the
10326 % \spage. The macro is different from \!\@makecol! as follows; the height
10327 % of resulting \!\@outputbox! is natural rather than \!\textheight!;
10328 % \Mgfnote{}s is excluded if any; and the skip of \!\textfloatsep! is added
10329 % below the bottom floats also if any,
10330 %
10331 % Then we let $h$ be the height-plus-depth of \!\@outputbox! being the
10332 % \spanning{} and shrink \!\@colht! by $h$. Next if
10333 % $h>\HB=\!\pcol@bg@preposttop!
10334 % \in\{\!\pcol@bg@preposttop@left!,\~\!\pcol@bg@preposttop@right!\}$, being
10335 % the bottom of the previous \env{paracol} environment (having right
10336 % \parapag{}e) or 0 if the current page does not have it, to mean we have
10337 % ordinary single-columned stuff in \preenv{}, we paint its \bground{} by
10338 % \!\pcol@bg@paintbox! temporarily letting $\!\pcol@bg@textheight!=h$ so
10339 % that $y_0=\HB$ and $y_1=h$ for $\bgr_{\{p,P\}}$. This \bgpaint{} is not
10340 % only for $\pp^b(0)$ which we acquire from from \!\@freelist! by \!\@next!
10341 % and let have the \spanning, but also for \!\pcol@rightpage! if $\CL<\C$ to
10342 % mean \parapag{}ing for which we temporarily increment \!\c@page! by one if
10343 % \npaired.
10344 %
10345 % We also let $\pp^h(0)$ be the shrunk \!\@colht!, and $\pp^t(0)$ be
10346 % \!\topskip! if $h=0$ assuming that the page does
10347 % not have any \spanning{}\footnote{
10348 % 
10349 % Checking the emptiness by \cs{pcol@ifempty} does not work well for the
10350 % very first page of a document because it has a \cs{write} as the very
10351 % first item.}
10352 % 
10353 % to typeset \colpage{}s from the top of the page, or otherwise be 0
10354 % together with \!\topskip! to inhibit the ordinary \!\topskip! insertion.
10355 %
10356 % As for $\pp^m(0)$, we define it as follows, referring to
10357 % $\mpbout=\!\pcol@mparbottom@out!=\{\mpb_L^l,\mpb_L^r,\mpb_R^l,\mpb_R^r\}$,
10358 % where $\mpb_X^x$ has exactly one element $\mpar(h,t)$ which may be the
10359 % position of last marginal notes in the last \env{paracol} environment in
10360 % the page we are working on, or $\mpb_X^x=\{\mpar(0,0)\}$ if such marginal
10361 % note or the environment itself does not exist in the page. On the other
10362 % hand, $B=\!\@mparbottom!$ may have non-zero for the bottom edge of the
10363 % last marginal note in \preenv{} including the last \env{paracol}
10364 % environment if any. Therefore, what we need to do is to let
10365 % $\mpb_L^x=\{\mpar(0,B)\}$ to reflect the marginal node whose bottom is at
10366 % $B$ and which can be different from what $\mpb_L^x$ had, where $x$ is the
10367 % target margin in the \preenv{} determined by \CSIndex{if@mparswitch}, the
10368 % parity of $\page(0)$ and \CSIndex{if@reversemargin}.
10369 %
10370 % The replacement is done by \!\pcol@do@mpbout! which invokes
10371 % $\!\pcol@do@mpbout@whole!\arg{m_L^l}\~\arg{m_L^r}\arg{\mpb_R^l}\arg{\mpb_R^r}$
10372 % where $m_L^x\in\{M_L^x,\,\!\pcol@do@mpbout@elem!\arg{M_L^x}\}$ whose choice
10373 % is made according that $x\in\{l,r\}$ is the target margin (latter) or not
10374 % (former). Therefore, prior to the invocation of \!\pcol@do@mpbout!, we
10375 % \!\def!fine \!\pcol@do@mpbout@whole! so that it \!\xdef!ines
10376 % $\mpbout=\!\pcol@mparbottom@out!$ with its four arguments, and
10377 % \!\pcol@do@mpbout@elem! to let it be expanded to
10378 % $\!\@elt!\Arg{0}\Arg{B}=\mpar(0,B)$. After that, we also invoke
10379 % \!\pcol@bias@mpbout! giving it $-h$ to replace $\mpar(t,b)$ being the sole
10380 % element of each $\mpb_{\{L,R\}}^{\{l,r\}}$ in the resulting $\mpbout$ with
10381 % $\mpar(t-h,b-h)$ to have what we give to $\pp^m(0)$. This replacement
10382 % transforms the coordinates for text area to that for columns, and makes it
10383 % possible for the first marginal note in each margin in the \env{paracol}
10384 % environment we now start to exploit the space for \preenv{} even if it is
10385 % tall extraordinarily.
10386 %
10387 % Then we let $\pp(0)$ have $\pp^i(0)$ and $\pp^m(0)$ shown above, and
10388 % $\pp^p(0)=\!\c@page!$, $\pp^f(0)=\bot$ and $\pp^s(0)=\emptyset$ by
10389 % \!\pcol@defcurrpage!, and let $\CSIndex{ifpcol@firstpage}=\true$ because
10390 % $\pp^b(0)$ has \preenv.
10391 % 
10392 % \changes{v1.3-6}{2013/09/17}
10393 % {Delete the argument of \cs{pcol@makenormalcol} because now it is
10394 % not used too tall pre-environment stuff.}
10395 % \changes{v1.3-3}{2013/09/17}
10396 % {Add background painting of pre-environment stuff.}
10397 % \changes{v1.3-4}{2013/09/17}
10398 % {Add initialization of $\pi^m(0)$.}
10399 % \changes{v1.32-2}{2015/10/10}
10400 % {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
10401 % 
10402 % \begin{macrocode}
10403 \else
10404 \pcol@makenormalcol
10405 \@tempdima\ht\@outputbox \advance\@tempdima\dp\@outputbox
10406 \global\advance\@colht-\@tempdima
10407 \def\reserved@a{%
10408 \ifdim\pcol@bg@preposttop=\@tempdima\else
10409 \edef\pcol@bg@textheight{\@elt{\number\@tempdima sp}}%
10410 \pcol@bg@paintbox{Pp}%
10411 \fi}
10412 \ifnum\pcol@ncolleft<\pcol@ncol
10413 \global\setbox\pcol@rightpage\vbox{%
10414 \ifpcol@paired\else \advance\c@page\@ne \fi
10415 \let\pcol@bg@preposttop\pcol@bg@preposttop@right
10416 \reserved@a \unvbox\pcol@rightpage}%
10417 \fi
10418 \pcol@Fb
10419 \@next\@currbox\@freelist{\global\setbox\@currbox\vbox{%
10420 \let\pcol@bg@preposttop\pcol@bg@preposttop@left
10421 \reserved@a \unvbox\@outputbox}}\pcol@ovf
10422 \pcol@Fe{output@start(preenv)}%
10423 \global\dimen\@currbox\@colht
10424 \ifdim\@tempdima=\z@ \@tempskipa\topskip \else \@tempskipa\z@ \fi
10425 \global\skip\@currbox\@tempskipa \global\topskip\@tempskipa
10426 \def\pcol@do@mpbout@whole##1##2##3##4{%
10427 \xdef\pcol@mparbottom@out{{##1}{##2}{##3}{##4}}}%
10428 \def\pcol@do@mpbout@elem\@elt##1##2{\@elt{0}{\number\@mparbottom}}%
10429 \pcol@do@mpbout
10430 \pcol@bias@mpbout{-\@tempdima}%
10431 \pcol@defcurrpage{\number\c@page}\@currbox\voidb@x{}{\pcol@mparbottom@out}%
10432 \global\pcol@firstpagetrue
10433 \fi
10434 % \end{macrocode}
10435 %
10436 % Then regardless of $H$, we do the followings for all columns $c\In0\C$ to
10437 % build $\cc_c$, after initializing \!\@colroom! to be \!\@colht!, and
10438 % invoking \!\pcol@floatplacement! to reinitialize the parameters of
10439 % \cwise{} float placement.
10440 %
10441 % First, if we have let $\!\topskip!=0$ with the \preenv,
10442 % we let $\cc_c(\vb^b)$ have an invisible \!\hrule! whose
10443 % height and depth are 0 as the very first vertical item of the \colpage.
10444 % When we visit the column $c$ for the first time afterward, we will
10445 % \!\unvbox! the box to let \TeX's page builder have $\!\topskip!=0$ and the
10446 % invisible rule. Then the first vertical item of the \colpage{} is added
10447 % but it is recognized as non-first by \TeX's page builder and thus it
10448 % inserts \!\baselineskip! referring to \!\prevdepth! as the depth of the
10449 % last item. The important issue is that the \!\prevdepth! to be referred
10450 % is assured having its value at \beginparacol, which is usually the depth
10451 % of the last item of \spanning, by the following mechanism: (1)
10452 % \!\pcol@invokeoutput! invoked in \!\pcol@zparacol! saves \!\prevdepth! in
10453 % \!\pcol@prevdepth! before the \!\output! request for
10454 % \!\pcol@output@start!; (2) \!\pcol@prevdepth! is saved in $\cc_c(\pd)$ by
10455 % \!\pcol@setcurrcolnf! invoked from \!\pcol@output@start! as discussed
10456 % afterward; (3) when the column $c$ is visited for the first time, the
10457 % special output routine \!\pcol@output@start! itself ($c=0$) or
10458 % \!\pcol@output@switch! ($c>0$) restores \!\pcol@prevdepth! from
10459 % $\cc_c(\pd)$ by \!\pcol@getcurrcol!; (4) \!\pcol@invokeoutput! which made
10460 % the \!\output! request for (3) lets \!\prevdepth! have the value of
10461 % \!\pcol@prevdepth! after the request. Therefore, the baseline progress
10462 % from the last line of the \spanning{} to the first line of each
10463 % \colpage{} should be very natural as we see in the third and fourth lines
10464 % of \secref{sec:man-close} of Part \ref{part:man}.
10465 %
10466 % Then we invoke \!\pcol@setcurrcolnf! to save the following values for
10467 % $\cc_c(e)$ ($e\neq\vb$); $\cc_c(\ft)=\!\voidb@x!$ because $c$ does not
10468 % have \Mcfnote{}s so far; $\cc_c(\pd)=\!\prevdepth!$ as discussed above;
10469 % $\cc_c(\tl)=\cc_c(\ml)=\cc_c(\bl)=\emptyset$ because
10470 % \!\pcol@makenormalcol! and \!\@combinefloats! invoked from it emptied
10471 % them; $\cc_c(\dl)=\emptyset$ as discussed above;
10472 % $\cc_c(\tn)=\!\c@topnumber!$, $\cc_c(\bn)=\!\c@botnumber!$ and
10473 % $\cc_c(\tn)=\!\c@totalnumber!$ as initialized by \!\@floatplacement!
10474 % invoked from \!\pcol@floatplacement!;
10475 % $\cc_c(\tr)=\!\topfraction!\times\!\@colht!$ and
10476 % $\cc_c(\br)=\!\bottomfraction!\times\!\@colht!$ as initialized by
10477 % \!\@floatplacement!; $\cc_c(\sw)$ is defined by \CSIndex{if@nobreak} and
10478 % \cs{if@after}\~|indent|
10479 % 
10480 % \expandafter\SpecialIndex\csname if@afterindent\endcsname
10481 % 
10482 % at the time of \beginparacol; and
10483 % $\cc_c(\ep)=\!\everypar!$ at the time of \beginparacol. We also let
10484 % $\cc_c(\vb^p)=0$ because $p=0$ and $\cc_c(\vb^r)=\!\@colroom!$ defined
10485 % above. In addition, we let $\S_c=\emptyset$ because we don't have any
10486 % \colpage{} having been completed.
10487 %
10488 % \SpecialArrayIndex{c}{\pcol@columncolor}
10489 % \SpecialArrayIndex{c}{\pcol@columncolor@box}
10490 % We also examine if $\Celtshadow^c=\cs{pcol@columncolor}\cdot c$ is defined
10491 % and, if so, acquire an \!\insert! from \!\@freelist! to let
10492 % $\Celt^c=\cs{pcol@columncolor@box}\cdot c$ have the coloring \!\special!
10493 % for the color defined in $\Celtshadow^c$ by invoking \!\pcol@set@color!
10494 % being the original \!\set@color! with nullification of \!\aftergroup!.
10495 % Otherwise, we let $\Celt^c=\bot$ .
10496 % 
10497 % \changes{v1.0}{2011/10/10}
10498 % {Add clearing of $S_c$.}
10499 % \changes{v1.32-2}{2015/10/10}
10500 % {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
10501 % \changes{v1.34}{2018/05/07}
10502 % {Add initialization of
10503 % $\gamma_0^c\EQ\cs{pcol@columncolor@box}\cdot c$.} 
10504 % 
10505 % \begin{macrocode}
10506 \global\@colroom\@colht \pcol@floatplacement
10507 \pcol@currcol\z@ \@whilenum\pcol@currcol<\pcol@ncol\do{%
10508 \pcol@Fb
10509 \@next\@currbox\@freelist{\global\setbox\@currbox\vbox{%
10510 \ifdim\topskip=\z@ \hrule\@height\z@\@width\z@ \fi}}\pcol@ovf
10511 \pcol@Fe{output@start(col)}%
10512 \pcol@setcurrcolnf
10513 \global\count\@currbox\z@
10514 \global\dimen\@currbox\@colroom
10515 \expandafter\gdef\csname pcol@shipped\number\pcol@currcol\endcsname{}%
10516 \pcol@ifccdefined
10517 {\@next\@currbox\@freelist{\global\setbox\@currbox\vbox{%
10518 \def\current@color{\pcol@ccuse{}}\let\aftergroup\@gobble
10519 \pcol@set@color}}\pcol@ovf}%
10520 {\def\@currbox{\voidb@x}}%
10521 \pcol@ccxdef{\@currbox}%
10522 \advance\pcol@currcol\@ne}%
10523 % \end{macrocode}
10524 %
10525 % \changes{v1.2-1}{2013/05/11}
10526 % {Add emptying \cs{pcol@colorstack} and the invocation of
10527 % \cs{pcol@savecolorstack} at the beginning of the first
10528 % column-page to be built.}
10529 % \changes{v1.2-2}{2013/05/11}
10530 % {Add insertion of \cs{footins} having footnotes to be merged if it
10531 % is not void.}
10532 % \changes{v1.22}{2013/06/30}
10533 % {Move emptying \cs{pcol@colorstack} to \cs{pcol@zparacol}.}
10534 % \changes{v1.32-2}{2015/10/10}
10535 % {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
10536 % \changes{v1.35-1}{2018/12/31}
10537 % {Add \cs{interlinepenalty} insertion for the first column to avoid
10538 % vertical overfull due to the first item taller than the column
10539 % room.}
10540 % 
10541 % Finally, we let $c=\!\pcol@currcol!=0$ for the first column, and regain the
10542 % parameters in $\cc_0$ by \!\pcol@getcurrcol!. Then before putting
10543 % $\cc_0(\vb^b)$ to the main vertical list by \!\unvbox! returning
10544 % $\cc_0(\vb)$ to \!\@freelist! by \!\@cons! because it has become useless
10545 % so far, we save the \colorctext{} just with $\Celt^c$ into $\csts$ by
10546 % \!\pcol@savecolorstack! because $\CST$ is emptied by \!\pcol@zparacol!.
10547 % Then we \!\insert! \!\footins! through itself to the main vertical list if
10548 % it is not $\bot$ and thus has footnotes to be \mgfnote{}. This
10549 % \!\insert!ion is different from other footnote \!\insert!ion because
10550 % \!\footins! is not \!\unvbox!ed but is put as a whole and is followed by
10551 % \!\penalty!\!\interlinepenalty!, so that footnotes will not be broken by
10552 % \TeX's page builder to prevent the reconnection of a broken footnote with
10553 % inappropriate glue discarding, which we will discuss in
10554 % \secref{sec:imp-fnote}. We also add a penalty 10000 or
10555 % \!\interlinepenalty! according to $\CSIndex{if@nobreak}=\true$ or not to
10556 % allow the first column to start from a new page when its first item is
10557 % taller than the room in the \spage{}.
10558 % 
10559 % \begin{macrocode}
10560 \global\pcol@currcol\z@
10561 \pcol@getcurrcol
10562 \pcol@savecolorstack
10563 \pcol@Fb
10564 \@cons\@freelist\@currbox \unvbox\@currbox
10565 \pcol@Fe{output@start(col)}%
10566 \ifvoid\footins\else
10567 \pcol@Log\pcol@output@start{insert}\footins
10568 \insert\footins{\box\footins\penalty\interlinepenalty}%
10569 \fi
10570 \if@nobreak \nobreak \else \addpenalty\interlinepenalty \fi}
10571
10572 % \end{macrocode}
10573 % \end{macro}
10574 %
10575 % \begin{macro}{\pcol@makenormalcol}
10576 % \changes{v1.2-2}{2013/05/11}
10577 % {Replace the building operation of \cs{@outputbox} with footnotes
10578 % with the invocation of \cs{pcol@combinefootins} and add the
10579 % examination of \cs{ifpcol@mgfnote}.}
10580 % \changes{v1.2-7}{2013/05/11}
10581 % {Turn \cs{ifpcol@lastpage} be $\string\true$ temporarily for
10582 % \cs{pcol@combinefloats} to separate bottom floats in
10583 % pre-environment stuff and the multi-column stuff in
10584 % \string\texttt{paracol} environment by \cs{textfloatsep}.}
10585 % \changes{v1.3-6}{2013/09/17}
10586 % {Completely redesigned to use \cs{@makecol} if pre-environment
10587 % stuff has bottom floats.}
10588 % \changes{v1.32-2}{2015/10/10}
10589 % {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
10590 % 
10591 % The macro \!\pcol@makenormalcol! is invoked solely from
10592 % \!\pcol@output@start! to let \!\@output~box! have the \preenv{} as
10593 % \spanning{} of the \spage. The operations this macro performs are very
10594 % similar to those of \!\@makecol!, which in fact is used in this macro
10595 % itself, but has the following differences.
10596 % 
10597 % \begin{enumerate}\def\labelenumi{(\arabic{enumi})}
10598 % \item
10599 % If $\CSIndex{ifpcol@mgfnote}=\true$, we exclude footnotes in \!\footins!
10600 % from \!\@outputbox!, because they are \mgfnote{} with \Scfnote{}s given in
10601 % columns, by saving it into \!\@tempboxa! during the building process and
10602 % restoring it from the box register.
10603 %
10604 % \item
10605 % If \preenv{} does not have bottom floats, we build \!\@outputbox! by
10606 % ourselves without relying on \!\@makecol! because the skips put into the
10607 % bottom (or near it) by the macro is harmful to making \preenv{} and
10608 % parallel columns naturally connected. Therefore, we move
10609 % \!\@holdpg! to \!\@outputbox! adding \!\footins! to its tail if any by
10610 % \!\pcol@combinefootins!, and then combine top floats if any by
10611 % \!\pcol@combinefloats!\footnote{
10612 % 
10613 % Since we do not have bottom floats, the order of materials in the
10614 % resulting \!\@outputbox! being top floats, main text and footnotes should
10615 % be consistent with other pages with any \LaTeX{} including p\LaTeX.}.
10616 % 
10617 % In addition, we clear \!\@midlist! and returns its contents to
10618 % \!\@freelist! as \!\@makecol! does.
10619 %
10620 % \item
10621 % If \preenv{} has bottom floats, on the other hand, we use \!\@makecol! to
10622 % build \preenv{} in \!\@outputbox! moving \!\@holdpg! into \!\box!|255|
10623 % prior to the invocation\footnote{
10624 % 
10625 % Therefore the order of footnotes and bottom floats is consistent with
10626 % other pages and columns, i.e., footnote-first in the native \LaTeX{} while
10627 % float-first in p\LaTeX{}, for example.}.
10628 % 
10629 % Also before invocation in addition, we temporarily let
10630 % $\CSIndex{ifpcol@lastpage}=\true$ to let
10631 % $\!\@combinefloats!=\!\pcol@combinefloats!$ used in \!\@makecol! put a
10632 % vertical skip of \!\textfloatsep! below the bottom floats so that the
10633 % floats are well separated from the top of multi-column stuff in the
10634 % \spage. We also nullify \!\@textbottom! by making it \!\let!-equal to
10635 % \!\relax! because it is unnecessary to put an infinitely stretchable skip
10636 % at the bottom\footnote{
10637 % 
10638 % Even if unharmful.},
10639 % 
10640 % and let $\!\vbadness!=10000$ to avoid an inevitable underfull message
10641 % because \!\@makecol! lets \!\@outputbox! as tall as \!\textheight!.
10642 %
10643 % \item
10644 % In both cases but especially that with bottom floats, resulting
10645 % \!\@outputbox! is decapsulated by \!\unvbox! to make its height {\em
10646 % natural}.
10647 % \end{enumerate}
10648 % 
10649 % Note that the special function for \sync{}ed \colpage{} in
10650 % \!\pcol@combinefloats! used directly or indirectly in this macro, on the
10651 % other hand, is not active in the invocation because \!\pcol@zparacol!
10652 % initialized $\!\pcol@textfloatsep!=\infty$ to mean we have no \sync{}ation
10653 % points. Also
10654 % note that bottom floats and non-\mgfnote{} footnotes are put in
10655 % \!\@outputbox! and thus they will not appear at the bottom of the page
10656 % but above the \colpage{}s in the page\footnote{
10657 % 
10658 % We could put them at the bottom by keeping them somewhere and insert them
10659 % in \!\pcol@outputcolumns!, but it will cause another problem that the
10660 % numbers of the figures and footnotes are smaller than those in \colpage{}s
10661 % which are above them.}.
10662 % 
10663 % \begin{macrocode}
10664 \def\pcol@makenormalcol{%
10665 \ifpcol@mgfnote \setbox\@tempboxa\box\footins \fi
10666 \begingroup
10667 \ifx\@botlist\@empty
10668 \ifvoid\footins \setbox\@outputbox\box\@holdpg
10669 \else \pcol@combinefootins\@holdpg\footins
10670 \fi
10671 \pcol@Fb
10672 \let\@elt\relax \xdef\@freelist{\@freelist\@midlist}%
10673 \pcol@Fe{makenormalcol}%
10674 \global\let\@midlist\@empty
10675 \pcol@combinefloats
10676 \else
10677 \pcol@lastpagetrue
10678 \setbox\@cclv\box\@holdpg \let\@textbottom\relax \vbadness\@M
10679 \@makecol
10680 \fi
10681 \global\setbox\@outputbox\vbox{\unvbox\@outputbox}%
10682 \endgroup
10683 \ifpcol@mgfnote \setbox\footins\box\@tempboxa \fi}
10684
10685 % \end{macrocode}
10686 % \end{macro}
10687 %
10688 %
10689 %
10690 % \subsection{Column-Switching}
10691 % \label{sec:imp-sout-switch}
10692 %
10693 % \begin{macro}{\pcol@output@switch}
10694 % \changes{v1.2-1}{2013/05/11}
10695 % {Add \cs{pcol@clearcst@unvbox} to add coloring \cs{special}s at the
10696 % top and bottom of the column-page to be saved.}
10697 % \changes{v1.3-1}{2013/09/17}
10698 % {Add the capture of a spanning text when it is closed.}
10699 % \changes{v1.3-3}{2013/09/17}
10700 % {Add $\pi^s(p)\EQ\cs{pcol@sptextlist}$ to the argument of
10701 % \cs{pcol@defcurrpage}.}
10702 % \changes{v1.3-4}{2013/09/17}
10703 % {Add $\pi^m(p)\EQ\cs{pcol@mparbottom}$ to the argument of
10704 % \cs{pcol@defcurrpage}.}
10705 % \changes{v1.32-2}{2015/10/10}
10706 % {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
10707 % \changes{v1.33-2}{2016/11/19}
10708 % {Let \cs{dimen@} have the height of \cs{pcol@prespan} if it is not
10709 % $\bot$, or 0 if $\bot$ for the sake of clarity.}
10710 % 
10711 % The macro \!\pcol@output@switch! is invoked from
10712 % \!\pcol@specialoutput! to process the special \!\output! request made in
10713 % \!\pcol@switchcol!, \!\pcol@visitallcols! and \!\pcol@flushclear!, for a
10714 % \cswitch{} from $c=\!\pcol@currcol!$ to $d=\!\pcol@nextcol!$ which can be
10715 % $c$. The macro is also invoked from \!\pcol@makeflushedpage! to \sync{}e
10716 % and to flush all \ccolpage{}s but staying in $c$.
10717 %
10718 % First, we examine if the \cswitch{} is to close a \mctext, i.e.,
10719 % $\CSIndex{ifpcol@sptext}={\true}$ and $c=0$, and if so we do the
10720 % following; let $h_p$ be the height of \!\pcol@prespan! having \prespan{}
10721 % if it is not $\bot$, or 0 if $\bot$ to mean we have had a page break in
10722 % the \mctext; add $h_p$ to \!\@colroom! which we temporarily shrank when
10723 % the \mctext{} starts; add an element $\spt(H,h)$ to the tail of
10724 % $\pp^s(\ptop)=\!\pcol@sptextlist!$ by \!\pcol@getcurrpage! and
10725 % \!\pcol@defcurrpage!, where $H$ is $h_p$ plus the total height of top
10726 % floats measured by \!\pcol@addflhd!, and $h$ is the height-plus-depth of
10727 % \!\@holdpg! having (a part of) \mctext, represented in the form of
10728 % integers and thus expanded with \!\number!; shift \!\@holdpg! left by
10729 % \!\pcol@shiftspanning! if the column-0 is not the leftmost due to \cswap;
10730 % and then put \prespan{} and (maybe shifted) \!\@holdpg! into \!\@holdpg!
10731 % itself so as to let \!\@holdpg! have everything in the \colpage{} 0 as
10732 % usual.
10733 %
10734 % Note that it can be $\!\pcol@prespan!=\bot$ if \mctext{} had a page break
10735 % (or multiple ones) in it as shown above. This empty \prespan{}, however,
10736 % does not always means that we have no top floats because the page break in
10737 % the \mctext{} can produce a \colpage{} with top floats which are deferred
10738 % from the previous page(s), or though unlikely the \mctext{} itself has
10739 % float environments. Therefore, the measurement of the total height of top
10740 % floats are always necessary. Also note that we perform these operations
10741 % at the first \cswitch{} for \cscan{}ing from $c=0$ with
10742 % $\CSIndex{ifpcol@sptext}=\true$, i.e., prior to the \sync{}ation itself
10743 % which takes place afterword, as explained shortly.
10744 %
10745 % Then regardless of the operations above, we acquire an \!\insert! from
10746 % \!\@freelist! by \!\@next! for $\cc_c(\vb)$ to store the \ccolpage{} in
10747 % (maybe modified) \!\@holdpg! by \!\pcol@clearcst@unvbox! to add uncoloring
10748 % \!\special!s to rewind the \colorstack{} $\CST^c$ at the bottom and
10749 % possibly coloring ones to establish that saved in $\csts$ at the top as
10750 % the \colorctext{} for the \colpage{} when it has the first item.
10751 %
10752 % Then if $\!\footins!\neq\bot$, we perform one of the followings.
10753 % 
10754 % \begin{itemize}
10755 % \item
10756 % If \Scfnote{} typesetting is in effect and $p=\ptop$, we save \!\footins!
10757 % into $\pp^f(p)$ by the sequence of \!\pcol@getcurrpinfo! to get $\pp(p)$,
10758 % \!\pcol@savefootins! to move it in $\pp^f(p)$, and \!\pcol@defcurrpage! to
10759 % update $\pp(p)$ with $\pp^f(p)$.
10760 %
10761 % \item
10762 % If \Scfnote{} typesetting is in effect but $p<\ptop$, we simply discard
10763 % the contents of \!\footins! by making it $\bot$, because \!\footins!
10764 % should have $\pp^f(p)$ which has been already fixed.
10765 %
10766 % \item
10767 % If \Mcfnote{} typesetting is in effect, by \!\pcol@savefootins! we save
10768 % \!\footins! into \!\pcol@currfoot!, which should be $\bot$ in other cases,
10769 % so that it will be saved into $\cc_c(\ft)$ by \!\pcol@setcurrcol!
10770 % afterward.
10771 % \end{itemize}
10772 % %
10773 % Then if $c=0$, we invoke \!\pcol@setpageno! to reflect the jump of
10774 % \!\c@page! made in the building process of the \colpage{} to $\pp(q)$ for
10775 % all $q\in[p,\ptop]$. After that, we save $c$'s \cctext{} into $\cc_c$ by
10776 % \!\pcol@setcurrcol! and let $\cc_c(\vb^p)=p$ and
10777 % $\cc_c(\vb^r)=\!\@colroom!$.
10778 % 
10779 % \begin{macrocode}
10780 %% Special Output Routines: Column-Switching
10781
10782 \def\pcol@output@switch{%
10783 \ifpcol@sptext\ifnum\pcol@currcol=\z@
10784 \ifvoid\pcol@prespan \dimen@\z@ \else \dimen@\ht\pcol@prespan \fi
10785 \global\advance\@colroom\dimen@
10786 \pcol@addflhd\@toplist\pcol@textfloatsep
10787 \pcol@getcurrpinfo\@tempcnta\@tempdima\@tempskipa
10788 \@tempdimb\ht\@holdpg \advance\@tempdimb\dp\@holdpg
10789 \@cons\pcol@sptextlist{{\number\dimen@}{\number\@tempdimb}}%
10790 \pcol@defcurrpage{\number\@tempcnta}\pcol@spanning\pcol@footins
10791 {\pcol@sptextlist}{\pcol@mparbottom}%
10792 \pcol@shiftspanning\@holdpg
10793 \setbox\@holdpg\vbox{\unvbox\pcol@prespan \unvbox\@holdpg}%
10794 \fi\fi
10795 \pcol@Fb
10796 \@next\@currbox\@freelist{\global\setbox\@currbox\vbox{
10797 \pcol@clearcst@unvbox\@holdpg}}\pcol@ovf
10798 \pcol@Fe{output@switch}%
10799 \def\pcol@currfoot{\voidb@x}%
10800 \ifvoid\footins\else
10801 \ifpcol@scfnote
10802 \ifnum\pcol@page=\pcol@toppage
10803 \pcol@getcurrpinfo\@tempcnta\@tempdima\@tempskipa
10804 \pcol@Log\pcol@output@switch{save}\footins
10805 \pcol@Fb
10806 \pcol@savefootins\pcol@footins
10807 \pcol@Fe{output@switch(pagefn)}%
10808 \pcol@defcurrpage{\number\@tempcnta}\pcol@spanning\pcol@footins
10809 {\pcol@sptextlist}{\pcol@mparbottom}%
10810 \else
10811 \pcol@Log\pcol@output@switch{discard}\footins
10812 \setbox\@tempboxa\box\footins
10813 \fi
10814 \else
10815 \pcol@Log\pcol@output@switch{save}\footins
10816 \pcol@Fb
10817 \pcol@savefootins\pcol@currfoot
10818 \pcol@Fe{output@switch(colfn)}%
10819 \fi
10820 \fi
10821 \ifnum\pcol@currcol=\z@ \pcol@setpageno \fi
10822 \pcol@setcurrcol
10823 \global\count\@currbox\pcol@page
10824 \global\dimen\@currbox\@colroom
10825 % \end{macrocode}
10826 %
10827 % Next, we examine if $\CSIndex{ifpcol@sptext}=\true$ and $c=0$ again, and
10828 % if so we {\em broadcast} \CSIndex{if@nobreak} and
10829 % \CSIndex{if@afterindent}, or in other words $\cc_c(\sw)$, and tokens in
10830 % $\!\everypar!=\cc_c(\ep)$, to pretend all columns follow the \mctext.
10831 % That is, for each column $e$, we restore its \cctext{} from $\cc_e$ by
10832 % \!\pcol@getcurrcol!, let \CSIndex{if@nobreak} and \CSIndex{if@afterindent}
10833 % have the values for $c$ ($\in\{0,\C{-}1\}$) and $\!\everypar!=\cc_c(\ep)$,
10834 % and then save the context to $\cc_e$ by \!\pcol@setcurrcol! so that
10835 % $\cc_e(\sw)=\cc_c(\sw)$ and $\cc_e(\ep)=\cc_c(\ep)$. After that, we
10836 % \!\global!ly turn $\CSIndex{ifpcol@sptext}=\false$ to give it the default
10837 % state.
10838 %
10839 % Note that this broadcast is essential when the \mctext{} has sectioning
10840 % commands to have consistent settings of the page break inhibition, the
10841 % skip above the another sectioning command following them, and the
10842 % indentation of the first paragraph, for all columns. On the other hand,
10843 % broadcasting of \!\everypar! is natural even when it does not have
10844 % sectioning commands because all columns may be considered following the
10845 % \mctext. Also note that, as mentioned in the explanation of the first
10846 % examination at the beginning of this macro, we perform these operations at
10847 % the first \cswitch{} for \cscan{}ning from $c=0$ with
10848 % $\CSIndex{ifpcol@sptext}=\true$ prior to the \sync{ation} following the
10849 % \mctext. This means, if $\CSIndex{if@nobreak}={\true}$,
10850 % $\!\penalty!=10000$ is inserted at the top and bottom end of the space for
10851 % \mctext{} in the columns such that $c\neq0$, the former by this \cscan{}
10852 % and the latter by the \cswitch{} to $c$ made after the synchronization.
10853 % Therefore, if our \sync{ation} mechanism and \TeX's page builder once
10854 % agreed both end can be in a page, both end will not chosen as page
10855 % break points\footnote{
10856 % 
10857 % As for $c=0$, its top end of \mctext{} is a feasible break point to make
10858 % the penalty insertion asymmetric. Therefore, we need to reinvestigate if
10859 % the condition of the broadcast is really appropriate, and, if
10860 % inappropriate, have to go back to the old implementation in which
10861 % \cs{ifpcol@sync} is included in the condition. Otherwise, if proved
10862 % appropriate, we will have to consider to make the penalty insertion
10863 % symmetric by adding \cs{nobreak} at the top of \mctext{} in $c=0$.}.
10864 % 
10865 % \changes{v1.0}{2011/10/10}
10866 % {Restrict the broadcast of \cs{if@nobreak} and \cs{everypar} only
10867 % when a column-switching is accompanied with spanning text.}
10868 % \changes{v1.2-7}{2013/05/11}
10869 % {Modify broadcasting of $\kappa_c(\sigma)$ so that \cs{@afterindent}
10870 % is broadcasted with \cs{@nobreak}.}
10871 % \changes{v1.3-1}{2013/09/17}
10872 % {Rename \cs{ifpcol@mctext} as \cs{ifpcol@sptext}.}
10873 % \changes{v1.3-6}{2013/09/17}
10874 % {Modify the condition of broadcasting $\kappa_0(\sigma)$ and
10875 % $\kappa_0(\varepsilon)$ accompanied with \cs{ifpcol@sptext} from
10876 % \cs{ifpcol@sync} to $c\EQ0$ so that the broadcast is made in the
10877 % first column-switching in column-scanning.}
10878 % 
10879 % \begin{macrocode}
10880 \let\reserved@a\@nobreakfalse \let\reserved@b\@afterindentfalse
10881 \ifpcol@sptext\ifnum\pcol@currcol=\z@
10882 \if@nobreak \let\reserved@a\@nobreaktrue \fi
10883 \if@afterindent \let\reserved@b\@afterindenttrue \fi
10884 \@temptokena\everypar
10885 \pcol@currcol\z@ \@whilenum\pcol@currcol<\pcol@ncol\do{%
10886 \pcol@getcurrcol \reserved@a \reserved@b \everypar\@temptokena
10887 \pcol@setcurrcol
10888 \advance\pcol@currcol\@ne}%
10889 \global\pcol@sptextfalse
10890 \fi\fi
10891 % \end{macrocode}
10892 % 
10893 % \changes{v1.2-2}{2013/05/11}
10894 % {Add the case
10895 % $\cs{ifpcol@clear}\EQ\cs{ifpcol@sync}\EQ\string\mathit{true}$ for
10896 % the invocation of \cs{pcol@restartcolumn} for pre-flushing column
10897 % height check.}
10898 % \changes{v1.3-6}{2013/09/17}
10899 % {Modify the code structure to let
10900 % $\cs{if@tempswa}\EQ\string\mathit{true}$ according to the
10901 % modification of the broadcast of $\kappa_0(\sigma)$ and
10902 % $\kappa_0(\varepsilon)$.}
10903 %
10904 % Finally we invoke \!\pcol@sync! for the \sync{}ation if
10905 % \CSIndex{ifpcol@sync} or \CSIndex{ifpcol@clear} is $\true$, and then
10906 % \!\pcol@restartcolumn! to restart the \ccolpage{} $d$ if
10907 % $\CSIndex{ifpcol@clear}={}\false$ to mean ordinary (but possibly
10908 % \sync{}ed) \cswitch{} or $\CSIndex{ifpcol@clear}={}\true$ but
10909 % $\CSIndex{ifpcol@sync}={}\true$ too to mean pre-flushing column height
10910 % check, before finishing \!\output! routine letting
10911 % $\CSIndex{ifpcol@sync}=\false$ for next \cswitch.
10912 % 
10913 % \begin{macrocode}
10914 \@tempswafalse \ifpcol@sync \@tempswatrue \fi \ifpcol@clear \@tempswatrue \fi
10915 \if@tempswa \pcol@sync \fi
10916 \@tempswatrue
10917 \ifpcol@clear \ifpcol@sync\else \@tempswafalse \fi\fi
10918 \if@tempswa \pcol@restartcolumn \fi
10919 \global\pcol@syncfalse}
10920
10921 % \end{macrocode}
10922 % \end{macro}
10923 %
10924 % \begin{macro}{\pcol@shiftspanning}
10925 % \changes{v1.3-1}{2013/09/17}
10926 % {Introduced to shift a spanning text to left if the column-0 is not
10927 % leftmost due to column-swapping.}
10928 % 
10929 % The macro $\!\pcol@shiftspanning!\arg{b}$ is used in \!\pcol@makecol! and
10930 % \!\pcol@output@switch! to let box register $b$ have itself but shifted
10931 % left by $\WT-w_0=\!\textwidth!-\!\columnwidth!$ so that the left edge of
10932 % its contents \mctext{} is aligned to the left edge of the leftmost column
10933 % being different from column-0 due to \cswap, i.e., if
10934 % $\CSIndex{ifpcol@swapcolumn}=\true$ and $\!\c@page!\bmod2=0$. Note that
10935 % \!\c@page! is {\em not} obtained from $\pp^p(p)$ by the invokers but have
10936 % the value when the \!\output! request is made to let invokers work, and
10937 % thus have the correct value even when a jump occurs prior to the request.
10938 % 
10939 % \begin{macrocode}
10940 \def\pcol@shiftspanning#1{%
10941 \ifpcol@swapcolumn\ifodd\c@page\else
10942 \setbox#1\vbox{\@tempdima\textwidth \advance\@tempdima-\columnwidth
10943 \moveleft\@tempdima\box#1}
10944 \fi\fi}
10945
10946 % \end{macrocode}
10947 % \end{macro}
10948 %
10949 % \begin{macro}{\pcol@restartcolumn}
10950 % \changes{v1.0}{2011/10/10}
10951 % {Add \cs{pcol@getcurrfoot} to restore parameters of $\kappa_c(\tau)$
10952 % into \cs{footins}.}
10953 % \changes{v1.32-2}{2015/10/10}
10954 % {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
10955 % 
10956 % The macro \!\pcol@restartcolumn! is invoked from \!\pcol@output@switch! or
10957 % \!\pcol@freshpage! to restart the \ccolpage{} $d=\!\pcol@nextcol!$ which
10958 % becomes $c=\!\pcol@currcol!$ by the very first assignment in this macro.
10959 % Then we restore the \cctext{} in $\cc_c$ by \!\pcol@getcurrcol! and let
10960 % $p=\cc_c(\vb^p)$ and $\!\@colroom!=\cc_c(\vb^r)$ before returning
10961 % $\cc_c(\vb)$ to \!\@freelist! by \!\@cons! because it has become useless
10962 % so far. We also restore the \pctext{} of $p$ by \!\pcol@getcurrpage!.
10963 % 
10964 % \begin{macrocode}
10965 \def\pcol@restartcolumn{%
10966 \global\pcol@currcol\pcol@nextcol
10967 \pcol@getcurrcol
10968 \global\pcol@page\count\@currbox
10969 \global\@colroom\dimen\@currbox
10970 \pcol@Fb
10971 \@cons\@freelist\@currbox
10972 \pcol@Fe{restartcolumn(col)}%
10973 \pcol@getcurrpage
10974 % \end{macrocode}
10975 % 
10976 % \changes{v1.2-2}{2013/05/11}
10977 % {Redesign the footnote insertion mechanism to cope with
10978 % page-wise footnotes.}
10979 % \changes{v1.2-1}{2013/05/11}
10980 % {Add \cs{pcol@restorecst@restart} to return main vertical list
10981 % with coloring operations.}
10982 % \changes{v1.3-1}{2013/09/17}
10983 % {Rename \cs{pcol@restorecst@restart} as \cs{pcol@putbackmvl}.}
10984 % \changes{v1.3-6}{2013/09/17}
10985 % {Change the code structure to move the insertion of page break
10986 % penalty for ordinary column-wise footnotes from below the main
10987 % text to below the footnotes.}
10988 % \changes{v1.3-3}{2013/09/17}
10989 % {Add \cs{@colht} and \cs{@tempdimb} as the first and third argument
10990 % of \cs{pcol@shrinkcolbyfn}.}
10991 %
10992 % Then we perform footnote \!\insert!ion as follows.
10993 % 
10994 % \begin{enumerate}\def\labelenumi{(\arabic{enumi})}
10995 % \item\label{item:scftop}
10996 % If footnote typesetting is \scfnote{} and $p=\ptop$, we do the followings.
10997 % 
10998 % \begin{enumerate}\def\labelenumii{(\alph{enumii})}
10999 % \item\label{item:scftop-main}
11000 % Put the contents of $\cc_c(\vb^b)$ by \!\pcol@putbackmvl! to make
11001 % the \colorctext{} in |.dvi| consistent with the current |.tex|'s one, and
11002 % to save \prespan{} into \!\pcol@prespan! if we are opening a \mctext{}.
11003 %
11004 % \item\label{item:scftop-pen}
11005 % Put $\!\penalty!=10000$ by \!\nobreak! if $\CSIndex{if@nobreak}=\true$ or
11006 % \!\interlinepenalty! by \!\addpenalty!\footnote{
11007 % 
11008 % As done in \!\@specialoutput! but \!\penalty!\!\interlinepenalty! should
11009 % be sufficient.}
11010 % 
11011 % otherwise, as the page break penalty at the returning point. Note that
11012 % adding the \!\penalty! will be nullified by \TeX{} if $\cc_c(\vb^b)$ has
11013 % nothing and thus, if the \colpage{} is still empty when we leave from it,
11014 % its emptiness without any items is assured. Also note that the penalty
11015 % insertion here {\em looks} essential to keep \TeX's page builder from
11016 % confusing with \scfnote{} footnotes which it has not seen in a
11017 % \colpage\footnote{
11018 % 
11019 % At least a test with tall \scfnote{} footnotes gave us a confusing
11020 % result.}.
11021 %
11022 % \item\label{item:scftop-fnote}
11023 % If $\pp^f(p)\neq\bot$, let \!\pcol@currfoot! and then \!\footins! have
11024 % the footnotes in it by an \!\edef! and \!\pcol@getcurrfoot!, return the
11025 % \!\insert! for them to \!\@freelist!, invoke \!\pcol@shrinkcolbyfn! to
11026 % shrink \!\@colht! temporarily by their total height and to remember the
11027 % existence of them with $\!\@tempdimb!=-\!\skip!\!\footins!$, and then
11028 % \!\insert! the footnotes so that it contributes to the building process
11029 % of the \colpage{} to be restarted. Otherwise, i.e. if $\pp^f(p)=\bot$,
11030 % \!\@colht! is unchanged and $\!\@tempdimb!=0$.
11031 %
11032 % \item\label{item:scftop-defer}
11033 % Invoke \!\pcol@deferredfootins! to \!\insert! deferred footnotes in $\df$
11034 % until their total height reaches (possibly shrunk) \!\@colht!. This
11035 % height capping is to keep \TeX's page builder from holding too large
11036 % number of footnotes unprocessed causing confused ordering on presenting
11037 % them to \!\output! routine.
11038 % \end{enumerate}
11039 %
11040 % \item
11041 % If footnote typesetting is \scfnote{} but $p<\ptop$, we do the followings.
11042 % 
11043 % \begin{enumerate}\def\labelenumii{(\alph{enumii})}
11044 % \item
11045 % If $\pp^f(p)\neq\bot$, get it into \!\footins! as done in
11046 % (\ref{item:scftop-fnote}) but giving \!\copy! to \!\pcol@getcurrfoot!
11047 % because $\pp^f(p)$ has been fixed and thus will be kept until it is
11048 % shipped out, and then \!\insert! it.
11049 %
11050 % \item
11051 % Put $\cc_c(\vb^b)$ and the penalty as done in (\ref{item:scftop-main}) and
11052 % (\ref{item:scftop-pen}).
11053 % \end{enumerate}
11054 % 
11055 % The order of footnotes, main vertical list and then penalty is essential
11056 % to ensure that the \colpage{} in $p<\ptop$ has room for footnotes whose
11057 % residence in $p$ has already been fixed.
11058 %
11059 % \item
11060 % If footnote typesetting is \mcfnote{}, we do the followings.
11061 % 
11062 % \begin{enumerate}\def\labelenumii{(\alph{enumii})}
11063 % \item
11064 % Put $\cc_c(\vb^b)$ as done in (\ref{item:scftop-main}).
11065 %
11066 % \item
11067 % If $\cc_c(ft)\neq\bot$, get it by \!\pcol@getcurrfoot! returning the
11068 % \!\insert! to \!\@freelist!, and then \!\insert! it.
11069 %
11070 % \item
11071 % Put a penalty as done in (\ref{item:scftop-pen}).
11072 % \end{enumerate}
11073 % 
11074 % The order of main vertical list, footnotes and then penalty is appropriate
11075 % for \Mcfnote{}s because they definitely have space in the \colpage{} and
11076 % \TeX{} will break the page below the insertion, possibly just below thanks
11077 % to the penalty, to keep the footnotes and references to them in a page.
11078 % \end{enumerate}
11079 % 
11080 % \changes{v1.32-2}{2015/10/10}
11081 % {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
11082 % 
11083 % \begin{macrocode}
11084 \ifpcol@scfnote
11085 \edef\pcol@currfoot{\pcol@footins}%
11086 \ifnum\pcol@page=\pcol@toppage
11087 \@tempdima\@colht \@tempdimb\z@
11088 \pcol@putbackmvl
11089 \if@nobreak \nobreak \else \addpenalty\interlinepenalty \fi
11090 \ifvoid\pcol@footins\else
11091 \pcol@Fb
11092 \pcol@getcurrfoot\box \@cons\@freelist\pcol@currfoot
11093 \pcol@Fe{restartcolumn(pagefn)}%
11094 \pcol@Log\pcol@restartcolumn{insert}\footins
11095 \pcol@shrinkcolbyfn\@colht\footins\@tempdimb
11096 \insert\footins{\unvbox\footins}%
11097 \fi
11098 \pcol@deferredfootins\pcol@restartcolumn
11099 \@colht\@tempdima
11100 \else
11101 \ifvoid\pcol@footins\else
11102 \pcol@getcurrfoot\copy
11103 \pcol@Log\pcol@restartcolumn{insdmy}\footins
11104 \insert\footins{\unvbox\footins}%
11105 \fi
11106 \pcol@putbackmvl
11107 \if@nobreak \nobreak \else \addpenalty\interlinepenalty \fi
11108 \fi
11109 \else
11110 \pcol@putbackmvl
11111 \ifvoid\pcol@currfoot\else
11112 \pcol@Fb
11113 \pcol@getcurrfoot\box \@cons\@freelist\pcol@currfoot
11114 \pcol@Fe{restartcolumn(colfn)}%
11115 \pcol@Log\pcol@restartcolumn{insert}\footins
11116 \insert\footins{\unvbox\footins}%
11117 \fi
11118 \if@nobreak \nobreak \else \addpenalty\interlinepenalty \fi
11119 \fi}
11120
11121 % \end{macrocode}
11122 % \end{macro}
11123 %
11124 % \KeepSpace{1}
11125 % \begin{macro}{\pcol@getcurrcol}
11126 % \changes{v1.1}{2012/05/11}
11127 % {Add assignment $w_c$ to \cs{columnwidth}, \cs{hsize} and
11128 % \cs{linewidth}.}
11129 % \changes{v1.2-5}{2013/05/11}
11130 % {Move assignment $w_c$ to \cs{hsize} and \cs{linewidth} to
11131 % \cs{pcol@invokeoutput}.}
11132 % \begin{macro}{\pcol@igetcurrcol}
11133 % \begin{macro}{\pcol@iigetcurrcol}
11134 % \changes{v1.0}{2011/10/10}
11135 % {Add restoration of \cs{pcol@textfloatsep}.}
11136 % \changes{v1.3-4}{2013/09/17}
11137 % {Remove the argument for $\kappa_c(\mu)\EQ\cs{@mparbottom}$ because it
11138 % is no longer in the column context.}
11139 % 
11140 % The macro \!\pcol@getcurrcol! is invoked from the following macros to
11141 % restore the typesetting parameters of the column $c=\!\pcol@currcol!$ from
11142 % $\cc_c$, and to let \!\columnwidth! have
11143 % $\w_c=|\pcol@columnwidth|{\cdot}c$\footnote{
11144 % 
11145 % \cs{hsize} and \cs{linewidth} are let have $\w_c$ and $\w_c-\lrm$
11146 % respectively in \cs{pcol@invokeoutput}.}.
11147 % 
11148 % \SpecialArrayIndex{c}{\pcol@columnwidth}
11149 % 
11150 % \begin{itemize}\item[]\begin{tabular}{lll}
11151 % \!\pcol@output@start!&\!\pcol@output@switch!&\!\pcol@restartcolumn!\\
11152 % \!\pcol@flushcolumn!&\!\pcol@measurecolumn!&\!\pcol@synccolumn!\\
11153 % \!\pcol@makeflushedpage!&\!\pcol@imakeflushedpage!&\!\pcol@iflushfloats!\\
11154 % \!\pcol@freshpage!&\!\pcol@output@end!
11155 % \end{tabular}
11156 % \end{itemize}
11157 % 
11158 % Since we represent $\cc_c$ as;
11159 % 
11160 % \begin{eqnarray*}
11161 % &&\Arg{\cc_c(\vb)}\Arg{\cc_c(\ft)}\Arg{\cc_c(\pd)}\Arg{\cc_c(\tl)}
11162 % \Arg{\cc_c(\ml)}\Arg{\cc_c(\bl)}\Arg{\cc_c(\dl)}\Arg{\cc_c(\tf)}|%|\\
11163 % &&\Arg{\Arg{\cc_c(\fh)}\Arg{\cc_c(\tn)}\Arg{\cc_c(\tr)}
11164 % \Arg{\cc_c(\bn)}\Arg{\cc_c(\br)}\Arg{\cc_c(\cn)}\Arg{\cc_c(\sw)}
11165 % \Arg{\cc_c(\ep)}}
11166 % \end{eqnarray*}
11167 % 
11168 % in the body of $|\pcol@col|{\cdot}c$,
11169 % 
11170 % \SpecialArrayIndex{c}{\pcol@col}
11171 % 
11172 % we restore first eight by \!\pcol@igetcurrcol! giving everything above as
11173 % its arguments by the expansion of
11174 % $$
11175 % \!\csname!| pcol@col|\!\number!\!\pcol@currcol!\!\endcsname!
11176 % $$
11177 % and then of the resulting control sequence. Then this macro gives its
11178 % ninth argument to \!\pcol@iigetcurrcol! which restores the last eight. We
11179 % also do
11180 % $$
11181 % \!\global!\!\columnwidth!|\pcol@columnwidth|{\cdot}c
11182 % $$
11183 % 
11184 % \SpecialArrayIndex{c}{\pcol@columnwidth}
11185 % 
11186 % by a pair of \!\expandafter! for the first two control sequences.
11187 %
11188 % Note that the restore operations are \!\global!, except for $\cc_c(\vb)$
11189 % and $\cc_d(\ft)$ because they are referred to only in \!\output!,
11190 % including \CSIndex{if@nobreak} for which \!\@nobreaktrue! and
11191 % \!\@nobreakfalse! are defined \!\global! by \LaTeX. Also note that
11192 % \!\dimen!-type parameters are saved in the form of integers and thus
11193 % restoring them needs to specify the unit |sp|.
11194 % 
11195 % \begin{macrocode}
11196 \def\pcol@getcurrcol{%
11197 \expandafter\expandafter\expandafter\pcol@igetcurrcol
11198 \csname pcol@col\number\pcol@currcol\endcsname
11199 \expandafter\global\expandafter\columnwidth
11200 \csname pcol@columnwidth\number\pcol@currcol\endcsname}
11201 \def\pcol@igetcurrcol#1#2#3#4#5#6#7#8#9{%
11202 \def\@currbox{#1}\def\pcol@currfoot{#2}\global\pcol@prevdepth#3sp\relax
11203 \gdef\@toplist{#4}\gdef\@midlist{#5}\gdef\@botlist{#6}\gdef\@deferlist{#7}%
11204 \global\pcol@textfloatsep#8sp\pcol@iigetcurrcol#9}
11205 \def\pcol@iigetcurrcol#1#2#3#4#5#6#7#8{%
11206 \global\@textfloatsheight#1sp\relax
11207 \global\@topnum#2\relax \global\@toproom#3sp\relax
11208 \global\@botnum#4\relax \global\@botroom#5sp\relax
11209 \global\@colnum#6\relax
11210 \global\@afterindentfalse \@nobreaktrue
11211 \ifcase#7
11212 \@nobreakfalse \or
11213 \global\@afterindenttrue \else
11214 \relax
11215 \fi
11216 \global\everypar{#8}}
11217 % \end{macrocode}
11218 % \end{macro}\end{macro}\end{macro}
11219 % 
11220 % \begin{macro}{\pcol@getcurrfoot}
11221 % \changes{v1.2-2}{2013/05/11}
11222 % {Add an argument being \cs{box} or \cs{copy}}
11223 % 
11224 % The macro $\!\pcol@getcurrfoot!\arg{com}$ is invoked from
11225 % \!\pcol@startcolumn! (\!\copy!, $\pp^f(p)$),
11226 % \!\pcol@restartcolumn! (\!\copy!\slash\!\box!, $\pp^f(p)$\slash$\cc_c(\ft)$),
11227 % \!\pcol@flushcolumn! (\!\box!, $\cc_c(\ft)$) and \!\pcol@imakeflushedpage!
11228 % (\!\box!, $\cc_c(\ft)$) to put everything in $\!\pcol@currfoot!$, having
11229 % the second element in the parens following macro names, into \!\footins!
11230 % using $\arg{com}$ shown as the first element in parens for the \!\box!
11231 % component. That is, if the source $\pp^f(p)$ or $\cc_c(\ft^b)$ is void,
11232 % we let $\!\box!{\cdot}\!\footins!$ be so. Otherwise, we move \!\box!,
11233 % \!\count!, \!\dimen! and \!\skip! of the source into those of
11234 % \!\footins!\footnote{
11235 % 
11236 % Moving \!\count!, \!\dimen! and \!\skip! is redundant almost always
11237 % because it is very unlikely that these footnote parameters are modified
11238 % dynamically. Moreover, dynamic modification of them is hardly consistent
11239 % with repetitive self-\!\insert!ion of \!\footins! in
11240 % \!\pcol@restartcolumn! and \!\@reinserts! of \LaTeX. However, we dare to
11241 % move them in order to, for example, allow each column has its own footnote
11242 % parameters.}.
11243 % 
11244 % 
11245 % \begin{macrocode}
11246 \def\pcol@getcurrfoot#1{%
11247 \ifvoid\pcol@currfoot \global\setbox\footins\box\voidb@x
11248 \else
11249 \global\setbox\footins#1\pcol@currfoot
11250 \global\count\footins\count\pcol@currfoot
11251 \global\dimen\footins\dimen\pcol@currfoot
11252 \global\skip\footins\skip\pcol@currfoot
11253 \fi}
11254 % \end{macrocode}
11255 % \end{macro}
11256 % 
11257 % \begin{macro}{\pcol@setcurrcol}
11258 % \changes{v1.0}{2011/10/10}
11259 % {Add save of \cs{pcol@textfloatsep}.}
11260 % \changes{v1.3-4}{2013/09/17}
11261 % {Remove $\kappa_c(\mu)\EQ\cs{@mparbottom}$ from the body of
11262 % $\cs{pcol@col}{\cdot}c$ because it is no longer in the column
11263 % context.}
11264 % 
11265 % \begin{macro}{\pcol@setcurrcolnf}
11266 % The macro \!\pcol@setcurrcol! is invoked from \!\pcol@output@switch!,
11267 % \!\pcol@measurecolumn! and \!\pcol@synccolumn! to save \cctext{} of
11268 % $c=\!\pcol@currcol!$ in $\cc_c$. It is also used in \!\pcol@setcurrcolnf!
11269 % invoked from \!\pcol@output@start!, \!\pcol@flushcolumn!,
11270 % \!\pcol@imakeflushedpage!, \!\pcol@iflushfloats! and \!\pcol@freshpage! for
11271 % the saving when the \colpage{} is known to have no footnotes.
11272 %
11273 % The macro \!\pcol@setcurrcol! at first calculates the combined code for
11274 % \CSIndex{if@nobreak} and \CSIndex{if@afterindent}, and then saves
11275 % parameters into $\cc_c$ by \!\xdef! to have the sequence shown in the
11276 % description of \!\pcol@getcurrcol!. Note that \!\dimen!-type parameters
11277 % are saved by expansions with \!\number! and thus as decimal integers.
11278 %
11279 % The macro \!\pcol@setcurrcolnf! \!\def!ines $\cc_c(\ft)=\!\pcol@currfoot!$
11280 % as \!\voidb@x!, and then invoke \!\pcol@setcurrcol! for saving.
11281 % 
11282 % \begin{macrocode}
11283 \def\pcol@setcurrcol{{\let\@elt\relax
11284 \@tempcnta\if@nobreak\if@afterindent\@ne\else\tw@\fi\else\z@\fi
11285 \expandafter\xdef\csname pcol@col\number\pcol@currcol\endcsname{%
11286 {\@currbox}{\pcol@currfoot}{\number\pcol@prevdepth}%
11287 {\@toplist}{\@midlist}{\@botlist}{\@deferlist}{\number\pcol@textfloatsep}%
11288 {{\number\@textfloatsheight}%
11289 {\number\@topnum}{\number\@toproom}{\number\@botnum}{\number\@botroom}%
11290 {\number\@colnum}{\number\@tempcnta}{\the\everypar}}}}}
11291 \def\pcol@setcurrcolnf{\def\pcol@currfoot{\voidb@x}\pcol@setcurrcol}
11292
11293 % \end{macrocode}
11294 % \end{macro}\end{macro}
11295 %
11296 % \begin{macro}{\pcol@putbackmvl}
11297 % \changes{v1.2-1}{2013/05/11}
11298 % {Introduced to restart a column with coloring.}
11299 % \changes{v1.3-1}{2013/09/17}
11300 % {Renamed from \cs{pcol@restorecst@restart} and the operations to
11301 % save pre-spanning-text stuff is added.}
11302 % \changes{v1.33-2}{2016/11/19}
11303 % {Add {\tt\%} to the end of the line to open \cs{vbox} for
11304 % \cs{pcol@prespan} to obey the coding convention.}
11305 % \changes{v1.34}{2018/05/07}
11306 % {Change nullification of
11307 % $\mathit{\Gamma}_s\EQ\cs{pcol@colorstack@saved}$ from \cs{gdef} to
11308 % \cs{box}-assignment of $\bot$ because it is now a \cs{vbox}.}
11309 % 
11310 % The macro \!\pcol@putbackmvl!, solely used in
11311 % \!\pcol@restartcolumn!, has two functions; \colorstack{} restoration and
11312 % \prespan{} preservation. It examines the emptiness of the \colpage{} of the
11313 % column $c$ to be restarted in $\cc_c(\vb)=\!\@currbox!$. If so, the
11314 % \colorstack{} $\CST^c$ is saved into $\csts=\!\pcol@colorstack@saved!$ by
11315 % \!\pcol@savecolorstack! as the opening \colorctext{} of the \colpage{},
11316 % and \!\pcol@prespan! for \prespan{} is made $\bot$.
11317 %
11318 % Otherwise, $\csts$ is let $\bot$ because the opening \colorctext{} has
11319 % already been put when we left from the \colpage{}. Then if
11320 % $\CSIndex{ifpcol@sptextstart}=\true$ to mean a \mctext{} is to start, we
11321 % save $\cc_c(\vb)$ into \!\pcol@prespan! adding the coloring \!\special!s
11322 % to restore \colorctext{} from $\CST^c$ by
11323 % \!\pcol@restorecolorstack!\footnote{
11324 % 
11325 % If \cs{pcol@prespan} is connected to (the first part of) the \mctext,
11326 % the reestablishment of the \colorstack{} here correctly places coloring
11327 % \cs{special}s in \texttt{.dvi}. On the other hand, if the \mctext{} is
11328 % stowed away to the next page as a whole, the reestablishment here is
11329 % essential for the correct paring of the pushes and pops, the latter of
11330 % which are at the bottom of the \colpage{} whose tail is \cs{pcol@prespan}.}.
11331 % 
11332 % We also shrink $\cc_c(\vb^r)=\!\@colroom!$ by the height of the \prespan{}
11333 % so that \mctext{} will be captured by \!\pcol@makecol! if it is broken
11334 % into two (or more) pages, and put a invisible \!\hrule! to the main
11335 % vertical list letting $\!\topskip!=0$ to suppress \!\topskip! insertion
11336 % prior to the \mctext{} but instead to make the text led by
11337 % \!\baselineskip! (or \!\lineskip!) according to the \!\prevdepth! being
11338 % the depth of the tallest column and the height of the first \!\hbox! in
11339 % the \mctext. Otherwise, i.e., if $\CSIndex{ifpcol@sptextstart}=\false$,
11340 % we simply put back $\cc_c(\vb)$ into the main vertical list and then the
11341 % coloring \!\special!s by \!\pcol@restorecolorstack!.
11342 %
11343 % Note that $\CSIndex{ifpcol@sptextstart}$ is temporarily made $\false$ by
11344 % this macro if the \!\pcol@output@switch! invoking \!\pcol@restartcolumn!
11345 % did not make \sync{}ed \cswitch{}, i.e., if $\CSIndex{ifpcol@flush}=\true$
11346 % to mean the page is flushed before the \sync{}ation, or
11347 % $\CSIndex{ifpcol@sync}=\false$ for \cscan{}ning prior to the \sync{}ation.
11348 % 
11349 % \begin{macrocode}
11350 \def\pcol@putbackmvl{%
11351 \ifpcol@flush \pcol@sptextstartfalse \fi
11352 \ifpcol@sync\else \pcol@sptextstartfalse \fi
11353 \pcol@ifempty\@currbox
11354 {\pcol@savecolorstack
11355 \ifpcol@sptextstart \global\setbox\pcol@prespan\box\voidb@x \fi}%
11356 {\global\setbox\pcol@colorstack@saved\box\voidb@x
11357 \ifpcol@sptextstart
11358 \global\setbox\pcol@prespan\vbox{%
11359 \unvbox\@currbox \pcol@restorecolorstack}%
11360 \global\advance\@colroom-\ht\pcol@prespan
11361 \global\topskip\z@ \hrule\@height\z@\@width\z@
11362 \else
11363 \unvbox\@currbox \pcol@restorecolorstack
11364 \fi}}
11365
11366 % \end{macrocode}
11367 % \end{macro}
11368 %
11369 %
11370 %
11371 % \KeepSpace{3}
11372 % \subsection{Color Management}
11373 % \label{sec:imp-sout-color}
11374 % 
11375 % \changes{v1.2-1}{2013/05/11}
11376 % {Add the subsection ``Color Management'' to describe newly
11377 % introduced macros for coloring.}
11378 % \changes{v1.3-6}{2013/09/17}
11379 % {Move commands outside \cs{output} routine to the newly introduced
11380 % section ``Commands for Text Coloring'' to distinguish
11381 % macros inside and outside \cs{output} routine.}
11382 % \changes{v1.22}{2013/06/30}
11383 % {\cs{pcol@output@cpush} was introduced for color stack pushing but
11384 % removed in v1.34.}
11385 % \changes{v1.34}{2018/05/07}
11386 % {\cs{pcol@output@cpush} is removed according to the change of text
11387 % coloring from \cs{output} to \cs{insert}.}
11388 % \changes{v1.22}{2013/06/30}
11389 % {\cs{pcol@output@icpush} was introduced to implement
11390 % \cs{pcol@output@cpush} but removed in v1.34.}
11391 % \changes{v1.34}{2018/05/07}
11392 % {\cs{pcol@output@icpush} is removed according to the change of text
11393 % coloring from \cs{output} to \cs{insert}.}
11394 % \changes{v1.24}{2013/07/27}
11395 % {\cs{pcol@output@mcpush} was introduced for coloring specified in
11396 % math mode but removed in v1.34.}
11397 % \changes{v1.34}{2018/05/07}
11398 % {\cs{pcol@output@mcpush} is removed according to the change of text
11399 % coloring from \cs{output} to \cs{insert}.}
11400 % \changes{v1.24}{2013/07/27}
11401 % {\cs{pcol@output@imcpush} was introduced for coloring specified in
11402 % math mode but removed in v1.34.}
11403 % \changes{v1.34}{2018/05/07}
11404 % {\cs{pcol@output@imcpush} is removed according to the change of text
11405 % coloring from \cs{output} to \cs{insert}.}
11406 % \changes{v1.22}{2013/06/30}
11407 % {\cs{pcol@output@cpop} was introduced for color stack popping but
11408 % removed in v1.34.}
11409 % \changes{v1.34}{2018/05/07}
11410 % {\cs{pcol@output@cpop} is removed according to the change of text
11411 % coloring from \cs{output} to \cs{insert}.}
11412 % \changes{v1.2-1}{2013/05/11}
11413 % {\cs{pcol@reset@color@elt} was introduced to implement
11414 % \cs{pcol@reset@color@pop} but removed in v1.34.}
11415 % \changes{v1.22}{2013/06/30}
11416 % {\cs{pcol@reset@color@elt} was moved from the position where
11417 % \cs{pcol@reset@color@pop} was defined
11418 % because it became to be used only by \cs{pcol@output@cpop}, but
11419 % removed in v1.34.}
11420 % \changes{v1.34}{2018/05/07}
11421 % {\cs{pcol@reset@color@elt} is removed according to the change of text
11422 % coloring from \cs{output} to \cs{insert}.}
11423 % \changes{v1.24}{2013/07/27}
11424 % {\cs{pcol@output@mcpop} was introduced for coloring specified in
11425 % math mode but removed in v1.34.}
11426 % \changes{v1.34}{2018/05/07}
11427 % {\cs{pcol@output@mcpop} is removed according to the change of text
11428 % coloring from \cs{output} to \cs{insert}.}
11429 % \changes{v1.24}{2013/07/27}
11430 % {\cs{pcol@output@mcpop@elt} was introduced for coloring specified in
11431 % math mode but removed in v1.34.}
11432 % \changes{v1.34}{2018/05/07}
11433 % {\cs{pcol@output@mcpop@elt} is removed according to the change of text
11434 % coloring from \cs{output} to \cs{insert}.}
11435 % \changes{v1.22}{2013/06/30}
11436 % {\cs{pcol@output@cset} was introduced to set $\gamma_0^c$ but
11437 % removed in v1.34.}
11438 % \changes{v1.34}{2018/05/07}
11439 % {\cs{pcol@output@cset} is removed according to the change of text
11440 % coloring from \cs{output} to \cs{insert}.}
11441 % \changes{v1.22}{2013/06/30}
11442 % {\cs{pcol@output@icset} was introduced to implement
11443 % \cs{pcol@output@cset} but removed in v1.34.}
11444 % \changes{v1.34}{2018/05/07}
11445 % {\cs{pcol@output@icset} is removed according to the change of text
11446 % coloring from \cs{output} to \cs{insert}.}
11447 % \changes{v1.22}{2013/06/30}
11448 % {\cs{pcol@return@from@color} was introduced to implement
11449 % \cs{pcol@output@cpush}, \cs{pcol@output@cpop} and
11450 % \cs{pcol@output@cset} but removed in v1.34.}
11451 % \changes{v1.34}{2018/05/07}
11452 % {\cs{pcol@return@from@color} is removed according to the change of
11453 % text coloring from \cs{output} to \cs{insert}.}
11454 %
11455 % \begin{macro}{\pcol@magicpenalty}
11456 % \begin{macro}{\pcol@ifempty}
11457 % \changes{v1.2-1}{2013/05/11}
11458 % {Introduced to examine the emptiness of the box, extracting the code
11459 % from \cs{pcol@measurecolumn} so as to be used for coloring as
11460 % well.}
11461 % 
11462 % The macro $\!\pcol@ifempty!\arg{box}\arg{then}\arg{else}$ is used in
11463 % \!\pcol@putbackmvl!, \!\pcol@clearcst@unvbox! and
11464 % \!\pcol@measurecolumn! to examine if $\arg{box}$ is empty, and to perform
11465 % $\arg{then}$ if so or $\arg{else}$ otherwise. Since \TeX{} does not
11466 % provide any convenient way for the examination unfortunately, we perform a
11467 % series of tricky operations to put the followings into \!\@tempboxa!; a
11468 % penalty of $\!\pcol@magicpenalty!=12345$ whose existence in the
11469 % $\arg{box}$ is (almost) impossible; contents of $\arg{box}$ put by
11470 % \!\unvcopy!; and then a \!\global! \!\def!inition of \!\@gtempa! to let it
11471 % have the decimal representation of \!\lastpenalty!. Since \!\lastpenalty!
11472 % has $\arg{pen}$ if the last item is $\!\penalty!\arg{pen}$, or 0
11473 % otherwise, $\!\@gtempa!=\!\pcol@magicpenalty!$ iff $\arg{box}$ is empty.
11474 % 
11475 % \begin{macrocode}
11476 %% Special Output Routines: Color Management
11477
11478 \def\pcol@magicpenalty{12345}
11479 \def\pcol@ifempty#1#2#3{%
11480 \setbox\@tempboxa\vbox{\penalty\pcol@magicpenalty
11481 \unvcopy#1\xdef\@gtempa{\number\lastpenalty}}%
11482 \ifnum\@gtempa=\pcol@magicpenalty\relax \def\reserved@a{#2}%
11483 \else \def\reserved@a{#3}%
11484 \fi
11485 \reserved@a}
11486
11487 % \end{macrocode}
11488 % \end{macro}\end{macro}
11489 %
11490 % \begin{macro}{\pcol@clearcst@unvbox}
11491 % \changes{v1.2-1}{2013/05/11}
11492 % {Introduced to put coloring \cs{special}s above and below of a
11493 % column-page.}
11494 % \begin{macro}{\pcol@clearcolorstack}
11495 % \changes{v1.2-1}{2013/05/11}
11496 % {Introduced to clear color context.}
11497 % \changes{v1.34}{2018/05/07}
11498 % {Completely change its definition according to the new text coloring
11499 % with \cs{insert}.}
11500 % 
11501 % The macro \!\pcol@clearcst@unvbox!$\arg{box}$, invoked from \!\pcol@opcol!
11502 % and \!\pcol@output@switch!, puts the following above and below
11503 % $\arg{box}$ containing the main vertical list of a \colpage{} from which
11504 % we are now leaving, if \!\pcol@ifempty! judges that $\arg{box}$ is not
11505 % empty. Above the $\arg{box}$, we put coloring \!\special!s to establish
11506 % the \colorstack{} of |.dvi| saved in $\csts=\!\pcol@colorstack@saved!$ by
11507 % \!\pcol@restorecst! as the opening \colorctext{} of the \colpage{}. The
11508 % stack $\csts$, however, can be $\bot$ if $\arg{box}$ already has the
11509 % \!\special!s, i.e., when we visit the \colpage{} it had already had
11510 % some items. Below $\arg{box}$, on the other hand, we put uncoloring
11511 % \!\special!s by \!\pcol@clearcolorstack! to rewind $\CSTraw^c$ to clear the
11512 % \colorctext{} of the \colpage{} in |.dvi| temporarily so that afterward it
11513 % is made consistent with that in |.tex|.
11514 %
11515 % The macro \!\pcol@clearcolorstack!, solely invoked from
11516 % \!\pcol@clearcst@unvbox! shown above\footnote{
11517 % 
11518 % But we have this macro to avoid the complication in \cs{def}ining
11519 % \cs{reserved@a} and \cs{reserved@b} with an argument if we did it in the
11520 % argument of \cs{pcol@ifempty} in \cs{pcol@clearcst@unvbox}.},
11521 % 
11522 % scans $\CSTraw^c=(\Celt^c,\cstraw)$ by \!\pcol@scancst! giving
11523 % $\cstraw=\!\pcol@colorins!$ to it as its argument. Since we gives
11524 % $\cstraw$ to the macro, this scan includes removals of all $\celtpop_i$
11525 % and $\mceltpop_{i,m}$, all $\celt_i$ having matching $\celtpop_i$, all
11526 % $\mcelt_{i,m}$ having matching $\mceltpop_{i,m}$, and all elements to
11527 % update $\Celt^c$, from $\cstraw$ to let \!\pcol@colorins! have $\cst$.
11528 % Prior to this invocation, we \!\def!ine $\!\reserved@a!\<\celt_i\>$ and
11529 % $\!\reserved@b!\<\Celt^c\>$ to let them have \!\reset@color! so that
11530 % uncoloring \!\special! will be put into the main vertical list for each
11531 % $\celt_i\in\cst$ and $\Celt^c$ before update if any, regardless of
11532 % coloring \!\special! they have. That is, we invoke \!\reset@color! as
11533 % many times as the appearance of $\celt_i\in\cst$ and once if
11534 % $\Celt^c\neq\bot$ before the invocation, ignoring the color information in
11535 % each element and the order of elements, expecting \!\reset@color! just
11536 % pops printer's \colorstack{} to rewind it as we intend.
11537 %
11538 % Note that in some printer |.def|inition could \!\def!ine \!\reset@color! to
11539 % let printer's text color be \!\current@color! to make the stack rewinding
11540 % resulting in the sequence of coloring operations with \!\current@color! at
11541 % the invocation of \!\output!. This meaningless operations might cause a
11542 % problem when a colored \colpage{} of $c_1$ is physically followed by another
11543 % \colpage{} of the succeeding column $c_2$ without any coloring, because the
11544 % \colpage{} of $c_2$ will be colored with \!\current@color! at the page break
11545 % in $c_1$. If this problem is serious, we could initialize $\Celt^c$ with
11546 % \!\current@color! at \beginparacol{} for all $c$ such that $\Celtshadow^c$
11547 % is undefined, in order to make sure that any \colpage{} has at least one
11548 % coloring \!\special! with $\Celt^c$ at its beginning so that, for example,
11549 % coloring operations at the tail of the \colpage{} of $c_1$ is overridden
11550 % by that of the default color of $c_2$ placed at the head of its \colpage{}.
11551 % 
11552 % \begin{macrocode}
11553 \def\pcol@clearcst@unvbox#1{%
11554 \pcol@ifempty#1\relax
11555 {\pcol@restorecst\pcol@colorstack@saved \unvbox#1\pcol@clearcolorstack}}
11556 \def\pcol@clearcolorstack{%
11557 \def\reserved@a##1{\reset@color}\def\reserved@b##1{\reset@color}%
11558 \pcol@scancst\pcol@colorins}
11559
11560 % \end{macrocode}
11561 % \end{macro}\end{macro}
11562 %
11563 % \changes{v1.2-1}{2013/05/11}
11564 % {\cs{pcol@set@color@elt} was introduced to implement color context
11565 % reestablishment but removed in v1.34.}
11566 % \changes{v1.34}{2018/05/07}
11567 % {\cs{pcol@set@color@elt} is removed according to the change of text
11568 % coloring from \cs{output} to \cs{insert}.}
11569 % 
11570 % \begin{macro}{\pcol@restorecolorstack}
11571 % \changes{v1.2-1}{2013/05/11}
11572 % {Introduced to reestablish color context.}
11573 % \changes{v1.34}{2018/05/07}
11574 % {Completely change its definition according to the new text coloring
11575 % with \cs{insert}.}
11576 % \begin{macro}{\pcol@restorecst}
11577 % \changes{v1.2-1}{2013/05/11}
11578 % {Introduced to reestablish color context.}
11579 % \changes{v1.34}{2018/05/07}
11580 % {Completely change its definition according to the new text coloring
11581 % with \cs{insert}.}
11582 % 
11583 % The macro \!\pcol@restorecolorstack!, used in \!\pcol@putbackmvl!
11584 % and \!\pcol@output@end!, makes \colorctext{} in
11585 % |.dvi| consistent with that in |.tex| by giving $\cst=\!\pcol@colorins!$
11586 % to \!\pcol@restorecst! to let it scan $\CST^c=(\Celt^c,\cst)$.
11587 % The callee macro $\!\pcol@restorecst!\arg{box}$, also used in
11588 % \!\pcol@clearcst@unvbox! with $\arg{box}=\csts=\!\pcol@colorstack@saved!$,
11589 % invokes \!\pcol@scancst! after \!\def!ining $\!\reserved@a!\<\celt_i\>$ to
11590 % apply \!\unvbox! to $\celt_i$ in $\cst$ or $\csts$ and
11591 % $\!\reserved@b!\<\Celt^c\>$ to apply \!\unvcopy! to $\Celt^c$ so that
11592 % coloring \!\special!s they have will be put into the main vertical list.
11593 % 
11594 % \begin{macrocode}
11595 \def\pcol@restorecolorstack{\pcol@restorecst\pcol@colorins}
11596 \def\pcol@restorecst{%
11597 \def\reserved@a##1{\unvbox##1}\def\reserved@b##1{\unvcopy##1}%
11598 \pcol@scancst}
11599
11600 % \end{macrocode}
11601 % \end{macro}\end{macro}
11602 %
11603 % \begin{macro}{\pcol@scancst}
11604 % \changes{v1.34}{2018/05/07}
11605 % {Introduced to implement new text coloring with \cs{insert}.}
11606 % \begin{macro}{\pcol@iscancst}
11607 % \changes{v1.34}{2018/05/07}
11608 % {Introduced to implement new text coloring with \cs{insert}.}
11609 %
11610 % \begin{Sloppy}{1500}
11611 % The macro $\!\pcol@scancst!\arg{box}$ is invoked from
11612 % \!\pcol@clearcolorstack! and \!\pcol@restorecst!. In the former
11613 % invocation, we have $\arg{box}=\cstraw=\!\pcol@colorins!$ to rewind
11614 % $\CSTraw=(\Celt^c,\cstraw)$ with $\!\reserved@a!\arg{\celt_i}$ and
11615 % $\!\reserved@b!\arg{\Celt^c}$ having \!\reset@color!. In the latter one,
11616 % we have
11617 % $\arg{box}\in\{\cst{=}\!\pcol@colorins!,\,\csts{=}\!\pcol@colorstack@saved!\}$
11618 % to reestablish $\CST^c=(\Celt^c,\cst)$ or $\csts$ with
11619 % $\!\reserved@a!\arg{\celt_i}$ to apply \!\unvbox! to $\celt_i$ and
11620 % $\!\reserved@b!\arg{\Celt^c}$ to apply \!\unvcopy! to $\Celt^c$.
11621 % Therefore, if $\arg{box}=\!\pcol@colorins!$, we at first put (un)coloring
11622 % \!\special! for $\Celt^c$, unless it is $\bot$, to the main vertical
11623 % list applying \!\reserved@b! to it. This means the \!\special! for
11624 % $\Celt^c$ is put first prior to those for elements in $\cstraw$ or $\cst$
11625 % consistently in reestablishing but not in rewinding. However as we
11626 % discussed in the description of \!\pcol@clearcolorstack!, the order of
11627 % rewinding does not affect the result for almost all printers because only
11628 % the number of pop operations is significant for them\footnote{
11629 % 
11630 % And even for the minority because multiple updates of printer's color with
11631 % one particular color are independent of the order of them.}.
11632 % 
11633 % Then if $\arg{box}\neq\bot$ we invoke \!\pcol@iscancst! to examine the
11634 % contents of $\arg{box}$ from its bottom to top. Prior to the invocation,
11635 % we do the following; let \!\@tempboxa! have an empty \!\vbox! as its initial
11636 % value of reformed $\arg{box}$; let \!\pcol@tempboxa! have an empty
11637 % \!\vbox! as its initial value of the sequence of \!\special!s to be put
11638 % into the main vertical list; let $\npop=\!\@tempcntb!=0$; let
11639 % $M=\!\reserved@b!=()$ as its initial value of the list of identifiers of
11640 % math-mode pops; $\CSIndex{if@tempswa}=\true$ to mean the first \!\vbox! to
11641 % update $\Celt^c$ found in the scan (i.e., the bottommost one) is
11642 % effective.
11643 % \end{Sloppy}
11644 %
11645 % In the macro \!\pcol@iscancst!, we repeatedly examine the last \!\vbox! in
11646 % $\arg{box}$ taken by \!\lastbox! into $\celt=\!\pcol@tempboxb!$ until
11647 % $\celt$ becomes $\bot$, and perform one of the following for $\celt$.
11648 % 
11649 % \begin{enumerate}\def\labelenumi{(\arabic{enumi})}
11650 % \def\HT{\mathit{height}}\def\DP{\mathit{depth}}\def\WD{\mathit{width}}
11651 % \item
11652 % If $\HT(\celt)=0$ and $\WD(\celt)=0$ to mean $\celt=\celtpop_i$, increment
11653 % $\npop$.
11654 %
11655 % \item
11656 % If $\HT(\celt)=0$ and $\WD(\celt)=m>0$ to mean $\celt=\mceltpop_{i,m}$, let
11657 % $M=(m,M)$.
11658 %
11659 % \item
11660 % If $\HT(\celt)\neq0$, $\DP(\celt)=0$ and $\WD(\celt)=0$ to mean
11661 % $\celt=\celt_i$, decrement $\npop$ if $\npop>0$, or otherwise add $\celt$
11662 % to the head of \!\@tempboxa! and apply $\!\reserved@a!\arg{\celt}$ to add
11663 % its result to the head of \!\pcol@tempboxa!.
11664 %
11665 % \item
11666 % If $\HT(\celt)\neq0$, $\DP(\celt)=0$ and $\WD(\celt)=m>0$ to mean
11667 % $\celt=\mcelt_{i,m}$, do nothing if $m\in M$, or otherwise add $\celt$
11668 % to the head of \!\@tempboxa! and apply $\!\reserved@a!\arg{\celt}$ to add
11669 % its result to the head of \!\pcol@tempboxa!.
11670 %
11671 % \item
11672 % If $\HT(\celt)\neq0$, $\DP(\celt)\neq0$ to mean $\celt$ has a \!\special!
11673 % with which $\Celt^c$ is updated. If $\CSIndex{if@tempswa}=\true$ to mean
11674 % $\celt$ is the first (bottommost) occurrence, $\Celt^c$ is updated
11675 % acquiring an \!\insert! from \!\@freelist! if it was $\bot$. In this
11676 % case of $\bot$, we have to put an uncoloring \!\special! by
11677 % \!\reset@color!, because \!\pcol@scancst! did not do it but
11678 % \!\columncolor! or \!\normalcolumncolor! pushed the corresponding color
11679 % \!\special!. Then we let $\CSIndex{if@tempswa}=\false$.
11680 %
11681 % Otherwise, i.e., if $\CSIndex{if@tempswa}=\false$ for second or succeeding
11682 % occurrences, we do nothing because updates by them are overridden by the
11683 % first one.
11684 % \end{enumerate}
11685 % 
11686 % Note that the cases other than (3) and (4) happen only in rewinding, and
11687 % thus in reestablishing we only have (3) and (4) with $\npop=0$ and $M=()$
11688 % always so that every $\celt$ is kept into new $\arg{box}$ and a coloring
11689 % \!\special! for it will be put into the main vertical list.
11690 %
11691 % Then we go back to \!\pcol@scancst! to let $\arg{box}=\!\@tempboxa!$,
11692 % meaningless in reestablishing but not harmful, and put the contents of
11693 % \!\pcol@tempboxa! to the main vertical list.
11694 %
11695 % 
11696 % \begin{macrocode}
11697 \def\pcol@scancst#1{%
11698 \@tempcnta#1\relax
11699 \ifnum\@tempcnta=\pcol@colorins
11700 \ifvoid\pcol@ccuse{@box}\else
11701 \reserved@b{\pcol@ccuse{@box}}\fi
11702 \fi
11703 \ifvoid\@tempcnta\else
11704 \setbox\@tempboxa\vbox{}\setbox\pcol@tempboxa\vbox{}\@tempcntb\z@
11705 \def\reserved@b{}\let\@elt\relax \@tempswatrue \pcol@iscancst
11706 \global\setbox\@tempcnta\box\@tempboxa \unvbox\pcol@tempboxa
11707 \fi}
11708 \def\pcol@iscancst{%
11709 \setbox\@tempcnta\vbox{%
11710 \unvbox\@tempcnta \global\setbox\pcol@tempboxb\lastbox}%
11711 \ifvoid\pcol@tempboxb \let\reserved@c\relax
11712 \else
11713 \let\reserved@c\pcol@iscancst
11714 \ifdim\ht\pcol@tempboxb=\z@
11715 \ifdim\wd\pcol@tempboxb=\z@ \advance\@tempcntb\@ne
11716 \else \edef\reserved@b{\@elt{\number\wd\pcol@tempboxb}\reserved@b}%
11717 \fi
11718 \else\ifdim\dp\pcol@tempboxb=\z@
11719 \ifdim\wd\pcol@tempboxb=\z@
11720 \ifnum\@tempcntb>\z@ \advance\@tempcntb\m@ne
11721 \else
11722 \setbox\@tempboxa\vbox{\copy\pcol@tempboxb \unvbox\@tempboxa}%
11723 \setbox\pcol@tempboxa\vbox{%
11724 \reserved@a\pcol@tempboxb \unvbox\pcol@tempboxa}%
11725 \fi
11726 \else
11727 \count@\wd\pcol@tempboxb \chardef\reserved@d\z@
11728 \def\@elt##1{\ifnum##1=\count@ \chardef\reserved@d\@ne \fi}%
11729 \reserved@b \let\@elt\relax
11730 \ifnum\reserved@d=\z@
11731 \setbox\@tempboxa\vbox{\copy\pcol@tempboxb \unvbox\@tempboxa}%
11732 \setbox\pcol@tempboxa\vbox{%
11733 \reserved@a\pcol@tempboxb \unvbox\pcol@tempboxa}%
11734 \fi
11735 \fi
11736 \else\if@tempswa
11737 \ifvoid\pcol@ccuse{@box}%
11738 \@next\@currbox\@freelist{\global\setbox\@currbox\vbox{}}\pcol@ovf
11739 \pcol@ccxdef{\@currbox}\reset@color
11740 \fi
11741 \global\setbox\pcol@ccuse{@box}\vbox{\unvbox\pcol@tempboxb}%
11742 \@tempswafalse
11743 \fi\fi\fi
11744 \fi
11745 \reserved@c}
11746
11747 % \end{macrocode}
11748 % \end{macro}\end{macro}
11749 %
11750 % \begin{macro}{\pcol@savecolorstack}
11751 % \changes{v1.2-1}{2013/05/11}
11752 % {Introduced to save the opening color context of a column-page.}
11753 % \changes{v1.34}{2018/05/07}
11754 % {Completely change its definition according to the new text coloring
11755 % with \cs{insert}.}
11756 % 
11757 % The macro \!\pcol@savecolorstack! is used in \!\pcol@startcolumn!,
11758 % \!\pcol@output@start! and \!\pcol@putbackmvl! to save the opening
11759 % \colorctext{} in $\CST^c$ of a \ccolpage{} $c$ known to be or found empty
11760 % into $\csts=\!\pcol@colorstack@saved!$. If both of
11761 % $\Celt^c=|\pcol@columncolor@box|\cdot c$ and $\cst=\!\pcol@colorins!$ are
11762 % $\bot$, $\csts$ is let be $\bot$. Otherwise, $\csts$ is let be a \!\vbox!
11763 % having a \!\vbox! for $\Celt^c$ at the top if it is not $\bot$ and then the
11764 % contents of $\cst$ if it is not $\bot$.
11765 % 
11766 % \SpecialArrayIndex{c}{\pcol@columncolor@box}
11767 % 
11768 % \begin{macrocode}
11769 \def\pcol@savecolorstack{%
11770 \ifvoid\pcol@colorins \@tempswafalse \else \@tempswatrue \fi
11771 \ifvoid\pcol@ccuse{@box}%
11772 \setbox\@tempboxa\box\voidb@x
11773 \else
11774 \setbox\@tempboxa\vbox{\unvcopy\pcol@ccuse{@box}}%
11775 \ht\@tempboxa1sp \dp\@tempboxa\z@ \wd\@tempboxa\z@
11776 \@tempswatrue
11777 \fi
11778 \if@tempswa
11779 \global\setbox\pcol@colorstack@saved\vbox{%
11780 \ifvoid\@tempboxa\else \box\@tempboxa \fi
11781 \ifvoid\pcol@colorins\else \unvcopy\pcol@colorins \fi}
11782 \else \global\setbox\pcol@colorstack@saved\box\voidb@x
11783 \fi}
11784
11785 % \end{macrocode}
11786 % \end{macro}
11787 % 
11788 % \changes{v1.2-1}{2013/05/11}
11789 % {\cs{pcol@colorstack@full} was introduced to represent
11790 % $\string\mathit{\Gamma}^c$ but removed in v1.34.}
11791 % \changes{v1.34}{2018/05/07}
11792 % {\cs{pcol@colorstack@full} is removed according to the change of text
11793 % coloring from \cs{output} to \cs{insert}.}
11794 % 
11795 % \KeepSpace{3}
11796 % \begin{macro}{\pcol@ccuse}
11797 % \changes{v1.34}{2018/05/07}
11798 % {Introduced to implement new text coloring with \cs{insert}.}
11799 % \begin{macro}{\pcol@ifccdefined}
11800 % \changes{v1.34}{2018/05/07}
11801 % {Introduced to implement new text coloring with \cs{insert}.}
11802 % \begin{macro}{\pcol@ccxdef}
11803 % \changes{v1.34}{2018/05/07}
11804 % {Introduced to implement new text coloring with \cs{insert}.}
11805 % 
11806 % The macro $\!\pcol@ccuse!\arg{pfx}$ is to expand a macro
11807 % $|\pcol@columncolor|\cdot\arg{pfx}\cdot c$ for the current column $c$. It
11808 % is used in \!\pcol@output@start! and \!\pcol@scancst@shadow! with
11809 % $\arg{pfx}=\hbox{`'}$ to have $\Celtshadow^c$, and in \!\pcol@scancst!,
11810 % \!\pcol@iscancst!, \!\pcol@savecolorstack!, \!\pcol@output@end! and
11811 % \!\pcol@icolumncolor! with $\arg{pfx}=|@box|$ to have $\Celt^c$.
11812 % 
11813 % \SpecialArrayIndex{c}{\pcol@columncolor}
11814 % \SpecialArrayIndex{c}{\pcol@columncolor@box}
11815 %
11816 % The macro $\!\pcol@ifccdefined!\arg{then}\arg{else}$ is used in
11817 % \!\pcol@output@start! and \!\pcol@scancst@shadow! to examine whether
11818 % $\Celtshadow^c=|\pcol@columncolor|\cdot c$ is defined and to do
11819 % $\arg{then}$ if so or $\arg{else}$ otherwise.
11820 % 
11821 % \SpecialArrayIndex{c}{\pcol@columncolor}
11822 %
11823 % The macro $\!\pcol@ccxdef!\arg{body}$ \!\xdef!ines a macro
11824 % $\Celt^c=|\pcol@columncolor@box|\cdot c$ as $\arg{body}$ for the current
11825 % column $c$. It is used in \!\pcol@output@start!, \!\pcol@iscancst! and
11826 % \!\pcol@icolumncolor! with $\arg{body}=\!\@currbox!$ when an \!\insert!
11827 % for $\Celt^c$ is acquired, and in \!\pcol@output@end! with
11828 % $\arg{body}=\!\voidb@x!$ after releasing $\Celt^c$ to \!\@freelist!.
11829 % 
11830 % \SpecialArrayIndex{c}{\pcol@columncolor@box}
11831 % 
11832 % \begin{macrocode}
11833 \def\pcol@ccuse#1{\@nameuse{pcol@columncolor#1\number\pcol@currcol}}
11834 \def\pcol@ifccdefined#1#2{%
11835 \expandafter\ifx\csname pcol@columncolor\number\pcol@currcol\endcsname\relax
11836 #2\else#1\fi}
11837 \def\pcol@ccxdef#1{%
11838 \expandafter\xdef
11839 \csname pcol@columncolor@box\number\pcol@currcol\endcsname{#1}}
11840
11841 % \end{macrocode}
11842 % \end{macro}\end{macro}\end{macro}
11843 %
11844 %
11845 %
11846 % \subsection{Footnote Handling}
11847 % \label{sec:imp-sout-scfnote}
11848 % \changes{v1.2-2}{2013/05/11}
11849 % {Add the subsection ``Footnote Handling'' to describe newly
11850 % introduced macros for page-wise footnotes.}
11851 %
11852 % \begin{macro}{\pcol@savefootins}
11853 % \changes{v1.2-2}{2013/05/11}
11854 % {Introduced to save footnotes in multiple occasions.}
11855 % 
11856 % The macro $\!\pcol@savefootins!\arg{cs}$, invoked from \!\pcol@makecol!
11857 % for \Scfnote{}s and from \!\pcol@output@switch! for both \mcfnote{} and
11858 % \Scfnote{}s, saves \!\footins! to an \!\insert! register obtained by
11859 % \!\@next! from \!\@freelist!, and \!\def!ines $\arg{cs}$ being
11860 % \!\pcol@currfoot! or \!\pcol@footins! so that it has the register as its
11861 % body and the register is then saved into $\pp^f(p)$ or $\cc_c(\ft)$. We
11862 % save not only \!\box! component of \!\footins! but also \!\count!,
11863 % \!\dimen! and \!\skip!\footnote{
11864 % 
11865 % Knowing these three components are virtually constants.}.
11866 % 
11867 % \begin{macrocode}
11868 %% Special Output Routines: Footnote Handling
11869
11870 \def\pcol@savefootins#1{%
11871 \@next#1\@freelist{%
11872 \global\setbox#1\box\footins
11873 \global\count#1\count\footins
11874 \global\dimen#1\dimen\footins
11875 \global\skip#1\skip\footins}{\def#1{\voidb@x}\pcol@ovf}}
11876
11877 % \end{macrocode}
11878 % \end{macro}
11879 %
11880 % \begin{macro}{\pcol@shrinkcolbyfn}
11881 % \changes{v1.2-2}{2013/05/11}
11882 % {Introduced to shrink \cs{@colht} temporarily by the
11883 % height-plus-depth of page-wise footnotes and the natural size
11884 % of the skip above them.}
11885 % \changes{v1.3-3}{2013/09/17}
11886 % {Add the first argument $\langle\string\mathit{height}\rangle$ for
11887 % the user \cs{pcol@ioutputelt}.}
11888 % \changes{v1.3-6}{2013/09/17}
11889 % {Add the third argument $\langle\string\mathit{skip}\rangle$ to
11890 % avoid accidental destruction of \cs{@tempdimb} which was modified
11891 % unconditionally.}
11892 % 
11893 % The macro $\!\pcol@shrinkcolbyfn!\arg{height}\arg{ins}\arg{skip}$, invoked
11894 % from \!\pcol@makecol!, \!\pcol@ioutputelt!, \!\pcol@startcolumn!,
11895 % \!\pcol@restartcolumn!, \!\pcol@flushcolumn! and \!\pcol@makeflushedpage!,
11896 % shrinks $\arg{height}\in\{\!\@colht!,\!\@tempdima!\}$ temporarily so that a
11897 % column or the set of all columns resides in a page with \Scfnote{}s in the
11898 % \!\insert! $\arg{ins}$. The shrinkage is calculated by adding the sum of
11899 % the height plus depth of all footnotes, i.e., that of $\arg{ins}$, and the
11900 % natural component of $\!\skip!\arg{ins}$, i.e., the vertical space
11901 % inserted between the columns and the footnotes. Note that the stretch and
11902 % shrink components of $\!\skip!\arg{ins}$ cannot be incorporated into the
11903 % calculation but their contribution to each \colpage{} is taken care of by
11904 % the following macro \!\pcol@unvbox@cclv! if required. Also note that the
11905 % inverse of $\!\skip!\arg{ins}$ is kept in $\arg{skip}$ if it is not
11906 % \!\relax! so that \!\pcol@deferredfootins! knows $\arg{ins}\neq\bot$ when
11907 % this macro is invoked from \!\pcol@startcolumn! and
11908 % \!\pcol@restartcolumn! with $\arg{skip}=\!\@tempdimb!$.
11909 % 
11910 % \begin{macrocode}
11911 \def\pcol@shrinkcolbyfn#1#2#3{%
11912 \ifx#3\relax\else #3-\skip#2\relax \fi
11913 \advance#1-\ht#2\advance#1-\dp#2\advance#1-\skip#2\relax}
11914 % \end{macrocode}
11915 % \end{macro}
11916 % 
11917 % \begin{macro}{\pcol@unvbox@cclv}
11918 % \changes{v1.2-2}{2013/05/11}
11919 % {Introduced to add stretch/shrink components of
11920 % \cs{skip}\cs{footins} at the bottom of a column-page if the page has
11921 % page-wise footnotes.}
11922 % 
11923 % The macro $\!\pcol@unvbox@cclv!\arg{ins}$, invoked from \!\pcol@makecol! and
11924 % \!\pcol@flushcolumn! when they work on a column-page with \Scfnote{}s,
11925 % adds the stretch and shrink components of $\!\skip!\arg{ins}$ at the end
11926 % of \!\box!|255|, where $\arg{ins}$ is non-void $\pp^f(p)$ having
11927 % \Scfnote{}s. Before the addition, the macro goes back to the baseline of
11928 % \!\box!|255|\footnote{
11929 % 
11930 % The comparison of the depth of \cs{box}\texttt{255} and \cs{@maxdepth} and
11931 % taking the latter if it is smaller is really just-in-case.}
11932 % 
11933 % to nullify the baseline progress mechanism so as to make it sure the exact
11934 % amount of the vertical skip is added. Then it adds the stretch and shrink
11935 % by at first adding the skip itself and then the negative amount of its
11936 % natural component.
11937 % 
11938 % \begin{macrocode}
11939 \def\pcol@unvbox@cclv#1{%
11940 \@tempdima\dp\@cclv \unvbox\@cclv
11941 \vskip \ifdim\@tempdima>\@maxdepth -\@maxdepth \else -\@tempdima \fi
11942 \vskip\skip#1\@tempdima\skip#1\vskip-\@tempdima}
11943
11944 % \end{macrocode}
11945 % \end{macro}
11946 %
11947 % \begin{macro}{\pcol@deferredfootins}
11948 % \changes{v1.2-2}{2013/05/11}
11949 % {Introduced to insert deferred footnotes.}
11950 % \changes{v1.3-6}{2013/09/17}
11951 % {Fix the bug that the height cap was underestimated by the duplicated
11952 % subtraction of \cs{skip}\cs{footins} if the page has already have
11953 % non-deferred footnotes.}
11954 % 
11955 % The macro $\!\pcol@deferredfootins!\arg{macro}$, invoked from
11956 % \!\pcol@startcolumn! and \!\pcol@restartcolumn!, tries to \!\insert! some
11957 % of leading deferred footnotes in $\df$ through \!\footins!\footnote{
11958 % 
11959 % The argument $\arg{macro}$ has the invoker itself shown in debug
11960 % messages.}.
11961 % 
11962 % In order to avoid that \!\footins! has footnotes across three or more
11963 % pages to make confusion in the order of footnotes kept inside of \TeX, we
11964 % cap the total height of footnotes by $h=\!\@colht!$ if it has already
11965 % shrunk by non-deferred footnotes in the page we are working on indicated
11966 % by $\!\@tempdimb!<0$, or $h=\!\@colht!-\!\skip!\!\footins!$ if the page
11967 % does not have non-deferred footnotes indicated by $\!\@tempdimb!=0$. That
11968 % is, we extract leading elements of $\df$ by \!\vsplit! until their total
11969 % height reaches $h$ and, if some elements are obtained in \!\@tempboxa!,
11970 % \!\insert! them through \!\footins!. As for the remaining elements if
11971 % any, we add a leading \!\penalty!\!\interlinepenalty! which should have
11972 % been removed by \!\vsplit!.
11973 %
11974 % Note that we temporarily let $\!\splitmaxdepth!=\!\@maxdepth!$,
11975 % $\!\splittopskip!=0$ and $\!\vbadness!=\infty$ at the \!\vsplit! so that
11976 % the depth of the split first half is \!\@maxdepth! at deepest, the second
11977 % half does not have any skip at its top, and \TeX{} will not complain of
11978 % (almost) inevitable underfull. Also note that the successful extraction
11979 % of the leading elements is examined by checking \!\ht!\!\@tempboxa! and
11980 % thus we need to \!\unvbox! it in itself because \!\vsplit! makes the
11981 % height $h$ regardless of its contents.
11982 % 
11983 % \begin{macrocode}
11984 \def\pcol@deferredfootins#1{%
11985 \ifdim\@tempdimb=\z@ \@tempdimb\@colht \advance\@tempdimb-\skip\footins
11986 \else \@tempdimb\@colht
11987 \fi
11988 \ifvoid\pcol@topfnotes\else \ifdim\@tempdimb>\z@
11989 \begingroup
11990 \splitmaxdepth\@maxdepth \splittopskip\z@ \vbadness\@M
11991 \setbox\@tempboxa\vsplit\pcol@topfnotes to\@tempdimb
11992 \ifvoid\pcol@topfnotes\else
11993 \global\setbox\pcol@topfnotes\vbox{\penalty\interlinepenalty
11994 \unvbox\pcol@topfnotes}%
11995 \fi
11996 \setbox\@tempboxa\vbox{\unvbox\@tempboxa}%
11997 \ifdim\ht\@tempboxa>\z@
11998 \pcol@Log#1{add}\@tempboxa
11999 \insert\footins{\unvbox\@tempboxa}%
12000 \fi
12001 \endgroup
12002 \fi\fi}
12003
12004 % \end{macrocode}
12005 % \end{macro}
12006 %
12007 % \begin{macro}{\pcol@combinefootins}
12008 % \changes{v1.2-2}{2013/05/11}
12009 % {Introduced to put footnotes into pre-environment stuff.}
12010 % \changes{v1.35-4}{2018/12/31}
12011 % {Add the insertion of vertical skip \cs{belowfootnoteskip}.}
12012 % \begin{macro}{\pcol@putfootins}
12013 % \changes{v1.2-2}{2013/05/11}
12014 % {Introduced to put page-wise footnotes to a page.}
12015 % \changes{v1.3-2}{2013/09/17}
12016 % {Change users \cs{pcol@outputelt} to \cs{pcol@ioutputelt}.}
12017 % \changes{v1.3-6}{2013/09/17}
12018 % {Remove \cs{pcol@output@end} from users.}
12019 % 
12020 % The macro $\!\pcol@combinefootins!\arg{b}\arg{f}$, invoked solely from
12021 % \!\pcol@makenormalcol!\footnote{
12022 % 
12023 % And thus having the arguments $\arg{b}$ and $\arg{f}$ is unnecessary, but
12024 % we keep this implementation to avoid unnecessary recoding from a
12025 % development version.},
12026 % 
12027 % constructs the \preenv{} in \!\@outputbox!, combining the stuff in the box
12028 % $b$ and pre-environment footnotes in the \!\insert! $f$. It is almost
12029 % equivalent to the \cs{else} part of \!\@makecol! in which the main
12030 % vertical list and \Mcfnote{}s are combined. The operation to put
12031 % footnotes is almost equivalent to the second half of the \cs{else} part
12032 % except that \!\insert! is not always \!\footins! but $f$ and is done by
12033 % \!\pcol@putfootins! in which a null vertical skip is added after $f$ but
12034 % this skip is removed by \!\unskip! after the invocation. The other
12035 % difference is that the vertical space of \!\belowfootnoteskip! is added if
12036 % it is not 0\footnote{
12037 % 
12038 % We avoid null space insertion to minimize the difference from older
12039 % versions in traced output.}
12040 % 
12041 % to have some space between non-merged \Preenv{} footnotes and the first
12042 % lines in a \env{paracol} environment.
12043 %
12044 % The null vertical skip is put for \Scfnote{}s, for which the macro
12045 % \!\pcol@putfootins! is invoked from \!\pcol@ioutputelt! and
12046 % \!\pcol@makeflushedpage!. Since we shrink the height of \colpage{}s by
12047 % the height-plus-depth of \Scfnote{}s, the natural height of the box in
12048 % which \colpage{}s and \Scfnote{}s are combined would be less than
12049 % \!\textheight! due to the depth of the last footnote line if we simply
12050 % made the footnotes the last items of the box. Though this shortage at
12051 % most \!\maxdepth! is expected to be covered by the stretch factor of
12052 % \!\skip!\!\footins! without too large badness causing an underfull
12053 % message\footnote{
12054 % 
12055 % With default settings of $\cs{maxdimen}=5\,|pt|$ and the stretch factor
12056 % 4\,|pt| of \cs{skip}\cs{footins}, the badness $100\times(5/4)^3\approx195$
12057 % is significantly less than the default $\cs{vbadness}=1000$.},
12058 % 
12059 % someday we could face an underfull with some unusual settings of
12060 % \!\maxdimen!, \!\skip!\!\footins! and/or \!\vbadness!. Therefore, we put a
12061 % null vertical skip so that the real bottom of the footnotes, instead of
12062 % the last baseline, is placed at the baseline of the box, to make the
12063 % natural height of the box is \!\textheight! exactly. Note that this
12064 % shifting \Scfnote{}s up will not make last baselines of footnotes among
12065 % pages unaligned, because the last line have a strut.
12066 % 
12067 % \begin{macrocode}
12068 \def\pcol@combinefootins#1#2{%
12069 \setbox\@outputbox\vbox{%
12070 \boxmaxdepth\@maxdepth
12071 \unvbox#1\relax
12072 \pcol@putfootins#2\unskip
12073 \ifdim\belowfootnoteskip=\z@\else \vskip\belowfootnoteskip \fi}}
12074 \def\pcol@putfootins#1{%
12075 \vskip\skip#1\relax
12076 \color@begingroup
12077 \normalcolor
12078 \footnoterule
12079 \unvbox#1\relax
12080 \color@endgroup \vskip\z@}
12081
12082 % \end{macrocode}
12083 % \end{macro}\end{macro}
12084 %
12085 %
12086 %
12087 % \KeepSpace{3}
12088 % \subsection{Marginal Notes}
12089 % \label{sec:imp-sout-mpar}
12090 % \changes{v1.3-4}{2013/09/17}
12091 % {Add this section ``Marginal Notes''.}
12092 %
12093 % \begin{macro}{\@addmarginpar}
12094 % \changes{v1.3-4}{2013/09/17}
12095 % {Made \cs{let}-equal to \cs{pcol@addmarginpar} in
12096 % \string\texttt{paracol} environments.}
12097 % \begin{macro}{\pcol@addmarginpar}
12098 % \changes{v1.3-4}{2013/09/17}
12099 % {Introduced to make a margin sharable by marginal notes from
12100 % different columns.}
12101 % \changes{v1.35-3}{2018/12/31}
12102 % {Fix the bug referring to \cs{@marbox} inappropriately.}
12103 % \changes{v1.35-3}{2018/12/31}
12104 % {Add vertical shifting of marginal note to emulate of
12105 % \cs{marginnote}.}
12106 % \begin{macro}{\pcol@@addmarginpar}
12107 % \changes{v1.3-4}{2013/09/17}
12108 % {Introduced to keep the original definition of \cs{@addmarginpar}.}
12109 % \def\swap{\mathit{swap}}
12110 % 
12111 % The macro \!\pcol@addmarginpar! is our own version of \!\@addmarginpar!,
12112 % which \!\pcol@zparacol! makes \!\let!-equal to \!\pcol@addmarginpar!
12113 % keeping its original definition in \!\pcol@@addmarginpar!. Therefore, in
12114 % an \env{paracol} environment, the \!\output! request made by \LaTeX's
12115 % \!\marginpar! in the column $c$ and page $p$ is processed by
12116 % \!\pcol@addmarginpar! through our own \!\output! routine being
12117 % \!\pcol@output!, \!\pcol@specialoutput! and \LaTeX's \!\@specialoutput!.
12118 % What we do in this macro are as follows; determine the margin which a
12119 % marginal note goes to; temporarily modify the parameter
12120 % $m_w=\!\marginparwidth!$ or $m_s=\!\marginparsep!$ according to the margin
12121 % and the column; determine the position to place the marginal note
12122 % consulting $\pp^m(p)=\!\pcol@mparbottom!$ obtained by
12123 % \!\pcol@getcurrpage!: and update $\pp^m(p)$ according to the position.
12124 %
12125 % First, there are the following parameters to determine the margin, and thus
12126 % the value of $\CSIndex{if@firstcolumn}$ referred to in \LaTeX's
12127 % \!\@addmarginpar! and meaning left if $\true$ or right if $\false$.
12128 % 
12129 % \begin{enumerate}\def\labelenumi{(\arabic{enumi})}
12130 % \item
12131 % The macros \!\pcol@mpthreshold@l! and \!\pcol@mpthreshold@r! defined by
12132 % \!\marginpar~threshold!\ give us the threshold of the column number to let
12133 % columns less than it go to the left margin while those equal to or greater
12134 % than it to the right, according to the \parapag{}e the column belongs to.
12135 % Therefore, we let $\CSIndex{if@firstcolumn}=\true$ iff
12136 % $c<\!\pcol@mpthreshold@l!\land c<\CL$ or $c<\!\pcol@mpthreshold@r!\land
12137 % c\geq\CL$, as the fundamental setting.
12138 %
12139 % \item
12140 % If $\CSIndex{ifpcol@swapmarginpar}=\true$ because the specifier `|m|' is
12141 % given to \!\twosided! explicitly or implicitly, the decision in (1) is
12142 % reversed if $\page(p)\bmod2=0$, and then this decision is reversed again
12143 % if $c\geq\CL$ and $\CSIndex{ifpcol@paired}=\false$ to mean $c$ is in a
12144 % \npaired{} right \parapag{}e. The second reversal is done because
12145 % $\page(p)$ is \emph{common} to both left and right \parapag{}es and is for
12146 % the left page in usual cases without page number jumps. Therefore,
12147 % $(\page(p)\bmod2)$ is for left \parapag{}es and thus for right counterparts
12148 % the decision should be made by $((\page(p)+1)\bmod2)$ and thus the result
12149 % should be reversed.
12150 %
12151 % \item
12152 % If \CSIndex{if@reversemargin} is made $\true$ by \LaTeX's
12153 % \!\reversemarginpar!, the decision made by (1) and then possibly reversed
12154 % by (2) is finally reversed.
12155 % \end{enumerate}
12156 % 
12157 % Second, we calculate
12158 % $$
12159 % D=\!\@tempdima!=\sum_{d=\Cfrom}^{\swap(c)-1}(w_{\swap(d)}+g_{\swap'(d)})
12160 % $$
12161 % where $x'=swap(x)$ is given by
12162 % $\!\pcol@swapcolumn!\<x\>\<x'\>\<\Cfrom\>\<\Cto\>$ to let
12163 % $x'=\Cto-(x-\Cfrom)-1$ if $\CSIndex{ifpcol@swapcolumn}=\true$ and
12164 % $\page(p)\bmod2=0$ or $x'=x$ otherwise,
12165 % $\swap'(x)=\!\pcol@colsepid!\in\{\swap(x)-1,x\}$ according to swapped or
12166 % not, $(\Cfrom,\Cto)\in\{(0,\CL),(\CL,\C)\}$ according to $c<\CL$ or not,
12167 % and $\w_x$ and $\gap_x$ are the width of $x$-th column and gap given by
12168 % $|\pcol@columnwidth|{\cdot}x$ and $|\pcol@columnsep|{\cdot}x$
12169 % respectively.
12170 % 
12171 % \SpecialArrayIndex{c}{\pcol@columnwidth}
12172 % \SpecialArrayIndex{c}{\pcol@columnsep}
12173 % 
12174 % That is, $D$ is the distance from the left edge of the column $c$ to that
12175 % of leftmost column in the (parallel-)
12176 % 
12177 % \Index{parallel-paging}
12178 % 
12179 % page in which $c$ resides. Then if $\CSIndex{if@firstcolumn}=\true$ to
12180 % let the marginal note go to the left margin, we add $D$ to
12181 % $m_w=\!\marginparwidth!$ so that \LaTeX's \!\@addmarginpar! being
12182 % \!\pcol@@addmarginpar! aligns the left edge of the marginal note at the
12183 % point apart from the column's left edge by $(D+m_w)+m_s$ rather than
12184 % $m_w+m_s$, or in other words $m_w+m_s$ apart from the left edge of the
12185 % leftmost column. On the other hand if $\CSIndex{if@firstcolumn}=\false$,
12186 % we add $\WT-(D+w_c)$ where $\WT$ is \!\textwidth!, being the distance from
12187 % the right edge of the column $c$ to that of the rightmost column, to
12188 % $m_s=\!\marginparsep!$ so that \!\pcol@@addmarginpar! aligns the left
12189 % edge of the marginal note at the point apart from the column's right edge
12190 % by $\WT-(D+w_c)+m_s$ rather than $m_s$, or in other words $m_s$ apart from
12191 % the right edge of the rightmost column.
12192 %
12193 % Third, we let \Midx{\!\pcol@marbox!} be the first element of \!\@currlist!
12194 % obtained by \!\@xnext! for the right marginal note if
12195 % $\CSIndex{if@firstcolumn}=\false$, or \!\@currbox! for the left marginal
12196 % note otherwise. Then we let $t=\!\@tempdima!$ be the distance from the
12197 % top edge of the column to that of the marginal note, namely \!\@pageht!
12198 % minus the height of \!\pcol@marbox! plus |\dimen|\!\@currbox! being
12199 % downward shift amount optionally given by \!\marginnote!. We also let
12200 % $h=\!\@tempdimb!$ be the height-plus-depth of the box \!\pcol@marbox!
12201 % plus \!\marginparpush!, or in other words the vertical space the marginal
12202 % note requires. Then we give $t$ and $h$ to \!\pcol@getmparbottom! to let
12203 % \!\@mparbottom! have the bottom of the existing marginal text below which
12204 % we put the marginal text in \!\pcol@marbox!, and to let \!\pcol@mpblist!
12205 % have the new list to be replaced with $\mpb_{\{L,R\}}^{\{l,r\}}$ in
12206 % $\pp^m(p)$.
12207 %
12208 % Forth, we update $\pp^m(p)$ with the new list in \!\pcol@mpblist! by a
12209 % process similar to \!\pcol@setpageno! but with \!\pcol@setmpbelt! to scan
12210 % the list of pages $\PPP$.
12211 %
12212 % Fifth, we shift down \!\pcol@marbox! by |\dimen|\!\@currbox! and, if the
12213 % shift amount is greater than the height of the box and thus the height of
12214 % shifting result is zero, decrement \!\@mparbottom! by the amount to
12215 % deceive \LaTeX's \!\@addmarginpar! into believing \!\@mparbottom! is above
12216 % the real one by the amount. In other words, by the decrement we let
12217 % \!\@addmarginpar! see the top edge of the shifted marginal note in the
12218 % box, rather than that of the box itself, for the placement with
12219 % \!\@mparbottom!.
12220 %
12221 % Finally, we invoke \LaTeX's original \!\@addmarginpar! being
12222 % \!\pcol@@addmarginpar! to put the marginal note according to
12223 % \CSIndex{if@firstcolumn}, temporarily modified \!\marginparsep! and
12224 % \!\marginparwidth!, and \!\@mparbottom!. Note that since
12225 % \!\pcol@zparacol! lets $\CSIndex{if@twocolumn}\~=\true$,
12226 % \!\pcol@@addmarginpar! determine the margin only by
12227 % \CSIndex{if@firstcolumn}. Also note that it can be $\!\@mparbottom!>t$
12228 % (before decrement with the positive shift amount) to mean the marginal
12229 % note should be shifted down from its natural position, and if so
12230 % \!\pcol@@addmarginpar! will give us a warning as the correct consequence
12231 % of the placement.
12232 % 
12233 % \begin{macrocode}
12234 %% Special Output Routines: Marginal Notes
12235
12236 \def\pcol@addmarginpar{%
12237 \pcol@getcurrpage \@firstcolumntrue
12238 \ifnum\pcol@currcol<\pcol@ncolleft
12239 \let\reserved@a\z@ \let\reserved@b\pcol@ncolleft
12240 \ifnum\pcol@mpthreshold@l>\pcol@currcol\else \@firstcolumnfalse \fi
12241 \else
12242 \let\reserved@a\pcol@ncolleft \let\reserved@b\pcol@ncol
12243 \ifnum\pcol@mpthreshold@r>\pcol@currcol\else \@firstcolumnfalse \fi
12244 \fi
12245 \ifpcol@swapmarginpar
12246 \ifodd\c@page\else
12247 \if@firstcolumn \@firstcolumnfalse \else \@firstcolumntrue \fi
12248 \fi
12249 \ifpcol@paired\else \ifnum\pcol@currcol<\pcol@ncolleft\else
12250 \if@firstcolumn \@firstcolumnfalse \else \@firstcolumntrue \fi
12251 \fi\fi
12252 \fi
12253 \if@reversemargin
12254 \if@firstcolumn \@firstcolumnfalse \else \@firstcolumntrue \fi
12255 \fi
12256 \pcol@swapcolumn\pcol@currcol\count@\reserved@a\reserved@b
12257 \@tempdima\z@
12258 \@tempcnta\reserved@a \@whilenum\@tempcnta<\count@\do{%
12259 \pcol@swapcolumn\@tempcnta\@tempcntb\reserved@a\reserved@b
12260 \advance\@tempdima\csname pcol@columnwidth\number\@tempcntb\endcsname\relax
12261 \advance\@tempdima\csname pcol@columnsep\pcol@colsepid\endcsname\relax
12262 \advance\@tempcnta\@ne}%
12263 \if@firstcolumn \advance\marginparwidth\@tempdima
12264 \else
12265 \advance\marginparsep\textwidth \advance\marginparsep-\@tempdima
12266 \advance\marginparsep-\columnwidth
12267 \fi
12268 \expandafter\@xnext\@currlist\@@\pcol@marbox\@gtempa
12269 \if@firstcolumn\let\pcol@marbox\@currbox \fi
12270 \@tempdima\@pageht \advance\@tempdima-\ht\pcol@marbox
12271 \advance\@tempdima\dimen\@currbox
12272 \@tempdimb\ht\pcol@marbox \advance\@tempdimb\dp\pcol@marbox
12273 \advance\@tempdimb\marginparpush
12274 \pcol@getmparbottom\@tempdima\@tempdimb
12275 \begingroup
12276 \@tempcnta\pcol@page \advance\@tempcnta-\pcol@basepage
12277 \edef\reserved@a{\pcol@pages\pcol@currpage}%
12278 \global\let\pcol@pages\@empty \global\let\pcol@currpage\@empty
12279 \let\@elt\pcol@setmpbelt \reserved@a
12280 \endgroup
12281 \ifdim\dimen\@currbox=\z@\else
12282 \ifdim\dimen\@currbox>\ht\pcol@marbox
12283 \advance\@mparbottom-\dimen\pcol@marbox
12284 \fi
12285 \setbox\pcol@marbox\hbox{\lower\dimen\@currbox\box\pcol@marbox}%
12286 \fi
12287 \pcol@@addmarginpar}
12288
12289 % \end{macrocode}
12290 % \end{macro}\end{macro}\end{macro}
12291 %
12292 % \KeepSpace{3}
12293 % \begin{macro}{\pcol@getmparbottom}
12294 % \changes{v1.3-4}{2013/09/17}
12295 % {Introduced to find the space where a marginal note is placed.}
12296 % \begin{macro}{\pcol@getmparbottom@i}
12297 % \changes{v1.3-4}{2013/09/17}
12298 % {Introduced to find the space where a marginal note is placed.}
12299 % \begin{macro}{\pcol@getmpbelt}
12300 % \changes{v1.3-4}{2013/09/17}
12301 % {Introduced to find the space where a marginal note is placed.}
12302 % \changes{v1.33-1}{2016/11/19}
12303 % {Fix the bug by which $t_k$ such that $t_k\geq t$ and $t_k-t\geq h$
12304 % but $t_k-b_{k-1}<h$ is found.}
12305 % 
12306 % The macro $\!\pcol@getmparbottom!\<t\>\<h\>$ is solely used in
12307 % \!\pcol@addmarginpar!\footnote{
12308 % 
12309 % Thus giving $t$ and $h$ as arguments is not necessary but we dare to do
12310 % it.}
12311 % 
12312 % to let $B=\!\@mparbottom!$ point the bottom of the marginal note below
12313 % which a new marginal note $m$, whose natural top is at $t$ and occupancy
12314 % height is $h$, in the current column $c$ and the page $p$ is placed, or 0
12315 % if the side margin has had no marginal notes yet. It is also \!\def!ines
12316 % $M'=\Midx{\!\pcol@mpblist!}$ having $\mpar(t',t'{+}h)$ for the new marginal
12317 % note $m$ placed at $t'$ in it and being replaced with one of
12318 % $\mpb_{\{L,R\}}^{\{l,r\}}$ in $\pp^m(p)$ by \!\pcol@setmpbelt!.
12319 %
12320 % First we examine if $\pp^m(p)=\!\pcol@mparbottom!$ is empty and if so we
12321 % simply let $B=0$ and $M'=(\mpar(t,t+h))$ because there are no marginal
12322 % notes in the page $p$ at all. Otherwise we obtain
12323 % $M\in\Set{\mpb_X^x}{X\in\{L,R\},\;x\in\{l,r\}}$ in \!\reserved@a! according
12324 % to the side margin to which the new marginal note $m$ goes to, i.e.,
12325 % according to $\CSIndex{if@firstcolumn}$ and $c<\CL$ or not, by
12326 % \!\pcol@getmparbottom@i! giving it the body of $\pp^m(p)$ by
12327 % \!\expandafter!. Then we apply $\!\pcol@getmpbelt!$ to each
12328 % $\mpar(t_i,b_i)\in M$ to have
12329 % $t_k=\min\Set{t_i}{t_i\geq{t},\;t_i-\max(t,b_{i-1})\geq{h}}$ and let
12330 % $B=b_{k-1}$ and
12331 % 
12332 % \begin{eqnarray*}
12333 % M'&=&(\mpar(t_1,b_1),\;\ldots,\;\mpar(t_{k-1},b_{k-1}),\;
12334 % \mpar(\max(t,B),\,\max(t,B)+h),\\
12335 % &&\phantom{\LP}
12336 % \mpar(t_k,b_k),\;\ldots,\;\mpar(t_n,b_n))
12337 % \end{eqnarray*}
12338 % 
12339 % where $n=\Abs{M}$, assuming $b_0=0$. That is, we try to find the first
12340 % available gap between marginal notes below $t$ to accommodate the
12341 % marginal note $m$ of $h$ tall. Then if such $t_k$ is not found because
12342 % $t>t_n$ to mean $m$ appears below the last marginal note as in natural
12343 % cases, or $t_i-\max(t,b_{i-1})<h$ for all $t_i$ s.t.\ $t_i>t$ to mean
12344 % there are no available gaps, we let $B=t_n$ and
12345 % $M'=(M,\mpar(\max(t,B),\,\max(t,B)+h))$ to place $m$ at the bottom.
12346 % 
12347 % \begin{macrocode}
12348 \def\pcol@getmparbottom#1#2{%
12349 \global\@mparbottom\z@
12350 \ifx\pcol@mparbottom\@empty
12351 \begingroup
12352 \@tempdimc#2\relax \advance\@tempdimc#1\relax \let\@elt\relax
12353 \xdef\pcol@mpblist{\@elt{\number#1}{\number\@tempdimc}}%
12354 \endgroup
12355 \else
12356 \expandafter\pcol@getmparbottom@i\pcol@mparbottom
12357 \begingroup
12358 \@tempdima#1\relax \@tempdimb#2\relax \@tempswafalse
12359 \let\@elt\pcol@getmpbelt \global\let\pcol@mpblist\@empty \reserved@a
12360 \if@tempswa\else
12361 \ifdim\@tempdima<\@mparbottom \@tempdima\@mparbottom \fi
12362 \advance\@tempdimb\@tempdima
12363 \@cons\pcol@mpblist{{\number\@tempdima}{\number\@tempdimb}}%
12364 \fi
12365 \endgroup
12366 \fi}
12367 \def\pcol@getmparbottom@i#1#2#3#4{%
12368 \ifnum\pcol@currcol<\pcol@ncolleft
12369 \if@firstcolumn \def\reserved@a{#1}\else\def\reserved@a{#2}\fi
12370 \else
12371 \if@firstcolumn \def\reserved@a{#3}\else\def\reserved@a{#4}\fi
12372 \fi}
12373 \def\pcol@getmpbelt#1#2{%
12374 \ifdim#1sp<\@tempdima
12375 \global\@mparbottom#2sp\relax \@cons\pcol@mpblist{{#1}{#2}}%
12376 \ifdim\@tempdima<#2sp\relax \@tempdima#2sp\relax \fi
12377 \else
12378 \@tempdimc\@tempdima \advance\@tempdimc\@tempdimb
12379 \ifdim#1sp<\@tempdimc
12380 \@tempdima#2sp\relax \global\@mparbottom#2sp\relax
12381 \@cons\pcol@mpblist{{#1}{#2}}%
12382 \else
12383 \@cons\pcol@mpblist{{\number\@tempdima}{\number\@tempdimc}\@elt{#1}{#2}}%
12384 \@tempswatrue
12385 \def\pcol@getmpbelt##1##2{\@cons\pcol@mpblist{{##1}{##2}}}
12386 \fi
12387 \fi}
12388
12389 % \end{macrocode}
12390 % \end{macro}\end{macro}\end{macro}
12391 %
12392 % \begin{macro}{\pcol@setmpbelt}
12393 % \changes{v1.3-4}{2013/09/17}
12394 % {Introduced to update $\pi^m(p)$.}
12395 % \begin{macro}{\pcol@setmpbelt@i}
12396 % \changes{v1.3-4}{2013/09/17}
12397 % {Introduced to update $\pi^m(p)$.}
12398 % 
12399 % The macro $\!\pcol@setmpbelt!
12400 % \Arg{\pp^p(q)}\<\pp^i(q)\>\<\pp^f(q)\>\Arg{\pp^s(q)}\Arg{\pp^m(q)}$ is
12401 % used solely in \!\pcol@addmarginpar! and is applied to $\PPP$ to update an
12402 % element $M\in\Set{\mpb_X^x}{X\in\{L,R\},x\in{l,r}}$ in $\pp^m(p)$ with
12403 % $M'=\!\pcol@mpblist!$ given by \!\pcol@getmparbottom!. The structure of
12404 % the macro is similar to \!\pcol@setpnoelt! to update $\pp^p(q)$ s.t.\
12405 % $q\geq p$, but in this macro the target of the update is only $p$. Then
12406 % for $q=p$, we invoke \!\pcol@setmpbelt@i! giving it the body of $\pp^m(p)$
12407 % being
12408 % $\Arg{\mpb_L^l}\Arg{\mpb_L^r}\Arg{\mpb_R^l}\Arg{\mpb_R^r}$, or
12409 % $\<\emptyset\>\<\emptyset\>\<\emptyset\>\<\emptyset\>$ if
12410 % $\pp^m(p)=\emptyset$, to obtain what $\pp^m(p)$ should have in
12411 % $\pp_{\mathit{new}}^m(p)=\!\reserved@a!$ in which $\mpb_X^x$ is replaced
12412 % with $M'$, where $X=L$ or $X=R$ if $c<\CL$ or not respectively, and $x=l$
12413 % or $x=r$ if $\CSIndex{if@firstcolumn}=\true$ or not respectively, and then
12414 % update $\pp^m(p)$ by $\!\pcol@defcurrpage!
12415 % \Arg{\pp^p(p)}\<\pp^i(p)\>\<\pp^f(p)\>\Arg{\pp^s(p)}
12416 % \Arg{\pp_{\mathit{new}}^m(q)}$.
12417 % 
12418 % \begin{macrocode}
12419 \def\pcol@setmpbelt#1#2#3#4#5{%
12420 {\let\@elt\relax \xdef\pcol@pages{\pcol@pages\pcol@currpage}}%
12421 \ifnum\@tempcnta=\z@
12422 \def\reserved@a{#5}%
12423 \ifx\reserved@a\@empty \pcol@setmpbelt@i{}{}{}{}\else \pcol@setmpbelt@i#5\fi
12424 \pcol@defcurrpage{#1}{#2}{#3}{#4}{\reserved@a}%
12425 \else \gdef\pcol@currpage{\@elt{#1}#2#3{#4}{#5}}%
12426 \fi
12427 \advance\@tempcnta\m@ne}
12428 \def\pcol@setmpbelt@i#1#2#3#4{%
12429 \ifnum\pcol@currcol<\pcol@ncolleft
12430 \if@firstcolumn \def\reserved@a{{\pcol@mpblist}{#2}{#3}{#4}}%
12431 \else \def\reserved@a{{#1}{\pcol@mpblist}{#3}{#4}}%
12432 \fi
12433 \else
12434 \if@firstcolumn \def\reserved@a{{#1}{#2}{\pcol@mpblist}{#4}}%
12435 \else \def\reserved@a{{#1}{#2}{#3}{\pcol@mpblist}}%
12436 \fi
12437 \fi}
12438
12439 % \end{macrocode}
12440 % \end{macro}\end{macro}
12441 %
12442 % \begin{macro}{\pcol@mparbottom@zero}
12443 % \changes{v1.3-4}{2013/09/17}
12444 % {Introduced to give the default of \cs{pcol@mparbottom@out}.}
12445 % \begin{macro}{\pcol@mparbottom@out}
12446 % \changes{v1.3-4}{2013/09/17}
12447 % {Introduced to keep the last elements of $\pi^m(p_t)$ at
12448 % \cs{end}\string\texttt{\char`\{paracol\char`\}.}}
12449 % 
12450 % The macro $\Uidx\mpboutz=\!\pcol@mparbottom@zero!$ is used in
12451 % \!\@outputpage!, \!\pcol@getmparbottom@last! and \!\pcol@output@end! to
12452 % give the default value of $\Uidx\mpbout=\!\pcol@mparbottom@out!$ with
12453 % $\mpar(0,0)$ for all elements $M\in\Set{\mpb_X^x}{X\in\{L,R\},x=\{l,r\}}$
12454 % to mean a page has no marginal notes carrying over from the preceding
12455 % \env{paracol} environments.
12456 %
12457 % As for $\mpbout$, besides the top level initialization to make it
12458 % $\mpboutz$, it is updated in \!\pcol@output@end! through macros
12459 % \!\pcol@getmparbottom@last! and \!\pcol@bias@mpbout! to have the last
12460 % element of each $M\in\Set{\mpb_X^x}{X\in\{L,R\},x=\{l,r\}}$ in
12461 % $\pp^m(\ptop)$ with transformation from coordinates of columns to that of
12462 % text area, or directly with $\mpboutz$ if the \lpage{} will not have
12463 % \postenv. The resulting $\mpbout$ is at first used in \!\pcol@output@end!
12464 % itself through \!\pcol@do@mpbout! to let \!\@mparbottom! have the value
12465 % $b$ of $\mpar(t,b)$ in $\mpb_L^l$ or $\mpb_L^r$ according to the side
12466 % margin which marginal notes in \postenv{} goes to.
12467 %
12468 % Then $\mpbout$ is passed to the next \env{paracol} environment if it
12469 % resides in the page where the previous environment also resides, to be
12470 % referred to by \!\pcol@output@start! which also performs
12471 % \!\pcol@do@mpbout! and \!\pcol@bias@mpbout! to let $\pp^m(0)$ have the
12472 % lists according to $\mpbout$ and $\!\@mparbottom!$ which can be modified
12473 % in \postenv{} of the previous environment or in other word
12474 % in \preenv{} of starting environment. By this setting of $\pp^m(0)$,
12475 % marginal note placement in the \spage{} is aware of the marginal notes
12476 % having been placed in previous environments and in \preenv{} and thus can
12477 % correctly examines if a marginal note to be added in a margin collide
12478 % the last one in the margin. On the other hand, if the \postenv{}
12479 % encounters a page break before a new environment starts, our own
12480 % \!\@outputpage! should be invoked at the page break to let
12481 % $\mpbout=\mpboutz$ because the marginal notes in previous environments do
12482 % not affect those in the new environment.
12483 %
12484 % Note that $\mpbout$ is also referred to and updated by
12485 % \!\pcol@do@mpb@all@i! and \!\pcol@do@mpb@all@ii! because they are used in
12486 % \!\pcol@bias@mpbout! and \!\pcol@getmparbottom@last! through
12487 % \!\pcol@do@mpb@all!.
12488 % 
12489 % \begin{macrocode}
12490 \gdef\pcol@mparbottom@zero{{\@elt{0}{0}}{\@elt{0}{0}}{\@elt{0}{0}}{\@elt{0}{0}}}
12491 \global\let\pcol@mparbottom@out\pcol@mparbottom@zero
12492
12493 % \end{macrocode}
12494 % \end{macro}\end{macro}
12495 %
12496 % \KeepSpace{2}
12497 % \begin{macro}{\pcol@do@mpbout}
12498 % \changes{v1.3-4}{2013/09/17}
12499 % {Introduced to do specified operations on $\string\cal{M}$ and its
12500 % element $M_L^x$ according to the side margin for marginal notes
12501 % outside \texttt{paracol} environments.}
12502 % \begin{macro}{\pcol@do@mpbout@i}
12503 % \changes{v1.3-4}{2013/09/17}
12504 % {Introduced to do specified operations on $\string\cal{M}$ and its
12505 % element $M_L^x$ according to the side margin for marginal notes
12506 % outside \texttt{paracol} environments.}
12507 % \begin{macro}{\pcol@do@mpbout@whole}
12508 % \changes{v1.3-4}{2013/09/17}
12509 % {Introduced to do a specified operation on $\string\cal{M}$.}
12510 % \begin{macro}{\pcol@do@mpbout@elem}
12511 % \changes{v1.3-4}{2013/09/17}
12512 % {Introduced to do a specified operation on an element $M_L^x$ in
12513 % $\string\cal{M}$.}
12514 % 
12515 % The macro \!\pcol@do@mpbout! is used in \!\pcol@output@start! and
12516 % \!\pcol@output@end! to perform operations specified by
12517 % \!\pcol@do@mpbout@whole! and \!\pcol@do@mpbout@elem!. The macro just
12518 % invokes \!\pcol@do@mpbout@i! giving it all
12519 % $M\in\Set{\mpb_X^x}{X\in\{L,R\},x\in\{l,r\}}$ by \!\expandafter!.
12520 %
12521 % Then \!\pcol@do@mpbout@i! determines the side margin $x\in\{l,r\}$ letting
12522 % $x=l$ iff $\CSIndex{if@mparswitch}=\true$, $\page(p)\bmod2=0$ and
12523 % $\CSIndex{if@reversemargin}=\false$, to invoke \!\pcol@do@mpbout@whole!
12524 % giving it all $M$ but $\mpb_L^x$ whose sole element $\mpar(t,b)$
12525 % may be modified by $\!\pcol@do@mpbout@elem!\!\@elt!\Arg{t}\Arg{b}$.
12526 %
12527 % In \!\pcol@output@start!, \!\pcol@do@mpbout@whole! is to \!\xdef!ine
12528 % $\mpbout$ with all $M$ and \!\pcol@do@mpbout@elem! is expanded to
12529 % $\mpar(0,B)$, where $B=\!\@mparbottom!$, regardless of $\mpb_L^x$ so that
12530 % it is replaced with $(\mpar(0,B))$ in the modified $\mpbout$ keeping other
12531 % elements unchanged. In \!\pcol@output@end!, \!\pcol@do@mpbout@whole! is
12532 % to throw all $M$ away into a \!\hbox! while \!\pcol@do@mpbout@elem! lets
12533 % $B=b$ so that the bottom of the last marginal note in the side margin
12534 % specified by $x$ is passed to \postenv{} through \!\@mparbottom!.
12535 % 
12536 % \begin{macrocode}
12537 \def\pcol@do@mpbout{\expandafter\pcol@do@mpbout@i\pcol@mparbottom@out}
12538 \def\pcol@do@mpbout@i#1#2#3#4{\@tempcnta\@ne
12539 \if@mparswitch \ifodd\c@page\else \@tempcnta\m@ne \fi\fi
12540 \if@reversemargin \@tempcnta-\@tempcnta \fi
12541 \ifnum\@tempcnta<\z@
12542 \pcol@do@mpbout@whole{\pcol@do@mpbout@elem#1}{#2}{#3}{#4}%
12543 \else
12544 \pcol@do@mpbout@whole{#1}{\pcol@do@mpbout@elem#2}{#3}{#4}%
12545 \fi}
12546
12547 % \end{macrocode}
12548 % \end{macro}\end{macro}\end{macro}\end{macro}
12549 %
12550 % \begin{macro}{\pcol@bias@mpbout}
12551 % \changes{v1.3-4}{2013/09/17}
12552 % {Introduced to perform coordinate transformation of the elements in
12553 % $\string\cal{M}$.}
12554 % \begin{macro}{\pcol@bias@mpbout@i}
12555 % \changes{v1.3-4}{2013/09/17}
12556 % {Introduced to perform coordinate transformation of the elements in
12557 % $\string\cal{M}$.}
12558 % 
12559 % The macro $\!\pcol@bias@mpbout!\Arg{y}$ is used in \!\pcol@output@start!
12560 % with $-y$ being the heigh-plus-depth of \preenv{}, in
12561 % \!\pcol@output@end! with $y$ being that of \spanning{} in the \lpage, and
12562 % in $\!\pcol@getmparbottom@last!\Arg{y}$ with its argument $y$. The macro
12563 % modifies $\mpar(t,b)$ in all $M\in\Set{\mpb_X^x}{X\in\{L,R\},x\in\{l,r\}}$
12564 % of $\mpbout$ so that they have $\mpar(t{+}y,b{+}y)$ for the transformation
12565 % from text area coordinates to columns in the first and third, while for
12566 % the reverse transformation in the second, by invoking \!\pcol@do@mpb@all!
12567 % giving it $\mpbout$ and letting \!\reserved@a! have
12568 % $\!\pcol@bias@mpbout@i!\Arg{y}$. That is,
12569 % $\!\pcol@bias@mpbout@i!\Arg{y}\!\@elt!\Arg{t}\Arg{b}\!\@nil!$ is then
12570 % invoked in \!\pcol@do@mpb@all@ii! with $t$ and $b$ from $\mpar(t,b)$ in
12571 % each $M$, and then it \!\def!ines \!\reserved@b! with $\mpar(t{+}y,b{+}y)$
12572 % so that updated $M$ has it.
12573 % 
12574 % \begin{macrocode}
12575 \def\pcol@bias@mpbout#1{\def\reserved@a{\pcol@bias@mpbout@i{#1}}%
12576 \pcol@do@mpb@all\pcol@mparbottom@out}
12577 \def\pcol@bias@mpbout@i#1\@elt#2#3\@nil{%
12578 \dimen@#2sp\relax \advance\dimen@#1\relax
12579 \dimen@ii#3sp\relax \advance\dimen@ii#1\relax
12580 \def\reserved@b{\@elt{\number\dimen@}{\number\dimen@ii}}}
12581
12582 % \end{macrocode}
12583 % \end{macro}\end{macro}
12584 %
12585 % \begin{macro}{\pcol@getmparbottom@last}
12586 % \changes{v1.3-4}{2013/09/17}
12587 % {Introduced to let $\string\cal{M}$ have the occupancy information of
12588 % the bottom marginal note in each margin.}
12589 % \begingroup\let\small\footnotesize
12590 % \begin{macro}{\pcol@getmparbottom@last@i}
12591 % \changes{v1.3-4}{2013/09/17}
12592 % {Introduced to let $\string\cal{M}$ have the occupancy information of
12593 % the bottom marginal note in each margin.}
12594 % 
12595 % The macro $\!\pcol@getmparbottom@last!\Arg{y}$ is used solely in
12596 % \!\pcol@output@end! to let
12597 % $\mpbout=\Arg{m_L^l}\Arg{m_L^r}\Arg{m_R^l}\Arg{m_R^r}$, where
12598 % $m_X^x=\mpar(t_n,b_n)\in\mpb_X^x$, $n=\Abs{\mpb_X^x}$ assuming
12599 % $\mpar(t_0,b_0)={\mpar}(y,y)$, and $y$ is the negative counterpart of the
12600 % height-plus-depth of the \spanning{} in the \lpage. Therefore, $\mpbout$
12601 % is let have the occupancy information of the last marginal note if any, or
12602 % the top edge of text area otherwise, in each margin.
12603 %
12604 % The macro at first examines if $\pp^m(\ptop)=\emptyset$ and, if so, lets
12605 % all elements in $\mpbout$ have $(\mpar(y,y))$ by letting it $\mpboutz$ and
12606 % then adding $y$ to each $t=b=0$ by \!\pcol@bias@mpbout! giving it $y$.
12607 % Otherwise, i.e., if $\pp^m(\ptop)\neq\emptyset$, it invokes
12608 % \!\pcol@do@mpb@all! giving it $\pp^m(\ptop)$ and letting \!\reserved@a!
12609 % have $\!\pcol@getmparbottom@last@i!\Arg{y}$. That is,
12610 % $\!\pcol@getmparbottom@last@i!\Arg{y}\~\mpar(t_1,b_1)\cdots
12611 % \mpar(t_n,b_n)\!\@nil!$ is then invoked in \!\pcol@do@mpb@all@ii! for each
12612 % $\mpb_X^x$ to let \!\reserved@b! have $\mpar(y,y)$ at first and then to
12613 % let it have $\mpar(t_i,b_i)$ for all $i\in[1,n]$. Therefore,
12614 % \!\reserved@b! should finally have $\mpar(t_n,b_n)$ assuming $t_0=b_0=y$,
12615 % and then becomes $m_X^x$.
12616 % \end{macro}\endgroup
12617 % 
12618 % \begin{macrocode}
12619 \def\pcol@getmparbottom@last#1{%
12620 \ifx\pcol@mparbottom\@empty
12621 \global\let\pcol@mparbottom@out\pcol@mparbottom@zero
12622 \pcol@bias@mpbout{#1}%
12623 \else
12624 \def\reserved@a{\pcol@getmparbottom@last@i{#1}}%
12625 \pcol@do@mpb@all\pcol@mparbottom
12626 \fi}
12627 \def\pcol@getmparbottom@last@i#1#2\@nil{%
12628 \edef\reserved@b{\@elt{\number#1}{\number#1}}%
12629 \def\@elt##1##2{\def\reserved@b{\@elt{##1}{##2}}}%
12630 #2\let\@elt\relax}
12631
12632 % \end{macrocode}
12633 % \end{macro}
12634 %
12635 % \KeepSpace{1}
12636 % \begin{macro}{\pcol@do@mpb@all}
12637 % \changes{v1.3-4}{2013/09/17}
12638 % {Introduced to implement \cs{pcol@bias@mpbout} and
12639 % \cs{pcol@getmparbottom@last}.}
12640 % \begin{macro}{\pcol@do@mpb@all@i}
12641 % \changes{v1.3-4}{2013/09/17}
12642 % {Introduced to implement \cs{pcol@bias@mpbout} and
12643 % \cs{pcol@getmparbottom@last}.}
12644 % \begin{macro}{\pcol@do@mpb@all@ii}
12645 % \changes{v1.3-4}{2013/09/17}
12646 % {Introduced to implement \cs{pcol@bias@mpbout} and
12647 % \cs{pcol@getmparbottom@last}.}
12648 % 
12649 % The macro $\!\pcol@do@mpb@all!\<L\>$ is used in \!\pcol@bias@mpbout! with
12650 % $L=\mpbout$ and in \!\pcol@getmparbottom@last! with $L=\pp^m(\ptop)$, to
12651 % process all four elements $\mpb_X^x$ in $L$ applying \!\reserved@a! to
12652 % each of them and to let $\mpbout$ have the result through \!\reserved@b!.
12653 % The macro simply invokes \!\pcol@do@mpb@all@i! giving it the body of $L$
12654 % by \!\expandafter!. Then $\!\pcol@do@mpb@all@i!
12655 % \Arg{\mpb_L^l}\Arg{\mpb_L^r}\Arg{\mpb_R^l}\Arg{\mpb_R^r}$ initialize
12656 % $\mpbout=\emptyset$ and then invokes \!\pcol@do@mpb@all@ii! four times
12657 % giving it each $\mpb_X^x$. Then
12658 % $\!\pcol@do@mpb@all@ii!\,\mpar(t_1,b_1)\cdots\~{\mpar}(t_n,b_n)\!\@nil!$
12659 % invokes \!\reserved@a! giving it all of $\mpar(t_i,b_1)$ at once to
12660 % process them and to have the result in \!\reserved@b! being added to
12661 % $\mpbout$.
12662 % 
12663 % \begin{macrocode}
12664 \def\pcol@do@mpb@all#1{\expandafter\pcol@do@mpb@all@i#1}
12665 \def\pcol@do@mpb@all@i#1#2#3#4{\begingroup \let\@elt\relax
12666 \gdef\pcol@mparbottom@out{}%
12667 \pcol@do@mpb@all@ii#1\@nil\pcol@do@mpb@all@ii#2\@nil
12668 \pcol@do@mpb@all@ii#3\@nil\pcol@do@mpb@all@ii#4\@nil
12669 \endgroup}
12670 \def\pcol@do@mpb@all@ii#1\@nil{%
12671 \reserved@a#1\@nil
12672 \xdef\pcol@mparbottom@out{\pcol@mparbottom@out{\reserved@b}}}
12673
12674 % \end{macrocode}
12675 % \end{macro}\end{macro}\end{macro}
12676 %
12677 %
12678 %
12679 % \subsection{Synchronization}
12680 % \label{sec:imp-sout-sync}
12681 %
12682 % \begin{macro}{\pcol@sync}
12683 % \changes{v1.0}{2011/10/10}
12684 % {Add measurement of $D_T$.}
12685 % \changes{v1.2-3}{2013/05/11}
12686 % {Modify the action on the page overflow to return from \cs{output}
12687 % without flushing so that the page is broken outside \cs{output} to
12688 % place top floats above the synchronization point set in the next
12689 % page.}
12690 % \changes{v1.2-2}{2013/05/11}
12691 % {Revise reflecting the redesign of page context.}
12692 % \changes{v1.2-2}{2013/05/11}
12693 % {Add pre-flushing column height check taking page-wise
12694 % footnotes into account.}
12695 % \changes{v1.3-6}{2013/09/17}
12696 % {Add the initialization of
12697 % $\cs{ifpcol@dfloats}\EQ\string\mathit{false}$ before invoking
12698 % \cs{pcol@measurecolumn}.}
12699 % 
12700 % The macro \!\pcol@sync! is invoked solely from \!\pcol@output@switch! for
12701 % \exsync{} in the following three cases in which
12702 % $\CSIndex{ifpcol@sync}\lor\CSIndex{ifpcol@clear}=\true$ commonly.
12703 % 
12704 % \begin{itemize}
12705 % \item
12706 % $\CSIndex{ifpcol@sync}\land\lnot\CSIndex{ifpcol@clear}$ to mean ordinary
12707 % \sync{}ed \cswitch.
12708 %
12709 % \item
12710 % $\CSIndex{ifpcol@sync}\land\CSIndex{ifpcol@clear}$ to mean \pfcheck.
12711 %
12712 % \item
12713 % $\lnot\CSIndex{ifpcol@sync}\land\CSIndex{ifpcol@clear}$ to mean page
12714 % flushing.
12715 % \end{itemize}
12716 % 
12717 % In any cases\footnote{
12718 % 
12719 % In the last case of page flushing, invoking \!\pcol@flushcolumn! is
12720 % redundant because it is made $p=\ptop$ by \pfcheck{} always preceding the
12721 % flushing, but the invocation is harmless.},
12722 % 
12723 % first we invoke \!\pcol@flushcolumn! for all $c\In0\C$ to flush the
12724 % \ccolpage{} of $c$ into $\S_c$ if the \colpage{} is not in $\ptop$, i.e.,
12725 % $\cc_c(\vb^p)<\ptop$ and then, if we have deferred floats, to ship out
12726 % following \fpage{}s up to $\ptop-1$ into $\S_c$ and to place them in
12727 % $\ptop$. This float placement in $\ptop$ is only for top and bottom
12728 % floats in \sync{}ed \cswitch{}, while a \fcolumn{} may be made in other
12729 % cases. Then we ship out all pages $p$ such that $p<\ptop$ by
12730 % \!\pcol@outputcolumns! giving argument 1. After that, we obtain the
12731 % \pctext{} of $\ptop$ by \!\pcol@getcurrpinfo!.
12732 %
12733 % Next, we measure the vertical sizes of the contents in the \ccolpage{} of
12734 % $c$ which is now in $\ptop$ for all $c\In0\C$ by \!\pcol@measurecolumn! as
12735 % follows, where $h(x)$ and $d(x)$ are the height and depth of an object $x$
12736 % respectively.
12737 % 
12738 % \begin{eqnarray*}
12739 % \sigma&=&\rlap{\!\floatsep!}\hskip8em
12740 % \sigma_t=\cases{\cc_c(\tf)& $\cc_c(\tf)<\infty$\cr
12741 % \!\textfloatsep!&$\cc_c(\tf)=\infty$}\qquad
12742 % \sigma_b=\!\textfloatsep!\\
12743 % \Uidx\fc(t)&=&\rlap{$\displaystyle(\cc_c(\tl)\neq())$}\hskip8em
12744 % \fc(m)=(\cc_c(\vb)\neq\!\vbox!|{}|)\\
12745 % \fc(f)&=&\rlap{$\displaystyle(\cc_c(\ft)\neq\bot)$}\hskip8em
12746 % \fc(b)=\fc(b')=(\cc_c(\bl)\neq())\\
12747 % \Uidx\Fc(X)&=&\rlap{$\displaystyle\exists x\in X:\fc(x)$}\hskip8em
12748 % f_b=\CSIndex{ifpcol@bfbottom}\\
12749 % \Uidx\vc(t)&=&\!\skip!{\cdot}\cc_c(\vb)=
12750 % \sum_{\Sub{\phi\in\cc_c(\tl)}}(h(\phi)+d(\phi))+
12751 % (\Abs{\cc_c(\tl)}-1)\cdot\sigma+\sigma_t\\
12752 % \vc(m)&=&h(\cc_c(\vb))+d(\cc_c(\vb))\\
12753 % \vc(f)&=&h(\cc_c(\ft))+d(\cc_c(\ft))\\
12754 % \vc(b)&=&\sum_{\Sub{\phi\in\cc_c(\bl)}}(h(\phi)+d(\phi))+
12755 % (\Abs{\cc_c(\bl)}-1)\cdot\sigma+\sigma_b\\
12756 % \vc(b')&=&\vc(b)+\sigma_b\\
12757 % \pd_c&=&\cases{\cc_c(\pd)&$\fc(m)$\cr
12758 % \infty &$\lnot \fc(m)$}\\
12759 % \Uidx\size_c(x)&=&\cases{\vc(x)&$\fc(x)$\cr
12760 % 0 &$\lnot \fc(x)$}\\
12761 % \Uidx\Size_c(X)&=&\cases{\displaystyle\sum_{x\in X}\size_c(x)&$\Fc(X)$\cr
12762 % -\infty& $\lnot \Fc(X)$}\\
12763 % \Uidx\VT&=&\!\@tempdima!=\max_{0\leq c<\C}\{\Size_c(\{t,m\})\}\\
12764 % \Uidx\VB&=&\!\@tempdimb!=\max_{0\leq c<\C}\{\size_c(f)+\size_c(b)\}\\
12765 % \Uidx\VP&=&\!\@pageht!=\max_{0\leq c<\C}\{\Size_c(\{t,m,f,b\})\}\\
12766 % \Uidx\VPP&=&\!\pcol@colht!=\max_{0\leq c<\C}\{\Size_c(\{t,m,f,b'\})\}\\
12767 % \Uidx\DT&=&\!\@tempdimc!=\min\Set{\pd_c}{\Size_c{\{t,m\}=\VT}}\\
12768 % \Uidx\dc&=&\cases{
12769 % 0& $\fc(b)\land(\lnot \fc(f)\lor f_b)$\cr
12770 % d(\cc_c(\ft))& $\fc(f)\land(\lnot \fc(b)\lor\lnot f_b)$\cr
12771 % d(\cc_c(\pd))& $\lnot \fc(b)\land\lnot \fc(f)$}\\
12772 % \Uidx\DP&=&\!\@pagedp!=\min\Set{\dc}{\Size_c(\{t,m,f,b'\})=\VPP}\\
12773 % \Uidx\cmax&=&\!\@tempcntb!=\ARG\max_{0\leq c<\C}\{\Size_c(\{t,m,f,b\})\}
12774 % \end{eqnarray*}
12775 % 
12776 % That is, $\VT$ is the maximum of combined vertical size (height plus
12777 % depth) of the top floats and the main vertical list, $\VB$ is that of
12778 % the footnotes and bottom floats, and $\VP$ is that of all items.
12779 % $\VPP$ is similar to $\VP$ but we add \!\textfloatsep! to the size of
12780 % bottom floats. Note that $\VT$, $\VP$ and $\VPP$ are $-\infty$ if any
12781 % \colpage{}s don't have corresponding items, while $\VB=0$ if so.
12782 % Also note that $\cmax$ is the ordinal of the column whose size is $\VP$.
12783 %
12784 % $\DT$ and $\DP$ are the minimum $\pd_c$ and $\dc$ respectively among those
12785 % gives $\VT$ and $\VPP$ respectively, where $\pd_c$ is $\cc_c(\pd)$ if
12786 % $f_m=\true$ or $\infty$ otherwise, and $\dc$ is 0 if $c$ has bottom float,
12787 % or the depth of the last footnote if any and without any bottom float, or
12788 % $\cc_c(\pd)$ otherwise. The reason why $\DT$ and $\DP$ have minimums is
12789 % that they are set into \!\prevdepth! for the items just following the
12790 % \sync{}ation point, and thus a smaller value results in a larger interline
12791 % skip and the special value $-1000\,|pt|$ to inhibit the skip by, e.g.,
12792 % \!\nointerlineskip!, is given the highest priority.
12793 %
12794 % Note that $\VPP$ and $\DP$ are only for the \lpage{} and thus referred to
12795 % by \!\pcol@output@end! to close the environment, and the former is done by
12796 % \!\pcol@makeflushedpage! if it works on the page. The reason why we add
12797 % \!\textfloatsep! to $\VPP$ is to make the last page well separated from
12798 % the \postenv{} if the tallest column, taking the addition into account,
12799 % has bottom floats. Also note that we let
12800 % $\CSIndex{ifpcol@dfloats}=\false$ before scanning columns with
12801 % \!\pcol@measurecolumn! so that the switch becomes $\true$ after the scan
12802 % iff a column has deferred floats (in the \lpage{}).
12803 % 
12804 % \begin{macrocode}
12805 %% Special Output Routines: Synchronization
12806
12807 \def\pcol@sync{%
12808 \pcol@currcol\z@ \@whilenum\pcol@currcol<\pcol@ncol\do\pcol@flushcolumn
12809 \pcol@outputcolumns\@ne
12810 \pcol@getcurrpinfo{\global\c@page}{\global\@colht}{\global\topskip}%
12811 \@tempdima-\maxdimen \@tempdimb-\maxdimen \pcol@colht-\maxdimen
12812 \@pageht-\maxdimen \@tempdimc\maxdimen \@pagedp\maxdimen \@tempcntb\z@
12813 \pcol@dfloatsfalse
12814 \pcol@currcol\z@ \@whilenum\pcol@currcol<\pcol@ncol\do\pcol@measurecolumn
12815 % \end{macrocode}
12816 %
12817 % As described above, any items can be empty, naturally for top floats,
12818 % footnotes and bottom floats, but also including main vertical lists if the
12819 % \ccolpage{}s were not in $\ptop$ before the invocation of
12820 % \!\pcol@flushcolumn!. Moreover, all main vertical lists can be empty if
12821 % all \lcolpage{}s just have started (by \!\newpage!, for example). More
12822 % weirdly, the case of all-empty main vertical lists can be accompanied with
12823 % other non-empty items when columns have floats or footnotes which cannot
12824 % be in $\ptop-1$ but are found their places in $\ptop$.
12825 %
12826 % Taking it into account that any items can be empty and the other item
12827 % of \Scfnote{}s, we have to determine whether the following two operations
12828 % are taken; invocation of \!\pcol@synccolumn! for each \colpage{} to set a
12829 % \sync{}ation point or to add an infinite stretch (and shrink) to its
12830 % bottom; and the examination of the height of each \colpage{}, taking the
12831 % \sync{}ation point to be set into account, to tell the necessity of
12832 % explicit page break with $\CSIndex{ifpcol@flush}=\true$. For the latter
12833 % we calculate the examination target $V=\!\@tempdimb!$ to be compared with
12834 % $\pp^h(\ptop)$, while for the former we determine the value of a switch
12835 % $f=\CSIndex{if@tempswa}$ so that we invoke \!\pcol@synccolumn! iff
12836 % $f=\true$ and $V\geq0$.
12837 %
12838 % For \sync{}ed \cswitch{} with $\CSIndex{ifpcol@clear}=\false$, we let
12839 % $f=(\VT\geq0)$ to mean at least one \colpage{} has a top float or
12840 % non-empty main vertical list, i.e., $\Fc(\{t,m\})={\true}$ for some
12841 % $c\In0\C$. That is if $\VT<0$, since the next items added to all
12842 % \colpage{}s are placed at the top of the page\footnote{
12843 % 
12844 % In usual cases, but it can mean some of them have negative vertical
12845 % sizes. Even though we can detect such a very unlikely special case, it is
12846 % very tough to define the reasonable \sync{}ation point above the top of
12847 % $\ptop$. Therefore, we assume the point is at the top of $\ptop$ and thus
12848 % do nothing.},
12849 % 
12850 % we don't need to set \sync{}ation points in them. As for $V$, we let
12851 % $V=\max(\VT,0)+\max(\VB,0)+v^f$ where $v^f$ is the sum of
12852 % height-plus-depth of $\pp^f(\ptop)$ and $\!\skip!{\cdot}\pp^f(\ptop)$ if
12853 % $\ptop$ has \Scfnote{}s, or 0 otherwise\footnote{
12854 % 
12855 % In the real implementation, $V=-\infty$ if $\VT=\VB=-\infty$ and no
12856 % \Scfnote{}s are presented, but this difference does not affect the
12857 % decisions because $f\land(V\geq0)=(\VT<0)\land(V\geq0)=\false$ and
12858 % $V\leq\pp^f(\ptop)$ with either $V=0$ or $V=-\infty$.}.
12859 % 
12860 % Note that it can be $\VP+v^f\leq\pp^h(\ptop)<\VT+\VB+v^f=V$ to mean
12861 % setting the \sync{}ation point at $\VT$ below $\ptop$'s top edge would
12862 % push bottom stuff beyond its bottom edge and thus we need an explicit page
12863 % break to place the point at the top of $\ptop+1$ (in usual cases).
12864 %
12865 % For \pfcheck{} or page flushing with $\CSIndex{ifpcol@clear}=\true$ on
12866 % the other hand, we let $f=\lnot\!\pcol@sync!$ to invoke \!\pcol@synccolumn!
12867 % only for page flushing and thus not for \pfcheck{}. As for $V$, we let
12868 % $V'=\VPP$ or $V'=\VP$ according as we working on \lpage{} or not, and
12869 % then let $V=\max(V',0)+v^f$ or $V=V'$ according as $\ptop$ has \Scfnote{}s
12870 % or not. That is, we have to invoke \!\pcol@synccolumn! unless $\ptop$ is
12871 % perfectly empty.
12872 %
12873 % Then if $\CSIndex{ifpcol@clear}=\false$ and
12874 % $\max(V,\;V-D'_T+\VE)>\pp^h(\ptop)$ where $D'_T=\DT$ if $0\leq\DT<\infty$ or
12875 % 0 otherwise, or $\CSIndex{ifpcol@clear}=\true$ and
12876 % $V>\pp^h(\ptop)$\footnote{
12877 % 
12878 % The examination is redundant in page flushing with
12879 % $\CSIndex{ifpcol@sync}=\false$ because it is assured that no overflow
12880 % happens in any \colpage{} by \pfcheck{} and explicit page breaking, but is
12881 % not harmful.},
12882 % 
12883 % we flush the page. That is, if the condition above holds,
12884 % we let $\CSIndex{ifpcol@flush}=\true$ and $d=\!\pcol@nextcol!={\cmax}$ to
12885 % tell \!\pcol@switchcol! or \!\pcol@flushclear! to make an explicit page
12886 % break in the column $\cmax$ from which we restart, and $f=\false$ to skip
12887 % \!\pcol@synccolumn! to postpone the \exsync{}. Note that the bias
12888 % $\VE=\!\pcol@@ensurevspace!$ in \sync{}ed \cswitch{} is to avoid breaking a
12889 % \colpage{} just below the \sync{}ation point due to too small space below
12890 % the point, less than \!\baselineskip! in default but can be other
12891 % threshold explicitly defined by \!\ensurevspace!. That is,
12892 % since $V-\DT+k\!\baselineskip!$ usually means the vertical position at
12893 % which $k$-th baseline below the \sync{}ation point is placed, the flushing
12894 % condition with $\VE=k\!\baselineskip!$ ensures that the page is flushed
12895 % iff the space below the point cannot accommodate $k$ lines. Also note that
12896 % necessary flushing with $V>\pp^h(p)$ assuredly takes place even when
12897 % $\DT$ is unusually large and/or $\VE$ is negative to make $-\DT+\VE<0$.
12898 %
12899 % Finally if $V\geq0$ and $f=\true$, we invoke \!\pcol@synccolumn! for each
12900 % column $c\In0\C$ to set a \sync{}ation point in it or to add an infinite
12901 % stretch (and shrink) at its bottom for flushing.
12902 % 
12903 % \changes{v1.3-6}{2013/09/17}
12904 % {Modify the flushing condition of synchronized column switching from
12905 % $V\GT\pi^h(p)$ to $\max(V,V-D_T+V_E)\GT\pi^h(p)$ to avoid page
12906 % break just below the synchronization point as much as possible.}
12907 % 
12908 % \begin{macrocode}
12909 \@tempswatrue \global\pcol@flushfalse
12910 \ifpcol@clear
12911 \ifpcol@lastpage \@tempdimb\pcol@colht \else \@tempdimb\@pageht \fi
12912 \ifpcol@sync \@tempswafalse \fi
12913 \else
12914 \ifdim\@tempdima<\z@ \@tempswafalse
12915 \else\ifdim\@tempdimb<\z@ \@tempdimb\@tempdima
12916 \else \advance\@tempdimb\@tempdima
12917 \fi\fi
12918 \fi
12919 \ifpcol@scfnote\ifvoid\pcol@footins\else
12920 \ifdim\@tempdimb<\z@ \@tempdimb\z@ \fi
12921 \advance\@tempdimb\ht\pcol@footins \advance\@tempdimb\dp\pcol@footins
12922 \advance\@tempdimb\skip\pcol@footins
12923 \fi\fi
12924 \dimen@\@tempdimb
12925 \ifpcol@clear\else \ifdim\dimen@<\z@\else
12926 \ifdim\@tempdimc=\maxdimen\else \ifdim\@tempdimc<\z@\else
12927 \advance\dimen@-\@tempdimc
12928 \fi\fi
12929 \advance\dimen@\pcol@@ensurevspace
12930 \ifdim\dimen@<\@tempdimb \dimen@\@tempdimb \fi
12931 \fi\fi
12932 \ifdim\dimen@>\@colht
12933 \global\pcol@flushtrue \@tempswafalse \pcol@nextcol\@tempcntb
12934 \fi
12935 \ifdim\@tempdimb<\z@\else \if@tempswa
12936 \pcol@currcol\z@ \@whilenum\pcol@currcol<\pcol@ncol\do\pcol@synccolumn
12937 \fi\fi}
12938
12939 % \end{macrocode}
12940 % \end{macro}
12941 %
12942 % \begin{macro}{\pcol@flushcolumn}
12943 % \changes{v1.0}{2011/10/10}
12944 % {Rename \cs{pcol@maxpage} as \cs{pcol@toppage}.}
12945 % \changes{v1.0}{2011/10/10}
12946 % {Add \cs{vfil} at the bottom of flushed column-page.}
12947 % \changes{v1.0}{2011/10/10}
12948 % {Change order of the garbage collection of \cs{pcol@currfoot} and
12949 % \cs{pcol@getcurrfoot}.}
12950 % \changes{v1.2-2}{2013/05/11}
12951 % {Revise reflecting the redesign of \cs{pcol@getcurrfoot}.}
12952 % \changes{v1.2-2}{2013/05/11}
12953 % {Add operations for page-wise footnotes.}
12954 % \changes{v1.2-2}{2013/05/11}
12955 % {Add the examination of $\kappa_c(\rho)\EQ\infty$ to cope with a
12956 % rare-case interaction of pre-flushing column height check and float
12957 % columns in last pages.}
12958 % \changes{v1.2-7}{2013/05/11}
12959 % {Save \cs{ifpcol@lastpage} into \cs{ifpcol@lastpagesave} and turn
12960 % \cs{ifpcol@lastpage} $\string\mathit{false}$ temporarily during
12961 % the macro works on non-top and thus non-last pages to fix the bug
12962 % that \cs{@makecol} and \cs{pcol@makefcolumn} misunderstand the page
12963 % they work on is last.}
12964 % \changes{v1.2-7}{2013/05/11}
12965 % {Replace \cs{@makecol} with \cs{pcol@@makecol} to cap the depth of
12966 % \cs{@outputbox} by \cs{@maxdepth} even with p\string\LaTeX.}
12967 % \changes{v1.21}{2013/06/06}
12968 % {Add page and column numbers to logging.}
12969 % \changes{v1.3-6}{2013/09/17}
12970 % {Fix the problem that a flushed column in a non-top page causes
12971 % overfull due to its hight-plus-depth greater than $\pi^h(p)$.}
12972 % \changes{v1.3-3}{2013/09/17}
12973 % {Add \cs{@colht} and \cs{relax} as the first and third argument
12974 % of \cs{pcol@shrinkcolbyfn} for all of three invocations of it.}
12975 % \changes{v1.3-6}{2013/09/17}
12976 % {Add \cs{@maxdepth} as the first argument of \cs{pcol@@makecol}.}
12977 % \changes{v1.32-2}{2015/10/10}
12978 % {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
12979 % 
12980 % The macro \!\pcol@flushcolumn! is invoked for each column $c\In0\C$ from
12981 % \!\pcol@sync! to ship out the \ccolpage{} of $c$ into $\S_c$ if it is not
12982 % leading one\Index{leading column-page}, i.e., $p=\cc_c(\vb^p)<\ptop$. The
12983 % macro also ships out \fpage{}s from $p+1$ up to $\ptop-1$ if we have
12984 % deferred floats to fill them and, if this float flushing still leaves
12985 % deferred floats, puts some of them to the \lcolpage{} being
12986 % current\Index{current column-page}{} now as its top and/or bottom floats.
12987 %
12988 % First we obtain the \cctext{} in $\cc_c$ by \!\pcol@getcurrcol! and
12989 % examines if $p=\cc_c(\vb^p)<\ptop$. If it does not hold to mean $c$ has
12990 % \lcolpage{}, we do nothing.
12991 %
12992 % Otherwise, we save \CSIndex{ifpcol@lastpage} into
12993 % \CSIndex{ifpcol@lastpagesave} turning the former switch $\false$ because we
12994 % are working on a non-\lcolpage{} definitely in a non-\lpage. Then we put
12995 % the contents of the \ccolpage{} $\cc_c(\vb^b)$ adding \!\vfil! at its tail
12996 % into \!\box!|255| being the \TeX's standard interface to carry the main
12997 % vertical list for \!\output! routine. We also move everything in
12998 % $\cc_c(\ft)$ obtained by \!\pcol@getcurrfoot! into \!\footins! and return
12999 % $\cc_c(\ft)$ to \!\@freelist! if $\cc_c(\ft^b)$ is not void.
13000 %
13001 % Then we obtain $p$'s \pctext{} by \!\pcol@getcurrpage! and, if it has
13002 % \Scfnote{}s in $\pp^f(p)$, we shrink \!\@colht! by the space required for
13003 % the footnotes using \!\pcol@shrinkcolbyfn! and add the stretch\slash
13004 % shrink components of $\!\skip!\cdot\pp^f(p)$ at the bottom of
13005 % \!\box!|255| by \!\pcol@unvbox@cclv!, as we did in \!\pcol@makecol!.
13006 % Otherwise we take a special care of the case that the height-plus-depth of
13007 % $\cc_c(\vb^b)$ is greater than $\pp^h(p)$ due to that its height is almost
13008 % equal to $\pi^h(p)$ and thus its depth makes the hight-plus-depth
13009 % exceeding $\pi^h(p)$. This excess is revealed by the \!\vfil! we just
13010 % have added making the height-plus-depth the height of \!\box!|255|, and
13011 % would cause overfull in \!\@makecol! and \!\pcol@@makecol! because they
13012 % need the height, i.e., not height-plus-depth, of \!\box!|255| not
13013 % exceeding $\pp^h(p)$. Therefore if it happens, we we remove the \!\vfil!
13014 % and cap the height of \!\box!|255| by \!\@maxdepth! to pretend as if the
13015 % box is directly passed from \TeX's page builder.
13016 %
13017 % Next we examine if $\cc_c(\tr)$ was made $\infty$ by \!\pcol@makefcolumn!
13018 % invoked from this macro itself when it processed the \colpage{} in the
13019 % previous \pfcheck{} for environment closing, which found a page break
13020 % should be done. That is, $\cc_c(\tr)=\infty$ means the \ccolpage{} was
13021 % once judged to be in the \lpage{} but \pfcheck{} forced a page break to
13022 % make it non-last, it should have all deferred floats now listed in
13023 % $\cc_c(\tl)$ at \Endparacol{}, but their total size is less than the
13024 % threshold to make a usual \fcolumn{} for the \lpage. If so, since the page
13025 % is not last now, we put all floats in $\cc_c(\tl)$ by \!\pcol@makefcolpage!
13026 % as the ship-out image in \!\@outputbox!, ignoring the contents added to
13027 % \!\box!|255| in the operations above because $\cc_c(\vb^b)$ should be
13028 % empty, and letting $\cc_c(\tr)=0$ to mean the floats have been
13029 % processed\footnote{
13030 % 
13031 % $\cc_c(\tl)$ can have any values other than $\infty$ because definitely it
13032 % will not be referred to in its inherent sense in the situation with no
13033 % further float additions and no deferred floats.}.
13034 %
13035 % Otherwise, since the \colpage{} can be put as usual, we invoke
13036 % \!\pcol@@makecol!\footnote{
13037 % 
13038 % Neither \cs{pcol@makecol} because \!\box!\texttt{255} has \!\vfil! at its
13039 % tail and the \colpage{} should be short enough, nor \cs{@makecol} because
13040 % we need to ensure the depth of resulting \cs{@outputbox} is capped.}
13041 % 
13042 % giving \!\@maxdepth! to it to build the complete \colpage{} in
13043 % \!\@outputbox! with depth capping and with the following setting\footnote{
13044 % 
13045 % \LaTeX's has another \!\insert! named \!\@kludgeins! for \!\enlargepage!
13046 % but \Paracol{} does not cares about it.}.
13047 % $$
13048 % \begin{array}{lll}
13049 % \!\box!|255|=\cc_c(\vb^b)&
13050 % \!\footins!=\cc_c(\ft)&
13051 % \!\@colht!=\pp^h(\cc_c(\vb^p))\\
13052 % \!\@midlist!=\cc_c(\ml)&
13053 % \!\@toplist!=\cc_c(\tl)&
13054 % \!\@botlist!=\cc_c(\bl)
13055 % \end{array}
13056 % $$
13057 % Finally, regardless of $\cc_c(\tr)=\infty$ or not, the resulting
13058 % \!\@outputbox! becomes $\s_c(p)$ and is added to the tail of $\S_c$
13059 % by \!\@cons!.
13060 % 
13061 % \begin{macrocode}
13062 \def\pcol@flushcolumn{%
13063 \pcol@getcurrcol
13064 \ifnum\count\@currbox<\pcol@toppage
13065 \ifpcol@lastpage \pcol@lastpagesavetrue \else \pcol@lastpagesavefalse \fi
13066 \pcol@lastpagefalse
13067 \pcol@page\count\@currbox
13068 \setbox\@cclv\vbox{\unvbox\@currbox \vfil}%
13069 \ifvoid\pcol@currfoot\else
13070 \pcol@Fb
13071 \@cons\@freelist\pcol@currfoot
13072 \pcol@Fe{flushcolumn(colfn)}%
13073 \fi
13074 \pcol@getcurrfoot\box
13075 \pcol@getcurrpage
13076 \ifvoid\pcol@footins
13077 \ifdim\ht\@cclv>\@colht
13078 \setbox\@cclv\vbox{\boxmaxdepth\@maxdepth \unvbox\@cclv \unskip}%
13079 \fi
13080 \else
13081 \pcol@shrinkcolbyfn\@colht\pcol@footins\relax
13082 \setbox\@cclv\vbox{\pcol@unvbox@cclv\pcol@footins}%
13083 \fi
13084 \pcol@Logstart{\pcol@flushcolumn(\number\c@page:\number\pcol@currcol)}
13085 \ifdim\@toproom=\maxdimen
13086 \setbox\@outputbox\pcol@makefcolpage \global\@toproom\z@
13087 \else
13088 \pcol@@makecol\@maxdepth
13089 \fi
13090 \pcol@Logend\pcol@flushcolumn
13091 \global\setbox\@currbox\box\@outputbox
13092 \expandafter\@cons\csname pcol@shipped\number\pcol@currcol\endcsname
13093 \@currbox
13094 % \end{macrocode}
13095 %
13096 % Then for each $q\in[p{+}1,\ptop{-}1]$, we repeat the followings; get $q$'s
13097 % \pctext{} by \!\pcol@getcurrpage!; shrink \!\@colht! by
13098 % \!\pcol@shrinkcolbyfn! if $q$ has \Scfnote{}s; try to make a \fcolumn{} in
13099 % \!\@outputbox! by \!\@makefcolumn! giving it \!\@deferlist! being
13100 % $\cc_c(\dl)$ at initial but will be shrunk; if the \fcolumn{} is made,
13101 % acquire an \!\insert! by \!\@next! to keep the contents of \!\@outputbox!
13102 % and to be added to the tail of $\S_c$ by \!\@cons!.
13103 % 
13104 % \changes{v1.2-2}{2013/05/11}
13105 % {Add \cs{@colht} shrinking by page-wise footnotes.}
13106 % \changes{v1.32-2}{2015/10/10}
13107 % {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
13108 % 
13109 % \begin{macrocode}
13110 \advance\pcol@page\@ne
13111 \ifx\@deferlist\@empty\else
13112 \@whilenum\pcol@page<\pcol@toppage\do{%
13113 \pcol@getcurrpage
13114 \ifvoid\pcol@footins\else
13115 \pcol@shrinkcolbyfn\@colht\pcol@footins\relax
13116 \fi
13117 \@makefcolumn\@deferlist
13118 \if@fcolmade
13119 \pcol@Fb
13120 \@next\@currbox\@freelist{\global\setbox\@currbox\box\@outputbox}%
13121 \pcol@ovf
13122 \pcol@Fe{flushcolumn(fcol)}%
13123 \expandafter\@cons
13124 \csname pcol@shipped\number\pcol@currcol\endcsname\@currbox
13125 \fi
13126 \advance\pcol@page\@ne}%
13127 \fi
13128 % \end{macrocode}
13129 %
13130 % Next, since we reach $\ptop$ and thus restore \CSIndex{ifpcol@lastpage}
13131 % from \CSIndex{ifpcol@lastpagesave} because the \tpage{} can be last.
13132 % Then we acquire the \ccolpage{} of $c$ which is now in $\ptop$ and thus
13133 % empty, by \!\@next!. Then we let $\!\@colht!=\!\@colroom!=\pp^h(\ptop)$
13134 % by \!\pcol@getcurrpinfo! but shrinking them by \!\pcol@shrinkcolbyfn! if
13135 % $\ptop$ has \Scfnote{}s, and reinitialize the float placement parameters by
13136 % \!\pcol@floatplacement!. Then, if $\cc_c(\dl)$ still has some floats,
13137 % we make a \fcolumn{} for some of them in the \tpage{} by
13138 % \!\pcol@makefcolumn! if $\CSIndex{ifpcol@clear}={}\true$ meaning flushing,
13139 % or try to move some of them to $\cc_c(\tl)=\!\@toplist!$ and/or
13140 % $\cc_c(\bl)=\!\@botlist!$ by \!\pcol@trynextcolumn! otherwise. Note that
13141 % since \!\@colroom! is used in \!\pcol@makefcolumn! as a working register,
13142 % we let $\!\@colroom!=\pp^h(\ptop)$ again after its invocation. After that
13143 % we save \cctext{} including those given by \!\pcol@floatplacement! and
13144 % modified by \!\pcol@makefcolumn! or \!\pcol@trynextcolumn! into $\cc_c$ by
13145 % \!\pcol@setcurrcolnf! because all footnotes are shipped out, and let
13146 % $\cc_c(\vb^p)=\ptop$. We also let $\cc_c(\vb^r)=\!\@colroom!$ possibly
13147 % modified by \!\pcol@trynextcolumn! but after canceling the shrinkage of
13148 % \!\@colht! due to \Scfnote{}s, i.e.,
13149 % $\cc_c(\vb^r)\gets\cc_c(\vb^r)+(H-H')$ where $H$ and $H'$ are \!\@colht!
13150 % before and after the shrinkage respectively.
13151 % 
13152 % \changes{v1.0}{2011/10/10}
13153 % {Add $\cs{@colht}\EQ\pi^h(p)$.}
13154 % \changes{v1.0}{2011/10/10}
13155 % {Replace \cs{pcol@trynextcolumn} with \cs{pcol@makefcolumn} for the
13156 % case of $\cs{ifpcol@clear}\EQ\mathit{true}$.}
13157 % \changes{v1.2-2}{2013/05/11}
13158 % {Revise reflecting the redesign of page context.}
13159 % \changes{v1.2-2}{2013/05/11}
13160 % {Add \cs{@colht} shrinking by page-wise footnotes.}
13161 % \changes{v1.2-7}{2013/05/11}
13162 % {Add the restore of \cs{ifpcol@lastpage} from
13163 % \cs{ifpcol@lastpagesave}.}
13164 % \changes{v1.21}{2013/06/06}
13165 % {Fix the bug that $\kappa_c(\beta^p)$ is let have \cs{pcol@page},
13166 % which can be less than $p_t\EQ\cs{pcol@toppage}$, to cause the column
13167 % $c$ is lost or moved to a wrong page.}
13168 % \changes{v1.32-2}{2015/10/10}
13169 % {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
13170 % 
13171 % \begin{macrocode}
13172 \ifpcol@lastpagesave \pcol@lastpagetrue \fi
13173 \pcol@Fb
13174 \@next\@currbox\@freelist{\global\setbox\@currbox\vbox{}}\pcol@ovf
13175 \pcol@Fe{flushcolumn(col)}%
13176 \pcol@getcurrpinfo\@tempcnta{\global\@colht}\@tempskipa
13177 \@pageht\@colht
13178 \ifvoid\pcol@footins\else \pcol@shrinkcolbyfn\@colht\pcol@footins\relax \fi
13179 \global\@colroom\@colht \pcol@floatplacement
13180 \ifx\@deferlist\@empty\else
13181 \ifpcol@clear
13182 \pcol@makefcolumn \global\@colroom\@colht
13183 \else
13184 \pcol@trynextcolumn
13185 \fi\fi
13186 \pcol@setcurrcolnf
13187 \global\count\@currbox\pcol@toppage
13188 \advance\@pageht-\@colht \advance\@pageht\@colroom
13189 \global\dimen\@currbox\@pageht
13190 \fi %\ifnum\count\@currbox<\pcol@toppage
13191 \advance\pcol@currcol\@ne}
13192
13193 % \end{macrocode}
13194 % \end{macro}
13195 %
13196 % \begin{macro}{\pcol@makefcolumn}
13197 % \changes{v1.0}{2011/10/10}
13198 % {Introduced to take special care of the float-column in the last
13199 % page. }
13200 % \changes{v1.2-2}{2013/05/11}
13201 % {Encapsulate the float column in a \cs{vbox} of \cs{@colht} so that
13202 % vertical skips at the top and bottom are not lost when the column
13203 % is put back to the main vertical list, and makes the assignment to
13204 % \cs{@currbox} global because the box is now referred to after
13205 % \cs{output} is completed.}
13206 % \changes{v1.2-7}{2013/05/11}
13207 % {Replace the sequence of operations to make a usual float column
13208 % with \cs{@toplist} with the newly introduced
13209 % \cs{pcol@makefcolpage}.}
13210 % \changes{v1.33-2}{2016/11/19}
13211 % {Remove a space after the \cs{vbox} to be assigned to \cs{@currbox}
13212 % to obey the coding convention.}
13213 % 
13214 % The macro \!\pcol@makefcolumn! is invoked solely from \!\pcol@flushcolumn!
13215 % to put deferred floats in the currently empty \colpage{} of $c$ in the
13216 % \tpage{} $\ptop$ which is being flushed. Since we have to take special care
13217 % of the case of environment closing, we cannot do this operation by
13218 % \!\@makefcolumn!, while in other cases for \!\flushpage! and \!\clearpage!
13219 % we also have to pay a small attention.
13220 %
13221 % First, we scan the copy of $\cc_c(\dl)$ applying \!\pcol@makefcolelt! to
13222 % each element to have the floats to be put in \!\@toplist!, which is
13223 % assuredly empty because the \ccolpage{} of $c$ has already been shipped
13224 % out to empty it, and those still deferred in $\cc_c(\dl)$. Prior to scan,
13225 % we let $H_r=\pp^h(\ptop)\footnotemark+\alpha$\footnotetext{
13226 % 
13227 % $\pp^h(\ptop)$ referred in this macro may have been shrunk by \Scfnote{}s
13228 % in \cs{pcol@flushcolumn}.},
13229 % 
13230 % as the space initially available for
13231 % floats each of which being $\phi$ is assumed to consume
13232 % $v(\phi)=h(\phi)+d(\phi)+\alpha$, and $H_t=\!\@colroom!=-\alpha$ as the
13233 % initial value of the accumulated size of $v(\phi)$ for all $\phi$ to be
13234 % put, where $\alpha=\!\floatsep!$ if $\CSIndex{ifpcol@lastpage}=\true$
13235 % 
13236 % \SpecialIndex{\ifpcol@lastpage}
13237 % 
13238 % as discussed afterward, or $\alpha=\!\@fpsep!$ otherwise.
13239 %
13240 % Then if the resulting \!\@toplist! is not empty\footnote{
13241 % 
13242 % It can happen if the first float is larger than $\pp^h(\ptop)$.},
13243 % 
13244 % we examine if $\ptop$ is the \lpage{} ($|\ifpcol@|\~|lastpage|=\true$)
13245 % 
13246 % \SpecialIndex{\ifpcol@lastpage}
13247 % 
13248 % and $\cc_c(\dl)$ is empty to mean the last \colpage{} have all deferred
13249 % floats. This case is subtle because if we make the \colpage{} a \fcolumn{}
13250 % it can be sparse and unnecessarily throw the \postenv{} to the next
13251 % page. Therefore, we intend to pack floats to the page top as top floats
13252 % and thus have let $\alpha=\!\floatsep!$ in the building process of
13253 % \!\@toplist! above\footnote{
13254 % 
13255 % We dare to do it knowing the natural component of \!\floatsep! is a little
13256 % bit (4pt) larger than that \!\@fpsep! and the possibility of having
13257 % fewer floats than those given by \!\@makefcolumn!.},
13258 % 
13259 % but it may make a too tall \colpage{} only having floats shrinking
13260 % the \postenv{} in the page. In addition, if other columns have
13261 % \fpage{}s in the \lpage, packing the floats as top floats should give
13262 % inconsistent appearance but we don't know whether the columns following
13263 % $c$ has \fpage{}s. Therefore, we performs this float packing if making
13264 % the \fpage{} gives too sparse, more specifically if
13265 % $H_t<\!\floatpagefraction!\times\pp^h(\ptop)=\!\@fpmin!$, but postpone the
13266 % final decision until the \colpage{} is eventually shipped out by
13267 % \!\pcol@flushcolumn! or \!\pcol@makeflushedpage!. That is, if the all
13268 % conditions above hold, we keep \!\@toplist! so that it is saved in
13269 % $\cc_c(\tl)$ and let $\cc_c(\tr)=\infty$ to indicate that the column has
13270 % pending floats. Note that the floats are shipped out by
13271 % \!\pcol@flushcolumn! if the \pfcheck{} currently being performed finds a
13272 % too tall column in $\ptop$ to force a page break making $\ptop$ non-last.
13273 % Also note that, in any cases, letting $\cc_c(\tr)=\infty$ is safe because
13274 % no longer we will have any float additions to the \colpage.
13275 %
13276 % Otherwise, i.e., if we are working on a non-\lpage{} to be flushed or a
13277 % \fcolumn{} is to be made for the \lpage, we put all floats in \!\@toplist!
13278 % in a \!\vbox! of $\pp^h(\ptop)$ tall by \!\pcol@makefcolpage! and then
13279 % let $\cc_c(\vb^b)$ be another \!\vbox! having it. This encapsulation of
13280 % the \fcolumn{} is necessary because $\cc_c(\vb^b)$ can be put back to the
13281 % main vertical list after the \pfcheck{} to remove skips above and below
13282 % the floats, namely \!\@fptop! and \!\@fpbot!, if the contents were not
13283 % encapsulated.
13284 % 
13285 % \begin{macrocode}
13286 \def\pcol@makefcolumn{%
13287 \ifpcol@lastpage \@tempdimc\floatsep \else \@tempdimc\@fpsep \fi
13288 \@tempdima\@colht \advance\@tempdima\@tempdimc \global\@colroom-\@tempdimc
13289 \begingroup
13290 \let\@elt\pcol@makefcolelt
13291 \let\reserved@b\@deferlist
13292 \global\let\@deferlist\@empty
13293 \reserved@b
13294 \endgroup
13295 \ifx\@toplist\@empty\else
13296 \@tempswatrue
13297 \ifpcol@lastpage \ifx\@deferlist\@empty \ifdim\@colroom<\@fpmin
13298 \@tempswafalse \global\@toproom\maxdimen
13299 \fi\fi\fi
13300 \if@tempswa \global\setbox\@currbox\vbox{\pcol@makefcolpage}\fi
13301 \fi}
13302 % \end{macrocode}
13303 % \end{macro}
13304 % 
13305 % \begin{macro}{\pcol@makefcolelt}
13306 % \changes{v1.0}{2011/10/10}
13307 % {Introduced to take special care of the float-column in the last
13308 % page. }
13309 % 
13310 % The macro $\!\pcol@makefcolelt!\<\phi\>$ is invoked solely from
13311 % \!\pcol@makefcolumn! to be applied to each float element $\phi$ in (the
13312 % copy of) $\cc_c(\dl)$. We examine if $v(\phi)=h(\phi)+d(\phi)+\alpha\leq
13313 % H_r$ to mean the \fcolumn{} being built has room large enough for the float
13314 % $\phi$. If so, we add $\phi$ to \!\@toplist! by \!\@cons!, and let
13315 % $H_r\gets H_r-v(\phi)$ and $H_t\gets H_t+v(\phi)$. Otherwise, we add
13316 % $\phi$ to $\cc_c(\dl)$ by \!\@cons! to make it deferred again, and
13317 % let $H_r=-\infty$ so that the examinations for any succeeding elements
13318 % fail.
13319 % 
13320 % \begin{macrocode}
13321 \def\pcol@makefcolelt#1{%
13322 \@tempdimb\ht#1{}\advance\@tempdimb\dp#1{}\advance\@tempdimb\@tempdimc
13323 \ifdim\@tempdimb>\@tempdima \@cons\@deferlist#1\relax
13324 \@tempdima-\maxdimen
13325 \else \@cons\@toplist#1\relax
13326 \advance\@tempdima-\@tempdimb \global\advance\@colroom\@tempdimb
13327 \fi}
13328 % \end{macrocode}
13329 % \end{macro}
13330 % 
13331 % \begin{macro}{\pcol@makefcolpage}
13332 % \changes{v1.2-7}{2013/05/11}
13333 % {Introduced to implement the operations to make a float column
13334 % performed in three macros.}
13335 % \changes{v1.32-2}{2015/10/10}
13336 % {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
13337 % \changes{v1.33-2}{2016/11/19}
13338 % {Add {\tt\%} to the end of the line to open \cs{vbox} to obey the
13339 % coding convention.}
13340 % 
13341 % The macro \!\pcol@makefcolpage! is invoked from \!\pcol@flushcolumn!,
13342 % \!\pcol@makefcolumn! and \!\pcol@imakeflushedpage! to build a \fcolumn{}
13343 % having floats in \!\@toplist!, which is then returned to \!\@freelist! and
13344 % then emptied. The floats are put in a \!\vbox! of \!\@colht! tall with
13345 % vertical skips of \!\@fptop!, \!\@fpsep! and \!\@fpbot! above, between and
13346 % below them respectively. The box is then let be $\s_c(p)$ or
13347 % $\cc_c(\vb^b)$ explicitly or implicitly by the invokers, with an
13348 % encapsulation in the case of \!\pcol@makefcolumn!.
13349 % 
13350 % \begin{macrocode}
13351 \def\pcol@makefcolpage{\vbox to\@colht{%
13352 \vskip\@fptop \vskip-\@fpsep
13353 \def\@elt##1{\vskip\@fpsep\box##1}\@toplist \vskip\@fpbot}%
13354 \pcol@Fb
13355 \xdef\@freelist{\@freelist\@toplist}\global\let\@toplist\@empty
13356 \pcol@Fe{makefcolpage}%
13357 }
13358
13359 % \end{macrocode}
13360 % \end{macro}
13361 %
13362 % \begin{macro}{\pcol@measurecolumn}
13363 % \changes{v1.0}{2011/10/10}
13364 % {Drastically changed to measure $D_T$, to deal with empty
13365 % main vertical list, and to omit \cs{topfigrule} and \cs{botfigrule}
13366 % from float size measurement.}
13367 % 
13368 % The macro \!\pcol@measurecolumn! is invoked for each column $c\In0\C$ from
13369 % \!\pcol@sync! to measure the sizes of the top floats $\size_c(t)$, main
13370 % vertical list $\size_c(m)$, footnotes $\size_c(f)$ and bottom floats
13371 % $\size_c(b)$ in the \ccolpage{} in the page $\ptop$. After obtaining the
13372 % \cctext{} in $\cc_c$ by \!\pcol@getcurrcol!, we calculate
13373 % $\size_c(t)=\!\skip!{\cdot}\cc_c(\vb)$ by \!\pcol@addflhd! giving it
13374 % $\cc_c(\tl)$ and $\cc_c(\tf)=\!\pcol@textfloatsep!$ as its arguments also
13375 % to have $\CSIndex{if@tempswa}={\fc(t)}$. Note that $\cc_c(\tf)=\infty$ means
13376 % the \colpage{} does not have any \sync{}ation points yet and thus
13377 % \!\textfloatsep! is used in the calculation as the skip between the top
13378 % floats and main vertical list, while the value itself possibly for a
13379 % \mvlfloat{} discussed later is used if $\cc_c(\tf)<\infty$. We also
13380 % calculate $\size_c(m)=h(\cc_c(\vb))+d(\cc_c(\vb))$, and then the sum of it
13381 % and $\size_c(t)$.
13382 % 
13383 % \begin{macrocode}
13384 \def\pcol@measurecolumn{%
13385 \pcol@getcurrcol
13386 \@tempswafalse
13387 \dimen@\z@ \pcol@addflhd\@toplist\pcol@textfloatsep
13388 \global\skip\@currbox\dimen@
13389 \advance\dimen@\ht\@currbox \advance\dimen@\dp\@currbox \dimen@ii\dimen@
13390 % \end{macrocode}
13391 %
13392 % Next we examine if the main vertical list $\cc_c(\vb^b)$ is empty by
13393 % \!\pcol@ifempty! and, if so, we let $\pd_c=\cc_c(\pd)=\infty$ and save it
13394 % (together with others) by \!\pcol@setcurrcol! so that, if the column
13395 % defines the $\VT$ finally by its top floats, $\DT$ is let $\infty$ and the
13396 % fact that the column has empty list is remembered. Otherwise, we let
13397 % $\pd_c=\cc_c(\pd)$ and $\CSIndex{if@tempswa}=\true$ to represent
13398 % $\Fc(\{t,m\})=f_t\lor f_m$ because $f_m=\true$. Then we invoke
13399 % \!\pcol@measureupdate! to let $\VT=\size_c(t)+\size_c(m)=\Size_c(\{t,m\})$
13400 % and $\DT=\pd_c$ if $\Fc(\{t,m\})=\true$ and $\VT<\Size_c(\{t,m\})$.
13401 % 
13402 % \begin{macrocode}
13403 \pcol@ifempty\@currbox
13404 {\global\pcol@prevdepth\maxdimen \pcol@setcurrcol}%
13405 {\@tempswatrue}%
13406 \pcol@measureupdate\@tempdima\dimen@ii\@tempdimc\pcol@prevdepth
13407 % \end{macrocode}
13408 % 
13409 % \changes{v1.2-2}{2013/05/11}
13410 % {Add calculation of $V_P$ and $c_{\string\max}$.}
13411 %
13412 % Next we let $\size_c(f)=0$ if $\cc_c(\ft^b)$ is void, or otherwise let
13413 % $\size_c(f)=h(\cc_c(\ft^b))+d(\cc_c(\ft^b))+{}\cc_c(\ft^s)$\footnote{
13414 % 
13415 % We ignore the height and depth of \!\footnoterule! because they are
13416 % expected to be 0 and are so in the default setting.}
13417 % 
13418 % and $\CSIndex{if@tempswa}=\true$ because $\fc(f)=\true$ and thus
13419 % $\Fc(\{t,m,f\})=\true$. After that, we calculate $\size_c(f)+\size_c(b)$
13420 % by \!\pcol@addflhd! giving it $\cc_c(\bl)$ and $\infty$ to mean
13421 % \!\textfloatsep! should be used for the calculation as its argument also
13422 % to have $\CSIndex{if@tempswa}={\Fc}(\{t,m,f,b\})$. Then we let
13423 % $\VB=\size_c(f)+\size_c(b)$ if $\VB<\size_c(f)+\size_c(b)$, and let
13424 % $\VP=\size_c(t)+\size_c(m)+\size_c(f)+\size_c(b)=\Size_c(\{t,m,f,b\})$ and
13425 % $c_{\max}=c$ if $\Fc(\{t,m,f,b\})=\true$ and $\VP<\Size_c(\{t,m,f,b\})$.
13426 % 
13427 % \begin{macrocode}
13428 \ifvoid\pcol@currfoot \dimen@\z@
13429 \else
13430 \dimen@\ht\pcol@currfoot \advance\dimen@\dp\pcol@currfoot
13431 \advance\dimen@\skip\pcol@currfoot
13432 \@tempswatrue
13433 \fi
13434 \pcol@addflhd\@botlist\maxdimen
13435 \ifdim\dimen@>\@tempdimb \@tempdimb\dimen@ \fi
13436 \advance\dimen@\dimen@ii
13437 \if@tempswa \ifdim\dimen@>\@pageht
13438 \@pageht\dimen@ \@tempcntb\pcol@currcol
13439 \fi\fi
13440 % \end{macrocode}
13441 %
13442 % Next, we let $\dc$ be the depth of the lowest non-empty items among the
13443 % main vertical list, footnotes and bottom floats. That is, we let
13444 % $\dc\gets\cc_c(\pd)$ at first, and then, if
13445 % $\CSIndex{ifpcol@bfbottom}={\true}$, override it by $\dc\gets
13446 % d(\cc_c(\ft^b))$ if there are footnotes, and finally override it by
13447 % $\dc\gets0$ for the bottom floats if exist adding \!\textfloatsep! to
13448 % $\Size_c(\{t,m,f,b\})$ to have $\Size_c(\{t,m,f,b'\})$. This overriding
13449 % order of $d(\cc_c(\ft^b))$ and then 0 by bottom floats is reversed when
13450 % $\CSIndex{ifpcol@bfbottom}=\false$ according to the implementation of
13451 % \!\@makecol!. Then, we invoke \!\pcol@measureupdate! again to let
13452 % $\VPP=\Size_c(\{t,m,f,b'\})$ and $\DP=\dc$ if $\Fc(\{t,m,f,b\})=\true$ and
13453 % $\VPP<\Size_c(\{t,m,f,b'\})$. It also lets $\DP=\dc$ if
13454 % $\Fc(\{t,m,f,b\})=\true$, $\VPP=\Size_c(\{t,m,f,b'\})$ and $\DP>\dc$.
13455 %
13456 % Finally, we let $\CSIndex{ifpcol@dfloats}=\true$ if
13457 % $\cc_c(\dl)\neq\emptyset$ to tell \!\pcol@makeflushedpage! that the
13458 % \lpage{} must be {\em full size} and \!\pcol@output@end! to flush the
13459 % deferred \cwise{} floats.
13460 % 
13461 % \changes{v1.3-6}{2013/09/17}
13462 % {Revise the mechanism to tell \cs{pcol@makeflushedpage} and
13463 % \cs{pcol@output@end} that a column in a last page has deferred
13464 % column-wise floats with newly introduced \cs{ifpcol@dfloats}.}
13465 % 
13466 % \begin{macrocode}
13467 \dimen@ii\pcol@prevdepth
13468 \ifpcol@bfbottom
13469 \ifvoid\pcol@currfoot\else \dimen@ii\dp\pcol@currfoot \fi
13470 \ifx\@botlist\@empty\else \dimen@ii\z@ \advance\dimen@\textfloatsep \fi
13471 \else
13472 \ifx\@botlist\@empty\else \dimen@ii\z@ \advance\dimen@\textfloatsep \fi
13473 \ifvoid\pcol@currfoot\else \dimen@ii\dp\pcol@currfoot \fi
13474 \fi
13475 \pcol@measureupdate\pcol@colht\dimen@\@pagedp\dimen@ii
13476 \ifx\@deferlist\@empty\else \pcol@dfloatstrue \fi
13477 \advance\pcol@currcol\@ne}
13478 % \end{macrocode}
13479 % \end{macro}
13480 % 
13481 % \begin{macro}{\pcol@addflhd}
13482 % \changes{v1.0}{2011/10/10}
13483 % {Drastically changed to omit \cs{topfigrule} and \cs{botfigrule}
13484 % from float size measurement, to take care of top float enlargement,
13485 % to add the measurement of $D_T$, and to revise the definition of
13486 % $D_P$.}
13487 % 
13488 % \begin{macro}{\pcol@hdflelt}
13489 % \def\xl{\lambda_x}
13490 % \changes{v1.3-3}{2013/09/17}
13491 % {Add a user \cs{pcol@makecol}.}
13492 % 
13493 % The macro $\!\pcol@addflhd!\arg{list}\arg{tfs}$ is invoked twice from
13494 % \!\pcol@measurecolumn! for a column $c$ to measure $\size_c(x)$
13495 % ($x\in\{t,b\}$) of top ($x=t$) or bottom ($x=b$) floats.
13496 % The arguments and registers referred to in the macro have the following
13497 % values according to $x=t$ or $x=b$.
13498 % $$
13499 % \nosv\begin{array}{l|ll}
13500 % & x=t& x=b\\\hline
13501 % \arg{list}& \cc_c(\tl)& \cc_c(\bl)\\
13502 % \arg{tfs}& \!\pcol@textfloatsep!& \!\maxdimen!\\
13503 % \CSIndex{if@tempswa}&
13504 % \false& \Fc(\{t,m,f\})\\
13505 % \!\dimen@!& 0& \size(f)
13506 % \end{array}
13507 % $$
13508 % The macro is also used in \!\pcol@makecol! and \!\pcol@output@switch! for
13509 % $x=t$ but with \!\dimen@! having the height of \!\pcol@prespan! for the
13510 % measurement of the total height of \prespan{} including top
13511 % floats\footnote{
13512 % 
13513 % In these invocations, \CSIndex{if@tempswa} is meaningless and not examined
13514 % by the invokers.}.
13515 %
13516 % The macro at first examines if $\cc_c(\xl)=\arg{list}$ is empty and does
13517 % nothing if so. Otherwise, \CSIndex{if@tempswa} is turned $\true$ to have
13518 % $\fc(t)=\true$ for $x=t$ or $\Fc(\{t,m,f,b\})=\true$ for $x=b$. Then we
13519 % scan all floats in $\arg{list}$ applying \!\pcol@hdflelt! to each float
13520 % $\phi$ to add $h(\phi)+d(\phi)+\!\floatsep!$ to \!\dimen@!, from/to which
13521 % we then subtract \!\floatsep! and add $\sigma_x$ because the last\slash
13522 % first float is followed\slash preceded by the vertical skip of $\sigma_x$
13523 % instead of \!\floatsep!, to have $\size_c(t)$ for $x=t$ or
13524 % $\size_c(f)+\size_c(b)$ for $x=b$ being {\em returned} to
13525 % \!\pcol@measurecolumn!.
13526 %
13527 % Note that $\sigma_t$ is $\arg{tfs}=\!\pcol@textfloatsep!$ if it is less
13528 % than $\infty$ or \!\textfloatsep! otherwise, while
13529 % $\sigma_b=\!\textfloatsep!$ always because $\arg{tfs}=\!\maxdimen!$. Also
13530 % note that $\sigma_t$ can be biased by 10000\,|pt| and thus larger than
13531 % 5000\,|pt|, if we have a \mvlfloat{} in top floats as discussed later.
13532 % Another caution is that we ignore the contribution by \!\topfigrule! nor
13533 % \!\botfigrule! because they should insert vertical items whose total
13534 % height and depth are 0.
13535 % 
13536 % \begin{macrocode}
13537 \def\pcol@addflhd#1#2{%
13538 \ifx#1\@empty\else
13539 \@tempswatrue
13540 \let\@elt\pcol@hdflelt
13541 #1\advance\dimen@-\floatsep
13542 \ifdim#2=\maxdimen \advance\dimen@\textfloatsep
13543 \else
13544 \advance\dimen@\pcol@textfloatsep
13545 \ifdim\pcol@textfloatsep>5000\p@ \advance\dimen@-\@M\p@ \fi
13546 \fi
13547 \let\@elt\relax
13548 \fi}
13549 \def\pcol@hdflelt#1{\advance\dimen@\ht#1\advance\dimen@\dp#1%
13550 \advance\dimen@\floatsep}
13551 % \end{macrocode}
13552 % \end{macro}\end{macro}
13553 % 
13554 % \begin{macro}{\pcol@measureupdate}
13555 % \changes{v1.0}{2011/10/10}
13556 % {Introduced to let $D_T$ and $D_P$ have the minimum depth of items
13557 % among those which give $V_T$ and $V_P$.}
13558 % 
13559 % The macro $\!\pcol@measureupdate!\<V\>\<v\>\<D\>\<d\>$ is invoked
13560 % twice in \!\pcol@measurecolumn! for $c$ to update $V\in\{\VT,\VPP\}$
13561 % and $D=\{\DT,\DP\}$ as follows if \CSIndex{if@tempswa}, being
13562 % $\Fc(\{t,m\})$ for $V=\VT$ or $\Fc(\{t,m,f,b\})$ for $V=\VPP$, is $\true$.
13563 % $$
13564 % V\gets\max(V,v)\qquad
13565 % D\gets\cases{\min(D,d)&$V=v$\cr
13566 % D& $V\neq v$}
13567 % $$
13568 % The arguments $v$ and $d$ have the followings according to $V$.
13569 % $$
13570 % \arraycolsep0pt
13571 % \begin{array}{rll}
13572 % V=\VT \;{:}\;&v=\Size_c(\{t,m\})&\quad d=\delta_c\\
13573 % V=\VPP\;{:}\;&v=\Size_c(\{t,m,f,b'))&\quad d=\dc
13574 % \end{array}
13575 % $$
13576 % 
13577 % \begin{macrocode}
13578 \def\pcol@measureupdate#1#2#3#4{\if@tempswa
13579 \ifdim#1<#2\relax#1#2\relax#3#4\relax
13580 \else\ifdim#1=#2\ifdim#3>#4\relax#3#4\fi\fi\fi\fi}
13581
13582 % \end{macrocode}
13583 % \end{macro}
13584 %
13585 % \begin{macro}{\pcol@synccolumn}
13586 % \changes{v1.0}{2011/10/10}
13587 % {Drastically changed to correctly implement the top float
13588 % enlargement and MVL-float.}
13589 % \changes{v1.2-2}{2013/05/11}
13590 % {Change code structure removing the case for overflown synchronized
13591 % pages.}
13592 % \changes{v1.2-2}{2013/05/11}
13593 % {Remove \cs{penalty}\string\texttt{-10000} made unnecessary by the
13594 % redesign of overflow synchronized pages.}
13595 % \changes{v1.2-7}{2013/05/11}
13596 % {Add an shrink of $1/10000\,\string\texttt{fil}$ to the bottom of
13597 % flushed column pages to cancel finite shrinks just below
13598 % synchronization points.}
13599 % 
13600 % The macro \!\pcol@synccolumn! is invoked for each column $c\In0\C$ from
13601 % \!\pcol@sync! to set a \sync{}ation point at $\VT$ from the top of the
13602 % \ccolpage{} of $c$ if $\CSIndex{ifpcol@clear}={\false}$, or flush it
13603 % otherwise. After obtaining $c$'s \cctext{} $\cc_c$ by
13604 % \!\pcol@getcurrcol!, we process one of the following three cases.
13605 %
13606 % The first case is for flushing with $\CSIndex{ifpcol@clear}=\true$. In
13607 % this case we simply add \!\vfil! at the tail of the main vertical list in
13608 % $\cc_c(\vb^b)$ to make the whole \colpage{} possibly with other items fit
13609 % in a box of \!\@colht! tall and, if $\cc_c(\tf)\neq\infty$ to mean the
13610 % column to be flushed has a \sync{}ation point, we also add an infinite
13611 % shrink of $1/10000\,|fil|$ so as to cancel a finite shrink just below the
13612 % point, as done in \!\pcol@makecol!\footnote{
13613 % 
13614 % Just in case, because it looks impossible that the natural height of the
13615 % \colpage{} exceeds $\pp^h(\ptop)$ with \pfcheck.}.
13616 % 
13617 % We also let $\cc_c(\pd)=1000\,|pt|$ to mimic \TeX's mechanism of
13618 % \!\prevdepth! with the empty main vertical list in the next
13619 % \colpage{}\footnote{
13620 % 
13621 % The author is not sure if this setting is really necessary but, at least,
13622 % it looks working well (though other setting looks all right too).}.
13623 % 
13624 % \begin{macrocode}
13625 \def\pcol@synccolumn{%
13626 \pcol@getcurrcol
13627 \ifpcol@clear
13628 \global\pcol@prevdepth\@m\p@
13629 \global\setbox\@currbox\vbox{\unvbox\@currbox
13630 \ifdim\pcol@textfloatsep=\maxdimen \vfil
13631 \else \vskip\z@\@plus1fil\@minus.0001fil
13632 \fi}%
13633 % \end{macrocode}
13634 % 
13635 % The second and third cases are for \sync{}ed \cswitch{}. The second case
13636 % is for $\DT=\infty$ to mean the \sync{}ation point is set just below the
13637 % top floats of a column whose main vertical list is empty because it is
13638 % definitely $\VT\geq0>-\infty$. In this case, we should not put anything
13639 % back to the main vertical list, because the column having defined the
13640 % point will restart from the top of its \colpage{} with \!\topskip! and
13641 % thus other columns should do so for the stuff following the point.
13642 % Therefore, we put $\cc_c(\vb^b)$ as the last top float, namely
13643 % {\em\Uidx\mvlfloat} because it is for the main vertical list, acquiring an
13644 % \!\insert! from \!\@freelist! by \!\@next! and assigning it to
13645 % \Midx{\!\pcol@float!} so that we pretend main vertical lists of all
13646 % columns are empty.
13647 %
13648 % The float has zero height and depth, and contains the
13649 % followings if we have some real floats; a vertical skip of $-\!\floatsep!$
13650 % to go back to the bottom of the last real float; \!\topfigrule! and a skip
13651 % of \!\textfloatsep! to separate $\cc_c(\vb^b)$ from the last real float;
13652 % and $\cc_c(\vb^b)$ followed by \!\vss! to avoid overfull and underfull.
13653 % Otherwise, i.e., we don't have any real floats, neither of the skips nor
13654 % \!\topfigrule! are put in the \mvlfloat{} because we let
13655 % $\!\floatsep!=\!\textfloatsep!=0$ and $\!\topfigrule!=\!\relax!$
13656 % temporarily in a group. Then we set the \sync{}ation point by enlarging
13657 % the space below the \mvlfloat{} so that the total size of all floats
13658 % including \!\floatsep! and \!\textfloatsep!, which may be 0 as set in the
13659 % process above, is equal to $\VT$. This enlarging is done by letting
13660 % $\cc_c(\tf)=\VT-(\vc(t)-\!\textfloatsep!+\!\floatsep!)$, the second term
13661 % of which is the vertical size of the top float sequence up to the
13662 % \mvlfloat, and by replacing \!\textfloatsep! with $\cc_c(\tf)$ in the top
13663 % float insertion process in \!\pcol@cflt! so that the top floats including
13664 % the \mvlfloat{} consumes $\VT$ as a whole\footnote{
13665 % 
13666 % This enlarging cannot be done by making the float's height
13667 % $\VT-\vc(t)-\!\floatsep!$ (or \!\textfloatsep!) because the height can be
13668 % negative.}.
13669 %
13670 % Note that the process above involves \!\floatsep! and \!\textfloatsep!
13671 % with some finite stretch and shrink, but these factors will not contribute
13672 % the final result because they are canceled by \!\vss! in the \mvlfloat{}
13673 % and by the small infinite stretch and shrink put by \!\pcol@makecol! and
13674 % this macro for flushing. Also note that $\cc_c(\tf)$ is then biased by
13675 % 10000\,|pt| so that \!\pcol@cflt! will not put \!\topfigrule! because it
13676 % has been already put as a part of the \mvlfloat{} or we don't have any
13677 % real floats. We also let $\cc_c(\pd)=1000$ to mean the \colpage{}'s main
13678 % vertical list is empty, so as to mimic \TeX's mechanism of \!\prevdepth!
13679 % with an empty list again.
13680 %
13681 % Another attention we have to pay is that \colpage{}s with
13682 % $\cc_c(\tf)=\infty$ does not have any \sync{}ation points, and thus
13683 % $\cc_c(\tf)<\infty$ means a \sync{}ation has already taken place in them.
13684 % If this $\cc_c(\tf)<\infty$ happens with $\DT=\infty$\footnote{
13685 % 
13686 % This can happen when a \sync{}ation with $\DT=\infty$ is immediately
13687 % followed by another \sync{}ation or, more unlikely, by additions of
13688 % items whose total amount is negative and then a \sync{}ation.},
13689 % 
13690 % we cannot update $\cc_c(\tf)$ because \!\pcol@measurecolumn! took care of
13691 % its value on measuring $\vc(t)$. Therefore, we do nothing if
13692 % $\cc_c(\tf)<\infty$ but just let succeeding stuff be added to the main
13693 % vertical list as in \cswitch{} without \sync{}ation.
13694 % 
13695 % \changes{v1.32-2}{2015/10/10}
13696 % {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
13697 % \changes{v1.33-2}{2016/11/19}
13698 % {Add {\tt\%} to the end of the line to open \cs{vbox} for
13699 % \cs{pcol@float} to obey the coding convention.}
13700 % 
13701 % \begin{macrocode}
13702 \else
13703 \@tempdimb\@tempdima
13704 \advance\@tempdimb-\skip\@currbox
13705 \ifdim\@tempdimc=\maxdimen
13706 \ifdim\pcol@textfloatsep=\maxdimen \begingroup
13707 \ifx\@toplist\@empty
13708 \textfloatsep\z@ \floatsep\z@ \let\topfigrule\relax
13709 \fi
13710 \pcol@Fb
13711 \@next\pcol@float\@freelist{\global\setbox\pcol@float\vbox to\z@{%
13712 \vskip-\floatsep \topfigrule \vskip\textfloatsep
13713 \unvbox\@currbox \vss}}\pcol@ovf
13714 \pcol@Fe{synccolumn(topfloat)}%
13715 \@cons\@toplist\pcol@float
13716 \advance\@tempdimb\textfloatsep \advance\@tempdimb-\floatsep
13717 \advance\@tempdimb\@M\p@
13718 \global\pcol@prevdepth\@m\p@
13719 \global\pcol@textfloatsep\@tempdimb
13720 \endgroup \fi
13721 % \end{macrocode}
13722 % 
13723 % The third and last case is for $\DT<\infty$ and thus most usual. In this
13724 % case, we enclose everything in $\cc_c(\vb^b)$ in a \!\vbox! whose height
13725 % is $h_c^v=\VT-\vc(t)$ and let $\cc_c(\vb^b)$ have it so that the item
13726 % following the \sync{}ation point start at $\VT$. An attention we have to
13727 % pay is that it can be $h_c^v<\!\topskip!$ to let \TeX{} insert a vertical
13728 % skip of the difference between them when the box is returned to the main
13729 % vertical list pushing down the \sync{}ation point a little bit\footnote{
13730 % 
13731 % This can happen not very unlikely especially with $\vc(t)$ a little bit
13732 % less than $\VT$ and $\cc_c(\vb^b)$ being empty.}.
13733 % 
13734 % Therefore, if so, we let $\cc_c(\vb^b)$ have the followings; a \!\vbox! of
13735 % \!\topskip! tall having its old contents at its top above which no
13736 % vertical skip will be inserted; a vertical skip $-\!\topskip!$ going back
13737 % to the page top; and a vertical skip $h_c^v$ going down to the
13738 % \sync{}ation point.
13739 %
13740 % The encapsulation of the old contents $\cc_c(\vb^b)$ in the box of $h_c^v$
13741 % tall gives us the following two features desirable for \sync{}ation.
13742 % First, all vertical glues in the box are {\em frozen}, nullifying finite
13743 % stretches in them because we insert an infinite stretch of
13744 % $1/10000\,|fil|$ at the bottom of $\cc_c(\vb^b)$ to push up its old
13745 % contents respecting other infinite stretches if any, as done by
13746 % \!\raggedbottom!, and also nullifying finite and infinite shrinks because
13747 % $h_c^v\geq\vc(m)$ definitely. This freezing and nullification keeps
13748 % \sync{}ation points already in $\cc_c(\vb^b)$ from being observed moving a
13749 % little bit vertically. That is, if we have a glue just below a
13750 % \sync{}ation point and it were {\em visible} to \TeX's page builder, the
13751 % item below the glue could move up/down when the builder found a break
13752 % point with some shrink\slash stretch. Though this moving up/down is
13753 % inhibited by the small infinite stretch\slash shrink which the \colpage{}
13754 % will at its bottom finally, it is undesirable to make \TeX{}
13755 % misunderstanding that the glues are stretchable\slash shrinkable though
13756 % they are not in reality.
13757 %
13758 % Second, since the boxes in all \colpage{} are zero deep due to the
13759 % infinite stretch at their bottoms and these bottoms are aligned at the
13760 % \sync{}ation point, we have a clear view of the baseline progress after
13761 % the \sync{}ation regardless of their contents. That is, we let
13762 % $\cc_c(\pd)=\DT$ to {\em broadcast} $\DT$ to all columns, so that
13763 % the baselines of first items following the \sync{}ation
13764 % point are aligned \!\baselineskip! below the bottom baseline of the column
13765 % which defines $\DT$\footnote{
13766 % 
13767 % Since $\DT$ is given by one of the tallest columns whose depth is smallest
13768 % among them, it is very likely that the bottom baseline of the column is
13769 % lowest among all columns. However, another column can have the lowest one
13770 % when its vertical size is a little bit shorter than $\VT$ and its depth is
13771 % small (e.g., 0). Though of course we can define $\DT$ being $\VT$ minus
13772 % the height of the column having the largest height to make the first
13773 % baseline below the \sync{}ation point apart from the lowest one by
13774 % \cs{baselineskip}, we dare to choose the definition of $\DT$ because such
13775 % lowest baseline often means that the column have some skip at its bottom
13776 % to give us the impression that the space between the baselines of the
13777 % tallest column and its first item is a little bit too large.},
13778 % 
13779 % if $\DT$ plus the hight of each item is less than \!\baselineskip!.
13780 %
13781 % In addition, we let $\cc_c(\tf)=\!\textfloatsep!$ to
13782 % indicate the \colpage{} has the \sync{}ation point we just have set, if it
13783 % was $\infty$ to mean the point is the first one. By this setting,
13784 % \!\pcol@makecol! and this macro itself will know that the \colpage{} needs
13785 % to have a small infinite shrink at its bottom to cancel finite ones below
13786 % the \sync{}ation point, while \!\pcol@cflt! acts as \LaTeX's \!\@cflt!
13787 % because it should be $\cc_c(\tf)\leq5000\,|pt|$ to mean the \colpage{}
13788 % does not have a \mvlfloat.
13789 % 
13790 % \changes{v1.33-2}{2016/11/19}
13791 % {Add {\tt\%} to the end of the line to open \cs{vbox} for
13792 % \cs{@currbox} and two lines for \cs{vbox}es in it to obey the
13793 % coding convention.}
13794 % 
13795 % \begin{macrocode}
13796 \else
13797 \global\pcol@prevdepth\@tempdimc
13798 \ifdim\pcol@textfloatsep=\maxdimen
13799 \global\pcol@textfloatsep\textfloatsep \fi
13800 \global\setbox\@currbox\vbox{%
13801 \ifdim\@tempdimb<\topskip
13802 \vbox to\topskip{\unvbox\@currbox \vskip\z@\@plus.0001fil}%
13803 \vskip-\topskip \vskip\@tempdimb
13804 \else
13805 \vbox to\@tempdimb{\unvbox\@currbox \vskip\z@\@plus.0001fil}%
13806 \fi}%
13807 \fi
13808 \fi
13809 % \end{macrocode}
13810 % 
13811 % Finally, we let $\cc_c(\tn)=0$ to inhibit further addition of top floats
13812 % because we have fixed the space for them\footnote{
13813 % 
13814 % Allowing the addition is tremendously tough even when the \colpage{} has
13815 % sufficiently large space above the \sync{}ation point.},
13816 % 
13817 % and save it and other \cctext{} members into $\cc_c$ by \!\pcol@setcurrcol!.
13818 % 
13819 % \begin{macrocode}
13820 \global\@topnum\z@ \pcol@setcurrcol
13821 \advance\pcol@currcol\@ne}
13822
13823 % \end{macrocode}
13824 % \end{macro}
13825 %
13826 %
13827 %
13828 % \subsection{Page Flushing}
13829 % \label{sec:imp-sout-flush}
13830 %
13831 % \begin{macro}{\pcol@output@flush}
13832 % \changes{v1.0}{2011/10/10}
13833 % {Rename \cs{pcol@makelastpage} as \cs{pcol@makeflushedpage}.}
13834 % \changes{v1.0}{2011/10/10}
13835 % {Remove unnecessary assignment of \cs{@colht}.}
13836 % \changes{v1.2-2}{2013/05/11}
13837 % {Add \cs{pcol@Logstart} and \cs{pcol@Logend}.}
13838 % \changes{v1.2-7}{2013/05/11}
13839 % {Add $\cs{boxmaxdepth}\EQ\cs{@maxdepth}$ for depth capping.}
13840 % \changes{v1.2-7}{2013/05/11}
13841 % {Add $\cs{boxmaxdepth}\EQ\cs{@maxdepth}$ for depth capping.}
13842 % \changes{v1.3-2}{2013/09/17}
13843 % {Add depth capping of \cs{pcol@rightpage}.}
13844 % 
13845 % The macro \!\pcol@output@flush! is invoked solely from
13846 % \!\pcol@specialoutput! to process the \!\output! request made by
13847 % \!\flushpage!. We invoke \!\pcol@makeflushedpage! giving it \!\@colht! as
13848 % the height of each \colpage{} to have the ship-out image of the
13849 % \tpage{} including its \spanning{} and \Scfnote{}s in \!\@outputbox! whose
13850 % height is then set to be \!\textheight!\footnote{
13851 % 
13852 % Just in case because the height of source \cs{@outputbox} should be exactly
13853 % \cs{textheight} though not specified so on its construction in
13854 % \cs{pcol@makeflushedpage}.},
13855 % 
13856 % ensuring that its depth is capped by $\!\boxmaxdepth!=\!\@maxdepth!$. We
13857 % also perform these height setting and depth capping on \!\pcol@rightpage!
13858 % if $\CL<\C$ to mean \parapag{}ing. Then we invoke \!\@outputpage! for
13859 % shipping out, and then finally \!\pcol@freshpage! to have a new page to
13860 % start new \colpage{}s in it.
13861 % 
13862 % \begin{macrocode}
13863 %% Special Output Routines: Page Flushing
13864
13865 \def\pcol@output@flush{%
13866 \pcol@makeflushedpage\@colht
13867 \pcol@Logstart\pcol@output@flush
13868 \setbox\@outputbox\vbox to\textheight{\boxmaxdepth\@maxdepth
13869 \unvbox\@outputbox}%
13870 \ifnum\pcol@ncolleft<\pcol@ncol
13871 \setbox\pcol@rightpage\vbox to\textheight{\boxmaxdepth\@maxdepth
13872 \unvbox\pcol@rightpage}%
13873 \fi
13874 \pcol@Logend\pcol@output@flush
13875 \@outputpage
13876 \pcol@freshpage}
13877
13878 % \end{macrocode}
13879 % \end{macro}
13880 %
13881 % \begin{macro}{\pcol@output@clear}
13882 % \changes{v1.0}{2011/10/10}
13883 % {Rename \cs{pcol@makelastpage} as \cs{pcol@makeflushedpage}.}
13884 % \changes{v1.0}{2011/10/10}
13885 % {Remove unnecessary increment of \cs{pcol@page} and assignment of
13886 % \cs{@colht}.}
13887 % \changes{v1.2-2}{2013/05/11}
13888 % {Add \cs{pcol@Logstart} and \cs{pcol@Logend}.}
13889 % \changes{v1.2-7}{2013/05/11}
13890 % {Add $\cs{boxmaxdepth}\EQ\cs{@maxdepth}$ for depth capping.}
13891 % \changes{v1.3-2}{2013/09/17}
13892 % {Add depth capping of \cs{pcol@rightpage} and building an empty
13893 % right parallel-page for each page-wise float page.}
13894 % \changes{v1.3-3}{2013/09/17}
13895 % {Add background painting of float pages.}
13896 % \changes{v1.32-3}{2015/10/10}
13897 % {Add $\hbox{\cs{f@depth}}\EQ0$ to override
13898 % $\hbox{\cs{f@depth}}\EQ\hbox{\texttt{1sp}}$ done by
13899 % \cs{@dblfloatplacement}.}
13900 % 
13901 % The macro \!\pcol@output@clear! is invoked solely from
13902 % \!\pcol@specialoutput! to process the \!\output! request made by
13903 % \!\clearpage!. The first part up to \!\@outputpage! and the last line of
13904 % this macro are same as \!\pcol@output@flush! to flush the \tpage{} and to
13905 % have a newpage. In the remaining mid part, we invoke \!\pcol@flushfloats!
13906 % to ship out all deferred \cwise{} floats in all columns if any, and
13907 % then do it for \pwise{} floats by the following invocations enclosed in a
13908 % group; letting $\!\pcol@rightpage!=\bot$ for ordinary paging;
13909 % \!\@dblfloatplacement! to set up placement parameters followed by
13910 % $\!\f@depth!=0$ to nullify the setting $\!\f@depth!=|1sp|$ possibly done
13911 % by it as discussed in the item-(\ref{item:ovv-float-@dblfloatplacement})
13912 % of \secref{sec:imp-ovv-float}; \!\@makefcolumn! with
13913 % \!\@dbldeferlist! to have a \fpage{} in \!\@outputbox! if any; and a loop
13914 % of \bgpaint{} of \!\@outputbox! and, if $\CL<\C$, of empty
13915 % \!\pcol@rightpage!, and \!\@outputpage! followed by \!\@makefcolumn!
13916 % repeated while we have a \fpage{}, i.e., $\CSIndex{if@fcolmade}=\true$.
13917 %
13918 % Note that the mid part is same as that found in \!\@doclearpage! but we
13919 % omit various adjuncts surrounding it as follows; examination of
13920 % \CSIndex{if@twocolumn} because we should have multiple columns;
13921 % examination of \CSIndex{if@firstcolumn} because we have to clear the page
13922 % immediately even when we are not in the first column; concatenating
13923 % \!\@dbltoplist! with \!\@dbldeferlist! and clearing it because the author
13924 % believes \!\@dbltoplist! must be empty on the invocation of this macro;
13925 % and letting $\!\@colht!=\!\textheight!$ because \!\pcol@flushfloats! did
13926 % it.
13927 % 
13928 % \begin{macrocode}
13929 \def\pcol@output@clear{%
13930 \pcol@makeflushedpage\@colht
13931 \pcol@Logstart\pcol@output@clear
13932 \setbox\@outputbox\vbox to\textheight{\boxmaxdepth\@maxdepth
13933 \unvbox\@outputbox}%
13934 \ifnum\pcol@ncolleft<\pcol@ncol
13935 \setbox\pcol@rightpage\vbox to\textheight{\boxmaxdepth\@maxdepth
13936 \unvbox\pcol@rightpage}%
13937 \fi
13938 \pcol@Logend\pcol@output@clear
13939 \@outputpage
13940 \pcol@flushfloats
13941 \begingroup
13942 \setbox\pcol@rightpage\box\voidb@x
13943 \@dblfloatplacement \let\f@depth\z@
13944 \@makefcolumn\@dbldeferlist
13945 \@whilesw\if@fcolmade\fi{%
13946 \def\pcol@bg@floatheight{\pcol@bg@textheight}%
13947 \setbox\@outputbox\vbox to\textheight{%
13948 \pcol@bg@paintbox{Ff}\unvbox\@outputbox}%
13949 \ifnum\pcol@ncolleft<\pcol@ncol
13950 \setbox\pcol@rightpage\vbox to\textheight{\pcol@bg@paintbox{Ff}\vfil}%
13951 \fi
13952 \@outputpage
13953 \@makefcolumn\@dbldeferlist}%
13954 \endgroup
13955 \pcol@freshpage}
13956
13957 % \end{macrocode}
13958 % \end{macro}
13959 %
13960 % \begin{macro}{\pcol@makeflushedpage}
13961 % \changes{v1.0}{2011/10/10}
13962 % {Renamed from \cs{pcol@makelastpage}.}
13963 % \changes{v1.0}{2011/10/10}
13964 % {Rename \cs{ifpcol@textonly} as \cs{ifpcol@nospan}.}
13965 % \changes{v1.0}{2011/10/10}
13966 % {Judge the last page is empty if $V_P\EQ-\infty$ instead of $V_P<0$.}
13967 % \changes{v1.2-2}{2013/05/11}
13968 % {Revise reflecting the redesign of page context.}
13969 % \changes{v1.3-2}{2013/09/17}
13970 % {Completely redesigned with new macro \cs{pcol@imakeflushedpage}.}
13971 % \changes{v1.3-3}{2013/09/17}
13972 % {Add background painting of page-wise floats, and a part of
13973 % operations for column-separation rule drawing and background
13974 % painting of page-wise footnotes.} 
13975 % \changes{v1.3-6}{2013/09/17}
13976 % {Revise the mechanism of special care about last page introducing
13977 % \cs{ifpcol@dfloats}.}
13978 % 
13979 % The macro $\!\pcol@makeflushedpage!\arg{ht}$ is invoked from
13980 % \!\pcol@output@flush! or \!\pcol@output@clear! with $\arg{ht}=\!\@colht!$
13981 % and from \!\pcol@output@end! with $\arg{ht}=\!\pcol@colht!$. At first, we
13982 % invoke \!\pcol@output@switch! with setting $\CSIndex{ifpcol@clear}=\true$
13983 % to flush all pages up to $\ptop-1$ and to let $\cc_c(\vb^b)$ have the
13984 % ship-out image of the main vertical list of each \colpage{} $c$ in
13985 % $\ptop$. This invocation also lets $\!\pcol@colht!=\VPP$ so that hereafter
13986 % we will refer $\VPP$ through $\arg{ht}$ if it is $\!\pcol@colht!$ for
13987 % \lpage. Then after obtaining $\ptop$'s \pctext{} to have
13988 % $\page(\ptop)=\pp^p(\ptop)$, $\!\@colht!=\pp^h(\ptop)$ and
13989 % \CSIndex{ifpcol@nospan} by \!\pcol@getcurrpinfo!, we build the ship-out
13990 % image of $\ptop$ in \!\@outputbox!, and \!\pcol@rightpage! if
13991 % \parapag{}ing, taking special care of the \lpage{} case as follows.
13992 % 
13993 % \begin{enumerate}\def\labelenumi{(\arabic{enumi})}
13994 % \item\label{item:mfp-nonlast}
13995 % If $\CSIndex{ifpcol@lastpage}=\false$, each of $\cc_c(\vb^b)$ has ship-out
13996 % image even if some or all of them are empty. It is unnecessary to be aware
13997 % of the perfectly empty case because it should mean the page $\ptop$ is
13998 % made blank intentionally.
13999 %
14000 % \item\label{item:mfp-last-dfloats}
14001 % If $\CSIndex{ifpcol@lastpage}=\true$ but $\CSIndex{ifpcol@dfloats}=\true$
14002 % too, the last page must have {\em full size} because we will have parallel
14003 % columned pages having \fcolumn{}s for deferred floats. However, if the
14004 % page has nothing, i.e., $\pp^i(\ptop)=\pp^f(\ptop)=\bot$ and
14005 % $\VPP=-\infty$, we must let $\!\@outputbox!=\bot$ (and
14006 % $\!\pcol@rightpage!=\bot$ as well) to avoid an unnecessary blank page is
14007 % shipped out. On the other hand, if $\pp^i(\ptop)\neq\bot$ or
14008 % $\pp^f(\ptop)\neq\bot$ while $\VPP=-\infty$, we build a full size page as
14009 % usual but letting $\!\@textbottom!=\!\vfil!$ temporarily to avoid underfull
14010 % in the process of building columns. Note that if $\pp^f(\ptop)\neq\bot$,
14011 % the \Scfnote{}s are always put into \!\@outputbox! regardless
14012 % \CSIndex{ifpcol@mgfnote} because the \lpage{} is not combined with
14013 % \postenv.
14014 %
14015 % \item\label{item:mfp-last-empty}
14016 % If $\CSIndex{ifpcol@lastpage}=\true$, $\CSIndex{ifpcol@dfloats}=\false$
14017 % and $\VPP=-\infty$, we have to let $\!\@outputbox!=\bot$ unless
14018 % $\pp^i(\ptop)\neq\bot$ or $\pp^f(\ptop)\neq\bot$ having non-\Mgfnote{}s.
14019 % If $\pp^f(\ptop)$ has non-\Mgfnote{}s, \!\@outputbox! and
14020 % \!\pcol@rightpage! must have $\pp^f(\ptop)$ possibly with $\pp^i(\ptop)$
14021 % but without any columns, and must be put into the main vertical list as
14022 % the leading part of \postenv{} by modifying $\VPP=0$. On the other hand
14023 % $\pp^f(\ptop)=\bot$ or it has \Mgfnote{}s, \!\@outputbox! must have only
14024 % $\pp^i(\ptop)$\footnote{
14025 % 
14026 % \!\pcol@rightpage! must have the counterpart in right \parapag{}e if the
14027 % \spanning{} is \preenv, while it is made $\bot$ by \!\pcol@output@end! if
14028 % the \spanning{} are \pwise{} floats.}.
14029 % 
14030 % Since \pwise{} floats become ordinary floats in \postenv, we cannot paint
14031 % its \bground{} and must remove \!\dbltextfloatsep! at the bottom of
14032 % $\pp^i(\ptop)$.
14033 %
14034 % \item\label{item:mfp-last-nonempty}
14035 % If $\CSIndex{ifpcol@lastpage}=\true$, $\CSIndex{ifpcol@dfloats}=\false$
14036 % and $\VPP>-\infty$, \!\@outputpage! and \!\pcol@rightpage! must have short
14037 % columns of $\VPP$ tall, together with $\pp^i(\ptop)$ as in non-\lpage{}s
14038 % but without $\pp^f(\ptop)$ if it has \Mgfnote{}s.
14039 % \end{enumerate}
14040 % 
14041 % To implement a part of special cares above, we at first let
14042 % $\CSIndex{if@tempswa}=\true$ iff $\cs{ifpcol@}\~|lastpage|=\false$,
14043 % 
14044 % \CSINDEX{ifpcol@lastpage}
14045 % 
14046 % $\VPP>-\infty$ or $\pp^f(\ptop)\neq\bot$.
14047 % 
14048 % \begin{macrocode}
14049 \def\pcol@makeflushedpage#1{%
14050 \pcol@cleartrue \pcol@output@switch \pcol@clearfalse
14051 \pcol@getcurrpinfo{\global\c@page}{\global\@colht}\@tempskipa
14052 \ifpcol@lastpage \@tempswafalse \else \@tempswatrue \fi
14053 \ifdim\pcol@colht=-\maxdimen\else \@tempswatrue \fi
14054 \ifvoid\pcol@footins\else \@tempswatrue \fi
14055 % \end{macrocode}
14056 %
14057 % Next, if $\CSIndex{ifpcol@nospan}=\true$ to mean the page $\ptop$ does not
14058 % have \spanning{} in $\pp^i(\ptop)$, we initialize both \!\@outputbox! and
14059 % \!\pcol@rightpage! to be $\bot$. Otherwise, after letting
14060 % $\CSIndex{if@tempswa}=\true$ if $\CSIndex{ifpcol@dfloats}=\true$ to make the
14061 % \lpage{} full size if we are working on it as discussed in\Tie
14062 % (\ref{item:mfp-last-dfloats}), we put $\pp^i(\ptop)$ in \!\@outputbox!,
14063 % and paint its \bground{} by \!\pcol@bg@paintbox! \!\edef!ining the height
14064 % parameter \!\pcol@bg@floatheight! with $h$ being the height-plus-depth of
14065 % $\pp^i(\ptop)$ with the following two exceptions; one is the case of
14066 % $\CSIndex{ifpcol@firstpage}={\true}$ to mean we are in \spage{} and thus
14067 % the \spanning{} is \preenv{} having already been painted by
14068 % \!\pcol@output@start!; and the other is the case of
14069 % $\CSIndex{if@tempswa}=\false$ to mean we are working on a truly \lpage{}
14070 % being empty except for the \spanning{} itself and thus the \pwise{}
14071 % floats become a part of deferred floats in \postenv{} as discussed in\Tie
14072 % (\ref{item:mfp-last-empty}). In the latter exceptional case, excluding
14073 % the case that the \lpage{} is also the \spage\footnote{
14074 % 
14075 % Extremely exceptional because the closing environment does not have
14076 % anything.},
14077 % 
14078 % we also remove the last skip being \!\dbltextfloatsep! so that those
14079 % floats are naturally connected with other floats given in
14080 % \postenv{} also as discussed in\Tie(\ref{item:mfp-last-empty}). Then we
14081 % {\em pack} the \!\@outputbox! in itself by \!\vbox! so that any
14082 % stretch\slash shrink factors in it cannot affect the ship-out image
14083 % especially when we paint its \bground{}\footnote{
14084 % 
14085 % Though that hardly happens.}.
14086 % 
14087 % Then we do the similar procedure for \!\pcol@rightpage! and make its height
14088 % and depth equal to those of \!\@outputbox!\footnote{
14089 % 
14090 % If \pwise{} floats become a part of \postenv's floats, \!\pcol@rightpage!
14091 % will be made $\bot$ by \!\pcol@output@end! afterward.}.
14092 % 
14093 % Finally we temporarily add $h$ to \!\topmargin! as done in
14094 % \!\pcol@ioutputelt! so that \bgpaint{} of columns and so on with
14095 % \bginfext{} can reach the paper top edge.
14096 % 
14097 % \changes{v1.3-6}{2013/09/17}
14098 % {Revise the condition of leaving page-wise floats as ordinary
14099 % post-environment floats using \cs{if@tempswa} with
14100 % \cs{ifpcol@dfloats}.}
14101 % \changes{v1.32-2}{2015/10/10}
14102 % {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
14103 % 
14104 % \begin{macrocode}
14105 \begingroup
14106 \ifpcol@nospan
14107 \global\setbox\@outputbox\box\voidb@x
14108 \global\setbox\pcol@rightpage\box\voidb@x
14109 \else
14110 \ifpcol@dfloats \@tempswatrue \fi
14111 \let\@elt\relax
14112 \edef\pcol@bg@floatheight{%
14113 \@elt{\number\ht\pcol@spanning sp}\@elt{\number\dp\pcol@spanning sp}}%
14114 \def\reserved@a{%
14115 \ifpcol@firstpage\else \if@tempswa \pcol@bg@paintbox{Ff}\fi\fi}%
14116 \@tempdima\ht\pcol@spanning \advance\@tempdima\dp\pcol@spanning
14117 \global\setbox\@outputbox\vbox{%
14118 \reserved@a \unvbox\pcol@spanning
14119 \ifpcol@firstpage\else \if@tempswa\else \unskip \fi\fi}%
14120 \global\setbox\@outputbox\vbox{\box\@outputbox}%
14121 \pcol@Fb
14122 \@cons\@freelist\pcol@spanning
14123 \pcol@Fe{makeflushedpage(spanning)}%
14124 \ifnum\pcol@ncolleft<\pcol@ncol
14125 \global\setbox\pcol@rightpage\vbox{%
14126 \ifpcol@paired\else \advance\c@page\@ne \fi
14127 \reserved@a \unvbox\pcol@rightpage}%
14128 \global\ht\pcol@rightpage\ht\@outputbox
14129 \global\dp\pcol@rightpage\dp\@outputbox
14130 \global\setbox\pcol@rightpage\vbox{\box\pcol@rightpage}%
14131 \fi
14132 \advance\topmargin\@tempdima
14133 \fi
14134 % \end{macrocode}
14135 %
14136 % Next, after \!\global!ly letting $\CSIndex{ifpcol@firstpage}=\false$ because
14137 % we will ship a page which may be the \spage{} shortly, we build the
14138 % ship-out image of columns if required fundamentally by
14139 % $\CSIndex{if@tempswa}=\true$. First,
14140 % if the page $\ptop$ has \Scfnote{}s, we shrink
14141 % $\!\@colht!={\pp^h}(\ptop)$ by \!\pcol@shrinkcolbyfn! to keep the room for
14142 % the footnotes, to have $H=\!\@pageht!$ being the possibly shrunk
14143 % $\pp^h(\ptop)$ for the reference
14144 % in \!\pcol@imakeflushedpage! after the further possible modification of
14145 % \!\@colht! we will make shortly. Second, if
14146 % $\CSIndex{ifpcol@lastpage}=\true$ but $\CSIndex{ifpcol@dfloats}=\true$
14147 % too, we turn $\CSIndex{ifpcol@lastpage}=\false$ because we need a
14148 % full-sized \lpage{}, temporarily letting $\!\@textbottom!=\!\vfil!$ if
14149 % $\VPP=-\infty$ to avoid underfull due to perfectly empty \colpage{}s as
14150 % discussed in\Tie(\ref{item:mfp-last-dfloats})\footnote{
14151 % 
14152 % Each \colpage{} $cc_c(\vb^b)$ itself exists because the empty \colpage{}
14153 % has been visited by \cscan{} prior to \!\output! request for environment
14154 % closing.}.
14155 % 
14156 % Third, if we are working on a truly \lpage{} and $\arg{ht}<H$ to mean the
14157 % tallest column is shorter than $H$, we let $\!\@colht!=\arg{ht}$ to let
14158 % \!\@makecol! build short \colpage{}s. Note that it is definitely
14159 % $\arg{ht}\leq H$ because the \pfcheck{} on the \lpage{} makes that sure.
14160 % Fourth and finally, unless all columns in truly \lpage{} are empty as
14161 % discussed in (\ref{item:mfp-last-empty}), we invoke
14162 % $\!\pcol@imakeflushedpage!\<\Cfrom\>\<\Cto\>\<b\>$ once or twice, to put
14163 % columns in right \parapag{}e to $b=\!\pcol@rightpage!$ with
14164 % $\LBRP\Cfrom\Cto=\LBRP\CL\C$ if $\CL<\C$, and then to put left ones in
14165 % $b=\!\@outputbox!$ with $\LBRP\Cfrom\Cto=\LBRP0\CL$ always\footnote{
14166 % 
14167 % The order of right to left is not essential in this macro but we follow
14168 % the convention in \!\pcol@outputelt!.}.
14169 % 
14170 % \changes{v1.0}{2011/10/10}
14171 % {Let \cs{@colht} be $\langle\mathit{ht}\rangle$ if the former is
14172 % less than the latter.}
14173 % \changes{v1.0}{2011/10/10}
14174 % {Add special care of the float column in the last page.}
14175 % \changes{v1.2-2}{2013/05/11}
14176 % {Add \cs{@colht} shrinking by page-wise footnotes.}
14177 % \changes{v1.3-3}{2013/09/17}
14178 % {Add \cs{@colht} and \cs{relax} as the first and third argument
14179 % of \cs{pcol@shrinkcolbyfn} for all of three invocations of it.}
14180 % \changes{v1.3-6}{2013/09/17}
14181 % {Remove empty column scan for \cs{if@fcolmade} because it is now
14182 % unnecessary thanks to \cs{ifpcol@dfloats}.}
14183 % \changes{v1.3-6}{2013/09/17}
14184 % {Revise the condition of column-page building and setting of
14185 % \cs{@colht}.}
14186 % 
14187 % \begin{macrocode}
14188 \global\pcol@firstpagefalse
14189 \if@tempswa
14190 \ifvoid\pcol@footins\else
14191 \pcol@shrinkcolbyfn\@colht\pcol@footins\relax
14192 \fi
14193 \let\pcol@@hfil\relax \@pageht\@colht
14194 \ifpcol@lastpage \ifpcol@dfloats
14195 \ifdim\pcol@colht<\z@ \def\@textbottom{\vfil}\fi
14196 \pcol@lastpagefalse
14197 \fi\fi
14198 \ifpcol@lastpage \ifdim#1<\@colht \@colht#1\fi\fi
14199 \ifdim\@colht<\z@ \else
14200 \ifnum\pcol@ncolleft<\pcol@ncol
14201 \pcol@imakeflushedpage\pcol@ncolleft\pcol@ncol\pcol@rightpage
14202 \fi
14203 \pcol@imakeflushedpage\z@\pcol@ncolleft\@outputbox
14204 \fi
14205 \fi
14206 % \end{macrocode}
14207 %
14208 % After putting all \colpage{}s, we examine if the page $\ptop$ has
14209 % \Scfnote{}s in $\pp^f(\ptop)$. If so, and unless $\ptop$ is a truly
14210 % \lpage{} and \Mgfnote{} typesetting is in effect to mean the \Scfnote{}s
14211 % will be merged with \postenv{}, we put the footnotes in $\pp^f(\ptop)$
14212 % below the \colpage{}s. Prior to this however, we let
14213 % \Midx{\!\pcol@fnheight@lpage!} have the height-plus-depth of the footnote,
14214 % so that \!\pcol@output@end! know the size for the \bgpaint{} of the
14215 % footnotes, which \!\pcol@imakeflushedpage! performed for non-\lpage{}s.
14216 % We also put an empty box of the size into \!\pcol@rightpage! by
14217 % \!\pcol@phantom! together with the \!\skip! component of $\pp^f(\ptop)$ to
14218 % keep the space necessary especially when $\ptop$ is the \lpage. Then we
14219 % put the footnotes in $\pp^f(\ptop)$ into \!\@outputpage! by
14220 % \!\pcol@putfootins!, reclaiming the contents of $\pp^f(\ptop)$ and letting
14221 % $\pp^f(\ptop)=\bot$ so that \!\pcol@output@end! will be unaware of the
14222 % footnotes. We also let $\VPP=\!\pcol@colht!=0$ if $\ptop$ is a truly
14223 % \lpage{} and it had $-\infty$ to indicate that the \lpage{} is not empty
14224 % but has footnotes as discussed in\Tie(\ref{item:mfp-last-empty}).
14225 % 
14226 % \changes{v1.2-2}{2013/05/11}
14227 % {Add incorporation of page-wise footnotes.}
14228 % \changes{v1.3-6}{2013/09/17}
14229 % {page-wise footnotes for the last page followed by pages for
14230 % deferred column-wise floats are now put by this macro.}
14231 % \changes{v1.32-2}{2015/10/10}
14232 % {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
14233 % 
14234 % \begin{macrocode}
14235 \gdef\pcol@fnheight@lpage{0pt}%
14236 \ifvoid\pcol@footins\else
14237 \@tempswatrue \ifpcol@lastpage \ifpcol@mgfnote \@tempswafalse \fi\fi
14238 \if@tempswa
14239 \pcol@Log\pcol@makeflushedpage{output}\pcol@footins
14240 \@tempdima\ht\pcol@footins \advance\@tempdima\dp\pcol@footins
14241 \xdef\pcol@fnheight@lpage{\number\@tempdima sp}%
14242 \ifnum\pcol@ncolleft<\pcol@ncol
14243 \global\setbox\pcol@rightpage\vbox{\unvbox\pcol@rightpage
14244 \vskip\skip\pcol@footins \nointerlineskip
14245 \pcol@phantom\pcol@footins \vskip\z@}%
14246 \fi
14247 \global\setbox\@outputbox\vbox{%
14248 \unvbox\@outputbox \pcol@putfootins\pcol@footins}%
14249 \pcol@Fb
14250 \@cons\@freelist\pcol@footins \gdef\pcol@footins{\voidb@x}%
14251 \pcol@Fe{makeflushedpage(pagefn)}%
14252 \ifdim\pcol@colht=-\maxdimen \global\pcol@colht\z@ \fi
14253 \fi
14254 \fi
14255 \endgroup}
14256
14257 % \end{macrocode}
14258 % \end{macro}
14259 %
14260 % \begin{macro}{\pcol@imakeflushedpage}
14261 % \changes{v1.3-2}{2013/09/17}
14262 % {Introduced for parallel-paging.}
14263 % \changes{v1.3-3}{2013/09/17}
14264 % {Implement column-separating rule and background painting of
14265 % columns, column-separating gaps, spanning texts and page-wise
14266 % footnotes.}
14267 % \changes{v1.3-4}{2013/09/17}
14268 % {Implement variable-width column-separating gaps.}
14269 %
14270 % The macro $\!\pcol@imakeflushedpage!\<\Cfrom\>\<\Cto\>\arg{b}$ is invoked
14271 % solely in \!\pcol@makeflushedpage! but can be twice with
14272 % $(\Cfrom,\Cto,b)=(\CL,\C,\!\pcol@rightpage!)$ if \parapag{}ing is in effect
14273 % and with $(\Cfrom,\Cto,b)=(0,\CL,\!\@outputbox!)$ always, to build the
14274 % ship-out image of the right or left \parapag{}e $\ptop$ in the box $b$
14275 % already having \spanning{} or its blank counterpart if any, respectively.
14276 %
14277 % After opening the \!\vbox! of the ship-out image for $b$, at first we
14278 % examine if $\CSIndex{ifpcol@paired}={\false}$ and $\Cfrom>0$, and if so we
14279 % temporarily increment $\page(\ptop)$ by one so that we check its parity
14280 % for \mirror{}ed \bgpaint{} correctly. Then if the page $\ptop$ has
14281 % \Scfnote{}s in $\pp^f(\ptop)$, we paint its \bground, or that of its blank
14282 % counterpart, by \!\pcol@bg@paintbox! \!\def!ining the parameter
14283 % \!\pcol@bg@footnoteheight! with the height-plus-depth of $\pp^f(\ptop)$,
14284 % as the very first element of the ship-out image as done in
14285 % \!\pcol@ioutputelt!, unless $\ptop$ is the truly \lpage{} for which the
14286 % \bgpaint{} is done in \!\pcol@output@end!. Then we put \spanning{} in $b$
14287 % itself if any.
14288 %
14289 % Next, we invoke \!\pcol@buildcolseprule! for \cseprule{} drawing and
14290 % \bgpaint{} giving it $H$ in \!\@colht! possibly shrunk from $\pp^h(\ptop)$
14291 % by \Scfnote{}s, $\LBRP\Cfrom\Cto$ for the set of columns to be put, and
14292 % \!\@maxdepth! for non-\lpage{}s to paint the \bground{}s of columns and
14293 % \csepgap{}s so that those of the last segment reach the page bottom, while
14294 % for \lpage{} we give 0 to let the bottom be the real bottom of the
14295 % columns. Then we put the painted \bground{}s in \!\@tempboxa!
14296 % immediately.
14297 % 
14298 % \begin{macrocode}
14299 \def\pcol@imakeflushedpage#1#2#3{\global\setbox#3\vbox{%
14300 \ifpcol@paired\else\ifnum#1=\z@\else \advance\c@page\@ne \fi\fi
14301 \ifvoid\pcol@footins\else \ifpcol@lastpage\else
14302 \def\pcol@bg@footnoteheight{%
14303 \@elt{\ht\pcol@footins}\@elt{\dp\pcol@footins}}%
14304 \pcol@bg@paintbox{Nn}%
14305 \fi\fi
14306 \unvbox#3\nointerlineskip
14307 \ifpcol@lastpage \pcol@buildcolseprule\@colht#1#2\z@
14308 \else \pcol@buildcolseprule\@colht#1#2\@maxdepth
14309 \fi
14310 \unvbox\@tempboxa
14311 % \end{macrocode}
14312 %
14313 % Now we put columns in a \!\hbox! of $\WT=\!\textwidth!$ wide. That is,
14314 % for each $c$, being $c'$ or $\C-1-c'$ for the $c'$-th iteration determined
14315 % by \!\pcol@swapcolumn! according to the effectiveness of \cswap{} and the
14316 % parity of $\page(\ptop)$, we obtain $c$'s \cctext{} $\cc_c$ by
14317 % \!\pcol@getcurrcol!, move $\cc_c(\vb^b)$ into \!\box!|255|, and let
14318 % $\!\footins!=\cc_c(\ft)$ by \!\pcol@getcurrfoot! returning it to
14319 % \!\@freelist! if $c$ has \Mcfnote{}s.
14320 %
14321 % After that we examine if $\cc_c(\tr)=\infty$ to mean we are working on the
14322 % \lpage{} and the \colpage{} is for a \fcolumn{} whose floats can be put as
14323 % top floats, and let $\!\topfigrule!=\!\relax!$ temporarily because the
14324 % floats are not top ones in reality, if so. Note that the abnormal setting
14325 % $\cc_c(\tr)=\infty$ is not recovered because it will never be referred to
14326 % and the register \!\@toproom! it represents will be updated with correct
14327 % value before it is referred to in \postenv. Then we also check
14328 % $\arg{ht}=H$ to mean the \lpage{} is full size. If both of them hold,
14329 % the floats in $\cc_c(\tl)$ should be (or may be) put in the \fcolumn{} as
14330 % usual and thus we put them in \!\@outputbox! of $H$ tall by
14331 % \!\pcol@makefcolpage!. Otherwise we invoke \!\pcol@@makecol!\footnote{
14332 % 
14333 % Not \cs{pcol@makecol} because the main vertical list has \!\vfil! and, if
14334 % it has a \sync{}ation point, a infinite shrink by \cs{pcol@synccolumn} at
14335 % its tail already, and we should not do any special operations for
14336 % \Scfnote{}s. Also it is not \cs{@makecol} because we need to ensure the
14337 % depth of resulting \cs{@outputbox} is capped.},
14338 % 
14339 % to have the ship-out image of the \colpage{} in \!\@outputbox!, possibly
14340 % only for the deferred floats in $\cc_c(\tl)$ but without \!\topfigrule! in
14341 % this case. Note that we don't take care of the stretch\slash shrink of
14342 % \!\skip!\!\footins! for \Scfnote{}s because \pfcheck{} on the \colpage{}
14343 % makes it sure that the natural height of the \colpage{} cannot be greater
14344 % than \!\@colht!. Also note that we give \!\@maxdepth! to
14345 % \!\pcol@@makecol! for non-\lpage{}s for depth capping, but for the
14346 % \lpage{} we pass 0 to the macro because $H=\!\@colht!$ should be large
14347 % enough to accommodate everything in the column including its last box even
14348 % if the box is unusually deep.
14349 %
14350 % Then we put the \!\@outputbox! above in a \!\hbox! of \!\columnwidth! wide
14351 % preceded by \!\pcol@@hfil! being \!\relax! for the first column, while
14352 % it is $\!\pcol@hfil!\<c^g\>$, where $c^g=\!\pcol@colsepid!$ being $c$ or
14353 % $c-1$ without or with \cswap{} respectively, to put a \csepgap{} possibly
14354 % with \cseprule{} segments in \!\pcol@tempboxa! built by
14355 % \!\pcol@buildcolseprule!. Finally, we save \cctext{} especially those
14356 % for float parameters into $\cc_c$ by \!\pcol@setcurrcolnf! because all
14357 % \Mcfnote{}s have been shipped out.
14358 % 
14359 % \changes{v1.2-4}{2013/05/11}
14360 % {Add column-swapping for even pages if specified.}
14361 % \changes{v1.2-2}{2013/05/11}
14362 % {Revise reflecting the redesign of \cs{pcol@getcurrfoot}.}
14363 % \changes{v1.2-2}{2013/05/11}
14364 % {Add \cs{pcol@Logstart} and \cs{pcol@Logend}.}
14365 % \changes{v1.2-7}{2013/05/11}
14366 % {Enclose the column-page building process in a group to fix the bug
14367 % which lets $\cs{topfigrule}\EQ\cs{relax}$ affecting to another
14368 % column.}
14369 % \changes{v1.2-7}{2013/05/11}
14370 % {Replace the sequence of operations to make a usual float column
14371 % with \cs{@toplist} with the newly introduced
14372 % \cs{pcol@makefcolpage}.}
14373 % \changes{v1.2-7}{2013/05/11}
14374 % {Replace \cs{@makecol} with \cs{pcol@@makecol} to cap the depth of
14375 % \cs{@outputbox} by \cs{@maxdepth} even with p\string\LaTeX.}
14376 % \changes{v1.3-6}{2013/09/17}
14377 % {Add \cs{@maxdepth} or 0 as the argument of \cs{pcol@@makecol} to
14378 % fix the problem that the last page is too large due to
14379 % \cs{@maxdepth}, by the latter.}
14380 % \changes{v1.3-6}{2013/09/17}
14381 % {Remove the examination of $\kappa_c(\lambda_d)$ for
14382 % \cs{if@fcolmade} because it is made unnecessary now by
14383 % \cs{ifpcol@dfloats}.}
14384 % \changes{v1.32-2}{2015/10/10}
14385 % {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
14386 % 
14387 % \begin{macrocode}
14388 \hb@xt@\textwidth{%
14389 \@tempcntb#1\@whilenum\@tempcntb<#2\do{%
14390 \pcol@swapcolumn\@tempcntb\pcol@currcol#1#2\relax
14391 \pcol@getcurrcol
14392 \setbox\@cclv\box\@currbox
14393 \ifvoid\pcol@currfoot\else
14394 \pcol@Fb
14395 \@cons\@freelist\pcol@currfoot
14396 \pcol@Fe{imakeflushedpage(colfn)}%
14397 \fi
14398 \pcol@getcurrfoot\box
14399 \@tempswafalse
14400 \begingroup
14401 \ifdim\@toproom=\maxdimen
14402 \let\topfigrule\relax \ifdim\@colht=\@pageht \@tempswatrue \fi
14403 \fi
14404 \if@tempswa
14405 \pcol@Logstart{\pcol@makeflushedpage(1)}%
14406 \setbox\@outputbox\pcol@makefcolpage
14407 \pcol@Logend{\pcol@makeflushedpage(1)}%
14408 \else
14409 \pcol@Logstart{\pcol@makeflushedpage(2)}%
14410 \ifpcol@lastpage \pcol@@makecol\z@ \else \pcol@@makecol\@maxdepth \fi
14411 \pcol@Logend{\pcol@makeflushedpage(2)}%
14412 \fi
14413 \pcol@@hfil \hb@xt@\columnwidth{\box\@outputbox\hss}%
14414 \endgroup
14415 \edef\pcol@@hfil{\noexpand\pcol@hfil{\pcol@colsepid}}%
14416 \pcol@setcurrcolnf
14417 \advance\@tempcntb\@ne}}}}
14418
14419 % \end{macrocode}
14420 % \end{macro}
14421 %
14422 % \begin{macro}{\pcol@flushfloats}
14423 % \changes{v1.0}{2011/10/10}
14424 % {Add reinitialization of \cs{@colht}.}
14425 % \changes{v1.2-4}{2013/05/11}
14426 % {Add column-swapping for even pages if specified.}
14427 % \changes{v1.3-2}{2013/09/17}
14428 % {Completely redesigned with new macro \cs{pcol@iflushfloats}.}
14429 % \begin{macro}{\pcol@iflushfloats}
14430 % \changes{v1.3-2}{2013/09/17}
14431 % {Introduced for parallel-paging.}
14432 % \changes{v1.3-3}{2013/09/17}
14433 % {Implement column-separating rule and background painting of
14434 % columns and column-separating gaps}
14435 % \changes{v1.3-4}{2013/09/17}
14436 % {Implement variable-width column-separating gaps.}
14437 % 
14438 % The macro \!\pcol@flushfloats! is invoked from \!\pcol@output@clear! and
14439 % \!\pcol@output@end! to flush all deferred \cwise{} floats in each
14440 % column if any. After letting $\!\@colht!=\!\textheight!$ for
14441 % \fcolumn{}s, we iterate shipping out a page having \fcolumn{}s while
14442 % $\CSIndex{if@fcolmade}=\exists c\In0\C:(\cc_c(\dl)\neq())$.
14443 %
14444 % In the loop, we initialize $\CSIndex{if@fcolmade}=\false$, and then
14445 % invoke \!\pcol@iflushfloats! twice or once according to $\CL<\C$ or not to
14446 % mean \parapag{}ing is in effect or not, respectively. That is, if
14447 % $\CL<\C$ we invoke the macro with $\LBRP\CL\C$ and \!\pcol@rightpage! for
14448 % the right \parapag{}e, and do it with $\LBRP0\CL$ and \!\@outputbox!
14449 % always. Note that if $\CL=\C$, we let $\!\pcol@rightpage!=\bot$ to tell
14450 % \!\@outputpage!, which we invoke at the end of the loop to ship out a page
14451 % or a \parapag{}e pair, that the \parapag{}ing is not in effect.
14452 %
14453 % The macro $\!\pcol@iflushfloats!\<\Cfrom\>\<\Cto\>\<b\>$ opens
14454 % a \!\vbox! to be set into $b$. Then if $\CSIndex{ifpcol@paired}={\false}$
14455 % and $\Cfrom>0$ to mean we are working on a right \npaired{} \parapag{}e,
14456 % we temporarily add \!\c@page! by one for page parity examination for
14457 % \mirror{}ed \bgpaint. Then, the macro \!\pcol@buildcolseprule! is invoked
14458 % with $\!\@colht!=\!\textheight!$ and $\LBRP\Cfrom\Cto$ for \cseprule{}
14459 % drawing in \!\pcol@tempboxa! and \bgpaint{} for columns and \csepgap{}s in
14460 % \!\@tempboxa! put into $b$ immediately.
14461 %
14462 % Then we open a \!\hbox! of \!\textwidth! wide and initialize
14463 % $f=\CSIndex{if@tempswa}$ to be \CSIndex{if@fcolmade}. Then for each
14464 % $c\In\Cfrom\Cto$, being $c'$ or $\C-1-c'$ for the $c'$-th iteration
14465 % determined by \!\pcol@swapcolumn! according to the effectiveness of
14466 % \cswap{} and the parity of \!\c@page!, we put an inner \!\hbox! of
14467 % $\!\columnwidth!=\w_c$ wide preceded by \!\pcol@@hfil! being \!\relax! at
14468 % initial or $\!\pcol@hfil!\<c_g\>$ otherwise for a \csepgap{} and
14469 % \cseprule{}, where $c_g\in\{c,c{-}1\}$ without or with \cswap{}
14470 % respectively. That is, at first we obtain $c$'s \cctext{} including
14471 % $\cc_c(\dl)$ by \!\pcol@getcurrcol! and pass $\cc_c(\dl)$ to
14472 % \!\@makefcolumn! to produce a \fcolumn{} in \!\@outputbox! to be put into
14473 % the inner \!\hbox!. Then we do $f\gets f\lor(\cc_d(\dl)\neq\emptyset)$
14474 % with $\cc_d(\dl)$ shrunk by \!\@makefcolumn! to let $f$ have
14475 % $\exists{}c\In0\Cto:(\cc_c(\dl)\neq\emptyset)$ at the end of the loop for
14476 % $c$, and then save the \cctext{} into $\cc_c$ by \!\pcol@setcurrcolnf!
14477 % because we have no footnotes in $c$.
14478 %
14479 % After the end of the loop, we move $f$ to \CSIndex{if@fcolmade} for
14480 % the termination check of the loop in \!\pcol@flushfloats!.
14481 % 
14482 % \begin{macrocode}
14483 \def\pcol@flushfloats{%
14484 \global\@colht\textheight
14485 \@whilesw\if@fcolmade\fi{%
14486 \global\@fcolmadefalse
14487 \ifnum\pcol@ncolleft<\pcol@ncol
14488 \pcol@iflushfloats\pcol@ncolleft\pcol@ncol\pcol@rightpage
14489 \else
14490 \setbox\pcol@rightpage\box\voidb@x
14491 \fi
14492 \pcol@iflushfloats\z@\pcol@ncolleft\@outputbox
14493 \@outputpage}}
14494 \def\pcol@iflushfloats#1#2#3{\setbox#3\vbox{%
14495 \ifpcol@paired\else\ifnum#1=\z@\else \advance\c@page\@ne \fi\fi
14496 \pcol@buildcolseprule\@colht#1#2\@maxdepth \unvbox\@tempboxa
14497 \hb@xt@\textwidth{%
14498 \let\pcol@@hfil\relax
14499 \if@fcolmade \@tempswatrue \else \@tempswafalse \fi
14500 \@tempcntb#1\@whilenum\@tempcntb<#2\do{%
14501 \pcol@swapcolumn\@tempcntb\pcol@currcol#1#2\relax
14502 \pcol@getcurrcol
14503 \@makefcolumn\@deferlist
14504 \pcol@@hfil \hb@xt@\columnwidth{%
14505 \if@fcolmade \box\@outputbox \else \vbox to\@colht{}\fi \hss}%
14506 \ifx\@deferlist\@empty\else \@tempswatrue \fi
14507 \edef\pcol@@hfil{\noexpand\pcol@hfil{\pcol@colsepid}}%
14508 \pcol@setcurrcolnf
14509 \advance\@tempcntb\@ne}%
14510 \if@tempswa \global\@fcolmadetrue \else \global\@fcolmadefalse \fi}}}
14511
14512 % \end{macrocode}
14513 % \end{macro}\end{macro}
14514 %
14515 % \begin{macro}{\pcol@freshpage}
14516 % \changes{v1.0}{2011/10/10}
14517 % {Rename \cs{pcol@maxpage} as \cs{pcol@toppage}.}
14518 % \changes{v1.0}{2011/10/10}
14519 % {Add save and restore of \cs{@currbox}.}
14520 % \changes{v1.0}{2011/10/10}
14521 % {Remove unnecessary assignment of \cs{pcol@currcol}.}
14522 % \changes{v1.2-2}{2013/05/11}
14523 % {Add argument 0 for the invocations of \cs{pcol@startcolumn} to
14524 % inhibit inserting deferred page-wise footnotes.}
14525 % 
14526 % The macro \!\pcol@freshpage! is invoked from \!\pcol@output@flush! and
14527 % \!\pcol@output@clear! to start a new page after column flushing. At
14528 % first, we let $p=\pbase=\ptop=0$ and $\PP=\emptyset$ because we know no
14529 % pages are kept. Then we invoke \!\pcol@startpage! to start a new page
14530 % with a \!\def!inition of $\!\pcol@currpage!=|{}|$ to indicate the invoker
14531 % is this macro (i.e., not \!\pcol@opcol!). Then after keeping \!\@colht!
14532 % in $h=\!\pcol@colht!$, we do the followings for each column $c\In0\C$.
14533 %
14534 % First we obtain $c$'s \cctext{} in $\cc_c$ by \!\pcol@getcurrcol! but let
14535 % $p=0$ and $\!\@colroom!=h$, which can be modified by $c'<c$, without
14536 % referring to $\cc_c(\vb^p)$ nor $\cc_c(\vb^r)$ because they are obsolete.
14537 % We also save \!\@currbox! to \Midx{\!\pcol@currboxsave!} because it may be
14538 % modified by \!\pcol@opcol! if we make \fcolumn{}s afterward. Then we invoke
14539 % \!\pcol@getcurrpage! to have the \pctext{} of $p=0$, because it might be
14540 % modified by a column $c'<c$ by producing \fcolumn{}s. After that and the
14541 % invocation of \!\pcol@floatplacement! for setting float parameters, we
14542 % invoke \!\pcol@startcolumn! for $c$'s \colpage{} at $p=0$, and iterate
14543 % \!\pcol@opcol! and \!\pcol@startcolumn! while a \fcolumn{} is made by the
14544 % latter\footnote{
14545 % 
14546 % Each column can have deferred floats on the invocation from
14547 % \!\pcol@output@flush!.}.
14548 % 
14549 % Note that we give the argument 0 to each invocation of
14550 % \!\pcol@startcolumn! to keep it from inserting deferred \Scfnote{}s, which
14551 % will be taken care of by \!\pcol@restartcolumn! if any. At last in the
14552 % loop, we restore \!\@currbox! from \!\pcol@currboxsave!, let
14553 % $\cc_c(\vb^b)$ be an empty \!\vbox! because the main vertical list is
14554 % empty, and save the \cctext{} into $\cc_c$ by \!\pcol@setcurrcolnf!
14555 % because of no footnotes obviously, after saving $p$ and \!\@colroom!,
14556 % which might be modified by the \fcolumn{} production, into $\cc_c(\vb^p)$
14557 % and $\cc_c(\vb^r)$.
14558 %
14559 % After the loop above, finally we invoke \!\pcol@restartcolumn! to return
14560 % to the column in which \!\flushpage! or \!\clearpage! was issued.
14561 % 
14562 % \begin{macrocode}
14563 \def\pcol@freshpage{%
14564 \global\pcol@page\z@ \global\pcol@toppage\z@ \global\pcol@basepage\z@
14565 \global\let\pcol@pages\@empty \global\let\pcol@currpage\@empty
14566 \pcol@startpage \pcol@colht\@colht
14567 \pcol@currcol\z@ \@whilenum\pcol@currcol<\pcol@ncol\do{%
14568 \pcol@getcurrcol \pcol@page\z@ \@colroom\pcol@colht
14569 \let\pcol@currboxsave\@currbox
14570 \pcol@getcurrpage
14571 \pcol@floatplacement
14572 \pcol@startcolumn\z@
14573 \@whilesw\if@fcolmade\fi{\pcol@opcol \pcol@startcolumn\z@}%
14574 \let\@currbox\pcol@currboxsave
14575 \global\setbox\@currbox\vbox{}%
14576 \global\count\@currbox\pcol@page \global\dimen\@currbox\@colroom
14577 \pcol@setcurrcolnf
14578 \advance\pcol@currcol\@ne}%
14579 \pcol@restartcolumn}
14580
14581 % \end{macrocode}
14582 % \end{macro}
14583 %
14584 %
14585 %
14586 % \subsection{Last Page}
14587 % \label{sec:imp-sout-end}
14588 %
14589 % \begin{macro}{\pcol@output@end}
14590 % \changes{v1.0}{2011/10/10}
14591 % {Drastically changed to take special care of float columns in the
14592 % last page, to deal with the empty last page with and without
14593 % deferred floats, and to try to make post-environment float pages.}
14594 % \changes{v1.2-2}{2013/05/11}
14595 % {Add incorporation of page-wise footnotes in the last ordinary
14596 % pages followed by float-pages.}
14597 % \changes{v1.2-7}{2013/05/11}
14598 % {Add \cs{pcol@outputfalse} to solve the \cs{output} request sneaking.}
14599 % \changes{v1.2-7}{2013/05/11}
14600 % {Add $\cs{boxmaxdepth}\EQ\cs{@maxdepth}$ for depth capping knowing
14601 % it is redundant.}
14602 % \changes{v1.3-2}{2013/09/17}
14603 % {Add parallel-paging operations.}
14604 % \changes{v1.3-3}{2013/09/17}
14605 % {Add background painting of page-wise footnotes and setting
14606 % of \cs{pcol@preposttop}.}
14607 % \changes{v1.3-4}{2013/09/17}
14608 % {Add operations to pass $\string\cal{M}$ to the next
14609 % \string\texttt{paracol} environment and \cs{@mparbottom} to post
14610 % environment typesetting.}
14611 % 
14612 % The macro \!\pcol@output@end! is invoked solely from
14613 % \!\pcol@specialoutput! to process the \!\output! request made by
14614 % \!\endparacol!. We invoke \!\pcol@makeflushedpage! for the \lpage{}
14615 % production as the setting $\CSIndex{ifpcol@lastpage}=\true$ done by
14616 % \!\endparacol! indicates, giving it $h=\!\pcol@colht!$ in which
14617 % \!\pcol@sync! sets the height of the tallest \colpage{} to have the
14618 % ship-out image of the \tpage{} in \!\@outputbox!.
14619 %
14620 % Next, we define $\mpbout=\!\pcol@mparbottom@out!$ as follows. First, we
14621 % invoke \!\pcol@getmparbottom@last! giving it $y=\VPP-\!\ht!\!\@outputbox!$
14622 % being the negative counterpart of
14623 % the height of \spanning{} in the \lpage, to let $\mpbout$ have the occupancy
14624 % information of the bottom marginal note in each margin if any, or
14625 % $\mpar(y,y)$ otherwise. Then we transform $y$-coordinates in $\mpbout$
14626 % from those for columns to those for text area by
14627 % $\!\pcol@bias@mpbout!\Arg{-y}$ to have the final result. Then to pass
14628 % \!\@mparbottom! for post-environment typesetting,
14629 % 
14630 % \Index{post-environment stuff}
14631 % 
14632 % we invoke \!\pcol@do@mpbout! \!\def!ining \!\pcol@do@mpbout@whole! to do
14633 % nothing and \!\pcol@do@mpbout@elem! to let $\!\@mparbottom!=b$ where
14634 % $\mpb_L^x=(\mpar(t,b))$ and $x\in\{l,r\}$ according to the margin which
14635 % post-environment marginal notes go to.
14636 % 
14637 % \Index{post-environment stuff}
14638 % 
14639 % \begin{macrocode}
14640 %% Special Output Routines: Last Page
14641
14642 \def\pcol@output@end{%
14643 \pcol@Logstart\pcol@output@end
14644 \pcol@makeflushedpage\pcol@colht
14645 \@tempdima\pcol@colht \ifdim\pcol@colht<\z@ \@tempdima\z@ \fi
14646 \advance\@tempdima-\ht\@outputbox
14647 \pcol@getmparbottom@last\@tempdima
14648 \pcol@bias@mpbout{-\@tempdima}
14649 \def\pcol@do@mpbout@whole##1##2##3##4{\setbox\@tempboxa\hbox{##1##2##3##4}}%
14650 \def\pcol@do@mpbout@elem\@elt##1##2{\global\@mparbottom##2sp}%
14651 \pcol@do@mpbout
14652 % \end{macrocode}
14653 %
14654 % Next we process one of the following cases.
14655 %
14656 % The first case is for $\CSIndex{ifpcol@dfloats}=\true$ to mean the
14657 % \lpage{} is followed by one or more pages having deferred \cwise{}
14658 % floats and thus \!\pcol@makeflushedpage! builds the ship-out image of the
14659 % \lpage{} in {\em full size} in \!\@outputbox! unless the page has nothing
14660 % perfectly. Therefore, we ship the image out by \!\@outputbox! unless it
14661 % is $\bot$ for perfectly empty case. Then we invoke \!\pcol@flushfloats!
14662 % to produce and ship out \fpage{}s, letting $\CSIndex{if@fcolmade}={\true}$
14663 % to tell the macro that at least we will have one \fpage{}. Now we have
14664 % shipped out everything in the closing environment and thus we let
14665 % $\CSIndex{ifpcol@output}=\false$ to tell \!\output! routine to work
14666 % ordinarily. Then we let $\CSIndex{if@tempswa}=f_{\it sp}=\true$ to
14667 % remember we will start a new page and thus $\!\@pagedp!=\pd=\DP=1000$ to
14668 % mimic \TeX's \!\prevdepth! mechanism. Finally we let
14669 % $\CSIndex{@mparbottom}=0$ and $\mpbout=\mpboutz$ because no marginal notes
14670 % are carried over to post-environment typesetting.
14671 % 
14672 % \Index{post-environment stuff}
14673 % 
14674 % \changes{v1.3-6}{2013/09/17}
14675 % {Simplify the case with deferred floats thanks to
14676 % \cs{ifpcol@dfloats} and redesign of \cs{pcol@makeflushedpage}.}
14677 % 
14678 % \begin{macrocode}
14679 \@tempswafalse
14680 \ifpcol@dfloats
14681 \ifvoid\@outputbox\else \@outputpage \fi
14682 \global\@fcolmadetrue \pcol@flushfloats
14683 \global\pcol@outputfalse
14684 \@tempswatrue \@pagedp\@m\p@ \global\@mparbottom\z@
14685 \global\let\pcol@mparbottom@out\pcol@mparbottom@zero
14686 % \end{macrocode}
14687 %
14688 % Before proceeding to the second and third cases, we let
14689 % $\CSIndex{ifpcol@output}=\false$ because we have nothing to ship out.
14690 %
14691 % Then the second case is for $h=-\infty$ without deferred \cwise{}
14692 % floats to mean all columns in the \lpage{} are empty and the page does not
14693 % have non-merged \Scfnote{}s. In this case, we examine if
14694 % $\Midx{\!\pcol@firstprevdepth!}=\!\relax!$ to mean we have had at least
14695 % one new page in \env{paracol} environment, i.e., \!\pcol@startpage! have
14696 % been invoked at least once. If so, we let $f_{\it sp}=\true$, $\pd=1000$,
14697 % $\!\@mparbottom!=0$ and $\mpbout=\mpboutz$ again and put nothing to the
14698 % main vertical list so that the \postenv{} starts from the top of the page.
14699 % However, we have to take care of the case that $f_{\it ns}=\false$ and
14700 % thus \!\@outputbox! has \spanning. If so, we acquire an \!\insert! from
14701 % \!\@freelist! by \!\@next! to let it have the \spanning, i.e., the
14702 % contents of \!\@outputbox!\footnote{
14703 % 
14704 % It does not have \!\dbltextfloatsep! at its tail because the skip has been
14705 % removed by \!\pcol@makeflushedpage!.}.
14706 % 
14707 % Then the \!\insert! is added to the head of \!\@dbldeferlist! with the
14708 % float placement code 10 to force \LaTeX's float placement mechanism to put
14709 % it to the page to be started shortly.
14710 %
14711 % On the other hand, $\!\pcol@firstprevdepth!\neq\!\relax!$ means that it
14712 % has $\!\prevdepth!=\pd'$ just before \beginparacol{} in decimal integer
14713 % representation. Since we have not started any pages in the environment,
14714 % and all columns in the \lpage{} is empty, we have almost nothing in the
14715 % environment. Note that the environment can have \pwise{} floats but they
14716 % have not yet put into any pages but are kept in \!\@dbldeferlist!, or
14717 % \Mgfnote{}s but they are merged to those in \postenv. Therefore, the
14718 % \preenv{} and \postenv{} must be {\em connected} naturally and thus we put
14719 % the \preenv{} kept in \!\@outputbox! to the main vertical list by
14720 % \!\unvbox!, letting $\pd=\pd'$ and keeping $f_{\it sp}=\false$\footnote{
14721 % 
14722 % The author of course know this situation is very unlikely but he is
14723 % monomaniac.}.
14724 % 
14725 % In this case, the setting of \!\@mparbottom! and $\mpbout$ done at the
14726 % beginning of this macro is correct because they describe the marginal
14727 % notes in \preenv{} including \env{paracol} environments preceding it even
14728 % if any.
14729 % 
14730 % \changes{v1.3-3}{2013/09/17}
14731 % {Add settings for background painting of post-environment stuff.}
14732 % \changes{v1.3-4}{2013/09/17}
14733 % {Add letting $\cs{@mparbottom}\EQ0$ and
14734 % ${\string\cal{M}}\EQ{\string\cal{M}}_0$ for the simple empty page
14735 % case.}
14736 % \changes{v1.3-6}{2013/09/17}
14737 % {Remove \cs{unskip} from the operation to let page-wise floats be
14738 % ordinary ones because \cs{pcol@makeflushedpage} does it.}
14739 % \changes{v1.32-2}{2015/10/10}
14740 % {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
14741 % 
14742 % \begin{macrocode}
14743 \else
14744 \global\pcol@outputfalse
14745 \ifdim\pcol@colht=-\maxdimen
14746 \ifx\pcol@firstprevdepth\relax
14747 \@tempswatrue \@pagedp\@m\p@ \global\@mparbottom\z@
14748 \global\let\pcol@mparbottom@out\pcol@mparbottom@zero
14749 \ifpcol@nospan\else
14750 \pcol@Fb
14751 \@next\@currbox\@freelist{\global\setbox\@currbox\box\@outputbox}%
14752 \pcol@ovf
14753 \pcol@Fe{output@end(spanning)}%
14754 \count\@currbox10\relax
14755 {\let\@elt\relax \xdef\@dbldeferlist{\@elt\@currbox\@dbldeferlist}}%
14756 \global\setbox\pcol@rightpage\box\voidb@x
14757 \fi
14758 \else \unvbox\@outputbox \@pagedp\pcol@firstprevdepth sp\relax
14759 \fi
14760 % \end{macrocode}
14761 %
14762 % The last case without deferred floats and with some non-empty columns or
14763 % non-merged \Scfnote{}s is
14764 % most usual. In this case, we may simply put \!\@outputbox! letting
14765 % $\!\topskip!=0$ because \!\topskip! has already been inserted in
14766 % \colpage{}s or \preenv{} in the box\footnote{
14767 % 
14768 % If the \lpage{} has non-merged \Scfnote{}s without any other items,
14769 % \cs{topskip} has not been inserted, but this inconsistency without
14770 % \cs{topskip} is acceptable.}.
14771 %
14772 % However before putting the box back to the main vertical list, we have to
14773 % take care of the \bgpaint{} as follows. First we let
14774 % $\CSIndex{ifpcol@havelastpage}=\true$ to let \!\@outputpage! paint the
14775 % \bground{} of the \postenv{} when the page having the \lpage{} completes.
14776 % Second, we let \!\pcol@bg@preposttop@left! have the height-plus-depth of
14777 % the \!\@outputbox! having the short \lpage{} because the \bground{} of
14778 % \postenv{}, or of \preenv{} if we have another \env{paracol} environment
14779 % in the same page, to be painted is just below the box. We also
14780 % \!\pcol@bg@preposttop@right! have the same value but only if $\CL<\C$,
14781 % because otherwise we have to keep this macro unchanged so that the
14782 % non-existent right \parapag{}e of the closing environment can be the
14783 % \postenv{} of a preceding environment and/or the \preenv{} of a succeeding
14784 % one with \parapag{}ing. Note that in the aforementioned {\em fresh page}
14785 % cases and the perfectly empty case, we may be unaware of these macros
14786 % because it should have been made 0 by the last invocation of
14787 % \!\@outputpage! in the fresh page case or the \preenv{} and \postenv{} are
14788 % contiguous in the empty case.
14789 %
14790 % Third and finally, we have to paint the \bground{} of non-merged
14791 % \Scfnote{}s because the painting is left by \!\pcol@makeflushedpage! for
14792 % this macro. Therefore, if $\!\pcol@fnheight@lpage!>0$ to mean we have
14793 % footnotes whose total height-plus-depth is in the macro, we paint their
14794 % \bground{} by \!\pcol@bg@paintbox! \!\def!ining \!\pcol@bg@footnoteheight!
14795 % with the size and temporarily re\!\def!ining \!\pcol@bg@textheight! to be
14796 % the height-plus-depth of \!\@outputbox! because the footnotes are at the
14797 % bottom of the box instead of the page. Note that the order of painting is
14798 % right first and then left second if we have \parapag{}es because we refer
14799 % the height-plus-depth of \!\@outputbox! being put into the main vertical
14800 % list making the box $\bot$. Also note that if the right \parapag{}e is
14801 % \npaired, we temporarily increment \!\c@page! in \!\pcol@rightpage! to let
14802 % \!\pcol@bg@paintbox! handle \bginfext{} to side margins correctly.
14803 % Another remark is that we don't modify $\pd=\!\@pagedp!$ and thus it keeps
14804 % $\DP$ in this case, and $f_{sp}$ is kept $\false$.
14805 % 
14806 % \changes{v1.3-3}{2013/09/17}
14807 % {Add background painting of page-wise footnotes.}
14808 % 
14809 % \begin{macrocode}
14810 \else
14811 \global\pcol@havelastpagetrue
14812 \@tempdima\ht\@outputbox \advance\@tempdima\dp\@outputbox
14813 \xdef\pcol@bg@preposttop@left{\number\@tempdima sp}%
14814 \ifnum\pcol@ncolleft<\pcol@ncol
14815 \global\let\pcol@bg@preposttop@right\pcol@bg@preposttop@left
14816 \fi
14817 \def\pcol@bg@textheight{\@elt{\ht\@outputbox}\@elt{\dp\@outputbox}}%
14818 \def\reserved@a{%
14819 \ifdim\pcol@fnheight@lpage>\z@
14820 \def\pcol@bg@footnoteheight{\@elt\pcol@fnheight@lpage}%
14821 \pcol@bg@paintbox{Nn}%
14822 \fi}%
14823 \ifnum\pcol@ncolleft<\pcol@ncol
14824 \global\setbox\pcol@rightpage\vbox{%
14825 \ifpcol@paired\else \advance\c@page\@ne \fi
14826 \reserved@a \unvbox\pcol@rightpage}%
14827 \fi
14828 \topskip\z@ \vbox{\reserved@a \unvbox\@outputbox}%
14829 \fi
14830 \fi
14831 % \end{macrocode}
14832 %
14833 % Now we have put almost everything in the \lpage{} but we may still have
14834 % \Scfnote{}s in $\pp^f(\ptop)$ to be merged with those in \postenv.
14835 % Therefore, we \!\insert! them through \!\footins! as a part of \postenv,
14836 % and then do that for deferred footnotes in $\df=\!\pcol@topfnotes!$
14837 % without using \!\pcol@deferredfootins! because we don't need the height
14838 % capping.
14839 % 
14840 % \changes{v1.2-2}{2013/05/11}
14841 % {Add insertion of page-wise footnotes to be merged.}
14842 % \changes{v1.32-2}{2015/10/10}
14843 % {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
14844 % 
14845 % \begin{macrocode}
14846 \ifvoid\pcol@footins\else
14847 \pcol@Log\pcol@output@end{insert}\pcol@footins
14848 \pcol@Fb
14849 \insert\footins{\unvbox\pcol@footins}\@cons\@freelist\pcol@footins
14850 \pcol@Fe{output@end(pagefn)}%
14851 \fi
14852 \ifvoid\pcol@topfnotes\else \insert\footins{\unvbox\pcol@topfnotes}\fi
14853 % \end{macrocode}
14854 %
14855 % The following operations are for clean-up and set-up for the \postenv;
14856 % for all c, return $\cc_c(\vb)$ obtained by \!\pcol@getcurrcol! and
14857 % $\Celt^c\neq\bot$ letting it $\bot$ to \!\@freelist!; reestablish the
14858 % \colorstack{} by \!\pcol@restorecolorstack! for column-0\footnote{
14859 % 
14860 % It can be any other column.}
14861 % 
14862 % so that the \colorstack{} is just $\cst$ and is rewound at \Endparacol,
14863 % and let $\cst=\bot$; reload $\cc_d$ for $d=\!\pcol@lastcol!$ being the
14864 % column in which \Endparacol{} occurs to let $\!\everypar!=\cc_d(\ep)$ and
14865 % to let \CSIndex{if@nobreak} and \CSIndex{if@afterindent} have the value
14866 % represented by $\cc_d(\sw)$, so that the first paragraph of the \postenv{}
14867 % is typeset following them\footnote{
14868 % 
14869 % For rare cases that the last item of the closing environment is a
14870 % sectioning command, but a user has such very unusual usage.};
14871 % 
14872 % let $\!\pcol@prevdepth!=\pd$ so that it is set to \!\prevdepth! by
14873 % \!\pcol@invokeoutput!; let $\!\@colht!=\!\@colroom!=\!\textheight!$ to
14874 % mean the single-column page does not have any floats so far because those
14875 % produced in or before the environment have already been shipped out, are
14876 % put to the main vertical list packed in \!\@outputbox!, or are in
14877 % \!\@dbldeferlist!.
14878 %
14879 % As for deferred \pwise{} floats produced in the environment, including
14880 % those once put in the \lpage{} but returned to the list by the operation
14881 % described above, we move them to \!\@deferlist! because they are now
14882 % \cwise{} floats. Then we invoke \!\pcol@floatplacement! to
14883 % reinitialize float placement parameters. Finally, if $f_{\it sp}=\true$,
14884 % we invoke \!\@startcolumn! and then repeat invocations of \!\@opcol! and
14885 % \!\@startcolumn! while \fpage{}s are produced, after letting
14886 % $\CSIndex{ifpcol@lastpage}=\false$ to make \!\@combinefloats! work as
14887 % \LaTeX's original\footnote{
14888 % 
14889 % Letting $\!\pcol@textfloatsep!=\infty$ is done by \!\pcol@floatplacement!.}.
14890 % 
14891 % \changes{v1.2-1}{2013/05/11}
14892 % {Add color resetting.}
14893 % \changes{v1.31}{2013/10/10}
14894 % {Add \cs{pcol@getcurrcol} for the column specified by
14895 % \cs{pcol@lastcol} to pass \cs{if@nobreak}, \cs{if@afterindent} and
14896 % \cs{everypar} of the column to post-environment stuff.}
14897 % \changes{v1.32-2}{2015/10/10}
14898 % {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
14899 % \changes{v1.34}{2018/05/07}
14900 % {Remove nullification of $\gamma_0^0$ because it is not meaningless
14901 % now, add release of $\gamma_0^c\NEQ\bot$ and then nullification of
14902 % it for all $c$, move color stack reestablishment down to the loop
14903 % with $c$ to ensure $\gamma_0^0\EQ\bot$, and add nullification of
14904 % $\mathit{\Gamma}$.}
14905 % 
14906 % \begin{macrocode}
14907 \pcol@currcol\z@ \@whilenum\pcol@currcol<\pcol@ncol\do{%
14908 \pcol@Fb
14909 \pcol@getcurrcol \@cons\@freelist\@currbox
14910 \ifvoid\pcol@ccuse{@box}\else
14911 \@cons\@freelist{\pcol@ccuse{@box}}%
14912 \pcol@ccxdef{\voidb@x}%
14913 \fi
14914 \pcol@Fe{output@end(col)}%
14915 \advance\pcol@currcol\@ne}%
14916 \pcol@currcol\z@ \pcol@restorecolorstack
14917 \global\setbox\pcol@colorins\box\voidb@x
14918 \pcol@currcol\pcol@lastcol\relax \pcol@getcurrcol
14919 \global\pcol@prevdepth\@pagedp
14920 \global\@colht\textheight
14921 \global\@colroom\textheight
14922 \global\let\@deferlist\@dbldeferlist \gdef\@dbldeferlist{}%
14923 \pcol@floatplacement
14924 \pcol@lastpagefalse
14925 \if@tempswa
14926 \@startcolumn \@whilesw\if@fcolmade\fi{\@opcol\@startcolumn}%
14927 \fi
14928 \pcol@Logend\pcol@output@end
14929 }
14930
14931 % \end{macrocode}
14932 % \end{macro}
14933 %
14934 %
14935 %
14936 % \section{Starting Environment}
14937 % \label{sec:imp-startenv}
14938 %
14939 % \begin{macro}{\pcol@invokeoutput}
14940 % \changes{v1.0}{2011/10/10}
14941 % {Let \cs{pcol@prevdepth} have \cs{prevdepth} directly instead of via
14942 % \cs{tempdima}.}
14943 % \changes{v1.2-2}{2013/05/11}
14944 % {Add logging.}
14945 % \changes{v1.2-5}{2013/05/11}
14946 % {Move the setting of \cs{linewidth} and \cs{hsize} from
14947 % \cs{pcol@getcurrcol} to this macro and add \cs{parshape}.}
14948 % \changes{v1.21}{2013/06/06}
14949 % {Add zero-clearing of \cs{deadcycles}.}
14950 % 
14951 % Before giving the definition of \env{paracol} environment and commands
14952 % used in it, we define the macro $\!\pcol@invokeoutput!\arg{pen}$ invoked
14953 % from them to make an \!\output!-request with \!\penalty! of
14954 % $\arg{pen}=|\pcol@op@|{\cdot}f$. The macro's structure is similar to that
14955 % for the request sequence in \!\end@float! as follows; insert a \!\penalty!
14956 % of $-10004$ to save the main vertical list in \!\@holdpg!; save
14957 % \!\prevdepth!; insert a \!\vbox! to make it sure the following \!\penalty!
14958 % of $\arg{pen}$ is kept even when we are at the top of a page; and finally
14959 % restore \!\prevdepth!.
14960 %
14961 % A difference is that we zero-clear \!\deadcycles! because it can be reach
14962 % $\!\maxdeadcycles!=100$ easily if a page has many \sync{}ations and many
14963 % columns. Another and more important difference is in the save\slash
14964 % restore of \!\prevdepth!. First, the value of the register is saved in
14965 % our own \!\pcol@prevdepth! instead of \!\@tempdima! by a \!\global!
14966 % assignment so that \!\output!-routine refers to it\footnote{
14967 % 
14968 % The assignment is not necessary to be done \!\global!ly but we dare to do
14969 % it to make all assignments to \!\pcol@prevdepth! being \!\global!
14970 % consistently.}.
14971 % 
14972 % Second, the value restored to \!\prevdepth! may be different from that we
14973 % just have saved because \!\output!-routine may update \!\pcol@prevdepth!
14974 % to have, for example, the value saved in $\cc_c(\pd)$ when we left from
14975 % $c$ which we are now restarting.
14976 %
14977 % In addition to above, after the invocation of \!\output!-routine, we let
14978 % $\!\linewidth!=\w_c-\lrm$ so that the register is shrunk from $\w_c$ by the
14979 % total width of left and right margins of the \env{list}-like environment
14980 % surrounding \env{paracol} if $\lrm=\!\pcol@lrmargin!>0$ to mean that.
14981 % Then if so, we set \!\parshape! to let every line of paragraphs in the
14982 % column $c$ is indented by \!\@totalleftmargin! and has width of
14983 % \!\linewidth!, as \LaTeX's \!\list! does. We also let $\!\hsize!=\w_c$
14984 % because it should have the width of the column even in a \env{list}-like
14985 % environment.
14986 %
14987 % The macro is invoked from \!\pcol@zparacol! ($f=|start|$),
14988 % \!\pcol@switchcol! for \!\switch~column! and \csenv{}s ($f=|switch|$),
14989 % \!\pcol@visitallcols! for \cscan{} prior to \sync{}ed \cswitch{} and page
14990 % flushing ($f=|switch|$), \!\pcol@flushclear! for \pfcheck{}
14991 % ($f=|switch|$), \!\pcol@com@flushpage! for \!\flushpage! ($f=|flush|$),
14992 % \!\pcol@com@clearpage! for \!\clearpage! ($f=|clear|$), and
14993 % \!\endparacol! ($f=|end|$).
14994 % \SpecialIndex{\pcol@op@start}
14995 % \SpecialIndex{\pcol@op@switch}
14996 % \SpecialIndex{\pcol@op@flush}
14997 % \SpecialIndex{\pcol@op@clear}
14998 % \SpecialIndex{\pcol@op@end}
14999 % 
15000 % \begin{macrocode}
15001 %% Starting Environment
15002
15003 \def\pcol@invokeoutput#1{\deadcycles\z@
15004 \pcol@Logstart{\pcol@invokeoutput
15005 {#1:\the\pcol@currcol/\the\pcol@nextcol%
15006 \ifnum#1=-10011:\ifpcol@sync s\fi \ifpcol@clear c\fi\fi}}%
15007 \penalty-\@Miv \global\pcol@prevdepth\prevdepth \vbox{}%
15008 \penalty#1\relax \prevdepth\pcol@prevdepth
15009 \linewidth\columnwidth \advance\linewidth-\pcol@lrmargin
15010 \ifdim\pcol@lrmargin>\z@ \parshape\@ne\@totalleftmargin\linewidth \fi
15011 \hsize\columnwidth
15012 \pcol@Logend{\pcol@invokeoutput{#1}}}
15013
15014 % \end{macrocode}
15015 % \end{macro}
15016 %
15017 % \KeepSpace{2}
15018 % \begin{macro}{\paracol}
15019 % \changes{v1.0}{2011/10/10}
15020 % {Change the order of operations for sake of clarity.}
15021 % \changes{v1.0}{2011/10/10}
15022 % {Add the mechanism of inter-environment local counter conservation.}
15023 % \changes{v1.0}{2011/10/10}
15024 % {Let $\cs{col@number}\EQ1$ instead of $C$ to keep \cs{maketitle} from
15025 % producing title with \cs{twocolumn}.}
15026 % \changes{v1.0}{2011/10/10}
15027 % {Add initialization of \cs{pcol@textfloatsep}, \cs{ifpcol@lastpage},
15028 % \cs{pcol@firstprevdepth} and \cs{@combinefloats}.}
15029 % \changes{v1.0}{2011/10/10}
15030 % {Make API commands environment-local and inhibit nesting of
15031 % \texttt{paracol}.}
15032 % \changes{v1.3-2}{2013/09/17}
15033 % {Modify to add the optional argument $C_L$ and optional
15034 % `\string\texttt{*}' for parallel-paging.}
15035 % \begin{macro}{\pcol@xparacol}
15036 % \changes{v1.3-2}{2013/09/17}
15037 % {Introduced to let $C_L\EQ C$ if the optional argument $C_L$ is not
15038 % given to \cs{paracol}.}
15039 % \begin{macro}{\pcol@yparacol}
15040 % \changes{v1.3-2}{2013/09/17}
15041 % {Introduced to process the optional `\string\texttt{*}' given with
15042 % the optional argument $C_L$ of \cs{paracol}.}
15043 % \begin{macro}{\pcol@zparacol}
15044 % \changes{v1.3-2}{2013/09/17}
15045 % {Introduced to add the optional argument $C_L$ and optional
15046 % `\string\texttt{*}' to \cs{paracol} for parallel-paging and to do
15047 % what had done by \cs{paracol}.}
15048 % 
15049 % The API macro $\!\paracol!|[|\CL|][*]|\Arg{\C}$\oarg{text} is invoked by
15050 % \beginparacol{} to start a \Midx{\env{paracol}} environment. The macro
15051 % simply examines the existence of the optional argument $\CL$, whose
15052 % default value $\C$ is given by \!\pcol@xparacol!, to decide the
15053 % number of columns in left \parapag{}es. Then if the optional argument is
15054 % given, \!\pcol@yparacol! examines the existence of `|*|' following it for
15055 % \npaired{} \parapag{}ing to let $\CSIndex{ifpcol@paired}=\false$, while
15056 % \!\paracol! gave the default $\true$ for \paired{} one to the switch.
15057 % Then the all other operations to start the environment is done by
15058 % \!\pcol@zparacol!.
15059 % 
15060 % \begin{macrocode}
15061 \def\paracol{\global\pcol@pairedtrue \@ifnextchar[%]
15062 \pcol@yparacol\pcol@xparacol}
15063 \def\pcol@xparacol#1{\pcol@zparacol[#1]{#1}}
15064 \def\pcol@yparacol[#1]{%
15065 \@ifstar{\global\pcol@pairedfalse \pcol@zparacol[#1]}%
15066 {\pcol@zparacol[#1]}}
15067 % \end{macrocode}
15068 %
15069 % In \!\pcol@zparacol!, after making it sure to be in vertical mode by
15070 % \CSIndex{par}, at first we examine if we are neither in a box by
15071 % \CSIndex{ifinner} nor with ordinary two-column typesetting by
15072 % \CSIndex{if@twocolumn}, and complain about inappropriateness unless our
15073 % expectation is satisfied. Then we let $\CL$ and $\C$ have the value given
15074 % through the corresponding arguments, unless $\CL>\C$ to let us make
15075 % $\CL=\C$ silently. Next we examine $\CL<\C$, and if not we let
15076 % $\CSIndex{ifpcol@paired}=\true$ regardless the setting in
15077 % \!\pcol@yparacol! because \npaired{} typesetting is meaningless without
15078 % \parapag{}ing. On the other hand, if \npaired{} typesetting is specified,
15079 % we let $\CSIndex{ifpcol@swapcolumn}={\false}$ but {\em not} \!\global!ly
15080 % because \cswap{} is meaningless in \npaired{} mode in the environment now
15081 % starting.
15082 %
15083 % Second, we perform the operations done by \!\item! if
15084 % $\CSIndex{if@newlist}=\true$ and $\CSIndex{if@inlabel}\~=\false$ to mean
15085 % the first one in a \env{list}-like environment will appear at the very
15086 % first line of the leftmost column. That is, we invoke \!\@nbitem! if
15087 % $\CSIndex{if@nobreak}=\true$, or add a penalty \!\@beginparpenalty! and a
15088 % vertical skip $\!\@topsep!-\!\parskip!-\!\itemsep!$ so that the first
15089 % \!\item! is \!\@topsep! apart from the last line above the environment,
15090 % and then let $\CSIndex{if@newlist}=\false$. The reason why we do these
15091 % operations here is that, if the \env{paracol} environment is enclosed in a
15092 % \env{list}-like environment without anything between two \!\begin! for
15093 % environments, we have to align all first \!\item!s in all columns. That
15094 % is, if we did not do that, the {\em literally first} \!\item! would do
15095 % that resulting in the column having the \!\item! led by the vertical skip
15096 % of \!\@topsep! while others should have ordinary inter-\!\item! skips.
15097 % Therefore, we perform the operations on behalf of all first \!\item!s in
15098 % all columns to have the skip of \!\@topsep! {\em above} the \env{paracol}
15099 % environment we are opening. Note that if \beginparacol{} immediately
15100 % follows a \!\begin! for a \env{trivlist}-like environment,
15101 % $\CSIndex{if@inlabel}=\true$ because the first \!\item! was given in the
15102 % opening macro and thus the operations shown above has already been
15103 % performed.
15104 % 
15105 % \changes{v1.3-6}{2013/09/17}
15106 % {Add operations for the vertical skips at the beginning of a
15107 % \texttt{list}-like environment.}
15108 % \changes{v1.35-6}{2018/12/31}
15109 % {Add error check with \cs{ifinner} and \cs{if@twocolumn}.}
15110 % \changes{v1.35-2}{2018/12/31}
15111 % {Add $\lnot$\cs{if@inlabel} to the condition to perform operations
15112 % for first \cs{item}.}
15113 % 
15114 % \begin{macrocode}
15115 \def\pcol@zparacol[#1]#2{\par
15116 \ifinner \@parmoderr \fi
15117 \if@twocolumn \PackageError{paracol}{%
15118 Environment paracol cannot work with ordinary two-column
15119 typesetting.}\@ehb\fi
15120 \global\pcol@ncolleft#1\relax \global\pcol@ncol#2\relax
15121 \ifnum\pcol@ncolleft>\pcol@ncol \global\pcol@ncolleft\pcol@ncol \fi
15122 \ifnum\pcol@ncolleft<\pcol@ncol\else \global\pcol@pairedtrue \fi
15123 \ifpcol@paired\else \pcol@swapcolumnfalse \fi
15124 \if@newlist \if@inlabel\else
15125 \if@nobreak \@nbitem
15126 \else
15127 \addpenalty\@beginparpenalty
15128 \addvspace\@topsep
15129 \addvspace{-\parskip}\addvspace{-\itemsep}%
15130 \fi
15131 \global\@newlistfalse
15132 \fi\fi
15133 % \end{macrocode}
15134 %
15135 % The third operation group is to set up lists for counters as follows.
15136 % First we obtain $\CC=\!\cl@@ckpt!$ to have all counters defined by
15137 % \!\newcounter! and \counter{page}. Then we scan $\CG=\!\pcol@gcounters!$
15138 % applying \!\pcol@remctrelt! to each element to have
15139 % $\CTL=\!\pcol@counters!$ for all \lcounter{}s by removing all $\cg\in\CG$
15140 % from $\CC$, and to move $\clist(\cg)=|\cl@|{\cdot}\cg$ to
15141 % $|\pcol@cl@|{\cdot}\cg$ redefining
15142 % $|\cl@|{\cdot}\cg=\!\pcol@stepcounter!\Arg{\cg}$
15143 % 
15144 % \SpecialArrayIndex{\theta}{\cl@}
15145 % 
15146 % to clear descendant \lcounter{}s of $\cg$, i.e., those in $\clist(\cg)$.
15147 %
15148 % Next we scan $\CTL$ applying \!\pcol@thectrelt! to each element $\cl\in\CTL$
15149 % to let $|\pcol@thectr@|{\cdot}\~\cl=|\the|{\cdot}\cl$
15150 % 
15151 % \SpecialArrayIndex{\theta}{\pcol@thectr@}
15152 % \SpecialArrayIndex{\theta}{\the}
15153 % 
15154 % so that the former has the {\em default} \lrep{} of $\cl$. The macro
15155 % \!\pcol@thectrelt! also lets
15156 % $|\the|{\cdot}\cl=|\pcol@thectr@|{\cdot}\cl{\cdot}0$
15157 % 
15158 % \SpecialArrayIndex{\theta{\cdot}c}{\pcol@thectr@}
15159 % \SpecialArrayIndex{\theta}{\the}
15160 % 
15161 % if the \lrep{} for $\cl$ and $c=0$ has been defined by
15162 % \!\definethecounter!. This is necessary because in the first visit to the
15163 % leftmost column 0 we will neither invoke \!\pcol@switchcol! nor thus scan
15164 % $\CTL$ with \!\pcol@setctrelt! which defines \lrep{}s, unless a \mctext{}
15165 % is specified with \beginparacol.
15166 %
15167 % Next we give the initial value of $\val_c(\cl)$ for each column $c$ and
15168 % \lcounter{} $\cl\in\CTL$ by the followings enclosed in a group. First we
15169 % scan $\Cc_0$ applying \!\pcol@loadctrelt! to each
15170 % $\cl\in\Cc'_0=\Set{\theta}{\<\theta,\val_0(\theta)\>\in\Cc_0}$ to have
15171 % the value $\val_0(\cl)$ in $|\pcol@ctr@|{\cdot}\cl$
15172 % 
15173 % \SpecialArrayIndex{\theta}{\pcol@ctr@}
15174 % 
15175 % temporarily. Next we scan $\CTL$ to pick \lcounter{}s $\theta$ such that
15176 % $\Uidx\Val(\theta)\neq\val_0(\theta)$ where $\Val(\theta)$ is the value of
15177 % $\theta$ outside \env{paracol} environment, or $\theta\notin\Cc'_0$, to
15178 % let them be listed in \!\@gtempa!. That is, we pick \lcounter{}s which
15179 % have been updated or defined after the closing of the previous
15180 % \env{paracol}, or everything in $\CTL$ at the first \beginparacol{} because
15181 % $\Cc_0=\emptyset$\footnote{
15182 % 
15183 % Undefined in fact.}.
15184 % 
15185 % Finally, we invoke \!\pcol@synccounter! giving it \!\@gtempa! as its
15186 % argument to let $\val_c(\theta)=\Val(\theta)$ for all $c$ and for each
15187 % $\theta$ in \!\@gtempa!. That is, when \env{paracol} environment appears
15188 % two or more times, the value of a \lcounter{} at the beginning of the
15189 % second or succeeding environment is kept unchanged from that at the end of
15190 % the previous environment, unless it has been updated between them. Note
15191 % that these scans above are enclosed in a group in order to make
15192 % $|\pcol@ctr@|{\cdot}\cl$
15193 % 
15194 % \SpecialArrayIndex{\theta}{\pcol@ctr@}
15195 % 
15196 % local and thus collected as a garbage at \!\endgroup!.
15197 % 
15198 % \begin{macrocode}
15199 \global\let\pcol@counters\cl@@ckpt
15200 \let\@elt\pcol@remctrelt \pcol@gcounters
15201 \let\@elt\pcol@thectrelt \pcol@counters
15202 \begingroup
15203 \let\@elt\pcol@loadctrelt \csname pcol@counters0\endcsname
15204 \let\@elt\pcol@cmpctrelt \global\let\@gtempa\@empty \pcol@counters
15205 \pcol@synccounter\@gtempa
15206 \endgroup
15207 % \end{macrocode}
15208 % 
15209 % Fourth, we set up a few \LaTeX's typesetting parameters which should have
15210 % appropriate values in the environment. We let
15211 % $\CSIndex{if@twocolumn}=\true$ so that \textit{float}|*| environments work
15212 % for \pwise{} floats and LaTeX's \!\@addmarginpar! determine the margin
15213 % for marginal notes by \CSIndex{if@firstcolumn} whose truth value is
15214 % determined by our own \!\@addmarginpar!. We also let $\!\col@number!=1$
15215 % instead of $\C$ so that its (almost surely) sole user \!\maketitle! will
15216 % not produce the title with \!\twocolumn! which cannot be in the
15217 % environment.
15218 %
15219 % Then we invoke $\!\pcol@setcolumnwidth!\<\Cfrom\>\<\Cto\>\<r\>\<s\>$ once
15220 % or twice with
15221 % $(\Cfrom,\Cto,r,s)=(0,\CL,\!\pcol@columnratioleft!,\!\pcol@colwidthspecleft!)$
15222 % always for left \parapag{}e, and with
15223 % $(\CL,\C,\!\pcol@columnratioright!,\!\pcol@colwidthspecright!)$ for right
15224 % one if $\CL<\C$ to define column widths $\w_c=|\pcol@columnwidth|{\cdot}c$
15225 % 
15226 % \SpecialArrayIndex{c}{\pcol@columnwidth}
15227 % 
15228 % and that of \csepgap{}s $\gap_c=|\pcol@columnsep|{\cdot}c$
15229 % 
15230 % \SpecialArrayIndex{c}{\pcol@columnsep}
15231 % 
15232 % for all $c\In0\C=\LBRP0\CL\cup\LBRP\CL\C$.
15233 %
15234 % Then we initialize other variables as follows;
15235 % $\lrm=\!\pcol@lrmargin!=\!\textwidth!-\!\linewidth!$ so that, if $\lrm>0$,
15236 % \!\linewidth! for $c$ has $\w_c-\lrm$ reflecting the paragraph shape of the
15237 % \env{list}-like environment surrounding \env{paracol} environment;
15238 % $\!\pcol@topskip!=\!\topskip!$ for the second and succeeding pages;
15239 % $\!\pcol@textfloatsep!=\infty$ to mean we don't have any \sync{}ation
15240 % points so far; $\CSIndex{ifpcol@lastpage}=\false$ because the \spage{} is
15241 % not the last so far; and $\!\pcol@firstprevdepth!=\!\prevdepth!$ in
15242 % decimal integer form for the extreme empty case.
15243 %
15244 % We also make the macro \!\@combinefloats! \!\let!-equal to our own
15245 % \!\pcol@combinefloats! throughout the environment, after saving its
15246 % original definition into \Midx{\!\pcol@@combinefloats!} for processing
15247 % \!\output! request sneaked from outside of environment, so that our
15248 % customization is in effect for any invocations including those from
15249 % \LaTeX's own macros. Similarly, \!\@addmarginpar! is made \!\let!-equal
15250 % to our own \!\pcol@addmarginpar! while its original definition is saved
15251 % into \!\pcol@@addmarginpar! but in this case we need the original for the
15252 % implementation of our own. On the other hand, \!\end@dblfloat! is simply
15253 % replaced with our own \!\pcol@end@dblfloat! being what \LaTeX{} had had until
15254 % 2014 as discussed in item-(\ref{item:ovv-float-end@dblfloat}) of
15255 % \secref{sec:imp-ovv-float}.
15256 % 
15257 % \changes{v1.1}{2012/05/11}
15258 % {Replace the calculation of \cs{columnwidth} with the call of
15259 % \cs{pcol@setcolumnwidth} and the assignment of $w_0$ to it.}
15260 % \changes{v1.2-4}{2013/05/11}
15261 % {Modify the setting of \cs{if@firstcolumn} according to
15262 % column-swapping.}
15263 % \changes{v1.2-5}{2013/05/11}
15264 % {Remove the setting \cs{columnwidth}, \cs{hsize} and \cs{linewidth}
15265 % because they are properly set in and after \cs{pcol@output@start}.}
15266 % \changes{v1.2-5}{2013/05/11}
15267 % {Add the setting of \cs{pcol@lrmargin}.}
15268 % \changes{v1.2-7}{2013/05/11}
15269 % {Add the saving of \cs{@combinefloats}.}
15270 % \changes{v1.3-4}{2013/09/17}
15271 % {Revise the mechanism to define the width of columns and
15272 % column-separating gaps, and add local overriding definition of
15273 % \cs{@addmarginpar}.}
15274 % \changes{v1.3-2}{2013/09/17}
15275 % {Add operations to define the width of columns and column-separating
15276 % gaps in right parallel-pages.}
15277 % \changes{v1.32-3}{2015/10/10}
15278 % {Add replacement of \cs{end@dblfloat} with \cs{pcol@end@dblfloat}.}
15279 % 
15280 % \begin{macrocode}
15281 \global\@twocolumntrue \col@number\@ne
15282 \pcol@setcolumnwidth\z@\pcol@ncolleft
15283 \pcol@columnratioleft\pcol@colwidthspecleft
15284 \ifnum\pcol@ncolleft<\pcol@ncol
15285 \pcol@setcolumnwidth\pcol@ncolleft\pcol@ncol
15286 \pcol@columnratioright\pcol@colwidthspecright
15287 \fi
15288 \pcol@lrmargin\textwidth \advance\pcol@lrmargin-\linewidth
15289 \global\pcol@topskip\topskip
15290 \global\pcol@textfloatsep\maxdimen
15291 \pcol@lastpagefalse \xdef\pcol@firstprevdepth{\number\prevdepth}%
15292 \let\pcol@@combinefloats\@combinefloats \let\@combinefloats\pcol@combinefloats
15293 \let\pcol@@addmarginpar\@addmarginpar \let\@addmarginpar\pcol@addmarginpar
15294 \let\end@dblfloat\pcol@end@dblfloat
15295 % \end{macrocode}
15296 %
15297 % Fifth, we save the original definition of \!\set@color! into
15298 % \!\pcol@set@color!, and then examine if $\!\set@color!\neq\!\relax!$
15299 % meaning some coloring package is loaded. If any coloring packages are not
15300 % loaded, we make macros for \bgpaint{}, namely \!\pcol@bg@paintpage!,
15301 % \!\pcol@bg@paintcolumns! and \!\pcol@bg@paintbox!, \!\let!-equal to
15302 % \!\relax! for the first two and to \!\@gobble! for the last so that they do
15303 % nothing without coloring package.
15304 %
15305 % If the coloring is enabled, on the other hand, we redefine \LaTeX's
15306 % \!\set@color! so that it works as \!\pcol@set@color@push! with
15307 % \colorstack. We also prepare the text coloring mechanism to let
15308 % $\CSIndex{ifpcol@inner}=\true$ in every \!\vbox! in the \env{paracol}
15309 % environment as follows. First, we let $\CSIndex{ifpcol@inner}=\false$
15310 % because we are not in any \!\vbox!es obviously. Then, to use
15311 % \!\everyvbox! for our own purpose, we do the followings; (1) \!\global!ly
15312 % assign a token \Midx{\!\pcol@dummytoken!}, which should never occurs, to
15313 % \!\pcol@everyvbox!; (2) save \!\everyvbox! into \!\pcol@everyvbox!
15314 % locally; (3) let \!\everyvbox! have a \!\the!-reference to
15315 % \!\pcol@everyvbox! and |\pcol@innerture| to let
15316 % $\CSIndex{ifpcol@inner}={\true}$; and then (4) make \!\everyvbox!
15317 % \!\let!-equal to \!\pcol@everyvbox!. By the last operation (4), any
15318 % \!\everyvbox! appearing in the \env{paracol} environment is replaced with
15319 % \!\pcol@everyvbox! to keep the real \!\everyvbox! from modified nullifying
15320 % our own operation |\pcol@innertrue|. On the other hand, since both
15321 % \!\everyvbox! and \!\pcol@everyvbox! are registers to hold tokens and
15322 % thus any operations applicable to \!\everyvbox! are also applicable to
15323 % \!\pcol@everyvbox!, any updates on \!\everyvbox! and explicit references
15324 % to it are simulated by \!\pcol@everyvbox!. Then the initial tokens given
15325 % to \!\pcol@everyvbox! by the saving operation (2) or tokens given inside
15326 % the environment are correctly processed whenever a \!\vbox! is opened,
15327 % together with |\pcol@innertrue| to fulfill our own purpose, because the
15328 % real \!\everyvbox! is let have a \!\the!-reference to \!\pcol@everyvbox!
15329 % by (3). We also reserve the invocation of \!\pcol@restoreeveryvbox! by
15330 % \!\aftergroup! so that the macro is invoked just after \Endparacol{} to
15331 % examine if any \!\global! assignments to \!\everyvbox! has been made in
15332 % the environment. The funny \!\global! assignment (1) is done for this
15333 % examination so that we detect global assignments done in the environment
15334 % having been closed because they should have changed the global value of
15335 % \!\pcol@everyvbox! to something different from \!\pcol@dummytoken!.
15336 %
15337 % Then we continue the case having some coloring package to make \bgpaint{}
15338 % macros \!\pcol@bg@paintpage!, \!\pcol@bg@paintbox! and
15339 % \!\pcol@bg@paintcolumns! activated by making them \!\let!-equal to their
15340 % |@@| counterparts namely \!\pcol@bg@@paintpage!, \!\pcol@bg@@paintbox! and
15341 % \!\pcol@bg@@paintcolumns! which implement \bgpaint{}.
15342 %
15343 % Finally we empty the shadow \colorstack{}
15344 % $\cstshadow={}$\!\pcol@colorstack@shadow! to give it initial value
15345 % regardless of the availability of coloring package.
15346 % 
15347 % \changes{v1.2-1}{2013/05/11}
15348 % {Add redefinitions of \cs{set@color} and \cs{reset@color}.}
15349 % \changes{v1.22}{2013/06/30}
15350 % {Add a trick with \cs{everyvbox} to turn on \cs{ifpcol@inner} in
15351 % every \cs{vbox}.}
15352 % \changes{v1.22}{2013/06/30}
15353 % {Move initial emptying of $\string\mathit{\Gamma}$ from
15354 % \cs{pcol@output@start} to \cs{pcol@zparacol}.}
15355 % \changes{v1.22}{2013/06/30}
15356 % {Add initial emptying of $\string\hat{\mathit{\Gamma}}$ and $\chi$.}
15357 % \changes{v1.3-3}{2013/09/17}
15358 % {Add definition of painting macros dependent to the availability of
15359 % a coloring package.}
15360 % \changes{v1.34}{2018/05/07}
15361 % {Remove the initializations of \cs{pcol@colorstack} and
15362 % \cs{pcol@colorstack@buf} because they no longer exist.}
15363 % 
15364 % \begin{macrocode}
15365 \global\let\pcol@set@color\set@color
15366 \ifx\set@color\relax
15367 \let\pcol@bg@paintpage\relax \let\pcol@bg@paintbox\@gobble
15368 \let\pcol@bg@paintcolumns\relax
15369 \else
15370 \let\set@color\pcol@set@color@push
15371 \pcol@innerfalse
15372 \global\pcol@everyvbox{\pcol@dummytoken}%
15373 \pcol@everyvbox\everyvbox
15374 \everyvbox{\the\pcol@everyvbox \pcol@innertrue}
15375 \let\everyvbox\pcol@everyvbox
15376 \aftergroup\pcol@restoreeveryvbox
15377 \let\pcol@bg@paintpage\pcol@bg@@paintpage
15378 \let\pcol@bg@paintbox\pcol@bg@@paintbox
15379 \let\pcol@bg@paintcolumns\pcol@bg@@paintcolumns
15380 \fi
15381 \gdef\pcol@colorstack@shadow{}%
15382 % \end{macrocode}
15383 % 
15384 % \changes{v1.2-2}{2013/05/11}
15385 % {Add initialization of \cs{pcol@footnotebase} and
15386 % \cs{pcol@nfootnotes}, and redefinitions of \cs{footnote},
15387 % \cs{footnotemark}, \cs{footnotetext} and \cs{@footnotetext}.}
15388 % \changes{v1.36-3}{2024/10/23}
15389 % {Check for \cs{@footnotetext} being renamed to \cs{H@@footnotetext}.}
15390 %
15391 % The sixth settings are for (mainly \mcfnote) footnotes. We initialize two
15392 % footnote-related count registers letting $\bf=\!\pcol@footnotebase!$ have
15393 % \!\c@footnote! and zero-clearing $\nf=\!\pcol@nfootnotes!$. Then we
15394 % redefine \LaTeX's API macros \!\footnote!, \!\footnotemark! and
15395 % \!\footnotetext! to let them be our own \!\pcol@footnote!,
15396 % \!\pcol@footnotemark! and \!\pcol@footnotetext! so that they have
15397 % starred-versions. The other API macro to be redefined, if \Scfnote{}
15398 % typesetting is in effect, is \!\footnoterule! which lets
15399 % $\!\columnwidth!=\!\textwidth!$ before invoking its original version saved
15400 % in \!\pcol@footnoterule! so that it acts as in single-columned typesetting
15401 % rather than multi-columned. Then we redefine \LaTeX's internal macro
15402 % \!\@footnotetext!\footnote{
15403 % This is called \!\H@@footnotetext! if \textsf{hyperref} (with option
15404 % \texttt{hyperfootnote}) is loaded.}
15405 % letting it be our own \!\pcol@fntext! for encapsulating a footnote in a
15406 % \!\vbox! and for deferred \!\insert!ion with \Scfnote{} typesetting.
15407 % 
15408 % \begin{macrocode}
15409 \pcol@footnotebase\c@footnote \global\pcol@nfootnotes\z@
15410 \let\footnote\pcol@footnote
15411 \let\footnotemark\pcol@footnotemark
15412 \let\footnotetext\pcol@footnotetext
15413 \ifpcol@scfnote
15414 \def\footnoterule{{\columnwidth\textwidth \pcol@footnoterule}}%
15415 \fi
15416 \@ifundefined{H@@footnotetext}{%
15417 \let\@footnotetext\pcol@fntext
15418 }{%
15419 \let\H@@footnotetext\pcol@fntext
15420 }
15421 % \end{macrocode}
15422 %
15423 % Seventh, we let \!\marginpar!, \!\@mn@@marginnote! and \!\@xympar! be our
15424 % own versions \!\pcol@marginpar!, \!\pcol@marginnote! and \!\pcol@xympar!
15425 % respectively for the emulation of \!\marginnote!, saving the original
15426 % version of the first and third into \!\pcol@@marginpar! and
15427 % \!\pcol@@xympar!. Then we inactivate API macros \!\twosided! and
15428 % \!\footnoteplacement! together with their backward-compatible macros
15429 % \!\swapcolumninevenpages!, \!\noswapcolumnineven~pages!,
15430 % \!\footnotelayout!, \!\multicolumnfootnotes!, \!\singlecolumnfootnotes! and
15431 % \!\mergedfootnotes!, so that they commonly invoke \!\pcol@ignore! because
15432 % their inherent operations turning corresponding switches are harmful in
15433 % \env{paracol} environment. Note that the inactivation of \!\twosided! is
15434 % done by redefinition of \!\pcol@twosided! because we need optional
15435 % argument processing by \!\twosided! even when it is inactivated. Further
15436 % note, that since \textsf{footmisc} defines its own version of
15437 % \!\footnotelayout!, we must only redefine \!\footnotelayout! if it is what we
15438 % expect, i.e. an alias to \!\footnoteplacement!.
15439 % 
15440 % \changes{v1.2-4}{2013/05/11}
15441 % {Add nullification of \cs{[no]swapcolumninevenpages}.}
15442 % \changes{v1.2-2}{2013/05/11}
15443 % {Add nullification of API macros of footnote typesetting definition.}
15444 % \changes{v1.3-3}{2013/09/17}
15445 % {Add new API inactivation for \cs{pcol@twosided}.}
15446 % \changes{v1.3-4}{2013/09/17}
15447 % {Add new API inactivation for \cs{pcol@twosided}.}
15448 % \changes{v1.3-5}{2013/09/17}
15449 % {Add new API inactivation for \cs{footnotelayout}.}
15450 % \changes{v1.35-3}{2018/12/31}
15451 % {Add local modifications of \cs{marginpar}, \cs{@mn@@marginnote} and
15452 % \cs{@xympar} for the emulation of \cs{marginnote}.}
15453 % \changes{v1.36-2}{2024/10/22}
15454 % {Add new API inactivation for \cs{footnoteplacement} and a check before
15455 % deactivating \cs{footnotelayout}.}
15456 % 
15457 % \begin{macrocode}
15458 \let\pcol@@marginpar\marginpar \let\marginpar\pcol@marginpar
15459 \let\@mn@@marginnote\pcol@marginnote
15460 \let\pcol@@xympar\@xympar \let\@xympar\pcol@xympar
15461 \def\pcol@twosided[#1]{\pcol@ignore\twosided}%
15462 \def\swapcolumninevenpages{\pcol@ignore\swapcolumninevenpages}%
15463 \def\noswapcolumninevenpages{\pcol@ignore\noswapcolumninevenpages}%
15464 \def\footnoteplacement#1{\pcol@ignore\footnoteplacement}%
15465 \ifx\footnotelayout\footnoteplacement
15466 \def\footnotelayout#1{\pcol@ignore\footnotelayout}%
15467 \fi
15468 \def\multicolumnfootnotes{\pcol@ignore\multicolumnfootnotes}%
15469 \def\singlecolumnfootnotes{\pcol@ignore\singlecolumnfootnotes}%
15470 \def\mergedfootnotes{\pcol@ignore\mergedfootnotes}%
15471 % \end{macrocode}
15472 %
15473 % Eighth, we scan the list \!\pcol@localcommands! of $\arg{com}$ being the
15474 % name of commands, e.g., |switchcolumn|, available only in the environment
15475 % or customized for the environment, applying \!\pcol@defcomelt! to each
15476 % $\arg{com}$ to let $|\|\arg{com}=|\pcol@com@|{\cdot}\arg{com}$
15477 % 
15478 % \SpecialArrayMainIndex{\string\arg{com}}{\pcol@com@}
15479 % 
15480 % the latter of which is the real implementation of the former. Note that
15481 % the list does not have all \elocal{} API commands but we omit
15482 % \!\column!(|*|) for \env{column}(|*|) environments because their
15483 % implementations \!\pcol@com@column!(|*|) are modified after the first
15484 % invocation. Therefore, we \!\def!ine \!\column!(|*|) to have
15485 % \!\pcol@com@column!(|*|) in their bodies\footnote{
15486 % 
15487 % We can do this for other commands instead of adhering to \cs{let} to
15488 % eliminate the exception, but the author loves to use \cs{let} as much as
15489 % possible.}.
15490 % 
15491 % We also give the first \!\def!initions of
15492 % \!\pcol@com@column!(|*|) to let them do nothing but re\!\def!ine
15493 % themselves by \!\pcol@defcolumn! unless
15494 % \!\pcol@com@column*! is given an optional \mctext{} argument which is
15495 % directly processed by \!\pcol@sptext!, if they appear as the first
15496 % \cswitch{} command\slash environment after \beginparacol. Then we
15497 % re\!\def!ine \!\paracol! itself so that it will complain of illegal
15498 % nesting by \!\PackageError!.
15499 % 
15500 % \begin{macrocode}
15501 \let\@elt\pcol@defcomelt \pcol@localcommands
15502 \def\column{\pcol@com@column}%
15503 \@namedef{column*}{\@nameuse{pcol@com@column*}}%
15504 \global\let\pcol@com@column\pcol@defcolumn
15505 \global\@namedef{pcol@com@column*}{\pcol@defcolumn
15506 \@ifnextchar[%]
15507 \pcol@sptext\relax}%
15508 \def\paracol##1{\PackageError{paracol}{%
15509 Environment paracol cannot be nested.}\@eha}%
15510 % \end{macrocode}
15511 %
15512 % Ninth, we let \!\output! have our output routine \!\pcol@output! as its sole
15513 % token, and then make \!\output! request with
15514 % $\!\penalty!=\!\pcol@op@start!$ by \!\pcol@invokeoutput! to invoke
15515 % \!\pcol@output@start! for initialization, after letting
15516 % $\!\@elt!=\!\relax!$ to make it sure that any lists can be manipulated
15517 % without unexpected application of a macro to their elements.
15518 % 
15519 % \begin{macrocode}
15520 \output{\pcol@output}%
15521 \let\@elt\relax
15522 \pcol@invokeoutput\pcol@op@start
15523 % \end{macrocode}
15524 %
15525 % Tenth and finally, we let $\!\pcol@nextcol!=0$ in case \beginparacol{} has
15526 % the optional argument for \mctext{}, and invoke \!\pcol@sptext! if it has.
15527 % Otherwise, we invoke $|\pcol@colpream|{\cdot}0$ being the \colpream{} of
15528 % the first column 0, which will be invoked by \!\pcol@switchcol! if
15529 % \mctext{} is given.
15530 % 
15531 % \SpecialArrayIndex{c}{\pcol@colpream}
15532 % 
15533 % \changes{v1.35-5}{2018/12/31}
15534 % {Add the invocation of $\cs{pcol@colpream}{\cdot}0$.}
15535 % 
15536 % \begin{macrocode}
15537 \pcol@nextcol\z@
15538 \@ifnextchar[%]
15539 \pcol@sptext{\@nameuse{pcol@colpream0}}}
15540 % \end{macrocode}
15541 % \end{macro}\end{macro}\end{macro}\end{macro}
15542 %
15543 % \begin{macro}{\pcol@paracol}
15544 % The macro \!\pcol@paracol! has the definition of \!\paracol!, which is
15545 % redefined in the macro itself, so that the only referrer
15546 % \!\pcol@icolumncolor! examines if it appears in \env{paracol}, i.e.,
15547 % $\!\pcol@paracol!\neq\!\paracol!$.
15548 % 
15549 % \begin{macrocode}
15550 \let\pcol@paracol\paracol
15551
15552 % \end{macrocode}
15553 % \end{macro}
15554 %
15555 % \begin{macro}{\thecolumn}
15556 % \changes{v1.3-5}{2013/09/17}
15557 % {Introduced to let users know which column they are working in.}
15558 % 
15559 % The API macro \!\thecolumn! gives the value of \!\pcol@currcol! to users
15560 % to let them know which column they are working in so that, for example,
15561 % they do some column-dependent operations.
15562 % 
15563 % \begin{macrocode}
15564 \def\thecolumn{\number\pcol@currcol}
15565
15566 % \end{macrocode}
15567 % \end{macro}
15568 %
15569 % \begin{macro}{\pcol@ignore}
15570 % \changes{v1.2-4}{2013/05/11}
15571 % {Introduced for nullification of \cs{[no]swapcolumninevenpages}.}
15572 % \changes{v1.2-2}{2013/05/11}
15573 % {Introduced for nullification of API macros of footnote typesetting
15574 % definition.}
15575 % 
15576 % The macro \!\pcol@ignore!$\arg{macro}$ is to complain that the
15577 % $\arg{macro}$ being one of the followings appears in \env{paracol}
15578 % environment.
15579 % 
15580 % \begin{itemize}\raggedright\item[]
15581 % \!\twosided!,
15582 % \!\swapcolumninevenpages!,
15583 % \!\noswapcolumninevenpages!,
15584 % \!\footnoteplacement!,
15585 % \!\footnotelayout!,
15586 % \!\multicolumnfootnotes!,
15587 % \!\singlecolumnfootnotes!,
15588 % \!\mergedfootnotes!
15589 % \end{itemize}
15590 % 
15591 % That is, these macros, except for \!\twosided!, are re\!\def!ined in
15592 % \!\pcol@zparacol! to invoke this macro with the argument identifying
15593 % themselves, which is shown in the warning message given by
15594 % \!\PackageWarning!. As for \!\twosided!, the target of the
15595 % re\!\def!inition is \!\pcol@twosided! so that its optional argument is
15596 % captured before the complaint.
15597 % 
15598 % \begin{macrocode}
15599 \def\pcol@ignore#1{\PackageWarning{paracol}{The command \string#1 is not
15600 effective in paracol environment and thus ignored}}
15601
15602 % \end{macrocode}
15603 % \end{macro}
15604 %
15605 % \begin{macro}{\pcol@localcommands}
15606 % \changes{v1.0}{2011/10/10}
15607 % {Introduced to make API commands environment-local.}
15608 % \changes{v1.3-5}{2013/09/17}
15609 % {Add \cs{@elt}\string\texttt{\char`\{cleardoublepage\char`\}} for
15610 % \cs{cleardoublepage}.} 
15611 % 
15612 % The macro \!\pcol@localcommands! is the list of the names of the following
15613 % {\em\Uidx\elocal} API commands (or {\em\Uidx\lcommand{}s} in short) and is
15614 % solely referred to by \!\pcol@zparacol!.
15615 % 
15616 % \begin{center}\begin{tabular}{llll}
15617 % \!\switchcolumn!&
15618 % \!\endcolumn!(|*|)&
15619 % \!\nthcolumn!(|*|)&\!\endnthcolumn!(|*|)\\
15620 % \!\leftcolumn!(|*|)&\!\endleftcolumn!(|*|)&
15621 % \!\rightcolumn!(|*|)&\!\endrightcolumn!(|*|)\\
15622 % \!\flushpage!&
15623 % \!\clearpage!&
15624 % \!\cleardoublepage!\\
15625 % \!\synccounter!&
15626 % \!\syncallcounters!
15627 % \end{tabular}\end{center}
15628 % 
15629 % Note that we omit \!\column!(|*|) from the list as discussed in the
15630 % description of \!\pcol@zparacol!.
15631 % 
15632 % \begin{macrocode}
15633 \def\pcol@localcommands{%
15634 \@elt{switchcolumn}%
15635 \@elt{endcolumn}\@elt{endcolumn*}%
15636 \@elt{nthcolumn}\@elt{endnthcolumn}\@elt{nthcolumn*}\@elt{endnthcolumn*}%
15637 \@elt{leftcolumn}\@elt{endleftcolumn}\@elt{leftcolumn*}\@elt{endleftcolumn*}%
15638 \@elt{rightcolumn}\@elt{endrightcolumn}%
15639 \@elt{rightcolumn*}\@elt{endrightcolumn*}%
15640 \@elt{flushpage}\@elt{clearpage}\@elt{cleardoublepage}%
15641 \@elt{synccounter}\@elt{syncallcounters}}
15642 % \end{macrocode}
15643 % \end{macro}
15644 % 
15645 % \begin{macro}{\pcol@defcomelt}
15646 % \changes{v1.0}{2011/10/10}
15647 % {Introduced to make API commands environment-local.}
15648 % 
15649 % The macro \!\pcol@defcomelt! is invoked solely from \!\pcol@zparacol! to be
15650 % applied to each element $\arg{com}$ in \!\pcol@localcommands!. Two
15651 % lengthy \!\let!s with \!\expandafter!s are for doing
15652 % $\!\let!|\|\arg{com}|=\pcol@com@|{\cdot}\arg{com}$ to bind the \elocal{}
15653 % API command $|\|\arg{com}$ and its implementation
15654 % $|\pcol@com@|{\cdot}\arg{com}$.
15655 % 
15656 % \SpecialArrayIndex{\string\arg{com}}{\pcol@com@}
15657 % 
15658 % \begin{macrocode}
15659 \def\pcol@defcomelt#1{%
15660 \expandafter\let\expandafter\reserved@a\csname pcol@com@#1\endcsname
15661 \expandafter\let\csname #1\endcsname\reserved@a}
15662
15663 % \end{macrocode}
15664 % \end{macro}
15665 %
15666 % \begin{macro}{\@dbldeferlist}
15667 % \changes{v1.32-3}{2015/10/10}
15668 % {Add top-level definition in case that future \LaTeX{} removes it at
15669 % all.}
15670 % \begin{macro}{\pcol@end@dblfloat}
15671 % \changes{v1.32-3}{2015/10/10}
15672 % {Added to go back to old mechanism.}
15673 % As discussed in \secref{sec:imp-ovv-float}, 2015 version of \LaTeX{}
15674 % no longer uses \!\@dbldeferlist! but the macro itself is still kept in
15675 % \LaTeX{}. However it will be removed in future to make the first
15676 % \!\@cons! with it resulting in an error. Therefore, here we have its top
15677 % level definition with empty duplicatedly in case of its future
15678 % elimination. The macro \!\end@dblfloat!, on the other hand, is replaced
15679 % with a new definition in the new \LaTeX{} of course, and thus we define
15680 % \!\pcol@end@dblfloat! here to keep its old definition and to replace the
15681 % new one in \env{paracol} environment as discussed in
15682 % item-(\ref{item:ovv-float-end@dblfloat}) of \secref{sec:imp-ovv-float}.
15683 % 
15684 % \begin{macrocode}
15685 \gdef\@dbldeferlist{}
15686 \def\pcol@end@dblfloat{%
15687 \if@twocolumn
15688 \@endfloatbox
15689 \ifnum\@floatpenalty <\z@
15690 \@largefloatcheck
15691 \@cons\@dbldeferlist\@currbox
15692 \fi
15693 \ifnum \@floatpenalty =-\@Mii \@Esphack\fi
15694 \else
15695 \end@float
15696 \fi
15697 }
15698 % \end{macrocode}
15699 % \end{macro}\end{macro}
15700 %
15701 %
15702 %
15703 % \KeepSpace{6}
15704 % \section{Column Width Setting}
15705 % \label{sec:imp-cwidth}
15706 % \changes{v1.3-4}{2013/09/17}
15707 % {Add the section ``Column Width Setting'' mainly to discuss the new
15708 % API \cs{setcolumnwidth}.}
15709 %
15710 % \begin{macro}{\columnratio}
15711 % \changes{v1.1}{2012/05/11}
15712 % {Introduced to specify column width fractions.}
15713 % \changes{v1.3-2}{2013/09/17}
15714 % {Add optional second argument for fractions in right
15715 % parallel-pages.}
15716 % \begin{macro}{\pcol@icolumnratio}
15717 % \changes{v1.3-2}{2013/09/17}
15718 % {Introduced to process the optional second argument of
15719 % \cs{columnratio}.}
15720 % \begin{macro}{\pcol@columnratioleft}
15721 % \changes{v1.1}{2012/05/11}
15722 % {Introduced to keep column width fractions.}
15723 % \changes{v1.3-2}{2013/09/17}
15724 % {Renamed from \cs{pcol@columnratio} to clarify it has fractions for
15725 % left parallel-pages.}
15726 % \begin{macro}{\pcol@columnratioright}
15727 % \changes{v1.3-2}{2013/09/17}
15728 % {Introduced to keep column width fractions for right
15729 % parallel-pages.}
15730 % 
15731 % The API macro $\!\columnratio!
15732 % \Arg{r^l_0,r^l_1,\cdots,r^l_{k^l-1}}|[|r^r_0,r^r_1,\cdots,r^r_{k^r-1}|]|$
15733 % defines the column width fraction $r^l_c$ for column $c$ in left
15734 % \parapag{}es and optionally $r^r_c$ for those in right \parapag{}es. This
15735 % macro and its callee \!\pcol@icolumnratio! just \!\global!y \!\def!ine
15736 % macros \!\pcol@columnratioleft! and \!\pcol@columnratioright! whose
15737 % bodies have the first and second arguments respectively, or commonly have
15738 % the first if the second optional one is not given, so that they are given
15739 % to \!\pcol@setcolwidth@r! as its third argument through
15740 % \!\pcol@setcolumnwidth! invoked in \!\pcol@zparacol!. Both of
15741 % \!\pcol@columnratioleft! and \!\pcol@columnratioright! are initialized to
15742 % be empty so that all columns have same width and are separated by
15743 % \!\columnsep! as default. Note that \!\pcol@columnratioleft! can be made
15744 % \!\let!-equal to \!\relax! by the related API macro \!\setcolumnwidth! so
15745 % that \!\pcol@setcolumnwidth! knows which of specifications given by two
15746 % API macros is effective and chooses \!\pcol@setcolwidth@r! or
15747 % \!\pcol@setcolwidth@s!.
15748 % 
15749 % \begin{macrocode}
15750 %% Column Width Setting
15751
15752 \def\columnratio#1{\global\let\pcol@colwidthspecleft\relax
15753 \gdef\pcol@columnratioleft{#1}%
15754 \@ifnextchar[%]
15755 \pcol@icolumnratio{\gdef\pcol@columnratioright{#1}}}
15756 \def\pcol@icolumnratio[#1]{\gdef\pcol@columnratioright{#1}}
15757 \columnratio{}\relax
15758
15759 % \end{macrocode}
15760 % \end{macro}\end{macro}\end{macro}\end{macro}
15761 %
15762 % \KeepSpace{2}
15763 % \begin{macro}{\setcolumnwidth}
15764 % \changes{v1.3-4}{2013/09/17}
15765 % {Introduced to specify column widths and column-separating gaps more
15766 % detailedly.}
15767 % \begin{macro}{\pcol@isetcolumnwidth}
15768 % \changes{v1.3-4}{2013/09/17}
15769 % {Introduced to process the optional second argument of
15770 % \cs{setcolumnwidth}.}
15771 % \begin{macro}{\pcol@colwidthspecleft}
15772 % \changes{v1.3-4}{2013/09/17}
15773 % {Introduced to keep column width specifications for left
15774 % parallel-pages.}
15775 % \begin{macro}{\pcol@colwidthspecright}
15776 % \changes{v1.3-4}{2013/09/17}
15777 % {Introduced to keep column width specifications for right
15778 % parallel-pages.}
15779 % 
15780 % The API macro $\!\setcolumnwidth!
15781 % \Arg{s^l_0,s^l_1,\cdots,s^l_{k^l-1}}|[|s^r_0,s^r_1,\cdots,s^r_{k^r-1}|]|$
15782 % defines the column width specification $s^l_c$ for column $c$ in left
15783 % \parapag{}es and optionally $s^r_c$ for those in right \parapag{}es, where
15784 % each specification $s^x_c$ has the form of $|[|w_c|][/[|g_c|]]|$ for width
15785 % and gap specifier $\w_c$ and $\gap_c$. After \!\let!ting
15786 % $\!\pcol@columnratioleft!=\!\relax!$ to disable the setting by
15787 % \!\columnratio! and to enable that done by this macro, the macro and its
15788 % callee \!\pcol@isetcolumnwidth! just \!\global!y \!\def!ine macros
15789 % \!\pcol@colwidthspecleft! and \!\pcol@colwidthspecright! whose bodies have
15790 % the first and second arguments respectively, or commonly have the first if
15791 % the second optional one is not given, so that they are given to
15792 % \!\pcol@setcolwidth@s! as its fourth argument through
15793 % \!\pcol@setcolumnwidth! invoked in \!\pcol@zparacol!. Both of
15794 % \!\pcol@colwidthspecleft! and \!\pcol@colwidthspecright! are initially
15795 % undefined because the default specification is given by
15796 % \!\columnratio!|{}|.
15797 % 
15798 % \begin{macrocode}
15799 \def\setcolumnwidth#1{\global\let\pcol@columnratioleft\relax
15800 \gdef\pcol@colwidthspecleft{#1}%
15801 \@ifnextchar[%]
15802 \pcol@isetcolumnwidth{\gdef\pcol@colwidthspecright{#1}}}
15803 \def\pcol@isetcolumnwidth[#1]{\gdef\pcol@colwidthspecright{#1}}
15804
15805 % \end{macrocode}
15806 % \end{macro}\end{macro}\end{macro}\end{macro}
15807 %
15808 % \begin{macro}{\pcol@setcolumnwidth}
15809 % \changes{v1.3-4}{2013/09/17}
15810 % {Move original functions to \cs{pcol@setcolumnwidth@r} and redefine
15811 % this macro to switch \cs{pcol@setcolumnwidth@r} and
15812 % \cs{pcol@setcolumnwidth@s}.}
15813 % 
15814 % \begin{Sloppy}{1500}
15815 % The macro $\!\pcol@setcolumnwidth!\<\Cfrom\>\<\Cto\>\arg{ratio}\arg{spec}$
15816 % is invoked solely from \!\pcol@zparacol! but can be twice, with;
15817 % $$
15818 % (\Cfrom,\Cto,\arg{ratio},\arg{spec})=
15819 % (0,\CL,\!\pcol@columnratioleft!,\!\pcol@colwidthspecleft!)
15820 % $$
15821 % always and with;
15822 % $$
15823 % (\Cfrom,\Cto,\arg{ratio},\arg{spec})=
15824 % (\CL,\C,\!\pcol@columnratioright!,\!\pcol@colwidthspecright!)
15825 % $$
15826 % if $\CL<\C$ for \parapag{}ing. The macro simply invokes
15827 % \!\pcol@setcolwidth@s! if $\!\pcol@columnratioleft!=\!\relax!$ because
15828 % \!\setcolumnwidth! did so, or \!\pcol@setcolwidth@r! otherwise, with all
15829 % arguments given by \!\pcol@zparacol!.
15830 % \end{Sloppy}
15831 % 
15832 % \begin{macrocode}
15833 \def\pcol@setcolumnwidth{%
15834 \ifx\pcol@columnratioleft\relax \let\reserved@a\pcol@setcolwidth@s
15835 \else \let\reserved@a\pcol@setcolwidth@r
15836 \fi
15837 \reserved@a}
15838
15839 % \end{macrocode}
15840 % \end{macro}
15841 %
15842 % \begin{macro}{\pcol@setcolwidth@r}
15843 % \changes{v1.1}{2012/05/11}
15844 % {Introduced to calculate $w_c$.}
15845 % \changes{v1.3-4}{2013/09/17}
15846 % {Renamed from \cs{pcol@setcolumnwidth} to make it clear what the
15847 % macro works for.}
15848 % \changes{v1.3-2}{2013/09/17}
15849 % {Add arguments $C^0$, $C^1$, $\langle\string\mathit{ratio}\rangle$
15850 % and $\langle\string\mathit{spec}\rangle$ for columns in right
15851 % parallel-pages.}
15852 % \changes{v1.3-3}{2013/09/17}
15853 % {Add setting of $g_c\EQ\cs{pcol@columnsep}{\cdot}c=\cs{columnsep}.}
15854 % 
15855 % \begin{Hfuzz}{0.3pt}%
15856 % The macro $\!\pcol@setcolwidth@r!\<\Cfrom\>\<\Cto\>\arg{ratio}\arg{spec}$
15857 % is invoked solely from \!\pcol@zparacol! through \!\pcol@setcolumnwidth!
15858 % once or twice with the arguments described in the explanation of the
15859 % latter macro. The macro calculates $\w_c=|\pcol@columnwidth|{\cdot}c$
15860 % 
15861 % \SpecialArrayIndex{c}{\pcol@columnwidth}
15862 % 
15863 % for all $c\In\Cfrom\Cto$, from the fractions $r_0$, $r_1$, \ldots,
15864 % $r_{k-1}$ given through the third argument $\arg{ratio}$, which was given
15865 % to \!\columnratio! and then kept in \!\pcol@columnratioleft! or
15866 % \!\pcol@columnratioright!. The macro also lets
15867 % $\gap_c=|\pcol@columnsep|{\cdot}c=\!\columnsep!$
15868 % 
15869 % \SpecialArrayIndex{c}{\pcol@columnsep}
15870 % 
15871 % for all $c\In\Cfrom\Cto$.
15872 % \end{Hfuzz}
15873 %
15874 % First, we calculate $W=\!\textwidth!-(\Cto-\Cfrom-1)\times\!\columnsep!$
15875 % being the sum of $\w_c$ for all $c\In\Cfrom\Cto$. Then we let
15876 % $\w_c=r_d{}W$ and $\gap_c=\!\columnsep!$ for all $c\In\Cfrom{k'}$ where
15877 % $k'=\min(k,\Cto-1)$, in the \!\@for! loop scanning $r_d$ for all
15878 % $d=c-\Cfrom\In0k$. Finally, we let
15879 % $\w_c=(W-\sum_{d=\Cfrom}^{k'-1}w_d)/(\Cto-\Cfrom-k')$ and
15880 % $\gap_c=\!\columnsep!$ for all $c\In{k'}\Cto$. Note that
15881 % $|\pcol@columnwidth|{\cdot}c$ and $|\pcol@columnsep|{\cdot}c$ are macros
15882 % having the integer representations of $\w_c$ and $\gap_c$ with the unit
15883 % |sp|.
15884 % 
15885 % \begin{macrocode}
15886 \def\pcol@setcolwidth@r#1#2#3#4{%
15887 \@tempcntb#2\advance\@tempcntb-#1\advance\@tempcntb\m@ne
15888 \@tempdima-\columnsep \multiply\@tempdima\@tempcntb
15889 \advance\@tempdima\textwidth \@tempdimb\@tempdima
15890 \@tempcnta#1\relax\@tempcntb#2\advance\@tempcntb\m@ne
15891 \@for\reserved@a:=#3\do{%
15892 \ifnum\@tempcnta<\@tempcntb
15893 \@tempdimc\reserved@a\@tempdima
15894 \expandafter\xdef\csname pcol@columnwidth\number\@tempcnta\endcsname{%
15895 \number\@tempdimc sp}%
15896 \global\@namedef{pcol@columnsep\number\@tempcnta}{\columnsep}%
15897 \advance\@tempdimb-\@tempdimc
15898 \advance\@tempcnta\@ne
15899 \fi}%
15900 \@tempcntb#2\advance\@tempcntb-\@tempcnta
15901 \divide\@tempdimb\@tempcntb
15902 \@whilenum\@tempcnta<#2\do{%
15903 \expandafter\xdef\csname pcol@columnwidth\number\@tempcnta\endcsname{%
15904 \number\@tempdimb sp}%
15905 \global\@namedef{pcol@columnsep\number\@tempcnta}{\columnsep}%
15906 \advance\@tempcnta\@ne}%
15907 }
15908
15909 % \end{macrocode}
15910 % \end{macro}
15911 %
15912 % \KeepSpace{3}
15913 % \begin{macro}{\pcol@setcolwidth@s}
15914 % \changes{v1.3-4}{2013/09/17}
15915 % {Introduced to calculate $w_c$ and $g_c$.}
15916 % \begin{macro}{\pcol@setcw@c}
15917 % \changes{v1.3-4}{2013/09/17}
15918 % {Introduced to process column width components in the argument
15919 % $\langle\string\mathit{spec}\rangle$ of \cs{pcol@setcolwidth@s}.}
15920 % \begin{macro}{\pcol@setcw@s}
15921 % \changes{v1.3-4}{2013/09/17}
15922 % {Introduced to process column-separating gap components in the
15923 % argument $\langle\string\mathit{spec}\rangle$ of
15924 % \cs{pcol@setcolwidth@s}.}
15925 % \begin{macro}{\pcol@setcw@filunit}
15926 % \changes{v1.3-4}{2013/09/17}
15927 % {Introduced to define the unit of infinite stretch factors in the
15928 % argument $\langle\string\mathit{spec}\rangle$ of
15929 % \cs{pcol@setcolwidth@s}.}
15930 % 
15931 % \begin{Hfuzz}{0.3pt}%
15932 % The macro $\!\pcol@setcolwidth@s!\<\Cfrom\>\<\Cto\>\arg{ratio}\arg{spec}$
15933 % is invoked solely from \!\pcol@zparacol! through \!\pcol@setcolumnwidth!
15934 % once or twice with the arguments described in the explanation of the
15935 % latter macro. The macro calculates $\w_c=|\pcol@columnwidth|{\cdot}c$
15936 % 
15937 % \SpecialArrayIndex{c}{\pcol@columnwidth}
15938 % 
15939 % for all $c\In\Cfrom\Cto$ and $\gap_c=|\pcol@columnsep|{\cdot}c$
15940 % 
15941 % \SpecialArrayIndex{c}{\pcol@columnsep}
15942 % 
15943 % for all $c\In\Cfrom{\Cto{-}1}$, from the column\slash gap specifications
15944 % $s_0$, $s_1$, \ldots, $s_{k-1}$ given through the fourth argument
15945 % $\arg{spec}$, which was given to \!\setcolumnwidth! and then kept in
15946 % \!\pcol@colwidthspecleft! or \!\pcol@colwidthspecright!.
15947 % \end{Hfuzz}
15948 %
15949 % Each specification $s_d$ for $\w_c$ and $\gap_c$ where $c=\Cfrom+d$ has
15950 % the form $|[|w'_d|][/[|g'_d|]]|$ to specify the natural width $w^n_d$ and
15951 % $g^n_d$ and infinite stretch factor $w^f_d$ and $g^f_d$ of column\slash gap
15952 % specification as follows;
15953 % 
15954 % \begin{eqnarray*}
15955 % w^n_d&=&\cases{0&$w'_d=\emptyset$\cr
15956 % 0&$w'_d=f\!\fill!$\cr
15957 % \mathit{natural}(w'_d)&otherwise}\qquad
15958 % w^f_d = \cases{1&$w'_d=\emptyset$\cr
15959 % f&$w'_d=f\!\fill!$\cr
15960 % \mathit{stretch}(w'_d)&otherwise}\\[1ex]
15961 % g^n_d&=&\cases{\!\columnsep!&$g'_d=\emptyset$\cr
15962 % 0&$g'_d=f\!\fill!$\cr
15963 % \mathit{natural}(g'_d)&otherwise}\qquad
15964 % g^f_d = \cases{0&$g'_d=\emptyset$\cr
15965 % f&$g'_d=f\!\fill!$\cr
15966 % \mathit{stretch}(g'_d)&otherwise}
15967 % \end{eqnarray*}
15968 % 
15969 % where $\mathit{natural}(x)$ is the natural width of the skip $x$ and
15970 % $\mathit{stretch}(x)$ is the infinite stretch factor of $x$. Note that
15971 % any finite stretch factors or any shrink factors do not affect them, and
15972 % infinite stretch units |fil|, |fill| and |filll| are not distinguished.
15973 % From factors above, we determine $w_c$ and $\gap_c$ as follows;
15974 % 
15975 % \begin{eqnarray*}
15976 % W&=&\sum_{d=0}^{m-2}(w^n_d+g^n_d)+w^n_{m-1}\\
15977 % F&=&\sum_{d=0}^{m-2}(w^f_d+g^f_d)+w^f_{m-1}\\
15978 % x_c&=&\cases{(\WT/W)x^n_{c-\Cfrom}&$W\geq\WT\;\lor\;F\leq0$\cr
15979 % x^n_{c-\Cfrom}+(x^f_{c-\Cfrom}/F)(\WT-W)&$W<\WT\;\land\;F>0$}
15980 % \qquad(x\in{\w,\gap})
15981 % \end{eqnarray*}
15982 % where $\WT=\!\textwidth!$ and $m=\Cto-\Cfrom$.
15983 %
15984 % To perform the assignments above, the macro at first invoke
15985 % $\!\pcol@setcw@scan!\<\Cfrom\>\<\Cto\>\~\ARg{spec}$ letting
15986 % $\!\pcol@setcw@c!=\!\pcol@setcw@s!=\!\pcol@setcw@accumwd!$ and
15987 % \!\pcol@setcw@filunit!${}=1$\,pt to scan $s_d$ for all $d\In0{m}$ and to
15988 % accumulate $W+g^n_{m-1}$ and $F+g^f_{m-1}$ in \!\dimen@! and \!\dimen@ii!
15989 % and then subtract $g^n_{m-1}$ and $g^f_{m-1}$ from them to have $W$ and
15990 % $F$. Note that $F$ is represented by a dimension with the unit of pt by
15991 % the definition of \!\pcol@setcw@filunit!. Then we invoke
15992 % \!\pcol@setcw@calcfactors! to calculate $(\WT/W)=\!\pcol@setcw@scale!$ and
15993 % $(\WT-W)/F=\!\@tempdimb!$. Finally we scan $s_d$ again but in this case
15994 % we let $\!\pcol@setcw@c!=\!\pcol@setcw@set!|{width}|$,
15995 % $\!\pcol@setcw@s!=\!\pcol@setcw@set!|{sep}|$ and
15996 % $\!\pcol@setcw@filunit!=\!\@tempdimb!=(\WT-W)/F$ to let $w_c$ and $\gap_c$
15997 % have the values shown above.
15998 % 
15999 % \begin{macrocode}
16000 \def\pcol@setcolwidth@s#1#2#3#4{\begingroup
16001 \dimen@\z@ \dimen@ii\z@ \def\pcol@setcw@filunit{\@ne\p@}%
16002 \let\pcol@setcw@c\pcol@setcw@accumwd \let\pcol@setcw@s\pcol@setcw@accumwd
16003 \pcol@setcw@scan#1#2{#4}%
16004 \advance\dimen@-\@tempdima \advance\dimen@ii-\@tempdimb
16005 \pcol@setcw@calcfactors
16006 \def\pcol@setcw@c{\pcol@setcw@set{width}}%
16007 \def\pcol@setcw@s{\pcol@setcw@set{sep}}%
16008 \let\pcol@setcw@filunit\dimen@ii
16009 \pcol@setcw@scan#1#2{#4}%
16010 \endgroup}
16011 % \end{macrocode}
16012 % \end{macro}\end{macro}\end{macro}\end{macro}
16013 % 
16014 % \begin{macro}{\pcol@setcw@scan}
16015 % \changes{v1.3-4}{2013/09/17}
16016 % {Introduced to scan the argument
16017 % $\langle\string\mathit{spec}\rangle$ of \cs{pcol@setcolwidth@s}.}
16018 % 
16019 % The macro $\!\pcol@setcw@scan!\<\Cfrom\>\<\Cto\>\~\ARg{spec}$ is to scan
16020 % first $m=\Cto-\Cfrom$ elements in $\arg{spec}=s_0,s_1,\ldots$ being the
16021 % column\slash gap specifications given to \!\setcolumnwidth!. At first we
16022 % add `,' as many as $m$ to the tail of $\arg{spec}$ to make it sure the
16023 % resulting $\arg{spec}$ has $m$ or more elements. Then we scan all
16024 % elements in the extended $\arg{spec}$ by a \!\@for! loop having many
16025 % \!\expandafter! but equivalent to;
16026 % 
16027 % \begin{quote}
16028 % |\@for\reserved@a:=|$s_0,s_1,\ldots$|\do{|\textit{body}|}|
16029 % \end{quote}
16030 % 
16031 % In the \textit{body} above, we invoke
16032 % $\!\pcol@setcw@getspec!\;s_i|//|\!\@nil!$ to parse $s_i$ to have $w^n_i$,
16033 % $w^f_i$ to be processed by \!\pcol@setcw@c! and $g^n_i$ and $g^f_i$ by
16034 % \!\pcol@setcw@s!, for all $i\In0m$.
16035 % 
16036 % \begin{macrocode}
16037 \def\pcol@setcw@scan#1#2#3{\def\reserved@a{#3}%
16038 \@tempcnta#1\relax \@whilenum\@tempcnta<#2\do{
16039 \edef\reserved@a{\reserved@a,}\advance\@tempcnta\@ne}%
16040 \@tempcnta#1\relax
16041 \expandafter\@for\expandafter\reserved@a\expandafter:\expandafter=\reserved@a
16042 \do{%
16043 \ifnum\@tempcnta<#2\relax
16044 \expandafter\pcol@setcw@getspec\reserved@a//\@nil
16045 \fi
16046 \advance\@tempcnta\@ne}}
16047 % \end{macrocode}
16048 % \end{macro}
16049 % 
16050 % \KeepSpace{1}
16051 % \begin{macro}{\pcol@setcw@getspec}
16052 % \changes{v1.3-4}{2013/09/17}
16053 % {Introduced to parse an element in the argument
16054 % $\langle\string\mathit{spec}\rangle$ of \cs{pcol@setcolwidth@s}.}
16055 % \begin{macro}{\pcol@setcw@getspec@i}
16056 % \changes{v1.3-4}{2013/09/17}
16057 % {Introduced to parse an element in the argument
16058 % $\langle\string\mathit{spec}\rangle$ of \cs{pcol@setcolwidth@s}.}
16059 % \begin{macro}{\pcol@setcw@fill}
16060 % \changes{v1.3-4}{2013/09/17}
16061 % {Introduced to extract \cs{fill} factor from an element in the
16062 % argument $\langle\string\mathit{spec}\rangle$ of
16063 % \cs{pcol@setcolwidth@s}.}
16064 % 
16065 % The macro
16066 % $\!\pcol@setcw@getspec!\<w'_d\>|/|\<g'_d\>|/|\arg{garbage}\!\@nil!$ is
16067 % used solely in \!\pcol@setcw@scan! to parse a column\slash gap
16068 % specification $s_d=|[|w'_d|][/[|g'_d|]]|$, to extract factors $w_d^n$,
16069 % $w_d^f$, $g_d^n$ and $g_d^f$, and to process width factors by
16070 % \!\pcol@setcw@c! and gap factors by \!\pcol@setcw@s!. Since the macro is
16071 % invoked with arguments in the form of $s_d|//|\!\@nil!$, if $s_d$ has
16072 % `|/|' in it $w'_d$ and $g'_d$ should have everything preceding and
16073 % following the `|/|' respectively while $\arg{garbage}$ should have the
16074 % redundant `|/|'. Otherwise, i.e., if $s_d$ does not have `|/|',
16075 % $w'_d=s_d$ and $g'_d=\emptyset$ while $\arg{garbage}=\emptyset$\footnote{
16076 % 
16077 % If $s_d$ have two or more `|/|', everything following the second one is
16078 % thrown away into $\arg{garbage}$ together with `|//|'. Therefore we could
16079 % check if $s_d$ has at most one `|/|' by examining $\arg{garbage}$ but we
16080 % abandon it simply ignoring $\arg{garbage}$.}.
16081 % 
16082 % Therefore, we invoke $\!\pcol@setcw@getspec@i!\arg{default}\Arg{x'_d}$ twice
16083 % with $(\arg{default},x'_d)=(\!\fill!,w'_d)$ for a column and
16084 % $(\arg{default},x'_d)=(\!\columnsep!,g'_d)$ for a gap, and \!\pcol@setcw@c!
16085 % and \!\pcol@setcw@s! after each invocation respectively.
16086 %
16087 % In this macro, at first we scan all tokens in $x'_d$ by \!\@tfor! to
16088 % remove all space tokens in it\footnote{
16089 % 
16090 % A proper skip specification and ``$f\!\fill!$'' is always proper without
16091 % space tokens in them.}.
16092 % 
16093 % Then if $x'_d$ after the space removal has nothing, we let
16094 % $x'_d=\arg{default}$. Next we examine if $x'_d=f\!\fill!$ in a tricky
16095 % way by temporarily \!\let!ting $\!\@gtempa!=\!\relax!$, defining \!\fill!
16096 % as ``|1pt|\!\gdef!\!\@gtempa!|{}|'' and making an assignment
16097 % ``\!\@tempskipa! $x'_d$''. That is, if $x'_d=f\!\fill!$, \!\@tempskipa!
16098 % will have $f{\cdot}|1pt|$ being a proper dimension and \!\@gtempa! is made
16099 % empty. Otherwise, \!\@tempskipa! should have $x'_d$ which must be a
16100 % proper skip and \!\@gtempa! remains unchanged from \!\relax!. Therefore,
16101 % if $\!\@gtempa!=\!\relax!$ we let $\!\@tempskipa!=x'_d$ again\footnote{
16102 % 
16103 % Because the first assignment is done in a group.}.
16104 % 
16105 % Otherwise, we invoke $\!\pcol@setcw@fill!\;x'_d$ to let
16106 % \!\@tempskipa! have $0\,|pt|\ |plus|\ f\,|fil|$ where $f$ is replaced by 1
16107 % if $f=\emptyset$.
16108 %
16109 % Now \!\@tempskipa! has $x_d^n$ as its natural component and may have some
16110 % infinite stretch component $x_d^f$ specified explicitly or with \!\fill!.
16111 % Therefore, we assign \!\@tempskipa! to \!\@tempdima! so that it has
16112 % $x_d^n$, and then, after adding 0\,|pt| |plus| 1000\,|pt| |minus|
16113 % 1000\,|pt| to \!\@tempskipa! to make it sure it has both stretch and shrink
16114 % components\footnote{
16115 % 
16116 % Almost sure because they could be $-1000$\,pt, but we ignore the
16117 % possibility.}
16118 % 
16119 % keeping infinite stretch factor if any, invoke \!\pcol@extract@fil! giving
16120 % it \!\the!-expansion of \!\@tempskipa! as the argument to let
16121 % $\!\@tempdimb!=x_d^f\times\!\pcol@setcw@filunit!$.
16122 % 
16123 % \begin{macrocode}
16124 \def\pcol@setcw@getspec#1/#2/#3\@nil{%
16125 \pcol@setcw@getspec@i\fill{#1}\pcol@setcw@c
16126 \pcol@setcw@getspec@i\columnsep{#2}\pcol@setcw@s}
16127 \def\pcol@setcw@getspec@i#1#2{%
16128 \def\reserved@a{}%
16129 \@tfor\reserved@b:=#2\do{\edef\reserved@a{\reserved@a\reserved@b}}
16130 \ifx\reserved@a\@empty \let\reserved@a#1\fi
16131 \let\@gtempa\relax
16132 {\def\fill{1\p@\gdef\@gtempa{}}\@tempskipa\reserved@a}%
16133 \ifx\@gtempa\relax \@tempskipa\reserved@a\relax
16134 \else \expandafter\pcol@setcw@fill\reserved@a
16135 \fi
16136 \@tempdima\@tempskipa
16137 \advance\@tempskipa0\p@\@plus\@m\p@\@minus\@m\p@\relax
16138 \expandafter\pcol@extract@fil\the\@tempskipa\@nil}
16139 \def\pcol@setcw@fill#1\fill{\def\reserved@b{#1}%
16140 \ifx\reserved@b\@empty \let\reserved@b\@ne \fi
16141 \@tempskipa0\p@\@plus\reserved@b fil\relax}
16142
16143 % \end{macrocode}
16144 % \end{macro}\end{macro}\end{macro}
16145 %
16146 % \begin{macro}{\pcol@setcw@accumwd}
16147 % \changes{v1.3-4}{2013/09/17}
16148 % {Introduced to accumulate natural and fill factors of the element in
16149 % the argument $\langle\string\mathit{spec}\rangle$ of
16150 % \cs{pcol@setcolwidth@s}.}
16151 % 
16152 % The macro \!\pcol@setcw@accumwd! is made \!\let!-equal to \!\pcol@setcw@c!
16153 % and \!\pcol@setcw@s! commonly and thus invoked from \!\pcol@setcw@getspec!
16154 % with setting $\!\@tempdima!=x_d^n$ and $\!\@tempdimb!=x_d^f\times1\,|pt|$,
16155 % where $x\in\{w,g\}$. The macro simply add them to \!\dimen@! and
16156 % \!\dimen@ii! respectively to accumulate $x_d^n$ and $x_d^f$ in them.
16157 % 
16158 % \begin{macrocode}
16159 \def\pcol@setcw@accumwd{\advance\dimen@\@tempdima \advance\dimen@ii\@tempdimb}
16160 % \end{macrocode}
16161 % \end{macro}
16162 % 
16163 % \begin{macro}{\pcol@setcw@set}
16164 % \changes{v1.3-4}{2013/09/17}
16165 % {Introduced to define $w_c$ and $g_c$ according to the element in
16166 % the argument $\langle\string\mathit{spec}\rangle$ of
16167 % \cs{pcol@setcolwidth@s}.}
16168 % 
16169 % The macro $\!\pcol@setcw@set!\ARg{wors}$ is made the body of
16170 % \!\pcol@setcw@c! with $\arg{wors}=|width|$ and of
16171 % \!\pcol@setcw@s! with $\arg{wors}=|sep|$ and thus invoked from
16172 % \!\pcol@setcw@getspec! with setting $\!\@tempdima!=x_d^n$ and
16173 % $$
16174 % (\!\pcol@setcw@scale!,\!\@tempdimb!)
16175 % \in\{(\emptyset,\,(x_d^f/F)(\WT-W)),\;(\WT/W,\,0)\}
16176 % $$
16177 % Therefore, we calculate
16178 % $x_c=\!\pcol@setcw@scale!\times\!\@tempdima!+\!\@tempdimb!$ and
16179 % \!\xdef!ine $|\pcol@column|{\cdot}\<wors\>{\cdot}c$ to let it have the
16180 % integer representation of $x_c$ with the unit |sp|.
16181 % 
16182 % \SpecialArrayIndex{c}{\pcol@columnwidth}
16183 % \SpecialArrayIndex{c}{\pcol@columnsep}
16184 % 
16185 % \begin{macrocode}
16186 \def\pcol@setcw@set#1{%
16187 \@tempdima\pcol@setcw@scale\@tempdima \advance\@tempdima\@tempdimb
16188 \expandafter\xdef\csname pcol@column#1\number\@tempcnta\endcsname{%
16189 \number\@tempdima sp}}
16190
16191 % \end{macrocode}
16192 % \end{macro}
16193 %
16194 % \begin{macro}{\pcol@setcw@calcfactors}
16195 % \changes{v1.3-4}{2013/09/17}
16196 % {Introduced to calculate scaling and stretch factors from
16197 % the argument $\langle\string\mathit{spec}\rangle$ of
16198 % \cs{pcol@setcolwidth@s}.}
16199 % \begin{macro}{\pcol@setcw@calcf}
16200 % \changes{v1.3-4}{2013/09/17}
16201 % {Introduced to calculate scaling or stretch factor from
16202 % the argument $\langle\string\mathit{spec}\rangle$ of
16203 % \cs{pcol@setcolwidth@s}.}
16204 % \changes{v1.31}{2013/10/10}
16205 % {Capitalize the first word of the error message for consistency.}
16206 % \begin{macro}{\pcol@setcw@scale}
16207 % \changes{v1.3-4}{2013/09/17}
16208 % {Introduced to have the scaling factor of $w_c$ and $g_c$.}
16209 % 
16210 % The macro \!\pcol@setcw@calcfactors! is used solely in
16211 % \!\pcol@setcolwidth@s! to calculate $\phi_s=\!\pcol@setcw@scale!$ and
16212 % $\phi_f=\!\dimen@ii!$ as follows
16213 % $$
16214 % (\phi_s,\phi_f)=\cases{(\WT/\W,\;0)& $W\geq\WT\;\lor\;F\leq0$\cr
16215 % (1,\;(\WT-W)/F)&$W<\WT\;\land\;F>0$}
16216 % $$
16217 % where $W=\!\dimen@!$, $F\times1\,|pt|=\!\dimen@ii!$ and $\WT=\!\textwidth!$,
16218 % and $\phi_s=1$ is represented by empty body of \!\pcol@setcw@scale!.
16219 % First we deal with the special and trivial case of $W=\WT$ to let
16220 % $\phi_s=1$ and $\phi_f=0$ so as to avoid arithmetic error in the
16221 % calculation of $\WT/W$. If $W\neq\WT$ on the other hand, we calculate
16222 % $\WT/W$ by $\!\pcol@setcw@calcf!\<\WT\>\<W\>\<\phi_s\>$ to have a
16223 % provisional result. Then if $W<\WT$ and $F>0$, we let $\phi_s=1$ and
16224 % invoke \!\pcol@setcw@calcf! again giving it $(\WT-W)$ and $F\times1\,|pt|$
16225 % but throw away the result $(\WT-W)/(F\times1\,|pt|)$ because \!\@tempdimb!
16226 % should have $(\WT-W)/F$ which is then set into $\phi_f=\!\dimen@ii!$.
16227 % Otherwise, we keep the provisional result of $\phi_s$ as the final one and
16228 % let $\phi_f=\!\dimen@ii!=0$.
16229 %
16230 % The macro $\!\pcol@setcw@calcf!\<x\>\<y\>\<z\>$ calculates $z\approx x/y$
16231 % and let $\!\@tempdimb!=Z=z\times1\,|pt|$ as follows. First we find the
16232 % following three parameters.
16233 % 
16234 % \begin{eqnarray*}
16235 % k_1&=&\min\Set{k}{k\geq0,\;x\cdot2^k\geq2^{13}\,|pt|}\\
16236 % k_2&=&\max\Set{k}{y\bmod2^k=0}\\
16237 % k_3&=&\min\Set{k}{k\geq0,\;\lceil y/2^{k_2+k}\rceil\leq2^{15}}
16238 % \end{eqnarray*}
16239 % 
16240 % With these parameters, we calculate $z'=\lfloor(x\cdot2^{k_1})/\lceil
16241 % y/2^{k_2+k_3}\rceil\rfloor$ to have a good approximation of
16242 % $(x/y)\cdot2^{k}$ where $k=k_1+k_2+k_3$ without arithmetic overflow. Then
16243 % if $z'/2^k\geq2^{14}$ or in other words $Z$ is larger than \!\maxdimen!,
16244 % we complain that by \!\PackageError! and, in case a user dare to
16245 % continue the typesetting process, we let $Z=10000\,|pt|$. Otherwise, we
16246 % calculate $Z=(z'/2^k)\cdot2^{16}=z'\cdot2^{16-k}$ to have it in
16247 % \!\@tempdimb! by $Z=z'\times2^{16-k}$ if $k<16$, or by $Z=z'/2^{k-16}$
16248 % otherwise. Finally we invoke \!\pcol@extract@pt! giving it
16249 % \!\the!-representation of $Z$ to have $z$.
16250 %
16251 % Note that it is assured $z\leq x/y$ regardless of successfulness of the
16252 % calculation and thus the scaling $\phi_s x_d^n$ and stretching
16253 % $x_d^n+\phi_f x_d^f$ cannot exceed their exact value to make it also sure
16254 % that $\sum_{c=\Cfrom}^{\Cto-2}(\w_c+\gap_c)+\w_{\Cto-1}\leq\WT$ and thus
16255 % the series of columns and \csepgap{}s should not cause overfull when a
16256 % page is shipped out with \!\hfil! added to each \csepgap{} for underfull
16257 % avoidance.
16258 % 
16259 % \begin{macrocode}
16260 \def\pcol@setcw@calcfactors{%
16261 \ifdim\dimen@=\textwidth \def\pcol@setcw@scale{}\dimen@ii\z@
16262 \else
16263 \pcol@setcw@calcf\textwidth\dimen@\pcol@setcw@scale
16264 \ifdim\dimen@<\textwidth \ifdim\dimen@ii>\z@
16265 \def\pcol@setcw@scale{}%
16266 \@tempdimc\textwidth \advance\@tempdimc-\dimen@
16267 \pcol@setcw@calcf\@tempdimc\dimen@ii\reserved@a \dimen@ii\@tempdimb
16268 \else \dimen@ii\z@ \fi
16269 \else \dimen@ii\z@ \fi
16270 \fi}
16271 \def\pcol@setcw@calcf#1#2#3{%
16272 \@tempdimb#1\@tempdima#2\@tempcnta\z@
16273 \ifdim\@tempdima=\z@ \@tempdima1sp\relax\fi
16274 \@whiledim\@tempdimb<8192\p@\do{%
16275 \multiply\@tempdimb\tw@ \advance\@tempcnta\@ne}%
16276 \@tempdimc\@tempdima
16277 \@whiledim\@tempdima=\@tempdimc\do{%
16278 \divide\@tempdimc\tw@ \multiply\@tempdimc\tw@
16279 \ifdim\@tempdima=\@tempdimc
16280 \divide\@tempdima\tw@ \divide\@tempdimc\tw@ \advance\@tempcnta\@ne
16281 \fi}
16282 \advance\@tempdima-1sp\relax
16283 \@whilenum\@tempdima>32768\do{\divide\@tempdima\tw@ \advance\@tempcnta\@ne}%
16284 \advance\@tempdima1sp\relax
16285 \divide\@tempdimb\@tempdima \@tempdimc\@tempdimb \@tempcntb\@tempcnta
16286 \@whilenum\@tempcntb>\z@\do{\divide\@tempdimc\tw@ \advance\@tempcntb\m@ne}
16287 \ifnum\@tempdimc>16383\relax
16288 \PackageError{%
16289 Scaling/filling factor for column/gap width is too large.}\@eha
16290 \@tempdimb\@M\p@
16291 \else
16292 \@tempcntb\sixt@@n \advance\@tempcntb-\@tempcnta
16293 \ifnum\@tempcntb<\z@
16294 \@whilenum\@tempcntb<\z@\do{\divide\@tempdimb\tw@ \advance\@tempcntb\@ne}%
16295 \else
16296 \@whilenum\@tempcntb>\z@\do{%
16297 \multiply\@tempdimb\tw@ \advance\@tempcntb\m@ne}%
16298 \fi
16299 \fi
16300 \expandafter\pcol@extract@pt\the\@tempdimb#3}
16301
16302 % \end{macrocode}
16303 % \end{macro}\end{macro}\end{macro}
16304 %
16305 % \KeepSpace{3}
16306 % \begin{macro}{\pcol@defkw}
16307 % \changes{v1.3-4}{2013/09/17}
16308 % {Introduced to define $\cs{pcol@kw@}{\cdot}k$ where
16309 % $k\in\{\string\texttt{pt},\string\texttt{plus},\string\texttt{minus},
16310 % \string\texttt{fil}\}$.}
16311 % \begin{macro}{\pcol@kw@pt}
16312 % \changes{v1.3-4}{2013/09/17}
16313 % {Introduced to have the keyword \string\texttt{pt}.}
16314 % \begin{macro}{\pcol@kw@plus}
16315 % \changes{v1.3-4}{2013/09/17}
16316 % {Introduced to have the keyword \string\texttt{plus}.}
16317 % \begin{macro}{\pcol@kw@minus}
16318 % \changes{v1.3-4}{2013/09/17}
16319 % {Introduced to have the keyword \string\texttt{minus}.}
16320 % \begin{macro}{\pcol@kw@fil}
16321 % \changes{v1.3-4}{2013/09/17}
16322 % {Introduced to have the keyword \string\texttt{fil}.}
16323 % 
16324 % The macro
16325 % $\!\pcol@defkw!|1.0|\arg{pt}\verb*| |\arg{plus}\verb*| 1.0|\arg{fil}
16326 % \verb*| |\arg{minus}\verb*| 1.0|\arg{garbage}\!\@nil!$ is used just once at
16327 % the top level to \!\def!ine \!\pcol@kw@pt!, \!\pcol@kw@plus!,
16328 % \!\pcol@kw@minus! and \!\pcol@kw@fil! letting them have $\arg{pt}=|pt|$,
16329 % $\arg{plus}=|plus|$, $\arg{minus}=|minus|$ and $\arg{fil}=|fil|$ in their
16330 % body respectively but with $\!\catcode!=12$ (other) which is used in
16331 % \!\the!-representation of glues. For the definition, we invoke
16332 % \!\pcol@defkw! giving it \!\the!-representation of \!\@tempskipa! letting
16333 % it have $1\,|pt|\ |plus|\ 1\,|fil|\ |minus|\ 1\,|fil|$ having all keywords
16334 % we need to have\footnote{
16335 % 
16336 % We can do what \!\pcol@defkw! does by temporarily giving $\!\catcode!=12$
16337 % to the characters for the keywords of course, but this method is much
16338 % easier.}.
16339 % 
16340 % The macro \!\pcol@kw@pt! is used in
16341 % $\!\pcol@extract@fil@ii!\arg{unit}\!\@nil!$ to examine if
16342 % $\arg{unit}=|pt|$, and in \!\pcol@def@extract@pt! to \!\def!ine
16343 % \!\pcol@extract@pt! having |pt| in its argument specification. The macros
16344 % \!\pcol@kw@plus! and \!\pcol@kw@minus! are used only in
16345 % \!\pcol@def@extract@fil!, and
16346 % \!\pcol@kw@fil! only in \!\pcol@def@extract@fil@iii!, to \!\def!ine
16347 % \!\pcol@extract@fil! having |plus| and |minus|, and
16348 % \!\pcol@extract@fil@iii! having |fil|, in their argument specifications
16349 % respectively.
16350 % 
16351 % \begin{macrocode}
16352 \@tempskipa 1\p@\@plus1fil\@minus1fil\relax
16353 \def\[email protected]#1 #2 1.0#3 #4 1.0#5\@nil{%
16354 \def\pcol@kw@pt{#1}\def\pcol@kw@plus{#2}\def\pcol@kw@fil{#3}%
16355 \def\pcol@kw@minus{#4}}
16356 \expandafter\pcol@defkw\the\@tempskipa\@nil
16357
16358 % \end{macrocode}
16359 % \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
16360 % 
16361 % \KeepSpace{4}
16362 % \begin{macro}{\pcol@def@extract@fil}
16363 % \changes{v1.3-4}{2013/09/17}
16364 % {Introduced to define \cs{pcol@extract@fil}.}
16365 % \begin{macro}{\pcol@extract@fil}
16366 % \changes{v1.3-4}{2013/09/17}
16367 % {Introduced to extract infinite stretch factor from a skip if any.}
16368 % \begin{macro}{\pcol@extract@fil@i}
16369 % \changes{v1.3-4}{2013/09/17}
16370 % {Introduced to extract the factor of \string\texttt{fil} from the
16371 % stretch factor in a skip if any.}
16372 % \begin{macro}{\pcol@extract@fil@ii}
16373 % \changes{v1.3-4}{2013/09/17}
16374 % {Introduced to extract the factor of \string\texttt{fil} from the
16375 % stretch factor in a skip if any.}
16376 % \begin{macro}{\pcol@def@extract@fil@iii}
16377 % \changes{v1.3-4}{2013/09/17}
16378 % {Introduced to define \cs{pcol@extract@fil@iii}.}
16379 % \begin{macro}{\pcol@extract@fil@iii}
16380 % \changes{v1.3-4}{2013/09/17}
16381 % {Introduced to extract the factor of \string\texttt{fil} from the
16382 % stretch factor in a skip.}
16383 % 
16384 % The macro
16385 % $\!\pcol@extract@fil!\<\mathit{garbage}_1\>\verb*| plus |\<s\>\verb*| minus|
16386 % \<\mathit{garbage}_2\>\!\@nil!$ is used solely in \!\pcol@setcw@getspec@i!
16387 % to extract the infinite stretch factor $f$ in the stretch component $s$ of
16388 % a column\slash gap specification $x'_d$ and to let
16389 % $\!\@tempdimb!=f\cdot{}u$ where
16390 % $u=\!\pcol@setcw@filunit!\in\{1\,|pt|,\;\phi_f=\!\dimen@ii!\}$ if $f$
16391 % exist or $\!\@tempdimb!=0$ otherwise. First of all, since the macro has
16392 % keywords |plus| and |minus| in $\!\catcode!=12$ in its argument
16393 % specification, we \!\def!ine it using \!\pcol@def@extract@fil!, whose body
16394 % is equivalent to
16395 % 
16396 % \begin{itemize}\item[]
16397 % \let\@sverb\latex@sverb
16398 % \verb*|\def\pcol@extract@fil#1 plus #2 minus#3\@nil|
16399 % |{\pcol@extract@fil@i#2\@nil}|
16400 % \end{itemize}
16401 % 
16402 % just once at the top level. Then since $s$ should have the form
16403 % $\<n\>|.|\<m\>\arg{unit}$ where $n$ and $m$ are decimal digit sequences and
16404 % $\arg{unit}\in\{|pt|,|fil|,|fill|,|filll|\}$, we examine if
16405 % $\arg{unit}=|pt|$ or not by a tricky way in
16406 % $\!\pcol@extract@fil@i!\<n\>|.|\<m{\cdot}\mathit{unit}\>\!\@nil!$. That
16407 % is, we do $\!\count@!\<m{\cdot}\mathit{unit}\>\!\@nil!$ with
16408 % \!\afterassignment! to invoke $\!\pcol@extract@fil@ii!\arg{unit}\!\@nil!$
16409 % after $m$ is assigned to \!\count@! to capture $\arg{unit}$. Then if it
16410 % is |pt| we let $\!\@tempdimb!=0$, or otherwise invoke
16411 % $\!\pcol@extract@fil@iii!\<f\>|fil|\arg{garbage}\!\@nil!$ giving it $s$
16412 % because it should have a postfix being |fil|, |fill| or |filll|, to have
16413 % $\!\@tempdimb!=f\cdot u$ finally. Note that since
16414 % \!\pcol@extract@fil@iii! also has the keyword |fil| in its argument
16415 % specification, we \!\def!ine it using \!\pcol@def@extract@fil@iii!, whose
16416 % body is equivalent to
16417 % 
16418 % \begin{quote}
16419 % \let\@sverb\latex@sverb
16420 % \verb*|\def\pcol@extract@fil@iii#1fil#2\@nil{%|\\
16421 % | \@tempdimb\pcol@setcw@filunit\relax \@tempdimb#1\@tempdimb}|
16422 % \end{quote}
16423 % 
16424 % just once at the top level too.
16425 % 
16426 % \begin{macrocode}
16427 \edef\pcol@def@extract@fil{%
16428 \def\noexpand\pcol@extract@fil
16429 ##1\space\pcol@kw@plus\space##2\space\pcol@kw@minus##3\noexpand\@nil{%
16430 \noexpand\pcol@extract@fil@i##2\noexpand\@nil}}
16431 \pcol@def@extract@fil
16432 \def\pcol@extract@fil@i#1.#2\@nil{\def\reserved@a{#1.#2}%
16433 \afterassignment\pcol@extract@fil@ii\count@#2\@nil}
16434 \def\pcol@extract@fil@ii#1\@nil{\def\reserved@b{#1}%
16435 \ifx\reserved@b\pcol@kw@pt \@tempdimb\z@
16436 \else \expandafter\pcol@extract@fil@iii\reserved@a\@nil
16437 \fi}
16438 \edef\pcol@def@extract@fil@iii{%
16439 \def\noexpand\pcol@extract@fil@iii##1\pcol@kw@fil##2\noexpand\@nil{%
16440 \@tempdimb\noexpand\pcol@setcw@filunit\relax \@tempdimb##1\@tempdimb}}
16441 \pcol@def@extract@fil@iii
16442
16443 % \end{macrocode}
16444 % \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
16445 %
16446 % \begin{macro}{\pcol@def@extract@pt}
16447 % \changes{v1.3-4}{2013/09/17}
16448 % {Introduced to define \cs{pcol@extract@pt}.}
16449 % \begin{macro}{\pcol@extract@pt}
16450 % \changes{v1.3-4}{2013/09/17}
16451 % {Introduced to extract the factor of \string\texttt{pt} from the
16452 % \cs{the} representation of a dimension.}
16453 % 
16454 % The macro $\!\pcol@extract@pt!\<f\>|pt|\<scale\>$ is solely used in
16455 % \!\pcol@setcw@calcf! to extract $f$ from a dimension in the form of
16456 % $f|pt|$ and to let the macro $\<scale\>$ have $f$. Since this macro has
16457 % the keyword |pt| in its argument specification, we \!\def!ine it using
16458 % \!\pcol@def@extract@pt!, whose body is equivalent to
16459 % 
16460 % \begin{quote}
16461 % \let\@sverb\latex@sverb
16462 % |\def\pcol@extract@pt#1pt#2{\def#2{#1}}|
16463 % \end{quote}
16464 % just once at the top level again.
16465 % 
16466 % \begin{macrocode}
16467 \edef\pcol@def@extract@pt{%
16468 \def\noexpand\pcol@extract@pt##1\pcol@kw@pt##2{\def##2{##1}}}
16469 \pcol@def@extract@pt
16470
16471 % \end{macrocode}
16472 % \end{macro}\end{macro}
16473 %
16474 %
16475 %
16476 % \section{Counter Operations}
16477 % \label{sec:imp-counter}
16478 %
16479 % \begin{macro}{\globalcounter}
16480 % \changes{v1.2-7}{2013/05/11}
16481 % {Examine if the argument counter is already in
16482 % $\string\mathit{\Theta}^g$ to avoid the duplication in the list
16483 % which caused a bug.}
16484 % \changes{v1.32-1}{2015/10/10}
16485 % {Modified according to the introduction of \cs{globalcounter*}.}
16486 % \begin{macro}{\pcol@globalcounter@s}
16487 % \changes{v1.32-1}{2015/10/10}
16488 % {Added for \cs{globalcounter*}.}
16489 % \begin{macro}{\pcol@globalcounter}
16490 % \changes{v1.32-1}{2015/10/10}
16491 % {Renamed from \cs{globalcounter} according to the introduction of
16492 % \cs{globalcounter*}.}
16493 % \begin{macro}{\pcol@gcounters}
16494 % The API macro $\!\globalcounter!\ARg{ctr}$, implemented by
16495 % \!\pcol@globalcounter! and also used in \!\pcol@fnlayout@p! to globalize the
16496 % counter \counter{footnote}, defines that $\arg{ctr}$ is a \gcounter, and
16497 % thus adds it to $\CG=\Midx{\!\pcol@gcounters!}$, which has \counter{page}
16498 % at initial. Note that we examines if $\arg{ctr}\in\CG$ prior to the
16499 % addition to avoid the duplication in $\CG$. Also note that initial
16500 % definition of \!\pcol@gcounters! is done by \!\gdef! just for consistent
16501 % \!\global! assignments to it. On the other hand \!\globalcounter!|*|,
16502 % implemented by \!\pcol@globalcounter@s!, makes all counters kept in
16503 % \!\cl@@ckpt! global by letting \!\pcol@gcounters! have the list.
16504 % Switching these two functionality is done by \!\globalcounter! examining
16505 % if it is followed by a |*| by \!\@ifstar!.
16506 % 
16507 % \begin{macrocode}
16508 %% Counter Operations
16509
16510 \def\globalcounter{\@ifstar\pcol@globalcounter@s\pcol@globalcounter}
16511 \def\pcol@globalcounter@s{\global\let\pcol@gcounters\cl@@ckpt}
16512 \def\pcol@globalcounter#1{{%
16513 \@tempswafalse \def\reserved@a{#1}%
16514 \def\@elt##1{\def\reserved@b{##1}%
16515 \ifx\reserved@a\reserved@b \@tempswatrue \fi}%
16516 \pcol@gcounters
16517 \if@tempswa\else \@cons\pcol@gcounters{{#1}}\fi}}
16518 \gdef\pcol@gcounters{\@elt{page}}
16519 % \end{macrocode}
16520 % \end{macro}\end{macro}\end{macro}\end{macro}
16521 % 
16522 % \begin{macro}{\localcounter}
16523 % \changes{v1.2-6}{2013/05/11}
16524 % {Introduced to remove the argument counter from
16525 % $\string\mathit{\Theta}^g$.}
16526 % 
16527 % The API macro \!\localcounter!\marg{ctr}, also used in
16528 % \!\pcol@fnlayout@c! to localize the counter \counter{footnote},
16529 % declares that $\arg{ctr}$ is a \lcounter, and thus removes it from $\CG$
16530 % by \!\pcol@removecounter! if $\arg{ctr}\neq\counter{page}$.
16531 % 
16532 % \begin{macrocode}
16533 \def\localcounter#1{%
16534 \expandafter\ifx\csname c@#1\endcsname\c@page\else
16535 \pcol@removecounter\pcol@gcounters{#1}%
16536 \fi}
16537 % \end{macrocode}
16538 % \end{macro}
16539 % 
16540 % \KeepSpace{1}
16541 % \begin{macro}{\pcol@remctrelt}
16542 % \changes{v1.2-6}{2013/05/11}
16543 % {Recode to use newly introduced \cs{pcol@removecounter}.}
16544 % \begin{macro}{\pcol@removecounter}
16545 % \changes{v1.2-6}{2013/05/11}
16546 % {Introduced for the counter removal operation in
16547 % \cs{localcounter} and \cs{pcol@remctrelt}.}
16548 % \begin{macro}{\pcol@iremctrelt}
16549 % \changes{v1.2-6}{2013/05/11}
16550 % {Add the first argument $\string\mathit{\Theta}'$ as the counter
16551 % list from which the second argument $\theta$ is removed.}
16552 % 
16553 % The macro $\!\pcol@remctrelt!\Arg\cg$ is invoked solely from
16554 % \!\pcol@zparacol! and is applied to each \gcounter{} $\cg\in\CG$ to
16555 % remove it from $\CC=\!\pcol@counters!$ in which we have $\CTL$ finally.
16556 % The macro also moves $|\cl@|{\cdot}\cg=\clist(\cg)$
16557 % 
16558 % \SpecialArrayIndex{\theta}{\cl@}
16559 % 
16560 % to $|\pcol@cl@|{\cdot}\cg$
16561 % 
16562 % \SpecialArrayMainIndex{\theta}{\pcol@cl@}
16563 % 
16564 % to keep the list of the descendant \lcounter{}s of $\cg$ in it, and then
16565 % re\!\def!ines $|\cl@|{\cdot}\cg=\!\pcol@stepcounter!\Arg\cg$
16566 % 
16567 % \SpecialArrayMainIndex{\theta}{\cl@}
16568 % 
16569 % so that it is invoked on $\!\stepcounter!\Arg\cg$ to let $\val_c(\cl)=0$
16570 % for all $c\In0\C$ and $\cl\in\clist(\cg)$, if $\cg\neq\counter{page}$.
16571 % These operations are performed by a lengthy sequence with many occurrences
16572 % of \!\expandafter!, \!\csname! and \!\endcsname! but the sequence is
16573 % equivalent to the following.
16574 % 
16575 % \begin{quote}
16576 % $\!\let!|\pcol@cl@|{\cdot}\cg|=\cl@|{\cdot}\cg$\\
16577 % $\CSIndex{ifx}|\c@|{\cdot}\cg\!\c@page!|\else |
16578 % |\def\cl@|{\cdot}\cg|{|\!\pcol@stepcounter!|{|\cg|}}\fi|$
16579 % \end{quote}
16580 % 
16581 % As for the removal of $\cg$ from $\CC$, we invoke
16582 % $\!\pcol@removecounter!\<\mathit{\Theta}'\>\Arg{\theta}$ giving it
16583 % $\mathit{\Theta}'=\CC$ and $\theta=\cg$. This macro, also invoked from
16584 % $\!\localcounter!\Arg\cl$ with $\mathit{\Theta}'=\CG$ and $\theta=\cl$,
16585 % does $\mathit{\Theta}''\gets\mathit{\Theta}'$,
16586 % $\mathit{\Theta}'=\emptyset$, and then apply
16587 % $\!\pcol@iremctrelt!\arg{\mathit{\Theta}'}$ to each
16588 % $\theta'\in\mathit{\Theta}''$ to let
16589 % $\mathit{\Theta}'\gets\mathit{\Theta}'\cup\{\theta'\}$ by \!\@cons! if
16590 % $\theta'\neq\theta$.
16591 % 
16592 % \begin{macrocode}
16593 \def\pcol@remctrelt#1{%
16594 \expandafter\let\expandafter\reserved@a\csname cl@#1\endcsname
16595 \expandafter\let\csname pcol@cl@#1\endcsname\reserved@a
16596 \expandafter\ifx\csname c@#1\endcsname\c@page\else
16597 \@namedef{cl@#1}{\pcol@stepcounter{#1}}%
16598 \fi
16599 \pcol@removecounter\pcol@counters{#1}}
16600 \def\pcol@removecounter#1#2{%
16601 \def\reserved@a{#2}\let\reserved@b#1\relax \global\let#1\@empty
16602 {\def\@elt{\pcol@iremctrelt#1}\reserved@b}}
16603 \def\pcol@iremctrelt#1#2{%
16604 \def\reserved@b{#2}%
16605 \ifx\reserved@a\reserved@b\else \@cons#1{{#2}}\fi}
16606
16607 % \end{macrocode}
16608 % \end{macro}\end{macro}\end{macro}
16609 %
16610 % \begin{macro}{\definethecounter}
16611 % The API macro $\!\definethecounter!\<\cl\>\<c\>\arg{rep}$ define the
16612 % \lrep{} $\arg{rep}$ for a \lcounter{} $\cl$ in a column $c$. It
16613 % \!\def!ines $|\pcol@thectr@|{\cdot}\cl{\cdot}c$
16614 % 
16615 % \SpecialArrayMainIndex{\theta{\cdot}c}{\pcol@thectr@}
16616 % 
16617 % to have $\arg{rep}$ in its body.
16618 % 
16619 % \begin{macrocode}
16620 \def\definethecounter#1#2#3{\@namedef{pcol@thectr@#1#2}{#3}}
16621 % \end{macrocode}
16622 % \end{macro}
16623 % 
16624 % \begin{macro}{\pcol@thectrelt}
16625 % The macro $\!\pcol@thectrelt!\<\cl\>$ is invoked solely in \!\pcol@zparacol!
16626 % and is applied to each $\cl\in\CTL$ to define its \lrep{} of
16627 % default and that of the leftmost column 0. To give unique representations
16628 % |\theH|${\cdot}\cl$ used by \textsf{hyperref}, it prepends the current column
16629 % number as \Midx{\!\pcol@thecurrcol!} to them. The macro performs a lengthy
16630 % sequence with many occurrences of \!\expandafter!, \!\csname! and
16631 % \!\endcsname! but the sequence is equivalent to the following.
16632 % 
16633 % \begin{quote}
16634 % $\!\let!|\pcol@thectr@|{\cdot}\cl|=\the|{\cdot}\cl$\\
16635 % $\CSIndex{ifx}|\pcol@thectr@|{\cdot}\cl{\cdot}0\!\relax!|\else |
16636 % \!\let!|\the|{\cdot}\cl|=\pcol@thectr@|{\cdot}\cl{\cdot}0| \fi|$
16637 % $\!\let!|\theH|{\cdot}\cl|=\pcol@thecurrcol\the|{\cdot}\cl$\\
16638 % \end{quote}
16639 % 
16640 % \SpecialArrayMainIndex{\theta}{\pcol@thectr@}
16641 % \SpecialArrayIndex{\theta{\cdot}c}{\pcol@thectr@}
16642 % \SpecialArrayMainIndex{\theta}{\the}
16643 % \SpecialArrayMainIndex{\theta}{\theH}
16644 % 
16645 % \begin{macrocode}
16646 \def\pcol@thectrelt#1{%
16647 \expandafter\let\expandafter\reserved@a\csname the#1\endcsname
16648 \expandafter\let\csname pcol@thectr@#1\endcsname\reserved@a
16649 \expandafter\let\expandafter\reserved@a\csname pcol@thectr@#10\endcsname
16650 \ifx\reserved@a\relax\else
16651 \expandafter\let\csname the#1\endcsname\reserved@a
16652 \fi
16653 \@ifundefined{theH#1}{}{%
16654 \expandafter\def\csname theH#1\expandafter\expandafter\expandafter\endcsname
16655 \expandafter\expandafter\expandafter{%
16656 \expandafter\expandafter\expandafter\pcol@thecurrcol\csname theH#1\endcsname
16657 }%
16658 }%
16659 }
16660 \def\pcol@thecurrcol{column\number\pcol@currcol.}
16661
16662 % \end{macrocode}
16663 % \end{macro}
16664 %
16665 % \KeepSpace{1}
16666 % \begin{macro}{\pcol@loadctrelt}
16667 % \changes{v1.0}{2011/10/10}
16668 % {Introduced for inter-environment local counter conservation.}
16669 % \begin{macro}{\pcol@storecounters}
16670 % \changes{v1.0}{2011/10/10}
16671 % {Introduced for inter-environment local counter conservation.}
16672 % \begin{macro}{\pcol@storectrelt}
16673 % \changes{v1.0}{2011/10/10}
16674 % {Introduced for inter-environment local counter conservation.}
16675 % 
16676 % The macro $\!\pcol@loadctrelt!\<\cl\>\<\val_c(\cl)\>$ is invoked from
16677 % \!\pcol@zparacol! and \!\pcol@synccounter! and is applied to each element
16678 % $\<\cl,\val_c(\cl)\>\in\Cc_c$ for a column $c$ to define a macro
16679 % $|\pcol@ctr@|{\cdot}\cl=v(\cl)$
16680 % 
16681 % \SpecialArrayMainIndex{\theta}{\pcol@ctr@}
16682 % 
16683 % having $\val_c(\cl)$ in its body for a temporary use. This macro or its
16684 % redefined version is then referred to by $\!\pcol@cmpctrelt!\<\cl\>$ or
16685 % $\!\pcol@storectrelt!\<\cl\>$. The latter is invoked from
16686 % \!\pcol@storecounters! via \!\pcol@sscounters! to add $\<\cl,v(\cl)\>$ to
16687 % \!\@gtempa! by \!\@cons! to rebuild $\CC_c$ for a column $c$ in
16688 % \!\@gtempa!.
16689 %
16690 % The macro \!\pcol@storecounters! is invoked solely from
16691 % $\!\pcol@synccounter!\<\theta\>$ to update a \lcounter{} $\theta$ with
16692 % $\Val(\theta)$ for \csync. That is, \!\pcol@storecounters! is used to add
16693 % $\<\cl,v(\cl)\>$ to \!\@gtempa! for all $\cl\in\CTL$ by \!\pcol@sscounters!
16694 % giving it \!\pcol@storectrelt! as its argument, where $v(\cl)$ is modified
16695 % if $\cl=\theta$ or unmodified otherwise after it is defined by
16696 % \!\pcol@loadctrelt!.
16697 % 
16698 % \begin{macrocode}
16699 \def\pcol@loadctrelt#1#2{\@namedef{pcol@ctr@#1}{#2}}
16700 \def\pcol@storecounters{\pcol@sscounters\pcol@storectrelt}
16701 \def\pcol@storectrelt#1{\@cons\@gtempa{{#1}{\@nameuse{pcol@ctr@#1}}}}
16702 % \end{macrocode}
16703 % \end{macro}\end{macro}\end{macro}
16704 % 
16705 % \begin{macro}{\pcol@savecounters}
16706 % \changes{v1.0}{2011/10/10}
16707 % {Move the body to \cs{pcol@sscounters}.}
16708 % 
16709 % \begin{macro}{\pcol@savectrelt}
16710 % The macro \!\pcol@savecounters! is invoked from
16711 % \!\pcol@com@syncallcounters!, \!\pcol@stepcounter! and \!\pcol@switchcol!
16712 % to let $\CC_c$ for a column $c$ have the list of $\<\cl,\val_c(\cl)\>$
16713 % where $\val_c(\cl)$ is the value of $|\c@|{\cdot}\cl$ to be saved in
16714 % the list.
16715 % 
16716 % \SpecialArrayIndex{\theta}{\c@}
16717 % 
16718 % It does this operation invoking \!\pcol@sscounters! giving it
16719 % \!\pcol@savectrelt! as its argument.
16720 %
16721 % The macro $\!\pcol@savectrelt!\<\cl\>$ adds $\<\cl,\val_c(\cl)\>$ to
16722 % \!\@gtempa! by \!\@cons! to rebuild $\CC_c$ for a column $c$ in
16723 % \!\@gtempa!.
16724 % 
16725 % \begin{macrocode}
16726 \def\pcol@savecounters{\pcol@sscounters\pcol@savectrelt}
16727 \def\pcol@savectrelt#1{\@cons\@gtempa{{#1}{\number\csname c@#1\endcsname}}}
16728 % \end{macrocode}
16729 % \end{macro}\end{macro}
16730 % 
16731 % \begin{macro}{\pcol@sscounters}
16732 % \changes{v1.0}{2011/10/10}
16733 % {Introduced to implement the common operations of
16734 % \cs{pcol@storecounters} and \cs{pcol@savecounters}.}
16735 % 
16736 % The macro $\!\pcol@sscounters!\arg{elt}$ is invoked from
16737 % \!\pcol@storecounters! with $\arg{elt}=\!\pcol@storectrelt!$ or
16738 % \!\pcol@savecounters! with $\arg{elt}=\!\pcol@savectrelt!$ to build
16739 % $\CC_c=|\pcol@counters|{\cdot}c$ for a column $c$.
16740 % 
16741 % \SpecialArrayMainIndex{c}{\pcol@counters}
16742 % 
16743 % To do that, it lets $\!\@gtempa!=()$ and then apply $\arg{elt}$ to all
16744 % $\cl\in\CTL=\!\pcol@counters!$ to have updated $\CC_c$ in \!\@gtempa!.
16745 % Then finally, \!\@gtempa! is moved into $\CC_c$ by \!\xdef!\footnote{
16746 % 
16747 % It can be done by \cs{global}\cs{let} more efficiently but it is lengthy
16748 % due to two \cs{expandafter}.}.
16749 % 
16750 % \begin{macrocode}
16751 \def\pcol@sscounters#1{\begingroup
16752 \global\let\@gtempa\@empty
16753 \let\@elt#1\relax \pcol@counters
16754 \let\@elt\relax
16755 \expandafter\xdef\csname pcol@counters\number\pcol@currcol\endcsname{%
16756 \@gtempa}%
16757 \endgroup}
16758
16759 % \end{macrocode}
16760 % \end{macro}
16761 %
16762 % \begin{macro}{\pcol@cmpctrelt}
16763 % \changes{v1.0}{2011/10/10}
16764 % {Introduced for inter-environment local counter conservation.}
16765 % 
16766 % The macro $\!\pcol@cmpctrelt!\<\theta\>$ is invoked solely from
16767 % \!\pcol@zparacol! and is applied to each $\theta\in\CC$ to examine if
16768 % $\val_0(\theta)=\Val(\theta)$ where $\val_0(\theta)$ is in
16769 % $|\pcol@ctr@|{\cdot}\theta$.
16770 % 
16771 % \SpecialArrayIndex{\theta}{\pcol@ctr@}
16772 % 
16773 % If the examination fails including due to that $|\pcol@ctr@|{\cdot}\theta$
16774 % 
16775 % \SpecialArrayIndex{\theta}{\pcol@ctr@}
16776 % 
16777 % is undefined, we add $\theta$ to the list \!\@gtempa! by \!\@cons!.
16778 % 
16779 % \begin{macrocode}
16780 \def\pcol@cmpctrelt#1{\@tempswafalse \@tempcnta\@nameuse{c@#1}%
16781 \expandafter\ifx\csname pcol@ctr@#1\endcsname\relax \@tempswatrue
16782 \else\ifnum\@nameuse{pcol@ctr@#1}=\@tempcnta\else \@tempswatrue
16783 \fi\fi
16784 \if@tempswa \@cons\@gtempa{{#1}}\fi}
16785
16786 % \end{macrocode}
16787 % \end{macro}
16788 %
16789 % \begin{macro}{\synccounter}
16790 % \changes{v1.0}{2011/10/10}
16791 % {Introduced as an environment-local API command.}
16792 % \begin{macro}{\pcol@com@synccounter}
16793 % \changes{v1.0}{2011/10/10}
16794 % {Introduced for the implementation of the new API command
16795 % \cs{synccounter}.}
16796 % 
16797 % The macro $\!\pcol@com@synccounter!\<\theta\>$, being the implementation
16798 % of the \elocal{} API macro \!\synccounter!, lets
16799 % $\val_c(\theta)=\Val(\theta)$ for all $c\In0\C$. That is, the value of
16800 % the counter $\theta$ is {\em broadcasted} to all columns for the
16801 % {\em\Uidx\csync} of $\theta$. This broadcast is done by
16802 % \!\pcol@synccounter! with an argument $\!\@elt!|{|\theta|}|$ so that it
16803 % works only on $\theta$.
16804 % 
16805 % \begin{macrocode}
16806 \def\pcol@com@synccounter#1{\pcol@synccounter{\@elt{#1}}}
16807 % \end{macrocode}
16808 % \end{macro}\end{macro}
16809 % 
16810 % \begin{macro}{\pcol@synccounter}
16811 % \changes{v1.0}{2011/10/10}
16812 % {Introduced for \cs{synccounter} and inter-environment local counter
16813 % conservation.}
16814 % \begin{macro}{\pcol@syncctrelt}
16815 % \changes{v1.0}{2011/10/10}
16816 % {Introduced for \cs{synccounter} and inter-environment local counter
16817 % conservation.}
16818 % 
16819 % The macro $\!\pcol@synccounter!\arg{lst}$ is invoked from
16820 % \!\pcol@zparacol! with $\arg{lst}=\!\@gtempa!$ and from
16821 % $\!\pcol@com@synccounter!\arg{ctr}$ with $\arg{lst}=\!\@elt!\Arg{ctr}$, to
16822 % let $\val_c(\theta)=\Val(\theta)$ for all $c\In0\C$ and all $\theta$ in
16823 % $\arg{lst}$. To do that, at first we move $\arg{lst}$ into \!\reserved@a!
16824 % in order to make \!\@gtempa! free so that it can be used in
16825 % \!\pcol@storecounters!. Next, for each $c\In0\C$, we let
16826 % $v(\cl)=\val_c(\cl)$ by applying \!\pcol@loadctrelt! to all
16827 % $\<\cl,\val_c(\cl)\>\in\Cc_c$, then scan $\arg{lst}$ applying
16828 % $\!\pcol@syncctrelt!\<\theta\>$ for each $\theta$ in $\arg{lst}$ to let
16829 % $v(\theta)=\Val(\theta)$, and finally store all $v(\cl)$ back to $\Cc_c$
16830 % by \!\pcol@storecounters!, where $v(\theta)$ is
16831 % $|\pcol@ctr@|{\cdot}\theta$.
16832 % 
16833 % \SpecialArrayIndex{\theta}{\pcol@ctr@}
16834 % 
16835 % \begin{macrocode}
16836 \def\pcol@synccounter#1{{%
16837 \let\@elt\relax \edef\reserved@a{#1}%
16838 \pcol@currcol\z@ \@whilenum\pcol@currcol<\pcol@ncol\do{%
16839 \let\@elt\pcol@loadctrelt \@nameuse{pcol@counters\number\pcol@currcol}%
16840 \let\@elt\pcol@syncctrelt \reserved@a
16841 \pcol@storecounters
16842 \advance\pcol@currcol\@ne}}}
16843 \def\pcol@syncctrelt#1{%
16844 \expandafter\edef\csname pcol@ctr@#1\endcsname{\number\@nameuse{c@#1}}}
16845
16846 % \end{macrocode}
16847 % \end{macro}\end{macro}
16848 %
16849 % \begin{macro}{\syncallcounters}
16850 % \changes{v1.0}{2011/10/10}
16851 % {Introduced as an environment-local API command.}
16852 % \begin{macro}{\pcol@com@syncallcounters}
16853 % \changes{v1.0}{2011/10/10}
16854 % {Introduced for the implementation of the new API command
16855 % \cs{syncallcounters}.}
16856 % 
16857 % The macro \!\pcol@com@syncallcounters!, being the implementation of the
16858 % \elocal{} API macro \!\syncallcounters!, makes all \lcounter{}s in all
16859 % columns have the value in the current column. That is, for each
16860 % $c\In0\C$, we invoke \!\pcol@savecounters! to let $\val_c(\cl)={\Val}(\cl)$
16861 % for all $\cl\in\CTL$.
16862 % 
16863 % \begin{macrocode}
16864 \def\pcol@com@syncallcounters{{%
16865 \pcol@currcol\z@ \@whilenum\pcol@currcol<\pcol@ncol\do{%
16866 \pcol@savecounters \advance\pcol@currcol\@ne}}}
16867
16868 % \end{macrocode}
16869 % \end{macro}\end{macro}
16870 %
16871 % \begin{macro}{\pcol@setctrelt}
16872 % \changes{v1.0}{2011/10/10}
16873 % {Replace \cs{setcounter} with direct assignment with \cs{csname} and
16874 % \cs{endcsname}}
16875 % 
16876 % The macro $\!\pcol@setctrelt!\<\cl\>\<\val_c(\cl)\>$ is solely invoked
16877 % from \!\pcol@switchcol! to switch to a column $c$ and is applied to each
16878 % $\<\cl,\val_c(\cl)\>\in\Cc_c$ to let $\Val(\cl)=\val_c(\cl)$ \!\global!ly.
16879 % It also define the \lrep{} of $\cl$, being $|\the|{\cdot}\cl$,
16880 % 
16881 % \SpecialArrayIndex{\theta}{\the}
16882 % 
16883 % to be $|\pcol@thectr@|{\cdot}\cl{\cdot}c$
16884 % 
16885 % \SpecialArrayIndex{\theta{\cdot}c}{\pcol@thectr@}
16886 % 
16887 % if it is defined, or otherwise to be $|\pcol@thectr@|{\cdot}\cl$ which keeps
16888 % the original $|\the|{\cdot}\cl$.
16889 % 
16890 % \SpecialArrayIndex{\theta}{\the}
16891 % 
16892 % This \lrep{} definition is done by a lengthy sequence with many occurrences
16893 % of \!\expandafter!, \!\csname! and \!\endcsname!, but it is equivalent to
16894 % the followings.
16895 % 
16896 % \begin{quote}
16897 % $\CSIndex{ifx}|\pcol@thectr@|{\cdot}\cl{\cdot}c\!\relax!| |
16898 % \!\let!|\the|{\cdot}\cl|=\pcol@thectr@|{\cdot}\cl$\\
16899 % $|\else |\!\let!|\the|{\cdot}\cl|=\pcol@thectr@|{\cdot}\cl{\cdot}c$\\
16900 % |\fi|
16901 % \end{quote}
16902 % % 
16903 % \begin{macrocode}
16904 \def\pcol@setctrelt#1#2{%
16905 \global\csname c@#1\endcsname#2\relax
16906 \expandafter\ifx\csname pcol@thectr@#1\number\pcol@currcol\endcsname\relax
16907 \expandafter\let\expandafter\reserved@a\csname pcol@thectr@#1\endcsname
16908 \else
16909 \expandafter\let\expandafter\reserved@a
16910 \csname pcol@thectr@#1\number\pcol@currcol\endcsname
16911 \fi
16912 \expandafter\let\csname the#1\endcsname\reserved@a}
16913
16914 % \end{macrocode}
16915 % \end{macro}
16916 %
16917 % \KeepSpace{1}
16918 % \begin{macro}{\pcol@stepcounter}
16919 % \changes{v1.0}{2011/10/10}
16920 % {Change the order of operations.}
16921 % \changes{v1.0}{2011/10/10}
16922 % {Replace \cs{csname}/\cs{endcsname} with \cs{@nameuse}.}
16923 % \begin{macro}{\pcol@stpldelt}
16924 % \begin{macro}{\pcol@stpclelt}
16925 % 
16926 % The macro $\!\pcol@stepcounter!\<\cg\>$ is invoked from
16927 % $\!\stepcounter!\<\cg\>$ for a \gcounter{} $\cg$ because
16928 % $|\cl@|{\cdot}\cg$
16929 % 
16930 % \SpecialArrayIndex{\theta}{\cl@}
16931 % 
16932 % is modified by \!\pcol@remctrelt! so as to invoke this macro to zero-clear
16933 % \lcounter{}s $\theta\in\clist(\cg)$. To do that, we do the followings in
16934 % a group for each $c\In0\C$. First we apply
16935 % $\!\pcol@stpldelt!\<\cl\>\<\val_c(\cl)\>$ to each
16936 % $\<\cl,\val_c(\cl)\>\in\Cc_c$ to let $\Val(\cl)=\val_c(\cl)$ locally.
16937 % Then we apply $\!\pcol@stpclelt!\<\theta\>$ to each $\theta\in\clist(\cg)$
16938 % to let $\Val(\theta)=0$. Finally, we invoke \!\pcol@savecounters! to let
16939 % $\val_c(\cl)=\Val(\cl)$ for all $\cl\in\CTL$ to reflect the zero-clear of
16940 % $\theta\in\clist(\cg)$.
16941 %
16942 % After the operations above, we apply $\!\@stpelt!\<\theta\>$ to each
16943 % $\theta\in\clist(\cg)$ for \!\global! zero-clearing.
16944 % 
16945 % \begin{macrocode}
16946 \def\pcol@stepcounter#1{\begingroup
16947 \pcol@currcol\z@ \@whilenum\pcol@currcol<\pcol@ncol\do{%
16948 \let\@elt\pcol@stpldelt \@nameuse{pcol@counters\number\pcol@currcol}%
16949 \let\@elt\pcol@stpclelt \@nameuse{pcol@cl@#1}%
16950 \pcol@savecounters
16951 \advance\pcol@currcol\@ne}%
16952 \endgroup
16953 \let\@elt\@stpelt \@nameuse{pcol@cl@#1}}
16954 \def\pcol@stpldelt#1#2{\csname c@#1\endcsname#2\relax}
16955 \def\pcol@stpclelt#1{\csname c@#1\endcsname\z@}
16956
16957 % \end{macrocode}
16958 % \end{macro}\end{macro}\end{macro}
16959 %
16960 %
16961 %
16962 % \section{Column-Switching Commands and Environments}
16963 % \label{sec:imp-switch}
16964 %
16965 % \begin{macro}{\pcol@par}
16966 % \changes{v1.0}{2011/10/10}
16967 % {Introduced for \cs{par}-if-necessary operation.}
16968 % 
16969 % Before giving the definition of \cswitch{} commands and environments, we
16970 % define a commonly used macro \!\pcol@par!, which do \CSIndex{par} if
16971 % necessary, i.e., we are not in vertical mode. The reason why we don't
16972 % simply do \CSIndex{par} is that it may have some definition different from
16973 % \!\@@par! and thus an incautious repetition of \CSIndex{par} may cause
16974 % undesirable results. This macro is used in \!\pcol@com@switchcolumn!,
16975 % \!\pcol@sptext!, \!\pcol@com@endcolumn!, \!\pcol@flushclear!,
16976 % and \!\endparacol!.
16977 % 
16978 % \begin{macrocode}
16979 %% Column-Switching Commands and Environments
16980
16981 \def\pcol@par{\ifvmode\else \par \fi}
16982
16983 % \end{macrocode}
16984 % \end{macro}
16985 %
16986 % \KeepSpace{2}
16987 % \begin{macro}{\switchcolumn}
16988 % \changes{v1.0}{2011/10/10}
16989 % {Made \cs{let}-equal to \cs{pcol@com@switchcolumn} for localization.}
16990 % \begin{macro}{\pcol@com@switchcolumn}
16991 % \changes{v1.0}{2011/10/10}
16992 % {Introduced as the implementation of \cs{switchcolumn}.}
16993 % \changes{v1.0}{2011/10/10}
16994 % {Add \cs{pcol@defcolumn} to clarify the behavior of \texttt{column}.}
16995 % \begin{macro}{\pcol@switchcolumn}
16996 % \changes{v1.0}{2011/10/10}
16997 % {Add the check of $d\geq0$.}
16998 % \changes{v1.31}{2013/10/10}
16999 % {Add a space before the number of columns in the error message.}
17000 % 
17001 % \begin{macro}{\pcol@iswitchcolumn}
17002 % The macro $\!\pcol@com@switchcolumn!|[|d|]|$, being the implementation of the
17003 % \elocal{} API macro \!\switchcolumn!, switches to the column $d$ if provided
17004 % through its optional argument, or to $d=(c+1)\bmod\C$ otherwise where $c$
17005 % is the ordinal of the current column. After making it sure to be in
17006 % vertical mode by \!\pcol@par!, it invokes \!\pcol@defcolumn! to give
17007 % \!\pcol@com@column!(|*|) their
17008 % \!\def!initions for occurrences not as the very first \cswitch{} command
17009 % or environment of the current \env{paracol} environment. Then, after
17010 % calculating $d=(c+1)\bmod\C$, this macro simply invokes
17011 % $\!\pcol@switchcol!|[|d|]|$ with or without the calculated $d$ depending
17012 % on the existence of the optional argument delimiter `|[|'.
17013 %
17014 % The macro $\!\pcol@switchcolumn!|[|d|]|$ lets $\!\pcol@nextcol!=d$ and
17015 % confirms $0\leq d<\C$ or abort the execution by \!\PackageError! if it
17016 % does not hold. Then it invokes \!\pcol@iswitchcolumn! if
17017 % $\!\switchcolumn!|[|d|]|$ is followed by a `|*|', or \!\pcol@switchcol!
17018 % otherwise.
17019 %
17020 % The macro $\!\pcol@iswitchcolumn!|[|\arg{text}|]|$ invokes
17021 % $\!\pcol@sptext!|[|\arg{text}|]|$ if the optional argument is provided, or
17022 % \!\pcol@switchcol! otherwise, after letting $\CSIndex{ifpcol@sync}=\true$
17023 % for \exsync{}.
17024 % 
17025 % \begin{macrocode}
17026 \def\pcol@com@switchcolumn{\pcol@par
17027 \pcol@defcolumn
17028 \@tempcnta\pcol@currcol \advance\@tempcnta\@ne
17029 \ifnum\@tempcnta<\pcol@ncol\else \@tempcnta\z@ \fi
17030 \@ifnextchar[%]
17031 \pcol@switchcolumn{\pcol@switchcolumn[\@tempcnta]}}
17032 \def\pcol@switchcolumn[#1]{%
17033 \pcol@nextcol#1\relax
17034 \@tempswafalse
17035 \ifnum#1<\z@ \@tempswatrue \fi
17036 \ifnum#1<\pcol@ncol\else \@tempswatrue \fi
17037 \if@tempswa
17038 \PackageError{paracol}{%
17039 Column number \number#1 must be less than \number\pcol@ncol}\@eha
17040 \pcol@nextcol\z@
17041 \fi
17042 \@ifstar\pcol@iswitchcolumn\pcol@switchcol}
17043 \def\pcol@iswitchcolumn{%
17044 \global\pcol@synctrue
17045 \@ifnextchar[%]
17046 \pcol@sptext\pcol@switchcol}
17047
17048 % \end{macrocode}
17049 % \end{macro}\end{macro}\end{macro}\end{macro}
17050 %
17051 % \begin{macro}{\pcol@sptext}
17052 % \changes{v1.0}{2011/10/10}
17053 % {Made \cs{long} to allow \cs{par} in its argument.}
17054 % \changes{v1.0}{2011/10/10}
17055 % {Replace \cs{par} with \cs{pcol@par}.}
17056 % \changes{v1.0}{2011/10/10}
17057 % {Add $\cs{ifpcol@mctext}\EQ\mathit{true}$ for restriction of the
17058 % broadcast of \cs{if@nobreak} and \cs{everypar}.}
17059 % \changes{v1.2-4}{2013/05/11}
17060 % {Add \cs{pcol@swapcolumn} for column-swapping.}
17061 % \changes{v1.2-5}{2013/05/11}
17062 % {Add setting of \cs{columnwidth}, \cs{linewidth} and \cs{parshape}
17063 % to have indented spanning text with surrounding
17064 % \string\texttt{list}-like environments.}
17065 % \changes{v1.3-1}{2013/09/17}
17066 % {Add $\cs{ifpcol@sptextstart}\EQ\string\mathit{true}$ before first
17067 % synchronized column-switching to let \cs{pcol@output@switch} save
17068 % pre-spanning-text stuff, move the timing of
17069 % $\cs{ifpcol@sptext}\EQ\string\mathit{true}$ from the end of
17070 % spanning text to the beginning so that \cs{output} routine for a
17071 % page break in the text capture the pre-break portion, and remove
17072 % the invocation of \cs{pcol@swapcolumn} because spanning texts are
17073 % now always put into the column-0.}
17074 % \changes{v1.3-6}{2013/09/17}
17075 % {Add globalization of \cs{@svsechd} and \cs{@svsec}.}
17076 % 
17077 % The macro $\!\pcol@sptext!|[|\arg{text}|]|$ is invoked from
17078 % \!\pcol@zparacol! and \!\pcol@iswitchcolumn! to put a \Uidx\mctext{}
17079 % $\arg{text}$ given as the optional argument of the former or that of
17080 % \!\switchcolumn!|*| and its relative environment openers for the latter.
17081 % The macro has \!\long! attribute because the \mctext{} may have
17082 % \CSIndex{par}. Since the text is put in the column-0 regardless of its
17083 % physical position, we let \!\pcol@nextcol! have 0 after saving the target
17084 % column $d=\!\pcol@nextcol!$ in \!\@tempcnta!. Then we switch to the
17085 % column by \!\pcol@switchcol!, after turning $\CSIndex{ifpcol@sync}=\true$
17086 % to set a \sync{}ation point above the text and
17087 % $\CSIndex{ifpcol@sptextstart}=\true$ to tell \!\pcol@output@switch! to
17088 % prepare the capture of \mctext{} saving the \prespan{}.
17089 %
17090 % Next, we let $\CSIndex{ifpcol@sptextstart}=\false$ and
17091 % $\CSIndex{ifpcol@sptext}=\true$ to indicate the main vertical list
17092 % contains only the \mctext{} and it is to be captured by \!\output!
17093 % routine. Then the $\arg{text}$ is put in a group in which we let
17094 % $\!\columnwidth!=\!\hsize!=\!\textwidth!$ and
17095 % $\!\linewidth!=\!\textwidth!-\lrm$ with \!\parshape! to indent lines by
17096 % \!\@totalleftmargin! if $\lrm>0$, to let \mctext{} span across all columns
17097 % reflecting the indentation in the \env{list}-like environments surrounding
17098 % \env{paracol} if any. We also let $\!\col@number!=1$ to ensure again that
17099 % \!\maketitle! produces a title without \!\twocolumn! if it is in the
17100 % \mctext.
17101 %
17102 % Then, after invoking \!\pcol@par! to ensure to be in vertical
17103 % mode, we \!\global!ize \!\@svsechd! and \!\@svsec! which may be defined in
17104 % a lower-level sectioning command such as \!\paragraph! in the \mctext{} so
17105 % that they are properly expanded in \!\everypar! inserted at the beginning
17106 % of the first paragraph of the column to which we switch shortly, even when
17107 % the sectioning command is used inappropriately in the \mctext.
17108 % We also \!\global!ize \!\everypar! by a sequence with three
17109 % \!\expandafter! so that \!\pcol@output@switch! for the \sync{}ed
17110 % \cswitch{} we make shortly broadcasts it to other columns. Finally after
17111 % closing the group, we let $\!\pcol@nextcol!=d$ and
17112 % $\CSIndex{pcol@sync}=\true$ to set another \sync{}ation point below the
17113 % \mctext{} and to make the captured text combined with \prespan, and then
17114 % invoke \!\pcol@switchcol! to switch the column $d$.
17115 % 
17116 % \begin{macrocode}
17117 \long\def\pcol@sptext[#1]{%
17118 \@tempcnta\pcol@nextcol
17119 \global\pcol@synctrue \pcol@nextcol\z@
17120 \global\pcol@sptextstarttrue
17121 \pcol@switchcol
17122 \global\pcol@sptextstartfalse \global\pcol@sptexttrue
17123 \begingroup
17124 \columnwidth\textwidth \hsize\columnwidth
17125 \linewidth\columnwidth \advance\linewidth-\pcol@lrmargin
17126 \ifdim\pcol@lrmargin>\z@ \parshape\@ne\@totalleftmargin\linewidth \fi
17127 \col@number\@ne #1\pcol@par
17128 \global\let\@svsechd\@svsechd \global\let\@svsec\@svsec
17129 \expandafter\global\expandafter\everypar\expandafter{\the\everypar}%
17130 \endgroup
17131 \pcol@nextcol\@tempcnta \global\pcol@synctrue \pcol@switchcol}
17132
17133 % \end{macrocode}
17134 % \end{macro}
17135 %
17136 % \begin{macro}{\pcol@switchcol}
17137 % \changes{v1.0}{2011/10/10}
17138 % {Add \cs{pcol@aconly} for disabling \cs{addcontentsline}.}
17139 % \changes{v1.2-2}{2013/05/11}
17140 % {Add column-scanning and page-overflow check for synchronized
17141 % column-switching.}
17142 % \changes{v1.2-4}{2013/05/11}
17143 % {Add \cs{pcol@swapcolumn} for column-swapping to turn
17144 % \cs{if@firstcolumn}.}
17145 % \changes{v1.3-4}{2013/09/17}
17146 % {Remove setting \cs{if@firstcolumn} and the invocation of
17147 % \cs{pcol@swapcolumn} for it because the position of marginal notes
17148 % are now controlled by \cs{pcol@addmarginpar}.}
17149 % \changes{v1.3-5}{2013/09/17}
17150 % {Add setting $V_E\EQ\cs{pcol@@ensurevspace}$ and reinitialization of
17151 % \cs{pcol@ensurevspace} for avoidance of post-synchronization
17152 % inconsistent page break.}
17153 % \changes{v1.35-5}{2018/12/31}
17154 % {Add the invocation of $\cs{pcol@colpream}\cdot c$.}
17155 % \changes{v1.36-1}{2024/10/21}
17156 % {Add check to not add zeroth preamble in \cs{endparacol}.}
17157 % 
17158 % The macro \!\pcol@switchcol! is invoked from \!\pcol@switchcolumn!,
17159 % \!\pcol@iswitchcolumn!, \!\pcol@sptext! and \!\endparacol! to switch the
17160 % column $d=\!\pcol@nextcol!$. First, we save \lcounter{}s in the current
17161 % column $c$ into $\Cc_c$ by \!\pcol@savecounters!.
17162 %
17163 % Next, if $\CSIndex{ifpcol@sync}=\true$, we do the followings. At first we
17164 % let $\VE={}$\!\pcol@@ensure~vspace! have the natural component of
17165 % \!\pcol@ensurevspace! which can have a glue specified by \!\ensurevspace!,
17166 % so that it is referred to by \!\pcol@sync! as the minimum space required
17167 % below the \sync{}ation point we are now setting. Second, we invoke
17168 % \!\pcol@visitallcols! temporarily turning $\CSIndex{ifpcol@sync}=\false$
17169 % for \cscan{}ning to visit all columns but current one to give \TeX's page
17170 % builder the chance to break \colpage{}s in the \tpage{} with \Scfnote{}s
17171 % which could have not been presented in the last visit of the columns.
17172 % Third, we make an \!\output! request with $\!\penalty!=\!\pcol@op@switch!$
17173 % to invoke \!\pcol@output@switch! by \!\pcol@invokeoutput! with
17174 % $\CSIndex{ifpcol@sync}=\true$ to make \sync{}ed switch to the column $d$.
17175 % This invocation may result in $\CSIndex{ifpcol@flush}=\true$ to mean the
17176 % \tpage{} should be broken before setting the \sync{}ation point.
17177 % Therefore if so, since \!\pcol@output@switch! switched to the tallest
17178 % column rather than $d$, we put \!\vfil! and \!\penalty!|-10000| to force
17179 % page break, make \cscan{} with \!\newpage! put into each column to have
17180 % some floats in the column in the new \tpage{}, and then invoke
17181 % \!\pcol@output@switch! again until it returns
17182 % $\CSIndex{ifpcol@flush}=\false$ telling us it successfully sets the
17183 % \sync{}ation point switching to the column $d$. Then as the last operation
17184 % specific to \sync{}ed \cswitch{}, we invoke \!\ensurevspace! with
17185 % \!\baselineskip! to give the default of $\VE$ for the next \sync{}ation.
17186 %
17187 % Otherwise, i.e., if $\CSIndex{ifpcol@sync}=\false$, we simply make the
17188 % \!\output! request for \!\pcol@output@switch! to switch to the column $d$.
17189 %
17190 % Then we scan $\Cc_d$ applying \!\pcol@setctrelt! to each
17191 % $\<\cl,\val_d(\cl)\>\in\Cc_d$ to let $\Val(\cl)={\val_d(\cl)}$. We also
17192 % scan $\T=\!\pcol@aconly!$ applying \!\pcol@aconlyelt! to each
17193 % $\<t_c,c\>\in T$ to inhibit \!\addcontentsline! to the contents file of
17194 % type $t_d$ as specified so by $\!\addcontentsonly!\arg{t_d}\~\arg{d}$.
17195 % After that, we let $\!\@elt!=\!\relax!$ to make it sure that any lists can
17196 % be manipulated without unexpected application of a macro to their
17197 % elements.
17198 %
17199 % Finally -- unless we process the implicit \!\pcol@switchol! from
17200 % \!\endparacol! -- we invoke $|\pcol@colpream|{\cdot}c$, where $c=-1$ if
17201 % $\CSIndex{ifpcol@sptextstart}=\true$ to mean the \cswitch{} is for a
17202 % \sptext{}, or $c=d$ otherwise.
17203 % 
17204 % \SpecialArrayIndex{c}{\pcol@colpream}
17205 % 
17206 % \begin{macrocode}
17207 \def\pcol@switchcol{%
17208 \pcol@savecounters
17209 \ifpcol@sync
17210 \@tempdima\pcol@ensurevspace\relax
17211 \edef\pcol@@ensurevspace{\number\@tempdima sp\relax}%
17212 \global\pcol@syncfalse \pcol@visitallcols\@@par \global\pcol@synctrue
17213 \pcol@invokeoutput\pcol@op@switch
17214 \@whilesw\ifpcol@flush\fi{%
17215 \vfil \penalty-\@M
17216 \global\pcol@syncfalse \pcol@visitallcols\newpage \global\pcol@synctrue
17217 \pcol@invokeoutput\pcol@op@switch}%
17218 \ensurevspace{\baselineskip}%
17219 \else
17220 \pcol@invokeoutput\pcol@op@switch
17221 \fi
17222 \let\@elt\pcol@setctrelt
17223 \csname pcol@counters\number\pcol@currcol\endcsname
17224 \let\@elt\pcol@aconlyelt \pcol@aconly \let\@elt\relax
17225 \@ifundefined{pcol@lastcol}{%
17226 \@nameuse{pcol@colpream\ifpcol@sptextstart-1\else\number\pcol@currcol\fi}
17227 }{}}
17228
17229 % \end{macrocode}
17230 % \end{macro}
17231 %
17232 % \begin{macro}{\pcol@visitallcols}
17233 % \changes{v1.2-2}{2013/05/11}
17234 % {Introduced for column-scanning in synchronized column-switching and
17235 % page flushing.}
17236 % 
17237 % The macro $\!\pcol@visitallcols!\arg{cs}$, invoked from \!\pcol@switchcol!
17238 % and \!\pcol@flushclear!, performs \cscan{}ning putting $\arg{cs}$ into the
17239 % visited columns. That is, we repeat the invocation of
17240 % \!\pcol@output@switch! to visit $d$ through \!\pcol@invokeoutput! with
17241 % $\!\penalty!=\!\pcol@op@switch!$ for all $d\In0\C-\{c\}$. In each visit,
17242 % we put $\arg{cs}\in\{\!\@@par!,\!\newpage!\}$ to have a chance of or to
17243 % force page break in each visited \colpage{}. Finally we go back to $c$ to
17244 % restore its \cctext{} especially when we are leaving the column 0 for
17245 % \mctext. That is, $\cc_c(\sw)$ and $\cc_c(\ep)$ should be presented to
17246 % \!\pcol@output@switch! to broadcast them to other columns.
17247 % 
17248 % \begin{macrocode}
17249 \def\pcol@visitallcols#1{\begingroup
17250 \@tempcnta\z@ \@tempcntb\pcol@currcol
17251 \@whilenum\@tempcnta<\pcol@ncol\do{%
17252 \ifnum\@tempcnta=\@tempcntb\else
17253 \pcol@nextcol\@tempcnta \pcol@invokeoutput\pcol@op@switch #1%
17254 \fi
17255 \advance\@tempcnta\@ne}%
17256 \pcol@nextcol\@tempcntb \pcol@invokeoutput\pcol@op@switch
17257 \endgroup}
17258
17259 % \end{macrocode}
17260 % \end{macro}
17261 %
17262 % \KeepSpace{3}
17263 % \begin{macro}{\column}
17264 % \changes{v1.0}{2011/10/10}
17265 % {Made \cs{let}-equal to \cs{pcol@com@column} for localization.}
17266 % \begin{macro}{\column*}
17267 % \changes{v1.0}{2011/10/10}
17268 % {Made \cs{let}-equal to \cs{pcol@com@column*} for localization.}
17269 % \begin{macro}{\pcol@com@column}
17270 % \changes{v1.0}{2011/10/10}
17271 % {Introduced as the implementation of \cs{column}.}
17272 % \begin{macro}{\pcol@com@column*}
17273 % \changes{v1.0}{2011/10/10}
17274 % {Introduced as the implementation of \cs{column*}.}
17275 % \begin{macro}{\pcol@defcolumn}
17276 % \changes{v1.0}{2011/10/10}
17277 % {Replace \cs{column} with \cs{pcol@com@column} and \cs{switchcolumn}
17278 % with \cs{pcol@switchenv}.}
17279 % 
17280 % The macros \!\pcol@com@column!(|*|), the implementations of the \elocal{}
17281 % API commands \!\column!(*), starts the environment |column(*)|.
17282 % 
17283 % \Midx{\EnvIndex{column}}\Midx{\EnvIndex{column*}}
17284 % 
17285 % Basically, the macros do \!\switch~column!\~(|*|), but if the environment
17286 % starts just after \beginparacol{} the macro have to switch to the column
17287 % 0. Therefore, the definitions for this very-beginning appearance are
17288 % given in \!\pcol@zparacol! to do (almost) nothing, and then those for
17289 % other ones are given by \!\pcol@defcolumn! invoked in
17290 % \!\pcol@com@switchcolumn! to invoke
17291 % \!\pcol@switchenv!|{column|(|*|)|}|(|*|) which then invokes
17292 % \!\switchcolumn!. Note that the definition of non-starred
17293 % \!\pcol@com@column! has \!\relax! after the invocation of
17294 % \!\pcol@switchenv! so that \!\@ifnextchar! and \!\@ifstar! to examine the
17295 % existence of `|[|' and `|*|' definitely tells us no even if the body of the
17296 % environment starts with a `|[|' or `|*|'.
17297 % 
17298 % \begin{macrocode}
17299 \def\pcol@defcolumn{%
17300 \gdef\pcol@com@column{\pcol@switchenv{column}\relax}%
17301 \global\@namedef{pcol@com@column*}{\pcol@switchenv{column*}*}}
17302
17303 % \end{macrocode}
17304 % \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
17305 %
17306 % \KeepSpace{10}
17307 % \begin{macro}{\nthcolumn}
17308 % \changes{v1.0}{2011/10/10}
17309 % {Made \cs{let}-equal to \cs{pcol@com@nthcolumn} for localization.}
17310 % \begin{macro}{\nthcolumn*}
17311 % \changes{v1.0}{2011/10/10}
17312 % {Made \cs{let}-equal to \cs{pcol@com@nthcolumn*} for localization.}
17313 % \begin{macro}{\pcol@com@nthcolumn}
17314 % \changes{v1.0}{2011/10/10}
17315 % {Introduced as the implementation of \cs{nthcolumn} with the
17316 % inhibition of column-switching in the environment.}
17317 % \begin{macro}{\pcol@com@nthcolumn*}
17318 % \changes{v1.0}{2011/10/10}
17319 % {Introduced as the implementation of \cs{nthcolumn*} with the
17320 % inhibition of column-switching in the environment.}
17321 % \begin{macro}{\leftcolumn}
17322 % \changes{v1.0}{2011/10/10}
17323 % {Made \cs{let}-equal to \cs{pcol@com@leftcolumn} for localization.}
17324 % \begin{macro}{\leftcolumn*}
17325 % \changes{v1.0}{2011/10/10}
17326 % {Made \cs{let}-equal to \cs{pcol@com@leftcolumn*} for localization.}
17327 % \begin{macro}{\pcol@com@leftcolumn}
17328 % \changes{v1.0}{2011/10/10}
17329 % {Introduced as the implementation of \cs{leftcolumn} with the
17330 % inhibition of column-switching in the environment.}
17331 % \begin{macro}{\pcol@com@leftcolumn*}
17332 % \changes{v1.0}{2011/10/10}
17333 % {Introduced as the implementation of \cs{leftcolumn*} with the
17334 % inhibition of column-switching in the environment.}
17335 % \begin{macro}{\rightcolumn}
17336 % \changes{v1.0}{2011/10/10}
17337 % {Made \cs{let}-equal to \cs{pcol@com@rightcolumn} for localization.}
17338 % \begin{macro}{\rightcolumn*}
17339 % \changes{v1.0}{2011/10/10}
17340 % {Made \cs{let}-equal to \cs{pcol@com@rightcolumn*} for localization.}
17341 % \begin{macro}{\pcol@com@rightcolumn}
17342 % \changes{v1.0}{2011/10/10}
17343 % {Introduced as the implementation of \cs{rightcolumn} with the
17344 % inhibition of column-switching in the environment.}
17345 % \begin{macro}{\pcol@com@rightcolumn*}
17346 % \changes{v1.0}{2011/10/10}
17347 % {Introduced as the implementation of \cs{rightcolumn*} with the
17348 % inhibition of column-switching in the environment.}
17349 % 
17350 % The macros $\!\pcol@com@nthcolumn!(|*|)\arg{d}$,
17351 % \!\pcol@com@leftcolumn!(|*|) and |\pcol@com@right|\~|column|(|*|) are the
17352 % implementations of \elocal{} API macros \!\nthcolumn!(|*|)$\arg{d}$,
17353 % \!\leftcolumn!(|*|) and \!\rightcolumn!(|*|) respectively. They start
17354 % corresponding environments |nthcolumn|(|*|), |leftcolumn|(|*|), and
17355 % |rightcolumn|(|*|)
17356 % 
17357 % \Midx{\EnvIndex{nthcolumn}}\Midx{\EnvIndex{nthcolumn*}}
17358 % \Midx{\EnvIndex{leftcolumn}}\Midx{\EnvIndex{leftcolumn*}}
17359 % \Midx{\EnvIndex{rightcolumn}}\Midx{\EnvIndex{rightcolumn*}}
17360 % 
17361 % simply invoking \!\pcol@switchenv!$\Arg{env}$\~(|*|), where $\arg{env}$ is
17362 % the name of each environment, giving it $d$, 0 and 1 respectively as its
17363 % optional argument for the target column.
17364 % 
17365 % \begin{macrocode}
17366 \def\pcol@com@nthcolumn#1{\pcol@switchenv{nthcolumn}[#1]\relax}
17367 \@namedef{pcol@com@nthcolumn*}#1{\pcol@switchenv{nthcolumn*}[#1]*}
17368 \def\pcol@com@leftcolumn{\pcol@switchenv{leftcolumn}[0]\relax}
17369 \@namedef{pcol@com@leftcolumn*}{\pcol@switchenv{leftcolumn*}[0]*}
17370 \def\pcol@com@rightcolumn{\pcol@switchenv{rightcolumn}[1]\relax}
17371 \@namedef{pcol@com@rightcolumn*}{\pcol@switchenv{rightcolumn*}[1]*}
17372
17373 % \end{macrocode}
17374 % \end{macro}\end{macro}\end{macro}\end{macro}
17375 % \end{macro}\end{macro}\end{macro}\end{macro}
17376 % \end{macro}\end{macro}\end{macro}\end{macro}
17377 %
17378 % \begin{macro}{\pcol@switchenv}
17379 % \changes{v1.0}{2011/10/10}
17380 % {Introduced to inhibit column-switching in the environment.}
17381 % \changes{v1.31}{2013/10/10}
17382 % {Fix the misspell ``switching'' in the error message.}
17383 % 
17384 % The macro $\!\pcol@switchenv!\arg{env}$ is invoked from
17385 % $|\pcol@com@|{\cdot}\arg{env}$ where $\arg{env}\in
17386 % \{\env{column}\~(|*|),\env{nthcolumn}(|*|),\env{leftcolumn}(|*|),
17387 % \env{rightcolumn}(|*|)\}$ to invoke \!\switchcolumn! with the arguments
17388 % following $\arg{env}$ given by the invoker macros. Before invoking
17389 % \!\switchcolumn!, we save it in \!\reserved@a! for the invocation and
17390 % re\!\def!ine it so that it will complain the illegal usage of \cswitch{}
17391 % commands\slash environments in the environment $\arg{env}$ by
17392 % \!\PackageError!.
17393 % 
17394 % \begin{macrocode}
17395 \def\pcol@switchenv#1{\let\reserved@a\switchcolumn
17396 \def\switchcolumn{\PackageError{paracol}{%
17397 Column switching commands and environments cannot be used in #1}\@eha}
17398 \reserved@a}
17399
17400 % \end{macrocode}
17401 % \end{macro}
17402 %
17403 % \KeepSpace{14}
17404 % \begin{macro}{\endcolumn}
17405 % \changes{v1.0}{2011/10/10}
17406 % {Made \cs{let}-equal to \cs{pcol@com@endcolumn} for localization.}
17407 % \begin{macro}{\endcolumn*}
17408 % \changes{v1.0}{2011/10/10}
17409 % {Made \cs{let}-equal to \cs{pcol@com@endcolumn*} for localization.}
17410 % \begin{macro}{\pcol@com@endcolumn}
17411 % \changes{v1.0}{2011/10/10}
17412 % {Introduced as the implementation of \cs{endcolumn} with the
17413 % globalization of \cs{everypar}.}
17414 % \begin{macro}{\pcol@com@endcolumn*}
17415 % \changes{v1.0}{2011/10/10}
17416 % {Introduced as the implementation of \cs{endcolumn*} with the
17417 % globalization of \cs{everypar}.}
17418 % \begin{macro}{\endnthcolumn}
17419 % \changes{v1.0}{2011/10/10}
17420 % {Made \cs{let}-equal to \cs{pcol@com@endnthcolumn} for localization.}
17421 % \begin{macro}{\endnthcolumn*}
17422 % \changes{v1.0}{2011/10/10}
17423 % {Made \cs{let}-equal to \cs{pcol@com@endnthcolumn*} for
17424 % localization.}
17425 % \begin{macro}{\pcol@com@endnthcolumn}
17426 % \changes{v1.0}{2011/10/10}
17427 % {Introduced as the implementation of \cs{endnthcolumn} with the
17428 % globalization of \cs{everypar}.}
17429 % \begin{macro}{\pcol@com@endnthcolumn*}
17430 % \changes{v1.0}{2011/10/10}
17431 % {Introduced as the implementation of \cs{endnthcolumn*} with the
17432 % globalization of \cs{everypar}.}
17433 % \begin{macro}{\endleftcolumn}
17434 % \changes{v1.0}{2011/10/10}
17435 % {Made \cs{let}-equal to \cs{pcol@com@endleftcolumn} for
17436 % localization.}
17437 % \begin{macro}{\endleftcolumn*}
17438 % \changes{v1.0}{2011/10/10}
17439 % {Made \cs{let}-equal to \cs{pcol@com@endleftcolumn*} for
17440 % localization.}
17441 % \begin{macro}{\pcol@com@endleftcolumn}
17442 % \changes{v1.0}{2011/10/10}
17443 % {Introduced as the implementation of \cs{endleftcolumn} with the
17444 % globalization of \cs{everypar}.}
17445 % \begin{macro}{\pcol@com@endleftcolumn*}
17446 % \changes{v1.0}{2011/10/10}
17447 % {Introduced as the implementation of \cs{endleftcolumn*} with the
17448 % globalization of \cs{everypar}.}
17449 % \begin{macro}{\endrightcolumn}
17450 % \changes{v1.0}{2011/10/10}
17451 % {Made \cs{let}-equal to \cs{pcol@com@endrightcolumn} for
17452 % localization.}
17453 % \begin{macro}{\endrightcolumn*}
17454 % \changes{v1.0}{2011/10/10}
17455 % {Made \cs{let}-equal to \cs{pcol@com@endrightcolumn*} for
17456 % localization.}
17457 % \begin{macro}{\pcol@com@endrightcolumn}
17458 % \changes{v1.0}{2011/10/10}
17459 % {Introduced as the implementation of \cs{endrightcolumn} with the
17460 % globalization of \cs{everypar}.}
17461 % \begin{macro}{\pcol@com@endrightcolumn*}
17462 % \changes{v1.0}{2011/10/10}
17463 % {Introduced as the implementation of \cs{endrightcolumn*} with the
17464 % globalization of \cs{everypar}.}
17465 % 
17466 % The macro \!\pcol@com@endcolumn! is the implementation of the \elocal{}
17467 % API macro \!\endcolumn! to close \env{column} environment. The macro
17468 % makes it sure we are in vertical mode by \!\pcol@par! and \!\global!ize
17469 % \!\everypar! so that it is saved in $\cc_c(\ep)$ of the current column
17470 % $c$ on the switch to another column. The macro also gives the common
17471 % definition of \!\pcol@com@endcolumn*! for \!\endcolumn*!,
17472 % \!\pcol@com@endnthcolumn!(|*|) for \!\endnthcolumn!(|*|),
17473 % \!\pcol@com@endleftcolumn!(|*|) for \!\endleftcolumn!(|*|), and
17474 % \!\pcol@com@endrightcolumn!(|*|) for \!\endrightcolumn!(|*|).
17475 % 
17476 % \begin{macrocode}
17477 \def\pcol@com@endcolumn{\pcol@par
17478 \expandafter\global\expandafter\everypar\expandafter{\the\everypar}}
17479 \expandafter\let\csname pcol@com@endcolumn*\endcsname\pcol@com@endcolumn
17480 \let\pcol@com@endnthcolumn\pcol@com@endcolumn
17481 \expandafter\let\csname pcol@com@endnthcolumn*\endcsname\pcol@com@endcolumn
17482 \let\pcol@com@endleftcolumn\pcol@com@endcolumn
17483 \expandafter\let\csname pcol@com@endleftcolumn*\endcsname\pcol@com@endcolumn
17484 \let\pcol@com@endrightcolumn\pcol@com@endcolumn
17485 \expandafter\let\csname pcol@com@endrightcolumn*\endcsname\pcol@com@endcolumn
17486
17487 % \end{macrocode}
17488 % \end{macro}\end{macro}\end{macro}\end{macro}
17489 % \end{macro}\end{macro}\end{macro}\end{macro}
17490 % \end{macro}\end{macro}\end{macro}\end{macro}
17491 % \end{macro}\end{macro}\end{macro}\end{macro}
17492 %
17493 % \begin{macro}{\definecolumnpreamble}
17494 % \changes{v1.35-5}{2018/12/31}
17495 % {Introduced to define a column preamble.}
17496 % 
17497 % The API macro \!\definecolumnpreamble!\marg{c}\marg{pream} is to define
17498 % the \colpream{} $\arg{pream}$ for the column $c$ or that for \sptext{}s if
17499 % $c=-1$. After assigning $c$ to \!\@tempcnta! to ensure $c$ is a number,
17500 % the macro $|\pcol@colpream|{\cdot}c$ is |\def|ined to have $\arg{pream}$.
17501 % 
17502 % \SpecialArrayMainIndex{c}{\pcol@colpream}
17503 % 
17504 % \begin{macrocode}
17505 \def\definecolumnpreamble#1#2{\@tempcnta#1\relax
17506 \expandafter\gdef\csname pcol@colpream\number\@tempcnta\endcsname{#2}}
17507
17508 % \end{macrocode}
17509 % \end{macro}
17510 %
17511 %
17512 % \begin{macro}{\ensurevspace}
17513 % \changes{v1.3-5}{2013/09/17}
17514 % {Introduced to declare the minimum space $V_E$ below a
17515 % synchronization point to let it stay in a page.}
17516 % \begin{macro}{\pcol@ensurevspace}
17517 % \changes{v1.3-5}{2013/09/17}
17518 % {Introduced to keep $V_E$ declared by \cs{ensurevspace}.}
17519 % \begin{macro}{\pcol@@ensurevspace}
17520 % \changes{v1.3-5}{2013/09/17}
17521 % {Introduced to pass $V_E$ declared by \cs{ensurevspace} to
17522 % \cs{output} routine.}
17523 % 
17524 % The API macro $\!\ensurevspace!\ARg{space}$ is to declare that the
17525 % \sync{}ation point following it must be thrown to the next page unless the
17526 % page has the vertical $\arg{space}$ below the \sync{}ation point. The
17527 % macro makes a dummy assignment of $\arg{space}$ to \!\@tempdima! to ensure
17528 % the argument is a dimension including forced one, or in other words to
17529 % raise an error if not in this macro rather than at the time $\arg{space}$
17530 % is {\em evaluated} in \!\pcol@switchcol!. Then $\arg{space}$ is kept in
17531 % \!\pcol@ensurevspace! so that $\arg{space}$ is evaluated in
17532 % \!\pcol@switchcol! for the \sync{}ation in question to pass the value to
17533 % \!\pcol@sync! through the macro $\!\pcol@@ensurevspace!=\Uidx\VE$,
17534 % especially when it has register references, for example to
17535 % \!\baselineskip!. To give the default of \!\pcol@ensurevspace!, we invoke
17536 % \!\ensurevspace! at the top level with \!\baselineskip!.
17537 % 
17538 % \begin{macrocode}
17539 \def\ensurevspace#1{{\@tempdima#1\relax \gdef\pcol@ensurevspace{#1}}}
17540 \ensurevspace{\baselineskip}
17541
17542 % \end{macrocode}
17543 % \end{macro}\end{macro}\end{macro}
17544 %
17545 %
17546 %
17547 % \section{Disabling \cs{addcontentsline}}
17548 % \label{sec:imp-aconly}
17549 %
17550 % \begin{macro}{\addcontentsonly}
17551 % \changes{v1.0}{2011/10/10}
17552 % {Introduced for disabling \cs{addcontentsline}.}
17553 % \begin{macro}{\pcol@aconly}
17554 % \changes{v1.0}{2011/10/10}
17555 % {Introduced for disabling \cs{addcontentsline}.}
17556 % 
17557 % The API macro $\!\addcontentsonly!\arg{t}\arg{c}$ makes the type $t$
17558 % contents file written by commands appearing only in the column $c$. The
17559 % macro simply add the pair $\<t,c\>$ to the list $\Uidx\T=\!\pcol@aconly!$
17560 % being empty at initial, after confirming we know the type $t$, one of
17561 % |toc|, |lof| and |lot| so far, by the fact $|\pcol@ac@def|{\cdot}t$ is
17562 % defined, or abort execution by \!\PackageError!.
17563 % 
17564 % \begin{macrocode}
17565 %% Disabling \addcontentsline
17566
17567 \def\addcontentsonly#1#2{%
17568 \@ifundefined{pcol@ac@def@#1}
17569 {\PackageError{paracol}{Unknown contents type #1}\@eha}\relax
17570 \@cons\pcol@aconly{{#1}{#2}}}
17571 \gdef\pcol@aconly{}
17572
17573 % \end{macrocode}
17574 % \end{macro}\end{macro}
17575 %
17576 % \begin{macro}{\pcol@aconlyelt}
17577 % \changes{v1.0}{2011/10/10}
17578 % {Introduced for disabling \cs{addcontentsline}.}
17579 % 
17580 % The macro $\!\pcol@aconlyelt!\arg{t_d}\arg{d}$ is invoked solely in
17581 % \!\pcol@switchcol! for the \cswitch{} to column $c$, and is applied to
17582 % each $\<t_d,d\>\in\T$ to enable \!\addcontentsline! for $t_d$ if $d=c$ by
17583 % the invocation of $|\pcol@ac@def@|{\cdot}t_d$
17584 % 
17585 % \SpecialArrayMainIndex{t}{\pcol@ac@def@}
17586 % 
17587 % with an argument |enable|, or to disable if $d\neq c$ with |disable|.
17588 % 
17589 % \begin{macrocode}
17590 \def\pcol@aconlyelt#1#2{%
17591 \ifnum#2=\pcol@currcol \@nameuse{pcol@ac@def@#1}{enable}%
17592 \else \@nameuse{pcol@ac@def@#1}{disable}%
17593 \fi}
17594 % \end{macrocode}
17595 % \end{macro}
17596 % 
17597 % \begin{macro}{\pcol@gobblethree}
17598 % \changes{v1.0}{2011/10/10}
17599 % {Introduced for disabling \cs{addcontentsline}.}
17600 % \begin{macro}{\pcol@addcontentsline}
17601 % \changes{v1.0}{2011/10/10}
17602 % {Introduced for disabling \cs{addcontentsline}.}
17603 % 
17604 % \hfuzz0.39pt
17605 % The macro $\!\pcol@gobblethree!\arg{file}\arg{sec}\arg{entry}$ is used in
17606 % \!\pcol@ac@disable@toc! and \!\pcol@ac@caption! to make
17607 % \!\addcontentsline! \!\let!-equal to this macro, which does nothing but
17608 % discarding three arguments, for disabling. The macro
17609 % \!\pcol@addcontentsline! is the \LaTeX's original \!\addcontentsline! and
17610 % is used in the macros mentioned above to let \!\addcontentsline! act as
17611 % original.
17612 % 
17613 % \begin{macrocode}
17614 \def\pcol@gobblethree#1#2#3{}
17615 \let\pcol@addcontentsline\addcontentsline
17616
17617 % \end{macrocode}
17618 % \end{macro}\end{macro}
17619 %
17620 % \KeepSpace{1}
17621 % \begin{macro}{\pcol@ac@def@toc}
17622 % \changes{v1.0}{2011/10/10}
17623 % {Introduced for disabling \cs{addcontentsline}.}
17624 % \begin{macro}{\pcol@ac@enable@toc}
17625 % \changes{v1.0}{2011/10/10}
17626 % {Introduced for disabling \cs{addcontentsline}.}
17627 % \begin{macro}{\pcol@ac@disable@toc}
17628 % \changes{v1.0}{2011/10/10}
17629 % {Introduced for disabling \cs{addcontentsline}.}
17630 % 
17631 % The macro $\!\pcol@ac@def@toc!\arg{eord}$ is invoked solely in
17632 % $\!\pcol@aconlyelt!|{toc}|\arg{c}$ to enable or disable
17633 % \!\addcontentsline! according to $\arg{eord}$ by making \!\@sect!
17634 % \!\let!-equal to \!\pcol@ac@enable@toc! which is the \LaTeX's original
17635 % \!\@sect!, or to \!\pcol@ac@disable@toc! respectively. The macro
17636 % $\!\pcol@ac@disable@toc!
17637 % \<a_1\>\<a_2\>\<a_3\>\<a_4\>\<a_5\>\<a_6\>|[|\<a_7\>|]|\<a_8\>$ at first
17638 % disables \!\addcontentsline! by making it \!\let!-equal to
17639 % \!\pcol@gobblethree!, then invokes the original \!\@sect! saved in
17640 % \!\pcol@ac@enable@toc! giving it all arguments $a_1$ to $a_8$, and
17641 % finally enables it by making it \!\let!-equal to \!\pcol@addcontentsline!.
17642 % Note that the argument $a_7$ is surrounded by |{| and |}| on the
17643 % invocation of \!\@sect! to conceal `|]|' in $a_7$.
17644 % 
17645 % \begin{macrocode}
17646 \def\pcol@ac@def@toc#1{%
17647 \expandafter\let\expandafter\@sect\csname pcol@ac@#1@toc\endcsname}
17648 \let\pcol@ac@enable@toc\@sect
17649 \def\pcol@ac@disable@toc#1#2#3#4#5#6[#7]#8{%
17650 \let\addcontentsline\pcol@gobblethree
17651 \pcol@ac@enable@toc{#1}{#2}{#3}{#4}{#5}{#6}[{#7}]{#8}%
17652 \let\addcontentsline\pcol@addcontentsline}
17653
17654 % \end{macrocode}
17655 % \end{macro}\end{macro}\end{macro}
17656 %
17657 % \KeepSpace{5}
17658 % \begin{macro}{\pcol@ac@def@lof}
17659 % \changes{v1.0}{2011/10/10}
17660 % {Introduced for disabling \cs{addcontentsline}.}
17661 % \begin{macro}{\pcol@ac@def@lot}
17662 % \changes{v1.0}{2011/10/10}
17663 % {Introduced for disabling \cs{addcontentsline}.}
17664 % \begin{macro}{\pcol@ac@caption@enable}
17665 % \changes{v1.0}{2011/10/10}
17666 % {Introduced for disabling \cs{addcontentsline}.}
17667 % \begin{macro}{\pcol@ac@caption@disable}
17668 % \changes{v1.0}{2011/10/10}
17669 % {Introduced for disabling \cs{addcontentsline}.}
17670 % \begin{macro}{\pcol@ac@caption@def}
17671 % \changes{v1.0}{2011/10/10}
17672 % {Introduced for disabling \cs{addcontentsline}.}
17673 % \begin{macro}{\pcol@ac@caption@if@lof}
17674 % \changes{v1.0}{2011/10/10}
17675 % {Introduced for disabling \cs{addcontentsline}.}
17676 % \begin{macro}{\pcol@ac@caption@if@lot}
17677 % \changes{v1.0}{2011/10/10}
17678 % {Introduced for disabling \cs{addcontentsline}.}
17679 % 
17680 % The macro $\!\pcol@ac@def@lof!\arg{eord}$ and
17681 % $\!\pcol@ac@def@lot!\arg{eord}$ are invoked solely in
17682 % $\!\pcol@aconlyelt!\<t\>\<c\>$ when $t$ is |lof| or |lot|
17683 % respectively. They invoke \!\pcol@ac@caption@enable!$\<t\>$ or
17684 % $\!\pcol@ac@caption@disable!\<t\>$ according to $\arg{eord}$, and then
17685 % these macros invoke $\!\pcol@ac@caption@def!\<s\>\<t\>$ where
17686 % $s=\!\@tempswatrue!$ or $s=\!\@tempswafalse!$ respectively to let
17687 % $\!\@caption!=\!\pcol@ac@caption!$ and $|\pcol@ac@caption@if@|{\cdot}t=s$
17688 % which are \!\let!-equal to \!\@tempswatrue! in default. That is,
17689 % $|\pcol@ac@catption@if@|{\cdot}t$ lets $\CSIndex{if@tempswa}={}\true$ iff
17690 % \!\addcontentsline! for $t$ is to be enable.
17691 % 
17692 % \begin{macrocode}
17693 \def\pcol@ac@def@lof#1{\@nameuse{pcol@ac@caption@#1}{lof}}
17694 \def\pcol@ac@def@lot#1{\@nameuse{pcol@ac@caption@#1}{lot}}
17695 \def\pcol@ac@caption@enable{\pcol@ac@caption@def\@tempswatrue}
17696 \def\pcol@ac@caption@disable{\pcol@ac@caption@def\@tempswafalse}
17697 \def\pcol@ac@caption@def#1#2{\let\@caption\pcol@ac@caption
17698 \expandafter\let\csname pcol@ac@caption@if@#2\endcsname#1}
17699 \let\pcol@ac@caption@if@lof\@tempswatrue
17700 \let\pcol@ac@caption@if@lot\@tempswatrue
17701 % \end{macrocode}
17702 % \end{macro}\end{macro}\end{macro}\end{macro}
17703 % \end{macro}\end{macro}\end{macro}
17704 % 
17705 % \begin{macro}{\pcol@ac@caption}
17706 % \changes{v1.0}{2011/10/10}
17707 % {Introduced for disabling \cs{addcontentsline}.}
17708 % \begin{macro}{\pcol@ac@caption@latex}
17709 % \changes{v1.0}{2011/10/10}
17710 % {Introduced for disabling \cs{addcontentsline}.}
17711 % 
17712 % The macro $\!\pcol@ac@caption!\arg{type}|[|\arg{lcap}|]|\<cap\>$ is made
17713 % \!\let!-equal to \!\@caption! by \!\pcol@ac@caption@def! to do what
17714 % \!\@caption! do but with enabling\slash disabling \!\addcontentsline!. At
17715 % first, it invokes $|\pcol@ac@cation@if@|{\cdot}t$ where
17716 % $t=|\ext@|{\cdot}\arg{type}$
17717 % 
17718 % \SpecialIndex{\ext@figure}\SpecialIndex{\ext@table}
17719 % 
17720 % to let \CSIndex{if@tempswa} be $\true$ or $\false$ according to the
17721 % enable\slash disable status of $t$. Then, after letting
17722 % $\!\addcontentsline!=\!\pcol@gobblethree!$ for disabling if $\false$, we
17723 % invoke \!\pcol@ac@caption@latex!, being the \LaTeX's original \!\@caption!,
17724 % giving all three arguments of \!\pcol@ac@caption! itself surrounding
17725 % $\arg{lcap}$ with |{| and |}| for the concealment of `|]|'. Finally, we
17726 % let $\!\addcontentsline!=\!\pcol@addcontentsline!$ so that other macros
17727 % uses it with its original definition.
17728 % 
17729 % \begin{macrocode}
17730 \long\def\pcol@ac@caption#1[#2]#3{%
17731 \@nameuse{pcol@ac@caption@if@\@nameuse{ext@#1}}%
17732 \if@tempswa\else \let\addcontentsline\pcol@gobblethree \fi
17733 \pcol@ac@caption@latex{#1}[{#2}]{#3}%
17734 \let\addcontentsline\pcol@addcontentsline}
17735 \let\pcol@ac@caption@latex\@caption
17736
17737 % \end{macrocode}
17738 % \end{macro}\end{macro}
17739 %
17740 %
17741 %
17742 % \KeepSpace{7}
17743 % \section{Page Flushing Commands}
17744 % \label{sec:imp-flush}
17745 %
17746 % \begin{macro}{\flushpage}
17747 % \changes{v1.0}{2011/10/10}
17748 % {Made \cs{let}-equal to \cs{pcol@com@flushpage} for
17749 % localization.}
17750 % \begin{macro}{\pcol@com@flushpage}
17751 % \changes{v1.0}{2011/10/10}
17752 % {Introduced as the implementation of \cs{flushpage} with the
17753 % replacement of \cs{par} with \cs{pcol@par}.}
17754 % \begin{macro}{\clearpage}
17755 % \changes{v1.0}{2011/10/10}
17756 % {Made \cs{let}-equal to \cs{pcol@com@clearpage} for
17757 % localization.}
17758 % \begin{macro}{\pcol@com@clearpage}
17759 % \changes{v1.0}{2011/10/10}
17760 % {Introduced as the implementation of \cs{clearpage} with the
17761 % replacement of \cs{par} with \cs{pcol@par}.}
17762 % \begin{macro}{\cleardoublepage}
17763 % \changes{v1.3-5}{2013/09/17}
17764 % {Added as a member of local commands and made \cs{let}-equal to
17765 % \cs{pcol@com@cleardoublepage}.}
17766 % \begin{macro}{\pcol@com@cleardoublepage}
17767 % \changes{v1.3-5}{2013/09/17}
17768 % {Introduced as the implementation of \cs{cleardoublepage}.}
17769 % 
17770 % The macros \!\pcol@com@flushpage!, \!\pcol@com@clearpage! and
17771 % \!\pcol@com@cleardoublepage! are the implementations of \elocal{} API
17772 % macro \!\flushpage!, \!\clearpage! and \!\cleardoublepage! respectively.
17773 % The first two have a common structure in which we at first invoke
17774 % \!\pcol@flushclear! for \cscan{} and \pfcheck, and then make an \!\output!
17775 % request by \!\pcol@invokeoutput! with \!\penalty! being \!\pcol@op@flush!
17776 % or \!\pcol@op@clear! according to the commands. On the other hand the
17777 % last one simply invokes \!\pcol@com@clearpage! unconditionally, and then
17778 % \!\pcol@com@flushpage!\footnote{
17779 % 
17780 % Unlike \LaTeX's \!\cleardoublepage!, it is unnecessary to put an empty
17781 % \!\hbox! before \!\flushpage! because it is active even at the top of a
17782 % page.}
17783 % 
17784 % if two-sided paging is enabled by $\CSIndex{if@twoside}=\true$, we are
17785 % in an even-numbered page, and $\CSIndex{ifpcol@paired}=\false$ to mean we
17786 % are not doing \npaired{} \parapag{}ing.
17787 % 
17788 % \begin{macrocode}
17789 %% Page Flushing Commands
17790
17791 \def\pcol@com@flushpage{\pcol@flushclear\voidb@x
17792 \pcol@invokeoutput\pcol@op@flush}
17793 \def\pcol@com@clearpage{\pcol@flushclear\voidb@x
17794 \pcol@invokeoutput\pcol@op@clear}
17795 \def\pcol@com@cleardoublepage{\pcol@com@clearpage
17796 \if@twoside \ifodd\c@page\else \ifpcol@paired\else \pcol@com@flushpage
17797 \fi\fi\fi}
17798 % \end{macrocode}
17799 % \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
17800 % 
17801 % \begin{macro}{\pcol@flushclear}
17802 % \changes{v1.2-2}{2013/05/11}
17803 % {Introduced for column-scanning in synchronized column-switching and
17804 % page flushing.}
17805 % 
17806 % The macro $\!\pcol@flushclear!\arg{box}$, invoked from
17807 % \!\pcol@com@flushpage!, \!\pcol@com@clear~page! and \!\endparacol!,
17808 % performs \cscan{} and \pfcheck{} prior to page flushing or environment
17809 % closing. After confirming we are in vertical mode by \!\pcol@par! and
17810 % letting $d=\!\pcol@nextcol!$ be $c=\!\pcol@currcol!$ to stay in $c$, we
17811 % invoke \!\pcol@visitallcols! for \cscan{} to give \TeX's page builder the
17812 % chance to break the \tpage{} prior to flushing it.
17813 %
17814 % Then we repeat \pfcheck{} invoking \!\pcol@output@switch! through
17815 % \!\pcol@invokeoutput! with $\!\penalty!=\!\pcol@op@switch!$ and
17816 % $\CSIndex{ifpcol@clear}=|\ifpcol@|\~|sync|=\true$
17817 % 
17818 % \SpecialIndex{\ifpcol@sync}
17819 % 
17820 % until the special \!\output! routine finishes with
17821 % $\CSIndex{ifpcol@flush}=\false$ and $\arg{box}=\bot$, where
17822 % $\arg{box}=\df=\!\pcol@topfnotes!$ if this macro is invoked from
17823 % \!\endparacol! with non-merged \Scfnote{} typesetting. In the repetition,
17824 % we put \!\vfil! and \!\penalty!|-10000| to force page break into the
17825 % tallest column, temporarily turning $\CSIndex{ifpcol@lastpage}=\false$
17826 % using \!\ifpcol@lastpagesave! because the broken page is not last one,
17827 % each time the \pfcheck{} tells us to do it. That is, we repeat the check
17828 % while we have too tall columns due to \Scfnote{}s or, when closing
17829 % \env{paracol} environment, deferred non-merged \Scfnote{}s.
17830 %
17831 % Finally we let $\CSIndex{ifpcol@clear}$ have its default setting, i.e.,
17832 % $\false$.
17833 % 
17834 % \begin{macrocode}
17835 \def\pcol@flushclear#1{\pcol@par
17836 \pcol@nextcol\pcol@currcol
17837 \pcol@visitallcols\@@par
17838 \pcol@cleartrue \global\pcol@synctrue
17839 \ifpcol@lastpage \pcol@lastpagesavetrue \else \pcol@lastpagesavefalse \fi
17840 \pcol@invokeoutput\pcol@op@switch \ifvoid#1\else \global\pcol@flushtrue \fi
17841 \@whilesw\ifpcol@flush\fi{%
17842 \pcol@lastpagefalse
17843 \vfil \penalty-\@M \pcol@cleartrue \global\pcol@synctrue
17844 \ifpcol@lastpagesave \pcol@lastpagetrue \fi
17845 \pcol@invokeoutput\pcol@op@switch
17846 \ifvoid#1\else \global\pcol@flushtrue \fi}%
17847 \pcol@clearfalse}
17848
17849 % \end{macrocode}
17850 % \end{macro}
17851 %
17852 %
17853 %
17854 %
17855 % \KeepSpace{8}
17856 % \section{Commands for Footnotes}
17857 % \label{sec:imp-fnote}
17858 % \changes{v1.2-2}{2013/05/11}
17859 % {Add the subsection ``Commands for Footnotes'' to describe newly
17860 % introduced macros for page-wise footnotes.}
17861 %
17862 % \begin{macro}{\footnoteplacement}
17863 % \changes{v1.36-2}{2024/10/22}
17864 % {Rename \cs{footnotelayout} to \cs{footnoteplacement} for compatibility
17865 % with \textsf{footmisc} package.}
17866 % \begin{macro}{\footnotelayout}
17867 % \changes{v1.3-5}{2013/09/17}
17868 % {Introduced for easier declaration of footnote layout.}
17869 % \begin{macro}{\pcol@fnlayout@c}
17870 % \changes{v1.3-5}{2013/09/17}
17871 % {Introduced for easier declaration of column-wise footnotes.}
17872 % \begin{macro}{\pcol@fnlayout@p}
17873 % \changes{v1.3-5}{2013/09/17}
17874 % {Introduced for easier declaration of page-wise footnotes.}
17875 % \begin{macro}{\pcol@fnlayout@m}
17876 % \changes{v1.3-5}{2013/09/17}
17877 % {Introduced for easier declaration of merged footnotes.}
17878 % \begin{macro}{\multicolumnfootnotes}
17879 % \changes{v1.2-2}{2013/05/11}
17880 % {Introduced to declare the default column-wise footnote
17881 % typesetting explicitly.}
17882 % \begin{macro}{\singlecolumnfootnotes}
17883 % \changes{v1.2-2}{2013/05/11}
17884 % {Introduced to declare the page-wise but non-merged footnote
17885 % typesetting.}
17886 % \begin{macro}{\mergedfootnotes}
17887 % \changes{v1.2-2}{2013/05/11}
17888 % {Introduced to declare the page-wise and merged footnote
17889 % typesetting.}
17890 % 
17891 % The API macro $\!\footnoteplacement!\Arg{l}$ is to determine that footnotes
17892 % are \mcfnote{} ($l=|c|$), \scfnote{} without merging ($l=|p|$), or
17893 % \mgfnote{} and \scfnote{} ($l=m$). The macro examines if
17894 % $l\in\{|c|,|p|,|m|\}$ by the existence of the corresponding macro
17895 % $|\pcol@fnlayout@|{\cdot}l$
17896 % 
17897 % \SpecialArrayIndex{l}{\pcol@fnlayout@}
17898 % 
17899 % and invokes it, or complains if not by \!\PackageError!.
17900 %
17901 % The macros \!\pcol@fnlayout@c!, \!\pcol@fnlayout@p! and
17902 % \!\pcol@fnlayout@m! turn switches $f_s=\CSIndex{ifpcol@scfnote}$,
17903 % $f_m=\CSIndex{ifpcol@mgfnote}$ and
17904 % $f_a=\CSIndex{ifpcol@fncounteradjustment}$ and make the counter
17905 % \counter{footnote} global or local as follows.
17906 % $$
17907 % \nosv\begin{array}{l|llll}
17908 % l&f_s&f_m&f_a&\counter{footnote}\\\hline
17909 % \verb|c|&\false&\false&\false&\hbox{local}\\
17910 % \verb|p|&\true&\false&\true&\hbox{global}\\
17911 % \verb|m|&\true&\true&\true&\hbox{global}
17912 % \end{array}
17913 % $$
17914 % Note that turning \CSIndex{ifpcol@fncounteradjustment} is done by
17915 % \!\fncounteradjustment! ($\true$) or \!\nofncounteradjustment! ($\false$).
17916 % Also note that the setting of |\ifpcol@fncounter|\~|adjustment|
17917 % 
17918 % \SpecialIndex{\ifpcol@fncounteradjustment}
17919 % 
17920 % and the globalization\slash localization of \counter{footnote} are just to
17921 % give defaults and thus can be overridden by API macros giving non-default
17922 % settings. Another remark is that backward-compatible macros
17923 % \!\multicolumnfootnotes!, \!\singlecolumnfootnotes! and
17924 % \!\mergedfootnotes! are \!\let!-equal to \!\pcol@fnlayout@c!,
17925 % \!\pcol@fnlayout@p! and \!\pcol@fnlayout@m! respectively. If the deprecated
17926 % \!\footnotelayout! is undefined \!\let! it equal to \!\footnoteplacement! and
17927 % add a hook to undefine it if \textsf{footmisc} gets loaded; print an
17928 % informational message in any case where our \!\footnotelayout! is
17929 % unavailable.
17930 % 
17931 % \begin{macrocode}
17932 %% Commands for Footnotes
17933
17934 \def\footnoteplacement#1{\@ifundefined{pcol@fnlayout@#1}%
17935 {\PackageError{paracol}{Unknown footnote layout specifier #1}}%
17936 {\@nameuse{pcol@fnlayout@#1}}}
17937 \def\pcol@fnlayout@c{\global\pcol@scfnotefalse \global\pcol@mgfnotefalse
17938 \localcounter{footnote}\nofncounteradjustment}
17939 \def\pcol@fnlayout@p{\global\pcol@scfnotetrue \global\pcol@mgfnotefalse
17940 \globalcounter{footnote}\fncounteradjustment}
17941 \def\pcol@fnlayout@m{\pcol@fnlayout@p\global\pcol@mgfnotetrue}
17942
17943 \let\multicolumnfootnotes\pcol@fnlayout@c
17944 \let\singlecolumnfootnotes\pcol@fnlayout@p
17945 \let\mergedfootnotes\pcol@fnlayout@m
17946 \@ifundefined{footnotelayout}{%
17947 \let\footnotelayout\footnoteplacement
17948 \AddToHook{package/footmisc/before}{\let\footnotelayout\relax}%
17949 }{}
17950 \AddToHook{package/footmisc/before}{\PackageNoteNoLine{paracol}{%
17951 With footmisc loaded, paracol's
17952 \string\footnotelayout\space will be unavailable. Please use the
17953 equivalent \string\footnoteplacement\space instead.\MessageBreak
17954 Also note, that paracol's and footmisc's footnote handling may crash%
17955 }}
17956
17957 % \end{macrocode}
17958 % \end{macro}\end{macro}\end{macro}\end{macro}
17959 % \end{macro}\end{macro}\end{macro}\end{macro}
17960 %
17961 % \KeepSpace{2}
17962 % \begin{macro}{\@footnotetext}
17963 % \begin{macro}{\pcol@fntext}
17964 % \changes{v1.2-2}{2013/05/11}
17965 % {Introduced for footnote encapsulation and deferring.}
17966 % \begin{macro}{\pcol@fntexttop}
17967 % \changes{v1.2-2}{2013/05/11}
17968 % {Introduced for footnote encapsulation.}
17969 % \begin{macro}{\pcol@fntextother}
17970 % \changes{v1.2-2}{2013/05/11}
17971 % {Introduced for footnote encapsulation and deferring.}
17972 % 
17973 % The macro \!\pcol@fntext!\marg{text} is our own version of \LaTeX's
17974 % \!\@footnotetext! used in \!\footnote! and \!\footnotetext! to \!\insert!
17975 % the footnote $\arg{text}$ through \!\footins!. Since the original and our
17976 % own are made \!\let!-equal by \!\pcol@zparacol!, our own is active
17977 % throughout the environment. The customization is done to examine if the
17978 % footnote should be deferred and to encapsulate the footnote in a \!\vbox!.
17979 %
17980 % The deferred footnote insertion is in effect if the footnote typesetting
17981 % is \scfnote{} and \!\footnote! or \!\footnotetext! appears in a page
17982 % $p<\ptop$. If so, we put the footnote $\arg{text}$ encapsulated in a
17983 % \!\vbox! by \!\pcol@fntextbody! to the tail of $\df=\!\pcol@topfnotes!$
17984 % with \!\penalty!\!\interlinepenalty! preceding it for the split in
17985 % \!\pcol@deferredfootins!, using \!\pcol@fntextother!\marg{text} whose sole
17986 % user is this macro. Note that the decision of deferring is done based on
17987 % $p=\!\pcol@page!$ which could be less than that of the page in which the
17988 % footnoted text appears because the paragraph having the text will have a
17989 % page break before the text. Therefore, $p$ for the footnote can be
17990 % $\ptop$, but this misjudgment will not cause problems because the footnote
17991 % will eventually be put in $\ptop$ through $\df$ when the page break
17992 % occurs.
17993 %
17994 % Otherwise the footnote $\arg{text}$ is processed by
17995 % \!\pcol@fntexttop!\marg{text}, also used solely in this macro, to
17996 % \!\insert! it through \!\footins! as usual but after the encapsulation by
17997 % \!\pcol@fntextbody! and with \!\penalty!\!\interlinepenalty! following it
17998 % to allow \TeX's page builder to split footnotes.
17999 %
18000 % Note that \!\pcol@fntexttop! and \!\pcol@fntextother! have \!\long!
18001 % property because $\arg{text}$ may have two or more paragraphs.
18002 % 
18003 % \begin{macrocode}
18004 \def\pcol@fntext{%
18005 \let\reserved@a\pcol@fntexttop
18006 \ifpcol@scfnote \ifnum\pcol@page<\pcol@toppage
18007 \let\reserved@a\pcol@fntextother
18008 \fi\fi
18009 \reserved@a}
18010 \long\def\pcol@fntexttop#1{%
18011 \pcol@Logfn{\pcol@fntexttop{\@thefnmark}}%
18012 \insert\footins{\pcol@fntextbody{#1}\penalty\interlinepenalty}}
18013 \long\def\pcol@fntextother#1{%
18014 \global\setbox\pcol@topfnotes\vbox{\unvbox\pcol@topfnotes
18015 \penalty\interlinepenalty\pcol@fntextbody{#1}}}
18016 % \end{macrocode}
18017 % \end{macro}\end{macro}\end{macro}\end{macro}
18018 % 
18019 % \begin{macro}{\pcol@fntextbody}
18020 % \changes{v1.2-2}{2013/05/11}
18021 % {Introduced for footnote encapsulation and height capping.}
18022 % 
18023 % The macro \!\pcol@fntextbody!\marg{text}, invoked from \!\pcol@fntexttop!
18024 % and \!\pcol@fntext~other!, encapsulates the footnote $\arg{text}$ in a
18025 % \!\vbox! whose height is $h_{\max}=\!\textheight!-\!\skip!\~\!\footins!$ at
18026 % tallest. The encapsulation is to inhibit page breaks in a footnote
18027 % because the split by the break will make some skips and other items
18028 % eliminated causing a weird result when split portions are {\em joined}.
18029 % The height capping is thus required to find a page in which the footnote
18030 % resides.
18031 %
18032 % The macro at first does operations done in \LaTeX's
18033 % \!\@footnotetext! to put $\arg{text}$ in \!\@tempboxa! but with one
18034 % exception that $\!\hsize!=\!\textwidth!$ rather than \!\columnwidth! when
18035 % \Scfnote{} typesetting is in effect. Note that this part is blindly copied
18036 % from the original though it should be meaningless to set
18037 % \!\interlinepenalty!, \!\splittopskip!, \!\splitmaxdepth! and
18038 % \!\floatingpenalty! because $\arg{text}$ is encapsulated.
18039 %
18040 % Then the height-plus-depth of the box is compared with $h_{\max}$ and, if
18041 % it exceeds the limit, the height of the box is set $h_{\max}$, the
18042 % footnote is made followed by a \!\vss! to avoid overfull, and a warning
18043 % message of too tall is put by \!\PackageWarning!. Finally, the box is put
18044 % into \!\footins! or $\df$ by the invoker of this macro.
18045 % 
18046 % \begin{macrocode}
18047 \long\def\pcol@fntextbody#1{\setbox\@tempboxa\vbox{%
18048 \reset@font\footnotesize
18049 \interlinepenalty\interfootnotelinepenalty
18050 \splittopskip\footnotesep
18051 \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
18052 \hsize \ifpcol@scfnote \textwidth \else \columnwidth \fi
18053 \def\@currentcounter{footnote}%
18054 \protected@edef\@currentlabel{%
18055 \csname p@footnote\endcsname\@thefnmark
18056 }%
18057 \color@begingroup
18058 \@makefntext{%
18059 \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
18060 \par
18061 \color@endgroup}%
18062 \@tempdima\ht\@tempboxa \advance\@tempdima\dp\@tempboxa
18063 \@tempdimb\textheight \advance\@tempdimb-\skip\footins
18064 \ifdim\@tempdima>\@tempdimb
18065 \setbox\@tempboxa\vbox to\@tempdimb{\unvbox\@tempboxa\vss}%
18066 \PackageWarning{paracol}{Too tall footnote}%
18067 \fi
18068 \box\@tempboxa}
18069
18070 % \end{macrocode}
18071 % \end{macro}
18072 %
18073 % \begin{macro}{\fncounteradjustment}
18074 % \changes{v1.2-2}{2013/05/11}
18075 % {Introduced to make \string\texttt{footnote} counter is consistent
18076 % with its origin at the beginning of \string\texttt{paracol} and the
18077 % number of footnotes given in the environment at its end.}
18078 % \begin{macro}{\nofncounteradjustment}
18079 % \changes{v1.2-2}{2013/05/11}
18080 % {Introduced to disable the footnote counter adjustment.}
18081 % 
18082 % The API macros \!\fncounteradjustment! and \!\nofncounteradjustment! turns
18083 % |\ifpcol@|\~|fncounteradjustment|
18084 % 
18085 % \SpecialIndex{\ifpcol@fncounteradjustment}
18086 % 
18087 % $\true$ or $\false$, to enable or disable the \counter{footnote} counter
18088 % adjustment letting $\!\c@footnote!=\bf+\nf$ in \Endparacol, respectively.
18089 % After the definition we disable the adjustment to give the default setting.
18090 % 
18091 % \begin{macrocode}
18092 \def\fncounteradjustment{\global\pcol@fncounteradjustmenttrue}
18093 \def\nofncounteradjustment{\global\pcol@fncounteradjustmentfalse}
18094 \nofncounteradjustment
18095
18096 % \end{macrocode}
18097 % \end{macro}\end{macro}
18098 %
18099 % \KeepSpace{2}
18100 % \begin{macro}{\pcol@footnoterule}
18101 % \changes{v1.2-2}{2013/05/11}
18102 % {Introduced to keep the original definition of \cs{footnoterule}.}
18103 % \begin{macro}{\pcol@@footnote}
18104 % \changes{v1.2-2}{2013/05/11}
18105 % {Introduced to keep the original definition of \cs{footnote}.}
18106 % \begin{macro}{\pcol@@footnotemark}
18107 % \changes{v1.2-2}{2013/05/11}
18108 % {Introduced to keep the original definition of \cs{footnotemark}.}
18109 % \begin{macro}{\pcol@@footnotetext}
18110 % \changes{v1.2-2}{2013/05/11}
18111 % {Introduced to keep the original definition of \cs{footnotetext}.}
18112 % 
18113 % The macros \!\pcol@footnoterule!, \!\pcol@@footnote!,
18114 % \!\pcol@@footnotemark! and \!\pcol@@footnotetext! are to keep the original
18115 % definitions of \!\footnoterule!, \!\footnote!, \!\foot~note~mark! and
18116 % \!\footnotetext! in them, respectively, so that we define our own versions
18117 % with references to the originals.
18118 % 
18119 % \begin{macrocode}
18120 \let\pcol@footnoterule\footnoterule
18121 \let\pcol@@footnote\footnote
18122 \let\pcol@@footnotemark\footnotemark
18123 \let\pcol@@footnotetext\footnotetext
18124 % \end{macrocode}
18125 % \end{macro}\end{macro}\end{macro}\end{macro}
18126 % 
18127 % \KeepSpace{4}
18128 % \begin{macro}{\footnote}
18129 % \begin{macro}{\pcol@footnote}
18130 % \changes{v1.2-2}{2013/05/11}
18131 % {Introduced for \cs{footnote*} and footnote counter adjustment.}
18132 % \begin{macro}{\pcol@ifootnote}
18133 % \changes{v1.2-2}{2013/05/11}
18134 % {Introduced for \cs{footnote*} and footnote counter adjustment.}
18135 % \begin{macro}{\footnotemark}
18136 % \begin{macro}{\pcol@footnotemark}
18137 % \changes{v1.2-2}{2013/05/11}
18138 % {Introduced for \cs{footnotemark*} and footnote counter adjustment.}
18139 % \begin{macro}{\pcol@ifootnotemark}
18140 % \changes{v1.2-2}{2013/05/11}
18141 % {Introduced for \cs{footnotemark*} and footnote counter adjustment.}
18142 % 
18143 % The macros \!\pcol@footnote! and \!\pcol@footnotemark! are the
18144 % implementations of our own versions of \!\footnote! and \!\footnotemark!
18145 % which are made \!\let!-equal to them by \!\pcol@zparacol!, respectively.
18146 % The reasons why we need to have our own are two-fold; to have starred
18147 % version of them; and to maintain $\nf=\!\pcol@nfootnotes!$ for the
18148 % \counter{footnote} counter adjustment.
18149 %
18150 % The implementations of the starred versions
18151 % \!\footnote!|*|\oarg{num}\marg{text} and
18152 % \!\footnotemark!|*|\~\oarg{num} have common structure in which we invoke
18153 % \!\pcol@adjustfnctr!$\arg{macro}$\oarg{num} if `|*|' is given, to let
18154 % \!\c@footnote! have the number relative to $\bf=\!\pcol@footnotebase!$ or
18155 % to itself. Then the macros \!\pcol@ifootnote! or \!\pcol@ifootnotemark!
18156 % are invoked from \!\pcol@adjustfnctr! or the else-part of \!\@ifstar! to
18157 % perform the operations common to both cases with and without `|*|', i.e.,
18158 % invoking the original version \!\pcol@@footnote! or \!\pcol@@footnotemark!
18159 % after incrementing $\nf$. One caution is that
18160 % $\arg{macro}=\!\pcol@ifootnote!$ for \!\footnote!, but
18161 % $\arg{macro}=|{|\!\pcol@ifootnotemark!\!\relax!|}|$ for \!\footnotemark!
18162 % so that \!\@ifnextchar! in \!\pcol@@footnotemark! invoked from
18163 % \!\pcol@ifootnotemark! eats \!\relax! to terminate space skipping and thus
18164 % spaces following \oarg{num} are kept.
18165 % 
18166 % \begin{macrocode}
18167 \def\pcol@footnote{\@ifstar{\pcol@adjustfnctr\pcol@ifootnote}\pcol@ifootnote}
18168 \def\pcol@ifootnote{\global\advance\pcol@nfootnotes\@ne \pcol@@footnote}
18169 \def\pcol@footnotemark{\@ifstar
18170 {\pcol@adjustfnctr{\pcol@ifootnotemark\relax}}%
18171 \pcol@ifootnotemark}
18172 \def\pcol@ifootnotemark{\global\advance\pcol@nfootnotes\@ne
18173 \pcol@@footnotemark}
18174 % \end{macrocode}
18175 % \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
18176 % 
18177 % \KeepSpace{1}
18178 % \begin{macro}{\pcol@adjustfnctr}
18179 % \changes{v1.2-2}{2013/05/11}
18180 % {Introduced for \cs{footnote*} and \cs{footnotemark*}.}
18181 % \begin{macro}{\pcol@iadjustfnctr}
18182 % \changes{v1.2-2}{2013/05/11}
18183 % {Introduced for \cs{footnote*} and \cs{footnotemark*}.}
18184 % \begin{macro}{\pcol@calcfnctr}
18185 % \changes{v1.2-2}{2013/05/11}
18186 % {Introduced for \cs{footnote*}, \cs{footnotemark*} and
18187 % \cs{footnotetext*}.}
18188 % 
18189 % The macro \!\pcol@adjustfnctr!$\arg{macro}$\oarg{num}, invoked from the
18190 % then-part of \!\@ifstar! in \!\pcol@footnote! and \!\pcol@footnotemark!,
18191 % calculates the number to be set into \!\c@footnote! by
18192 % \!\pcol@calcfnctr!$\arg{num}$\!\@nil! after processing the optional
18193 % argument $\arg{num}$ by \!\pcol@iadjustfnctr! with default `|+1|', and
18194 % then invoke $\arg{macro}$ being \!\pcol@ifootnote! or
18195 % \!\pcol@ifootnotemark!\!\relax!. Since \!\pcol@calcfnctr! returns the
18196 % number \!\c@footnote! should have and the counter is incremented by
18197 % \!\stepcounter! in \!\pcol@@footnote! or \!\pcol@@footnotemark!, we
18198 % decrement the counter prior to invoke $\arg{macro}$.
18199 %
18200 % The macro \!\pcol@calcfnctr!$\arg{num}$\!\@nil!, also invoked from
18201 % \!\pcol@iifootnotetext!, calculate $m$ specified by $\arg{num}$ as follows,
18202 % where $f=\!\c@footnote!$, to return it through \!\@tempcnta!.
18203 % $$
18204 % m=\cases{f+k&$\arg{num}=|+|k$\cr
18205 % f-k&$\arg{num}=|-|k$\cr
18206 % \bf+k&$\arg{num}=k$}
18207 % $$
18208 % 
18209 % \begin{macrocode}
18210 \def\pcol@adjustfnctr#1{\@ifnextchar[%]
18211 {\pcol@iadjustfnctr{#1}}{\pcol@iadjustfnctr{#1}[+1]}}
18212 \def\pcol@iadjustfnctr#1[#2]{\pcol@calcfnctr#2\@nil
18213 \global\c@footnote\@tempcnta \global\advance\c@footnote\m@ne#1}
18214 \def\pcol@calcfnctr#1#2\@nil{\@tempcnta\c@footnote
18215 \def\reserved@a{#1}\def\reserved@b{+}%
18216 \ifx\reserved@a\reserved@b \advance\@tempcnta#2\relax
18217 \else \def\reserved@b{-}%
18218 \ifx\reserved@a\reserved@b \advance\@tempcnta-#2\relax
18219 \else \@tempcnta\pcol@footnotebase \advance\@tempcnta#1#2\relax
18220 \fi\fi}
18221 % \end{macrocode}
18222 % \end{macro}\end{macro}\end{macro}
18223 % 
18224 % \KeepSpace{2}
18225 % \begin{macro}{\footnotetext}
18226 % \begin{macro}{\pcol@footnotetext}
18227 % \changes{v1.2-2}{2013/05/11}
18228 % {Introduced for \cs{footnotetext*}.}
18229 % \begin{macro}{\pcol@ifootnotetext}
18230 % \changes{v1.2-2}{2013/05/11}
18231 % {Introduced for \cs{footnotetext*}.}
18232 % \begin{macro}{\pcol@iifootnotetext}
18233 % \changes{v1.2-2}{2013/05/11}
18234 % {Introduced for \cs{footnotetext*}.}
18235 % 
18236 % The macros \!\pcol@footnotetext! is the implementation of our own versions
18237 % of \!\footnotetext! which is made \!\let!-equal to it by
18238 % \!\pcol@zparacol!. The reasons why we need to have our own is to have the
18239 % starred version. That is, if `|*|' is not given, we simply invoke the
18240 % original version \!\pcol@@footnotetext!. Otherwise we invoke
18241 % \!\pcol@ifootnotetext! which then examines if the optional argument
18242 % \oarg{num} is presented. If so, we invoke \!\pcol@iifootnotetext! in
18243 % which \!\pcol@calcfnctr!$\arg{num}$\!\@nil! is invoked to have the value
18244 % $m$ being the footnote ordinal with which we invoke
18245 % \!\pcol@@footnotetext!\oarg{\mbox{$m$}} with two \!\expandafter!s to
18246 % extract $m$ from \!\@tempcnta!. Otherwise, i.e., \oarg{num} is not given,
18247 % we increment \!\c@footnote! by \!\stepcounter! before invoking
18248 % \!\pcol@@footnotetext!.
18249 % 
18250 % \begin{macrocode}
18251 \def\pcol@footnotetext{\@ifstar\pcol@ifootnotetext\pcol@@footnotetext}
18252 \def\pcol@ifootnotetext{\@ifnextchar[%]
18253 \pcol@iifootnotetext{\stepcounter{footnote}\pcol@@footnotetext}}
18254 \def\pcol@iifootnotetext[#1]{\pcol@calcfnctr#1\@nil
18255 \expandafter\pcol@@footnotetext\expandafter[\number\@tempcnta]}
18256
18257 % \end{macrocode}
18258 % \end{macro}\end{macro}\end{macro}\end{macro}
18259 %
18260 %
18261 %
18262 % \KeepSpace{13}
18263 % \section{Commands for Marginal Notes}
18264 % \label{sec:imp-mpar}
18265 % \changes{v1.35-3}{2018/12/31}
18266 % {Add the section ``Commands for Marginal Notes'' to describe newly
18267 % introduced macros for the emulation of \cs{marginnote}.}
18268 %
18269 % \begin{macro}{\marginpar}
18270 % \changes{v1.35-3}{2018/12/31}
18271 % {Locally modified in \cs{pcol@zparacol} for the emulation of
18272 % \cs{marginnote}.}
18273 % \begin{macro}{\pcol@marginpar}
18274 % \changes{v1.35-3}{2018/12/31}
18275 % {Introduced as the in-\texttt{paracol} version of \cs{marginpar} for
18276 % the emulation of \cs{marginnote}.}
18277 % \begin{macro}{\pcol@@marginpar}
18278 % \changes{v1.35-3}{2018/12/31}
18279 % {Introduced to keep the original version of \cs{marginpar} for
18280 % the emulation of \cs{marginnote}.}
18281 % \begin{macro}{\@mn@@marginnote}
18282 % \changes{v1.35-3}{2018/12/31}
18283 % {Locally modified in \cs{pcol@zparacol} for the emulation of
18284 % \cs{marginnote}.}
18285 % \begin{macro}{\pcol@marginnote}
18286 % \changes{v1.35-3}{2018/12/31}
18287 % {Introduced as the in-\texttt{paracol} version of
18288 % \cs{@mn@@marginnote} for the emulation of \cs{marginnote}.}
18289 % \begin{macro}{\pcol@mn@warning}
18290 % \changes{v1.35-3}{2018/12/31}
18291 % {Introduced to put a warning message to show \cs{marginnote} is
18292 % emulated.}
18293 % \begin{macro}{\@xympar}
18294 % \changes{v1.35-3}{2018/12/31}
18295 % {Locally modified in \cs{pcol@zparacol} for the emulation of
18296 % \cs{marginnote}.}
18297 % \begin{macro}{\pcol@xympar}
18298 % \changes{v1.35-3}{2018/12/31}
18299 % {Introduced as the in-\texttt{paracol} version of
18300 % \cs{@xympar} for the emulation of \cs{marginnote}.}
18301 % \begin{macro}{\pcol@@xympar}
18302 % \changes{v1.35-3}{2018/12/31}
18303 % {Introduced to keep the original version of \cs{@xympar} for the
18304 % emulation of \cs{marginnote}.}
18305 % \begin{macro}{\pcol@mparoffset}
18306 % \changes{v1.35-3}{2018/12/31}
18307 % {Introduced to have the vertical offset for the emulation of
18308 % \cs{marginnote}.}
18309 % The API macro \!\marginnote!\oarg{left}\marg{right}\oarg{voffset} given by
18310 % the package \textsf{marginnote} is emulated using
18311 % \!\marginpar!\oarg{left}\marg{right} and \!\pcol@addmarginpar! in
18312 % \!\output! routine. The basic mechanism is to pass the vertical offset
18313 % $\arg{voffset}$ to \!\pcol@addmarginpar! through $|\dimen|\arg{b}$ where
18314 % $b$ is the \!\insert! to carry $\arg{left}$. The offset passing is
18315 % implemented as follows.
18316 % 
18317 % \begin{itemize}
18318 % \item
18319 % \!\marginpar! is made \!\let!-equal to our own version \!\pcol@marginpar!
18320 % in \!\pcol@zparacol! so that it \!\let! the macro \!\pcol@mparoffset! be
18321 % \!\z@! and then invoke \LaTeX's original version kept in
18322 % \!\pcol@@marginpar!, because the marginal note given by \!\marginpar! will
18323 % not be shifted.
18324 %
18325 % \item
18326 % The internal macro
18327 % \!\@mn@@marginnote!\oarg{left}\marg{right}\oarg{voffset} defined in
18328 % \textsf{marginnote} is made \!\let!-equal to our own version
18329 % \!\pcol@marginnote! in \!\pcol@zparacol! so that it |\def|ines
18330 % \!\pcol@mparoffset! to have $\arg{voffset}$ and then invoke
18331 % \!\pcol@@marginpar!\oarg{left}\~\marg{right} for the emulation. In the
18332 % invocation, \textsf{marginnote}'s typesetting macros \!\margin~font!,
18333 % \!\raggedleftmarginnote! and \!\raggedrightmarginnote! are attached to
18334 % $\arg{left}$ and $\arg{right}$.
18335 %
18336 % \item
18337 % \LaTeX's internal macro \!\@xympar! for the last operations of
18338 % \!\marginpar! is made \!\let!-equal to our own version in
18339 % \!\pcol@zparacol! so that it assigns the offset in \!\pcol@mparoffset! to
18340 % |\dimen|\!\@marbox! for $\arg{left}$, if $\!\@floatpenalty!<0$ to mean
18341 % other macros for \!\marginpar! have not detected any errors.
18342 % \end{itemize}
18343 % 
18344 % In addition, we raise a warning that \!\marginnote! is emulated by
18345 % \!\pcol@mn@warning!, which is made \!\let!-equal to \!\relax! in the caller
18346 % \!\pcol@marginnote! after the invocation so that the warning message is
18347 % put just once.
18348 % 
18349 % \begin{macrocode}
18350 %% Commands for Marginal Notes
18351
18352 \def\pcol@marginpar{\let\pcol@mparoffset\z@ \pcol@@marginpar}
18353 \long\def\pcol@marginnote[#1]#2[#3]{\endgroup
18354 \pcol@mn@warning \global\let\pcol@mn@warning\relax
18355 \def\pcol@mparoffset{#3}%
18356 \pcol@@marginpar[\marginfont\raggedleftmarginnote#1]%
18357 {\marginfont\raggedrightmarginnote#2}}
18358 \def\pcol@mn@warning{%
18359 \PackageWarning{paracol}{\string\margninnote\space is emulated by
18360 \string\marginpar.}}
18361 \def\pcol@xympar{%
18362 \ifnum\@floatpenalty<\z@ \global\dimen\@marbox\pcol@mparoffset\relax \fi
18363 \pcol@@xympar}
18364
18365 % \end{macrocode}
18366 % \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
18367 % \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
18368 %
18369 %
18370 % \KeepSpace{9}
18371 % \section{Two-Sided Typesetting}
18372 % \label{sec:imp-swap}
18373 % \changes{v1.2-4}{2013/05/11}
18374 % {Add the section ``Column-Swapping'' to describe newly
18375 % introduced macros for column-swapping.}
18376 % \changes{v1.3-5}{2013/09/17}
18377 % {Rename the section title from ``Column-Swapping'' to ``Two-Sided
18378 % Typesetting''.}
18379 %
18380 % \begin{macro}{\twosided}
18381 % \changes{v1.3-5}{2013/09/17}
18382 % {Introduced as an easier API for various two-sided typesetting.}
18383 % \changes{v1.3-3}{2013/09/17}
18384 % {Add two-sided background painting.}
18385 % \changes{v1.3-4}{2013/09/17}
18386 % {Add two-sided marginal note placement.}
18387 % \begin{macro}{\pcol@twosided}
18388 % \changes{v1.3-5}{2013/09/17}
18389 % {Introduced to implement \cs{twosided}.}
18390 % \changes{v1.31}{2013/10/10}
18391 % {Fix spelling ``twosiding'' replacing it with ``two-siding'' in the
18392 % error message.}
18393 % \begin{macro}{\pcol@twosided@p}
18394 % \changes{v1.3-5}{2013/09/17}
18395 % {Introduced to implement \cs{twosided} with \string\texttt{[p]}.}
18396 % \begin{macro}{\pcol@twosided@c}
18397 % \changes{v1.3-5}{2013/09/17}
18398 % {Introduced to implement \cs{twosided} with \string\texttt{[c]}.}
18399 % \begin{macro}{\pcol@twosided@m}
18400 % \changes{v1.3-5}{2013/09/17}
18401 % {Introduced to implement \cs{twosided} with \string\texttt{[m]}.}
18402 % \changes{v1.3-4}{2013/09/17}
18403 % {Introduced for two-sided marginal note placement.}
18404 % \begin{macro}{\pcol@twosided@b}
18405 % \changes{v1.3-5}{2013/09/17}
18406 % {Introduced to implement \cs{twosided} with \string\texttt{[b]}.}
18407 % \changes{v1.3-3}{2013/09/17}
18408 % {Introduced for two-sided background painting.}
18409 % \begin{macro}{\swapcolumninevenpages}
18410 % \changes{v1.2-4}{2013/05/11}
18411 % {Introduced to enable column-swapping.}
18412 % \begin{macro}{\noswapcolumninevenpages}
18413 % \changes{v1.2-4}{2013/05/11}
18414 % {Introduced to disable column-swapping.}
18415 % 
18416 % \def\inornot{\mathrel{{\in}/{\notin}}}
18417 % 
18418 % The API macro $\!\twosided!|[|T|]|$ where $T=t_1t_2\cdots$ is to
18419 % enable\slash disable two-sided paging with
18420 % $\CSIndex{if@twoside}=\true/\false$ ($|p|\inornot T$), two-sided \cswap{}
18421 % with $\CSIndex{ifpcol@swapcolumn}\~={\true/\false}$ ($|c|\inornot T$),
18422 % two-sided % marginal note placement with
18423 % $\CSIndex{ifpcol@swapmarginpar}={\true/\false}$ ($|m|\inornot T$), and/or
18424 % two-sided \bgpaint{} with $\CSIndex{ifpcol@bg@swap}={\true/\false}$
18425 % ($|b|\inornot{}T$) individually, or to enable all of them as a whole
18426 % when the optional argument is not given.
18427 %
18428 % The macro invokes \!\pcol@twosided! with the optional argument $T$ if
18429 % provided, or with $T=|pcmb|$ otherwise to enable all features. Then
18430 % \!\pcol@twosided! at first turns all the switches $\false$ an then scans
18431 % all non-space tokens $t\in T$ invoking $|\pcol@twosided@|{\cdot}t$ if it
18432 % is defined and thus $t\in\{|p|,|c|,|m|,|b|\}$ to turn the corresponding
18433 % switch $\true$, or complains that the feature $t$ is unknown.
18434 %
18435 % Note that backward-compatible API macros
18436 % \!\swapcolumninevenpages! and \!\noswapcolumn~inevenpages! are still
18437 % available to turn $\CSIndex{ifpcol@swapcolumn}$ $\true$ an $\false$
18438 % respectively.
18439 % 
18440 % \begin{macrocode}
18441 %% Column Swapping
18442
18443 \def\twosided{\@ifnextchar[%]
18444 {\pcol@twosided}{\pcol@twosided[pcmb]}}
18445 \def\pcol@twosided[#1]{%
18446 \global\@twosidefalse \global\pcol@swapcolumnfalse
18447 \global\pcol@swapmarginparfalse \global\pcol@bg@swapfalse
18448 \@tfor\reserved@a:=#1\do{%
18449 \@ifundefined{pcol@twosided@\reserved@a}%
18450 {\PackageError{paracol}{Unknown two-siding feature \reserved@a}}%
18451 {\@nameuse{pcol@twosided@\reserved@a}}}}
18452 \def\pcol@twosided@p{\global\@twosidetrue}
18453 \def\pcol@twosided@c{\global\pcol@swapcolumntrue}
18454 \def\pcol@twosided@m{\global\pcol@swapmarginpartrue}
18455 \def\pcol@twosided@b{\global\pcol@bg@swaptrue}
18456
18457 \def\swapcolumninevenpages{\global\pcol@swapcolumntrue}
18458 \def\noswapcolumninevenpages{\global\pcol@swapcolumnfalse}
18459
18460 % \end{macrocode}
18461 % \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
18462 % \end{macro}\end{macro}
18463 % 
18464 % \begin{macro}{\pcol@swapcolumn}
18465 % \changes{v1.2-4}{2013/05/11}
18466 % {Introduced to convert column ordinal and its position.}
18467 % \changes{v1.3-2}{2013/09/17}
18468 % {Add two arguments $C^0$ and $C^1$ as the third and fourth ones to
18469 % modify the calculation of $c_2$ with them for column-swapping with
18470 % parallel-paging.}
18471 % \changes{v1.3-3}{2013/09/17}
18472 % {Add the assignment of \cs{pcol@colsepid} to let it have $c_2-1$ if
18473 % swapped or $c_2$ otherwise.}
18474 % \changes{v1.3-4}{2013/09/17}
18475 % {Add a user \cs{pcol@addmarginpar} and remove \cs{paracol},
18476 % \cs{pcol@sptext} and \cs{pcol@switchcol}.}
18477 % \begin{macro}{\pcol@colsepid}
18478 % \changes{v1.3-3}{2013/09/17}
18479 % {Introduced to be let have $c_2-1$ if swapped or $c_2$ otherwise by
18480 % \cs{pcol@swapcolumn}.}
18481 % 
18482 % The macro \!\pcol@swapcolumn!$\<c_1\>\<c_2\>\<\Cfrom\>\<\Cto\>$ converts
18483 % the column ordinal $c$ or position $c'$ in the \!\count!
18484 % register\footnote{
18485 % 
18486 % Or the \!\dimen! register \!\z@!.}
18487 % 
18488 % $c_1$ to the position or ordinal to set it in the \!\count! register
18489 % $c_2$, for a \parapag{}e having columns $c\In\Cfrom\Cto$. That is, we let
18490 % $c_2=(\Cto-1)-(c_1-\Cfrom)$ if $\CSIndex{ifpcol@swapcolumn}=\true$ to mean
18491 % the \cswap{} is in effect and \!\c@page! is even, while $c_2=c_1$
18492 % otherwise. We also let $c^g=\!\pcol@colsepid!=c_2-1$ if swapped, or
18493 % $c^g=c_2$ otherwise, so that it has the ordinal of the \csepgap{}
18494 % {\em physically} following the column $c_2$.
18495 %
18496 % The macro is used in \!\pcol@ioutputelt!, \!\pcol@addmarginpar!,
18497 % \!\pcol@imakeflushedpage! and \!\pcol@iflushfloats! with
18498 % $(c_1,c_2)=(c',c)$, and in \!\pcol@addmarginpar! (another use) with
18499 % $(c_1,c_2)=(c,c')$. Note that in the uses in the macros above except for
18500 % \!\pcol@addmarginpar!, \!\c@page! definitely has the page number for the
18501 % page to be shipped out. As for \!\pcol@addmarginpar! on the other hand,
18502 % \!\c@page! can be different from the ship-out page number to produce a
18503 % weird result if their parities are different, due to page jump. However
18504 % this problem is not so severe because it just affects the position of
18505 % marginal notes which \LaTeX{} itself may misplace.
18506 % 
18507 % \begin{macrocode}
18508 \def\pcol@swapcolumn#1#2#3#4{%
18509 \edef\pcol@colsepid{\number#1}%
18510 \ifpcol@swapcolumn
18511 \ifodd\c@page\relax #2#1\relax
18512 \else
18513 #2#4\relax \advance#2-#1\relax \advance#2#3\relax \advance#2-\tw@
18514 \edef\pcol@colsepid{\number#2}%
18515 \advance#2\@ne
18516 \fi
18517 \else #2#1\relax
18518 \fi}
18519
18520 % \end{macrocode}
18521 % \end{macro}\end{macro}
18522 % 
18523 % \KeepSpace{2}
18524 % \begin{macro}{\marginparthreshold}
18525 % \changes{v1.3-4}{2013/09/17}
18526 % {Introduced to specify the smallest ordinal of columns whose marginal
18527 % notes go to the right margin if not swapped.}
18528 % \begin{macro}{\pcol@marginparthreshold}
18529 % \changes{v1.3-4}{2013/09/17}
18530 % {Introduced to implement \cs{marginparthreshold}.}
18531 % \begin{macro}{\pcol@mpthreshold@l}
18532 % \changes{v1.3-4}{2013/09/17}
18533 % {Introduced to keep the value specified by \cs{marginparthreshold}
18534 % for columns in left parallel-pages.}
18535 % \begin{macro}{\pcol@mpthreshold@r}
18536 % \changes{v1.3-4}{2013/09/17}
18537 % {Introduced to keep the value specified by \cs{marginparthreshold}
18538 % for columns in right parallel-pages.}
18539 % 
18540 % The API macro $\!\marginparthreshold!\Arg{t_l}|[|t_r|]|$ determines the
18541 % smallest ordinal $t_l$ of columns in left \parapag{}es whose marginal
18542 % notes go to the right margin in fundamental setting of marginal note
18543 % positioning, while the threshold in right \parapag{}es is given by $t_r$
18544 % if provided or by $t_l$ otherwise. That is, marginal notes given in a
18545 % column $c$ in a page $p$ s.t.\ $c\In0\CL$ (resp.\ $\LBRP\CL\C$) go left if
18546 % $c<t_l$ (resp.\ $c<t_r$) while they go right if $c\geq t_l$ (resp.\ $c\geq
18547 % t_r$), providing
18548 % $$
18549 % (\CSIndex{ifpcol@swapmarginpar}\;\land\;\page(p)\bmod2=0)
18550 % \not\equiv\CSIndex{if@reversemargin}=\false
18551 % $$
18552 % or the margins are swapped otherwise.
18553 %
18554 % The macro \!\def!ines \!\pcol@mpthreshold@l! to let it have $t_l$ after a
18555 % assigning $t_l$ to \!\@tempcnta! to ensure $t_l$ gives some number, and
18556 % then do the same for \!\pcol@mpthreshold@r! with $t_r$ by
18557 % \!\pcol@marginparthreshold! if $t_r$ is provided, or let the macro have
18558 % $t_l$ otherwise. Note that at the top level we do
18559 % \!\marginparthreshold!|{1}| to give defaults. Also note that
18560 % \!\pcol@mpthreshold@l! and \!\pcol@mpthreshold@r! are referred to solely
18561 % in \!\pcol@addmarginpar!.
18562 % 
18563 % \begin{macrocode}
18564 \def\marginparthreshold#1{\@tempcnta#1\relax
18565 \xdef\pcol@mpthreshold@l{\number\@tempcnta}%
18566 \@ifnextchar[%]
18567 \pcol@marginparthreshold{\xdef\pcol@mpthreshold@r{\number\@tempcnta}}}
18568 \def\pcol@marginparthreshold[#1]{\@tempcnta#1\relax
18569 \xdef\pcol@mpthreshold@r{\number\@tempcnta}}
18570 \marginparthreshold{1}
18571
18572 % \end{macrocode}
18573 % \end{macro}\end{macro}\end{macro}\end{macro}
18574 %
18575 %
18576 % \KeepSpace{5}
18577 % \section{Commands for Text Coloring}
18578 % \label{sec:imp-commcolor}
18579 % \changes{v1.3-6}{2013/09/17}
18580 % {Add the section ``Commands for Text Coloring'' to distinguish
18581 % macros inside and outside \cs{output} routine and describe the latter
18582 % in this section.}
18583 %
18584 % \begin{macro}{\columncolor}
18585 % \changes{v1.2-1}{2013/05/11}
18586 % {Introduced to define the default color of a column.}
18587 % \changes{v1.22}{2013/06/30}
18588 % {Add the definition of \cs{pcol@colorcommand} for warning in
18589 % \cs{pcol@icolumncolor}.}
18590 % \begin{macro}{\pcol@xcolumncolor}
18591 % \changes{v1.2-1}{2013/05/11}
18592 % {Introduced to implement \cs{columncolor}.}
18593 % \begin{macro}{\pcol@ycolumncolor}
18594 % \changes{v1.2-1}{2013/05/11}
18595 % {Introduced to implement \cs{columncolor}.}
18596 % \begin{macro}{\pcol@columncolor}
18597 % \changes{v1.2-1}{2013/05/11}
18598 % {Introduced to implement \cs{columncolor}.}
18599 % 
18600 % The API macro \!\columncolor!\oarg{mode}\marg{color}\oarg{c} defines the
18601 % default color specified by $\arg{color}$ optionally with color
18602 % $\arg{mode}$ of the column $c$ being the current column or that specified
18603 % by the optional argument. After \!\def!ining \Midx{\!\pcol@colorcommand!}
18604 % being the \!\string! of this macro itself, and processing two optional
18605 % arguments $\arg{mode}$ and $c$ through macros \!\pcol@xcolumncolor!,
18606 % \!\pcol@ycolumncolor! and \!\pcol@columncolor!, the macro
18607 % \!\pcol@icolumncolor!\marg{cmd}\oarg{c} is invoked to perform real
18608 % operations with the coloring command
18609 % $\arg{cmd}=\!\color!$\oarg{mode}\marg{color}.
18610 % 
18611 % \begin{macrocode}
18612 %% Commands for Text Coloring
18613
18614 \def\columncolor{\def\pcol@colorcommand{\string\columncolor}%
18615 \@ifnextchar[%]
18616 \pcol@xcolumncolor\pcol@ycolumncolor}
18617 \def\pcol@xcolumncolor[#1]#2{\pcol@columncolor{\color[#1]{#2}}}
18618 \def\pcol@ycolumncolor#1{\pcol@columncolor{\color{#1}}}
18619 \def\pcol@columncolor#1{\@ifnextchar[%]
18620 {\pcol@icolumncolor{#1}}{\pcol@icolumncolor{#1}[\number\pcol@currcol]}}
18621 % \end{macrocode}
18622 % \end{macro}\end{macro}\end{macro}\end{macro}
18623 % 
18624 % \begin{macro}{\normalcolumncolor}
18625 % \changes{v1.2-1}{2013/05/11}
18626 % {Introduced to define the default color of a column is
18627 % \cs{normalcolor}.}
18628 % \changes{v1.22}{2013/06/30}
18629 % {Add the definition of \cs{pcol@colorcommand} for warning in
18630 % \cs{pcol@icolumncolor}.}
18631 % 
18632 % The API macro \!\normalcolumncolor!\oarg{c} defines the default color of
18633 % the column $c$, being the current column or that specified by the optional
18634 % argument, is \!\normalcolor!. That is, after \!\def!ining
18635 % \Midx{\!\pcol@colorcommand!} being the \!\string! of this macro itself,
18636 % this macro simply invokes \!\pcol@icolumncolor!\marg{cmd}\oarg{c} to
18637 % perform real operations with the coloring command
18638 % $\arg{cmd}=\!\normalcolor!$.
18639 % 
18640 % \begin{macrocode}
18641 \def\normalcolumncolor{\def\pcol@colorcommand{\string\normalcolumncolor}%
18642 \@ifnextchar[%]
18643 {\pcol@icolumncolor\normalcolor}%
18644 {\pcol@icolumncolor\normalcolor[\number\pcol@currcol]}}
18645 % \end{macrocode}
18646 % \end{macro}
18647 % 
18648 % \KeepSpace{1}
18649 % \changes{v1.22}{2013/06/30}
18650 % {\cs{pcol@getshadowcc} was introduced for setting $\hat\gamma_0^c$
18651 % into $\gamma_0^c$ locally, but removed in v1.34.}
18652 % \changes{v1.34}{2018/05/07}
18653 % {\cs{pcol@getshadowcc} is removed according to the change of text
18654 % coloring from \cs{output} to \cs{insert}.}
18655 % \begin{macro}{\pcol@icolumncolor}
18656 % \changes{v1.2-1}{2013/05/11}
18657 % {Introduced to implement \cs{columncolor} and
18658 % \cs{normalcolumncolor}.}
18659 % \changes{v1.22}{2013/06/30}
18660 % {Add warning of ineffective uses of \cs{columncolor} and
18661 % \cs{normalcolumncolor}, and modify the mechanism to update
18662 % $\gamma_0^c$ and to rewind\slash reestablish color stack.}
18663 % \changes{v1.23}{2013/07/08}
18664 % {Add an argument of \cs{relax} to \cs{pcol@color@invokeoutput}
18665 % because any insertion after \cs{vadjust} is not required or
18666 % justified.}
18667 % \changes{v1.24}{2013/07/27}
18668 % {Add math mode to the cases of ineffective use.}
18669 % \changes{v1.34}{2018/05/07}
18670 % {Remove the invocations of \cs{pcol@iicolumncolor} for
18671 % $\cs{pcol@columncolor@shadow}\cdot c$ because it no longer exists,
18672 % completely change the operations in the case the target column $c$
18673 % is the current one according to the new method with \cs{insert},
18674 % and add immediate setting of $\gamma_0^c$ in the case $c$ is not
18675 % current.}
18676 % \begin{macro}{\pcol@iicolumncolor}
18677 % \changes{v1.22}{2013/06/30}
18678 % {Introduced for setting $\gamma_0^c$ and $\hat\gamma_0^c$, and
18679 % pushing $\chi$.}
18680 % \changes{v1.34}{2018/05/07}
18681 % {Remove the third argument, change the second argument from a
18682 % control sequence name to the target column, add a grouping to
18683 % surround the entire body of the macro, and change the body of
18684 % $\gamma_0^c$ so that it only has the color information.}
18685 % \begin{macro}{\pcol@scancst@shadow}
18686 % \changes{v1.34}{2018/05/07}
18687 % {Introduced to rewind or establish the color stack $\hat\Gamma^c$.}
18688 % 
18689 % The macro \!\pcol@icolumncolor!\marg{cmd}\oarg{c}, invoked from
18690 % \!\pcol@columncolor! and \!\normal~columncolor!, performs the operations to
18691 % define the default color of the column $c$ with the coloring command
18692 % $\arg{cmd}\in\{\!\color!\hbox{\oarg{mode}}\ARg{color},\,\!\normalcolor!\}$
18693 % as follows. First we examine if \!\set@color! is not \!\relax! and we are
18694 % in non-internal vertical or non-restricted horizontal mode and, if not, we
18695 % complain the command whose name is in \!\pcol@colorcommand! is ineffective
18696 % by \!\PackageWarning! and do nothing.
18697 %
18698 % Otherwise and if we are not in a \env{paracol} environment, i.e.,
18699 % \!\paracol! is not \!\let!-equal to \!\pcol@paracol!, we simply invoke
18700 % \!\pcol@iicolumncolor! to let $\Celtshadow^c=|\pcol@columncolor|\cdot c$
18701 % have the color $\chi$ specified by $\arg{cmd}$ so that the next
18702 % \beginparacol{} will let $\Celt^c$ have the coloring \!\special! for
18703 % $\chi$. If we are in a \env{paracol} environment but in a column $c'\neq
18704 % c$, on the other hand, we also let $\Celtshadow=\chi$ but in addition let
18705 % $\Celt^c=|\pcol@columncolor@box|\cdot c$ have the coloring \!\special! for
18706 % $\chi$ immediately so that it is effective in the next \cswitch{} to $c$.
18707 % This immediate setting of $\Celt^c$ is done by invoking $\arg{cmd}$ with
18708 % the original \!\set@color! saved in \!\pcol@set@color! and the
18709 % nullification of \!\aftergroup!, after acquiring an \!\insert! for it if
18710 % necessary,
18711 % 
18712 % \SpecialArrayIndex{c}{\pcol@columncolor}
18713 % \SpecialArrayIndex{c}{\pcol@columncolor@box}
18714 %
18715 % Otherwise, i.e., if we are in a \env{paracol} environment and in the
18716 % column $c$, at first we invoke \!\pcol@scancst@shadow! to rewind
18717 % $\CSTshadow^c$ applying $\!\@elt!=\!\reset@color!$ to
18718 % $\celtshadow_i\in\CSTshadow^c$. Then, after letting $\Celtshadow^c=\chi$,
18719 % we invoke \!\pcol@scancst@shadow! again to reestablish $\CSTshadow^c$ with
18720 % the new $\Celtshadow^c$ so that $\Celtshadow^c$ is at the bottom of the
18721 % \colorstack{} in |.tex|. In this scan $\!\@elt!\arg{\celtshadow_i}$
18722 % \!\def!ines \!\current@color! to let it have $\celtshadow_i$ and then
18723 % invokes \!\pcol@set@color! to put the coloring \!\special! for
18724 % $\celtshadow_i$ nullifying \!\aftergroup!. Then we \!\insert! a \!\vbox!,
18725 % whose height and depth are 1\,|pt| and width is 0, having the coloring
18726 % \!\special! for $\chi$ so that \!\output! will let $\Celt^c$ have the
18727 % \!\special! in a synchronous manner. After that we put a
18728 % $\!\penalty!=10000$ if $\CSIndex{if@nobreak}=\true$ to keep the
18729 % \!\insert!ion from being followed by a page break.
18730 %
18731 % The macro $\!\pcol@iicolumncolor!\arg{cmd}\arg{c}$ at first
18732 % invokes $\arg{cmd}$ to let \!\current@color! have the printer-specific color
18733 % information $\chi$ of $\arg{color}$ or what \!\normalcolor! specifies,
18734 % temporarily letting \!\set@color! be \!\relax! to let \!\color! or
18735 % \!\normalcolor! just do the \!\def!inition of \!\current@color! without
18736 % putting coloring \!\special!s nor preparing \colorstack{} popping. Then
18737 % we \!\xdef!ine $\Celtshadow^c=|\pcol@columncolor|{\cdot}c$ to have $\chi$.
18738 % 
18739 % \SpecialArrayIndex{c}{\pcol@columncolor}
18740 %
18741 % \begingroup\hfuzz3.1pt
18742 % The macro \!\pcol@scancst@shadow! applies \!\@elt! to $\Celtshadow^c$ to
18743 % put a coloring or uncoloring \!\special! for it if it is defined, and then
18744 % do the same for all
18745 % $\celtshadow_i\in\cstshadow=\!\pcol@colorstack@shadow!$.
18746 % \par\endgroup
18747 % 
18748 % \begin{macrocode}
18749 \def\pcol@icolumncolor#1[#2]{%
18750 \@tempswafalse
18751 \ifpcol@inner \@tempswatrue \fi
18752 \ifinner \@tempswatrue \fi
18753 \ifmmode \@tempswatrue \fi
18754 \ifx\set@color\relax
18755 \PackageWarning{paracol}{\pcol@colorcommand\space is not effective
18756 without some coloring package}%
18757 \else\if@tempswa
18758 \PackageWarning{paracol}{\pcol@colorcommand\space is not effective
18759 when not in outer par mode}%
18760 \else
18761 \begingroup
18762 \let\@elt\relax
18763 \ifx\pcol@paracol\paracol
18764 \pcol@iicolumncolor{#1}{#2}%
18765 \else\ifnum#2=\pcol@currcol
18766 \def\@elt##1{\reset@color}\pcol@scancst@shadow
18767 \pcol@iicolumncolor{#1}{#2}%
18768 \def\@elt##1{\def\current@color{##1}\let\aftergroup\@gobble
18769 \pcol@set@color}%
18770 \pcol@scancst@shadow
18771 \setbox\@tempboxa\vbox{\let\set@color\pcol@set@color
18772 \let\aftergroup\@gobble #1}%
18773 \ht\@tempboxa1sp \dp\@tempboxa1sp \wd\@tempboxa\z@\relax
18774 \insert\pcol@colorins{\box\@tempboxa}%
18775 \ifvmode\if@nobreak \nobreak \fi\fi
18776 \else
18777 \pcol@iicolumncolor{#1}{#2}%
18778 \pcol@currcol#2\relax
18779 \ifvoid\pcol@ccuse{@box}%
18780 \@next\@currbox\@freelist{}\pcol@ovf
18781 \pcol@ccxdef{\@currbox}%
18782 \fi
18783 \global\setbox\pcol@ccuse{@box}\vbox{\let\set@color\pcol@set@color
18784 \let\aftergroup\@gobble #1}%
18785 \fi\fi
18786 \endgroup
18787 \fi\fi
18788 \ignorespaces}
18789 \def\pcol@iicolumncolor#1#2{{\let\set@color\relax #1%
18790 \expandafter\xdef\csname pcol@columncolor#2\endcsname{\current@color}}}
18791 \def\pcol@scancst@shadow{%
18792 \pcol@ifccdefined{\@elt{\pcol@ccuse{}}}\relax
18793 \pcol@colorstack@shadow}
18794
18795 % \end{macrocode}
18796 % \end{macro}\end{macro}\end{macro}
18797 %
18798 % \KeepSpace{1}
18799 % \begin{macro}{\pcol@mcpushlimit}
18800 % \changes{v1.24}{2013/07/27}
18801 % {Introduced for coloring specified in math mode.}
18802 % \changes{v1.34}{2018/05/07}
18803 % {Move down to place it just before the \cs{def}inition of
18804 % \cs{pcol@set@color@push} being the sole referrer, and change its
18805 % body from 100 to 1000.}
18806 % \begin{macro}{\set@color}
18807 % \begin{macro}{\pcol@set@color}
18808 % \begin{macro}{\pcol@set@color@push}
18809 % \changes{v1.2-1}{2013/05/11}
18810 % {Introduced to work as \cs{set@color}.}
18811 % \changes{v1.22}{2013/06/30}
18812 % {Modified to push color stack by \cs{output} always.}
18813 % \changes{v1.23}{2013/07/08}
18814 % {Add an argument of null \cs{hskip} to \cs{pcol@color@invokeoutput}
18815 % so that the first word of a colored text is hyphenated.}
18816 % \changes{v1.24}{2013/07/27}
18817 % {Add the mechanism special for math mode.}
18818 % \changes{v1.3-6}{2013/09/17}
18819 % {Change the second argument of \cs{pcol@color@invokeoutput} from
18820 % \cs{hskip}\cs{z@} to \cs{pcol@fcwhyphenate} to make null skip
18821 % insertion conditional.}
18822 % \changes{v1.34}{2018/05/07}
18823 % {Completely change its definition according to the new text coloring
18824 % with \cs{insert}.}
18825 % \changes{v1.37}{2025/07/14}
18826 % {Replace \cs{pcol@fcwhyphenate} by \cs{nobreak}\cs{hskip}\cs{z@} to
18827 % always insert unbreakable null skip.}
18828 % 
18829 % The macro \!\pcol@set@color@push! is invoked whenever \LaTeX's
18830 % counterpart \!\set@color! appears in a \env{paracol} environment through
18831 % coloring commands such as \!\color!, because \!\pcol@zparacol! replaces
18832 % \LaTeX's macro with it saving the original version in \!\pcol@set@color!,
18833 % if the original \!\set@color! is not \!\relax! to mean some coloring
18834 % package is in use. This original version is used through
18835 % \!\pcol@set@color! by \!\pcol@bg@paintregion@i!, \!\pcol@output@start! and
18836 % \!\pcol@icolumncolor! besides this macro \!\pcol@set@color@push!,
18837 % while \!\output! lets $\!\set@color!=\!\pcol@set@color!$ for the references
18838 % outside of our control.
18839 %
18840 % The macro at first invokes its original version being \!\pcol@set@color!
18841 % to put an appropriate coloring \!\special! to |.dvi| and reserve the
18842 % invocation of \!\reset@color! by \!\aftergroup!. Then, it performs one of
18843 % two different operations depending on TeX's mode, i.e., math mode or not.
18844 % If we are in math mode and not in a \!\vbox!, at first we increment
18845 % $m=\!\pcol@mcid!$ and examine if $m>\!\pcol@mcpushlimit!=1000$, and if so
18846 % we stop the execution with \!\PackageError!\footnote{
18847 % 
18848 % And let $m=1$ to allow a user to continue the execution bravely.}
18849 % 
18850 % in order to avoid too many macros $|\pcol@reset@color@mpop@|\cdot m$ are
18851 % defined\footnote{
18852 % 
18853 % \SpecialArrayIndex{m}{\pcol@reset@color@mpop@}
18854 % 
18855 % We could make the number of math-mode coloring operations virtually
18856 % unlimited by putting all digits of the decimal representation of $m$
18857 % followed by a terminator by multiple
18858 % \cs{aftergroup}s so that \cs{pcol@reset@color@mpop} is put by
18859 % \cs{aftergroup} prior to them to capture them as its argument, but
18860 % limiting with $2^{31}-1$ is still necessary and that with 1000 is
18861 % reasonable.}.
18862 % 
18863 % Otherwise, i.e., if $m\leq\!\pcol@mcpushlimit!$, we
18864 % reserve the invocation of the macro $|\pcol@reset@color@mpop@|{\cdot}i$
18865 % 
18866 % \SpecialArrayMainIndex{m}{\pcol@reset@color@mpop@}
18867 % 
18868 % for our own pop by \!\aftergroup! defining the macro as
18869 % $\!\pcol@reset@color@mpop!\Arg{m}$. If we are not in math mode, on the
18870 % other hand, and neither in a \!\vbox! nor in restricted horizontal mode,
18871 % we simply reserve the invocation of the macro $\pcol@reset@color@pop$.
18872 %
18873 % Then, regardless that we are in math mode or not, we push the contents of
18874 % \!\current@color!, which \!\set@color! should refer to as the color
18875 % information to be set, into the shadow \colorstack{}
18876 % $\cstshadow=\!\pcol@colorstack@shadow!$ for the stack rewinding\slash
18877 % reestablishing in \!\columncolor! and \!\normalcolumncolor!. Since this
18878 % push is done non-\!\global!ly with \!\edef!, we save\slash restore the
18879 % definition of \!\@elt! to\slash from \Midx{\!\pcol@elt@save!} before\slash
18880 % after the push, respectively\footnote{
18881 % 
18882 % Just in case.}.
18883 % 
18884 % Then we \!\insert! a \!\vbox! through \!\pcol@colorins! for the push of
18885 % $\celt_i$ or $\mcelt_{i,m}$ to $\cstraw$ synchronous with a page break or
18886 % \cswitch{}. The height of the \!\vbox! is 1\,|pt|, depth is 0 and
18887 % width is $m$\,|sp| if we are in math mode or 0 otherwise, and its
18888 % contents is the coloring \!\special! given by \!\pcol@set@color! so that
18889 % the \!\special! is what the macro put at the beginning of this macro but
18890 % without the reservation of \!\reset@color!. After the insertion, we put
18891 % \!\nobreak!\!\hskip!\!\z@!, to split the coloring \!\special!
18892 % from the first colored word so that the word may be hyphenated if we are
18893 % in horizontal mode. If we are in vertical mode, on the other hand, we do
18894 % \!\nobreak! if $\CSIndex{if@nobreak}=\true$ to keep the \!\insert!ion from
18895 % being followed by a page break.
18896 % 
18897 % \begin{macrocode}
18898 \def\pcol@mcpushlimit{1000}
18899 \def\pcol@set@color@push{\pcol@set@color
18900 \ifmmode\else\ifinner \pcol@innertrue \fi\fi
18901 \ifpcol@inner\else
18902 \ifmmode
18903 \global\advance\pcol@mcid\@ne
18904 \ifnum \pcol@mcid>\pcol@mcpushlimit\relax
18905 \PackageError{paracol}{Too many coloring commands in math mode}\@ehb
18906 \global\pcol@mdid\@ne
18907 \fi
18908 \@tempdima\pcol@mcid sp\relax
18909 \expandafter\aftergroup
18910 \csname pcol@reset@color@mpop@\number\pcol@mcid\endcsname
18911 \expandafter\xdef
18912 \csname pcol@reset@color@mpop@\number\pcol@mcid\endcsname
18913 {\noexpand\pcol@reset@color@mpop{\number\pcol@mcid}}%
18914 \else
18915 \aftergroup\pcol@reset@color@pop \@tempdima\z@
18916 \fi
18917 \let\pcol@elt@save\@elt \let\@elt\relax
18918 \edef\pcol@colorstack@shadow{\pcol@colorstack@shadow\@elt{\current@color}}%
18919 \let\@elt\pcol@elt@save
18920 \setbox\@tempboxa\vbox{\let\aftergroup\@gobble \pcol@set@color}%
18921 \ht\@tempboxa1sp \dp\@tempboxa\z@ \wd\@tempboxa\@tempdima
18922 \insert\pcol@colorins{\box\@tempboxa}\ifhmode \nobreak\hskip\z@ \fi
18923 \ifvmode\if@nobreak \nobreak \fi\fi
18924 \fi}
18925
18926 % \end{macrocode}
18927 % \end{macro}\end{macro}\end{macro}\end{macro}
18928 %
18929 % \begin{macro}{\pcol@reset@color@pop}
18930 % \changes{v1.2-1}{2013/05/11}
18931 % {Introduced to work as \cs{reset@color}.}
18932 % \changes{v1.22}{2013/06/30}
18933 % {Modified to pop color stack by \cs{output} and to examine if
18934 % $\cs{ifpcol@output}\EQ\mathit{true}$.}
18935 % \changes{v1.23}{2013/07/08}
18936 % {Add an argument of \cs{relax} to \cs{pcol@color@invokeoutput}
18937 % so that the last word of a colored text is not followed by a line
18938 % break candidate.}
18939 % \changes{v1.34}{2018/05/07}
18940 % {Completely change its definition according to the new text coloring
18941 % with \cs{insert}.}
18942 % \begin{macro}{\pcol@reset@color@mpop}
18943 % \changes{v1.24}{2013/07/27}
18944 % {Introduced for coloring specified in math mode.}
18945 % \changes{v1.34}{2018/05/07}
18946 % {Completely change its definition according to the new text coloring
18947 % with \cs{insert}.}
18948 % 
18949 % The macro \!\pcol@reset@color@pop! and its math-mode relative
18950 % $\!\pcol@reset@color@mpop!\~\Arg{m}$ are invoked by
18951 % \!\aftergroup! mechanism in \!\pcol@set@color@push!, directly for the
18952 % former and through the macro $|\pcol@reset@color@mpop@|{\cdot}m$
18953 % 
18954 % \SpecialArrayIndex{m}{\pcol@reset@color@mpop@}
18955 % 
18956 % for the latter. They \!\insert! a \!\vbox! for $\celtpop_i$ or
18957 % $\mceltpop_{i,m}$ to add it to $\cstraw$ synchronously with a page break
18958 % or \cswitch{}. Therefore, the height and depth of the \!\vbox! are 0 and
18959 % width is 0 for $\celtpop_i$ or $m$\,|sp| for $\mceltpop_{i,m}$. The
18960 % contents of the \!\vbox! is an uncoloring \!\special! given by
18961 % \!\reset@color! but this is done just for debugging to show what
18962 % \!\pcol@colorins! has by, for example, \!\pcol@ShowBox!. Then if we are
18963 % in vertical mode and $\CSIndex{if@nobreak}=\true$, we do \!\nobreak! to
18964 % keep the \!\insert!ion from being followed by a page break even in
18965 % \!\pcol@reset@color@mpop! because its corresponding
18966 % \!\pcol@set@color@push! may have been in a displayed math construct after
18967 % which we are in vertical mode.
18968 %
18969 % One caution is that \!\pcol@reset@color@pop! can be invoked outside the
18970 % \env{paracol} environment in which the corresponding
18971 % \!\pcol@set@color@push! appears. In this case with
18972 % $\CSIndex{ifpcol@output}=\false$, we don't need to do the pop operation
18973 % and cannot make the \!\insert!ion for it because \!\output! is not for
18974 % \env{paracol}.
18975 % 
18976 % \begin{macrocode}
18977 \def\pcol@reset@color@pop{%
18978 \ifpcol@output
18979 \setbox\@tempboxa\vbox{\reset@color}%
18980 \ht\@tempboxa\z@ \dp\@tempboxa\z@ \wd\@tempboxa\z@
18981 \insert\pcol@colorins{\box\@tempboxa}%
18982 \ifvmode\if@nobreak \nobreak \fi\fi
18983 \fi}
18984 \def\pcol@reset@color@mpop#1{%
18985 \setbox\@tempboxa\vbox{\reset@color}%
18986 \ht\@tempboxa\z@ \dp\@tempboxa\z@ \wd\@tempboxa#1sp\relax
18987 \insert\pcol@colorins{\box\@tempboxa}%
18988 \ifvmode\if@nobreak \nobreak \fi\fi
18989 }
18990
18991 % \end{macrocode}
18992 % \end{macro}\end{macro}
18993 %
18994 % \changes{v1.22}{2013/06/30}
18995 % {\cs{pcol@color@invokeoutput} was introduced for \cs{output}
18996 % request for coloring but removed in v1.34.}
18997 % \changes{v1.23}{2013/07/08}
18998 % {\cs{pcol@color@invokeoutput} was modified to add second argument
18999 % $s$ to insert a null skip after \cs{vadjust} only when the macro is
19000 % invoked from \cs{pcol@set@color@push} in horizontal mode.}
19001 % \changes{v1.34}{2018/05/07}
19002 % {\cs{pcol@color@invokeoutput} is removed according to the change of
19003 % text coloring from \cs{output} to \cs{insert}.}
19004 % \changes{v1.22}{2013/06/30}
19005 % {\cs{pcol@color@invokeoutput@v} was introduced for \cs{output}
19006 % request for coloring but removed in v1.34.}
19007 % \changes{v1.34}{2018/05/07}
19008 % {\cs{pcol@color@invokeoutput@v} is removed according to the change of
19009 % text coloring from \cs{output} to \cs{insert}.}
19010 %
19011 %
19012 % \KeepSpace{1}
19013 % \changes{v1.3-6}{2013/09/17}
19014 % {Introduced \cs{pcol@fcwhyphenate} to enable null skip insertion before
19015 % the first word after a coloring command not always but conditionally.}
19016 % \changes{v1.37}{2025/07/14}
19017 % {Removed \cs{pcol@fcwhyphenate}, due to an extra \cs{nobreak} before the
19018 % zero-width space fixing the issue, \cs{pcol@fcwhyphenate} was intended
19019 % to solve. Fixes \href{https://codeberg.org/mgkurtz/paracol/issues/9}
19020 % {issue \# 9}.}
19021 % \begin{macro}{\coloredwordhyphenated}
19022 % \changes{v1.3-6}{2013/09/17}
19023 % {Introduced to enable null skip insertion before the first word
19024 % after a coloring command not always but conditionally.}
19025 % \changes{v1.37}{2025/07/14}
19026 % {Changed to a no-op plus info with \cs{pcol@fcwhyphenate} gone.}
19027 % \begin{macro}{\nocoloredwordhyphenated}
19028 % \changes{v1.3-6}{2013/09/17}
19029 % {Introduced to disable null skip insertion before the first word
19030 % after a coloring command.}
19031 % \changes{v1.37}{2025/07/14}
19032 % {Changed to a no-op plus info with \cs{pcol@fcwhyphenate} gone.}
19033 % 
19034 % \begin{macrocode}
19035 \def\coloredwordhyphenated{\PackageNoteNoLine{paracol}{The commands
19036 \string\coloredwordhyphenated and \string\nocoloredwordhyphenated
19037 are not necessary anymore and now have no effect besides logging
19038 this note.}}
19039 \let\nocoloredwordhyphenated\coloredwordhyphenated
19040 % \end{macrocode}
19041 % \end{macro}\end{macro}
19042 %
19043 %
19044 %
19045 % \KeepSpace{8}
19046 % \section{Commands for Column-Separating Rule Color and Background Painting}
19047 % \label{sec:imp-commbg}
19048 % \changes{v1.3-3}{2013/09/17}
19049 % {Add the subsection ``Commands for Column-Separating Rule Color and
19050 % Background Painting'' to describe newly
19051 % introduced API macros to specify colors of column-separating rules
19052 % and background painting.}
19053 %
19054 % \begin{macro}{\colseprulecolor}
19055 % \changes{v1.3-3}{2013/09/17}
19056 % {Introduced to specify the colors of column-separating rules.}
19057 % \begin{macro}{\pcol@defcseprulecolor@x}
19058 % \changes{v1.3-3}{2013/09/17}
19059 % {Introduced to implement \cs{colseprulecolor}.}
19060 % \begin{macro}{\pcol@defcseprulecolor@y}
19061 % \changes{v1.3-3}{2013/09/17}
19062 % {Introduced to implement \cs{colseprulecolor}.}
19063 % \begin{macro}{\pcol@defcseprulecolor}
19064 % \changes{v1.3-3}{2013/09/17}
19065 % {Introduced to implement \cs{colseprulecolor}.}
19066 % \begin{macro}{\normalcolseprulecolor}
19067 % \changes{v1.3-3}{2013/09/17}
19068 % {Introduced to specify that color of column-separating rules is normal.}
19069 % \begin{macro}{\pcol@defcseprulecolor@i}
19070 % \changes{v1.3-3}{2013/09/17}
19071 % {Introduced to implement \cs{colseprulecolor} and
19072 % \cs{normalcolseprulecolor}.}
19073 % \begin{macro}{\pcol@colseprulecolor}
19074 % \changes{v1.3-3}{2013/09/17}
19075 % {Introduced to keep the color for all column-separating rules.}
19076 % 
19077 % The macro \!\colseprulecolor!\oarg{mode}\marg{color}$|[|c|]|$ \!\def!ines
19078 % \!\pcol@colseprulecolor! to have the $\arg{color}$ optionally with
19079 % coloring $\arg{mode}$ of all \cseprule{}s if the optional argument $c$ is
19080 % not provided, or $|\pcol@colseprulecolor|{\cdot}c$
19081 % 
19082 % \SpecialArrayMainIndex{c}{\pcol@colseprulecolor}
19083 % 
19084 % that of the rule drawn between a particular column pair $c$ and $c+1$.
19085 % After \!\def!ining \Midx{\!\pcol@colorcommand!} to be \!\colseprulecolor!
19086 % in case we have to give a warning, the macro invokes
19087 % \!\pcol@defcseprulecolor@x!\oarg{mode}\marg{color} or
19088 % \!\pcol@defcseprulecolor@y!\marg{color} according to the provision of the
19089 % optional argument $\arg{mode}$ to invoke \!\pcol@defcseprulecolor! with
19090 % argument \marg{cmd}${}={}$\!\color!\oarg{mode}\marg{color} so that this
19091 % macro invokes $\!\pcol@defcseprulecolor@i!\ARg{cmd}|[|c|]|$ where
19092 % $c=\emptyset$ if the optional argument $c$ is not provided.
19093 %
19094 % The macro $\!\normalcolseprulecolor!|[|c|]|$, on the other hand, defines
19095 % $|\pcol@colseprule|\~|color|[{\cdot}c]$
19096 % 
19097 % \SpecialArrayIndex{c}{\pcol@colseprulecolor}
19098 % \SpecialIndex{\pcol@colseprulecolor}
19099 % 
19100 % with whatever \!\normalcolor! gives, and thus it invokes
19101 % \!\pcol@defcseprulecolor@i! letting $\arg{cmd}=\!\normalcolor!$, after
19102 % \!\def!ining \!\pcol@colorcommand! to be \!\normalcolsep~rule~color!.
19103 %
19104 % The macro $\!\pcol@defcseprulecolor@i!\ARg{cmd}|[|c|]|$ examines if
19105 % $\!\set@color!=\!\relax!$ to mean no coloring packages have been loaded
19106 % and, if so, do nothing giving a warning the command in
19107 % \!\pcol@colorcommand! is not effective. Otherwise, we examine if
19108 % $\arg{cmd}$ has proper arguments by invoking it but temporally nullifying
19109 % \!\set@color! and then \!\def!ine $|\pcol@colseprulecolor|[{\cdot}c]$
19110 % 
19111 % \SpecialArrayIndex{c}{\pcol@colseprulecolor}
19112 % \SpecialIndex{\pcol@colseprulecolor}
19113 % 
19114 % to be $\arg{cmd}$.
19115 %
19116 % Note that at the top level we \!\def!ine \!\pcol@colseprulecolor! to be
19117 % \!\normalcolor! to give the default for all \cseprule{}s. Also note that
19118 % macros $|\pcol@colseprulecolor|{\cdot}c$
19119 % 
19120 % \SpecialArrayIndex{c}{\pcol@colseprulecolor}
19121 % 
19122 % are referred to solely in \!\pcol@hfil!
19123 % which also uses \!\pcol@colseprulecolor! for columns for which
19124 % $|\pcol@colseprulecolor|{\cdot}c$
19125 % 
19126 % \SpecialArrayIndex{c}{\pcol@colseprulecolor}
19127 % 
19128 % is not defined.
19129 % 
19130 % \begin{macrocode}
19131 %% Commands for Column-Separating Rule Color and Background Painting
19132
19133 \def\colseprulecolor{\def\pcol@colorcommand{\string\colseprulecolor}%
19134 \@ifnextchar[%]
19135 \pcol@defcseprulecolor@x\pcol@defcseprulecolor@y}
19136 \def\pcol@defcseprulecolor@x[#1]#2{\pcol@defcseprulecolor{\color[#1]{#2}}}
19137 \def\pcol@defcseprulecolor@y#1{\pcol@defcseprulecolor{\color{#1}}}
19138 \def\pcol@defcseprulecolor#1{\@ifnextchar[%]
19139 {\pcol@defcseprulecolor@i{#1}}{\pcol@defcseprulecolor@i{#1}[]}}
19140 \def\normalcolseprulecolor{%
19141 \def\pcol@colorcommand{\string\normalcolseprulecolor}%
19142 \@ifnextchar[%]
19143 {\pcol@defcseprulecolor@i\normalcolor}%
19144 {\pcol@defcseprulecolor@i\normalcolor[]}}
19145 \def\pcol@defcseprulecolor@i#1[#2]{%
19146 \ifx\set@color\relax
19147 \PackageWarning{paracol}{\pcol@colorcommand\space is not effective
19148 without some coloring package}%
19149 \else
19150 {\let\set@color\relax #1}%
19151 \global\@namedef{pcol@colseprulecolor#2}{#1}%
19152 \fi}
19153 \gdef\pcol@colseprulecolor{\normalcolor}
19154
19155 % \end{macrocode}
19156 % \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
19157 %
19158 % \KeepSpace{8}
19159 % \begin{macro}{\backgroundcolor}
19160 % \changes{v1.3-3}{2013/09/17}
19161 % {Introduced to define colors for background painting.}
19162 % \begin{macro}{\nobackgroundcolor}
19163 % \changes{v1.3-3}{2013/09/17}
19164 % {Introduced to undefine colors for background painting.}
19165 % \begin{macro}{\pcol@backgroundcolor@e}
19166 % \changes{v1.3-3}{2013/09/17}
19167 % {Introduced to implement \cs{backgroundcolor} and
19168 % \cs{nobackgroundcolor}.}
19169 % \begin{macro}{\pcol@backgroundcolor}
19170 % \changes{v1.3-3}{2013/09/17}
19171 % {Introduced to implement \cs{backgroundcolor} and
19172 % \cs{nobackgroundcolor}.}
19173 % \changes{v1.31}{2013/10/10}
19174 % {Fix the misspelling ``colorling'' in the error message.}
19175 % \begin{macro}{\pcol@backgroundcolor@i}
19176 % \changes{v1.3-3}{2013/09/17}
19177 % {Introduced to implement \cs{backgroundcolor} and
19178 % \cs{nobackgroundcolor}.}
19179 % \begin{macro}{\pcol@bg@region}
19180 % \changes{v1.3-3}{2013/09/17}
19181 % {Introduced to implement \cs{backgroundcolor} and
19182 % \cs{nobackgroundcolor}.}
19183 % \begin{macro}{\pcol@backgroundcolor@ii}
19184 % \changes{v1.3-3}{2013/09/17}
19185 % {Introduced to implement \cs{backgroundcolor} and
19186 % \cs{nobackgroundcolor}.}
19187 % \begin{macro}{\pcol@backgroundcolor@iii}
19188 % \changes{v1.3-3}{2013/09/17}
19189 % {Introduced to implement \cs{backgroundcolor}.}
19190 % \begin{macro}{\pcol@backgroundcolor@iv}
19191 % \changes{v1.3-3}{2013/09/17}
19192 % {Introduced to implement \cs{backgroundcolor}.}
19193 % \begin{macro}{\pcol@backgroundcolor@v}
19194 % \changes{v1.3-3}{2013/09/17}
19195 % {Introduced to implement \cs{backgroundcolor}.}
19196 % 
19197 % {\nosv\gdef\|{\;|\;}}
19198 % \def\fdef{f_{\mathit{def}}}
19199 % 
19200 % The macro
19201 % \!\backgroundcolor!\marg{region}\oarg{mode}\marg{color}
19202 % defines the $\arg{color}$ optionally with $\arg{mode}$ of the
19203 % $\arg{region}$ whose syntax is specified as follows.
19204 % 
19205 % % \begin{eqnarray*}
19206 % \arg{region}&{:}{:}{=}&\arg{regionid}\arg{extension}\\
19207 % \arg{regionid}&{:}{:}{=}&\<a\>\|\arg{corg}|[|c|]|\\
19208 % \arg{a}&{:}{:}{=}&\arg{corg}\||s|\||S|\||t|\||T|\||l|\||L|\||r|\||R|\|
19209 % |f|\||F|\||n|\||N|\||p|\||P|\\
19210 % \arg{corg}&{:}{:}{=}&|c|\||C|\||g|\||G|\\
19211 % \arg{extension}&{:}{:}{=}&\emptyset\||(|x_0|,|y_0|)|\|
19212 % |(|x_0|,|y_0|)(|x_1|,|y_1|)|
19213 % \end{eqnarray*}
19214 % % 
19215 % On the other hand, the counterpart macro
19216 % \!\nobackgroundcolor!\marg{region} undefines the color of $\arg{region}$.
19217 % Both macros invoke \!\pcol@backgroundcolor! giving all arguments to it to
19218 % parse the argument $\arg{region}$, after letting
19219 % $\fdef=\CSIndex{if@tempswa}=\true$ and
19220 % $\!\pcol@backgroundcolor@e!=\!\pcol@backgroundcolor@w!$ in
19221 % \!\backgroundcolor!, or $\fdef=\CSIndex{if@tempswa}=\true$ and
19222 % $\!\pcol@backgroundcolor@e!=\!\pcol@backgroundcolor@z!$ in
19223 % \!\nobackgroundcolor!. Note that the \!\let!-assignment to
19224 % \!\pcol@backgroundcolor@e! is effective when we found an error in the
19225 % parse of the argument $\arg{region}$ to throw away what remains in the
19226 % argument unprocessed and, for \!\backgroundcolor!, the other arguments
19227 % \oarg{mode}\marg{color}.
19228 %
19229 % Then the macro \!\pcol@backgroundcolor! examines if $|\pcol@bg@@|{\cdot}a$
19230 % 
19231 % \SpecialArrayIndex{a}{\pcol@bg@@}
19232 % 
19233 % is defined, and if not, raises an error that $a$ is invalid and then, in case
19234 % the user dare to continue the execution, invokes
19235 % \!\pcol@backgroundcolor@e! to throw all arguments away after letting
19236 % $a'=\!\pcol@bg@region!=|xx|$ so that the undefining
19237 % $|\pcol@bg@color|{\cdot}a'$ does not cause any troubles.
19238 % 
19239 % \SpecialArrayIndex{a}{\pcol@bg@color@}
19240 % \SpecialArrayIndex{a{\cdot}\string\texttt{@}{\cdot}c}{\pcol@bg@color@}
19241 % 
19242 % Otherwise, i.e., if $|\pcol@bg@@|{\cdot}a$ is defined, it
19243 % invokes $\!\pcol@backgroundcolor@i!|[|c|]|$ or \!\pcol@backgroundcolor@ii!
19244 % according to the provision of the optional argument $|[|c|]|$, after
19245 % \!\def!ining $a'=\Midx{\!\pcol@bg@region!}$ to be $a$. Then
19246 % \!\pcol@backgroundcolor@i! examines if \!\pcol@bg@may~have~col@!${\cdot}a$
19247 % 
19248 % \SpecialIndex{\pcol@bg@mayhavecol@c}\SpecialIndex{\pcol@bg@mayhavecol@C}
19249 % \SpecialIndex{\pcol@bg@mayhavecol@g}\SpecialIndex{\pcol@bg@mayhavecol@G}
19250 % 
19251 % is defined, and if not, raises an error again in a similar way, or
19252 % otherwise invokes \!\pcol@backgroundcolor@ii! after re\!\def!ining
19253 % $a'=a{\cdot}|@|{\cdot}c$.
19254 %
19255 % Then if $\fdef=\true$, the macro \!\pcol@backgroundcolor@ii! examines if
19256 % $\!\set@color!=\!\relax!$, and if so it complains that any coloring
19257 % packages have not been loaded and invokes \!\pcol@backgroundcolor@w! just
19258 % for throwing away optional arguments for \bgext{} and
19259 % \oarg{mode}\marg{color}. Otherwise, i.e., if $\!\set@color!\neq\!\relax!$,
19260 % it invokes \!\pcol@backgroundcolor@iii! after adding $a'$ to the tail of
19261 % \!\pcol@bg@defined!. On the other hand if $\fdef=\false$, it invokes
19262 % \!\pcol@backgroundcolor@z! without checking the availability of coloring
19263 % macros.
19264 %
19265 % The macro \!\pcol@backgroundcolor@iii! at first invokes
19266 % $\!\pcol@bg@defext!\Arg{d}\Arg{e}$ with $e=0$ for all
19267 % $d\in\{|l|,|r|,|t|,|b|\}$ to have default (no) \bgext{}s. Then if
19268 % $|(|x_0|,|y_0|)|$ is provided, \!\pcol@bg@defext! is invoked again by
19269 % \!\pcol@backgroundcolor@iv! for all
19270 % $d\in\{|l|,|r|,|t|,|b|\}$ but with $e=x_0$ for
19271 % $d\in\{|l|,|r|\}$ and with $e=y_0$ for $d\in\{|t|,|b|\}$.
19272 % Further, if % $|(|x_1|,|y_1|)|$ is also provided, \!\pcol@bg@defext! is
19273 % invoked once again by \!\pcol@backgroundcolor@v! for all
19274 % $(d,e)\in\{(|r|,x_1),(|b|,y_1)\}$. Finally \!\pcol@backgroundcolor@v!
19275 % invokes \!\pcol@backgroundcolor@x!, which is also invoked from
19276 % \!\pcol@backgroundcolor@iii! and \!\pcol@backgroundcolor@iv! if they find no
19277 % (further) \bgext{}s.
19278 % 
19279 % \begin{macrocode}
19280 \def\backgroundcolor#1{\@tempswatrue
19281 \let\pcol@backgroundcolor@e\pcol@backgroundcolor@w
19282 \pcol@backgroundcolor#1\@nil}
19283 \def\nobackgroundcolor#1{\@tempswafalse
19284 \let\pcol@backgroundcolor@e\pcol@backgroundcolor@z
19285 \pcol@backgroundcolor#1\@nil}
19286 \def\pcol@backgroundcolor#1{%
19287 \@ifundefined{pcol@bg@@#1}%
19288 {\PackageError{paracol}%
19289 {Invalid background coloring region identifier #1}%
19290 \def\pcol@bg@region{xx}\pcol@backgroundcolor@e}%
19291 {\def\pcol@bg@region{#1}%
19292 \@ifnextchar[%]
19293 \pcol@backgroundcolor@i \pcol@backgroundcolor@ii}}
19294 \def\pcol@backgroundcolor@i[#1]{%
19295 \@ifundefined{pcol@bg@mayhavecol@\pcol@bg@region}%
19296 {\PackageError{paracol}%
19297 {Column number \number#1 is not effective for background coloring region
19298 \pcol@bg@region}%
19299 \def\pcol@bg@region{xx}\pcol@backgroundcolor@e}%
19300 {\edef\pcol@bg@region{\pcol@bg@region @#1}%
19301 \pcol@backgroundcolor@ii}}
19302 \def\pcol@backgroundcolor@ii{%
19303 \if@tempswa
19304 \ifx\set@color\relax
19305 \PackageWarning{paracol}{\string\backgroundcolor\space is not effective
19306 without some coloring package}%
19307 \let\reserved@b\pcol@backgroundcolor@w
19308 \else
19309 \let\reserved@b\pcol@backgroundcolor@iii
19310 \@cons\pcol@bg@defined{{\pcol@bg@region}}%
19311 \fi
19312 \else
19313 \let\reserved@b\pcol@backgroundcolor@z
19314 \fi
19315 \reserved@b}
19316 \def\pcol@backgroundcolor@iii{%
19317 \pcol@bg@defext{l}\z@ \pcol@bg@defext{r}\z@
19318 \pcol@bg@defext{t}\z@ \pcol@bg@defext{b}\z@
19319 \@ifnextchar(%)
19320 \pcol@backgroundcolor@iv \pcol@backgroundcolor@x}
19321 \def\pcol@backgroundcolor@iv(#1,#2){%
19322 \pcol@bg@defext{l}{#1}\pcol@bg@defext{r}{#1}%
19323 \pcol@bg@defext{t}{#2}\pcol@bg@defext{b}{#2}%
19324 \@ifnextchar(%)
19325 \pcol@backgroundcolor@v \pcol@backgroundcolor@x}
19326 \def\pcol@backgroundcolor@v(#1,#2){%
19327 \pcol@bg@defext{r}{#1}\pcol@bg@defext{b}{#2}%
19328 \pcol@backgroundcolor@x}
19329 % \end{macrocode}
19330 % \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
19331 % \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
19332 % 
19333 % \begin{macro}{\pcol@backgroundcolor@x}
19334 % \changes{v1.3-3}{2013/09/17}
19335 % {Introduced to implement \cs{backgroundcolor}.}
19336 % \begin{macro}{\pcol@backgroundcolor@y}
19337 % \changes{v1.3-3}{2013/09/17}
19338 % {Introduced to implement \cs{backgroundcolor}.}
19339 % 
19340 % The macro \!\pcol@backgroundcolor@x! is used in
19341 % \!\pcol@backgroundcolor@iii!, \!\pcol@backgroundcolor@iv! and
19342 % \!\pcol@backgroundcolor@v! to define the color for \bgpaint{} of the
19343 % region $a'=\!\pcol@bg@region!$. Since the macro is followed by the
19344 % arguments \oarg{mode}\marg{color} of \!\backgroundcolor!, the macro
19345 % invokes \!\color! to let it \!\def!ine \!\current@color! but without real
19346 % coloring operations by letting
19347 % \!\set@color!${}={}$\!\pcol@backgroundcolor@y!. Therefore
19348 % \!\pcol@backgroundcolor@y! is invoked in \!\color! and it \!\xdef!ines
19349 % $|\pcol@bg@colpr|{\cdot}a'$ to let it have whatever \!\current@color! has.
19350 % 
19351 % \SpecialArrayIndex{a}{\pcol@bg@color@}
19352 % \SpecialArrayIndex{a{\cdot}\string\texttt{@}{\cdot}c}{\pcol@bg@color@}
19353 % 
19354 % \begin{macrocode}
19355 \def\pcol@backgroundcolor@x#1\@nil{\begingroup
19356 \let\set@color\pcol@backgroundcolor@y \color}
19357 \def\pcol@backgroundcolor@y{%
19358 \expandafter\xdef\csname pcol@bg@color@\pcol@bg@region\endcsname
19359 {\current@color}%
19360 \endgroup}
19361 % \end{macrocode}
19362 % \end{macro}\end{macro}
19363 %
19364 % \KeepSpace{2}
19365 % \begin{macro}{\pcol@backgroundcolor@z}
19366 % \changes{v1.3-3}{2013/09/17}
19367 % {Introduced to implement \cs{nobackgroundcolor}.}
19368 % \begin{macro}{\pcol@backgroundcolor@w}
19369 % \changes{v1.3-3}{2013/09/17}
19370 % {Introduced to implement \cs{backgroundcolor}.}
19371 % \begin{macro}{\pcol@backgroundcolor@wi}
19372 % \changes{v1.3-3}{2013/09/17}
19373 % {Introduced to implement \cs{backgroundcolor} and
19374 % \cs{nobackgroundcolor}.}
19375 % \begin{macro}{\pcol@bg@color@xx}
19376 % \changes{v1.3-3}{2013/09/17}
19377 % {Introduced to implement \cs{backgroundcolor} and
19378 % \cs{nobackgroundcolor}.}
19379 % 
19380 % The macro \!\pcol@backgroundcolor@z! is invoked from
19381 % \!\pcol@backgroundcolor@ii! directly to work for \!\nobackgroundcolor! to
19382 % disable the \bgpaint{} for a region $a'=\!\pcol@bg@region!$, or from
19383 % \!\pcol@backgroundcolor! and \!\pcol@backgroundcolor@i! through
19384 % \!\pcol@backgroundcolor@e! when they find an error in the argument
19385 % $\arg{region}$ of \!\nobackground~color!. Similarly the macro
19386 % \!\pcol@backgroundcolor@w! is invoked from \!\pcol@background~color@ii!
19387 % directly when it finds no coloring packages have not been loaded, or
19388 % \!\pcol@backgroundcolor! and \!\pcol@backgroundcolor@i! through
19389 % \!\pcol@backgroundcolor@e! on error too but in the argument of
19390 % \!\backgroundcolor!. Both macros throw away whatever remains in
19391 % $\arg{region}$ unprocessed and then invoke \!\pcol@backgroundcolor@wi!,
19392 % but \!\pcol@backgroundcolor@z! gives it a dummy argument pair, while
19393 % \!\pcol@backgroundcolor@w! passes \oarg{mode}\marg{color} to it.
19394 %
19395 % Then \!\pcol@backgroundcolor@wi! throw all arguments away and lets
19396 % $|\pcol@bg@color@|{\cdot}a'\~=\!\relax!$ so that the region $a'$ is
19397 % untouched in \bgpaint{} macros. Note that since
19398 % $a'=|xx|$ being an absolutely non-existent region when this macro is used
19399 % for error recovery, undefining \!\pcol@bg@color@xx! is not harmful.
19400 % 
19401 % \begin{macrocode}
19402 \def\pcol@backgroundcolor@z#1\@nil{\pcol@backgroundcolor@wi[]{}}
19403 \def\pcol@backgroundcolor@w#1\@nil{\@ifnextchar[%]
19404 \pcol@backgroundcolor@wi{\pcol@backgroundcolor@wi[]}}
19405 \def\pcol@backgroundcolor@wi[#1]#2{%
19406 \expandafter\global\expandafter\let
19407 \csname pcol@bg@color@\pcol@bg@region\endcsname\relax}
19408
19409 % \end{macrocode}
19410 % \end{macro}\end{macro}\end{macro}\end{macro}
19411 %
19412 % \KeepSpace{2}
19413 % \begin{macro}{\pcol@bg@mayhavecol@c}
19414 % \changes{v1.3-3}{2013/09/17}
19415 % {Introduced to implement \cs{backgroundcolor} and
19416 % \cs{nobackgroundcolor}.}
19417 % \begin{macro}{\pcol@bg@mayhavecol@C}
19418 % \changes{v1.3-3}{2013/09/17}
19419 % {Introduced to implement \cs{backgroundcolor} and
19420 % \cs{nobackgroundcolor}.}
19421 % \begin{macro}{\pcol@bg@mayhavecol@g}
19422 % \changes{v1.3-3}{2013/09/17}
19423 % {Introduced to implement \cs{backgroundcolor} and
19424 % \cs{nobackgroundcolor}.}
19425 % \begin{macro}{\pcol@bg@mayhavecol@G}
19426 % \changes{v1.3-3}{2013/09/17}
19427 % {Introduced to implement \cs{backgroundcolor} and
19428 % \cs{nobackgroundcolor}.}
19429 % 
19430 % The macros $|\pcol@bg@mayhavecol@|{\cdot}a$ where $a\in\{|c|,|C|,|g|,|G|\}$
19431 % are used in \!\pcol@background~color@i! when the region specifier $a$ in
19432 % $\arg{region}$ argument of \!\backgroundcolor! or \!\noback~groundcolor! is
19433 % followed by optional $|[|c|]|$, so that the invoker macro examines if $a$
19434 % can have the optional column ordinal.
19435 % 
19436 % \SpecialArrayMainIndex{a}{\pcol@bg@mayhavecol@}
19437 % 
19438 % Therefore, the macros just need not to be \!\relax! and thus commonly have
19439 % empty bodies.
19440 % 
19441 % \begin{macrocode}
19442 \def\pcol@bg@mayhavecol@c{}
19443 \def\pcol@bg@mayhavecol@C{}
19444 \def\pcol@bg@mayhavecol@g{}
19445 \def\pcol@bg@mayhavecol@G{}
19446
19447 % \end{macrocode}
19448 % \end{macro}\end{macro}\end{macro}\end{macro}
19449 %
19450 % \begin{macro}{\pcol@bg@defext}
19451 % \changes{v1.3-3}{2013/09/17}
19452 % {Introduced to implement \cs{backgroundcolor}.}
19453 % The macro $\!\pcol@bg@defext!\Arg{d}\Arg{e}$ is used by
19454 % \!\pcol@backgroundcolor@iii!,
19455 % \!\pcol@back~groundcolor@iv! and \!\pcol@backgroundcolor@v! to \!\def!ine
19456 % $|\pcol@bg@ext@|{\cdot}d{\cdot}|@|{\cdot}a'$ be $e=0$ for all
19457 % $d\in\{|l|,|r|,|t|,|b|\}$ in the first, be $e=x_0$ for $d\in\{|l|,|r|\}$
19458 % and $e=y_0$ for $d\in\{|t|,|b|\}$ in the second, and be $e=x_0$, $x_1$,
19459 % $y_0$ and $y_1$ for $d$ being |l|, |r|, |t|, |b| respectively in the last.
19460 % 
19461 % \SpecialArrayMainIndex{d{\cdot}\string\texttt{@}{\cdot}a}{\pcol@bg@ext@}
19462 % \SpecialArrayMainIndex
19463 % {d{\cdot}\string\texttt{@}{\cdot}a{\cdot}\string\texttt{@}{\cdot}c}
19464 % {\pcol@bg@ext@}
19465 % 
19466 % The macro at first lets \!\@tempdima! have $e$ to confirm $e$ is a proper
19467 % dimension and then \!\xdef!ines
19468 % $|\pcol@bg@ext@|{\cdot}d{\cdot}|@|{\cdot}a'$ to let it have the integer
19469 % representation of $e$ followed by |sp|.
19470 % 
19471 % \SpecialArrayMainIndex{d{\cdot}\string\texttt{@}{\cdot}a}{\pcol@bg@ext@}
19472 % \SpecialArrayMainIndex
19473 % {d{\cdot}\string\texttt{@}{\cdot}a{\cdot}\string\texttt{@}{\cdot}c}
19474 % {\pcol@bg@ext@}
19475 % 
19476 % 
19477 % \begin{macrocode}
19478 \def\pcol@bg@defext#1#2{%
19479 \@tempdima#2\relax
19480 \expandafter\xdef\csname pcol@bg@ext@#1@\pcol@bg@region\endcsname{%
19481 \number\@tempdima sp}}
19482
19483 % \end{macrocode}
19484 % \end{macro}
19485 %
19486 % \begin{macro}{\resetbackgroundcolor}
19487 % \changes{v1.3-3}{2013/09/17}
19488 % {Introduced to disable background-painting for all regions.}
19489 % \begingroup \let\SMALL\small \let\small\footnotesize
19490 % \begin{macro}{\pcol@resetbackgroundcolor}
19491 % \changes{v1.3-3}{2013/09/17}
19492 % {Introduced to implement \cs{resetbackgroundcolor}.}
19493 % \let\small\SMALL
19494 % \begin{macro}{\pcol@bg@defined}
19495 % \changes{v1.3-3}{2013/09/17}
19496 % {Introduced to implement \cs{resetbackgroundcolor}.}
19497 % 
19498 % The API macro \!\resetbackgroundcolor! disables \bgpaint{} of all regions
19499 % whose colors have been specified by \!\backgroundcolor!. Since the region
19500 % specifiers $a'_1$, $a'_2$, \ldots, $a'_n$ for which \bgpaint{} is specified
19501 % are recorded in $\!\pcol@bg@defined!=
19502 % \!\@elt!\Arg{a'_1}\!\@elt!\Arg{a'_2}\cdots\!\@elt!\Arg{a'_n}$ by
19503 % \!\pcol@backgroundcolor!, the macro invokes \!\pcol@bg@defined!
19504 % temporarily letting $\!\@elt!=\!\pcol@resetbackgroundcolor!$ to let
19505 % $|\pcol@bg@|\~|color@|{\cdot}a'_i$ be \!\relax! for all $i\in[1,n]$, and
19506 % clears \!\pcol@bg@defined!, whose initial state is also empty.
19507 % 
19508 % \SpecialArrayIndex{a}{\pcol@bg@color@}
19509 % \SpecialArrayIndex{a{\cdot}\string\texttt{@}{\cdot}c}{\pcol@bg@color@}
19510 % 
19511 % \begin{macrocode}
19512 \def\resetbackgroundcolor{{%
19513 \let\@elt\pcol@resetbackgroundcolor \pcol@bg@defined
19514 \gdef\pcol@bgdefined{}}}
19515 \def\pcol@resetbackgroundcolor#1{%
19516 \expandafter\global\expandafter\let\csname pcol@bg@color@#1\endcsname\relax}
19517 \gdef\pcol@bg@defined{}
19518
19519 % \end{macrocode}
19520 % \end{macro}\end{macro}\endgroup\end{macro}
19521 %
19522 %
19523 %
19524 % \section{Closing Environment}
19525 % \label{sec:imp-end}
19526 %
19527 % \begin{macro}{\endparacol}
19528 % \changes{v1.0}{2011/10/10}
19529 % {Replace \cs{par} with \cs{pcol@par}.}
19530 % \changes{v1.2-2}{2013/05/11}
19531 % {Add pre-flushing column height check and footnote counter
19532 % adjustment.}
19533 % \changes{v1.2-5}{2013/05/11}
19534 % {Remove \cs{global} assignment of \cs{hsize} and \cs{linewidth}
19535 % because assignments of them in \string\texttt{paracol} are now
19536 % perfectly local.}
19537 % \changes{v1.31}{2013/10/10}
19538 % {Add saving $c$ into \cs{pcol@lastcol} to let \cs{pcol@output@end}
19539 % know the column visited last.}
19540 % \begin{macro}{\pcol@lastcol}
19541 % \changes{v1.31}{2013/10/10}
19542 % {Introduced to keep the column visited last to pass its typesetting
19543 % parameters to post-environment.}
19544 % 
19545 % The macro \!\endparacol! is invoked from \Endparacol{} to close
19546 % \env{paracol} environment. After making it sure to be in vertical mode by
19547 % \!\pcol@par!, we switch to the column 0 by \!\pcol@switchcol! to let
19548 % \lcounter{} have the values for the column 0 so that they are referred to
19549 % outside the environment, after saving the current column $c$ in
19550 % \!\pcol@lastcol! to be referred to in \!\pcol@output@end! so that
19551 % $\cc_c(\sw)$ and $\cc_c(\ep)$ are passed to \postenv. In \!\pcol@switchcol!,
19552 % we make sure, not to add the preamble for column 0 by checking whether
19553 % \!\pcol@lastcol! is set.
19554 %
19555 % \begin{Sloppy}{1800}
19556 % Then we invoke \!\pcol@flushclear! for \pfcheck{}, turning
19557 % $\CSIndex{ifpcol@lastpage}=\true$ to tell \!\pcol@output@switch! for the
19558 % check that it works on the \lpage, and giving $\bot$ to \!\pcol@flushclear!
19559 % as its argument, unless footnote typesetting is \scfnote{} but not
19560 % \mgfnote{} for which we give $\df$ to ensure all deferred footnotes are
19561 % put in the checking process. Note that the argument for \Mcfnote{}
19562 % typesetting is $\df$ but it is definitely $\bot$ in this mode. After that
19563 % we make an \!\output! request by \!\pcol@invokeoutput! with
19564 % $\!\penalty!=\!\pcol@op@end!$ and still with
19565 % $\CSIndex{ifpcol@lastpage}=\true$ to build the \lpage.
19566 % \end{Sloppy}
19567 %
19568 % Next, we let $\!\columnwidth!=\!\textwidth!$ and
19569 % $\CSIndex{if@twocolumn}=\false$ for single-column typesetting, and also
19570 % let $\!\topskip!=\!\pcol@topskip!$ to make it sure that the parameter has
19571 % the value used outside in \env{paracol} environment. Finally, if the
19572 % \counter{footnote} counter adjustment is required by
19573 % $\CSIndex{ifpcol@fncounteradjustment}=\true$, we let
19574 % $\!\c@footnote!=\bf+\nf$.
19575 % 
19576 % \begin{macrocode}
19577 %% Closing Environment
19578
19579 \def\endparacol{\pcol@par
19580 \edef\pcol@lastcol{\number\pcol@currcol}%
19581 \pcol@nextcol\z@ \pcol@switchcol
19582 \pcol@lastpagetrue
19583 \ifpcol@mgfnote \pcol@flushclear\voidb@x
19584 \else \pcol@flushclear\pcol@topfnotes
19585 \fi
19586 \pcol@invokeoutput\pcol@op@end
19587 \global\columnwidth\textwidth
19588 \global\@twocolumnfalse
19589 \global\topskip\pcol@topskip
19590 \ifpcol@fncounteradjustment
19591 \global\c@footnote\pcol@footnotebase
19592 \global\advance\c@footnote\pcol@nfootnotes
19593 \fi}
19594
19595 % \end{macrocode}
19596 % \end{macro}\end{macro}
19597 %
19598 % \begin{macro}{\pcol@restoreeveryvbox}
19599 % \changes{v1.22}{2013/06/30}
19600 % {Introduced to reflect \cs{global} updates on \cs{everyvbox} in
19601 % \string\texttt{paracol} environments.}
19602 % 
19603 % The macro \!\pcol@restoreeveryvbox! is invoked just after \Endparacol{} by
19604 % \!\aftergroup! mechanism activated by \!\pcol@zparacol!. It examines if
19605 % \!\pcol@everyvbox! has tokens different from \!\pcol@dummytoken! which
19606 % \!\pcol@zparacol! \!\global!ly assigned to the register. Since the dummy
19607 % token cannot be assigned to \!\everyvbox!\footnote{
19608 % 
19609 % Unless a very surprising coincidence happens or a user intentionally
19610 % violates the coherence of the implementation.},
19611 % 
19612 % the difference means the \!\everyvbox! has been \!\global!ly updated with
19613 % the value that \!\pcol@everyvbox! has now. Therefore if so, we
19614 % globally update \!\everyvbox! with \!\pcol@everyvbox! to reflect the
19615 % global update in the environment.
19616 % 
19617 % \begin{macrocode}
19618 \def\pcol@restoreeveryvbox{%
19619 \expandafter\def\expandafter\reserved@a\expandafter{\the\pcol@everyvbox}%
19620 \def\reserved@b{\pcol@dummytoken}%
19621 \ifx\reserved@a\reserved@b\else \global\everyvbox\pcol@everyvbox \fi}
19622 % \end{macrocode}
19623 % \end{macro}
19624 %\iffalse
19625 %</paracol>
19626 %\fi
19627 \endinput
19628
19629  vi: spellcapcheck=[.?]\\_[])'"^I\ ]\\+ spell