diff options
author | Karl Berry <karl@freefriends.org> | 2015-04-13 22:09:26 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-04-13 22:09:26 +0000 |
commit | ab9be52a67d39f40115219e0f9bc910e2f3fe161 (patch) | |
tree | 4733e546b3e768b05f371ec3d7996eac0d29f7a5 /Master/texmf-dist/tex/latex/eledmac | |
parent | 8562bba79a44a820fa5d61677186442b48d889e6 (diff) |
eledmac (13apr15)
git-svn-id: svn://tug.org/texlive/trunk@36840 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/eledmac')
-rw-r--r-- | Master/texmf-dist/tex/latex/eledmac/eledmac.sty | 1450 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/eledmac/eledpar.sty | 508 |
2 files changed, 1209 insertions, 749 deletions
diff --git a/Master/texmf-dist/tex/latex/eledmac/eledmac.sty b/Master/texmf-dist/tex/latex/eledmac/eledmac.sty index cb2acbfc52d..f5214429322 100644 --- a/Master/texmf-dist/tex/latex/eledmac/eledmac.sty +++ b/Master/texmf-dist/tex/latex/eledmac/eledmac.sty @@ -26,8 +26,14 @@ \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{eledmac}[2015/03/22 v1.20.0 LaTeX port of EDMAC]% +\ProvidesPackage{eledmac}[2015/04/13 v1.21.0 LaTeX port of EDMAC]% \newif\ifledfinal +\newif\ifoldprintnpnumspace@ +\newif\ifnocritical@% +\newif\if@noeled@sec% +\newif\ifnoend@% +\newif\ifnofamiliar@% +\newif\ifnoledgroup@% \newif\ifparapparatus@ \newif\ifnoquotation@ \newif\iflednopbinverse @@ -37,7 +43,20 @@ \parapparatus@false \RequirePackage{xkeyval} \DeclareOptionX{series}[A,B,C,D,E,Z]{\xdef\default@series{#1}} +\DeclareOptionX{noeledsec}{\@noeled@sectrue} +\DeclareOptionX{nocritical}{\nocritical@true}% +\DeclareOptionX{nofamiliar}{\nofamiliar@true}% +\DeclareOptionX{noledgroup}{\noledgroup@true}% +\DeclareOptionX{noend}{% + \let\l@dend@open\@gobble% + \let\l@d@end\relax + \let\l@dend@close\relax% + \global\let\l@dend@stuff=\relax% + \global\chardef\l@d@end=16% + \noend@true% +}% \DeclareOptionX{noquotation}{\noquotation@true} +\DeclareOptionX{oldprintnpnumspace}{\oldprintnpnumspace@true} \DeclareOptionX{final}{\ledfinaltrue} \DeclareOptionX{draft}{\ledfinalfalse} \DeclareOptionX{parapparatus}{\parapparatus@true} @@ -90,7 +109,7 @@ \newcommand*{\led@err@NumberingShouldHaveStarted}{% \eledmac@error{Numbering should already have been started}{\@ehc}} \newcommand*{\led@err@edtextoutsidepstart}{% - \eledmac@error{\string\edtext\space outside numbered paragraph (\pstart…\pend)}{\@ehc}}% + \eledmac@error{\string\edtext\space outside numbered paragraph (\pstart\ldots\pend)}{\@ehc}}% \newcommand*{\led@mess@NotesChanged}{% \typeout{eledmac reminder: }% \typeout{ The number of the footnotes in this section @@ -142,6 +161,8 @@ \eledmac@warning{Bad action code, value \next@action.}} \newcommand*{\led@warn@DuplicateLabel}[1]{% \eledmac@warning{Duplicate definition of label `#1' on page \the\pageno.}} +\newcommand*{\led@warn@AppLabelOutEdtext}[1]{% + \eledmac@warning{\string\applabel\space outside of \string\edtext\space `#1' on page \the\pageno.}}% \newcommand*{\led@warn@RefUndefined}[1]{% \eledmac@warning{Reference `#1' on page \the\pageno\space undefined. Using `000'.}} @@ -181,12 +202,18 @@ \eledmac@warning{\itemcount@\space rightnotes on line \the\line@num\space p. \the\page@num}% \fi% }% -\newcommand{\led@war@FalseverseDeprecated}{% - \eledmac@warning{\string\falseverse\space deprecated. Look at \string\newverse\space instead.}% +\newcommand{\led@war@noeledsecDeprecated}[0]{% + \eledmac@warning{\string\noeledsec\space deprecated. Use `noeledsec` option instead.}% +}% +\newcommand{\led@war@ledsetnormalparstuffDeprecated}{% + \eledmac@warning{\string\ledsetnormalparstuff\space deprecated. Look at \string\Xledsetnormalparstuff\space and \ledsetnormalparstuffX\space instead.}% }% \newcommand{\led@war@ledxxxDeprecated}[1]{% \eledmac@warning{\string\led#1\space deprecated. Look at \string\e#1 instead.}% }% +\newcommand{\led@war@noendnotesDeprecated}[0]{% + \eledmac@warning{\string\noendnotes\space deprecated. Use `noend` option instead.}% +}% \newcommand*{\led@err@TooManyColumns}{% \eledmac@error{Too many columns}{\@ehc}} \newcommand*{\led@err@UnequalColumns}{% @@ -212,6 +239,7 @@ }% \providecommand*{\@gobblethree}[3]{} \providecommand*{\@gobblefour}[4]{} +\providecommand*{\@gobblefive}[5]{} \let\linenumberlist=\empty \newcount\@l@dtempcnta \newcount\@l@dtempcntb @@ -339,19 +367,25 @@ \ifx\@tempa\@tempb \global\bypage@true \global\bypstart@false - \pstartinfootnote[][false] + \unless\ifnocritical@% + \pstartinfootnote[][false]% + \fi% \else \def\@tempb{pstart}% \ifx\@tempa\@tempb \global\bypage@false \global\bypstart@true - \pstartinfootnote + \unless\ifnocritical@% + \pstartinfootnote% + \fi% \else \def\@tempb{section} \ifx\@tempa\@tempb \global\bypage@false \global\bypstart@false - \pstartinfootnote[][false] + \unless\ifnocritical@% + \pstartinfootnote[][false]% + \fi% \else \led@warn@BadLineation \fi @@ -594,6 +628,7 @@ \ifnum #1=\last@page@num \else \ifbypage@ + \csxdef{lastlinenumberon@\the\last@page@num}{\the\line@num}% \line@num=\z@ \subline@num=\z@ \fi \page@num=#1\relax @@ -716,11 +751,42 @@ \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} +\newcommand*{\n@num}{% + \ifledRcol% + \xright@appenditem{\the\absline@numR}\to\actionlines@listR + \xright@appenditem{-1007}\to\actions@listR + \else% + \xright@appenditem{\the\absline@num}\to\actionlines@list% + \xright@appenditem{-1007}\to\actions@list% + \fi% +}% +\newcommand*{\n@num@stanza}{% + \ifledRcol% + \xright@appenditem{\the\absline@numR}\to\actionlines@listR% + \xright@appenditem{-1008}\to\actions@listR% + \else% + \xright@appenditem{\the\absline@num}\to\actionlines@list%% + \xright@appenditem{-1008}\to\actions@list% + \fi% +} +\newif\ifl@dhidenumber +\newcommand*{\hidenumbering}{ + \ifledRcol% + \write\linenum@outR{\string\hide@num}% + \else% + \write\linenum@out{\string\hide@num}% + \fi% +}% +\newcommand*{\hide@num}{% + \ifledRcol% + \xright@appenditem{\the\absline@numR}\to\actionlines@listR% + \xright@appenditem{-1009}\to\actions@listR% + \else% + \xright@appenditem{\the\absline@num}\to\actionlines@list%% + \xright@appenditem{-1009}\to\actions@list% + \fi% +} \newcount\insert@count \newcommand*{\dummy@ref}[2]{#2} \newcommand*{\@ref}[2]{% @@ -847,10 +913,24 @@ \def\endlock{\write\linenum@out{\string\lock@off}} \newif\ifl@dskipnumber -\newcommand*{\skipnumbering}{\skipnumbering@reg} -\newcommand*{\skipnumbering@reg}{% - \write\linenum@out{\string\n@num}% - \advanceline{-1}} +\newif\ifl@dskipversenumber% +\newcommand*{\skipnumbering}{ + \ifledRcol% + \ifinstanza% + \write\linenum@outR{\string\n@num@stanza}% + \else% + \write\linenum@outR{\string\n@num}% + \fi% + \advanceline{-1}% + \else% + \ifinstanza% + \write\linenum@out{\string\n@num@stanza}% + \else% + \write\linenum@out{\string\n@num}% + \fi% + \advanceline{-1}% + \fi% +}% \list@create{\end@lemmas} \long\def\dummy@text#1#2/{#1} @@ -1051,7 +1131,11 @@ \newif\iflabelpstart \labelpstartfalse \newcommandx*{\pstart}[1][1]{% + \normal@pars% \ifstrempty{#1}{\at@every@pstart}{\noindent#1}% + \ifautopar% + \autopar% + \fi% \ifluatex% \edef\l@luatextextdir@L{\the\luatextextdir}% \fi% @@ -1092,6 +1176,7 @@ \newcommandx*{\pend}[1][1]{\ifnumbering \else% \led@err@PendNotNumbered% \fi% + \global\l@dskipversenumberfalse% \ifnumberedpar@ \else% \led@err@PendNoPstart% \fi% @@ -1114,7 +1199,11 @@ \fi% \@oldnobreak% \addtocounter{pstart}{1}% + \normal@pars% \ifstrempty{#1}{\at@every@pend}{\noindent#1}% + \ifautopar% + \autopar% + \fi% } @@ -1165,7 +1254,12 @@ \inserthangingsymbolfalse \fi \check@pb@in@verse - \affixline@num + \ifl@dhidenumber% + \global\l@dhidenumberfalse% + \f@x@l@cks% + \else% + \affixline@num% + \fi% \xifinlist{\the\l@dnumpstartsL}{\eled@sections@@}% {\print@eledsection}% {\print@line}% @@ -1227,22 +1321,22 @@ \newcommand*{\ledrlfill}{} \newcommand*{\getline@num}{% - \global\advance\absline@num \@ne + \global\advance\absline@num \@ne% \do@actions \do@ballast \ifnumberline - \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 + \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 \fi - } +} \newcount\ballast@count \newcounter{ballast} \setcounter{ballast}{0} @@ -1313,74 +1407,81 @@ \fi \or% % 1007 \l@dskipnumbertrue + \or% % 1008 + \l@dskipversenumbertrue% + \or% % 1009 + \l@dhidenumbertrue \else \led@warn@BadAction \fi} \newcommand*{\affixline@num}{% -\ifledgroupnotesL@\else\ifnumberline -\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 + \ifledgroupnotesL@\else + \ifnumberline + \ifl@dskipnumber + \global\l@dskipnumberfalse \else - \@l@dtempcnta=\c@firstlinenum + \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 + \ifl@dskipversenumber\else + \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 + \fi + \fi + \f@x@l@cks \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 -\fi -\fi } \newcommand*{\ch@cksub@l@ck}{% @@ -1612,16 +1713,36 @@ \csname #1footfmt\endcsname #2[#1]\color@endgroup}} \newcommand*{\ledsetnormalparstuff}{% + \led@war@ledsetnormalparstuffDeprecated% + \ifluatex% + \luatextextdir\footnote@luatextextdir% + \luatexpardir\footnote@luatexpardir% + \fi% + \csuse{\csuse{footnote@dir}}% + \normal@pars% + \noindent \parfillskip \z@ \@plus 1fil}% + +\newcommand*{\ledsetnormalparstuff@common}{% \ifluatex% \luatextextdir\footnote@luatextextdir% \luatexpardir\footnote@luatexpardir% \fi% \csuse{\csuse{footnote@dir}}% \normal@pars% - \noindent \parfillskip \z@ \@plus 1fil} + \parfillskip \z@ \@plus 1fil}% + +\newcommand*{\Xledsetnormalparstuff}[1]{% + \ledsetnormalparstuff@common% + \nottoggle{Xparindent@#1}{\noindent}{}%\noindent and and not \parindent=0pt to avoid to break the (bad) change made when moving from ledmac to eledmac +}% + +\newcommand*{\ledsetnormalparstuffX}[1]{% + \ledsetnormalparstuff@common% + \nottoggle{parindentX@#1}{\noindent}{}%\noindent and and not \parindent=0pt to avoid to break the (bad) change made when moving from ledmac to eledmac +}% \notbool{parapparatus@}{\newcommandx*}{\newcommandx}{\normalfootfmt}[4][4=Z]{% 4th arg is optional, for backward compatibility - \ledsetnormalparstuff% + \Xledsetnormalparstuff{#4}% \hangindent=\csuse{Xhangindent@#4} \strut{\printlinefootnote{#1}{#4}}% {\nottoggle{Xlemmadisablefontselection@#4}{\select@lemmafont#1|#2}{#2}}% @@ -1676,6 +1797,24 @@ \def\l@dparsedendline{0}% \def\l@dparsedendsub{0}% +\newif\ifistwofollowinglines@% +\newcommand{\setistwofollowinglines}[4]{% + \ifcsdef{lastlinenumberon@#1}% + {\numdef{\tmp}{\csuse{lastlinenumberon@#1}}}% + {\numdef{\tmp}{0}}% + \istwofollowinglines@false% + \ifnumequal{#4-#2}{1}% + {\istwofollowinglines@true}% + {\ifbypage@% + \ifnumequal{#3-#1}{1}% + {% + \ifnumequal{#2}{\tmp}% + {\ifnumequal{#4}{1}{\istwofollowinglines@true}{}}% + {}% + }% + {}% + }% +}% \newcommand*{\setprintlines}[6]{% \l@d@pnumfalse \l@d@dashfalse \ifbypage@ @@ -1703,10 +1842,24 @@ \fi \fi% \ifl@d@dash% - \iftoggle{fulllines@}% + \ifboolexpr{togl{fulllines@} or test{\ifcsempty{twolines@\@currentseries}}}% {}% {% - \ifcsempty{twolines@\@currentseries}% + \setistwofollowinglines{#1}{#2}{#4}{#5}% + \ifboolexpr{% + (% + togl {twolinesbutnotmore@\@currentseries}% + and not% + (% + bool {istwofollowinglines@}% + )% + )% + or% + (% + (not test{\ifnumequal{#1}{#4}})% + and togl{twolinesonlyinsamepage@\@currentseries}% + )% + }% {}% {% \l@d@dashfalse% @@ -1715,7 +1868,7 @@ \l@d@eslfalse% \ifcsempty{morethantwolines@\@currentseries}% {}% - {\ifnum\numexpr #5-#2>1\relax% + {\ifistwofollowinglines@\else% \l@d@morethantwolinestrue% \fi% }% @@ -1731,23 +1884,27 @@ \ifl@d@pnum #1\fullstop\fi \linenumrep{#2} \ifl@d@ssub \fullstop \sublinenumrep{#3}\fi - \ifl@d@dash \ifl@d@twolines\else\endashchar\fi\fi - \ifl@d@pnum #4\fullstop\fi - \ifl@d@elin \linenumrep{#5}\fi - \ifl@d@esl \ifl@d@elin \fullstop\fi \sublinenumrep{#6}\fi \ifl@d@twolines% \ifl@d@morethantwolines% \csuse{morethantwolines@\@currentseries}% \else% \csuse{twolines@\@currentseries}% \fi% + \else% + \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% \fi% \endgroup} \newcommand*{\normalfootstart}[1]{% \ifdimequal{0pt}{\preXnotes@}{}% {% \iftoggle{preXnotes@}{% - \togglefalse{preXnotes@}\skip\csname #1footins\endcsname=\csuse{preXnotes@}}% + \togglefalse{preXnotes@}% + \skip\csname #1footins\endcsname=% + \dimexpr\csuse{preXnotes@}+\csuse{afterXrule@#1}\relax% + }% {}% }% \vskip\skip\csname #1footins\endcsname% @@ -1757,8 +1914,7 @@ \fi% \setXnoteswidthliketwocolumns@{#1}% \setXnotespositionliketwocolumns@{#1}% - \print@Xfootnoterule{#1}%% - \vskip\csuse{afterXrule@#1}% + \print@Xfootnoterule{#1}% \noindent\leavevmode} \let\normalfootnoterule=\footnoterule \newcommand*{\normalfootgroup}[1]{% @@ -1780,13 +1936,11 @@ \setXnoteswidthliketwocolumns@{#1}% \setXnotespositionliketwocolumns@{#1}% \print@Xfootnoterule{#1}%% - \vskip\csuse{afterXrule@#1}% \fi% \else% \setXnoteswidthliketwocolumns@{#1}% \setXnotespositionliketwocolumns@{#1}% \print@Xfootnoterule{#1}%% - \vskip\csuse{afterXrule@#1}% \fi% \setlength{\parindent}{0pt} {\csuse{Xnotefontsize@#1}\csuse{txtbeforeXnotes@#1}} @@ -1813,12 +1967,16 @@ \count\csname #1footins\endcsname=1000 \csxdef{default@#1footins}{1000}%Use this to confine the notes to one side only \dimen\csname #1footins\endcsname=\csuse{maxhXnotes@#1} - \skip\csname #1footins\endcsname=\csuse{beforeXnotes@#1} - \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=\csuse{maxhXnotes@#1} - \skip\csname mp#1footins\endcsname=\csuse{beforeXnotes@#1} + \skip\csname #1footins\endcsname=\csuse{beforeXnotes@#1}% + \advance\skip\csname #1footins\endcsname by\csuse{afterXrule@#1}% + \ifnoledgroup@\else% + \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=\csuse{maxhXnotes@#1} + \skip\csname mp#1footins\endcsname=\csuse{beforeXnotes@#1}% + \advance\skip\csname mp#1footins\endcsname by\csuse{afterXrule@#1}% + \fi } \newcommand*{\footparagraph}[1]{% @@ -1831,13 +1989,17 @@ \count\csname #1footins\endcsname=1000 \csxdef{default@#1footins}{1000}%Use this to confine the notes to one side only \dimen\csname #1footins\endcsname=\csuse{maxhXnotes@#1} - \skip\csname #1footins\endcsname=\csuse{beforeXnotes@#1} + \skip\csname #1footins\endcsname=\csuse{beforeXnotes@#1}% + \advance\skip\csname #1footins\endcsname by\csuse{afterXrule@#1}% \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 - \dimen\csname mp#1footins\endcsname=\csuse{maxhXnotes@#1} - \skip\csname mp#1footins\endcsname=\csuse{beforeXnotes@#1} + \ifnoledgroup@\else + \expandafter\let\csname mpv#1footnote\endcsname=\mppara@vfootnote + \expandafter\let\csname mp#1footgroup\endcsname=\mppara@footgroup + \count\csname mp#1footins\endcsname=1000 + \dimen\csname mp#1footins\endcsname=\csuse{maxhXnotes@#1} + \skip\csname mp#1footins\endcsname=\csuse{beforeXnotes@#1}% + \advance\skip\csname mp#1footins\endcsname by\csuse{afterXrule@#1}% + \fi } \providecommand{\footfudgefiddle}{64} \newcommand*{\para@footsetup}[1]{{\csuse{Xnotefontsize@#1} @@ -1853,14 +2015,16 @@ \ifdimequal{0pt}{\preXnotes@}{}% {% \iftoggle{preXnotes@}{% - \togglefalse{preXnotes@}\skip\csname #1footins\endcsname=\csuse{preXnotes@}}% + \togglefalse{preXnotes@}% + \skip\csname #1footins\endcsname=% + \dimexpr\csuse{preXnotes@}+\csuse{afterXrule@#1}\relax% + }% {}% }% \vskip\skip\csname #1footins\endcsname% \setXnoteswidthliketwocolumns@{#1}% \setXnotespositionliketwocolumns@{#1}% \print@Xfootnoterule{#1}%% - \vskip\csuse{afterXrule@#1}% \noindent\leavevmode} \newcommand*{\para@vfootnote}[2]{% \insert\csname #1footins\endcsname @@ -1903,7 +2067,7 @@ \newcommandx*{\parafootfmt}[4][4=Z]{% \insertparafootsep{#4}% - \ledsetnormalparstuff% + \Xledsetnormalparstuff{#4}% \printlinefootnote{#1}{#4}% {\nottoggle{Xlemmadisablefontselection@#4}{\select@lemmafont#1|#2}{#2}}% \iftoggle{nosep@}{\hskip\csuse{inplaceoflemmaseparator@#4}}{\ifcsempty{lemmaseparator@#4}% @@ -1936,13 +2100,11 @@ \setXnoteswidthliketwocolumns@{#1}% \setXnotespositionliketwocolumns@{#1}% \print@Xfootnoterule{#1}%% - \vskip\csuse{afterXrule@#1}% \fi% \else% \setXnoteswidthliketwocolumns@{#1}% \setXnotespositionliketwocolumns@{#1}% - \print@Xfootnoterule{#1}%% - \vskip\csuse{afterXrule@#1}% + \print@Xfootnoterule{#1}% \fi% \unvbox\csname mp#1footins\endcsname \ifcsstring{Xragged@#1}{L}{\RaggedLeft}{}% @@ -1994,10 +2156,16 @@ \expandafter\let\csname #1footfmt\endcsname=\threecolfootfmt \expandafter\let\csname #1footgroup\endcsname=\threecolfootgroup \dimen\csname #1footins\endcsname=\csuse{maxhXnotes@#1}% + \skip\csname #1footins\endcsname=\csuse{beforeXnotes@#1}% + \advance\skip\csname #1footins\endcsname by\csuse{afterXrule@#1}% \threecolfootsetup{#1} - \expandafter\let\csname mpv#1footnote\endcsname=\mpnormalvfootnote - \expandafter\let\csname mp#1footgroup\endcsname=\mpthreecolfootgroup - \mpthreecolfootsetup{#1} + \ifnoledgroup@\else + \expandafter\let\csname mpv#1footnote\endcsname=\mpnormalvfootnote + \expandafter\let\csname mp#1footgroup\endcsname=\mpthreecolfootgroup + \skip\csname mp#1footins\endcsname=\csuse{beforeXnotes@#1}% + \advance\skip\csname mp#1footins\endcsname by\csuse{afterXrule@#1}% + \mpthreecolfootsetup{#1} + \fi } \newcommand*{\threecolfootsetup}[1]{% @@ -2016,11 +2184,11 @@ \notbool{parapparatus@}{\newcommandx*}{\newcommandx}{\threecolfootfmt}[4][4=Z]{% \normal@pars \hsize \csuse{hsizethreecol@#4} - \parindent=0pt + \nottoggle{Xparindent@#4}{\parindent=\z@}{} \tolerance=5000 - \raggedright \hangindent=\csuse{Xhangindent@#4} \leavevmode + \csuse{Xcolalign@#4}% \strut{\printlinefootnote{#1}{#4}}% {\nottoggle{Xlemmadisablefontselection@#4}{\select@lemmafont#1|#2}{#2}}% \iftoggle{nosep@}{\hskip\csuse{inplaceoflemmaseparator@#4}}{\ifcsempty{lemmaseparator@#4}% @@ -2045,14 +2213,12 @@ \else% \setXnoteswidthliketwocolumns@{#1}% \setXnotespositionliketwocolumns@{#1}% - \print@Xfootnoterule{#1}%% - \vskip\csuse{afterXrule@#1}% + \print@Xfootnoterule{#1}% \fi% \else% \setXnoteswidthliketwocolumns@{#1}% \setXnotespositionliketwocolumns@{#1}% - \print@Xfootnoterule{#1}%% - \vskip\csuse{afterXrule@#1}% + \print@Xfootnoterule{#1}% \fi% {\csuse{Xnotefontsize@#1}\noindent\csuse{txtbeforeXnotes@#1}}\par \splittopskip=\ht\strutbox @@ -2065,10 +2231,16 @@ \expandafter\let\csname #1footfmt\endcsname=\twocolfootfmt \expandafter\let\csname #1footgroup\endcsname=\twocolfootgroup \dimen\csname #1footins\endcsname=\csuse{maxhXnotes@#1}% + \skip\csname #1footins\endcsname=\csuse{beforeXnotes@#1}% + \advance\skip\csname #1footins\endcsname by\csuse{afterXrule@#1}% \twocolfootsetup{#1} - \expandafter\let\csname mpv#1footnote\endcsname=\mpnormalvfootnote - \expandafter\let\csname mp#1footgroup\endcsname=\mptwocolfootgroup - \mptwocolfootsetup{#1} + \ifnoledgroup@\else + \expandafter\let\csname mpv#1footnote\endcsname=\mpnormalvfootnote + \expandafter\let\csname mp#1footgroup\endcsname=\mptwocolfootgroup + \skip\csname mp#1footins\endcsname=\csuse{beforeXnotes@#1}% + \advance\skip\csname mp#1footins\endcsname by\csuse{afterXrule@#1}% + \mptwocolfootsetup{#1} + \fi } \newcommand*{\twocolfootsetup}[1]{% @@ -2082,11 +2254,11 @@ \notbool{parapparatus@}{\newcommandx*}{\newcommandx}{\twocolfootfmt}[4][4=Z]{% 4th arg is optional, for backward compatibility \normal@pars \hsize \csuse{hsizetwocol@#4} - \parindent=0pt + \nottoggle{Xparindent@#4}{\parindent=\z@}{} \tolerance=5000 - \raggedright \hangindent=\csuse{Xhangindent@#4} \leavevmode + \csuse{Xcolalign@#4}% \strut{\printlinefootnote{#1}{#4}}% {\nottoggle{Xlemmadisablefontselection@#4}{\select@lemmafont#1|#2}{#2}}% \iftoggle{nosep@}{\hskip\csuse{inplaceoflemmaseparator@#4}}{\ifcsempty{lemmaseparator@#4}% @@ -2115,14 +2287,12 @@ \else% \setXnoteswidthliketwocolumns@{#1}% \setXnotespositionliketwocolumns@{#1}% - \print@Xfootnoterule{#1}%% - \vskip\csuse{afterXrule@#1}% + \print@Xfootnoterule{#1}% \fi% \else% \setXnoteswidthliketwocolumns@{#1}% \setXnotespositionliketwocolumns@{#1}% - \print@Xfootnoterule{#1}%% - \vskip\csuse{afterXrule@#1}% + \print@Xfootnoterule{#1}% \fi% {\csuse{Xnotefontsize@#1}\noindent\csuse{txtbeforeXnotes@#1}}\par \splittopskip=\ht\strutbox @@ -2193,7 +2363,7 @@ \newcommand*{\normalbodyfootmarkX}[1]{% \hbox{\textsuperscript{\normalfont\@nameuse{@thefnmark#1}}}} -\newcommand*{\normalvfootnoteX}[2]{% +\notbool{parapparatus@}{\newcommand*}{\newcommand}{\normalvfootnoteX}[2]{% \insert\@nameuse{footins#1}\bgroup \csuse{bhooknoteX@#1} \csuse{notefontsizeX@#1} @@ -2203,7 +2373,7 @@ \fi\fi% \setnotesXpositionliketwocolumns@{#1}% \spaceskip=\z@skip \xspaceskip=\z@skip - \csuse{\csuse{footnote@dir}}\if@RTL\else\noindent\leavevmode\fi\@nameuse{footfmt#1}{#1}{#2}\egroup} + \csuse{\csuse{footnote@dir}}\@nameuse{footfmt#1}{#1}{#2}\egroup} \newcommand*{\mpnormalvfootnoteX}[2]{% \global\setbox\@nameuse{mpfootins#1}\vbox{% @@ -2215,7 +2385,7 @@ \color@begingroup \@nameuse{footfmt#1}{#1}{#2}\color@endgroup}} -\newcommand*{\normalfootfmtX}[2]{% +\notbool{parapparatus@}{\newcommand*}{\newcommand}{\normalfootfmtX}[2]{% \ifluatex% \luatextextdir\footnote@luatextextdir% \luatexpardir\footnote@luatexpardir% @@ -2224,9 +2394,9 @@ \protected@edef\@currentlabel{% \@nameuse{@thefnmark#1}% }% - \ledsetnormalparstuff + \ledsetnormalparstuffX{#1}% \hangindent=\csuse{hangindentX@#1}% - {{\csuse{notenumfontX@#1}\@nameuse{footfootmark#1}}\strut%\enspace + {{\csuse{notenumfontX@#1}\@nameuse{footfootmark#1}}\strut% #2\strut\par}} \newcommand*{\normalfootfootmarkX}[1]{% @@ -2236,7 +2406,10 @@ \ifdimequal{0pt}{\prenotesX@}{}% {% \iftoggle{prenotesX@}{% - \togglefalse{prenotesX@} \skip\csname footins#1\endcsname=\csuse{prenotesX@}}% + \togglefalse{prenotesX@}% + \skip\csname footins#1\endcsname=% + \dimexpr\csuse{prenotesX@}+\csuse{afterruleX@#1}\relax% + }% {}% }% \vskip\skip\csname footins#1\endcsname% @@ -2248,7 +2421,7 @@ \setnotesXwidthliketwocolumns@{#1}% \setnotesXpositionliketwocolumns@{#1}% \print@footnoteXrule{#1}% - \vskip\csuse{afterruleX@#1}} +}% \let\normalfootnoteruleX=\footnoterule @@ -2270,13 +2443,11 @@ \setnotesXwidthliketwocolumns@{#1}% \setnotesXpositionliketwocolumns@{#1}% \print@footnoteXrule{#1}% - \vskip\csuse{afterruleX@#1}% \fi% \else% \setnotesXwidthliketwocolumns@{#1}% \setnotesXpositionliketwocolumns@{#1}% \print@footnoteXrule{#1}% - \vskip\csuse{afterruleX@#1}% \fi% \unvbox\@nameuse{mpfootins#1}} @@ -2313,24 +2484,35 @@ \count\csname footins#1\endcsname=1000 \csxdef{default@footins#1}{1000}%Use to have note only for one side \dimen\csname footins#1\endcsname=\csuse{maxhnotesX@#1} - \skip\csname footins#1\endcsname=\csuse{beforenotesX@#1} - \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=\csuse{maxhnotesX@#1} - \skip\csname mpfootins#1\endcsname=\csuse{beforenotesX@#1} + \skip\csname footins#1\endcsname=\csuse{beforenotesX@#1}% + \advance\skip\csname footins#1\endcsname by\csuse{afterruleX@#1}% + \ifnoledgroup@\else% + \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=\csuse{maxhnotesX@#1} + \skip\csname mpfootins#1\endcsname=\csuse{beforenotesX@#1}% + \advance\skip\csname mpfootins#1\endcsname by\csuse{afterruleX@#1}% + \fi } \newcommand*{\foottwocolX}[1]{% - \csgdef{series@displayX#1}{twocol} + \csgdef{series@displayX#1}{twocolX} \expandafter\let\csname regvfootnote#1\endcsname=\twocolvfootnoteX \expandafter\let\csname footfmt#1\endcsname=\twocolfootfmtX \expandafter\let\csname footgroup#1\endcsname=\twocolfootgroupX - \dimen\csname #1footins\endcsname=\csuse{maxhnotesX@#1}% + \dimen\csname footins#1\endcsname=\csuse{maxhnotesX@#1}% + \skip\csname footins#1\endcsname=\csuse{beforenotesX@#1}% + \advance\skip\csname footins#1\endcsname by \csuse{afterruleX@#1}\relax% \twocolfootsetupX{#1} - \expandafter\let\csname mpvfootnote#1\endcsname=\mpnormalvfootnoteX - \expandafter\let\csname mpfootgroup#1\endcsname=\mptwocolfootgroupX - \mptwocolfootsetupX{#1}} + \ifnoledgroup@\else% + \expandafter\let\csname mpvfootnote#1\endcsname=\mpnormalvfootnoteX + \expandafter\let\csname mpfootgroup#1\endcsname=\mptwocolfootgroupX + \skip\csname mpfootins#1\endcsname=\csuse{beforenotesX@#1}% + \advance\skip\csname mpfootins#1\endcsname by\csuse{afterruleX@#1} + \mptwocolfootsetupX{#1} + \fi% +} \newcommand*{\twocolfootsetupX}[1]{% \count\csname footins#1\endcsname 500 @@ -2340,26 +2522,25 @@ \count\csname mpfootins#1\endcsname 500 \multiply\dimen\csname mpfootins#1\endcsname by \tw@} -\newcommand*{\twocolvfootnoteX}[2]{% +\notbool{parapparatus@}{\newcommand*}{\newcommand}{\twocolvfootnoteX}[2]{% \insert\csname footins#1\endcsname\bgroup \csuse{notefontsizeX@#1} \footsplitskips \spaceskip=\z@skip \xspaceskip=\z@skip \@nameuse{footfmt#1}{#1}{#2}\egroup} -\newcommand*{\twocolfootfmtX}[2]{% +\notbool{parapparatus@}{\newcommand*}{\newcommand}{\twocolfootfmtX}[2]{% \protected@edef\@currentlabel{% \@nameuse{@thefnmark#1}% }% \normal@pars \hangindent=\csuse{hangindentX@#1}% \hsize \csuse{hsizetwocolX@#1} - \parindent=\z@ -%%% \parfillskip=0pt \@plus 1fil + \nottoggle{parindentX@#1}{\parindent=\z@}{} \tolerance=5000\relax - \raggedright \leavevmode - {\csuse{notenumfontX@#1}\@nameuse{footfootmark#1}\strut%\enspace + \csuse{colalignX@#1}% + {\csuse{notenumfontX@#1}\@nameuse{footfootmark#1}\strut% #2\strut\par}\allowbreak} \newcommand*{\twocolfootgroupX}[1]{{\csuse{notefontsizeX@#1} @@ -2379,28 +2560,33 @@ \setnotesXwidthliketwocolumns@{#1}% \setnotesXpositionliketwocolumns@{#1}% \print@footnoteXrule{#1}% - \vskip\csuse{afterruleX@#1}% \fi% \else% \setnotesXwidthliketwocolumns@{#1}% \setnotesXpositionliketwocolumns@{#1}% \print@footnoteXrule{#1}% - \vskip\csuse{afterruleX@#1}% \fi% \splittopskip=\ht\strutbox \expandafter \rigidbalance\csname mpfootins#1\endcsname \tw@ \splittopskip}} \newcommand*{\footthreecolX}[1]{% - \csgdef{series@displayX#1}{threecol} + \csgdef{series@displayX#1}{threecolX} \expandafter\let\csname regvfootnote#1\endcsname=\threecolvfootnoteX \expandafter\let\csname footfmt#1\endcsname=\threecolfootfmtX \expandafter\let\csname footgroup#1\endcsname=\threecolfootgroupX - \dimen\csname #1footins\endcsname=\csuse{maxhnotesX@#1}% + \dimen\csname footins#1\endcsname=\csuse{maxhnotesX@#1}% + \skip\csname footins#1\endcsname=\csuse{beforenotesX@#1}% + \advance\skip\csname footins#1\endcsname by \csuse{afterruleX@#1}\relax% \threecolfootsetupX{#1} - \expandafter\let\csname mpvfootnote#1\endcsname=\mpnormalvfootnoteX - \expandafter\let\csname mpfootgroup#1\endcsname=\mpthreecolfootgroupX - \mpthreecolfootsetupX{#1}} + \ifnoledgroup@\else% + \expandafter\let\csname mpvfootnote#1\endcsname=\mpnormalvfootnoteX + \expandafter\let\csname mpfootgroup#1\endcsname=\mpthreecolfootgroupX + \skip\csname mpfootins#1\endcsname=\csuse{beforenotesX@#1}% + \advance\skip\csname mpfootins#1\endcsname by\csuse{afterruleX@#1} + \mpthreecolfootsetupX{#1} + \fi% +} \newcommand*{\threecolfootsetupX}[1]{% \count\csname footins#1\endcsname 333 @@ -2410,25 +2596,24 @@ \count\csname mpfootins#1\endcsname 333 \multiply\dimen\csname mpfootins#1\endcsname by \thr@@} -\newcommand*{\threecolvfootnoteX}[2]{% +\notbool{parapparatus@}{\newcommand*}{\newcommand}{\threecolvfootnoteX}[2]{% \insert\csname footins#1\endcsname\bgroup \csuse{notefontsizeX@#1} \footsplitskips \@nameuse{footfmt#1}{#1}{#2}\egroup} -\newcommand*{\threecolfootfmtX}[2]{% +\notbool{parapparatus@}{\newcommand*}{\newcommand}{\threecolfootfmtX}[2]{% \protected@edef\@currentlabel{% \@nameuse{@thefnmark#1}% }% \hangindent=\csuse{hangindentX@#1}% \normal@pars \hsize \csuse{hsizethreecolX@#1} - \parindent=\z@ -%%% \parfillskip=0pt \@plus 1fil + \nottoggle{parindentX@#1}{\parindent=\z@}{} % \tolerance=5000\relax - \raggedright \leavevmode - {\csuse{notenumfontX@#1}\@nameuse{footfootmark#1}\strut%\enspace + \csuse{colalignX@#1}% + {\csuse{notenumfontX@#1}\@nameuse{footfootmark#1}\strut% #2\strut\par}\allowbreak} \newcommand*{\threecolfootgroupX}[1]{{\csuse{notefontsizeX@#1} @@ -2448,13 +2633,11 @@ \setnotesXwidthliketwocolumns@{#1}% \setnotesXpositionliketwocolumns@{#1}% \print@footnoteXrule{#1}% - \vskip\csuse{afterruleX@#1}% \fi% \else% \setnotesXwidthliketwocolumns@{#1}% \setnotesXpositionliketwocolumns@{#1}% \print@footnoteXrule{#1}% - \vskip\csuse{afterruleX@#1}% \fi% \splittopskip=\ht\strutbox \expandafter @@ -2471,13 +2654,18 @@ \count\csname footins#1\endcsname=1000 \csxdef{default@footins#1}{1000}%Use this to confine the notes to one side only \dimen\csname footins#1\endcsname=\csuse{maxhnotesX@#1} - \skip\csname footins#1\endcsname=\csuse{beforenotesX@#1} - \expandafter\let\csname mpvfootnote#1\endcsname=\mppara@vfootnoteX - \expandafter\let\csname mpfootgroup#1\endcsname=\mppara@footgroupX - \count\csname mpfootins#1\endcsname=1000 - \dimen\csname mpfootins#1\endcsname=\csuse{maxhnotesX@#1} - \skip\csname mpfootins#1\endcsname=\csuse{beforenotesX@#1} - \para@footsetupX{#1}} + \skip\csname footins#1\endcsname=\csuse{beforenotesX@#1}% + \advance\skip\csname footins#1\endcsname by\csuse{afterruleX@#1}% + \para@footsetupX{#1} + \ifnoledgroup@\else + \expandafter\let\csname mpvfootnote#1\endcsname=\mppara@vfootnoteX + \expandafter\let\csname mpfootgroup#1\endcsname=\mppara@footgroupX + \count\csname mpfootins#1\endcsname=1000 + \dimen\csname mpfootins#1\endcsname=\csuse{maxhnotesX@#1} + \skip\csname mpfootins#1\endcsname=\csuse{beforenotesX@#1}% + \advance\skip\csname mpfootins#1\endcsname by\csuse{afterruleX@#1}% + \fi + } \newcommand*{\para@footsetupX}[1]{{\csuse{notefontsizeX@#1} \setnotesXwidthliketwocolumns@{#1}% @@ -2492,7 +2680,10 @@ \ifdimequal{0pt}{\prenotesX@}{}% {% \iftoggle{prenotesX@}{% - \togglefalse{prenotesX@}\skip\csname footins#1\endcsname=\csuse{prenotesX@}}% + \togglefalse{prenotesX@}% + \skip\csname footins#1\endcsname=% + \dimexpr\csuse{prenotesX@}+\csuse{afterruleX@#1}\relax% + }% {}% }% \vskip\skip\csname footins#1\endcsname% @@ -2503,7 +2694,6 @@ \setnotesXwidthliketwocolumns@{#1}% \setnotesXpositionliketwocolumns@{#1}% \print@footnoteXrule{#1}% - \vskip\csuse{afterruleX@#1}% } \newcommand*{\para@vfootnoteX}[2]{% @@ -2539,8 +2729,8 @@ \@nameuse{@thefnmark#1}% }% \insertparafootsep{#1}% - \ledsetnormalparstuff - {\csuse{notenumfontX@#1}\csuse{notenumfontX@#1}\@nameuse{footfootmark#1}\strut%\enspace + \ledsetnormalparstuffX{#1}% + {\csuse{notenumfontX@#1}\csuse{notenumfontX@#1}\@nameuse{footfootmark#1}\strut% #2\penalty-10}} \newcommand*{\para@footgroupX}[1]{% @@ -2566,13 +2756,11 @@ \setnotesXwidthliketwocolumns@{#1}% \setnotesXpositionliketwocolumns@{#1}% \print@footnoteXrule{#1}% - \vskip\csuse{afterruleX@#1}% \fi% \else% \setnotesXwidthliketwocolumns@{#1}% \setnotesXpositionliketwocolumns@{#1}% \print@footnoteXrule{#1}% - \vskip\csuse{afterruleX@#1}% \fi% \unvbox\csname mpfootins#1\endcsname \ifcsstring{raggedX@#1}{L}{\RaggedLeft}{}% @@ -2584,11 +2772,11 @@ \newdimen\old@hsize% -\old@hsize=\linewidth% +\AtBeginDocument{\old@hsize=\hsize}% \newcommand{\setXnoteswidthliketwocolumns@}[1]{% - \global\let\hsize@fornote=\linewidth% - \global\old@hsize=\linewidth% + \global\let\hsize@fornote=\hsize% + \global\old@hsize=\hsize% \iftoggle{Xnoteswidthliketwocolumns@#1}% {% \csuse{setwidthliketwocolumns@\columns@position}% @@ -2601,7 +2789,7 @@ \newcommand{\setnotesXwidthliketwocolumns@}[1]{% \global\let\hsize@fornote=\hsize% - \global\old@hsize=\linewidth% + \global\old@hsize=\hsize% \iftoggle{notesXwidthliketwocolumns@#1}% {% \csuse{setwidthliketwocolumns@\columns@position}% @@ -2629,36 +2817,95 @@ \newcommand{\fnpos}[1]{\xdef\@fnpos{#1}} \newcommand{\mpfnpos}[1]{\xdef\@mpfnpos{#1}} \newcommand{\print@Xfootnoterule}[1]{% + \vskip-\csuse{afterXrule@#1}%Because count in \dimen\csuse{#1footins} \nointerlineskip% \moveleft-\leftskip\vbox{\csuse{#1footnoterule}}% \nointerlineskip% + \vskip\csuse{afterXrule@#1}% }% \newcommand{\print@footnoteXrule}[1]{% + \vskip-\csuse{afterruleX@#1}%Because count in \dimen\csuse{footins#1} \nointerlineskip% \moveleft-\leftskip\vbox{\csuse{footnoterule#1}}% \nointerlineskip% + \vskip\csuse{afterruleX@#1}% }% +\gdef\firstXseries@{} +\newcommand{\prepare@preXnotes}[1]{% + \ifdimequal{0pt}{\preXnotes@}% + {}% + {% + \IfStrEq{\firstXseries@}{}{% + \global\skip\csuse{#1footins}=\preXnotes@% + \global\advance\skip\csname #1footins\endcsname by\csuse{afterXrule@#1}% + \gdef\firstXseries@{#1}% + }% + {% + \ifseriesbefore{#1}{\firstXseries@}% + {% + \global\skip\csuse{#1footins}=\csuse{beforeXnotes@\firstXseries@}% + \global\advance\skip\csname #1footins\endcsname by\csuse{afterXrule@#1}% + \gdef\firstXseries@{#1}% + }% + {}% + }% + }% +} +\gdef\firstseriesX@{} +\newcommand{\prepare@prenotesX}[1]{% + \ifdimequal{0pt}{\prenotesX@}% + {}% + {% + \IfStrEq{\firstseriesX@}{}{% + \global\skip\csuse{footins#1}=\prenotesX@% + \global\advance\skip\csname footins#1\endcsname by\csuse{afterruleX@#1}% + \gdef\firstseriesX@{#1}% + }% + {% + \ifseriesbefore{#1}{\firstseriesX@}% + {% + \global\skip\csuse{footins#1}=\csuse{beforenotesX@\firstseriesX@}% + \global\advance\skip\csname footins#1\endcsname by\csuse{afterruleX@#1}% + \gdef\firstXseries@{#1}% + }% + {}% + }% + }% +} \newcommand\print@notesX[1]{% \csuse{footstart#1}{#1}% \csuse{footgroup#1}{#1}% }% \newcommand*{\doxtrafeeti}{% - \setbox\@outputbox \vbox{% - \unvbox\@outputbox% - \def\do##1{% - \ifvoid\csuse{footins##1}\else% - \print@notesX{##1}% - \fi% - }% - \dolistloop{\@series}}% - }% + \unless\ifnofamiliar@% + \gdef\firstseriesX@{}% + \setbox\@outputbox \vbox{% + \unvbox\@outputbox% + \def\do##1{% + \ifvoid\csuse{footins##1}\else% + \global\skip\csuse{footins##1}=\csuse{beforenotesX@##1}% + \global\advance\skip\csuse{footins##1} by\csuse{afterruleX@##1}% + \print@notesX{##1}% + \fi% + }% + \dolistloop{\@series}}% + \fi% +}% \newcommand{\doreinxtrafeeti}{% - \def\do##1{\ifvoid\csuse{footins##1}\else\insert\csuse{footins##1}{\unvbox\csuse{footins##1}}\fi}% - \dolistloop{\@series}% - } + \unless\ifnofamiliar@% + \def\do##1{% + \ifvoid\csuse{footins##1}\else + \insert% + \csuse{footins##1} + {\unvbox\csuse{footins##1}}% + \fi% + }% + \dolistloop{\@series}% + \fi% +}% \newcommand*{\addfootinsX}[1]{% \led@warn@AddfootinsXObsolete% @@ -2677,6 +2924,7 @@ \g@addto@macro{\l@dfamendmini}{% \ifvoid\@nameuse{mpfootins#1}\else\@nameuse{mpfootgroup#1}{#1}\fi}% } +\ifbool{noend@}{}{%Used instead of \ifnoend@ to prevent expansion problem \newwrite\l@d@end \newif\ifl@dend@ \newcommand{\l@dend@open}[1]{\global\l@dend@true\immediate\openout\l@d@end=#1\relax} @@ -2688,7 +2936,11 @@ \fi \immediate\write\l@d@end{\string\l@d@section{\the\section@num}}} -\global\notbool{parapparatus@}{}{\long}\def\endprint#1#2#3#4{{% +\global\notbool{parapparatus@}{}{\long}\def\endprint#1#2#3#4#5{{% + \xdef\@currentseries{#4}% + \IfStrEq{#5}{fulllines}% + {\toggletrue{fulllines@}}% + {}% \csuse{bhookXendnote@#4}% \csuse{Xendnotefontsize@#4}% {% @@ -2703,6 +2955,7 @@ {#2}% }% \enskip#3\par% + \togglefalse{fulllines@}% }}% \let\l@d@section=\@gobble @@ -2731,15 +2984,60 @@ \l@d@esltrue \l@d@dashtrue \fi - \fi} + \fi% + \ifl@d@dash% + \ifboolexpr{togl{fulllines@} or test{\ifcsempty{Xendtwolines@\@currentseries}}}% + {}% + {% + \setistwofollowinglines{#1}{#2}{#4}{#5}% + \ifboolexpr{% + (% + togl {Xendtwolinesbutnotmore@\@currentseries}% + and not% + (% + bool {istwofollowinglines@}% + )% + )% + or% + (% + (not test{\ifnumequal{#1}{#4}})% + and togl{Xendtwolinesonlyinsamepage@\@currentseries}% + )% + }% + {}% + {% + \l@d@dashfalse% + \l@d@twolinestrue% + \l@d@elinfalse% + \l@d@eslfalse% + \ifcsempty{Xendmorethantwolines@\@currentseries}% + {}% + {\ifistwofollowinglines@\else% + \l@d@morethantwolinestrue% + \fi% + }% + }% + }% + \fi% +}% \def\printendlines#1|#2|#3|#4|#5|#6|#7|{\begingroup \setprintendlines{#1}{#2}{#3}{#4}{#5}{#6}% - \printnpnum{#1} \linenumrep{#2}% + \printnpnum{#1}% + \ifoldprintnpnumspace@\space\fi% + \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 + \ifl@d@twolines% + \ifl@d@morethantwolines% + \csuse{Xendmorethantwolines@\@currentseries}% + \else% + \csuse{Xendtwolines@\@currentseries}% + \fi% + \else% + \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% + \fi% \endgroup} \newcommand*{\printnpnum}[1]{p.#1) } @@ -2750,8 +3048,12 @@ \expandafter\let\csname #1end\endcsname=\endprint \input\jobname.end \endgroup} -\newcommand*{\noendnotes}{\global\let\l@dend@stuff=\relax - \global\chardef\l@d@end=16 } +\newcommand*{\noendnotes}{% + \led@war@noendnotesDeprecated% + \global\let\l@dend@stuff=\relax% + \global\chardef\l@d@end=16% +}% +}% \newcommand{\newseries}[1]{% \def\do##1{\newseries@{##1}}% \docsvlist{#1} @@ -2763,162 +3065,194 @@ \ifdefined\newseries@eledpar% \newseries@eledpar{#1}% \fi% - \newtoggle{Xlemmadisablefontselection@#1} - \newtoggle{Xendlemmadisablefontselection@#1} - \csgdef{Xhangindent@#1}{0pt}% - \csgdef{hangindentX@#1}{0pt}% - \csgdef{Xragged@#1}{}% - \csgdef{raggedX@#1}{}% - \csgdef{hsizetwocol@#1}{0.45 \hsize}% - \csgdef{hsizetwocolX@#1}{0.45 \hsize}% - \csgdef{hsizethreecol@#1}{.3 \hsize}% - \csgdef{hsizethreecolX@#1}{.3 \hsize}% - \csgdef{Xnotenumfont@#1}{\notenumfont}% - \csgdef{Xendnotenumfont@#1}{\notenumfont}% - \csgdef{notenumfontX@#1}{\notenumfont}% - \csgdef{Xnotefontsize@#1}{\notefontsetup}% - \csgdef{notefontsizeX@#1}{\notefontsetup}% - \csgdef{Xendnotefontsize@#1}{\notefontsetup}% - \csgdef{bhooknoteX@#1}{}% - \csgdef{bhookXnote@#1}{}% - \csgdef{bhookXendnote@#1}{}% - \csgdef{boxlinenum@#1}{0pt}% - \csgdef{boxXendlinenum@#1}{0pt}% - \csgdef{boxsymlinenum@#1}{0pt}% - \newtoggle{numberonlyfirstinline@#1}% - \newtoggle{numberonlyfirstintwolines@#1}% - \csgdef{twolines@#1}{}% - \csgdef{morethantwolines@#1}{}% - \newtoggle{onlypstartinfootnote@#1}% - \newtoggle{pstartinfootnoteeverytime@#1}% - \newtoggle{pstartinfootnote@#1}% - \csgdef{symlinenum@#1}{\symplinenum}% - \newtoggle{nonumberinfootnote@#1}% - \csgdef{beforenumberinfootnote@#1}{0pt}% - \csgdef{afternumberinfootnote@#1}{0.5em}% - \newtoggle{nonbreakableafternumber@#1}% - \csgdef{beforesymlinenum@#1}{\csuse{beforenumberinfootnote@#1}}% - \csgdef{aftersymlinenum@#1}{\csuse{afternumberinfootnote@#1}}% - \csgdef{inplaceofnumber@#1}{1em}% - \global\cslet{lemmaseparator@#1}{\rbracket}% - \csgdef{beforelemmaseparator@#1}{0em}% - \csgdef{afterlemmaseparator@#1}{0.5em}% - \csgdef{inplaceoflemmaseparator@#1}{1em}% - \csgdef{afternote@#1}{1em plus.4em minus.4em}% - \csgdef{parafootsep@#1}{\parafootftmsep}% - \csgdef{beforeXnotes@#1}{1.2em \@plus .6em \@minus .6em} - \csgdef{beforenotesX@#1}{1.2em \@plus .6em \@minus .6em} - \csgdef{afterXrule@#1}{0pt} - \csgdef{afterruleX@#1}{0pt} - \csgdef{txtbeforeXnotes@#1}{} - \csgdef{maxhnotesX@#1}{\ledfootinsdim}% - \csgdef{maxhXnotes@#1}{\ledfootinsdim} - \newtoggle{Xnoteswidthliketwocolumns@#1}% - \newtoggle{notesXwidthliketwocolumns@#1}% - - \expandafter\newinsert\csname footins#1\endcsname% - \expandafter\newinsert\csname #1footins\endcsname% - \expandafter\newinsert\csname mpfootins#1\endcsname% - \expandafter\newinsert\csname mp#1footins\endcsname% - - \global\notbool{parapparatus@}{\expandafter\newcommand\expandafter *}{\expandafter\newcommand}\csname #1footnote\endcsname[2][]{% - \if@edtext@% - \begingroup% - \newcommand{\content}{##2}% - \ifnumberedpar@% - \ifledRcol% - \ifluatex% - \footnotelang@lua[R]% - \fi% - \@ifundefined{xpg@main@language}%if polyglossia - {}% - {\footnotelang@poly[R]}% - \footnoteoptions@[R]{##1}{true}% - \xright@appenditem{\noexpand\prepare@edindex@fornote{\l@d@nums}% - \noexpand\csuse{v#1footnote}{#1}% - {{\l@d@nums}{\expandonce\@tag}{\expandonce\content}}}\to\inserts@listR - \footnoteoptions@[R]{##1}{false}% - \global\advance\insert@countR \@ne% - \else% + \unless\ifnocritical@ + \newtoggle{Xparindent@#1} + \newtoggle{Xlemmadisablefontselection@#1} + \csgdef{Xhangindent@#1}{0pt}% + \csgdef{Xragged@#1}{}% + \csgdef{hsizetwocol@#1}{0.45 \hsize}% + \csgdef{hsizethreecol@#1}{.3 \hsize}% + \csgdef{Xcolalign@#1}{\raggedright}% + \csgdef{Xnotenumfont@#1}{\notenumfont}% + \csgdef{Xnotefontsize@#1}{\notefontsetup}% + \csgdef{bhookXnote@#1}{}% + \csgdef{boxlinenum@#1}{0pt}% + \csgdef{boxsymlinenum@#1}{0pt}% + \newtoggle{numberonlyfirstinline@#1}% + \newtoggle{numberonlyfirstintwolines@#1}% + \csgdef{twolines@#1}{}% + \csgdef{morethantwolines@#1}{}% + \newtoggle{twolinesbutnotmore@#1}% + \newtoggle{twolinesonlyinsamepage@#1}% + \newtoggle{onlypstartinfootnote@#1}% + \newtoggle{pstartinfootnoteeverytime@#1}% + \newtoggle{pstartinfootnote@#1}% + \csgdef{symlinenum@#1}{\symplinenum}% + \newtoggle{nonumberinfootnote@#1}% + \csgdef{beforenumberinfootnote@#1}{0pt}% + \csgdef{afternumberinfootnote@#1}{0.5em}% + \newtoggle{nonbreakableafternumber@#1}% + \csgdef{beforesymlinenum@#1}{\csuse{beforenumberinfootnote@#1}}% + \csgdef{aftersymlinenum@#1}{\csuse{afternumberinfootnote@#1}}% + \csgdef{inplaceofnumber@#1}{1em}% + \global\cslet{lemmaseparator@#1}{\rbracket}% + \csgdef{beforelemmaseparator@#1}{0em}% + \csgdef{afterlemmaseparator@#1}{0.5em}% + \csgdef{inplaceoflemmaseparator@#1}{1em}% + \csgdef{beforeXnotes@#1}{1.2em \@plus .6em \@minus .6em} + \csgdef{afterXrule@#1}{0pt} + \csgdef{txtbeforeXnotes@#1}{} + \csgdef{maxhXnotes@#1}{\ledfootinsdim} + \newtoggle{Xnoteswidthliketwocolumns@#1}% + \expandafter\newinsert\csname #1footins\endcsname% + \unless\ifnoledgroup@% + \expandafter\newinsert\csname mp#1footins\endcsname% + \fi% + \global\notbool{parapparatus@}{\expandafter\newcommand\expandafter *}{\expandafter\newcommand}\csname #1footnote\endcsname[2][]{% + \if@edtext@% + \begingroup% + \newcommand{\content}{##2}% + \ifnumberedpar@% + \ifledRcol% \ifluatex% - \footnotelang@lua% + \footnotelang@lua[R]% \fi% - \@ifundefined{xpg@main@language}%if polyglossia - {}% - {\footnotelang@poly}% - \footnoteoptions@{##1}{true}% - \xright@appenditem{\noexpand\prepare@edindex@fornote{\l@d@nums}% - \noexpand\csuse{v#1footnote}{#1}% - {{\l@d@nums}{\expandonce\@tag}{\expandonce\content}}}\to\inserts@list - \global\advance\insert@count \@ne% - \footnoteoptions@{##1}{false}% - \fi - \else - \csuse{v#1footnote}{#1}{{0|0|0|0|0|0|0}{}{##1}}% - \fi% - \ignorespaces% - \endgroup% - \else% - \led@err@FootnoteWithoutEdtext% - \fi% - } - \csgdef{series@display#1}{} - \footnormal{#1} - - \global\expandafter\newcommand\csname footnote#1\endcsname[1]{% - \begingroup% - \newcommand{\content}{##1}% - \stepcounter{footnote#1}% - \protected@csxdef{@thefnmark#1}{\csuse{thefootnote#1}}% - \nottoggle{nomk@}%Nomk is set to true when using \footnoteXnomk with eledpar - {\csuse{@footnotemark#1}}% - {}% - \ifluatex% - \xdef\footnote@luatextextdir{\the\luatextextdir}% - \xdef\footnote@luatexpardir{\the\luatexpardir}% + \@ifundefined{xpg@main@language}%if polyglossia + {}% + {\footnotelang@poly[R]}% + \footnoteoptions@[R]{##1}{true}% + \xright@appenditem{% + \noexpand\prepare@preXnotes{#1}% + \noexpand\prepare@edindex@fornote{\l@d@nums}% + \noexpand\csuse{v#1footnote}{#1}% + {{\l@d@nums}{\expandonce\@tag}{\expandonce\content}}% + }\to\inserts@listR + \footnoteoptions@[R]{##1}{false}% + \global\advance\insert@countR \@ne% + \else% + \ifluatex% + \footnotelang@lua% + \fi% + \@ifundefined{xpg@main@language}%if polyglossia + {}% + {\footnotelang@poly}% + \footnoteoptions@{##1}{true}% + \xright@appenditem{% + \noexpand\prepare@preXnotes{#1}% + \noexpand\prepare@edindex@fornote{\l@d@nums}% + \noexpand\csuse{v#1footnote}{#1}% + {{\l@d@nums}{\expandonce\@tag}{\expandonce\content}}% + }\to\inserts@list + \global\advance\insert@count \@ne% + \footnoteoptions@{##1}{false}% + \fi + \else + \csuse{v#1footnote}{#1}{{0|0|0|0|0|0|0}{}{##1}}% \fi% - \csuse{vfootnote#1}{#1}{\expandonce\content}\m@mmf@prepare% - \endgroup% - } - \newcounter{footnote#1} - \global\expandafter\renewcommand\csname thefootnote#1\endcsname{\arabic{footnote#1}} - \csgdef{series@displayX#1}{} - \footnormalX{#1} - - \global\expandafter\newcommand\csname #1endnote\endcsname[2]{{\newlinechar='40 - \global\@noneed@Footnotetrue% - \newcommand{\content}{##1}% - \immediate\write\l@d@end{\expandafter\string\csname #1end\endcsname% - {\ifnumberedpar@\l@d@nums\fi}% - {\ifnumberedpar@\expandonce\@tag\fi}{\expandonce\content}{#1}}}\ignorespaces% - } - - \global\cslet{#1end}{\@gobblefour} + \ignorespaces% + \endgroup% + \else% + \led@err@FootnoteWithoutEdtext% + \fi% + } + \footnormal{#1} + \fi + \unless\ifnofamiliar@ + \newtoggle{parindentX@#1} + \csgdef{hangindentX@#1}{0pt}% + \csgdef{raggedX@#1}{}% + \csgdef{hsizetwocolX@#1}{0.45 \hsize}% + \csgdef{hsizethreecolX@#1}{.3 \hsize}% + \csgdef{colalignX@#1}{\raggedright}% + \csgdef{notenumfontX@#1}{\notenumfont}% + \csgdef{notefontsizeX@#1}{\notefontsetup}% + \csgdef{bhooknoteX@#1}{}% + \csgdef{afterruleX@#1}{0pt} + \csgdef{beforenotesX@#1}{1.2em \@plus .6em \@minus .6em} + \csgdef{maxhnotesX@#1}{\ledfootinsdim}% + \newtoggle{notesXwidthliketwocolumns@#1}% + \expandafter\newinsert\csname footins#1\endcsname% + \unless\ifnoledgroup@% + \expandafter\newinsert\csname mpfootins#1\endcsname% + \fi% - \global\csletcs{#1@@footnote}{#1footnote} + \global\expandafter\newcommand\csname footnote#1\endcsname[1]{% + \begingroup% + \prepare@prenotesX{#1}% + \newcommand{\content}{##1}% + \stepcounter{footnote#1}% + \protected@csxdef{@thefnmark#1}{\csuse{thefootnote#1}}% + \nottoggle{nomk@}%Nomk is set to true when using \footnoteXnomk with eledpar + {\csuse{@footnotemark#1}}% + {}% + \ifluatex% + \xdef\footnote@luatextextdir{\the\luatextextdir}% + \xdef\footnote@luatexpardir{\the\luatexpardir}% + \fi% + \csuse{vfootnote#1}{#1}{\expandonce\content}\m@mmf@prepare% + \endgroup% + } + \newcounter{footnote#1} + \global\expandafter\renewcommand\csname thefootnote#1\endcsname{\arabic{footnote#1}} + \footnormalX{#1} + \fi + \csgdef{parafootsep@#1}{\parafootftmsep}% + \csgdef{afternote@#1}{1em plus.4em minus.4em}% + \unless\ifnoend@ + + \global\expandafter\newcommandx\csname #1endnote\endcsname[2][1,usedefault]{% + \bgroup% + \newlinechar='40% + \global\@noneed@Footnotetrue% + \newcommand{\content}{##2}% + \immediate\write\l@d@end{% + \expandafter\string\csname #1end\endcsname% + {\ifnumberedpar@\l@d@nums\fi}% + {\ifnumberedpar@\expandonce\@tag\fi}% + {\expandonce\content}% + {#1}% + {##1}% + }% + \egroup% + \ignorespaces% + }% + \global\cslet{#1end}{\@gobblefive} + \global\csletcs{#1@@footnote}{#1footnote} + \csgdef{Xendtwolines@#1}{}% + \csgdef{Xendmorethantwolines@#1}{}% + \newtoggle{Xendtwolinesbutnotmore@#1}{}% + \newtoggle{Xendtwolinesonlyinsamepage@#1}{}% + \newtoggle{Xendlemmadisablefontselection@#1}% + \csgdef{Xendnotenumfont@#1}{\notenumfont}% + \csgdef{Xendnotefontsize@#1}{\notefontsetup}% + \csgdef{bhookXendnote@#1}{}% + \csgdef{boxXendlinenum@#1}{0pt}% + \fi% \listxadd{\@series}{#1} -} + } }% End of \newseries \expandafter\newseries\expandafter{\default@series} -\newcommand{\seriesatbegin}[1]{ - \edef\series{#1} - \def\new{} - \listeadd{\new}{\series} - \def\do##1{\ifcsstring{series}{##1}{}{\listadd{\new}{##1}}} - \dolistloop{\@series} - \xdef\@series{\new} +\newcommand{\seriesatbegin}[1]{% + \StrDel{\@series}{#1}[\@series]% + \edef\@new{}% + \listeadd{\@new}{#1}% + \listeadd{\@new}{\@series}% + \xdef\@series{\@new}% } -\newcommand{\seriesatend}[1]{ - \edef\series{#1} - \def\new{} - \def\do##1{\ifcsstring{series}{##1}{}{\listadd{\new}{##1}}} - \dolistloop{\@series} - \listeadd{\new}{\series} - \xdef\@series{\new} +\newcommand{\seriesatend}[1]{% + \StrDel{\@series}{#1}[\@series]% + \edef\@new{}% + \listeadd{\@new}{\@series}% + \listeadd{\@new}{#1}% + \xdef\@series{\@new}% } - -\newcommandx{\settoggle@series}[4][4]{% +\newcommand{\ifseriesbefore}[4]{% + \StrPosition{\@series}{#1}[\@first]% + \StrPosition{\@series}{#2}[\@second]% + \ifnumgreater{\@second}{\@first}{#3}{#4}% +} +\newcommandx{\settoggle@series}[5][4,5,usedefault]{% \def\do##1{% \global\settoggle{#2@##1}{#3}% \ifstrequal{#4}{reload}% @@ -2930,12 +3264,15 @@ }% \ifstrempty{#1}{% \dolistloop{\@series}% + \ifstrempty{#5}{}{% + \docsvlist{#5}% + } }% - {% + {% \docsvlist{#1}% }% } -\newcommandx{\setcommand@series}[4][4]{% +\newcommandx{\setcommand@series}[5][4,5,usedefault]{% \def\do##1{ \csgdef{#2@##1}{#3} \ifstrequal{#4}{reload}{ @@ -2944,126 +3281,118 @@ }{}} \ifstrempty{#1}{% \dolistloop{\@series}% + \ifstrempty{#5}{}{% + \docsvlist{#5} + } }% {% \docsvlist{#1}% }% }% -\newcommand{\newhookcommand@series}[1]{% +\newcommandx{\newhookcommand@series}[2][2,usedefault]{% \global\expandafter\newcommand\expandafter*\csname #1\endcsname[2][]{% - \setcommand@series{##1}{#1}{##2}% + \setcommand@series{##1}{#1}{##2}[][#2]% }% -} - -\newhookcommand@series{twolines} - -\newhookcommand@series{morethantwolines} - -\newhookcommand@series{Xhangindent} - -\newhookcommand@series{hangindentX} - -\newhookcommand@series{Xragged} - -\newhookcommand@series{raggedX} - -\newhookcommand@series{hsizetwocol} - -\newhookcommand@series{hsizethreecol} - -\newhookcommand@series{hsizetwocolX} - -\newhookcommand@series{hsizethreecolX} - -\newhookcommand@series{Xnotenumfont} - -\newhookcommand@series{notenumfontX} - -\newhookcommand@series{Xendnotenumfont} - -\newhookcommand@series{bhooknoteX} - -\newhookcommand@series{bhookXnote} - -\newhookcommand@series{bhookXendnote} - -\newhookcommand@series{Xnotefontsize} - -\newhookcommand@series{notefontsizeX} - -\newhookcommand@series{Xendnotefontsize} - -\newhookcommand@series{boxlinenum} - -\newhookcommand@series{boxXendlinenum}% - -\newhookcommand@series{boxsymlinenum} - -\newhookcommand@series{parafootsep} - -\newhookcommand@series{symlinenum} - -\newhookcommand@series{beforenumberinfootnote} - -\newhookcommand@series{afternumberinfootnote} - -\newhookcommand@series{beforesymlinenum} - -\newhookcommand@series{aftersymlinenum} - -\newhookcommand@series{inplaceofnumber} - -\newhookcommand@series{lemmaseparator} - -\newhookcommand@series{beforelemmaseparator} - -\newhookcommand@series{afterlemmaseparator} - -\newhookcommand@series{inplaceoflemmaseparator} - -\newhookcommand@series{afternote} - -\newhookcommand@series{txtbeforeXnotes} - -\newhookcommand@series{afterruleX} - -\newhookcommand@series{afterXrule} - -\newcommand{\newhookcommand@series@reload}[1]{% - \global\expandafter\newcommand\expandafter*\csname #1\endcsname[2][]{% - \setcommand@series{##1}{#1}{##2}[reload]% + \ifstrempty{#2}{}{% + \def\do##1{% + \global\expandafter\newcommand\expandafter*\csname #1##1\endcsname[1]{% + \csuse{#1}[##1]{####1}% + }% + }% + \docsvlist{#2}% }% } -\newhookcommand@series@reload{beforeXnotes} - -\newhookcommand@series@reload{beforenotesX} - -\newhookcommand@series@reload{maxhnotesX} - -\newhookcommand@series@reload{maxhXnotes} -\newcommand{\newhooktoggle@series}[1]{% +\newcommandx{\newhooktoggle@series}[2][2,usedefault]{% \global\expandafter\newcommandx\expandafter*\csname #1\endcsname[2][1,2={true},usedefault]{% - \settoggle@series{##1}{#1}{##2}% + \settoggle@series{##1}{#1}{##2}[][#2]% + }% + \ifstrempty{#2}{}{% + \def\do##1{% + \global\expandafter\newcommand\expandafter*\csname #1##1\endcsname{% + \csuse{#1}[##1]% + }% }% + \docsvlist{#2}% + }% } -\newhooktoggle@series{numberonlyfirstinline} -\newhooktoggle@series{numberonlyfirstintwolines} -\newhooktoggle@series{nonumberinfootnote} -\newhooktoggle@series{pstartinfootnote} -\newhooktoggle@series{pstartinfootnoteeverytime}% -\newhooktoggle@series{onlypstartinfootnote} -\newhooktoggle@series{nonbreakableafternumber} -\newhooktoggle@series{Xlemmadisablefontselection} -\newhooktoggle@series{Xendlemmadisablefontselection} \newcommand{\newhooktoggle@series@reload}[1]{% \global\expandafter\newcommandx\expandafter*\csname #1\endcsname[2][1,2={true},usedefault]{% \settoggle@series{##1}{#1}{##2}[reload]% }% }% - -\newhooktoggle@series@reload{Xnoteswidthliketwocolumns}% -\newhooktoggle@series@reload{notesXwidthliketwocolumns}% - +\newcommand{\newhookcommand@series@reload}[1]{% + \global\expandafter\newcommand\expandafter*\csname #1\endcsname[2][]{% + \setcommand@series{##1}{#1}{##2}[reload]% + }% +} +\unless\ifnocritical@ + \newhooktoggle@series{Xparindent} + \newhookcommand@series{twolines}[appref] + \newhookcommand@series{morethantwolines}[appref] + \newhooktoggle@series{twolinesbutnotmore}[appref] + \newhooktoggle@series{twolinesonlyinsamepage}[appref] + \newhookcommand@series{Xhangindent} + \newhookcommand@series{Xragged} + \newhookcommand@series{hsizetwocol} + \newhookcommand@series{hsizethreecol} + \newhookcommand@series{Xcolalign}% + \newhookcommand@series{Xnotenumfont} + \newhookcommand@series{bhookXnote} + \newhookcommand@series{boxsymlinenum} + \newhookcommand@series{symlinenum} + \newhookcommand@series{beforenumberinfootnote} + \newhookcommand@series{afternumberinfootnote} + \newhookcommand@series{beforesymlinenum} + \newhookcommand@series{aftersymlinenum} + \newhookcommand@series{inplaceofnumber} + \newhookcommand@series{lemmaseparator} + \newhookcommand@series{beforelemmaseparator} + \newhookcommand@series{afterlemmaseparator} + \newhookcommand@series{inplaceoflemmaseparator} + \newhookcommand@series{txtbeforeXnotes} + \newhookcommand@series@reload{afterXrule} + \newhooktoggle@series{numberonlyfirstinline} + \newhooktoggle@series{numberonlyfirstintwolines} + \newhooktoggle@series{nonumberinfootnote} + \newhooktoggle@series{pstartinfootnote} + \newhooktoggle@series{pstartinfootnoteeverytime}% + \newhooktoggle@series{onlypstartinfootnote} + \newhooktoggle@series{nonbreakableafternumber} + \newhooktoggle@series{Xlemmadisablefontselection} + \newhookcommand@series@reload{maxhXnotes} + \newhookcommand@series@reload{beforeXnotes} + \newhooktoggle@series@reload{Xnoteswidthliketwocolumns}% + \newhookcommand@series{Xnotefontsize} + \newhookcommand@series{boxlinenum} +\fi +\unless\ifnofamiliar@ + \newhooktoggle@series{parindentX} + \newhookcommand@series{hangindentX} + \newhookcommand@series{raggedX} + \newhookcommand@series{hsizetwocolX} + \newhookcommand@series{hsizethreecolX} + \newhookcommand@series{colalignX}% + \newhookcommand@series{notenumfontX} + \newhookcommand@series{bhooknoteX} + \newhookcommand@series@reload{beforenotesX} + \newhookcommand@series@reload{maxhnotesX} + \newhooktoggle@series@reload{notesXwidthliketwocolumns}% + \newhookcommand@series@reload{afterruleX} + \newhookcommand@series{notefontsizeX} +\fi +\newhookcommand@series{parafootsep} +\newhookcommand@series{afternote} +\unless\ifnoend@ + \newhookcommand@series{Xendtwolines}[apprefwithpage] + \newhookcommand@series{Xendmorethantwolines}[apprefwithpage] + \newhooktoggle@series{Xendtwolinesbutnotmore}[apprefwithpage] + \newhooktoggle@series{Xendtwolinesonlyinsamepage}[apprefwithpage] + \newhookcommand@series{Xendnotenumfont} + \newhookcommand@series{bhookXendnote} + \newhookcommand@series{boxXendlinenum}% + \newhookcommand@series{Xendnotefontsize} + \newhooktoggle@series{Xendlemmadisablefontselection} +\fi \newcommand*{\notenumfont}{\normalfont} \newcommand*{\notefontsetup}{\footnotesize} \newif\ifledplinenum @@ -3193,7 +3522,6 @@ \AtBeginDocument{\@ifpackageloaded{footmisc}{}{\newif\ifFN@bottom}} \newcommand*{\l@ddofootinsert}{% -%%% \page@start \ifvoid\footins \setbox\@outputbox \box\@cclv \else @@ -3201,7 +3529,7 @@ \boxmaxdepth \@maxdepth \@tempdima\dp\@cclv \unvbox \@cclv - \ifFN@bottom\vfill\fi\vskip \skip\footins%%% If the option bottom of loadmisc package is loaded + \ifFN@bottom\vfill\fi\vskip \skip\footins% If the option bottom of loadmisc package is loaded \color@begingroup \normalcolor \footnoterule @@ -3231,23 +3559,30 @@ \csuse{#1footgroup}{#1}%% }% \newcommand*{\@opxtrafeetii}{% - \def\do##1{% - \ifvoid\csuse{##1footins}\else% - \print@Xnotes{##1}% - \fi% - }% - \dolistloop{\@series}% + \unless\ifnocritical@% + \gdef\firstXseries@{}% + \def\do##1{% + \ifvoid\csuse{##1footins}\else% + \global\skip\csuse{##1footins}=\csuse{beforeXnotes@##1}% + \global\advance\skip\csuse{##1footins} by\csuse{afterXrule@##1}% + \print@Xnotes{##1}% + \fi% + }% + \dolistloop{\@series}% + \fi% }% \newcommand*{\l@ddodoreinxtrafeet}{% \doreinxtrafeeti \doreinxtrafeetii} \newcommand*{\doreinxtrafeetii}{% - \def\do##1{% - \ifvoid\csuse{##1footins}\else% - \insert\csuse{##1footins}{\unvbox\csuse{##1footins}}% - \fi}% - \dolistloop{\@series} + \unless\ifnocritical@% + \def\do##1{% + \ifvoid\csuse{##1footins}\else% + \insert\csuse{##1footins}{\unvbox\csuse{##1footins}}% + \fi}% + \dolistloop{\@series} + \fi% } \gdef \l@d@reinserts{% @@ -3283,19 +3618,35 @@ \@ifclassloaded{memoir}{% \g@addto@macro{\@mem@extranofeet}{% - \def\do#1{\ifvoid\csuse{#1footins}\else\@mem@nofootfalse\fi% - \ifvoid\csuse{footins#1}\else\@mem@nofootfalse\fi% - } - \dolistloop{\@series}% - \@led@extranofeet} + \unless\ifnocritical@% + \def\do#1{\ifvoid\csuse{#1footins}\else\@mem@nofootfalse\fi% + \ifvoid\csuse{footins#1}\else\@mem@nofootfalse\fi% + } + \dolistloop{\@series}% + \@led@extranofeet + \fi% + }% }{% \newcommand*{\@led@testifnofoot}{% - \@led@nofoottrue - \ifvoid\footins\else\@led@nofootfalse\fi - \def\do##1{\ifvoid\csuse{##1footins}\else\@led@nofootfalse\fi% - \ifvoid\csuse{footins##1}\else\@led@nofootfalse\fi}% - \dolistloop{\@series} - \@led@extranofeet} + \@led@nofoottrue% + \ifvoid\footins\else% + \@led@nofootfalse% + \fi% + \def\do##1{% + \unless\ifnocritical@% + \ifvoid\csuse{##1footins}\else% + \@led@nofootfalse% + \fi% + \fi% + \unless\ifnofamiliar@% + \ifvoid\csuse{footins##1}\else% + \@led@nofootfalse% + \fi% + \fi% + }% + \dolistloop{\@series}% + \@led@extranofeet% +}% \renewcommand{\@doclearpage}{% \@led@testifnofoot @@ -3405,6 +3756,34 @@ {\linenumrep{\line@num}|% \ifsublines@ \sublinenumrep{\subline@num}\else 0\fi}\to\labelref@list} +\newcommand*{\applabel}[1]{% + \if@edtext@% + \ifcsundef{the@label#1}{% + \csdef{the@label#1}{applabel}% + }% + {% + \led@warn@DuplicateLabel{#1 (applabel)}% + }% + \expandafter\l@dp@rsefootspec\l@d@nums|% + \@bsphack% + \ifledRcol% + \protected@write\@auxout{}% + {\string\l@dmake@labelsR\space\l@dparsedstartpage|\l@dparsedstartline|\l@dparsedstartsub|\the\c@pstartR|{#1:start}}% + \ifdef{\hypertarget}{\hypertarget{#1:start}{}}{}% + \protected@write\@auxout{}% + {\string\l@dmake@labelsR\space\l@dparsedendpage|\l@dparsedendline|\l@dparsedendsub|\the\c@pstartR|{#1:end}}% + \else% + \protected@write\@auxout{}% + {\string\l@dmake@labels\space\l@dparsedstartpage|\l@dparsedstartline|\l@dparsedstartsub|\the\c@pstart|{#1:start}}% + \ifdef{\hypertarget}{\hypertarget{#1:start}{}}{}% + \protected@write\@auxout{}% + {\string\l@dmake@labels\space\l@dparsedendpage|\l@dparsedendline|\l@dparsedendsub|\the\c@pstart|{#1:end}}% + \fi% + \@esphack% + \else% + \led@warn@AppLabelOutEdtext{#1}% + \fi% +}% \newrobustcmd{\wrap@edcrossref}[2]{% \ifdef{\hyperlink}% {\hyperlink{#1}{#2}}% @@ -3469,6 +3848,42 @@ \linenum{\@tempa|% \@tempb}}}% +\xdef\twolines@appref{}% +\xdef\morethantwolines@appref{}% +\newtoggle{twolinesbutnotmore@appref}% +\newtoggle{twolinesonlyinsamepage@appref}% + +\newcommand\apprefprefixsingle{}% +\newcommand\apprefprefixmore{}% + +\newcommandx{\appref}[2][1,usedefault]{% + \IfStrEq{#1}{fulllines}% + {\toggletrue{fulllines@}}% + {}% + \xdef\@currentseries{appref}% + \ifdefempty{\apprefprefixmore}% + {\apprefprefixsingle}% + {% + \IfEq{\xlineref{#2:start}}{\xlineref{#2:end}}% + {\apprefprefixsingle}% + {\apprefprefixmore}% + }% + \printlines\xpageref{#2:start}|\xlineref{#2:start}|\xsublineref{#2:start}|\xpageref{#2:end}|\xlineref{#2:end}|\xsublineref{#2:end}||% + \togglefalse{fulllines@}% +}% + +\xdef\Xendtwolines@apprefwithpage{}% +\xdef\Xendmorethantwolines@apprefwithpage{}% +\newtoggle{Xendtwolinesbutnotmore@apprefwithpage}% +\newtoggle{Xendtwolinesonlyinsamepage@apprefwithpage}% + +\newcommandx{\apprefwithpage}[2][1,usedefault]{% + \IfStrEq{#1}{fulllines}% + {\toggletrue{fulllines@}}% + {}% + \printendlines\xpageref{#2:start}|\xlineref{#2:start}|\xsublineref{#2:start}|\xpageref{#2:end}|\xlineref{#2:end}|\xsublineref{#2:end}||% + \togglefalse{fulllines@}% +}% \newcommand*{\edmakelabel}[2]{\expandafter\xdef\csname the@label#1\endcsname{#2}} \let\l@dold@xympar\@xympar @@ -3695,6 +4110,7 @@ \fi% \fi% } +\ifnoledgroup@\else% \newcommand*{\l@dfeetbeginmini}{\l@dedbeginmini\l@dfambeginmini} \newcommand*{\l@dfeetendmini}{% \IfStrEq{critical-familiar}{\@mpfnpos}% @@ -3822,6 +4238,7 @@ \l@dfeetendmini% } +\fi% \newif\ifledgroupnotesL@ \newif\ifledgroupnotesR@ \AtBeginDocument{% @@ -3864,8 +4281,9 @@ \xdef\@index@parenthesis{)}% }{}% } -\newcommand{\ledinnote}[2]{\csuse{#1}{#2\emph{n}}} -\newcommand{\ledinnotehyperpage}[2]{\csuse{#1}{\hyperpage{#2}\emph{n}}} +\newcommand{\ledinnote}[2]{\csuse{#1}{\ledinnotemark{#2}}}% +\newcommand{\ledinnotehyperpage}[2]{\csuse{#1}{\ledinnotemark{\hyperpage{#2}}}}% +\newcommand{\ledinnotemark}[1]{#1\emph{n}}% \def\create@edindex@for@memoir{ \g@addto@macro{\makememindexhook}{% \def\edindex{\@bsphack% @@ -3987,7 +4405,7 @@ }% \newcommand{\get@edindex@hyperref}[1]{% - \ifdef{\hyperlink}% + \ifdefequal{\iftrue}{\ifHy@hyperindex}% {% \edef\temp@{% \catcode`\ =9 %space need for catcode @@ -4190,20 +4608,24 @@ } \newcommand{\disable@familiarnotes}{% - \def\do##1{% - \csletcs{footnote@@##1}{footnote##1}% - \expandafter\renewcommand \csname footnote##1\endcsname[1]{% - \protected@csxdef{@thefnmark##1}{\csuse{thefootnote##1}}% - \csuse{@footnotemark##1}% - }% - }% - \dolistloop{\@series}% + \unless\ifnofamiliar@% + \def\do##1{% + \csletcs{footnote@@##1}{footnote##1}% + \expandafter\renewcommand \csname footnote##1\endcsname[1]{% + \protected@csxdef{@thefnmark##1}{\csuse{thefootnote##1}}% + \csuse{@footnotemark##1}% + }% + }% + \dolistloop{\@series}% + \fi% }% \newcommand{\restore@familiarnotes}{% - \def\do##1{% - \csletcs{footnote##1}{footnote@@##1}% - }% - \dolistloop{\@series}% + \unless\ifnofamiliar@% + \def\do##1{% + \csletcs{footnote##1}{footnote@@##1}% + }% + \dolistloop{\@series}% + \fi% }% \newcommand{\disable@sidenotes}{% @@ -4967,6 +5389,7 @@ \let\sectionmark\@gobble% \let\subsectionmark\@gobble% } +\notbool{@noeled@sec}{% \ifl@dmemoir \newcommand\beforeeledchapter{\clearforchapter} \else @@ -5008,7 +5431,9 @@ \AtBeginDocument{% \patchcmd{\chapter}{\clearforchapter}{% \if@eled@sectioning\else% - \clearforchapter + \ifl@dprintingpages\else% + \clearforchapter% + \fi% \fi% } {} @@ -5060,7 +5485,9 @@ \patchcmd{\chapter}{\if@openright\cleardoublepage\else\clearpage\fi}{% \if@eled@sectioning\else% - \if@openright\cleardoublepage\else\clearpage\fi%No clearpage inside a \eledsection : will keep critical notes from printing on the title page. + \ifl@dprintingpages\else% + \if@openright\cleardoublepage\else\clearpage\fi%No clearpage inside a \eledsection: will keep critical notes from printing on the title page. + \fi% \fi% }% {}% @@ -5187,8 +5614,10 @@ } \catcode`\#=6 %Space NEEDS by \catcode \newwrite\eled@sectioning@out -\newif\if@noeled@sec% -\newcommand{\noeledsec}{\global\@noeled@sectrue}% +\newcommand{\noeledsec}{% + \led@war@noeledsecDeprecated% + \global\@noeled@sectrue% +}% \newcommand{\eledchapter}[2][]{% #2% \ifledRcol% @@ -5360,6 +5789,7 @@ \listcsgadd{eled@sections#5@@}{#3}% } +}{} \def\normal@page@break{} \def\l@prev@pb{} \def\l@prev@nopb{} diff --git a/Master/texmf-dist/tex/latex/eledmac/eledpar.sty b/Master/texmf-dist/tex/latex/eledmac/eledpar.sty index 07d9fadb905..f1fd61f5c34 100644 --- a/Master/texmf-dist/tex/latex/eledmac/eledpar.sty +++ b/Master/texmf-dist/tex/latex/eledmac/eledpar.sty @@ -23,7 +23,7 @@ %% This work consists of the files listed in the README file. %% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{eledpar}[2015/03/22 v1.14.0 eledmac extension for parallel texts]% +\ProvidesPackage{eledpar}[2015/04/13 v1.15.0 eledmac extension for parallel texts]% \RequirePackage{xspace}% \newif\ifshiftedpstarts @@ -166,19 +166,28 @@ \ifx\@tempa\@tempb \global\bypage@Rtrue \global\bypstart@Rfalse + \unless\ifnocritical@% + \pstartinfootnote[][false]% + \fi% \else \def\@tempb{pstart}% \ifx\@tempa\@tempb \global\bypage@Rfalse \global\bypstart@Rtrue + \unless\ifnocritical@% + \pstartinfootnote% + \fi% \else \def@tempb{section} \ifx\@tempa\@tempb - \global\bypage@Rfalse - \global\bypstart@Rfalse + \global\bypage@Rfalse% + \global\bypstart@Rfalse% + \unless\ifnocritical@% + \pstartinfootnote[][false]% + \fi% \else \led@warn@BadLineation - \fi + \fi% \fi \fi \fi}} @@ -550,15 +559,6 @@ \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 @@ -668,13 +668,6 @@ \else \write\linenum@out{\string\lock@off}% \fi} -\renewcommand*{\skipnumbering}{% - \ifledRcol \write\linenum@outR{\string\n@num}% - \advanceline{-1}% - \else - \skipnumbering@reg - \fi} - \renewcommand*{\set@line}{% \ifledRcol @@ -698,35 +691,44 @@ \fi} \newcommand{\newseries@eledpar}[1]{% - \csgdef{onlysideX@#1}{}% - \csgdef{onlyXside@#1}{}% - \global\newbool{keepforXside@#1}% - \global\newbool{keepforsideX@#1}% - \expandafter\list@create\csname footnote#1@mk\endcsname% - \expandafter\newcommand\csname footnote#1nomk\endcsname[1]{% - \toggletrue{nomk@}% - \csuse{footnote#1}{##1}% - \togglefalse{nomk@}% - \letcs{\@tmp}{footnote#1@mk}% - \numdef\@tmpa{\csuse{c@footnote#1}}% - \global\xright@appenditem{\@tmpa}\to\@tmp% - \global\cslet{footnote#1@mk}{\@tmp}% - }% - \expandafter\newcommand\csname footnote#1mk\endcsname{% - \letcs{\@tmp}{footnote#1@mk}% - \gl@p\@tmp\to\@tmpa% - \global\cslet{footnote#1@mk}{\@tmp}% - \letcs{\old@footnote}{c@footnote#1}% - \setcounter{footnote#1}{\@tmpa}% - \protected@csxdef{@thefnmark#1}{\csuse{thefootnote#1}}% - \csuse{@footnotemark#1}% - \setcounter{footnote#1}{\old@footnote}% - \xspace% - }% + \unless\ifnocritical@% + \csgdef{onlysideX@#1}{}% + \global\newbool{keepforXside@#1}% + \fi% + \unless\ifnofamiliar@% + \global\newbool{keepforsideX@#1}% + \csgdef{onlyXside@#1}{}% + \fi% + \unless\ifnofamiliar@% + \expandafter\list@create\csname footnote#1@mk\endcsname% + \expandafter\newcommand\csname footnote#1nomk\endcsname[1]{% + \toggletrue{nomk@}% + \csuse{footnote#1}{##1}% + \togglefalse{nomk@}% + \letcs{\@tmp}{footnote#1@mk}% + \numdef\@tmpa{\csuse{c@footnote#1}}% + \global\xright@appenditem{\@tmpa}\to\@tmp% + \global\cslet{footnote#1@mk}{\@tmp}% + }% + \expandafter\newcommand\csname footnote#1mk\endcsname{% + \letcs{\@tmp}{footnote#1@mk}% + \gl@p\@tmp\to\@tmpa% + \global\cslet{footnote#1@mk}{\@tmp}% + \letcs{\old@footnote}{c@footnote#1}% + \setcounter{footnote#1}{\@tmpa}% + \protected@csxdef{@thefnmark#1}{\csuse{thefootnote#1}}% + \csuse{@footnotemark#1}% + \setcounter{footnote#1}{\old@footnote}% + \xspace% + }% + \fi }% -\newhookcommand@series{onlysideX}% - -\newhookcommand@series{onlyXside}% +\unless\ifnocritical@% + \newhookcommand@series{onlyXside}% +\fi% +\unless\ifnofamiliar@% + \newhookcommand@series{onlysideX}% +\fi \newcommand{\init@series@eledpar}{% \def\do##1{\newseries@eledpar{##1}}% @@ -884,6 +886,7 @@ \ifstrempty{#1}% {\csgdef{before@pstartL@\the\l@dnumpstartsL}{\at@every@pstart}}% {\csgdef{before@pstartL@\the\l@dnumpstartsL}{\noindent#1}}% + \at@every@pstart@call% } \newcommandx*{\pstartR}[1][1]{% \if@nobreak% @@ -931,6 +934,7 @@ \ifstrempty{#1}% {\csgdef{before@pstartR@\the\l@dnumpstartsR}{\at@every@pstart}}% {\csgdef{before@pstartR@\the\l@dnumpstartsR}{\noindent#1}}% + \at@every@pstart@call% } \newcommandx*{\pendL}[1][1]{% \ifnumbering \else% @@ -977,6 +981,8 @@ {\csgdef{after@pendR@\the\l@dnumpstartsR}{\noindent#1}}% } +\newcommand{\AtEveryPstartCall}[1]{\xdef\at@every@pstart@call{\unexpanded{#1}}}% +\gdef\at@every@pstart@call{}% \newif\ifprint@last@after@pendL% \newif\ifprint@last@after@pendR% \newbox\l@dleftbox @@ -994,34 +1000,39 @@ \newcommand*{\do@lineL}{% \letcs{\ifnumberpstart}{numberpstart@L\the\l@dpscL}% - \advance\countLline \@ne + \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} + {\vbadness=10000% + \splittopskip=\z@% + \do@lineLhook% + \l@demptyd@ta% + \global\setbox\one@line=\vsplit\namebox{l@dLcolrawbox\the\l@dpscL}% to\baselineskip}% - \IfStrEq{\splitfirstmarks\parledgroup@}{begin}{\parledgroup@notes@startL}{} - \unvbox\one@line \global\setbox\one@line=\lastbox - \getline@numL + \IfStrEq{\splitfirstmarks\parledgroup@}{begin}{\parledgroup@notes@startL}{}% + \unvbox\one@line \global\setbox\one@line=\lastbox% + \getline@numL% \ifnum\@lock>\@ne% \inserthangingsymboltrue% \else% \inserthangingsymbolfalse% - \fi - \setbox\l@dleftbox + \fi% + \setbox\l@dleftbox% \hb@xt@ \Lcolwidth{% - \affixline@num + \ifl@dhidenumber% + \global\l@dhidenumberfalse% + \f@x@l@cks% + \else% + \affixline@num% + \fi% \xifinlist{\the\l@dpscL}{\eled@sections@@}% {\add@inserts\affixside@note}% {\print@lineL}}% - \add@penaltiesL - \global\advance\@donereallinesL\@ne - \global\advance\@donetotallinesL\@ne -\else + \add@penaltiesL% + \global\advance\@donereallinesL\@ne% + \global\advance\@donetotallinesL\@ne% +\else% \setbox\l@dleftbox \hb@xt@ \Lcolwidth{\hspace*{\Lcolwidth}}% - \global\advance\@donetotallinesL\@ne + \global\advance\@donetotallinesL\@ne% \fi} \def\print@lineL{% @@ -1029,14 +1040,14 @@ \l@dld@ta %space kept for backward compatibility \add@inserts\affixside@note% \l@dlsn@te %space kept for backward compatibility - {\ledllfill\hb@xt@ \wd\one@line{% + {\ledllfill\hb@xt@ \Lcolwidth{% \do@insidelineLhook% \ifluatex% \luatextextdir\l@luatextextdir@L% \fi% \new@lineL% \inserthangingsymbolL% - \l@dunhbox@line{\one@line}}\correcthangingL\ledrlfill\l@drd@ta% + \l@dunhbox@line{\one@line}}\ledrlfill\l@drd@ta% \l@drsn@te}} \def\print@eledsectionL{%% @@ -1080,36 +1091,41 @@ \newcommand*{\do@lineR}{% \letcs{\ifnumberpstart}{numberpstart@R\the\l@dpscR}% \ledRcol@true% - \advance\countRline \@ne + \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} + {\vbadness=10000% + \splittopskip=\z@% + \do@lineRhook% + \l@demptyd@ta% + \global\setbox\one@lineR=\vsplit\namebox{l@dRcolrawbox\the\l@dpscR}% to\baselineskip}% - \IfStrEq{\splitfirstmarks\parledgroup@}{begin}{\parledgroup@notes@startR}{} - \unvbox\one@lineR \global\setbox\one@lineR=\lastbox - \getline@numR + \IfStrEq{\splitfirstmarks\parledgroup@}{begin}{\parledgroup@notes@startR}{}% + \unvbox\one@lineR \global\setbox\one@lineR=\lastbox% + \getline@numR% \ifnum\@lockR>\@ne% - \inserthangingsymbolRtrue + \inserthangingsymbolRtrue% \else% \inserthangingsymbolRfalse% \fi% - \setbox\l@drightbox + \setbox\l@drightbox% \hb@xt@ \Rcolwidth{% - \affixline@numR% + \ifl@dhidenumber% + \global\l@dhidenumberfalse% + \f@x@l@cksR% + \else% + \affixline@numR% + \fi% \xifinlist{\the\l@dpscR}{\eled@sectionsR@@}% {\add@insertsR\affixside@noteR}% {\print@lineR}% }% - \add@penaltiesR - \global\advance\@donereallinesR\@ne - \global\advance\@donetotallinesR\@ne -\else - \setbox\l@drightbox \hb@xt@ \Rcolwidth{\hspace*{\Rcolwidth}} - \global\advance\@donetotallinesR\@ne -\fi + \add@penaltiesR% + \global\advance\@donereallinesR\@ne% + \global\advance\@donetotallinesR\@ne% +\else% + \setbox\l@drightbox \hb@xt@ \Rcolwidth{\hspace*{\Rcolwidth}}% + \global\advance\@donetotallinesR\@ne% +\fi% \ledRcol@false% } @@ -1118,7 +1134,7 @@ \l@dld@ta %space kept for backward compatibility \add@insertsR\affixside@noteR% \l@dlsn@te %space kept for backward compatibility - \correcthangingR\ledllfill\hb@xt@ \wd\one@lineR{% + \ledllfill\hb@xt@ \Rcolwidth{% \do@insidelineRhook% \new@lineR% \inserthangingsymbolR% @@ -1126,7 +1142,7 @@ \luatextextdir\l@luatextextdir@R% \fi% \l@dunhbox@line{\one@lineR}}\ledrlfill\l@drd@ta% - \l@drsn@te + \l@drsn@te% } \def\print@eledsectionR{% @@ -1161,37 +1177,39 @@ \global\advance\absline@numR \@ne \do@actionsR \do@ballastR -\ifledgroupnotesR@\else\ifnumberline - \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 + \ifledgroupnotesR@\else + \ifnumberline + \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 + \fi \fi -\fi -\fi } \newcommand*{\getline@numL}{% - \global\advance\absline@num \@ne + \global\advance\absline@num \@ne \do@actions \do@ballast -\ifledgroupnotesL@\else\ifnumberline - \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 + \ifledgroupnotesL@\else + \ifnumberline + \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 + \fi \fi -\fi -\fi } \newcommand*{\do@ballastR}{\global\ballast@count=\z@ @@ -1203,6 +1221,8 @@ \fi \fi \endgroup} + +\newif\ifl@dskipversenumberR \newcommand*{\do@actions@fixedcodeR}{% \ifcase\@l@dtempcnta% \or% % 1001 @@ -1211,7 +1231,7 @@ \global\sublines@false \or% % 1003 \global\@lockR=\@ne - \or% % 1004 + \or% % 1004% \ifnum\@lockR=\tw@ \global\@lockR=\thr@@ \else @@ -1227,9 +1247,14 @@ \fi \or% % 1007 \l@dskipnumbertrue - \else + \or% % 1008 + \l@dskipversenumberRtrue% + \or% % 1009 + \l@dhidenumbertrue% + \else% \led@warn@BadAction - \fi} + \fi% +} \newcommand*{\do@actionsR}{% \global\let\do@actions@nextR=\relax @@ -1349,21 +1374,23 @@ \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}}}% + \ifl@dskipversenumberR\else + \if@twocolumn + \if@firstcolumn + \gdef\l@dld@ta{\llap{{\leftlinenumR}}}% + \else + \gdef\l@drd@ta{\rlap{{\rightlinenumR}}}% + \fi \else - \gdef\l@dld@ta{\llap{{\leftlinenumR}}}% + \@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 \fi @@ -1691,36 +1718,24 @@ \newif\ifinserthangingsymbolR \newcommand{\inserthangingsymbolL}{% -\ifinserthangingsymbol% + \ifinserthangingsymbol% \ifinstanzaL% + \hskip \@ifundefined{sza@0@}{0}{\expandafter% + \noexpand\csname sza@0@\endcsname}\stanzaindentbase% \hangingsymbol% \fi% -\fi} + \fi% +}% \newcommand{\inserthangingsymbolR}{% -\ifinserthangingsymbolR% + \ifinserthangingsymbolR% \ifinstanzaR% + \hskip \@ifundefined{sza@0@}{0}{\expandafter% + \noexpand\csname sza@0@\endcsname}\stanzaindentbase% \hangingsymbol% \fi% -\fi} -\newcommand{\correcthangingL}{% -\ifl@dpaging\else% - \ifinstanzaL% - \ifinserthangingsymbol% - \hskip \@ifundefined{sza@0@}{0}{\expandafter% - \noexpand\csname sza@0@\endcsname}\stanzaindentbase% - \fi% - \fi% -\fi} + \fi% +}% -\newcommand{\correcthangingR}{% -\ifl@dpaging\else% - \ifinstanzaR% - \ifinserthangingsymbolR% - \hskip \@ifundefined{sza@0@}{0}{\expandafter% - \noexpand\csname sza@0@\endcsname}\stanzaindentbase% - \fi% - \fi% -\fi} \chardef\next=\catcode`\& \catcode`\&=\active @@ -2122,67 +2137,67 @@ \newcommand*{\Pages}{% \l@dprintingpagestrue% \eledsection@correcting@skip=-2\baselineskip% line correcting for section titles. - \parledgroup@notespacing@set@correction - \typeout{} - \typeout{*************************** PAGES ***************************} - \ifnum\l@dnumpstartsL=\l@dnumpstartsR\else + \parledgroup@notespacing@set@correction% + \typeout{}% + \typeout{*************************** PAGES ***************************}% + \ifnum\l@dnumpstartsL=\l@dnumpstartsR\else% \led@err@BadLeftRightPstarts{\the\l@dnumpstartsL}{\the\l@dnumpstartsR}% - \fi + \fi% \setlength{\Lcolwidth}{\textwidth}% \setlength{\Rcolwidth}{\textwidth}% - \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 + \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% \let\print@Xnotes\print@Xnotes@forpages% \let\print@notesX\print@notesX@forpages% - \check@pstarts - \loop\if@pstarts - \global\advance\l@dpscL \@ne - \global\advance\l@dpscR \@ne - \getlinesfromparlistL - \getlinesfromparlistR + \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 + \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 + \check@pstarts% + \if@pstarts% + \global\advance\l@dpscL \@ne% + \global\advance\l@dpscR \@ne% \restore@pstartL@pc% \restore@pstartR@pc% - \global\@donereallinesL=\z@ - \global\@donetotallinesL=\z@ - \global\@donereallinesR=\z@ - \global\@donetotallinesR=\z@ - \checkraw@text -{ \loop\ifaraw@text - \checkpageL + \global\@donereallinesL=\z@% + \global\@donetotallinesL=\z@% + \global\@donereallinesR=\z@% + \global\@donetotallinesR=\z@% + \checkraw@text% +{ \loop\ifaraw@text% + \checkpageL% \l@duselanguage{\theledlanguageL}% { \loop\ifl@dsamepage% - \ifdefstring{\@eledsectnotoc}{L}{\ledsectnotoc}{} + \ifdefstring{\@eledsectnotoc}{L}{\ledsectnotoc}{}% \csuse{before@pstartL@\the\l@dpscL}% - \global\csundef{before@pstartL@\the\l@dpscL} - \do@lineL + \global\csundef{before@pstartL@\the\l@dpscL}% + \do@lineL% \xifinlist{\the\l@dpscL}{\eled@sections@@} {\print@eledsectionL}% {}% - \advance\numpagelinesL \@ne - \ifshiftedpstarts + \advance\numpagelinesL \@ne% + \ifshiftedpstarts% \ifdim\ht\l@dleftbox>0pt\hb@xt@% \hsize{\ledstrutL\unhbox\l@dleftbox}% \else% @@ -2193,37 +2208,38 @@ \else% \parledgroup@correction@notespacing{L} \hb@xt@ \hsize{\ledstrutL\unhbox\l@dleftbox}% - \fi + \fi% \get@nextboxL% + \global\l@dskipversenumberfalse% \ifprint@last@after@pendL% \csuse{after@pendL@\the\l@dpscL}% \global\csundef{after@pendL@\the\l@dpscL}% \fi% \checkpageL% - \checkverseL - \checkpbL - \repeat - \ifl@dpagefull + \checkverseL% + \checkpbL% + \repeat% + \ifl@dpagefull% \@writelinesonpageL{\the\numpagelinesL}% - \else + \else% \@writelinesonpageL{1000}% - \fi - \numpagelinesL \z@ - \parledgroup@correction@notespacing@init + \fi% + \numpagelinesL \z@% + \parledgroup@correction@notespacing@init% \clearl@dleftpage }% \checkpageR% \l@duselanguage{\theledlanguageR}% { \loop\ifl@dsamepage% - \initnumbering@sectcountR - \ifdefstring{\@eledsectnotoc}{R}{\ledsectnotoc}{} + \initnumbering@sectcountR% + \ifdefstring{\@eledsectnotoc}{R}{\ledsectnotoc}{}% \csuse{before@pstartR@\the\l@dpscR}% - \global\csundef{before@pstartR@\the\l@dpscR} - \do@lineR - \xifinlist{\the\l@dpscR}{\eled@sectionsR@@} + \global\csundef{before@pstartR@\the\l@dpscR}% + \do@lineR% + \xifinlist{\the\l@dpscR}{\eled@sectionsR@@}% {\print@eledsectionR}% {}% - \advance\numpagelinesR \@ne - \ifshiftedpstarts + \advance\numpagelinesR \@ne% + \ifshiftedpstarts% \ifdim\ht\l@drightbox>0pt\hb@xt@% \hsize{\ledstrutR\unhbox\l@drightbox}% \else% @@ -2232,50 +2248,57 @@ \global\pagetotal=\dimen0% \fi% \else% - \parledgroup@correction@notespacing{R} + \parledgroup@correction@notespacing{R}% \hb@xt@ \hsize{\ledstrutR\unhbox\l@drightbox}% - \fi + \fi% \get@nextboxR% + \global\l@dskipversenumberRfalse% \ifprint@last@after@pendR% \csuse{after@pendR@\the\l@dpscR}% \global\csundef{after@pendR@\the\l@dpscR}% \fi% \checkpageR% - \checkverseR - \checkpbR - \repeat - \ifl@dpagefull + \checkverseR% + \checkpbR% + \repeat% + \ifl@dpagefull% \@writelinesonpageR{\the\numpagelinesR}% - \else + \else% \@writelinesonpageR{1000}% - \fi - \numpagelinesR=\z@ - \parledgroup@correction@notespacing@init - \clearl@drightpage} - \checkraw@text - \ifaraw@text - \getlinesfrompagelistL - \getlinesfrompagelistR + \fi% + \numpagelinesR=\z@% + \parledgroup@correction@notespacing@init% + \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@ - \global\instanzaLfalse - \global\instanzaRfalse + \fi% + \repeat}% + \fi% + \flush@notes% + \flush@notesR% + \endgroup% + \global\l@dpscL=\z@% + \global\l@dpscR=\z@% + \global\l@dnumpstartsL=\z@% + \global\l@dnumpstartsR=\z@% + \global\instanzaLfalse% + \global\instanzaRfalse% \l@dprintingpagesfalse% \finish@Pages@notes%Needed to prevent final notes overlap line number \ignorespaces} \newcommand{\finish@Pages@notes}{% \def\do##1{% + \ifnocritical@% + \newbox\csuse{##1footins} + \fi + \ifnofamiliar@% + \newbox\csuse{footins##1} + \fi \ifvoid\csuse{##1footins}% \ifvoid\csuse{footins##1}\else% \newpage\null% @@ -2539,6 +2562,13 @@ \fi \fi} +\pretocmd{\chapter}{% + \ifl@dprintingpages% + \vbox{}% + \fi% + }% + {}% + {}% \newcommand{\eledsectnotoc}[1]{\xdef\@eledsectnotoc{#1}} \eledsectnotoc{R} \newcommand{\eledsectmark}[1]{\xdef\@eledsectmark{#1}} |