From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Mon, 2 Sep 2019 13:46:59 +0900
Subject: Initial commit

---
 macros/latex/contrib/paracol/pwfnote.dtx | 608 +++++++++++++++++++++++++++++++
 1 file changed, 608 insertions(+)
 create mode 100644 macros/latex/contrib/paracol/pwfnote.dtx

(limited to 'macros/latex/contrib/paracol/pwfnote.dtx')

diff --git a/macros/latex/contrib/paracol/pwfnote.dtx b/macros/latex/contrib/paracol/pwfnote.dtx
new file mode 100644
index 0000000000..8fcf377159
--- /dev/null
+++ b/macros/latex/contrib/paracol/pwfnote.dtx
@@ -0,0 +1,608 @@
+% \def\Dotquad{\leavevmode\cleaders\hbox to.44em{\hss.\hss}%
+%   \hskip\parindent\kern0pt}
+% \def\fnpar#1#2{#1 paragraph\Dotfill\\\Dotfill with a footnote#2\Dotfill
+%   in it.\par}
+% \def\Fnpar#1#2#3{#1 paragraph\Dotfill\\\Dotfill with a footnote#2\Dotfill
+%   in it.\\#3\par}
+% 
+% \section{Numbering and Placement of Page-Wise Footnotes}
+% \label{sec:fnnp}
+% \changes{v1.2-2}{2013/05/11}
+% 	{Add the section ``Numbering and Placement of Single-Columned
+%	 Footnotes'' to describe page-wise footnotes in detail.}
+% \changes{v1.3-5}{2013/09/17}
+%	{Rename the section title from ``Numbering and Placement of
+%	 Single-Columned Footnotes''to ``Numbering and Placement of
+% 	``Page-Wise Footnotes'' following new naming.}
+% 
+% Here we have a simple example of \scfnote{} but not-merged
+% footnotes\footnote{.
+% 
+% Because of the non-merged typesetting, this footnote is put above the
+% example.\par\Hrule\label{fn:preenv}}.
+%
+% \footnotelayout{p}
+% \begin{paracol}{2}
+% \fnpar{First left-column}{\footnote{First left-column footnote.}}
+% \fnpar{Second left-column}{\footnote{Second left-column footnote.}}
+% \switchcolumn
+% \fnpar{First right-column}{\footnote{First right-column footnote.}}
+% \fnpar{Second right-column}{\footnote{Second right-column footnote.
+% This and all other footnotes above are \scfnote{} and, since footnote
+% typesetting is non-merged, they are put above the \postenv.}}
+% \end{paracol}
+% \Hrule
+% 
+% As shown above, it is easy to have a reasonable result of footnote
+% numbering and placement as far as your \env{paracol} environment is
+% completely included in a page and you accept the numbering in
+% left-column-first manner constructing the environment as follows
+% exploiting the fact \counter{footnote} is made global, where $b$ is the
+% value of \counter{footnote} counter at \beginparacol, i.e., the number
+% given to the footnote just preceding the environment, and thus
+% $b=\ref{fn:preenv}$ in the example above.
+% 
+% \begin{quote}\vskip-1pt
+% |\begin{paracol}{2}|\\
+% \textit{left-column stuff having $n$ footnotes numbered $b+1$, $b+2$,
+% \ldots, $b+n$}\\
+% |\switchcolumn|\\
+% \textit{right-column stuff having $m$ footnotes numbered $b+n+1$, $b+n+2$,
+% \ldots, $b+n+m$}\\
+% |\end{paracol}|
+% \end{quote}\vskip-1pt
+% 
+% The real life is, however, tougher than that, because the assumptions above
+% are too optimistic as described in the following subsections.
+% \vskip-3pt\vskip0pt
+% 
+% 
+% \subsection{Multiple \cs{switchcolumn} in a Page}
+% \label{sec:fnnp-multsc}
+% 
+% Here we have an example with three \!\switchcolumn! commands in a page
+% having six footnotes.  Hereafter, footnotes are typeset with
+% \Uidx{\!\footnotelayout!}|{m}|\footnote{
+% 
+% And thus this footnote is merged with those in the \env{paracol}
+% environment.}.
+% 
+% \footnotelayout{m}
+% \Hrule
+% \begin{paracol}{2}
+% \fnpar{First left-column}{\footnote{First left-column
+% footnote.\label{fn:2L1}}}
+% \Fnpar{Second left-column}{\footnote{Second left-column
+% footnote.\label{fn:2L2}}}{
+% It is followed by a \cs{switchcolumn}.}
+% \switchcolumn
+% \Fnpar{First right-column}{\footnote{First right-column footnote but
+% following the second left-column one.\label{fn:2R1}}}{It is followed by a
+% \cs{switchcolumn*}.}
+% \switchcolumn*
+% \Fnpar{Third and synchronized left-column}{\footnote{Third left-column
+% footnote but following the first right-column one.\label{fn:2L3}}}{It is
+% followed by a \cs{switchcolumn}.}
+% \switchcolumn
+% \fnpar{Second and synchronized right-column}{\footnote{Second right-column
+% footnote but following the third left-column one.\label{fn:2R2}}}
+% \fnpar{Third right-column}{\footnote{Third right-column
+% footnote.\label{fn:2R3}}}
+% \end{paracol}
+% \newpage
+% 
+% The example in the previous page should look weird because the order of
+% the third footnote in the left column \ref{fn:2L3} and the first in the
+% right \ref{fn:2R1} are reversed in their numbers and in the stack at the
+% page bottom.  However, the result is \emph{natural} because they are
+% numbered and stacked in the order of occurrence in the source |.tex| as
+% always done in any documents without \textsf{paracol} and with it but
+% \mcfnote{} footnote typesetting.  Since the \textsf{paracol} cannot
+% maintain the order automatically\footnote{
+% 
+% So far, because the maintenance is extremely tough.  But since it is not
+% impossible, some day you could have an improved version of
+% \textsf{paracol} with the automatic ordering.},
+% 
+% you have to maintain it by yourself.
+% 
+% The problem is partly solved by using \!\footnote! with its optional
+% argument \oarg{num} to number the first right-column and the third
+% left-column footnotes explicitly, i.e., to give
+% $\mathit{num}=\ref{fn:2L3}$ to the former and $\mathit{num}=\ref{fn:2R1}$
+% to the latter.  One caution is that you have to remember that \!\footnote!
+% with the optional \meta{num} does not update \counter{footnote} counter
+% and thus you have to do
+% \!\setcounter!|{footnote}{|\texttt{\ref{fn:2L3}}|}| or
+% \!\addtocounter!|{footnote}{2}| after the third left-column footnote.
+% 
+% This remedy, however, cannot change the stacking order of these two
+% footnotes of course.  Therefore, you need another trick with
+% \!\footnotemark! and \!\footnotetext! to stack the third left-column
+% footnote above the first right-column one.  More specifically, you can
+% solve the problem inserting
+% 
+% \begin{quote}
+% \!\footnotetext!\texttt{[\ref{fn:2R1}]}
+%     |{|\textit{text for the third left footnote}|}|
+% \end{quote}
+% 
+% somewhere between \!\footnote! commands for the second left-column and the
+% first right-column ones, e.g., at the end of the second left-column
+% paragraph, and attaching its mark to the appropriate word for the footnote
+% by \!\footnotemark!\texttt{[\ref{fn:2R1}]}, to have the following.
+% 
+% \Hrule
+% \begin{paracol}{2}
+% \fnpar{First left-column}{\footnote{First left-column
+% footnote.\label{fn:3L1}}}
+% \Fnpar{Second left-column}{\footnote{Second left-column
+% footnote.\label{fn:3L2}}}{
+% It is followed by \cs{footnotetext}\texttt{[\ref{fn:3L3}]}\marg{text}
+% and a \cs{switchcolumn}.}
+% \addtocounter{footnote}{1}
+% \footnotetext[\arabic{footnote}]{Third left-column footnote given by
+% \cs{footnotetext}\texttt{[\ref{fn:3L3}]}\marg{text} placed at the end of
+% the second left-column paragraph.\label{fn:3L3}}
+% \switchcolumn
+% \addtocounter{footnote}{1}
+% \Fnpar{First right-column}{\footnote[\arabic{footnote}]{First right-column
+% footnote whose number \ref{fn:3R1} is explicitly given by
+% \cs{footnote}\texttt{[\ref{fn:3R1}]}\marg{text}.\label{fn:3R1}}}{It is
+% followed by a \cs{switchcolumn*}.}
+% \addtocounter{footnote}{-1}
+% \switchcolumn*
+% Third and synchroized left-column paragraph\Dotfill\\
+% \Dotfill with a footnote whose mark
+% here\footnotemark[\arabic{footnote}]\Dotfill\\
+% \Dotfill is given by \!\footnotemark!\texttt{[\ref{fn:3L3}]}\Dotfill in
+% it.\\
+% It is followed by \!\addtocounter!|{footnote}{2}| and a \!\switchcolumn!.
+% \addtocounter{footnote}{1}
+% \switchcolumn
+% \fnpar{Second and synchronized right-column}{\footnote{Second right-column
+% footnote correctly following the first right-column one.\label{fn:3R2}}}
+% \fnpar{Third right-column}{\footnote{Third right-column
+% footnote.\label{fn:3R3}}}
+% \end{paracol}
+% \Hrule
+% 
+% Though this solution gives a good result, however, it has the following
+% two problems.  First, you have to explicitly specify the footnote number
+% through the optional arguments \oarg{num} of \!\footnote!,
+% \!\footnotetext! and \!\footnotemark!.  This problem is quite severe
+% because, for example, if you add a footnote somewhere preceding the
+% \env{paracol} environment in question, you have to modify all
+% \oarg{num} arguments of footnote-related commands in the environment.
+% This means that when the footnote addition is done in the first page of a
+% 100-page document having \env{paracol} environments with explicitly numbered
+% footnotes in every page, you have to make the corrections for environments
+% in 99 pages.  The other a little bit less severe problem is that you have
+% to keep \counter{footnote} counter having correct value by
+% \!\setcounter!, \!\addtocounter! or \!\stepcounter! for footnotes following
+% those with explicit numbering so that their numbers are given by the
+% default action of \!\footnote!.
+% 
+% To cope with these two problems, \textsf{paracol} provides you with the
+% \emph{starred} versions of \!\footnote! and its relatives as introduced in
+% Section~\ref{sec:ref-scfnote} and detailedly explained in the next
+% Section~\ref{sec:fnnp-starred}.
+% 
+% 
+% 
+% \subsection{Commands \cs{footnote*} and Relatives}
+% \label{sec:fnnp-starred}
+% 
+% \begin{description}
+% \item[\Midx{\!\footnote!}\texttt{*}\oarg{|+|disp}\marg{text}]\mbox{}
+% \Item[\Midx{\!\footnote!}\texttt{*}\oarg{|-|disp}\marg{text}]\mbox{}
+% \Item[\Midx{\!\footnote!}\texttt{*}\oarg{disp}\marg{text}]\mbox{}\par
+% The command is similar to its non-starred counterpart but the explicit
+% numbering with the optional argument is done in \emph{self-relative} or
+% \emph{base-displacement} style.  That is, if the optional argument has a
+% leading `|+|' or `|-|',  the number given to the footnote is
+% $f+\meta{disp}$ or $f-\meta{disp}$ respectively where $f$ is the value of
+% \counter{footnote} counter, or in other words the number given to the last
+% footnote\footnote{
+% 
+% If it is put by the ordinary \cs{footnote}.}.
+% 
+% Otherwise, i.e., the optional argument is a number without |+|/|-| sign,
+% the number given to the footnote is $b+\meta{disp}$ where $b$ is the base
+% value of \counter{footnote} counter at \beginparacol{} for the environment
+% in which the command appears, or in other words the number given to the
+% last \Preenv{} footnote\footnote{
+% 
+% Or the last footnote in the previous \env{paracol} environment,
+% etc.\label{fn:4L0}}.
+% 
+% In addition, unlike the non-starred version, this command updates
+% \counter{footnote} counter with the number given to the footnote, i.e.,
+% $f\gets f+\meta{disp}$, $f\gets f-\meta{disp}$ or $f\gets b+\meta{disp}$
+% is performed, so that following \!\footnote! without explicit numbering
+% option have numbers $f+1$, $f+2$ and so on with new $f$.
+% 
+% \begin{itemize}
+% \item
+% If the optional argument is not provided, it is assumed that |[+1]| is
+% given and thus \!\footnote!|*|\marg{text} acts as \!\footnote!\marg{text}.
+% \end{itemize}
+% 
+% \item[\Midx{\!\footnotemark!}\rm|*[|{[|+-|]}\meta{disp}{|]|}]\mbox{}\par
+% This command is a mixture of its non-starred counterpart and
+% \!\footnote!|*|.  That is the number for the footnote mark is calculated
+% in the way of \!\footnote!|*| and \counter{footnote} counter is updated.
+% 
+% \item[\Midx{\!\footnotetext!}\rm|*[|{[|+-|]}\meta{disp}{|]|}\marg{text}]
+% \mbox{}\par
+% Without the optional argument |[|[|+-|]\meta{disp}|]|, this command does what
+% \!\footnotetext!\marg{text} does but in addition increments
+% \counter{footnote} counter before that.  With the optional argument, on
+% the other hand, the number given to the footnote \meta{text} is calculated
+% as done in \!\footnote!, but the \counter{footnote} counter is not
+% updated.
+% \end{description}
+% 
+% With these starred commands, you can produce the following using the
+% base-displacement mechanism without worrying about the absolute value of
+% \!\footnote! counter and its change.
+% 
+% \Hrule
+% \begin{paracol}{2}
+% \tolerance5000\hbadness5000
+% \fnpar{First left-column}{\footnote{First left-column
+% footnote.\label{fn:4L1}}}
+% \Fnpar{Second left-column}{\footnote{Second left-column
+% footnote.\label{fn:4L2}}}{
+% It is followed by \cs{footnotetext}|*[3]|\marg{text} and a
+% \cs{switchcolumn}.}
+% \footnotetext*[3]{Third left-column footnote given by
+% \cs{footnotetext}|*[3]|\marg{text} placed at the end of
+% the second left-column paragraph to have
+% $\ref{fn:4L3}=\ref{fn:4L0}+3$.\label{fn:4L3}}
+% \switchcolumn
+% \Fnpar{First right-column}{\footnote*[4]{First right-column
+% footnote whose number \ref{fn:4R1} is given by
+% \cs{footnote}|*[4]|\marg{text} because
+% $\ref{fn:4R1}=\ref{fn:4L0}+4$.\label{fn:4R1}}}{It is followed by a
+% \cs{switchcolumn*}.}
+% \switchcolumn*
+% Third and synchronized left-column paragraph\Dotfill\\
+% \Dotfill with a footnote whose mark
+% here\footnotemark*[3]\Dotfill\\
+% is given by \!\footnotemark!|*[3]| because $\ref{fn:4L3}=\ref{fn:4L0}+3$.
+% It is followed by a \!\switchcolumn!.
+% \switchcolumn
+% \fnpar{Second and synchronized right-column}{\footnote*[5]{Second right-column
+% footnote produced by \cs{footnote}|*[5]|\marg{text} because
+% $\ref{fn:4R2}=\ref{fn:4L0}+5$.\label{fn:4R2}}}
+% \fnpar{Third right-column}{\footnote{Third right-column
+% footnote produced by \cs{footnote}\marg{text} because
+% $\ref{fn:4R3}=\ref{fn:4R2}+1$.\label{fn:4R3}}}
+% \end{paracol}
+% \newpage
+% 
+% The other way to produce the same result except for the absolute footnote
+% numbers is to use the self-relative mechanism and to exploit the progress
+% of \counter{footnote} counter as follows.
+% 
+% \Hrule
+% \begin{paracol}{2}
+% \tolerance5000\hbadness5000
+% \fnpar{First left-column}{\footnote{First left-column
+% footnote.\label{fn:5L1}}}
+% \Fnpar{Second left-column}{\footnote{Second left-column
+% footnote.\label{fn:5L2}}}{
+% It is followed by \cs{footnotetext}|*|\marg{text} and a
+% \cs{switchcolumn}.}
+% \footnotetext*{Third left-column footnote given by
+% \cs{footnotetext}|*|\marg{text} placed at the end of
+% the second left-column paragraph because it follows the second footnote
+% \ref{fn:5L2}.\label{fn:5L3}}
+% \switchcolumn
+% \Fnpar{First right-column}{\footnote{First right-column
+% footnote whose number \ref{fn:5R1} is given by
+% \cs{footnote}\marg{text} because
+% $\ref{fn:5R1}=\ref{fn:5L3}+1$ and \cs{footnotetext*} for \ref{fn:5L3} lets
+% \counter{footnote} have the value.\label{fn:5R1}}}{It is followed by a
+% \cs{switchcolumn*}.}
+% \switchcolumn*
+% Third and synchronized left-column paragraph\Dotfill\\
+% \Dotfill with a footnote whose mark
+% here\footnotemark*[-1]\Dotfill\\
+% is given by \!\footnotemark!|*[-1]| because $\ref{fn:5L3}=\ref{fn:5R1}-1$.
+% It is followed by a \!\switchcolumn!.
+% \switchcolumn
+% \fnpar{Second and synchronized right-column}{\footnote*[+2]{Second
+% right-column footnote produced by \cs{footnote}|*[+2]|\marg{text} because
+% $\ref{fn:5R2}=\ref{fn:5L3}+2$.\label{fn:5R2}}}
+% \fnpar{Third right-column}{\footnote{Third right-column
+% footnote produced by \cs{footnote}\marg{text} because
+% $\ref{fn:5R3}=\ref{fn:5R2}+1$.\label{fn:5R3}}}
+% \end{paracol}
+% \Hrule
+% 
+% It depends on the structure of your document which of the
+% base-displacement and self-relative is better.  If your document has
+% frequent switching between single- and multi-column text typesetting and
+% thus the contents of a \env{paracol} environment is relatively small, the
+% base-displacement is a good choice because you may concentrate on one
+% base value of \counter{footnote} counter.  Otherwise, especially when your
+% document consists of one single and large \env{paracol} environment, the
+% base-displacement is almost equivalent to maintaining absolute values and
+% thus the self-relative should be preferred.
+% 
+% Note that if the last \!\footnote! or \!\footnotemark! in a \env{paracol}
+% environment is starred, the command lets \counter{footnote} counter have
+% some value smaller than that for the last stacked footnote.  For example, 
+% if the second and third right-column footnotes \ref{fn:5R2} and
+% \ref{fn:5R3} are omitted from the example above, the last footnote-related
+% command will be \!\footnotemark!|*[-1]| which makes the counter at
+% \Endparacol{} \ref{fn:5L3} rather than \ref{fn:5R1}.  You may not worry
+% about this problem, however, because \Endparacol{} automatically maintains
+% the counter letting it have $b+n$ where $n$ is the number of \!\footnote!
+% and \!\footnotemark! in the environment, if the maintenance is ordered by
+% the command \!\fncounteradjustment! which is automatically executed by
+% \!\footnotelayout! with the argument |p| or |m|.
+% 
+% 
+% 
+% \subsection{Page Break}
+% \label{sec:fnnp-pbreak}
+% 
+% When a \env{paracol} environment with footnotes lays across a page boundary,
+% you could have some weird result even if the environment have just one
+% \!\switchcolumn! as shown below.
+% 
+% \Hrule
+% \begin{paracol}{2}
+% First left-column paragraph \Dotfill\\
+% \Dotfill with a footnote\footnote{First left-column
+% footnote.\label{fn:6L1}}\Dotfill\\
+% \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\
+% \Dotfill in it.
+% \par
+% Second left-column paragraph \Dotfill\\
+% \Dotfill with a footnote\footnote{Second left-column
+% footnote.\label{fn:6L2}}
+% \Dotfill in it.
+% \switchcolumn
+% First right-column paragraph \Dotfill\\
+% \Dotfill with a footnote\footnote{First right-column
+% footnote weirdly placed here while the footnoted main text is in the
+% previous page.\label{fn:6R1}}\Dotfill\\
+% \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\
+% \Dotfill in it.
+% \par
+% Second right-column paragraph \Dotfill\\
+% \Dotfill with a footnote\footnote{Second right-column
+% footnote whose mark in the main text gives impression that footnote
+% numbering jumps from \ref{fn:6L2} to \ref{fn:6R2}.\label{fn:6R2}}
+% \Dotfill in it.
+% \end{paracol}
+% \Hrule
+% 
+% Since the part of the source |.tex| for this example above is
+% fundamentally same as that in p.~\pageref{sec:fnnp} at the beginning of
+% this Section~\ref{sec:fnnp}, footnotes are simply numbered in
+% left-column-first manner without any tricks.  However it results in
+% giving an impression that two paragraphs in each of both columns at the
+% bottom of the last page have footnote marks of inconsecutive numbers
+% \ref{fn:6L1} and \ref{fn:6R1} due to the second left-column paragraph and
+% the footnote \ref{fn:6L2} in it.  More weirdly, the first right-column
+% footnote \ref{fn:6R1} is not put in the last page where its mark is shown
+% but is stacked below \ref{fn:6L2} in this page.
+% 
+% The reason why this happens is that a footnote is not immediately put to
+% the bottom of the page where its mark resides but to the page constructing
+% at the time when the footnote is processed at the end of the paragraph in
+% which the corresponding \!\footnote! (or \!\footnotetext!)
+% occurs\footnote{
+% 
+% More accurately, the footnote is kept in a place in \TeX{} together with
+% other preceding but still unprocessed footnotes and then \TeX{} examines
+% them at the end of a paragraph in which a page break is found to decide
+% whether each of them is included in the page just being completed.}.
+% 
+% Therefore, it may happen even in an ordinary single-column document or a
+% \env{paracol}ed multi-column one with \Mcfnote{}s that a
+% footnote is thrown to the page $p+1$ next to the page $p$ in which its
+% mark is left, when the mark is placed around the bottom of the page
+% $p$.
+% 
+% This footnote placement mechanism becomes clearly visible in the example
+% above in which the footnote \ref{fn:6R1} is processed {\em after} the
+% second left-column paragraph is processed to complete the last page giving
+% no chance to the footnote placed in the page\footnote{%
+% 
+% In fact, even \cs{footnote} for the footnote is processed after the page
+% break in this case.}.
+% 
+% Therefore, the solution of this placement problem is to let the first
+% right-column footnote processed {\em before} the page is broken by the
+% progress of the left-column.  That is, in the solution shown below the
+% author inserted \!\switchcolumn! after the first left-column paragraph to
+% let the first right-column paragraph and its footnote are processed, and
+% then did \!\switchcolumn! again after the right-column paragraph to go
+% back to the left-column.
+% 
+% \Hrule
+% \begin{paracol}{2}
+% First left-column paragraph \Dotfill\\
+% \Dotfill with a footnote\footnote{First left-column
+% footnote.\label{fn:7L1}}\Dotfill\\
+% \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\
+% \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\
+% \Dotfill\\
+% \Dotfill in it.\\
+% It is followed by a \!\switchcolumn!.
+% \par\switchcolumn
+% First right-column paragraph \Dotfill\\
+% \Dotfill with a footnote\footnote{First right-column
+% footnote which is now placed in this page where its mark \ref{fn:7R1}
+% resides.\label{fn:7R1}}\Dotfill\\
+% \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\
+% \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\ \Dotfill\\
+% \Dotfill in it.\\
+% It is followed by a \!\switchcolumn! to go back to the left column.
+% \par\newpage\switchcolumn
+% Second left-column paragraph \Dotfill\\
+% \Dotfill with a footnote\footnote{Second left-column
+% footnote whose number \ref{fn:7L2} follows the right-column footnote
+% \ref{fn:7R1} in the last page.\label{fn:7L2}}
+% \Dotfill in it.\\
+% It is also followed by a \!\switchcolumn!.
+% \switchcolumn
+% Second right-column paragraph \Dotfill\\
+% \Dotfill with a footnote\footnote{Second right-column
+% footnote whose number \ref{fn:7R2} follows the left-column footnote
+% \ref{fn:7L2}.\label{fn:7R2}}
+% \Dotfill in it.
+% \end{paracol}
+% \Hrule
+% 
+% Unfortunately, this tactics does not always solve the problem.  If a
+% left-column paragraph has a page break in it and a footnote before the
+% break, doing \!\switchcolumn! after the paragraph is too late to let
+% right-column footnotes reside in the page just having been broken, while
+% inserting \!\switchcolumn! before the paragraph should cause incorrect
+% stacking order.
+% 
+% The remedy for this problem is similar to that shown in
+% Section~\ref{sec:fnnp-multsc} to cope with multiple \!\switchcolumn! in a
+% \env{paracol} environment.  Here it is shown a little bit more formally.
+% Suppose we have a page in a \env{paracol} environment in which a page
+% break occurs in $p_l$-th and $p_r$-th paragraphs in the left and right
+% columns respectively.  Thus we have $p_l-1$ and $p_r-1$ completed
+% paragraphs in each of both columns.  Let $n_l$ (resp.\ $n_r$) be the
+% number of footnotes in the pre-break left-column (resp.\ right-column)
+% paragraphs, and $m_l$ (resp.\ $m_r$) be the number of pre-break footnotes
+% in the $p_l$-th (resp.\ $p_r$-th) paragraph.  Thus we have $n_l+m_l$
+% (resp.\ $n_r+m_r$) footnotes in the left (resp.\ right) column of the page
+% before the break.  The following construct assures that those footnotes
+% are properly numbered and stacked at the bottom of the page.
+% 
+% \begin{list}{}{\rightmargin\leftmargin \itemindent-.5\leftmargin
+% \listparindent\itemindent \leftmargin1.5\leftmargin \parsep0pt}\it\item
+% First to $(p_l-1)$-th paragraphs with $n_l$ footnotes in total given by
+% {\rm\!\footnote!\marg{text}}.\par
+% {\rm\!\footnotetext!|*{|{\it 1st footnote in $p_l$-th paragraph}|}|}\par
+% \mbox{\qquad}\ldots\par
+% {\rm\!\footnotetext!|*{|{\it$m_l$-th footnote in $p_l$-th paragraph}|}|}\par
+% \!\switchcolumn!\par
+% First to $(p_r-1)$-th paragraphs with $n_r$ footnotes in total given by
+% {\rm\!\footnote!\marg{text}}.\par
+% {\rm\!\footnotetext!|*{|{\it 1st footnote in $p_r$-th paragraph}|}|}\par
+% \mbox{\qquad}\ldots\par
+% {\rm\!\footnotetext!|*{|{\it$m_r$-th footnote in $p_r$-th paragraph}|}|}\par
+% \!\switchcolumn!\par
+% $p_l$-th paragraph whose first footnote mark is given by
+% {\rm\!\footnotemark!|*[-|$(m_l{+}n_r{+}m_r{-1})$|]|}, while second to
+% $m_l$-th ones are given by \!\footnotemark! without {\rm|*|} nor optional
+% {\rm\oarg{num}}.  The first subsequent footnotes beyond the page break, if
+% any, is given by {\rm\!\footnote!|*[+|$(n_r{+}m_r{+1})$|]|\marg{text}}
+% while further subsequent ones are given by
+% {\rm\!\footnote!\marg{text}}.\par
+% \!\switchcolumn!\par
+% $p_r$-th paragraph whose first footnote mark is given by
+% {\rm\!\footnotemark!|*[-|$(m_r{+}k_l{-1})$|]|} where $k_l$ is the number
+% of left-column footnotes beyond the break, while second to $m_r$-th ones
+% are given by \!\footnotemark!.  The first subsequent footnotes beyond the
+% page break, if any, is given by
+% {\rm\!\footnote!|*[+|$(k_l{+1})$|]|\marg{text}}, while further subsequent
+% ones are given by {\rm\!\footnote!\marg{text}}.
+% \end{list}
+% %
+% The example shown in the next two pages is for the case of
+% $p_l=p_r=n_l=n_r=m_l=m_r=k_l=2$.
+% 
+% \newpage
+% \Hrule
+% \begin{paracol}{2}
+% First left-column paragraph with two footnotes\break
+% \mbox{}\Dotquad here\footnote{First left-column footnote given by
+% \cs{footnote}\marg{text}.\label{fn;8L1}} by
+% \!\footnote!\marg{text}\Dotfill\\
+% \Dotquad and here\footnote{Second left-column footnote also given by
+% \cs{footnote}\marg{text}.\label{fn:8L2}} also by
+% \!\footnote!\marg{text}\Dotfill\\
+% \Dotfill\\\Dotfill\\\Dotfill\\\Dotfill\\\Dotfill\\
+% \Dotfill\\\Dotfill\\\Dotfill\\\Dotfill\\\Dotfill\\
+% \Dotfill\\\Dotfill\\\Dotfill\\\Dotfill\\\Dotfill\\
+% followed by a series of \!\footnotetext!|*|\marg{text} and then a
+% \!\switchcolumn!.
+% \footnotetext*{Third left-column footnote given by
+% \cs{footnotetext*}\marg{text}.\label{fn:8L3}}
+% \footnotetext*{Fourth left-column footnote given by
+% \cs{footnotetext*}\marg{text}.\label{fn:8L4}}
+% 
+% \switchcolumn
+% First right-column paragraph with two footnotes\break
+% \mbox{}\Dotquad here\footnote{First right-column footnote given by
+% \cs{footnote}\marg{text}.\label{fn;8R1}} by
+% \!\footnote!\marg{text}\Dotfill\\
+% \Dotquad and here\footnote{Second right-column footnote also given by
+% \cs{footnote}\marg{text}.\label{fn:8R2}} also by
+% \!\footnote!\marg{text}\Dotfill\\
+% \Dotfill\\\Dotfill\\\Dotfill\\\Dotfill\\\Dotfill\\
+% \Dotfill\\\Dotfill\\\Dotfill\\\Dotfill\\\Dotfill\\
+% \Dotfill\\\Dotfill\\\Dotfill\\\Dotfill\\\Dotfill\\
+% followed by a series of \!\footnotetext!|*|\marg{text} and then a
+% \!\switchcolumn!.
+% \footnotetext*{Third right-column footnote given by
+% \cs{footnotetext*}\marg{text}.\label{fn:8R3}}
+% \footnotetext*{Fourth right-column footnote given by
+% \cs{footnotetext*}\marg{text}.\label{fn:8R4}}
+% 
+% \switchcolumn
+% Second left-column paragraph across two pages\break
+% \mbox{}\Dotquad with two pre-break footnotes\Dotfill\\
+% \Dotquad here\footnotemark*[-5] by \!\footnotemark!|*[-5]|
+% because $m_l+n_r+m_r-1=2+2+2-1=5$ and thus
+% $\ref{fn:8L3}=\ref{fn:8R4}-5$\Dotfill\\
+% \Dotquad and here\footnotemark{} by \!\footnotemark!\Dotfill\\
+% \Dotfill\\\Dotfill\\\Dotfill\\\Dotfill\\\Dotfill\\
+% \Dotfill\\\Dotfill\\\Dotfill\\\Dotfill\\\Dotfill\\
+% \Dotfill\\\Dotfill\\\Dotfill\\\Dotfill\\\Dotfill\\
+% \Dotfill\\\Dotfill\\
+% \Dotquad and two post-break footnotes\Dotfill\\
+% \Dotquad here\footnote*[+5]{Fifth left-column footnote given by
+% \cs{footnote}|*[+5]| because $n_r+m_r+1=2+2+1=5$ and thus
+% $\ref{fn:8L5}=\ref{fn:8L4}+5$.\label{fn:8L5}} by
+% \!\footnote!|*[+5]|\marg{text}\Dotfill\\
+% \Dotquad and here\footnote{Sixth left-column foootnote given by
+% \cs{footnote}\marg{text}.\label{fn:8L6}} by
+% \!\footnote!\marg{text}\Dotfill\\
+% followed by a \!\switchcolumn!.
+% 
+% \switchcolumn
+% Second right-column paragraph across two pages\break
+% \mbox{}\Dotquad with two pre-break footnotes\Dotfill\\
+% \Dotquad here\footnotemark*[-3] by \!\footnotemark!|*[-3]|
+% because $m_r+k_l-1=2+2-1=3$ and thus
+% $\ref{fn:8R3}=\ref{fn:8L6}-3$\Dotfill\\
+% \Dotquad and here\footnotemark{} by \!\footnotemark!\Dotfill\\
+% \Dotfill\\\Dotfill\\\Dotfill\\\Dotfill\\\Dotfill\\
+% \Dotfill\\\Dotfill\\\Dotfill\\\Dotfill\\\Dotfill\\
+% \Dotfill\\\Dotfill\\\Dotfill\\\Dotfill\\\Dotfill\\
+% \Dotfill\\\Dotfill\\
+% \Dotquad and two post-break footnotes\Dotfill\\
+% \Dotquad here\footnote*[+3]{Fifth right-column footnote given by
+% \cs{footnote}|*[+3]| because $k_l+1=3$ and thus
+% $\ref{fn:8R5}=\ref{fn:8R4}+3$.\label{fn:8R5}} by
+% \!\footnote!|*[+3]|\marg{text}\Dotfill\\
+% \Dotquad and here\footnote{Sixth right-column foootnote given by
+% \cs{footnote}\marg{text}.\label{fn:8R6}} by
+% \!\footnote!\marg{text}\Dotfill.
+% \end{paracol}
+% \Hrule
+% 
+% Note that though the remedy works well as shown above, it is not a good
+% idea to do that when you are writing draft versions of your document
+% because page break points go up and down by your modifications to the
+% document.  Therefore, it is recommended to put all footnotes by
+% non-starred \!\footnote! until your document becomes perfect except for
+% footnote numbering and placement and then to adjust them by the techique
+% described in this section.
+% 
+% \endinput
-- 
cgit v1.2.3

