summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/reledmac
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-09-30 21:17:05 +0000
committerKarl Berry <karl@freefriends.org>2015-09-30 21:17:05 +0000
commit2f667f4d777c2ce38eb648f49ae5fde2c644dcfc (patch)
tree3b7e1b1c11a57d6981a90224d1b8a380dbb9fe23 /Master/texmf-dist/source/latex/reledmac
parent21923df0aa733309adbfcc3169c7ffc0e0ab8b1c (diff)
reledmac (30sep15)
git-svn-id: svn://tug.org/texlive/trunk@38505 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/reledmac')
-rw-r--r--Master/texmf-dist/source/latex/reledmac/reledmac.dtx264
-rw-r--r--Master/texmf-dist/source/latex/reledmac/reledpar.dtx590
2 files changed, 696 insertions, 158 deletions
diff --git a/Master/texmf-dist/source/latex/reledmac/reledmac.dtx b/Master/texmf-dist/source/latex/reledmac/reledmac.dtx
index d30bdabe7b4..c44d24e4f1e 100644
--- a/Master/texmf-dist/source/latex/reledmac/reledmac.dtx
+++ b/Master/texmf-dist/source/latex/reledmac/reledmac.dtx
@@ -326,6 +326,11 @@
% \changes{v2.1.3}{2015/09/05}{\protect\cs{Xnoindent} and \protect\cs{noindentX} work now again (broken in 2.0.0).}
% \changes{v2.1.3}{2015/09/05}{Change some internal code in order to provide compatibility with \LaTeX\ release of october~2015}
% \changes{v2.1.3}{2015/09/05}{Fix bug which inserted double space before paragraphed familiar notes.}
+% \changes{v2.2.0}{2015/09/29}{Fix bug with combination of \protect\cs{onehalfspacing} and two columns and three columns notes typeset.}
+% \changes{v2.2.0}{2015/09/29}{Fix bug with some setting command and optimization option.}
+% \changes{v2.2.0}{2015/09/29}{New setting tools for endnotes: \protect\cs{Xendnumberonlyfirstinline}, \protect\cs{Xendnumberonlyfirstintwolines}, \protect\cs{Xendsymlinenum}, \protect\cs{Xendbeforenumber}, \protect\cs{Xendafterenumber}, \protect\cs{Xendbeforesymlinenum}, \protect\cs{Xendaftersymlinenum}, \protect\cs{Xendboxsymlinenum}, \protect\cs{Xendhangindent}, \protect\cs{Xendbhooklinenumber}, \protect\cs{Xendahooklinenumber}, \protect\cs{Xendbhookinplaceofnumber}, \protect\cs{Xendahookinplaceofnumber}.}
+% \changes{v2.2.0}{2015/09/29}{Fix spurious space with paragraphed critical notes when using \LuaLaTeX.}
+% \changes{v2.2.0}{2015/09/29}{Increase line list version number to ensure compatibility with new options of \reledpar package.}
% \hyphenation{man-u-script man-u-scripts}
%
%
@@ -1564,16 +1569,23 @@
%
% Use \protect\cs{Xnumberonlyfirstinline}\oarg{s}\verb+[false]+ to disable this. \meta{s} can be empty if you want to disable it for every series.
%
-% \DescribeMacro{\Xnumberonlyfirstintwolines}
% \changes{v1.1.0}{2012/09/25}{Add \protect\cs{Xnumberonlyfirstintwolines}}
+% \DescribeMacro{\Xnumberonlyfirstintwolines}
% Suppose you have a lemma on line~2 and a lemma between line~2 and line~3.
% With \protect\cs{Xnumberonlyfirstinline}, the second lemma is considered to be on the same line as the first lemma.
% But if you use both \protect\cs{Xnumberonlyfirstinline}\oarg{s} and \protect\cs{Xnumberonlyfirstintwolines}\oarg{s}, a distinction is made.
-% Use the command \linebreak\protect\cs{Xnumberonlyfirstintwolines}\oarg{s}\verb+[false]+\\
+% Use the command \linebreak\protect\cs{Xnumberonlyfirstintwolines}\oarg{s}\verb+[false]+
% to disable this. \meta{s} can be empty if you want to disable it for every series.
+%
+%
% \DescribeMacro{\Xsymlinenum}
% For setting a particular symbol in place of the line number, you can use \protect\cs{Xsymlinenum}\oarg{s}\marg{symbol} in combination with \protect\cs{Xnumberonlyfirstinline}\oarg{s}. From the second lemma of the same line, the symbol will be used instead of the line number. Note that any command called in \meta{symbol} must be robust. Use \protect\cs{robustify} to robustify a non-robust command.
%
+% \DescribeMacro{\Xendnumberonlyfirstinline}
+% \DescribeMacro{\Xendnumberonlyfirstintwolines}
+% \DescribeMacro{\Xendsymlinenum}
+% For endnotes, \cs{Xendnumberonlyfirstinline}; \cs{Xendnumberonlyfirstintwolines} and \cs{Xendsymlinenum} are the equivalents of
+% \\ \cs{Xnumberonlyfirstinline}; \cs{Xnumberonlyfirstintwolines} and \cs{Xsymlinenum}.
% \subsubsection{Abbreviate line range}
% \changes{v1.20.0}{2015/03/22}{Add \protect\cs{Xtwolines} and \protect\cs{Xmorethantwolines} hooks}
% \label{Xtwolines}
@@ -1663,6 +1675,9 @@
% \DescribeMacro{\Xafternumber}
% With \protect\cs{Xafternumber}\oarg{s}\marg{l} you can add some space after the line number in a footnote. If the line number is not printed, the space is not either. The default value is 0.5~em.
%
+% \DescribeMacro{\Xendbeforenumber}\DescribeMacro{Xendafterenumber}
+% \cs{Xendbeforenumber} and \cs{Xendafterenumber} are the equivalents of \cs{Xbeforenumber} and \cs{afterenumber} for endnotes.
+%
%\changes{v1.4.3}{2012/12/18}{Add \protect\cs{Xnonbreakableafternumber}.}
%\DescribeMacro{\Xnonbreakableafternumber}
% By default, the space defined by \protect\cs{Xafternumber} is breakable.
@@ -1676,6 +1691,10 @@
% \DescribeMacro{\Xaftersymlinenum}
% With \protect\cs{Xaftersymlinenum}\oarg{s}\marg{l} you can add some space after the line symbol in a footnote. The default value is value set by \protect\cs{Xafternumber}.
%
+% \DescribeMacro{\Xendbeforesymlinenum}
+% \DescribeMacro{\Xendaftersymlinenum}
+% \cs{Xendbeforesymlinenum} and \cs{Xendaftersymlinenum} are the equivalents of \cs{Xbeforesymlinenum} and \cs{Xaftersymlinenum} for the endnotes.
+%
% \subsubsection{Space in place of number}
% \DescribeMacro{\Xinplaceofnumber}
% If no number or symbolic line number is printed, you can add a space, with \cs{Xinplaceofnumber}\oarg{s}\marg{l}. The default value is 1~em.
@@ -1695,6 +1714,9 @@
%
% \DescribeMacro{\Xboxsymlinenum}
% \protect\cs{Xboxsymlinenum}\oarg{s}\marg{l} is the same as \protect\cs{Xboxlinenum} but for the line number symbol.
+%
+% \DescribeMacro{\Xendboxsymlinenum}
+% \protect\cs{Xendboxsymlinenum}\oarg{s}\marg{l} is the same as \protect\cs{Xboxsymlinenum} but for endnotes.
%
% \changes{v1.23.0}{2015/05/18}{Add \protect\cs{Xboxlinenumalign} and \protect\cs{Xendboxlinenumalign}.}
% \DescribeMacro{\Xboxlinenumalign}
@@ -1728,6 +1750,22 @@
% \protect\cs{Xendboxlinenum}\oarg{s}\marg{l}, \protect\cs{Xendboxlinenumalign}\oarg{s}\marg{text}, \protect\cs{Xendboxstartlinenum}\oarg{s}\marg{l}, \protect\cs{Xendboxendlinenum}\oarg{s}\marg{l} are the same as, respectively, \protect\cs{Xboxlinenum} and \protect\cs{Xboxlinenumalign}, \protect\cs{Xboxstartlinenum}, \protect\cs{Xboxendlinenum} except in endnotes.
%
%
+% \subsection{Arbitrary code around line number}
+% \DescribeMacro{\Xendbhooklinenumber}
+% \cs{Xendbhooklinenumber}\oarg{s}\marg{code} is used to execute code before line number in endnotes. The code is executed before the \cs{Xendbeforelinenumber} space and before the \cs{Xendnotenumfont} font setting.
+%
+% \DescribeMacro{\Xendahooklinenumber}
+% \cs{Xendahooklinenumber}\oarg{s}\marg{code} is used to execute code after line number in endnotes.
+% The code is executed after the \cs{Xendafternumber} space.
+%
+%
+%
+% \DescribeMacro{\Xendbhookinplaceofnumber}
+% \cs{Xendbhookinplaceofnumber}\oarg{s}\marg{code} is used to execute code before space or symbol which replace line number in endnotes. The code is executed before the \cs{Xendbeforesymlinenum} space and before the \cs{Xendnotenumfont} font setting.
+%
+% \DescribeMacro{\Xendahookinplaceofnumber}
+% \cs{Xendahookinplaceofnumber}\oarg{s}\marg{code} is used to execute code after space or symbol which replace line number in endnotes.
+% The code is executed after the \cs{Xendaftersymlinenum} space.
%\subsection{Separator between the lemma and the note}
% \subsubsection{For footnotes}
% \DescribeMacro{\Xlemmaseparator}
@@ -1779,6 +1817,17 @@
% \protect\cs{notenumfontX}\oarg{s}\marg{command} is used to change the font style for note numbers in familiar footnotes.
% \meta{command} must be one (or more) switching command, like \protect\cs{bfseries}.
%
+
+% \subsubsection{For the lemma}
+% \changes{v1.11.0}{2014/05/09}{Add hooks to disable the font selection for lemma in footnote.}
+% \DescribeMacro{\Xlemmadisablefontselection}
+% By default, font of the lemma in footnote is the same as font of the lemma in the main text. For example, if the lemma is in italic in the main text, it is also in italic in note. The \protect\cs{Xlemmadisablefontselection}\oarg{s} command allows to disable it for a specific series.
+%
+% \DescribeMacro{\Xendlemmadisablefontselection}
+% By default, font of the lemma in endnote is the same as font of the lemma in the main text. For example, if the lemma is in italic in the main text, it is also in italic in note. The command allows \protect\cs{Xendlemmadisablefontselection}\oarg{s} to disable it for a specific series.
+%
+%
+% \subsubsection{For all notes}
% \DescribeMacro{\Xnotefontsize}
% \protect\cs{Xnotefontsize}\oarg{s}\marg{command} is used to define the font size of critical footnotes of the series. The default value is \protect\cs{footnotesize}.
% The \meta{command} must not be a size in pt, but a standard \LaTeX\ size, like \protect\cs{small}.
@@ -1790,16 +1839,7 @@
% \DescribeMacro{\Xendnotefontsize}
% \protect\cs{Xendnotefontsize}\oarg{s}\marg{l} is used to define the font size of end critical footnotes of the series. The default value is \protect\cs{footnotesize}.
% The \meta{command} must not be a size in pt, but a standard \LaTeX\ size, like \protect\cs{small}.
-% \subsubsection{For the lemma}
-% \changes{v1.11.0}{2014/05/09}{Add hooks to disable the font selection for lemma in footnote.}
-% \DescribeMacro{\Xlemmadisablefontselection}
-% By default, font of the lemma in footnote is the same as font of the lemma in the main text. For example, if the lemma is in italic in the main text, it is also in italic in note. The \protect\cs{Xlemmadisablefontselection}\oarg{s} command allows to disable it for a specific series.
-%
-% \DescribeMacro{\Xendlemmadisablefontselection}
-% By default, font of the lemma in endnote is the same as font of the lemma in the main text. For example, if the lemma is in italic in the main text, it is also in italic in note. The command allows \protect\cs{Xendlemmadisablefontselection}\oarg{s} to disable it for a specific series.
-%
-%
-% \subsection{Styles of notes content}
+% \subsection{Indent of notes content}
% \changes{v1.21.0}{2015/04/13}{Add \protect\cs{Xparindent} and \protect\cs{hangindentX}}
% \DescribeMacro{\Xparindent}
% By default, \macpackage does not add indentation before the paragraphs inside critical footnotes.
@@ -1814,6 +1854,10 @@
%
% \DescribeMacro{\hangindentX}
% For familiar notes NOT paragraphed you can define an indentation with \protect\cs{hangindentX}\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.
+
+% \DescribeMacro{\Xendhangindent}
+% For critical endnotes NOT paragraphed you can define an indentation with \protect\cs{Xendhangindent}\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.
+%
%
% \subsection{Arbitrary code at the beginning of notes}
% \changes{v1.1.0}{2012/09/25}{New hook to add arbitrary code at the beginning of the notes}
@@ -1878,7 +1922,7 @@
%
% \DescribeMacro{\Xparafootsep}\DescribeMacro{\parafootsepX}
% For paragraphed footnotes (see below), you can choose the separator between each note by using \protect\cs{Xparafootsep}\oarg{s}\marg{text} for critical notes and \protect\cs{parafootsepX} for familiar notes.
-% A common separator is the double pipe ($\parallel$), which you can set by using \protect\cs{parafootsep}\verb+{$\parallel$}+.
+% A common separator is the double pipe ($\parallel$), which you can set by using \protect\cs{Xparafootsep}\verb+{$\parallel$}+.
%
% Note that if the symbol defined by \protect\cs{Xsymlinenum} must be used at the beginning of a note, the \protect\cs{Xparafootsep} / \protect\cs{parafootsepX} is not used before this note.
%
@@ -3258,7 +3302,7 @@
% \begin{macrocode}
%<*code>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{reledmac}[2015/09/05 v2.1.3 typeset critical edition]%
+\ProvidesPackage{reledmac}[2015/09/29 v2.2.0 typeset critical edition]%
% \end{macrocode}
%
% \subsection{Package options}
@@ -5766,7 +5810,7 @@
% It is written in the file list.
% If we process a line-list file which used a older version, that means the commands used inside are deprecated, and we can't use them.
% \begin{macrocode}
-\newcommand{\this@line@list@version}{2}%
+\newcommand{\this@line@list@version}{3}%
% \end{macrocode}
% \end{macro}
% \begin{macro}{\line@list@stuff}
@@ -5797,6 +5841,9 @@
\global\first@linenum@out@false%
\immediate\openout\linenum@out=#1\relax%
\immediate\write\linenum@out{\string\line@list@version{\this@line@list@version}}%
+ \ifl@dpaging%
+ \immediate\write\linenum@out{\string\@par@sync@option{\@par@this@sync@option}}%
+ \fi%
\else
% \end{macrocode}
% If we get here, then this is
@@ -9094,10 +9141,10 @@
% \protect\cs{rigidbalance} directly, without any re-boxing.
% \begin{macrocode}
\newcommand*{\threecolfootgroup}[1]{{\csuse{Xnotefontsize@#1}%
- \noindent\csuse{Xtxtbeforenotes@#1}\par%
+ \noindent\csuse{Xtxtbeforenotes@#1}}\par%
\splittopskip=\ht\strutbox
\expandafter
- \rigidbalance\csname #1footins\endcsname \thr@@ \splittopskip}}
+ \rigidbalance\csname #1footins\endcsname \thr@@ \splittopskip}
% \end{macrocode}
% \end{macro}
%
@@ -9202,10 +9249,10 @@
% \end{macrocode}
% \begin{macrocode}
\newcommand*{\twocolfootgroup}[1]{{\csuse{Xnotefontsize@#1}
- \noindent\csuse{Xtxtbeforenotes@#1}\par%
+ \noindent\csuse{Xtxtbeforenotes@#1}}\par%
\splittopskip=\ht\strutbox
\expandafter
- \rigidbalance\csname #1footins\endcsname \tw@ \splittopskip}}
+ \rigidbalance\csname #1footins\endcsname \tw@ \splittopskip}
% \end{macrocode}
% \end{macro}
@@ -9351,11 +9398,7 @@
{%
\hspace{\csuse{Xinplaceofnumber@#2}}%
}%
- {\hspace{\csuse{Xbeforesymlinenum@#2}}\csuse{Xnotenumfont@#2}%
- \ifdimequal{\csuse{Xboxsymlinenum@#2}}{0pt}%
- {\csuse{Xsymlinenum@#2}}%
- {\hbox to \csuse{Xboxsymlinenum@#2}{\csuse{Xsymlinenum@#2}\hfill}}%
- \hspace{\csuse{Xaftersymlinenum@#2}}}%
+ {\printsymlinefootnotearea{#2}}%
}%
{%
\printlinefootnotearea{#1}{#2}%
@@ -9376,6 +9419,21 @@
}
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\printsymlinefootnotearea}
+% This macro prints the space before the line symbol, changes the font, when prints the line symbol and the space after it.
+% \begin{macrocode}
+\newcommand{\printsymlinefootnotearea}[1]{%
+ \hspace{\csuse{Xbeforesymlinenum@#1}}%
+ \csuse{Xnotenumfont@#1}%
+ \ifdimequal{\csuse{Xboxsymlinenum@#1}}{\z@}%
+ {\csuse{Xsymlinenum@#1}}%
+ {\hbox to \csuse{Xboxsymlinenum@#1}%
+ {\csuse{Xsymlinenum@#1}\hfill}%
+ }%
+ \hspace{\csuse{Xaftersymlinenum@#1}}%
+}%
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{\printlinefootnotearea}
% This macro prints the space before the line number, changes the font, then prints the line number and the space after it.
% It is called by \protect\cs{printlinefootnote}
@@ -9695,7 +9753,8 @@
% If we use \LuaTeX, ensure we use good text's direction.
% \begin{macrocode}
\ifluatex%
- \textdir TLT%
+ \edef\@tmp{\the\textdir}%
+ \ifdefstring{\@tmp}{TLT}{}{\textdir TLT}%Test in order to prevent spurious space (bug #397)
\fi%
% \end{macrocode}
% Decide which part of line number components we will print.
@@ -10967,6 +11026,7 @@
% \end{itemize}
% \begin{macrocode}
\global\notbool{parapparatus@}{}{\long}\def\endprint#1#2#3#4#5{{%
+ \hangindent=\csuse{Xendhangindent@#4}%
\ifXendinsertsep@%
\hskip\csuse{Xendafternote@#4}%
\csuse{Xendsep@#4}%
@@ -10982,15 +11042,10 @@
\notblank{#5}{\docsvlist{#5}}{}%
\csuse{Xendbhooknote@#4}%
\csuse{Xendnotefontsize@#4}%
- \ifboolexpr{%
- togl {nonum@}%
- or togl {Xendnonumber@#4}%
- }%
- {\hspace{\csuse{Xendinplaceofnumber@#4}}}%
- {\printlineendnotearea{#1}{#4}}%
- \nottoggle{Xendlemmadisablefontselection@#4}%
- {\select@lemmafont#1|#2}%
- {#2}%
+ \printlineendnote{#1}{#4}%
+ \nottoggle{Xendlemmadisablefontselection@#4}%
+ {\select@lemmafont#1|#2}%
+ {#2}%
\ifboolexpr{%
togl {nosep@}%
or test{\ifcsempty{Xendlemmaseparator@#4}}%
@@ -11014,6 +11069,56 @@
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \begin{macro}{\printlineendnote}
+% This macro controls, in endnote, whether the line number is printed or not, according to the series options. Its first argument is the information about lines; its second is the series of the footnote.
+% \begin{macrocode}
+\newcommand{\printlineendnote}[2]{%
+ \l@dp@rsefootspec#1|%
+ \iftoggle{Xendnumberonlyfirstintwolines@#2}{%
+ \edef\lineinfo@{\l@dparsedstartpage - \l@dparsedstartline - \l@dparsedstartsub - \l@dparsedendpage - \l@dparsedendline - \l@dparsedendsub}%
+ }%
+ {%
+ \edef\lineinfo@{\l@dparsedstartpage - \l@dparsedstartline - \l@dparsedstartsub}%
+ }%
+ \ifboolexpr{%
+ togl {nonum@}%
+ or togl {Xendnonumber@#2}%
+ }%
+ {\hspace{\csuse{Xendinplaceofnumber@#2}}}%
+ {%
+ \iftoggle{Xendnumberonlyfirstinline@#2}%
+ {\ifcsdef{prevendline#2}%
+ {\ifcsequal{prevendline#2}{lineinfo@}%
+ {%
+ \csuse{Xendbhookinplaceofnumber@#2}%
+ \ifcsempty{Xendsymlinenum@#2}%
+ {\hspace{\csuse{Xendinplaceofnumber@#2}}}%
+ {\printsymlineendnotearea{#2}}%
+ \csuse{Xendahookinplaceofnumber@2}%
+ }%
+ {\printlineendnotearea{#1}{#2}}}%
+ {\printlineendnotearea{#1}{#2}}%
+ }%
+ {\printlineendnotearea{#1}{#2}}%We keep every time line
+ \csxdef{prevendline#2}{\lineinfo@}%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\printsymlineendnotearea}
+% \begin{macrocode}
+\newcommand{\printsymlineendnotearea}[1]{%
+ \hspace{\csuse{Xendbeforesymlinenum@#1}}%
+ \csuse{Xendnotenumfont@#1}%
+ \ifdimequal{\csuse{Xendboxsymlinenum@#1}}{\z@}%
+ {\csuse{Xendsymlinenum@#1}}%
+ {\hbox to \csuse{Xendboxsymlinenum@#1}%
+ {\csuse{Xendsymlinenum@#1}\hfill}%
+ }%
+ \hspace{\csuse{Xendaftersymlinenum@#1}}%
+}%
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{\printlineendnotearea}
%
% This macro prints the space before the line number, changes the font, then prints the line number and the space after it.
@@ -11022,6 +11127,8 @@
% The first argument is line information, the second is the notes series (A, B, C, etc.)
% \begin{macrocode}
\newcommand{\printlineendnotearea}[2]{%
+ \csuse{Xendbhooklinenumber@#2}%
+ \hspace{\csuse{Xendbeforenumber@#2}}%
\bgroup%
\csuse{Xendnotenumfont@#2}%
\ifdimequal{\csuse{Xendboxlinenum@#2}}{0pt}%
@@ -11034,7 +11141,8 @@
\IfSubStr{LC}{\csuse{Xendboxlinenumalign@#2}}{\hfill}{}%
}}%
\egroup%
- \enspace%
+ \hspace{\csuse{Xendafternumber@#2}}%
+ \csuse{Xendahooklinenumber@#2}%
}%
% \end{macrocode}
% \end{macro}
@@ -11554,6 +11662,9 @@
\csgdef{Xendnotefontsize@#1}{\footnotesize}%
\csgdef{Xendbhooknote@#1}{}%
+ \csgdef{Xendbeforenumber@#1}{0pt}
+ \csgdef{Xendafternumber@#1}{0.5em}
+
\csgdef{Xendboxlinenum@#1}{0pt}%
\csgdef{Xendboxlinenumalign@#1}{L}%
@@ -11571,6 +11682,20 @@
\csgdef{Xendinplaceofnumber@#1}{0pt}%
\newtoggle{Xendnonumber@#1}%
+
+ \csgdef{Xendhangindent@#1}{0pt}%
+ \newtoggle{Xendnumberonlyfirstinline@#1}%
+ \newtoggle{Xendnumberonlyfirstintwolines@#1}%
+
+ \csgdef{Xendbeforesymlinenum@#1}{\csuse{Xendbeforenumber@#1}}%
+ \csgdef{Xendaftersymlinenum@#1}{\csuse{Xendafternumber@#1}}%
+ \csgdef{Xendsymlinenum@#1}{}%
+ \csgdef{Xendboxsymlinenum@#1}{0pt}%
+
+ \csgdef{Xendbhooklinenumber@#1}{}%
+ \csgdef{Xendehooklinenumber@#1}{}%
+ \csgdef{Xendbhookinplaceofnumber@#1}{}%
+ \csgdef{Xendehookinplaceofnumber@#1}{}%
% \end{macrocode}
% End of endnotes declaration
% \begin{macrocode}
@@ -11677,13 +11802,13 @@
\newcommandx{\settoggle@series}[5][4,5,usedefault]{%
\def\do##1{%
\global\settoggle{#2@##1}{#3}%
- \ifstrequal{#4}{reload}%
- {%
- \csuse{Xarrangement@\csuse{series@display##1}}{##1}%
- \csuse{arrangementX@\csuse{series@displayX##1}}{##1}%
- }%
- {}%
- }%
+ \ifstrequal{#4}{critical}{
+ \csuse{Xarrangement@\csuse{series@display##1}}{##1}%
+ }{}
+ \ifstrequal{#4}{familiar}{
+ \csuse{arrangementX@\csuse{series@displayX##1}}{##1}%
+ }{}
+ }%
\ifstrempty{#1}{%
\dolistloop{\@series}%
\ifstrempty{#5}{}{%
@@ -11710,10 +11835,13 @@
\newcommandx{\setcommand@series}[5][4,5,usedefault]{%
\def\do##1{
\csgdef{#2@##1}{#3}
- \ifstrequal{#4}{reload}{
- \csuse{Xarrangement@\csuse{series@display##1}}{##1}%
- \csuse{arrangementX@\csuse{series@displayX##1}}{##1}%
- }{}}
+ \ifstrequal{#4}{critical}{%
+ \csuse{Xarrangement@\csuse{series@display##1}}{##1}%
+ }{}
+ \ifstrequal{#4}{familiar}{%
+ \csuse{arrangementX@\csuse{series@displayX##1}}{##1}%
+ }{}%
+ }%
\ifstrempty{#1}{%
\dolistloop{\@series}%
\ifstrempty{#5}{}{%
@@ -11773,11 +11901,11 @@
% \begin{macro}{\newhooktoggle@series@reload}
% \changes{v1.13.0}{2014/09/16}{Add \protect\cs{newhookcommand@toggle@reload}}
% \protect\cs{newhookcommand@toggle@reload} does the same thing as \protect\cs{newhooktoggle@series}
-% but the commands created by this macro also reload the series arrangement.
+% but the commands created by this macro also reload the series arrangement, depending of type os notes
% \begin{macrocode}
-\newcommand{\newhooktoggle@series@reload}[1]{%
+\newcommand{\newhooktoggle@series@reload}[2]{%
\global\expandafter\newcommandx\expandafter*\csname #1\endcsname[2][1,2={true},usedefault]{%
- \settoggle@series{##1}{#1}{##2}[reload]%
+ \settoggle@series{##1}{#1}{##2}[#2]%
}%
}%
% \end{macrocode}
@@ -11790,9 +11918,9 @@
% but the commands created by this macro also reload the series' arrangement.
%
% \begin{macrocode}
-\newcommand{\newhookcommand@series@reload}[1]{%
+\newcommand{\newhookcommand@series@reload}[2]{%
\global\expandafter\newcommand\expandafter*\csname #1\endcsname[2][]{%
- \setcommand@series{##1}{#1}{##2}[reload]%
+ \setcommand@series{##1}{#1}{##2}[#2]%
}%
}
% \end{macrocode}
@@ -11825,7 +11953,7 @@
\newhookcommand@series{Xafterlemmaseparator}
\newhookcommand@series{Xinplaceoflemmaseparator}
\newhookcommand@series{Xtxtbeforenotes}
- \newhookcommand@series@reload{Xafterrule}
+ \newhookcommand@series@reload{Xafterrule}{critical}
\newhooktoggle@series{Xnumberonlyfirstinline}
\newhooktoggle@series{Xnumberonlyfirstintwolines}
\newhooktoggle@series{Xnonumber}
@@ -11838,9 +11966,9 @@
\newhooktoggle@series{Xonlypstart}
\newhooktoggle@series{Xnonbreakableafternumber}
\newhooktoggle@series{Xlemmadisablefontselection}
- \newhookcommand@series@reload{Xmaxhnotes}
- \newhookcommand@series@reload{Xbeforenotes}
- \newhooktoggle@series@reload{Xnoteswidthliketwocolumns}%
+ \newhookcommand@series@reload{Xmaxhnotes}{critical}
+ \newhookcommand@series@reload{Xbeforenotes}{critical}
+ \newhooktoggle@series@reload{Xnoteswidthliketwocolumns}{critical}%
\newhookcommand@series{Xnotefontsize}
\newhookcommand@series{Xboxlinenum}%
@@ -11866,10 +11994,10 @@
\newhookcommand@series{colalignX}%
\newhookcommand@series{notenumfontX}
\newhookcommand@series{bhooknoteX}
- \newhookcommand@series@reload{beforenotesX}
- \newhookcommand@series@reload{maxhnotesX}
- \newhooktoggle@series@reload{noteswidthliketwocolumnsX}%
- \newhookcommand@series@reload{afterruleX}
+ \newhookcommand@series@reload{beforenotesX}{familiar}
+ \newhookcommand@series@reload{maxhnotesX}{familiar}
+ \newhooktoggle@series@reload{noteswidthliketwocolumnsX}{familiar}%
+ \newhookcommand@series@reload{afterruleX}{familiar}
\newhookcommand@series{notefontsizeX}
\newhookcommand@series{afternoteX}
\newhookcommand@series{parafootsepX}
@@ -11899,12 +12027,30 @@
\newhookcommand@series{Xendafterlemmaseparator}
\newhookcommand@series{Xendinplaceoflemmaseparator}
+ \newhookcommand@series{Xendbeforenumber}%
+ \newhookcommand@series{Xendafternumber}%
+
\newhooktoggle@series{Xendparagraph}
\newhookcommand@series{Xendafternote}
\newhookcommand@series{Xendsep}
\newhookcommand@series{Xendinplaceofnumber}%
\newhooktoggle@series{Xendnonumber}%
+
+ \newhooktoggle@series{Xendnumberonlyfirstinline}%
+ \newhooktoggle@series{Xendnumberonlyfirstintwolines}%
+
+ \newhookcommand@series{Xendsymlinenum}%
+ \newhookcommand@series{Xendbeforesymlinenum}%
+ \newhookcommand@series{Xendaftersymlinenum}%
+ \newhookcommand@series{Xendboxsymlinenum}%
+
+ \newhookcommand@series{Xendbhooklinenumber}%
+ \newhookcommand@series{Xendahooklinenumber}%
+ \newhookcommand@series{Xendbhookinplaceofnumber}%
+ \newhookcommand@series{Xendahookinplaceofnumber}%
+
+ \newhookcommand@series{Xendhangindent}%
\fi
% \end{macrocode}
% \subsection{Hooks for a particular footnote}
diff --git a/Master/texmf-dist/source/latex/reledmac/reledpar.dtx b/Master/texmf-dist/source/latex/reledmac/reledpar.dtx
index 1226600d08a..653d943da40 100644
--- a/Master/texmf-dist/source/latex/reledmac/reledpar.dtx
+++ b/Master/texmf-dist/source/latex/reledmac/reledpar.dtx
@@ -245,6 +245,8 @@
% \changes{v2.3.0}{2015/09/05}{Fix bug with title number in parallel columns}
% \changes{v2.3.0}{2015/09/05}{Change some internal codes in order to provide compatibility with \LaTeX\ release of october~2015}
% \changes{v2.3.0}{2015/09/05}{New line setting command suffixed by R to set only the right side.}
+% \changes{v2.4.0}{2015/09/29}{New way of (not) synchronizing the parallel pages.}
+% \changes{v2.4.0}{2015/09/29}{Option to switch to \protect\cs{mainmatter} when calling \protect\cs{Pages}}
% \hyphenation{man-u-script man-u-scripts}
%
%
@@ -336,6 +338,37 @@
% Names of the package related to parallel typesetting have moved in parallel of names of the package related to critical edition.
%
% Please read \macpackage's handbook in order to understand this evolution.
+%
+% \section{Options}
+% The package can be loaded with a number of global options which are listed
+% here. Those options are fully described in the paragraphs devoted to their feature.
+% \subsection{Synchronization's options}
+% Please read the paragraph on synchronization's option on \reff{syncoption} to understand better those options.
+% \begin{description}
+% \item [shiftedpstarts] prevents white space between paragraphs on facing pages,
+% the white space necessary to sync pages is collected at the bottom of
+% the page instead.
+% \item [advancedshiftedpstarts] does the same as \option{shiftedpstarts}, but
+% the pstart shift are not counted to determine when cutting the page. That
+% could help to avoid page with blank lines at the bottom.
+% \item [nomaxlines] allows facing pages to have different numbers of lines.
+% \item [nosyncpstarts] disables syncing on facing pages. In that case the pages
+% are filled as two streams normal.
+% \end{description}
+% \subsection{Other options}
+% \begin{description}
+% \item [parledgroup] allows the use of \env{ledgroup} environment with \parpackage.\footnote{This option can either be used on \macpackage or \parpackage.}
+% \item [widthliketwocolumns] set the width of the text printed in a single
+% column to be the same as the width of the text printed in two parallel
+% columns with \parpackage. This is useful when alternating between normal and
+% parallel typesetting.\footnote{This option can either be used on \macpackage or \parpackage.}
+% \item [sameparallelpagenumber] sets page numbers on facing pages to the same value.
+% \item [prevpgnotnumbered] enables that the page before facing pages (the one
+% automatically inserted to start parallel pages on a left page) is not
+% counted. This applies only if the page is empty.
+% \end{description}
+%
+%
% \section{General}\label{howto}
%
% A file may mix \emph{numbered} and \emph{unnumbered} text.
@@ -527,6 +560,95 @@
% 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.
+% \subsubsection[Way of synchronizing]{Way of synchronizing\footnote{There is a French version of this article on \url{http://geekographie.maieul.net/185}.}}\label{syncoption}
+% Synchronization of left and right texts in parallel processing
+% requires some `numbered' auxiliary files to be written (namely \verb+.1+,
+%\verb+.1R+, \verb+.2+, \verb+.2R+, and so forth), the content of which may change as long
+%as synchronization is not complete. This usually requires LaTeX to be
+%run several times. Therefore, it is advised to use in conjunction
+%utilities such as latexmk to ensure that synchronization is complete.
+%
+%Numbered paragraphs which are contained between the \cs{pstart} and \cs{pend}
+%macros are thereafter called `chunks'.
+%
+%In short, the default setting is designed in such a way that
+%corresponding chunks of text are always kept in synchronization, even
+%at the cost of page padding, as it may result in leaving blank lines
+%between chunks of text. Conversely, using in conjunction
+%\option{advancedshiftedpstarts} and \option{nomaxlines} settings ensures that pages
+%are filled with text to full advantage—at the cost of the chunks not
+%being kept in synchronization—and every chunk starts on the facing
+%page of its corresponding chunk.
+%
+%To understand better how each of the synchronization settings of
+%\parpackage works, one must first understand how the default setting of
+%\parpackage synchronizes the left and right chunks.
+%
+%The aim of the default setting is twofold:
+%\begin{itemize}
+%\item To ensure that left pages contain what is to be on left sides and
+%that right pages contain what is to be on right sides.
+%\item To ensure that every chunk starts on the page that is facing its
+%corresponding chunk.
+%\end{itemize}
+%
+%As regards the latter, \parpackage checks that both of the following
+%rules are respected:
+%\begin{itemize}
+%\item The numbers of lines of every pair of chunks must be identical. To
+%keep this rule, \parpackage may insert some blank lines at the bottom of
+%the chunk that is shorter so that it may eventually have the same
+%number of lines as the one that is longer.
+%\item The main content of two facing pages, apart from critical and
+%familiar footnotes, must have the same numbers of lines, including
+%those that may be blank. Consequently, if one left page contains more
+%notes than the corresponding right page, the bottom of the right page
+%must be left blank.
+%\end{itemize}
+%
+%Each of these rules can be modified by a number of optional
+%synchronization settings in \parpackage:
+%\begin{enumerate}
+%\item Regarding the number of lines a pair of chunks may have:
+% \begin{enumerate}
+% \item 'shiftedpstarts' setting merely moves any added blank lines from
+%the bottom of the chunks to the bottom of the page. It does not allow
+%to have more lines on a given page as it just removes the blank lines
+%between the chunks and does nothing more. To understand better how
+%this work, you may compare the total amounts of lines of text on a
+%given page whether you have activated this setting or not: you will
+%see that both amounts are the same.
+% \item 'advancedshiftedpstarts' prevents any blank lines from being
+%inserted at the bottom of the chunks, also taking them away from the
+%total amount of lines the page may have. This allows to get more lines
+%on the pages. However, please note that:
+% \begin{itemize}
+% \item Blank lines are taken into account as \parpackage moves from one to
+%the following chunk of text, so that every pair of chunks may always
+%start on the same facing pages.
+% \item Consequently, blank lines continue to be taken into account in
+%the calculation of the amount of lines a given pair of pages may have.
+%This is why when a longer chunk runs from one page to another the
+%shorter corresponding one also runs across pages, even if this may
+%result in some blank vertical space being left on the first page.
+% \end{itemize}
+% \end{enumerate}
+% \item As regards the number of lines per page, including blank ones, the
+%\option{nomaxlines} setting disregards the rule that forces two facing pages
+%to have the same numbers of lines. So it allows to have more text on
+%the pages. Then, by a complex mechanism it is ensured that two
+%corresponding chunks may always start on the same facing pages,
+%provided that \option{shiftedpstarts} or \option{advancedshiftedpstarts} settings
+%shall not be activated.
+%\end{enumerate}
+%
+%Lastly, one may disregard all of the synchronization rules and content
+%himself with parallel texts typesetting. To achieve this, please use
+%the \option{nosyncpstarts} setting.
+%
+%Please note that every change of synchronization setting resets the
+%content of the `numbered' auxiliary files to make sure that \parpackage
+%does not try to make the synchronization with wrong calculations.
% \subsubsection{Page number}\label{sameparallelpagenumber}
% \changes{v1.15.0}{2015/05/18}{Add sameparallelpagenumber option.}
% By default, \protect\cs{Pages} use the standard \LaTeX\ page number scheme.
@@ -565,6 +687,12 @@
% \item[prevpgnotnumbered] will make this page won't be counted in the page counter.
%
% \end{description}
+% \subsubsection{Notes about \protect\cs{mainmatter}}
+% If you use \cs{frontmatter}, do not use \cs{mainmatter} directly before \cs{Pages} because it could create spurious empty pages.
+%
+% Use instead \cs{pages} with the optional argument \verb+[mainmatter]+.
+% In this case, the content of \cs{Pages} will start on a left side, without any spurious empty page, and the left pages will be odd (and not event like in normal way), the first one being \verb+1+.
+%
% \subsection{Critical and familiar footnotes}
% Of course, in ``Facing pages'', the \macpackage's both critical and familiar footnotes can be used.
% However, some specific points must be taken into consideration.
@@ -808,21 +936,6 @@
% selection for the side. The right side language is also
% applied to the right side line numbers.
%
-% \subsection{Shifting}
-% Corresponding left and right sides must have the same number of
-% paragraph chunks --- if there are four on the left there must be four
-% on the right, even if some are empty. The start of each pair of left and
-% right chunks are aligned horizontally on the page. The ends may
-% come at different positions --- if one chunk is shorter than the other
-% then blank lines are output on the shorter side until the end of the longer
-% chunk is reached.
-%
-% However, sometime if the left pstarts are much greater than right pstarts,
-% or \emph{vice-versa},
-% you can decide to shift the pstarts on the left and right side.
-% That means the start of pstarts are not aligned horizontally on the page,
-% the shift is offset at the end of each double pages.
-% To enable this function, load \parpackage with the option \verb+shiftedpstarts+.
% \section{Verse}
%
% If you are typesetting verses with \macpackage you can use the \protect\cs{stanza}
@@ -993,7 +1106,7 @@
% \begin{macrocode}
%<*code>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{reledpar}[2015/09/05 v2.3.0 reledmac extension for parallel texts]%
+\ProvidesPackage{reledpar}[2015/09/29 v2.4.0 reledmac extension for parallel texts]%
% \end{macrocode}
% \subsection{Package's requirement}
@@ -1007,19 +1120,66 @@
% \begin{macrocode}
\RequirePackage{xkeyval}
% \end{macrocode}
+% \subsection{Package's options}
+% \subsubsection{Synchronization's options}
+% \begin{macro}{\@par@this@sync@option}
+% The \cs{par@sync@option} stores the options of synchronization.
+% It use to ensure these options do not change between two run.
+% \begin{macrocode}
+\def\@par@this@sync@option{}%
+% \end{macrocode}
+% \end{macro}
% With the option `shiftedpstarts' a long pstart on the left side (or on the right side) does not make a blank on the corresponding pstart, but the blank is put on the bottom of the page. Consequently, the pstarts on the parallel pages are shifted, but the shift stops at every end of pages.
% \begin{macro}{\ifshiftedpstarts}
% \begin{macrocode}
\newif\ifshiftedpstarts
-\DeclareOptionX{shiftedpstarts}{\shiftedpstartstrue}
+\DeclareOptionX{shiftedpstarts}{%
+ \shiftedpstartstrue%
+ \apptocmd{\@par@this@sync@option}{shifted}{}{}%
+}%
+% \end{macrocode}
+% \end{macro}
+% With the option `advancedshiftedpstarts' a long pstart on the left side (or on the right side) does not make a blank on the corresponding pstart, but the blank is put on the bottom of the page. Consequently, the pstarts on the parallel pages are shifted, but the shift stops at every end of pages.
+% Differing to \option{shiftedpstarts}, the pstart shift are not counted to determine when cutting the page. That could help to avoid page with blank lines at the bottom.
+% \begin{macro}{\ifshiftedpstarts}
+% \begin{macrocode}
+\newif\ifadvancedshiftedpstarts
+\DeclareOptionX{advancedshiftedpstarts}{%
+ \advancedshiftedpstartstrue%
+ \shiftedpstartstrue%
+ \apptocmd{\@par@this@sync@option}{advancedshifted}{}{}%
+}%
+% \end{macrocode}
+% \end{macro}
+% With the option \option{nomaxlines}, \parpackage allows facing pages to have not the same number of lines.
+% \begin{macro}{\ifnomaxlines}
+% \begin{macrocode}
+\newif\ifnomaxlines%
+\DeclareOptionX{nomaxlines}{%
+ \nomaxlinestrue%
+ \apptocmd{\@par@this@sync@option}{nomax}{}{}%
+}%
+% \end{macrocode}
+% \end{macro}
+% With the option \option{nosyncpstarts}, \parpackage only alternate between left and right side, and does not try to obtain the same number of line in corresponding page.
+% \begin{macro}{\ifnosyncpstarts}
+% \begin{macrocode}
+\newif\ifnosyncpstarts%
+\DeclareOptionX{nosyncpstarts}{%
+ \shiftedpstartstrue%
+ \nomaxlinestrue%
+ \nosyncpstartstrue%
+ \apptocmd{\@par@this@sync@option}{nosync}{}{}%
+}%
% \end{macrocode}
% \end{macro}
+% \subsubsection{Other options}
% The \verb+parledgroup+ can be called either on \macpackage or \parpackage.
% \begin{macrocode}
\DeclareOptionX{parledgroup}{\parledgrouptrue}
% \end{macrocode}
% \begin{macro}{\ifwidthliketwocolumns}
-% The \protect\cs{widthliketwocolumns} option can be called either on \macpackage or \parpackage.
+% The \verb|widthliketwocolumns| option can be called either on \macpackage or \parpackage.
% \changes{v1.9.0}{2014/09/16}{Added widthliketwocolumns option}
% \begin{macrocode}
\DeclareOptionX{widthliketwocolumns}{\widthliketwocolumnstrue}%
@@ -1085,12 +1245,17 @@
%
% All the error and warning messages are collected here as macros.
%
-% \begin{macro}{\eledpar@error}
+% \begin{macro}{\reledpar@error}
% \changes{v1.8.2}{2014/08/15}{Errors specific to eledpar send to eledpar handbook}
% \begin{macrocode}
\newcommand{\reledpar@error}[2]{\PackageError{reledpar}{#1}{#2}}
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\reledpar@warning}
+% \begin{macrocode}
+\newcommand{\reledpar@warning}[1]{\PackageWarning{reledpar}{#1}}%
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{\led@err@TooManyPstarts}
% \begin{macrocode}
\newcommand*{\led@err@TooManyPstarts}{%
@@ -1167,6 +1332,13 @@
}%
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\led@warn@ChangeSyncOption}
+% \begin{macrocode}
+\newcommand*{\led@warn@ChangeSyncOption}[1]{%
+ \reledpar@warning{You have changed synchronization's options since last run. We have not read line-list file #1. Please run LaTeX again.}%
+}%
+% \end{macrocode}
+% \end{macro}
% \section{Sectioning commands}
%
% \begin{macro}{\section@numR}
@@ -1725,6 +1897,23 @@
}
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\@par@sync@option}
+% When typesetting parallel pages, \cs{@par@sync@option} check if we have changed the synchronization's option since the last run.
+% If true, we just not read the numbered file.
+% \begin{macrocode}
+\newcommand{\@par@sync@option}[1]{%
+ \IfStrEq{#1}{\@par@this@sync@option}%
+ {}%
+ {\ifledRcol%
+ \led@warn@ChangeSyncOption{\jobname.\extensionchars\the\section@num}%
+ \else%
+ \led@warn@ChangeSyncOption{\jobname.\extensionchars\the\section@num}%
+ \fi%
+ \endinput%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{\read@linelist}
% \protect\cs{read@linelist}\marg{file} is the control sequence
% that is called by \protect\cs{beginnumbering}
@@ -2052,7 +2241,7 @@
% \begin{macro}{\@pend}
% \begin{macro}{\@pendR}
% \protect\cs{@pend}\marg{num} adds its argument to the \protect\cs{linesinpar@listL}
-% list, and analagously for \protect\cs{@pendR}. If needed, it resets line number.
+% list, and analogously for \protect\cs{@pendR}. If needed, it resets line number.
% Both are defined in \macpackage, but they are empty.
% They are really defined only in \parpackage.
%
@@ -2069,6 +2258,33 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\@pstart}
+% \begin{macro}{\@pstartR}
+% \cs{@pstart} and cs{@pstartR} allows us to know, when using \cs{nomaxlines} option in which page we should start a pstart, and also how many empty lines we should let before starting this pstart at the begining of the page
+% \begin{macrocode}
+\newcommand{\@pstart}[3]{%
+ \ifcsdef{minpage@pstart@#1}%
+ {\ifnumgreater{#2}{\csuse{minpage@pstart@#1}}%
+ {\csnumgdef{minpage@pstart@#1}{#2}}%
+ {}%
+ }%
+ {\csnumgdef{minpage@pstart@#1}{#2}}
+ \csnumgdef{afterlines@pstart@#1L}{#3}%
+ }%
+
+\newcommand{\@pstartR}[3]{%
+ \numdef{\@tmp}{#2-1}%Because we have not to know in which page the pstart starts, but in which pair of facing page
+ \ifcsdef{minpage@pstart@#1}%
+ {\ifnumgreater{\@tmp}{\csuse{minpage@pstart@#1}}%
+ {\csnumgdef{minpage@pstart@#1}{\@tmp}}%
+ {}%
+ }%
+ {\csnumgdef{minpage@pstart@#1}{\@tmp}}
+ \csnumgdef{afterlines@pstart@#1R}{#3}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
% \begin{macro}{\@lopL}
% \begin{macro}{\@lopR}
% \protect\cs{@lopL}\marg{num} adds its argument to the \protect\cs{linesonpage@listL}
@@ -2126,6 +2342,9 @@
\global\first@linenum@out@Rfalse
\immediate\openout\linenum@outR=#1
\immediate\write\linenum@outR{\string\line@list@version{\this@line@list@version}}%
+ \ifl@dpaging%
+ \immediate\write\linenum@outR{\string\@par@sync@option{\@par@this@sync@option}}%
+ \fi%
\else
\if@minipage%
\leavevmode%
@@ -2918,38 +3137,41 @@
\letcs{\ifnumberpstart}{numberpstart@L\the\l@dpscL}%
\advance\countLline \@ne%
\ifvbox\namebox{l@dLcolrawbox\the\l@dpscL}%
- {\vbadness=10000%
- \splittopskip=\z@%
- \do@lineLhook%
- \l@demptyd@ta%
- \global\setbox\one@line=\vsplit\namebox{l@dLcolrawbox\the\l@dpscL}%
+ {\vbadness=10000%
+ \splittopskip=\z@%
+ \do@lineLhook%
+ \l@demptyd@ta%
+ \global\setbox\one@line=\vsplit\namebox{l@dLcolrawbox\the\l@dpscL}%
to\baselineskip}%
- \IfStrEq{\splitfirstmarks\parledgroup@}{begin}{\parledgroup@notes@startL}{}%
- \unvbox\one@line \global\setbox\one@line=\lastbox%
- \getline@numL%
- \ifnum\@lock>\@ne%
- \inserthangingsymboltrue%
- \else%
- \inserthangingsymbolfalse%
- \fi%
- \setbox\l@dleftbox%
- \hb@xt@ \Lcolwidth{%
- \ifl@dhidenumber%
- \global\l@dhidenumberfalse%
- \f@x@l@cks%
+ \IfStrEq{\splitfirstmarks\parledgroup@}{begin}{\parledgroup@notes@startL}{}%
+ \unvbox\one@line \global\setbox\one@line=\lastbox%
+ \@writepageofparL%
+ \getline@numL%
+ \ifnum\@lock>\@ne%
+ \inserthangingsymboltrue%
\else%
- \affixline@num%
+ \inserthangingsymbolfalse%
\fi%
- \xifinlist{\the\l@dpscL}{\eled@sections@@}%
- {\add@inserts\affixside@note}%
- {\print@lineL}}%
- \add@penaltiesL%
- \global\advance\@donereallinesL\@ne%
- \global\advance\@donetotallinesL\@ne%
-\else%
- \setbox\l@dleftbox \hb@xt@ \Lcolwidth{\hspace*{\Lcolwidth}}%
- \global\advance\@donetotallinesL\@ne%
-\fi}
+ \setbox\l@dleftbox%
+ \hb@xt@ \Lcolwidth{%
+ \ifl@dhidenumber%
+ \global\l@dhidenumberfalse%
+ \f@x@l@cks%
+ \else%
+ \affixline@num%
+ \fi%
+ \xifinlist{\the\l@dpscL}{\eled@sections@@}%
+ {\add@inserts\affixside@note}%
+ {\print@lineL}%
+ }%
+ \add@penaltiesL%
+ \global\advance\@donereallinesL\@ne%
+ \global\advance\@donetotallinesL\@ne%
+ \else%
+ \setbox\l@dleftbox \hb@xt@ \Lcolwidth{\hspace*{\Lcolwidth}}%
+ \global\advance\@donetotallinesL\@ne%
+ \fi%
+}%
% \end{macrocode}
@@ -3060,40 +3282,41 @@
\ledRcol@true%
\advance\countRline \@ne%
\ifvbox\namebox{l@dRcolrawbox\the\l@dpscR}%
- {\vbadness=10000%
- \splittopskip=\z@%
- \do@lineRhook%
- \l@demptyd@ta%
- \global\setbox\one@lineR=\vsplit\namebox{l@dRcolrawbox\the\l@dpscR}%
+ {\vbadness=10000%
+ \splittopskip=\z@%
+ \do@lineRhook%
+ \l@demptyd@ta%
+ \global\setbox\one@lineR=\vsplit\namebox{l@dRcolrawbox\the\l@dpscR}%
to\baselineskip}%
- \IfStrEq{\splitfirstmarks\parledgroup@}{begin}{\parledgroup@notes@startR}{}%
- \unvbox\one@lineR \global\setbox\one@lineR=\lastbox%
- \getline@numR%
- \ifnum\@lockR>\@ne%
- \inserthangingsymbolRtrue%
- \else%
- \inserthangingsymbolRfalse%
- \fi%
- \setbox\l@drightbox%
- \hb@xt@ \Rcolwidth{%
- \ifl@dhidenumber%
- \global\l@dhidenumberfalse%
- \f@x@l@cksR%
+ \IfStrEq{\splitfirstmarks\parledgroup@}{begin}{\parledgroup@notes@startR}{}%
+ \unvbox\one@lineR \global\setbox\one@lineR=\lastbox%
+ \@writepageofparR%
+ \getline@numR%
+ \ifnum\@lockR>\@ne%
+ \inserthangingsymbolRtrue%
\else%
- \affixline@numR%
+ \inserthangingsymbolRfalse%
\fi%
- \xifinlist{\the\l@dpscR}{\eled@sectionsR@@}%
- {\add@insertsR\affixside@noteR}%
- {\print@lineR}%
- }%
- \add@penaltiesR%
- \global\advance\@donereallinesR\@ne%
- \global\advance\@donetotallinesR\@ne%
-\else%
- \setbox\l@drightbox \hb@xt@ \Rcolwidth{\hspace*{\Rcolwidth}}%
- \global\advance\@donetotallinesR\@ne%
-\fi%
-\ledRcol@false%
+ \setbox\l@drightbox%
+ \hb@xt@ \Rcolwidth{%
+ \ifl@dhidenumber%
+ \global\l@dhidenumberfalse%
+ \f@x@l@cksR%
+ \else%
+ \affixline@numR%
+ \fi%
+ \xifinlist{\the\l@dpscR}{\eled@sectionsR@@}%
+ {\add@insertsR\affixside@noteR}%
+ {\print@lineR}%
+ }%
+ \add@penaltiesR%
+ \global\advance\@donereallinesR\@ne%
+ \global\advance\@donetotallinesR\@ne%
+ \else%
+ \setbox\l@drightbox \hb@xt@ \Rcolwidth{\hspace*{\Rcolwidth}}%
+ \global\advance\@donetotallinesR\@ne%
+ \fi%
+ \ledRcol@false%
}
@@ -4499,6 +4722,29 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\@writepageofparL}
+% \begin{macro}{\@writepageofparR}
+% These write the pages where start the first line of a chunck.
+% \begin{macrocode}
+\newcommand*{\@writepageofparL}[0]{%
+ \ifnum\@donereallinesL=\z@%
+ \edef\next{%
+ \write\linenum@out{\string\@pstart{\the\l@dpscL}{\the\c@page}{\the\numpagelinesL}}%
+ }%
+ \next%
+ \fi%
+}%
+\newcommand*{\@writepageofparR}[0]{%
+ \ifnum\@donereallinesR=\z@%
+ \edef\next{%
+ \write\linenum@outR{\string\@pstartR{\the\l@dpscR}{\the\c@page}{\the\numpagelinesR}}%
+ }%
+ \next%
+ \fi%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
%
% \section{Parallel columns}
%
@@ -4961,10 +5207,11 @@
%
% \changes{v1.12.0}{2015/02/23}{Add \protect\cs{l@dprintingpagestrue}}
% \begin{macrocode}
-\newcommand*{\Pages}{%
+\newcommandx*{\Pages}[1][1,usedefault]{%
\ifl@dpairing%
\led@err@Pages@InsideEnv%
\fi%
+ \ifstrequal{#1}{mainmatter}{\Pages@mainmattertrue}{\Pages@mainmatterfalse}%
\eledsection@correcting@skip=-2\baselineskip% line correcting for section titles.
\parledgroup@notespacing@set@correction%
\typeout{}%
@@ -5101,9 +5348,23 @@
\parledgroup@correction@notespacing{L}%
\hb@xt@ \hsize{\ledstrutL\unhbox\l@dleftbox}%
\else%
- \dimen0=\pagetotal%
- \advance\dimen0 by \baselineskip%
- \global\pagetotal=\dimen0%
+ \unless\ifadvancedshiftedpstarts%
+ \dimen0=\pagetotal%
+ \advance\dimen0 by \baselineskip%
+ \global\pagetotal=\dimen0%
+ \else%
+ \ifnomaxlines%
+ \numdef{\@tmp}{\the\l@dpscL+1}%
+ \ifcsdef{minpage@pstart@\@tmp}{%
+ \ifnumless{\the\c@page}{\csuse{minpage@pstart@\@tmp}}%
+ {\dimen0=\pagetotal%
+ \advance\dimen0 by \baselineskip%
+ \global\pagetotal=\dimen0%
+ }%
+ {}%
+ }{}%
+ \fi%
+ \fi%
\fi%
\else%
\parledgroup@correction@notespacing{L}%
@@ -5119,7 +5380,7 @@
% Reset the verse skipnumber boolean
% \begin{macrocode}
\get@nextboxL%
- \global\l@dskipversenumberfalse%
+ \global\l@dskipversenumberfalse%
\ifprint@last@after@pendL%
\csuse{after@pendL@\the\l@dpscL}%
\global\csundef{after@pendL@\the\l@dpscL}%
@@ -5168,16 +5429,30 @@
\parledgroup@correction@notespacing{R}%
\hb@xt@ \hsize{\ledstrutR\unhbox\l@drightbox}%
\else%
- \dimen0=\pagetotal%
- \advance\dimen0 by \baselineskip%
- \global\pagetotal=\dimen0%
+ \unless\ifadvancedshiftedpstarts%
+ \dimen0=\pagetotal%
+ \advance\dimen0 by \baselineskip%
+ \global\pagetotal=\dimen0%
+ \else%
+ \ifnomaxlines%
+ \numdef{\@tmp}{\the\l@dpscR+1}%
+ \ifcsdef{minpage@pstart@\@tmp}{%
+ \ifnumless{\the\c@page}{\csuse{minpage@pstart@\@tmp}}%
+ {\dimen0=\pagetotal%
+ \advance\dimen0 by \baselineskip%
+ \global\pagetotal=\dimen0%
+ }%
+ {}%
+ }{}%
+ \fi%
+ \fi%
\fi%
\else%
\parledgroup@correction@notespacing{R}%
\hb@xt@ \hsize{\ledstrutR\unhbox\l@drightbox}%
\fi%
\get@nextboxR%
- \global\l@dskipversenumberRfalse%
+ \global\l@dskipversenumberRfalse%
\ifprint@last@after@pendR%
\csuse{after@pendR@\the\l@dpscR}%
\global\csundef{after@pendR@\the\l@dpscR}%
@@ -5277,9 +5552,11 @@
% \begin{macro}{\ledstrutR}
% Struts inserted into leftand right text lines.
% \changes{v0.3.0}{2005/02/10}{Added \protect\cs{ledtrutL} and \protect\cs{ledstrutR}}
+% \changes{v2.4.0}{2015/09/29}{Deleted \protect\cs{ledtrutL} and \protect\cs{ledstrutR}}
+% \changes{v2.4.0}{2015/09/29}{Fix bug with dotted letter}
% \begin{macrocode}
-\newcommand*{\ledstrutL}{\strut}
-\newcommand*{\ledstrutR}{\strut}
+\newcommand*{\ledstrutL}{}
+\newcommand*{\ledstrutR}{}
% \end{macrocode}
% \end{macro}
@@ -5303,6 +5580,7 @@
\ifdim\pagetotal<\topskip% on an empty page
\else
\clearpage
+ \Pages@mainmatter%
\fi
\ifodd\c@page%
\ifprevpgnotnumbered%
@@ -5479,8 +5757,11 @@
\ifdim\pagetotal<\ledthegoal
\ifnum\numpagelinesL<\l@dminpagelines
\else
- \l@dsamepagefalse
- \l@dpagefullfalse
+ \ifnomaxlines%
+ \else%
+ \l@dsamepagefalse%
+ \l@dpagefullfalse%
+ \fi%
\fi
\else
\l@dsamepagefalse
@@ -5500,8 +5781,11 @@
\ifdim\pagetotal<\ledthegoal
\ifnum\numpagelinesR<\l@dminpagelines
\else
- \l@dsamepagefalse
- \l@dpagefullfalse
+ \ifnomaxlines%
+ \else%
+ \l@dsamepagefalse%
+ \l@dpagefullfalse%
+ \fi%
\fi
\else
\l@dsamepagefalse
@@ -5622,6 +5906,17 @@
% \end{macro}
%
% \subsection{Getting boxes content}
+% \begin{macro}{\if@getnextbox}
+% The \cs{if@getnextbox} boolean is switched to true if we can get the next chunk in a page after finished previous chunk.
+% That is:
+% \begin{itemize}
+% \item If we use the \option{nosyncpstarts} option, in any case
+% \item If we do not use it, only when the number or real or blank line of the current chunk is equal or greater to the maximum number of line in the current pair of chunks.
+% \end{itemize}
+% \begin{macrocode}
+\newif\if@getnextbox%
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{\get@nextboxL}
% \begin{macro}{\get@nextboxR}
% \changes{v0.11.0}{2012/06/11}{Change \protect\cs{get@nextboxL} and \protect\cs{get@nextboxR} to allow to disable line numbering (like in eledmac 0.15).}
@@ -5638,15 +5933,57 @@
\else% box is empty
% \end{macrocode}
% The box is empty.
-% Check if enough lines (real and blank) have been
+% By default, we can get the next box
+% \begin{macrocode}
+ \@getnextboxtrue%Should be local, but be cautious
+% \end{macrocode}
+% But not when sufficient lines for this page have been generated (except when we don't do any synchronization whatsoever).
% output.
% \begin{macrocode}
\ifnum\usenamecount{l@dmaxlinesinpar\the\l@dpscL}>\@donetotallinesL
- \parledgroup@notes@endL
- \else
+ \parledgroup@notes@endL%
+ \unless\ifnosyncpstarts%
+ \@getnextboxfalse%
+% \end{macrocode}
+% If we use the nomaxlines option, we will start at new page, but we take count of the lines to be typeset for the actual right chunk on the right page, before starting new chunk on the left page.
+% \begin{macrocode}
+ \ifnomaxlines%
+ \ifdim\pagetotal<\ledthegoal%
+ \numdef{\@tmp}{\l@dpscL+1}%
+ \ifcsdef{afterlines@pstart@\@tmp R}{%
+ \ifnumless{\numpagelinesL}{\csuse{afterlines@pstart@\@tmp R}}%
+ {}%
+ {\ifcsdef{minpage@pstart@\@tmp}%
+ {\ifnumless{\the\c@page}{\csuse{minpage@pstart@\@tmp}}%
+ {\ifnum\numpagelinesL=\l@dminpagelines%
+ \@getnextboxtrue%
+ \fi%
+ }%
+ {\@getnextboxtrue}}%
+ {\@getnextboxtrue}%
+ }%
+ }%
+ {}%
+ \fi%
+ \fi%
+ \fi%
+ \else%
+ \ifnomaxlines%
+ \numdef{\@tmp}{\the\l@dpscL+1}%
+ \ifcsdef{minpage@pstart@\@tmp}{%
+ \ifnumless{\the\c@page}{\csuse{minpage@pstart@\@tmp}}%
+ {\ifdimgreater{\pagetotal}{\ledthegoal}%
+ {\@getnextboxtrue}%
+ {\@getnextboxfalse}%
+ }%
+ {\@getnextboxtrue}%
+ }{}%
+ \fi%
+ \fi%
% \end{macrocode}
% Sufficient lines have been output.
% \begin{macrocode}
+ \if@getnextbox%
\ifnum\usenamecount{l@dmaxlinesinpar\the\l@dpscL}=\@donetotallinesL
\parledgroup@notes@endL
\fi
@@ -5704,9 +6041,45 @@
\newcommand*{\get@nextboxR}{%
\ifvbox\namebox{l@dRcolrawbox\the\l@dpscR}% box is not empty
\else% box is empty
+ \@getnextboxtrue%
\ifnum\usenamecount{l@dmaxlinesinpar\the\l@dpscR}>\@donetotallinesR
\parledgroup@notes@endR
- \else
+ \unless\ifnosyncpstarts%
+ \@getnextboxfalse%
+ \ifnomaxlines%
+ \ifdim\pagetotal<\ledthegoal%
+ \numdef{\@tmp}{\l@dpscR+1}%
+ \ifcsdef{afterlines@pstart@\@tmp L}{%
+ \ifnumless{\numpagelinesL}{\csuse{afterlines@pstart@\@tmp L}}%
+ {}%
+ {\ifcsdef{minpage@pstart@\@tmp}%
+ {\ifnumless{\the\c@page}{\csuse{minpage@pstart@\@tmp}}%
+ {\ifnum\numpagelinesR=\l@dminpagelines%
+ \@getnextboxtrue%
+ \fi%
+ }%
+ {\@getnextboxtrue}}%
+ {\@getnextboxtrue}%
+ }%%
+ }%
+ {}%
+ \fi%
+ \fi%
+ \fi%
+ \else%
+ \ifnomaxlines%
+ \numdef{\@tmp}{\the\l@dpscR+1}%
+ \ifcsdef{minpage@pstart@\@tmp}{%
+ \ifnumless{\the\c@page}{\csuse{minpage@pstart@\@tmp}}%
+ {\ifdimgreater{\pagetotal}{\ledthegoal}%
+ {\@getnextboxtrue}%
+ {\@getnextboxfalse}%
+ }%
+ {\@getnextboxtrue}%
+ }{}
+ \fi%
+ \fi%
+ \if@getnextbox%
\ifnum\usenamecount{l@dmaxlinesinpar\the\l@dpscR}=\@donetotallinesR
\parledgroup@notes@endR
\fi
@@ -5742,6 +6115,7 @@
% \end{macro}
%
% \section{Page numbering}
+% \subsection{Global options}
% The \verb+sameparallelpagenumber+ option allows the same page number on both left and right side
% The \verb+prevpgnotnumbered+ option allows an empty (not numbered) right-side page before \cs{Pages}.
%
@@ -5837,6 +6211,24 @@
\setcounter{par@page}{1}%
% \end{macrocode}
% \end{macro}
+% \subsection{mainmatter option of \cs{Pages}}
+% The optional argument of \cs{Pages} could be equal to \verb+mainmatter+.
+% In this case the boolean \cs{ifPages@mainmatter} is set to true, and some special things are done in \cs{Pages@mainmatter}, called by \cs{cleartol@devenpage}.
+% \begin{macro}{\ifPages@mainmatter}
+% \begin{macro}{\Pages@mainmatter}
+% \begin{macrocode}
+\newif\ifPages@mainmatter
+\newcommand{\Pages@mainmatter}{%
+ \ifPages@mainmatter%
+ \pagenumbering{arabic}%
+ \addtocounter{page}{1}%
+ \addtocounter{par@page}{-1}%
+ \patchcmd{\thepage}{page}{par@page}{}{}%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+% \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.