summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/eledmac/eledpar.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/eledmac/eledpar.sty')
-rw-r--r--Master/texmf-dist/tex/latex/eledmac/eledpar.sty389
1 files changed, 242 insertions, 147 deletions
diff --git a/Master/texmf-dist/tex/latex/eledmac/eledpar.sty b/Master/texmf-dist/tex/latex/eledmac/eledpar.sty
index 60b80af8ceb..6b0a96c5264 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}[2014/04/14 v1.7.0 eledmac extension for parallel texts]
+\ProvidesPackage{eledpar}[2014/08/05 v1.8.0 eledmac extension for parallel texts]%
\newif\ifshiftedpstarts
\let\shiftedversestrue\shiftedpstartstrue
@@ -58,19 +58,6 @@
\newif\ifpst@rtedR
\pst@rtedRfalse
-\providecommand*{\beginnumbering}{%
- \ifnumbering
- \led@err@NumberingStarted
- \endnumbering
- \fi
- \global\l@dnumpstartsL \z@
- \global\pst@rtedLfalse
- \global\numberingtrue
- \global\advance\section@num \@ne
- \initnumbering@reg
- \message{Section \the\section@num}%
- \line@list@stuff{\jobname.\extensionchars\the\section@num}%
- \l@dend@stuff}
\newcommand*{\beginnumberingR}{%
\ifnumberingR
\led@err@NumberingStarted
@@ -95,10 +82,11 @@
\l@dend@stuff
\setcounter{pstartR}{1}
\begingroup
- \initnumbering@sectcmd
\initnumbering@sectcountR
+ \gdef\eled@sectionsR@@{}
+ \makeatletter\InputIfFileExists{\jobname.eledsec\the\section@numR R}{}{}\makeatother
+ \immediate\openout\eled@sectioningR@out=\jobname.eledsec\the\section@numR R\relax
}
-
\def\endnumberingR{%
\ifnumberingR
\global\numberingRfalse
@@ -118,7 +106,10 @@
\fi
\else
\led@err@NumberingNotStarted
- \fi\endgroup}
+ \fi
+ \endgroup
+ \immediate\closeout\eled@sectioningR@out
+ }
\newcounter{chapterR}
\newcounter{sectionR}
@@ -139,6 +130,7 @@
\led@mess@SectionContinued{\the\section@numR R}%
\line@list@stuffR{\jobname.\extensionchars\the\section@numR R}%
\l@dend@stuff
+ \initnumbering@sectcmd
\else
\led@err@numberingShouldHaveStarted
\endnumberingR
@@ -303,7 +295,7 @@
\fi
\fi}
-\newcommand{\@l@regR}{%
+\newcommand{\@nl@regR}{%
\ifx\l@dchset@num\relax \else
\advance\absline@numR \@ne
\set@line@action
@@ -347,12 +339,12 @@
\fi
\fi}
-\renewcommand*{\@l}[2]{%
+\renewcommand*{\@nl}[2]{%
\fix@page{#1}%
\ifledRcol
- \@l@regR
+ \@nl@regR
\else
- \@l@reg
+ \@nl@reg
\fi}
\newcount\last@page@numR
@@ -628,9 +620,9 @@
\fi}
\newcommand*{\new@lineL}{%
- \write\linenum@out{\string\@l[\the\c@page][\thepage]}}
+ \write\linenum@out{\string\@nl[\the\c@page][\thepage]}}
\newcommand*{\new@lineR}{%
- \write\linenum@outR{\string\@l[\the\c@page][\thepage]}}
+ \write\linenum@outR{\string\@nl[\the\c@page][\thepage]}}
\renewcommand*{\flag@start}{%
\ifledRcol
\edef\next{\write\linenum@outR{%
@@ -767,6 +759,7 @@
\newenvironment{pairs}{%}
\l@dpairingtrue
\l@dpagingfalse
+ \initnumbering@sectcmd
}{%
\l@dpairingfalse
}
@@ -775,6 +768,7 @@
\let\chapter\chapterinpages
\l@dpairingtrue
\l@dpagingtrue
+ \initnumbering@sectcmd
\setlength{\Lcolwidth}{\textwidth}%
\setlength{\Rcolwidth}{\textwidth}%
}{%
@@ -791,16 +785,15 @@
\newif\ifinstanzaR
\newenvironment{Leftside}{%
\ledRcolfalse
- \let\beginnumbering\beginnumbering\setcounter{pstartL}{1}
+ \setcounter{pstartL}{1}
\let\pstart\pstartL
\let\thepstart\thepstartL
\let\pend\pendL
\let\memorydump\memorydumpL
\Leftsidehook
- \let\oldstanza\stanza
- \renewcommand{\stanza}{\oldstanza\global\instanzaLtrue}
+ \let\old@startstanza\@startstanza
+ \def\@startstanza[##1]{\global\instanzaLtrue\old@startstanza[##1]}
}{
- \let\stanza\oldstanza
\Leftsidehookend}
\newcommand*{\Leftsidehook}{}
\newcommand*{\Leftsidehookend}{}
@@ -821,11 +814,10 @@
\let\lednopb\lednopbR
\let\lineation\lineationR
\Rightsidehook
- \let\oldstanza\stanza
- \renewcommand{\stanza}{\oldstanza\global\instanzaRtrue}
+ \let\old@startstanza\@startstanza
+ \def\@startstanza[##1]{\global\instanzaRtrue\old@startstanza[##1]}
}{%
\ledRcolfalse
- \let\stanza\oldstanza
\Rightsidehookend
}
@@ -840,12 +832,12 @@
\newcounter{pstartRold}
\renewcommand{\thepstartR}{{\bfseries\@arabic\c@pstartR}. }
-\newcommand*{\pstartL}{%
-\if@nobreak%
+\newcommandx*{\pstartL}[1][1]{%
+ \if@nobreak%
\let\@oldnobreak\@nobreaktrue%
-\else%
+ \else%
\let\@oldnobreak\@nobreakfalse%
-\fi%
+ \fi%
\@nobreaktrue%
\ifnumbering \else%
\led@err@PstartNotNumbered%
@@ -880,13 +872,16 @@
\numberedpar@true%
\iflabelpstart\protected@edef\@currentlabel%
{\p@pstartL\thepstartL}\fi%
+ \ifstrempty{#1}%
+ {}%
+ {\csgdef{before@pstartL@\the\l@dnumpstartsL}{\noindent#1}}%
}
-\newcommand*{\pstartR}{%
-\if@nobreak%
+\newcommandx*{\pstartR}[1][1]{%
+ \if@nobreak%
\let\@oldnobreak\@nobreaktrue%
-\else%
+ \else%
\let\@oldnobreak\@nobreakfalse%
-\fi%
+ \fi%
\@nobreaktrue%
\ifnumberingR \else%
\led@err@PstartNotNumbered%
@@ -920,8 +915,12 @@
\numberedpar@true%
\iflabelpstart\protected@edef\@currentlabel%
{\p@pstartR\thepstartR}\fi%
+ \ifstrempty{#1}%
+ {}
+ {\csgdef{before@pstartR@\the\l@dnumpstartsR}{\noindent#1}}%
}
-\newcommand*{\pendL}{\ifnumbering \else%
+\newcommandx*{\pendL}[1][1]{%
+ \ifnumbering \else%
\led@err@PendNotNumbered%
\fi%
\ifnumberedpar@ \else%
@@ -937,9 +936,12 @@
\addtocounter{pstartL}{1}%
\fi
\parledgroup@beforenotes@save{L}%
+ \ifstrempty{#1}%
+ {}%
+ {\csgdef{after@pendL@\the\l@dnumpstartsL}{\noindent#1}}%
}
-
-\newcommand*{\pendR}{\ifnumberingR \else%
+\newcommandx*{\pendR}[1][1]{%
+ \ifnumberingR \else%
\led@err@PendNotNumbered%
\fi%
\ifnumberedpar@ \else%
@@ -954,7 +956,10 @@
\ifnumberpstart%
\addtocounter{pstartR}{1}%
\fi%
- \parledgroup@beforenotes@save{R}
+ \parledgroup@beforenotes@save{R}%
+ \ifstrempty{#1}%
+ {}%
+ {\csgdef{after@pendR@\the\l@dnumpstartsR}{\noindent#1}}%
}
\newbox\l@dleftbox
@@ -982,18 +987,19 @@
\IfStrEq{\splitfirstmarks\parledgroup@}{begin}{\parledgroup@notes@startL}{}
\unvbox\one@line \global\setbox\one@line=\lastbox
\getline@numL
-\ifnum\@lock>\@ne\inserthangingsymboltrue\else\inserthangingsymbolfalse\fi
+ \ifnum\@lock>\@ne%
+ \inserthangingsymboltrue%
+ \else%
+ \inserthangingsymbolfalse%
+ \fi
\setbox\l@dleftbox
\hb@xt@ \Lcolwidth{%
- \affixpstart@numL
\affixline@num
- \l@dld@ta
\add@inserts
\affixside@note
- \l@dlsn@te
- {\ledllfill\hb@xt@ \wd\one@line{\do@insidelineLhook\inserthangingsymbolL\new@lineL\l@dunhbox@line{\one@line}}\correcthangingL\ledrlfill\l@drd@ta%
- \l@drsn@te
- }}%
+ \xifinlist{\the\l@dpscL}{\eled@sections@@}%
+ {}%
+ {\print@lineL}}%
\add@penaltiesL
\global\advance\@donereallinesL\@ne
\global\advance\@donetotallinesL\@ne
@@ -1002,12 +1008,38 @@
\global\advance\@donetotallinesL\@ne
\fi}
+\def\print@lineL{%
+ \affixpstart@numL%
+ \l@dld@ta %space kept for backwar compatibility
+ \l@dlsn@te %space kept for backwar compatibility
+ {\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{%
+ \addtocounter{pstartL}{-1}%
+ \ifdefstring{\@eledsectnotoc}{L}{\ledsectnotoc}{}
+ \ifdefstring{\@eledsectmark}{L}{}{\ledsectnomark}
+ \numdef{\temp@}{\l@dpscL-1}%
+ \xifinlist{\temp@}{\eled@sections@@}{\@nobreaktrue}{\@nobreakfalse}%
+ \@eled@sectioningtrue%
+ \csuse{eled@sectioning@\the\l@dpscL}%
+ \@eled@sectioningfalse%
+ \global\csundef{eled@sectioning@\the\l@dpscL}%
+ \if@RTL%
+ \hspace{-\paperwidth}%
+ {\hbox{\l@dunhbox@line{\one@line}} \new@line}%
+ \else%
+ \hspace{\paperwidth}%
+ {\new@line \hbox{\l@dunhbox@line{\one@line}}}%
+ \fi%
+ \vskip\eledsection@correcting@skip%
+}
\newcommand*{\do@lineLhook}{}
\newcommand*{\do@lineRhook}{}
\newcommand*{\do@insidelineLhook}{}
\newcommand*{\do@insidelineRhook}{}
\newcommand*{\do@lineR}{%
+ \ledRcol@true%
\advance\countRline \@ne
\ifvbox\namebox{l@dRcolrawbox\the\l@dpscR}%
{\vbadness=10000
@@ -1016,29 +1048,61 @@
\l@demptyd@ta
\global\setbox\one@lineR=\vsplit\namebox{l@dRcolrawbox\the\l@dpscR}
to\baselineskip}%
- \IfStrEq{\splitfirstmarks\parledgroup@}{begin}{\parledgroup@notes@startR}{}
+ \IfStrEq{\splitfirstmarks\parledgroup@}{begin}{\parledgroup@notes@startR}{}
\unvbox\one@lineR \global\setbox\one@lineR=\lastbox
\getline@numR
-\ifnum\@lockR>\@ne\inserthangingsymbolRtrue\else\inserthangingsymbolRfalse\fi
+ \ifnum\@lockR>\@ne%
+ \inserthangingsymbolRtrue
+ \else%
+ \inserthangingsymbolRfalse%
+ \fi%
\setbox\l@drightbox
\hb@xt@ \Rcolwidth{%
- \affixpstart@numR
- \affixline@numR
- \l@dld@ta
+ \affixline@numR%
\add@insertsR
\affixside@noteR
- \l@dlsn@te
- {\correcthangingR\ledllfill\hb@xt@ \wd\one@lineR{\do@insidelineRhook\inserthangingsymbolR\new@lineR\l@dunhbox@line{\one@lineR}}\ledrlfill\l@drd@ta%
- \l@drsn@te
- }}%
+ \xifinlist{\the\l@dpscR}{\eled@sectionsR@@}%
+ {}%
+ {\print@lineR}%
+ }%
\add@penaltiesR
\global\advance\@donereallinesR\@ne
\global\advance\@donetotallinesR\@ne
\else
\setbox\l@drightbox \hb@xt@ \Rcolwidth{\hspace*{\Rcolwidth}}
\global\advance\@donetotallinesR\@ne
-\fi}
+\fi
+\ledRcol@false%
+}
+\def\print@lineR{%
+ \affixpstart@numR%
+ \l@dld@ta
+ \l@dlsn@te
+\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{%
+ \addtocounter{pstartR}{-1}%
+ \initnumbering@sectcountR%
+ \ifdefstring{\@eledsectnotoc}{R}{\ledsectnotoc}{}%
+ \ifdefstring{\@eledsectmark}{R}{}{\ledsectnomark}%
+ \numdef{\temp@}{\l@dpscR-1}%
+ \xifinlist{\temp@}{\eled@sectionsR@@}{\@nobreaktrue}{\@nobreakfalse}%
+ \@eled@sectioningtrue%
+ \csuse{eled@sectioning@\the\l@dpscR R}%
+ \@eled@sectioningfalse%
+ \global\csundef{eled@sectioning@\the\l@dpscR R}%
+ \if@RTL%
+ \hspace{-\paperwidth}%
+ {\hbox{\l@dunhbox@line{\one@lineR}} \new@lineR}%
+ \else%
+ \hspace{\paperwidth}%
+ {\new@lineR \hbox{\l@dunhbox@line{\one@lineR}}}%
+ \fi%
+ \vskip\eledsection@correcting@skip
+}
\newcommand*{\getline@numR}{%
\global\advance\absline@numR \@ne
\do@actionsR
@@ -1416,61 +1480,14 @@
\to\labelref@list
\fi}
+\WithSuffix\newcommand\sidenotemargin*[1]{%
+ \l@dgetsidenote@margin{#1}
+ \global\sidenote@marginR=\@l@dtempcntb
+ \global\sidenote@margin=\@l@dtempcntb
+}
\newcount\sidenote@marginR
-\renewcommand*{\sidenotemargin}[1]{{%
- \l@dgetsidenote@margin{#1}%
- \ifnum\@l@dtempcntb>\m@ne
- \ifledRcol
- \global\sidenote@marginR=\@l@dtempcntb
- \else
- \global\sidenote@margin=\@l@dtempcntb
- \fi
- \fi}}
-\sidenotemargin{right}
\global\sidenote@margin=\@ne
-\renewcommand*{\l@dlsnote}[1]{%
- \begingroup%
- \newcommand{\content}{#1}%
- \ifnumberedpar@
- \ifledRcol%
- \xright@appenditem{\noexpand\vl@dlsnote{\csexpandonce{content}}}%
- \to\inserts@listR
- \global\advance\insert@countR \@ne%
- \else%
- \xright@appenditem{\noexpand\vl@dlsnote{\csexpandonce{content}}}%
- \to\inserts@list
- \global\advance\insert@count \@ne%
- \fi
- \fi\ignorespaces\endgroup}
-\renewcommand*{\l@drsnote}[1]{%
- \begingroup%
- \newcommand{\content}{#1}%
- \ifnumberedpar@
- \ifledRcol%
- \xright@appenditem{\noexpand\vl@drsnote{\csexpandonce{content}}}%
- \to\inserts@listR
- \global\advance\insert@countR \@ne%
- \else%
- \xright@appenditem{\noexpand\vl@drsnote{\csexpandonce{content}}}%
- \to\inserts@list
- \global\advance\insert@count \@ne%
- \fi
- \fi\ignorespaces\endgroup}
-\renewcommand*{\l@dcsnote}[1]{%
- \begingroup%
- \newcommand{\content}{#1}%
- \ifnumberedpar@
- \ifledRcol%
- \xright@appenditem{\noexpand\vl@dcsnote{\csexpandonce{content}}}%
- \to\inserts@listR
- \global\advance\insert@countR \@ne%
- \else%
- \xright@appenditem{\noexpand\vl@dcsnote{\csexpandonce{content}}}%
- \to\inserts@list
- \global\advance\insert@count \@ne%
- \fi
- \fi\ignorespaces\endgroup}
\newcommand*{\affixside@noteR}{%
\def\sidenotecontent@{}%
@@ -1484,27 +1501,38 @@
\numdef{\itemcount@}{\itemcount@+1}%
}%
\dolistloop{\l@dcsnotetext}%
- \ifnumgreater{\itemcount@}{1}{\eledmac@warning{\itemcount@\space sidenotes on line \the\line@numR R p. \the\page@numR,}}{}%
+ \ifnumgreater{\itemcount@}{1}{\eledmac@warning{\itemcount@\space sidenotes on line \the\line@numR\space p. \the\page@numR,}}{}%
\gdef\@templ@d{}%
\ifx\@templ@d\l@dcsnotetext \else%
\if@twocolumn%
\if@firstcolumn%
- \setl@dlp@rbox{\sidenotecontent@}%
+ \setl@dlp@rbox{##1}{\sidenotecontent@}%
\else%
\setl@drp@rbox{\sidenotecontent@}%
\fi%
\else%
\@l@dtempcntb=\sidenote@marginR%
\ifnum\@l@dtempcntb>\@ne%
- \advance\@l@dtempcntb by\page@num%
+ \advance\@l@dtempcntb by\page@numR%
\fi%
\ifodd\@l@dtempcntb%
- \setl@drp@rbox{\sidenotecontent@t}%
+ \setl@drp@rbox{\sidenotecontent@}%
+ \gdef\sidenotecontent@{}%
+ \numdef{\itemcount@}{0}%
+ \dolistloop{\l@dcsnotetext@l}%
+ \ifnumgreater{\itemcount@}{1}{\eledmac@warning{\itemcount@\space leftnotes on line \the\line@numR\space p. \the\page@numR,}}{}%
+ \setl@dlp@rbox{\sidenotecontent@}%
\else%
\setl@dlp@rbox{\sidenotecontent@}%
+ \gdef\sidenotecontent@{}%
+ \numdef{\itemcount@}{0}%
+ \dolistloop{\l@dcsnotetext@r}%
+ \ifnumgreater{\itemcount@}{1}{\eledmac@warning{\itemcount@\space rightnotes on line \the\line@numR\space p. \the\page@numR,}}{}%
+ \setl@drp@rbox{\sidenotecontent@}%
\fi%
\fi%
- \fi}
+ \fi%
+}
\renewcommand{\l@dbfnote}[1]{%
\ifnumberedpar@
@@ -1684,15 +1712,6 @@
\newif\ifl@dusedbabel
\l@dusedbabelfalse
-\newif\ifl@dsamelang
- \l@dsamelangtrue
-\newcommand*{\l@dchecklang}{%
- \l@dsamelangfalse
- \edef\@tempa{\theledlanguageL}\edef\@temp{\theledlanguageR}%
- \ifx\@tempa\@tempb
- \l@dsamelangtrue
- \fi}
-
\newcommand*{\l@dbbl@set@language}[1]{%
\edef\languagename{#1}%
\select@language{\languagename}%
@@ -1728,15 +1747,20 @@
\gdef\theledlanguageR{\bbl@main@language}%
}%
}
- { \apptocmd{\xpg@set@language}{%
- \ifledRcol \gdef\theledlanguageR{#1}%
- \else \gdef\theledlanguageL{#1}%
+ { \let\old@otherlanguage\otherlanguage%
+ \renewcommand{\otherlanguage}[2][]{%
+ \selectlanguage[#1]{#2}%
+ \ifledRcol \gdef\theledlanguageR{#2}%
+ \else \gdef\theledlanguageL{#2}%
\fi}%
- \let\l@duselanguage\xpg@set@language
+ \let\l@duselanguage\xpg@set@language%
\gdef\theledlanguageL{\xpg@main@language}%
\gdef\theledlanguageR{\xpg@main@language}%
}}
+\newsavebox{\@eledsectionL}%
+\newsavebox{\@eledsectionR}%
\newcommand*{\Columns}{%
+ \eledsection@correcting@skip=-\baselineskip% Correction for sections' titles
\setcounter{pstartL}{\value{pstartLold}}
\setcounter{pstartR}{\value{pstartRold}}
\ifnum\l@dnumpstartsL=\l@dnumpstartsR\else
@@ -1757,21 +1781,40 @@
\global\advance\l@dpscL \@ne
\global\advance\l@dpscR \@ne
\checkraw@text
- \l@dchecklang
{ \loop\ifaraw@text
- \ifl@dsamelang
- \do@lineL
- \do@lineR
- \else
\l@duselanguage{\theledlanguageL}%
\do@lineL
+ \xifinlist{\the\l@dpscL}{\eled@sections@@}
+ {%
+ \ifdefstring{\@eledsectmark}{L}%
+ {\csuse{eled@sectmark@\the\l@dpscL}%
+ }{}%
+ \global\csundef{eled@sectmark@\the\l@dpscL}%
+ \savebox{\@eledsectionL}{\parbox[t][][t]{\Lcolwidth}{\vbox{}\print@eledsectionL}}%\vbox{}-> prevent alignment troubles with RTL language
+ }%
+ {}%
\l@duselanguage{\theledlanguageR}%
\do@lineR
- \fi
+ \xifinlist{\the\l@dpscR}{\eled@sectionsR@@}
+ {%
+ \ifdefstring{\@eledsectmark}{R}%
+ {\csuse{eled@sectmark@\the\l@dpscR R}%
+ }{}%
+ \global\csundef{eled@sectmark@\the\l@dpscR R}%
+ \savebox{\@eledsectionR}{\parbox[t][][t]{\Rcolwidth}{\vbox{}\print@eledsectionR}}}%\vbox{}-> prevent alignment troubles with RTL language
+ {}%
\hb@xt@ \hsize{%
- \hfill \unhbox\l@dleftbox
- \hfill \columnseparator \hfill
- \unhbox\l@drightbox
+ \ifdefstring{\columns@position}{L}{}{\hfill }%
+ \unhbox\l@dleftbox%
+ \ifhbox\@eledsectionL%
+ \usebox{\@eledsectionL}%
+ \fi%
+ \print@columnseparator%
+ \unhbox\l@drightbox%
+ \ifhbox\@eledsectionR%
+ \usebox{\@eledsectionR}%
+ \fi%
+ \ifdefstring{\columns@position}{R}{}{\hfill}%
}%
\checkraw@text
\checkverseL
@@ -1803,6 +1846,19 @@
\global\instanzaLfalse
\global\instanzaRfalse}
+\def\print@columnseparator{%
+ \ifdim\beforecolumnseparator<0pt%
+ \hfill%
+ \else%
+ \hspace{\beforecolumnseparator}%
+ \fi%
+ \columnseparator%
+ \ifdim\aftercolumnseparator<0pt%
+ \hfill%
+ \else%
+ \hspace{\beforecolumnseparator}%
+ \fi%
+}%
\newcommand{\checkpb@columns}{%
\newif\if@pb
@@ -1829,6 +1885,15 @@
\newdimen\columnrulewidth
\columnrulewidth=\z@
+\newcommand*{\columnsposition}[1]{%
+ \xdef\columns@position{#1}%
+ }%
+\xdef\columns@position{R}%
+\newlength{\beforecolumnseparator}%
+\setlength{\beforecolumnseparator}{-2pt}%
+
+\newlength{\aftercolumnseparator}%
+\setlength{\aftercolumnseparator}{-2pt}%
\newif\if@pstarts
\newcommand*{\check@pstarts}{%
\@pstartsfalse
@@ -1870,6 +1935,7 @@
\newcount\l@dminpagelines
\newcommand*{\Pages}{%
+ \eledsection@correcting@skip=-2\baselineskip% line correcting for section titles.
\setcounter{pstartL}{\value{pstartLold}}
\setcounter{pstartR}{\value{pstartRold}}
\parledgroup@notespacing@set@correction
@@ -1918,8 +1984,14 @@
\checkpageL
\l@duselanguage{\theledlanguageL}%
%%% \begingroup
-{ \loop\ifl@dsamepage
+{ \loop\ifl@dsamepage%
+ \ifdefstring{\@eledsectnotoc}{L}{\ledsectnotoc}{}
+ \csuse{before@pstartL@\the\l@dpscL}
+ \global\csundef{before@pstartL@\the\l@dpscL}
\do@lineL
+ \xifinlist{\the\l@dpscL}{\eled@sections@@}
+ {\print@eledsectionL}%
+ {}%
\advance\numpagelinesL \@ne
\ifshiftedpstarts
\ifdim\ht\l@dleftbox>0pt\hb@xt@ \hsize{\ledstrutL\unhbox\l@dleftbox}\fi%
@@ -1942,8 +2014,15 @@
\clearl@dleftpage }%
\checkpageR
\l@duselanguage{\theledlanguageR}%
-{ \loop\ifl@dsamepage
+{ \loop\ifl@dsamepage%
+ \initnumbering@sectcountR
+ \ifdefstring{\@eledsectnotoc}{R}{\ledsectnotoc}{}
+ \csuse{before@pstartR@\the\l@dpscR}
+ \global\csundef{before@pstartR@\the\l@dpscR}
\do@lineR
+ \xifinlist{\the\l@dpscR}{\eled@sectionsR@@}
+ {\print@eledsectionR}%
+ {}%
\advance\numpagelinesR \@ne
\ifshiftedpstarts
\ifdim\ht\l@drightbox>0pt\hb@xt@ \hsize{\ledstrutR\unhbox\l@drightbox}\fi%
@@ -2152,13 +2231,12 @@
\ifvbox\namebox{l@dLcolrawbox\the\l@dpscL}% box is not empty
\else% box is empty
\ifnum\usenamecount{l@dmaxlinesinpar\the\l@dpscL}>\@donetotallinesL
- \parledgroup@notes@endL
+ \parledgroup@notes@endL
\else
\ifnum\usenamecount{l@dmaxlinesinpar\the\l@dpscL}=\@donetotallinesL
\parledgroup@notes@endL
\fi
- \ifwrittenlinesL
- \else
+ \ifwrittenlinesL\else
\@writelinesinparL
\writtenlinesLtrue
\fi
@@ -2171,6 +2249,8 @@
\resetprevline@
\fi
\fi
+ \csuse{after@pendL@\the\l@dpscL}%
+ \global\csundef{after@pendL@\the\l@dpscL}%
\addtocounter{pstartL}{1}
\global\pstartnumtrue
\l@dcalc@maxoftwo{\the\usenamecount{l@dmaxlinesinpar\the\l@dpscL}}%
@@ -2180,6 +2260,10 @@
\global\advance\l@dpscL \@ne
\parledgroup@notes@endL
\parledgroup@correction@notespacing@final{L}
+ \else
+ \l@dpagefulltrue
+ \csuse{after@pendL@\the\l@dpscL}%
+ \global\csundef{after@pendL@\the\l@dpscL}%
\fi
\fi
\fi}
@@ -2187,13 +2271,12 @@
\ifvbox\namebox{l@dRcolrawbox\the\l@dpscR}% box is not empty
\else% box is empty
\ifnum\usenamecount{l@dmaxlinesinpar\the\l@dpscR}>\@donetotallinesR
- \parledgroup@notes@endR
+ \parledgroup@notes@endR
\else
\ifnum\usenamecount{l@dmaxlinesinpar\the\l@dpscR}=\@donetotallinesR
\parledgroup@notes@endR
\fi
- \ifwrittenlinesR
- \else
+ \ifwrittenlinesR\else
\@writelinesinparR
\writtenlinesRtrue
\fi
@@ -2206,6 +2289,8 @@
\resetprevline@
\fi
\fi
+ \csuse{after@pendR@\the\l@dpscR}%
+ \global\csundef{after@pendR@\the\l@dpscR}%
\addtocounter{pstartR}{1}
\global\pstartnumRtrue
\l@dcalc@maxoftwo{\the\usenamecount{l@dmaxlinesinpar\the\l@dpscR}}%
@@ -2215,10 +2300,20 @@
\global\advance\l@dpscR \@ne
\parledgroup@notes@endR
\parledgroup@correction@notespacing@final{R}
+ \else
+ \csuse{after@pendR@\the\l@dpscR}%
+ \global\csundef{after@pendR@\the\l@dpscR}%
+ \l@dpagefulltrue
\fi
\fi
\fi}
+\newcommand{\eledsectnotoc}[1]{\xdef\@eledsectnotoc{#1}}
+\eledsectnotoc{R}
+\newcommand{\eledsectmark}[1]{\xdef\@eledsectmark{#1}}
+\eledsectmark{L}
+\newskip\eledsection@correcting@skip
+\newwrite\eled@sectioningR@out
\def\l@prev@pbR{}
\def\l@prev@nopbR{}
\newcommand{\ledpbR}{\write\linenum@outR{\string\led@pbR}}
@@ -2288,7 +2383,7 @@
\vspace{\parledgroup@notespacing@correction@accumulated}
\parledgroup@correction@notespacing@init%
\ifstrequal{#1}{L}{
- \numdef{\@checking}{\the\l@dpscL-1}
+ \numdef{\@checking}{\the\l@dpscL-1}
}{
\numdef{\@checking}{\the\l@dpscR-1}
}