diff options
author | Karl Berry <karl@freefriends.org> | 2017-05-04 22:15:11 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-05-04 22:15:11 +0000 |
commit | 0d739ae3dc202302661cc0325561e1e745aea898 (patch) | |
tree | 7048783cc490ae1e34ca38c3c243003bebba7152 /Master/texmf-dist/tex/latex/reledmac/reledpar.sty | |
parent | 06ecc9f9415924da0dc43ceffdcf0e970c745ad9 (diff) |
reledmac (4may17)
git-svn-id: svn://tug.org/texlive/trunk@44196 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/reledmac/reledpar.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/reledmac/reledpar.sty | 163 |
1 files changed, 133 insertions, 30 deletions
diff --git a/Master/texmf-dist/tex/latex/reledmac/reledpar.sty b/Master/texmf-dist/tex/latex/reledmac/reledpar.sty index e1f0f7648f4..0e7091efa6a 100644 --- a/Master/texmf-dist/tex/latex/reledmac/reledpar.sty +++ b/Master/texmf-dist/tex/latex/reledmac/reledpar.sty @@ -29,7 +29,7 @@ \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{reledpar}[2017/04/28 v2.17.4 reledmac extension for parallel texts]% +\ProvidesPackage{reledpar}[2017/05/04 v2.18.0 reledmac extension for parallel texts]% \RequirePackage{xspace}% \RequirePackage{xkeyval} @@ -854,8 +854,8 @@ \let\pend\pendL \let\memorydump\memorydumpL \Leftsidehook - \let\old@startstanza\@startstanza - \def\@startstanza[##1]{\global\instanzaLtrue\old@startstanza[##1]} + \let\old@startstanza\@startstanza% + \def\@startstanza[##1][##2]{\global\instanzaLtrue\old@startstanza[##1][##2]}% }{ \expandafter\ifvoid\csname l@dLcolrawbox1\endcsname% \led@error@missing@numbering{Leftside}% @@ -883,8 +883,8 @@ \let\lednopb\lednopbR \let\lineation\lineationR \Rightsidehook - \let\old@startstanza\@startstanza - \def\@startstanza[##1]{\global\instanzaRtrue\old@startstanza[##1]} + \let\old@startstanza\@startstanza% + \def\@startstanza[##1][##2]{\global\instanzaRtrue\old@startstanza[##1][##2]}% }{% \ledRcolfalse \expandafter\ifvoid\csname l@dRcolrawbox1\endcsname% @@ -902,7 +902,7 @@ \newcounter{pstartR} \renewcommand{\thepstartR}{{\bfseries\@arabic\c@pstartR}. } -\newcommandx*{\pstartL}[1][1]{% +\newcommandx*{\pstartL}[2][1,2,usedefault]{% \if@nobreak% \let\@oldnobreak\@nobreaktrue% \else% @@ -943,17 +943,39 @@ \fi% \fi% \fi% + \@at@start@every@pstart% \hsize=\Lcolwidth% \numberedpar@true% \iflabelpstart\protected@edef\@currentlabel% {\p@pstartL\thepstartL}\fi% - \ifstrempty{#1}% - {\csgdef{before@pstartL@\the\l@dnumpstartsL}{\at@every@pstart}}% - {\csgdef{before@pstartL@\the\l@dnumpstartsL}{\noindent#1}}% + \providetoggle{before@pstartL@\the\l@dnumpstartsL @par}% + \ifboolexpr{% + test {\ifstrempty{#1}}% + and test {\ifstrempty{#2}}% + }% + {% + \ifat@every@pstart@star@% + \global\togglefalse{before@pstartL@\the\l@dnumpstartsL @par}% + \else% + \global\toggletrue{before@pstartL@\the\l@dnumpstartsL @par}% + \fi% + \csgdef{before@pstartL@\the\l@dnumpstartsL}{\at@every@pstart}% + }% + {% + \ifstrempty{#1}{}{% + \global\toggletrue{before@pstartL@\the\l@dnumpstartsL @par}% + \csgdef{before@pstartL@\the\l@dnumpstartsL}{\noindent#1}% + }% + \ifstrempty{#2}{}% + {% + \csgdef{before@pstartL@\the\l@dnumpstartsL}{#2}% + \global\togglefalse{before@pstartL@\the\l@dnumpstartsL @par}% + }% + }% \at@every@pstart@call% \ignorespaces% } -\newcommandx*{\pstartR}[1][1]{% +\newcommandx*{\pstartR}[2][1,2,usedefault]{% \if@nobreak% \let\@oldnobreak\@nobreaktrue% \else% @@ -993,23 +1015,46 @@ \fi% \fi% \fi% + \@at@start@every@pstart% \hsize=\Rcolwidth% \numberedpar@true% \iflabelpstart\protected@edef\@currentlabel% {\p@pstartR\thepstartR}\fi% - \ifstrempty{#1}% - {\csgdef{before@pstartR@\the\l@dnumpstartsR}{\at@every@pstart}}% - {\csgdef{before@pstartR@\the\l@dnumpstartsR}{\noindent#1}}% + \providetoggle{before@pstartR@\the\l@dnumpstartsR @par}% + \ifboolexpr{% + test {\ifstrempty{#1}}% + and test {\ifstrempty{#2}}% + }% + {% + \ifat@every@pstart@star@% + \global\togglefalse{before@pstartR@\the\l@dnumpstartsR @par}% + \else% + \global\toggletrue{before@pstartR@\the\l@dnumpstartsR @par}% + \fi% + \csgdef{before@pstartR@\the\l@dnumpstartsR}{\at@every@pstart}% + }% + {% + \ifstrempty{#1}{}{% + \global\toggletrue{before@pstartR@\the\l@dnumpstartsR @par}% + \csgdef{before@pstartR@\the\l@dnumpstartsR}{\noindent#1}% + }% + \ifstrempty{#2}{}% + {% + \csgdef{before@pstartR@\the\l@dnumpstartsR}{#2}% + \global\togglefalse{before@pstartR@\the\l@dnumpstartsR @par}% + }% + }% \at@every@pstart@call% \ignorespaces% } -\newcommandx*{\pendL}[1][1]{% +\newcommandx*{\pendL}[2][1,2,usedefault]{% \ifnumbering \else% \led@err@PendNotNumbered% \fi% \ifnumberedpar@ \else% \led@err@PendNoPstart% \fi% + \@at@end@every@pend% \endgraf\global\num@lines=\prevgraf\egroup% \global\par@line=0% \endgroup% @@ -1020,17 +1065,39 @@ \addtocounter{pstartL}{1}% \fi \parledgroup@beforenotes@save{L}% - \ifstrempty{#1}% - {\csgdef{after@pendL@\the\l@dnumpstartsL}{\at@every@pend}}% - {\csgdef{after@pendL@\the\l@dnumpstartsL}{\noindent#1}}% - } -\newcommandx*{\pendR}[1][1]{% + \providetoggle{after@pendL@\the\l@dnumpstartsL @par}% + \ifboolexpr{% + test {\ifstrempty{#1}}% + and test {\ifstrempty{#2}}% + }% + {% + \ifat@every@pend@star@% + \global\togglefalse{after@pendL@\the\l@dnumpstartsL @par}% + \else% + \global\toggletrue{after@pendL@\the\l@dnumpstartsL @par}% + \fi% + \csgdef{after@pendL@\the\l@dnumpstartsL}{\at@every@pend}% + }% + {% + \ifstrempty{#1}{}{% + \global\toggletrue{after@pendL@\the\l@dnumpstartsL @par}% + \csgdef{after@pendL@\the\l@dnumpstartsL}{\noindent#1}% + }% + \ifstrempty{#2}{}% + {% + \csgdef{after@pendL@\the\l@dnumpstartsL}{#2}% + \global\togglefalse{after@pendL@\the\l@dnumpstartsL @par}% + }% + }% +}% +\newcommandx*{\pendR}[2][1,2,usedefault]{% \ifnumberingR \else% \led@err@PendNotNumbered% \fi% \ifnumberedpar@ \else% \led@err@PendNoPstart% \fi% + \@at@end@every@pend% \endgraf\global\num@linesR=\prevgraf\egroup% \global\par@lineR=0% \endgroup% @@ -1041,9 +1108,28 @@ \addtocounter{pstartR}{1}% \fi% \parledgroup@beforenotes@save{R}% - \ifstrempty{#1}% - {\csgdef{after@pendR@\the\l@dnumpstartsR}{\at@every@pend}}% - {\csgdef{after@pendR@\the\l@dnumpstartsR}{\noindent#1}}% + \providetoggle{after@pendR@\the\l@dnumpstartsR @par}% + \ifboolexpr{% + test {\ifstrempty{#1}}% + and test {\ifstrempty{#2}}% + }% + {% + \ifat@every@pend@star@% + \global\togglefalse{after@pendR@\the\l@dnumpstartsR @par}% + \else% + \global\toggletrue{after@pendR@\the\l@dnumpstartsR @par}% + \fi% + \csgdef{after@pendR@\the\l@dnumpstartsR}{\at@every@pend}}% + {% + \ifstrempty{#1}{}{% + \csgdef{after@pendR@\the\l@dnumpstartsR}{\noindent#1}% + \global\toggletrue{after@pendR@\the\l@dnumpstartsR @par}% + }% + \ifstrempty{#2}{}{% + \csgdef{after@pendR@\the\l@dnumpstartsR}{#2}% + \global\togglefalse{after@pendR@\the\l@dnumpstartsR @par}% + }% + }% } \newcommand{\AtEveryPstartCall}[1]{\gdef\at@every@pstart@call{#1}}% @@ -1899,7 +1985,7 @@ \chardef\next=\catcode`\& \catcode`\&=\active -\newenvironment{astanza}[1][]{% +\newenvironment{astanza}[2][1,2,usedefault]{% \catcode`\&\active \global\stanza@count\@ne\stanza@modulo\@ne \ifnum\usenamecount{sza@0@}=\z@ @@ -1917,18 +2003,25 @@ \global\advance\stanza@count\@ne \@astanza@line}% \def\&{\@stopastanza}% - \ifboolexpr{not test{\ifdefvoid{\at@every@stanza}} and test{\ifstrempty{#1}}}% - {\pstart[\at@every@stanza]}% - {\pstart[#1]}% + \ifboolexpr{% + not test{\ifdefvoid{\at@every@stanza}}% + and test{\ifstrempty{#1}}% + and test{\ifstrempty{#2}}}% + {\pstart[][\at@every@stanza]\at@start@every@stanza}% + {\pstart[#1][#2]\at@start@every@stanza}% \@astanza@line \let\par\relax\ignorespaces%No paragraph in verses }{} -\newcommandx{\@stopastanza}[1][1,usedefault]{% +\newcommandx{\@stopastanza}[2][1,2,usedefault]{% \endlock\mbox{}% - \ifboolexpr{not test{\ifdefvoid{\at@every@stop@stanza}} and test{\ifstrempty{#1}}}% - {\pend[\at@every@stop@stanza]}% - {\pend[#1]}% + \ifboolexpr{% + not test{\ifdefvoid{\at@every@stop@stanza}}% + and test{\ifstrempty{#1}}% + and test{\ifstrempty{#2}}% + }% + {\before@every@stop@stanza\pend[][\at@every@stop@stanza]}% + {\before@every@stop@stanza\pend[#1][#2]}% }% \newcommand*{\@astanza@line}{% \ifnum\value{stanzaindentsrepetition}=0 @@ -2369,6 +2462,10 @@ and test {\ifdefempty{\at@every@pstart}}}% {}% {% + \ifboolexpr{not togl{before@pstartR@\the\l@dpscR @par} and not togl{before@pstartL@\the\l@dpscL @par}}{% + \csuse{before@pstartL@\the\l@dpscL}% + \csuse{before@pstartR@\the\l@dpscR}% + }{% \hb@xt@ \hsize{% \ifdefstring{\columns@position}{L}{}{\hfill }% \par\parbox[t][][t]{\Lcolwidth}{% @@ -2381,6 +2478,7 @@ }% \ifdefstring{\columns@position}{R}{}{\hfill}% }% + }% }% \global\csundef{before@pstartL@\the\l@dpscL}% \global\csundef{before@pstartR@\the\l@dpscR}% @@ -2392,6 +2490,10 @@ and test {\ifdefempty{\at@every@pend}}}% {}% {% + \ifboolexpr{not togl{after@pendR@\the\l@dpscR @par} and not togl{after@pendL@\the\l@dpscL @par}}{% + \csuse{after@pendL@\the\l@dpscL}% + \csuse{after@pendR@\the\l@dpscR}% + }{% \hb@xt@ \hsize{% \ifdefstring{\columns@position}{L}{}{\hfill }% \parbox[t][][t]{\Lcolwidth}{% @@ -2404,6 +2506,7 @@ }% \ifdefstring{\columns@position}{R}{}{\hfill}% }% + }% }% \global\csundef{after@pendL@\the\l@dpscL}% \global\csundef{after@pendR@\the\l@dpscR}% |