summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/reledmac/reledpar.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/reledmac/reledpar.dtx')
-rw-r--r--macros/latex/contrib/reledmac/reledpar.dtx89
1 files changed, 70 insertions, 19 deletions
diff --git a/macros/latex/contrib/reledmac/reledpar.dtx b/macros/latex/contrib/reledmac/reledpar.dtx
index 2649200823..45e86de80e 100644
--- a/macros/latex/contrib/reledmac/reledpar.dtx
+++ b/macros/latex/contrib/reledmac/reledpar.dtx
@@ -225,7 +225,7 @@
% \changes{v1.15.0}{2015/04/13}{Fix vertical spurious space before right \protect\cs{eledchapter} (bug added in v1.13.0).}
% \changes{v1.15.0}{2015/04/13}{Prevent vertical space when using \protect\cs{AtEveryPstart} or \protect\cs{AtEveryPend} with a command which prints nothing}
% \changes{v1.16.0}{2015/05/18}{Fix a bug with nofamiliar / nocritical option of eledmac.}
-% \changes{v1.16.0}{2015/05/18}{Error message when using \protect\cs{beginnumbering}\ ...\ \protect\cs{endnumbering} without \protect\cs{pstart}.}
+% \changes{v1.16.0}{2015/05/18}{Error message when using \protect\cs{beginnumbering}\ldots\protect\cs{endnumbering} without \protect\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 \protect\cs{Pages} inside `pages' environment and \protect\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.}
@@ -293,7 +293,7 @@
% \changes{v2.14.4}{2016/11/14}{Take into account \protect\cs{linenumberstyle} when using \protect\cs{edlineref}.}
% \changes{v2.15.0}{2016/12/12}{Add \protect\option{movecolumnspositiononrightpage} option.}
% \changes{v2.15.0}{2016/12/12}{New macro \protect\cs{sidenotemarginR}, fix default value to right.}
-% \changes{v2.15.0}{2016/12/12}{Fix a bug with \protect\cs{msdata} when using multiple \protect\cs{beginnumbering}\ ...\ \protect\cs{endnumbering}}
+% \changes{v2.15.0}{2016/12/12}{Fix a bug with \protect\cs{msdata} when using multiple \protect\cs{beginnumbering}\ldots\protect\cs{endnumbering}}
% \changes{v2.15.0}{2016/12/12}{Fix a bug about space before sectioning commands after a pairs environment (bug added in v.~2.14.4).}
% \changes{v2.15.0}{2016/12/12}{Fix a bug with page break when using \protect\cs{columns} (bug added in v.~2.14.1).}
% \changes{v2.16.0}{2016/12/23}{Compatibility with \protect\cs{setmsdataposition}}
@@ -317,7 +317,7 @@
% \changes{v2.20.0}{2017/08/17}{Fix a bug with \protect\cs{continuousnumberingwithcolumns} when using multiple series of continued numbering text. Now, the line number are correctly reset at each \protect\cs{beginnumbering}.}
% \changes{v2.20.0}{2017/08/17}{Fix a bug with \protect\option{continuousnumberingwithcolumns} and inner / outer notes and line numbering.}
% \changes{v2.20.0}{2017/08/17}{Add \protect\cs{linenumOnlyPagesForColumns} and \protect\cs{linenumOnlyPagesForColumnsR} to tell to print the line numbers associated with a column only on some specific pages (for example, only on right pages).}
-% \changes{v2.20.0}{2017/08/17}{Fix a bug with \protect\option{continuousnumberingwithcolumns} when a \protect\cs{beginnumbering} is called after an other \protect\cs{beginnumbering}\ ...\ \protect\cs{endnumbering}.}
+% \changes{v2.20.0}{2017/08/17}{Fix a bug with \protect\option{continuousnumberingwithcolumns} when a \protect\cs{beginnumbering} is called after an other \protect\cs{beginnumbering}\ldots\protect\cs{endnumbering}.}
% \changes{v2.20.0}{2017/08/17}{Fix a bug with \protect\option{widthliketwocolumns} when manually setting \protect\cs{beforecolumnseparator} and \protect\cs{aftercolumnseparator}.}
% \changes{v2.20.0}{2017/08/17}{Fix compatibility between \protect\option{continuousnumberingwithcolumns} and \protect\cs{numberpstartfalse}.}
% \changes{v2.20.1}{2017/08/23}{Fix bug with \protect\option{continuousnumberingwithcolumns} when left column and right column have not the same size.}
@@ -338,6 +338,8 @@
% \changes{v2.22.1}{2019/01/08}{Really reset line number annotation at each line}
% \changes{v2.22.2}{2019/01/22}{Fix bug with \protect\cs{Xonlyside} and \protect\cs{onlysideX}}
% \changes{v2.22.3}{2019/07/21}{When using \protect\cs{parindentX} or \protect\cs{Xparindent} and stanza, use the normal indentation in the footnote, not the verse indentation.}
+% \changes{v2.23.0}{2020/03/08}{Add \protect\cs{Leftpagehook} and \protect\cs{Rightpagehook}.}
+% \changes{v2.23.0}{2020/03/08}{Add hanging symbol feature into \protect\env{astanza}.}
% ^^A PW added following as the definitions are at some unknown elsewhere
%
% \newcommand{\egstart}{%
@@ -627,8 +629,8 @@
% numbers between multiple columns and single columns, use the
% \option{continuousnumberingwithcolumns} option when loading \macpackage
% or \parpackage.
-% You will need to use \cs{pausenumbering}~...\
-% \cs{resumenumbering} in addition to \cs{beginnumbering}~...\
+% You will need to use \cs{pausenumbering}\ldots
+% \cs{resumenumbering} in addition to \cs{beginnumbering}\ldots
% \cs{endnumbering} (see \reff{reledmac-pause}).
%
% The best way to understand the behaviour of \cs{pausenumbering} and
@@ -640,15 +642,15 @@
% left-column commands.
%
% This means that you must switch between single-column and left-column
-% text using \cs{beginnumbering}~...\ \cs{pausenumbering}~...\
-% \cs{resumenumbering}~...\ \cs{pausenumbering}~...\
-% \cs{resumenumbering}~...\ \cs{endnumbering}.
+% text using \cs{beginnumbering}\ldots\cs{pausenumbering}\ldots
+% \cs{resumenumbering}\ldots\cs{pausenumbering}\ldots
+% \cs{resumenumbering}\ldots\cs{endnumbering}.
%
% On the other side, the first right column must always begin with
% \cs{beginnumbering}, no matter if the corresponding left-column started
% with \cs{resumenumbering} or not; this is because numbering in the right
% column has not been started yet. Then, for consecutive chunks of
-% right-column text you should use \cs{pausenumbering}~...\
+% right-column text you should use \cs{pausenumbering}\ldots
% \cs{resumenumbering}.
%
% You must use \cs{endnumbering} in a right column in the following cases:
@@ -1210,6 +1212,13 @@
%
% About these two hooks, read \macpackage's handbook (\reff{reledmac-linehook}).
%
+% \subsection{Executing code at each page}
+% \DescribeMacro{\Rightpagehook}
+% \DescribeMacro{\Leftpagehook}
+% When typesetting parallel pages, the \cs{Leftpagehook} and \cs{Rightpagehook} macros
+% are executed each time \Parpackage switches to Left / Right page.
+%
+% These macro are initially void. You can redefine them using \cs{renewcommand}.
% \section{Verse}
%
% If you are typesetting verses with \macpackage you can use the \protect\cs{stanza}
@@ -1386,7 +1395,7 @@
% \begin{macrocode}
%<*code>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{reledpar}[2019/11/04 v2.22.4 reledmac extension for parallel texts]%
+\ProvidesPackage{reledpar}[2020/03/08 v2.23.0 reledmac extension for parallel texts]%
% \end{macrocode}
% \subsection{Package's requirement}
@@ -2636,7 +2645,7 @@
%
% \begin{macro}{\l@d@set}
% The \protect\cs{l@d@set}\marg{num} macro sets
-% the line number for the next \verb?\pstart...? to the value specified as
+% the line number for the next \cs{pstart}\ldots\ to the value specified as
% its argument. This is used to implement \protect\cs{setlinenum}.
% It is defined in \macpackage.
% \changes{v2.0.0}{2015/07/19}{\protect\cs{l@d@set} defined only in \reledmac.}
@@ -3001,8 +3010,9 @@
% line-list file, to mark the start of a new text line.
% \begin{macrocode}
\newcommand*{\new@lineL}{%
+ \set@this@c@page%
\ifnumberline%
- \write\linenum@out{\string\@nl[\the\c@par@page][\thepage]}%
+ \write\linenum@out{\string\@nl[\the\@this@c@page][\thepage]}%
\fi%
}%
% \end{macrocode}
@@ -3012,8 +3022,9 @@
% line-list file, to mark the start of a new text line.
% \begin{macrocode}
\newcommand*{\new@lineR}{%
+ \set@this@c@page%
\ifnumberline%
- \write\linenum@outR{\string\@nl[\the\c@par@page][\thepar@page]}%
+ \write\linenum@outR{\string\@nl[\the\@this@c@page][\thepage]}%
\fi%
}%
% \end{macrocode}
@@ -3051,7 +3062,7 @@
%
% \begin{macro}{\setline}
% You can use \protect\cs{setline}\marg{num}
-% in running text (i.e., within \verb?\pstart...\pend?) to set the
+% in running text (i.e., within \cs{pstart}\ldots\cs{pend}) to set the
% current visible
% line-number to a specified positive value.
% It is defined in \macpackage.
@@ -3413,6 +3424,15 @@
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \begin{macro}{ifinastanzaL}
+% \begin{macro}{ifinastanzaR}
+% These boolean tests are switched by the \protect\env{astanza} environnement, using either the left or right side.
+% \begin{macrocode}
+ \newif\ifinastanzaL%
+ \newif\ifinastanzaR%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
% \begin{environment}{Leftside}
% Within the \verb?pairs? and \verb?pages? environments the left and
% right hand texts are within \verb?Leftside? and \verb?Rightside?
@@ -3461,6 +3481,15 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \begin{macro}{\Rightpagehook}
+% \begin{macro}{\Leftpagehook}
+% Hook at the start of Left/Right page, initially empty.
+% \begin{macrocode}
+\newcommand*{\Rightpagehook}{}%
+\newcommand*{\Leftpagehook}{}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
%
% \begin{environment}{Rightside}
% The \verb?Rightside? environment is only slightly more complicated
@@ -4056,6 +4085,7 @@
% \protect\cs{print@eledsectionL} is for line with macro code.
% \begin{macrocode}
\def\print@eledsectionL{%%
+ \disable@edindex%
\addtocounter{pstartL}{-1}%
\ifdefstring{\@eledsectnotoc}{L}{\ledsectnotoc}{}
\ifdefstring{\@eledsectmark}{L}{}{\ledsectnomark}
@@ -4081,6 +4111,7 @@
{\new@line \hbox{\l@dunhbox@line{\one@line}}}%
\fi%
\vskip\eledsection@correcting@skip%
+ \restore@edindex%
}
% \end{macrocode}
@@ -4245,6 +4276,7 @@
}
\def\print@eledsectionR{%
+ \disable@edindex%
\addtocounter{pstartR}{-1}%
\set@sectcountR%
\ifdefstring{\@eledsectnotoc}{R}{\ledsectnotoc}{}%
@@ -4270,7 +4302,8 @@
\hspace{3\paperwidth}%
{\new@lineR \hbox{\l@dunhbox@line{\one@lineR}}}%
\fi%
- \vskip\eledsection@correcting@skip
+ \vskip\eledsection@correcting@skip%
+ \restore@edindex%
}
% \end{macro}
% \end{macro}
@@ -5309,6 +5342,9 @@
\noexpand\csname sza@0@\endcsname}\stanzaindentbase%
\@hangingsymbol%
\fi%
+ \ifinastanzaL%
+ \@hangingsymbol%
+ \fi%
\fi%
}%
\newcommand{\inserthangingsymbolR}{%
@@ -5318,6 +5354,9 @@
\noexpand\csname sza@0@\endcsname}\stanzaindentbase%
\@hangingsymbol%
\fi%
+ \ifinastanzaR%
+ \@hangingsymbol%
+ \fi%
\fi%
}%
% \end{macrocode}
@@ -5344,6 +5383,11 @@
%
% \begin{macrocode}
\newenvironmentx{astanza}[2][1,2,usedefault]{%
+ \ifledRcol%
+ \global\inastanzaRtrue%
+ \else%
+ \global\inastanzaLtrue%
+ \fi%
\catcode`\&\active
\global\stanza@count\@ne\stanza@modulo\@ne
\newdimen\parindent@beforestanza%
@@ -5555,11 +5599,14 @@
% If use \protect\package{polyglossia}
% \changes{v1.8.0}{2014/08/05}{Correct left/right language setting with polyglossia.}
% \changes{v1.9.0}{2014/09/16}{Debug left/right language switching with polyglossia. Do not write in .aux file when setting left/right lines.}
-% \changes{v2.22.4}{2019/11/4}{Provide compatibility with lastet version of polyglossia (v1.45).}
+% \changes{v2.22.4}{2019/11/04}{Provide compatibility with last version of polyglossia (v1.45).}
+% \changes{v2.23.0}{2020/03/08}{Restore compatibility with version of polyglossia prior to v1.45.}
% \begin{macrocode}
{ \let\old@otherlanguage\otherlanguage%
\renewcommand{\otherlanguage}[2][]{%
- \xpg@set@group@aux%
+ \ifdefined\xpg@set@group@aux%
+ \xpg@set@group@aux%
+ \fi%
\selectlanguage[#1]{#2}%
\ifledRcol \gdef\theledlanguageR{#2}%
\else \gdef\theledlanguageL{#2}%
@@ -6241,8 +6288,8 @@
% \begin{macro}{setnotepositionliketwocolumns@R}
% The \protect\cs{setwidthliketwocolumns} macro is called in \protect\cs{beginnumbering} in a \textbf{non-parallel}
% typesetting context, to fix the width of the lines to be vertically aligned with parallel columns. It is also called at the beginning of a note's group, if some options are enabled.
-% The \protect\cs{setposition...} macros are called in \protect\cs{beginnumbering} in a \textbf{non- parallel} typesetting context to fix the position of the lines.
-% The \protect\cs{setnoteposition...} macros are called in \protect\cs{xxxfootstart} in a \textbf{non- parallel} typesetting context to fix the position of notes block.
+% The \protect\cs{setposition\ldots} macros are called in \protect\cs{beginnumbering} in a \textbf{non- parallel} typesetting context to fix the position of the lines.
+% The \protect\cs{setnoteposition\ldots} macros are called in \protect\cs{xxxfootstart} in a \textbf{non- parallel} typesetting context to fix the position of notes block.
% \begin{macrocode}
\newcommand{\setwidthliketwocolumns}{%
\get@intercolumns@width%As \columns is not necessary called before \setwidthliketwocolumns
@@ -6505,6 +6552,7 @@
% \changes{v0.2.0}{2004/12/20}{Added \protect\cs{l@duselanguage} to \protect\cs{Pages}}
% \begin{macrocode}
\checkpageL%
+ \Leftpagehook%
\l@duselanguage{\theledlanguageL}%
{ \loop\ifl@dsamepage%
% \end{macrocode}
@@ -6602,6 +6650,7 @@
% \changes{v0.3.0}{2005/02/10}{Added \protect\cs{ledstrutR} to \protect\cs{Pages}}
% \begin{macrocode}
\checkpageR%
+ \Rightpagehook%
\l@duselanguage{\theledlanguageR}%
{ \loop\ifl@dsamepage%
\set@sectcountR%
@@ -6698,6 +6747,8 @@
\global\l@dnumpstartsR=\z@%
\global\instanzaLfalse%
\global\instanzaRfalse%
+ \global\inastanzaLfalse%
+ \global\inastanzaRfalse%
\global\l@dprintingpagesfalse%
% \end{macrocode}
% Check the consistency of \cs{edtext@later} and \cs{edtext@now}