diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/ledmac/ledmac.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/ledmac/ledmac.sty | 224 |
1 files changed, 122 insertions, 102 deletions
diff --git a/Master/texmf-dist/tex/latex/ledmac/ledmac.sty b/Master/texmf-dist/tex/latex/ledmac/ledmac.sty index be073f70fc9..181f0c99acf 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}[2005/03/24 v0.7 LaTeX port of EDMAC] +\ProvidesPackage{ledmac}[2011/08/22 v0.10 LaTeX port of EDMAC] \newif\ifledfinal \DeclareOption{final}{\ledfinaltrue} @@ -508,42 +508,50 @@ \newcommand*{\lock@on}{\futurelet\next\do@lockon} \newcommand*{\do@lockon}{% \ifx\next\lock@off - \global\let\lock@off=\skip@lockoff + \global\let\lock@off=\skip@lockoff \else - \xright@appenditem{\the\absline@num}\to\actionlines@list - \ifsublines@ - \xright@appenditem{-1005}\to\actions@list - \ifcase\sub@lock - \sub@lock \@ne - \else - \sub@lock \z@ - \fi - \else - \xright@appenditem{-1003}\to\actions@list - \ifcase\@lock - \@lock \@ne - \else - \@lock \z@ - \fi - \fi + \do@lockonL + \fi} +\newcommand*{\do@lockonL}{% + \xright@appenditem{\the\absline@num}\to\actionlines@list + \ifsublines@ + \xright@appenditem{-1005}\to\actions@list + \ifnum\sub@lock=\z@ + \sub@lock \@ne + \else + \ifnum\sub@lock=\thr@@ + \sub@lock \@ne + \fi + \fi + \else + \xright@appenditem{-1003}\to\actions@list + \ifnum\@lock=\z@ + \@lock \@ne + \else + \ifnum\@lock=\thr@@ + \@lock \@ne + \fi + \fi \fi} -\newcommand*{\do@lockoff}{% + +\newcommand*{\do@lockoffL}{% \xright@appenditem{\the\absline@num}\to\actionlines@list \ifsublines@ \xright@appenditem{-1006}\to\actions@list \ifnum\sub@lock=\tw@ - \sub@lock \thr@@ + \sub@lock \thr@@ \else - \sub@lock \z@ + \sub@lock \z@ \fi \else \xright@appenditem{-1004}\to\actions@list \ifnum\@lock=\tw@ - \@lock \thr@@ + \@lock \thr@@ \else - \@lock \z@ + \@lock \z@ \fi \fi} +\newcommand*{\do@lockoff}{\do@lockoffL} \newcommand*{\skip@lockoff}{\global\let\lock@off=\do@lockoff} \global\let\lock@off=\do@lockoff @@ -721,7 +729,14 @@ \newcount\num@lines \newbox\one@line \newcount\par@line -\newcommand*{\pstart}{\ifnumbering \else +\newcommand*{\pstart}{ +\if@nobreak +\let\@oldnobreak\@nobreaktrue +\else +\let\@oldnobreak\@nobreakfalse +\fi +\@nobreaktrue +\ifnumbering \else \led@err@PstartNotNumbered \beginnumbering \fi @@ -748,7 +763,8 @@ \repeat \flush@notes \endgroup - \ignorespaces} + \ignorespaces + \@oldnobreak} \newcommand*{\l@dzeropenalties}{% \brokenpenalty \z@ \clubpenalty \z@ @@ -766,23 +782,22 @@ \ignorespaces} \newcommand*{\normal@pars}{\everypar={}\let\par\endgraf} -\newcommand*{\do@line}{% - {\vbadness=10000 \splittopskip=0pt - \do@linehook - \l@demptyd@ta - \global\setbox\one@line=\vsplit\raw@text to\baselineskip}% - \unvbox\one@line \global\setbox\one@line=\lastbox - \getline@num + \newcommand*{\l@dunhbox@line}[1]{\unhbox #1} + \newcommand*{\do@line}{% + {\vbadness=10000 + \splittopskip=\z@ + \do@linehook +\l@demptyd@ta + \global\setbox\one@line=\vsplit\raw@text to\baselineskip}% + \unvbox\one@line \global\setbox\one@line=\lastbox + \getline@num \affixline@num - \hb@xt@ \linewidth{% - \l@dld@ta\add@inserts\affixside@note - \l@dlsn@te% left side note - {\ledllfill - \hb@xt@ \wd\one@line{\new@line\unhbox\one@line}% - \ledrlfill\l@drd@ta% - \l@drsn@te}% right side note - }% - \add@penalties} + \hb@xt@ \linewidth{\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 + }} + \add@penalties} \newcommand*{\do@linehook}{} \newcommand*{\l@demptyd@ta}{% @@ -859,40 +874,32 @@ \do@actions@next} \newcommand*{\do@actions@fixedcode}{% - \ifcase\@l@dtempcnta% %1000 - \or% % 1001 - \global\sublines@true - \or% % 1002 - \global\sublines@false - \or% % 1003 - \ifcase\@lock - \global\@lock=\@ne - \else - \global\@lock=\z@ - \fi - \or% % 1004 - \ifnum\@lock=\tw@ - \global\@lock=\thr@@ - \else - \global\@lock=\z@ - \fi - \or% % 1005 - \ifcase\sub@lock - \global\sub@lock=\@ne - \else - \global\sub@lock=\z@ - \fi - \or% % 1006 - \ifnum\sub@lock=\tw@ - \global\sub@lock=\thr@@ - \else - \global\sub@lock=\z@ - \fi - \or% % 1007 - \l@dskipnumbertrue - \else - \led@warn@BadAction - \fi} + \ifcase\@l@dtempcnta + \or% % 1001 + \global\sublines@true + \or% % 1002 + \global\sublines@false + \or% % 1003 + \global\@lock=\@ne + \or% % 1004 + \ifnum\@lock=\tw@ + \global\@lock=\thr@@ + \else + \global\@lock=\z@ + \fi + \or% % 1005 + \global\sub@lock=\@ne + \or% % 1006 + \ifnum\sub@lock=\tw@ + \global\sub@lock=\thr@@ + \else + \global\sub@lock=\z@ + \fi + \or% % 1007 + \l@dskipnumbertrue + \else + \led@warn@BadAction + \fi} \newcommand*{\affixline@num}{% \ifl@dskipnumber @@ -1875,37 +1882,50 @@ \newcommand*{\ledrightnote}[1]{\edtext{}{\l@drsnote{#1}}} \newcommand*{\ledsidenote}[1]{\edtext{}{\l@dcsnote{#1}}} +\newif\ifrightnoteup + \rightnoteuptrue \newcommand*{\l@dlsnote}[1]{% \ifnumberedpar@ - \xright@appenditem{\noexpand\vl@dlsnote{{\l@d@nums}{\@tag}{#1}}}% + \xright@appenditem{\noexpand\vl@dlsnote{#1}}% \to\inserts@list \global\advance\insert@count \@ne \fi\ignorespaces} \newcommand*{\l@drsnote}[1]{% \ifnumberedpar@ - \xright@appenditem{\noexpand\vl@drsnote{{\l@d@nums}{\@tag}{#1}}}% + \xright@appenditem{\noexpand\vl@drsnote{#1}}% \to\inserts@list \global\advance\insert@count \@ne \fi\ignorespaces} \newcommand*{\l@dcsnote}[1]{% \ifnumberedpar@ - \xright@appenditem{\noexpand\vl@dcsnote{{\l@d@nums}{\@tag}{#1}}}% + \xright@appenditem{\noexpand\vl@dcsnote{#1}}% \to\inserts@list \global\advance\insert@count \@ne \fi\ignorespaces} -\newcommand*{\vl@dlsnote}[1]{\setl@dlp@rbox#1} -\newcommand*{\vl@drsnote}[1]{\setl@drp@rbox#1} -\newcommand*{\vl@dcsnote}[1]{\savel@dcsnote#1} +\newcommand*{\vl@dlsnote}[1]{\setl@dlp@rbox{#1}} +\newcommand*{\vl@drsnote}[1]{\setl@drp@rbox{#1}} +\newcommand*{\vl@dcsnote}[1]{\gdef\l@dcsnotetext{#1}} -\newcommand*{\setl@dlp@rbox}[3]{% +\newcommand*{\setl@dlp@rbox}[1]{% {\parindent\z@\hsize=\ledlsnotewidth\ledlsnotefontsetup - \global\setbox\l@dlp@rbox=\vbox to\z@{\vss#3}}}% aligns on bottom line + \global\setbox\l@dlp@rbox + \ifleftnoteup + =\vbox to\z@{\vss #1}% + \else + =\vbox to 0.70\baselineskip{\strut#1\vss}% + \fi}} %% \global\setbox\l@dlp@rbox=\vbox to\z@{#3\vss}}}% aligns on top line -\newcommand*{\setl@drp@rbox}[3]{% +\newcommand*{\setl@drp@rbox}[1]{% {\parindent\z@\hsize=\ledrsnotewidth\ledrsnotefontsetup - \global\setbox\l@drp@rbox=\vbox to\z@{\vss#3}}} - + \global\setbox\l@drp@rbox + \ifrightnoteup + =\vbox to\z@{\vss#1}% + \else + =\vbox to0.7\baselineskip{\strut#1\vss}% + \fi}} +\newif\ifleftnoteup + \leftnoteuptrue \newcommand*{\savel@dcsnote}[3]{% \gdef\l@dcsnotetext{#3}} @@ -1914,9 +1934,9 @@ \ifx\@templ@d\l@dcsnotetext \else \if@twocolumn \if@firstcolumn - \setl@dlp@rbox{}{}{\l@dcsnotetext}% + \setl@dlp@rbox{\l@dcsnotetext}% \else - \setl@drp@rbox{}{}{\l@dcsnotetext}% + \setl@drp@rbox{\l@dcsnotetext}% \fi \else \@l@dtempcntb=\sidenote@margin @@ -1924,9 +1944,9 @@ \advance\@l@dtempcntb by\page@num \fi \ifodd\@l@dtempcntb - \setl@drp@rbox{}{}{\l@dcsnotetext}% + \setl@drp@rbox{\l@dcsnotetext}% \else - \setl@dlp@rbox{}{}{\l@dcsnotetext}% + \setl@dlp@rbox{\l@dcsnotetext}% \fi \fi \fi} @@ -2315,7 +2335,7 @@ } \newcommand*{\addfootinsX}[1]{% - \footnormalX{#1} + \footnormalX{#1}% \g@addto@macro{\doxtrafeeti}{% \setbox\@outputbox \vbox{% \unvbox\@outputbox @@ -2325,11 +2345,11 @@ \ifvoid\@nameuse{footins#1}\else \insert\@nameuse{footins#1}{\unvbox\@nameuse{footins#1}}\fi}% \g@addto@macro{\l@dfambeginmini}{% - \expandafter\let\csname footnote#1\endcsname=\@nameuse{mpfootnote#1}} + \expandafter\expandafter\expandafter\let\expandafter\expandafter + \csname footnote#1\endcsname \csname mpfootnote#1\endcsname}% \g@addto@macro{\l@dfamendmini}{% - \ifvoid\@nameuse{mpfootins#1}\else\@nameuse{mpfootgroup#1{#1}}}% + \ifvoid\@nameuse{mpfootins#1}\else\@nameuse{mpfootgroup#1}{#1}\fi}% } - \newcommand*{\l@dfeetbeginmini}{\l@dedbeginmini\l@dfambeginmini} \newcommand*{\l@dfeetendmini}{\l@dedendmini\l@dfamendmini} @@ -2756,16 +2776,17 @@ \let\Next=\next \newcommand{\variab}{\relax} -\newcommand{\l@dcheckcols}{% - \ifnum\l@dcolcount=1\relax% +\newcommand*{\l@dcheckcols}{% + \ifnum\l@dcolcount=1\relax \else - \ifnum\l@dampcount=1\relax% + \ifnum\l@dampcount=1\relax \else - \ifnum\l@dcolcount=\l@dampcount\relax% - \led@err@UnequalColumns - \fi% + \ifnum\l@dcolcount=\l@dampcount\relax + \else + \l@d@err@UnequalColumns + \fi \fi - \l@dampcount=\l@dcolcount% + \l@dampcount=\l@dcolcount \fi} \newcommand{\l@dmodforcritext}{% @@ -3232,7 +3253,6 @@ \usingedtext -\InputIfFileExists{ledpatch.sty} \endinput %% |