From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- macros/latex/contrib/paracol/ref.dtx | 1535 ++++++++++++++++++++++++++++++++++ 1 file changed, 1535 insertions(+) create mode 100644 macros/latex/contrib/paracol/ref.dtx (limited to 'macros/latex/contrib/paracol/ref.dtx') diff --git a/macros/latex/contrib/paracol/ref.dtx b/macros/latex/contrib/paracol/ref.dtx new file mode 100644 index 0000000000..4025a65d08 --- /dev/null +++ b/macros/latex/contrib/paracol/ref.dtx @@ -0,0 +1,1535 @@ +% \footnotelayout{m} +% \columnratio{} +% \section{Reference Manual} +% \label{sec:ref} +% \subsection{Environment \texttt{paracol}} +% \label{sec:ref-paracol} +% +% \begin{description} +% \item[\ENV{paracol}{\marg{num}\oarg{text}}]\mbox{}\par +% The environment \env{paracol} contains \meta{body} typeset in \meta{num} +% columns in parallel. The optional \meta{text} is put spanning all columns +% prior to the multi-columned \meta{body}. +%  +% \begin{itemize} +% \item +% \changes{v1.2-2}{2013/05/11} +% {Add a footnote mentioning page-wise footnotes merged with +% pre-environment staff.} +% \changes{v1.35-4}{2018/12/31} +% {Add description of \cs{belowfootnoteskip}.} +%  +% The environment may start from \emph{any} vertical position in a page, +% i.e., not necessary at the top of a page. The single-column +% {\em\Uidx\preenv} of the {\em\Uidx\spage} in which \beginparacol{} lies +% are naturally connected to the beginning part of \meta{body} in each +% column, unless the page has footnotes\footnote{ +%  +% With \Mgfnote{} layout shown in Section~\ref{sec:ref-scfnote}, the +% footnotes in the single-column contents are merged with those in +% \env{paracol} environment and are put at the bottom of the \spage{} +% together as shown in this page.} +%  +% or bottom floats. If these kinds of bottom stuff exist, they are +% put above the multi-columned \meta{body}, or the spanning \meta{text} +%  +% \UsageIndex{spanning text} +%  +% if provided, with a vertical skip of \!\textfloatsep! separating them if +% bottom floats exist, or of \!\belowfootnoteskip! described in +% Section~\ref{sec:ref-scfnote} if only footnotes exist. The +% \emph{deferred} floats which have not yet appeared in the starting page +% and thus will appear in the next or succeeding pages are considered as +% \pwise{} floats given in the environment. +% +% \item +% \changes{v1.2-5}{2013/05/11} +% {Add an item to show that \string\texttt{paracol} can be enclosed in +% a \string\texttt{list}-like environment.} +%  +% The environment can be enclosed in a \env{list}{\em-like environment} such +% as \env{enumerate}, \env{itemize} and \env{description}. If so, \!\item!s +% in each column are typeset using the parameters of the surrounding +% environment such as \!\leftmargin! and \!\rightmargin!. For example, the +% following short \env{paracol} environment is included in an \env{itemize} +% for this and other \!\item!s in this page. +%  +% \begin{paracol}{2} +% \item +% This is the first \!\item! in the left column. +% +% \item +% This is the second \!\item! in the left column followed by a +% \!\switchcolumn!\footnote{. +%  +% This footnote is to show the footnotes in this page are merged.}. +% \switchcolumn +% +% \item +% This is the first \!\item! in the right column. +% +% \item +% This is the second \!\item! in the right column. +% +% \item +% This is the third and last \!\item! in the right column. +% \end{paracol} +% You are now seeing the switching to/from multi-columned and \env{itemize}d +% texts are naturally connected with the last and this single-columned +% sentences. You may feel the space between two columns above is too large +% but it simply results from the large total \!\leftmargin!s of the outer +% \env{description} and this \env{itemize}, which make the right column +% shifted right. A simple remedy for this large space is to make +% \!\columnsep! narrower, for example 0\,pt as shown below. +%  +% \columnsep0pt +% \begin{paracol}{2} +% \item +% This \!\item! is wider than the last \!\item! above because +% \!\columnsep! is 0\,pt. +% \switchcolumn +% +% \item +% Therefore, this \!\item! is shifted left a little bit to make +% inter-column spece narrower. +% \end{paracol} +% +% \item +% All \Uidx\lcounter{}s in all columns are initialized to have the values at +% \beginparacol{} on its first occurrence. On the second and succeeding +% occurrences of \beginparacol, the \lcounter{}s in each column have the +% value at the last \Endparacol, unless they are modified after the +% \Endparacol. If a counter is modified (or declared by \!\newcounter!) +% after the \Endparacol, the local versions of the counter in all columns +% commonly have the value at \beginparacol. +% +% \item +% \changes{v1.2-2}{2013/05/11} +% {Add a footnote mentioning page-wise footnotes merged with +% post-environment staff.} +%  +% The environment may end at \emph{any} vertical position in a page, i.e., +% the {\em\Uidx\postenv} being the single-column texts and others +% following \Endparacol{} in the {\em\Uidx\lpage} of the environment may not +% start from the top of a page. If any columns don't have deferred +% \cwise{} floats and the most advanced {\em\Uidx\lcolumn} at +% \Endparacol{} has neither of footnotes\footnote{ +%  +% With \Mgfnote{} layout shown in Section~\ref{sec:ref-scfnote}, the +% footnotes in the closing \env{paracol} environment are merged with those +% in \postenv{} and are put at the bottom of the page{} together as shown in +% this page.} +%  +% nor bottom floats, its bottom is naturally connected to the \postenv{}. +% If the \lcolumn{} has these kinds of bottom stuff, they are put above the +% \postenv{}, with a vertical skip of \!\textfloatsep! separating them if +% bottom floats exist. All deferred \cwise{} floats given in the +% environment are flushed before the \postenv{} appears, possibly creating +% {\em\Uidx\fcolumn{}s} only with floats. On the other hand, deferred +% \pwise{} floats given in the environment are considered as deferred +% (single-) \cwise{} floats given just after \Endparacol. +% +% \item +% The values of all \lcounter{}s in the leftmost column are used as the +% initial values of them in the \postenv. +% +% \item +% The \env{paracol} environment cannot be nested, or you will have an error +% message of illegal nesting. +% +% \item +% The commands \!\switchcolumn!, \!\synccounter!, \!\syncallcounters! and +% \!\flushpage!, and environments \env{column}(|*|), \env{nthcolumn}(|*|), +% \env{leftcolumn}(|*|) and \env{rightcolumn}(|*|) are {\em local} to +% \env{paracol} environment and thus undefined outside the +% environment\footnote{ +%  +% Unless you dare to define them.}. +%  +% The command \!\clearpage! is of course usable outside and inside the +% environment but its function inside is a little bit different from outside. +% \end{itemize} +% +% +% +% \item[\ENV{paracol}{\oarg{numleft}\marg{num}\oarg{text}}]\mbox{} +% \Item[\ENV{paracol}{\oarg{numleft}\texttt{*}\marg{num}\oarg{text}}] +% \mbox{}\par +% \changes{v1.3-2}{2013/09/17} +% {Add description of parallel-paging.} +%  +% If a \beginparacol{} has the optional \meta{numleft} argument to specify +% the number of leading columns $n_l$ together with the total $n$ given by +% \meta{num}, columns in the environment are laid out across two adjacent +% pages. In this {\em\Uidx\parapag{}e} typesetting, the first $n_l$ columns +% are placed in the {\em left} page while remaining $n_r=n-n_l$ columns go to +% the next {\em right} page. The pair of left and right pages is +% considered as comprising a virtual {\em\Uidx\paired} page and thus shares +% a common page number, unless {\em\Uidx\npaired} typesetting is specified +% by the optional `|*|' following the optional \meta{numleft} argument. In +% the \npaired{} \parapag{}ing, when the leading $n_l$ columns are put in a +% page $p$, the trailing $n_r$ columns are in the page $p+1$. +%  +% \begin{itemize} +% \item +% All {\em\Uidx\pwstuff}, i.e., \Preenv{} and \postenv, \pwise{} floats, +% \mctext{} and (\mgfnote{} or non-merged) \Scfnote{}s, are placed only in +% left \parapag{}es leaving corresponding regions in right \parapag{}es +% blank\footnote{ +%  +% Someday the author could devise an advanced mechanism to exploit the space +% in right \parapag{}es.}. +% +% \item +% A \npaired{} left \parapag{}e is not necessary to be even-numbered, though +% the printing tradition requires so if you naturally want to have a +% \parapag{}e pair in a double spread. The page number given to the first +% left \parapag{}e is simply the number of the page $p_1$ in which +% \beginparacol{} reside, and that for the $k$-th left \parapag{}e is +% $p_1+2(k-1)$\footnote{ +%  +% Unless you make some change to \counter{page} counter.}. +%  +% Therefore, to make it sure $p_1$ is even, you might need to have an +% ordinary page of blank, a title, etc., or to let \counter{page} counter have +% an even number by \!\setcounter!, etc., before starting a \env{paracol} +% environment. +% +% \item +% Section~\ref{sec:ppts} shows examples of \parapag{}ing together with +% related issues on two-sided typesetting. +% \end{itemize} +% \end{description} +% +% +% +% \subsection{Column-Switching Command and Environments} +% \label{sec:ref-switchcolumn} +% +% \begin{description} +% \item[\Midx{\!\switchcolumn!}\oarg{col}]\mbox{} +% \Item[\Midx{\!\switchcolumn!}\oarg{col}\texttt{*}\oarg{text}]\mbox{}\par +% The command switches columns from $i$ to $j$ where $i$ and $j$ is the +% zero-origin ordinals of the columns from/to which we are leaving\slash +% visiting respectively. Without the optional \meta{col}, $j=i+1\bmod n$ +% where $n$ is the number of columns given to \beginparacol, while +% $j=\meta{col}$ with the optional argument. If the command (or +% \oarg{col} if specified) is followed by a |*|, the \cswitch{} takes +% place after \sync{}ation and, if specified, the optional spanning +% \meta{text} is put. +%  +% \Index{spanning text} +%  +% \begin{itemize} +% \item +% Using \!\switchcolumn! in a \env{list}-like environment \emph{included} in +% a \env{paracol} environment causes an ugly result without any error\slash +% warning messages. This caution is effectual for all \csenv{}s too. +% +% \item +% If $\meta{col}\notin\LBRP0n$, an error is reported and, if you dare to +% continue, you will switch to the leftmost column 0. +% +% \item +% The \sync{}ation point is set just below the last line of the \lcolumn{} +% in a page $p$, partly taking deferred floats into account. That is, all +% deferred floats are put in the pages up to $p-1$ and at the top of $p$ if +% possible. Then, if a non-\lcolumn{} has footnotes and/or bottom floats +% and they cannot be pushed down below the \sync{}ation point, the point is +% moved to the next page top\footnote{ +%  +% Or below top floats deferred to the page.}. +% +% \item +% In a page having one or more \sync{}ation points, stretch and shrink +% factors of all vertical spaces, such as those surrounding sectionning +% commands, are ignored. Therefore, even if you specify \!\flushbottom!, +% the page is typeset as if \!\raggedbottom! were specified. +% +% \item +% After a \sync{}ation point is set, no top floats will be inserted in the page +% having the point, thus they will be deferred to the next page or further one. +% \end{itemize} +% +% +% +% \item[\ENV{column}{}]\mbox{} +% \Item[\ENV{column*}{\oarg{text}}]\mbox{}\par +% The environment \env{column} contains \meta{body} for the column next to +% what we are in just before \!\begin!|{|\env{column}|}|. The starred +% version \env{column*} does the same after \sync{}ation and, if specified, +% the optional spanning \meta{text} is put. +%  +% \Index{spanning text} +%  +% \begin{itemize} +% \item +% The environments are almost equivalent to; +% \begin{quote} +% |{|\!\switchcolumn!\quad\meta{body}\quad\CSIndex{par}|}|\\ +% |{|\!\switchcolumn!|*|\oarg{text}\quad\meta{body}\quad\CSIndex{par}|}| +% \end{quote} +% except for their first occurrences which don't switch to the column 1 +% (i.e., right column if two-columned) but stay in the leftmost column 0. +% More precisely, \!\begin!|{|\env{column}(|*|)|}| does not make \cswitch{} +% if it is not preceded by \!\switchcolumn! nor other \csenv{}s. +% +% \item +% The \meta{body} of the environments cannot have \!\switchcolumn! nor +% \csenv{}s including \env{column}(|*|) themselves, or you will have an +% error message of illegal use of command\slash environment. +% +% \item +% Column-switching\index{column-switching} does not take place at +% \!\end!|{|\env{column}(|*|)|}|. Therefore, texts following the +% environments are put in the column in which \meta{body} resides until a +% \cswitch{} command\slash environment is given. +% \end{itemize} +% +% +% +% \item[\ENV{nthcolumn}{\marg{col}}]\mbox{} +% \Item[\ENV{nthcolumn*}{\marg{col}\oarg{text}}]\mbox{}\par +% The environment \env{nthcolumn} contains \meta{body} for the column +% \meta{col}. The starred version \env{nthcolumn*} does the same after +% \sync{}ation and, if specified, the optional spanning \meta{text} is put. +%  +% \Index{spanning text} +%  +% \begin{itemize} +% \item +% The environments are equivalent to; +%  +% \begin{quote} +% |{|\!\switchcolumn!\oarg{col}\quad\meta{body}\quad\CSIndex{par}|}|\\ +% |{|\!\switchcolumn!\oarg{col}|*|\oarg{text}\quad +% \meta{body}\quad\CSIndex{par}|}| +% \end{quote} +% +% \item +% The \meta{body} of the environments cannot have \!\switchcolumn! nor +% \csenv{}s including \env{nthcolumn}(|*|) themselves, or you will have an +% error message of illegal use of command\slash environment. +% +% \item +% Column-switching\index{column-switching} does not take place at +% \!\end!|{|\env{nthcolumn}(|*|)|}|. Therefore, texts following the +% environments are put in the column in which \meta{body} resides until a +% \cswitch{} command\slash environment is given. +% \end{itemize} +% +% +% +% \KeepSpace{4} +% \item[\ENV{leftcolumn}{}]\mbox{} +% \Item[\ENV{leftcolumn*}{\oarg{text}}]\mbox{} +% \Item[\ENV{rightcolumn}{}]\mbox{} +% \Item[\ENV{rightcolumn*}{\oarg{text}}]\mbox{}\par\nobreak +% The environment \env{leftcolumn} contains \meta{body} for the leftmost +% column 0, while \env{rightcolumn} for the column 1 being the right column +% in two-column typesetting. The starred versions \env{leftcolumn*} and +% \env{rightcolumn*} do the same after \sync{}ation and, if specified, the +% optional spanning \meta{text} is put. +%  +% \Index{spanning text} +%  +% \begin{itemize} +% \item +% The environments \env{leftcolumn}(|*|) are equivalent to; +%  +% \begin{quote} +% \Env{nthcolumn}{\Arg{\texttt{0}}}\\ +% \Env{nthcolumn*}{\Arg{\texttt{0}}\oarg{text}} +% \end{quote} +%  +% while \env{rightcolumn}(|*|) are equivalent to; +%  +% \begin{quote} +% \Env{nthcolumn}{\Arg{\texttt{1}}}\\ +% \Env{nthcolumn*}{\Arg{\texttt{1}}\oarg{text}} +% \end{quote} +%  +% \end{itemize} +% +% +% +% \item[\Midx{\!\thecolumn!}]\mbox{}\par +% \changes{v1.3-5}{2013/09/17} +% {Add description of \cs{thecolumn}.} +% The command gives you the zero-origin ordinal of the column in which this +% command appears. Therefore, the following code snip; +%  +% \begin{itemize}\item[] +% |\begin{paracol}{3}|\\ +% |Column-\thecolumn.\switchcolumn| +% |Column-\thecolumn.\switchcolumn| +% |Column-\thecolumn.|\\ +% |\end{paracol}| +% \end{itemize} +%  +% gives us the followings. +%  +% \par\medskip +% \begin{paracol}{3} +% Column-\thecolumn.\switchcolumn +% Column-\thecolumn.\switchcolumn +% Column-\thecolumn. +% \end{paracol} +%  +% \begin{itemize} +% \item +% The command is {\em neither} a \LaTeX's counter nor \!\count! register of +% native \TeX{}, and thus the value it keeps cannot be modified. However, +% it can be used wherever an integer number is required or appropriate. +% Therefore for example, \!\setcounter!|{mycounter}{|\!\thecolumn!|}| works +% well to give the column ordinal to the counter |mycounter|. +% \end{itemize} +% +% +% +% \item[\Midx{\!\definecolumnpreamble!}\marg{col}\marg{pream}]\mbox{}\par +% \changes{v1.35-5}{2018/12/31} +% {Add description of \cs{definecolumnpreamble}.} +% The command is to define the {\Uidx\colpream} \meta{pream} for the column +% \meta{col}, which is inserted at every \cswitch{} to the column. More +% specifically, the command let \!\switchcolumn! to \meta{col} act as if you +% sepcify; +%  +% \begin{itemize}\item[] +% \!\switchcolumn! $\arg{pream\ for\ col}$ +% \end{itemize} +%  +% and \csenv{}s such as \env{nthcolumn} act as if you specify; +%  +% \begin{itemize}\item[] +% |\begin{nthcolumn}{|\meta{col}|}| $\arg{pream\ for\ col}$ +%  +% \end{itemize} +%  +% \begin{itemize} +% \item +% \begingroup\hfuzz1.5pt +% The optional \sptext{} of \!\switchcolumn!, \csenv{}s and \beginparacol{} +% is considered to be in a virtual column $-1$, and thus if you need a +% \Colpream{} for \sptext{}s do \!\definecolumnpreamble!|{-1}|\marg{pream}. +% \par\endgroup +% +% \item +% The command may appear in a \env{paracol} environment and, if so, +% \meta{pream} is effective from the succeeding \cswitch{} to \meta{col}. +% +% \item +% The definition of \meta{pream} is made globally. +% \end{itemize} +% +% +% +% \item[\Midx{\!\ensurevspace!}\marg{len}]\mbox{}\par +% \changes{v1.3-5}{2013/09/17} +% {Add description of \cs{ensurevspace}.} +%  +% The command tells the first \sync{}ing \cswitch{} command (i.e., +% \!\switchcolumn!\oarg{col}|*|) or environment (i.e., \env{column*}, etc.\@) +% following this command that the page must be broken before \sync{}ation +% unless the \sync{}ation point has the space of \meta{len} or more below it +% in the page. If a \sync{}ation does not have the command after the +% previous \sync{}ation, it is assumed that +% \!\ensurevspace!|{|\!\baselineskip!|}| is given. +%  +% \begin{itemize} +% \item +% This command is to be used when a \sync{}ation point would be placed near +% the bottom of a page $p$ and the space below it is not sufficient for a column +% $c$ to put anything in the page, while another column $c'$ can have a few +% lines in the page. If this happens, the first line after the \sync{}ation +% should start at the top of the page $p+1$ in the column $c$, while that of +% $c'$ is still in the page $p$, giving you an impression that the +% \sync{}ation fails to align the top of all columns below it. The fact is, +% however, the \sync{}ation point is properly established near at the bottom +% of the page but the first line of $c$ needs some large space due to, for +% example, the followings. +%  +% \begin{itemize} +% \item +% The line has unusually tall stuff including larger font letters. +% +% \item +% The line has a footnote reference which is hardly apart from the +% footnote, and thus the line and the footnote go to the next page together. +% +% \item +% The parameter \!\clubpenalty! is too large (e.g., 10000) to break the +% first and second lines into separate pages. +% +% \item +% The first line follows a vertical space. +% \end{itemize} +% +% \item +% This manual itself has some instances of \!\ensurevspace! command in the +% page \pageref{page:bfreude} and \pageref{page:efreude} in which each German +% stanza is enclosed in \env{verse} and then \env{leftcolumn*} environments +% and has \!\ensurevspace!|{2|\!\baselineskip!|}| before the \!\begin!ing of +% the outer \env{leftcolumn*} because the first line of the stanza is +% preceded by a vertical space inserted by \!\begin!|{|\env{verse}|}|. In +% fact without \!\ensurevspace!, the first two lines of the sixth English +% stanza would be in the page \pageref{page:bfreude}, while corresponding +% German stanza go to the next page \pageref{page:efreude} as a whole, due +% to the difference of the height of footnotes in each column, i.e., German +% ones are taller than English ones to narrow the space for the German +% column. +% +% \item +% As the author does in the ``An die Freude/To Joy'' example, it is a good +% tactics to have an \!\ensurevspace! with some vertical space larger than the +% default \!\baselineskip! if it is sure that a column has a feature shown +% above regardless of the position of the \sync{}ation point in question, +% because the point goes up or down with revisions of your document and +% using an \!\ensurevspace! for a \sync{}ation far above the page bottom is +% perfectly harmless. Similarly, if you find a problem in a \sync{}ation +% and add an \!\ensurevspace! to solve it, keeping the command attached is +% recommended even when the \sync{}ation point moves up or down to make the +% command unnecessary. +% \end{itemize} +% \end{description} +% +% +% +% \subsection{Commands for Column and Gap Width} +% \label{sec:ref-colwidth} +% +% \begin{description} +% \item[\Midx{\!\columnratio!}\Arg{$r_0,r_1,\cdots,r_k$} +% {|[|$r'_0,r'_1,\cdots,r'_{k'}$|]|}]\mbox{}\par +% \changes{v1.1}{2012/05/11} +% {Add description of \cs{columnratio}.} +% \changes{v1.3-2}{2013/09/17} +% {Add descriptino of the optional argument of \cs{columnratio} for +% parallel-paging.} +%  +% The command defines the width of each column by the fraction $r_i$ to +% specify the portion which $i$-th ($i=0$ for the leftmost) column +% occupies. More specifically, the width $\Midx{\w}_i$ of the $i$-th column +% is defined as follows, where $W$ is \!\textwidth!, $S$ is \!\columnsep!, +% and $n$ is the number of columns given to \beginparacol. +%  +% \begin{eqnarray*} +% W'&=&W-(n-1)S\\ +% w_i&=&\cases{ +% r_iW' +% \vrule height1.5\ht\strutbox depth1.5\dp\strutbox width0pt&$i\leq k$\cr +% \displaystyle{(1-\sum_{j=0}^k r_j)W'\over n-(k+1)}&$i>k$} +% \end{eqnarray*} +%  +% For a \env{paracol} environment with \parapag{}ing, $n$ is replaced with +% $n_l$ for the columns in left \parapag{}es, while $n$ and $w_i$ are +% replaced with $n_r$ and $w_{n_r+i}$ for those in right \parapag{}es. +% Moreover, if the optional argument having $r'_0,r'_1,\cdots,r'_{k'}$ is +% provided, $w_{n_r+i}$ for a column in right \parapag{}es is determined +% by $r'_i$ and $k'$ instead of $r_i$ and $k$. +%  +% \begin{itemize} +% \item +% The equations above imply that $k0$ and $\sum_{j=0}^k +% r_j<1$. If $k\geq n-1$, $k$ is assumed to be $n-2$ and all $r_i$ such +% that $i\geq n-1$ are ignored. If $r_i$ or its sum does not satisfy the +% conditions, you will have an ugly result with ``Overfull'' messages. +% +% \item +% The argument $r_0,r_1,\cdots,r_k$ can be empty to mean $k=-1$ to let all +% column widths be $W'/n$ as default. +% +% \item +% The setting of column width by the command takes effect in the |paracol| +% environments following the command\footnote{ +%  +% If the command is in a \texttt{paracol} environment, the command does not +% affect the column widths of the environment but does the next ones, though +% such usage is very unusual.}. +%  +% Therefore, though placing the command in the preamble is the most natural +% way\footnote{ +%  +% Or second most to not using it at all, of course.}, +%  +% you may place this command between two |paracol| environments to change +% the column layout for the second one even when they appear in a page as +% shown in Section~\ref{sec:man-close}. +% +% \item +% \changes{v1.2-5}{2013/05/11} +% {Modify the description about \cs{linewidth} reflecting the fact +% that \string\texttt{paracol} may be included in a +% \string\texttt{list}-like environment.} +%  +% In the $i$-th column, \!\columnwidth! has $w_i$ and, for outermost +% paragraphs in the column, \!\hsize! has $w_i$ as well. As for +% \!\linewidth!, it has $w_i-(\!\textwidth!-l)$ where $l$ is what +% \!\linewidth! had at \beginparacol{}, i.e., the \!\linewidth! for the +% \env{list}-like environment surrounding \env{paracol} if any, or +% \!\textwidth! otherwise. +% +% \item +% You can specify width of each column and that of each {\em gap} between +% two columns more detailedly by \!\setcolumnwidth! shown below. If your +% document has both of \!\columnratio! and \!\setcolumnwidth! prior to a +% \env{paracol} environment, the command given later is effective for the +% environment. +% \end{itemize} +% +% +% +% \item[\Midx{\!\setcolumnwidth!}\Arg{$s_0,s_1,\cdots,s_k$} +% {|[|$s'_0,s'_1,\cdots,s'_{k'}$|]|}]\mbox{}\par +% \changes{v1.3-2}{2013/09/17} +% {Add descriptino of \cs{setcolumnwidth}.} +%  +% The command defines the width of each column and that of each {\em gap} +% between two columns by the column/gap specification $s_i$ for the $i$-th +% column and the gap between it and the $(i{+}1)$-th column. More +% specifically, $s_i$ has the form of $\hat w_i$ or $\hat w_i\,|/|\,\hat g_i$ +% where each of $\hat w_i$ and $\hat g_i$ is a proper glue including a +% proper dimension, or an empty string to mean $\hat w_i=\!\fill!$ and $\hat +% g_i=\!\columnsep!$, to determine the width of $i$-th column $\w_i$ and that +% of $i$-th gap $\Midx{\gap}_i$ as follows, where $\mathit{nat}(x)$ is the +% natural width of the glue $x$, $\mathit{str}(x)$ is the infinite stretch +% factor of $x$, $W$ is \!\textwidth!, and $n$ is the number of columns +% given to \beginparacol. +%  +% \begin{eqnarray*} +% W'&=&\sum_{i=0}^{n-2}\big(\mathit{nat}(\hat w_i)+\mathit{nat}(\hat g_i)\big)+ +% \mathit{nat}(\hat w_{n-1})\\ +% F&=&\sum_{i=0}^{n-2}\big(\mathit{str}(\hat g_i)+\mathit{str}(\hat g_i)\big)+ +% \mathit{str}(\hat w_{n-1})\\ +% x_i&=&\cases{(W/W')\mathit{nat}(\hat x_i)&$W'\geq W\;\lor\;F\leq0$\cr +% \mathit{nat}(\hat x_i)+(\mathit{str}(\hat x_i)/F)(W-W')& +% $W'< W\;\land\;F>0$} +% \qquad(x\in\{w,g\}) +% \end{eqnarray*} +% That is, if the total of natural widths $W'$ is larger than \!\textwidth! +% $W$ or there are no infinite stretch factors in the specification, given +% widths are scaled down or up so that the scaled total is equal to $W$. +% Otherwise, each width with an infinite stretch factor is extended +% according to its ratio in the total stretch so that the stretched total is +% equal to $W$. +% +% For a \env{paracol} environment with \parapag{}ing, $n$ is replaced with +% $n_l$ for the columns in left \parapag{}es, while $n$, $w_i$ and $g_i$ are +% replaced with $n_r$, $w_{n_r+i}$ and $g_{n_r+i}$ for those in right +% \parapag{}es. Moreover, if the optional argument having +% $s'_0,s'_1,\cdots,s'_{k'}$ is provided, $w_{n_r+i}$ and $g_{n_r+i}$ for a +% column in right \parapag{}es are determined by $s'_i$ instead of $s_i$. +%  +% \begin{itemize} +% \item +% In \env{paracol} environments having $n$ columns, $s_i$ s.t.\ $i\geq n$ +% and $\hat g_{n-1}$ are ignored. On the other hand if $kk$. +% +% \item +% Finite stretch factors and finite or infinite shrink factors in $\hat w_i$ +% and $\hat g_i$ are ignored. +% +% \item +% Unlike \TeX's genuine glue addition, all infinite unit |fil|, |fill| and +% |filll| are not distinguished in the summation for $F$. Also unlike +% \TeX's genuine scaling of a glue primitive, +% $f\!\fill!$ means $0\,|pt|\ |plus|\ f\,|fill|$ for convenience\footnote{ +%  +% In \TeX's grammar, $f\!\fill!$ means a dimension rather than a glue and is +% $0\,|pt|$ because the natural component of \!\fill! is 0.}. +% +% \item +% The division $W/W'$ and $\mathit{str}(\hat x_i)/F$ can have some +% arithmetic errors and thus the total of $w_i$ and $g_i$ may not be equal to +% $W$ exactly but can be a little bit less than $W$. This small error is, +% however, equally distributed to $g_i$ in typesetting of a page to make the +% total width of columns and gaps is exactly $W$\footnote{ +%  +% If we may ignore the arithmetic error inherent in \TeX.}. +% +% \item +% All the specifications shown in the table below give us same results for a +% \env{paracol} environment having three columns, providing +% $\!\textwidth!=360\,|pt|$ and $\!\columnsep!=S=20\,|pt|$. +%  +% \par\hbox to\textwidth\bgroup\hfil +% \nosv \def\|{\verb|}\small\arraycolsep0pt\def\arraystretch{1.1} +% $\begin{array}[b]{l|ccccc} +% s_0,s_1,s_2&w_0&g_0&w_1&g_1&w_2\rlap{ (in \texttt{pt})}\\\hline +% \|50pt/20pt,100pt/40pt,150pt|&50&20&100&40&150\\ +% \|50pt,100pt/2\columnsep,150pt|&50&S& +% 100&2S&150\\ +% \|50pt/\fill,100pt/2\fill,150pt|&50&(1/3)\cdot60&100&(2/3)\cdot60&150\\ +% \|,2\fill/2\columnsep,3\fill|&\ (1/6)\cdot300&S& +% (2/6)\cdot300&2S& +% (3/6)\cdot300\\ +% \|50pt/20,50pt plus 1fil/40pt,50pt plus 2fil |& +% 50&20&50+(1/3)\cdot150&40& +% 50+(2/3)\cdot150\\ +% \|5pt/2pt,10pt/4pt,15pt|&10\cdot5&10\cdot2&10\cdot10&10\cdot4& +% 10\cdot15\\ +% \|100pt/40pt,200pt/80pt,300pt|&0.5\cdot100&0.5\cdot40& +% 0.5\cdot200&0.5\cdot80& +% 0.5\cdot300 +% \end{array}$\hfil\egroup +% +% \item +% If your document has both of \!\columnratio! and \!\setcolumnwidth! prior +% to a \env{paracol} environment, the command given later is effective for +% the environment. +% \end{itemize} +% \end{description} +% +% +% +% \subsection{Commands for Two-Sided Typesetting and Marginal Note Placement} +% \label{sec:ref-twoside} +% \changes{v1.3-3}{2013/09/17} +% {Add the sub-section ``Commands for Two-Sided Typesetting and Marginal +% Note Placement''.} +% \changes{v1.3-4}{2013/09/17} +% {Add the sub-section ``Commands for Two-Sided Typesetting and Marginal +% Note Placement''.} +% \changes{v1.3-5}{2013/09/17} +% {Add the sub-section ``Commands for Two-Sided Typesetting and Marginal +% Note Placement''.} +% +% \begin{description} +% \item[\Midx{\!\twosided!}{$|[|t_1t_2\cdots t_k|]|$}]\mbox{}\par +% \changes{v1.3-3}{2013/09/17} +% {Add description of \cs{twosided}.} +% \changes{v1.3-4}{2013/09/17} +% {Add description of \cs{twosided}.} +% \changes{v1.3-5}{2013/09/17} +% {Add description of \cs{twosided}.} +%  +% The command enables a set of two-sided typesetting features +% $\Set{t_i}{t_i\in\{|p|,|c|,|m|,|b|\},\ 1\leq i\leq k}$ explicitly by the +% optional argument, or all of the following four features as a whole +% without the argument, in even-numbered pages. +%  +% \begin{description} +% \item[|p|\rm(\textit{age})] +% for ordinary two-sided paging, letting the left side margin be +% \!\evensidemargin!, page headers be different from those in odd-numbered +% pages with |headings| or |myheadings| page style, and \!\cleardoublepage! +% leave an even-numbered page blank if it is used in an odd-numbered page. +% +% \item[|c|\rm(\textit{olumn})] +% for {\em\Uidx\cswap} to \emph{print} columns in even-numbered pages in +% reverse order. This feature is sometimes preferable in typesetting +% especially with unbalanced parallel columns to make, for example, a wider +% columns are always \emph{inside} while narrower ones are \emph{outside}. +% +% \item[|m|\rm(\textit{arginal text})] +% to place marginal notes in the side margin opposite to that specified by +% the command \!\marginparthreshold! discussed shortly. +% +% \item[|b|\rm(\textit{ackground painting})] +% to make \bgpaint, shown in Section~\ref{sec:ref-bgpaint}, +% \emph{\mirror{}ed} so that, for example, a color specified for the left +% margin is used to paint the right margin instead. +% \end{description} +%  +% \begin{itemize} +% \item +% The feature |p| is also enabled by the |twoside| option of +% \!\documentclass! with almost all classes including |article|, |book|, +% |report|, etc. Though it is strongly recommended to make both settings by +% \!\documentclass! and this command consistent, they can be inconsistent +% resulting in lack of some expected functions. For example, enabling |p| +% feature by \!\twosided! without |twoside| option in \!\documentclass! +% makes the format of headers and footers in all pages same even with +% \!\pagestyle!|{headings}|. +% +% \item +% The \cswap{} enabled by the feature |c| is ineffective in \npaired{} +% \parapag{}ing because it is meaningless\footnote{ +%  +% Unless somebody tells the author it is meaningful.}, +%  +% and thus silently ignored. +% +% \item +% In ordinary single-column typesetting, marginal note swapping in +% even-numbered pages is enabled by the |twoside| option, while it never takes +% place in ordinary two-column typesetting. For marginal notes given in +% \env{paracol} environments, however, swapping of them in +% even-numbered pages is enabled by giving the feature |m| to \!\twosided!. +% +% \item\label{page:cswap} +% The command has to be outside of \env{paracol} environments to decide the +% action in the environments following them. If it appears in a +% \env{paracol} environment, you will have a warning message saying it is +% ignored. +% +% \twosided[c]\columnratio{0.6}\columnsep0pt +% \begin{paracol}{2} +% \hfuzz2pt +% \item +% Here is an example of column swapping. Since this page +% \pageref{page:cswap} is odd, this wider column-0 with roman font is placed +% in left side and thus inside at the begining, but now we are in an even +% page in which this column is in right side. +% +% \switchcolumn +% \item\it +% This narrower, outside and italicized column-1 is at first in right +% side but the page break has changed the position to the left. +% \end{paracol} +% +% \item +% \changes{v1.2-4}{2013/05/11} +% {Add description of \cs{[no]swapcolumninevenpages}.} +% \changes{v1.3-5}{2013/09/17} +% {Remove description of \cs{[no]swapcolumninevenpages} but mention +% they are still available.} +%  +% In old versions of \Paracol, namely 1.2 and its minor revisions 1.2x, +% \cswap{} was controlled by lengthy commmands +% \Midx{\!\swapcolumninevenpages!} and \Midx{\!\noswapcolumninevenpages!}. +% Though they are still available and will be so forever for backward +% compatibility, it is recommended to use \!\twosided! with or without the +% feature |c|. The old versions also have a problem that \spanning{} +% crossing a page boundary is placed incorrectly after the page break in it, +% but this problem is solved by a fix incorporated in version 1.3. +% +% \item +% It must be $t_i\in\{|p|,|c|,|m|,|b|\}$, or you will have an error message +% of illegal two-siding feature. +% +% \item +% Section~\ref{sec:ppts} shows examples of two-sided typesetting together +% with related issues on \parapag{}ing. +% \end{itemize} +% +% +% +% \item[\Midx{\!\marginparthreshold!}$\Arg{k}{|[|k'|]|}$]\mbox{}\par +% \changes{v1.3-4}{2013/09/17} +% {Add description of \cs{marginparthreshold}.} +%  +% The command specifies the minimum ordinal $k$ of columns whose marginal +% notes are placed in right margin. That is, marginal notes given in a +% column-$i$ go to left margin if $i