summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/eledmac/eledpar.dtx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-06-15 23:28:58 +0000
committerKarl Berry <karl@freefriends.org>2015-06-15 23:28:58 +0000
commit210f6b4d5e219769ade60e62594dbea850759243 (patch)
tree621b069b0b55efdd833052e1cf4cad7d7003a5b8 /Master/texmf-dist/source/latex/eledmac/eledpar.dtx
parent20e51a25c22700214c05b35772c0f08180182e9b (diff)
eledmac (2jun15)
git-svn-id: svn://tug.org/texlive/trunk@37555 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/eledmac/eledpar.dtx')
-rw-r--r--Master/texmf-dist/source/latex/eledmac/eledpar.dtx415
1 files changed, 316 insertions, 99 deletions
diff --git a/Master/texmf-dist/source/latex/eledmac/eledpar.dtx b/Master/texmf-dist/source/latex/eledmac/eledpar.dtx
index 46da8f1635e..19adc281d9d 100644
--- a/Master/texmf-dist/source/latex/eledmac/eledpar.dtx
+++ b/Master/texmf-dist/source/latex/eledmac/eledpar.dtx
@@ -30,20 +30,29 @@
% hyperindex=true
hyperindex=false
]{hyperref}
-\usepackage[utf8]{inputenc}
+\usepackage{fontspec}
\usepackage[english]{babel}
\usepackage{graphicx,eledmac,eledpar,metalogo}
\makeatletter
+ \renewenvironment{theglossary}{%
+ \@restonecoltrue\if@twocolumn\@restonecolfalse\fi
+ \columnseprule \z@ \columnsep 35\p@
+ \glossary@prologue%
+ \GlossaryParms \let\item\@idxitem \ignorespaces}
+ {\if@restonecol\onecolumn\else\clearpage\fi}
+ \def\theindex{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi
+ \columnseprule \z@ \columnsep 35\p@
+ \index@prologue%
+ \IndexParms \let\item\@idxitem \ignorespaces}
+ \def\endtheindex{\if@restonecol\onecolumn\else\clearpage\fi}
\@mparswitchfalse
\makeatother
\EnableCrossrefs
\CodelineIndex
\RecordChanges
-%%\OnlyDescription
\renewcommand{\MakeUppercase}[1]{#1}
\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}}
@@ -66,7 +75,7 @@
%
% \fi
% \newcommand{\reff}[1]{\ref{#1} p.~\pageref{#1}}
-% \CheckSum{4996}
+% \CheckSum{5224}
%
% \makeatletter
% \newcommand*{\DescribeIt}{\leavevmode\@bsphack\begingroup\MakePrivateLetters
@@ -149,27 +158,27 @@
% }%
%\makeatother
%
-% \changes{v0.1}{2004/12/10}{First public release}
-% \changes{v0.2}{2005/01/01}{Fix babel problems}
-% \changes{v0.3}{2005/03/24}{Reorganize for ledarab}
+% \changes{v0.1.0}{2004/12/10}{First public release}
+% \changes{v0.2.0}{2005/01/01}{Fix babel problems}
+% \changes{v0.3.0}{2005/03/24}{Reorganize for ledarab}
% \changes{v0.3.a}{2005/03/30}{Minor \cs{linenummargin} fix}
% \changes{v0.3.b}{2005/04/08}{Improved parallel page balancing}
% \changes{v0.3.c}{2011/06/16}{Compatibilty with Polyglossia}
-% \changes{v0.4}{2011/08/03}{No more ledparpatch. All patches are now in the main file.}
-% \changes{v0.5}{2011/08/21}{Corrections about \cs{section} and other titles in numbered sections}
-% \changes{v0.6}{2011/08/22}{Be able to us \cs{chapter} in parallel pages.}
-% \changes{v0.7}{2011/08/31}{Option `shiftedverses' which make there is no blank between two parallel verses with inequal length.}
-% \changes{v0.8}{2011/09/16}{Possibility to have a symbol on each hanging of verses, like in the french typography. Redefine the commande \cs{hangingsymbol} to define the character.}
-% \changes{v0.9}{2011/10/01}{Possibilty to number the pstart with the commands \cs{numberpstarttrue}.}
+% \changes{v0.4.0}{2011/08/03}{No more ledparpatch. All patches are now in the main file.}
+% \changes{v0.5.0}{2011/08/21}{Corrections about \cs{section} and other titles in numbered sections}
+% \changes{v0.6.0}{2011/08/22}{Be able to us \cs{chapter} in parallel pages.}
+% \changes{v0.7.0}{2011/08/31}{Option `shiftedverses' which make there is no blank between two parallel verses with inequal length.}
+% \changes{v0.8.0}{2011/09/16}{Possibility to have a symbol on each hanging of verses, like in the french typography. Redefine the commande \cs{hangingsymbol} to define the character.}
+% \changes{v0.9.0}{2011/10/01}{Possibilty to number the pstart with the commands \cs{numberpstarttrue}.}
% \changes{v0.9.1}{2011/10/02}{The numbering of the pstarts restarts on each \cs{beginnumbering}.}
% \changes{v0.9.2}{2011/11/08}{Debug : with \cs{Columns}, the hanging indentation now runs on the left columns and the hanging symbol is shown only when \cs{stanza} is used.}
% \changes{v0.9.3}{2011/11/18}{\cs{thepstartL} and \cs{thepstartR} use now \cs{bfseries} and not \cs{bf}, which is deprecated and makes conflicts with memoir class.}
-% \changes{v0.10}{2012/04/04}{\cs{edlabel} commands which start a paragraph are now put in the right place.}
-% \changes{v0.10}{2012/04/04}{\cs{edlabel} commands on the right side are now correctly indicated.}
-% \changes{v1.0}{2012/09/14}{Compatibility with eledmac. Change name to eledpar.}
+% \changes{v0.10.0}{2012/04/04}{\cs{edlabel} commands which start a paragraph are now put in the right place.}
+% \changes{v0.10.0}{2012/04/04}{\cs{edlabel} commands on the right side are now correctly indicated.}
+% \changes{v1.0.0}{2012/09/14}{Compatibility with eledmac. Change name to eledpar.}
% \changes{v1.0.1}{2012/09/16}{Correction on \cs{numberonlyfirstinline} with lineation by pstart or by page.}
-% \changes{v1.1}{2012/09/25}{Shiftedverses becomes shiftedpstarts.}
-% \changes{v1.2}{2012/10/15}{Support for \cs{led}\meta{section} commands in parallel texts.}
+% \changes{v1.1.0}{2012/09/25}{Shiftedverses becomes shiftedpstarts.}
+% \changes{v1.2.0}{2012/10/15}{Support for \cs{led}\meta{section} commands in parallel texts.}
% \changes{v1.3.2}{2012/12/11}{Debug with some classes.}
% \changes{v1.4.3}{2013/10/27}{Corrects a false hanging verse when a verse is exactly the length of a line.}
% \changes{v1.5.0}{2013/11/08}{Add, as in eledmac, features to manage page breaks.}
@@ -194,6 +203,14 @@
% \changes{v1.15.0}{2015/04/13}{Add \cs{AtEveryPstartCall}.}
% \changes{v1.15.0}{2015/04/13}{Fix vertical spurious space before right \cs{eledchapter} (bug added in v1.13.0).}
% \changes{v1.15.0}{2015/04/13}{Prevent vertical space when using \cs{AtEveryPstart} or \cs{AtEveryPend} with a command which prints nothing}
+% \changes{v1.16.0}{2015/05/18}{Fix bug with nofamiliar / nocritical option of eledmac.}
+% \changes{v1.16.0}{2015/05/18}{Error message when using \cs{beginnumbering}…\cs{endnumbering} without \cs{pstart}.}
+% \changes{v1.16.0}{2015/05/18}{Error message when starting a Leftside/a Rightside while the previous one has not been yet typeset.}
+% \changes{v1.16.0}{2015/05/18}{Error message when calling \cs{Pages} inside `pages' environment and \cs{Columns} inside `pairs' environment.}
+% \changes{v1.16.0}{2015/05/18}{New package option sameparallelpagenumber to have the same page number for both left and right side.}
+% \changes{v1.16.1}{2015/05/20}{Write information about line-list file version in the correct file.}
+% \changes{v1.16.2}{2015/05/29}{Fix bug when adding empty lines before a \cs{pend} in combination with some specific penalties setting.}
+% \changes{v1.17.0}{2015/06/02}{Add compatibility of optional argument of \cs{pstart}/\cs{pend} and \cs{AtEveryPstart}/\cs{AtEveryPend} with two columns mode.}
% \hyphenation{man-u-script man-u-scripts}
%
%
@@ -239,6 +256,7 @@
%
% \Lpack{eledpar} provides many tools and options. Normally, they are all documented in this file.
% Also provided is a help folder, ``\href{examples/.}{examples}''. The folder contains additional examples (although not for all cases).
+% Examples starting by ``3-'' are for basic uses, those starting by ``4-'' are for advanced uses.
%
% To report bugs, please go to ledmac's GitHub page and click ``New Issue'': \url{https://github.com/maieul/ledmac/issues/}. You must open an account with github.com to access my page (maieul/ledmac). GitHub accounts are free for open-source users. You can report bug in English or in French (better).
%
@@ -340,8 +358,7 @@
% the right text, requiring a total of 10240 boxes. If you need more chunks
% then you can increase \cs{maxchunks}. The \cs{maxchunks} must be called in the preamble.
%
-% TeX has a limited number of boxes; if you get an error
-% message along the lines of `no room for a new box', then load the package etex, which needs pdflatex or xelatex. If you \cs{maxchunks} is too little
+% If you \cs{maxchunks} is too little
%you can get a \Eledmac{} error message along the
% lines: `Too many \cs{pstart} without printing. Some text will be lost.'
% then you will have to either increase \cs{maxchunks} or use the
@@ -371,7 +388,9 @@
% \begin{pairs}
% \begin{Leftside} ... \end{Leftside}
% \begin{Rightside} ... \end{Rightside}
+% \end{pairs}
% \Columns
+% \begin{pairs}
% \begin{Leftside} ... \end{Leftside}
% ...
% \end{pairs}
@@ -471,7 +490,17 @@
% 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}
+% \subsection{Page number}
+% \changes{v1.15.0}{2015/05/18}{Add sameparallelpagenumber option.}
+% By default, \cs{Pages} use the standard \LaTeX\ page number scheme.
+% This means that pages are numbered continuously following printed-book conventions: from left-hand to right-hand side, left-hand pages having even numbers, right-hand pages having odd numbers.
+%
+% \DescribeMacro{\sameparallelpagenumbertrue}\DescribeMacro{\sameparallelpagenumbertrue}However, you can use the package option \verb+sameparallelpagenumber+ to have the same page number for both left and right side.
+% In this case, this setting will apply only for pages typeset by \cs{Pages}, not for ``normal'' pages.
+%
+% You can also switch the two system using \cs{sameparallelpagenumbertrue} and \cs{sameparallelpagenumberfalse}.
+%
+% \subsection{Setting the page breaking}
% \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
@@ -484,7 +513,7 @@
% 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.
+% Of course, in ``Facing 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}.
@@ -672,6 +701,7 @@
% to both left and right texts, and after making sure that all previous
% notes have been output. For example, along the lines of:
% \begin{verbatim}
+% \begin{pages}
% \begin{Leftside}
% \beginnumbering
% ...
@@ -680,7 +710,9 @@
% \beginnumbering
% ...
% \end{Rightside}
+% \end{pages}
% \Pages
+% \begin{pages}
% \begin{Leftside}
% \memorydump
% ...
@@ -688,8 +720,8 @@
% \begin{Rightside}
% \memorydump
% ...
+% \end{pages}
% \end{verbatim}
-%
% \DescribeMacro{\Rlineflag}
% The value of \cs{Rlineflag} is appended to the line numbers of the
% right texts. Its default definition is: \\
@@ -717,7 +749,7 @@
%
%
%
-%\changes{v0.9}{2011/10/01}{Possibility to number \cs{pstart}.}
+%\changes{v0.9.0}{2011/10/01}{Possibility to number \cs{pstart}.}
% It's possible to insert a number at every \cs{pstart} command. You must use the \DescribeMacro{\numberpstarttrue}\cs{numberpstarttrue} command to have it. You can stop the numerotation with \DescribeMacro{\numberpstartfalse}\cs{numberpstartfalse}. You can redefine the commands \DescribeMacro{\thepstartL}\cs{thepstartL} and \DescribeMacro{\thepstartR}\cs{thepstartR} to change style. The numbering restarts on each \cs{beginnumbering}
% \section{Verse}
%
@@ -864,8 +896,8 @@
% \pend
% \endnumbering
% \end{Rightside}
-% \Pages
% \end{pages}
+% \Pages
% \end{verbatim}
% You can add sectioning a sectioning command, following this scheme:
% \begin{verbatim}
@@ -944,7 +976,7 @@
% \begin{macrocode}
%<*code>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{eledpar}[2015/04/13 v1.15.0 eledmac extension for parallel texts]%
+\ProvidesPackage{eledpar}[2015/06/02 v1.17.0 eledmac extension for parallel texts]%
% \end{macrocode}
% Few commands use \cs{xspace} command.
@@ -960,9 +992,12 @@
\let\shiftedversesfalse\shiftedpstartsfalse
\DeclareOption{shiftedverses}{\shiftedpstartstrue}
\DeclareOption{shiftedpstarts}{\shiftedpstartstrue}
-\DeclareOption{parledgroup}{\parledgrouptrue}
% \end{macrocode}
% \end{macro}
+% The \verb+parledgroup+ can be called either on \Eledmac or \Eledpar.
+% \begin{macrocode}
+\DeclareOption{parledgroup}{\parledgrouptrue}
+% \end{macrocode}
% \begin{macro}{\ifwidthliketwocolumns}
% The \cs{widthliketwocolumns} option can be called both in eledpar and eledmac.
% \changes{v1.9.0}{2014/09/16}{Added widthliketwocolumns option}
@@ -970,13 +1005,19 @@
\DeclareOption{widthliketwocolumns}{\widthliketwocolumnstrue}%
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\ifsameparallelpagenumber}
+% \begin{macrocode}
+\newif\ifsameparallelpagenumber%
+\DeclareOption{sameparallelpagenumber}{\sameparallelpagenumbertrue}%
+% \end{macrocode}
+% \end{macro}
% \begin{macrocode}
\ProcessOptions%
% \end{macrocode}
% As noted above, much of the code is a duplication of the original
% \Eledmac{} code to handle the extra box(es) for the right hand side text,
% and sometimes for the left hand side as well. In order to distinguish
-% I use `R' or `L' in the names of macros for the right and left code.
+% we use `R' or `L' in the names of macros for the right and left code.
% The specifics of `L' and `R' are normally hidden from the user by
% letting the \verb?Leftside? and \verb?Rightside? environments set things
% up appropriately.
@@ -988,8 +1029,8 @@
% \cs{ifl@dpaging} is also set TRUE if we are doing parallel pages.
% \cs{ifledRcol} is set TRUE if we are doing the right hand text.
% They are defined in \Lpack{eledmac}.
-% \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{v0.3.0}{2005/02/24}{Moved \cs{ifl@dpairing} to eledmac}
+% \changes{v0.9.0}{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}
@@ -1048,6 +1089,26 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\led@err@Leftside@PreviousNotPrinted}
+% \begin{macro}{\led@err@Rightside@PreviousNotPrinted}
+% \begin{macrocode}
+\newcommand*{\led@err@Leftside@PreviousNotPrinted}{%
+ \eledpar@error{You call a new Leftside environment while the previous one has not been typeset by \string\Pages\space or \string\Columns}{\@ehc}}
+\newcommand*{\led@err@Rightside@PreviousNotPrinted}{%
+ \eledpar@error{You call a new Rightside environment while the previous one has not been typeset by \string\Pages\space or \string\Columns}{\@ehc}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\led@err@Pages@InsideEnv}
+% \begin{macro}{\led@err@Columns@InsideEnv}
+% \begin{macrocode}
+\newcommand*{\led@err@Pages@InsideEnv}{%
+ \eledpar@error{\string\Pages\space must be called *outside* of the `pages` environment}{\@ehc}}
+\newcommand*{\led@err@Columns@InsideEnv}{%
+ \eledpar@error{\string\Columns\space must be called *outside* of the `pairs` environment}{\@ehc}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
%
% \section{Sectioning commands}
%
@@ -1072,7 +1133,7 @@
% \cs{ifpst@rtedL} is set FALSE at the start of left side numbering, and
% similarly for \cs{ifpst@rtedR}.
% \cs{ifpst@rtedL} is defined in \Lpack{eledmac}.
-% \changes{v0.3}{2005/02/24}{Moved \cs{ifpst@rtedL} to eledmac}
+% \changes{v0.3.0}{2005/02/24}{Moved \cs{ifpst@rtedL} to eledmac}
% \begin{macrocode}
\pst@rtedLfalse
\newif\ifpst@rtedR
@@ -1135,6 +1196,9 @@
\ifnumberingR
\global\numberingRfalse
\normal@pars
+ \ifnum\l@dnumpstartsR=0%
+ \led@err@NumberingWithoutPstart%
+ \fi%
\ifl@dpairing
\global\pst@rtedRfalse
\else
@@ -1237,8 +1301,8 @@
% \label{lineation}\relax
%
% \subsection{Choosing the system of lineation}
-% \changes{v0.11}{2012/06/11}{Lineation can be by pstart (like in eledmac 0.15).}
-% \changes{v1.0}{2012/09/14}{Debug in lineation by pstart}
+% \changes{v0.11.0}{2012/06/11}{Lineation can be by pstart (like in eledmac 0.15).}
+% \changes{v1.0.0}{2012/09/14}{Debug in lineation by pstart}
% Sometimes you want line numbers that start at $1$ at the top of each
% page; sometimes you want line numbers that start at $1$ at each \cs{pstart}; other times you want line numbers that start at $1$ at the start
% of each section and increase regardless of page breaks.
@@ -1449,7 +1513,7 @@
% \begin{macro}{\sublinenumrepR}
% \cs{linenumrepR}\marg{ctr} typesets the right line number \meta{ctr}, and
% similarly \cs{sublinenumrepR} for subline numbers.
-% \changes{v0.3}{2005/02/10}{Added \cs{linenumrepR} and \cs{sublinenumrepR}}
+% \changes{v0.3.0}{2005/02/10}{Added \cs{linenumrepR} and \cs{sublinenumrepR}}
% \begin{macrocode}
\newcommand*{\linenumrepR}[1]{\@arabic{#1}}
\newcommand*{\sublinenumrepR}[1]{\@arabic{#1}}
@@ -1464,7 +1528,7 @@
% \cs{leftlinenumR} and \cs{rightlinenumR} are the macros that are
% called to print the right text's marginal line numbers. Much of the
% code for these is common and is maintained in \cs{l@dlinenumR}.
-% \changes{v0.3}{2005/02/10}{Simplified \cs{leftlinenumR} and
+% \changes{v0.3.0}{2005/02/10}{Simplified \cs{leftlinenumR} and
% \cs{rightlinenumR} by introducing \cs{l@dlinenumR}}
% \begin{macrocode}
\newcommand*{\leftlinenumR}{%
@@ -1488,7 +1552,7 @@
%
%
% \subsection{Line-number counters and lists}
-%
+% \subsubsection{Correspond to those in \Lpack{eledmac} for regular or left text}
% We need another set of counters and lists for the right text,
% corresponding to those in \Lpack{eledmac} for regular or left text.
%
@@ -1530,8 +1594,6 @@
\list@create{\insertlines@listR}
\list@create{\actionlines@listR}
\list@create{\actions@listR}
-\list@create{\sw@listR}%
-\list@create{\sw@list@inedtextR}%
% \end{macrocode}
% \end{macro}
@@ -1539,6 +1601,14 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\page@numR}
+% The right text page number.
+% \begin{macrocode}
+\newcount\page@numR
+
+% \end{macrocode}
+% \end{macro}
+% \subsubsection{Specific to \Lpack{eledpar}}
% \begin{macro}{\linesinpar@listL}
% \begin{macro}{\linesinpar@listR}
% \begin{macro}{\maxlinesinpar@list}
@@ -1555,13 +1625,6 @@
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\page@numR}
-% The right text page number.
-% \begin{macrocode}
-\newcount\page@numR
-
-% \end{macrocode}
-% \end{macro}
%
%
% \subsection{Reading the line-list file}
@@ -1586,8 +1649,6 @@
\list@clear{\actions@listR}%
\list@clear{\linesinpar@listR}%
\list@clear{\linesonpage@listR}
- \list@clear{\sw@listR}%
- \list@clear{\sw@list@inedtextR}%
\else
\list@clearing@reg
\list@clear{\linesinpar@listL}%
@@ -2022,6 +2083,7 @@
% \begin{macrocode}
\renewcommand*{\@ref}[2]{%
\ifledRcol
+ \global\advance\@edtext@level by 1%
\global\insert@countR=#1\relax
\loop\ifnum\insert@countR>\z@
\xright@appenditem{\the\absline@numR}\to\insertlines@listR
@@ -2043,7 +2105,8 @@
\let\sub@action=\relax
\let\set@line@action=\relax
\let\@lab=\relax
- \let\@sw\@gobbletwo%
+ \let\@lemma=\relax
+ \let\@sw\@gobblethree%
#2
\global\endpage@num=\page@numR
\global\endline@num=\line@numR
@@ -2060,11 +2123,37 @@
\the\endpage@num|\the\endline@num|%
\ifsublines@ \the\endsubline@num \else 0\fi}\to\line@listR
% \end{macrocode}
-%
-% Finally, execute the second argument of \cs{@ref} again,
+% Create a list which will store all the second argument of each \cs{@sw}
+% in this lemma, at this level.
+% \begin{macrocode}
+ \expandafter\list@create\expandafter{\csname sw@list@edtext@tmp@\the\@edtext@level\endcsname}%
+% \end{macrocode}
+% Declare and init boolean for lemma in this level.
+% \begin{macrocode}
+ \providebool{lemmacommand@\the\@edtext@level}%
+ \boolfalse{lemmacommand@\the\@edtext@level}%
+% \end{macrocode}
+% Execute the second argument of \cs{@ref} again,
% to perform for real all the commands within it.
% \begin{macrocode}
- #2
+ #2
+% Now, we store the list of \cs{@sw} of this current \cs{edtext} as an element of
+% the global list of list of \cs{@sw} for a \cs{edtext} depth.
+% \begin{macrocode}
+ \ifnum\@edtext@level>0%
+ \def\create@this@edtext@level{\expandafter\list@create\expandafter{\csname sw@list@edtextR@\the\@edtext@level\endcsname}}%
+ \ifcsundef{sw@list@edtextR@\the\@edtext@level}{\create@this@edtext@level}{}%
+ \letcs{\@tmp}{sw@list@edtextR@\the\@edtext@level}%
+ \letcs{\@tmpp}{sw@list@edtext@tmp@\the\@edtext@level}%
+ \xright@appenditem{\expandonce\@tmpp}\to\@tmp%
+ \global\cslet{sw@list@edtextR@\the\@edtext@level}{\@tmp}%
+ \fi%
+% \end{macrocode}
+% Decrease edtext level counter.
+% \begin{macrocode}
+ \global\advance\@edtext@level by -1%
+% \end{macrocode}
+% \begin{macrocode}
\else
% \end{macrocode}
% And when not in right text
@@ -2153,6 +2242,7 @@
\immediate\closeout\linenum@outR
\global\first@linenum@out@Rfalse
\immediate\openout\linenum@outR=#1
+ \immediate\write\linenum@outR{\string\line@list@version{\this@line@list@version}}%
\else
\if@minipage%
\leavevmode%
@@ -2186,7 +2276,7 @@
% We enclose a lemma marked by \cs{edtext} in
% \cs{flag@start} and \cs{flag@end}: these send the \cs{@ref}
% command to the line-list file.
-% \changes{v0.3}{2005/02/04}{Removed extraneous spaces from\cs{flag@end}}
+% \changes{v0.3.0}{2005/02/04}{Removed extraneous spaces from\cs{flag@end}}
% \changes{v1.8.2}{2014/08/15}{\cs{flag@start} and \cs{flag@end} are now defined only one time for eledmac and eledpar}
% \end{macro}
% \end{macro}
@@ -2308,7 +2398,7 @@
% \begin{macro}{\critext}
% \begin{macro}{\edtext}
-% \changes{v1.3}{2012/11/16}{Manage RTL language.}
+% \changes{v1.3.0}{2012/11/16}{Manage RTL language.}
% \changes{v1.11.0}{2014/01/22}{\cs{critext} and \cs{edtext} are now defined only in eledmac.}
% And similarly for \cs{edtext}.
% \end{macro}
@@ -2355,13 +2445,14 @@
% We need to declare these options.
% We also need boolean flags, and to set them to true when a note series is not printed on one side.
% We check the \verb+nofamiliar+ and \verb+nocritical+ \Eledmac{} options.
+% \changes{v1.16.0}{2015/05/18}{Fix bug with \cs{onlysideX}.}
% \begin{macrocode}
- \unless\ifnocritical@%
- \csgdef{onlysideX@#1}{}%
- \global\newbool{keepforXside@#1}%
- \fi%
\unless\ifnofamiliar@%
+ \csgdef{onlysideX@#1}{}%
\global\newbool{keepforsideX@#1}%
+ \fi%
+ \unless\ifnocritical@%
+ \global\newbool{keepforXside@#1}%
\csgdef{onlyXside@#1}{}%
\fi%
% \end{macrocode}
@@ -2584,9 +2675,12 @@
% environments, respectively. The \verb?Leftside? environment is simple,
% indicating that right text is not within its purview and using some
% particular macros.
-% \changes{v0.3}{2005/02/10}{Added hooks into Leftside environment}
+% \changes{v0.3.0}{2005/02/10}{Added hooks into Leftside environment}
% \begin{macrocode}
\newenvironment{Leftside}{%
+ \expandafter\ifvoid\csname l@dLcolrawbox1\endcsname\else%
+ \led@err@Leftside@PreviousNotPrinted%
+ \fi%
\ledRcolfalse
\setcounter{pstartL}{1}
\let\pstart\pstartL
@@ -2607,7 +2701,7 @@
% \begin{macro}{\Rightsidehookend}
% Hooks into the start and end of the \texttt{Leftside} and \texttt{Rightside}
% environments. These are initially empty.
-% \changes{v0.3}{2005/02/10}{Added \cs{Leftsidehook}, \cs{Leftsidehookend},
+% \changes{v0.3.0}{2005/02/10}{Added \cs{Leftsidehook}, \cs{Leftsidehookend},
% \cs{Rightsidehook} and \cs{Rightsidehookend}}
% \begin{macrocode}
\newcommand*{\Leftsidehook}{}
@@ -2628,6 +2722,9 @@
% ensures that the right right text code will be used.
% \begin{macrocode}
\newenvironment{Rightside}{%
+ \expandafter\ifvoid\csname l@dRcolrawbox1\endcsname\else%
+ \led@err@Rightside@PreviousNotPrinted%
+ \fi%
\ledRcoltrue
\let\beginnumbering\beginnumberingR
\let\endnumbering\endnumberingR
@@ -2697,7 +2794,7 @@
%
% \begin{macro}{\pstartL}
% \begin{macro}{\pstartR}
-% \changes{v1.1}{2012/09/25}{Add \cs{labelpstarttrue} (from eledmac).}
+% \changes{v1.1.0}{2012/09/25}{Add \cs{labelpstarttrue} (from eledmac).}
% \changes{v1.1.1}{2012/10/01}{Correct \cs{pstartR} bug introduced by 1.1.}
% \changes{v1.4.3}{2013/10/27}{Spurious spaces in \cs{pstartL} and \cs{pstartR}.}
% \changes{v1.8.0}{2014/08/05}{As in \Lpack{eledmac}, \cs{pendL} and \cs{pendR} can have an optional argument.}
@@ -2763,6 +2860,13 @@
\global\l@dnumpstartsL=\l@dc@maxchunks%
\fi%
\global\setnamebox{l@dLcolrawbox\the\l@dnumpstartsL}=\vbox\bgroup%
+% \end{macrocode}
+% We set all the usual interline penalties to zero; this ensures that there'll
+% be no large interline penalties to prevent us from slicing the
+% paragraph into pieces. These penalties revert to the values
+% that you set when the group for the \cs{vbox} ends.
+% \begin{macrocode}
+ \l@dzeropenalties%
\ifautopar\else%
\ifnumberpstart%
\ifsidepstartnum%
@@ -2818,6 +2922,7 @@
\global\l@dnumpstartsR=\l@dc@maxchunks%
\fi%
\global\setnamebox{l@dRcolrawbox\the\l@dnumpstartsR}=\vbox\bgroup%
+ \l@dzeropenalties%
\ifautopar\else%
\ifnumberpstart%
\ifsidepstartnum\else%
@@ -2855,13 +2960,11 @@
\led@err@PendNoPstart%
\fi%
% \end{macrocode}
-% We set all the usual interline penalties to zero and then immediately
+% We immediately
% call \cs{endgraf} to end the paragraph; this ensures that there'll
% be no large interline penalties to prevent us from slicing the
-% paragraph into pieces. These penalties revert to the values
-% that you set when the group for the \cs{vbox} ends.
+% paragraph into pieces.
% \begin{macrocode}
- \l@dzeropenalties%
\endgraf\global\num@lines=\prevgraf\egroup%
\global\par@line=0%
% \end{macrocode}
@@ -2898,7 +3001,6 @@
\ifnumberedpar@ \else%
\led@err@PendNoPstart%
\fi%
- \l@dzeropenalties%
\endgraf\global\num@linesR=\prevgraf\egroup%
\global\par@lineR=0%
\endgroup%
@@ -2986,14 +3088,14 @@
% \end{macro}
%
%
-% \changes{v0.11}{2012/06/11}{Change \cs{do@lineL} and \cs{do@lineR} to allow line numbering by pstart (like in eledmac 0.15).}
+% \changes{v0.11.0}{2012/06/11}{Change \cs{do@lineL} and \cs{do@lineR} to allow line numbering by pstart (like in eledmac 0.15).}
% \changes{v1.8.0}{2014/08/05}{Change \cs{do@lineR} and \cs{do@lineR} to allow new sectioning commands.}
% \begin{macro}{\do@lineL}
% \changes{v1.8.1}{2014/08/07}{Fix a bug with critical notes a the begining of a page, (maybe added by v1.8.0) (?).}
% The \cs{do@lineL} macro is called to
% do all the processing for a single line of left text.
-% \changes{v0.3}{2005/02/10}{Added \cs{do@lineLhook} to \cs{do@lineL}}
-% \changes{v0.3}{2005/02/10}{Simplified \cs{do@lineL} by using macros for
+% \changes{v0.3.0}{2005/02/10}{Added \cs{do@lineLhook} to \cs{do@lineL}}
+% \changes{v0.3.0}{2005/02/10}{Simplified \cs{do@lineL} by using macros for
% some common code}
% \begin{macrocode}
\newcommand*{\do@lineL}{%
@@ -3111,8 +3213,8 @@
% \end{macro}
% \end{macro}
% \end{macro}
-% \changes{v0.3}{2005/02/10}{Added \cs{do@lineLhook} and \cs{do@lineRhook}}
-% \changes{v1.4}{2013/07/11}{Added \cs{do@insidelineLhook} and \cs{do@insidelineRhook}}
+% \changes{v0.3.0}{2005/02/10}{Added \cs{do@lineLhook} and \cs{do@lineRhook}}
+% \changes{v1.4.0}{2013/07/11}{Added \cs{do@insidelineLhook} and \cs{do@insidelineRhook}}
% \begin{macro}{\do@lineLhook}
% \begin{macro}{\do@lineRhook}
% \begin{macro}{\do@insidelineLhook}
@@ -3132,7 +3234,7 @@
% \begin{macro}{\do@lineR}
% The \cs{do@lineR} macro is called to
% do all the processing for a single line of right text.
-% \changes{v0.3}{2005/02/10}{Changed \cs{do@lineR} similarly to \cs{do@lineL}}
+% \changes{v0.3.0}{2005/02/10}{Changed \cs{do@lineR} similarly to \cs{do@lineL}}
% \changes{v1.8.1}{2014/08/07}{Fix a bug with critical notes a the begining of a page, added by v1.8.0 (?).}
% \begin{macrocode}
\newcommand*{\do@lineR}{%
@@ -3310,7 +3412,7 @@
%
% It may call itself recursively and we use tail recursion, via
% \cs{do@actions@nextR} for this.
-% \changes{v0.3}{2005/02/24}{Used \cs{do@actions@fixedcode} in \cs{do@actionsR}}
+% \changes{v0.3.0}{2005/02/24}{Used \cs{do@actions@fixedcode} in \cs{do@actionsR}}
% \changes{v1.15.0}{2015/04/13}{Add action 1008 and 1009}
% \begin{macrocode}
@@ -3398,8 +3500,8 @@
% \begin{macro}{\affixline@numR}
% \cs{affixline@numR} is the right text version of the
% \cs{affixline@num} macro.
-% \changes{v0.3}{2005/02/24}{Changed \cs{affixline@numR} to match new eledmac}
-% \changes{v0.11}{2012/06/11}{Changed \cs{affixline@numR} to allow to disable line numbering (like in eledmac 0.15).}
+% \changes{v0.3.0}{2005/02/24}{Changed \cs{affixline@numR} to match new eledmac}
+% \changes{v0.11.0}{2012/06/11}{Changed \cs{affixline@numR} to allow to disable line numbering (like in eledmac 0.15).}
% \begin{macrocode}
\providecommand*{\l@dcalcnum}[3]{%
@@ -3693,10 +3795,10 @@
% \fi}
% \end{verbatim}
% This is for a single chunk. However, as we are probably dealing
-% with several chunks at a time, the above is nor really relevant. I think
+% with several chunks at a time, the above is nor really relevant. Peter Wilson thinks
% that it is likely with parallel text that there is no real need to add
% back any penalties; even if there was, they would have to match across the
-% left and right lines. So, I end up with the following.
+% left and right lines. So, Peter Wilson ends up with the following.
%
% \begin{macrocode}
\newcommand*{\add@penaltiesL}{}
@@ -3750,7 +3852,7 @@
% Just a reminder of the arguments: \\
% \verb?\printlinesR #1 | #2 | #3 | #4 | #5 | #6 | #7? \\
% \verb?\printlinesR start-page | line | subline | end-page | line | subline | font ?
-% \changes{v0.3}{2005/02/10}{Simplified \cs{printlinesR} by using
+% \changes{v0.3.0}{2005/02/10}{Simplified \cs{printlinesR} by using
% \cs{setprintlines}}
% \begin{macrocode}
\def\printlinesR#1|#2|#3|#4|#5|#6|#7|{\begingroup
@@ -4119,7 +4221,7 @@
%
%
% \begin{macro}{\normalbfnoteX}
-% \changes{v0.3}{2005/02/04}{Removed extraneous spaces from \cs{normalbfnoteX}}
+% \changes{v0.3.0}{2005/02/04}{Removed extraneous spaces from \cs{normalbfnoteX}}
% \changes{v1.3.5}{2013/07/10}{Allows one to redefine \cs{thefootnoteX} with \c{alph} when some packages are loaded.}
% \changes{v1.4.1}{2013/08/16}{Fix bug with normal familiar footnotes when mixing RTL and LTR text.}
% \begin{macrocode}
@@ -4156,13 +4258,13 @@
%
% \section{Verse}
-%\changes{v0.11}{2012/06/11}{New management of hangingsymbol insertion, preventing undesirable insertions.}
-%\changes{v0.12}{2012/08/03}{New management of hangingsymbol insertion, preventing undesirable insertions.}
+%\changes{v0.11.0}{2012/06/11}{New management of hangingsymbol insertion, preventing undesirable insertions.}
+%\changes{v0.12.0}{2012/08/03}{New management of hangingsymbol insertion, preventing undesirable insertions.}
% Like in eledmac, the insertion of hangingsymbol is base on \cs{ifinserthangingsymbol}, and, for the right side, on \cs{ifinserthangingsymbolR}.
% Both commands also include the hanging space, to be sure the \cs{one@line} of hanging lines has the same width that the \cs{one@line} of normal lines and to prevent the column separator from shifting.
% \begin{macro}{\inserthangingsymbolL}
% \begin{macro}{\inserthangingsymbolR}
-% \changes{v0.11}{2012/06/11}{Prevent the column separator for hanging verse from shifting}
+% \changes{v0.11.0}{2012/06/11}{Prevent the column separator for hanging verse from shifting}
% \changes{v1.4.3}{2013/10/27}{Hanging verse is no longer automatically flush right.}
% \changes{v1.15.0}{2015/04/13}{Prevent more efficiently the column separator from shifting when a verse is hanging}
% \begin{macrocode}
@@ -4342,7 +4444,7 @@
% \begin{macro}{\l@dnumpstartsR}
% The numbers of left and right chunks. \cs{l@dnumpstartsL} is defined
% in \Lpack{eledmac}.
-% \changes{v0.3}{2005/02/24}{Moved \cs{l@dnumpstartsL} to eledmac}
+% \changes{v0.3.0}{2005/02/24}{Moved \cs{l@dnumpstartsL} to eledmac}
% \begin{macrocode}
\newcount\l@dnumpstartsR
@@ -4423,7 +4525,7 @@
% might use different languages via \verb?babel?. On the other hand,
% \verb?babel? might not be called at all (even though it might be already
% built into the format).
-% \changes{v0.2}{2004/12/20}{Added section of babel related code}
+% \changes{v0.2.0}{2004/12/20}{Added section of babel related code}
%
% With the normal sequential text each line is initially typeset
% in the current language environment, and then it is output at which
@@ -4649,6 +4751,9 @@
% \changes{v1.12.0}{2015/02/23}{Add \cs{l@dprintingcolumnstrue}}
% \begin{macrocode}
\newcommand*{\Columns}{%
+ \ifl@dpairing%
+ \led@err@Columns@InsideEnv%
+ \fi%
\l@dprintingcolumnstrue%
\eledsection@correcting@skip=-\baselineskip% Correction for sections' titles
\ifnum\l@dnumpstartsL=\l@dnumpstartsR\else
@@ -4683,10 +4788,14 @@
\restore@pstartL@pc%
\restore@pstartR@pc%
% \end{macrocode}
+% We print the optional argument of \cs{pstart} or the argument of \cs{AtEveryPstart}.
+% \begin{macrocode}
+ \Columns@print@before@pstart%
+% \end{macrocode}
% Check if there is text yet to be processed in at least one of
% the two current chunks, and also whether the left and right languages
% are the same
-% \changes{v0.2}{2004/12/20}{Added \cs{l@dchecklang} and \cs{l@duselanguage}
+% \changes{v0.2.0}{2004/12/20}{Added \cs{l@dchecklang} and \cs{l@duselanguage}
% to \cs{Columns}}
% \changes{v1.8.0}{2014/08/05}{Suppress \cs{l@dchecklang} from \cs{Columns}.}
% \begin{macrocode}
@@ -4738,7 +4847,7 @@
% \end{macrocode}
% Having completed a pair of chunks, write the number of lines
% in each chunk to the respective section files. Increment pstart counters and reset line numbering if it's by pstart.
-% \changes{v0.11}{2012/06/11}{Line numbering by pstart.}
+% \changes{v0.11.0}{2012/06/11}{Line numbering by pstart.}
% \begin{macrocode}
\@writelinesinparL
\@writelinesinparR
@@ -4751,6 +4860,7 @@
\write\linenum@outR{\string\@set[1]}
\resetprevline@
\fi
+ \Columns@print@after@pend%
\repeat
% \end{macrocode}
% Having output all chunks, make sure all notes have been output,
@@ -4995,10 +5105,62 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\Columns@print@before@pstart}
+% \begin{macro}{\Columns@print@after@pend}
+% The \cs{Columns@print@before@pstart} and \cs{Columns@print@after@pend} print the content of the optional argument of \cs{pstart} / \cs{pend}. If this content is not empty, it also print the separator.
+% \begin{macrocode}
+\newcommand{\Columns@print@before@pstart}{%
+ \ifboolexpr{%
+ test{\ifcsstring{before@pstartL@\the\l@dpscL}{\at@every@pstart}}%
+ and test {\ifcsstring{before@pstartR@\the\l@dpscR}{\at@every@pstart}}%
+ and test {\ifdefempty{\at@every@pstart}}}%
+ {}%
+ {%
+ \hb@xt@ \hsize{%
+ \ifdefstring{\columns@position}{L}{}{\hfill }%
+ \par\parbox[t][][t]{\Lcolwidth}{%
+ \csuse{before@pstartL@\the\l@dpscL}%
+ }%
+ \print@columnseparator%
+ \parbox[t][][t]{\Rcolwidth}{%
+ \csuse{before@pstartR@\the\l@dpscR}%
+ }%
+ \ifdefstring{\columns@position}{R}{}{\hfill}%
+ }%
+ }%
+ \global\csundef{before@pstartL@\the\l@dpscL}%
+ \global\csundef{before@pstartR@\the\l@dpscR}%
+}%
+\newcommand{\Columns@print@after@pend}{%
+ \ifboolexpr{%
+ test{\ifcsstring{after@pendL@\the\l@dpscL}{\at@every@pend}}%
+ and test {\ifcsstring{after@pendR@\the\l@dpscR}{\at@every@pend}}%
+ and test {\ifdefempty{\at@every@pend}}}%
+ {}%
+ {%
+ \hb@xt@ \hsize{%
+ \ifdefstring{\columns@position}{L}{}{\hfill }%
+ \parbox[t][][t]{\Lcolwidth}{%
+ \csuse{after@pendL@\the\l@dpscL}%
+ }%
+ \print@columnseparator%
+ \parbox[t][][t]{\Rcolwidth}{%
+ \csuse{after@pendR@\the\l@dpscR}%
+ }%
+ \ifdefstring{\columns@position}{R}{}{\hfill}%
+ }%
+ }%
+ \global\csundef{after@pendL@\the\l@dpscL}%
+ \global\csundef{after@pendR@\the\l@dpscR}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
% \section{Parallel pages}
%
% This is considerably more complicated than parallel columns.
%
+% \subsection{Specific counters}
% \begin{macro}{\numpagelinesL}
% \begin{macro}{\numpagelinesR}
% \begin{macro}{\l@dminpagelines}
@@ -5013,6 +5175,7 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \subsection{Main macro}
% \begin{macro}{\Pages}
% \changes{v1.8.0}{2014/07/28}{Modify \cs{Pages} to enable to add section's title.}
% \changes{v1.8.3}{2014/08/31}{Debug blank pages when using optional argument in the last \cs{pend}.}
@@ -5027,7 +5190,10 @@
% \changes{v1.12.0}{2015/02/23}{Add \cs{l@dprintingpagestrue}}
% \begin{macrocode}
\newcommand*{\Pages}{%
- \l@dprintingpagestrue%
+ \l@dprintingpagestrue%
+ \ifl@dpairing%
+ \led@err@Pages@InsideEnv%
+ \fi%
\eledsection@correcting@skip=-2\baselineskip% line correcting for section titles.
\parledgroup@notespacing@set@correction%
\typeout{}%
@@ -5056,6 +5222,10 @@
\writtenlinesLfalse%
\writtenlinesRfalse%
% \end{macrocode}
+% Sometimes, people what to have the same page number on both left and right sides. To do this, use the \cs{init@sameparallelpage@number} command.
+% \begin{macrocode}
+ \init@sameparallelpage@number
+% \end{macrocode}
% The footnotes are printed in a different way from expected in \Lpack{eledmac}, as we may want to print the notes on one side only.
% \begin{macrocode}
\let\print@Xnotes\print@Xnotes@forpages%
@@ -5128,7 +5298,7 @@
% \end{macrocode}
% See if there is more that can be done for the left page and set up the
% left language.
-% \changes{v0.2}{2004/12/20}{Added \cs{l@duselanguage} to \cs{Pages}}
+% \changes{v0.2.0}{2004/12/20}{Added \cs{l@duselanguage} to \cs{Pages}}
% \begin{macrocode}
\checkpageL%
\l@duselanguage{\theledlanguageL}%
@@ -5136,7 +5306,7 @@
% \end{macrocode}
% Process the next (left) text line, adding it to the page.
% Eventually, adds the optional argument of pstart.
-% \changes{v0.3}{2005/02/10}{Added \cs{ledstrutL} to \cs{Pages}}
+% \changes{v0.3.0}{2005/02/10}{Added \cs{ledstrutL} to \cs{Pages}}
% \begin{macrocode}
\ifdefstring{\@eledsectnotoc}{L}{\ledsectnotoc}{}%
\csuse{before@pstartL@\the\l@dpscL}%
@@ -5207,7 +5377,7 @@
\clearl@dleftpage }%
% \end{macrocode}
% Now do the same for the right text.
-% \changes{v0.3}{2005/02/10}{Added \cs{ledstrutR} to \cs{Pages}}
+% \changes{v0.3.0}{2005/02/10}{Added \cs{ledstrutR} to \cs{Pages}}
% \begin{macrocode}
\checkpageR%
\l@duselanguage{\theledlanguageR}%
@@ -5289,23 +5459,33 @@
\global\instanzaLfalse%
\global\instanzaRfalse%
\l@dprintingpagesfalse%
+ \finish@sameparallelpage@number%In order to have continuous page number
\finish@Pages@notes%Needed to prevent final notes overlap line number
\ignorespaces}
+
% \end{macrocode}
% \end{macro}
%
+% \subsection{Ensure all notes be printed at the end of parallel pages}
% \begin{macro}{\finish@Pages@notes}
% This macro ensures that all long notes are printed at the end of \cs{Pages} typessetting, and that there is no more long notes left for the next pages.
% \begin{macrocode}
\newcommand{\finish@Pages@notes}{%
\def\do##1{%
+% \end{macrocode}
+% First, declare footnote box if there was no previous declared.
+% E.g. if familiar or critical notes were disabled by \eledmac{} options.
+% \begin{macrocode}
\ifnocritical@%
- \newbox\csuse{##1footins}
+ \global\newnamebox{##1footins}
\fi
\ifnofamiliar@%
- \newbox\csuse{footins##1}
+ \global\newnamebox{footins##1}
\fi
+% \end{macrocode}
+% And now, add a \cs{newpage} if there is no more footnote to print.
+% \begin{macrocode}
\ifvoid\csuse{##1footins}%
\ifvoid\csuse{footins##1}\else%
\newpage\null%
@@ -5320,10 +5500,11 @@
}%
% \end{macrocode}
% \end{macro}
+% \subsection{Struts}
% \begin{macro}{\ledstrutL}
% \begin{macro}{\ledstrutR}
% Struts inserted into leftand right text lines.
-% \changes{v0.3}{2005/02/10}{Added \cs{ledtrutL} and \cs{ledstrutR}}
+% \changes{v0.3.0}{2005/02/10}{Added \cs{ledtrutL} and \cs{ledstrutR}}
% \begin{macrocode}
\newcommand*{\ledstrutL}{\strut}
\newcommand*{\ledstrutR}{\strut}
@@ -5332,7 +5513,8 @@
% \end{macro}
% \end{macro}
%
-%
+%
+% \subsection{Page clearing}
% \begin{macro}{\cleartoevenpage}
% \begin{macro}{\cleartol@devenpage}
% \cs{cleartoevenpage}, which is defined in the memoir class,
@@ -5376,6 +5558,7 @@
\newcommand*{\clearl@drightpage}{%
\ifdim\pagetotal=0pt\hbox{}\fi%
\newpage%
+ \stepcounter{sameparallelpage@number}%
\ifodd\c@page
\led@err@RightOnLeftPage
\hbox{}%
@@ -5386,6 +5569,7 @@
% \end{macro}
% \end{macro}
%
+% \subsection{Lines managing}
% \begin{macro}{\getlinesfromparlistL}
% \begin{macro}{\@cs@linesinparL}
% \begin{macro}{\getlinesfromparlistR}
@@ -5486,6 +5670,7 @@
% \end{macro}
% \end{macro}
%
+% \subsection{Page break managing}
% \begin{macro}{\ifl@dsamepage}
% \begin{macro}{\l@dsamepagetrue}
% \begin{macro}{\l@dsamepagefalse}
@@ -5653,9 +5838,10 @@
% \end{macro}
% \end{macro}
%
+% \subsection{Getting boxes content}
% \begin{macro}{\get@nextboxL}
% \begin{macro}{\get@nextboxR}
-% \changes{v0.11}{2012/06/11}{Change \cs{get@nextboxL} and \cs{get@nextboxR} to allow to disable line numbering (like in eledmac 0.15).}
+% \changes{v0.11.0}{2012/06/11}{Change \cs{get@nextboxL} and \cs{get@nextboxR} to allow to disable line numbering (like in eledmac 0.15).}
% If the current box is not empty (i.e., still contains some lines)
% nothing is done. Otherwise if and only if a synchronisation point is
% reached the next box is started.
@@ -5691,7 +5877,7 @@
\fi
\ifnum\l@dnumpstartsL>\l@dpscL
% \end{macrocode}
-% \changes{v0.11}{2012/06/11}{Pstart number can be printed in side}
+% \changes{v0.11.0}{2012/06/11}{Pstart number can be printed in side}
% There are still unprocessed boxes. Recalculate the maximum number of
% lines needed, and move onto the next box (by incrementing \cs{l@dpscL}). If needed, restart the line numbering.
% \begin{macrocode}
@@ -5724,10 +5910,6 @@
\parledgroup@correction@notespacing@final{L}
\else
% \end{macrocode}
-% Add the content of the optional argument of the last \cs{pend}.
-% \begin{macrocode}
- \print@last@after@pendLtrue%
-% \end{macrocode}
% \begin{macrocode}
\fi
\fi
@@ -5775,6 +5957,41 @@
% \end{macro}
% \end{macro}
%
+% \subsection{Same page number in both side}
+% The \verb+sameparallelpagenumber+ allow to have the same page number for the left and the right side
+% We can not do it by changing the value of the \verb|page| counter, since its value is used to determine whether a page is left or right.
+% Consequently, we have to do it by patching \cs{thepage} inside a \cs{Pages} macro.
+%
+%
+% \begin{macro}{\init@sameparallelpage@number}
+% This macro is called at the beginning of \cs{Pages}.
+% It patches the \cs{thepage} macro in order to
+% and to use the value of \verb+sameparallelpage@number+ \LaTeX counter instead of those of \verb+page+ \LaTeX counter.
+% As we are inside a group, the patch is local, and, consequently, the page printed after the \cs{Pages} will use the normal page number scheme.
+%
+% The value of \verb+sameparallelpage@number+ is increase by 1 when we change from right page to left page.
+% \begin{macrocode}
+\newcounter{sameparallelpage@number}
+\newcommand{\init@sameparallelpage@number}{%
+ \setcounter{sameparallelpage@number}{\c@page}%
+ \ifsameparallelpagenumber%
+ \patchcmd{\thepage}{page}{sameparallelpage@number}{}{}%
+ \fi%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\finish@sameparallelpage@number}
+% This macro is called at the end of \cs{Pages}.
+% If the \verb+sameparallelpage@number+ is enabled,
+% it set the page number to the last value of \verb+sameparallelpage@number+ counter, in order to have a continuity of page numbering between pages printed with \cs{Pages} and normal pages.
+% \begin{macrocode}
+\newcommand{\finish@sameparallelpage@number}{%
+ \ifsameparallelpagenumber%
+ \setcounter{page}{\c@sameparallelpage@number}%
+ \fi%
+}%
+% \end{macrocode}
+% \end{macro}
% \section{Sections' titles' commands}
% As switching from left to right pages does not clear the page since v1.13.0,
% but only creates new pages, no \verb+\vbox{}+ is inserted, and consequently parallel chapters are mis-aligned.