Debian Codegraph @

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

raw
1 % \def\oddeven#1#2{\ifodd\value{page}#1\else#2\fi}
2 % \marginparpush5pt \@mparswitchtrue
3 % \section{Two-Sided Typesetting and Parallel-Paging}
4 % \label{sec:ppts}
5 % \changes{v1.3-2}{2013/09/17}
6 % {Add the section ``Two-Sided Typesetting and Parallel-Paging''.}
7 % \changes{v1.3-4}{2013/09/17}
8 % {Add the section ``Two-Sided Typesetting and Parallel-Paging''.}
9 % \changes{v1.3-5}{2013/09/17}
10 % {Add the section ``Two-Sided Typesetting and Parallel-Paging''.}
11 %
12 % This and the next section are typeset with \Uidx{\!\twosided!} enabling
13 % features |p|, |c| and |m| and also |b| for a part of the next section.
14 % The effect of |p| feature can be seen by the \oddeven{left}{right}, or in
15 % other word inside, margin of this \oddeven{odd}{even}-numbered page is
16 % narrower than that of the previous pages because the author reduced the
17 % effective \oddeven{left}{right} side margin being calculated from
18 % \oddeven{\cs{oddsidemargin}}{\cs{evesidemargin}}
19 % 
20 % \SpecialIndex{\oddsidemargin}
21 % \SpecialIndex{\evensidemargin}
22 % 
23 % by 75\,\%\footnote{
24 % 
25 % This document itself does not have |twoside| option in its
26 % \!\documentclass! but the inconsistency between the option and
27 % \!\twosided! is not visible because \!\pagestyle! is |plain|.}.
28 % 
29 % This setting makes the \oddeven{right}{left} side or outside margin of
30 % this page enlarged by 125\,\%, as well as the \oddeven{left}{right} side
31 % and outside margin of the next \oddeven{even}{odd}-numbered page specified
32 % by \oddeven{\cs{evensidemargin}}{\cs{oddsidemargin}}.
33 %
34 % Next, we see the effects of |c| and |m| features by the \env{paracol}
35 % environment below for which \Uidx{\!\columnratio!}|{0.6}| and
36 % \Uidx{\!\marginparthreshold!}|{0}| are declared to make the \emph{inside}
37 % columns (\oddeven{left}{right} ones in \oddeven{odd}{even}-numbered pages)
38 % are wider than the \emph{outside} ones and all marginal notes go to
39 % outside (\oddeven{right}{left} in \oddeven{odd}{even}-numbered pages)
40 % margins.
41 % 
42 % \columnratio{0.6}\marginparthreshold{0}
43 % 
44 % \par\Hrule
45 % \begin{paracol}{2}
46 % \switchcolumn
47 % \footnotetext*{Since the author is temporarily disabling the warning from
48 % marginal note placement mechanism of \LaTeX, pushing down the second
49 % marginal note from column-1 is silently performed when you process this
50 % document.}
51 % \switchcolumn
52 % This line\Marginpar{First marginal note from column-0.} of the first
53 % paragraph of the inside column-0 has a marginal note. Now the author puts
54 % a few dummy lines to keep a space below the marginal note.\\
55 % \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\
56 % \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\par
57 %
58 % This line\Marginpar{Second marginal note from column-0.} of the second
59 % paragraph of the inside column-0 also has a marginal note. Now the author
60 % puts a few dummy lines again but this time to go down to the bottom of the
61 % page.\\
62 % \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\
63 % \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\
64 % \Dotfill\\ \Dotfill\par
65 %
66 % This is the third paragraph of the inside column-0 having a page break in
67 % it. Since shortly we will be in an \oddeven{even}{odd}-numbered page
68 % \pageref{page:ppts2} (now), this wider column\Marginpar{Third marginal
69 % note from column-0} is now \oddeven{right}{left} one keeping it
70 % inside, while the marginal note given in the first line of this page goes
71 % to \oddeven{left}{right} and outside. Now we will have a \!\switchcolumn!
72 % below this paragraph to go to the column-1 and back to the previous page
73 % \pageref{sec:ppts}.\label{page:ppts2}
74 % \switchcolumn
75 % \it
76 % This is the first paragraph in the narrower, italicized and outside
77 % column-1. In this paragraph, we shortly have a marginal note, italicized
78 % too, which goes to the outside margin shared by all marginal notes from
79 % both columns.\Marginpar{\it First marginal note from column-1.} The
80 % marginal note given here is placed its natural position and its first line
81 % is aligned to the first line of the second sentence of this paragraph by
82 % exploitation of the space between two marginal notes from the column-0,
83 % though we already have had three notes from the column.
84 %
85 % Now\Marginpar{\it Second marginal note from column-1.} the author puts
86 % another marginal note whose first line would be aligned to that of this
87 % paragraph, but it is pushed down below the second marginal note from the
88 % column-0 because two notes conflict with each other over the
89 % space\footnotemark*[+0]. Note that since the note from this column is given
90 % \emph{after} that from the column-0 was given, the conflict is solved
91 % pushing the note from this column down rather than that from the
92 % column-0. Now the author puts a few dummy lines to go to the second last
93 % line of this page.\\
94 % \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\
95 % \Dotfill\par
96 %
97 % This is the third paragraph of the outside column-1, which becomes
98 % \oddeven{left}{right} shortly by the page break.\Marginpar{\it Third
99 % marginal note from column-1.} The third marginal note is given in the
100 % first line of this page, but it is pushed down again due to the conflict
101 % with the note from the column-0.
102 % \end{paracol}
103 % \Hrule
104 %
105 % Note that the position of the last marginal note in the \env{paracol}
106 % \Marginpar{Marginal note given after \env{paracol} environment is closed.}
107 % environment which we just have closed affects the marginal note placement
108 % in \postenv. For example, the marginal note given in the first line of
109 % this paragraph is pushed down.
110 %
111 % \ifodd\value{page}
112 % We will see a few examples of \parapag{}ing shortly, but before that we
113 % will have an intentional black page to make the first page of the example
114 % odd-numbered to avoid you have an impression that its layout is
115 % incorrect\footnote{
116 % 
117 % At least the author himself had such impression without the blank page.}
118 % 
119 % because if it were in an even page you would see the {\em outside\/} third
120 % and fourth supplementary {\em columns\/} at first.
121 % 
122 % \newpage\vspace*{\fill}\centerline{(intentionally blanked page)}\vfill
123 % 
124 % \else
125 % From the next page, we will see a few examples of \parapag{}ing.
126 % \fi
127 %
128 %
129 %
130 % \newpage
131 % \subsection{Example of Paired Parallel-Paging}
132 % \label{sec:ppts-paired}
133 %
134 % Shortly we will start a \env{paracol} environment by \beginparacol|[2]{4}|
135 % having four columns but two for each of left and right \paired{}
136 % \parapag{}es. Since the author declares \!\columnratio!|{0.6}[0.5]|, the
137 % columns in left pages are made unbalanced while those in right pages are
138 % balanced.
139 % 
140 % \columnratio{0.6}[0.5]
141 % \par\Hrule
142 % \begin{paracol}[2]{4}
143 % This is the first paragraph of the leftmost column-0,
144 % \Marginpar{Marginal note from column-0.}
145 % whose first line has a marginal note placed in the right margin because
146 % the setting of \!\marginparthreshold! being 0 is still effective and we
147 % are in the odd-numbered page \pageref{sec:ppts-paired}. Now we
148 % have a \!\switchcolumn! to the next column-1.
149 %
150 % \switchcolumn
151 % \begin{Hfuzz}{1.1pt}\it
152 % This is the first paragraph of the second and right column-1 in the left
153 % \parapag{}e. We shortly give an italicized mar\-gin\-al note carefully, so
154 % that it does not conflict with the marginal note from the column-0.
155 % \Marginpar{\it Marginal note from column-1.}
156 % That is, now the author puts the note. Now we
157 % have a \!\switchcolumn! to the next column-2.
158 % \end{Hfuzz}
159 % \footnotetext*{This footnote is put in the left \parapag{}e together with
160 % another footnote below given in the column-2 in the right \parapag{}e.
161 % \label{fn:ppts-paired1}}
162 %
163 % \switchcolumn
164 % \begingroup\sf
165 % This is the first paragraph of the column-2 being the left column of the
166 % right \parapag{}e. Though we are in a page different from that column-0
167 % and 1 reside in, this page is still numbered \pageref{sec:ppts-paired}
168 % because the left and right page is \paired. Therefore, the left margin of
169 % this page is narrower than the right margin because the page number is
170 % odd.
171 % 
172 % \footnotetext*{This footnote is \emph{not} put in the right \parapag{}e
173 % though it is given in the column-2 in the right \parapag{}e and thus its
174 % reference is in the column, of course.\label{fn:ppts-paired2}}
175 %
176 % You have to notice
177 % \Marginpar{\sf Marginal note from column-2.}
178 % the first paragraph does not start from the page top
179 % but above it we have some space of exactly same size as the \preenv{}
180 % shown in the left \parapag{}e. Therefore, the top of the first paragraphs
181 % in all columns are aligned. The marginal note given in the first line of
182 % this paragraph goes to the right margin of this page because of the
183 % \!\marginparthreshold! setting and the parity of this page. Now we have a
184 % \!\switchcolumn! to the next column-3.
185 % \par\endgroup
186 % \begin{figure*}\nosv
187 % \def\arraystretch{0.8}
188 % \centerline{\begin{tabular}[b]{|c|}\hline
189 % \hbox to.9\textwidth{}\\
190 % \sf page-wise figure given in column-2\\
191 % \\\hline
192 % \end{tabular}}
193 % \caption{A Page-Wise Figure}
194 % \end{figure*}
195 %
196 % \switchcolumn
197 % \begingroup\sl
198 % This is the first paragraph
199 % \Marginpar{\sl Marginal note from column-3.}
200 % in the last rightmost column-3 whose width is equal to that of the column-2.
201 % The marginal note given in the first line goes to right and does not
202 % conflict with that from the column-2. We are now going back to the
203 % column-0 by a {\rm\!\switchcolumn!|*|} with a \mctext.
204 % \endgroup
205 %
206 % \switchcolumn*[\subsection*{A Spanning Text: though this is wider than the
207 % page width, this text does not span the boundary between the left and
208 % right parallel-pages.}]
209 %
210 % We have come back to this column-0. The space above the \mctext{} is due
211 % to the \sync{}ation because two paragraphs in the column-2 are
212 % significantly taller in total than the paragraphs in other columns. As
213 % the spanning text itself says, it cannot extend to the right \parapag{}e.
214 % The author puts dummy lines to go to the page bottom.\\
215 % \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\
216 % \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\par
217 %
218 % Now we will have a page break shortly. You could be surprised by seeing
219 % this column is not in the left \parapag{}e after the break but in the
220 % right one. This is because the feature |c| is enabled to swap not only
221 % columns in a page but also the left and right \paired{} \parapag{}es when
222 % they are even-numbered. The other feature |p| makes the left outside
223 % margins of this right and the previous left pages wider than the right
224 % inside margins.\label{page:ppts-paired2}
225 %
226 % \switchcolumn
227 % \begingroup\it
228 % We have restarted this column-1. This paragraph has a
229 % footnote\footnotemark*[-1] as shown below.\\
230 % \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\
231 % \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\
232 % \Dotfill\\ \Dotfill\par
233 %
234 % After the page break below, this column also goes to the right page
235 % together with the column-0
236 % \Marginpar{\it Another marginal note from column-1.}
237 % and is placed outside (left) in the page, as well as the marginal note
238 % in this right page but in the outside margin.
239 % \par\endgroup
240 %
241 % \switchcolumn
242 % \begingroup\sf
243 % We have a few other materials not shown in right \parapag{}es. The space
244 % above this paragraph is for the \mctext{} placed in the left \parapag{}e.
245 % The \Scfnote{} given here\footnotemark{} is also not in this page but in
246 % the left. Finally, the author has put a page-wise figure spanning columns
247 % just before \!\switchcolumn! by which we left this column, but it will be
248 % in the right page \pageref{page:ppts-paired2} together with column-0 and
249 % 1.\\
250 % \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\
251 % \Dotfill\\ \Dotfill\\ \Dotfill\par
252 %
253 % Though the footnote numbered \ref{fn:ppts-paired2} goes to the left page,
254 % its space and that of \ref{fn:ppts-paired1} make this and the next columns
255 % shorter in the previous page. Similarly, we have a space above for the
256 % page-wise figure shown in the right page.
257 % \par\endgroup
258 %
259 % \switchcolumn
260 % \begingroup\sl
261 % As expected, this line is aligned to the first line of the paragraph in
262 % the column-2 as well as those in column-0 and 1. It is also consistent
263 % the first lines including that of this paragraph are not indented because
264 % the \mctext{} is given by {\rm\!\subsection!|*|} which makes first
265 % paragraphs unindented.\\
266 % \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\
267 % \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\par
268 %
269 % After the page break we will have shortly, this column becomes the
270 % leftmost in the left \parapag{}e, as you are seeing now,
271 % \Marginpar{\sl Another marginal note from column-3.}
272 % but still outermost as well as the marginal note in the outside left
273 % margin.
274 % \endgroup
275 % \end{paracol}
276 % \Hrule
277 %
278 % Now you are seeing yet another material placed only in the page in which
279 % the column-0 resides and thus being the right page now, i.e., this
280 % paragraph and the next one in the \postenv. You might be disappointed by
281 % the fact the \emph{outside} pages, i.e., left in this page
282 % \pageref{page:ppts-paired2} and right in the previous page
283 % \pageref{sec:ppts-paired}, cannot have \pwstuff{} but it is what the
284 % author can do now for the version 1.3 and thus you have to wait some
285 % future versions in which the author could devise a mechanism to exploit
286 % the corresponding space in the pages\footnote{
287 % 
288 % You might complain the immaturity of \parapag{}ing and might claim that it
289 % should be included in \Paracol{} after the author implements the
290 % mechanism. In fact the author himself is frustrated current features of
291 % \parapag{}ing but he dared to release the version 1.3 knowing that there
292 % are people who happily typeset their \parapag{}ed documents with the
293 % current limited features.}.
294 % 
295 % In addition, you might think it is weird that the |c| feature of
296 % \!\twosided! swaps columns \emph{and} paired pages. However this swapping
297 % is a natural consequence of the combination of \cswap{} and \paired{}
298 % \parapag{}ing. Therefore, you can simply disable the |c| feature (maybe
299 % together with other features) to have more intuitive results.
300 %
301 % In the next Section~\ref{sec:ppts-npaired}, you will see another kind of
302 % \parapag{}ing namely \npaired{} one. Before that, we need a blank page to
303 % let the \npaired{} \parapag{}ing start from an even-numbered page so that
304 % a left and right page pair comprises a double spread. A short remark on
305 % the blank next page is that it does not have a right counterpart
306 % \parapag{}e because the page is outside \env{paracol} environments and does
307 % not have any portion from the environments\footnote{
308 % 
309 % To illustrate this fact, the author dares to put a real blank page rather
310 % than stepping the \counter{page} counter.}.
311 % 
312 % \newpage\vspace*{\fill}\centerline{(intentionally blanked page)}\vfill
313 %
314 %
315 %
316 % \newpage
317 % \subsection{Example of Non-Paired Parallel-Paging}
318 % \label{sec:ppts-npaired}
319 %
320 % This and following three pages are to show an example of \npaired{}
321 % \parapag{}ing, in which the author keeps the setting of \!\twosided!,
322 % \!\columnratio! and \!\marginparthreshold! unchanged.
323 % The arguments of \beginparacol{} for column population are also unchanged
324 % to have $2+2$ configuration, but the first argument is followed by |*| for
325 % \npaired{} typesetting. That is, the environment below starts by
326 % \beginparacol|[2]*{4}|. The contents of the environment is also almost
327 % same as the previous Section~\ref{sec:ppts-paired}, while
328 % \Emph{bold-faced} words show the difference from the \paired{}
329 % typesetting.
330 % 
331 % \columnratio{0.6}[0.5]
332 % \par\Hrule
333 % \begin{paracol}[2]*{4}
334 % This is the first paragraph of the leftmost column-0,
335 % \Marginpar{Marginal note from column-0.}
336 % whose first line has a marginal note placed in the \Emph{left} margin
337 % because the setting of \!\marginparthreshold! being 0 is still effective
338 % and we are in the \Emph{even}-numbered page
339 % \Emph{\pageref{sec:ppts-npaired}}. Now we have a \!\switchcolumn! to the
340 % next column-1.
341 %
342 % \switchcolumn
343 % \begingroup\it
344 % This is the first paragraph of the second and right column-1 in the left
345 % \parapag{}e. We shortly give an italicized mar\-gin\-al note carefully, so
346 % that it does not conflict with the marginal note from the column-0.
347 % \Marginpar{\it Marginal note from column-1.}
348 % That is, now the author puts the note. Now we
349 % have a \!\switchcolumn! to the next column-2.
350 % \par\endgroup
351 % \footnotetext*{This footnote is put in the left \parapag{}e together with
352 % another footnote below given in the column-2 in the right \parapag{}e.
353 % \label{fn:ppts-npaired1}}
354 %
355 % \switchcolumn
356 % \begingroup\sf\label{page:ppts-npaired1r}
357 % This is the first paragraph of the column-2 being the left column of the
358 % right \parapag{}e. \Emph{Since we are in the page next to} that column-0
359 % and 1 reside in, this page is numbered \Emph{\pageref{page:ppts-npaired1r}}
360 % because the left and right page is \Emph{\npaired}. Therefore, the left
361 % margin of this page is narrower than the right margin because the page
362 % number is odd.
363 % 
364 % \footnotetext*{This footnote is \emph{not} put in the right \parapag{}e
365 % though it is given in the column-2 in the right \parapag{}e and thus its
366 % reference is in the column, of course.\label{fn:ppts-npaired2}}
367 %
368 % You have to notice
369 % \Marginpar{\sf Marginal note from column-2.}
370 % the first paragraph does not start from the page top
371 % but above it we have some space of exactly same size as the \preenv{}
372 % shown in the left \parapag{}e. Therefore, the top of the first paragraphs
373 % in all columns are aligned. The marginal note given in the first line of
374 % this paragraph goes to the right margin of this page because of the
375 % \!\marginparthreshold! setting and the parity of this page. Now we have a
376 % \!\switchcolumn! to the next column-3.
377 % \par\endgroup
378 % \begin{figure*}\nosv
379 % \def\arraystretch{0.8}
380 % \centerline{\begin{tabular}[b]{|c|}\hline
381 % \hbox to.9\textwidth{}\\
382 % \sf page-wise figure given in column-2\\
383 % \\\hline
384 % \end{tabular}}
385 % \caption{A Page-Wise Figure}
386 % \end{figure*}
387 %
388 % \switchcolumn
389 % \begingroup\sl
390 % This is the first paragraph
391 % \Marginpar{\sl Marginal note from column-3.}
392 % in the last rightmost column-3 whose width is equal to that of the column-2.
393 % The marginal note given in the first line goes to right and does not
394 % conflict with that from the column-2. We are now going back to the
395 % column-0 by a {\rm\!\switchcolumn!|*|} with a \mctext.
396 % \endgroup
397 %
398 % \switchcolumn*[\subsection*{A Spanning Text: though this is wider than the
399 % page width, this text does not span the boundary between the left and
400 % right parallel-pages.}]
401 %
402 % We have come back to this column-0. The space above the \mctext{} is due
403 % to the \sync{}ation because two paragraphs in the column-2 are
404 % significantly taller in total than the paragraphs in other columns. As
405 % the spanning text itself says, it cannot extend to the right \parapag{}e.
406 % The author puts dummy lines to go to the page bottom.\\
407 % \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\
408 % \Dotfill\\ \Dotfill\par
409 %
410 % Now we will have a page break shortly. You \Emph{will not} be surprised
411 % by seeing this column \Emph{is still in the left \parapag{}e after the
412 % break.} This is because the feature |c| is \Emph{not effective in
413 % \npaired{} \parapag{}ing.} The other feature |p| \Emph{consistently makes
414 % the left outside margins of this and the previous page in which this
415 % column resides} wider than the right inside margins.
416 % \label{page:ppts-npaired2}
417 %
418 % \switchcolumn
419 % \begingroup\it
420 % We have restarted this column-1. This paragraph has a
421 % footnote\footnotemark*[-1] as shown below.\\
422 % \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\
423 % \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\par
424 %
425 % After the page break below, this column also \Emph{stays in the left page}
426 % together with the column-0
427 % \Marginpar{\it Another marginal note from column-1.}
428 % and is placed \Emph{inside (right)} in the page, as well as the marginal
429 % note in this \Emph{left} page \Emph{still} in the outside margin.
430 % \par\endgroup
431 %
432 % \switchcolumn
433 % \begingroup\sf
434 % We have a few other materials not shown in right \parapag{}es. The space
435 % above this paragraph is for the \mctext{} placed in the left \parapag{}e.
436 % The \Scfnote{} given here\footnotemark{} is also not in this page but in
437 % the left. Finally, the author has put a page-wise figure spanning columns
438 % just before \!\switchcolumn! by which we left this column, but it will be
439 % in the \Emph{left} page \Emph{\pageref{page:ppts-npaired2}} together with
440 % column-0 and 1.\\
441 % \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\par
442 %
443 % Though the footnote numbered \Emph{\ref{fn:ppts-npaired2}} goes to the
444 % left page, its space and that of \Emph{\ref{fn:ppts-npaired1}} make this
445 % and the next columns shorter in the previous page. Similarly, we have a
446 % space above for the page-wise figure shown in the \Emph{left} page.
447 % \par\endgroup
448 %
449 % \switchcolumn
450 % \begingroup\sl
451 % As expected, this line is aligned to the first line of the paragraph in
452 % the column-2 as well as those in column-0 and 1. It is also consistent
453 % the first lines including that of this paragraph are not indented because
454 % the \mctext{} is given by {\rm\!\subsection!|*|} which makes first
455 % paragraphs unindented.\\
456 % \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\
457 % \Dotfill\\ \Dotfill\par
458 %
459 % After the page break we will have shortly, this column \Emph{is kept being
460 % the rightmost in the right \parapag{}e}, as you are seeing now,
461 % \Marginpar{\sl Another marginal note from column-3.}
462 % \Emph{and} still outermost as well as the marginal note in the outside
463 % \Emph{right} margin.
464 % \endgroup
465 % \end{paracol}
466 % \Hrule
467 %
468 % As the \postenv{} in Section~\ref{sec:ppts-paired} is, this paragraph
469 % being the \postenv{} of the \npaired{} \parapag{}es appears only in the
470 % \parapag{}e in which the column-0 belongs to, and thus in the left
471 % \parapag{}e in this case.
472 % \endinput