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/eledmac.sty | |
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/eledmac.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/eledmac/eledmac.sty | 91 |
1 files changed, 88 insertions, 3 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'. |