summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/reledmac/reledmac.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/reledmac/reledmac.sty')
-rw-r--r--Master/texmf-dist/tex/latex/reledmac/reledmac.sty113
1 files changed, 86 insertions, 27 deletions
diff --git a/Master/texmf-dist/tex/latex/reledmac/reledmac.sty b/Master/texmf-dist/tex/latex/reledmac/reledmac.sty
index 126120131fe..b218251acd3 100644
--- a/Master/texmf-dist/tex/latex/reledmac/reledmac.sty
+++ b/Master/texmf-dist/tex/latex/reledmac/reledmac.sty
@@ -37,7 +37,7 @@
%%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{reledmac}[2021/04/04 v2.37.2 typesetting critical editions]%
+\ProvidesPackage{reledmac}[2021/05/30 v2.38.0 typesetting critical editions]%
\RequirePackage{xkeyval}
\newif\ifparledgroup
\newif\ifsameparallelpagenumber%
@@ -1662,17 +1662,31 @@
\fi%
\fi%
\if@RTL%
+ \IfStrEq{\xabslineref{edtext:start:\csuse{thisedtext@\the\@edtext@level}}}%
+ {000}%
+ {}%
+ {%
+ \ifnumequal%
+ {\xabslineref{edtext:start:\csuse{thisedtext@\the\@edtext@level}}}%
+ {\xabslineref{edtext:end:\csuse{thisedtext@\the\@edtext@level}}}%
+ {}%
+ {\write@lemma}%
+ }%
\flag@start@RTL%
+ \IfStrEq{\xabslineref{edtext:start:\csuse{thisedtext@\the\@edtext@level}}}%
+ {000}%
+ {}%
+ {%
+ \ifnumequal%
+ {\xabslineref{edtext:start:\csuse{thisedtext@\the\@edtext@level}}}%
+ {\xabslineref{edtext:end:\csuse{thisedtext@\the\@edtext@level}}}%
+ {\write@lemma}%
+ {}%
+ }%
\else%
\flag@start%
+ \write@lemma%
\fi%
- \if@lemmacommand@%
- \ifledRcol%
- \write\linenum@outR{\string\@lemma}%
- \else%
- \write\linenum@out{\string\@lemma}%
- \fi%
- \fi%
\endgroup%
\ifdef{\hypertarget}%
{%
@@ -1760,6 +1774,15 @@
\newcommand{\@lemma}{%
\booltrue{lemmacommand@\the\@edtext@level}%
}%
+\newcommand{\write@lemma}{%
+ \if@lemmacommand@%
+ \ifledRcol%
+ \write\linenum@outR{\string\@lemma}%
+ \else%
+ \write\linenum@out{\string\@lemma}%
+ \fi%
+ \fi%
+}%
\newif\if@lemmacommand@%
\newcommand*{\linenum}[1]{%
\xdef\@tempa{#1|||||||\noexpand\\\l@d@nums}%
@@ -2283,8 +2306,8 @@
\hb@xt@ \z@{\hskip\@tempdima\kern\ledrsnotesep\box\l@drp@rbox\hss}%
}%
-\newcommand*{\ledllfill}{\hfil}
-\newcommand*{\ledrlfill}{}
+\newcommand*{\ledllfill}{\unless\if@RTL\hfil\fi}%
+\newcommand*{\ledrlfill}{\if@RTL\hfil\fi}%
\newcommand*{\getline@num}{%
\global\advance\absline@num \@ne%
@@ -3873,7 +3896,7 @@
{\numdef{\tmp}{0}}%
\istwofollowinglines@false%
\ifnumequal{#4-#2}{1}%
- {\istwofollowinglines@true}%
+ {\istwofollowinglines@true}%%
{\ifbypage@%
\ifnumequal{#3-#1}{1}%
{%
@@ -3885,7 +3908,9 @@
\fi%
}%
}%
+\newcount\printlines@count%
\def\printlines#1|#2|#3|#4|#5|#6|#7|#8|{%
+ \global\advance\printlines@count by 1%
\begingroup%
\setprintlines{#1}{#2}{#3}{#4}{#5}{#6}%
\ifdimequal{\csuse{Xboxstartlinenum@\@currentseries}}{0pt}%
@@ -3895,10 +3920,22 @@
{\@annot@start@print}%
{}%
\ifl@d@pnum%
- \wrap@edcrossref{\@this@crossref@start}{#1}%
- \ifl@d@Xlinenumber%
- \csuse{Xpagelinesep@\@currentseries}%
- \fi%
+ \iftoggle{Xnopagenumberifcurrent@\@currentseries}{%
+ \edlabel{printlines@\the\printlines@count}%
+ }{}%
+ \ifboolexpr{%
+ not test{\ifnumequal{\xpageref{printlines@\the\printlines@count}}{#1}}%
+ or not togl{Xnopagenumberifcurrent@\@currentseries}%
+ }%
+ {%
+ \csuse{Xbeforepagenumber@\@currentseries}%
+ \wrap@edcrossref{\@this@crossref@start}{%
+ #1%
+ }%
+ \ifl@d@Xlinenumber%
+ \csuse{Xpagelinesep@\@currentseries}%
+ \fi%
+ }{}%
\fi%
\ifl@d@Xlinenumber%
\wrap@edcrossref{\@this@crossref@start}{%
@@ -3920,9 +3957,9 @@
\ifl@d@Xtwolines%
\ifl@d@Xlinenumber%
\ifl@d@Xmorethantwolines%
- \csuse{Xmorethantwolines@\@currentseries}%
+ \wrap@edcrossref{\@this@crossref@end}{\csuse{Xmorethantwolines@\@currentseries}}%
\else%
- \csuse{Xtwolines@\@currentseries}%
+ \wrap@edcrossref{\@this@crossref@end}{\csuse{Xtwolines@\@currentseries}}%
\fi%
\fi%
\else%
@@ -3937,8 +3974,16 @@
{\@annot@end@print}%
{}%
\ifl@d@pnum%
- \wrap@edcrossref{\@this@crossref@end}{#4}%
- \csuse{Xpagelinesep@\@currentseries}%
+ \ifboolexpr{%
+ not test{\ifnumequal{\xpageref{printlines@\the\printlines@count}}{#4}}%
+ or not togl{Xnopagenumberifcurrent@\@currentseries}%
+ }{%
+ \csuse{Xbeforepagenumber@\@currentseries}%
+ \wrap@edcrossref{\@this@crossref@end}{%
+ #4%
+ }%
+ \csuse{Xpagelinesep@\@currentseries}%
+ }{}%
\fi%
\ifl@d@Xlinenumber%
\ifl@d@elin%
@@ -5304,9 +5349,9 @@
\ifl@d@Xtwolines%
\ifl@d@Xendlinenumber%
\ifl@d@Xmorethantwolines%
- \csuse{Xendmorethantwolines@\@currentseries}%
+ \wrap@edcrossref{\@this@crossref@end}{\csuse{Xendmorethantwolines@\@currentseries}}%
\else%
- \csuse{Xendtwolines@\@currentseries}%
+ \wrap@edcrossref{\@this@crossref@end}{\csuse{Xendtwolines@\@currentseries}}%
\fi%
\fi%
\else%
@@ -5448,6 +5493,8 @@
\newtoggle{Xnolinenumberifannotation@#1}%
\csgdef{Xbeforenumber@#1}{0pt}%
\csgdef{Xtxtbeforenumber@#1}{}%
+ \newtoggle{Xnopagenumberifcurrent@#1}%
+ \csgdef{Xbeforepagenumber@#1}{}%
\csgdef{Xafternumber@#1}{0.5em}%
\newtoggle{Xnonbreakableafternumber@#1}%
\csgdef{Xbeforesymlinenum@#1}{\csuse{Xbeforenumber@#1}}%
@@ -5947,6 +5994,8 @@
\newhookcommand@series{Xsymlinenumannotation}%
\newhookcommand@series{Xbeforenumber}
\newhookcommand@series{Xtxtbeforenumber}
+ \newhooktoggle@series{Xnopagenumberifcurrent}%
+ \newhookcommand@series{Xbeforepagenumber}%
\newhookcommand@series{Xafternumber}
\newhookcommand@series{Xbeforesymlinenum}
\newhookcommand@series{Xaftersymlinenum}
@@ -8051,10 +8100,14 @@
}%
}%
}%
-\xdef\stanza@hang{\noexpand\leavevmode\noexpand\startlock
- \hangindent\expandafter
- \noexpand\csname sza@0@\endcsname\stanzaindentbase
- \hangafter\@ne}
+
+\def\stanza@hang{%
+ \leavevmode\startlock%
+ \hangindent\if@RTL-\fi\expandafter%
+ \csname sza@0@\endcsname\stanzaindentbase%
+ \hangafter\@ne%
+}%
+
\def\sza@penalty{\count@\csname szp@\number\stanza@count @\endcsname
\ifnum\count@>\@M\advance\count@-\@M\penalty-\else
\penalty\fi\count@}
@@ -8069,8 +8122,14 @@
\def\noexpand\stanza@hang{\unexpanded{\leavevmode\null}}%
\let\noexpand\endlock\relax%
\noexpand\else%
- \interlinepenalty%
- \@M\rightskip\z@ plus 1fil\relax%
+ \interlinepenalty\@M%
+ \unexpanded{%
+ \ifboolexpr{bool {@RTL} and bool{xetex}}{%
+ \leftskip\z@ plus 1fil\relax%
+ }{%
+ \rightskip\z@ plus 1fil\relax%
+ }%
+ }%
\noexpand\fi%
\noexpand\ifnum\expandafter\noexpand\csname szp@0@\endcsname=\z@%
\let\noexpand\sza@penalty%