summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/eledmac
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
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')
-rw-r--r--Master/texmf-dist/source/latex/eledmac/eledmac.dtx1101
-rw-r--r--Master/texmf-dist/source/latex/eledmac/eledmac.ins3
-rw-r--r--Master/texmf-dist/source/latex/eledmac/eledpar.dtx415
-rw-r--r--Master/texmf-dist/source/latex/eledmac/eledpar.ins2
4 files changed, 1090 insertions, 431 deletions
diff --git a/Master/texmf-dist/source/latex/eledmac/eledmac.dtx b/Master/texmf-dist/source/latex/eledmac/eledmac.dtx
index 8e32d29da58..8411945969e 100644
--- a/Master/texmf-dist/source/latex/eledmac/eledmac.dtx
+++ b/Master/texmf-dist/source/latex/eledmac/eledmac.dtx
@@ -29,10 +29,22 @@
% hyperindex=true
hyperindex=false
]{hyperref}
-\usepackage[utf8]{inputenc}
+\usepackage{fontspec}
\usepackage[english]{babel}
\usepackage{graphicx,eledmac,metalogo}
+% Index and Changelog in one column
\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
@@ -42,7 +54,6 @@
\renewcommand{\MakeUppercase}[1]{#1}
\pagestyle{headings}
\setcounter{StandardModuleDepth}{1}
-\setcounter{IndexColumns}{2}
\begin{document}
\raggedbottom
\DocInput{eledmac.dtx}
@@ -52,7 +63,7 @@
% \fi
%
% \newcommand{\reff}[1]{\ref{#1} p.~\pageref{#1}}
-% \CheckSum{11649}
+% \CheckSum{11980}
%
% \makeatletter
% \newcommand*{\DescribeIt}{\leavevmode\@bsphack\begingroup\MakePrivateLetters
@@ -148,41 +159,42 @@
% \newcommand{\texbook}{\textit{TeXbook}}
% \newcommand{\thetexbook}{\textit{The TeXbook}}
%
-% \changes{v0.1}{2003/03/25}{First public release}
-% \changes{v0.2}{2003/08/16}{Added tabmac code, and extended indexing}
+% \changes{v0.1.0}{2003/03/25}{First public release}
+% \changes{v0.2.0}{2003/08/16}{Added tabmac code, and extended indexing}
% \changes{v0.2.1}{2003/09/13}{Bug fixes and match with mempatch v1.8}
% \changes{v0.2.2}{2003/11/09}{Improved paragraph footnotes}
% \changes{v0.2.2}{2003/11/09}{New Dekker example}
-% \changes{v0.3}{2004/02/14}{Includes edstanza and more}
+% \changes{v0.3.0}{2004/02/14}{Includes edstanza and more}
% \changes{v0.3.1}{2004/02/18}{Not released. Added remarks about the parallel package}
-% \changes{v0.4}{2004/02/29}{Added minipage, etc., support}
+% \changes{v0.4.0}{2004/02/29}{Added minipage, etc., support}
% \changes{v0.4.1}{2004/03/28}{Not released. Minor editorial improvements and code tweaks}
-% \changes{v0.5}{2004/04/04}{Added sidenotes, familiar footnotes in numbered text}
+% \changes{v0.5.0}{2004/04/04}{Added sidenotes, familiar footnotes in numbered text}
% \changes{v0.5.1}{2004/04/10}{Fixed right line numbers killed in v0.5}
-% \changes{v0.6}{2004/11/16}{Fixed long paragraphs looping}
-% \changes{v0.6}{2004/11/16}{Prepared for eledpar package}
-% \changes{v0.6}{2004/12/10}{Fixed minor typos}
-% \changes{v0.7}{2005/02/18}{Tidying up for eledpar and ledarab packages}
-% \changes{v0.7}{2005/02/18}{Replaced all \cs{interAfootnotelinepenalty}, etc.,
+% \changes{v0.6.0}{2004/11/16}{Fixed long paragraphs looping}
+% \changes{v0.6.0}{2004/11/16}{Prepared for eledpar package}
+% \changes{v0.6.0}{2004/12/10}{Fixed minor typos}
+% \changes{v0.7.0}{2005/02/18}{Tidying up for eledpar and ledarab packages}
+% \changes{v0.7.0}{2005/02/18}{Replaced all \cs{interAfootnotelinepenalty}, etc.,
% by just \cs{interfootnotelinepenalty}}
-% \changes{v0.7}{2005/03/02}{eledmac having been available for 2 years,
+% \changes{v0.7.0}{2005/03/02}{eledmac having been available for 2 years,
% deleted the commented out original edmac texts}
-% \changes{v0.7}{2011/06/17}{Ma\"ieul Rouquette new maintainer}
-% \changes{v0.8}{2011/17/06}{Bug on endnotes fixed: in a // text, all endnotes will print and be placed at the ends of columns (!)}
+% \changes{v0.7.0}{2011/06/17}{Ma\"ieul Rouquette new maintainer}
+% \changes{v0.8.0}{2011/17/06}{Bug on endnotes fixed: in a // text, all endnotes will print and be placed at the ends of columns (!)}
% \changes{v0.8.1}{2011/07/14}{Bug on \cs{edtext} ; \cs{critex} ; \cs{lemma} fixed: we can now us non-switching commands}
-% \changes{v0.9}{2011/08/03}{No more ledpatch. All patches are now in the main file.}
+% \changes{v0.9.0}{2011/08/03}{No more ledpatch. All patches are now in the main file.}
% \changes{v0.9.1}{2011/08/08}{Fix some bugs linked to integrating ledpatch on the main file.}
-% \changes{v0.10}{2011/08/22}{Corrections to \cs{section} and other titles in numbered sections}
-% \changes{v0.11}{2011/09/16}{Makes it possible to add a symbol on each verse's hanging, as in French typography. Redefines the command \cs{hangingsymbol} to define the character.}
-% \changes{v0.12}{2011/10/01}{Possibility to number the pstart with the commands \cs{numberpstarttrue}.}
-% \changes{v0.12}{2011/10/01}{For compatibility with eledpar, possibility to use \cs{autopar} on the right side.}
+% \changes{v0.10.0}{2011/08/22}{Corrections to \cs{section} and other titles in numbered sections}
+% \changes{v0.11.0}{2011/09/16}{Makes it possible to add a symbol on each verse's hanging, as in French typography. Redefines the command \cs{hangingsymbol} to define the character.}
+% \changes{v0.12.0}{2011/10/01}{Possibility to number the pstart with the commands \cs{numberpstarttrue}.}
+% \changes{v0.12.0}{2011/10/01}{For compatibility with eledpar, possibility to use \cs{autopar} on the right side.}
% \changes{v0.12.1}{2011/10/02}{The numbering of \cs{pstarts} restarts on each \cs{beginnumbering}.}
% \changes{v0.12.1}{2011/10/02}{Don't number \cs{pstarts} of stanza.}
-% \changes{v0.13}{2011/11/08}{New stanzaindentsrepetition counter: to repeat stanza indents every \emph{n} verses.}
+% \changes{v0.13.0}{2011/11/08}{New stanzaindentsrepetition counter: to repeat stanza indents every \emph{n} verses.}
% \changes{v0.13.1}{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.14}{2012/04/04}{Tweaked \cs{edlabel} to get correct line number if the command is first element of a paragraph.}
-% \changes{v1.0}{2012/09/15}{Some compatibility break with eledmac. Change of name: eledmac.}
-% \changes{v1.1}{2012/09/25}{New package option: parapparatus.}
+% \changes{v0.14.0}{2012/04/04}{Tweaked \cs{edlabel} to get correct line number if the command is first element of a paragraph.}
+% \changes{v1.0.0}{2012/09/15}{Some compatibility break with eledmac. Change of name: eledmac.}
+% \changes{v1.1.0}{2012/09/25}{New package option: parapparatus.}
+% \changes{v1.4.0}{2012/11/16}{Compatibility with LuaTeX of RTL notes.}
% \changes{v1.4.2}{2012/12/12}{Debug with some special classes.}
% \changes{v1.4.3}{2012/12/18}{Spurious space after familiar footnotes.}
% \changes{v1.4.4}{2013/02/18}{Label inside familiar footnotes.}
@@ -190,6 +202,7 @@
% \changes{v1.4.6}{2013/04/15}{Bug with memoir class introduced by 1.4.5.}
% \changes{v1.4.8}{2013/07/02}{Corrects a bug with parallel texts introduced by 1.1.}
% \changes{v1.6.1}{2013/10/27}{Corrects a false hanging verse when a verse is exactly the length of a line.}
+% \changes{v1.4.0}{2012/11/16}{Compatibility with LuaTeX of RTL notes.}
% \changes{v1.8.0}{2013/12/13}{Compatibility with parledgroup option of eledpar package.}
% \changes{v1.8.2}{2014/01/31}{Debug compatibility problem with hebrew option of babel package.}
% \changes{v1.8.3}{2014/02/03}{Fixes spurious spaces added by v1.7.0.}
@@ -246,6 +259,16 @@
% \changes{v1.22.0}{2015/04/25}{Adds hyperlink for references to notes in indices.}
% \changes{v1.22.0}{2015/04/25}{Fix conflict between noend package option and edtabularx environments}
% \changes{v1.22.1}{2015/04/29}{Fix bug (added on v1.22.0) with \cs{inplaceofnumber} hook.}
+% \changes{v1.23.0}{2015/05/18}{Compatibility between nofamiliar/nocriticals option and minipage/ledgroup.}
+% \changes{v1.23.0}{2015/05/18}{Fix error of \cs{iftrue} not closed.}
+% \changes{v1.23.0}{2015/05/18}{Allow use of \cs{sameword} with inputenc managing of UTF-8.}
+% \changes{v1.23.0}{2015/05/18}{Error message when using \cs{beginnumbering}…\cs{endnumbering} without \cs{pstart}.}
+% \changes{v1.23.0}{2015/05/18}{New tools to ensure the line-list file uses the right version of commands when upgrading the eledmac version.}
+% \changes{v1.23.0}{2015/05/18}{Fix bug with \cs{skipnumbering} called immediately after a \cs{pstart}.}
+% \changes{v1.23.0}{2015/05/18}{Fix spurious space with \cs{skipnumbering} (bug added on v1.21.0).}
+% \changes{v1.23.1}{2015/05/20}{Fix bug with \cs{lemma} command in the right side.}
+% \changes{v1.23.2}{2015/05/29}{Compatibility with \LaTeX's release 2015.}
+% \changes{v1.24.0}{2015/06/02}{We can reinitialize \cs{AtEveryPstart} and \cs{AtEveryPend} providing to it an empty argument.}
% \hyphenation{man-u-script man-u-scripts}
%
%
@@ -340,7 +363,8 @@
% \Lpack{poemscol} for poetical works.
%
% \Lpack{eledmac} 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)
+% Also provided is a help folder, ``\href{examples/.}{examples}''. The folder contains additional examples (although not for all cases).
+% Example starting by ``1-'' are for basic uses, those starting by ``2-'' are for advanced uses.
%
% To report bugs or request a new feature, please go to ledmac GitHub page and click on ``New Issue'': \url{https://github.com/maieul/ledmac/issues/}. You must create an account on github.com to access my page (maieul/ledmac). GitHub accounts are free for open-source users. You can post messages in English or in French (preferred).
%
@@ -813,7 +837,7 @@
% pp.\,257--258.\protect\index{Beeton, Barbara Ann Neuhaus Friend}}
%
% \subsubsection{Numbering paragraphs (\cs{pstart})}
-%\changes{v0.12}{2011/10/01}{Possibility to number \cs{pstart}.}
+%\changes{v0.12.0}{2011/10/01}{Possibility to number \cs{pstart}.}
% It is 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 numbering with \DescribeMacro{\numberpstartfalse}\cs{numberpstartfalse}.
% You can redefine the command \DescribeMacro{\thepstart}\cs{thepstart} to change style.
% You can change the value of the pstart number by using \emph{after} \cs{beginnumbering}:
@@ -821,11 +845,11 @@
% \setcounter{numberpstart}{value}
% \end{verbatim}
% On each \cs{beginnumbering} the numbering restarts.
-% \changes{v0.15}{2012/06/11}{Possibility to print \cs{pstart} number inside.}
+% \changes{v0.15.0}{2012/06/11}{Possibility to print \cs{pstart} number inside.}
%
% With the \cs{sidepstartnumtrue} command, the number of \cs{pstart} will be printed inside. In this case, the line number will be not printed.
%
-% \changes{v1.1}{2012/09/25}{Add \cs{labelpstarttrue}.}
+% \changes{v1.1.0}{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 written in right to left, we \LuaLaTeX\ or \XeLaTeX, so
@@ -921,7 +945,7 @@
% \texttt{linenumincrement} counter values.
% \subsubsection{Setting lineation reset}
% \DescribeMacro{\lineation}
-% \changes{v1.0}{2012/09/15}{Debug in lineation command}
+% \changes{v1.0.0}{2012/09/15}{Debug in lineation command}
% Lines can be numbered either by page, by pstart or by section; you specify
% this using the \cs{lineation}\marg{arg}
% macro, where \meta{arg} is either
@@ -1155,7 +1179,7 @@
%
% If you need more series of critical notes, please look at \reff{newseries}.
%
-%\changes{v1.0}{2012/09/15}{Options nonum and nosep in \cs{Xfootnote}.}
+%\changes{v1.0.0}{2012/09/15}{Options nonum and nosep in \cs{Xfootnote}.}
%\changes{v1.20.0}{2015/03/22}{Options fulllines in \cs{Xfootnote}.}\label{Xfootnoteopt}
%An optional argument can be added before the text of the footnote. Its value is a comma separated list of options.
% \label{fulllines}The available options are:
@@ -1225,7 +1249,7 @@
% \end{verbatim}
%
% \DescribeMacro{\lemma}
-% \changes{v1.0}{2012/09/15}{\cs{lemma} can contain commands.}
+% \changes{v1.0.0}{2012/09/15}{\cs{lemma} can contain commands.}
% If you want to change the lemma that gets passed to the notes, you
% can do this by using \cs{lemma}\marg{alternative} within the
% second argument to \cs{edtext}, before the note commands.
@@ -1307,26 +1331,100 @@
%
% \subsection{Disambiguation of identical words in the apparatus}
% \changes{v1.15.0}{2015/01/12}{New tools to prevent ambiguous references in lemma}
+% \changes{v1.23.0}{2015/05/18}{Fix bug with \cs{sameword} when the same lemma is used for multiple notes or for nested \cs{edtext}s.}
+% \changes{v1.23.0}{2015/05/18}{Optional argument of \cs{sameword} can be a comma separated list of \cs{edtext} depth.}
+% \changes{v1.23.0}{2015/05/18}{Fix bug with \cs{sameword} when the lemma overlaps multiple line.}
% Sometimes, the same word occurs twice (or more) in the same line.
% \Lpack{eledmac} provides tools to disambiguate references in the critical notes.
% The lemma will be followed by a reference number if a given word occurs more that once in the same line.
-%
+%
+% \subsubsection{Basic use}
% \DescribeMacro{\sameword} To use this tool, you have to mark every occurrence of the potentially ambiguous term with the \cs{sameword} command:
% \begin{verbatim}
% Lupus \sameword{aut} canis \edtext{\sameword{aut}}{\Afootnote{et}} felix
% \end{verbatim}
% In this example, \verb+aut+ will be followed, in the critical note, by the exponent \verb+2+ if it is printed in the same line as the first \verb+aut+, but it won't if it is printed in a different line. The number is printed only after the second run.
%
-% If you use the \cs{lemma} command, \Lpack{eledmac} assumes that the word marked with \cs{sameword} is not already present in \cs{lemma}.
-% However, if it is actually present in \cs{lemma}, you must use this method:
+% \subsubsection{Note about input encoding with UTF-8 processor}
+%
+% If you use UTF-8 processor, like \XeLaTeX\ or \LuaLaTeX, there should not be any glitches.
+% However, pay attention to how characters are encoded. Similar-looking characters may be represented differently in unicode numbering.
+%
+% For instance, in Greek, \verb+ᾳ+ has two possible unicode numbers:
+% \begin{itemize}
+% \item GREEK SMALL LETTER ALPHA (U+03B1) + COMBINING GREEK YPOGEGRAMMENI (U+0345)
+% \item GREEK SMALL LETTER ALPHA WITH YPOGEGRAMMENI (U+1FB3)
+% \end{itemize}
+%
+% Which unicode number you use depends, many times, on your keyboard configuration (the computer-input system).
+%
+% Inside \eledmac, the \cs{sameword} command considers these two unicodes options as different characters. If you use only one unicode number consistently, the distinction will probably make no difference to how your text looks, but \cs{sameword} will process the text inaccurately, based on the unicode numbers. To prevent this, do the following:
+% \begin{itemize}
+% \item If you use \XeLaTeX, add this line in your preamble: \verb+ \XeTeXinputnormalization 1+.
+% \item If you use \LuaLaTeX, use the \Lpack{uninormalize} of Michal Hoftich\footnote{\url{https://github.com/michal-h21/uninormalize}.} with the \verb+buffer+ option set to true.
+% \end{itemize}
+%
+% With these tools, \XeTeX\ / \LuaTeX\ will dynamicaly normalize unicode input when reading the file.
+% Consequently, you will have no problems with the \cs{sameword} command.
+% \subsubsection{Use with \cs{lemma} command}
+% If you use the \cs{lemma} command, \Lpack{eledmac} cannot know to which occurence of \cs{sameword} in the first argument of \cs{edtext} a word marked with \cs{sameword} in \cs{lemma} should refer.
+%
+% For example in the following example:
+% \begin{verbatim}
+% some thing
+% \edtext{\sameword{sw}
+% and other \sameword{sw}
+% and again \sameword{sw}
+% it is all}%
+% }{\lemma{\sameword{sw} \ldots all}\Afootnote{critical note}}.%
+% \end{verbatim}
+% \Lpack{eledmac} cannot know if the ``sw'' in \cs{lemma} refers to the word after ``thing'', after ``other'', or after ``again''.
+%
+% Consequently, you have to tell \Lpack{eledmac} which instance of \cs{sameword} in the first argument of \cs{edtext} you want to reference:
% \begin{itemize}
-% \item In the first argument of \cs{edtext}, use \cs{sameword} with the optional argument `[inlemma]`.
% \item In the content of \cs{lemma}, use \cs{sameword} with no optional argument.
+% \item In the first argument of \cs{edtext}, use \cs{sameword} with the optional argument \oarg{X}. \meta{X} is the depth of the \cs{edtext} where the \cs{lemma} is used.
+% So if the \cs{lemma} is called in a \cs{edtext} inside another \cs{edtext}, \meta{X} is equal to \verb+2+.
+% If the \cs{lemma} is called in a \cs{edtext} ``of first level'', \meta{X} is equal to \verb|1|. If the lemma is called in both 1 and 2 \cs{edtext} depth, \meta{X} is \verb+1,2+. If that word is referenced in the lemma of every \cs{edtext} depth, \meta{X} can also be set to \verb+inlemma+.
% \end{itemize}
-% Like this:
+% Note that only words that are actually referenced in a \cs{lemma} need the optional argument. Therefore, the first \cs{sameword} in the example above should have ``1'' as its optional argument, to be referenced correctly in the lemma.
+%
+% Note also that the \meta{X} does not refer to the level where the \cs{sameword} occurs, but to the level of the \cs{lemma} that refers to that \cs{sameword}. For example:
% \begin{verbatim}
-% \edtext{\sameword[inlemma]{sw}}{\lemma{\sameword{sw} some lemma}\Afootnote{some note}}
+% \edtext{some \edtext{\sameword[1]{word}}{\Afootnote{om. M}}
+% and other \sameword{word}
+% and again a \sameword{word}
+% it is all}%
+% }{\lemma{some \sameword{word} \ldots all}\Afootnote{critical note}}.%
% \end{verbatim}
+% Here the \cs{sameword} occurs in an \cs{edtext} of level 2, but since it is referenced by \cs{lemma} on level 1, it has ``1'' in the optional argument.
+
+% In the following schema, each framed box represents an \cs{edtext} level. Each number is an occurrence of \cs{sameword}. After a framed box, the text in superscript represents the content of \cs{lemma} for that \cs{edtext} level. The text in subscript at the right of a number represents the content of the optional argument of \cs{sameword}.
+%
+%\fbox{%
+% \fbox{%
+% $1_{inlemma}$
+% \fbox{$2$}
+% $3_2$%
+% }\textsuperscript{$1$\ldots$3$}%
+% 4
+% $5_1$
+% }\textsuperscript{1\ldots5}
+%
+% The \cs{sameword} number~3 is called in a \cs{lemma} related to an \cs{edtext} of level~2.
+% It must be marked by ``2''.
+%
+% The \cs{sameword} number~5 is called in a \cs{lemma} related to \cs{edtext} of level~1. It must be marked by ``1''.
+%
+% The \cs{sameword} number is called in two \cs{lemma}s: one related to a \cs{edtext} of level~1, the other related to \cs{edtext} of level~2.
+% It must be marked by ``1,2''.
+% However, as \cs{lemma} is called only in level~1 and~2, ``1,2'' could replaced by ``inlemma''.
+%
+% The \cs{sameword} number ``2'' is in the first argument of a \cs{edtext} of level~3, but it has no \cs{lemma}-command, so there is no need to mark it.
+%
+%
+%
+% \subsubsection{Customizing}
% \DescribeMacro{\showwordrank}You can redefine the \cs{showwordrank} macro to change the way the number is printed. The default value is
% \begin{verbatim}
%\newcommand{\showwordrank}[2]{%
@@ -1375,7 +1473,7 @@
%
% \subsection{Display options}
% \label{displayoptions}
-% \changes{v1.0}{2012/09/15}{New generic commands to customize footnote display.}
+% \changes{v1.0.0}{2012/09/15}{New generic commands to customize footnote display.}
% Since version 1.0, some commands can be used to change the display of the footnotes. All can have an optional argument \oarg{s}, which is the letter of the series --- or a list of letters separated by comma --- depending on which option is applied.
%
% When a length, noted \meta{l}, is used, it can be stretchable: \verb|a plus b minus c|. The final length |m| is calculated by \LaTeX{} to have: $a-c \leq m \leq a+b$. If you use some relative unity\footnote{Like \verb|em| which is the width of a mg.}, it will be relative to fontsize of the footnote, except for commands concerning the place kept by the notes --- including blank space.
@@ -1388,7 +1486,7 @@
% Use \cs{numberonlyfirstinline}\oarg{s}\verb+[false]+ to disable this (\meta{s} can be empty if you want to disable it for every series).
%
% \DescribeMacro{\numberonlyfirstintwolines}
-% \changes{v1.1}{2012/09/25}{Add \cs{numberonlyfirstintwolines}}
+% \changes{v1.1.0}{2012/09/25}{Add \cs{numberonlyfirstintwolines}}
% Suppose you have a lemma on line~2 and a lemma between line~2 and line~3.
% With \cs{numberonlyfirstinline}, the second lemma is considered to be on the same line as the first lemma.
% But if you use both \cs{numberonlyfirstinline}\oarg{s} and \cs{numberonlyfirstintwolines}\oarg{s}, the distinction is made.
@@ -1437,7 +1535,7 @@
% \DescribeMacro{\nonumberinfootnote}
% You can use \cs{nonumberinfootnote}\oarg{s} if you don't want to have the line number in a footnote. To cancel it, use \cs{nonumberinfootnote}\oarg{s}\verb+[false]+.
%
-% \changes{v1.1}{2012/09/25}{Add \cs{pstartinfootnote} and \cs{onlypstartinfootnote}}
+% \changes{v1.1.0}{2012/09/25}{Add \cs{pstartinfootnote} and \cs{onlypstartinfootnote}}
% \changes{v1.18.0}{2015/02/23}{Add \cs{pstartinfootnoteeverytime}}
% \changes{v1.18.0}{2015/02/23}{Debug \cs{onlypstartinfootnote} when using \cs{numberonlyfirstinline} and the current line number differs from the previous.}
% \DescribeMacro{\pstartinfootnote}
@@ -1492,10 +1590,38 @@
% \DescribeMacro{\boxsymlinenum}
% \cs{boxsymlinenum}\oarg{s}\marg{l} is the same as \cs{boxlinenum} but for the line number symbol.
%
-%
+% \changes{v1.23.0}{2015/05/18}{Add \cs{boxlinenumalign} and \cs{boxXendlinenumalign}.}
+% \DescribeMacro{boxlinenumalign}
+% If you put line number in box, it will be aligned left inside the box.
+% However, you can change it using \cs{boxlinenumalign}\oarg{s}\marg{text} where \meta{text} can be the following:
+% \begin{description}
+% \item[L] to align left (default value);
+% \item[R] to align right;
+% \item[C] to center.
+% \end{description}
+%
+% \changes{v1.23.0}{2015/05/18}{Add \cs{boxstartlinenum}, \cs{boxXendstartlinenum}, \cs{boxendlinenum}, \cs{boxXendendlinenum}.}
+% When using boxlinenum, \Eledmac{} put all the line number description in the same box. That is, the same box will contain: the start line number, the dash, and either the end line number or the range symbol (like \verb+ff.+).
+% However, it is possible to box them in two different boxes.
+% \begin{itemize}
+% \item \cs{boxstartlinenum}\oarg{s}\marg{l} will box the start line number in a box of length \meta{l}. The content will be put at the right of the box.
+% \item \cs{boxendlinenum}\oarg{s}\marg{l} will box the dash plus the end line number or the range symbol in a box of length \meta{l}. The content will be put at the left of the box.
+% \end{itemize}
+%
+% With these two commands, it is possible to horizontaly align the dash of line number when using critical notes, to obtain something like:
+% \begin{verbatim}
+% 1
+% 12-23
+% 24ff.
+% \end{verbatim}
% \DescribeMacro{\boxXendlinenum}
+% \DescribeMacro{\boxXendlinenumalign}
+% \DescribeMacro{\boxXendstartlinenumalign}
+% \DescribeMacro{\boxXendendlinenumalign}
% \changes{v1.20.0}{2015/03/22}{Add \cs{boxXendlinenum}}
-% \cs{boxXendlinenum}\oarg{s}\marg{l} is the same as \cs{boxlinenum} except in endnotes.
+% \cs{boxXendlinenum}\oarg{s}\marg{l}, \cs{boxXendlinenumalign}\oarg{s}\marg{text}, \cs{boxXendstartlinenum}\oarg{s}\marg{l}, \cs{boxXendendlinenum}\oarg{s}\marg{l} are the same as, respectively, \cs{boxlinenum} and \cs{boxlinenumalign}, \cs{boxstartlinenum}, \cs{boxendlinenum} except in endnotes.
+%
+%
%\subsubsection{Separator between the lemma and the note}
% \paragraph{For footnotes}
% \DescribeMacro{\lemmaseparator}
@@ -1583,7 +1709,7 @@
% For familiar notes NOT paragraphed you can define an indentation with \cs{Xhangindent}\oarg{s}\marg{l}, which will be applied in the second line of notes. It can help to make a distinction between a new note and a break in a note.
%
% \subsubsection{Arbitrary code at the beginninging of notes}
-% \changes{v1.1}{2012/09/25}{New hook to add arbitrary code at the beginning of the notes}
+% \changes{v1.1.0}{2012/09/25}{New hook to add arbitrary code at the beginning of the notes}
% The three next commands add an arbitrary code at the beginning of notes.
% As the name's space is local to the notes, you can use it to redefine some style inside the notes.
% For example, if you don't want the pstart number to be in bold, use :
@@ -1640,7 +1766,7 @@
%
% \DescribeMacro{\parafootsep}
% For paragraphed footnotes (see below), you can choose the separator between each note by using \cs{parafootsep}\oarg{s}\marg{text}. A common separator is the double pipe (\verb+$||$+), which you can set by using \cs{parafootsep}\verb+{$\parallel$}+.
-% Note that if the symbol defined by \cs{symlinenum} must be used at the begin of a notes, the \cs{parafootsep} is not used before this note.
+% Note that if the symbol defined by \cs{symlinenum} must be used at the beginning of a note, the \cs{parafootsep} is not used before this note.
%
% \changes{v1.12.0}{2014/08/05}{New options for ragged-paragraph notes}
% \DescribeMacro{\Xragged}
@@ -1650,7 +1776,7 @@
% Text in paragraphed footnotes is justified, but you can use \cs{raggedX}\oarg{s}+{L}+ if you want it to be ragged left, or \cs{raggedX}\oarg{s}+{R} if you want it to be ragged right.
%
%\subsubsection{Options for block of notes}
-% \changes{v1.1}{2012/09/12}{New options for block of notes.}
+% \changes{v1.1.0}{2012/09/12}{New options for block of notes.}
% \DescribeMacro{\txtbeforeXnotes}
% You can add some text before critical notes with \cs{txtbeforeXnotes}\oarg{s}\marg{text}.
%
@@ -1910,7 +2036,7 @@
% long to fit on one print line.
%
% \subsection{Repeating stanza indents}
-%\changes{v0.13}{2011/11/08}{New stanzaindentsrepetition counter to repeat stanza indents every \emph{n} verses.}
+%\changes{v0.13.0}{2011/11/08}{New stanzaindentsrepetition counter to repeat stanza indents every \emph{n} verses.}
% \label{stanzaindentsrepetition}Since version 0.13, if the indentation is repeated every \emph{n} verses of the stanza, you can define only the \emph{n} first indentations, and say they are repeated, defining the value of the \verb+stanzaindentsrepetition+ counter at \emph{n}. For example:
%\begin{verbatim}
%\setstanzaindents{5,1,0}
@@ -2292,7 +2418,7 @@
% \changes{v1.12.3}{2014/08/15}{Debug \cs{ledinnernote} and \cs{ledouternote} commands in the top of pages.}
% \DescribeMacro{\ledleftnote}
% \DescribeMacro{\ledrightnote}
-% \changes{v1.0}{2012/09/15}{Possibility to have commands in sidenotes.}
+% \changes{v1.0.0}{2012/09/15}{Possibility to have commands in sidenotes.}
% \DescribeMacro{\ledsidenote}
% \DescribeMacro{\sidenotemargin}
% \cs{ledsidenote}\marg{text} will put \meta{text} into the margin specified
@@ -3103,7 +3229,7 @@
% \begin{macrocode}
%<*code>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{eledmac}[2015/04/29 v1.22.1 LaTeX port of EDMAC]%
+\ProvidesPackage{eledmac}[2015/06/02 v1.24.0 LaTeX port of EDMAC]%
% \end{macrocode}
%
% Generally, these are the modifications to the original.
@@ -3121,7 +3247,7 @@
% \end{itemize}
%
% \subsection{Package options}
-% \changes{v0.4}{2004/02/29}{Added final/draft options}
+% \changes{v0.4.0}{2004/02/29}{Added final/draft options}
% \changes{v1.13.0}{2014/09/16}{Added widthliketwocolumns option}
% \begin{macro}{\ifledfinal}
% \begin{macro}{\ifoldprintnpnumspace@}
@@ -3216,58 +3342,27 @@
% \end{macro}
% \end{macro}
% \end{macro}
-% Loading package \emph{xargs} to declare commands with optional arguments.
-% \emph {Etoolbox} is also used to make code clearer - for example, in dynamic command names (which can replace \cs{csname} etc.).
-% Use \emph{suffix} to declare commands with a starred version, \Lpack{xstring} to work with strings and \emph{iflutex} to test if LuaLaTeX is running, and \Lpack{ragged2e} to manage ragging for paragraphed notes.
-% \changes{v1.4}{2012/11/16}{Compatibility with LuaTeX of RTL notes.}
-% \begin{macrocode}
-\RequirePackage{xargs}
-\RequirePackage{etoolbox}
-\reserveinserts{32}
-\RequirePackage{suffix}
-\RequirePackage{xstring}
-\RequirePackage{ifluatex}
-\RequirePackage{ragged2e}
-% \end{macrocode}
-% \begin{macro}{\if@RTL}
-% The \cs{if@RTL} is defined by the bidi package, which is sometimes loaded by \emph{polyglossia}.
-% But we define it if the bidi package is not loaded.
-% \begin{macrocode}
-\ifdef{\if@RTL}{}{\newif\if@RTL}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\showlemma}
-% \verb?\showlemma?\marg{lemma} typesets the lemma text in the body.
-% It depends on the option.
-% \changes{v0.4}{2004/02/29}{Added \cs{showlemma}}
-% \begin{macrocode}
-\ifledfinal
- \newcommand*{\showlemma}[1]{#1}
-\else
- \newcommand*{\showlemma}[1]{\underline{#1}}
-\fi
-
-% \end{macrocode}
-% \end{macro}
% \subsection{Loading packages}
-% Loading package \emph{xargs} to declare commands with optional arguments.
-% \emph {Etoolbox} is also used to make code clearer - for example, in dynamic command names (which can replace \cs{csname} etc.).
-% Use \emph{suffix} to declare commands with a starred version, \Lpack{xstring} to work with strings, \emph{ifluatex} to test if LuaLaTeX is running, and \Lpack{ragged2e} to manage ragged for paragraphed notes.
-% \changes{v1.4}{2012/11/16}{Compatibility with LuaTeX of RTL notes.}
+% Loading package \Lpack{xargs} to declare commands with optional arguments.
+% \Lpack{Etoolbox} is also used to make code clearer - for example, in dynamic command names (which can replace \cs{csname} etc.).
+% Use \Lpack{suffix} to declare commands with a starred version, \Lpack{xstring} to work with strings, \Lpack{ifluatex} and \Lpack{ifxetex} to test if \LuaTeX\ or \XeTeX\ is running, and \Lpack{ragged2e} to manage ragged for paragraphed notes.
% \begin{macrocode}
\RequirePackage{xargs}
\RequirePackage{etoolbox}
+\RequirePackage{etex}
\reserveinserts{32}
\RequirePackage{suffix}
\RequirePackage{xstring}
\RequirePackage{ifluatex}
\RequirePackage{ragged2e}
+\RequirePackage{ragged2e}
+\RequirePackage{ifxetex}%
% \end{macrocode}
%
% \subsection{Boolean flags}
% \begin{macro}{\ifl@dmemoir}
% Define a flag for if the \Lpack{memoir} class has been used.
-% \changes{v0.2}{2003/07/25}{Added \cs{ifl@dmemoir} for memoir class having been used}
+% \changes{v0.2.0}{2003/07/25}{Added \cs{ifl@dmemoir} for memoir class having been used}
% \begin{macrocode}
\newif\ifl@dmemoir
\@ifclassloaded{memoir}{\l@dmemoirtrue}{\l@dmemoirfalse}
@@ -3301,11 +3396,18 @@
\ifdef{\if@RTL}{}{\newif\if@RTL}
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\if@RTL}
+% The \cs{if@RTL} is defined by the bidi package, which is sometimes loaded by \emph{polyglossia}.
+% But we define it if the bidi package is not loaded.
+% \begin{macrocode}
+\ifdef{\if@RTL}{}{\newif\if@RTL}
+% \end{macrocode}
+% \end{macro}
% \subsection{Messages}
%
% All the messages are grouped here as macros. This saves TeX's memory
% when the same message is repeated and also lets them be edited easily.
-% \changes{v0.7}{2005/02/21}{Made macros of all messages}
+% \changes{v0.7.0}{2005/02/21}{Made macros of all messages}
% \changes{v1.12.3}{2012/08/15}{Add macros for new messages since v0.7}
%
% \begin{macro}{\eledmac@warning}
@@ -3317,7 +3419,7 @@
%
% \begin{macro}{\eledmac@error}
% Write an error message.
-% \changes{v0.2}{2003/07/25}{Added \cs{eledmac@error} and replaced error messages}
+% \changes{v0.2.0}{2003/07/25}{Added \cs{eledmac@error} and replaced error messages}
% \changes{v1.12.3}{2014/08/15}{Replaced error messages}
% \begin{macrocode}
\newcommand{\eledmac@error}[2]{\PackageError{eledmac}{#1}{#2}}
@@ -3399,6 +3501,12 @@
\eledmac@warning{Can't find line-list file #1}}
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\led@warn@LineFileObsolete}
+% \begin{macrocode}
+\newcommand*{\led@warn@Obsolete}[1]{%
+ \eledmac@warning{Line-list file #1 was obsolete. We have not read it. Please run LaTeX again.}}
+% \end{macrocode}
+% \end{macro}
%
% \begin{macro}{\led@warn@BadAdvancelineSubline}
% \begin{macro}{\led@warn@BadAdvancelineLine}
@@ -3429,6 +3537,7 @@
% \begin{macro}{\led@err@PendNotNumbered}
% \begin{macro}{\led@err@PendNoPstart}
% \begin{macro}{\led@err@AutoparNotNumbered}
+% \begin{macro}{\led@err@NumberingWithoutPstart}
% \begin{macrocode}
\newcommand*{\led@err@PstartNotNumbered}{%
\eledmac@error{\string\pstart\space must be used within a
@@ -3444,12 +3553,15 @@
\newcommand*{\led@err@AutoparNotNumbered}{%
\eledmac@error{\string\autopar\space must be used within a
numbered section}{\@ehc}}
+\newcommand*{\led@err@NumberingWithoutPstart}{%
+ \eledmac@error{\string\beginnumbering...\string\endnumbering\space without \string\pstart}{\@ehc}}%
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\led@warn@BadAction}
% \begin{macrocode}
@@ -3618,6 +3730,7 @@
}%
% \end{macrocode}
% \end{macro}
+
%
% \subsection{Gobbling}
% \changes{v1.14.0}{2014/10/27}{Provide \cs{@gobblefour}}
@@ -3636,12 +3749,25 @@
% \end{macro}
% Here, we define some commands which gobble their arguments.
% \subsection{Miscellaneous commands}
+% \begin{macro}{\showlemma}
+% \verb?\showlemma?\marg{lemma} typesets the lemma text in the body.
+% It depends on the option.
+% \changes{v0.4.0}{2004/02/29}{Added \cs{showlemma}}
+% \begin{macrocode}
+\ifledfinal
+ \newcommand*{\showlemma}[1]{#1}
+\else
+ \newcommand*{\showlemma}[1]{\underline{#1}}
+\fi
+
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{\linenumberlist}
% The code for the \verb?\linenumberlist? mechanism was given to Peter Wilson by Wayne
% Sullivan\index{Sullivan, Wayne} on 2004/02/11.
%
% Initialize it as \verb?\empty?
-% \changes{v0.3}{2004/02/14}{Added \cs{linenumberlist} mechanism}
+% \changes{v0.3.0}{2004/02/14}{Added \cs{linenumberlist} mechanism}
% \begin{macrocode}
\let\linenumberlist=\empty
@@ -3736,9 +3862,9 @@
% the `left' text of parallel texts (when \cs{ifl@dpairing} is TRUE).
% They are explained in the \Lpack{eledpar}
% manual.
-% \changes{v0.7}{2005/02/24}{Added \cs{l@dnumpstartsL}, \cs{ifl@dpairing}
+% \changes{v0.7.0}{2005/02/24}{Added \cs{l@dnumpstartsL}, \cs{ifl@dpairing}
% and \cs{ifpst@rted} for/from eledpar}
-% \changes{v0.12}{2005/10/01}{Added \cs{ifledRcol} and \cs{ifnumberingR} for/from \Lpack{eledpar}}
+% \changes{v0.12.0}{2005/10/01}{Added \cs{ifledRcol} and \cs{ifnumberingR} for/from \Lpack{eledpar}}
% \changes{v1.12.0}{2014/08/05}{Add \cs{ifledRcol@} for \Lpack{eledpar}}
% \changes{v1.13.2}{2014/09/31}{Add \cs{ifl@dpaging} for \Lpack{eledpar}}
% \changes{v1.18.0}{2015/02/23}{Add \cs{ifl@dprintingpages} and \cs{@dprintingcolumns} for \Lpack{eledpar}}
@@ -3798,7 +3924,7 @@
% actually apply to both uses, though in all other respects there
% should be no direct interaction between the use of these counters
% and variables in the two processing steps.
-% \changes{v0.7}{2005/02/24}{Added \cs{initnumbering@reg}}
+% \changes{v0.7.0}{2005/02/24}{Added \cs{initnumbering@reg}}
% \changes{v1.12.0}{2014/08/05}{\cs{beginnumbering} is defined only on \Lpack{eledmac}, not on \Lpack{eledpar}.}
% For parallel processing :
%\begin{itemize}
@@ -3871,13 +3997,16 @@
% It takes care of notifying you when changes have been noted in the
% input that require running the file through again to move everything
% to the right place.
-% \changes{v0.7}{2005/02/24}{Changed \cs{endnumbering} for eledpar}
+% \changes{v0.7.0}{2005/02/24}{Changed \cs{endnumbering} for eledpar}
% \changes{v1.12.5}{2014/08/31}{Allow to mix parallel columns and normal text when using \cs{pausenumbering}}
% \begin{macrocode}
\def\endnumbering{%
\ifnumbering
\global\numberingfalse
\normal@pars
+ \ifnum\l@dnumpstartsL=0%
+ \led@err@NumberingWithoutPstart%
+ \fi%
\ifl@dpairing
\global\pst@rtedLfalse
\else
@@ -3923,7 +4052,7 @@
% without resetting the various counters. Note that no check is made
% by \cs{resumenumbering} to ensure that \cs{pausenumbering} was actually
% invoked.
-% \changes{v0.7}{2005/02/24}{Changed \cs{resumenumbering} for eledpar}
+% \changes{v0.7.0}{2005/02/24}{Changed \cs{resumenumbering} for eledpar}
% \changes{v1.12.5}{2014/08/31}{Debug \cs{resumenumbering}}
% \begin{macrocode}
\newcommand*{\resumenumbering}{%
@@ -3957,7 +4086,7 @@
% \label{lineation}\relax
%
% \subsection{Choosing the system of lineation}
-% \changes{v0.15}{2012/06/11}{Line numbering can be reset at each pstart.}
+% \changes{v0.15.0}{2012/06/11}{Line numbering can be reset at each 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.
@@ -4047,7 +4176,7 @@
%
% The selection is recorded in the count \cs{line@margin}:
% $0$ for left, $1$ for right, $2$ for outer, and $3$ for inner.
-% \changes{v0.7}{2005/02/23}{Added \cs{l@dgetline@margin}}
+% \changes{v0.7.0}{2005/02/23}{Added \cs{l@dgetline@margin}}
% \begin{macrocode}
\newcount\line@margin
\newcommand*{\linenummargin}[1]{{%
@@ -4124,7 +4253,7 @@
% \begin{macro}{\firstsublinenum}
% \begin{macro}{\sublinenumincrement}
% These macros can be used to set the corresponding counters.
-% \changes{v0.7}{2005/02/18}{Added \cs{firstlinenum}, \cs{linenumincrement},
+% \changes{v0.7.0}{2005/02/18}{Added \cs{firstlinenum}, \cs{linenumincrement},
% \cs{firstsublinenum} and \cs{linenumincrement}}
% \begin{macrocode}
\newcommand*{\firstlinenum}[1]{\setcounter{firstlinenum}{#1}}
@@ -4150,7 +4279,7 @@
%
% \cs{lock@disp} encodes the selection: $0$ for first, $1$ for last,
% $2$ for all.
-% \changes{v0.7}{2005/02/23}{Added \cs{l@dgetlock@disp}}
+% \changes{v0.7.0}{2005/02/23}{Added \cs{l@dgetlock@disp}}
% \begin{macrocode}
\newcount\lock@disp
\newcommand{\lockdisp}[1]{{%
@@ -4217,9 +4346,9 @@
% \verb?\linenumberstyle? and \verb?\sublinenumberstyle? are user level
% macros for setting the number represention (\verb?\linenumrep?
% and \verb?\sublinenumrep?) for line and sub-line numbers.
-% \changes{v0.3}{2004/02/14}{Added \cs{linenumberstyle} and \cs{sublinenumberstyle}}
-% \changes{v0.7}{2005/02/18}{Using \cs{linenumrep} instead of \cs{linenumr@p}}
-% \changes{v0.7}{2005/02/18}{Using \cs{sublinenumrep} instead of \cs{sublinenumr@p}}
+% \changes{v0.3.0}{2004/02/14}{Added \cs{linenumberstyle} and \cs{sublinenumberstyle}}
+% \changes{v0.7.0}{2005/02/18}{Using \cs{linenumrep} instead of \cs{linenumr@p}}
+% \changes{v0.7.0}{2005/02/18}{Using \cs{sublinenumrep} instead of \cs{sublinenumr@p}}
% \begin{macrocode}
\newcommand*{\linenumberstyle}[1]{%
\def\linenumrep##1{\@nameuse{@#1}{##1}}}
@@ -4268,9 +4397,9 @@
%
% The original \cs{numlabfont} specification is equivalent to
% the \LaTeX\ \cs{scriptsize} for a 10pt document.
-% \changes{v0.3}{2004/02/14}{Added \cs{linenumr@p} and \cs{sublinenum@rep}
+% \changes{v0.3.0}{2004/02/14}{Added \cs{linenumr@p} and \cs{sublinenum@rep}
% to \cs{leftlinenum} and \cs{rightlinenum}}
-% \changes{v0.7}{2005/02/18}{Added \cs{ledlinenum} for use by
+% \changes{v0.7.0}{2005/02/18}{Added \cs{ledlinenum} for use by
% \cs{leftlinenum} and \cs{rightlinenum}}
% \begin{macrocode}
\newlength{\linenumsep}
@@ -4755,15 +4884,13 @@
%
% \begin{macro}{\list@clearing@reg}
% Clears the lists for \cs{read@linelist}
-% \changes{v0.7}{2005/02/22}{Added \cs{list@clearing@reg}}
+% \changes{v0.7.0}{2005/02/22}{Added \cs{list@clearing@reg}}
% \begin{macrocode}
\newcommand*{\list@clearing@reg}{%
\list@clear{\line@list}%
\list@clear{\insertlines@list}%
\list@clear{\actionlines@list}%
\list@clear{\actions@list}%
- \list@clear{\sw@list}%
- \list@clear{\sw@list@inedtext}%
}%
% \end{macrocode}
% \end{macro}
@@ -4771,7 +4898,7 @@
% \begin{macro}{\get@linelistfile}
% \Eledmac{} can take advantage of the \LaTeX\ `safe file input' macros
% to get the line-list file.
-% \changes{v0.7}{2005/02/22}{Added \cs{get@linelistfile}}
+% \changes{v0.7.0}{2005/02/22}{Added \cs{get@linelistfile}}
% \begin{macrocode}
\newcommand*{\get@linelistfile}[1]{%
\InputIfFileExists{#1}{%
@@ -4822,6 +4949,24 @@
% that modifies the action-code list: again, this is so that they
% can be turned off easily for nested calls of \cs{@ref}.
%
+% \begin{macro}{\line@list@version}
+% The \cs{line@list@version} check if the line-list file does not refers to the older commands of \Lpack{eledmac}.
+% In this case, we stop reading the line-list file.
+% Consequently, \cs{line@list@version} should be the first line of a line-number file.
+% \begin{macrocode}
+\newcommand{\line@list@version}[1]{%
+ \IfStrEq{#1}{\this@line@list@version}%
+ {}%
+ {\ifledRcol%
+ \led@warn@Obsolete{\jobname.\extensionchars\the\section@num}%
+ \else%
+ \led@warn@Obsolete{\jobname.\extensionchars\the\section@num}%
+ \fi%
+ \endinput%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{\@nl}
% \begin{macro}{\@nl@reg}
% \changes{v1.12.0}{2014/08/05}{To ensure compatibility with \cs{musixtex}, \cs{@l} becomes \cs{@l}. Consequently, \cs{@l@reg} becomes \cs{@nl@reg}.}
@@ -4844,11 +4989,11 @@
% it may come in handy later. The macro \cs{fix@page} checks if a new
% page has started.
%
-% \changes{v0.3}{2004/02/14}{Added a bunch of code to \cs{@nl} for handling
+% \changes{v0.3.0}{2004/02/14}{Added a bunch of code to \cs{@nl} for handling
% \cs{setlinenum}}
-% \changes{v0.6}{2004/11/16}{Extended \cs{@nl} to include the page number}
-% \changes{v0.6}{2004/11/16}{Added \cs{fix@page} to \cs{@nl}}
-% \changes{v0.7}{2005/02/22}{Added \cs{@nl@reg}}
+% \changes{v0.6.0}{2004/11/16}{Extended \cs{@nl} to include the page number}
+% \changes{v0.6.0}{2004/11/16}{Added \cs{fix@page} to \cs{@nl}}
+% \changes{v0.7.0}{2005/02/22}{Added \cs{@nl@reg}}
% \begin{macrocode}
\newcommand{\@nl}[2]{%
\fix@page{#1}%
@@ -4920,7 +5065,7 @@
% \begin{macro}{\fix@page}
% \cs{fix@page} basically replaces \cs{@page}. It determines whether or not
% a new page has been started, based on the page values held by \cs{@nl}.
-% \changes{v0.6}{2004/11/16}{Added \cs{last@page@num} and \cs{fix@page}}
+% \changes{v0.6.0}{2004/11/16}{Added \cs{last@page@num} and \cs{fix@page}}
% \begin{macrocode}
\newcount\last@page@num
\last@page@num=-10000
@@ -4949,7 +5094,7 @@
% auxiliary file(s) if the \Lpack{eledpar} package has been used. They
% are just here to stop \Lpack{\eledmac} from moaning if the \Lpack{eledpar}
% is used for one run and then not for the following one.
-% \changes{v0.6}{2004/11/16}{Added \cs{@pend},\cs{@pendR}, \cs{@lopL} and
+% \changes{v0.6.0}{2004/11/16}{Added \cs{@pend},\cs{@pendR}, \cs{@lopL} and
% \cs{@lopR} in anticipation of parallel processing}
% \begin{macrocode}
\newcommand*{\@pend}[1]{}
@@ -5169,7 +5314,7 @@
% \begin{macro}{\n@num}
% These macros implement the \cs{skipnumbering} command.
% They use a new action code, namely 1007.
-% \changes{v0.7}{2005/02/22}{Added \cs{n@num}}
+% \changes{v0.7.0}{2005/02/22}{Added \cs{n@num}}
% \changes{v1.21.0}{2015/04/13}{\cs{n@num} defined only one time for both \Eledmac{} and \Eledpar{}}
% \changes{v1.21.0}{2015/04/13}{\cs{n@num@ref} deleted}
% \begin{macrocode}
@@ -5261,12 +5406,13 @@
% The first thing \cs{@ref} (i.e. \cs{@ref@reg}) itself does is to add
% the specified number
% of items to the \cs{insertlines@list} list.
-% \changes{v0.7}{2005/02/22}{Added \cs{@ref@reg}}
+% \changes{v0.7.0}{2005/02/22}{Added \cs{@ref@reg}}
% \begin{macrocode}
\newcommand*{\@ref}[2]{%
\@ref@reg{#1}{#2}}
\newcommand*{\@ref@reg}[2]{%
\global\insert@count=#1\relax
+ \global\advance\@edtext@level by 1%
\loop\ifnum\insert@count>\z@
\xright@appenditem{\the\absline@num}\to\insertlines@list
\global\advance\insert@count \m@ne
@@ -5287,7 +5433,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@num
\global\endline@num=\line@num
@@ -5304,11 +5451,37 @@
\the\endpage@num|\the\endline@num|%
\ifsublines@ \the\endsubline@num \else 0\fi}\to\line@list
% \end{macrocode}
-%
-% Finally, execute the second argument of \cs{@ref} again,
+% Create a list which stores every second argument of each \cs{@sw}
+% in this lemma, at this level.
+% Also set the boolean about the use of lemma in this edtext level to false.
+% \begin{macrocode}
+ \expandafter\list@create\expandafter{\csname sw@list@edtext@tmp@\the\@edtext@level\endcsname}%
+ \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%
+% \end{macrocode}
+% 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@edtext@\the\@edtext@level\endcsname}}%
+ \ifcsundef{sw@list@edtext@\the\@edtext@level}{\create@this@edtext@level}{}%
+ \letcs{\@tmp}{sw@list@edtext@\the\@edtext@level}%
+ \letcs{\@tmpp}{sw@list@edtext@tmp@\the\@edtext@level}
+ \xright@appenditem{\expandonce\@tmpp}\to\@tmp%
+ \global\cslet{sw@list@edtext@\the\@edtext@level}{\@tmp}%
+ \fi%
+% \end{macrocode}
+% Decrease edtext level counter.
+% \begin{macrocode}
+ \global\advance\@edtext@level by -1%
+% \end{macrocode}
+% \begin{macrocode}
+}
% \end{macrocode}
% \end{macro}
@@ -5358,6 +5531,16 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\this@line@list@version}
+% The commands allowed in the line-list file and their arguments
+% can change between two version of \Eledmac.
+% The \cs{this@line@list@version} command is upgraded when it happens.
+% It is written in the file list.
+% If we process a line-list file which used a older version, that means the commands used insided are deprecated, and we can't use them.
+% \begin{macrocode}
+\newcommand{\this@line@list@version}{2}%
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{\line@list@stuff}
% The \cs{line@list@stuff}\marg{file} macro, which
% is called by \cs{beginnumbering}, performs
@@ -5378,13 +5561,14 @@
% \cs{immediate}, and clear the \cs{iffirst@linenum@out@} flag.
% \changes{v0.2.2}{2003/11/09}{Added initial write of page number in
% \cs{line@list@stuff}}
-% \changes{v0.7}{2005/02/25}{Deleted \cs{page@start} from \cs{line@list@stuff}}
+% \changes{v0.7.0}{2005/02/25}{Deleted \cs{page@start} from \cs{line@list@stuff}}
% \changes{v1.15.1}{2015/01/16}{Revert modification of 1.5.2 which makes bug with numbering. Leave vertical mode to solve spurious space before minipage.}
% \begin{macrocode}
\iffirst@linenum@out@
\immediate\closeout\linenum@out%
\global\first@linenum@out@false%
\immediate\openout\linenum@out=#1\relax%
+ \immediate\write\linenum@out{\string\line@list@version{\this@line@list@version}}%
\else
% \end{macrocode}
% If we get here, then this is
@@ -5404,7 +5588,7 @@
% \begin{macro}{\new@line}
% The \cs{new@line} macro sends the \cs{@nl} command to the line-list
% file, to mark the start of a new text line, and its page number.
-% \changes{v0.6}{2004/11/16}{Extended \cs{new@line} to output page numbers}
+% \changes{v0.6.0}{2004/11/16}{Extended \cs{new@line} to output page numbers}
% \begin{macrocode}
\newcommand*{\new@line}{%
\IfStrEq{\led@pb@setting}{after}%
@@ -5487,7 +5671,7 @@
% \Eledmac{} would go into an infinite loop, emitting thousands of blank pages.
% This was caused by being unable to find an appropriate place in the
% output routine. A different algorithm is now used for getting page numbers.
-% \changes{v0.6}{2004/11/16}{Made \cs{page@start} a no-op}
+% \changes{v0.6.0}{2004/11/16}{Made \cs{page@start} a no-op}
% \begin{macrocode}
\newcommand*{\page@start}{}
@@ -5590,14 +5774,15 @@
% \begin{macro}{\skipnumbering}
% In numbered text \cs{skipnumbering} will suspend the numbering
% for that particular line.
-% \changes{v0.7}{2005/02/22}{Added \cs{skipnumbering} and supports}
+% \changes{v0.7.0}{2005/02/22}{Added \cs{skipnumbering} and supports}
% \changes{v1.21.0}{2015/04/13}{\cs{skipnumbering} defined only one time for both \Eledmac{} and \Eledpar{}.}
% \changes{v1.21.0}{2015/04/13}{Correct \cs{skipnumbering} for stanza.}
% \changes{v1.21.0}{2015/04/13}{Delete \cs{skipnumbering@reg}.}
% \begin{macrocode}
\newif\ifl@dskipnumber
\newif\ifl@dskipversenumber%
-\newcommand*{\skipnumbering}{
+\newcommand*{\skipnumbering}{%
+ \leavevmode%
\ifledRcol%
\ifinstanza%
\write\linenum@outR{\string\n@num@stanza}%
@@ -5754,7 +5939,7 @@
% nested instances of \cs{edtext}, and other problematic macros, from
% our lemma. This is similar to what we did in reading the line-list
% file using \cs{dummy@ref} and various redefinitions---and that's
-% because nested \cs{edtext} macros create nested \cs{@ref} entries
+% because nested \cs{edtext}s macros create nested \cs{@ref} entries
% in the line-list file.
%
% Here's a macro that takes the same arguments as
@@ -5839,11 +6024,11 @@
% is to ensure that those characters are \emph{always} active; within
% languages that make no special use of them, their associated
% control sequences should simply return the proper character.)
-% \changes{v0.2}{2003/07/25}{Added \cs{l@dtabnoexpands} to \cs{no@expands}}
+% \changes{v0.2.0}{2003/07/25}{Added \cs{l@dtabnoexpands} to \cs{no@expands}}
% \changes{v0.2.1}{203/08/25}{Removed some \cs{let}s from \cs{no@expands}.
% These were in \edmac{} but I feel that they should not have been as they
% disabled page/line refs in a footnotes}
-% \changes{v1.0}{2012/09/15}{Change to be compatible with new features}
+% \changes{v1.0.0}{2012/09/15}{Change to be compatible with new features}
% \begin{macrocode}
\newcommand*{\no@expands}{%
\let\select@@lemmafont=0%
@@ -5868,12 +6053,14 @@
\newcommand{\@tag}{}
% \end{macrocode}
% \end{macro}
-% \begin{macro}{\if@edtext@}
+% \begin{macro}{\@edtext@level}
% \changes{v1.15.0}{2015/01/12}{New boolean \cs{if@edtext@}.}
-% This boolean is set to TRUE inside a \cs{edtext} (or \cs{critext}).
+% \changes{v1.23.0}{2015/05/18}{The boolean \cs{if@edtext@} becomes the counter \cs{edtext@level}.}
+% This counter is increased by 1 at each level of \cs{edtext} (or \cs{critext}).
% That is useful for some commands which can have a different behavior if called inside or outside of the \marg{lemma} argument.
% \begin{macrocode}
-\newif\if@edtext@%
+\newcount\@edtext@level%
+\@edtext@level=0%
% \end{macrocode}
% \end{macro}
% \begin{macro}{\critext}
@@ -5895,8 +6082,8 @@
% \end{macro}
%
% \begin{macro}{\edtext}
-% \changes{v0.4}{2004/02/29}{Added \cs{showlemma} to \cs{edtext} (and \cs{critext})}
-% \changes{v1.4}{2012/11/16}{Compatibility of \cs{edtext} (and \cs{critext}) with the right-to-left direction (with Polyglossia).}
+% \changes{v0.4.0}{2004/02/29}{Added \cs{showlemma} to \cs{edtext} (and \cs{critext})}
+% \changes{v1.4.0}{2012/11/16}{Compatibility of \cs{edtext} (and \cs{critext}) with the right-to-left direction (with Polyglossia).}
% \changes{v1.17.0}{2015/02/09}{Error message when calling \cs{edtext} outside of a numbered paragraph.}
% When executed, \cs{edtext} first ensures that we're in
% horizontal mode.
@@ -5907,13 +6094,37 @@
% \begin{macrocode}
\ifnumberedpar@%
% \end{macrocode}
-% We switch the \cs{@edtext@} flag,
-% to let know to other commands that we are in a \cs{edtext}.
+% We increase the \cs{@edtext@} counter to know in which level of \cs{edtext} we are.
+% \begin{macrocode}
+ \global\advance\@edtext@level by 1%
+% \end{macrocode}
+% By default, we don't use \cs{lemma}
% \begin{macrocode}
- \@edtext@true%
+ \global\@lemmacommand@false%
+% \end{macrocode}
+% \begin{macrocode}
+ \begingroup%
+% \end{macrocode}
+% We get the next series of samewords data in the list of samewords data for the current edtext level. We push them inside \cs{sw@inthisedtext}.
+% \begin{macrocode}
+ \ifledRcol%
+ \ifcsundef{sw@list@edtextR@\the\@edtext@level}%
+ {\global\let\sw@inthisedtext\empty}%
+ {\ifcsempty{sw@list@edtextR@\the\@edtext@level}%
+ {\global\let\sw@inthisedtext\empty}%
+ {\expandafter\gl@p\csname sw@list@edtextR@\the\@edtext@level\endcsname\to\sw@inthisedtext}%
+ }%
+ \else%
+ \ifcsundef{sw@list@edtext@\the\@edtext@level}%
+ {\global\let\sw@inthisedtext\empty}%
+ {\ifcsempty{sw@list@edtext@\the\@edtext@level}%
+ {\global\let\sw@inthisedtext\empty}%
+ {\expandafter\gl@p\csname sw@list@edtext@\the\@edtext@level\endcsname\to\sw@inthisedtext}%
+ }%
+ \fi%
% \end{macrocode}
% \begin{macro}{\@tag}
-% Our normal lemma is just argument \verb"#1"; but that argument could have
+% \label{@tag}Our normal lemma is just argument \verb"#1"; but that argument could have
% further invocations of \cs{edtext} within it. We get a copy of the
% lemma without any \cs{edtext} macros within it by temporarily redefining
% \cs{edtext} to just copy its first argument and ignore the other,
@@ -5923,9 +6134,11 @@
% original \cs{edtext} restored; within this group we've also turned
% off the expansion of those control sequences commonly found within text
% that can cause trouble for us.
+%
% \begin{macrocode}
- \begingroup%
- \global\renewcommand{\@tag}{\no@expands #1}%
+ \global\renewcommand{\@tag}{%
+ \no@expands #1%
+ }%
% \end{macrocode}
% \end{macro}
% \begin{macro}{\l@d@nums}
@@ -5955,6 +6168,23 @@
% \begin{macrocode}
\ignorespaces #2\relax%
% \end{macrocode}
+% With polyglossia, you must track whether the language reads left to right (English) or right to left (Arabic).
+% \begin{macrocode}
+ \@ifundefined{xpg@main@language}{%if not polyglossia
+ \flag@start}%
+ {\if@RTL\flag@end\else\flag@start\fi%
+ }%
+% \end{macrocode}
+% We write in the numbered file wether the current \cs{edtext} has a \cs{lemma} in the the second argument.
+% \begin{macrocode}
+ \if@lemmacommand@%
+ \ifledRcol%
+ \write\linenum@outR{\string\@lemma}%
+ \else%
+ \write\linenum@out{\string\@lemma}%
+ \fi%
+ \fi%
+% \end{macrocode}
% Finally, we're ready to admit the first argument into the current
% paragraph.
%
@@ -5965,10 +6195,6 @@
% within the expansion of \verb"#2" above, or in \cs{aftergroup}
% commands within that expansion.
% \begin{macrocode}
- \@ifundefined{xpg@main@language}{%if not polyglossia
- \flag@start}%
- {\if@RTL\flag@end\else\flag@start\fi% With polyglossia, you must track whether the language reads left to right (English) or right to left (Arabic).
- }%
\endgroup%
\showlemma{#1}%
% \end{macrocode}
@@ -5990,7 +6216,7 @@
{\if@RTL\flag@start\else\flag@end\fi% With polyglossia, you must track whether the language reads left to right (English) or right to left (Arabic).
}%
% \end{macrocode}
-% We switch to false some flag.
+% We switch to false some flags.
% \begin{itemize}
% \item The one that checks having footnotes inside a \cs{edtext}.
% \item The one that says we are inside a \cs{edtext}.
@@ -5998,7 +6224,7 @@
% \end{itemize}
% \begin{macrocode}
\global\@noneed@Footnotefalse%
- \@edtext@false%
+ \global\advance\@edtext@level by -1%
\global\@lemmacommand@false%
% \end{macrocode}
% If we are outside of a numbered paragraph,
@@ -6071,12 +6297,18 @@
% \subsection{Substitute lemma}
%
% \begin{macro}{\lemma}
+% \changes{v1.23.0}{2015/05/18}{Fix spurious space after \cs{lemma} command}
% The \cs{lemma}\marg{text} macro allows you to change the lemma
% that's passed on to the notes.
+% Read about \cs{@tag} in normal \cs{edtext} macro for more details about \cs{sw@list@inedtext} and \cs{no@expands} (\reff{@tag}).
% \begin{macrocode}
\newcommand*{\lemma}[1]{%
\global\@lemmacommand@true%
- \global\renewcommand{\@tag}{\no@expands #1}}%
+ \global\renewcommand{\@tag}{%
+ \no@expands #1%
+ }%
+ \ignorespaces%
+}%
% \end{macrocode}
% \end{macro}
%
@@ -6088,6 +6320,15 @@
\newif\if@lemmacommand@%
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\@lemma}
+% The \cs{@lemma} is written in the numbered file to set which \cs{edtext} has an
+% \cs{lemma} as second argument.
+% \begin{macrocode}
+\newcommand{\@lemma}{%
+ \booltrue{lemmacommand@\the\@edtext@level}%
+}%
+% \end{macrocode}
+% \end{macro}
% \subsection{Substitute line numbers}
%
% \begin{macro}{\linenum}
@@ -6152,161 +6393,253 @@
% The general mechanism is the following:
% \begin{itemize}
% \item \textbf{At the first run}, each \cs{sameword} command increments an \Lpack{etoolbox} counter the name of which contains the argument of the \cs{sameword} commands.
-% \item Then this counter, associated with the argument of \cs{sameword} is stored (\cs{@sw} command) in the auxiliary file of the current \Lpack{eledmac} section (the \verb+.1+, \verb+.2+… file).
+% \item Then this counter, associated with the argument of \cs{sameword} is stored, with the \cs{@sw} command, in the auxiliary file of the current \Lpack{eledmac} section (the \verb+.1+, \verb+.2+… file).
% \item \textbf{When this auxiliary file is read at the second run}, different operations are achieved:
+% \begin{enumerate}
+% \item Get the rank of each \cs{sameword} in a line (relative rank) from the rank of each \cs{sameword} in all the numbered section (absolute rank):
+% \begin{itemize}
+% \item For each paired \cs{sameword} argument and absolute line number, a counter is defined. Its value corresponds to the number of times \verb+\sameword{argument}+ is called from the beginning of the lineation to the end of the current line. We also store the same data for the preceding absolute line number, if it does not have \verb+\sameword{argument}+.
+% \item For each \cs{sameword} having the same argument, we substract from its absolute rank the number stored for the paired \cs{sameword} argument and previous absolute line number. Consequently, we obtain the relative rank.
+% \item See the following example which explain how for same \cs{sameword} absolute ranks are transformed to relative rank.
+% \begin{verbatim}
+% At line 1:
+% absolute rank 1 becomes relative rank 1-0 = 1
+% 1 is stored for this \sameword and the line 1
+% At line 2:
+% absolute rank 2 becomes relative rank 2-1 = 1
+% absolute rank 3 becomes relative rank 3-2 = 2
+% 3 is stored for this \sameword and the line 2
+% At line 3:
+% no \sameword for this line.
+% 3 is stored for this \sameword and the line 3
+% At line 4:
+% absolute rank 4 becomes relative rank 4-3 = 1
+% 3 is stored for this \sameword and the line 4
+% \end{verbatim}
+% \end{itemize}
+% \item Create lists of lists of \cs{sameword} by depth of \cs{edtext}.
+% That is: create a list for \cs{edtext} of level~1, a list for \cs{edtext} of level~2, a list for \cs{edtext} of level~3 etc.
+% For each \cs{edtext} in these list, we store all the relative rank of \cs{saweword} which are called as lemma information, that is 1) or called in the first argument of \cs{sameword} 2) or called in the \cs{lemma} macro of the second argument of \cs{sameword} AND marked by the optional argument of \cs{saweword} in first argument of \cs{edtext}.
+%
+% For example, suppose a line with nested \cs{edtext}s which contains some
+% word marked by \cs{sameword} and having the following relative rank:\\
+%
+%
+%\let\up\textsuperscript
+%bar\up{1} \fbox{%
+% \fbox{foo\up{1} foo\up{2} bar\up{2} foo\up{3}} (A)(B)
+% foo\up{4} bar\up{3}%
+% } (C)
+% \fbox{%
+% \fbox{foo\up{5}} (D)
+% bar\up{4}
+% } (E)
+%
+% In this example, all lemma information for \cs{edtext} is framed. The text in parenthesis is the content of critical notes associated to the preceding frame.
+% As you can see, we have two level of \cs{edtext}.
+%
+%The list for \cs{edtext}s of level~1 is $\{\{1,2,2,3,4,3\},\{5,4\}\}$.
+%
+%The list for \cs{edtext}s of level~2 is $\{\{1,2,2,3\},\{5\}\}$.
+%
+% As you can see, the mandatory argument of \cs{sameword} does not matter: we store the rank informations for every word potentially ambiguous.
+% \end{enumerate}
+% \item At the second run, when a critical notes is called, we associate it to the next item of the list associated to is \cs{edtext} level. So, in the previous example:
+% \begin{itemize}
+% \item Critical notes (A) and (B) are associated with $\{1,2,2,3\}$.
+% \item Critical note (C) is associated with $\{1,2,2,3,4,3\}$.
+% \item Critical note (D) is associated with $\{5\}$.
+% \item Critical note (E) is associated with $\{5,4\}$.
+% \end{itemize}
+% \item At the second run, when a critical note is printed:
% \begin{itemize}
-% \item For each paired \cs{sameword} argument and absolute line number, a counter is defined. Its value corresponds to the number of times \verb+\sameword{argument}+ is called from the beginning of the lineation to the end of the current line. We also store the same data for the preceding absolute line number, if it does not have \verb+\sameword{argument}+.
-% \item A \cs{sw@list} list is filled with the values stored in the auxiliary file. But before doing this we transform these values : we substract from them the number stored for the paired \cs{sameword} argument and previous absolute line number.
-% \end{itemize}
-% \item At the second run, when the \cs{sameword} command is called, new operations happen. We first read the first element of the \cs{sw@list}, then delete it from this list, and, if we are inside a \cs{edtext} command, we store it in a \cs{sw@list@inedtext} list.
-% \item At the second run, when the critical notes are built, the \cs{sameword@inedtext} command is used instead of \cs{sameword}. Then, we read the next value of \cs{sw@list@inedtext} list and remove it from this list. We send it to the \cs{showwordrank} to be printed after the lemma, but only if the current line has more than one value for the argument of \cs{sameword}. Otherwise, we just print the lemma, with no number.
-%
+% \item The \cs{sameword} command is let \cs{sameword@inedtext}.
+% \item At each call of this \cs{sameword@inedtext}, we step to the next element of the list associated to the note. Let it be $r$.
+% \item For the word marked by \cs{sameword}, we calculate how many time it is called in its line. To do it:
+% \begin{itemize}
+% \item We get the absolute line number of the current \cs{sameword}. This absolute line number was stored with list of relative rank for the current \cs{edtext}. That means, in the previous example, that, if the absolute line number of \cs{edtext} was 1, that critical notes (A) and (B) were not associated with $\{1,2,2,3\}$ but with $\{(1,1),(2,1),(2,1),(3,1)\}$. Such method to know the absolute line number associated to a \cs{sameword} is required because a \cs{edtext} can be overlap many lines, but \cs{sameword} can get it.
+% \item We get the value associated, when reading the auxiliary file, to the pair compose by the current marked word and the current absolute line number. Let this value be $n$.
+% \end{itemize}
+% \item If $n >1 $, that mean the current word appears more than once time in its line. In this case, we call \cs{showwordrank} with the word as first argument and $r$ as second argument. If the word is called only once, we just print it.
+% \end{itemize}
% \end{itemize}
-
-% \begin{macro}{\sw@list}
-% \begin{macro}{\sw@list@inedtext}
-% So, first, the lists.
-% \begin{macrocode}
-\list@create{\sw@list}%
-\list@create{\sw@list@inedtext}%
+% After theory, implementation.
+% \begin{macro}{\get@sw@txt}
+% As the argument of \cs{sameword} can contain active character if we
+% use \Lpack{inputenc} with \verb+utf8+ option instead of native UTF-8 engine,
+% we store its detokenized content in a macro in order to allow dynamic name of macro with \cs{csname}.\footnote{See \url{http://tex.stackexchange.com/q/244538/7712}.}
+%
+% Because there is a bug with \cs{detokenize} and \XeTeX\ when using non BMP characters\footnote{\url{http://sourceforge.net/p/xetex/bugs/108/}},
+% we detokenize only for not \XeTeX engines. In any case, in \XeTeX, a \cs{csname} construction can contain UTF-8 characters without a problem, as UTF-8 characters are not managed with category code, but instead read directly as UTF-8 characters.
+% \begin{macrocode}
+\newcommand{\get@sw@txt}[1]{%
+ \ifxetex%
+ \xdef\sw@txt{#1}%
+ \else%
+ \expandafter\xdef\expandafter\sw@txt\expandafter{\detokenize{#1}}%
+ \fi%
+}%
% \end{macrocode}
% \end{macro}
-% \end{macro}
% \begin{macro}{\sameword}
+% \changes{v1.23.0}{2015/05/18}{In order to allow use of \cs{sameword} with inputenc, we detokenize its mandatory argument before using it in control sequence names.}
% The hight level macro \cs{sameword}, used by the editor.
% \begin{macrocode}
-\newcommandx{\sameword}[2][1,usedefault]{\leavevmode%
+\newcommandx{\sameword}[2][1,usedefault]{%
+ \leavevmode%
+ \get@sw@txt{#2}%
% \end{macrocode}
-% First, increament the counter corresponding to the argument.
+% Now, the real code. First, increment the counter corresponding to the argument.
% \begin{macrocode}
- \unless\ifledRcol%
- \csnumgdef{sw@#2}{\csuse{sw@#2}+1}%
+ \unless\ifledRcol%
+ \csnumgdef{sw@\sw@txt}{\csuse{sw@\sw@txt}+1}%
% \end{macrocode}
-% Then, write its value to the numbered file
+% Then, write its value to the numbered file.
% \begin{macrocode}
- \protected@write\linenum@out{}{\string\@sw{#2}{\csuse{sw@#2}}}%
-% \end{macrocode}
-% At the second run, read the \cs{sw@list} next item and, if we are in \cs{edtext}, put it to \cs{sw@list@inedtext}.
-% \begin{macrocode}
- \unless\ifx\sw@list\empty%
- \gl@p\sw@list\to\@tempb%
- \if@edtext@%
- \unless\if@lemmacommand@%
- \xright@appenditem{\@tempb}\to\sw@list@inedtext%
- \else%
- \ifstrequal{#1}{inlemma}{\xright@appenditem{\@tempb}\to\sw@list@inedtext}{}%
- \fi%
- \fi%
- \global\let\@tempb=\undefined%
- \fi%
+ \protected@write\linenum@out{}{\string\@sw{\sw@txt}{\csuse{sw@\sw@txt}}{#1}}%
% \end{macrocode}
% Do the same thing if we are in the right columns.
% \begin{macrocode}
\else%
- \csnumgdef{sw@#2@R}{\csuse{sw@#2@R}+1}%
- \protected@write\linenum@outR{}{\string\@sw{#2}{\csuse{sw@#2@R}}}%
- \unless\ifx\sw@listR\empty%
- \gl@p\sw@listR\to\@tempb%
- \if@edtext@%
- \unless\if@lemmacommand@%
- \xright@appenditem{\@tempb}\to\sw@list@inedtextR%
- \else%
- \ifstrequal{#1}{inlemma}{\xright@appenditem{\@tempb}\to\sw@list@inedtextR}{}%
- \fi%
- \fi%
- \global\let\@tempb=\undefined%
- \fi%
+ \csnumgdef{sw@\sw@txt@R}{\csuse{sw@\sw@txt@R}+1}%
+ \protected@write\linenum@outR{}{\string\@sw{\sw@txt}{\csuse{sw@\sw@txt@R}}{#1}}%
\fi%
% \end{macrocode}
-% In any case, print the word.
+% And print the word.
% \begin{macrocode}
#2%
}%
% \end{macrocode}
% \end{macro}
+% A flag set to true if a \cs{@sw} relative rank must be added to the list of ranks for a specific \cs{edtext}.
+% \begin{macro}{\if@addsw}
+% \begin{macrocode}
+\newif\if@addsw%
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{\@sw}
% The command printed in the auxiliary files.
% \begin{macrocode}
-\newcommand{\@sw}[2]{%
+\newcommand{\@sw}[3]{%
+ \get@sw@txt{#1}%
\unless\ifledRcol%
% \end{macrocode}
% First, define a counter which store the second argument as value for a each paired absolute line number/first argument
% \begin{macrocode}
- \csxdef{sw@#1@\the\absline@num @\the\section@num}{#2}%
+ \csxdef{sw@\sw@txt @\the\absline@num @\the\section@num}{#2}%
% \end{macrocode}
% If such argument was not defined for the preceding line, define it.
% \begin{macrocode}
\numdef{\prev@line}{\the\absline@num-1}%
- \ifcsundef{sw@#1@\prev@line @\the\section@num}{%
- \csnumgdef{sw@#1@\prev@line @\the\section@num}{#2-1}%
+ \ifcsundef{sw@\sw@txt @\prev@line @\the\section@num}{%
+ \csnumgdef{sw@\sw@txt @\prev@line @\the\section@num}{#2-1}%
}{}%
% \end{macrocode}
-% Then, calculate the position of the word in the line, and put it in \cs{sw@list}.
+% Then, calculate the position of the word in the line.
% \begin{macrocode}
- \numdef{\the@sw}{#2-\csuse{sw@#1@\prev@line @\the\section@num}}%
- \xright@appenditem{\the@sw}\to\sw@list%
+ \numdef{\the@sw}{#2-\csuse{sw@\sw@txt @\prev@line @\the\section@num}}%
% \end{macrocode}
% And do the same thing for the right side.
% \begin{macrocode}
\else%
- \csxdef{sw@#1@\the\absline@numR @\the\section@numR @R}{#2}%
+ \csxdef{sw@\sw@txt @\the\absline@numR @\the\section@numR @R}{#2}%
\numdef{\prev@line}{\the\absline@numR-1}%
- \ifcsundef{sw@#1@\prev@line @\the\section@numR @R}{%
- \csnumgdef{sw@#1@\prev@line @\the\section@numR @R}{#2-1}%
+ \ifcsundef{sw@\sw@txt @\prev@line @\the\section@numR @R}{%
+ \csnumgdef{sw@\sw@txt @\prev@line @\the\section@numR @R}{#2-1}%
}{}%
- \numdef{\the@sw}{#2-\csuse{sw@#1@\prev@line @\the\section@numR @R}}%
- \xright@appenditem{\the@sw}\to\sw@listR%
+ \numdef{\the@sw}{#2-\csuse{sw@\sw@txt @\prev@line @\the\section@numR @R}}%
\fi%
+% \end{macrocode}
+% And now, add it to the list of \cs{@sw} for the current edtext, in all depth.
+% \begin{macrocode}
+ \@tempcnta=\@edtext@level
+ \@whilenum{\@tempcnta>0}\do{%
+ \ifcsdef{sw@list@edtext@tmp@\the\@tempcnta}%
+ {%
+ \@addswfalse%
+ \notbool{lemmacommand@\the\@tempcnta}%
+ {\@addswtrue}%
+ {\IfStrEq{#3}{inlemma}%
+ {\@addswtrue}%
+ {%
+ \def\do##1{%
+ \ifnumequal{##1}{\the\@tempcnta}%
+ {\@addswtrue\listbreak}%
+ {}%
+ }%
+ \docsvlist{#3}%
+ }%
+ }%
+ \if@addsw%
+ \letcs{\@tmp}{sw@list@edtext@tmp@\the\@tempcnta}%
+ \ifledRcol%
+ \xright@appenditem{{\the@sw}{\the\absline@numR}}\to\@tmp%
+ \else%
+ \xright@appenditem{{\the@sw}{\the\absline@num}}\to\@tmp%
+ \fi%
+ \cslet{sw@list@edtext@tmp@\the\@tempcnta}{\@tmp}%
+ \fi%
+ }%
+ {}%
+ \advance\@tempcnta by -1%
+ }%
}%
% \end{macrocode}
% \end{macro}
% \begin{macro}{\sameword@inedtext}
% The command called when \cs{sameword} is called in a edtext.
% \begin{macrocode}
-\def\sameword@inedtext#1{%
+\newcommandx{\sameword@inedtext}[2][1,usedefault]{%
+ \get@sw@txt{#2}%
\unless\ifledRcol@%
% \end{macrocode}
-% First, calculate the number of occurrences of the word in the current line
-% \begin{macrocode}
- \ifcsdef{sw@#1@\the\absline@num @\the\section@num}{%
- \numdef{\prev@line}{\the\absline@num-1}%
- \numdef{\sw@atthisline}{\csuse{sw@#1@\the\absline@num @\the\section@num}-\csuse{sw@#1@\prev@line @\the\section@num}}%
- }%
- {\numdef{\sw@atthisline}{0}}%
-% \end{macrocode}
% Just a precaution.
% \begin{macrocode}
\ifx\sw@list@inedtext\empty%
\def\the@sw{999}%
+ \def\this@absline{-99}%
\else%
% \end{macrocode}
% But in many cases, at this step, we should have some content in the list \cs{sw@list@inedtext}, which contains the reference for edtext.
% \begin{macrocode}
- \gl@p\sw@list@inedtext\to\the@sw%
+ \gl@p\sw@list@inedtext\to\@tmp%
+ \edef\the@sw{\expandafter\@firstoftwo\@tmp}%
+ \edef\this@absline{\expandafter\@secondoftwo\@tmp}%
\fi%
% \end{macrocode}
-% Then, print the rank, but only if there is more than one occurrence of the word in the current line.
+% First, calculate the number of occurrences of the word in the current line
+% \begin{macrocode}
+ \ifcsdef{sw@\sw@txt @\this@absline @\the\section@num}{%
+ \numdef{\prev@line}{\this@absline-1}%
+ \numdef{\sw@atthisline}{\csuse{sw@\sw@txt @\this@absline @\the\section@num}-\csuse{sw@\sw@txt @\prev@line @\the\section@num}}%
+ }%
+ {\numdef{\sw@atthisline}{0}}%
+% \end{macrocode}
+% Finally, print the rank, but only if there is more than one occurrence of the word in the current line.
% \begin{macrocode}
\ifnumgreater{\sw@atthisline}{1}%
- {\showwordrank{#1}{\the@sw}}%
- {#1}%
+ {\showwordrank{#2}{\the@sw}}%
+ {#2}%
% \end{macrocode}
% And the same for right side.
% \begin{macrocode}
\else%
- \ifcsdef{sw@#1@\the\absline@numR @\the\section@numR @R}{%
- \numdef{\prev@line}{\the\absline@numR-1}%
- \numdef{\sw@atthisline}{\csuse{sw@#1@\the\absline@numR @\the\section@numR @R}-\csuse{sw@#1@\prev@line @\the\section@numR @R}}%
- }%
- {\numdef{\sw@atthisline}{0}}%
- \ifx\sw@list@inedtextR\empty%
+ \ifx\sw@list@inedtext\empty%
\def\the@sw{999}%
+ \def\this@absline{-99}%
\else%
- \gl@p\sw@list@inedtextR\to\the@sw%
+ \gl@p\sw@list@inedtext\to\@tmp%
+ \edef\the@sw{\expandafter\@firstoftwo\@tmp}%
+ \edef\this@absline{\expandafter\@secondoftwo\@tmp}%
\fi%
+ \ifcsdef{sw@\sw@txt @\this@absline @\the\section@numR @R}{%
+ \numdef{\prev@line}{\this@absline-1}%
+ \numdef{\sw@atthisline}{\csuse{sw@\sw@txt @\this@absline @\the\section@numR @R}-\csuse{sw@\sw@txt @\prev@line @\the\section@numR @R}}%
+ }%
+ {\numdef{\sw@atthisline}{0}}%
\ifnumgreater{\sw@atthisline}{1}%
- {\showwordrank{#1}{\the@sw}}%
- {#1}%
+ {\showwordrank{#2}{\the@sw}}%
+ {#2}%
\fi%
}%
% \end{macrocode}
@@ -6393,7 +6726,11 @@
% \changes{v1.13.1}{2014/09/25}{Add \cs{l@dzeropenalties} in \cs{pstart}}
% \begin{macrocode}
-\newcommand{\AtEveryPstart}[1]{\xdef\at@every@pstart{\noindent\unexpanded{#1}}}%
+\newcommand{\AtEveryPstart}[1]{%
+ \ifstrempty{#1}%
+ {\xdef\at@every@pstart{}}%
+ {\xdef\at@every@pstart{\noindent\unexpanded{#1}}}%
+}%
\xdef\at@every@pstart{}%
\newcounter{pstart}
@@ -6515,7 +6852,11 @@
% \begin{macro}{\at@every@pend}
% \begin{macrocode}
-\newcommand{\AtEveryPend}[1]{\xdef\at@every@pend{\noindent\unexpanded{#1}}}%
+\newcommand{\AtEveryPend}[1]{%
+ \ifstrempty{#1}%
+ {\xdef\at@every@pend{}}%
+ {\xdef\at@every@pend{\noindent\unexpanded{#1}}}%
+}%
\xdef\at@every@pend{}%
% \end{macrocode}
@@ -6523,8 +6864,8 @@
% \end{macro}
%
% \begin{macro}{\l@dzeropenalties}
-% A macro to zero penalties for \cs{pend}.
-% \changes{v0.7}{2005/02/22}{Added \cs{l@dzeropenalties}}
+% A macro to zero penalties for \cs{pend} or \cs{pstart}.
+% \changes{v0.7.0}{2005/02/22}{Added \cs{l@dzeropenalties}}
% \begin{macrocode}
\newcommand*{\l@dzeropenalties}{%
\brokenpenalty \z@ \clubpenalty \z@
@@ -6760,8 +7101,8 @@
% \begin{macro}{\do@insidelinehook}
% Two hooks into \cs{do@line}. The first is called at the beginning of \cs{do@line}, the second is called in the line box.
% The second can, for example, have a \cs{markboth} command inside, the first can't.
-% \changes{v0.7}{2005/02/18}{Added \cs{do@linehook} for use in \cs{do@line}}
-% \changes{v1.5}{2013/07/11}{Added \cs{do@insidelinehook} for use in \cs{do@line}}
+% \changes{v0.7.0}{2005/02/18}{Added \cs{do@linehook} for use in \cs{do@line}}
+% \changes{v1.5.0}{2013/07/11}{Added \cs{do@insidelinehook} for use in \cs{do@line}}
% \begin{macrocode}
\newcommand*{\do@linehook}{}
\newcommand*{\do@insidelinehook}{}
@@ -6777,7 +7118,7 @@
% \begin{macro}{\l@dcsnotetext@r}
% Nulls the \cs{...d@ta}, which may later hold line numbers.
% Similarly for \cs{l@dcsnotetext}, \cs{l@dcsnotetext@l}, \cs{l@dcsnotetext@r} for the texts of the sidenotes, left and right notes.
-% \changes{v0.7}{2005/02/18}{Added \cs{l@demptyd@ta}}
+% \changes{v0.7.0}{2005/02/18}{Added \cs{l@demptyd@ta}}
% \begin{macrocode}
\newcommand*{\l@demptyd@ta}{%
\gdef\l@dld@ta{}%
@@ -6797,7 +7138,7 @@
% \begin{macro}{\l@dlsn@te}
% \begin{macro}{\l@drsn@te}
% Zero width boxes of the left and right side notes, together with their kerns.
-% \changes{v0.7}{2005/02/18}{Added \cs{l@dlsn@te} and \cs{l@drsn@te}
+% \changes{v0.7.0}{2005/02/18}{Added \cs{l@dlsn@te} and \cs{l@drsn@te}
% for use in \cs{do@line}}
% \begin{macrocode}
\newcommand{\l@dlsn@te}{%
@@ -6904,7 +7245,7 @@
% \cs{do@actions} does. If there could be more actions to process for
% this line, \cs{do@actions@next} is set equal to \cs{do@actions};
% otherwise it's just \cs{relax}.
-% \changes{v0.7}{2005/02/22}{Added number skipping to \cs{do@actions}}
+% \changes{v0.7.0}{2005/02/22}{Added number skipping to \cs{do@actions}}
% \begin{macrocode}
\newcommand*{\do@actions}{%
\global\let\do@actions@next=\relax
@@ -6980,7 +7321,7 @@
% \begin{macro}{\do@actions@fixedcode}
% This macro handles the fixed codes for \cs{do@actions}. It is
% one big case statement.
-% \changes{v0.7}{2005/02/24}{Added \cs{do@actions@fixedcode}}
+% \changes{v0.7.0}{2005/02/24}{Added \cs{do@actions@fixedcode}}
% \begin{macrocode}
\newcommand*{\do@actions@fixedcode}{%
\ifcase\@l@dtempcnta
@@ -7052,14 +7393,14 @@
%
% First, the case when we're within a sub-line range.
% \changes{v0.5.1}{2004/04/10}{Changed \cs{affixline@num} to cater for sidenotes}
-% \changes{v0.7}{2005/02/22}{Added skipnumering to \cs{affixline@num}}
+% \changes{v0.7.0}{2005/02/22}{Added skipnumering to \cs{affixline@num}}
% \begin{macrocode}
\newcommand*{\affixline@num}{%
% \end{macrocode}
% No number is attached if \cs{ifl@dskipnumber} is TRUE (and then it
% is set to its normal FALSE value).
% No number is attached if \cs{ifnumberline} is FALSE (the normal value is TRUE).
-% \changes{v0.15}{2012/06/11}{Line numbering can be disabled.}
+% \changes{v0.15.0}{2012/06/11}{Line numbering can be disabled.}
% \begin{macrocode}
\ifledgroupnotesL@\else
\ifnumberline
@@ -7202,7 +7543,7 @@
% \begin{macro}{\ch@ck@l@ck}
% \begin{macro}{\f@x@l@cks}
% These macros handle line number locking for \cs{affixline@num}.
-% \changes{v0.7}{2005/02/24}{Added \cs{ch@cksub@l@ck}, \cs{ch@ck@l@ck}
+% \changes{v0.7.0}{2005/02/24}{Added \cs{ch@cksub@l@ck}, \cs{ch@ck@l@ck}
% and \cs{f@x@l@cks}}
% \cs{ch@cksub@l@ck} checks subline locking. If it fails, then we disable
% the line-number display by setting the counters to arbitrary but unequal
@@ -7552,7 +7893,7 @@
%
%
% \subsection{Outer-level footnote commands}
-% \changes{v1.0}{2012/09/15}{Options of \cs{Xfootnote}s.}
+% \changes{v1.0.0}{2012/09/15}{Options of \cs{Xfootnote}s.}
% \begin{macro}{\footnoteoptions@}
% The \cs{footnoteoption@}\oarg{side}\marg{options}\marg{value} change the value of on options of Xfootnote, to switch between true and false.
% \begin{macrocode}
@@ -7680,7 +8021,7 @@
% 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
+% \changes{v0.7.0}{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}
@@ -7697,7 +8038,7 @@
%
% \begin{macro}{\mpnormalvfootnote}
% And a somewhat different version for minipages.
-% \changes{v0.4}{2004/02/29}{Added \cs{mpnormalvfootnote}}
+% \changes{v0.4.0}{2004/02/29}{Added \cs{mpnormalvfootnote}}
% \begin{macrocode}
\notbool{parapparatus@}{\newcommand*}{\newcommand}{\mpnormalvfootnote}[2]{%
\global\setbox\@nameuse{mp#1footins}\vbox{%
@@ -7737,7 +8078,7 @@
% to get the lines numbered automatically (as set up by
% \cs{autopar}, for example).
%
-% \changes{v1.4}{2012/11/16}{Direction of footnotes with polyglossia.}
+% \changes{v1.4.0}{2012/11/16}{Direction of footnotes with polyglossia.}
% \changes{v1.21.0}{2015/04/13}{\cs{ledsetnormalparstuff} is deprecated and becomes \cs{ledsetnormalparstuffX} and \cs{Xledsetnormalparstuff}.}
% \begin{macrocode}
\newcommand*{\ledsetnormalparstuff}{%
@@ -7805,7 +8146,7 @@
%
% With polyglossia, each critical note has a \cs{footnote@lang} which shows the language of the lemma,
% and which can be used to switch the bracket from right to left.
-% \changes{v1.4}{2012/11/16}{Switch the right bracket to a left bracket when the lemma is RTL (needs polyglossia or LuaTeX).}
+% \changes{v1.4.0}{2012/11/16}{Switch the right bracket to a left bracket when the lemma is RTL (needs polyglossia or LuaTeX).}
% \begin{macrocode}
\def\endashchar{\textnormal{--}}
\newcommand*{\fullstop}{\textnormal{.}}
@@ -7975,6 +8316,7 @@
{}%
}%
{}%
+ \fi%
}%
}%
% \end{macrocode}
@@ -7991,7 +8333,7 @@
%
% The macro \cs{setprintlines} does the work of deciding what numbers should
% be printed. Its arguments are the same as the first 6 of \cs{printlines}.
-% \changes{v0.7}{2005/02/18}{Added \cs{setprintlines} for use by \cs{printlines}}
+% \changes{v0.7.0}{2005/02/18}{Added \cs{setprintlines} for use by \cs{printlines}}
% \begin{macrocode}
\newcommand*{\setprintlines}[6]{%
\l@d@pnumfalse \l@d@dashfalse
@@ -8080,9 +8422,10 @@
%
% \begin{macro}{\printlines}
% Now we're ready to print it all. If the lineation is by pstart, we print the pstart.
-% \changes{v0.15}{2012/06/11}{Line numbering can be reset at each pstart.}
+% \changes{v0.15.0}{2012/06/11}{Line numbering can be reset at each pstart.}
% \begin{macrocode}
-\def\printlines#1|#2|#3|#4|#5|#6|#7|{\begingroup
+\def\printlines#1|#2|#3|#4|#5|#6|#7|{%
+ \begingroup%
\ifluatex%
\luatextextdir TLT%
\fi%
@@ -8093,15 +8436,24 @@
% ending sub-line number: it could come after the starting
% sub-line number (in which case we want only the dash) or after an
% ending line number (in which case we need to insert a period).
+% So, first, print ths start line number.
% \begin{macrocode}
+ \ifdimequal{\csuse{boxstartlinenum@\@currentseries}}{0pt}%
+ {\bgroup}%
+ {\leavevmode\hbox to \csuse{boxstartlinenum@\@currentseries}\bgroup\hfill}%
\ifl@d@pnum #1\fullstop\fi
\linenumrep{#2}
+ \ifl@d@ssub \fullstop \sublinenumrep{#3}\fi
+ \egroup%
% \end{macrocode}
-% \changes{v0.3}{2004/02/14}{Added \cs{linenumr@p} and \cs{sublinenumr@p}
+% Then print the dash + end linuber, or the range symbol.
+% \changes{v0.3.0}{2004/02/14}{Added \cs{linenumr@p} and \cs{sublinenumr@p}
% to \cs{printlines}}
% \changes{v1.20.0}{2015/03/22}{Added \cs{ifl@d@morethantwolines} and \cs{ifl@d@morethantwolines} to \cs{printlines}}
% \begin{macrocode}
- \ifl@d@ssub \fullstop \sublinenumrep{#3}\fi
+ \ifdimequal{\csuse{boxendlinenum@\@currentseries}}{0pt}%
+ {\bgroup}%
+ {\hbox to \csuse{boxendlinenum@\@currentseries}\bgroup}%
\ifl@d@twolines%
\ifl@d@morethantwolines%
\csuse{morethantwolines@\@currentseries}%
@@ -8114,7 +8466,12 @@
\ifl@d@elin \linenumrep{#5}\fi%
\ifl@d@esl \ifl@d@elin \fullstop\fi \sublinenumrep{#6}\fi%
\fi%
-\endgroup}
+ \ifdimequal{\csuse{boxendlinenum@\@currentseries}}{0pt}%
+ {}%
+ {\hfill}%Prevent underfull hbox
+ \egroup%
+ \endgroup%
+}%
% \end{macrocode}
% \end{macro}
% \begin{macro}{\normalfootstart}\label{normalvalues}
@@ -8194,7 +8551,7 @@
%
% \begin{macro}{\mpnormalfootgroup}
% A somewhat different version for minipages.
-% \changes{v0.4}{2004/02/29}{Added \cs{mpnormalfootgroup}}
+% \changes{v0.4.0}{2004/02/29}{Added \cs{mpnormalfootgroup}}
% \begin{macrocode}
\newcommand*{\mpnormalfootgroup}[1]{{
\vskip\skip\@nameuse{mp#1footins}
@@ -8260,7 +8617,7 @@
%
% \begin{macro}{\ledfootinsdim}
% Have a constant value for the \verb?\dimen\footins?
-% \changes{v1.1}{2012/09/25}{Deprecated \cs{ledfootinsdim}}
+% \changes{v1.1.0}{2012/09/25}{Deprecated \cs{ledfootinsdim}}
% \begin{macrocode}
\newcommand*{\ledfootinsdim}{0.8\vsize} % kept for backward compatibility, should'nt be used anymore.
% \end{macrocode}
@@ -8269,8 +8626,8 @@
%
% \begin{macro}{\preXnotes@}
% \begin{macro}{\preXnotes}
-% \changes{v1.1}{2012/09/25}{New skip \cs{preXnotes@}}
-% \changes{v1.2}{2012/10/08}{Debug in familiar footnotes (but introduced by v1.1).}
+% \changes{v1.1.0}{2012/09/25}{New skip \cs{preXnotes@}}
+% \changes{v1.2.0}{2012/10/08}{Debug in familiar footnotes (but introduced by v1.1).}
% If user redefines \cs{preXnotes@}, via \cs{preXnotes} to a value greater than 0~pt,
% this skip will be added before first series notes
% instead of the notes skip.
@@ -8312,7 +8669,7 @@
% \end{macrocode}
% Now do the setup for minipage footnotes. We use as much as possible of the
% normal setup as we can (so the notes will have a similar layout).
-% \changes{v0.4}{2004/02/29}{Added minpage footnote setup to \cs{footnormal}}
+% \changes{v0.4.0}{2004/02/29}{Added minpage footnote setup to \cs{footnormal}}
% \begin{macrocode}
\ifnoledgroup@\else%
\expandafter\let\csname mpv#1footnote\endcsname=\mpnormalvfootnote
@@ -9089,7 +9446,7 @@
% \end{macro}
%
%
-% % \section{Familiar footnotes}
+% \section{Familiar footnotes}
%
% \subsection{Generality}
% The original \edmac{} provided users with five series of critical footnotes (\cs{Afootnote} \cs{Bfootnote} \cs{Cfootnote} \cs{Dfootnote} \cs{Efootnote}),
@@ -9180,7 +9537,7 @@
% In order to enable the regular \verb?\footnote?s in numbered text
% we have to play around with its \verb?\@footnotetext?, using
% different forms for when in numbered or regular text.
-% \changes{v0.5}{2004/04/03}{Enabled regular \cs{footnote} in numbered text}
+% \changes{v0.5.0}{2004/04/03}{Enabled regular \cs{footnote} in numbered text}
% \begin{macrocode}
\pretocmd{\@footnotetext}{%
\ifnumberedpar@
@@ -9196,7 +9553,7 @@
% \begin{macro}{\vl@dbfnote}
% \verb?\l@dbfnote? adds the footnote to the insert list, and
% \verb?\vl@dbfnote? calls the original \verb?\@footnotetext?.
-% \changes{v0.6}{2004/11/23}{Changed \cs{l@dbfnote} and \cs{vl@dbfnote} as
+% \changes{v0.6.0}{2004/11/23}{Changed \cs{l@dbfnote} and \cs{vl@dbfnote} as
% originals could give incorrect markers in the footnotes}
% \changes{v1.4.1}{2012/11/16}{Compatibility of standard footnotes with eledmac when these footnotes contain any commands.}
% \begin{macrocode}
@@ -9414,7 +9771,7 @@
%
%
% \begin{macro}{\normalbfnoteX}
-% \changes{v0.7}{2005/02/18}{Removed extraneous space from \cs{normalbfnoteX}}
+% \changes{v0.7.0}{2005/02/18}{Removed extraneous space from \cs{normalbfnoteX}}
% \changes{v1.4.9}{2013/07/10}{Allow to redefine \cs{thefootnoteX} with \c{alph} when some packages are loaded.}
% \begin{macrocode}
\newcommand{\normalbfnoteX}[2]{%
@@ -9440,7 +9797,7 @@
%
%
% \begin{macro}{\vnumfootnoteX}
-% \changes{v0.7}{2005/02/18}{Removed extraneous space from \cs{vnumfootnoteX}}
+% \changes{v0.7.0}{2005/02/18}{Removed extraneous space from \cs{vnumfootnoteX}}
% \begin{macrocode}
\newcommand{\vnumfootnoteX}[2]{%
\ifnumberedpar@
@@ -10245,7 +10602,13 @@
\csuse{Xendnotenumfont@#4}%
\ifdimequal{\csuse{boxXendlinenum@#4}}{0pt}%
{\printendlines#1|}%
- {\leavevmode\hbox to \csuse{boxXendlinenum@#4}{\printendlines#1|\hfill}}%
+ {\leavevmode%
+ \hbox to \csuse{boxXendlinenum@#4}%
+ {%
+ \IfSubStr{RC}{\csuse{boxXendlinenumalign@#4}}{\hfill}{}%
+ \printendlines#1|%
+ \IfSubStr{LC}{\csuse{boxXendlinenumalign@#4}}{\hfill}{}%
+ }}%
}%
\enspace{%
\nottoggle{Xendlemmadisablefontselection@#4}%
@@ -10289,7 +10652,7 @@
% First of all, we print the second page number only if
% the ending page number is different
% from the starting page number.\phantomsection\label{printendlines}
-% \changes{v0.7}{2005/02/18}{Added \cs{setprintendlines} for use by
+% \changes{v0.7.0}{2005/02/18}{Added \cs{setprintendlines} for use by
% \cs{printendlines}}
% \begin{macrocode}
\newcommand*{\setprintendlines}[6]{%
@@ -10376,7 +10739,7 @@
%
% \begin{macro}{\printendlines}
% Now we're ready to print it all.
-% \changes{v0.3}{2004/02/14}{Added \cs{linenumr@p} and \cs{sublinenumr@p}
+% \changes{v0.3.0}{2004/02/14}{Added \cs{linenumr@p} and \cs{sublinenumr@p}
% to \cs{printendlines}}
% \begin{macrocode}
\def\printendlines#1|#2|#3|#4|#5|#6|#7|{\begingroup
@@ -10387,11 +10750,23 @@
% ending sub-line number: it could be coming after the starting
% sub-line number (in which case we want only the dash) or after an
% ending line number (in which case we need to insert a period).
+%
+% So, first, print the start lines.
% \begin{macrocode}
+ \ifdimequal{\csuse{boxXendstartlinenum@\@currentseries}}{0pt}%
+ {\bgroup}%
+ {\leavevmode\hbox to \csuse{boxXendstartlinenum@\@currentseries}\bgroup\hfill}%
\printnpnum{#1}%
\ifoldprintnpnumspace@\space\fi%
\linenumrep{#2}%
\ifl@d@ssub \fullstop \sublinenumrep{#3}\fi
+ \egroup%
+% \end{macrocode}
+% And now, print the dash + the end line number, or the line number range symbol.
+% \begin{macrocode}
+ \ifdimequal{\csuse{boxXendendlinenum@\@currentseries}}{0pt}%
+ {\bgroup}%
+ {\hbox to \csuse{boxXendendlinenum@\@currentseries}\bgroup}%
\ifl@d@twolines%
\ifl@d@morethantwolines%
\csuse{Xendmorethantwolines@\@currentseries}%
@@ -10404,7 +10779,12 @@
\ifl@d@elin \linenumrep{#5}\fi%
\ifl@d@esl \ifl@d@elin \fullstop\fi \sublinenumrep{#6}\fi%
\fi%
-\endgroup}
+ \ifdimequal{\csuse{boxXendendlinenum@\@currentseries}}{0pt}%
+ {}%
+ {\hfill}%Prevent underfull hbox
+ \egroup%
+ \endgroup%
+}%
% \end{macrocode}
% \end{macro}
@@ -10526,7 +10906,13 @@
\csgdef{Xnotenumfont@#1}{\notenumfont}%
\csgdef{Xnotefontsize@#1}{\notefontsetup}%
\csgdef{bhookXnote@#1}{}%
+
\csgdef{boxlinenum@#1}{0pt}%
+ \csgdef{boxlinenumalign@#1}{L}%
+
+ \csgdef{boxstartlinenum@#1}{0pt}%
+ \csgdef{boxendlinenum@#1}{0pt}%
+
\csgdef{boxsymlinenum@#1}{0pt}%
\newtoggle{numberonlyfirstinline@#1}%
\newtoggle{numberonlyfirstintwolines@#1}%
@@ -10565,10 +10951,11 @@
% \end{macrocode}
% \subsubsection{Create commands for critical apparatus, \cs{Afootnote}, \cs{Bfootnote} etc.}
% Note the double \# in command: it's because command is made inside another command.
-% \changes{v1.4}{2012/11/16}{Remembers the language of the lemma, in order to create a correct direction for the footnote separator.}
+% \changes{v1.4.0}{2012/11/16}{Remembers the language of the lemma, in order to create a correct direction for the footnote separator.}
+% \changes{v1.23.0}{2015/04/29}{Prevent spurious spaces when \cs{Afootnote} and similar commands are followed by spaces (bug added on 1.0.0!).}
% \begin{macrocode}
\global\notbool{parapparatus@}{\expandafter\newcommand\expandafter *}{\expandafter\newcommand}\csname #1footnote\endcsname[2][]{%
- \if@edtext@%
+ \ifnum\@edtext@level>0%
\begingroup%
\newcommand{\content}{##2}%
\ifnumberedpar@%
@@ -10583,6 +10970,7 @@
\xright@appenditem{%
\noexpand\prepare@preXnotes{#1}%
\noexpand\prepare@edindex@fornote{\l@d@nums}%
+ \unexpanded{\def\sw@list@inedtext}{\expandafter\unexpanded\expandafter{\sw@inthisedtext}}%The value of the \sw@inthisedtext of current edtext will be pushed to \sw@list@inedtext when the notes are expanded.
\noexpand\csuse{v#1footnote}{#1}%
{{\l@d@nums}{\expandonce\@tag}{\expandonce\content}}%
}\to\inserts@listR
@@ -10599,6 +10987,7 @@
\xright@appenditem{%
\noexpand\prepare@preXnotes{#1}%
\noexpand\prepare@edindex@fornote{\l@d@nums}%
+ \unexpanded{\def\sw@list@inedtext}{\expandafter\unexpanded\expandafter{\sw@inthisedtext}}%The value of the \sw@inthisedtext of current edtext will be pushed to \sw@list@inedtext when the notes are expanded.
\noexpand\csuse{v#1footnote}{#1}%
{{\l@d@nums}{\expandonce\@tag}{\expandonce\content}}%
}\to\inserts@list
@@ -10608,11 +10997,11 @@
\else
\csuse{v#1footnote}{#1}{{0|0|0|0|0|0|0}{}{##1}}%
\fi%
- \ignorespaces%
\endgroup%
\else%
\led@err@FootnoteWithoutEdtext%
\fi%
+ \ignorespaces%
}
% \end{macrocode}
% We need to be able to modify \Eledmac's footnote macros and restore their
@@ -10752,7 +11141,13 @@
\csgdef{Xendnotenumfont@#1}{\notenumfont}%
\csgdef{Xendnotefontsize@#1}{\notefontsetup}%
\csgdef{bhookXendnote@#1}{}%
+
\csgdef{boxXendlinenum@#1}{0pt}%
+ \csgdef{boxXendlinenumalign@#1}{L}%
+
+ \csgdef{boxXendstartlinenum@#1}{0pt}%
+ \csgdef{boxXendendlinenum@#1}{0pt}%
+
\csgdef{Xendlemmaseparator@#1}{}%
\csgdef{Xendbeforelemmaseparator@#1}{0em}%
\csgdef{Xendafterlemmaseparator@#1}{0.5em}%
@@ -10779,7 +11174,7 @@
% \end{macrocode}
% \section{Display}
% \subsection{Change series order}
-% \changes{v1.1}{2012/09/25}{New tools to change order of series}
+% \changes{v1.1.0}{2012/09/25}{New tools to change order of series}
% \changes{v1.21.0}{2015/04/13}{\cs{seriesatbegin} and \cs{seriesatbegin} more efficient}
% \begin{macro}{\seriesatbegin}
% \cs{seriesatbegin}\marg{s} changes the order of series, to put the series \meta{s} at the beginning of the list.
@@ -10818,11 +11213,11 @@
}
% \end{macrocode}
% \end{macro}
-% \changes{v1.0}{2012/09/15}{New generic commands to customize footnote display.}
+% \changes{v1.0.0}{2012/09/15}{New generic commands to customize footnote display.}
% \subsection{Options}
% \subsubsection{Tools to set options}
% \begin{macro}{\settoggle@series}
-% \changes{v1.1}{2012/09/25}{\cs{settoggle@series} switch the global value of the toggle, not only the local value.}
+% \changes{v1.1.0}{2012/09/25}{\cs{settoggle@series} switch the global value of the toggle, not only the local value.}
% \changes{v1.13.0}{2014/09/16}{\cs{settoggle@series} can take an optional arguments to reload series setup.}
% \cs{settoggle@series}\marg{series}\marg{toggle}\marg{value} is a generic command to switch toggles for some series.
% The arguments are:
@@ -10972,7 +11367,7 @@
\newhookcommand@series{Xcolalign}%
\newhookcommand@series{Xnotenumfont}
\newhookcommand@series{bhookXnote}
- \newhookcommand@series{boxsymlinenum}
+ \newhookcommand@series{boxsymlinenum}%
\newhookcommand@series{symlinenum}
\newhookcommand@series{beforenumberinfootnote}
\newhookcommand@series{afternumberinfootnote}
@@ -10997,7 +11392,13 @@
\newhookcommand@series@reload{beforeXnotes}
\newhooktoggle@series@reload{Xnoteswidthliketwocolumns}%
\newhookcommand@series{Xnotefontsize}
- \newhookcommand@series{boxlinenum}
+
+ \newhookcommand@series{boxlinenum}%
+ \newhookcommand@series{boxlinenumalign}%
+
+ \newhookcommand@series{boxstartlinenum}%
+ \newhookcommand@series{boxendlinenum}%
+
\fi
% \end{macrocode}
% \subsubsection{Options for familiar notes}
@@ -11035,7 +11436,13 @@
\newhooktoggle@series{Xendtwolinesonlyinsamepage}[apprefwithpage]
\newhookcommand@series{Xendnotenumfont}
\newhookcommand@series{bhookXendnote}
+
\newhookcommand@series{boxXendlinenum}%
+ \newhookcommand@series{boxXendlinenumalign}%
+
+ \newhookcommand@series{boxXendstartlinenum}%
+ \newhookcommand@series{boxXendendlinenum}%
+
\newhookcommand@series{Xendnotefontsize}
\newhooktoggle@series{Xendlemmadisablefontselection}
\newhookcommand@series{Xendlemmaseparator}
@@ -11211,9 +11618,12 @@
\printlinefootnotenumbers{#1}{#2}%
}%
{%
- \hbox to \csuse{boxlinenum@#2}{%
- \printlinefootnotenumbers{#1}{#2}%
- \hfill}%
+ \hbox to \csuse{boxlinenum@#2}%
+ {%
+ \IfSubStr{RC}{\csuse{boxlinenumalign@#2}}{\hfill}{}%
+ \printlinefootnotenumbers{#1}{#2}%
+ \IfSubStr{LC}{\csuse{boxlinenumalign@#2}}{\hfill}{}%
+ }%
}%
}%
% \end{macrocode}
@@ -11399,7 +11809,7 @@
% \end{macrocode}
% \end{macro}
% \begin{macro}{\ifFN@bottom}
-% \changes{v1.5}{2013/07/11}{Use the bottom option of \Lpack{footmisc} package.}
+% \changes{v1.5.0}{2013/07/11}{Use the bottom option of \Lpack{footmisc} package.}
% The \cs{ifFN@bottom} macro is defined by the \Lpack{footmisc} package. If this package is not loaded, we define it.
% \begin{macrocode}
\AtBeginDocument{\@ifpackageloaded{footmisc}{}{\newif\ifFN@bottom}}
@@ -11409,7 +11819,7 @@
% This macro essentially holds the initial portion of the kernel
% \cs{@makecol} code.
% \changes{v0.2.1}{2003/09/13}{Renamed \cs{dofootinsert} as \cs{l@ddofootinsert}}
-% \changes{v0.7}{2005/02/25}{Deleted \cs{page@start} from \cs{l@ddofootinsert}}
+% \changes{v0.7.0}{2005/02/25}{Deleted \cs{page@start} from \cs{l@ddofootinsert}}
% \begin{macrocode}
\newcommand*{\l@ddofootinsert}{%
\ifvoid\footins
@@ -11764,7 +12174,7 @@
% hopefully cures that, and also allows for non-arabic page numbering.
%
% \changes{v0.2.1}{2003/08/26}{Tweaked \cs{edlabel} to get correct page numbers}
-% \changes{v0.14}{2012/04/04}{Tweaked \cs{edlabel} to get correct line number if the command is first element of a paragraph.}
+% \changes{v0.14.0}{2012/04/04}{Tweaked \cs{edlabel} to get correct line number if the command is first element of a paragraph.}
% \changes{v1.18.0}{2015/02/23}{\cs{edlabel} is now defined only one time for both eledmac and eledpar}
% \begin{macrocode}
@@ -11884,7 +12294,7 @@
% of \cs{@lab} appends just the current line and sub-line numbers
% to \cs{labelref@list}.
% \changes{v0.2.1}{2003/08/26}{Removed page setting from \cs{@lab}}
-% \changes{v0.3}{2004/02/14}{Replaced \cs{the}\cs{line@num} by
+% \changes{v0.3.0}{2004/02/14}{Replaced \cs{the}\cs{line@num} by
% \cs{linenumr@p}\cs{line@num} in
% \cs{@lab}, and similar for sub-lines}
% \begin{macrocode}
@@ -11898,7 +12308,7 @@
% \cs{applabel}, if called in \cs{edtext} will insert automatically both a start and an end label for the current edtext lines.
% \begin{macrocode}
\newcommand*{\applabel}[1]{%
- \if@edtext@%
+ \ifnum\@edtext@level>0%
% \end{macrocode}
% Label should not be already defined.
% \begin{macrocode}
@@ -12129,15 +12539,40 @@
% It always prints the page number, as it should be printed in the end notes.
% The \cs{twolinesappref} and \cs{morethantwolinesappref} are similar to the footnote
% hooks and \cs{twolines} \cs{morethantwolines}.
+%
+% So, first declare the default value of the hooks for the pseudo-series appref.
+% Also declare the internal toggle which are switch by \eledmac{}.
% \begin{macrocode}
\xdef\twolines@appref{}%
\xdef\morethantwolines@appref{}%
\newtoggle{twolinesbutnotmore@appref}%
\newtoggle{twolinesonlyinsamepage@appref}%
+\xdef\Xendtwolines@apprefwithpage{}%
+\xdef\Xendmorethantwolines@apprefwithpage{}%
+\newtoggle{Xendtwolinesbutnotmore@apprefwithpage}%
+\newtoggle{Xendtwolinesonlyinsamepage@apprefwithpage}%
+
+% \end{macrocode}
+% Note that some of these hooks are declared but no user command can change their values. Such hooks are not pertinent for appref and apprefwithpage pseudo-series, but their values are nonetheless tested in some macros.
+% \begin{macrocode}
+
+\xdef\boxstartlinenum@appref{0pt}
+\xdef\boxendlinenum@appref{0pt}
+
+\xdef\boxXendstartlinenum@apprefwithpage{0pt}
+\xdef\boxXendendlinenum@apprefwithpage{0pt}
+
+% \end{macrocode}
+% Now, declare the default value of \cs{apprefprefixsingle} and \cs{apprefprefixmore}.
+% \begin{macrocode}
\newcommand\apprefprefixsingle{}%
\newcommand\apprefprefixmore{}%
+% \end{macrocode}
+% And now, the main commands: \cs{appref} and \cs{apprefwithpage}.
+% These commands call \cs{printlines} and \cs{printendlines}. That is why we have previously declared all hooks values tested inside these last commands.
+% \begin{macrocode}
\newcommandx{\appref}[2][1,usedefault]{%
\IfStrEq{#1}{fulllines}%
{\toggletrue{fulllines@}}%
@@ -12154,15 +12589,12 @@
\togglefalse{fulllines@}%
}%
-\xdef\Xendtwolines@apprefwithpage{}%
-\xdef\Xendmorethantwolines@apprefwithpage{}%
-\newtoggle{Xendtwolinesbutnotmore@apprefwithpage}%
-\newtoggle{Xendtwolinesonlyinsamepage@apprefwithpage}%
-
+% \changes{v1.23.0}{2015/05/18}{Debug \cs{Xendtwolines}, \cs{Xendmorethantwolines}, \cs{Xendtwolinesbutnotmore} and \cs{Xendtwolinesonlyinsamepage} when using \cs{apprefwithpage}.}
\newcommandx{\apprefwithpage}[2][1,usedefault]{%
\IfStrEq{#1}{fulllines}%
{\toggletrue{fulllines@}}%
{}%
+ \xdef\@currentseries{apprefwithpage}%
\printendlines\xpageref{#2:start}|\xlineref{#2:start}|\xsublineref{#2:start}|\xpageref{#2:end}|\xlineref{#2:end}|\xsublineref{#2:end}||%
\togglefalse{fulllines@}%
}%
@@ -12206,7 +12638,7 @@
% \begin{macro}{\@xympar}
% Changing \verb?\@xympar? a little at least ensures that \verb?\marginpar?s
% in numbered text do not disturb the flow.
-% \changes{v0.5}{2004/04/0}{Eliminated \cs{marginpar} disturbance}
+% \changes{v0.5.0}{2004/04/0}{Eliminated \cs{marginpar} disturbance}
% \begin{macrocode}
\let\l@dold@xympar\@xympar
\renewcommand{\@xympar}{%
@@ -12222,7 +12654,7 @@
% \end{macro}
%
% We provide side notes as replacement for \verb?\marginpar? in numbered text.
-% \changes{v0.5}{2004/04/03}{Added left and right side notes}
+% \changes{v0.5.0}{2004/04/03}{Added left and right side notes}
% \changes{v0.5.1}{2004/04/10}{Added moveable side note}
%
% \begin{macro}{\sidenote@margin}
@@ -12239,7 +12671,7 @@
% \item[inner] : 3
% \end{description}
% \changes{v0.5.1}{2004/04/10}{Added \cs{sidenotemargin} and \cs{sidenote@margin}}
-% \changes{v0.7}{2005/02/23}{Added \cs{l@dgetsidenote@margin}}
+% \changes{v0.7.0}{2005/02/23}{Added \cs{l@dgetsidenote@margin}}
% \changes{v1.12.0}{2014/08/05}{\cs{sidenotemargin} is now directly defined in \Lpack{eledmac} to be able to manage \Lpack{eledpar}.}
% \begin{macrocode}
\newcount\sidenote@margin
@@ -12594,7 +13026,7 @@
% \changes{v1.9.0}{2014/02/05}{Add \cs{mpfnpos} to choice the order of footnotes in minipage / ledgroup.}
% These will be the hooks in \verb?\@iiiminpage? and \verb?\endminipage?
% They can be extended to handle other things if necessary.
-% \changes{v0.4}{2004/02/29}{Added \cs{l@dfeetbeginmini}, \cs{l@dfeetendmini}
+% \changes{v0.4.0}{2004/02/29}{Added \cs{l@dfeetbeginmini}, \cs{l@dfeetendmini}
% and all their supporting code}
% \begin{macrocode}
\ifnoledgroup@\else%
@@ -12618,30 +13050,34 @@
% minipage environment.
% \begin{macrocode}
\newcommand*{\l@dedbeginmini}{%
- \def\do##1{\csletcs{v##1footnote}{mpv##1footnote}}%
- \dolistloop{\@series}%
+ \unless\ifnocritical@%
+ \def\do##1{\csletcs{v##1footnote}{mpv##1footnote}}%
+ \dolistloop{\@series}%
+ \fi%
}
\newcommand*{\l@dedendmini}{%
- \ifl@dpairing
- \ifledRcol
- \flush@notesR
- \else
- \flush@notes
+ \unless\ifnocritical@%
+ \ifl@dpairing%
+ \ifledRcol%
+ \flush@notesR%
+ \else%
+ \flush@notes%
+ \fi%
\fi
- \fi
- \def\do##1{
- \ifvoid\csuse{mp##1footins}\else%
- \ifl@dpairing\ifparledgroup%
- \ifledRcol%
- \dimgdef{\parledgroup@beforenotesR}{\parledgroup@beforenotesR+\skip\@nameuse{mp##1footins}}
- \else%
- \dimgdef{\parledgroup@beforenotesL}{\parledgroup@beforenotesL+\skip\@nameuse{mp##1footins}}
- \fi%
- \fi\fi%
- \csuse{mp##1footgroup}{##1}%
- \fi}%
- \dolistloop{\@series}%
- }
+ \def\do##1{%
+ \ifvoid\csuse{mp##1footins}\else%
+ \ifl@dpairing\ifparledgroup%
+ \ifledRcol%
+ \dimgdef{\parledgroup@beforenotesR}{\parledgroup@beforenotesR+\skip\@nameuse{mp##1footins}}%
+ \else%
+ \dimgdef{\parledgroup@beforenotesL}{\parledgroup@beforenotesL+\skip\@nameuse{mp##1footins}}%
+ \fi%
+ \fi\fi%
+ \csuse{mp##1footgroup}{##1}%
+ \fi}%
+ \dolistloop{\@series}%
+ \fi%
+}%
% \end{macrocode}
% \end{macro}
@@ -12653,11 +13089,18 @@
% minipage environment.
% \begin{macrocode}
\newcommand*{\l@dfambeginmini}{%
+ \unless\ifnofamiliar@%
\def\do##1{\csletcs{vfootnote##1}{mpvfootnote##1}}%
- \dolistloop{\@series}}
+ \dolistloop{\@series}%
+ \fi%
+}%
+
\newcommand*{\l@dfamendmini}{%
- \def\do##1{\ifvoid\csuse{mpfootins##1}\else\csuse{mpfootgroup##1}{##1}\fi}%
- \dolistloop{\@series}}
+ \unless\ifnofamiliar@%
+ \def\do##1{\ifvoid\csuse{mpfootins##1}\else\csuse{mpfootgroup##1}{##1}\fi}%
+ \dolistloop{\@series}%
+ \fi%
+}%
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -12665,7 +13108,7 @@
% \begin{macro}{\@iiiminipage}
% This is our extended form of the kernel \verb?\@iiiminipage? defined in
% \file{ltboxes.dtx}.
-% \changes{v0.4}{2004/02/29}{Modified kernel \cs{@iiiminipage} and
+% \changes{v0.4.0}{2004/02/29}{Modified kernel \cs{@iiiminipage} and
% \cs{endminipage} to cater for critical footnotes}
% \begin{macrocode}
\def\@iiiminipage#1#2[#3]#4{%
@@ -12714,7 +13157,7 @@
% \end{macro}
%
% \begin{macro}{\l@dunboxmpfoot}
-% \changes{v0.7}{2005/02/18}{Added \cs{l@dunboxmpfoot} containing
+% \changes{v0.7.0}{2005/02/18}{Added \cs{l@dunboxmpfoot} containing
% some common code}
% \begin{macrocode}
\newcommand*{\l@dunboxmpfoot}{%
@@ -12740,7 +13183,7 @@
% This environment puts footnotes at the end, even if that happens to
% be in the middle of a page, or crossing a page boundary. It is a sort
% of unboxed, fixed width minipage.
-% \changes{v0.4}{2004/02/29}{Added ledgroup environment}
+% \changes{v0.4.0}{2004/02/29}{Added ledgroup environment}
% \begin{macrocode}
\newenvironment{ledgroup}{%
\resetprevpage@num%
@@ -12765,7 +13208,7 @@
% be in the middle of a page, or crossing a page boundary. It is a sort
% of unboxed, variable \meta{width} minipage. The optional \meta{pos}
% controls the sideways position of numbered text.
-% \changes{v0.4}{2004/02/29}{Added ledgroupsized environment}
+% \changes{v0.4.0}{2004/02/29}{Added ledgroupsized environment}
% \changes{v0.5.1}{2004/04/10}{Only change \cs{hsize} in ledgroupsized
% environment otherwise page number can be in wrong place}
% \begin{macrocode}
@@ -12829,7 +13272,7 @@
% \end{macro}
% \section{Indexing}
%
-% \changes{v1.5}{2013/07/11}{Correct indexing when the call is made in critical notes.}
+% \changes{v1.5.0}{2013/07/11}{Correct indexing when the call is made in critical notes.}
% \changes{v1.8.0}{2014/07/21}{If \Lpack{imakeidx} and \Lpack{hyperref} are loaded, adds hyperref in the index.}
% \changes{v1.8.5}{2014/08/28}{Debug indexing in right column, with eledpar.}
% Here's some code for indexing using page \& line numbers.
@@ -13005,7 +13448,7 @@
% class is being used, except if \Lpack{imakeidx} or \Lpack{indextools} is used.
% \begin{macro}{\edindex}
% \changes{v0.4.1}{2003/03/29}{Let eledmac take advantage of memoir's indexing}
-% \changes{v1.5}{2013/07/11}{Compatibility with \Lpack{imakeidx} package, and possibility to use multiple index with \cs{edindex}.}
+% \changes{v1.5.0}{2013/07/11}{Compatibility with \Lpack{imakeidx} package, and possibility to use multiple index with \cs{edindex}.}
% \changes{v1.12.0}{2014/08/05}{Use correctly default index when \Lpack{imakeidx} is loaded.}
% \changes{v1.14.0}{2014/10/27}{Let eledmac take advantage of imakeidx even when memoir class is used}
% \subsection{Memoir compatibility}
@@ -13532,8 +13975,8 @@
% \begin{macro}{\inserthangingymbol}
% \begin{macro}{\ifinserthangingsymbol}
% The boolean \cs{ifinserthangingsymbol} is set to TRUE when \cs{@lock} is greater than 1, i.e. when we are not in the first line of a verse. The switch of \cs{ifinserthangingsymbol} is made in \cs{do@line} before the printing of line but after the line number calculation.
-%\changes{v0.15}{2012/06/11}{New management of hangingsymbol insertion, preventing undesirable insertions.}
-%\changes{v0.17}{2012/08/03}{New new management of hangingsymbol insertion, preventing undesirable insertions.}
+%\changes{v0.15.0}{2012/06/11}{New management of hangingsymbol insertion, preventing undesirable insertions.}
+%\changes{v0.17.0}{2012/08/03}{New new management of hangingsymbol insertion, preventing undesirable insertions.}
% \changes{v1.6.1}{2013/10/27}{Hang verse is now not automatically flush right.}
% \begin{macrocode}
\newif\ifinserthangingsymbol
@@ -13617,7 +14060,7 @@
% to set the penalties. These two macros are a convenience to give
% the user one less thing to worry about (misspelling the first argument).
% Since version 0.13, the \verb+stanzaindentsrepetition+ counter can be used when the indentation is repeated every n verses. The \cs{managestanza@modulo} is a command which modifies the counter stanza@modulo. The command adds 1 to stanza@modulo, but if stanza@modulo is equal to the stanzaindentsrepetition counter, the command restarts it.
-%\changes{v0.13}{2011/11/08}{New stanzaindentsrepetition counter to repeat stanza indents every \emph{n} verses.}
+%\changes{v0.13.0}{2011/11/08}{New stanzaindentsrepetition counter to repeat stanza indents every \emph{n} verses.}
% % \changes{v1.5.1}{2013/08/16}{Correct stanzaindentsrepetition counter}
% \begin{macrocode}
\newcommand*{\setstanzaindents}[1]{\setstanzavalues{sza}{#1}}
@@ -15224,8 +15667,8 @@
% \begin{macro}{\quote}
% \begin{macro}{\endquote}
% \changes{v1.12.0}{2014/08/05}{\cs{ledxxx} sectioning commands are deprecated and replaced by \cs{eledxxx} commands.}
-% \changes{v1.2}{2012/10/08}{Compatibility of \cs{ledchapter} with the \emph{memoir} class.}
-% \changes{v1.3}{2012/11/01}{\emph{Quotation} and {quote} environment inside numbered sections.}
+% \changes{v1.2.0}{2012/10/08}{Compatibility of \cs{ledchapter} with the \emph{memoir} class.}
+% \changes{v1.3.0}{2012/11/01}{\emph{Quotation} and {quote} environment inside numbered sections.}
% \changes{v1.4.1}{2012/11/16}{New option \emph{noquotation}.}
% \changes{v1.4.7}{2012/06/07}{Compatibility of sectioning commands with \cs{autopar}.}
% \changes{v1.8.0}{2013/12/13}{Correction of sectioning commands in parallel texts.}
@@ -16269,6 +16712,8 @@
% The \cs{ledinnote} commands takes now a first optional argument, which is the label for the hyperreference.
% If you have redefined it, change your redefinition, and check if you can
% avoid this redefinition by redefining only \cs{ledinnotemark}.
+% \subsection{Migration to eledmac 1.23.0}
+% People must delete the numbered auxiliary file before new run after update of eledmac.
% \clearpage
% \bibliographystyle{alpha}
% \phantomsection
diff --git a/Master/texmf-dist/source/latex/eledmac/eledmac.ins b/Master/texmf-dist/source/latex/eledmac/eledmac.ins
index 08058323d08..e6539bd70b1 100644
--- a/Master/texmf-dist/source/latex/eledmac/eledmac.ins
+++ b/Master/texmf-dist/source/latex/eledmac/eledmac.ins
@@ -46,8 +46,7 @@
\keepsilent
-%%% \Msg{*** Generating the driver file ***}
-%%% \generateFile{ledmac.drv}{t}{\from{eledmac.dtx}{driver}}
+
\Msg{*** Generating the LaTeX2e package files ***}
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.
diff --git a/Master/texmf-dist/source/latex/eledmac/eledpar.ins b/Master/texmf-dist/source/latex/eledmac/eledpar.ins
index cd2ef72ac62..4382c0a963e 100644
--- a/Master/texmf-dist/source/latex/eledmac/eledpar.ins
+++ b/Master/texmf-dist/source/latex/eledmac/eledpar.ins
@@ -47,8 +47,6 @@
\keepsilent
-%%% \Msg{*** Generating the driver file ***}
-%%% \generateFile{ledpar.drv}{t}{\from{ledpar.dtx}{driver}}
\Msg{*** Generating the LaTeX2e package files ***}