diff options
author | Karl Berry <karl@freefriends.org> | 2015-02-23 22:44:10 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-02-23 22:44:10 +0000 |
commit | b860a122b3f401880629bd012909c84ca7d8ce5d (patch) | |
tree | e1ea654861ea23a0c20d9bd2aab4919c2d82245c /Master/texmf-dist/tex/latex/eledmac/eledpar.sty | |
parent | d2042950476abfbb4b757f512dee4152811c1ca7 (diff) |
eledmac (23feb15)
git-svn-id: svn://tug.org/texlive/trunk@36361 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/eledmac/eledpar.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/eledmac/eledpar.sty | 145 |
1 files changed, 83 insertions, 62 deletions
diff --git a/Master/texmf-dist/tex/latex/eledmac/eledpar.sty b/Master/texmf-dist/tex/latex/eledmac/eledpar.sty index 9b3a569cebf..94766b8c597 100644 --- a/Master/texmf-dist/tex/latex/eledmac/eledpar.sty +++ b/Master/texmf-dist/tex/latex/eledmac/eledpar.sty @@ -23,7 +23,7 @@ %% This work consists of the files listed in the README file. %% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{eledpar}[2015/01/23 v1.11.0 eledmac extension for parallel texts]% +\ProvidesPackage{eledpar}[2015/02/23 v1.12.0 eledmac extension for parallel texts]% \newif\ifshiftedpstarts \let\shiftedversestrue\shiftedpstartstrue @@ -702,6 +702,31 @@ \fi \fi} + +\list@create{\list@pstartL@pc}% +\list@create{\list@pstartR@pc}% +\def\dump@pstartL@pc{% + \xright@appenditem{\the\c@pstartL}\to\list@pstartL@pc% + \global\cslet{numberpstart@L\the\l@dnumpstartsL}{\ifnumberpstart}% +}% + +\def\dump@pstartR@pc{% + \xright@appenditem{\the\c@pstartR}\to\list@pstartR@pc% + \global\cslet{numberpstart@R\the\l@dnumpstartsR}{\ifnumberpstart}% +}% + +\def\restore@pstartL@pc{% + \ifx\list@pstartL@pc\empty\else% + \gl@p\list@pstartL@pc\to\@temp% + \global\c@pstartL=\@temp% + \fi% +}% +\def\restore@pstartR@pc{% + \ifx\list@pstartR@pc\empty\else% + \gl@p\list@pstartR@pc\to\@temp% + \global\c@pstartR=\@temp% + \fi% +}% \newenvironment{pairs}{%} \l@dpairingtrue \l@dpagingfalse @@ -777,10 +802,8 @@ \newcount\par@lineR \newcounter{pstartL} -\newcounter{pstartLold} \renewcommand{\thepstartL}{{\bfseries\@arabic\c@pstartL}. } \newcounter{pstartR} -\newcounter{pstartRold} \renewcommand{\thepstartR}{{\bfseries\@arabic\c@pstartR}. } \newcommandx*{\pstartL}[1][1]{% @@ -790,6 +813,9 @@ \let\@oldnobreak\@nobreakfalse% \fi% \@nobreaktrue% + \ifluatex% + \xdef\l@luatextextdir@L{\the\luatextextdir}% + \fi% \ifnumbering \else% \led@err@PstartNotNumbered% \beginnumbering% @@ -799,7 +825,6 @@ \pend% \fi% \ifpst@rtedL\else% - \setcounter{pstartLold}{\value{pstartL}}% \list@clear{\inserts@list}% \global\let\next@insert=\empty% \global\pst@rtedLtrue% @@ -834,6 +859,9 @@ \let\@oldnobreak\@nobreakfalse% \fi% \@nobreaktrue% + \ifluatex% + \xdef\l@luatextextdir@R{\the\luatextextdir}% + \fi% \ifnumberingR \else% \led@err@PstartNotNumbered% \beginnumberingR% @@ -843,7 +871,6 @@ \pendR% \fi% \ifpst@rtedR\else% - \setcounter{pstartRold}{\value{pstartR}}% \list@clear{\inserts@listR}% \global\let\next@insertR=\empty% \global\pst@rtedRtrue% @@ -883,6 +910,7 @@ \endgroup% \ignorespaces% \@oldnobreak% + \dump@pstartL@pc% \ifnumberpstart% \addtocounter{pstartL}{1}% \fi @@ -904,6 +932,7 @@ \endgroup% \ignorespaces% \@oldnobreak% + \dump@pstartR@pc% \ifnumberpstart% \addtocounter{pstartR}{1}% \fi% @@ -929,6 +958,7 @@ \newcount\@donetotallinesR \newcommand*{\do@lineL}{% + \letcs{\ifnumberpstart}{numberpstart@L\the\l@dpscL}% \advance\countLline \@ne \ifvbox\namebox{l@dLcolrawbox\the\l@dpscL}% {\vbadness=10000 @@ -964,7 +994,14 @@ \l@dld@ta %space kept for backward compatibility \add@inserts\affixside@note% \l@dlsn@te %space kept for backward compatibility - {\ledllfill\hb@xt@ \wd\one@line{\do@insidelineLhook\inserthangingsymbolL\new@lineL\l@dunhbox@line{\one@line}}\correcthangingL\ledrlfill\l@drd@ta% + {\ledllfill\hb@xt@ \wd\one@line{% + \do@insidelineLhook% + \ifluatex% + \luatextextdir\l@luatextextdir@L% + \fi% + \new@lineL% + \inserthangingsymbolL% + \l@dunhbox@line{\one@line}}\correcthangingL\ledrlfill\l@drd@ta% \l@drsn@te}} \def\print@eledsectionL{%% @@ -974,7 +1011,13 @@ \numdef{\temp@}{\l@dpscL-1}% \xifinlist{\temp@}{\eled@sections@@}{\@nobreaktrue}{\@nobreakfalse}% \@eled@sectioningtrue% - \csuse{eled@sectioning@\the\l@dpscL}% + \bgroup% + \ifluatex% + \luatextextdir\l@luatextextdir@L% + \luatexpardir\l@luatextextdir@L% + \fi% + \csuse{eled@sectioning@\the\l@dpscL}% + \egroup% \@eled@sectioningfalse% \global\csundef{eled@sectioning@\the\l@dpscL}% \if@RTL% @@ -998,6 +1041,7 @@ \newcommand*{\do@insidelineRhook}{} \newcommand*{\do@lineR}{% + \letcs{\ifnumberpstart}{numberpstart@R\the\l@dpscR}% \ledRcol@true% \advance\countRline \@ne \ifvbox\namebox{l@dRcolrawbox\the\l@dpscR}% @@ -1037,7 +1081,14 @@ \l@dld@ta %space kept for backward compatibility \add@insertsR\affixside@noteR% \l@dlsn@te %space kept for backward compatibility -\correcthangingR\ledllfill\hb@xt@ \wd\one@lineR{\do@insidelineRhook\inserthangingsymbolR\new@lineR\l@dunhbox@line{\one@lineR}}\ledrlfill\l@drd@ta% + \correcthangingR\ledllfill\hb@xt@ \wd\one@lineR{% + \do@insidelineRhook% + \new@lineR% + \inserthangingsymbolR% + \ifluatex% + \luatextextdir\l@luatextextdir@R% + \fi% + \l@dunhbox@line{\one@lineR}}\ledrlfill\l@drd@ta% \l@drsn@te } @@ -1049,7 +1100,13 @@ \numdef{\temp@}{\l@dpscR-1}% \xifinlist{\temp@}{\eled@sectionsR@@}{\@nobreaktrue}{\@nobreakfalse}% \@eled@sectioningtrue% - \csuse{eled@sectioning@\the\l@dpscR R}% + \bgroup% + \ifluatex% + \luatextextdir\l@luatextextdir@R% + \luatexpardir\l@luatextextdir@R% + \fi% + \csuse{eled@sectioning@\the\l@dpscR R}% + \egroup% \@eled@sectioningfalse% \global\csundef{eled@sectioning@\the\l@dpscR R}% \if@RTL% @@ -1389,38 +1446,6 @@ \list@create{\labelref@listR} -\renewcommand*{\edlabel}[1]{% - \ifl@dpairing\ifautopar% - \strut% - \fi\fi% - \@bsphack% - \ifledRcol - \write\linenum@outR{\string\@lab}% - \ifx\labelref@listR\empty - \xdef\label@refs{\zz@@@}% - \else - \gl@p\labelref@listR\to\label@refs - \fi - \ifvmode - \advancelabel@refs - \fi - \protected@write\@auxout{}% - {\string\l@dmake@labelsR\space\thepage|\label@refs|\the\c@pstartR|{#1}}% - \else - \write\linenum@out{\string\@lab}% - \ifx\labelref@list\empty - \xdef\label@refs{\zz@@@}% - \else - \gl@p\labelref@list\to\label@refs - \fi - \ifvmode - \advancelabel@refs - \fi - \protected@write\@auxout{}% - {\string\l@dmake@labels\space\thepage|\label@refs|\the\c@pstart|{#1}}% - \fi - \@esphack} - \def\l@dmake@labelsR#1|#2|#3|#4|#5{% \expandafter\ifx\csname the@label#5\endcsname \relax\else \led@warn@DuplicateLabel{#4}% @@ -1759,9 +1784,8 @@ \newsavebox{\@eledsectionL}% \newsavebox{\@eledsectionR}% \newcommand*{\Columns}{% + \l@dprintingcolumnstrue% \eledsection@correcting@skip=-\baselineskip% Correction for sections' titles - \setcounter{pstartL}{\value{pstartLold}} - \setcounter{pstartR}{\value{pstartRold}} \ifnum\l@dnumpstartsL=\l@dnumpstartsR\else \led@err@BadLeftRightPstarts{\the\l@dnumpstartsL}{\the\l@dnumpstartsR}% \fi @@ -1779,6 +1803,8 @@ \global\pstartnumRtrue \global\advance\l@dpscL \@ne \global\advance\l@dpscR \@ne + \restore@pstartL@pc% + \restore@pstartR@pc% \checkraw@text { \loop\ifaraw@text \l@duselanguage{\theledlanguageL}% @@ -1831,8 +1857,6 @@ \write\linenum@outR{\string\@set[1]} \resetprevline@ \fi - \addtocounter{pstartL}{1} - \addtocounter{pstartR}{1} \repeat \flush@notes \flush@notesR @@ -1841,6 +1865,7 @@ \global\l@dpscR=\z@ \global\l@dnumpstartsL=\z@ \global\l@dnumpstartsR=\z@ + \l@dprintingcolumnsfalse% \ignorespaces \global\instanzaLfalse \global\instanzaRfalse} @@ -1971,9 +1996,8 @@ \newcount\l@dminpagelines \newcommand*{\Pages}{% + \l@dprintingpagestrue% \eledsection@correcting@skip=-2\baselineskip% line correcting for section titles. - \setcounter{pstartL}{\value{pstartLold}} - \setcounter{pstartR}{\value{pstartRold}} \parledgroup@notespacing@set@correction \typeout{} \typeout{*************************** PAGES ***************************} @@ -2011,6 +2035,8 @@ \if@pstarts \global\advance\l@dpscL \@ne \global\advance\l@dpscR \@ne + \restore@pstartL@pc% + \restore@pstartR@pc% \global\@donereallinesL=\z@ \global\@donetotallinesL=\z@ \global\@donereallinesR=\z@ @@ -2052,7 +2078,7 @@ \numpagelinesL \z@ \parledgroup@correction@notespacing@init \clearl@dleftpage }% - \checkpageR + \checkpageR% \l@duselanguage{\theledlanguageR}% { \loop\ifl@dsamepage% \initnumbering@sectcountR @@ -2105,6 +2131,7 @@ \global\l@dnumpstartsR=\z@ \global\instanzaLfalse \global\instanzaRfalse + \l@dprintingpagesfalse% \ignorespaces} \newcommand*{\ledstrutL}{\strut} @@ -2300,21 +2327,18 @@ \ifnum\l@dnumpstartsL>\l@dpscL \writtenlinesLfalse \ifbypstart@ - \ifnum\value{pstartL}<\value{pstartLold} - \else - \global\line@num=0 - \resetprevline@ - \fi + \global\line@num=0% + \resetprevline@% \fi \csuse{after@pendL@\the\l@dpscL}% \global\csundef{after@pendL@\the\l@dpscL}% - \addtocounter{pstartL}{1} - \global\pstartnumtrue \l@dcalc@maxoftwo{\the\usenamecount{l@dmaxlinesinpar\the\l@dpscL}}% {\the\@donetotallinesL}% {\usenamecount{l@dmaxlinesinpar\the\l@dpscL}}% \global\@donetotallinesL \z@ \global\advance\l@dpscL \@ne + \global\pstartnumtrue% + \restore@pstartL@pc% \parledgroup@notes@endL \parledgroup@correction@notespacing@final{L} \else @@ -2338,21 +2362,18 @@ \ifnum\l@dnumpstartsR>\l@dpscR \writtenlinesRfalse \ifbypstart@R - \ifnum\value{pstartR}<\value{pstartRold} - \else - \global\line@numR=0 - \resetprevline@ - \fi + \global\line@numR=0% + \resetprevline@% \fi \csuse{after@pendR@\the\l@dpscR}% \global\csundef{after@pendR@\the\l@dpscR}% - \addtocounter{pstartR}{1} - \global\pstartnumRtrue \l@dcalc@maxoftwo{\the\usenamecount{l@dmaxlinesinpar\the\l@dpscR}}% {\the\@donetotallinesR}% {\usenamecount{l@dmaxlinesinpar\the\l@dpscR}}% \global\@donetotallinesR \z@ \global\advance\l@dpscR \@ne + \global\pstartnumRtrue% + \restore@pstartR@pc% \parledgroup@notes@endR \parledgroup@correction@notespacing@final{R} \else |