diff options
author | Karl Berry <karl@freefriends.org> | 2012-07-12 21:41:28 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-07-12 21:41:28 +0000 |
commit | e3c6e657f396096f4406658bd2917dd46b7aa9f5 (patch) | |
tree | 0b1e7fa2fd386946837ebb17bc3a2f1e5eda3940 /Master/texmf-dist/tex/latex/ledmac/ledmac.sty | |
parent | 9f5608ba2efae21382aa973dc6095686c97b6c0e (diff) |
ledmac (21jun12)
git-svn-id: svn://tug.org/texlive/trunk@27016 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/ledmac/ledmac.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/ledmac/ledmac.sty | 151 |
1 files changed, 108 insertions, 43 deletions
diff --git a/Master/texmf-dist/tex/latex/ledmac/ledmac.sty b/Master/texmf-dist/tex/latex/ledmac/ledmac.sty index 3a9c19cc5fb..a303b951ab0 100644 --- a/Master/texmf-dist/tex/latex/ledmac/ledmac.sty +++ b/Master/texmf-dist/tex/latex/ledmac/ledmac.sty @@ -23,7 +23,7 @@ %% This work consists of the files listed in the README file. %% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{ledmac}[2012/04/04 v0.14 LaTeX port of EDMAC] +\ProvidesPackage{ledmac}[2012/06/21 v0.16 LaTeX port of EDMAC] \newif\ifledfinal \DeclareOption{final}{\ledfinaltrue} @@ -145,6 +145,7 @@ \line@list@stuff{\jobname.\extensionchars\the\section@num}% \l@dend@stuff \setcounter{pstart}{1} + \firstpstarttrue } \newcommand*{\initnumbering@reg}{% \global\pst@rtedLfalse @@ -195,6 +196,7 @@ \fi} \newif\ifbypage@ +\newif\ifbypstart@ \newcommand*{\lineation}[1]{{% \ifnumbering \led@err@LineationInNumbered @@ -202,16 +204,23 @@ \def\@tempa{#1}\def\@tempb{page}% \ifx\@tempa\@tempb \global\bypage@true + \global\bypstart@false \else - \def\@tempb{section}% + \def\@tempb{pstart}% \ifx\@tempa\@tempb \global\bypage@false + \global\bypstart@true \else - \led@warn@BadLineation + \def@tempb{section} + \ifx\@tempa\@tempb + \global\bypage@false + \global\bypstart@false + \else + \led@warn@BadLineation + \fi \fi \fi \fi}} - \newcount\line@margin \newcommand*{\linenummargin}[1]{{% \l@dgetline@margin{#1}% @@ -697,6 +706,8 @@ \fi \flag@end} +\newif\ifnumberline +\numberlinetrue \newcommand*{\set@line}{% \ifx\line@list\empty \global\noteschanged@true @@ -736,9 +747,16 @@ \newcounter{pstart} \renewcommand{\thepstart}{{\bfseries\@arabic\c@pstart}. } \newif\ifnumberpstart +\newif\iffirstpstart +\firstpstarttrue \numberpstartfalse \newcommand*{\pstart}{ -\managehangingsymbol +\ifbypstart@\iffirstpstart + \firstpstartfalse + \else + \setline{0} + \fi +\fi \if@nobreak \let\@oldnobreak\@nobreaktrue \else @@ -756,7 +774,7 @@ \list@clear{\inserts@list}% \global\let\next@insert=\empty \begingroup\normal@pars - \global\setbox\raw@text=\vbox\bgroup\ifautopar\else\ifnumberpstart\ifinstanza\else\thepstart\fi\fi\fi + \global\setbox\raw@text=\vbox\bgroup\ifautopar\else\ifnumberpstart\ifinstanza\else\ifsidepstartnum\else\thepstart\fi\fi\fi\fi \numberedpar@true} \newcommand*{\pend}{\ifnumbering \else \led@err@PendNotNumbered @@ -764,9 +782,6 @@ \ifnumberedpar@ \else \led@err@PendNoPstart \fi -\ifnumberpstart -\addtocounter{pstart}{1} -\fi \l@dzeropenalties \endgraf\global\num@lines=\prevgraf\egroup \global\par@line=0 @@ -776,6 +791,10 @@ \flush@notes \endgroup \ignorespaces + \ifnumberpstart +\addtocounter{pstart}{1} +\pstartnumtrue +\fi \@oldnobreak} \newcommand*{\l@dzeropenalties}{% @@ -815,11 +834,13 @@ \unvbox\one@line \global\setbox\one@line=\lastbox \getline@num \affixline@num - \hb@xt@ \linewidth{\l@dld@ta\add@inserts\affixside@note + \affixpstart@num + \hb@xt@ \linewidth{\inserthangingsymbol\l@dld@ta\add@inserts\affixside@note \l@dlsn@te {\ledllfill\hb@xt@ \wd\one@line{\new@line\l@dunhbox@line{\one@line}}\ledrlfill\l@drd@ta% \l@drsn@te - }} + }}% + \prevline@num=\line@num% \add@penalties} \newcommand*{\do@linehook}{} @@ -837,9 +858,12 @@ \newcommand*{\ledrlfill}{} \newcommand*{\getline@num}{% - \global\advance\absline@num \@ne + \ifnumberline + \global\advance\absline@num \@ne + \fi \do@actions \do@ballast + \ifnumberline \ifsublines@ \ifnum\sub@lock<\tw@ \global\advance\subline@num \@ne @@ -849,8 +873,9 @@ \global\advance\line@num \@ne \global\subline@num \z@ \fi - \fi} - + \fi + \fi + } \newcount\ballast@count \newcounter{ballast} \setcounter{ballast}{0} @@ -925,6 +950,7 @@ \fi} \newcommand*{\affixline@num}{% +\ifnumberline \ifl@dskipnumber \global\l@dskipnumberfalse \else @@ -984,7 +1010,9 @@ %% #1% \fi \f@x@l@cks -\fi} +\fi +\fi +} \newcommand*{\ch@cksub@l@ck}{% \ifcase\sub@lock @@ -1032,6 +1060,45 @@ \newcommand{\pageparbreak}{\pend\newpage\pstart\noindent} + +\newif\ifsidepstartnum +\newcommand*{\affixpstart@num}{% + \ifsidepstartnum + \if@twocolumn + \if@firstcolumn + \gdef\l@dld@ta{\llap{{\leftpstartnum}}}% + \else + \gdef\l@drd@ta{\rlap{{\rightpstartnum}}}% + \fi + \else + \@l@dtempcntb=\line@margin + \ifnum\@l@dtempcntb>\@ne + \advance\@l@dtempcntb \page@num + \fi + \ifodd\@l@dtempcntb + \gdef\l@drd@ta{\rlap{{\rightpstartnum}}}% + \else + \gdef\l@dld@ta{\llap{{\leftpstartnum}}}% + \fi + \fi + \fi + +} + +\newif\ifpstartnum +\pstartnumtrue +\newcommand*{\leftpstartnum}{ + \ifpstartnum\thepstart + \kern\linenumsep\fi + \global\pstartnumfalse +} +\newcommand*{\rightpstartnum}{ + \ifpstartnum + \kern\linenumsep + \thepstart + \fi + \global\pstartnumfalse +} \list@create{\inserts@list} \newcommand*{\add@inserts}{% \global\let\add@inserts@next=\relax @@ -1274,6 +1341,17 @@ \fi \fi} \def\printlines#1|#2|#3|#4|#5|#6|#7|{\begingroup + \ifbypstart@% + \ifl@dpairing% + \ifledRcol% + \thepstartR% + \else% + \thepstartL% + \fi% + \else% + \thepstart% + \fi% + \fi% \setprintlines{#1}{#2}{#3}{#4}{#5}{#6}% \ifl@d@pnum #1\fullstop\fi \ifledplinenum \linenumrep{#2}\else \symplinenum\fi @@ -1393,6 +1471,7 @@ \interparanoteglue{1em plus.4em minus.4em} \newcommand*{\parafootfmt}[3]{% + \insertparafootftmsep% \ledsetnormalparstuff {\notenumfont\printlines#1|}\enspace {\select@lemmafont#1|#2}\rbracket\enskip @@ -1425,6 +1504,14 @@ \newcommand*{\removehboxes}{\setbox0=\lastbox \ifhbox0{\removehboxes}\unhbox0 \fi} +\newcommand{\parafootftmsep}{} +\newcount\prevpage@num +\newcommand{\insertparafootftmsep}{% + \ifnum\prevpage@num=\page@num% + \parafootftmsep% + \fi% + \global\prevpage@num=\page@num% +} \newcount\@k \newdimen\@h \newcommand*{\rigidbalance}[3]{\setbox0=\box#1 \@k=#2 \@h=#3 \@@line{\splittopskip=\@h \vbadness=\@M \hfilneg @@ -1920,9 +2007,9 @@ \newcommand*{\ledlsnotefontsetup}{\raggedleft\footnotesize} \newcommand*{\ledrsnotefontsetup}{\raggedright\footnotesize} -\newcommand*{\ledleftnote}[1]{\setcounter{hboxmodulo}{-1}\edtext{}{\l@dlsnote{#1}}} -\newcommand*{\ledrightnote}[1]{\setcounter{hboxmodulo}{-1}\edtext{}{\l@drsnote{#1}}} -\newcommand*{\ledsidenote}[1]{\setcounter{hboxmodulo}{-1}\edtext{}{\l@dcsnote{#1}}} +\newcommand*{\ledleftnote}[1]{\edtext{}{\l@dlsnote{#1}}} +\newcommand*{\ledrightnote}[1]{\edtext{}{\l@drsnote{#1}}} +\newcommand*{\ledsidenote}[1]{\edtext{}{\l@dcsnote{#1}}} \newif\ifrightnoteup \rightnoteuptrue @@ -2304,6 +2391,7 @@ \penalty0}} \newcommand*{\parafootfmtX}[2]{% + \insertparafootftmsep \ledsetnormalparstuff {\notenumfont\@nameuse{footfootmark#1}\strut%\enspace #2\penalty-10}} @@ -2595,33 +2683,10 @@ } \newcommand*{\hangingsymbol}{} -\newcounter{hbox} -\newcounter{hboxmodulo} -\newif\ifhangingsymbol -\hangingsymbolfalse \newif\ifinstanza \instanzafalse -\newcommand{\managehangingsymbol}{\ifinstanza% - \setcounter{hbox}{0}% - \setcounter{hboxmodulo}{0}% - \everyhbox{% -\ifnum \value{hbox}>2% - \addtocounter{hboxmodulo}{1}% - \ifnum \value{hboxmodulo}=2 - \ifhangingsymbol% - \hangingsymbol% - \hangingsymbolfalse% - \else% - \hangingsymboltrue% - \fi% - \setcounter{hboxmodulo}{0}% - \fi% -\else% -\addtocounter{hbox}{1}% -\fi% -} -\fi} - +\newcount\prevline@num +\newcommand{\inserthangingsymbol}{\ifinstanza\ifnum\line@num=\prevline@num\hfill\hangingsymbol\fi\fi} \newcommand*{\ampersand}{\char`\&} \chardef\body=\catcode`\@ |