summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/ledmac
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-01-12 23:57:51 +0000
committerKarl Berry <karl@freefriends.org>2006-01-12 23:57:51 +0000
commitbfb5860bf0e40f46d39badb79838f5ecfcf58776 (patch)
tree9e0d2409d0d3b4abe58f78f1368990da14715873 /Master/texmf-dist/tex/latex/ledmac
parent957c6bc9342ffaefb65ef4a3e6f1c3817dbf7631 (diff)
ledmac
git-svn-id: svn://tug.org/texlive/trunk@1031 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/ledmac')
-rw-r--r--Master/texmf-dist/tex/latex/ledmac/afoot.sty125
-rw-r--r--Master/texmf-dist/tex/latex/ledmac/ledarab.sty213
-rw-r--r--Master/texmf-dist/tex/latex/ledmac/ledmac.sty3239
-rw-r--r--Master/texmf-dist/tex/latex/ledmac/ledpar.sty1842
-rw-r--r--Master/texmf-dist/tex/latex/ledmac/ledparpatch.sty470
-rw-r--r--Master/texmf-dist/tex/latex/ledmac/ledpatch.sty316
6 files changed, 6205 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/ledmac/afoot.sty b/Master/texmf-dist/tex/latex/ledmac/afoot.sty
new file mode 100644
index 00000000000..5a0cba81a3e
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ledmac/afoot.sty
@@ -0,0 +1,125 @@
+%%
+%% This is file `afoot.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ledarab.dtx (with options: `afoot')
+%%
+%% Author: Peter Wilson (Herries Press) herries dot press at earthlink dot net
+%% Copyright 2005 Peter R. Wilson
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3 of this license or (at your option) any
+%% later version.
+%% The latest version of the license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2003/06/01 or later.
+%%
+%% This work has the LPPL maintenance status "author-maintained".
+%%
+%% This work consists of the files listed in the README file.
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{afoot}[2005/03/24 v0.1 PW's version of ArabTeX's afoot.sty]
+
+\ifx \footglue \undefined % normal case
+\else % fnpara.sty is present
+ \long\def\@makefntext#1{{$^{\@thefnmark}$}#1\nobreak }
+\fi
+
+%%% Make the LaTeX \cs{footnote} catcode-safe, like in Plain TeX.
+
+\def \@footnotetext {% new, do not yet read footnote text
+ \insert \footins \bgroup
+ \ifx \footglue \undefined % prepare normal footnote
+ \interlinepenalty \interfootnotelinepenalty \floatingpenalty \@MM
+ \splittopskip \footnotesep \splitmaxdepth \dp \strutbox
+ \else
+ \global\long\def \@makefntext ##1{{$^{\@thefnmark }$}##1\nobreak }%
+ \setbox0=\hbox \bgroup % fnpara.sty is present
+ \floatingpenalty=20000 \footnotesize
+ \fi
+ \edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}%
+ \a@fntext }
+
+\def \@mpfootnotetext {%
+ \global \setbox \@mpfootins \vbox \bgroup
+ \edef \@currentlabel {\csname p@mpfootnote\endcsname \@thefnmark }%
+ \unvbox \@mpfootins \reset@font \a@fntext }
+
+\def \a@fntext {% common part for footnote text
+ \footnotesize \hsize \columnwidth \@parboxrestore \clubpenalty 5000
+ \@makefntext {\rule {\z@ }{\footnotesep }}\futurelet \next \fo@t }
+
+%%%%%%%%%%%%%%%%%%%%%%%% \footnote, parts from Plain %%%%%%%%%%%%%%%%%
+
+\def\fo@t{%
+ \ifcat
+ \bgroup \noexpand\next
+ \let\next\f@@t
+ \else
+ \let\next\f@t
+ \fi
+ \next }
+\def\f@@t{\bgroup\aftergroup\@foot\let\next}
+\def\f@t#1{#1\@foot}
+\def\@foot{\unskip \strut \lineskiplimit -20pt \endgraf \egroup }
+
+%%%%%%%%% footnote inside an Arabic environment, Roman document style
+
+\def\a@footnote{%
+ \def\@foot{% ArabTeX-LaTeX version
+ \ifx \footglue \undefined % normal case
+ \unskip \strut
+ \else % fnpara.sty is present
+ \penalty-10 \hskip\footglue \egroup % box 0
+ \dp0=0pt \ht0=\fudgefactor\wd0 \box0
+ \fi
+ \egroup \arab@codes \set@arabfont \test@token }%
+ \def\@footnotemark{\af@fnmarkb@x \a@spacetrue}%
+ \rmfamily \parindent \a@parindent \unarab@codes \footnote }
+
+\def\af@fnmarkb@x{%
+ \a@spacefalse \putword@box \@makefnmark}
+
+\def\a@footnotemark{%
+ \def\@footnotemark{\af@fnmarkb@x \a@spacefalse \arab@codes \test@token}%
+ \unarab@codes \footnotemark }
+
+%%%%%%%%% footnote inside an Arabic environment, Arabic document style
+
+\def\a@@footnote{% ArabTeX-LaTeX version
+ \def\@footnotemark{\af@fnmarkb@x \a@spacetrue}%
+ \def\a@fntext{\a@@fntext }%
+ \footnote }
+
+\def\a@@fntext#1{% some common code for footnote text
+ \def\end{%
+ \a@par \egroup \test@token }%
+ \hsize \columnwidth \@parboxrestore
+ \initlineb@x \@footnotemark \test@token #1 \end }
+
+\def\a@@footnotemark{%
+ \def\@footnotemark{\af@fnmarkb@x \a@spacetrue \test@token}%
+ \footnotemark }
+
+\def \LRfootnotes {% left to right, Arabic document
+ \let \a@c@footnote \a@footnote
+ \let \a@c@footnotemark \a@footnotemark }
+\all@wcmd \LRfootnotes
+
+\def \RLfootnotes {% right to left, Arabic document
+ \let \a@c@footnote \a@@footnote
+ \let \a@c@footnotemark \a@@footnotemark }
+\all@wcmd \RLfootnotes
+\let \arabfootnotes \RLfootnotes
+\all@wcmd \arabfootnotes
+
+\LRfootnotes
+
+\endinput
+%%
+%% End of file `afoot.sty'.
diff --git a/Master/texmf-dist/tex/latex/ledmac/ledarab.sty b/Master/texmf-dist/tex/latex/ledmac/ledarab.sty
new file mode 100644
index 00000000000..cab93190138
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ledmac/ledarab.sty
@@ -0,0 +1,213 @@
+%%
+%% This is file `ledarab.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ledarab.dtx (with options: `ledarab')
+%%
+%% Author: Peter Wilson (Herries Press) herries dot press at earthlink dot net
+%% Copyright 2005 Peter R. Wilson
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3 of this license or (at your option) any
+%% later version.
+%% The latest version of the license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2003/06/01 or later.
+%%
+%% This work has the LPPL maintenance status "author-maintained".
+%%
+%% This work consists of the files listed in the README file.
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{ledarab}[2005/03/24 v0.1 Cooperation between arabtex and ledmac]
+
+\providecommand*{\tr@ce@n}{\tracingmacros 0}
+\providecommand*{\tr@ce@ff}{\edef \tr@ce@n
+{\nxp\tracingmacros \the\tracingmacros }\tracingmacros 0}
+\let \tr@ce@n \relax
+
+\newif\if@l@dparpack
+ \@l@dparpackfalse
+\@ifpackageloaded{ledpar}{\@l@dparpacktrue}{\@l@dparpackfalse}
+
+\renewcommand*{\do@linehook}{%
+ \advance\baselineskip 1ex}
+
+%%%%%%%%%%%%%%%%%%%%% ledpar fix %%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\newcommand{\arabledparfixi}{%
+\renewcommand*{\do@lineLhook}{%
+ \advance\baselineskip 1ex}
+\renewcommand*{\do@lineRhook}{%
+ \advance\baselineskip 1ex}
+\newcommand*{\a@l@dparparamsL}{%
+ \ifnum \parshape = \z@
+ \a@hsize \Lcolwidth
+ \a@leftmargin \z@
+ \else
+ \a@hsize \Lcolwidth \a@leftmargin \@totalleftmargin
+ \fi
+ \a@leftmargin \z@
+ \a@prevgraf \z@ \spreadfalse }
+\newcommand*{\a@l@dparparamsR}{%
+ \ifnum \parshape = \z@
+ \a@hsize \Rcolwidth
+ \a@leftmargin \z@
+ \else
+ \a@hsize \Rcolwidth \a@leftmargin \@totalleftmargin
+ \fi
+ \a@leftmargin \z@
+ \a@prevgraf \z@ \spreadfalse }
+\renewcommand*{\Leftsidehook}{%
+ \let\a@parparams\a@l@dparparamsL}
+\renewcommand*{\Rightsidehook}{%
+ \let\a@parparams\a@l@dparparamsR}
+\newcommand*{\ledarabstrut}{%
+ \rule[-1ex]{0pt}{4ex}}
+\newcommand*{\savestruts}{%
+ \let\oldl@dstr@tL\ledstrutL
+ \let\oldl@dstr@tR\ledstrutR}
+\newcommand*{\restorestruts}{%
+ \let\ledstrutL\oldl@dstr@tL
+ \let\ledstrutR\oldl@dstr@tR}
+\newcommand*{\latinarabic}{%
+ \def\ledstrutL{\ledarabstrut}%
+ \def\ledstrutR{}}
+\newcommand*{\arabiclatin}{%
+ \def\ledstrutL{}%
+ \def\ledstrutR{\ledarabstrut}}
+
+}% end of \newcommand{\arabledparfixi}{...
+
+\if@l@dparpack
+ \arabledparfixi
+ \savestruts
+\fi
+%%%%%%%%%%%%%%%%%%%%% end major ledpar fix %%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\newcommand*{\a@c@edtext}{%
+ \tr@ce@n \leavea@vmode \unarab@codes
+\begingroup
+ \tr@ce@ff \rmfamily \tr@ce@n \a@@edtext}
+
+\newcommand*{\a@@edtext}[1]{%
+%%% \def\next@command{\a@@@edtext {\RL{#1}}}% causes errors
+ \def\next@command{\a@@@edtext {#1}}%
+ \futurelet \next@token \test@space }
+
+\def\a@edget@text #1\@@{%
+ \a@edappend{\flag@start}\a@@Linsert{#1}}
+
+\newcommand*{\a@edend@lemma}{%
+ \ifx\end@lemmas\empty \else
+ \gl@p\end@lemmas\to\x@lemma
+ \x@lemma
+ \global\let\x@lemma=\relax
+ \fi}
+
+\newcommand*{\a@edput@text}{%
+ \a@Lunpack \putwordb@x {\ins@skip }}
+
+\newcommand*{\a@edappend}[1]{%
+ \setbox \lineb@x \hbox {\unhbox \lineb@x #1}}
+
+\newcommand{\a@@@edtext}[2]{
+ \no@expands
+ \def\next@command{\test@special}%
+%%% \xdef \@tag{#1}\set@line % the original produces roman in notes
+%%% \def\@@@tag{\RL{#1}} \xdef\@tag{\@@@tag}\set@line % produces errors
+ \xdef \@tag{{\RL{#1}}}\set@line% produces arabic in notes GOOD ONE!!
+ \global\insert@count=0
+ \aftergroup \a@edget@text
+ \ignorespaces #2\relax
+\endgroup
+%%% #1\a@edend@lemma \@@ %% gives roman in arabic text
+ \showlemma{#1}\a@edend@lemma \@@% GOOD ONE
+ \a@edput@text \a@edappend {\flag@end }%
+ \arab@codes
+ \a@spacetrue
+\tr@ce@ff \test@token}
+
+\renewcommand{\showlemma}[1]{%
+ \ifin@arab\RL{#1}\else #1\fi} % arabic in text, but roman in notes
+
+\all@wcmd{\beginnumbering}
+\all@wcmd{\endnumbering}
+
+\if@l@dparpack
+ \all@wcmd{\beginnumberingR}
+ \all@wcmd{\endnumberingR}
+\fi
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\let\a@par=\a@@par % save for \a@@everypar in \a@c@autopar
+
+\def\a@c@pstart{\pstart \test@token}
+\def\a@c@pend{\a@par \pend \a@par \test@token}
+
+\def\a@c@autopar{% use inside Arabic environment
+\ifnumbering \else \errmessage
+{\string\autopar\space must be used within a numbered section}%
+\beginnumbering
+\fi
+\a@@everypar= {\setbox0 = \box \lineb@x \let \next \test@token
+\a@par \pstart % starts a group
+\def \a@@par {\a@par \pend \a@par }%
+\def \end {\a@par \pend \test@token \end }%
+\a@@everypar= {}\arab@indent }%
+\a@spacefalse \test@token}
+
+\all@w@ne{\@arabic}
+\newcommand*{\arablinenumr@p}[1]{\RL{\@arabic{#1}}}
+
+\def\linenumrep#1{\LR{\@arabic{#1}}}
+\let\oldlinenumrep\linenumrep
+\def\sublinenumrep#1{\LR{\@arabic{#1}}}
+\let\oldsublinenumrep\sublinenumrep
+\newcommand*{\arablnumrep}{\global\let\linenumrep\arablinenumr@p
+ \global\let\sublinenumrep\arablinenumr@p}
+\newcommand*{\restorelnumrep}{\global\let\linenumrep\oldlinenumrep
+ \global\let\sublinenumrep\oldsublinenumrep}
+\all@wcmd{\arablnumrep}
+\all@wcmd{\restorelnumrep}
+
+\if@l@dparpack
+ \def\linenumrepR#1{\LR{\@arabic{#1}}}
+ \let\oldlinenumrepR\linenumrepR
+ \def\sublinenumrepR#1{\LR{\@arabic{#1}}}
+ \let\oldsublinenumrepR\sublinenumrepR
+ \newcommand*{\arablnumrepR}{\global\let\linenumrepR\arablinenumr@p
+ \global\let\sublinenumrepR\arablinenumr@p}
+ \newcommand*{\restorelnumrepR}{\global\let\linenumrepR\oldlinenumrepR
+ \global\let\sublinenumrepR\oldsublinenumrepR}
+ \all@wcmd{\arablnumrepR}
+ \all@wcmd{\restorelnumrepR}
+\fi
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\all@w@ne{\edlabel}
+\all@w@ne{\edpageref}
+\all@w@ne{\xpageref}
+\all@w@ne{\lineref}
+\all@w@ne{\xlineref}
+\all@w@ne{\sublineref}
+\all@w@ne{\xsublineref}
+\all@w@ne{\edindex}
+\all@w@ne{\typeout}
+\all@wtw@{\edmakelabel}
+\all@wtw@{\xxref}
+
+\if@l@dparpack
+ \all@wcmd{\Columns}
+ \all@wcmd{\Pages}
+\fi
+
+\InputIfFileExists{ledarabpatch.sty}
+
+\endinput
+%%
+%% End of file `ledarab.sty'.
diff --git a/Master/texmf-dist/tex/latex/ledmac/ledmac.sty b/Master/texmf-dist/tex/latex/ledmac/ledmac.sty
new file mode 100644
index 00000000000..d92fc341a76
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ledmac/ledmac.sty
@@ -0,0 +1,3239 @@
+%%
+%% This is file `ledmac.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ledmac.dtx (with options: `code')
+%%
+%% Author: Peter Wilson (Herries Press) herries dot press at earthlink dot net
+%% Copyright 2003 -- 2005 Peter R. Wilson
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3 of this license or (at your option) any
+%% later version.
+%% The latest version of the license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2003/06/01 or later.
+%%
+%% This work has the LPPL maintenance status "author-maintained".
+%%
+%% This work consists of the files listed in the README file.
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{ledmac}[2005/03/24 v0.7 LaTeX port of EDMAC]
+
+\newif\ifledfinal
+\DeclareOption{final}{\ledfinaltrue}
+\DeclareOption{draft}{\ledfinalfalse}
+\ExecuteOptions{final}
+\ProcessOptions*\relax
+
+\ifledfinal
+ \newcommand*{\showlemma}[1]{#1}
+\else
+ \newcommand*{\showlemma}[1]{\textit{#1}}
+\fi
+
+\let\linenumberlist=\empty
+
+\newcount\@l@dtempcnta \newcount\@l@dtempcntb
+\newif\ifl@dmemoir
+\@ifclassloaded{memoir}{\l@dmemoirtrue}{\l@dmemoirfalse}
+
+\newcommand{\ledmac@warning}[1]{\PackageWarning{ledmac}{#1}}
+\newcommand{\ledmac@error}[2]{\PackageError{ledmac}{#1}{#2}}
+\newcommand*{\led@err@NumberingStarted}{%
+ \ledmac@error{Numbering has already been started}{\@ehc}}
+\newcommand*{\led@err@NumberingNotStarted}{%
+ \ledmac@error{Numbering was not started}{\@ehc}}
+\newcommand*{\led@err@NumberingShouldHaveStarted}{%
+ \ledmac@error{Numbering should already have been started}{\@ehc}}
+\newcommand*{\led@mess@NotesChanged}{%
+ \typeout{ledmac reminder: }%
+ \typeout{ The number of footnotes in this section
+ has changed since the last run.}%
+ \typeout{ You will need to run LaTeX two more times
+ before the footnote placement}%
+ \typeout{ and line numbering in this section are
+ correct.}}
+\newcommand*{\led@mess@SectionContinued}[1]{%
+ \message{Section #1 (continuing the previous section)}}
+\newcommand*{\led@err@LineationInNumbered}{%
+ \ledmac@error{You can't use \string\lineation\space within
+ a numbered section}{\@ehc}}
+\newcommand*{\led@warn@BadLineation}{%
+ \ledmac@warning{Bad \string\lineation\space argument}}
+\newcommand*{\led@warn@BadLinenummargin}{%
+ \ledmac@warning{Bad \string\linenummargin\space argument}}
+\newcommand*{\led@warn@BadLockdisp}{%
+ \ledmac@warning{Bad \string\lockdisp\space argument}}
+\newcommand*{\led@warn@BadSublockdisp}{%
+ \ledmac@warning{Bad \string\sublockdisp\space argument}}
+\newcommand*{\led@warn@NoLineFile}[1]{%
+ \ledmac@warning{Can't find line-list file #1}}
+\newcommand*{\led@warn@BadAdvancelineSubline}{%
+ \ledmac@warning{\string\advanceline\space produced a sub-line
+ number less than zero.}}
+\newcommand*{\led@warn@BadAdvancelineLine}{%
+ \ledmac@warning{\string\advanceline\space produced a line
+ number less than zero.}}
+\newcommand*{\led@warn@BadSetline}{%
+ \ledmac@warning{Bad \string\setline\space argument}}
+\newcommand*{\led@warn@BadSetlinenum}{%
+ \ledmac@warning{Bad \string\setlinenum\space argument}}
+\newcommand*{\led@err@PstartNotNumbered}{%
+ \ledmac@error{\string\pstart\space must be used within a
+ numbered section}{\@ehc}}
+\newcommand*{\led@err@PstartInPstart}{%
+ \ledmac@error{\string\pstart\space encountered while another
+ \string\pstart\space was in effect}{\@ehc}}
+\newcommand*{\led@err@PendNotNumbered}{%
+ \ledmac@error{\string\pend\space must be used within a
+ numbered section}{\@ehc}}
+\newcommand*{\led@err@PendNoPstart}{%
+ \ledmac@error{\string\pend\space must follow a \string\pstart}{\@ehc}}
+\newcommand*{\led@err@AutoparNotNumbered}{%
+ \ledmac@error{\string\autopar\space must be used within a
+ numbered section}{\@ehc}}
+\newcommand*{\led@warn@BadAction}{%
+ \ledmac@warning{Bad action code, value \next@action.}}
+\newcommand*{\led@warn@DuplicateLabel}[1]{%
+ \ledmac@warning{Duplicate definition of label `#1' on page \the\pageno.}}
+\newcommand*{\led@warn@RefUndefined}[1]{%
+ \ledmac@warning{Reference `#1' on page \the\pageno\space undefined.
+ Using `000'.}}
+\newcommand*{\led@warn@NoMarginpars}{%
+ \ledmac@warning{You can't use \string\marginpar\space in numbered text}}
+\newcommand*{\led@warn@BadSidenotemargin}{%
+ \ledmac@warning{Bad \string\sidenotemmargin\space argument}}
+\newcommand*{\led@warn@NoIndexFile}[1]{%
+ \ledmac@warning{Undefined index file #1}}
+\newcommand*{\led@err@TooManyColumns}{%
+ \ledmac@error{Too many columns}{\@ehc}}
+\newcommand*{\led@err@UnequalColumns}{%
+ \ledmac@error{Number of columns is not equal to the number
+ in the previous row (or \protect\\ \space forgotten?)}{\@ehc}}
+\newcommand*{\led@err@LowStartColumn}{%
+ \ledmac@error{Start column is too low}{\@ehc}}
+\newcommand*{\led@err@HighEndColumn}{%
+ \ledmac@error{End column is too high}{\@ehc}}
+\newcommand*{\led@err@ReverseColumns}{%
+ \ledmac@error{Start column is greater than end column}{\@ehc}}
+\newcount\section@num
+\section@num=0
+\let\extensionchars=\empty
+\newif\ifnumbering
+\newif\ifl@dpairing
+ \l@dpairingfalse
+\newif\ifpst@rtedL
+ \pst@rtedLfalse
+\newcount\l@dnumpstartsL
+
+\newcommand*{\beginnumbering}{%
+ \ifnumbering
+ \led@err@NumberingStarted
+ \endnumbering
+ \fi
+ \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*{\initnumbering@reg}{%
+ \global\pst@rtedLfalse
+ \global\l@dnumpstartsL \z@
+ \global\absline@num \z@
+ \global\line@num \z@
+ \global\subline@num \z@
+ \global\@lock \z@
+ \global\sub@lock \z@
+ \global\sublines@false
+ \global\let\next@page@num=\relax
+ \global\let\sub@change=\relax}
+
+\def\endnumbering{%
+ \ifnumbering
+ \global\numberingfalse
+ \normal@pars
+ \ifl@dpairing
+ \global\pst@rtedLfalse
+ \else
+ \ifx\insertlines@list\empty\else
+ \global\noteschanged@true
+ \fi
+ \ifx\line@list\empty\else
+ \global\noteschanged@true
+ \fi
+ \fi
+ \ifnoteschanged@
+ \led@mess@NotesChanged
+ \fi
+ \else
+ \led@err@NumberingNotStarted
+ \fi}
+
+\newcommand{\pausenumbering}{%
+ \endnumbering\global\numberingtrue}
+\newcommand*{\resumenumbering}{%
+ \ifnumbering
+ \global\pst@rtedLtrue
+ \global\advance\section@num \@ne
+ \led@mess@SectionContinued{\the\section@num}%
+ \line@list@stuff{\jobname.\extensionchars\the\section@num}%
+ \l@dend@stuff
+ \else
+ \led@err@NumberingShouldHaveStarted
+ \endnumbering
+ \beginnumbering
+ \fi}
+
+\newif\ifbypage@
+\newcommand*{\lineation}[1]{{%
+ \ifnumbering
+ \led@err@LineationInNumbered
+ \else
+ \def\@tempa{#1}\def\@tempb{page}%
+ \ifx\@tempa\@tempb
+ \global\bypage@true
+ \else
+ \def\@tempb{section}%
+ \ifx\@tempa\@tempb
+ \global\bypage@false
+ \else
+ \led@warn@BadLineation
+ \fi
+ \fi
+ \fi}}
+
+\newcount\line@margin
+\newcommand*{\linenummargin}[1]{{%
+ \l@dgetline@margin{#1}%
+ \ifnum\@l@dtempcntb>\m@ne
+ \global\line@margin=\@l@dtempcntb
+ \fi}}
+\newcommand*{\l@dgetline@margin}[1]{%
+ \def\@tempa{#1}\def\@tempb{left}%
+ \ifx\@tempa\@tempb
+ \@l@dtempcntb \z@
+ \else
+ \def\@tempb{right}%
+ \ifx\@tempa\@tempb
+ \@l@dtempcntb \@ne
+ \else
+ \def\@tempb{outer}%
+ \ifx\@tempa\@tempb
+ \@l@dtempcntb \tw@
+ \else
+ \def\@tempb{inner}%
+ \ifx\@tempa\@tempb
+ \@l@dtempcntb \thr@@
+ \else
+ \led@warn@BadLinenummargin
+ \@l@dtempcntb \m@ne
+ \fi
+ \fi
+ \fi
+ \fi}
+
+\newcounter{firstlinenum}
+ \setcounter{firstlinenum}{5}
+\newcounter{linenumincrement}
+ \setcounter{linenumincrement}{5}
+\newcounter{firstsublinenum}
+ \setcounter{firstsublinenum}{5}
+\newcounter{sublinenumincrement}
+ \setcounter{sublinenumincrement}{5}
+
+\newcommand*{\firstlinenum}[1]{\setcounter{firstlinenum}{#1}}
+\newcommand*{\linenumincrement}[1]{\setcounter{linenumincrement}{#1}}
+\newcommand*{\firstsublinenum}[1]{\setcounter{firstsublinenum}{#1}}
+\newcommand*{\sublinenumincrement}[1]{\setcounter{sublinenumincrement}{#1}}
+
+\newcount\lock@disp
+\newcommand{\lockdisp}[1]{{%
+ \l@dgetlock@disp{#1}%
+ \ifnum\@l@dtempcntb>\m@ne
+ \global\lock@disp=\@l@dtempcntb
+ \else
+ \led@warn@BadLockdisp
+ \fi}}
+\newcommand*{\l@dgetlock@disp}[1]{
+ \def\@tempa{#1}\def\@tempb{first}%
+ \ifx\@tempa\@tempb
+ \@l@dtempcntb \z@
+ \else
+ \def\@tempb{last}%
+ \ifx\@tempa\@tempb
+ \@l@dtempcntb \@ne
+ \else
+ \def\@tempb{all}%
+ \ifx\@tempa\@tempb
+ \@l@dtempcntb \tw@
+ \else
+ \@l@dtempcntb \m@ne
+ \fi
+ \fi
+ \fi}
+
+\newcount\sublock@disp
+\newcommand{\sublockdisp}[1]{{%
+ \l@dgetlock@disp{#1}%
+ \ifnum\@l@dtempcntb>\m@ne
+ \global\sublock@disp=\@l@dtempcntb
+ \else
+ \led@warn@BadSublockdisp
+ \fi}}
+
+\newcommand*{\linenumberstyle}[1]{%
+ \def\linenumrep##1{\@nameuse{@#1}{##1}}}
+\newcommand*{\sublinenumberstyle}[1]{%
+ \def\sublinenumrep##1{\@nameuse{@#1}{##1}}}
+\linenumberstyle{arabic}
+ \let\linenumr@p\linenumrep
+\sublinenumberstyle{arabic}
+ \let\sublinenumr@p\sublinenumrep
+
+\newlength{\linenumsep}
+ \setlength{\linenumsep}{1pc}
+\newcommand*{\numlabfont}{\normalfont\scriptsize}
+\newcommand*{\ledlinenum}{%
+ \numlabfont\linenumrep{\line@num}%
+ \ifsublines@
+ \ifnum\subline@num>0\relax
+ \unskip\fullstop\sublinenumrep{\subline@num}%
+ \fi
+ \fi}
+\newcommand*{\leftlinenum}{%
+ \ledlinenum
+ \kern\linenumsep}
+\newcommand*{\rightlinenum}{%
+ \kern\linenumsep
+ \ledlinenum}
+
+\newcommand*{\list@create}[1]{\global\let#1=\empty}
+\newcommand*{\list@clear}[1]{\global\let#1=\empty}
+\newtoks\@toksa \newtoks\@toksb
+\global\@toksa={\\}
+\long\def\xright@appenditem#1\to#2{%
+ \global\@toksb=\expandafter{#2}%
+ \xdef#2{\the\@toksb\the\@toksa\expandafter{#1}}%
+ \global\@toksb={}}
+\long\def\xleft@appenditem#1\to#2{%
+ \global\@toksb=\expandafter{#2}%
+ \xdef#2{\the\@toksa\expandafter{#1}\the\@toksb}%
+ \global\@toksb={}}
+\def\gl@p#1\to#2{\expandafter\gl@poff#1\gl@poff#1#2}
+\long\def\gl@poff\\#1#2\gl@poff#3#4{\gdef#4{#1}\gdef#3{#2}}
+
+\newcount\line@num
+\newcount\subline@num
+\newif\ifsublines@
+\newcount\absline@num
+\newcount\@lock
+\newcount\sub@lock
+\list@create{\line@list}
+\list@create{\insertlines@list}
+\list@create{\actionlines@list}
+\list@create{\actions@list}
+
+\newcount\page@num
+\newcount\endpage@num
+\newcount\endline@num
+\newcount\endsubline@num
+\newif\ifnoteschanged@
+\newread\@inputcheck
+\newcommand*{\read@linelist}[1]{%
+ \list@clearing@reg
+ \get@linelistfile{#1}%
+ \endgroup
+
+ \global\page@num=\m@ne
+ \ifx\actionlines@list\empty
+ \gdef\next@actionline{1000000}%
+ \else
+ \gl@p\actionlines@list\to\next@actionline
+ \gl@p\actions@list\to\next@action
+ \fi}
+
+\newcommand*{\list@clearing@reg}{%
+ \list@clear{\line@list}%
+ \list@clear{\insertlines@list}%
+ \list@clear{\actionlines@list}%
+ \list@clear{\actions@list}}
+\newcommand*{\get@linelistfile}[1]{%
+ \InputIfFileExists{#1}{%
+ \global\noteschanged@false
+ \begingroup
+ \catcode`\[=1 \catcode`\]=2
+ \makeatletter \catcode`\^^M=9}{%
+ \led@warn@NoLineFile{#1}%
+ \global\noteschanged@true
+ \begingroup}%
+}
+
+\newcommand{\@l}[2]{%
+ \fix@page{#1}%
+ \@l@reg}
+\newcommand*{\@l@reg}{%
+ \ifx\l@dchset@num\relax \else
+ \advance\absline@num \@ne
+ \set@line@action
+ \let\l@dchset@num=\relax
+ \advance\absline@num \m@ne
+ \advance\line@num \m@ne
+ \fi
+ \advance\absline@num \@ne
+ \ifx\next@page@num\relax \else
+ \page@action
+ \let\next@page@num=\relax
+ \fi
+ \ifx\sub@change\relax \else
+ \ifnum\sub@change>\z@
+ \sublines@true
+ \else
+ \sublines@false
+ \fi
+ \sub@action
+ \let\sub@change=\relax
+ \fi
+ \ifcase\@lock
+ \or
+ \@lock \tw@
+ \or \or
+ \@lock \z@
+ \fi
+ \ifcase\sub@lock
+ \or
+ \sub@lock \tw@
+ \or \or
+ \sub@lock \z@
+ \fi
+ \ifsublines@
+ \ifnum\sub@lock<\tw@
+ \advance\subline@num \@ne
+ \fi
+ \else
+ \ifnum\@lock<\tw@
+ \advance\line@num \@ne \subline@num \z@
+ \fi
+ \fi}
+
+\newcommand*{\@page}[1]{%
+ \ifbypage@
+ \line@num \z@ \subline@num \z@
+ \fi
+ \page@num=#1\relax
+ \def\next@page@num{#1}}
+
+\newcount\last@page@num
+ \last@page@num=-10000
+\newcommand*{\fix@page}[1]{%
+ \ifnum #1=\last@page@num
+ \else
+ \ifbypage@
+ \line@num=\z@ \subline@num=\z@
+ \fi
+ \page@num=#1\relax
+ \last@page@num=#1\relax
+ \def\next@page@num{#1}%
+ \fi}
+
+\newcommand*{\@pend}[1]{}
+\newcommand*{\@pendR}[1]{}
+\newcommand*{\@lopL}[1]{}
+\newcommand*{\@lopR}[1]{}
+
+\newcommand*{\sub@on}{\ifsublines@
+ \let\sub@change=\relax
+ \else
+ \def\sub@change{1}%
+ \fi}
+\newcommand*{\sub@off}{\ifsublines@
+ \def\sub@change{-1}%
+ \else
+ \let\sub@change=\relax
+ \fi}
+
+\newcommand*{\@adv}[1]{\ifsublines@
+ \advance\subline@num by #1\relax
+ \ifnum\subline@num<\z@
+ \led@warn@BadAdvancelineSubline
+ \subline@num \z@
+ \fi
+ \else
+ \advance\line@num by #1\relax
+ \ifnum\line@num<\z@
+ \led@warn@BadAdvancelineLine
+ \line@num \z@
+ \fi
+ \fi
+ \set@line@action}
+
+\newcommand*{\@set}[1]{\ifsublines@
+ \subline@num=#1\relax
+ \else
+ \line@num=#1\relax
+ \fi
+ \set@line@action}
+
+\newcommand*{\l@d@set}[1]{%
+ \line@num=#1\relax
+ \advance\line@num \@ne
+ \def\l@dchset@num{#1}}
+\let\l@dchset@num\relax
+
+\newcommand*{\page@action}{%
+ \xright@appenditem{\the\absline@num}\to\actionlines@list
+ \xright@appenditem{\next@page@num}\to\actions@list}
+\newcommand*{\set@line@action}{%
+ \xright@appenditem{\the\absline@num}\to\actionlines@list
+ \ifsublines@
+ \@l@dtempcnta=-\subline@num
+ \else
+ \@l@dtempcnta=-\line@num
+ \fi
+ \advance\@l@dtempcnta by -5000
+ \xright@appenditem{\the\@l@dtempcnta}\to\actions@list}
+\newcommand*{\sub@action}{%
+ \xright@appenditem{\the\absline@num}\to\actionlines@list
+ \ifsublines@
+ \xright@appenditem{-1001}\to\actions@list
+ \else
+ \xright@appenditem{-1002}\to\actions@list
+ \fi}
+\newcommand*{\lock@on}{\futurelet\next\do@lockon}
+\newcommand*{\do@lockon}{%
+ \ifx\next\lock@off
+ \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
+ \fi}
+\newcommand*{\do@lockoff}{%
+ \xright@appenditem{\the\absline@num}\to\actionlines@list
+ \ifsublines@
+ \xright@appenditem{-1006}\to\actions@list
+ \ifnum\sub@lock=\tw@
+ \sub@lock \thr@@
+ \else
+ \sub@lock \z@
+ \fi
+ \else
+ \xright@appenditem{-1004}\to\actions@list
+ \ifnum\@lock=\tw@
+ \@lock \thr@@
+ \else
+ \@lock \z@
+ \fi
+ \fi}
+\newcommand*{\skip@lockoff}{\global\let\lock@off=\do@lockoff}
+\global\let\lock@off=\do@lockoff
+
+\newcommand*{\n@num}{\n@num@reg}
+\newcommand*{\n@num@reg}{%
+ \xright@appenditem{\the\absline@num}\to\actionlines@list
+ \xright@appenditem{-1007}\to\actions@list}
+
+\newcount\insert@count
+\newcommand*{\dummy@ref}[2]{#2}
+\newcommand*{\@ref}[2]{%
+ \@ref@reg{#1}{#2}}
+\newcommand*{\@ref@reg}[2]{%
+ \global\insert@count=#1\relax
+ \loop\ifnum\insert@count>\z@
+ \xright@appenditem{\the\absline@num}\to\insertlines@list
+ \global\advance\insert@count \m@ne
+ \repeat
+ \begingroup
+ \let\@ref=\dummy@ref
+ \let\page@action=\relax
+ \let\sub@action=\relax
+ \let\set@line@action=\relax
+ \let\@lab=\relax
+ #2
+ \global\endpage@num=\page@num
+ \global\endline@num=\line@num
+ \global\endsubline@num=\subline@num
+ \endgroup
+ \xright@appenditem%
+ {\the\page@num|\the\line@num|%
+ \ifsublines@ \the\subline@num \else 0\fi|%
+ \the\endpage@num|\the\endline@num|%
+ \ifsublines@ \the\endsubline@num \else 0\fi}\to\line@list
+ #2}
+
+\newwrite\linenum@out
+\newif\iffirst@linenum@out@
+ \first@linenum@out@true
+\newcommand*{\line@list@stuff}[1]{%
+ \read@linelist{#1}%
+ \iffirst@linenum@out@
+ \immediate\closeout\linenum@out
+ \global\first@linenum@out@false
+ \immediate\openout\linenum@out=#1\relax
+ \else
+ \closeout\linenum@out
+ \openout\linenum@out=#1\relax
+ \fi}
+
+\newcommand*{\new@line}{\write\linenum@out{\string\@l[\the\c@page][\thepage]}}
+\newcommand*{\flag@start}{%
+ \edef\next{\write\linenum@out{%
+ \string\@ref[\the\insert@count][}}%
+ \next}
+\newcommand*{\flag@end}{\write\linenum@out{]}}
+\newcommand*{\page@start}{}
+
+\newcommand*{\startsub}{\dimen0\lastskip
+ \ifdim\dimen0>0pt \unskip \fi
+ \write\linenum@out{\string\sub@on}%
+ \ifdim\dimen0>0pt \hskip\dimen0 \fi}
+\def\endsub{\dimen0\lastskip
+ \ifdim\dimen0>0pt \unskip \fi
+ \write\linenum@out{\string\sub@off}%
+ \ifdim\dimen0>0pt \hskip\dimen0 \fi}
+
+\newcommand*{\advanceline}[1]{\write\linenum@out{\string\@adv[#1]}}
+\newcommand*{\setline}[1]{%
+ \ifnum#1<\z@
+ \led@warn@BadSetline
+ \else
+ \write\linenum@out{\string\@set[#1]}%
+ \fi}
+
+\newcommand*{\setlinenum}[1]{%
+ \ifnum#1<\z@
+ \led@warn@BadSetlinenum
+ \else
+ \write\linenum@out{\string\l@d@set[#1]}%
+ \fi}
+
+\newcommand*{\startlock}{\write\linenum@out{\string\lock@on}}
+\def\endlock{\write\linenum@out{\string\lock@off}}
+
+\newif\ifl@dskipnumber
+ \l@dskipnumberfalse
+\newcommand*{\skipnumbering}{\skipnumbering@reg}
+\newcommand*{\skipnumbering@reg}{%
+ \write\linenum@out{\string\n@num}%
+ \advanceline{-1}}
+
+\list@create{\end@lemmas}
+\long\def\dummy@text#1#2/{#1}
+\newcommand{\dummy@edtext}[2]{#1}
+\newcommand*{\no@expands}{\let\rm=0\let\it=0\let\sl=0\let\bf=0\let\tt=0%
+ \let\b=0\let\c=0\let\d=0\let\t=0%
+ \let\select@@lemmafont=0%
+ \def\protect{\noexpand\protect\noexpand}%
+ \let\startsub=\relax \let\endsub=\relax
+ \let\startlock=\relax \let\endlock=\relax
+ \let\edlabel=\@gobble
+ \let\setline=\@gobble \let\advanceline=\@gobble
+ \let\critext=\dummy@text
+ \let\edtext=\dummy@edtext
+ \l@dtabnoexpands
+ \morenoexpands}
+\let\morenoexpands=\relax
+
+\long\def\critext#1#2/{\leavevmode
+ \begingroup
+ \no@expands
+ \xdef\@tag{#1}%
+ \set@line
+ \global\insert@count=0
+ \ignorespaces #2\relax
+ \flag@start
+ \endgroup
+ \showlemma{#1}%
+ \ifx\end@lemmas\empty \else
+ \gl@p\end@lemmas\to\x@lemma
+ \x@lemma
+ \global\let\x@lemma=\relax
+ \fi
+ \flag@end}
+\newcommand{\edtext}[2]{\leavevmode
+ \begingroup
+ \no@expands
+ \xdef\@tag{#1}%
+ \set@line
+ \global\insert@count=0
+ \ignorespaces #2\relax
+ \flag@start
+ \endgroup
+ \showlemma{#1}%
+ \ifx\end@lemmas\empty \else
+ \gl@p\end@lemmas\to\x@lemma
+ \x@lemma
+ \global\let\x@lemma=\relax
+ \fi
+ \flag@end}
+
+\newcommand*{\set@line}{%
+ \ifx\line@list\empty
+ \global\noteschanged@true
+ \xdef\l@d@nums{000|000|000|000|000|000|\edfont@info}%
+ \else
+ \gl@p\line@list\to\@tempb
+ \xdef\l@d@nums{\@tempb|\edfont@info}%
+ \global\let\@tempb=\undefined
+ \fi}
+
+\newcommand*{\edfont@info}{\f@encoding/\f@family/\f@series/\f@shape}
+
+\newcommand*{\lemma}[1]{\xdef\@tag{#1}\ignorespaces}
+\newcommand*{\linenum}[1]{%
+ \xdef\@tempa{#1|||||||\noexpand\\\l@d@nums}%
+ \global\let\l@d@nums=\empty
+ \expandafter\line@set\@tempa|\\\ignorespaces}
+\def\line@set#1|#2\\#3|#4\\{%
+ \gdef\@tempb{#1}%
+ \ifx\@tempb\empty
+ \l@d@add{#3}%
+ \else
+ \l@d@add{#1}%
+ \fi
+ \gdef\@tempb{#4}%
+ \ifx\@tempb\empty\else
+ \l@d@add{|}\line@set#2\\#4\\%
+ \fi}
+\newcommand{\l@d@add}[1]{\xdef\l@d@nums{\l@d@nums#1}}
+
+\newbox\raw@text
+\newif\ifnumberedpar@
+\newcount\num@lines
+\newbox\one@line
+\newcount\par@line
+\newcommand*{\pstart}{\ifnumbering \else
+ \led@err@PstartNotNumbered
+ \beginnumbering
+ \fi
+ \ifnumberedpar@
+ \led@err@PstartInPstart
+ \pend
+ \fi
+ \list@clear{\inserts@list}%
+ \global\let\next@insert=\empty
+ \begingroup\normal@pars
+ \global\setbox\raw@text=\vbox\bgroup
+ \numberedpar@true}
+\newcommand*{\pend}{\ifnumbering \else
+ \led@err@PendNotNumbered
+ \fi
+ \ifnumberedpar@ \else
+ \led@err@PendNoPstart
+ \fi
+ \l@dzeropenalties
+ \endgraf\global\num@lines=\prevgraf\egroup
+ \global\par@line=0
+ \loop\ifvbox\raw@text
+ \do@line
+ \repeat
+ \flush@notes
+ \endgroup
+ \ignorespaces}
+
+\newcommand*{\l@dzeropenalties}{%
+ \brokenpenalty \z@ \clubpenalty \z@
+ \displaywidowpenalty \z@ \interlinepenalty \z@ \predisplaypenalty \z@
+ \postdisplaypenalty \z@ \widowpenalty \z@}
+
+\newcommand*{\autopar}{\ifnumbering \else
+ \led@err@AutoparNotNumbered
+ \beginnumbering
+ \fi
+ \everypar={\setbox0=\lastbox
+ \endgraf \vskip-\parskip
+ \pstart \noindent \kern\wd0
+ \let\par=\pend}%
+ \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
+ \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}
+
+\newcommand*{\do@linehook}{}
+\newcommand*{\l@demptyd@ta}{%
+ \gdef\l@dld@ta{}%
+ \gdef\l@drd@ta{}%
+ \gdef\l@dcsnotetext{}}
+
+\newcommand{\l@dlsn@te}{%
+ \hb@xt@ \z@{\hss\box\l@dlp@rbox\kern\ledlsnotesep}}
+\newcommand{\l@drsn@te}{%
+ \hb@xt@ \z@{\kern\ledrsnotesep\box\l@drp@rbox\hss}}
+
+\newcommand*{\ledllfill}{\hfil}
+\newcommand*{\ledrlfill}{}
+
+\newcommand*{\getline@num}{%
+ \global\advance\absline@num \@ne
+ \do@actions
+ \do@ballast
+ \ifsublines@
+ \ifnum\sub@lock<\tw@
+ \global\advance\subline@num \@ne
+ \fi
+ \else
+ \ifnum\@lock<\tw@
+ \global\advance\line@num \@ne
+ \global\subline@num \z@
+ \fi
+ \fi}
+
+\newcount\ballast@count
+\newcounter{ballast}
+ \setcounter{ballast}{0}
+\newcommand*{\do@ballast}{\global\ballast@count \z@
+ \begingroup
+ \advance\absline@num \@ne
+ \ifnum\next@actionline=\absline@num
+ \ifnum\next@action>-1001\relax
+ \global\advance\ballast@count by -\c@ballast
+ \fi
+ \fi
+ \endgroup}
+\newcommand*{\do@actions}{%
+ \global\let\do@actions@next=\relax
+ \ifnum\absline@num<\next@actionline\else
+ \ifnum\next@action>-1001
+ \global\page@num=\next@action
+ \ifbypage@
+ \global\line@num=\z@ \global\subline@num=\z@
+ \fi
+ \else
+ \ifnum\next@action<-4999
+ \@l@dtempcnta=-\next@action
+ \advance\@l@dtempcnta by -5001
+ \ifsublines@
+ \global\subline@num=\@l@dtempcnta
+ \else
+ \global\line@num=\@l@dtempcnta
+ \fi
+ \else
+ \@l@dtempcnta=-\next@action
+ \advance\@l@dtempcnta by -1000
+ \do@actions@fixedcode
+ \fi
+ \fi
+ \ifx\actionlines@list\empty
+ \gdef\next@actionline{1000000}%
+ \else
+ \gl@p\actionlines@list\to\next@actionline
+ \gl@p\actions@list\to\next@action
+ \global\let\do@actions@next=\do@actions
+ \fi
+ \fi
+\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}
+
+\newcommand*{\affixline@num}{%
+\ifl@dskipnumber
+ \global\l@dskipnumberfalse
+\else
+ \ifsublines@
+ \@l@dtempcntb=\subline@num
+ \ifnum\subline@num>\c@firstsublinenum
+ \@l@dtempcnta=\subline@num
+ \advance\@l@dtempcnta by-\c@firstsublinenum
+ \divide\@l@dtempcnta by\c@sublinenumincrement
+ \multiply\@l@dtempcnta by\c@sublinenumincrement
+ \advance\@l@dtempcnta by\c@firstsublinenum
+ \else
+ \@l@dtempcnta=\c@firstsublinenum
+ \fi
+ \ch@cksub@l@ck
+ \else
+ \@l@dtempcntb=\line@num
+ \ifx\linenumberlist\empty
+ \ifnum\line@num>\c@firstlinenum
+ \@l@dtempcnta=\line@num
+ \advance\@l@dtempcnta by-\c@firstlinenum
+ \divide\@l@dtempcnta by\c@linenumincrement
+ \multiply\@l@dtempcnta by\c@linenumincrement
+ \advance\@l@dtempcnta by\c@firstlinenum
+ \else
+ \@l@dtempcnta=\c@firstlinenum
+ \fi
+ \else
+ \@l@dtempcnta=\line@num
+ \edef\rem@inder{,\linenumberlist,\number\line@num,}%
+ \edef\sc@n@list{\def\noexpand\sc@n@list
+ ####1,\number\@l@dtempcnta,####2|{\def\noexpand\rem@inder{####2}}}%
+ \sc@n@list\expandafter\sc@n@list\rem@inder|%
+ \ifx\rem@inder\empty\advance\@l@dtempcnta\@ne\fi
+ \fi
+ \ch@ck@l@ck
+ \fi
+ \ifnum\@l@dtempcnta=\@l@dtempcntb
+ \if@twocolumn
+ \if@firstcolumn
+ \gdef\l@dld@ta{\llap{{\leftlinenum}}}%
+ \else
+ \gdef\l@drd@ta{\rlap{{\rightlinenum}}}%
+ \fi
+ \else
+ \@l@dtempcntb=\line@margin
+ \ifnum\@l@dtempcntb>\@ne
+ \advance\@l@dtempcntb \page@num
+ \fi
+ \ifodd\@l@dtempcntb
+ \gdef\l@drd@ta{\rlap{{\rightlinenum}}}%
+ \else
+ \gdef\l@dld@ta{\llap{{\leftlinenum}}}%
+ \fi
+ \fi
+ \else
+%% #1%
+ \fi
+ \f@x@l@cks
+\fi}
+
+\newcommand*{\ch@cksub@l@ck}{%
+ \ifcase\sub@lock
+ \or
+ \ifnum\sublock@disp=\@ne
+ \@l@dtempcntb=\z@ \@l@dtempcnta=\@ne
+ \fi
+ \or
+ \ifnum\sublock@disp=\tw@ \else
+ \@l@dtempcntb=\z@ \@l@dtempcnta=\@ne
+ \fi
+ \or
+ \ifnum\sublock@disp=\z@
+ \@l@dtempcntb=\z@ \@l@dtempcnta=\@ne
+ \fi
+ \fi}
+\newcommand*{\ch@ck@l@ck}{%
+ \ifcase\@lock
+ \or
+ \ifnum\lock@disp=\@ne
+ \@l@dtempcntb=\z@ \@l@dtempcnta=\@ne
+ \fi
+ \or
+ \ifnum\lock@disp=\tw@ \else
+ \@l@dtempcntb=\z@ \@l@dtempcnta=\@ne
+ \fi
+ \or
+ \ifnum\lock@disp=\z@
+ \@l@dtempcntb=\z@ \@l@dtempcnta=\@ne
+ \fi
+ \fi}
+\newcommand*{\f@x@l@cks}{%
+ \ifcase\@lock
+ \or
+ \global\@lock=\tw@
+ \or \or
+ \global\@lock=\z@
+ \fi
+ \ifcase\sub@lock
+ \or
+ \global\sub@lock=\tw@
+ \or \or
+ \global\sub@lock=\z@
+ \fi}
+
+\newcommand{\pageparbreak}{\pend\newpage\pstart\noindent}
+
+\list@create{\inserts@list}
+\newcommand*{\add@inserts}{%
+ \global\let\add@inserts@next=\relax
+ \ifx\inserts@list\empty \else
+ \ifx\next@insert\empty
+ \ifx\insertlines@list\empty
+ \global\noteschanged@true
+ \gdef\next@insert{100000}%
+ \else
+ \gl@p\insertlines@list\to\next@insert
+ \fi
+ \fi
+ \ifnum\next@insert=\absline@num
+ \gl@p\inserts@list\to\@insert
+ \@insert
+ \global\let\@insert=\undefined
+ \global\let\next@insert=\empty
+ \global\let\add@inserts@next=\add@inserts
+ \fi
+\fi
+\add@inserts@next}
+
+\newcommand*{\add@penalties}{\@l@dtempcnta=\ballast@count
+ \ifnum\num@lines>\@ne
+ \global\advance\par@line \@ne
+ \ifnum\par@line=\@ne
+ \advance\@l@dtempcnta \clubpenalty
+ \fi
+ \@l@dtempcntb=\par@line \advance\@l@dtempcntb \@ne
+ \ifnum\@l@dtempcntb=\num@lines
+ \advance\@l@dtempcnta \widowpenalty
+ \fi
+ \ifnum\par@line<\num@lines
+ \advance\@l@dtempcnta \interlinepenalty
+ \fi
+ \fi
+ \ifnum\@l@dtempcnta=\z@
+ \relax
+ \else
+ \ifnum\@l@dtempcnta>-10000
+ \penalty\@l@dtempcnta
+ \else
+ \penalty -10000
+ \fi
+ \fi}
+
+\newcommand*{\flush@notes}{%
+ \@xloop
+ \ifx\inserts@list\empty \else
+ \gl@p\inserts@list\to\@insert
+ \@insert
+ \global\let\@insert=\undefined
+ \repeat}
+
+\def\@xloop#1\repeat{%
+ \def\body{#1\expandafter\body\fi}%
+ \body}
+
+\newcommand*{\notefontsetup}{\footnotesize}
+\newcommand*{\notenumfont}{\normalfont}
+ \def\select@lemmafont#1|#2|#3|#4|#5|#6|#7|{\select@@lemmafont#7|}
+ \def\select@@lemmafont#1/#2/#3/#4|%
+ {\fontencoding{#1}\fontfamily{#2}\fontseries{#3}\fontshape{#4}%
+ \selectfont}
+
+\newcommand*{\Afootnote}[1]{%
+ \ifnumberedpar@
+ \xright@appenditem{\noexpand\vAfootnote{A}%
+ {{\l@d@nums}{\@tag}{#1}}}\to\inserts@list
+ \global\advance\insert@count \@ne
+ \else
+ \vAfootnote{A}{{0|0|0|0|0|0|0}{}{#1}}%
+ \fi\ignorespaces}
+\newcommand*{\Bfootnote}[1]{%
+ \ifnumberedpar@
+ \xright@appenditem{\noexpand\vBfootnote{B}%
+ {{\l@d@nums}{\@tag}{#1}}}\to\inserts@list
+ \global\advance\insert@count \@ne
+ \else
+ \vBfootnote{B}{{0|0|0|0|0|0|0}{}{#1}}%
+ \fi\ignorespaces}
+\newcommand*{\Cfootnote}[1]{%
+ \ifnumberedpar@
+ \xright@appenditem{\noexpand\vCfootnote{C}%
+ {{\l@d@nums}{\@tag}{#1}}}\to\inserts@list
+ \global\advance\insert@count \@ne
+ \else
+ \vCfootnote{C}{{0|0|0|0|0|0|0}{}{#1}}%
+ \fi\ignorespaces}
+\newcommand*{\Dfootnote}[1]{%
+ \ifnumberedpar@
+ \xright@appenditem{\noexpand\vDfootnote{D}%
+ {{\l@d@nums}{\@tag}{#1}}}\to\inserts@list
+ \global\advance\insert@count \@ne
+ \else
+ \vDfootnote{D}{{0|0|0|0|0|0|0}{}{#1}}%
+ \fi\ignorespaces}
+\newcommand*{\Efootnote}[1]{%
+ \ifnumberedpar@
+ \xright@appenditem{\noexpand\vEfootnote{E}%
+ {{\l@d@nums}{\@tag}{#1}}}\to\inserts@list
+ \global\advance\insert@count \@ne
+ \else
+ \vEfootnote{E}{{0|0|0|0|0|0|0}{}{#1}}%
+ \fi\ignorespaces}
+
+\newinsert\mpAfootins
+\newinsert\mpBfootins
+\newinsert\mpCfootins
+\newinsert\mpDfootins
+\newinsert\mpEfootins
+
+\newcommand*{\mpAfootnote}[1]{%
+ \ifnumberedpar@
+ \xright@appenditem{\noexpand\mpvAfootnote{A}%
+ {{\l@d@nums}{\@tag}{#1}}}\to\inserts@list
+ \global\advance\insert@count \@ne
+ \else
+ \mpvAfootnote{A}{{0|0|0|0|0|0|0}{}{#1}}%
+ \fi\ignorespaces}
+\newcommand*{\mpBfootnote}[1]{%
+ \ifnumberedpar@
+ \xright@appenditem{\noexpand\mpvBfootnote{B}%
+ {{\l@d@nums}{\@tag}{#1}}}\to\inserts@list
+ \global\advance\insert@count \@ne
+ \else
+ \mpvBfootnote{B}{{0|0|0|0|0|0|0}{}{#1}}%
+ \fi\ignorespaces}
+\newcommand*{\mpCfootnote}[1]{%
+ \ifnumberedpar@
+ \xright@appenditem{\noexpand\mpvCfootnote{C}%
+ {{\l@d@nums}{\@tag}{#1}}}\to\inserts@list
+ \global\advance\insert@count \@ne
+ \else
+ \mpvCfootnote{C}{{0|0|0|0|0|0|0}{}{#1}}%
+ \fi\ignorespaces}
+\newcommand*{\mpDfootnote}[1]{%
+ \ifnumberedpar@
+ \xright@appenditem{\noexpand\mpvDfootnote{D}%
+ {{\l@d@nums}{\@tag}{#1}}}\to\inserts@list
+ \global\advance\insert@count \@ne
+ \else
+ \mpvDfootnote{D}{{0|0|0|0|0|0|0}{}{#1}}%
+ \fi\ignorespaces}
+\newcommand*{\mpEfootnote}[1]{%
+ \ifnumberedpar@
+ \xright@appenditem{\noexpand\mpvEfootnote{E}%
+ {{\l@d@nums}{\@tag}{#1}}}\to\inserts@list
+ \global\advance\insert@count \@ne
+ \else
+ \mpvEfootnote{E}{{0|0|0|0|0|0|0}{}{#1}}%
+ \fi\ignorespaces}
+\newcommand*{\normalvfootnote}[2]{%
+ \insert\csname #1footins\endcsname\bgroup
+ \notefontsetup
+ \footsplitskips
+ \spaceskip=\z@skip \xspaceskip=\z@skip
+ \csname #1footfmt\endcsname #2\egroup}
+\newcommand*{\footsplitskips}{%
+ \interlinepenalty=\interfootnotelinepenalty
+ \floatingpenalty=\@MM
+ \splittopskip=\ht\strutbox \splitmaxdepth=\dp\strutbox
+ \leftskip=\z@skip \rightskip=\z@skip}
+
+\newcommand*{\mpnormalvfootnote}[2]{%
+ \global\setbox\@nameuse{mp#1footins}\vbox{%
+ \unvbox\@nameuse{mp#1footins}
+ \notefontsetup
+ \hsize\columnwidth
+ \@parboxrestore
+ \color@begingroup
+ \csname #1footfmt\endcsname #2\color@endgroup}}
+
+\newcommand*{\ledsetnormalparstuff}{%
+ \normal@pars
+ \parindent \z@ \parfillskip \z@ \@plus 1fil}
+\newcommand*{\normalfootfmt}[3]{%
+ \ledsetnormalparstuff
+ {\notenumfont\printlines#1|}\strut\enspace
+ {\select@lemmafont#1|#2}\rbracket\enskip#3\strut\par}
+
+\def\endashchar{\textnormal{--}}
+\newcommand*{\fullstop}{\textnormal{.}}
+\newcommand*{\rbracket}{\textnormal{\thinspace]}}
+
+\newif\ifl@d@pnum
+ \l@d@pnumfalse
+\newif\ifl@d@ssub
+ \l@d@ssubfalse
+\newif\ifl@d@elin
+ \l@d@elinfalse
+\newif\ifl@d@esl
+ \l@d@eslfalse
+\newif\ifl@d@dash
+ \l@d@dashfalse
+\newif\ifledplinenum
+ \ledplinenumtrue
+\newcommand*{\symplinenum}{}
+
+\newcommand*{\l@dparsefootspec}[3]{\l@dp@rsefootspec#1|}
+\def\l@dp@rsefootspec#1|#2|#3|#4|#5|#6|#7|{%
+ \gdef\l@dparsedstartpage{#1}%
+ \gdef\l@dparsedstartline{#2}%
+ \gdef\l@dparsedstartsub{#3}%
+ \gdef\l@dparsedendpage{#4}%
+ \gdef\l@dparsedendline{#5}%
+ \gdef\l@dparsedendsub{#6}%
+}
+\def\l@dparsedstartpage{0}%
+\def\l@dparsedstartline{0}%
+\def\l@dparsedstartsub{0}%
+\def\l@dparsedendpage{0}%
+\def\l@dparsedendline{0}%
+\def\l@dparsedendsub{0}%
+
+\newcommand*{\setprintlines}[6]{%
+ \l@d@pnumfalse \l@d@dashfalse
+ \ifbypage@
+ \ifnum#4=#1 \else
+ \l@d@pnumtrue
+ \l@d@dashtrue
+ \fi
+ \fi
+ \ifl@d@pnum \l@d@elintrue \else \l@d@elinfalse \fi
+ \ifnum#2=#5 \else
+ \l@d@elintrue
+ \l@d@dashtrue
+ \fi
+ \l@d@ssubfalse
+ \ifnum#3=0 \else
+ \l@d@ssubtrue
+ \fi
+ \l@d@eslfalse
+ \ifnum#6=0 \else
+ \ifnum#6=#3
+ \ifl@d@elin \l@d@esltrue \else \l@d@eslfalse \fi
+ \else
+ \l@d@esltrue
+ \l@d@dashtrue
+ \fi
+ \fi}
+\def\printlines#1|#2|#3|#4|#5|#6|#7|{\begingroup
+ \setprintlines{#1}{#2}{#3}{#4}{#5}{#6}%
+ \ifl@d@pnum #1\fullstop\fi
+ \ifledplinenum \linenumrep{#2}\else \symplinenum\fi
+ \ifl@d@ssub \fullstop \sublinenumrep{#3}\fi
+ \ifl@d@dash \endashchar\fi
+ \ifl@d@pnum #4\fullstop\fi
+ \ifl@d@elin \linenumrep{#5}\fi
+ \ifl@d@esl \ifl@d@elin \fullstop\fi \sublinenumrep{#6}\fi
+\endgroup}
+
+\newcommand*{\normalfootstart}[1]{%
+ \vskip\skip\csname #1footins\endcsname
+ \leftskip0pt \rightskip0pt
+ \csname #1footnoterule\endcsname}
+\let\normalfootnoterule=\footnoterule
+\newcommand*{\normalfootgroup}[1]{\unvbox\csname #1footins\endcsname}
+
+\newcommand*{\mpnormalfootgroup}[1]{{
+ \vskip\skip\@nameuse{mp#1footins}
+ \normalcolor
+ \@nameuse{#1footnoterule}
+ \unvbox\csname mp#1footins\endcsname}}
+
+\newcommand*{\ledfootinsdim}{0.8\vsize}
+
+\newinsert\Afootins \newinsert\Bfootins
+\newinsert\Cfootins \newinsert\Dfootins
+\newinsert\Efootins
+\newcommand*{\footnormal}[1]{%
+ \expandafter\let\csname #1footstart\endcsname=\normalfootstart
+ \expandafter\let\csname v#1footnote\endcsname=\normalvfootnote
+ \expandafter\let\csname #1footfmt\endcsname=\normalfootfmt
+ \expandafter\let\csname #1footgroup\endcsname=\normalfootgroup
+ \expandafter\let\csname #1footnoterule\endcsname=%
+ \normalfootnoterule
+ \count\csname #1footins\endcsname=1000
+ \dimen\csname #1footins\endcsname=\ledfootinsdim
+ \skip\csname #1footins\endcsname=1.2em \@plus .6em \@minus .6em
+ \expandafter\let\csname mpv#1footnote\endcsname=\mpnormalvfootnote
+ \expandafter\let\csname mp#1footgroup\endcsname=\mpnormalfootgroup
+ \count\csname mp#1footins\endcsname=1000
+ \dimen\csname mp#1footins\endcsname=\ledfootinsdim
+ \skip\csname mp#1footins\endcsname=1.2em \@plus .6em \@minus .6em
+}
+
+\footnormal{A}
+\footnormal{B}
+\footnormal{C}
+\footnormal{D}
+\footnormal{E}
+
+\newcommand*{\footparagraph}[1]{%
+ \expandafter\let\csname #1footstart\endcsname=\parafootstart
+ \expandafter\let\csname v#1footnote\endcsname=\para@vfootnote
+ \expandafter\let\csname #1footfmt\endcsname=\parafootfmt
+ \expandafter\let\csname #1footgroup\endcsname=\para@footgroup
+ \count\csname #1footins\endcsname=1000
+ \para@footsetup{#1}
+ \expandafter\let\csname mpv#1footnote\endcsname=\mppara@vfootnote
+ \expandafter\let\csname mp#1footgroup\endcsname=\mppara@footgroup
+ \count\csname mp#1footins\endcsname=1000
+}
+
+\providecommand{\footfudgefiddle}{64}
+\newcommand*{\para@footsetup}[1]{{\notefontsetup
+ \dimen0=\baselineskip
+ \multiply\dimen0 by 1024
+ \divide \dimen0 by \columnwidth \multiply\dimen0 by \footfudgefiddle\relax
+ \expandafter
+ \xdef\csname #1footfudgefactor\endcsname{%
+ \expandafter\strip@pt\dimen0 }}}
+
+\newcommand*{\parafootstart}[1]{%
+ \rightskip=0pt \leftskip=0pt \parindent=0pt
+ \vskip\skip\csname #1footins\endcsname
+ \csname #1footnoterule\endcsname}
+\newcommand*{\para@vfootnote}[2]{%
+ \insert\csname #1footins\endcsname
+ \bgroup
+ \notefontsetup
+ \footsplitskips
+ \setbox0=\vbox{\hsize=\maxdimen
+ \noindent\csname #1footfmt\endcsname#2}%
+ \setbox0=\hbox{\unvxh0}%
+ \dp0=0pt
+ \ht0=\csname #1footfudgefactor\endcsname\wd0
+ \box0
+ \penalty0
+ \egroup}
+
+\newcommand*{\mppara@vfootnote}[2]{%
+ \global\setbox\@nameuse{mp#1footins}\vbox{%
+ \unvbox\@nameuse{mp#1footins}%
+ \notefontsetup
+ \footsplitskips
+ \setbox0=\vbox{\hsize=\maxdimen
+ \noindent\color@begingroup\csname #1footfmt\endcsname #2\color@endgroup}%
+ \setbox0=\hbox{\unvxh0}%
+ \dp0=\z@
+ \ht0=\csname #1footfudgefactor\endcsname\wd0
+ \box0
+ \penalty0
+}}
+
+\newcommand*{\unvxh}[1]{%
+ \setbox0=\vbox{\unvbox#1%
+ \global\setbox1=\lastbox}%
+ \unhbox1
+ \unskip % remove \rightskip,
+ \unskip % remove \parfillskip,
+ \unpenalty % remove \penalty of 10000,
+ \hskip\ipn@skip} % but add the glue to go between the notes
+
+\newskip\ipn@skip
+\newcommand*{\interparanoteglue}[1]{%
+ {\notefontsetup\global\ipn@skip=#1 \relax}}
+\interparanoteglue{1em plus.4em minus.4em}
+
+\newcommand*{\parafootfmt}[3]{%
+ \ledsetnormalparstuff
+ {\notenumfont\printlines#1|}\enspace
+ {\select@lemmafont#1|#2}\rbracket\enskip
+ #3\penalty-10 }
+\newcommand*{\para@footgroup}[1]{%
+ \unvbox\csname #1footins\endcsname
+ \makehboxofhboxes
+ \setbox0=\hbox{\unhbox0 \removehboxes}%
+ \notefontsetup
+ \noindent\unhbox0\par}
+
+\newcommand*{\mppara@footgroup}[1]{{%
+ \vskip\skip\@nameuse{mp#1footins}
+ \normalcolor
+ \@nameuse{#1footnoterule}%
+ \unvbox\csname mp#1footins\endcsname
+ \makehboxofhboxes
+ \setbox0=\hbox{\unhbox0 \removehboxes}%
+ \notefontsetup
+ \noindent\unhbox0\par}}
+
+\newcommand*{\makehboxofhboxes}{\setbox0=\hbox{}%
+ \loop
+ \unpenalty
+ \setbox2=\lastbox
+ \ifhbox2
+ \setbox0=\hbox{\box2\unhbox0}%
+ \repeat}
+
+\newcommand*{\removehboxes}{\setbox0=\lastbox
+ \ifhbox0{\removehboxes}\unhbox0 \fi}
+
+\newcount\@k \newdimen\@h
+\newcommand*{\rigidbalance}[3]{\setbox0=\box#1 \@k=#2 \@h=#3
+ \@@line{\splittopskip=\@h \vbadness=\@M \hfilneg
+ \valign{##\vfil\cr\dosplits}}}
+
+\newcommand*{\dosplits}{\ifnum\@k>0 \noalign{\hfil}\splitoff
+ \global\advance\@k-1\cr\dosplits\fi}
+
+\newcommand*{\splitoff}{\dimen0=\ht0
+ \divide\dimen0 by\@k \advance\dimen0 by\@h
+ \setbox2 \vsplit0 to \dimen0
+ \unvbox2 }
+
+\newcommand*{\footthreecol}[1]{%
+ \expandafter\let\csname v#1footnote\endcsname=\threecolvfootnote
+ \expandafter\let\csname #1footfmt\endcsname=\threecolfootfmt
+ \expandafter\let\csname #1footgroup\endcsname=\threecolfootgroup
+ \threecolfootsetup{#1}
+ \expandafter\let\csname mpv#1footnote\endcsname=\mpnormalvfootnote
+ \expandafter\let\csname mp#1footgroup\endcsname=\mpthreecolfootgroup
+ \mpthreecolfootsetup{#1}
+}
+
+\newcommand*{\threecolfootsetup}[1]{%
+ \count\csname #1footins\endcsname 333
+ \multiply\dimen\csname #1footins\endcsname \thr@@}
+\newcommand*{\mpthreecolfootsetup}[1]{%
+ \count\csname mp#1footins\endcsname 333
+ \multiply\dimen\csname mp#1footins\endcsname \thr@@}
+
+\newcommand*{\threecolvfootnote}[2]{%
+ \insert\csname #1footins\endcsname\bgroup
+ \notefontsetup
+ \footsplitskips
+ \csname #1footfmt\endcsname #2\egroup}
+\newcommand*{\threecolfootfmt}[3]{%
+ \normal@pars
+ \hsize .3\hsize
+ \parindent=0pt
+ \tolerance=5000
+ \raggedright
+ \leavevmode
+ \strut{\notenumfont\printlines#1|}\enspace
+ {\select@lemmafont#1|#2}\rbracket\enskip
+ #3\strut\par\allowbreak}
+\newcommand*{\threecolfootgroup}[1]{{\notefontsetup
+ \splittopskip=\ht\strutbox
+ \expandafter
+ \rigidbalance\csname #1footins\endcsname \thr@@ \splittopskip}}
+\newcommand*{\mpthreecolfootgroup}[1]{{%
+ \vskip\skip\@nameuse{mp#1footins}
+ \normalcolor
+ \@nameuse{#1footnoterule}
+ \splittopskip=\ht\strutbox
+ \expandafter
+ \rigidbalance\csname mp#1footins\endcsname \thr@@ \splittopskip}}
+
+\newcommand*{\foottwocol}[1]{%
+ \expandafter\let\csname v#1footnote\endcsname=\twocolvfootnote
+ \expandafter\let\csname #1footfmt\endcsname=\twocolfootfmt
+ \expandafter\let\csname #1footgroup\endcsname=\twocolfootgroup
+ \twocolfootsetup{#1}
+ \expandafter\let\csname mpv#1footnote\endcsname=\mpnormalvfootnote
+ \expandafter\let\csname mp#1footgroup\endcsname=\mptwocolfootgroup
+ \mptwocolfootsetup{#1}
+}
+
+\newcommand*{\twocolfootsetup}[1]{%
+ \count\csname #1footins\endcsname 500
+ \multiply\dimen\csname #1footins\endcsname \tw@}
+\newcommand*{\twocolvfootnote}[2]{\insert\csname #1footins\endcsname\bgroup
+ \notefontsetup
+ \footsplitskips
+ \csname #1footfmt\endcsname #2\egroup}
+\newcommand*{\twocolfootfmt}[3]{%
+ \normal@pars
+ \hsize .45\hsize
+ \parindent=0pt
+ \tolerance=5000
+ \raggedright
+ \leavevmode
+ \strut{\notenumfont\printlines#1|}\enspace
+ {\select@lemmafont#1|#2}\rbracket\enskip
+ #3\strut\par\allowbreak}
+\newcommand*{\twocolfootgroup}[1]{{\notefontsetup
+ \splittopskip=\ht\strutbox
+ \expandafter
+ \rigidbalance\csname #1footins\endcsname \tw@ \splittopskip}}
+
+\newcommand*{\mptwocolfootsetup}[1]{%
+ \count\csname mp#1footins\endcsname 500
+ \multiply\dimen\csname mp#1footins\endcsname \tw@}
+\newcommand*{\mptwocolfootgroup}[1]{{%
+ \vskip\skip\@nameuse{mp#1footins}
+ \normalcolor
+ \@nameuse{#1footnoterule}
+ \splittopskip=\ht\strutbox
+ \expandafter
+ \rigidbalance\csname mp#1footins\endcsname \tw@ \splittopskip}}
+
+\countdef\pageno=0 \pageno=1
+\newcommand*{\advancepageno}{\ifnum\pageno<\z@ \global\advance\pageno\m@ne
+ \else\global\advance\pageno\@ne\fi}
+
+\providecommand{\m@m@makecolfloats}{%
+ \xdef\@freelist{\@freelist\@midlist}%
+ \global \let \@midlist \@empty
+ \@combinefloats}
+\providecommand{\m@m@makecoltext}{%
+ \ifvbox\@kludgeins
+ \@makespecialcolbox
+ \else
+ \setbox\@outputbox \vbox to\@colht {%
+ \@texttop
+ \dimen@ \dp\@outputbox
+ \unvbox\@outputbox
+ \vskip -\dimen@
+ \@textbottom}%
+ \fi}
+\providecommand{\m@m@makecolintro}{}
+
+\gdef\l@d@makecol{%
+ \l@ddofootinsert
+ \m@m@makecolfloats
+ \m@m@makecoltext
+ \global \maxdepth \@maxdepth}
+
+\newcommand*{\l@ddofootinsert}{%
+%%% \page@start
+ \ifvoid\footins
+ \setbox\@outputbox \box\@cclv
+ \else
+ \setbox\@outputbox \vbox {%
+ \boxmaxdepth \@maxdepth
+ \@tempdima\dp\@cclv
+ \unvbox \@cclv
+ \vskip \skip\footins
+ \color@begingroup
+ \normalcolor
+ \footnoterule
+ \unvbox \footins
+ \color@endgroup
+ }%
+ \fi
+ \l@ddoxtrafeet
+}
+
+\newcommand*{\l@ddoxtrafeet}{%
+ \doxtrafeeti
+ \doxtrafeetii}
+
+\newcommand*{\doxtrafeetii}{%
+ \setbox\@outputbox \vbox{%
+ \unvbox\@outputbox
+ \@opxtrafeetii}}
+\newcommand*{\@opxtrafeetii}{%
+ \ifvoid\Afootins\else\Afootstart{A}\Afootgroup{A}\fi
+ \ifvoid\Bfootins\else\Bfootstart{B}\Bfootgroup{B}\fi
+ \ifvoid\Cfootins\else\Cfootstart{C}\Cfootgroup{C}\fi
+ \ifvoid\Dfootins\else\Dfootstart{D}\Dfootgroup{D}\fi
+ \ifvoid\Efootins\else\Efootstart{E}\Efootgroup{E}\fi}
+
+\newcommand*{\l@ddodoreinxtrafeet}{%
+ \doreinxtrafeeti
+ \doreinxtrafeetii}
+
+\newcommand*{\doreinxtrafeetii}{%
+ \ifvoid\Afootins\else\insert\Afootins{\unvbox\Afootins}\fi
+ \ifvoid\Bfootins\else\insert\Bfootins{\unvbox\Bfootins}\fi
+ \ifvoid\Cfootins\else\insert\Cfootins{\unvbox\Cfootins}\fi
+ \ifvoid\Dfootins\else\insert\Dfootins{\unvbox\Dfootins}\fi
+ \ifvoid\Efootins\else\insert\Efootins{\unvbox\Efootins}\fi
+}
+
+\gdef \l@d@reinserts{%
+ \ifvoid\footins\else\insert\footins{\unvbox\footins}\fi
+ \l@ddodoreinxtrafeet
+ \ifvbox\@kludgeins\insert\@kludgeins{\unvbox\@kludgeins}\fi
+}
+
+\@ifclassloaded{memoir}{%
+ \g@addto@macro{\m@mdoextrafeet}{\l@ddoxtrafeet}%
+ \g@addto@macro{\m@mdodoreinextrafeet}{\l@ddodoreinxtrafeet}%
+ }{%
+ \gdef\@makecol{\l@d@makecol}%
+ \gdef\@reinserts{\l@d@reinserts}%
+}
+
+\newcommand*{\addfootins}[1]{%
+ \footnormal{#1}
+ \g@addto@macro{\@opxtrafeetii}{%
+ \ifvoid\@nameuse{#1footins}\else
+ \@nameuse{#1footstart{#1}}\@nameuse{#1footgroup}{#1}\fi}
+ \g@addto@macro{\doreinxtrafeetii}{%
+ \ifvoid\@nameuse{#1footins}\else
+ \insert\@nameuse{#1footins}{\unvbox\@nameuse{#1footins}}\fi}
+ \g@addto@macro{\l@dedbeginmini}{%
+ \expandafter\let\csname #1footnote\endcsname = \@nameuse{mp#1footnote}}
+ \g@addto@macro{\l@dedendmini}{%
+ \ifvoid\@nameuse{mp#1footins}\else\@nameuse{mpfootgroup#1{#1}}\fi}
+}
+
+\newif\if@led@nofoot
+\newcommand*{\@led@extranofeet}{}
+
+\@ifclassloaded{memoir}{%
+\g@addto@macro{\@mem@extranofeet}{%
+ \ifvoid\Afootins\else\@mem@nofootfalse\fi
+ \ifvoid\Bfootins\else\@mem@nofootfalse\fi
+ \ifvoid\Cfootins\else\@mem@nofootfalse\fi
+ \ifvoid\Dfootins\else\@mem@nofootfalse\fi
+ \ifvoid\Efootins\else\@mem@nofootfalse\fi
+ \ifvoid\footinsA\else\@mem@nofootfalse\fi
+ \ifvoid\footinsB\else\@mem@nofootfalse\fi
+ \ifvoid\footinsC\else\@mem@nofootfalse\fi
+ \@led@extranofeet}
+}{%
+\newcommand*{\@led@testifnofoot}{%
+ \@led@nofoottrue
+ \ifvoid\footins\else\@led@nofootfalse\fi
+ \ifvoid\Afootins\else\@led@nofootfalse\fi
+ \ifvoid\Bfootins\else\@led@nofootfalse\fi
+ \ifvoid\Cfootins\else\@led@nofootfalse\fi
+ \ifvoid\Dfootins\else\@led@nofootfalse\fi
+ \ifvoid\Efootins\else\@led@nofootfalse\fi
+ \ifvoid\footinsA\else\@led@nofootfalse\fi
+ \ifvoid\footinsB\else\@led@nofootfalse\fi
+ \ifvoid\footinsC\else\@led@nofootfalse\fi
+ \@led@extranofeet}
+
+\renewcommand{\@doclearpage}{%
+ \@led@testifnofoot
+ \if@led@nofoot
+ \setbox\@tempboxa\vsplit\@cclv to\z@ \unvbox\@tempboxa
+ \setbox\@tempboxa\box\@cclv
+ \xdef\@deferlist{\@toplist\@botlist\@deferlist}%
+ \global \let \@toplist \@empty
+ \global \let \@botlist \@empty
+ \global \@colroom \@colht
+ \ifx \@currlist\@empty
+ \else
+ \@latexerr{Float(s) lost}\@ehb
+ \global \let \@currlist \@empty
+ \fi
+ \@makefcolumn\@deferlist
+ \@whilesw\if@fcolmade \fi{\@opcol\@makefcolumn\@deferlist}%
+ \if@twocolumn
+ \if@firstcolumn
+ \xdef\@dbldeferlist{\@dbltoplist\@dbldeferlist}%
+ \global \let \@dbltoplist \@empty
+ \global \@colht \textheight
+ \begingroup
+ \@dblfloatplacement
+ \@makefcolumn\@dbldeferlist
+ \@whilesw\if@fcolmade \fi{\@outputpage
+ \@makefcolumn\@dbldeferlist}%
+ \endgroup
+ \else
+ \vbox{}\clearpage
+ \fi
+ \fi
+ \else
+ \setbox\@cclv\vbox{\box\@cclv\vfil}%
+ \l@d@makecol\@opcol
+ \clearpage
+ \fi}
+}
+
+\list@create{\labelref@list}
+%% \newcommand*{\zz@@@}{000|000|000} % set three counters to zero in one go
+\newcommand*{\zz@@@}{000|000} % set two counters to zero in one go
+
+\newcommand*{\edlabel}[1]{\@bsphack
+ \write\linenum@out{\string\@lab}%
+ \ifx\labelref@list\empty
+ \xdef\label@refs{\zz@@@}%
+ \else
+ \gl@p\labelref@list\to\label@refs
+ \fi
+ \protected@write\@auxout{}%
+ {\string\l@dmake@labels\space\thepage|\label@refs|{#1}}%
+ \@esphack}
+
+\newcommand*{\l@dmake@labels}{}
+\def\l@dmake@labels#1|#2|#3|#4{%
+ \expandafter\ifx\csname the@label#4\endcsname \relax\else
+ \led@warn@DuplicateLabel{#4}%
+ \fi
+ \expandafter\gdef\csname the@label#4\endcsname{#1|#2|#3}%
+ \ignorespaces}
+
+\AtBeginDocument{%
+ \def\l@dmake@labels#1|#2|#3|#4{}%
+}
+
+\newcommand*{\@lab}{\xright@appenditem
+ {\linenumrep{\line@num}|%
+ \ifsublines@ \sublinenumrep{\subline@num}\else 0\fi}\to\labelref@list}
+
+\newcommand*{\edpageref}[1]{\l@dref@undefined{#1}\l@dgetref@num{1}{#1}}
+\newcommand*{\xpageref}[1]{\l@dgetref@num{1}{#1}}
+
+\newcommand*{\lineref}[1]{\l@dref@undefined{#1}\l@dgetref@num{2}{#1}}
+\newcommand*{\xlineref}[1]{\l@dgetref@num{2}{#1}}
+
+\newcommand*{\sublineref}[1]{\l@dref@undefined{#1}\l@dgetref@num{3}{#1}}
+\newcommand*{\xsublineref}[1]{\l@dgetref@num{3}{#1}}
+
+\newcommand*{\l@dref@undefined}[1]{%
+ \expandafter\ifx\csname the@label#1\endcsname\relax
+ \led@warn@RefUndefined{#1}%
+ \fi}
+
+\newcommand*{\l@dgetref@num}[2]{%
+ \expandafter
+ \ifx\csname the@label#2\endcsname \relax
+ 000%
+ \else
+ \expandafter\expandafter\expandafter
+ \l@dlabel@parse\csname the@label#2\endcsname|#1%
+ \fi}
+
+\newcommand*{\l@dlabel@parse}{}
+\def\l@dlabel@parse#1|#2|#3|#4{%
+ \ifcase #4\relax
+ \or #1%
+ \or #2%
+ \or #3%
+ \fi}
+
+\newcommand*{\xxref}[2]{%
+ {\expandafter\ifx\csname the@label#1\endcsname
+ \relax \expandafter\let\csname the@label#1\endcsname\zz@@@\fi
+ \expandafter\ifx\csname the@label#2\endcsname \relax
+ \expandafter\let\csname the@label#2\endcsname\zz@@@\fi
+ \linenum{\csname the@label#1\endcsname|%
+ \csname the@label#2\endcsname}}}
+
+\newcommand*{\edmakelabel}[2]{\expandafter\xdef\csname the@label#1\endcsname{#2}}
+
+\newwrite\l@d@end
+\newif\ifl@dend@
+\newcommand{\l@dend@open}[1]{\l@dend@true\immediate\openout\l@d@end=#1\relax}
+\newcommand{\l@dend@close}{\l@dend@false\immediate\closeout\l@d@end}
+
+\newcommand{\l@dend@stuff}{%
+ \ifl@dend@\relax\else
+ \l@dend@open{\jobname.end}%
+ \fi
+ \immediate\write\l@d@end{\string\l@d@section{\the\section@num}}}
+
+\newcommand*{\Aendnote}[1]{{\newlinechar='40
+ \immediate\write\l@d@end{\string\Aend%
+ {\ifnumberedpar@\l@d@nums\fi}%
+ {\ifnumberedpar@\@tag\fi}{#1}}}\ignorespaces}
+\newcommand*{\Bendnote}[1]{{\newlinechar='40
+ \immediate\write\l@d@end{\string\Bend%
+ {\ifnumberedpar@\l@d@nums\fi}%
+ {\ifnumberedpar@\@tag\fi}{#1}}}\ignorespaces}
+\newcommand*{\Cendnote}[1]{{\newlinechar='40
+ \immediate\write\l@d@end{\string\Cend%
+ {\ifnumberedpar@\l@d@nums\fi}%
+ {\ifnumberedpar@\@tag\fi}{#1}}}\ignorespaces}
+\newcommand*{\Dendnote}[1]{{\newlinechar='40
+ \immediate\write\l@d@end{\string\Dend%
+ {\ifnumberedpar@\l@d@nums\fi}%
+ {\ifnumberedpar@\@tag\fi}{#1}}}\ignorespaces}
+\newcommand*{\Eendnote}[1]{{\newlinechar='40
+ \immediate\write\l@d@end{\string\Eend%
+ {\ifnumberedpar@\l@d@nums\fi}%
+ {\ifnumberedpar@\@tag\fi}{#1}}}\ignorespaces}
+
+\def\endprint#1#2#3{{\notefontsetup{\notenumfont\printendlines#1|}%
+ \enspace{\select@lemmafont#1|#2}\enskip#3\par}}
+\providecommand*{\@gobblethree}[3]{}
+\let\Aend=\@gobblethree
+\let\Bend=\@gobblethree
+\let\Cend=\@gobblethree
+\let\Dend=\@gobblethree
+\let\Eend=\@gobblethree
+\let\l@d@section=\@gobble
+
+\newcommand*{\setprintendlines}[6]{%
+ \l@d@pnumfalse \l@d@dashfalse
+ \ifnum#4=#1 \else
+ \l@d@pnumtrue
+ \l@d@dashtrue
+ \fi
+ \ifl@d@pnum \l@d@elintrue \else \l@d@elinfalse \fi
+ \ifnum#2=#5 \else
+ \l@d@elintrue
+ \l@d@dashtrue
+ \fi
+ \l@d@ssubfalse
+ \ifnum#3=0 \else
+ \l@d@ssubtrue
+ \fi
+ \l@d@eslfalse
+ \ifnum#6=0 \else
+ \ifnum#6=#3
+ \ifl@d@elin \l@d@esltrue \else \l@d@eslfalse \fi
+ \else
+ \l@d@esltrue
+ \l@d@dashtrue
+ \fi
+ \fi}
+\def\printendlines#1|#2|#3|#4|#5|#6|#7|{\begingroup
+ \setprintendlines{#1}{#2}{#3}{#4}{#5}{#6}%
+ \printnpnum{#1} \linenumrep{#2}%
+ \ifl@d@ssub \fullstop \sublinenumrep{#3}\fi
+ \ifl@d@dash \endashchar\fi
+ \ifl@d@pnum \printnpnum{#4}\fi
+ \ifl@d@elin \linenumrep{#5}\fi
+ \ifl@d@esl \ifl@d@elin \fullstop\fi \sublinenumrep{#6}\fi
+\endgroup}
+
+\newcommand*{\printnpnum}[1]{p.#1) }
+
+\newcommand*{\doendnotes}[1]{\l@dend@close
+ \begingroup
+ \makeatletter
+ \expandafter\let\csname #1end\endcsname=\endprint
+ \input\jobname.end
+ \endgroup}
+\newcommand*{\noendnotes}{\global\let\l@dend@stuff=\relax
+ \global\chardef\l@d@end=16 }
+\let\l@dold@xympar\@xympar
+\renewcommand{\@xympar}{%
+ \ifnumberedpar@
+ \led@warn@NoMarginpars
+ \@esphack
+ \else
+ \l@dold@xympar
+ \fi}
+
+\newcount\sidenote@margin
+\newcommand*{\sidenotemargin}[1]{{%
+ \l@dgetsidenote@margin{#1}%
+ \ifnum\@l@dtempcntb>\m@ne
+ \global\sidenote@margin=\@l@dtempcntb
+ \fi}}
+\newcommand*{\l@dgetsidenote@margin}[1]{%
+ \def\@tempa{#1}\def\@tempb{left}%
+ \ifx\@tempa\@tempb
+ \@l@dtempcntb \z@
+ \else
+ \def\@tempb{right}%
+ \ifx\@tempa\@tempb
+ \@l@dtempcntb \@ne
+ \else
+ \def\@tempb{outer}%
+ \ifx\@tempa\@tempb
+ \@l@dtempcntb \tw@
+ \else
+ \def\@tempb{inner}%
+ \ifx\@tempa\@tempb
+ \@l@dtempcntb \thr@@
+ \else
+ \led@warn@BadSidenotemargin
+ \@l@dtempcntb \m@ne
+ \fi
+ \fi
+ \fi
+ \fi}
+\sidenotemargin{right}
+
+\newbox\l@dlp@rbox
+\newbox\l@drp@rbox
+
+\newdimen\ledlsnotewidth \ledlsnotewidth=\marginparwidth
+\newdimen\ledrsnotewidth \ledrsnotewidth=\marginparwidth
+\newdimen\ledlsnotesep \ledlsnotesep=\linenumsep
+\newdimen\ledrsnotesep \ledrsnotesep=\linenumsep
+\newcommand*{\ledlsnotefontsetup}{\raggedleft\footnotesize}
+\newcommand*{\ledrsnotefontsetup}{\raggedright\footnotesize}
+
+\newcommand*{\ledleftnote}[1]{\edtext{}{\l@dlsnote{#1}}}
+\newcommand*{\ledrightnote}[1]{\edtext{}{\l@drsnote{#1}}}
+\newcommand*{\ledsidenote}[1]{\edtext{}{\l@dcsnote{#1}}}
+
+\newcommand*{\l@dlsnote}[1]{%
+ \ifnumberedpar@
+ \xright@appenditem{\noexpand\vl@dlsnote{{\l@d@nums}{\@tag}{#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}}}%
+ \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}}}%
+ \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*{\setl@dlp@rbox}[3]{%
+ {\parindent\z@\hsize=\ledlsnotewidth\ledlsnotefontsetup
+ \global\setbox\l@dlp@rbox=\vbox to\z@{\vss#3}}}% aligns on bottom line
+%% \global\setbox\l@dlp@rbox=\vbox to\z@{#3\vss}}}% aligns on top line
+\newcommand*{\setl@drp@rbox}[3]{%
+ {\parindent\z@\hsize=\ledrsnotewidth\ledrsnotefontsetup
+ \global\setbox\l@drp@rbox=\vbox to\z@{\vss#3}}}
+
+\newcommand*{\savel@dcsnote}[3]{%
+ \gdef\l@dcsnotetext{#3}}
+
+\newcommand*{\affixside@note}{%
+ \gdef\@templ@d{}%
+ \ifx\@templ@d\l@dcsnotetext \else
+ \if@twocolumn
+ \if@firstcolumn
+ \setl@dlp@rbox{}{}{\l@dcsnotetext}%
+ \else
+ \setl@drp@rbox{}{}{\l@dcsnotetext}%
+ \fi
+ \else
+ \@l@dtempcntb=\sidenote@margin
+ \ifnum\@l@dtempcntb>\@ne
+ \advance\@l@dtempcntb by\page@num
+ \fi
+ \ifodd\@l@dtempcntb
+ \setl@drp@rbox{}{}{\l@dcsnotetext}%
+ \else
+ \setl@dlp@rbox{}{}{\l@dcsnotetext}%
+ \fi
+ \fi
+ \fi}
+
+\providecommand*{\multiplefootnotemarker}{3sp}
+\providecommand*{\multfootsep}{\textsuperscript{\normalfont,}}
+
+\providecommand*{\m@mmf@prepare}{%
+ \kern-\multiplefootnotemarker
+ \kern\multiplefootnotemarker\relax}
+\providecommand*{\m@mmf@check}{%
+ \ifdim\lastkern=\multiplefootnotemarker\relax
+ \edef\@x@sf{\the\spacefactor}%
+ \unkern
+ \multfootsep
+ \spacefactor\@x@sf\relax
+ \fi}
+
+\@ifclassloaded{memoir}{}{%
+\let\l@dold@footnotetext\@footnotetext
+\renewcommand{\@footnotetext}[1]{%
+ \l@dold@footnotetext{#1}%
+ \m@mmf@prepare}
+\renewcommand*{\@footnotemark}{%
+ \leavevmode
+ \ifhmode
+ \edef\@x@sf{\the\spacefactor}%
+ \m@mmf@check
+ \nobreak
+ \fi
+ \@makefnmark
+ \m@mmf@prepare
+ \ifhmode\spacefactor\@x@sf\fi
+ \relax}
+}
+
+\let\l@doldold@footnotetext\@footnotetext
+\renewcommand{\@footnotetext}[1]{%
+ \ifnumberedpar@
+ \edtext{}{\l@dbfnote{#1}}%
+ \else
+ \l@doldold@footnotetext{#1}%
+ \fi}
+\newcommand{\l@dbfnote}[1]{%
+ \ifnumberedpar@
+ \xright@appenditem{\noexpand\vl@dbfnote{{#1}}{\@thefnmark}}%
+ \to\inserts@list
+ \global\advance\insert@count \@ne
+ \fi\ignorespaces}
+\newcommand{\vl@dbfnote}[2]{%
+ \def\@thefnmark{#2}%
+ \l@doldold@footnotetext{#1}}
+
+\newcommand{\footnoteA}[1]{%
+ \stepcounter{footnoteA}%
+ \protected@xdef\@thefnmarkA{\thefootnoteA}%
+ \@footnotemarkA
+ \vfootnoteA{A}{#1}\m@mmf@prepare}
+
+\newinsert\footinsA
+\newcounter{footnoteA}
+ \renewcommand{\thefootnoteA}{\arabic{footnoteA}}
+
+\newcommand*{\footfootmarkA}{\textsuperscript{\thefootnoteA}}
+
+\newcommand{\mpfootnoteA}[1]{%
+ \stepcounter{footnoteA}%
+ \protected@xdef\@thefnmarkA{\thefootnoteA}%
+ \@footnotemarkA
+ \mpvfootnoteA{A}{#1}\m@mmf@prepare}
+\newinsert\mpfootinsA
+
+\newcommand*{\prebodyfootmark}{%
+ \leavevmode
+ \ifhmode
+ \edef\@x@sf{\the\spacefactor}%
+ \m@mmf@check
+ \nobreak
+ \fi}
+\newcommand{\postbodyfootmark}{%
+ \m@mmf@prepare
+ \ifhmode\spacefactor\@x@sf\fi\relax}
+
+\newcommand*{\normal@footnotemarkX}[1]{%
+ \prebodyfootmark
+ \@nameuse{bodyfootmark#1}%
+ \postbodyfootmark}
+
+\newcommand*{\normalbodyfootmarkX}[1]{%
+ \hbox{\textsuperscript{\normalfont\@nameuse{@thefnmark#1}}}}
+\newcommand*{\normalvfootnoteX}[2]{%
+ \insert\@nameuse{footins#1}\bgroup
+ \notefontsetup
+ \footsplitskips
+ \spaceskip=\z@skip \xspaceskip=\z@skip
+ \@nameuse{footfmt#1}{#1}{#2}\egroup}
+
+\newcommand*{\mpnormalvfootnoteX}[2]{%
+ \global\setbox\@nameuse{mpfootins#1}\vbox{%
+ \unvbox\@nameuse{mpfootins#1}
+ \notefontsetup
+ \hsize\columnwidth
+ \@parboxrestore
+ \color@begingroup
+ \@nameuse{footfmt#1}{#1}{#2}\color@endgroup}}
+
+\newcommand*{\normalfootfmtX}[2]{%
+ \ledsetnormalparstuff
+ {\notenumfont\@nameuse{footfootmark#1}\strut%\enspace
+ #2\strut\par}}
+
+\newcommand*{\normalfootfootmarkX}[1]{%
+ \textsuperscript{\@nameuse{@thefnmark#1}}}
+
+\newcommand*{\normalfootstartX}[1]{%
+ \vskip\skip\@nameuse{footins#1}%
+ \leftskip=\z@
+ \rightskip=\z@
+ \@nameuse{footnoterule#1}}
+
+\let\normalfootnoteruleX=\footnoterule
+
+\newcommand*{\normalfootgroupX}[1]{%
+ \unvbox\@nameuse{footins#1}}
+
+\newcommand*{\mpnormalfootgroupX}[1]{%
+ \vskip\skip\@nameuse{mpfootins#1}
+ \normalcolor
+ \@nameuse{footnoterule#1}
+ \unvbox\@nameuse{mpfootins#1}}
+
+\newcommand{\normalbfnoteX}[2]{%
+ \ifnumberedpar@
+ \xright@appenditem{\noexpand\vbfnoteX{#1}{#2}{\@nameuse{thefootnote#1}}}%
+ \to\inserts@list
+ \global\advance\insert@count \@ne
+ \fi\ignorespaces}
+
+\newcommand{\vbfnoteX}[3]{%
+ \@namedef{@thefnmark#1}{#3}%
+ \@nameuse{regvfootnote#1}{#1}{#2}}
+
+\newcommand{\vnumfootnoteX}[2]{%
+ \ifnumberedpar@
+ \edtext{}{\normalbfnoteX{#1}{#2}}%
+ \else
+ \@nameuse{regvfootnote#1}{#1}{#2}%
+ \fi}
+
+\newcommand*{\footnormalX}[1]{%
+ \expandafter\let\csname footstart#1\endcsname=\normalfootstartX
+ \@namedef{@footnotemark#1}{\normal@footnotemarkX{#1}}
+ \@namedef{bodyfootmark#1}{\normalbodyfootmarkX{#1}}
+ \expandafter\let\csname regvfootnote#1\endcsname=\normalvfootnoteX
+ \expandafter\let\csname vfootnote#1\endcsname=\vnumfootnoteX
+ \expandafter\let\csname footfmt#1\endcsname=\normalfootfmtX
+ \@namedef{footfootmark#1}{\normalfootfootmarkX{#1}}
+ \expandafter\let\csname footgroup#1\endcsname=\normalfootgroupX
+ \expandafter\let\csname footnoterule#1\endcsname=\normalfootnoteruleX
+ \count\csname footins#1\endcsname=1000
+ \dimen\csname footins#1\endcsname=\ledfootinsdim
+ \skip\csname footins#1\endcsname=1.2em \@plus .6em \@minus .6em
+ \expandafter\let\csname mpvfootnote#1\endcsname=\mpnormalvfootnoteX
+ \expandafter\let\csname mpfootgroup#1\endcsname=\mpnormalfootgroupX
+ \count\csname mpfootins#1\endcsname=1000
+ \dimen\csname mpfootins#1\endcsname=\ledfootinsdim
+ \skip\csname mpfootins#1\endcsname=1.2em \@plus .6em \@minus .6em
+}
+
+\newcommand*{\foottwocolX}[1]{%
+ \expandafter\let\csname regvfootnote#1\endcsname=\twocolvfootnoteX
+ \expandafter\let\csname footfmt#1\endcsname=\twocolfootfmtX
+ \expandafter\let\csname footgroup#1\endcsname=\twocolfootgroupX
+ \twocolfootsetupX{#1}
+ \expandafter\let\csname mpvfootnote#1\endcsname=\mpnormalvfootnoteX
+ \expandafter\let\csname mpfootgroup#1\endcsname=\mptwocolfootgroupX
+ \mptwocolfootsetupX{#1}}
+
+\newcommand*{\twocolfootsetupX}[1]{%
+ \count\csname footins#1\endcsname 500
+ \multiply\dimen\csname footins#1\endcsname by \tw@}
+\newcommand*{\mptwocolfootsetupX}[1]{%
+ \count\csname mpfootins#1\endcsname 500
+ \multiply\dimen\csname mpfootins#1\endcsname by \tw@}
+
+\newcommand*{\twocolvfootnoteX}[2]{%
+ \insert\csname footins#1\endcsname\bgroup
+ \notefontsetup
+ \footsplitskips
+ \spaceskip=\z@skip \xspaceskip=\z@skip
+ \@nameuse{footfmt#1}{#1}{#2}\egroup}
+
+\newcommand*{\twocolfootfmtX}[2]{%
+ \normal@pars
+ \hsize .45\hsize
+ \parindent=\z@
+%%% \parfillskip=0pt \@plus 1fil
+ \tolerance=5000\relax
+ \raggedright
+ \leavevmode
+ {\notenumfont\@nameuse{footfootmark#1}\strut%\enspace
+ #2\strut\par}\allowbreak}
+
+\newcommand*{\twocolfootgroupX}[1]{{\notefontsetup
+ \splittopskip=\ht\strutbox
+ \expandafter
+ \rigidbalance\csname footins#1\endcsname \tw@ \splittopskip}}
+\newcommand*{\mptwocolfootgroupX}[1]{{%
+ \vskip\skip\@nameuse{mpfootins#1}
+ \normalcolor
+ \@nameuse{footnoterule#1}
+ \splittopskip=\ht\strutbox
+ \expandafter
+ \rigidbalance\csname mpfootins#1\endcsname \tw@ \splittopskip}}
+
+\newcommand*{\footthreecolX}[1]{%
+ \expandafter\let\csname regvfootnote#1\endcsname=\threecolvfootnoteX
+ \expandafter\let\csname footfmt#1\endcsname=\threecolfootfmtX
+ \expandafter\let\csname footgroup#1\endcsname=\threecolfootgroupX
+ \threecolfootsetupX{#1}
+ \expandafter\let\csname mpvfootnote#1\endcsname=\mpnormalvfootnoteX
+ \expandafter\let\csname mpfootgroup#1\endcsname=\mpthreecolfootgroupX
+ \mpthreecolfootsetupX{#1}}
+
+\newcommand*{\threecolfootsetupX}[1]{%
+ \count\csname footins#1\endcsname 333
+ \multiply\dimen\csname footins#1\endcsname by \thr@@}
+\newcommand*{\mpthreecolfootsetupX}[1]{%
+ \count\csname mpfootins#1\endcsname 333
+ \multiply\dimen\csname mpfootins#1\endcsname by \thr@@}
+
+\newcommand*{\threecolvfootnoteX}[2]{%
+ \insert\csname footins#1\endcsname\bgroup
+ \notefontsetup
+ \footsplitskips
+ \@nameuse{footfmt#1}{#1}{#2}\egroup}
+
+\newcommand*{\threecolfootfmtX}[2]{%
+ \normal@pars
+ \hsize .3\hsize
+ \parindent=\z@
+%%% \parfillskip=0pt \@plus 1fil
+ \tolerance=5000\relax
+ \raggedright
+ \leavevmode
+ {\notenumfont\@nameuse{footfootmark#1}\strut%\enspace
+ #2\strut\par}\allowbreak}
+
+\newcommand*{\threecolfootgroupX}[1]{{\notefontsetup
+ \splittopskip=\ht\strutbox
+ \expandafter
+ \rigidbalance\csname footins#1\endcsname \thr@@ \splittopskip}}
+\newcommand*{\mpthreecolfootgroupX}[1]{{%
+ \vskip\skip\@nameuse{mpfootins#1}
+ \normalcolor
+ \@nameuse{footnoterule#1}
+ \splittopskip=\ht\strutbox
+ \expandafter
+ \rigidbalance\csname mpfootins#1\endcsname \thr@@ \splittopskip}}
+
+\newcommand*{\footparagraphX}[1]{%
+ \expandafter\let\csname footstart#1\endcsname=\parafootstartX
+ \expandafter\let\csname regvfootnote#1\endcsname=\para@vfootnoteX
+ \expandafter\let\csname footfmt#1\endcsname=\parafootfmtX
+ \expandafter\let\csname footgroup#1\endcsname=\para@footgroupX
+ \expandafter\let\csname footnoterule#1\endcsname=\normalfootnoteruleX
+ \count\csname footins#1\endcsname=1000
+ \expandafter\let\csname mpvfootnote#1\endcsname=\mppara@vfootnoteX
+ \expandafter\let\csname mpfootgroup#1\endcsname=\mppara@footgroupX
+ \count\csname mpfootins#1\endcsname=1000
+ \para@footsetupX{#1}}
+
+\newcommand*{\para@footsetupX}[1]{{\notefontsetup
+ \dimen0=\baselineskip
+ \multiply\dimen0 by 1024
+ \divide\dimen0 by \hsize \multiply\dimen0 by \footfudgefiddle\relax
+ \expandafter
+ \xdef\csname footfudgefactor#1\endcsname{%
+ \expandafter\strip@pt\dimen0 }}}
+
+\newcommand*{\parafootstartX}[1]{%
+ \vskip\skip\@nameuse{footins#1}%
+ \leftskip=\z@
+ \rightskip=\z@
+ \parindent=\z@
+ \vskip\skip\@nameuse{footins#1}%
+ \@nameuse{footnoterule#1}}
+
+\newcommand*{\para@vfootnoteX}[2]{%
+ \insert\csname footins#1\endcsname
+ \bgroup
+ \notefontsetup
+ \footsplitskips
+ \setbox0=\vbox{\hsize=\maxdimen
+ \noindent\@nameuse{footfmt#1}{#1}{#2}}%
+ \setbox0=\hbox{\unvxh0}%
+ \dp0=\z@
+ \ht0=\csname footfudgefactor#1\endcsname\wd0
+ \box0
+ \penalty0
+ \egroup}
+\newcommand*{\mppara@vfootnoteX}[2]{%
+ \global\setbox\@nameuse{mpfootins#1}\vbox{%
+ \unvbox\@nameuse{mpfootins#1}
+ \notefontsetup
+ \footsplitskips
+ \setbox0=\vbox{\hsize=\maxdimen
+ \noindent\color@begingroup\@nameuse{footfmt#1}{#1}{#2}\color@endgroup}%
+ \setbox0=\hbox{\unvxh0}%
+ \dp0=\z@
+ \ht0=\csname footfudgefactor#1\endcsname\wd0
+ \box0
+ \penalty0}}
+
+\newcommand*{\parafootfmtX}[2]{%
+ \ledsetnormalparstuff
+ {\notenumfont\@nameuse{footfootmark#1}\strut%\enspace
+ #2\penalty-10}}
+
+\newcommand*{\para@footgroupX}[1]{%
+ \unvbox\csname footins#1\endcsname
+ \makehboxofhboxes
+ \setbox0=\hbox{\unhbox0 \removehboxes}%
+ \notefontsetup
+ \noindent\unhbox0\par}
+\newcommand*{\mppara@footgroupX}[1]{{%
+ \vskip\skip\@nameuse{mpfootins#1}
+ \normalcolor
+ \@nameuse{footnoterule#1}
+ \unvbox\csname mpfootins#1\endcsname
+ \makehboxofhboxes
+ \setbox0=\hbox{\unhbox0 \removehboxes}%
+ \notefontsetup
+ \noindent\unhbox0\par}}
+
+\newcommand{\footnoteB}[1]{%
+ \stepcounter{footnoteB}%
+ \protected@xdef\@thefnmarkB{\thefootnoteB}%
+ \@footnotemarkB
+ \vfootnoteB{B}{#1}\m@mmf@prepare}
+
+\newcounter{footnoteB}
+ \renewcommand{\thefootnoteB}{\arabic{footnoteB}}
+
+\newinsert\footinsB
+
+\newcommand{\mpfootnoteB}[1]{%
+ \stepcounter{footnoteB}%
+ \protected@xdef\@thefnmarkB{\thefootnoteB}%
+ \@footnotemarkB
+ \mpvfootnoteB{B}{#1}\m@mmf@prepare}
+\newinsert\mpfootinsB
+
+\newcommand{\footnoteC}[1]{%
+ \stepcounter{footnoteC}%
+ \protected@xdef\@thefnmarkC{\thefootnoteC}%
+ \@footnotemarkC
+ \vfootnoteC{C}{#1}\m@mmf@prepare}
+\newcounter{footnoteC}
+ \renewcommand{\thefootnoteC}{\arabic{footnoteC}}
+\newinsert\footinsC
+
+\newcommand{\mpfootnoteC}[1]{%
+ \stepcounter{footnoteC}%
+ \protected@xdef\@thefnmarkC{\thefootnoteC}%
+ \@footnotemarkC
+ \mpvfootnoteC{C}{#1}\m@mmf@prepare}
+\newinsert\mpfootinsC
+
+\footnormalX{A}
+\footnormalX{B}
+\footnormalX{C}
+
+\newcommand*{\doxtrafeeti}{%
+ \setbox\@outputbox \vbox{%
+ \unvbox\@outputbox
+ \ifvoid\footinsA\else\footstartA{A}\footgroupA{A}\fi
+ \ifvoid\footinsB\else\footstartB{B}\footgroupB{B}\fi
+ \ifvoid\footinsC\else\footstartC{C}\footgroupC{C}\fi
+ }}
+
+\newcommand{\doreinxtrafeeti}{%
+ \ifvoid\footinsA\else\insert\footinsA{\unvbox\footinsA}\fi
+ \ifvoid\footinsB\else\insert\footinsB{\unvbox\footinsB}\fi
+ \ifvoid\footinsC\else\insert\footinsC{\unvbox\footinsC}\fi
+ }
+
+\newcommand*{\addfootinsX}[1]{%
+ \footnormalX{#1}
+ \g@addto@macro{\doxtrafeeti}{%
+ \setbox\@outputbox \vbox{%
+ \unvbox\@outputbox
+ \ifvoid\@nameuse{footins#1}\else
+ \@nameuse{footstart#1}{#1}\@nameuse{footgroup#1}{#1}\fi}}%
+ \g@addto@macro{\doreinxtrafeeti}{%
+ \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}}
+ \g@addto@macro{\l@dfamendmini}{%
+ \ifvoid\@nameuse{mpfootins#1}\else\@nameuse{mpfootgroup#1{#1}}}%
+}
+
+\newcommand*{\l@dfeetbeginmini}{\l@dedbeginmini\l@dfambeginmini}
+\newcommand*{\l@dfeetendmini}{\l@dedendmini\l@dfamendmini}
+
+\newcommand*{\l@dedbeginmini}{%
+ \let\Afootnote=\mpAfootnote%
+ \let\Bfootnote=\mpBfootnote%
+ \let\Cfootnote=\mpCfootnote%
+ \let\Dfootnote=\mpDfootnote%
+ \let\Efootnote=\mpEfootnote}
+\newcommand*{\l@dedendmini}{%
+ \ifvoid\mpAfootins\else\mpAfootgroup{A}\fi%
+ \ifvoid\mpBfootins\else\mpBfootgroup{B}\fi%
+ \ifvoid\mpCfootins\else\mpCfootgroup{C}\fi%
+ \ifvoid\mpDfootins\else\mpDfootgroup{D}\fi%
+ \ifvoid\mpEfootins\else\mpEfootgroup{E}\fi}
+
+\newcommand*{\l@dfambeginmini}{%
+ \let\footnoteA=\mpfootnoteA%
+ \let\footnoteB=\mpfootnoteB%
+ \let\footnoteC=\mpfootnoteC}
+\newcommand*{\l@dfamendmini}{%
+ \ifvoid\mpfootinsA\else\mpfootgroupA{A}\fi%
+ \ifvoid\mpfootinsB\else\mpfootgroupB{B}\fi%
+ \ifvoid\mpfootinsC\else\mpfootgroupC{C}\fi}
+
+\def\@iiiminipage#1#2[#3]#4{%
+ \leavevmode
+ \@pboxswfalse
+ \setlength\@tempdima{#4}%
+ \def\@mpargs{{#1}{#2}[#3]{#4}}%
+ \setbox\@tempboxa\vbox\bgroup
+ \color@begingroup
+ \hsize\@tempdima
+ \textwidth\hsize \columnwidth\hsize
+ \@parboxrestore
+ \def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c@mpfootnote\z@
+ \let\@footnotetext\@mpfootnotetext
+ \l@dfeetbeginmini% added
+ \let\@listdepth\@mplistdepth \@mplistdepth\z@
+ \@minipagerestore
+ \@setminipage}
+
+\def\endminipage{%
+ \par
+ \unskip
+ \ifvoid\@mpfootins\else
+ \l@dunboxmpfoot
+ \fi
+ \l@dfeetendmini% added
+ \@minipagefalse
+ \color@endgroup
+ \egroup
+ \expandafter\@iiiparbox\@mpargs{\unvbox\@tempboxa}}
+
+\newcommand*{\l@dunboxmpfoot}{%
+ \vskip\skip\@mpfootins
+ \normalcolor
+ \footnoterule
+ \unvbox\@mpfootins}
+
+\newenvironment{ledgroup}{%
+ \def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c@mpfootnote\z@
+ \let\@footnotetext\@mpfootnotetext
+ \l@dfeetbeginmini%
+}{%
+ \par
+ \unskip
+ \ifvoid\@mpfootins\else
+ \l@dunboxmpfoot
+ \fi
+ \l@dfeetendmini%
+}
+
+\newenvironment{ledgroupsized}[2][l]{%
+ \hsize #2\relax
+%% \textwidth #2\relax
+%% \columnwidth #2\relax
+ \let\ledllfill\hfil
+ \let\ledrlfill\hfil
+ \def\@tempa{#1}\def\@tempb{l}%
+ \ifx\@tempa\@tempb
+ \let\ledllfill\relax
+ \else
+ \def\@tempb{r}%
+ \ifx\@tempa\@tempb
+ \let\ledrlfill\relax
+ \fi
+ \fi
+ \def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c@mpfootnote\z@
+ \let\@footnotetext\@mpfootnotetext
+ \l@dfeetbeginmini%
+}{%
+ \par
+ \unskip
+ \ifvoid\@mpfootins\else
+ \l@dunboxmpfoot
+ \fi
+ \l@dfeetendmini%
+}
+
+\newcommand{\pagelinesep}{-}
+\newcommand{\edindexlab}{$&}
+\newcounter{labidx}
+\setcounter{labidx}{0}
+
+\newcommand{\doedindexlabel}{\stepcounter{labidx}%
+ \edlabel{\edindexlab\thelabidx}}
+
+\newcommand{\thepageline}{%
+ \thepage\pagelinesep\lineref{\edindexlab\thelabidx}}
+
+\@ifclassloaded{memoir}{%
+ \g@addto@macro{\makememindexhook}{%
+ \def\edindex{\@bsphack%
+ \@ifnextchar [{\l@d@index}{\l@d@index[\jobname]}}}
+ \newcommand{\edindex}[2][\jobname]{\@bsphack\@esphack}
+ \def\l@d@index[#1]{%
+ \@ifundefined{#1@idxfile}%
+ {\ifreportnoidxfile
+ \led@warn@NoIndexFile{#1}%
+ \fi
+ \begingroup
+ \@sanitize
+ \@nowrindex}%
+ {\def\@idxfile{#1}%
+ \doedindexlabel
+ \begingroup
+ \@sanitize
+ \l@d@wrindexm@m}}
+ \newcommand{\l@d@wrindexm@m}[1]{\l@d@@wrindexhyp#1||\\}
+ \def\l@d@@wrindexhyp#1|#2|#3\\{%
+ \ifshowindexmark\@showidx{#1}\fi
+ \ifx\\#2\\%
+ \protected@write\@auxout{}%
+ {\string\@@wrindexm@m{\@idxfile}{#1|hyperpage}{\thepageline}}%
+ \else
+ \def\Hy@temp@A{#2}%
+ \ifx\Hy@temp@A\HyInd@ParenLeft
+ \protected@write\@auxout{}%
+ {\string\@@wrindexm@m{\@idxfile}{#1|#2hyperpage}{\thepageline}}%
+ \else
+ \protected@write\@auxout{}%
+ {\string\@@wrindexm@m{\@idxfile}{#1|#2}{\thepageline}}%
+ \fi
+ \fi
+ \endgroup
+ \@esphack}
+}{%
+ \g@addto@macro{\makeindex}{%
+ \def\edindex{\@bsphack
+ \doedindexlabel
+ \begingroup
+ \@sanitize
+ \@wredindex}}
+ \newcommand{\edindex}[1]{\@bsphack\@esphack}
+ \newcommand{\@wredindex}[1]{%
+ \protected@write\@indexfile{}%
+ {\string\indexentry{#1}{\thepageline}}%
+ \endgroup
+ \@esphack}
+}
+
+\AtBeginDocument{\@ifpackageloaded{hyperref}{}{%
+ \def\l@d@@wrindexhyp#1||\\{%
+ \ifshowindexmark\@showidx{#1}\fi
+ \protected@write\@auxout{}%
+ {\string\@@wrindexm@m{\@idxfile}{#1}{\thepageline}}%
+ \endgroup
+ \@esphack}}}
+
+\newtoks\@emptytoks
+
+\newtoks\l@denvbody
+
+\newcommand{\addtol@denvbody}[1]{%
+ \global\l@denvbody\expandafter{\the\l@denvbody#1}}
+
+\newcommand{\l@dcollect@body}[1]{%
+ \l@denvbody{\expandafter#1\expandafter{\the\l@denvbody}}%
+ \edef\processl@denvbody{\the\l@denvbody\noexpand\end{\@currenvir}}%
+ \l@denvbody\@emptytoks \def\l@dbegin@stack{b}%
+ \begingroup
+ \expandafter\let\csname\@currenvir\endcsname\l@dcollect@@body
+ \edef\processl@denvbody{\expandafter\noexpand\csname\@currenvir\endcsname}%
+ \processl@denvbody}
+
+\def\l@dpush@begins#1\begin#2{%
+ \ifx\end#2\else b\expandafter\l@dpush@begins\fi}
+
+\def\l@dcollect@@body#1\end#2{%
+ \edef\l@dbegin@stack{\l@dpush@begins#1\begin\end
+ \expandafter\@gobble\l@dbegin@stack}%
+ \ifx\@empty\l@dbegin@stack
+ \endgroup
+ \@checkend{#2}%
+ \addtol@denvbody{#1}%
+ \else
+ \addtol@denvbody{#1\end{#2}}%
+ \fi
+ \processl@denvbody % A little tricky! Note the grouping
+}
+
+\newcommand*{\ampersand}{\char`\&}
+
+ \chardef\body=\catcode`\@
+ \catcode`\@=11
+ \chardef\next=\catcode`\&
+ \catcode`\&=\active
+
+ \newcount\stanza@count
+ \newlength{\stanzaindentbase}
+ \setlength{\stanzaindentbase}{20pt}
+
+\def\strip@szacnt#1,#2|{\def\@tempb{#1}\def\@tempa{#2|}}
+\newcommand*{\setstanzavalues}[2]{\def\@tempa{#2,,|}%
+ \stanza@count\z@
+ \def\next{\expandafter\strip@szacnt\@tempa
+ \ifx\@tempb\empty\let\next\relax\else
+ \expandafter\mathchardef\csname #1@\number\stanza@count
+ @\endcsname\@tempb\relax
+ \advance\stanza@count\@ne\fi\next}%
+ \next}
+
+\newcommand*{\setstanzaindents}[1]{\setstanzavalues{sza}{#1}}
+\newcommand*{\setstanzapenalties}[1]{\setstanzavalues{szp}{#1}}
+
+\def\stanza@line{\parindent=\csname sza@\number\stanza@count
+ @\endcsname\stanzaindentbase
+ \pstart\stanza@hang\ignorespaces}
+\xdef\stanza@hang{\noexpand\leavevmode\noexpand\startlock
+ \hangindent\expandafter
+ \noexpand\csname sza@0@\endcsname\stanzaindentbase
+ \hangafter\@ne}
+\def\sza@penalty{\count@\csname szp@\number\stanza@count @\endcsname
+ \ifnum\count@>\@M\advance\count@-\@M\penalty-\else
+ \penalty\fi\count@}
+
+\let\startstanzahook\relax
+\let\endstanzaextra\relax
+\xdef\stanza{\begingroup\startstanzahook%
+ \catcode`\&\active\global\stanza@count\@ne
+ \noexpand\ifnum\expandafter\noexpand
+ \csname sza@0@\endcsname=\z@\let\noexpand\stanza@hang\relax
+ \let\noexpand\endlock\relax\noexpand\else\interlinepenalty
+ \@M\rightskip\z@ plus 1fil\relax\noexpand\fi\noexpand\ifnum
+ \expandafter\noexpand\csname szp@0@\endcsname=\z@
+ \let\noexpand\sza@penalty\relax\noexpand\fi \def\noexpand&{%
+ \noexpand\endlock\noexpand\pend\noexpand\sza@penalty\global
+ \advance\stanza@count\@ne\noexpand\stanza@line}\def\noexpand
+ \&{\noexpand\endlock\noexpand\pend\endgroup\endstanzaextra}%
+ \noexpand\stanza@line}
+
+\newcommand*{\flagstanza}[2][\stanzaindentbase]{%
+ \hskip -#1\llap{#2}\hskip #1\ignorespaces}
+
+ \catcode`\&=\next
+ \catcode`\@=\body
+%% \let\ampersand=\&
+ \setstanzavalues{szp}{0}
+
+\newcommand*{\l@dtabnoexpands}{%
+ \def\ss{\noexpand\ss}%
+ \def\"##1{\noexpand\"##1}%
+ \def\'##1{\noexpand\'##1}%
+ \def\`##1{\noexpand\`##1}%
+ \def\^##1{\noexpand\^##1}%
+ \def\phantom##1{\noexpand\phantom{##1}}%
+ \def\hphantom##1{\noexpand\hphantom{##1}}%
+ \def\underbrace##1{\noexpand\underbrace{##1}}%
+ \def\dots{\noexpand\dots}%
+ \let\rtab=0%
+ \let\ctab=0%
+ \let\ltab=0%
+ \let\rtabtext=0%
+ \let\ltabtext=0%
+ \let\ctabtext=0%
+ \let\edbeforetab=0%
+ \let\edaftertab=0%
+ \let\edatab=0%
+ \let\edatabell=0%
+ \let\edatleft=0%
+ \let\edatright=0%
+ \let\edvertline=0%
+ \let\edvertdots=0%
+ \let\edrowfill=0%
+}
+
+\newcount\l@dampcount
+ \l@dampcount=1\relax
+\newcount\l@dcolcount
+ \l@dcolcount=0\relax
+
+\newbox\hilfsbox
+\newskip\hilfsskip
+\newbox\Hilfsbox
+\newcount\hilfscount
+
+\newdimen\dcoli
+\newdimen\dcolii
+\newdimen\dcoliii
+\newdimen\dcoliv
+\newdimen\dcolv
+\newdimen\dcolvi
+\newdimen\dcolvii
+\newdimen\dcolviii
+\newdimen\dcolix
+\newdimen\dcolx
+\newdimen\dcolxi
+\newdimen\dcolxii
+\newdimen\dcolxiii
+\newdimen\dcolxiv
+\newdimen\dcolxv
+\newdimen\dcolxvi
+\newdimen\dcolxvii
+\newdimen\dcolxviii
+\newdimen\dcolxix
+\newdimen\dcolxx
+\newdimen\dcolxxi
+\newdimen\dcolxxii
+\newdimen\dcolxxiii
+\newdimen\dcolxxiv
+\newdimen\dcolxxv
+\newdimen\dcolxxvi
+\newdimen\dcolxxvii
+\newdimen\dcolxxviii
+\newdimen\dcolxxix
+\newdimen\dcolxxx
+\newdimen\dcolerr % added for error handling
+
+\newcommand{\l@dcolwidth}{\ifcase \the\l@dcolcount \dcoli %???
+ \or \dcoli \or \dcolii \or \dcoliii
+ \or \dcoliv \or \dcolv \or \dcolvi
+ \or \dcolvii \or \dcolviii \or \dcolix \or \dcolx
+ \or \dcolxi \or \dcolxii \or \dcolxiii
+ \or \dcolxiv \or \dcolxv \or \dcolxvi
+ \or \dcolxvii \or \dcolxviii \or \dcolxix \or \dcolxx
+ \or \dcolxxi \or \dcolxxii \or \dcolxxiii
+ \or \dcolxxiv \or \dcolxxv \or \dcolxxvi
+ \or \dcolxxvii \or \dcolxxviii \or \dcolxxix \or \dcolxxx
+ \else \dcolerr \fi}
+
+\newcommand*{\stepl@dcolcount}{\advance\l@dcolcount\@ne
+ \ifnum\l@dcolcount>30\relax
+ \led@err@TooManyColumns
+ \fi}
+
+\newcommand{\l@dsetmaxcolwidth}{%
+ \ifdim\l@dcolwidth < \wd\hilfsbox
+ \l@dcolwidth = \wd\hilfsbox
+ \else \relax \fi}
+
+\let\EDTEXT=\edtext
+\newcommand{\xedtext}[2]{\EDTEXT{#1}{#2}}
+\let\CRITEXT=\critext
+\long\def\xcritext #1#2/{\CRITEXT{#1}{#2}/}
+\let\EDLABEL=\edlabel
+\newcommand*{\xedlabel}[1]{\EDLABEL{#1}}
+\let\EDINDEX=\edindex
+\ifl@dmemoir
+ \newcommand{\xedindex}{\@bsphack%
+ \@ifnextchar [{\l@d@index}{\l@d@index[\jobname]}}
+ \newcommand{\nulledindex}[2][\jobname]{\@bsphack\@esphack}
+\else
+ \newcommand{\xedindex}{\@bsphack%
+ \doedindexlabel
+ \begingroup
+ \@sanitize
+ \@wredindex}
+ \newcommand{\nulledindex}[1]{\@bsphack\@esphack}
+\fi
+
+\let\A@@footnote=\Afootnote
+\let\B@@footnote=\Bfootnote
+\let\C@@footnote=\Cfootnote
+\let\D@@footnote=\Dfootnote
+\let\E@@footnote=\Efootnote
+\let\@line@@num=\linenum
+\def\l@dgobbledarg #1/{\relax}
+\newcommand*{\l@dgobblearg}[1]{\relax}
+
+\let\Relax=\relax
+\let\NEXT=\next
+\newcount\@hilfs@count
+
+\def\measuremcell #1&{%
+ \ifx #1\\ \ifnum\l@dcolcount=0\let\NEXT\relax%
+ \else\l@dcheckcols%
+ \l@dcolcount=0%
+ \let\NEXT\measuremcell%
+ \fi%
+ \else\setbox\hilfsbox=\hbox{$\displaystyle{#1}$}%
+ \stepl@dcolcount%
+ \l@dsetmaxcolwidth%
+ \let\NEXT\measuremcell%
+ \fi\NEXT}
+
+\def\measuretcell #1&{%
+ \ifx #1\\ \ifnum\l@dcolcount=0\let\NEXT\relax%
+ \else\l@dcheckcols%
+ \l@dcolcount=0%
+ \let\NEXT\measuretcell%
+ \fi%
+ \else\setbox\hilfsbox=\hbox{#1}%
+ \stepl@dcolcount%
+ \l@dsetmaxcolwidth%
+ \let\NEXT\measuretcell%
+ \fi\NEXT}
+
+\def\measuremrow #1\\{%
+ \ifx #1&\let\NEXT\relax%
+ \else\measuremcell #1&\\&\\&%
+ \let\NEXT\measuremrow%
+ \fi\NEXT}
+\def\measuretrow #1\\{%
+ \ifx #1&\let\NEXT\relax%
+ \else\measuretcell #1&\\&\\&%
+ \let\NEXT\measuretrow%
+ \fi\NEXT}
+
+\newskip\edtabcolsep
+\global\edtabcolsep=10pt
+
+\let\NEXT\relax
+\let\Next=\next
+\newcommand{\variab}{\relax}
+
+\newcommand{\l@dcheckcols}{%
+ \ifnum\l@dcolcount=1\relax%
+ \else
+ \ifnum\l@dampcount=1\relax%
+ \else
+ \ifnum\l@dcolcount=\l@dampcount\relax%
+ \led@err@UnequalColumns
+ \fi%
+ \fi
+ \l@dampcount=\l@dcolcount%
+ \fi}
+
+\newcommand{\l@dmodforcritext}{%
+ \let\critext\relax%
+ \let\Afootnote\l@dgobbledarg%
+ \let\Bfootnote\l@dgobbledarg%
+ \let\Cfootnote\l@dgobbledarg%
+ \let\Dfootnote\l@dgobbledarg%
+ \let\Efootnote\l@dgobbledarg%
+ \let\edindex\nulledindex%
+ \let\linenum\@gobble}
+\newcommand{\l@drestoreforcritext}{%
+ \def\Afootnote##1##2/{\A@@footnote{##1}{##2}}%
+ \def\Bfootnote##1##2/{\B@@footnote{##1}{##2}}%
+ \def\Cfootnote##1##2/{\C@@footnote{##1}{##2}}%
+ \def\Dfootnote##1##2/{\D@@footnote{##1}{##2}}%
+ \def\Efootnote##1##2/{\E@@footnote{##1}{##2}}%
+ \let\edindex\xedindex}
+
+\newcommand{\l@dmodforedtext}{%
+ \let\edtext\relax
+ \let\Afootnote\l@dgobblearg
+ \let\Bfootnote\l@dgobblearg
+ \let\Cfootnote\l@dgobblearg
+ \let\Dfootnote\l@dgobblearg
+ \let\Efootnote\l@dgobblearg
+ \let\edindex\nulledindex
+ \let\linenum\@gobble}
+\newcommand{\l@drestoreforedtext}{%
+ \def\Afootnote##1{\A@@footnote{##1}}%
+ \def\Bfootnote##1{\B@@footnote{##1}}%
+ \def\Cfootnote##1{\C@@footnote{##1}}%
+ \def\Dfootnote##1{\D@@footnote{##1}}%
+ \def\Efootnote##1{\E@@footnote{##1}}%
+ \let\edindex\xedindex}
+
+\newcommand{\l@dnullfills}{%
+ \def\edlabel##1{}%
+ \def\edrowfill##1##2##3{}%
+}
+\newcommand{\l@drestorefills}{%
+ \def\edrowfill##1##2##3{\@EDROWFILL@{##1}{##2}{##3}}%
+}
+
+\newcommand{\letsforverteilen}{%
+ \let\critext\xcritext
+ \let\edtext\xedtext
+ \let\edindex\xedindex
+ \let\Afootnote\A@@footnote
+ \let\Bfootnote\B@@footnote
+ \let\Cfootnote\C@@footnote
+ \let\Dfootnote\D@@footnote
+ \let\Efootnote\E@@footnote
+ \let\linenum\@line@@num
+ \hilfsskip=\l@dcolwidth%
+ \advance\hilfsskip by -\wd\hilfsbox
+ \def\edlabel##1{\xedlabel{##1}}}
+
+\def\setmcellright #1&{\def\edlabel##1{}%
+ \let\edindex\nulledindex
+ \ifx #1\\ \ifnum\l@dcolcount=0%\removelastskip
+ \let\Next\relax%
+ \else\l@dcolcount=0%
+ \let\Next=\setmcellright%
+ \fi%
+ \else%
+ \disablel@dtabfeet%
+ \stepl@dcolcount%
+ \setbox\hilfsbox=\hbox{$\displaystyle{#1}$}%
+ \letsforverteilen%
+ \hskip\hilfsskip$\displaystyle{#1}$%
+ \hskip\edtabcolsep%
+ \let\Next=\setmcellright%
+ \fi\Next}
+
+\def\settcellright #1&{\def\edlabel##1{}%
+ \let\edindex\nulledindex
+ \ifx #1\\ \ifnum\l@dcolcount=0%\removelastskip
+ \let\Next\relax%
+ \else\l@dcolcount=0%
+ \let\Next=\settcellright%
+ \fi%
+ \else%
+ \disablel@dtabfeet%
+ \stepl@dcolcount%
+ \setbox\hilfsbox=\hbox{#1}%
+ \letsforverteilen%
+ \hskip\hilfsskip#1%
+ \hskip\edtabcolsep%
+ \let\Next=\settcellright%
+ \fi\Next}
+\def\setmcellleft #1&{\def\edlabel##1{}%
+ \let\edindex\nulledindex
+ \ifx #1\\ \ifnum\l@dcolcount=0 \let\Next\relax%
+ \else\l@dcolcount=0%
+ \let\Next=\setmcellleft%
+ \fi%
+ \else \disablel@dtabfeet%
+ \stepl@dcolcount%
+ \setbox\hilfsbox=\hbox{$\displaystyle{#1}$}%
+ \letsforverteilen
+ $\displaystyle{#1}$\hskip\hilfsskip\hskip\edtabcolsep%
+ \let\Next=\setmcellleft%
+ \fi\Next}
+
+\def\settcellleft #1&{\def\edlabel##1{}%
+ \let\edindex\nulledindex
+ \ifx #1\\ \ifnum\l@dcolcount=0 \let\Next\relax%
+ \else\l@dcolcount=0%
+ \let\Next=\settcellleft%
+ \fi%
+ \else \disablel@dtabfeet%
+ \stepl@dcolcount%
+ \setbox\hilfsbox=\hbox{#1}%
+ \letsforverteilen
+ #1\hskip\hilfsskip\hskip\edtabcolsep%
+ \let\Next=\settcellleft%
+ \fi\Next}
+\def\setmcellcenter #1&{\def\edlabel##1{}%
+ \let\edindex\nulledindex
+ \ifx #1\\ \ifnum\l@dcolcount=0\let\Next\relax%
+ \else\l@dcolcount=0%
+ \let\Next=\setmcellcenter%
+ \fi%
+ \else \disablel@dtabfeet%
+ \stepl@dcolcount%
+ \setbox\hilfsbox=\hbox{$\displaystyle{#1}$}%
+ \letsforverteilen%
+ \hskip 0.5\hilfsskip$\displaystyle{#1}$\hskip0.5\hilfsskip%
+ \hskip\edtabcolsep%
+ \let\Next=\setmcellcenter%
+ \fi\Next}
+
+\def\settcellcenter #1&{\def\edlabel##1{}%
+ \let\edindex\nulledindex
+ \ifx #1\\ \ifnum\l@dcolcount=0 \let\Next\relax%
+ \else\l@dcolcount=0%
+ \let\Next=\settcellcenter%
+ \fi%
+ \else \disablel@dtabfeet%
+ \stepl@dcolcount%
+ \setbox\hilfsbox=\hbox{#1}%
+ \letsforverteilen%
+ \hskip 0.5\hilfsskip #1\hskip 0.5\hilfsskip%
+ \hskip\edtabcolsep%
+ \let\Next=\settcellcenter%
+ \fi\Next}
+
+\let\NEXT=\relax
+
+\def\setmrowright #1\\{%
+ \ifx #1& \let\NEXT\relax
+ \else \centerline{\setmcellright #1&\\&\\&}
+ \let\NEXT=\setmrowright
+ \fi\NEXT}
+\def\settrowright #1\\{%
+ \ifx #1& \let\NEXT\relax
+ \else \centerline{\settcellright #1&\\&\\&}
+ \let\NEXT=\settrowright
+ \fi\NEXT}
+
+\def\setmrowleft #1\\{%
+ \ifx #1&\let\NEXT\relax
+ \else \centerline{\setmcellleft #1&\\&\\&}
+ \let\NEXT=\setmrowleft
+ \fi\NEXT}
+\def\settrowleft #1\\{%
+ \ifx #1& \let\NEXT\relax
+ \else \centerline{\settcellleft #1&\\&\\&}
+ \let\NEXT=\settrowleft
+ \fi\NEXT}
+
+\def\setmrowcenter #1\\{%
+ \ifx #1& \let\NEXT\relax%
+ \else \centerline{\setmcellcenter #1&\\&\\&}
+ \let\NEXT=\setmrowcenter
+ \fi\NEXT}
+\def\settrowcenter #1\\{%
+ \ifx #1& \let\NEXT\relax
+ \else \centerline{\settcellcenter #1&\\&\\&}
+ \let\NEXT=\settrowcenter
+ \fi\NEXT}
+
+\newcommand{\nullsetzen}{%
+ \stepl@dcolcount%
+ \l@dcolwidth=0pt%
+ \ifnum\l@dcolcount=30\let\NEXT\relax%
+ \l@dcolcount=0\relax
+ \else\let\NEXT\nullsetzen%
+ \fi\NEXT}
+
+\newcommand{\edatleft}[3][\@empty]{%
+ \ifx#1\@empty
+ \vbox to 10pt{\vss\hbox{$\left#2\vrule width0pt height #3
+ depth 0pt \right. $\hss}\vfil}
+ \else
+ \vbox to 4pt{\vss\hbox{$#1\left#2\vrule width0pt height #3
+ depth 0pt \right. $}\vfil}
+ \fi}
+\newcommand{\edatright}[3][\@empty]{%
+ \ifx#1\@empty
+ \vbox to 10pt{\vss\hbox{$\left.\vrule width0pt height #3
+ depth 0pt \right#2 $\hss}\vfil}
+ \else
+ \vbox to 4pt{\vss\hbox{$\left.\vrule width0pt height #3
+ depth 0pt \right#2 #1 $}\vfil}
+ \fi}
+
+\newcommand{\edvertline}[1]{\vbox to 8pt{\vss\hbox{\vrule height #1}\vfil}}
+
+\newcommand{\edvertdots}[1]{\vbox to 1pt{\vss\vbox to #1%
+ {\cleaders\hbox{$\m@th\hbox{.}\vbox to 0.5em{ }$}\vfil}}}
+
+\newdimen\edfilldimen
+\edfilldimen=0pt
+
+\newcounter{addcolcount}
+ \renewcommand{\theaddcolcount}{\roman{addcolcount}}
+\newcommand{\l@dtabaddcols}[2]{%
+ \l@dcheckstartend{#1}{#2}%
+ \ifl@dstartendok
+ \setcounter{addcolcount}{#1}%
+ \@whilenum \value{addcolcount}<#2\relax \do
+ {\advance\edfilldimen by \the \csname dcol\theaddcolcount\endcsname
+ \advance\edfilldimen by \edtabcolsep
+ \stepcounter{addcolcount}}%
+ \advance\edfilldimen by \the \csname dcol\theaddcolcount\endcsname
+ \fi
+}
+
+\newif\ifl@dstartendok
+\newcommand{\l@dcheckstartend}[2]{%
+ \l@dstartendoktrue
+ \ifnum #1<\@ne
+ \l@dstartendokfalse
+ \led@err@LowStartColumn
+ \fi
+ \ifnum #2>30\relax
+ \l@dstartendokfalse
+ \led@err@HighEndColumn
+ \fi
+ \ifnum #1>#2\relax
+ \l@dstartendokfalse
+ \led@err@ReverseColumns
+%%% \ledmac@error{Start column is greater than end column}{\@ehc}%
+ \fi
+}
+
+\newcommand*{\edrowfill}[3]{%
+ \l@dtabaddcols{#1}{#2}%
+ \hb@xt@ \the\l@dcolwidth{\hb@xt@ \the\edfilldimen{#3}\hss}}
+\let\@edrowfill@=\edrowfill
+\def\@EDROWFILL@#1#2#3{\@edrowfill@{#1}{#2}{#3}}
+
+\newcommand{\leftltab}[1]{%
+ \hb@xt@\z@{\vbox{\edtabindent%
+ \moveleft\Hilfsskip\hbox{\ #1}}\hss}}
+
+\newcommand{\leftrtab}[2]{%
+ #2\hb@xt@\z@{\vbox{\edtabindent%
+ \advance\Hilfsskip by\dcoli%
+ \moveleft\Hilfsskip\hbox{\ #1}}\hss}}
+
+\newcommand{\leftctab}[2]{%
+ \hb@xt@\z@{\vbox{\edtabindent\l@dcolcount=\l@dampcount%
+ \advance\Hilfsskip by 0.5\dcoli%
+ \setbox\hilfsbox=\hbox{\def\edlabel##1{}%
+ \disablel@dtabfeet$\displaystyle{#2}$}%
+ \advance\Hilfsskip by -0.5\wd\hilfsbox%
+ \moveleft\Hilfsskip\hbox{\ #1}}\hss}%
+ #2}
+
+\newcommand{\rightctab}[2]{%
+ \setbox\hilfsbox=\hbox{\def\edlabel##1{}%
+ \disablel@dtabfeet#2}\l@dampcount=\l@dcolcount%
+ #1\hb@xt@\z@{\vbox{\edtabindent\l@dcolcount=\l@dampcount%
+ \advance\Hilfsskip by 0.5\l@dcolwidth%
+ \advance\Hilfsskip by -\wd\hilfsbox%
+ \setbox\hilfsbox=\hbox{\def\edlabel##1{}%
+ \disablel@dtabfeet$\displaystyle{#1}$}%
+ \advance\Hilfsskip by -0.5\wd\hilfsbox%
+ \advance\Hilfsskip by \edtabcolsep%
+ \moveright\Hilfsskip\hbox{ #2}}\hss}%
+ }
+
+\newcommand{\rightltab}[2]{%
+ \setbox\hilfsbox=\hbox{\def\edlabel##1{}%
+ \disablel@dtabfeet#2}\l@dampcount=\l@dcolcount%
+ #1\hb@xt@\z@{\vbox{\edtabindent\l@dcolcount=\l@dampcount%
+ \advance\Hilfsskip by\l@dcolwidth%
+ \advance\Hilfsskip by-\wd\hilfsbox%
+ \setbox\hilfsbox=\hbox{\def\edlabel##1{}%
+ \disablel@dtabfeet$\displaystyle{#1}$}%
+ \advance\Hilfsskip by-\wd\hilfsbox%
+ \advance\Hilfsskip by\edtabcolsep%
+ \moveright\Hilfsskip\hbox{ #2}}\hss}%
+ }
+
+\newcommand{\rightrtab}[2]{%
+ \setbox\hilfsbox=\hbox{\def\edlabel##1{}%
+ \disablel@dtabfeet#2}%
+ #1\hb@xt@\z@{\vbox{\edtabindent%
+ \advance\Hilfsskip by-\wd\hilfsbox%
+ \advance\Hilfsskip by\edtabcolsep%
+ \moveright\Hilfsskip\hbox{ #2}}\hss}%
+ }
+
+\newcommand{\rtab}[1]{%
+ \l@dnullfills
+ \def\edbeforetab##1##2{\leftrtab{##1}{##2}}%
+ \def\edaftertab##1##2{\rightrtab{##1}{##2}}%
+ \measurembody{#1}%
+ \l@drestorefills
+ \variab
+ \setmrowright #1\\&\\%
+ \enablel@dtabfeet}
+
+\newcommand{\measurembody}[1]{%
+ \disablel@dtabfeet%
+ \l@dcolcount=0%
+ \nullsetzen%
+ \l@dcolcount=0
+ \measuremrow #1\\&\\%
+ \global\l@dampcount=1}
+
+\newcommand{\rtabtext}[1]{%
+ \l@dnullfills
+ \measuretbody{#1}%
+ \l@drestorefills
+ \variab
+ \settrowright #1\\&\\%
+ \enablel@dtabfeet}
+
+\newcommand{\measuretbody}[1]{%
+ \disablel@dtabfeet%
+ \l@dcolcount=0%
+ \nullsetzen%
+ \l@dcolcount=0
+ \measuretrow #1\\&\\%
+ \global\l@dampcount=1}
+
+\newcommand{\ltab}[1]{%
+ \l@dnullfills
+ \def\edbeforetab##1##2{\leftltab{##1}{##2}}%
+ \def\edaftertab##1##2{\rightltab{##1}{##2}}%
+ \measurembody{#1}%
+ \l@drestorefills
+ \variab
+ \setmrowleft #1\\&\\%
+ \enablel@dtabfeet}
+
+\newcommand{\ltabtext}[1]{%
+ \l@dnullfills
+ \measuretbody{#1}%
+ \l@drestorefills
+ \variab
+ \settrowleft #1\\&\\%
+ \enablel@dtabfeet}
+
+\newcommand{\ctab}[1]{%
+ \l@dnullfills
+ \def\edbeforetab##1##2{\leftctab{##1}{##2}}%
+ \def\edaftertab##1##2{\rightctab{##1}{##2}}%
+ \measurembody{#1}%
+ \l@drestorefills
+ \variab
+ \setmrowcenter #1\\&\\%
+ \enablel@dtabfeet}
+
+\newcommand{\ctabtext}[1]{%
+ \l@dnullfills
+ \measuretbody{#1}%
+ \l@drestorefills
+ \variab
+ \settrowcenter #1\\&\\%
+ \enablel@dtabfeet}
+
+\newcommand{\spreadtext}[1]{%\l@dcolcount=\l@dampcount%
+ \hb@xt@ \the\l@dcolwidth{\hbox{#1}\hss}}
+\newcommand{\spreadmath}[1]{%
+ \hb@xt@ \the\l@dcolwidth{\hbox{$\displaystyle{#1}$}\hss}}
+
+\def\tabellzwischen #1&{%
+ \ifx #1\\ \let\NEXT\relax \l@dcolcount=0
+ \else \stepl@dcolcount%
+ \l@dcolwidth = #1 mm
+ \let\NEXT=\tabellzwischen
+ \fi \NEXT }
+
+\def\edatabell #1\\{%
+ \tabellzwischen #1&\\&}
+\def\Setzen #1&{%
+ \ifx #1\relax \let\NEXT=\relax
+ \else \stepl@dcolcount%
+ \let\tabelskip=\l@dcolwidth
+ \EDTAB #1|
+ \let\NEXT=\Setzen
+ \fi\NEXT}
+
+\def\EDATAB #1\\{%
+ \ifx #1\Relax \centerline{\Setzen #1\relax&}
+ \let\Next\relax
+ \else \centerline{\Setzen #1&\relax&}
+ \let\Next=\EDATAB
+ \fi\Next}
+\newcommand{\edatab}[1]{%
+ \variab%
+ \EDATAB #1\\\Relax\\}
+
+\newskip\HILFSskip
+\newskip\Hilfsskip
+
+\newcommand{\EDTABINDENT}{%
+ \ifnum\l@dcolcount=30\let\NEXT\relax\l@dcolcount=0%
+ \else\stepl@dcolcount%
+ \advance\Hilfsskip by\l@dcolwidth%
+ \ifdim\l@dcolwidth=0pt\advance\hilfscount\@ne
+ \else\advance\Hilfsskip by \the\hilfscount\edtabcolsep%
+ \hilfscount=1\fi%
+ \let\NEXT=\EDTABINDENT%
+ \fi\NEXT}%
+\newcommand{\edtabindent}{%
+ \l@dcolcount=0\relax
+ \Hilfsskip=0pt%
+ \hilfscount=1\relax
+ \EDTABINDENT%
+ \hilfsskip=\hsize%
+ \advance\hilfsskip -\Hilfsskip%
+ \Hilfsskip=0.5\hilfsskip%
+ }%
+
+\def\EDTAB #1|#2|{%
+ \setbox\tabhilfbox=\hbox{$\displaystyle{#1}$}%
+ \setbox\tabHilfbox=\hbox{$\displaystyle{#2}$}%
+ \advance\tabelskip -\wd\tabhilfbox%
+ \advance\tabelskip -\wd\tabHilfbox%
+ \unhbox\tabhilfbox\hskip\tabelskip%
+ \unhbox\tabHilfbox}%
+
+\def\EDTABtext #1|#2|{%
+ \setbox\tabhilfbox=\hbox{#1}%
+ \setbox\tabHilfbox=\hbox{#2}%
+ \advance\tabelskip -\wd\tabhilfbox%
+ \advance\tabelskip -\wd\tabHilfbox%
+ \unhbox\tabhilfbox\hskip\tabelskip%
+ \unhbox\tabHilfbox}%
+\newbox\tabhilfbox
+\newbox\tabHilfbox
+
+\newenvironment{edarrayl}{\l@dcollect@body\ltab}{}
+\newenvironment{edarrayc}{\l@dcollect@body\ctab}{}
+\newenvironment{edarrayr}{\l@dcollect@body\rtab}{}
+
+\newenvironment{edtabularl}{\l@dcollect@body\ltabtext}{}
+\newenvironment{edtabularc}{\l@dcollect@body\ctabtext}{}
+\newenvironment{edtabularr}{\l@dcollect@body\rtabtext}{}
+
+\newcommand{\usingcritext}{%
+ \def\disablel@dtabfeet{\l@dmodforcritext}%
+ \def\enablel@dtabfeet{\l@drestoreforcritext}}
+\newcommand{\usingedtext}{%
+ \def\disablel@dtabfeet{\l@dmodforedtext}%
+ \def\enablel@dtabfeet{\l@drestoreforedtext}}
+
+\usingedtext
+
+\InputIfFileExists{ledpatch.sty}
+
+\endinput
+%%
+%% End of file `ledmac.sty'.
diff --git a/Master/texmf-dist/tex/latex/ledmac/ledpar.sty b/Master/texmf-dist/tex/latex/ledmac/ledpar.sty
new file mode 100644
index 00000000000..0050d5fa099
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ledmac/ledpar.sty
@@ -0,0 +1,1842 @@
+%%
+%% This is file `ledpar.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ledpar.dtx (with options: `code')
+%%
+%% Author: Peter Wilson (Herries Press) herries dot press at earthlink dot net
+%% Copyright 2004, 2005 Peter R. Wilson
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3 of this license or (at your option) any
+%% later version.
+%% The latest version of the license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2003/06/01 or later.
+%%
+%% This work has the LPPL maintenance status "author-maintained".
+%%
+%% This work consists of the files listed in the README file.
+%%
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{ledpar}[2005/04/08 v0.3b ledmac extension for parallel texts]
+
+ \l@dpairingfalse
+\newif\ifl@dpaging
+ \l@dpagingfalse
+\newif\ifledRcol
+ \ledRcolfalse
+\newdimen\Lcolwidth
+ \Lcolwidth=0.45\textwidth
+\newdimen\Rcolwidth
+ \Rcolwidth=0.45\textwidth
+
+\newcommand*{\led@err@TooManyPstarts}{%
+ \ledmac@error{Too many \string\pstart\space without printing.
+ Some text will be lost}{\@ehc}}
+\newcommand*{\led@err@BadLeftRightPstarts}[2]{%
+ \ledmac@error{The numbers of left (#1) and right (#2)
+ \string\pstart s do not match}{\@ehc}}
+\newcommand*{\led@err@LeftOnRightPage}{%
+ \ledmac@error{The left page has ended on a right page}{\@ehc}}
+\newcommand*{\led@err@RightOnLeftPage}{%
+ \ledmac@error{The right page has ended on a left page}{\@ehc}}
+\newcount\section@numR
+ \section@numR=\z@
+\newif\ifnumberingR
+ \pst@rtedLfalse
+\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
+ \endnumberingR
+ \fi
+ \global\l@dnumpstartsR \z@
+ \global\pst@rtedRfalse
+ \global\numberingRtrue
+ \global\advance\section@numR \@ne
+ \global\absline@numR \z@
+ \global\line@numR \z@
+ \global\subline@numR \z@
+ \global\@lock \z@
+ \global\sub@lock \z@
+ \global\sublines@false
+ \global\let\next@page@numR=\relax
+ \global\let\sub@change=\relax
+ \message{Section \the\section@numR R }%
+ \line@list@stuffR{\jobname.\extensionchars\the\section@numR R}%
+ \l@dend@stuff}
+
+\def\endnumberingR{%
+ \ifnumberingR
+ \global\numberingRfalse
+ \normal@pars
+ \ifl@dpairing
+ \global\pst@rtedRfalse
+ \else
+ \ifx\insertlines@listR\empty\else
+ \global\noteschanged@true
+ \fi
+ \ifx\line@listR\empty\else
+ \global\noteschanged@true
+ \fi
+ \fi
+ \ifnoteschanged@
+ \led@mess@NotesChanged
+ \fi
+ \else
+ \led@err@NumberingNotStarted
+ \fi}
+
+\newcommand*{\pausenumberingR}{%
+ \endnumberingR\global\numberingRtrue}
+\newcommand*{\resumenumberingR}{%
+ \ifnumberingR
+ \global\pst@rtedRtrue
+ \global\advance\section@numR \@ne
+ \led@mess@SectionContinued{\the\section@numR R}%
+ \line@list@stuffR{\jobname.\extensionchars\the\section@numR R}%
+ \l@dend@stuff
+ \else
+ \led@err@numberingShouldHaveStarted
+ \endnumberingR
+ \beginnumberingR
+ \fi}
+
+\newcommand*{\memorydumpL}{%
+ \endnumbering
+ \numberingtrue
+ \global\pst@rtedLtrue
+ \global\advance\section@num \@ne
+ \led@mess@SectionContinued{\the\section@num}%
+ \line@list@stuff{\jobname.\extensionchars\the\section@num}%
+ \l@dend@stuff}
+\newcommand*{\memorydumpR}{%
+ \endnumberingR
+ \numberingRtrue
+ \global\pst@rtedRtrue
+ \global\advance\section@numR \@ne
+ \led@mess@SectionContinued{\the\section@numR R}%
+ \line@list@stuffR{\jobname.\extensionchars\the\section@numR R}%
+ \l@dend@stuff}
+
+\newif\ifbypage@R
+ \bypage@Rfalse
+\newcommand*{\lineationR}[1]{{%
+ \ifnumberingR
+ \led@err@LineationInNumbered
+ \else
+ \def\@tempa{#1}\def\@tempb{page}%
+ \ifx\@tempa\@tempb
+ \global\bypage@Rtrue
+ \else
+ \def\@tempb{section}%
+ \ifx\@tempa\@tempb
+ \global\bypage@Rfalse
+ \else
+ \led@warn@BadLineation
+ \fi
+ \fi
+ \fi}}
+
+\newcount\line@marginR
+\renewcommand*{\linenummargin}[1]{{%
+ \l@dgetline@margin{#1}%
+ \ifnum\@l@dtempcntb>\m@ne
+ \ifledRcol
+ \global\line@marginR=\@l@dtempcntb
+ \else
+ \global\line@margin=\@l@dtempcntb
+ \fi
+ \fi}}
+\line@marginR=\@ne
+
+\newcounter{firstlinenumR}
+ \setcounter{firstlinenumR}{5}
+\newcounter{linenumincrementR}
+ \setcounter{linenumincrementR}{5}
+\newcounter{firstsublinenumR}
+ \setcounter{firstsublinenumR}{5}
+\newcounter{sublinenumincrementR}
+ \setcounter{sublinenumincrementR}{5}
+
+\providecommand*{\firstlinenum}{}
+\providecommand*{\linenumincrement}{}
+\providecommand*{\firstsublinenum}{}
+\providecommand*{\sublinenumincrement}{}
+\renewcommand*{\firstlinenum}[1]{%
+ \ifledRcol \setcounter{firstlinenumR}{#1}%
+ \else \setcounter{firstlinenum}{#1}%
+ \fi}
+\renewcommand*{\linenumincrement}[1]{%
+ \ifledRcol \setcounter{linenumincrementR}{#1}%
+ \else \setcounter{linenumincrement}{#1}%
+ \fi}
+\renewcommand*{\firstsublinenum}[1]{%
+ \ifledRcol \setcounter{firstsublinenumR}{#1}%
+ \else \setcounter{firstsublinenum}{#1}%
+ \fi}
+\renewcommand*{\sublinenumincrement}[1]{%
+ \ifledRcol \setcounter{sublinenumincrementR}{#1}%
+ \else \setcounter{sublinenumincrement}{#1}%
+ \fi}
+
+\newcommand*{\Rlineflag}{R}
+
+\newcommand*{\linenumrepR}[1]{\@arabic{#1}}
+\newcommand*{\sublinenumrepR}[1]{\@arabic{#1}}
+
+\newcommand*{\leftlinenumR}{%
+ \l@dlinenumR
+ \kern\linenumsep}
+\newcommand*{\rightlinenumR}{%
+ \kern\linenumsep
+ \l@dlinenumR}
+\newcommand*{\l@dlinenumR}{%
+ \numlabfont\linenumrepR{\line@numR}\Rlineflag%
+ \ifsublines@
+ \ifnum\subline@num>\z@
+ \unskip\fullstop\sublinenumrepR{\subline@numR}%
+ \fi
+ \fi}
+
+\newcount\line@numR
+\newcount\subline@numR
+\newcount\absline@numR
+
+\list@create{\line@listR}
+\list@create{\insertlines@listR}
+\list@create{\actionlines@listR}
+\list@create{\actions@listR}
+
+\list@create{\linesinpar@listL}
+\list@create{\linesinpar@listR}
+\list@create{\maxlinesinpar@list}
+
+\newcount\page@numR
+
+\renewcommand*{\read@linelist}[1]{%
+ \ifledRcol
+ \list@clear{\line@listR}%
+ \list@clear{\insertlines@listR}%
+ \list@clear{\actionlines@listR}%
+ \list@clear{\actions@listR}%
+ \list@clear{\linesinpar@listR}%
+ \list@clear{\linesonpage@listR}
+ \else
+ \list@clearing@reg
+ \list@clear{\linesinpar@listL}%
+ \list@clear{\linesonpage@listL}%
+ \fi
+ \list@clear{\maxlinesinpar@list}
+ \get@linelistfile{#1}%
+ \endgroup
+ \ifledRcol
+ \global\page@numR=\m@ne
+ \ifx\actionlines@listR\empty
+ \gdef\next@actionlineR{1000000}%
+ \else
+ \gl@p\actionlines@listR\to\next@actionlineR
+ \gl@p\actions@listR\to\next@actionR
+ \fi
+ \else
+ \global\page@num=\m@ne
+ \ifx\actionlines@list\empty
+ \gdef\next@actionline{1000000}%
+ \else
+ \gl@p\actionlines@list\to\next@actionline
+ \gl@p\actions@list\to\next@action
+ \fi
+ \fi}
+
+\renewcommand{\@l}[2]{%
+ \fix@page{#1}%
+ \ifledRcol
+ \ifx\l@dchset@num\relax \else
+ \advance\absline@numR \@ne
+ \set@line@action
+ \let\l@dchset@num=\relax
+ \advance\absline@numR \m@ne
+ \advance\line@numR \m@ne% % do we need this??
+ \fi
+ \advance\absline@numR \@ne
+ \ifx\next@page@numR\relax \else
+ \page@action
+ \let\next@page@numR=\relax
+ \fi
+ \ifx\sub@change\relax \else
+ \ifnum\sub@change>\z@
+ \sublines@true
+ \else
+ \sublines@false
+ \fi
+ \sub@action
+ \let\sub@change=\relax
+ \fi
+ \ifcase\@lock
+ \or
+ \@lock \tw@
+ \or \or
+ \@lock \z@
+ \fi
+ \ifcase\sub@lock
+ \or
+ \sub@lock \tw@
+ \or \or
+ \sub@lock \z@
+ \fi
+ \ifsublines@
+ \ifnum\sub@lock<\tw@
+ \advance\subline@numR \@ne
+ \fi
+ \else
+ \ifnum\@lock<\tw@
+ \advance\line@numR \@ne \subline@numR \z@
+ \fi
+ \fi
+ \else
+ \@l@reg
+ \fi}
+
+\newcount\last@page@numR
+ \last@page@numR=-10000
+\renewcommand*{\fix@page}[1]{%
+ \ifledRcol
+ \ifnum #1=\last@page@numR
+ \else
+ \ifbypage@R
+ \line@numR \z@ \subline@numR \z@
+ \fi
+ \page@numR=#1\relax
+ \last@page@numR=#1\relax
+ \def\next@page@numR{#1}%
+ \fi
+ \else
+ \ifnum #1=\last@page@num
+ \else
+ \ifbypage@
+ \line@num \z@ \subline@num \z@
+ \fi
+ \page@num=#1\relax
+ \last@page@num=#1\relax
+ \def\next@page@num{#1}%
+ \fi
+ \fi}
+
+\renewcommand*{\@adv}[1]{%
+ \ifsublines@
+ \ifledRcol
+ \advance\subline@numR by #1\relax
+ \ifnum\subline@numR<\z@
+ \led@warn@BadAdvancelineSubline
+ \subline@numR \z@
+ \fi
+ \else
+ \advance\subline@num by #1\relax
+ \ifnum\subline@num<\z@
+ \led@warn@BadAdvancelineSubline
+ \subline@num \z@
+ \fi
+ \fi
+ \else
+ \ifledRcol
+ \advance\line@numR by #1\relax
+ \ifnum\line@numR<\z@
+ \led@warn@BadAdvancelineLine
+ \line@numR \z@
+ \fi
+ \else
+ \advance\line@num by #1\relax
+ \ifnum\line@num<\z@
+ \led@warn@BadAdvancelineLine
+ \line@num \z@
+ \fi
+ \fi
+ \fi
+ \set@line@action}
+
+\renewcommand*{\@set}[1]{%
+ \ifledRcol
+ \ifsublines@
+ \subline@numR=#1\relax
+ \else
+ \line@numR=#1\relax
+ \fi
+ \set@line@action
+ \else
+ \ifsublines@
+ \subline@num=#1\relax
+ \else
+ \line@num=#1\relax
+ \fi
+ \set@line@action
+ \fi}
+
+\renewcommand*{\l@d@set}[1]{%
+ \ifledRcol
+ \line@numR=#1\relax
+ \advance\line@numR \@ne
+ \def\l@dchset@num{#1}
+ \else
+ \line@num=#1\relax
+ \advance\line@num \@ne
+ \def\l@dchset@num{#1}
+ \fi}
+\let\l@dchset@num\relax
+
+\renewcommand*{\page@action}{%
+ \ifledRcol
+ \xright@appenditem{\the\absline@numR}\to\actionlines@listR
+ \xright@appenditem{\next@page@numR}\to\actions@listR
+ \else
+ \xright@appenditem{\the\absline@num}\to\actionlines@list
+ \xright@appenditem{\next@page@num}\to\actions@list
+ \fi}
+\renewcommand*{\set@line@action}{%
+ \ifledRcol
+ \xright@appenditem{\the\absline@numR}\to\actionlines@listR
+ \ifsublines@
+ \@l@dtempcnta=-\subline@numR
+ \else
+ \@l@dtempcnta=-\line@numR
+ \fi
+ \advance\@l@dtempcnta by -5000\relax
+ \xright@appenditem{\the\@l@dtempcnta}\to\actions@listR
+ \else
+ \xright@appenditem{\the\absline@num}\to\actionlines@list
+ \ifsublines@
+ \@l@dtempcnta=-\subline@num
+ \else
+ \@l@dtempcnta=-\line@num
+ \fi
+ \advance\@l@dtempcnta by -5000\relax
+ \xright@appenditem{\the\@l@dtempcnta}\to\actions@list
+ \fi}
+
+\renewcommand*{\sub@action}{%
+ \ifledRcol
+ \xright@appenditem{\the\absline@numR}\to\actionlines@listR
+ \ifsublines@
+ \xright@appenditem{-1001}\to\actions@listR
+ \else
+ \xright@appenditem{-1002}\to\actions@listR
+ \fi
+ \else
+ \xright@appenditem{\the\absline@num}\to\actionlines@list
+ \ifsublines@
+ \xright@appenditem{-1001}\to\actions@list
+ \else
+ \xright@appenditem{-1002}\to\actions@list
+ \fi
+ \fi}
+
+\renewcommand*{\do@lockon}{%
+ \ifx\next\lock@off
+ \global\let\lock@off=\skip@lockoff
+ \else
+ \ifledRcol
+ \xright@appenditem{\the\absline@numR}\to\actionlines@listR
+ \ifsublines@
+ \xright@appenditem{-1005}\to\actions@listR
+ \ifcase\sub@lock
+ \sub@lock \@ne
+ \else
+ \sub@lock \z@
+ \fi
+ \else
+ \xright@appenditem{-1003}\to\actions@listR
+ \ifcase\@lock
+ \@lock \@ne
+ \else
+ \@lock \z@
+ \fi
+ \fi
+ \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
+ \fi
+ \fi}
+\renewcommand*{\do@lockoff}{%
+ \ifledRcol
+ \xright@appenditem{\the\absline@numR}\to\actionlines@listR
+ \ifsublines@
+ \xright@appenditem{-1006}\to\actions@listR
+ \ifnum\sub@lock=\tw@
+ \sub@lock \thr@@
+ \else
+ \sub@lock \z@
+ \fi
+ \else
+ \xright@appenditem{-1004}\to\actions@listR
+ \ifnum\@lock=\tw@
+ \@lock \thr@@
+ \else
+ \@lock \z@
+ \fi
+ \fi
+ \else
+ \xright@appenditem{\the\absline@num}\to\actionlines@list
+ \ifsublines@
+ \xright@appenditem{-1006}\to\actions@list
+ \ifnum\sub@lock=\tw@
+ \sub@lock \thr@@
+ \else
+ \sub@lock \z@
+ \fi
+ \else
+ \xright@appenditem{-1004}\to\actions@list
+ \ifnum\@lock=\tw@
+ \@lock \thr@@
+ \else
+ \@lock \z@
+ \fi
+ \fi
+ \fi}
+\global\let\lock@off=\do@lockoff
+
+\providecommand*{\n@num}{}
+\renewcommand*{\n@num}{%
+ \ifledRcol
+ \xright@appenditem{\the\absline@numR}\to\actionlines@listR
+ \xright@appenditem{-1007}\to\actions@listR
+ \else
+ \n@num@reg
+ \fi}
+
+\newcount\insert@countR
+\renewcommand*{\@ref}[2]{%
+ \ifledRcol
+ \global\insert@countR=#1\relax
+ \loop\ifnum\insert@countR>\z@
+ \xright@appenditem{\the\absline@numR}\to\insertlines@listR
+ \global\advance\insert@countR \m@ne
+ \repeat
+ \begingroup
+ \let\@ref=\dummy@ref
+ \let\page@action=\relax
+ \let\sub@action=\relax
+ \let\set@line@action=\relax
+ \let\@lab=\relax
+ #2
+ \global\endpage@num=\page@numR
+ \global\endline@num=\line@numR
+ \global\endsubline@num=\subline@numR
+ \endgroup
+ \xright@appenditem%
+ {\the\page@numR|\the\line@numR|%
+ \ifsublines@ \the\subline@numR \else 0\fi|%
+ \the\endpage@num|\the\endline@num|%
+ \ifsublines@ \the\endsubline@num \else 0\fi}\to\line@listR
+ #2
+ \else
+ \@ref@reg{#1}{#2}%
+ \fi}
+\providecommand*{\@pend}[1]{}
+\renewcommand*{\@pend}[1]{%
+ \xright@appenditem{#1}\to\linesinpar@listL}
+\providecommand*{\@pendR}[1]{}
+\renewcommand*{\@pendR}[1]{%
+ \xright@appenditem{#1}\to\linesinpar@listR}
+
+\providecommand*{\@lopL}[1]{}
+\renewcommand*{\@lopL}[1]{%
+ \xright@appenditem{#1}\to\linesonpage@listL}
+\providecommand*{\@lopR}[1]{}
+\renewcommand*{\@lopR}[1]{%
+ \xright@appenditem{#1}\to\linesonpage@listR}
+
+\newwrite\linenum@outR
+\newif\iffirst@linenum@out@R
+ \first@linenum@out@Rtrue
+\newcommand*{\line@list@stuffR}[1]{%
+ \read@linelist{#1}%
+ \iffirst@linenum@out@R
+ \immediate\closeout\linenum@outR
+ \global\first@linenum@out@Rfalse
+ \immediate\openout\linenum@outR=#1
+ \else
+ \closeout\linenum@outR
+ \openout\linenum@outR=#1
+ \fi}
+
+\newcommand*{\new@lineR}{%
+ \write\linenum@outR{\string\@l[\the\c@page][\thepage]}}
+\renewcommand*{\flag@start}{%
+ \ifledRcol
+ \edef\next{\write\linenum@outR{%
+ \string\@ref[\the\insert@countR][}}%
+ \next
+ \else
+ \edef\next{\write\linenum@out{%
+ \string\@ref[\the\insert@count][}}%
+ \next
+ \fi}
+\renewcommand*{\flag@end}{%
+ \ifledRcol
+ \write\linenum@outR{]}%
+ \else
+ \write\linenum@out{]}%
+ \fi}
+\renewcommand*{\startsub}{\dimen0\lastskip
+ \ifdim\dimen0>0pt \unskip \fi
+ \ifledRcol \write\linenum@outR{\string\sub@on}%
+ \else \write\linenum@out{\string\sub@on}%
+ \fi
+ \ifdim\dimen0>0pt \hskip\dimen0 \fi}
+\def\endsub{\dimen0\lastskip
+ \ifdim\dimen0>0pt \unskip \fi
+ \ifledRcol \write\linenum@outR{\string\sub@off}%
+ \else \write\linenum@out{\string\sub@off}%
+ \fi
+ \ifdim\dimen0>0pt \hskip\dimen0 \fi}
+
+\renewcommand*{\advanceline}[1]{%
+ \ifledRcol \write\linenum@outR{\string\@adv[#1]}%
+ \else \write\linenum@out{\string\@adv[#1]}%
+ \fi}
+\renewcommand*{\setline}[1]{%
+ \ifnum#1<\z@
+ \led@warn@BadSetline
+ \else
+ \ifledRcol \write\linenum@outR{\string\@set[#1]}%
+ \else \write\linenum@out{\string\@set[#1]}%
+ \fi
+ \fi}
+\renewcommand*{\setlinenum}[1]{%
+ \ifnum#1<\z@
+ \led@warn@BadSetlinenum
+ \else
+ \ifledRcol \write\linenum@outR{\string\l@d@set[#1]}
+ \else \write\linenum@out{\string\l@d@set[#1]} \fi
+ \fi}
+
+\renewcommand*{\startlock}{%
+ \ifledRcol \write\linenum@outR{\string\lock@on}%
+ \else \write\linenum@out{\string\lock@on}%
+ \fi}
+\def\endlock{%
+ \ifledRcol \write\linenum@outR{\string\lock@off}%
+ \else \write\linenum@out{\string\lock@off}%
+ \fi}
+
+\renewcommand*{\skipnumbering}{%
+ \ifledRcol \write\linenum@outR{\string\n@num}%
+ \advanceline{-1}%
+ \else
+ \skipnumbering@reg
+ \fi}
+
+\long\def\critext#1#2/{\leavevmode
+ \begingroup
+ \no@expands
+ \xdef\@tag{#1}%
+ \set@line
+ \ifledRcol \global\insert@countR \z@
+ \else \global\insert@count \z@ \fi
+ \ignorespaces #2\relax
+ \flag@start
+ \endgroup
+ \showlemma{#1}%
+ \ifx\end@lemmas\empty \else
+ \gl@p\end@lemmas\to\x@lemma
+ \x@lemma
+ \global\let\x@lemma=\relax
+ \fi
+ \flag@end}
+\renewcommand{\edtext}[2]{\leavevmode
+ \begingroup
+ \no@expands
+ \xdef\@tag{#1}%
+ \set@line
+ \ifledRcol \global\insert@countR \z@
+ \else \global\insert@count \z@ \fi
+ \ignorespaces #2\relax
+ \flag@start
+ \endgroup
+ \showlemma{#1}%
+ \ifx\end@lemmas\empty \else
+ \gl@p\end@lemmas\to\x@lemma
+ \x@lemma
+ \global\let\x@lemma=\relax
+ \fi
+ \flag@end}
+
+\renewcommand*{\set@line}{%
+ \ifledRcol
+ \ifx\line@listR\empty
+ \global\noteschanged@true
+ \xdef\l@d@nums{000|000|000|000|000|000|\edfont@info}%
+ \else
+ \gl@p\line@listR\to\@tempb
+ \xdef\l@d@nums{\@tempb|\edfont@info}%
+ \global\let\@tempb=\undefined
+ \fi
+ \else
+ \ifx\line@list\empty
+ \global\noteschanged@true
+ \xdef\l@d@nums{000|000|000|000|000|000|\edfont@info}%
+ \else
+ \gl@p\line@list\to\@tempb
+ \xdef\l@d@nums{\@tempb|\edfont@info}%
+ \global\let\@tempb=\undefined
+ \fi
+ \fi}
+
+\newenvironment{pairs}{%
+ \l@dpairingtrue
+ \l@dpagingfalse
+}{%
+ \l@dpairingfalse
+}
+\newenvironment{pages}{%
+ \l@dpairingtrue
+ \l@dpagingtrue
+ \setlength{\Lcolwidth}{\textwidth}%
+ \setlength{\Rcolwidth}{\textwidth}%
+}{%
+ \l@dpairingfalse
+ \l@dpagingfalse
+}
+
+\newenvironment{Leftside}{%
+ \ledRcolfalse
+ \let\pstart\pstartL
+ \let\pend\pendL
+ \let\memorydump\memorydumpL
+ \Leftsidehook
+}{\Leftsidehookend}
+\newcommand*{\Leftsidehook}{}
+\newcommand*{\Leftsidehookend}{}
+\newcommand*{\Rightsidehook}{}
+\newcommand*{\Rightsidehookend}{}
+
+\newenvironment{Rightside}{%
+ \ledRcoltrue
+ \let\beginnumbering\beginnumberingR
+ \let\endnumbering\endnumberingR
+ \let\pausenumbering\pausenumberingR
+ \let\resumenumbering\resumenumberingR
+ \let\memorydump\memorydumpR
+ \let\pstart\pstartR
+ \let\pend\pendR
+ \let\lineation\lineationR
+ \Rightsidehook
+}{%
+ \ledRcolfalse
+ \Rightsidehookend
+}
+
+\newcount\num@linesR
+\newbox\one@lineR
+\newcount\par@lineR
+\newcommand*{\pstartL}{\ifnumbering \else
+ \led@err@PstartNotNumbered
+ \beginnumbering
+ \fi
+ \ifnumberedpar@
+ \led@err@PstartInPstart
+ \pend
+ \fi
+ \ifpst@rtedL\else
+ \list@clear{\inserts@list}%
+ \global\let\next@insert=\empty
+ \global\pst@rtedLtrue
+ \fi
+ \begingroup\normal@pars
+ \global\advance\l@dnumpstartsL \@ne
+ \ifnum\l@dnumpstartsL>\l@dc@maxchunks
+ \led@err@TooManyPstarts
+ \global\l@dnumpstartsL=\l@dc@maxchunks
+ \fi
+ \global\setnamebox{l@dLcolrawbox\the\l@dnumpstartsL}=\vbox\bgroup%
+ \hsize=\Lcolwidth
+ \numberedpar@true}
+\newcommand*{\pstartR}{\ifnumberingR \else
+ \led@err@PstartNotNumbered
+ \beginnumberingR
+ \fi
+ \ifnumberedpar@
+ \led@err@PstartInPstart
+ \pendR
+ \fi
+ \ifpst@rtedR\else
+ \list@clear{\inserts@listR}%
+ \global\let\next@insertR=\empty
+ \global\pst@rtedRtrue
+ \fi
+ \begingroup\normal@pars
+ \global\advance\l@dnumpstartsR \@ne
+ \ifnum\l@dnumpstartsR>\l@dc@maxchunks
+ \led@err@TooManyPstarts
+ \global\l@dnumpstartsR=\l@dc@maxchunks
+ \fi
+ \global\setnamebox{l@dRcolrawbox\the\l@dnumpstartsR}=\vbox\bgroup%
+ \hsize=\Rcolwidth
+ \numberedpar@true}
+\newcommand*{\pendL}{\ifnumbering \else
+ \led@err@PendNotNumbered
+ \fi
+ \ifnumberedpar@ \else
+ \led@err@PendNoPstart
+ \fi
+ \l@dzeropenalties
+ \endgraf\global\num@lines=\prevgraf\egroup
+ \global\par@line=0
+ \endgroup
+ \ignorespaces}
+
+\newcommand*{\pendR}{\ifnumberingR \else
+ \led@err@PendNotNumbered
+ \fi
+ \ifnumberedpar@ \else
+ \led@err@PendNoPstart
+ \fi
+ \l@dzeropenalties
+ \endgraf\global\num@linesR=\prevgraf\egroup
+ \global\par@lineR=0
+ \endgroup
+ \ignorespaces}
+
+\newbox\l@dleftbox
+\newbox\l@drightbox
+
+\newcount\countLline
+ \countLline \z@
+\newcount\countRline
+ \countRline \z@
+
+\newcount\@donereallinesL
+\newcount\@donetotallinesL
+\newcount\@donereallinesR
+\newcount\@donetotallinesR
+
+\newcommand*{\do@lineL}{%
+ \advance\countLline \@ne
+ \ifvbox\namebox{l@dLcolrawbox\the\l@dpscL}%
+ {\vbadness=10000 \splittopskip=0pt
+ \do@lineLhook
+ \l@demptyd@ta
+ \global\setbox\one@line=\vsplit\namebox{l@dLcolrawbox\the\l@dpscL}
+ to\baselineskip}%
+ \unvbox\one@line \global\setbox\one@line=\lastbox
+ \getline@num
+ \setbox\l@dleftbox
+ \hb@xt@ \Lcolwidth{%
+ \affixline@num
+ \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@penaltiesL
+ \global\advance\@donereallinesL\@ne
+ \global\advance\@donetotallinesL\@ne
+ \else
+ \setbox\l@dleftbox \hb@xt@ \Lcolwidth{\hspace*{\Lcolwidth}}%
+ \global\advance\@donetotallinesL\@ne
+ \fi}
+
+\newcommand*{\do@lineLhook}{}
+\newcommand*{\do@lineRhook}{}
+
+\newcommand*{\do@lineR}{%
+ \advance\countRline \@ne
+ \ifvbox\namebox{l@dRcolrawbox\the\l@dpscR}%
+ {\vbadness=10000 \splittopskip=0pt
+ \do@lineRhook
+ \l@demptyd@ta
+ \global\setbox\one@lineR=\vsplit\namebox{l@dRcolrawbox\the\l@dpscR}
+ to\baselineskip}%
+ \unvbox\one@lineR \global\setbox\one@lineR=\lastbox
+ \getline@numR
+ \setbox\l@drightbox
+ \hb@xt@ \Rcolwidth{%
+ \affixline@numR
+ \l@dld@ta
+ \add@insertsR
+ \affixside@noteR
+ \l@dlsn@te% left side note
+ {\ledllfill\hb@xt@ \wd\one@lineR{\new@lineR\unhbox\one@lineR}\ledrlfill\l@drd@ta
+ \l@drsn@te% right side note
+ }}%
+ \add@penaltiesR
+ \global\advance\@donereallinesR \@ne
+ \global\advance\@donetotallinesR \@ne
+ \else
+ \setbox\l@drightbox \hb@xt@ \Rcolwidth{\hspace*{\Rcolwidth}}
+ \global\advance\@donetotallinesR \@ne
+ \fi}
+
+\newcommand*{\getline@numR}{%
+ \global\advance\absline@numR \@ne
+ \do@actionsR
+ \do@ballastR
+ \ifsublines@
+ \ifnum\sub@lock<\tw@
+ \global\advance\subline@numR \@ne
+ \fi
+ \else
+ \ifnum\@lock<\tw@
+ \global\advance\line@numR \@ne
+ \global\subline@numR=\z@
+ \fi
+ \fi}
+
+\newcommand*{\do@ballastR}{\global\ballast@count=\z@
+ \begingroup
+ \advance\absline@numR \@ne
+ \ifnum\next@actionlineR=\absline@numR
+ \ifnum\next@actionR>-1001
+ \global\advance\ballast@count by -\c@ballast
+ \fi
+ \fi
+ \endgroup}
+\newcommand*{\do@actionsR}{%
+ \global\let\do@actions@nextR=\relax
+ \@l@dtempcntb=\absline@numR
+ \ifnum\@l@dtempcntb<\next@actionlineR\else
+ \ifnum\next@actionR>-1001
+ \global\page@numR=\next@actionR
+ \ifbypage@R
+ \global\line@numR=\z@ \global\subline@numR=\z@
+ \fi
+ \else
+ \ifnum\next@actionR<-4999
+ \@l@dtempcnta=-\next@actionR
+ \advance\@l@dtempcnta by -5001
+ \ifsublines@
+ \global\subline@numR=\@l@dtempcnta
+ \else
+ \global\line@numR=\@l@dtempcnta
+ \fi
+ \else
+ \@l@dtempcnta=-\next@actionR
+ \advance\@l@dtempcnta by -1000
+ \do@actions@fixedcode
+ \fi
+ \fi
+ \ifx\actionlines@listR\empty
+ \gdef\next@actionlineR{1000000}%
+ \else
+ \gl@p\actionlines@listR\to\next@actionlineR
+ \gl@p\actions@listR\to\next@actionR
+ \global\let\do@actions@nextR=\do@actionsR
+ \fi
+ \fi
+ \do@actions@nextR}
+
+\newcommand*{\affixline@numR}{%
+\ifl@dskipnumber
+ \global\l@dskipnumberfalse
+\else
+ \ifsublines@
+ \@l@dtempcntb=\subline@numR
+ \ifnum\subline@numR>\c@firstsublinenumR
+ \@l@dtempcnta=\subline@numR
+ \advance\@l@dtempcnta by-\c@firstsublinenumR
+ \divide\@l@dtempcnta by\c@sublinenumincrementR
+ \multiply\@l@dtempcnta by\c@sublinenumincrementR
+ \advance\@l@dtempcnta by\c@firstsublinenumR
+ \else
+ \@l@dtempcnta=\c@firstsublinenumR
+ \fi
+ \ch@cksub@l@ck
+ \else
+ \@l@dtempcntb=\line@numR
+ \ifx\linenumberlist\empty
+ \ifnum\line@numR>\c@firstlinenumR
+ \@l@dtempcnta=\line@numR
+ \advance\@l@dtempcnta by-\c@firstlinenumR
+ \divide\@l@dtempcnta by\c@linenumincrementR
+ \multiply\@l@dtempcnta by\c@linenumincrementR
+ \advance\@l@dtempcnta by\c@firstlinenumR
+ \else
+ \@l@dtempcnta=\c@firstlinenumR
+ \fi
+ \else
+ \@l@dtempcnta=\line@numR
+ \edef\rem@inder{,\linenumberlist,\number\line@numR,}%
+ \edef\sc@n@list{\def\noexpand\sc@n@list
+ ####1,\number\@l@dtempcnta,####2|{\def\noexpand\rem@inder{####2}}}%
+ \sc@n@list\expandafter\sc@n@list\rem@inder|%
+ \ifx\rem@inder\empty\advance\@l@dtempcnta\@ne\fi
+ \fi
+ \ch@ck@l@ck
+ \fi
+ \ifnum\@l@dtempcnta=\@l@dtempcntb
+ \if@twocolumn
+ \if@firstcolumn
+ \gdef\l@dld@ta{\llap{{\leftlinenumR}}}%
+ \else
+ \gdef\l@drd@ta{\rlap{{\rightlinenumR}}}%
+ \fi
+ \else
+ \@l@dtempcntb=\line@marginR
+ \ifnum\@l@dtempcntb>\@ne
+ \advance\@l@dtempcntb by\page@numR
+ \fi
+ \ifodd\@l@dtempcntb
+ \gdef\l@drd@ta{\rlap{{\rightlinenumR}}}%
+ \else
+ \gdef\l@dld@ta{\llap{{\leftlinenumR}}}%
+ \fi
+ \fi
+ \else
+%% #1%
+ \fi
+ \f@x@l@cks
+\fi}
+
+\list@create{\inserts@listR}
+\newcommand*{\add@insertsR}{%
+ \global\let\add@inserts@nextR=\relax
+ \ifx\inserts@listR\empty \else
+ \ifx\next@insertR\empty
+ \ifx\insertlines@listR\empty
+ \global\noteschanged@true
+ \gdef\next@insertR{100000}%
+ \else
+ \gl@p\insertlines@listR\to\next@insertR
+ \fi
+ \fi
+ \ifnum\next@insertR=\absline@numR
+ \gl@p\inserts@listR\to\@insertR
+ \@insertR
+ \global\let\@insertR=\undefined
+ \global\let\next@insertR=\empty
+ \global\let\add@inserts@nextR=\add@insertsR
+ \fi
+ \fi
+ \add@inserts@nextR}
+
+\newcommand*{\add@penaltiesL}{}
+\newcommand*{\add@penaltiesR}{}
+
+\newcommand*{\flush@notesR}{%
+ \@xloop
+ \ifx\inserts@listR\empty \else
+ \gl@p\inserts@listR\to\@insertR
+ \@insertR
+ \global\let\@insertR=\undefined
+ \repeat}
+
+\renewcommand*{\Afootnote}[1]{%
+ \ifnumberedpar@
+ \ifledRcol
+ \xright@appenditem{\noexpand\vAfootnote{A}%
+ {{\l@d@nums}{\@tag}{#1}}}\to\inserts@listR
+ \global\advance\insert@countR \@ne
+ \else
+ \xright@appenditem{\noexpand\vAfootnote{A}%
+ {{\l@d@nums}{\@tag}{#1}}}\to\inserts@list
+ \global\advance\insert@count \@ne
+ \fi
+ \else
+ \vAfootnote{A}{{0|0|0|0|0|0|0}{}{#1}}%
+ \fi\ignorespaces}
+\renewcommand*{\Bfootnote}[1]{%
+ \ifnumberedpar@
+ \ifledRcol
+ \xright@appenditem{\noexpand\vBfootnote{B}%
+ {{\l@d@nums}{\@tag}{#1}}}\to\inserts@listR
+ \global\advance\insert@countR \@ne
+ \else
+ \xright@appenditem{\noexpand\vBfootnote{B}%
+ {{\l@d@nums}{\@tag}{#1}}}\to\inserts@list
+ \global\advance\insert@count \@ne
+ \fi
+ \else
+ \vBfootnote{B}{{0|0|0|0|0|0|0}{}{#1}}%
+ \fi\ignorespaces}
+\renewcommand*{\Cfootnote}[1]{%
+ \ifnumberedpar@
+ \ifledRcol
+ \xright@appenditem{\noexpand\vCfootnote{C}%
+ {{\l@d@nums}{\@tag}{#1}}}\to\inserts@listR
+ \global\advance\insert@countR \@ne
+ \else
+ \xright@appenditem{\noexpand\vCfootnote{C}%
+ {{\l@d@nums}{\@tag}{#1}}}\to\inserts@list
+ \global\advance\insert@count \@ne
+ \fi
+ \else
+ \vCfootnote{C}{{0|0|0|0|0|0|0}{}{#1}}%
+ \fi\ignorespaces}
+\renewcommand*{\Dfootnote}[1]{%
+ \ifnumberedpar@
+ \ifledRcol
+ \xright@appenditem{\noexpand\vDfootnote{D}%
+ {{\l@d@nums}{\@tag}{#1}}}\to\inserts@listR
+ \global\advance\insert@countR \@ne
+ \else
+ \xright@appenditem{\noexpand\vDfootnote{D}%
+ {{\l@d@nums}{\@tag}{#1}}}\to\inserts@list
+ \global\advance\insert@count \@ne
+ \fi
+ \else
+ \vDfootnote{D}{{0|0|0|0|0|0|0}{}{#1}}%
+ \fi\ignorespaces}
+\renewcommand*{\Efootnote}[1]{%
+ \ifnumberedpar@
+ \ifledRcol
+ \xright@appenditem{\noexpand\vEfootnote{E}%
+ {{\l@d@nums}{\@tag}{#1}}}\to\inserts@listR
+ \global\advance\insert@countR \@ne
+ \else
+ \xright@appenditem{\noexpand\vEfootnote{E}%
+ {{\l@d@nums}{\@tag}{#1}}}\to\inserts@list
+ \global\advance\insert@count \@ne
+ \fi
+ \else
+ \vEfootnote{E}{{0|0|0|0|0|0|0}{}{#1}}%
+ \fi\ignorespaces}
+
+\renewcommand*{\mpAfootnote}[1]{%
+ \ifnumberedpar@
+ \ifledRcol
+ \xright@appenditem{\noexpand\mpvAfootnote{A}%
+ {{\l@d@nums}{\@tag}{#1}}}\to\inserts@listR
+ \global\advance\insert@countR \@ne
+ \else
+ \xright@appenditem{\noexpand\mpvAfootnote{A}%
+ {{\l@d@nums}{\@tag}{#1}}}\to\inserts@list
+ \global\advance\insert@count \@ne
+ \fi
+ \else
+ \mpvAfootnote{A}{{0|0|0|0|0|0|0}{}{#1}}%
+ \fi\ignorespaces}
+\renewcommand*{\mpBfootnote}[1]{%
+ \ifnumberedpar@
+ \ifledRcol
+ \xright@appenditem{\noexpand\mpvBfootnote{B}%
+ {{\l@d@nums}{\@tag}{#1}}}\to\inserts@listR
+ \global\advance\insert@countR \@ne
+ \else
+ \xright@appenditem{\noexpand\mpvBfootnote{B}%
+ {{\l@d@nums}{\@tag}{#1}}}\to\inserts@list
+ \global\advance\insert@count \@ne
+ \fi
+ \else
+ \mpvBfootnote{B}{{0|0|0|0|0|0|0}{}{#1}}%
+ \fi\ignorespaces}
+\renewcommand*{\mpCfootnote}[1]{%
+ \ifnumberedpar@
+ \ifledRcol
+ \xright@appenditem{\noexpand\mpvCfootnote{C}%
+ {{\l@d@nums}{\@tag}{#1}}}\to\inserts@listR
+ \global\advance\insert@countR \@ne
+ \else
+ \xright@appenditem{\noexpand\mpvCfootnote{C}%
+ {{\l@d@nums}{\@tag}{#1}}}\to\inserts@list
+ \global\advance\insert@count \@ne
+ \fi
+ \else
+ \mpvCfootnote{C}{{0|0|0|0|0|0|0}{}{#1}}%
+ \fi\ignorespaces}
+\renewcommand*{\mpDfootnote}[1]{%
+ \ifnumberedpar@
+ \ifledRcol
+ \xright@appenditem{\noexpand\mpvDfootnote{D}%
+ {{\l@d@nums}{\@tag}{#1}}}\to\inserts@listR
+ \global\advance\insert@countR \@ne
+ \else
+ \xright@appenditem{\noexpand\mpvDfootnote{D}%
+ {{\l@d@nums}{\@tag}{#1}}}\to\inserts@list
+ \global\advance\insert@count \@ne
+ \fi
+ \else
+ \mpvDfootnote{D}{{0|0|0|0|0|0|0}{}{#1}}%
+ \fi\ignorespaces}
+\renewcommand*{\mpEfootnote}[1]{%
+ \ifnumberedpar@
+ \ifledRcol
+ \xright@appenditem{\noexpand\mpvEfootnote{E}%
+ {{\l@d@nums}{\@tag}{#1}}}\to\inserts@listR
+ \global\advance\insert@countR \@ne
+ \else
+ \xright@appenditem{\noexpand\mpvEfootnote{E}%
+ {{\l@d@nums}{\@tag}{#1}}}\to\inserts@list
+ \global\advance\insert@count \@ne
+ \fi
+ \else
+ \mpvEfootnote{E}{{0|0|0|0|0|0|0}{}{#1}}%
+ \fi\ignorespaces}
+\def\printlinesR#1|#2|#3|#4|#5|#6|#7|{\begingroup
+ \setprintlines{#1}{#2}{#3}{#4}{#5}{#6}%
+ \ifl@d@pnum #1\fullstop\fi
+ \ifledplinenum \linenumr@p{#2}\Rlineflag\else \symplinenum\fi
+ \ifl@d@ssub \fullstop \sublinenumr@p{#3}\fi
+ \ifl@d@dash \endashchar\fi
+ \ifl@d@pnum #4\fullstop\fi
+ \ifl@d@elin \linenumr@p{#5}\Rlineflag\fi
+ \ifl@d@esl \ifl@d@elin \fullstop\fi \sublinenumr@p{#6}\fi
+\endgroup}
+
+\let\ledsavedprintlines\printlines
+
+\list@create{\labelref@listR}
+
+\renewcommand*{\edlabel}[1]{\@bsphack
+ \ifledRcol
+ \write\linenum@outR{\string\@lab}%
+ \ifx\labelref@listR\empty
+ \xdef\label@refs{\zz@@@}%
+ \else
+ \gl@p\labelref@listR\to\label@refs
+ \fi
+ \protected@write\@auxout{}%
+ {\string\l@dmake@labelsR\space\thepage|\label@refs|{#1}}%
+ \else
+ \write\linenum@out{\string\@lab}%
+ \ifx\labelref@list\empty
+ \xdef\label@refs{\zz@@@}%
+ \else
+ \gl@p\labelref@list\to\label@refs
+ \fi
+ \fi
+ \protected@write\@auxout{}%
+ {\string\l@dmake@labels\space\thepage|\label@refs|{#1}}%
+ \@esphack}
+
+\def\l@dmake@labelsR#1|#2|#3|#4{%
+ \expandafter\ifx\csname the@label#4\endcsname \relax\else
+ \led@warn@DuplicateLabel{#4}%
+ \fi
+ \expandafter\gdef\csname the@label#4\endcsname{#1|#2\Rlineflag|#3}%
+ \ignorespaces}
+\AtBeginDocument{%
+ \def\l@dmake@labelsR#1|#2|#3|#4{}%
+}
+
+\renewcommand*{\@lab}{%
+ \ifledRcol
+ \xright@appenditem{\linenumr@p{\line@numR}|%
+ \ifsublines@ \sublinenumr@p{\subline@numR}\else 0\fi}%
+ \to\labelref@listR
+ \else
+ \xright@appenditem{\linenumr@p{\line@num}|%
+ \ifsublines@ \sublinenumr@p{\subline@num}\else 0\fi}%
+ \to\labelref@list
+ \fi}
+
+\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]{%
+ \ifnumberedpar@
+ \ifledRcol
+ \xright@appenditem{\noexpand\vl@dlsnote{{\l@d@nums}{\@tag}{#1}}}%
+ \to\inserts@listR
+ \global\advance\insert@countR \@ne
+ \else
+ \xright@appenditem{\noexpand\vl@dlsnote{{\l@d@nums}{\@tag}{#1}}}%
+ \to\inserts@list
+ \global\advance\insert@count \@ne
+ \fi
+ \fi\ignorespaces}
+\renewcommand*{\l@drsnote}[1]{%
+ \ifnumberedpar@
+ \ifledRcol
+ \xright@appenditem{\noexpand\vl@drsnote{{\l@d@nums}{\@tag}{#1}}}%
+ \to\inserts@listR
+ \global\advance\insert@countR \@ne
+ \else
+ \xright@appenditem{\noexpand\vl@drsnote{{\l@d@nums}{\@tag}{#1}}}%
+ \to\inserts@list
+ \global\advance\insert@count \@ne
+ \fi
+ \fi\ignorespaces}
+\renewcommand*{\l@dcsnote}[1]{%
+ \ifnumberedpar@
+ \ifledRcol
+ \xright@appenditem{\noexpand\vl@dcsnote{{\l@d@nums}{\@tag}{#1}}}%
+ \to\inserts@listR
+ \global\advance\insert@countR \@ne
+ \else
+ \xright@appenditem{\noexpand\vl@dcsnote{{\l@d@nums}{\@tag}{#1}}}%
+ \to\inserts@list
+ \global\advance\insert@count \@ne
+ \fi
+ \fi\ignorespaces}
+
+\newcommand*{\affixside@noteR}{%
+ \gdef\@templ@d{}%
+ \ifx\@templ@d\l@dcsnotetext \else
+ \if@twocolumn
+ \if@firstcolumn
+ \setl@dlp@rbox{}{}{\l@dcsnotetext}%
+ \else
+ \setl@drp@rbox{}{}{\l@dcsnotetext}%
+ \fi
+ \else
+ \@l@dtempcntb=\sidenote@marginR
+ \ifnum\@l@dtempcntb>\@ne
+ \ifl@dpaging
+ \advance\@l@dtempcntb by\@ne
+ \else
+ \advance\@l@dtempcntb by\page@num
+ \fi
+ \fi
+ \ifodd\@l@dtempcntb
+ \setl@drp@rbox{}{}{\l@dcsnotetext}%
+ \else
+ \setl@dlp@rbox{}{}{\l@dcsnotetext}%
+ \fi
+ \fi
+ \fi}
+
+\renewcommand{\l@dbfnote}[1]{%
+ \ifnumberedpar@
+ \ifledRcol
+ \xright@appenditem{\noexpand\vl@dbfnote{{#1}}{\@thefnmark}}%
+ \to\inserts@listR
+ \global\advance\insert@countR \@ne
+ \else
+ \xright@appenditem{\noexpand\vl@dbfnote{{#1}}{\@thefnmark}}%
+ \to\inserts@list
+ \global\advance\insert@count \@ne
+ \fi
+ \fi\ignorespaces}
+
+\renewcommand{\normalbfnoteX}[2]{%
+ \ifnumberedpar@
+ \ifledRcol
+ \xright@appenditem{\noexpand\vbfnoteX{#1}{#2}{\@nameuse{thefootnote#1}}}%
+ \to\inserts@listR
+ \global\advance\insert@countR \@ne
+ \else
+ \xright@appenditem{\noexpand\vbfnoteX{#1}{#2}{\@nameuse{thefootnote#1}}}%
+ \to\inserts@list
+ \global\advance\insert@count \@ne
+ \fi
+ \fi\ignorespaces}
+
+ \chardef\next=\catcode`\&
+ \catcode`\&=\active
+
+\newenvironment{astanza}{%
+ \startstanzahook
+ \catcode`\&\active
+ \global\stanza@count\@ne
+ \ifnum\usenamecount{sza@0@}=\z@
+ \let\stanza@hang\relax
+ \let\endlock\relax
+ \else
+%%% \interlinepenalty\@M % this screws things up, but I don't know why
+ \rightskip\z@ plus 1fil\relax
+ \fi
+ \ifnum\usenamecount{szp@0@}=\z@
+ \let\sza@penalty\relax
+ \fi
+ \def&{%
+ \endlock\mbox{}%
+ \sza@penalty
+ \global\advance\stanza@count\@ne
+ \@astanza@line}%
+ \def\&{%
+ \endlock\mbox{}
+ \pend
+ \endstanzaextra}%
+ \pstart
+ \@astanza@line
+}{}
+
+\newcommand*{\@astanza@line}{%
+ \parindent=\csname sza@\number\stanza@count @\endcsname\stanzaindentbase
+ \par
+ \stanza@hang%\mbox{}%
+ \ignorespaces}
+
+ \catcode`\&=\next
+
+\providecommand*{\newnamebox}[1]{%
+ \expandafter\newbox\csname #1\endcsname}
+\providecommand*{\setnamebox}[1]{%
+ \expandafter\setbox\csname #1\endcsname}
+\providecommand*{\unhnamebox}[1]{%
+ \expandafter\unhbox\csname #1\endcsname}
+\providecommand*{\unvnamebox}[1]{%
+ \expandafter\unvbox\csname #1\endcsname}
+\providecommand*{\namebox}[1]{%
+ \csname #1\endcsname}
+
+\providecommand*{\newnamecount}[1]{%
+ \expandafter\newcount\csname #1\endcsname}
+\providecommand*{\usenamecount}[1]{%
+ \csname #1\endcsname}
+
+\newcount\l@dc@maxchunks
+\newcommand{\maxchunks}[1]{\l@dc@maxchunks=#1}
+ \maxchunks{10}
+
+\newcount\l@dnumpstartsR
+
+\newcount\l@dpscL
+\newcount\l@dpscR
+
+\newcommand*{\l@dsetuprawboxes}{%
+ \@l@dtempcntb=\l@dc@maxchunks
+ \loop\ifnum\@l@dtempcntb>\z@
+ \newnamebox{l@dLcolrawbox\the\@l@dtempcntb}
+ \newnamebox{l@dRcolrawbox\the\@l@dtempcntb}
+ \advance\@l@dtempcntb \m@ne
+ \repeat}
+
+\newcommand*{\l@dsetupmaxlinecounts}{%
+ \@l@dtempcntb=\l@dc@maxchunks
+ \loop\ifnum\@l@dtempcntb>\z@
+ \newnamecount{l@dmaxlinesinpar\the\@l@dtempcntb}
+ \advance\@l@dtempcntb \m@ne
+ \repeat}
+\newcommand*{\l@dzeromaxlinecounts}{%
+ \begingroup
+ \@l@dtempcntb=\l@dc@maxchunks
+ \loop\ifnum\@l@dtempcntb>\z@
+ \global\usenamecount{l@dmaxlinesinpar\the\@l@dtempcntb}=\z@
+ \advance\@l@dtempcntb \m@ne
+ \repeat
+ \endgroup}
+
+\AtBeginDocument{%
+ \l@dsetuprawboxes
+ \l@dsetupmaxlinecounts
+ \l@dzeromaxlinecounts
+ \l@dnumpstartsL=\z@
+ \l@dnumpstartsR=\z@
+ \l@dpscL=\z@
+ \l@dpscR=\z@}
+
+\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}%
+ \if@filesw
+ \protected@write\@auxout{}{\string\select@language{\languagename}}%
+ \addtocontents{toc}{\string\select@language{\languagename}}%
+ \addtocontents{lof}{\string\select@language{\languagename}}%
+ \addtocontents{lot}{\string\select@language{\languagename}}%
+ \fi}
+
+\providecommand{\selectlanguage}[1]{}
+\newcommand*{\l@duselanguage}[1]{}
+\gdef\theledlanguageL{}
+\gdef\theledlanguageR{}
+
+\AtBeginDocument{%
+ \@ifundefined{bbl@main@language}{%
+ \l@dusedbabelfalse
+ \renewcommand*{\selectlanguage}[1]{}}{%
+ \l@dusedbabeltrue
+ \let\l@doldselectlanguage\selectlanguage
+ \let\l@doldbbl@set@language\bbl@set@language
+ \let\bbl@set@language\l@dbbl@set@language
+ \renewcommand{\selectlanguage}[1]{%
+ \l@doldselectlanguage{#1}%
+ \ifledRcol \gdef\theledlanguageR{#1}%
+ \else \gdef\theledlanguageL{#1}%
+ \fi}
+ \renewcommand*{\l@duselanguage}[1]{%
+ \l@doldselectlanguage{#1}}
+ \gdef\theledlanguageL{\bbl@main@language}%
+ \gdef\theledlanguageR{\bbl@main@language}%
+}}
+\newcommand*{\Columns}{%
+ \ifnum\l@dnumpstartsL=\l@dnumpstartsR\else
+ \led@err@BadLeftRightPstarts{\the\l@dnumpstartsL}{\the\l@dnumpstartsR}%
+ \fi
+ \begingroup
+ \l@dzeropenalties
+ \endgraf\global\num@lines=\prevgraf
+ \global\num@linesR=\prevgraf
+ \global\par@line=\z@
+ \global\par@lineR=\z@
+ \global\l@dpscL=\z@
+ \global\l@dpscR=\z@
+ \check@pstarts
+ \loop\if@pstarts
+ \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
+ \l@duselanguage{\theledlanguageR}%
+ \do@lineR
+ \fi
+ \hb@xt@ \hsize{%
+ \unhbox\l@dleftbox
+ \hfill \columnseparator \hfill
+ \unhbox\l@drightbox
+ }%
+ \checkraw@text
+ \repeat}
+ \@writelinesinparL
+ \@writelinesinparR
+ \check@pstarts
+ \repeat
+ \flush@notes
+ \flush@notesR
+ \endgroup
+ \global\l@dpscL=\z@
+ \global\l@dpscR=\z@
+ \global\l@dnumpstartsL=\z@
+ \global\l@dnumpstartsR=\z@
+ \ignorespaces}
+
+\newcommand*{\columnseparator}{%
+ \smash{\rule[-0.2\baselineskip]{\columnrulewidth}{1.05\baselineskip}}}
+\newdimen\columnrulewidth
+ \columnrulewidth=\z@
+
+\newif\if@pstarts
+\newcommand*{\check@pstarts}{%
+ \@pstartsfalse
+ \ifnum\l@dnumpstartsL>\l@dpscL
+ \@pstartstrue
+ \else
+ \ifnum\l@dnumpstartsR>\l@dpscR
+ \@pstartstrue
+ \fi
+ \fi}
+
+\newif\ifaraw@text
+ \araw@textfalse
+\newcommand*{\checkraw@text}{%
+ \araw@textfalse
+ \ifvbox\namebox{l@dLcolrawbox\the\l@dpscL}
+ \araw@texttrue
+ \else
+ \ifvbox\namebox{l@dRcolrawbox\the\l@dpscR}
+ \araw@texttrue
+ \fi
+ \fi}
+
+\newcommand*{\@writelinesinparL}{%
+ \edef\next{%
+ \write\linenum@out{\string\@pend[\the\@donereallinesL]}}%
+ \next
+ \global\@donereallinesL \z@}
+\newcommand*{\@writelinesinparR}{%
+ \edef\next{%
+ \write\linenum@outR{\string\@pendR[\the\@donereallinesR]}}%
+ \next
+ \global\@donereallinesR \z@}
+
+\newcount\numpagelinesL
+\newcount\numpagelinesR
+\newcount\l@dminpagelines
+
+\newcommand*{\Pages}{%
+ \typeout{}
+ \typeout{*************************** PAGES ***************************}
+ \ifnum\l@dnumpstartsL=\l@dnumpstartsR\else
+ \led@err@BadLeftRightPstarts{\the\l@dnumpstartsL}{\the\l@dnumpstartsR}%
+ \fi
+ \cleartol@devenpage
+ \begingroup
+ \l@dzeropenalties
+ \endgraf\global\num@lines=\prevgraf
+ \global\num@linesR=\prevgraf
+ \global\par@line=\z@
+ \global\par@lineR=\z@
+ \global\l@dpscL=\z@
+ \global\l@dpscR=\z@
+ \writtenlinesLfalse
+ \writtenlinesRfalse
+ \check@pstarts
+ \loop\if@pstarts
+ \global\advance\l@dpscL \@ne
+ \global\advance\l@dpscR \@ne
+ \getlinesfromparlistL
+ \getlinesfromparlistR
+ \l@dcalc@maxoftwo{\@cs@linesinparL}{\@cs@linesinparR}%
+ {\usenamecount{l@dmaxlinesinpar\the\l@dpscL}}%
+ \check@pstarts
+ \repeat
+ \global\l@dpscL=\z@
+ \global\l@dpscR=\z@
+ \getlinesfrompagelistL
+ \getlinesfrompagelistR
+ \l@dcalc@minoftwo{\@cs@linesonpageL}{\@cs@linesonpageR}%
+ {\l@dminpagelines}%
+ \check@pstarts
+ \if@pstarts
+ \global\advance\l@dpscL \@ne
+ \global\advance\l@dpscR \@ne
+ \global\@donereallinesL=\z@
+ \global\@donetotallinesL=\z@
+ \global\@donereallinesR=\z@
+ \global\@donetotallinesR=\z@
+ \checkraw@text
+{ \loop\ifaraw@text
+ \checkpageL
+ \l@duselanguage{\theledlanguageL}%
+%%% \begingroup
+{ \loop\ifl@dsamepage
+ \do@lineL
+ \advance\numpagelinesL \@ne
+ \hb@xt@ \hsize{\ledstrutL\unhbox\l@dleftbox}%
+ \get@nextboxL
+ \checkpageL
+ \repeat
+ \ifl@dpagefull
+ \@writelinesonpageL{\the\numpagelinesL}%
+ \else
+ \@writelinesonpageL{1000}%
+ \fi
+ \numpagelinesL \z@
+ \clearl@dleftpage }%
+ \checkpageR
+ \l@duselanguage{\theledlanguageR}%
+{ \loop\ifl@dsamepage
+ \do@lineR
+ \advance\numpagelinesR \@ne
+ \hb@xt@ \hsize{\ledstrutR\unhbox\l@drightbox}%
+ \get@nextboxR
+ \checkpageR
+ \repeat
+ \ifl@dpagefull
+ \@writelinesonpageR{\the\numpagelinesR}%
+ \else
+ \@writelinesonpageR{1000}%
+ \fi
+ \numpagelinesR=\z@
+ \clearl@drightpage}
+ \checkraw@text
+ \ifaraw@text
+ \getlinesfrompagelistL
+ \getlinesfrompagelistR
+ \l@dcalc@minoftwo{\@cs@linesonpageL}{\@cs@linesonpageR}%
+ {\l@dminpagelines}%
+ \fi
+ \repeat}
+ \fi
+ \flush@notes
+ \flush@notesR
+ \endgroup
+ \global\l@dpscL=\z@
+ \global\l@dpscR=\z@
+ \global\l@dnumpstartsL=\z@
+ \global\l@dnumpstartsR=\z@
+ \ignorespaces}
+
+\newcommand*{\ledstrutL}{\strut}
+\newcommand*{\ledstrutR}{\strut}
+
+\providecommand{\cleartoevenpage}[1][\@empty]{%
+ \clearpage
+ \ifodd\c@page\hbox{}#1\clearpage\fi}
+\newcommand*{\cleartol@devenpage}{%
+ \ifdim\pagetotal<\topskip% on an empty page
+ \else
+ \clearpage
+ \fi
+ \ifodd\c@page\hbox{}\clearpage\fi}
+\newcommand*{\clearl@dleftpage}{%
+ \clearpage
+ \ifodd\c@page\else
+ \led@err@LeftOnRightPage
+ \hbox{}%
+ \cleardoublepage
+ \fi}
+\newcommand*{\clearl@drightpage}{%
+ \clearpage
+ \ifodd\c@page
+ \led@err@RightOnLeftPage
+ \hbox{}%
+ \cleartoevenpage
+ \fi}
+
+\newcommand*{\getlinesfromparlistL}{%
+ \ifx\linesinpar@listL\empty
+ \gdef\@cs@linesinparL{0}%
+ \else
+ \gl@p\linesinpar@listL\to\@cs@linesinparL
+ \fi}
+\newcommand*{\getlinesfromparlistR}{%
+ \ifx\linesinpar@listR\empty
+ \gdef\@cs@linesinparR{0}%
+ \else
+ \gl@p\linesinpar@listR\to\@cs@linesinparR
+ \fi}
+
+\newcommand*{\getlinesfrompagelistL}{%
+ \ifx\linesonpage@listL\empty
+ \gdef\@cs@linesonpageL{1000}%
+ \else
+ \gl@p\linesonpage@listL\to\@cs@linesonpageL
+ \fi}
+\newcommand*{\getlinesfrompagelistR}{%
+ \ifx\linesonpage@listR\empty
+ \gdef\@cs@linesonpageR{1000}%
+ \else
+ \gl@p\linesonpage@listR\to\@cs@linesonpageR
+ \fi}
+
+\newcommand*{\@writelinesonpageL}[1]{%
+ \edef\next{\write\linenum@out{\string\@lopL{#1}}}%
+ \next}
+\newcommand*{\@writelinesonpageR}[1]{%
+ \edef\next{\write\linenum@outR{\string\@lopR{#1}}}%
+ \next}
+
+\newcommand*{\l@dcalc@maxoftwo}[3]{%
+ \ifnum #2>#1\relax
+ #3=#2\relax
+ \else
+ #3=#1\relax
+ \fi}
+\newcommand*{\l@dcalc@minoftwo}[3]{%
+ \ifnum #2<#1\relax
+ #3=#2\relax
+ \else
+ #3=#1\relax
+ \fi}
+
+\newif\ifl@dsamepage
+ \l@dsamepagetrue
+\newif\ifl@dpagefull
+\newcommand*{\checkpageL}{%
+ \l@dpagefulltrue
+ \l@dsamepagetrue
+ \check@goal
+ \ifdim\pagetotal<\ledthegoal
+ \ifnum\numpagelinesL<\l@dminpagelines
+ \else
+ \l@dsamepagefalse
+ \l@dpagefullfalse
+ \fi
+ \else
+ \l@dsamepagefalse
+ \l@dpagefulltrue
+ \fi}
+\newcommand*{\checkpageR}{%
+ \l@dpagefulltrue
+ \l@dsamepagetrue
+ \check@goal
+ \ifdim\pagetotal<\ledthegoal
+ \ifnum\numpagelinesR<\l@dminpagelines
+ \else
+ \l@dsamepagefalse
+ \l@dpagefullfalse
+ \fi
+ \else
+ \l@dsamepagefalse
+ \l@dpagefulltrue
+ \fi}
+
+\newdimen\ledthegoal
+\newcommand*{\goalfraction}{0.9}
+\newcommand*{\check@goal}{%
+ \ledthegoal=\goalfraction\pagegoal}
+
+\newif\ifwrittenlinesL
+\newif\ifwrittenlinesR
+
+\newcommand*{\get@nextboxL}{%
+ \ifvbox\namebox{l@dLcolrawbox\the\l@dpscL}% box is not empty
+ \else% box is empty
+ \ifnum\usenamecount{l@dmaxlinesinpar\the\l@dpscL}>\@donetotallinesL
+ \else
+ \ifwrittenlinesL
+ \else
+ \@writelinesinparL
+ \writtenlinesLtrue
+ \fi
+ \ifnum\l@dnumpstartsL>\l@dpscL
+ \writtenlinesLfalse
+ \l@dcalc@maxoftwo{\the\usenamecount{l@dmaxlinesinpar\the\l@dpscL}}%
+ {\the\@donetotallinesL}%
+ {\usenamecount{l@dmaxlinesinpar\the\l@dpscL}}%
+ \global\@donetotallinesL \z@
+ \global\advance\l@dpscL \@ne
+ \fi
+ \fi
+ \fi}
+\newcommand*{\get@nextboxR}{%
+ \ifvbox\namebox{l@dRcolrawbox\the\l@dpscR}% box is not empty
+ \else% box is empty
+ \ifnum\usenamecount{l@dmaxlinesinpar\the\l@dpscR}>\@donetotallinesR
+ \else
+ \ifwrittenlinesR
+ \else
+ \@writelinesinparR
+ \writtenlinesRtrue
+ \fi
+ \ifnum\l@dnumpstartsR>\l@dpscR
+ \writtenlinesRfalse
+ \l@dcalc@maxoftwo{\the\usenamecount{l@dmaxlinesinpar\the\l@dpscR}}%
+ {\the\@donetotallinesR}%
+ {\usenamecount{l@dmaxlinesinpar\the\l@dpscR}}%
+ \global\@donetotallinesR \z@
+ \global\advance\l@dpscR \@ne
+ \fi
+ \fi
+ \fi}
+
+\InputIfFileExists{ledparpatch.sty}
+
+\endinput
+%%
+%% End of file `ledpar.sty'.
diff --git a/Master/texmf-dist/tex/latex/ledmac/ledparpatch.sty b/Master/texmf-dist/tex/latex/ledmac/ledparpatch.sty
new file mode 100644
index 00000000000..a6b626c281b
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ledmac/ledparpatch.sty
@@ -0,0 +1,470 @@
+% ledparpatch.sty
+% Copyright Peter Wilson 2004, 2005
+% herries dot press at earthlink dot net
+%
+% Patch(es) for ledpar
+%
+%
+%\ProvidesFile{ledparpatch}[2005/01/11 v0.1 patches for ledpar v0.2]
+%\ProvidesFile{ledparpatch}[2005/04/15 v0.2 patches for ledpar v0.2]
+%\ProvidesFile{ledparpatch}[2005/08/22 v0.3 patches for ledpar v0.3b]
+\ProvidesFile{ledparpatch}[2005/09/15 v0.4 patches for ledpar v0.3b]
+
+%%%%%%%%%%%%%%%%%%%%%%%%% v0.3 (& v0.4) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%% sidenote extensions
+
+\renewcommand*{\l@drsnote}[1]{%
+ \ifnumberedpar@
+ \ifledRcol
+ \xright@appenditem{\noexpand\vl@drsnote{#1}}%
+ \to\inserts@listR
+ \global\advance\insert@countR \@ne
+ \else
+ \xright@appenditem{\noexpand\vl@drsnote{#1}}%
+ \to\inserts@list
+ \global\advance\insert@count \@ne
+ \fi
+ \fi\ignorespaces}
+
+\renewcommand*{\l@dlsnote}[1]{%
+ \ifnumberedpar@
+ \ifledRcol
+ \xright@appenditem{\noexpand\vl@dlsnote{#1}}%
+ \to\inserts@listR
+ \global\advance\insert@countR \@ne
+ \else
+ \xright@appenditem{\noexpand\vl@dlsnote{#1}}%
+ \to\inserts@list
+ \global\advance\insert@count \@ne
+ \fi
+ \fi\ignorespaces}
+
+\renewcommand*{\l@dcsnote}[1]{%
+ \ifnumberedpar@
+ \ifledRcol
+ \xright@appenditem{\noexpand\vl@dcsnote{#1}}%
+ \to\inserts@listR
+ \global\advance\insert@countR \@ne
+ \else
+ \xright@appenditem{\noexpand\vl@dcsnote{#1}}%
+ \to\inserts@list
+ \global\advance\insert@count \@ne
+ \fi
+ \fi\ignorespaces}
+
+\renewcommand*{\affixside@noteR}{%
+ \gdef\@templ@d{}%
+ \ifx\@templ@d\l@dcsnotetext \else
+ \if@twocolumn
+ \if@firstcolumn
+ \setl@dlp@rbox{\l@dcsnotetext}%
+ \else
+ \setl@drp@rbox{\l@dcsnotetext}%
+ \fi
+ \else
+ \@l@dtempcntb=\sidenote@marginR
+ \ifnum\@l@dtempcntb>\@ne
+ \advance\@l@dtempcntb by\page@num
+ \fi
+ \ifodd\@l@dtempcntb
+ \setl@drp@rbox{\l@dcsnotetext}%
+ \else
+ \setl@dlp@rbox{\l@dcsnotetext}%
+ \fi
+ \fi
+ \fi}
+
+%%% startlock/endlock fixes
+
+
+\newcount\@lockR
+\newcount\sub@lockR
+
+\newcommand*{\do@lockonR}{%
+ \xright@appenditem{\the\absline@numR}\to\actionlines@listR
+ \ifsublines@
+ \xright@appenditem{-1005}\to\actions@listR
+ \ifnum\sub@lockR=\z@
+ \sub@lockR \@ne
+ \else
+ \ifnum\sub@lockR=\thr@@
+ \sub@lockR \@ne
+ \fi
+ \fi
+ \else
+ \xright@appenditem{-1003}\to\actions@listR
+ \ifnum\@lockR=\z@
+ \@lockR \@ne
+ \else
+ \ifnum\@lockR=\thr@@
+ \@lockR \@ne
+ \fi
+ \fi
+ \fi}
+
+\renewcommand*{\do@lockon}{%
+ \ifx\next\lock@off
+ \global\let\lock@off=\skip@lockoff
+ \else
+ \ifledRcol
+ \do@lockonR
+ \else
+ \do@lockonL
+ \fi
+ \fi}
+
+\newcommand{\do@lockoffR}{%
+ \xright@appenditem{\the\absline@numR}\to\actionlines@listR
+ \ifsublines@
+ \xright@appenditem{-1006}\to\actions@listR
+ \ifnum\sub@lockR=\tw@
+ \sub@lockR \thr@@
+ \else
+ \sub@lockR \z@
+ \fi
+ \else
+ \xright@appenditem{-1004}\to\actions@listR
+ \ifnum\@lockR=\tw@
+ \@lockR \thr@@
+ \else
+ \@lockR \z@
+ \fi
+ \fi}
+
+\renewcommand*{\do@lockoff}{%
+ \ifledRcol
+ \do@lockoffR
+ \else
+ \do@lockoffL
+ \fi}
+\global\let\lock@off=\do@lockoff
+
+\newcommand*{\do@actions@fixedcodeR}{%
+ \ifcase\@l@dtempcnta%
+ \or% % 1001
+ \global\sublines@true
+ \or% % 1002
+ \global\sublines@false
+ \or% % 1003
+ \global\@lockR=\@ne
+ \or% % 1004
+ \ifnum\@lockR=\tw@
+ \global\@lockR=\thr@@
+ \else
+ \global\@lockR=\z@
+ \fi
+ \or% % 1005
+ \global\sub@lockR=\@ne
+ \or% % 1006
+ \ifnum\sub@lockR=\tw@
+ \global\sub@lockR=\thr@@
+ \else
+ \global\sub@lockR=\z@
+ \fi
+ \or% % 1007
+ \l@dskipnumbertrue
+ \else
+ \led@warn@BadAction
+ \fi}
+
+\renewcommand*{\do@actionsR}{%
+ \global\let\do@actions@nextR=\relax
+ \@l@dtempcntb=\absline@numR
+ \ifnum\@l@dtempcntb<\next@actionlineR\else
+ \ifnum\next@actionR>-1001\relax
+ \global\page@numR=\next@actionR
+ \ifbypage@R
+ \global\line@numR \z@ \global\subline@numR \z@
+ \fi
+ \else
+ \ifnum\next@actionR<-4999\relax % 9/05 added relax here
+ \@l@dtempcnta=-\next@actionR
+ \advance\@l@dtempcnta by -5001\relax
+ \ifsublines@
+ \global\subline@numR=\@l@dtempcnta
+ \else
+ \global\line@numR=\@l@dtempcnta
+ \fi
+ \else
+ \@l@dtempcnta=-\next@actionR
+ \advance\@l@dtempcnta by -1000\relax
+ \do@actions@fixedcodeR
+ \fi
+ \fi
+ \ifx\actionlines@listR\empty
+ \gdef\next@actionlineR{1000000}%
+ \else
+ \gl@p\actionlines@listR\to\next@actionlineR
+ \gl@p\actions@listR\to\next@actionR
+ \global\let\do@actions@nextR=\do@actionsR
+ \fi
+ \fi
+ \do@actions@nextR}
+
+
+\newcommand{\@l@regR}{%
+ \ifx\l@dchset@num\relax \else
+ \advance\absline@numR \@ne
+ \set@line@action
+ \let\l@dchset@num\relax
+ \advance\absline@numR \m@ne
+ \advance\line@numR \m@ne% % do we need this?
+ \fi
+ \advance\absline@numR \@ne
+ \ifx\next@page@numR\relax \else
+ \page@action
+ \let\next@page@numR\relax
+ \fi
+ \ifx\sub@change\relax \else
+ \ifnum\sub@change>\z@
+ \sublines@true
+ \else
+ \sublines@false
+ \fi
+ \sub@action
+ \let\sub@change\relax
+ \fi
+ \ifcase\@lockR
+ \or
+ \@lockR \tw@
+ \or\or
+ \@lockR \z@
+ \fi
+ \ifcase\sub@lockR
+ \or
+ \sub@lockR \tw@
+ \or\or
+ \sub@lockR \z@
+ \fi
+ \ifsublines@
+ \ifnum\sub@lockR<\tw@
+ \advance\subline@numR \@ne
+ \fi
+ \else
+ \ifnum\@lockR<\tw@
+ \advance\line@numR \@ne \subline@numR \z@
+ \fi
+ \fi}
+
+\renewcommand*{\@l}[2]{%
+ \fix@page{#1}%
+ \ifledRcol
+ \@l@regR
+ \else
+ \@l@reg
+ \fi}
+
+\renewcommand*{\beginnumberingR}{%
+ \ifnumberingR
+ \led@err@NumberingStarted
+ \endnumberingR
+ \fi
+ \global\l@dnumpstartsR \z@
+ \global\pst@rtedRfalse
+ \global\numberingRtrue
+ \global\advance\section@numR \@ne
+ \global\absline@numR \z@
+ \global\line@numR \z@
+ \global\@lockR \z@
+ \global\sub@lockR \z@
+ \global\sublines@false
+ \global\let\next@page@numR\relax
+ \global\let\sub@change\relax
+ \message{Section \the\section@numR R }%
+ \line@list@stuffR{\jobname.\extensionchars\the\section@numR R}%
+ \l@dend@stuff}
+
+\renewcommand*{\getline@numR}{%
+ \global\advance\absline@numR \@ne
+ \do@actionsR
+ \do@ballastR
+ \ifsublines@
+ \ifnum\sub@lockR<\tw@
+ \global\advance\subline@numR \@ne
+ \fi
+ \else
+ \ifnum\@lockR<\tw@
+ \global\advance\line@numR \@ne
+ \global\subline@numR \z@
+ \fi
+ \fi}
+
+
+\newcommand*{\ch@cksub@l@ckR}{%
+ \ifcase\sub@lockR
+ \or
+ \ifnum\sublock@disp=\@ne
+ \@l@dtempcntb \z@ \@l@dtempcnta \@ne
+ \fi
+ \or
+ \ifnum\sublock@disp=\tw@
+ \else
+ \@l@dtempcntb \z@ \@l@dtempcnta \@ne
+ \fi
+ \or
+ \ifnum\sublock@disp=\z@
+ \@l@dtempcntb \z@ \@l@dtempcnta \@ne
+ \fi
+ \fi}
+
+\newcommand*{\ch@ck@l@ckR}{%
+ \ifcase\@lockR
+ \or
+ \ifnum\lock@disp=\@ne
+ \@l@dtempcntb \z@ \@l@dtempcnta \@ne
+ \fi
+ \or
+ \ifnum\lock@disp=\tw@
+ \else
+ \@l@dtempcntb \z@ \@l@dtempcnta \@ne
+ \fi
+ \or
+ \ifnum\lock@disp=\z@
+ \@l@dtempcntb \z@ \@l@dtempcnta \@ne
+ \fi
+ \fi}
+
+\newcommand*{\f@x@l@cksR}{%
+ \ifcase\@lockR
+ \or
+ \global\@lockR \tw@
+ \or \or
+ \global\@lockR \z@
+ \fi
+ \ifcase\sub@lockR
+ \or
+ \global\sub@lockR \tw@
+ \or \or
+ \global\sub@lockR \z@
+ \fi}
+
+
+%% #1 = subline@numR
+%% #2 = c@firstsublinenumR
+%% #3 = c@sublinenumincrementR
+%%%%%% v0.4 put \relax after each argument; e.g., by #3 -> by #3\relax
+\providecommand*{\l@dcalcnum}[3]{%
+ \ifnum #1 > #2\relax
+ \@l@dtempcnta = #1\relax
+ \advance\@l@dtempcnta by -#2\relax
+ \divide\@l@dtempcnta by #3\relax
+ \multiply\@l@dtempcnta by #3\relax
+ \advance\@l@dtempcnta by #2\relax
+ \else
+ \@l@dtempcnta=#2\relax
+ \fi}
+
+\renewcommand*{\affixline@numR}{%
+\ifl@dskipnumber
+ \global\l@dskipnumberfalse
+\else
+ \ifsublines@
+ \@l@dtempcntb=\subline@numR
+ \l@dcalcnum{\subline@numR}{\c@firstsublinenumR}{\c@sublinenumincrementR}%
+ \ch@cksub@lockR
+ \else
+ \@l@dtempcntb=\line@numR
+ \ifx\linenumberlist\empty
+ \l@dcalcnum{\line@numR}{\c@firstlinenumR}{\c@linenumincrementR}%
+ \else
+ \@l@dtempcnta=\line@numR
+ \edef\rem@inder{,\linenumberlist,\number\line@numR,}%
+ \edef\sc@n@list{\def\noexpand\sc@n@list
+ ####1,\number\@l@dtempcnta,####2|{\def\noexpand\rem@inder{####2}}}%
+ \sc@n@list\expandafter\sc@n@list\rem@inder|%
+ \ifx\rem@inder\empty\advance\@l@dtempcnta\@ne\fi
+ \fi
+ \ch@ck@l@ckR
+ \fi
+ \ifnum\@l@dtempcnta=\@l@dtempcntb
+ \if@twocolumn
+ \if@firstcolumn
+ \gdef\l@dld@ta{\llap{{\leftlinenumR}}}%
+ \else
+ \gdef\l@drd@ta{\rlap{{\rightlinenumR}}}%
+ \fi
+ \else
+ \@l@dtempcntb=\line@marginR
+ \ifnum\@l@dtempcntb>\@ne
+ \advance\@l@dtempcntb by\page@numR
+ \fi
+ \ifodd\@l@dtempcntb
+ \gdef\l@drd@ta{\rlap{{\rightlinenumR}}}%
+ \else
+ \gdef\l@dld@ta{\llap{{\leftlinenumR}}}%
+ \fi
+ \fi
+ \fi
+ \f@x@l@cksR
+\fi}
+
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%% v0.2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\renewcommand*{\do@lineL}{%
+ \advance\countLline \@ne
+ \ifvbox\namebox{l@dLcolrawbox\the\l@dpscL}%
+ {\vbadness=10000
+ \splittopskip=\z@
+ \do@lineLhook
+ \l@demptyd@ta
+ \global\setbox\one@line=\vsplit\namebox{l@dLcolrawbox\the\l@dpscL}
+ to\baselineskip}%
+ \unvbox\one@line \global\setbox\one@line=\lastbox
+ \getline@num
+ \setbox\l@dleftbox
+ \hb@xt@ \Lcolwidth{%
+ \affixline@num
+ \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@penaltiesL
+ \global\advance\@donereallinesL\@ne
+ \global\advance\@donetotallinesL\@ne
+\else
+ \setbox\l@dleftbox \hb@xt@ \Lcolwidth{\hspace*{\Lcolwidth}}%
+ \global\advance\@donetotallinesL\@ne
+\fi}
+
+\renewcommand*{\do@lineR}{%
+ \advance\countRline \@ne
+ \ifvbox\namebox{l@dRcolrawbox\the\l@dpscR}%
+ {\vbadness=10000
+ \splittopskip=\z@
+ \do@lineRhook
+ \l@demptyd@ta
+ \global\setbox\one@lineR=\vsplit\namebox{l@dRcolrawbox\the\l@dpscR}
+ to\baselineskip}%
+ \unvbox\one@lineR \global\setbox\one@lineR=\lastbox
+ \getline@numR
+ \setbox\l@drightbox
+ \hb@xt@ \Rcolwidth{%
+ \affixline@numR
+ \l@dld@ta
+ \add@insertsR
+ \affixside@noteR
+ \l@dlsn@te
+ {\ledllfill\hb@xt@ \wd\one@lineR{\new@lineR\l@dunhbox@line{\one@lineR}}\ledrlfill\l@drd@ta%
+ \l@drsn@te
+ }}%
+ \add@penaltiesR
+ \global\advance\@donereallinesR\@ne
+ \global\advance\@donetotallinesR\@ne
+\else
+ \setbox\l@drightbox \hb@xt@ \Rcolwidth{\hspace*{\Rcolwidth}}
+ \global\advance\@donetotallinesR\@ne
+\fi}
+
+\endinput
+
+%%%%%%%%%%%%%%%%%%%% v0.1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%% v0.1 stuff now in ledpar.sty itself
+
diff --git a/Master/texmf-dist/tex/latex/ledmac/ledpatch.sty b/Master/texmf-dist/tex/latex/ledmac/ledpatch.sty
new file mode 100644
index 00000000000..d80586e7505
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ledmac/ledpatch.sty
@@ -0,0 +1,316 @@
+% ledpatch.sty
+% Copyright Peter Wilson 2004, 2005
+% herries dot press at earthlink dot net
+%
+% Patch(es) for ledmac
+%
+%
+%%%%\ProvidesFile{ledpatch}[2004/12/18 v0.1 patches for ledmac v0.6]
+%\ProvidesFile{ledpatch}[2005/01/11 v0.2 patches for ledmac v0.6]
+%\ProvidesFile{ledpatch}[2005/03/24 v0.3 patches for ledmac v0.7]
+%\ProvidesFile{ledpatch}[2005/04/15 v0.3a patches for ledmac v0.7]
+%\ProvidesFile{ledpatch}[2005/06/02 v0.4 patches for ledmac v0.7]
+\ProvidesFile{ledpatch}[2005/08/22 v0.5 patches for ledmac v0.7]
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%% v0.5 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%% There was a missing \else in \l@dcheckcols just before the
+%%% error message. The symptom was reported by Tobias Verbeke.
+
+\renewcommand*{\l@dcheckcols}{%
+ \ifnum\l@dcolcount=1\relax
+ \else
+ \ifnum\l@dampcount=1\relax
+ \else
+ \ifnum\l@dcolcount=\l@dampcount\relax
+ \else
+ \l@d@err@UnequalColumns
+ \fi
+ \fi
+ \l@dampcount=\l@dcolcount
+ \fi}
+
+%%% \startlock and \endlock did not work properly in the middle
+%%% of a line. Problem reported by Stefano Cracolic
+%%% Letting S stand for \startlock and E for \endlock and t for regular
+%%% text, numbering is per the following examples:
+%%%
+%%% 1 Sttttt 1 Sttttt 1 Sttttt 1 Sttttt
+%%% tttttt tttttt tttttt tttttt
+%%% 2 ttEStt 2 ttttES tttttE tttttt
+%%% tttttt tttttt 2 Sttttt 2 EStttt
+%%% tttttt tttttt tttttt tttttt
+%%% ttEttt ttEttt ttEttt ttEttt
+%%% 3 tttttt 3 tttttt 3 tttttt 3 tttttt
+%%% 4 tttStt 4 tttttS 4 tttStt 4 ttSEtt
+%%% tttttt tttttt tttttt 5 tttttt
+%%% tttttt tttttt tttttt 6 tttttt
+%%% ttEttt Ettttt tttttE 7 tttttt
+%%% 5 tttttt 5 tttttt 5 tttttt 8 tttttt
+
+\renewcommand*{\do@lockon}{%
+ \ifx\next\lock@off
+ \global\let\lock@off=\skip@lockoff
+ \else
+ \do@lockonL
+ \fi}
+
+\newcommand*{\do@lockonL}{%
+ \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
+ \ifnum\sub@lock=\z@
+ \sub@lock \@ne
+ \else
+ \ifnum\sub@lock=\thr@@
+ \sub@lock \@ne
+ \fi
+ \fi
+ \else
+ \xright@appenditem{-1003}\to\actions@list
+%% \ifcase\@lock
+%% \@lock \@ne
+%% \else
+%% \@lock \z@
+%% \fi
+ \ifnum\@lock=\z@
+ \@lock \@ne
+ \else
+ \ifnum\@lock=\thr@@
+ \@lock \@ne
+ \fi
+ \fi
+ \fi}
+
+\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@@
+ \else
+ \sub@lock \z@
+ \fi
+ \else
+ \xright@appenditem{-1004}\to\actions@list
+ \ifnum\@lock=\tw@
+ \@lock \thr@@
+ \else
+ \@lock \z@
+ \fi
+ \fi}
+\renewcommand*{\do@lockoff}{\do@lockoffL}
+\global\let\lock@off=\do@lockoff
+
+\renewcommand*{\do@actions@fixedcode}{%
+ \ifcase\@l@dtempcnta
+ \or% % 1001
+ \global\sublines@true
+ \or% % 1002
+ \global\sublines@false
+ \or% % 1003
+%% \ifcase\@lock
+%% \global\@lock=\@ne
+%% \else
+%% \global\@lock=\z@
+%% \fi
+ \global\@lock=\@ne
+ \or% % 1004
+ \ifnum\@lock=\tw@
+ \global\@lock=\thr@@
+ \else
+ \global\@lock=\z@
+ \fi
+ \or% % 1005
+5% \ifcase\sub@lock
+%% \global\sub@lock=\@ne
+%% \else
+%% \global\sub@lock=\z@
+%% \fi
+ \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}
+
+
+
+%%% Reworked the sidenotes code.
+%%% Sidenotes are normally aligned on their bottom lines,
+%%% i.e, multiline notes extend upwards. To align notes on
+%%% their top lines (multiline notes extend downwards):
+%%% \rightnoteupfalse and/or \leftnoteupfalse. The default
+%%% is, of course, \rightnoteuptrue and \leftnoteuptrue.
+
+\newif\ifrightnoteup
+ \rightnoteuptrue
+
+\renewcommand*{\l@drsnote}[1]{%
+ \ifnumberedpar@
+ \xright@appenditem{\noexpand\vl@drsnote{#1}}%
+ \to\inserts@list
+ \global\advance\insert@count \@ne
+ \fi\ignorespaces}
+
+\renewcommand*{\vl@drsnote}[1]{\setl@drp@rbox{#1}}
+
+\renewcommand*{\setl@drp@rbox}[1]{%
+ {\parindent\z@\hsize=\ledrsnotewidth\ledrsnotefontsetup
+ \global\setbox\l@drp@rbox
+ \ifrightnoteup
+ =\vbox to\z@{\vss#1}%
+ \else
+ =\vbox to0.7\baselineskip{\strut#1\vss}%
+ \fi}}
+
+\newif\ifleftnoteup
+ \leftnoteuptrue
+
+\renewcommand*{\l@dlsnote}[1]{%
+ \ifnumberedpar@
+ \xright@appenditem{\noexpand\vl@dlsnote{#1}}%
+ \to\inserts@list
+ \global\advance\insert@count \@ne
+ \fi\ignorespaces}
+
+\renewcommand*{\vl@dlsnote}[1]{\setl@dlp@rbox{#1}}
+
+\renewcommand*{\setl@dlp@rbox}[1]{%
+ {\parindent\z@\hsize=\ledlsnotewidth\ledlsnotefontsetup
+ \global\setbox\l@dlp@rbox
+ \ifleftnoteup
+ =\vbox to\z@{\vss #1}%
+ \else
+ =\vbox to 0.70\baselineskip{\strut#1\vss}%
+ \fi}}
+
+\renewcommand*{\l@dcsnote}[1]{%
+ \ifnumberedpar@
+ \xright@appenditem{\noexpand\vl@dcsnote{#1}}%
+ \to\inserts@list
+ \global\advance\insert@count \@ne
+ \fi\ignorespaces}
+
+\renewcommand*{\vl@dcsnote}[1]{\gdef\l@dcsnotetext{#1}}
+
+\renewcommand*{\affixside@note}{%
+ \gdef\@templ@d{}%
+ \ifx\@templ@d\l@dcsnotetext \else
+ \if@twocolumn
+ \if@firstcolumn
+ \setl@dlp@rbox{\l@dcsnotetext}%
+ \else
+ \setl@drp@rbox{\l@dcsnotetext}%
+ \fi
+ \else
+ \@l@dtempcntb=\sidenote@margin
+ \ifnum\@l@dtempcntb>\@ne
+ \advance\@l@dtempcntb by\page@num
+ \fi
+ \ifodd\@l@dtempcntb
+ \setl@drp@rbox{\l@dcsnotetext}%
+ \else
+ \setl@dlp@rbox{\l@dcsnotetext}%
+ \fi
+ \fi
+ \fi}
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%% v0.4 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%% The instructions on page 26 in the manual regarding creating
+%%% a new familiar footnote series are incorrect. Instead follow
+%%% how the provided series are defined, that is, for example:
+%%% \makeatletter
+%%% \newcommand{\footnoteD}[1]{%
+%%% \stepcounter{footnoteD}%
+%%% \protected@xdef\@thefnmarkD{\thefootnoteD}%
+%%% \@footnotemarkD
+%%% \vfootnoteD{D}{#1}\m@mmf@prepare}
+%%%
+%%% \newcounter{footnoteD}
+%%% \renewcommand{\thefootnoteD}{\arabic{footnoteD}}
+%%% \newinsert\footinsD
+%%%
+%%% \newcommand{\mpfootnoteD}[1]{%
+%%% \stepcounter{footnoteD}%
+%%% \protected@xdef\@thefnmarkD{\thefootnoteD}%
+%%% \@footnotemarkD
+%%% \mpvfootnoteD{D}{#1}\m@mmf@prepare}
+%%% \newinsert\mpfootinsD
+%%%
+%%% \footnormalX{D}
+%%% \addfootinsX{D}
+%%% \makeatother
+%%%
+
+%%% Change \addfootinsX to correct screwups in defining new familar
+%%% series footnotes. Problem initially noted by Dirk Schlimm
+%%% (dschlimm@gmail.com) in private email, 2005/05/31
+
+\renewcommand*{\addfootinsX}[1]{%
+ \footnormalX{#1}%
+ \g@addto@macro{\doxtrafeeti}{%
+ \setbox\@outputbox \vbox{%
+ \unvbox\@outputbox
+ \ifvoid\@nameuse{footins#1}\else
+ \@nameuse{footstart#1}{#1}\@nameuse{footgroup#1}{#1}\fi}}%
+ \g@addto@macro{\doreinxtrafeeti}{%
+ \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}}%
+ \g@addto@macro{\l@dfambeginmini}{%
+ \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}}}%
+ \g@addto@macro{\l@dfamendmini}{%
+ \ifvoid\@nameuse{mpfootins#1}\else\@nameuse{mpfootgroup#1}{#1}\fi}%
+}
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%% v0.3a %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% Slight efficiency improvement (particularly for ledpar)
+
+\newcommand*{\l@dunhbox@line}[1]{\unhbox #1}
+
+\renewcommand*{\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
+%%%% {\ledllfill\hb@xt@ \wd\one@line{\new@line\unhbox\one@line}\ledrlfill\l@drd@ta%
+ {\ledllfill\hb@xt@ \wd\one@line{\new@line\l@dunhbox@line{\one@line}}\ledrlfill\l@drd@ta%
+ \l@drsn@te
+ }}
+ \add@penalties}
+
+
+\endinput
+
+%%%%%%%%%%% earlier patches now in ledmac.sty itself
+