diff options
author | Karl Berry <karl@freefriends.org> | 2013-11-09 23:38:16 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-11-09 23:38:16 +0000 |
commit | 9d1f0b004cd5a2bdf8014aef14a0afb6f54c3c06 (patch) | |
tree | 327dd724a3e886e675aec58dcba21b1451078e49 /Master/texmf-dist/tex/latex/eledmac | |
parent | ed47a420cd7d5ffcfc9106fbb61a9e25bc47c577 (diff) |
eledmac (9nov13)
git-svn-id: svn://tug.org/texlive/trunk@32113 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/eledmac')
-rw-r--r-- | Master/texmf-dist/tex/latex/eledmac/eledmac.sty | 91 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/eledmac/eledpar.sty | 102 |
2 files changed, 186 insertions, 7 deletions
diff --git a/Master/texmf-dist/tex/latex/eledmac/eledmac.sty b/Master/texmf-dist/tex/latex/eledmac/eledmac.sty index 3db143e93d6..5061da66731 100644 --- a/Master/texmf-dist/tex/latex/eledmac/eledmac.sty +++ b/Master/texmf-dist/tex/latex/eledmac/eledmac.sty @@ -24,15 +24,17 @@ \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{eledmac}[2013/10/27 v1.6.1 LaTeX port of EDMAC] +\ProvidesPackage{eledmac}[2013/11/08 v1.7.0 LaTeX port of EDMAC] \newif\ifledfinal \newif\ifparapparatus@ \newif\ifnoquotation@ +\newif\iflednopbinverse \parapparatus@false \DeclareOption{noquotation}{\noquotation@true} \DeclareOption{final}{\ledfinaltrue} \DeclareOption{draft}{\ledfinalfalse} \DeclareOption{parapparatus}{\parapparatus@true} +\DeclareOption{nopbinverse}{\lednopbinversetrue} \ExecuteOptions{final} \ProcessOptions*\relax @@ -166,6 +168,9 @@ \global\pst@rtedLfalse \global\l@dnumpstartsL \z@ \global\absline@num \z@ + \gdef\normal@page@break{} + \gdef\l@prev@pb{} + \gdef\l@prev@nopb{} \global\line@num \z@ \global\subline@num \z@ \global\@lock \z@ @@ -581,6 +586,7 @@ \page@num=#1\relax \last@page@num=#1\relax \def\next@page@num{#1}% + \listcsxadd{normal@page@break}{\the\absline@num} \fi} \newcommand*{\@pend}[1]{} @@ -754,7 +760,34 @@ \fi% \fi} -\newcommand*{\new@line}{\write\linenum@out{\string\@l[\the\c@page][\thepage]}} +\newcommand*{\new@line}{% + \IfStrEq{\led@pb@setting}{after}% + {\xifinlistcs{\the\absline@num}{l@prev@nopb}% + {\xifinlistcs{\the\absline@num}{normal@page@break}% + {\numgdef{\@next@page}{\thepage+1}% + \write\linenum@out{\string\@l[\@next@page][\@next@page]}% + }% + {\write\linenum@out{\string\@l[\the\c@page][\thepage]}}% + }% + {\write\linenum@out{\string\@l[\the\c@page][\thepage]}}}% + {}% + \IfStrEq{\led@pb@setting}{before}% + {% +\numdef{\next@absline}{\the\absline@num+1} +\xifinlistcs{\next@absline}{l@prev@nopb}% + {\xifinlistcs{\the\absline@num}{normal@page@break}% + {% + \numgdef{\nc@page}{\c@page+1}% + \write\linenum@out{\string\@l[\nc@page][\nc@page]}% + }% + {\write\linenum@out{\string\@l[\the\c@page][\thepage]}}% + }% + {\write\linenum@out{\string\@l[\the\c@page][\thepage]}}% +}% + {}% + \IfStrEqCase{\led@pb@setting}{{before}{\relax}{after}{\relax}}[\write\linenum@out{\string\@l[\the\c@page][\thepage]}]% +} + \newcommand*{\flag@start}{% \edef\next{\write\linenum@out{% \string\@ref[\the\insert@count][}}% @@ -995,18 +1028,22 @@ \global\setbox\one@line=\vsplit\raw@text to\baselineskip}% \unvbox\one@line \global\setbox\one@line=\lastbox \getline@num + \IfStrEq{\led@pb@setting}{before}{\led@check@pb\led@check@nopb}{} \ifnum\@lock>\@ne \inserthangingsymboltrue \else \inserthangingsymbolfalse \fi + \check@pb@in@verse \affixline@num \affixpstart@num \hb@xt@ \linewidth{\do@insidelinehook\l@dld@ta\add@inserts\affixside@note \l@dlsn@te {\ledllfill\hb@xt@ \wd\one@line{\new@line\inserthangingsymbol\l@dunhbox@line{\one@line}}\ledrlfill\l@drd@ta% \l@drsn@te - }}}% + }} + \IfStrEq{\led@pb@setting}{after}{\led@check@pb\led@check@nopb}{} + }% \newcommand*{\do@linehook}{} \newcommand*{\do@insidelinehook}{} \newcommand*{\l@demptyd@ta}{% @@ -3919,6 +3956,54 @@ \usingedtext +\def\normal@page@break{} +\def\l@prev@pb{} +\def\l@prev@nopb{} +\newcommand{\ledpb}{\write\linenum@out{\string\led@pb}} +\newcommand{\ledpbnum}[1]{\write\linenum@out{\string\led@pbnum{#1}}} +\newcommand{\lednopb}{\write\linenum@out{\string\led@nopb}} +\newcommand{\lednopbnum}[1]{\write\linenum@out{\string\led@nopbnum{#1}}} +\newcommand{\led@pb}{\listcsxadd{l@prev@pb}{\the\absline@num}} +\newcommand{\led@pbnum}[1]{\listcsxadd{l@prev@pb}{#1}} +\newcommand{\led@nopb}{\listcsxadd{l@prev@nopb}{\the\absline@num}} +\newcommand{\led@nopbnum}[1]{\listcsxadd{l@prev@nopb}{#1}} +\def\led@pb@setting{before} +\newcommand{\ledpbsetting}[1]{\gdef\led@pb@setting{#1}} +\newcommand{\led@check@pb}{\xifinlistcs{\the\absline@num}{l@prev@pb}{\pagebreak[4]}{}} +\newcommand{\led@check@nopb}{% + \IfStrEq{\led@pb@setting}{before}{% + \xifinlistcs{\the\absline@num}{l@prev@nopb}% + {\numdef{\abs@prevline}{\the\absline@num-1}% + \xifinlistcs{\abs@prevline}{normal@page@break}% + {\nopagebreak[4]\enlargethispage{\baselineskip}}% + {}}% + {}}% + {}% + {}% + \IfStrEq{\led@pb@setting}{after}{% + \xifinlistcs{\the\absline@num}{l@prev@nopb}{% + \xifinlistcs{\the\absline@num}{normal@page@break}% + {\nopagebreak[4]\enlargethispage{\baselineskip}}% + {}% +}% + {}}% + {}% + {}% +} +\newcommand{\check@pb@in@verse}{% + \ifinstanza\iflednopbinverse\ifinserthangingsymbol% Using stanzas and enabling page breaks in verse control, while on a hanging verse. + \ifnum\page@num=\last@page@num\else%If we have change page + \IfStrEq{\led@pb@setting}{before}{% + \numgdef{\abs@line@verse}{\the\absline@num-1}% + \ledpbnum{\abs@line@verse}% + }{}% + \IfStrEq{\led@pb@setting}{after}{% + \numgdef{\abs@line@verse}{\the\absline@num-1}% + \lednopbnum{\abs@line@verse}% + }{}% + \fi% + \fi\fi\fi% +} \endinput %% %% End of file `eledmac.sty'. diff --git a/Master/texmf-dist/tex/latex/eledmac/eledpar.sty b/Master/texmf-dist/tex/latex/eledmac/eledpar.sty index 358d09e92db..18890617f82 100644 --- a/Master/texmf-dist/tex/latex/eledmac/eledpar.sty +++ b/Master/texmf-dist/tex/latex/eledmac/eledpar.sty @@ -24,7 +24,7 @@ %% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{eledpar}[2013/10/27 v1.4.3 eledmac extension for parallel texts] +\ProvidesPackage{eledpar}[2013/11/08 v1.5.0 eledmac extension for parallel texts] \newif\ifshiftedpstarts \let\shiftedversestrue\shiftedpstartstrue @@ -80,6 +80,9 @@ \global\numberingRtrue \global\advance\section@numR \@ne \global\absline@numR \z@ + \gdef\normal@page@breakR{} + \gdef\l@prev@pbR{} + \gdef\l@prev@nopbR{} \global\line@numR \z@ \global\@lockR \z@ \global\sub@lockR \z@ @@ -158,7 +161,6 @@ \line@list@stuffR{\jobname.\extensionchars\the\section@numR R}% \l@dend@stuff} -%% \changes{v0.11}{2012/06/11}{Lineation can be by pstart (like in eledmac 0.15).} \newif\ifbypage@R \newif\ifbypstart@R \bypage@Rfalse @@ -228,7 +230,10 @@ \ifledRcol \setcounter{sublinenumincrementR}{#1}% \else \setcounter{sublinenumincrement}{#1}% \fi} - +\WithSuffix\newcommand\firstlinenum*[1]{\setcounter{firstlinenumR}{#1}\setcounter{firstlinenum}{#1}} +\WithSuffix\newcommand\linenumincrement*[1]{\setcounter{linenumincrementR}{#1}\setcounter{linenumincrement}{#1}} +\WithSuffix\newcommand\firstsublinenum*[1]{\setcounter{subfirstlinenumR}{#1}\setcounter{subfirstlinenum}{#1}} +\WithSuffix\newcommand\sublinenumincrement*[1]{\setcounter{sublinenumincrementR}{#1}\setcounter{sublinenumincrement}{#1}} \newcommand*{\Rlineflag}{R} \newcommand*{\linenumrepR}[1]{\@arabic{#1}} @@ -371,6 +376,7 @@ \page@num=#1\relax \last@page@num=#1\relax \def\next@page@num{#1}% + \listcsxadd{normal@page@break}{\the\absline@num} \fi \fi} @@ -620,6 +626,8 @@ \fi \fi} +\newcommand*{\new@lineL}{% + \write\linenum@out{\string\@l[\the\c@page][\thepage]}} \newcommand*{\new@lineR}{% \write\linenum@outR{\string\@l[\the\c@page][\thepage]}} \renewcommand*{\flag@start}{% @@ -808,6 +816,8 @@ \let\thepstart\thepstartR \let\pstart\pstartR \let\pend\pendR + \let\ledpb\ledpbR + \let\lednopb\lednopbR \let\lineation\lineationR \Rightsidehook \let\oldstanza\stanza @@ -976,7 +986,7 @@ \add@inserts \affixside@note \l@dlsn@te - {\ledllfill\hb@xt@ \wd\one@line{\do@insidelineLhook\inserthangingsymbolL\new@line\l@dunhbox@line{\one@line}}\correcthangingL\ledrlfill\l@drd@ta% + {\ledllfill\hb@xt@ \wd\one@line{\do@insidelineLhook\inserthangingsymbolL\new@lineL\l@dunhbox@line{\one@line}}\correcthangingL\ledrlfill\l@drd@ta% \l@drsn@te }}% \add@penaltiesL @@ -1755,6 +1765,9 @@ \unhbox\l@drightbox }% \checkraw@text + \checkverseL + \checkverseR + \checkpb@columns \repeat} \@writelinesinparL \@writelinesinparR @@ -1781,6 +1794,27 @@ \global\instanzaLfalse \global\instanzaRfalse} + +\newcommand{\checkpb@columns}{% + \newif\if@pb + \newif\if@nopb + \IfStrEq{\led@pb@setting}{before}{ + \numdef{\next@absline}{\the\absline@num+1}% + \numdef{\next@abslineR}{\the\absline@numR+1}% + \xifinlistcs{\next@absline}{l@prev@pb}{\@pbtrue}{}% + \xifinlistcs{\next@abslineR}{l@prev@pbR}{\@pbtrue}{} + \xifinlistcs{\next@absline}{l@prev@nopb}{\@nopbtrue}{}% + \xifinlistcs{\next@abslineR}{l@prev@nopbR}{\@nopbtrue}{} + }{} + \IfStrEq{\led@pb@setting}{after}{ + \xifinlistcs{\the\absline@num}{l@prev@pb}{\@pbtrue}{}% + \xifinlistcs{\the\absline@numR}{l@prev@pbR}{\@pbtrue}{} + \xifinlistcs{\the\absline@num}{l@prev@nopb}{\@nopbtrue}{}% + \xifinlistcs{\the\absline@numR}{l@prev@nopbR}{\@nopbtrue}{} + }{} +\if@nopb\nopagebreak[4]\enlargethispage{\baselineskip}\fi +\if@pb\pagebreak[4]\fi +} \newcommand*{\columnseparator}{% \smash{\rule[-0.2\baselineskip]{\columnrulewidth}{1.05\baselineskip}}} \newdimen\columnrulewidth @@ -1886,6 +1920,8 @@ \get@nextboxL \checkpageL + \checkverseL + \checkpbL \repeat \ifl@dpagefull \@writelinesonpageL{\the\numpagelinesL}% @@ -1906,6 +1942,8 @@ \fi \get@nextboxR \checkpageR + \checkverseR + \checkpbR \repeat \ifl@dpagefull \@writelinesonpageR{\the\numpagelinesR}% @@ -2010,6 +2048,7 @@ \newif\ifl@dsamepage \l@dsamepagetrue \newif\ifl@dpagefull + \newcommand*{\checkpageL}{% \l@dpagefulltrue \l@dsamepagetrue @@ -2039,6 +2078,51 @@ \l@dpagefulltrue \fi} +\newcommand{\checkpbL}{ + \IfStrEq{\led@pb@setting}{after}{ + \xifinlistcs{\the\absline@num}{l@prev@pb}{\l@dpagefulltrue\l@dsamepagefalse}{} + \xifinlistcs{\the\absline@num}{l@prev@nopb}{\l@dpagefullfalse\l@dsamepagetrue}{} + }{} + \IfStrEq{\led@pb@setting}{before}{ + \numdef{\next@absline}{\the\absline@num+1} + \xifinlistcs{\next@absline}{l@prev@pb}{\l@dpagefulltrue\l@dsamepagefalse}{} + \xifinlistcs{\next@absline}{l@prev@nopb}{\l@dpagefullfalse\l@dsamepagetrue}{} + }{} +} + +\newcommand{\checkpbR}{ + \IfStrEq{\led@pb@setting}{after}{ + \xifinlistcs{\the\absline@numR}{l@prev@pbR}{\l@dpagefulltrue\l@dsamepagefalse}{} + \xifinlistcs{\the\absline@numR}{l@prev@nopbR}{\l@dpagefullfalse\l@dsamepagetrue}{} + }{} + \IfStrEq{\led@pb@setting}{before}{ + \numdef{\next@abslineR}{\the\absline@numR+1} + \xifinlistcs{\next@abslineR}{l@prev@pbR}{\l@dpagefulltrue\l@dsamepagefalse}{} + \xifinlistcs{\next@abslineR}{l@prev@nopbR}{\l@dpagefullfalse\l@dsamepagetrue}{} + }{} +} +\newcommand{\checkverseL}{ +\ifinstanzaL + \iflednopbinverse + \ifinserthangingsymbol + \numgdef{\prev@abslineverse}{\the\absline@num-1} + \IfStrEq{\led@pb@setting}{after}{\lednopbnum{\prev@abslineverse}}{} + \IfStrEq{\led@pb@setting}{before}{\ifnum\numpagelinesL<3\ledpbnum{\prev@abslineverse}\fi}{} + \fi + \fi +\fi +} +\newcommand{\checkverseR}{ +\ifinstanzaR + \iflednopbinverse + \ifinserthangingsymbolR + \numgdef{\prev@abslineverse}{\the\absline@numR-1} + \IfStrEq{\led@pb@setting}{after}{\lednopbnumR{\prev@abslineverse}}{} + \IfStrEq{\led@pb@setting}{before}{\ifnum\numpagelinesR<3\ledpbnumR{\prev@abslineverse}\fi}{} + \fi + \fi +\fi +} \newdimen\ledthegoal \ifshiftedpstarts \newcommand*{\goalfraction}{0.95} @@ -2111,6 +2195,16 @@ \fi \fi} +\def\l@prev@pbR{} +\def\l@prev@nopbR{} +\newcommand{\ledpbR}{\write\linenum@outR{\string\led@pbR}} +\newcommand{\ledpbnumR}[1]{\write\linenum@outR{\string\led@pbnumR{#1}}} +\newcommand{\lednopbR}{\write\linenum@outR{\string\led@nopbR}} +\newcommand{\lednopbnumR}[1]{\write\linenum@outR{\string\led@nopbnumR{#1}}} +\newcommand{\led@pbR}{\listcsxadd{l@prev@pbR}{\the\absline@numR}} +\newcommand{\led@pbnumR}[1]{\listcsxadd{l@prev@pbR}{#1}} +\newcommand{\led@nopbR}{\listcsxadd{l@prev@nopbR}{\the\absline@numR}} +\newcommand{\led@nopbnumR}[1]{\listcsxadd{l@prev@nopbR}{#1}} \endinput %% %% End of file `eledpar.sty'. |