summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/eledmac
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-03-06 22:25:59 +0000
committerKarl Berry <karl@freefriends.org>2015-03-06 22:25:59 +0000
commitf9aaa3838259336c024df786fbd42d9b19e5c13e (patch)
treec293fb93daec90e11683c8e7c46ef73c3211ac33 /Master/texmf-dist/source/latex/eledmac
parenta1de98c2e6a9abc9f7a2848511ce420c8e9e1b0c (diff)
eledmac (6mar15)
git-svn-id: svn://tug.org/texlive/trunk@36447 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/eledmac')
-rw-r--r--Master/texmf-dist/source/latex/eledmac/eledmac.dtx153
-rw-r--r--Master/texmf-dist/source/latex/eledmac/eledpar.dtx493
2 files changed, 558 insertions, 88 deletions
diff --git a/Master/texmf-dist/source/latex/eledmac/eledmac.dtx b/Master/texmf-dist/source/latex/eledmac/eledmac.dtx
index 43aeba86d64..e92cdf15132 100644
--- a/Master/texmf-dist/source/latex/eledmac/eledmac.dtx
+++ b/Master/texmf-dist/source/latex/eledmac/eledmac.dtx
@@ -51,7 +51,7 @@
%
% \fi
%
-% \CheckSum{10643}
+% \CheckSum{10683}
%
% \makeatletter
% \newcommand*{\DescribeIt}{\leavevmode\@bsphack\begingroup\MakePrivateLetters
@@ -216,6 +216,8 @@
% \changes{v1.16.0}{2015/01/23}{Compatibility of standard footnotes with some biblatex styles.}
% \changes{v1.16.0}{2015/01/23}{New \cs{stanzaindent} command.}
% \changes{v1.18.0}{2015/02/23}{Compatibility with \LuaLaTeX\ RTL languages.}
+% \changes{v1.19.0}{2015/03/06}{\cs{maxhXnotes} and \cs{maxhnotesX} work now for both two-columns and three-columns setting.}
+% \changes{v1.19.0}{2015/03/06}{Compatibility with \Lpack{eledpar} v.1.13.0.}
% \hyphenation{man-u-script man-u-scripts}
%
%
@@ -768,7 +770,7 @@
% \changes{v1.1}{2012/09/25}{Add \cs{labelpstarttrue}.}
% With the \cs{labelpstarttrue} command, a \cs{label} added just after a \cs{pstart} will refer to the number of this pstart.
% \subsubsection{Languages written in Right to Left}
-% If you use languages writtin in Right to Left, we \LuaLaTeX\\ or \XeLaTeX,
+% If you use languages written in right to left, we \LuaLaTeX\ or \XeLaTeX, so
% you must switch text direction \cs{before} the \cs{pstart} command.
% \subsubsection{Memory limits}
% \textbf{This paragraph is kept for history, but problem described below should not appear with \Lpack{eledmac}.}
@@ -1501,7 +1503,7 @@
%
%
% Be careful with this setting: it could make the notes be written on the bottom pages number.
-% \DescribeMacro{\maxhXnotes}
+% \DescribeMacro{\maxhXnotes}\label{maxhXnotes}
% By default, one series of critical notes can take 80\% of the page size, before being broken to the next page.
% If you want to change the size use \cs{maxhXnotes}\oarg{s}\marg{l}.
% Be careful : the length can't be flexible, and is relative to the the current font.
@@ -2790,7 +2792,7 @@
% \begin{macrocode}
%<*code>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{eledmac}[2015/02/23 v1.18.0 LaTeX port of EDMAC]%
+\ProvidesPackage{eledmac}[2015/03/06 v1.19.0 LaTeX port of EDMAC]%
% \end{macrocode}
%
% Generally, these are the modifications to the original.
@@ -3264,7 +3266,7 @@
% \begin{macro}{\@l@dtempcntb}
% In imitation of \LaTeX, we create a couple of scratch counters.
%
-% \LaTeX\ already defines \cs{@tempcnta} and \cs{@tempcntb} but Peter Wilson have
+% \LaTeX\ already defines \cs{@tempcnta} and \cs{@tempcntb} but Peter Wilson
% found in the past that it can be dangerous to use these (for example
% one of the AMS packages did something nasty to the \Lpack{ccaption}
% package's use of one of these).
@@ -7195,12 +7197,24 @@
%
% \begin{macro}{\footsplitskips}
% Some setup code that is common for a variety of the footnotes.
+% The setup is for :
+% \begin{itemize}
+% \item \cs{interlinepenalty}.
+% \item \cs{splittopskip} (skip before last part of notes that flow from one page to another).
+% \item \cs{splitmaxdepth}.
+% \item \cs{floatingpenalty}, that is penalty values being added when a long note flows from one page to another.
+% Here, we let it to 0 when we are processing parallel pages in \Lpack{eledpar}, in order to allow notes to flow from left to right pages and \emph{vice-versa}.
+% Otherwise, we let it to \cs{@MM}, which is the standard \LaTeX\ \cs{floatingpenalty}.
+% \end{itemize}
% \changes{v0.7}{2005/02/18}{Added \cs{footsplitskips} for use in many
% footnote styles}
+% \changes{v1.19.0}{2015/03/06}{\cs{footsplitskips} doesn't set \cs{floatingpenalty} to \cs{@MM} when processing parallel pages.}
% \begin{macrocode}
\newcommand*{\footsplitskips}{%
\interlinepenalty=\interfootnotelinepenalty
- \floatingpenalty=\@MM
+ \unless\ifl@dprintingpages%
+ \floatingpenalty=\@MM%
+ \fi%
\splittopskip=\ht\strutbox \splitmaxdepth=\dp\strutbox
\leftskip=\z@skip \rightskip=\z@skip}
@@ -7354,7 +7368,7 @@
% \end{quote}
% \LaTeX\ tends to use a lot of counters and packages should try and
% minimise the number of new ones they create. In line with this
-% Peter Wilson have reverted to traditional booleans.
+% Peter Wilson has reverted to traditional booleans.
%
% \begin{macro}{\ifl@d@pnum}
% \begin{macro}{\ifl@d@ssub}
@@ -7695,6 +7709,7 @@
\expandafter\let\csname #1footnoterule\endcsname=%
\normalfootnoterule
\count\csname #1footins\endcsname=1000
+ \csxdef{default@#1footins}{1000}%Use this to confine the notes to one side only
\dimen\csname #1footins\endcsname=\csuse{maxhXnotes@#1}
\skip\csname #1footins\endcsname=\csuse{beforeXnotes@#1}
% \end{macrocode}
@@ -7756,6 +7771,7 @@
\expandafter\let\csname #1footfmt\endcsname=\parafootfmt
\expandafter\let\csname #1footgroup\endcsname=\para@footgroup
\count\csname #1footins\endcsname=1000
+ \csxdef{default@#1footins}{1000}%Use this to confine the notes to one side only
\dimen\csname #1footins\endcsname=\csuse{maxhXnotes@#1}
\skip\csname #1footins\endcsname=\csuse{beforeXnotes@#1}
\para@footsetup{#1}
@@ -8180,6 +8196,7 @@
\expandafter\let\csname v#1footnote\endcsname=\threecolvfootnote
\expandafter\let\csname #1footfmt\endcsname=\threecolfootfmt
\expandafter\let\csname #1footgroup\endcsname=\threecolfootgroup
+ \dimen\csname #1footins\endcsname=\csuse{maxhXnotes@#1}%
\threecolfootsetup{#1}
% \end{macrocode}
% The additional setup for minipages.
@@ -8217,6 +8234,7 @@
% \begin{macrocode}
\newcommand*{\threecolfootsetup}[1]{%
\count\csname #1footins\endcsname 333
+ \csxdef{default@#1footins}{333}%Use this to confine the notes to one side only
\multiply\dimen\csname #1footins\endcsname \thr@@}
% \end{macrocode}
% \end{macro}
@@ -8301,8 +8319,8 @@
% box. Here, we just print the \cs{line} which comes out of
% \cs{rigidbalance} directly, without any re-boxing.
% \begin{macrocode}
-\newcommand*{\threecolfootgroup}[1]{{\notefontsetup
- {\csuse{Xnotefontsize@#1}\noindent\csuse{txtbeforeXnotes@#1}}\par
+\newcommand*{\threecolfootgroup}[1]{{\csuse{Xnotefontsize@#1}%
+ \noindent\csuse{txtbeforeXnotes@#1}\par%
\splittopskip=\ht\strutbox
\expandafter
\rigidbalance\csname #1footins\endcsname \thr@@ \splittopskip}}
@@ -8353,6 +8371,7 @@
\expandafter\let\csname v#1footnote\endcsname=\twocolvfootnote
\expandafter\let\csname #1footfmt\endcsname=\twocolfootfmt
\expandafter\let\csname #1footgroup\endcsname=\twocolfootgroup
+ \dimen\csname #1footins\endcsname=\csuse{maxhXnotes@#1}%
\twocolfootsetup{#1}
% \end{macrocode}
% The additional setup for minipages.
@@ -8378,6 +8397,7 @@
% \begin{macrocode}
\newcommand*{\twocolfootsetup}[1]{%
\count\csname #1footins\endcsname 500
+ \csxdef{default@#1footins}{500}%Use this to confine the notes to one side only
\multiply\dimen\csname #1footins\endcsname \tw@}
% \end{macrocode}
% \begin{macrocode}
@@ -8405,7 +8425,7 @@
% \end{macrocode}
% \begin{macrocode}
\newcommand*{\twocolfootgroup}[1]{{\csuse{Xnotefontsize@#1}
- {\csuse{Xnotefontsize@#1}\noindent\csuse{txtbeforeXnotes@#1}}\par
+ \noindent\csuse{txtbeforeXnotes@#1}\par%
\splittopskip=\ht\strutbox
\expandafter
\rigidbalance\csname #1footins\endcsname \tw@ \splittopskip}}
@@ -8832,6 +8852,7 @@
\expandafter\let\csname footgroup#1\endcsname=\normalfootgroupX
\expandafter\let\csname footnoterule#1\endcsname=\normalfootnoteruleX
\count\csname footins#1\endcsname=1000
+ \csxdef{default@footins#1}{1000}%Use to have note only for one side
\dimen\csname footins#1\endcsname=\csuse{maxhnotesX@#1}
\skip\csname footins#1\endcsname=\csuse{beforenotesX@#1}
% \end{macrocode}
@@ -8860,6 +8881,7 @@
\expandafter\let\csname regvfootnote#1\endcsname=\twocolvfootnoteX
\expandafter\let\csname footfmt#1\endcsname=\twocolfootfmtX
\expandafter\let\csname footgroup#1\endcsname=\twocolfootgroupX
+ \dimen\csname #1footins\endcsname=\csuse{maxhnotesX@#1}%
\twocolfootsetupX{#1}
\expandafter\let\csname mpvfootnote#1\endcsname=\mpnormalvfootnoteX
\expandafter\let\csname mpfootgroup#1\endcsname=\mptwocolfootgroupX
@@ -8874,6 +8896,7 @@
% \begin{macrocode}
\newcommand*{\twocolfootsetupX}[1]{%
\count\csname footins#1\endcsname 500
+ \csxdef{default@footins#1}{500}%Use this to confine the notes to one side only
\multiply\dimen\csname footins#1\endcsname by \tw@}
\newcommand*{\mptwocolfootsetupX}[1]{%
\count\csname mpfootins#1\endcsname 500
@@ -8968,6 +8991,7 @@
\expandafter\let\csname regvfootnote#1\endcsname=\threecolvfootnoteX
\expandafter\let\csname footfmt#1\endcsname=\threecolfootfmtX
\expandafter\let\csname footgroup#1\endcsname=\threecolfootgroupX
+ \dimen\csname #1footins\endcsname=\csuse{maxhnotesX@#1}%
\threecolfootsetupX{#1}
\expandafter\let\csname mpvfootnote#1\endcsname=\mpnormalvfootnoteX
\expandafter\let\csname mpfootgroup#1\endcsname=\mpthreecolfootgroupX
@@ -8982,6 +9006,7 @@
% \begin{macrocode}
\newcommand*{\threecolfootsetupX}[1]{%
\count\csname footins#1\endcsname 333
+ \csxdef{default@footins#1}{333}%Use this to confine the notes to one side only
\multiply\dimen\csname footins#1\endcsname by \thr@@}
\newcommand*{\mpthreecolfootsetupX}[1]{%
\count\csname mpfootins#1\endcsname 333
@@ -9078,6 +9103,7 @@
\expandafter\let\csname footgroup#1\endcsname=\para@footgroupX
\expandafter\let\csname footnoterule#1\endcsname=\normalfootnoteruleX
\count\csname footins#1\endcsname=1000
+ \csxdef{default@footins#1}{1000}%Use this to confine the notes to one side only
\dimen\csname footins#1\endcsname=\csuse{maxhnotesX@#1}
\skip\csname footins#1\endcsname=\csuse{beforenotesX@#1}
\expandafter\let\csname mpvfootnote#1\endcsname=\mppara@vfootnoteX
@@ -9333,17 +9359,37 @@
% \end{macro}
%
% \section{Footnotes' output}
+% \begin{macro}{\print@notesX}
% \begin{macro}{\doxtrafeeti}
% \begin{macro}{\doreinxtrafeeti}
% We have to add all the new kinds of familiar footnotes to the output
% routine. These are the class 1 feet\index{class 1 feet}.
+% The normal way to add one series.
+% \cs{print@Xnotes} is replaced by \Lpack{eledpar} when using \cs{Pages}.
+% \begin{macrocode}
+\newcommand\print@notesX[1]{%
+ \csuse{footstart#1}{#1}%
+ \csuse{footgroup#1}{#1}%
+}%
+% \end{macrocode}
+% We print all the series of notes by looping on them.
+% We check before printing them that there are not voided.
+% We also call \cs{correct@footinsX@box} if \Lpack{eledpar} is loaded.
+% Read \Lpack{eledpar} handbook about this macro.
% \begin{macrocode}
\newcommand*{\doxtrafeeti}{%
\setbox\@outputbox \vbox{%
- \unvbox\@outputbox
- \def\do##1{\ifvoid\csuse{footins##1}\else\csuse{footstart##1}{##1}\csuse{footgroup##1}{##1}\fi}
- \dolistloop{\@series}%
- }}
+ \unvbox\@outputbox%
+ \def\do##1{%
+ \ifvoid\csuse{footins##1}\else%
+ \ifdefined\correct@footinsX@box%
+ \correct@footinsX@box{##1}%
+ \fi%
+ \print@notesX{##1}%
+ \fi%
+ }%
+ \dolistloop{\@series}}%
+ }%
\newcommand{\doreinxtrafeeti}{%
\def\do##1{\ifvoid\csuse{footins##1}\else\insert\csuse{footins##1}{\unvbox\csuse{footins##1}}\fi}%
@@ -9353,6 +9399,7 @@
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\addfootinsX}
% Juste for backward compatibility: print a warning message.
@@ -9597,6 +9644,13 @@
\xifinlist{#1}{\@series}{\led@warn@SeriesStillExist{#1}}%
{%
% \end{macrocode}
+% \subsection{Init specific to \Lpack{eledpar}}
+% When calling \cs{newseries@} after having loaded \Lpack{eledpar}
+% \begin{macrocode}
+ \ifdefined\newseries@eledpar%
+ \newseries@eledpar{#1}%
+ \fi%
+% \end{macrocode}
% \subsection{Create all commands to memorize display options}
% \begin{macrocode}
\newtoggle{Xlemmadisablefontselection@#1}
@@ -9650,13 +9704,13 @@
\newtoggle{notesXwidthliketwocolumns@#1}%
% \end{macrocode}
% \subsection{Create inserts, needed to add notes in foot}
-% Concerning inserts, see chapter 15 of the TeXBook by D. Knuth
+% As regards inserts, see chapter 15 of the TeXBook by D. Knuth
% \begin{macrocode}
- \expandafter\newinsert\csname mpfootins#1\endcsname
- \expandafter\newinsert\csname footins#1\endcsname
- \expandafter\newinsert\csname #1footins\endcsname
- \expandafter\newinsert\csname mp#1footins\endcsname
+ \expandafter\newinsert\csname footins#1\endcsname%
+ \expandafter\newinsert\csname #1footins\endcsname%
+ \expandafter\newinsert\csname mpfootins#1\endcsname%
+ \expandafter\newinsert\csname mp#1footins\endcsname%
% \end{macrocode}
% \subsection{Create commands for critical apparatus, \cs{Xfootnote}}
% Note the double \# in command: it's because command is made inside another command.
@@ -9715,7 +9769,9 @@
\newcommand{\content}{##1}%
\stepcounter{footnote#1}%
\protected@csxdef{@thefnmark#1}{\csuse{thefootnote#1}}%
- \csuse{@footnotemark#1}%
+ \nottoggle{nomk@}%Nomk is set to true when using \footnoteXnomk with eledpar
+ {\csuse{@footnotemark#1}}%
+ {}%
\csuse{vfootnote#1}{#1}{\expandonce\content}\m@mmf@prepare%
\endgroup%
}
@@ -9926,6 +9982,7 @@
\newhookcommand@series{afterXrule}
+
% \end{macrocode}
% \end{macro}
% \begin{macro}{\newhookcommand@series@reload}
@@ -10014,6 +10071,12 @@
\newtoggle{nosep@}
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\nomk@}
+%\cs{nomk@} toggle is used by \Lpack{eledpar} to remove the footnote mark in the text when using \cs{footnoteXmk}. Read \Lpack{eledpar} handbook.
+% \begin{macrocode}
+\newtoggle{nomk@}%
+% \end{macrocode}
+% \end{macro}
% \subsection{Alias}
% \begin{macro}{\nolemmaseparator}
%\cs{nolemmaseparator}\oarg{series} is just an alias for \cs{lemmaseparator}\oarg{series}\verb|{}|.
@@ -10109,20 +10172,20 @@
% It is called by \cs{printlinefootnote}
% depending of the options about repeating line numbers.
% The first argument is line information, the second is the notes series (A, B, C. etc.)
-% \begin{macrocode}
+% \begin{macrocode}
\newcommand{\printlinefootnotearea}[2]{%
\printbeforenumberinfootnote{#2}%
\csuse{Xnotenumfont@#2}%
\boxfootnotenumbers{#1}{#2}%
\printafternumberinfootnote{#2}%
}%
-% \end{macrocode}
+% \end{macrocode}
% \end{macro}
% \begin{macro}{\boxfootnotenumbers}
% Depending on the user settings, this macro will box line numbers (or not).
% The first argument is line information, the second is the notes series (A, B, C. etc.)
% The previous \cs{printlinefootnotearea} calls it.
-% \begin{macrocode}
+% \begin{macrocode}
\newcommand{\boxfootnotenumbers}[2]{%
\ifdimequal{\csuse{boxlinenum@#2}}{0pt}{%
\printlinefootnotenumbers{#1}{#2}%
@@ -10133,7 +10196,7 @@
\hfill}%
}%
}%
-% \end{macrocode}
+% \end{macrocode}
% \end{macro}
% \begin{macro}{\printlinefootnotenumbers}
% This macro prints, if needed, the pstart number and the line number.
@@ -10391,14 +10454,36 @@
% \end{macro}
%
% \begin{macro}{\@opxtrafeetii}
-% The extra critical feet to be aded to the output.
+% \begin{macro}{\print@Xnotes}
+% The extra critical feet to be added to the output.
% \changes{v0.4.1}{2004/03/06}{Added \cs{@opxtrafeetii}}
+% The normal way to add one series.
+% \cs{print@Xnotes} is replaced by \Lpack{eledpar} when using \cs{Pages}.
+% \begin{macrocode}
+\newcommand\print@Xnotes[1]{%
+ \csuse{#1footstart}{#1}%
+ \csuse{#1footgroup}{#1}%%
+}%
+% \end{macrocode}
+% We print all series of notes by looping on them.
+% We check before printing them that they are not voided.
+% We also call \cs{correct@Xfootins@box} if \Lpack{eledpar} is loaded.
+% Read \Lpack{eledpar} handbook about this macro.
% \begin{macrocode}
\newcommand*{\@opxtrafeetii}{%
- \def\do##1{\ifvoid\csuse{##1footins}\else\csuse{##1footstart}{##1}\csuse{##1footgroup}{##1}\fi}
- \dolistloop{\@series}}
+ \def\do##1{%
+ \ifvoid\csuse{##1footins}\else%
+ \ifdefined\correct@Xfootins@box%
+ \correct@Xfootins@box{##1}%
+ \fi%
+ \print@Xnotes{##1}%
+ \fi%
+ }%
+ \dolistloop{\@series}%
+}%
% \end{macrocode}
% \end{macro}
+% \end{macro}
%
%
% \begin{macro}{\l@ddodoreinxtrafeet}
@@ -10420,7 +10505,10 @@
% within \cs{@reinserts}. The implementation may well have to change.
% \begin{macrocode}
\newcommand*{\doreinxtrafeetii}{%
- \def\do##1{\ifvoid\csuse{##1footins}\else\insert\csuse{##1ootins}{\unvbox\csuse{##1footins}}\fi}
+ \def\do##1{%
+ \ifvoid\csuse{##1footins}\else%
+ \insert\csuse{##1footins}{\unvbox\csuse{##1footins}}%
+ \fi}%
\dolistloop{\@series}
}
@@ -10573,7 +10661,7 @@
% \section{Cross referencing}
% \label{xref}\relax
%
-% Peter Wilson have rewritten portions of the code in this section so that
+% Peter Wilson has rewritten portions of the code in this section so that
% the LaTeX \file{.aux} file is used. This will also handle \cs{include}d
% files.
%
@@ -10901,6 +10989,7 @@
% \end{macro}
%
% \begin{macro}{\xxref}
+% \changes{v1.19.0}{2015/03/06}{\cs{xxref} works also with right side numbers, when \cs{Rlineflag} is not empty.}
% The \cs{xxref} command takes two arguments, both of which are
% labels, e.g., \verb"\xxref{mouse}{elephant}". It first does some
% checking to make sure that the labels do exist (if one doesn't,
@@ -10926,8 +11015,10 @@
\else%
\expandafter\def\csname the@@label#2\endcsname{\l@dgetref@num{1}{#2}|\l@dgetref@num{2}{#2}|\l@dgetref@num{3}{#2}}%
\fi%
- \linenum{\csname the@@label#1\endcsname|%
- \csname the@@label#2\endcsname}}}
+ \StrDel{\csuse{the@@label#1}}{\Rlineflag}[\@tempa]%
+ \StrDel{\csuse{the@@label#2}}{\Rlineflag}[\@tempb]%
+ \linenum{\@tempa|%
+ \@tempb}}}%
% \end{macrocode}
% \end{macro}
diff --git a/Master/texmf-dist/source/latex/eledmac/eledpar.dtx b/Master/texmf-dist/source/latex/eledmac/eledpar.dtx
index 30fa7d5d414..35f15065443 100644
--- a/Master/texmf-dist/source/latex/eledmac/eledpar.dtx
+++ b/Master/texmf-dist/source/latex/eledmac/eledpar.dtx
@@ -22,6 +22,7 @@
%<*driver>
\documentclass[twoside]{ltxdoc}
\usepackage{url}
+\usepackage{xr-hyper}
\usepackage[draft=false,
plainpages=false,
pdfpagelabels,
@@ -43,6 +44,20 @@
\pagestyle{headings}
\setcounter{StandardModuleDepth}{1}
\setcounter{IndexColumns}{2}
+% Some commands are defined here, and not in the commented part, because \externaldocument is required
+ \newcommand{\Lpack}[1]{\textsf{#1}}
+ \newcommand{\Lclass}[1]{\textsf{#1}}
+ \newcommand{\file}[1]{\texttt{#1}}
+ \newcommand{\eledpar}{eledpar}
+ \newcommand{\eledmac}{eledmac}
+ \newcommand{\Eledmac}{\Lpack{\eledmac}}
+ \newcommand{\Eledpar}{\Lpack{\eledpar}}
+ \newcommand{\edmac}{\texttt{EDMAC}}
+ \newcommand{\tabmac}{\texttt{TABMAC}}
+ \newcommand{\edstanza}{\texttt{EDSTANZA}}
+ \newcommand{\texbook}{\textit{TeXbook}}
+ \newcommand{\thetexbook}{\textit{The TeXbook}}
+\externaldocument[eledmac-]{eledmac}
\begin{document}
\raggedbottom
\DocInput{eledpar.dtx}
@@ -50,8 +65,7 @@
%</driver>
%
% \fi
-%
-% \CheckSum{4722}
+% \CheckSum{4949}
%
% \makeatletter
% \newcommand*{\DescribeIt}{\leavevmode\@bsphack\begingroup\MakePrivateLetters
@@ -133,18 +147,6 @@
% \my@changes#1.\@nil
% }%
%\makeatother
-% \newcommand{\Lpack}[1]{\textsf{#1}}
-% \newcommand{\Lclass}[1]{\textsf{#1}}
-% \newcommand{\file}[1]{\texttt{#1}}
-% \newcommand{\eledpar}{eledpar}
-% \newcommand{\eledmac}{eledmac}
-% \newcommand{\Eledmac}{\Lpack{\eledmac}}
-% \newcommand{\Eledpar}{\Lpack{\eledpar}}
-% \newcommand{\edmac}{\texttt{EDMAC}}
-% \newcommand{\tabmac}{\texttt{TABMAC}}
-% \newcommand{\edstanza}{\texttt{EDSTANZA}}
-% \newcommand{\texbook}{\textit{TeXbook}}
-% \newcommand{\thetexbook}{\textit{The TeXbook}}
%
% \changes{v0.1}{2004/12/10}{First public release}
% \changes{v0.2}{2005/01/01}{Fix babel problems}
@@ -184,6 +186,8 @@
% \changes{v1.10.0}{2015/01/12}{Compatibility with \cs{AtEveryPstart} and \cs{AtEveryPend}}
% \changes{v1.11.0}{2015/01/23}{Compatibility of standard footnotes with some biblatex styles.}
% \changes{v1.12.0}{2015/02/23}{Compatibility with \LuaLaTeX\ RTL languages.}
+% \changes{v1.13.0}{2015/03/06}{With parallel pages, long notes can now flow from the Left to the right side and from the Right to the left side.}
+% \changes{v1.13.0}{2015/03/06}{Fix bug in shiftedpstarts when size difference between pstarts is very important.}
% \hyphenation{man-u-script man-u-scripts}
%
%
@@ -422,9 +426,10 @@
%
% \DescribeMacro{\Xnoteswidthliketwocolumns}
% \DescribeMacro{\notesXwidthliketwocolumns}
-% In most case, you should use \cs{widthliketwocolumns} in combination with \cs{Xnoteswidthliketwocolumns} and \cs{notesXwidthliketwocolumns} to align the critical/familiar footnotes with the two colums. \Lpack{eledmac} handbook for more details.
+% In most cases, you should use \cs{widthliketwocolumns} in combination with \cs{Xnoteswidthliketwocolumns} and \cs{notesXwidthliketwocolumns} to align the critical/familiar footnotes with the two colums.
+% See \Lpack{eledmac}'s handbook for more details.
% \section{Facing pages}\label{pages}
-%
+% \subsection{Basic usage}
% \DescribeEnv{pages}
% Numbered text that is to be set on facing pages must be within a \verb?pages?
% environment. Within the environment the text for the lefthand and righthand
@@ -449,7 +454,7 @@
% Each \cs{Pages} command starts a new even numbered page. After parallel
% typesetting is finished, a new page is started.
% Note that the \cs{Pages} \textbf{must be} outside of the \verb+pages+ environment.
-%
+% \subsection{Text width}
% \DescribeMacro{\Lcolwidth}
% \DescribeMacro{\Rcolwidth}
% Within the \verb?pages? environment the lengths \cs{Lcolwidth} and
@@ -457,7 +462,7 @@
% and right pages, respectively. By default, these are set to the normal
% textwidth for the document, but can be changed within the environment if
% necessary.
-%
+% \subsection{Setting}
% \DescribeMacro{\goalfraction}
% When doing parallel pages \Eledpar{} has to guess where TeX is going to
% put pagebreaks and hopefully get there first in order to put the pair of
@@ -469,7 +474,53 @@
% if some left text overflows onto an odd numbered page or some right text
% onto an even page, try reducing it, for instance by: \\
% \verb?\renewcommand*{\goalfraction}{0.8}?
-%
+% \subsection{Critical and familiar footnotes}
+% Of course, in ``FFacing pages'', the \Lpack{eledmac} both critical and familiar footnotes can be used.
+% However, some specific points must be taken into consideration.
+% \subsubsection{Note size setting}
+% Since \Lpack{eledpar} v.1.13.0, long notes in facing pages can flow from left to right pages, and \emph{vice-versa}.
+% However, the \Lpack{eledmac} default setting for the maximum alloted size to notes is greater than \cs{textheight}. That makes impossible for long notes to flow across pages.
+% \footnote{The same applies to \LaTeX\ normal notes. Read \url{http://tex.stackexchange.com/a/228283/7712} for technical informations.}
+% We have not changed this default setting, because we don't want to break compatibility with older version of \Lpack{eledmac}.
+% So, you MUST change the default setting via \cs{maxhXnotes} (for critical notes)\cs{maxhnotesX} (for familiar notes).
+% Both commands are explained in \Lpack handbook (\ref{eledmac-maxhXnotes} p.~\pageref{eledmac-maxhXnotes}).
+% As and advisable setting:
+% \begin{verbatim}
+% \maxhXnotes{0.6\textheight}
+% \maxhnotesX{0.6\textheight}
+% \end{verbatim}
+% \subsubsection{Notes for one side only}
+% \DescribeMacro{\onlyXside}
+% \DescribeMacro{\onlysideX}
+% You may want to typeset notes on one side only (either left or right).
+% Use \cs{onlyXside}\oarg{s}\marg{p} to set critical notes, and \cs{onlysideX}\oarg{s}\marg{p} to set familiar notes.
+% \marg{p} must be set to \verb+L+ for notes to be confined only on the left side and to \verb+R+ for notes to be confined only on the right side.
+% \subsubsection{Familiar notes called in the right side, but to be printed in the left side}
+% \DescribeMacro{\footnoteXnomk}
+% \DescribeMacro{\footnoteXmk}
+% As often happens, the left side has less room for text.
+% We may want to call familiar notes in the right side while using at the same time the available space in the left side to print them.
+%
+% To achieve this, we call \cs{footnoteXnomk}\marg{notecontent} in the left side. X is to be replaced by the series letter. We do this call in the left side after the word which matches up to the one in the right side after which we want to insert the actual footnote mark.
+%
+% In the right side, we call \cs{footnoteXmk} at the place we want to have the footnote mark. X is to be replaced by the series letter.
+% For example:
+% \begin{verbatim}
+% \begin{Leftside}
+% \beginnumbering
+% \pstart
+% A little cat\footnoteAnomk{A note.}. And so one ...
+% \pend
+% \endnumbering
+% \end{Leftside}
+% \begin{Rightside}
+% \beginnumbering
+% \pstart
+% Un petit chat\footnotemk. And so one ...
+% \pend
+% \endnumbering
+% \end{Rightside}
+% \end{verbatim}
% \section{Left and right texts}\label{leftright}
%
% Parallel texts are divided into Leftside and Rightside. The form of the
@@ -493,8 +544,7 @@
% \DescribeMacro{\firstsublinenum*}
% \DescribeMacro{\sublinenumincrement*}
% The \Eledmac{} package originally used counters for specifying the
-% numbering scheme; now both \Eledmac\footnote{when used with \Lpack{ledpatch}
-% v0.2 or greater.} and
+% numbering scheme; now both \Eledmac and
% the \Eledpar{} package use macros instead. Following
% \cs{firstlinenum}\marg{num} the first line number will be \meta{num}, and
% following \cs{linenumincrement}\marg{num} only every \meta{num}th
@@ -533,7 +583,7 @@
% Numbering, via \cs{beginnumbering} and \cs{endnumbering}, may extend
% across several \verb?Leftside? or \verb?Rightside? environments.
% Remember, though,
-% that the Left/Right sides are effectively independent of each other.
+% that the left/right sides are effectively independent of each other.
%
% Generally speaking, controls like \cs{firstlinenum} or \cs{linenummargin}
% apply to sequential and left texts. To effect right texts only they have
@@ -872,9 +922,13 @@
% \begin{macrocode}
%<*code>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{eledpar}[2015/02/27 v1.12.1 eledmac extension for parallel texts]%
+\ProvidesPackage{eledpar}[2015/03/06 v1.13.0 eledmac extension for parallel texts]%
% \end{macrocode}
+% Few commands use \cs{xspace} command.
+% \begin{macrocode}
+\RequirePackage{xspace}%
+% \end{macrocode}
% With the option `shiftedpstarts' a long pstart one the left side (or in the right side) doesn't make a blank on the corresponding pstart, but the blank is put on the bottom of the page. Consequently, the pstarts on the parallel pages are shifted, but the shift stops at every end of pages.
% The \cs{shiftedverses} is kept for backward compatibility.
% \begin{macro}{\ifshiftedpstarts}
@@ -915,10 +969,8 @@
% \changes{v0.3}{2005/02/24}{Moved \cs{ifl@dpairing} to eledmac}
% \changes{v0.9}{2005/10/01}{Moved \cs{iflledRcol} and \cs{ifnumberingR} to eledmac}
% \changes{v1.9.1}{2014/09/30}{Moved \cs{ifl@dpaging} to eledmac}
+% \changes{v1.13.0}{2015/03/06}{Remove false boolean settings which are not needed.}
% \begin{macrocode}
- \l@dpairingfalse
- \l@dpagingfalse
- \ledRcolfalse
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -943,9 +995,9 @@
%
% \begin{macro}{\eledpar@error}
% \changes{v1.8.2}{2014/08/15}{Errors specific to eledpar send to eledpar handbook}
-% \begin{macrocode}
+% \begin{macrocode}
\newcommand{\eledpar@error}[2]{\PackageError{eledpar}{#1}{#2}}
-% \end{macrocode}
+% \end{macrocode}
% \end{macro}
% \begin{macro}{\led@err@TooManyPstarts}
% \begin{macrocode}
@@ -2284,7 +2336,110 @@
% \end{macrocode}
% \end{macro}
+% \subsection{Specific hooks and commands for notes}
+% The \Lpack{eledmac} \cs{newseries@} initalizes commands which are linked to notes series.
+% However, to keep \Lpack{eledmac} as light as possible, it does not define commands which are specific to \Lpack{eledpar}.
+% This is what does \cs{newseries@eledpar}. The specific hooks are also defined here.
+% \begin{macro}{\newseries@eledpar}
+% \begin{macrocode}
+\newcommand{\newseries@eledpar}[1]{%
+% \end{macrocode}
+% \subsubsection{Create commands to memorize display options}
+% \begin{macrocode}
+ \csgdef{onlysideX@#1}{}%
+ \csgdef{onlyXside@#1}{}%
+% \end{macrocode}
+% \subsubsection{Boolean flags for notes to be printed in one side only}
+% \Lpack{eledpar} allows notes to be printed on one side only.
+% We need boolean flags, and set them to true when a note series is not printed in one side
+% evne though it contains something.
+% \begin{macrocode}
+ \global\newbool{keepforXside@#1}%
+ \global\newbool{keepforsideX@#1}%
+% \end{macrocode}
+% \subsubsection{Familiar footnotes without marks}
+% The \cs{footnoteXnomk} commands are for notes which are printed in the left side, while they are called in the right side.
+% Basically, they set first toggle \cs{nomark@} to true, then call the \cs{footnoteX}.
+% and finally add the footnote counter in the footnote counter list.
%
+% So declare the list.
+% \begin{macrocode}
+ \expandafter\list@create\csname footnote#1@mk\endcsname%
+% \end{macrocode}
+% Then, declare the \cs{footnoteXnomk} command.
+% \begin{macrocode}
+ \expandafter\newcommand\csname footnote#1nomk\endcsname[1]{%
+% \end{macrocode}
+% First step: just call the normal \cs{footnoteX}, saying that we don't want to print the mark.
+% \begin{macrocode}
+ \toggletrue{nomk@}%
+ \csuse{footnote#1}{##1}%
+ \togglefalse{nomk@}%
+% \end{macrocode}
+% Second, and last, step: store the footnote counter in the footnote counters list.
+% We use some \cs{let}, because \cs{xright@appenditem} is difficult to use with \cs{expandafter}.
+% \begin{macrocode}
+ \letcs{\@tmp}{footnote#1@mk}%
+ \numdef\@tmpa{\csuse{c@footnote#1}}%
+ \global\xright@appenditem{\@tmpa}\to\@tmp%
+ \global\cslet{footnote#1@mk}{\@tmp}%
+ }%
+% \end{macrocode}
+% Then, declare the command which inserts the footnotemark in the right side.
+% \begin{macrocode}
+ \expandafter\newcommand\csname footnote#1mk\endcsname{%
+% \end{macrocode}
+% Get the first element of the footnote mark list.
+% As \cs{gl@p} is difficult to use with dynamic name macro, we use \cs{let} commands.
+% \begin{macrocode}
+ \letcs{\@tmp}{footnote#1@mk}%
+ \gl@p\@tmp\to\@tmpa%
+ \global\cslet{footnote#1@mk}{\@tmp}%
+% \end{macrocode}
+% Set the footnotecounter with it.
+% For the sake of security, we make a backup of the previous value.
+% \begin{macrocode}
+ \letcs{\old@footnote}{c@footnote#1}%
+ \setcounter{footnote#1}{\@tmpa}%
+% \end{macrocode}
+% Define the footnote mark and print it
+% \begin{macrocode}
+ \protected@csxdef{@thefnmark#1}{\csuse{thefootnote#1}}%
+ \csuse{@footnotemark#1}%
+% \end{macrocode}
+% Restore previous footnote counter and finally add space.
+% \begin{macrocode}
+ \setcounter{footnote#1}{\old@footnote}%
+ \xspace%
+ }%
+% \end{macrocode}
+% End of \cs{newseries@eledpar}.
+% \begin{macrocode}
+}%
+% \end{macrocode}
+% \end{macro}
+% \subsubsection{Create hooks}
+% Read the eledmac code handbook about \cs{newhookcommand@series}.
+% Here, we create hooks which are specific to \Lpack{eledpar}.
+% \begin{macrocode}
+\newhookcommand@series{onlysideX}%
+
+\newhookcommand@series{onlyXside}%
+
+% \end{macrocode}
+% \subsubsection{Init standards series (A,B,C,D,E,Z)}
+% \begin{macro}{\init@series@eledpar}
+% \cs{newseries@eledpar} is called by \cs{newseries@}.
+% However, this command is called before \Lpack{eledpar} is loaded.
+% Thus, we need to initiate a specific series hook for eledpar.
+% \begin{macrocode}
+\newcommand{\init@series@eledpar}{%
+ \def\do##1{\newseries@eledpar{##1}}%
+ \dolistloop{\@series}%
+}%
+\init@series@eledpar%
+% \end{macrocode}
+% \end{macro}
% \section{Pstart numbers dumping and restoration}
% While in \Lpack{eledmac} the footnotes are inserted in the same time as the \cs{pstart} …\cs{pend} are read, in \Lpack{eledpar} they are inserted when the \cs{Columns} or \cs{Pages} commands are called.
% Consequently, if we do nothing, the value of the PstartL and PstartR counters are not the same in the main text and in the notes.
@@ -3560,8 +3715,180 @@
% \end{macro}
% \end{macro}
%
-%
-%
+% \subsection{Footnotes output specific to \cs{Pages}}
+% \begin{macro}{\print@Xnotes@forpages}
+% \begin{macro}{\correct@Xfootins@box}
+% \begin{macro}{\print@notesX@forpages}
+% \begin{macro}{\correct@footinsX@box}
+% The \cs{onlyXside} and \cs{onlysideX} hooks for \cs{Pages}
+% allow notes to be printed either in left or right pages only.
+% The implementation of such features is delegated to \cs{print@Xnotes@forpages},
+% which replaces \cs{print@Xnotes} inside \cs{Pages}.
+% Here is how we proceed\footnote{See \url{http://tex.stackexchange.com/a/230332/7712}.}:
+% \begin{itemize}
+% \item If notes are to be printed in both sides, we just proceed the usual way: print the foot starts for the series, then the foot group.
+% \item If notes are to be printed in the left side, we do these prints only for even pages ; if notes are to be printed in the right side, we do these prints only for odd pages.
+% \item However, that is not enough. Because the problem does not only consists in printing notes in any particular page. It is also not to put aside room for notes in the pages where we don't want to print them.
+% To take an example: if some note in the left side is too long by 160pt to be printed in full in the left page, we do not want to put aside 160pt a space for it in the following right page.
+% \item To solve this problem, we change the magnification factor associated with notes before going to the next page.
+% If we start a page where no notes are supposed to be printed, the magnification counter is set to 0. We also set the note skip to 0pt. Before starting a new page where these notes are supposed to be printed, we reset these counter and skip to their default values. (About these counter and skip, read \texbook\ p.~122-125).
+% \item There still remains a last problem. This problem is quite complex to understand, so an example will speak for itself. Suppose we allow 10 lines of notes by page.
+% Suppose a long note, be it 25 lines, which needs three pages to be printed. Suppose it must be printed only on left pages, namely odd pages.
+%
+% On p.~2, the first 10 lines of the notes are printed.
+% On p.~3, the box associated to the notes contains 10 lines. However, as we are in a right page, we don't void this box. So \TeX\ will keep its content for the pages to come. However, on p.~4 it will also add one line in the footnote box, because in any case, \TeX adds some content in the box when preparing the output routines, even if there is some content left in this box from the previous pages.
+% So the lines in the note box at p.~4 will be $10+1=11$. There is one line which should not be there. Furthermore, as the box size is for 10~lines and not for 11~lines, this last line will be glued to the previous one.
+%
+% To fix this double issue:
+% \begin{itemize}
+% \item For the pages where notes must be NOT printed, we allow to every note box one line less than it ought to be.
+% In our example, that means that we allow \TeX\ to add only $10-1=9$ line in the note box on p.~3.
+% Before shifting to the pages where notes must be printed, we allow to every notes the expected number of lines. In our example, that means that we allow \TeX to add 10~lines in the note box on p.~4. As on p.~3 only 9 lines were allowed, that means note box of p.~4 will contain $9+1=10$ lines. So the ``one line too many'' problem is solved.
+% \item Still remains the ``glue'' problem. We solve it by recreating a clean note box. We split the one which is created by \TeX\ to get the next line printed. Then, we create the new box, by bringing together the first part and the last part of the splitted box, adding some skip between them. That is achieved by \cs{correct@Xfootins@box} (or \cs{correct@footinsX@box} for familiar notes).
+% \end{itemize}
+% \end{itemize}
+% The code to print critical notes, when processing \cs{Pages}
+% \begin{macrocode}
+\newcommand\print@Xnotes@forpages[1]{%
+% \end{macrocode}
+% First case: notes are for both sides. Just print the note start and the note group
+% \begin{macrocode}
+ \ifcsempty{onlyXside@#1}{%
+ \csuse{#1footstart}{#1}%
+ \csuse{#1footgroup}{#1}%
+ }%
+% \end{macrocode}
+% Second case: notes are for one side only.
+% First test if we are in a page where they must be printed.
+% \begin{macrocode}
+ {%
+ \ifboolexpr{%
+ ((test {\ifcsstring{onlyXside@#1}{L}} and not test{\ifnumodd{\c@page}})%
+ or%
+ (test {\ifcsstring{onlyXside@#1}{R}} and test{\ifnumodd{\c@page}}))%
+ }%
+% \end{macrocode}
+% If we are in a page where notes must be printed, print them.
+% \begin{macrocode}
+ {%
+ \csuse{#1footstart}{#1}%
+ \csuse{#1footgroup}{#1}%
+% \end{macrocode}
+% Then, say to not keep room for notes in the next page.
+% \begin{macrocode}
+ \global\count\csuse{#1footins}=0%
+ \global\skip\csuse{#1footins}=0pt%
+% \end{macrocode}
+% And also, allow one line less for notes in the next page.
+% \begin{macrocode}
+ \csuse{Xnotefontsize@#1}%
+ \global\advance\dimen\csuse{#1footins} by -\baselineskip%
+% \end{macrocode}
+% Now we have printed the notes. So we put aside this fact.
+% \begin{macrocode}
+ \global\boolfalse{keepforXside@#1}%
+ }%
+% \end{macrocode}
+% In case we are on a page where notes must NOT be printed.
+% First, memorize that we have not printed the notes, despite having some to print.
+% \begin{macrocode}
+ {%
+ \global\booltrue{keepforXside@#1}%
+% \end{macrocode}
+% Then restore expected rooms for notes on the next page.
+% \begin{macrocode}
+ \global\count\csuse{#1footins}=\csuse{default@#1footins}%
+ \global\skip\csuse{#1footins}=\csuse{beforeXnotes@#1}%
+% \end{macrocode}
+% Last but not least, restore the normal line number allowed to notes for the following page.
+% \begin{macrocode}
+ \bgroup%
+ \csuse{Xnotefontsize@#1}%
+ \global\advance\dimen\csuse{#1footins} by \baselineskip%
+ \egroup%
+% \end{macrocode}
+% \begin{macrocode}
+% End of \cs{print@Xnotes@forpages}.
+ }%
+ }%
+}%
+% \end{macrocode}
+% Now, \cs{correct@Xfootins@box}, to fix problem of last line being glued to the previous one.
+% \begin{macrocode}
+\newcommand{\correct@Xfootins@box}[1]{%
+% \end{macrocode}
+% We need to make correction only in case we have not printed any note in the previous page,
+% although there was to be ``normally'' printed.
+% \begin{macrocode}
+ \ifbool{keepforXside@#1}{%
+% \end{macrocode}
+% Some setting needed to do the right splitting.
+% \begin{macrocode}
+ \csuse{Xnotefontsize@#1}%
+ \splittopskip=0pt%
+% \end{macrocode}
+% And now, split the last line, and push in the right place.
+% \begin{macrocode}
+ \global\setbox\csuse{#1footins}=\vbox{%
+ \vsplit\csuse{#1footins} to \dimexpr\ht\csuse{#1footins}-1pt\relax%
+ \vskip \dimexpr-0.5\baselineskip-\lineskip-0.5pt\relax%
+ \unvbox\csuse{#1footins}%
+ }%
+% \end{macrocode}
+% End of the macro.
+% \begin{macrocode}
+ }{}%
+}%
+% \end{macrocode}
+% And now, the same for familiar footnotes.
+% \begin{macrocode}
+\newcommand\print@notesX@forpages[1]{%
+ \ifcsempty{onlysideX@#1}{%
+ \csuse{footstart#1}{#1}%
+ \csuse{footgroup#1}{#1}%
+ }%
+ {%
+ \ifboolexpr{%
+ ((test {\ifcsstring{onlysideX@#1}{L}} and not test{\ifnumodd{\c@page}})%
+ or%
+ (test {\ifcsstring{onlysideX@#1}{R}} and test{\ifnumodd{\c@page}}))%
+ }%
+ {%
+ \csuse{footstart#1}{#1}%
+ \csuse{footgroup#1}{#1}%
+ \global\count\csuse{footins#1}=0%
+ \global\skip\csuse{footins#1}=0pt%
+ \csuse{notefontsizeX@#1}%
+ \global\advance\dimen\csuse{footins#1} by -\baselineskip%
+ \global\boolfalse{keepforsideX@#1}%
+ }%
+ {%
+ \global\booltrue{keepforsideX@#1}%
+ \global\count\csuse{footins#1}=\csuse{default@footins#1}%
+ \global\skip\csuse{footins#1}=\csuse{beforenotesX@#1}%
+ \bgroup%
+ \csuse{notefontsizeX@#1}%
+ \global\advance\dimen\csuse{footins#1} by \baselineskip%
+ \egroup%
+ }%
+ }%
+}%
+\newcommand{\correct@footinsX@box}[1]{%
+ \ifbool{keepforsideX@#1}{%
+ \csuse{notefontsizeX@#1}%
+ \splittopskip=0pt%
+ \global\setbox\csuse{footins#1}=\vbox{%
+ \vsplit\csuse{footins#1} to \dimexpr\ht\csuse{footins#1}-1pt\relax%
+ \vskip \dimexpr-0.5\baselineskip-\lineskip-0.5pt\relax%
+ \unvbox\csuse{footins#1}%
+ }%
+ }{}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
% \section{Cross referencing}
% \label{xref}\relax
%
@@ -3833,7 +4160,8 @@
%
%
% \begin{environment}{astanza}
-% \changes{v1.4.1}{2013/08/16}{Enable the use of stanzaindentsrepetition within astanza environnment.}
+% \changes{v1.4.1}{2013/08/16}{Enable the use of stanzaindentsrepetition within astanza environment.}
+% \changes{v1.13.0}{2015/03/06}{Enable the use of optional argument of \& in astanza environment.}
% This is roughly an environmental form of \cs{stanza}, which treats
% its stanza-like contents as a single chunk.
%
@@ -3846,7 +4174,6 @@
\let\stanza@hang\relax
\let\endlock\relax
\else
-%%% \interlinepenalty\@M % this screws things up, but I don't know why
\rightskip\z@ plus 1fil\relax
\fi
\ifnum\usenamecount{szp@0@}=\z@
@@ -3857,10 +4184,7 @@
\sza@penalty
\global\advance\stanza@count\@ne
\@astanza@line}%
- \def\&{%
- \endlock\mbox{}
- \pend
- \endstanzaextra}%
+ \def\&{\@stopastanza}%
\pstart
\@astanza@line
}{}
@@ -3868,6 +4192,17 @@
% \end{macrocode}
% \end{environment}
%
+% \begin{macro}{\@stopastanza}
+% This command is called by \verb+\&+ in astanza environment.
+% It allows optional arguments.
+% \begin{macrocode}
+\newcommandx{\@stopastanza}[1][1,usedefault]{%
+ \endlock\mbox{}%
+ \pend[#1]%
+ \endstanzaextra%
+}%
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{\@astanza@line}
% This gets put at the start of each line in the environment. It sets up
% the paragraph style --- each line is treated as a paragraph.
@@ -4368,7 +4703,7 @@
\@writelinesinparL
\@writelinesinparR
\check@pstarts
- \ifbypstart@
+ \ifbypstart@%
\write\linenum@out{\string\@set[1]}
\resetprevline@
\fi
@@ -4643,6 +4978,7 @@
% \changes{v1.8.3}{2014/08/31}{Debug blank pages when using optional argument in the last \cs{pend}.}
% \changes{v1.10.0}{2015/01/12}{Debug wrong pages splitting when no optional argument is used in last \cs{pend} (bug was added in v.1.8.3).}
% \changes{v1.10.0}{2015/01/12}{Debug wrong parallel pages synchronization when an \cs{edtext} falls accross two pages.}
+% \changes{v1.13.0}{2015/03/06}{When using shiftedpstarts option, a \cs{l@dleftbox} with a null height will advance the \cs{pagetotal} in any case.}
% The \cs{Pages} command results in the previous Left and
% Right texts being typeset on matching facing pages. There should
% be equal numbers of chunks in the left and right texts.
@@ -4659,6 +4995,12 @@
\led@err@BadLeftRightPstarts{\the\l@dnumpstartsL}{\the\l@dnumpstartsR}%
\fi
% \end{macrocode}
+% \changes{v1.13.0}{2015/03/06xx}{Prevent false overfull hboxes when using \cs{Pages} outside of pages environment.}
+% As \cs{Pages} must be called outside of the pages environment, we have to redefine the \cs{Lcolwidth} and \cs{Rcolwidth} lengths, to prevent false overfull hboxes.
+% \begin{macrocode}
+ \setlength{\Lcolwidth}{\textwidth}%
+ \setlength{\Rcolwidth}{\textwidth}%
+% \end{macrocode}
% Get onto an empty even (left) page, then initialise counters, etc.
% \begin{macrocode}
\cleartol@devenpage
@@ -4673,6 +5015,11 @@
\writtenlinesLfalse
\writtenlinesRfalse
% \end{macrocode}
+% The footnotes are printed in way which is different way from the one expected in \Lpack{eledmac}, as we may want to have the notes printed in one side only.
+% \begin{macrocode}
+ \let\print@Xnotes\print@Xnotes@forpages%
+ \let\print@notesX\print@notesX@forpages%
+% \end{macrocode}
% Check if there are chunks to be processed.
% \begin{macrocode}
\check@pstarts
@@ -4744,7 +5091,6 @@
% \begin{macrocode}
\checkpageL
\l@duselanguage{\theledlanguageL}%
-%%% \begingroup
{ \loop\ifl@dsamepage%
% \end{macrocode}
% Process the next (left) text line, adding it to the page.
@@ -4759,8 +5105,23 @@
{\print@eledsectionL}%
{}%
\advance\numpagelinesL \@ne
+% \end{macrocode}
+% When using shiftedpstarts option, a \cs{l@dleftbox} with a null height is not printed.
+% That means we do not insert blank lines at the end of a left chunk lower than the corresponding right chunk.
+% However, a \cs{l@dleftbox} with a null height will advance the \cs{pagetotal} in any case.
+% Because if we do not do this, the \cs{checkpageL} could let \cs{ifl@pagefull} to false,
+% and consequently a \cs{@lopL} equal to 1000 could be written in the numbered file,
+% even if all the lines actually needed for the current page have been printed.
+% \l@dleftbox
+% \begin{macrocode}
\ifshiftedpstarts
- \ifdim\ht\l@dleftbox>0pt\hb@xt@ \hsize{\ledstrutL\unhbox\l@dleftbox}\fi%
+ \ifdim\ht\l@dleftbox>0pt\hb@xt@%
+ \hsize{\ledstrutL\unhbox\l@dleftbox}%
+ \else%
+ \dimen0=\pagetotal%
+ \advance\dimen0 by \baselineskip%
+ \global\pagetotal=\dimen0%
+ \fi%
\else%
\parledgroup@correction@notespacing{L}
\hb@xt@ \hsize{\ledstrutL\unhbox\l@dleftbox}%
@@ -4818,7 +5179,13 @@
{}%
\advance\numpagelinesR \@ne
\ifshiftedpstarts
- \ifdim\ht\l@drightbox>0pt\hb@xt@ \hsize{\ledstrutR\unhbox\l@drightbox}\fi%
+ \ifdim\ht\l@drightbox>0pt\hb@xt@%
+ \hsize{\ledstrutR\unhbox\l@drightbox}%
+ \else%
+ \dimen0=\pagetotal%
+ \advance\dimen0 by \baselineskip%
+ \global\pagetotal=\dimen0%
+ \fi%
\else%
\parledgroup@correction@notespacing{R}
\hb@xt@ \hsize{\ledstrutR\unhbox\l@drightbox}%
@@ -4878,6 +5245,7 @@
\global\instanzaLfalse
\global\instanzaRfalse
\l@dprintingpagesfalse%
+ \newpage\null%Needed to prevent final notes overlap line number
\ignorespaces}
% \end{macrocode}
@@ -4898,16 +5266,11 @@
%
% \begin{macro}{\cleartoevenpage}
% \begin{macro}{\cleartol@devenpage}
-% \begin{macro}{\clearl@dleftpage}
-% \begin{macro}{\clearl@drightpage}
% \cs{cleartoevenpage}, which is defined in the memoir class,
% is like \cs{clear(double)page} except that we
% end up on an even page.
% \cs{cleartol@devenpage} is similar except that it first checks to see
% if it is already on an empty page.
-% \cs{clearl@dleftpage} and \cs{clearl@drightpage} get us onto
-% an odd and even page, respectively, checking that we end up on
-% the immediately next page.
% \begin{macrocode}
\providecommand{\cleartoevenpage}[1][\@empty]{%
\clearpage
@@ -4918,15 +5281,32 @@
\clearpage
\fi
\ifodd\c@page\hbox{}\clearpage\fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\clearl@dleftpage}
+% \begin{macro}{\clearl@drightpage}
+% \cs{clearl@dleftpage} and \cs{clearl@drightpage} get us onto
+% an odd and even page, respectively, checking that we end up on
+% the subsquent page.
+% Both commands use \cs{newpage} and not \cs{clearpage}.
+% Because \cs{clearpage} prints all footnotes before the next page, even if it has to add new empty pages, while \cs{newpage} does not.
+% And as we want notes started in the left page continue in the right page and \emph{vice-versa}, we must use \cs{newpage} and not \cs{clearpage}
+%
+% \changes{v1.13.0}{2015/03/06x}{Use \cs{newpage} instead of \cs{clearpage}.}
+% \begin{macrocode}
\newcommand*{\clearl@dleftpage}{%
- \clearpage
+ \ifdim\pagetotal=0pt\hbox{}\fi%
+ \newpage%
\ifodd\c@page\else
\led@err@LeftOnRightPage
\hbox{}%
\cleardoublepage
\fi}
+
\newcommand*{\clearl@drightpage}{%
- \clearpage
+ \ifdim\pagetotal=0pt\hbox{}\fi%
+ \newpage%
\ifodd\c@page
\led@err@RightOnLeftPage
\hbox{}%
@@ -4936,8 +5316,6 @@
% \end{macrocode}
% \end{macro}
% \end{macro}
-% \end{macro}
-% \end{macro}
%
% \begin{macro}{\getlinesfromparlistL}
% \begin{macro}{\@cs@linesinparL}
@@ -5254,19 +5632,19 @@
\resetprevline@%
\fi
% Add the content of the optional argument of the previous \cs{pend}.
-% \begin{macrocode}
+% \begin{macrocode}
\csuse{after@pendL@\the\l@dpscL}%
\global\csundef{after@pendL@\the\l@dpscL}%
-% \end{macrocode}
+% \end{macrocode}
% Check the number of lines
-% \begin{macrocode}
+% \begin{macrocode}
\l@dcalc@maxoftwo{\the\usenamecount{l@dmaxlinesinpar\the\l@dpscL}}%
{\the\@donetotallinesL}%
{\usenamecount{l@dmaxlinesinpar\the\l@dpscL}}%
\global\@donetotallinesL \z@
-% \end{macrocode}
+% \end{macrocode}
% Go to the next pstart
-% \begin{macrocode}
+% \begin{macrocode}
\global\advance\l@dpscL \@ne
\global\pstartnumtrue%
\restore@pstartL@pc%
@@ -5276,11 +5654,12 @@
\parledgroup@notes@endL
\parledgroup@correction@notespacing@final{L}
\else
+% \end{macrocode}
% Add the content of the optional argument of the last \cs{pend}.
-% \begin{macrocode}
+% \begin{macrocode}
\print@last@after@pendLtrue%
-% \end{macrocode}
-% \begin{macrocode}
+% \end{macrocode}
+% \begin{macrocode}
\fi
\fi
\fi}