From bd074a3cb017b7513267c1a7de5d665b2aa21da8 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 12 Jan 2015 22:58:51 +0000 Subject: eledmac (12jan15) git-svn-id: svn://tug.org/texlive/trunk@36040 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/eledmac/eledmac.sty | 198 +++++++++++++++++++----- Master/texmf-dist/tex/latex/eledmac/eledpar.sty | 107 ++++++++----- 2 files changed, 223 insertions(+), 82 deletions(-) (limited to 'Master/texmf-dist/tex/latex/eledmac') diff --git a/Master/texmf-dist/tex/latex/eledmac/eledmac.sty b/Master/texmf-dist/tex/latex/eledmac/eledmac.sty index f3962f31caf..4fb5cd6a17f 100644 --- a/Master/texmf-dist/tex/latex/eledmac/eledmac.sty +++ b/Master/texmf-dist/tex/latex/eledmac/eledmac.sty @@ -25,7 +25,7 @@ \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{eledmac}[2014/12/17 v1.14.2 LaTeX port of EDMAC]% +\ProvidesPackage{eledmac}[2015/01/12 v1.15.0 LaTeX port of EDMAC]% \newif\ifledfinal \newif\ifparapparatus@ \newif\ifnoquotation@ @@ -70,7 +70,7 @@ \newif\ifl@imakeidx \@ifpackageloaded{imakeidx}{\l@imakeidxtrue}{\l@imakeidxfalse} -\ifcsdef{if@RTL}{}{\newif\if@RTL} +\ifdef{\if@RTL}{}{\newif\if@RTL} \newcommand{\eledmac@warning}[1]{\PackageWarning{eledmac}{#1}} \newcommand{\eledmac@error}[2]{\PackageError{eledmac}{#1}{#2}} \newcommand*{\led@err@NumberingStarted}{% @@ -502,7 +502,10 @@ \list@clear{\line@list}% \list@clear{\insertlines@list}% \list@clear{\actionlines@list}% - \list@clear{\actions@list}} + \list@clear{\actions@list}% + \list@clear{\sw@list}% + \list@clear{\sw@list@inedtext}% + }% \newcommand*{\get@linelistfile}[1]{% \InputIfFileExists{#1}{% \global\noteschanged@false @@ -572,7 +575,7 @@ \page@num=#1\relax \last@page@num=#1\relax \def\next@page@num{#1}% - \listcsxadd{normal@page@break}{\the\absline@num} + \listxadd{\normal@page@break}{\the\absline@num} \fi} \newcommand*{\@pend}[1]{} @@ -583,10 +586,10 @@ \newcommand*{\sub@on}{\ifsublines@ \let\sub@change=\relax \else - \def\sub@changes{1}% + \def\sub@change{1}% \fi} \newcommand*{\sub@off}{\ifsublines@ - \def\sub@changes{-1}% + \def\sub@change{-1}% \else \let\sub@change=\relax \fi} @@ -706,10 +709,12 @@ \repeat \begingroup \let\@ref=\dummy@ref + \let\@lopL\@gobble \let\page@action=\relax \let\sub@action=\relax \let\set@line@action=\relax \let\@lab=\relax + \let\@sw\@gobbletwo% #2 \global\endpage@num=\page@num \global\endline@num=\line@num @@ -748,8 +753,8 @@ \newcommand*{\new@line}{% \IfStrEq{\led@pb@setting}{after}% - {\xifinlistcs{\the\absline@num}{l@prev@nopb}% - {\xifinlistcs{\the\absline@num}{normal@page@break}% + {\xifinlist{\the\absline@num}{\l@prev@nopb}% + {\xifinlist{\the\absline@num}{\normal@page@break}% {\numgdef{\@next@page}{\thepage+1}% \write\linenum@out{\string\@nl[\@next@page][\@next@page]}% }% @@ -759,8 +764,8 @@ {}% \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}% + \xifinlist{\next@absline}{\l@prev@nopb}% + {\xifinlist{\the\absline@num}{\normal@page@break}% {\numgdef{\nc@page}{\c@page+1}% \write\linenum@out{\string\@nl[\nc@page][\nc@page]}% }% @@ -842,13 +847,16 @@ \let\edlabel=\@gobble \let\setline=\@gobble \let\advanceline=\@gobble \let\critext=\dummy@text + \let\sameword\sameword@inedtext% \let\edtext=\dummy@edtext \l@dtabnoexpands \morenoexpands} \let\morenoexpands=\relax \newcommand{\@tag}{} +\newif\if@edtext@% \long\def\critext#1#2/{\leavevmode + \@edtext@true% \begingroup \global\renewcommand{\@tag}{\no@expands #1}%% \set@line @@ -869,8 +877,11 @@ \flag@end}% {\if@RTL\flag@start\else\flag@end\fi% With polyglossia, you must track whether the language reads left to right (English) or right to left (Arabic). } + \@edtext@false% + \global\@lemmacommand@false% } \newcommand{\edtext}[2]{\leavevmode + \@edtext@true% \begingroup \global\renewcommand{\@tag}{\no@expands #1}%% \set@line @@ -892,6 +903,8 @@ {\if@RTL\flag@start\else\flag@end\fi% With polyglossia, you must track whether the language reads left to right (English) or right to left (Arabic). }% \global\@noneed@Footnotefalse% + \@edtext@false% + \global\@lemmacommand@false% } \newcommand*{\flag@end}{% @@ -915,7 +928,10 @@ \newcommand*{\edfont@info}{\f@encoding/\f@family/\f@series/\f@shape} -\newcommand*{\lemma}[1]{\global\renewcommand{\@tag}{\no@expands #1}} +\newcommand*{\lemma}[1]{% + \global\@lemmacommand@true% + \global\renewcommand{\@tag}{\no@expands #1}}% +\newif\if@lemmacommand@% \newcommand*{\linenum}[1]{% \xdef\@tempa{#1|||||||\noexpand\\\l@d@nums}% \global\let\l@d@nums=\empty @@ -933,12 +949,104 @@ \fi} \newcommand{\l@d@add}[1]{\xdef\l@d@nums{\l@d@nums#1}} + +\list@create{\sw@list}% +\list@create{\sw@list@inedtext}% +\newcommandx{\sameword}[2][1,usedefault]{\leavevmode% + \unless\ifledRcol% + \csnumgdef{sw@#2}{\csuse{sw@#2}+1}% + \protected@write\linenum@out{}{\string\@sw{#2}{\csuse{sw@#2}}}% + \unless\ifx\sw@list\empty% + \gl@p\sw@list\to\@tempb% + \if@edtext@% + \unless\if@lemmacommand@% + \xright@appenditem{\@tempb}\to\sw@list@inedtext% + \else% + \ifstrequal{#1}{inlemma}{\xright@appenditem{\@tempb}\to\sw@list@inedtext}{}% + \fi% + \fi% + \global\let\@tempb=\undefined% + \fi% + \else% + \csnumgdef{sw@#2@R}{\csuse{sw@#2@R}+1}% + \protected@write\linenum@outR{}{\string\@sw{#2}{\csuse{sw@#2@R}}}% + \unless\ifx\sw@listR\empty% + \gl@p\sw@listR\to\@tempb% + \if@edtext@% + \unless\if@lemmacommand@% + \xright@appenditem{\@tempb}\to\sw@list@inedtextR% + \else% + \ifstrequal{#1}{inlemma}{\xright@appenditem{\@tempb}\to\sw@list@inedtextR}{}% + \fi% + \fi% + \global\let\@tempb=\undefined% + \fi% + \fi% + #2% +}% +\newcommand{\@sw}[2]{% + \unless\ifledRcol% + \csxdef{sw@#1@\the\absline@num @\the\section@num}{#2}% + \numdef{\prev@line}{\the\absline@num-1}% + \ifcsundef{sw@#1@\prev@line @\the\section@num}{% + \csnumgdef{sw@#1@\prev@line @\the\section@num}{#2-1}% + }{}% + \numdef{\the@sw}{#2-\csuse{sw@#1@\prev@line @\the\section@num}}% + \xright@appenditem{\the@sw}\to\sw@list% + \else% + \csxdef{sw@#1@\the\absline@numR @\the\section@numR @R}{#2}% + \numdef{\prev@line}{\the\absline@numR-1}% + \ifcsundef{sw@#1@\prev@line @\the\section@numR @R}{% + \csnumgdef{sw@#1@\prev@line @\the\section@numR @R}{#2-1}% + }{}% + \numdef{\the@sw}{#2-\csuse{sw@#1@\prev@line @\the\section@numR @R}}% + \xright@appenditem{\the@sw}\to\sw@listR% + \fi% +}% +\def\sameword@inedtext#1{% + \unless\ifledRcol@% + \ifcsdef{sw@#1@\the\absline@num @\the\section@num}{% + \numdef{\prev@line}{\the\absline@num-1}% + \numdef{\sw@atthisline}{\csuse{sw@#1@\the\absline@num @\the\section@num}-\csuse{sw@#1@\prev@line @\the\section@num}}% + }% + {\numdef{\sw@atthisline}{0}}% + \ifx\sw@list@inedtext\empty% + \def\the@sw{999}% + \else% + \gl@p\sw@list@inedtext\to\the@sw% + \fi% + \ifnumgreater{\sw@atthisline}{1}% + {\showwordrank{#1}{\the@sw}}% + {#1}% + \else% + \ifcsdef{sw@#1@\the\absline@numR @\the\section@numR @R}{% + \numdef{\prev@line}{\the\absline@numR-1}% + \numdef{\sw@atthisline}{\csuse{sw@#1@\the\absline@numR @\the\section@numR @R}-\csuse{sw@#1@\prev@line @\the\section@numR @R}}% + }% + {\numdef{\sw@atthisline}{0}}% + \ifx\sw@list@inedtextR\empty% + \def\the@sw{999}% + \else% + \gl@p\sw@list@inedtextR\to\the@sw% + \fi% + \ifnumgreater{\sw@atthisline}{1}% + {\showwordrank{#1}{\the@sw}}% + {#1}% + \fi% +}% +\newcommand{\showwordrank}[2]{% + #1\textsuperscript{#2}% +}% + \newbox\raw@text \newif\ifnumberedpar@ \newcount\num@lines \newbox\one@line \newcount\par@line +\newcommand{\AtEveryPstart}[1]{\xdef\at@every@pstart{\noindent\unexpanded{#1}}}% +\xdef\at@every@pstart{}% + \newcounter{pstart} \renewcommand{\thepstart}{{\bfseries\@arabic\c@pstart}. } \newif\ifnumberpstart @@ -946,7 +1054,7 @@ \newif\iflabelpstart \labelpstartfalse \newcommandx*{\pstart}[1][1]{% - \ifstrempty{#1}{}{\noindent#1}% + \ifstrempty{#1}{\at@every@pstart}{\noindent#1}% \if@nobreak% \let\@oldnobreak\@nobreaktrue% \else% @@ -1006,9 +1114,13 @@ \fi% \@oldnobreak% \addtocounter{pstart}{1}% - \ifstrempty{#1}{}{\noindent#1}% + \ifstrempty{#1}{\at@every@pend}{\noindent#1}% } + +\newcommand{\AtEveryPend}[1]{\xdef\at@every@pend{\noindent\unexpanded{#1}}}% +\xdef\at@every@pend{}% + \newcommand*{\l@dzeropenalties}{% \brokenpenalty \z@ \clubpenalty \z@ \displaywidowpenalty \z@ \interlinepenalty \z@ \predisplaypenalty \z@ @@ -1441,13 +1553,13 @@ \newcommandx*{\footnotelang@poly}[1][1=L,usedefault]{% \ifstrequal{#1}{L}{% \if@RTL% - \xright@appenditem{{\csxdef{footnote@dir}{@RTLtrue}}}\to\inserts@list%Know the language of lemma + \xright@appenditem{{\csxdef{footnote@dir}{@RTLtrue}}}\to\inserts@list%Know the language used in the lemma \global\advance\insert@count \@ne% \else \xright@appenditem{{\csxdef{footnote@dir}{@RTLfalse}}}\to\inserts@list%Know the language of lemma \global\advance\insert@count \@ne% \fi% - \xright@appenditem{{\csxdef{footnote@lang}{\csexpandonce{languagename}}}}\to\inserts@list%Know the language of lemma + \xright@appenditem{{\csxdef{footnote@lang}{\expandonce\languagename}}}\to\inserts@list%Know the language of lemma \global\advance\insert@count \@ne% }% {% @@ -1458,7 +1570,7 @@ \xright@appenditem{{\csxdef{footnote@dir}{@RTLfalse}}}\to\inserts@listR%Know the language of lemma \global\advance\insert@countR \@ne% \fi - \xright@appenditem{{\csxdef{footnote@lang}{\csexpandonce{languagename}}}}\to\inserts@listR%Know the language of lemma + \xright@appenditem{{\csxdef{footnote@lang}{\expandonce\languagename}}}\to\inserts@listR%Know the language of lemma \global\advance\insert@countR \@ne% }% } @@ -2015,7 +2127,7 @@ \newcommand{\l@dbfnote}[1]{% \ifnumberedpar@ \gdef\@tag{#1}% - \xright@appenditem{\noexpand\vl@dbfnote{{\csexpandonce{@tag}}}{\@thefnmark}}% + \xright@appenditem{\noexpand\vl@dbfnote{{\expandonce\@tag}}{\@thefnmark}}% \to\inserts@list \global\advance\insert@count \@ne \fi\ignorespaces} @@ -2124,8 +2236,8 @@ \newcommand{\normalbfnoteX}[2]{% \ifnumberedpar@ - \protected@csxdef{thisfootnote}{\csuse{thefootnote#1}}% - \xright@appenditem{\noexpand\vbfnoteX{#1}{#2}{\csexpandonce{thisfootnote}}}% + \protected@xdef\thisfootnote{\csuse{thefootnote#1}}% + \xright@appenditem{\noexpand\vbfnoteX{#1}{#2}{\expandonce\thisfootnote}}% \to\inserts@list \global\advance\insert@count \@ne \fi\ignorespaces} @@ -2298,7 +2410,7 @@ \rigidbalance\csname mpfootins#1\endcsname \thr@@ \splittopskip}} \newcommand*{\footparagraphX}[1]{% - \csgdef{series@displayX#1}{paragraph} + \csgdef{series@displayX#1}{paragraphX}% \expandafter\newcount\csname prevpage#1@num\endcsname \expandafter\let\csname footstart#1\endcsname=\parafootstartX \expandafter\let\csname regvfootnote#1\endcsname=\para@vfootnoteX @@ -2420,11 +2532,11 @@ \newdimen\old@hsize% -\old@hsize=\hsize% +\old@hsize=\linewidth% \newcommand{\setXnoteswidthliketwocolumns@}[1]{% - \global\let\hsize@fornote=\hsize% - \old@hsize=\hsize% + \global\let\hsize@fornote=\linewidth% + \global\old@hsize=\linewidth% \iftoggle{Xnoteswidthliketwocolumns@#1}% {% \csuse{setwidthliketwocolumns@\columns@position}% @@ -2437,7 +2549,7 @@ \newcommand{\setnotesXwidthliketwocolumns@}[1]{% \global\let\hsize@fornote=\hsize% - \old@hsize=\hsize% + \global\old@hsize=\linewidth% \iftoggle{notesXwidthliketwocolumns@#1}% {% \csuse{setwidthliketwocolumns@\columns@position}% @@ -2643,7 +2755,7 @@ \footnoteoptions@[R]{##1}{true}% \xright@appenditem{\noexpand\prepare@edindex@fornote{\l@d@nums}% \noexpand\csuse{v#1footnote}{#1}% - {{\l@d@nums}{\csexpandonce{@tag}}{\csexpandonce{content}}}}\to\inserts@listR + {{\l@d@nums}{\expandonce\@tag}{\expandonce\content}}}\to\inserts@listR \footnoteoptions@[R]{##1}{false}% \global\advance\insert@countR \@ne% \else% @@ -2656,7 +2768,7 @@ \footnoteoptions@{##1}{true}% \xright@appenditem{\noexpand\prepare@edindex@fornote{\l@d@nums}% \noexpand\csuse{v#1footnote}{#1}% - {{\l@d@nums}{\csexpandonce{@tag}}{\csexpandonce{content}}}}\to\inserts@list + {{\l@d@nums}{\expandonce\@tag}{\expandonce\content}}}\to\inserts@list \global\advance\insert@count \@ne% \footnoteoptions@{##1}{false}% \fi @@ -2675,7 +2787,7 @@ \stepcounter{footnote#1}% \protected@csxdef{@thefnmark#1}{\csuse{thefootnote#1}}% \csuse{@footnotemark#1}% - \csuse{vfootnote#1}{#1}{\csexpandonce{content}}\m@mmf@prepare% + \csuse{vfootnote#1}{#1}{\expandonce\content}\m@mmf@prepare% \endgroup% } \newcounter{footnote#1} @@ -2688,7 +2800,7 @@ \newcommand{\content}{##1}% \immediate\write\l@d@end{\expandafter\string\csname #1end\endcsname% {\ifnumberedpar@\l@d@nums\fi}% - {\ifnumberedpar@\csexpandonce{@tag}\fi}{\csexpandonce{content}}{#1}}}\ignorespaces% + {\ifnumberedpar@\expandonce\@tag\fi}{\expandonce\content}{#1}}}\ignorespaces% } \global\cslet{#1end}{\@gobblefour} @@ -3299,11 +3411,11 @@ \newcommand{\content}{#1}% \ifnumberedpar@ \ifledRcol% - \xright@appenditem{\noexpand\vl@dlsnote{\csexpandonce{content}}}% + \xright@appenditem{\noexpand\vl@dlsnote{\expandonce\content}}% \to\inserts@listR \global\advance\insert@countR \@ne% \else% - \xright@appenditem{\noexpand\vl@dlsnote{\csexpandonce{content}}}% + \xright@appenditem{\noexpand\vl@dlsnote{\expandonce\content}}% \to\inserts@list \global\advance\insert@count \@ne% \fi @@ -3314,11 +3426,11 @@ \newcommand{\content}{#1}% \ifnumberedpar@ \ifledRcol% - \xright@appenditem{\noexpand\vl@drsnote{\csexpandonce{content}}}% + \xright@appenditem{\noexpand\vl@drsnote{\expandonce\content}}% \to\inserts@listR \global\advance\insert@countR \@ne% \else% - \xright@appenditem{\noexpand\vl@drsnote{\csexpandonce{content}}}% + \xright@appenditem{\noexpand\vl@drsnote{\expandonce\content}}% \to\inserts@list \global\advance\insert@count \@ne% \fi @@ -3329,11 +3441,11 @@ \newcommand{\content}{#1}% \ifnumberedpar@ \ifledRcol% - \xright@appenditem{\noexpand\vl@dcsnote{\csexpandonce{content}}}% + \xright@appenditem{\noexpand\vl@dcsnote{\expandonce\content}}% \to\inserts@listR \global\advance\insert@countR \@ne% \else% - \xright@appenditem{\noexpand\vl@dcsnote{\csexpandonce{content}}}% + \xright@appenditem{\noexpand\vl@dcsnote{\expandonce\content}}% \to\inserts@list \global\advance\insert@count \@ne% \fi @@ -5097,26 +5209,26 @@ \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}} +\newcommand{\led@pb}{\listxadd{\l@prev@pb}{\the\absline@num}} +\newcommand{\led@pbnum}[1]{\listxadd{\l@prev@pb}{#1}} +\newcommand{\led@nopb}{\listxadd{\l@prev@nopb}{\the\absline@num}} +\newcommand{\led@nopbnum}[1]{\listxadd{\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@pb}{\xifinlist{\the\absline@num}{\l@prev@pb}{\pagebreak[4]}{}} \newcommand{\led@check@nopb}{% \IfStrEq{\led@pb@setting}{before}{% - \xifinlistcs{\the\absline@num}{l@prev@nopb}% + \xifinlist{\the\absline@num}{\l@prev@nopb}% {\numdef{\abs@prevline}{\the\absline@num-1}% - \xifinlistcs{\abs@prevline}{normal@page@break}% + \xifinlist{\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}% + \xifinlist{\the\absline@num}{\l@prev@nopb}{% + \xifinlist{\the\absline@num}{\normal@page@break}% {\nopagebreak[4]\enlargethispage{\baselineskip}}% {}% }% diff --git a/Master/texmf-dist/tex/latex/eledmac/eledpar.sty b/Master/texmf-dist/tex/latex/eledmac/eledpar.sty index cc019b78841..e600da8f515 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}[2014/09/30 v1.9.1 eledmac extension for parallel texts]% +\ProvidesPackage{eledpar}[2015/01/12 v1.10.0 eledmac extension for parallel texts]% \newif\ifshiftedpstarts \let\shiftedversestrue\shiftedpstartstrue @@ -263,6 +263,8 @@ \list@create{\insertlines@listR} \list@create{\actionlines@listR} \list@create{\actions@listR} +\list@create{\sw@listR}% +\list@create{\sw@list@inedtextR}% \list@create{\linesinpar@listL} \list@create{\linesinpar@listR} @@ -278,6 +280,8 @@ \list@clear{\actions@listR}% \list@clear{\linesinpar@listR}% \list@clear{\linesonpage@listR} + \list@clear{\sw@listR}% + \list@clear{\sw@list@inedtextR}% \else \list@clearing@reg \list@clear{\linesinpar@listL}% @@ -378,7 +382,7 @@ \page@num=#1\relax \last@page@num=#1\relax \def\next@page@num{#1}% - \listcsxadd{normal@page@break}{\the\absline@num} + \listxadd{\normal@page@break}{\the\absline@num} \fi \fi} @@ -570,10 +574,12 @@ \repeat \begingroup \let\@ref=\dummy@ref + \let\@lopR\@gobble \let\page@action=\relax \let\sub@action=\relax \let\set@line@action=\relax \let\@lab=\relax + \let\@sw\@gobbletwo% #2 \global\endpage@num=\page@numR \global\endline@num=\line@numR @@ -682,6 +688,7 @@ \fi} \long\def\critext#1#2/{\leavevmode + \@edtext@true% \begingroup \renewcommand{\@tag}{\no@expands #1}% \set@line @@ -703,8 +710,11 @@ \flag@end}% {\if@RTL\flag@start\else\flag@end\fi% be careful on the direction of writing with polyglossia } + \@edtext@false% + \@lemmacommand@false% } \renewcommand{\edtext}[2]{\leavevmode + \@edtext@true% \begingroup% \renewcommand{\@tag}{\no@expands #1}% \set@line% @@ -726,6 +736,8 @@ \flag@end}% {\if@RTL\flag@start\else\flag@end\fi% be careful on the direction of writing with polyglossia }% + \@edtext@false% + \@lemmacommand@false% } \renewcommand*{\set@line}{% @@ -871,7 +883,7 @@ \iflabelpstart\protected@edef\@currentlabel% {\p@pstartL\thepstartL}\fi% \ifstrempty{#1}% - {}% + {\csgdef{before@pstartL@\the\l@dnumpstartsL}{\at@every@pstart}}% {\csgdef{before@pstartL@\the\l@dnumpstartsL}{\noindent#1}}% } \newcommandx*{\pstartR}[1][1]{% @@ -914,7 +926,7 @@ \iflabelpstart\protected@edef\@currentlabel% {\p@pstartR\thepstartR}\fi% \ifstrempty{#1}% - {} + {\csgdef{before@pstartR@\the\l@dnumpstartsR}{\at@every@pstart}}% {\csgdef{before@pstartR@\the\l@dnumpstartsR}{\noindent#1}}% } \newcommandx*{\pendL}[1][1]{% @@ -935,7 +947,7 @@ \fi \parledgroup@beforenotes@save{L}% \ifstrempty{#1}% - {}% + {\csgdef{after@pendL@\the\l@dnumpstartsL}{\at@every@pend}}% {\csgdef{after@pendL@\the\l@dnumpstartsL}{\noindent#1}}% } \newcommandx*{\pendR}[1][1]{% @@ -956,10 +968,12 @@ \fi% \parledgroup@beforenotes@save{R}% \ifstrempty{#1}% - {}% + {\csgdef{after@pendR@\the\l@dnumpstartsR}{\at@every@pend}}% {\csgdef{after@pendR@\the\l@dnumpstartsR}{\noindent#1}}% } +\newif\ifprint@last@after@pendL% +\newif\ifprint@last@after@pendR% \newbox\l@dleftbox \newbox\l@drightbox @@ -994,7 +1008,7 @@ \hb@xt@ \Lcolwidth{% \affixline@num \xifinlist{\the\l@dpscL}{\eled@sections@@}% - {}% + {\add@inserts\affixside@note}% {\print@lineL}}% \add@penaltiesL \global\advance\@donereallinesL\@ne @@ -1012,8 +1026,7 @@ {\ledllfill\hb@xt@ \wd\one@line{\do@insidelineLhook\inserthangingsymbolL\new@lineL\l@dunhbox@line{\one@line}}\correcthangingL\ledrlfill\l@drd@ta% \l@drsn@te}} -\def\print@eledsectionL{% - \add@inserts\affixside@note% +\def\print@eledsectionL{%% \addtocounter{pstartL}{-1}% \ifdefstring{\@eledsectnotoc}{L}{\ledsectnotoc}{} \ifdefstring{\@eledsectmark}{L}{}{\ledsectnomark} @@ -1065,7 +1078,7 @@ \hb@xt@ \Rcolwidth{% \affixline@numR% \xifinlist{\the\l@dpscR}{\eled@sectionsR@@}% - {}% + {\add@insertsR\affixside@noteR}% {\print@lineR}% }% \add@penaltiesR @@ -1081,16 +1094,13 @@ \def\print@lineR{% \affixpstart@numR% \l@dld@ta %space kept for backward compatibility - \add@insertsR% - \affixside@noteR% + \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% \l@drsn@te } \def\print@eledsectionR{% - \add@insertsR% - \affixside@noteR% \addtocounter{pstartR}{-1}% \initnumbering@sectcountR% \ifdefstring{\@eledsectnotoc}{R}{\ledsectnotoc}{}% @@ -1438,7 +1448,11 @@ \list@create{\labelref@listR} -\renewcommand*{\edlabel}[1]{\@bsphack +\renewcommand*{\edlabel}[1]{% + \ifl@dpairing\ifautopar% + \strut% + \fi\fi% + \@bsphack% \ifledRcol \write\linenum@outR{\string\@lab}% \ifx\labelref@listR\empty @@ -1546,11 +1560,11 @@ \ifnumberedpar@ \gdef\@tag{#1}% \ifledRcol% - \xright@appenditem{\noexpand\vl@dbfnote{{\csexpandonce{@tag}}}{\@thefnmark}}% + \xright@appenditem{\noexpand\vl@dbfnote{{\expandonce\@tag}}{\@thefnmark}}% \to\inserts@listR \global\advance\insert@countR \@ne% \else% - \xright@appenditem{\noexpand\vl@dbfnote{{\csexpandonce{@tag}}}{\@thefnmark}}% + \xright@appenditem{\noexpand\vl@dbfnote{{\expandonce\@tag}}{\@thefnmark}}% \to\inserts@list \global\advance\insert@count \@ne% \fi @@ -1565,8 +1579,8 @@ \@ifundefined{xpg@main@language}%if polyglossia {}% {\footnotelang@poly[R]}% - \protected@csxdef{thisfootnote}{\csuse{thefootnote#1}}% - \xright@appenditem{\noexpand\vbfnoteX{#1}{#2}{\csexpandonce{thisfootnote}}}% + \protected@xdef\thisfootnote{\csuse{thefootnote#1}}% + \xright@appenditem{\noexpand\vbfnoteX{#1}{#2}{\expandonce\thisfootnote}}% \to\inserts@listR \global\advance\insert@countR \@ne% \else% @@ -1576,8 +1590,8 @@ \@ifundefined{xpg@main@language}%if polyglossia {}% {\footnotelang@poly}% - \protected@csxdef{thisfootnote}{\csuse{thefootnote#1}}% - \xright@appenditem{\noexpand\vbfnoteX{#1}{#2}{\csexpandonce{thisfootnote}}}% + \protected@xdef\thisfootnote{\csuse{thefootnote#1}}% + \xright@appenditem{\noexpand\vbfnoteX{#1}{#2}{\expandonce\thisfootnote}}% \to\inserts@list \global\advance\insert@count \@ne% \fi @@ -2067,7 +2081,7 @@ %%% \begingroup { \loop\ifl@dsamepage% \ifdefstring{\@eledsectnotoc}{L}{\ledsectnotoc}{} - \csuse{before@pstartL@\the\l@dpscL} + \csuse{before@pstartL@\the\l@dpscL}% \global\csundef{before@pstartL@\the\l@dpscL} \do@lineL \xifinlist{\the\l@dpscL}{\eled@sections@@} @@ -2080,8 +2094,12 @@ \parledgroup@correction@notespacing{L} \hb@xt@ \hsize{\ledstrutL\unhbox\l@dleftbox}% \fi - \checkpageL% \get@nextboxL% + \ifprint@last@after@pendL% + \csuse{after@pendL@\the\l@dpscL}% + \global\csundef{after@pendL@\the\l@dpscL}% + \fi% + \checkpageL% \checkverseL \checkpbL \repeat @@ -2098,7 +2116,7 @@ { \loop\ifl@dsamepage% \initnumbering@sectcountR \ifdefstring{\@eledsectnotoc}{R}{\ledsectnotoc}{} - \csuse{before@pstartR@\the\l@dpscR} + \csuse{before@pstartR@\the\l@dpscR}% \global\csundef{before@pstartR@\the\l@dpscR} \do@lineR \xifinlist{\the\l@dpscR}{\eled@sectionsR@@} @@ -2111,8 +2129,12 @@ \parledgroup@correction@notespacing{R} \hb@xt@ \hsize{\ledstrutR\unhbox\l@drightbox}% \fi - \checkpageR% \get@nextboxR% + \ifprint@last@after@pendR% + \csuse{after@pendR@\the\l@dpscR}% + \global\csundef{after@pendR@\the\l@dpscR}% + \fi% + \checkpageR% \checkverseR \checkpbR \repeat @@ -2234,7 +2256,14 @@ \else \l@dsamepagefalse \l@dpagefulltrue - \fi} + \fi% + \ifprint@last@after@pendL% + \l@dpagefullfalse% + \l@dsamepagefalse% + \print@last@after@pendLfalse% + \fi% + }% + \newcommand*{\checkpageR}{% \l@dpagefulltrue \l@dsamepagetrue @@ -2248,7 +2277,13 @@ \else \l@dsamepagefalse \l@dpagefulltrue - \fi} + \fi% + \ifprint@last@after@pendR% + \l@dpagefullfalse% + \l@dsamepagefalse% + \print@last@after@pendRfalse% + \fi% + }% \newcommand{\checkpbL}{ \IfStrEq{\led@pb@setting}{after}{ @@ -2342,10 +2377,7 @@ \parledgroup@notes@endL \parledgroup@correction@notespacing@final{L} \else - \l@dpagefulltrue - \l@dsamepagefalse% - \csuse{after@pendL@\the\l@dpscL}% - \global\csundef{after@pendL@\the\l@dpscL}% + \print@last@after@pendLtrue% \fi \fi \fi} @@ -2383,10 +2415,7 @@ \parledgroup@notes@endR \parledgroup@correction@notespacing@final{R} \else - \l@dpagefulltrue% - \l@dsamepagefalse% - \csuse{after@pendR@\the\l@dpscR}% - \global\csundef{after@pendR@\the\l@dpscR}% + \print@last@after@pendRtrue% \fi \fi \fi} @@ -2403,10 +2432,10 @@ \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}} +\newcommand{\led@pbR}{\listxadd{\l@prev@pbR}{\the\absline@numR}} +\newcommand{\led@pbnumR}[1]{\listxadd{\l@prev@pbR}{#1}} +\newcommand{\led@nopbR}{\listxadd{\l@prev@nopbR}{\the\absline@numR}} +\newcommand{\led@nopbnumR}[1]{\listxadd{\l@prev@nopbR}{#1}} \newmarks\parledgroup@ \newmarks\parledgroup@series \newmarks\parledgroup@type -- cgit v1.2.3