diff options
author | Karl Berry <karl@freefriends.org> | 2015-11-13 22:34:12 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-11-13 22:34:12 +0000 |
commit | c5e0cd049cb657a40e15cef1fddf373161d5615d (patch) | |
tree | ae6c99f7df2f58569060989b2f43ba3fdd71ab5f /Master/texmf-dist/tex/latex | |
parent | 22e97b885e90c0253656b4ca0015e655034b05ad (diff) |
reledmac (13nov15)
git-svn-id: svn://tug.org/texlive/trunk@38840 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/reledmac/reledmac.sty | 602 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/reledmac/reledpar.sty | 109 |
2 files changed, 525 insertions, 186 deletions
diff --git a/Master/texmf-dist/tex/latex/reledmac/reledmac.sty b/Master/texmf-dist/tex/latex/reledmac/reledmac.sty index 82613f160ba..7381db48cee 100644 --- a/Master/texmf-dist/tex/latex/reledmac/reledmac.sty +++ b/Master/texmf-dist/tex/latex/reledmac/reledmac.sty @@ -33,7 +33,7 @@ %% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{reledmac}[2015/10/26 v2.4.1 typeset critical edition]% +\ProvidesPackage{reledmac}[2015/11/13 v2.5.0 typeset critical edition]% \RequirePackage{xkeyval} \newif\ifparledgroup \DeclareOptionX{series}[A,B,C,D,E]{\xdef\default@series{#1}} @@ -191,8 +191,13 @@ \newcommand*{\led@warn@AppLabelOutEdtext}[1]{% \reledmac@warning{\string\applabel\space outside of \string\edtext\space `#1' on page \the\pageno.}}% \newcommand*{\led@warn@RefUndefined}[1]{% + \G@refundefinedtrue% \reledmac@warning{Reference `#1' on page \the\pageno\space undefined. Using `000'.}} +\newcommand*{\led@warn@pairRefUndefined}[1]{% + \G@refundefinedtrue% + \reledmac@warning{Reference `#1:start' and/or `#1:end' on page \the\pageno\space undefined. + Using `??'.}} \newcommand*{\led@warn@NoMarginpars}{% \reledmac@warning{You can't use \string\marginpar\space in numbered text}} \newcommand*{\led@warn@BadSidenotemargin}{% @@ -282,6 +287,7 @@ \newif\ifledRcol \newif\ifledRcol@ \newif\ifnumberingR +\newif\ifXnote@% \newcount\section@num \section@num=0 \let\extensionchars=\empty @@ -582,7 +588,9 @@ \numlabfont\linenumrep{\line@num}% \ifsublines@ \ifnum\subline@num>0\relax - \unskip\fullstop\sublinenumrep{\subline@num}% + \unskip% + \Xsublinesep@side% + \sublinenumrep{\subline@num}% \fi \fi% \egroup% @@ -1035,7 +1043,7 @@ \newwrite\linenum@out \newif\iffirst@linenum@out@ \first@linenum@out@true -\newcommand{\this@line@list@version}{3}% +\newcommand{\this@line@list@version}{5}% \newcommand*{\line@list@stuff}[1]{% \read@linelist{#1}% \iffirst@linenum@out@ @@ -1279,7 +1287,6 @@ \newcommand*{\edfont@info}{\f@encoding/\f@family/\f@series/\f@shape} -\unless\ifnocritical@ \newcommand*{\lemma}[1]{% \global\@lemmacommand@true% \global\renewcommand{\@tag}{% @@ -1290,7 +1297,6 @@ \newcommand{\@lemma}{% \booltrue{lemmacommand@\the\@edtext@level}% }% -\fi \newif\if@lemmacommand@% \newcommand*{\linenum}[1]{% \xdef\@tempa{#1|||||||\noexpand\\\l@d@nums}% @@ -2100,6 +2106,7 @@ \noindent\leavevmode} \newcommand*{\normalfootgroup}[1]{% {\csuse{Xnotefontsize@#1}\noindent\csuse{Xtxtbeforenotes@#1}}% + \csuse{Xbhookgroup@#1}% \unvbox\csname #1footins\endcsname% \hsize=\old@hsize% }% @@ -2126,6 +2133,7 @@ \fi% \setlength{\parindent}{0pt} {\csuse{Xnotefontsize@#1}\csuse{Xtxtbeforenotes@#1}} + \csuse{Xbhookgroup@#1}% \unvbox\csname mp#1footins\endcsname}} \fi \newcommand*{\Xarrangement@paragraph}[1]{% @@ -2151,7 +2159,7 @@ \fi } \providecommand{\footfudgefiddle}{64} -\newcommand*{\para@footsetup}[1]{{\csuse{Xnotefontsize@#1} +\newcommand*{\para@footsetup}[1]{{\csuse{Xbhookgroup@#1}\csuse{Xnotefontsize@#1} \setXnoteswidthliketwocolumns@{#1}% \dimen0=\baselineskip \multiply\dimen0 by 1024 @@ -2235,7 +2243,8 @@ \ifcsstring{Xragged@#1}{R}{\RaggedRight}{}% \makehboxofhboxes \setbox0=\hbox{{\csuse{Xnotefontsize@#1}\csuse{Xtxtbeforenotes@#1}}\unhbox0 \removehboxes}% - \csuse{Xnotefontsize@#1} + \csuse{Xbhookgroup@#1}% + \csuse{Xnotefontsize@#1}% \unhbox0\par% \global\hsize=\old@hsize% }% @@ -2265,7 +2274,8 @@ \ifcsstring{Xragged@#1}{R}{\RaggedRight}{}% \makehboxofhboxes \setbox0=\hbox{{\csuse{Xnotefontsize@#1}\csuse{Xtxtbeforenotes@#1}}\unhbox0 \removehboxes}% - \csuse{Xnotefontsize@#1} + \csuse{Xbhookgroup@#1}% + \csuse{Xnotefontsize@#1}% \unhbox0\par}} \newcommand*{\makehboxofhboxes}{\setbox0=\hbox{}% @@ -2355,7 +2365,7 @@ }}% #3\strut\par\allowbreak} \newcommand*{\threecolfootgroup}[1]{{\csuse{Xnotefontsize@#1}% - \noindent\csuse{Xtxtbeforenotes@#1}}\par% + \noindent\csuse{Xtxtbeforenotes@#1}\csuse{Xbhookgroup@#1}}\par% \splittopskip=\ht\strutbox \expandafter \rigidbalance\csname #1footins\endcsname \thr@@ \splittopskip} @@ -2378,7 +2388,8 @@ \setXnotespositionliketwocolumns@{#1}% \print@Xfootnoterule{#1}% \fi% - {\csuse{Xnotefontsize@#1}\noindent\csuse{Xtxtbeforenotes@#1}}\par + {\csuse{Xnotefontsize@#1}\noindent\csuse{Xtxtbeforenotes@#1}}% + \csuse{Xbhookgroup@#1}\par% \splittopskip=\ht\strutbox \expandafter \rigidbalance\csname mp#1footins\endcsname \thr@@ \splittopskip}} @@ -2430,7 +2441,7 @@ }}% #3\strut\par\allowbreak} \newcommand*{\twocolfootgroup}[1]{{\csuse{Xnotefontsize@#1} - \noindent\csuse{Xtxtbeforenotes@#1}}\par% + \noindent\csuse{Xtxtbeforenotes@#1}\csuse{Xbhookgroup@#1}}\par% \splittopskip=\ht\strutbox \expandafter \rigidbalance\csname #1footins\endcsname \tw@ \splittopskip} @@ -2457,14 +2468,18 @@ \setXnotespositionliketwocolumns@{#1}% \print@Xfootnoterule{#1}% \fi% - {\csuse{Xnotefontsize@#1}\noindent\csuse{Xtxtbeforenotes@#1}}\par + {\csuse{Xnotefontsize@#1}\noindent\csuse{Xtxtbeforenotes@#1}}% + \csuse{Xbhookgroup@#1}\par% \splittopskip=\ht\strutbox \expandafter \rigidbalance\csname mp#1footins\endcsname \tw@ \splittopskip}} \def\endashchar{\textnormal{--}} + \newcommand*{\fullstop}{\textnormal{.}} +\def\Xsublinesep@side{\fullstop} + \newcommand*{\rbracket}{\textnormal{% \csuse{text\csuse{footnote@lang}}{% \ifluatex% @@ -2487,15 +2502,12 @@ }% } \newcommand{\printlinefootnote}[2]{% - \def\extractline@##1|##2|##3|##4|##5|##6|##7|{##2}% - \def\extractsubline@##1|##2|##3|##4|##5|##6|##7|{##3}% - \def\extractendline@##1|##2|##3|##4|##5|##6|##7|{##5}% - \def\extractendsubline@##1|##2|##3|##4|##5|##6|##7|{##6}% + \l@dp@rsefootspec#1|% \iftoggle{Xnumberonlyfirstintwolines@#2}{% - \edef\lineinfo@{\extractline@ #1| - \extractsubline@ #1| - \extractendline@ #1| - \extractendsubline@ #1|}% + \edef\lineinfo@{\l@dparsedstartline - \l@dparsedstartsub - \l@dparsedendline - \l@dparsedendsub}% }% {% - \edef\lineinfo@{\extractline@ #1| - \extractsubline@ #1|}% + \edef\lineinfo@{\l@dparsedstartline - \l@dparsedstartsub}% }% \iftoggle{nonum@}{%Try if the line number must printed for this specific not (by default, yes) \hspace{\csuse{Xinplaceofnumber@#2}}% @@ -2577,7 +2589,9 @@ \csuse{Xstanzaseparator@#2}% \fi% }{}% - \iftoggle{Xonlypstart@#2}{}{\printlines#1|}% + \iftoggle{Xonlypstart@#2}{}{% + \csuse{Xtxtbeforenumber@#2}% + \printlines#1||\ifledRcol@\@Rlineflag\fi}% }% \newcommand{\printXbeforenumber}[1]{% \hspace{\csuse{Xbeforenumber@#1}}% @@ -2593,7 +2607,6 @@ \newif\ifl@d@dash \newif\ifl@d@Xtwolines% \newif\ifl@d@Xmorethantwolines% -\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}% @@ -2689,7 +2702,7 @@ \fi% }% }% -\def\printlines#1|#2|#3|#4|#5|#6|#7|{% +\def\printlines#1|#2|#3|#4|#5|#6|#7|#8|{% \begingroup% \ifluatex% \edef\@tmp{\the\textdir}% @@ -2699,9 +2712,14 @@ \ifdimequal{\csuse{Xboxstartlinenum@\@currentseries}}{0pt}% {\bgroup}% {\leavevmode\hbox to \csuse{Xboxstartlinenum@\@currentseries}\bgroup\hfill}% - \ifl@d@pnum #1\fullstop\fi - \linenumrep{#2} - \ifl@d@ssub \fullstop \sublinenumrep{#3}\fi + \ifl@d@pnum #1% + \csuse{Xsublinesep@\@currentseries}% + \fi% + \linenumrep{#2}\iftoggle{Xlineflag@\@currentseries}{#8}{}% + \ifl@d@ssub% + \csuse{Xsublinesep@\@currentseries}% + \sublinenumrep{#3}% + \fi \egroup% \ifdimequal{\csuse{Xboxendlinenum@\@currentseries}}{0pt}% {\bgroup}% @@ -2720,9 +2738,17 @@ \csuse{Xlinerangeseparator@\@currentseries}% \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@pnum% + #4% + \csuse{Xsublinesep@\@currentseries}% + \fi% + \ifl@d@elin \linenumrep{#5}\iftoggle{Xlineflag@\@currentseries}{#8}{}\fi% + \ifl@d@esl% + \ifl@d@elin% + \csuse{Xsublinesep@\@currentseries}% + \fi% + \sublinenumrep{#6}% + \fi% \fi% \ifdimequal{\csuse{Xboxendlinenum@\@currentseries}}{0pt}% {}% @@ -2768,23 +2794,54 @@ }{}{} \apptocmd{\@footnotetext}{\fi}{}{}% +\patchcmd% + {\footnote}% + {\stepcounter\@mpfn}% + {% + \ifl@dpairing% + \global\advance\footnote@reading by \@ne% + \ifcsdef{footnotereading\the\footnote@reading=typeset}% + {\setcounter{\@mpfn}{\csuse{footnotereading\the\footnote@reading=typeset}}}% + {\setcounter{\@mpfn}{\footnote@reading}}% + \else% + \stepcounter\@mpfn% + \fi% + }% + {} + {} \newcommand{\l@dbfnote}[1]{% \ifnumberedpar@ + \ifl@dpairing + \protected@xdef\thisfootnote{\the\footnote@reading}% + \else% + \protected@xdef\thisfootnote{\thefootnote}% + \fi% \gdef\@tag{#1\relax}% \ifledRcol% - \xright@appenditem{\noexpand\vl@dbfnote{{\expandonce\@tag}}{\@thefnmark}}% + \xright@appenditem{\noexpand\vl@dbfnote{{\expandonce\@tag}}{\thisfootnote}}% \to\inserts@listR \global\advance\insert@countR \@ne% \else% - \xright@appenditem{\noexpand\vl@dbfnote{{\expandonce\@tag}}{\@thefnmark}}% + \xright@appenditem{\noexpand\vl@dbfnote{{\expandonce\@tag}}{\thisfootnote}}% \to\inserts@list \global\advance\insert@count \@ne% \fi \fi\ignorespaces} \newcommand{\vl@dbfnote}[2]{% - \def\@thefnmark{#2}% - \@footnotetext{#1}% + \ifboolexpr{bool{l@dprintingpages} or bool{l@dprintingcolumns}}% + {% + \global\advance\footnote@typeset by \@ne% + \setcounter{footnote}{\footnote@typeset}% + \immediate\write\@mainaux{% + \global\csdef{footnotereading#2=typeset}{\the\footnote@typeset}% + }% + \def\@thefnmark{\the\footnote@typeset}% + }% + {% + \@namedef{@thefnmark}{#2}% + }% + \@footnotetext{#1}% }% \newcommand*{\prebodyfootmark}{% \leavevmode @@ -2880,6 +2937,7 @@ \let\normalfootnoteruleX=\footnoterule \newcommand*{\normalfootgroupX}[1]{% + \csuse{bhookgroupX@#1}% \unvbox\@nameuse{footins#1}% \hsize=\old@hsize% }% @@ -2903,11 +2961,17 @@ \setnotesXpositionliketwocolumns@{#1}% \print@footnoteXrule{#1}% \fi% + \csuse{bhookgroupX@#1}% \unvbox\@nameuse{mpfootins#1}} \newcommand{\normalbfnoteX}[2]{% \ifnumberedpar@ + \ifl@dpairing + \protected@xdef\thisfootnote{\the\csname footnote#1@reading\endcsname}% + \else% + \protected@xdef\thisfootnote{\csuse{thefootnote#1}}% + \fi% \ifledRcol% \ifluatex \footnotelang@lua[R]% @@ -2915,7 +2979,6 @@ \@ifundefined{xpg@main@language}%if polyglossia {}% {\footnotelang@poly[R]}% - \protected@xdef\thisfootnote{\csuse{thefootnote#1}}% \xright@appenditem{\noexpand\vbfnoteX{#1}{#2}{\expandonce\thisfootnote}}% \to\inserts@listR \global\advance\insert@countR \@ne% @@ -2926,7 +2989,6 @@ \@ifundefined{xpg@main@language}%if polyglossia {}% {\footnotelang@poly}% - \protected@xdef\thisfootnote{\csuse{thefootnote#1}}% \xright@appenditem{\noexpand\vbfnoteX{#1}{#2}{\expandonce\thisfootnote}}% \to\inserts@list \global\advance\insert@count \@ne% @@ -2934,8 +2996,20 @@ \fi\ignorespaces} \newcommand{\vbfnoteX}[3]{% - \@namedef{@thefnmark#1}{#3}% - \@nameuse{regvfootnote#1}{#1}{#2}} + \ifboolexpr{bool{l@dprintingpages} or bool{l@dprintingcolumns}}% + {% + \global\expandafter\advance\csname footnote#1@typeset\endcsname by \@ne% + \setcounter{footnote#1}{\csuse{footnote#1@typeset}}% + \@namedef{@thefnmark#1}{\csuse{thefootnote#1}}% + \immediate\write\@mainaux{% + \global\csdef{footnote#1reading#3=typeset}{\the\csname footnote#1@typeset\endcsname}% + }% + }% + {% + \@namedef{@thefnmark#1}{#3}% + }% + \@nameuse{regvfootnote#1}{#1}{#2}% +} \newcommand{\vnumfootnoteX}[2]{% \ifnumberedpar@ @@ -3022,10 +3096,11 @@ {\csuse{notenumfontX@#1}\@nameuse{footfootmark#1}\strut% #2\strut\par}\allowbreak} -\newcommand*{\twocolfootgroupX}[1]{{\csuse{notefontsizeX@#1} +\newcommand*{\twocolfootgroupX}[1]{{\csuse{bhookgroupX@#1}\csuse{notefontsizeX@#1} \splittopskip=\ht\strutbox \expandafter \rigidbalance\csname footins#1\endcsname \tw@ \splittopskip}} + \newcommand*{\mptwocolfootgroupX}[1]{{% \vskip\skip\@nameuse{mpfootins#1} \ifl@dpairing\ifparledgroup% @@ -3045,6 +3120,7 @@ \setnotesXpositionliketwocolumns@{#1}% \print@footnoteXrule{#1}% \fi% + \csuse{bhookgroupX@#1}% \splittopskip=\ht\strutbox \expandafter \rigidbalance\csname mpfootins#1\endcsname \tw@ \splittopskip}} @@ -3099,10 +3175,11 @@ {\csuse{notenumfontX@#1}\@nameuse{footfootmark#1}\strut% #2\strut\par}\allowbreak} -\newcommand*{\threecolfootgroupX}[1]{{\csuse{notefontsizeX@#1} +\newcommand*{\threecolfootgroupX}[1]{{\csuse{bhookgroupX@#1}\csuse{notefontsizeX@#1} \splittopskip=\ht\strutbox \expandafter \rigidbalance\csname footins#1\endcsname \thr@@ \splittopskip}} + \newcommand*{\mpthreecolfootgroupX}[1]{{% \vskip\skip\@nameuse{mpfootins#1} \ifl@dpairing\ifparledgroup @@ -3122,6 +3199,7 @@ \setnotesXpositionliketwocolumns@{#1}% \print@footnoteXrule{#1}% \fi% + \csuse{bhookgroupX@#1}% \splittopskip=\ht\strutbox \expandafter \rigidbalance\csname mpfootins#1\endcsname \thr@@ \splittopskip}} @@ -3150,7 +3228,7 @@ \fi } -\newcommand*{\para@footsetupX}[1]{{\csuse{notefontsizeX@#1} +\newcommand*{\para@footsetupX}[1]{{\csuse{bhookgroupX@#1}\csuse{notefontsizeX@#1} \setnoteswidthliketwocolumnsX@{#1}% \dimen0=\baselineskip \multiply\dimen0 by 1024 @@ -3236,8 +3314,10 @@ \ifcsstring{raggedX@#1}{R}{\RaggedRight}{}% \makehboxofhboxes \setbox0=\hbox{\unhbox0 \removehboxes}% + \csuse{bhookgroupX@#1} \csuse{notefontsizeX@#1} \unhbox0\par} + \newcommand*{\mppara@footgroupX}[1]{{% \setnoteswidthliketwocolumnsX@{#1}% \vskip\skip\@nameuse{mpfootins#1} @@ -3264,6 +3344,7 @@ \ifcsstring{raggedX@#1}{R}{\RaggedRight}{}% \makehboxofhboxes \setbox0=\hbox{\unhbox0 \removehboxes}% + \csuse{bhookgroupX@#1}% \csuse{notefontsizeX@#1} \unhbox0\par}} @@ -3425,7 +3506,7 @@ \dolistloop{\@series}% }% -\global\notbool{parapparatus@}{}{\long}\def\endprint#1#2#3#4#5{{% +\global\notbool{parapparatus@}{}{\long}\def\endprint#1#2#3#4#5#6{{% \hangindent=\csuse{Xendhangindent@#4}% \ifXendinsertsep@% \hskip\csuse{Xendafternote@#4}% @@ -3442,7 +3523,9 @@ \notblank{#5}{\docsvlist{#5}}{}% \csuse{Xendbhooknote@#4}% \csuse{Xendnotefontsize@#4}% + \IfStrEq{#6}{R}{\ledRcol@true}{}% \printlineendnote{#1}{#4}% + \IfStrEq{#6}{R}{\ledRcol@false}{}% \nottoggle{Xendlemmadisablefontselection@#4}% {\select@lemmafont#1|#2}% {#2}% @@ -3513,18 +3596,42 @@ \bgroup% \csuse{Xendnotenumfont@#2}% \ifdimequal{\csuse{Xendboxlinenum@#2}}{0pt}% - {\printendlines#1|}% + {\printendlines#1||\ifledRcol@\@Rlineflag\fi}% {\leavevmode% \hbox to \csuse{Xendboxlinenum@#2}% {% \IfSubStr{RC}{\csuse{Xendboxlinenumalign@#2}}{\hfill}{}% - \printendlines#1|% + \printendlines#1||\ifledRcol@\@Rlineflag\fi% \IfSubStr{LC}{\csuse{Xendboxlinenumalign@#2}}{\hfill}{}% }}% \egroup% \hspace{\csuse{Xendafternumber@#2}}% \csuse{Xendahooklinenumber@#2}% }% +\newif\ifXendinsertsep@% +\newcommand*{\doendnotes}[1]{% + \l@dend@close{#1}% + \begingroup + \makeatletter + \expandafter\let\csname #1end\endcsname=\endprint + \input\jobname.#1end% + \global\Xendinsertsep@false% + \endgroup} +\newcommand*{\doendnotesbysection}[1]{% + \l@dend@close{#1}% + \global\expandafter\advance\csname #1end@bysection\endcsname by 1% + \begingroup% + \makeatletter% + \def\l@d@section##1{% + \ifnumequal{##1}{\csname #1end@bysection\endcsname}% + {\cslet{#1end}{\endprint}}% + {\cslet{#1end}{\@gobblefive}}% + }% + \input\jobname.#1end% + \global\Xendinsertsep@false% + \endgroup% +}% +}% \newcommand*{\setprintendlines}[6]{% \l@d@pnumfalse \l@d@dashfalse \ifnum#4=#1 \else @@ -3584,14 +3691,28 @@ }% \fi% }% -\def\printendlines#1|#2|#3|#4|#5|#6|#7|{\begingroup +\def\printendlines#1|#2|#3|#4|#5|#6|#7|#8|{\begingroup \setprintendlines{#1}{#2}{#3}{#4}{#5}{#6}% \ifdimequal{\csuse{Xendboxstartlinenum@\@currentseries}}{0pt}% {\bgroup}% {\leavevmode\hbox to \csuse{Xendboxstartlinenum@\@currentseries}\bgroup\hfill}% \printnpnum{#1}% - \linenumrep{#2}% - \ifl@d@ssub \fullstop \sublinenumrep{#3}\fi + \ifl@d@dash% + \ifl@d@pnum% + \csuse{Xendlineprefixsingle@\@currentseries}% + \else% + \ifcsempty{Xendlineprefixmore@\@currentseries}% + {\csuse{Xendlineprefixsingle@\@currentseries}} + {\csuse{Xendlineprefixmore@\@currentseries}}% + \fi% + \else% + \csuse{Xendlineprefixsingle@\@currentseries}% + \fi% + \linenumrep{#2}\iftoggle{Xendlineflag@\@currentseries}{\ifledRcol@\@Rlineflag\fi}{}% + \ifl@d@ssub% + \csuse{Xendsublinesep@\@currentseries}% + \sublinenumrep{#3}% + \fi% \egroup% \ifdimequal{\csuse{Xendboxendlinenum@\@currentseries}}{0pt}% {\bgroup}% @@ -3611,8 +3732,17 @@ \fi% \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@elin% + \ifl@d@pnum\csuse{Xendlineprefixsingle@\@currentseries}\fi% + \linenumrep{#5}% + \iftoggle{Xendlineflag@\@currentseries}{\ifledRcol@\@Rlineflag\fi}{}% + \fi% + \ifl@d@esl% + \ifl@d@elin% + \csuse{Xendsublinesep@\@currentseries}% + \fi% + \sublinenumrep{#6}% + \fi% \fi% \ifdimequal{\csuse{Xendboxendlinenum@\@currentseries}}{0pt}% {}% @@ -3621,32 +3751,8 @@ \endgroup% }% -\newcommand*{\printnpnum}[1]{p.#1) } +\newcommand*{\printnpnum}[1]{\csuse{Xendbeforepagenumber@\@currentseries}#1\csuse{Xendafterpagenumber@\@currentseries}} -\newif\ifXendinsertsep@% -\newcommand*{\doendnotes}[1]{% - \l@dend@close{#1}% - \begingroup - \makeatletter - \expandafter\let\csname #1end\endcsname=\endprint - \input\jobname.#1end% - \global\Xendinsertsep@false% - \endgroup} -\newcommand*{\doendnotesbysection}[1]{% - \l@dend@close{#1}% - \global\expandafter\advance\csname #1end@bysection\endcsname by 1% - \begingroup% - \makeatletter% - \def\l@d@section##1{% - \ifnumequal{##1}{\csname #1end@bysection\endcsname}% - {\cslet{#1end}{\endprint}}% - {\cslet{#1end}{\@gobblefive}}% - }% - \input\jobname.#1end% - \global\Xendinsertsep@false% - \endgroup% -}% -}% \newcommand{\newseries}[1]{% \def\do##1{\newseries@{##1}}% \docsvlist{#1} @@ -3659,6 +3765,7 @@ \newseries@par{#1}% \fi% \unless\ifnocritical@ + \newtoggle{Xlineflag@#1} \newtoggle{Xparindent@#1} \newtoggle{Xlemmadisablefontselection@#1} \csgdef{Xhangindent@#1}{0pt}% @@ -3669,6 +3776,7 @@ \csgdef{Xnotenumfont@#1}{\normalfont}% \csgdef{Xnotefontsize@#1}{\footnotesize}% \csgdef{Xbhooknote@#1}{}% + \csgdef{Xbhookgroup@#1}{}% \csgdef{Xboxlinenum@#1}{0pt}% \csgdef{Xboxlinenumalign@#1}{L}% @@ -3681,6 +3789,7 @@ \newtoggle{Xnumberonlyfirstintwolines@#1}% \csgdef{Xtwolines@#1}{}% \csgdef{Xmorethantwolines@#1}{}% + \csgdef{Xsublinesep@#1}{\fullstop}% \newtoggle{Xtwolinesbutnotmore@#1}% \newtoggle{Xtwolinesonlyinsamepage@#1}% \newtoggle{Xonlypstart@#1}% @@ -3691,6 +3800,7 @@ \csgdef{Xsymlinenum@#1}{}% \newtoggle{Xnonumber@#1}% \csgdef{Xbeforenumber@#1}{0pt}% + \csgdef{Xtxtbeforenumber@#1}{}% \csgdef{Xafternumber@#1}{0.5em}% \newtoggle{Xnonbreakableafternumber@#1}% \csgdef{Xbeforesymlinenum@#1}{\csuse{Xbeforenumber@#1}}% @@ -3726,12 +3836,14 @@ {\footnotelang@poly[R]}% \footnoteoptions@{R}{##1}{true}% \xright@appenditem{% + \noexpand\Xnote@true% \noexpand\prepare@preXnotes{#1}% \noexpand\prepare@edindex@fornote{\l@d@nums}% \unexpanded{\def\sw@list@inedtext}{\expandafter\unexpanded\expandafter{\sw@inthisedtext}}%The value of the \sw@inthisedtext of current \edtext will be pushed to \sw@list@inedtext when the notes are expanded. \noexpand\setcounter{stanzaR}{\the\c@stanzaR}%Save stanzaR counter for footnote \noexpand\csuse{v#1footnote}{#1}% {{\l@d@nums}{\expandonce\@tag}{\expandonce\content}}% + \noexpand\Xnote@false% }\to\inserts@listR \footnoteoptions@{R}{##1}{false}% \global\advance\insert@countR \@ne% @@ -3744,6 +3856,7 @@ {\footnotelang@poly}% \footnoteoptions@{L}{##1}{true}% \xright@appenditem{% + \noexpand\Xnote@true% \noexpand\prepare@preXnotes{#1}% \noexpand\prepare@edindex@fornote{\l@d@nums}% \unexpanded{\def\sw@list@inedtext}{\expandafter\unexpanded\expandafter{\sw@inthisedtext}}%The value of the \sw@inthisedtext of current edtext will be pushed to \sw@list@inedtext when the notes are expanded. @@ -3752,6 +3865,7 @@ \fi% \noexpand\csuse{v#1footnote}{#1}% {{\l@d@nums}{\expandonce\@tag}{\expandonce\content}}% + \noexpand\Xnote@false% }\to\inserts@list \global\advance\insert@count \@ne% \footnoteoptions@{L}{##1}{false}% @@ -3778,6 +3892,7 @@ \csgdef{notenumfontX@#1}{\normalfont}% \csgdef{notefontsizeX@#1}{\footnotesize}% \csgdef{bhooknoteX@#1}{}% + \csgdef{bhookgroupX@#1}{}% \csgdef{afterruleX@#1}{0pt} \csgdef{beforenotesX@#1}{1.2em \@plus .6em \@minus .6em} \csgdef{maxhnotesX@#1}{0.8\vsize}% @@ -3793,7 +3908,14 @@ \begingroup% \prepare@prenotesX{#1}% \newcommand{\content}{##1}% - \stepcounter{footnote#1}% + \ifl@dpairing% + \global\expandafter\advance\csname footnote#1@reading\endcsname by \@ne + \ifcsdef{footnote#1reading\the\csname footnote#1@reading\endcsname=typeset}% + {\setcounter{footnote#1}{\csuse{footnote#1reading\the\csname footnote#1@reading\endcsname=typeset}}}% + {\setcounter{footnote#1}{\the\csname footnote#1@reading\endcsname}}% + \else% + \stepcounter{footnote#1}% + \fi% \protected@csxdef{@thefnmark#1}{\csuse{thefootnote#1}}% \nottoggle{nomk@}%Nomk is set to true when using \footnoteXnomk with \parpackage {\csuse{@footnotemark#1}}% @@ -3807,8 +3929,8 @@ } \newcounter{footnote#1} \global\expandafter\renewcommand\csname thefootnote#1\endcsname{\arabic{footnote#1}} -\arrangementX@normal{#1}% - \fi + \arrangementX@normal{#1}% + \fi \unless\ifnoend@ \expandafter\newwrite\csname l@d@#1end\endcsname% \expandafter\newif\csname ifl@dend@#1\endcsname% @@ -3825,6 +3947,7 @@ {\expandonce\content}% {#1}% {\unexpanded{##1}}% + {\ifledRcol R\else L\fi} \@percentchar% }% \egroup% @@ -3842,6 +3965,8 @@ \csgdef{Xendnotefontsize@#1}{\footnotesize}% \csgdef{Xendbhooknote@#1}{}% + \csgdef{Xendsublinesep@#1}{\fullstop}% + \csgdef{Xendbeforenumber@#1}{0pt} \csgdef{Xendafternumber@#1}{0.5em} @@ -3878,6 +4003,13 @@ \csgdef{Xendehookinplaceofnumber@#1}{}% \csgdef{Xendlinerangeseparator@#1}{\endashchar}% + + \csgdef{Xendbeforepagenumber@#1}{p.}% + \csgdef{Xendafterpagenumber@#1}{) }% + \csgdef{Xendlineprefixsingle@#1}{}% + \csgdef{Xendlineprefixmore@#1}{}% + + \newtoggle{Xendlineflag@#1} \fi% \listxadd{\@series}{#1} } @@ -3992,9 +4124,11 @@ \newhookcommand@series{Xcolalign}% \newhookcommand@series{Xnotenumfont} \newhookcommand@series{Xbhooknote} + \newhookcommand@series@reload{Xbhookgroup}{critical} \newhookcommand@series{Xboxsymlinenum}% \newhookcommand@series{Xsymlinenum} \newhookcommand@series{Xbeforenumber} + \newhookcommand@series{Xtxtbeforenumber} \newhookcommand@series{Xafternumber} \newhookcommand@series{Xbeforesymlinenum} \newhookcommand@series{Xaftersymlinenum} @@ -4020,7 +4154,7 @@ \newhookcommand@series@reload{Xmaxhnotes}{critical} \newhookcommand@series@reload{Xbeforenotes}{critical} \newhooktoggle@series@reload{Xnoteswidthliketwocolumns}{critical}% - \newhookcommand@series{Xnotefontsize} + \newhookcommand@series@reload{Xnotefontsize}{critical} \newhookcommand@series{Xboxlinenum}% \newhookcommand@series{Xboxlinenumalign}% @@ -4032,11 +4166,13 @@ \newhookcommand@series{Xparafootsep} \fi -\newhookcommand@series{Xtwolines}[appref] -\newhookcommand@series{Xmorethantwolines}[appref] -\newhooktoggle@series{Xtwolinesbutnotmore}[appref] -\newhooktoggle@series{Xtwolinesonlyinsamepage}[appref] -\newhookcommand@series{Xlinerangeseparator}[appref] +\newhooktoggle@series{Xlineflag}[appref,SEref] +\newhookcommand@series{Xtwolines}[appref,SEref] +\newhookcommand@series{Xmorethantwolines}[appref,SEref] +\newhookcommand@series{Xsublinesep}[appref,SEref,side] +\newhooktoggle@series{Xtwolinesbutnotmore}[appref,SEref] +\newhooktoggle@series{Xtwolinesonlyinsamepage}[appref,SEref] +\newhookcommand@series{Xlinerangeseparator}[appref,SEref] \unless\ifnofamiliar@ \newhooktoggle@series{parindentX} \newhookcommand@series{hangindentX} @@ -4046,11 +4182,12 @@ \newhookcommand@series{colalignX}% \newhookcommand@series{notenumfontX} \newhookcommand@series{bhooknoteX} + \newhookcommand@series@reload{bhookgroupX}{familiar} \newhookcommand@series@reload{beforenotesX}{familiar} \newhookcommand@series@reload{maxhnotesX}{familiar} \newhooktoggle@series@reload{noteswidthliketwocolumnsX}{familiar}% \newhookcommand@series@reload{afterruleX}{familiar} - \newhookcommand@series{notefontsizeX} + \newhookcommand@series@reload{notefontsizeX}{familiar} \newhookcommand@series{afternoteX} \newhookcommand@series{parafootsepX} \fi @@ -4097,11 +4234,18 @@ \newhookcommand@series{Xendhangindent}% \fi -\newhookcommand@series{Xendtwolines}[apprefwithpage] -\newhookcommand@series{Xendmorethantwolines}[apprefwithpage] -\newhooktoggle@series{Xendtwolinesbutnotmore}[apprefwithpage] -\newhooktoggle@series{Xendtwolinesonlyinsamepage}[apprefwithpage] -\newhookcommand@series{Xendlinerangeseparator}[apprefwithpage] +\newhooktoggle@series{Xendlineflag}[apprefwithpage,SErefwithpage] +\newhookcommand@series{Xendtwolines}[apprefwithpage,SErefwithpage] +\newhookcommand@series{Xendmorethantwolines}[apprefwithpage,SErefwithpage] +\newhooktoggle@series{Xendtwolinesbutnotmore}[apprefwithpage,SErefwithpage] +\newhooktoggle@series{Xendtwolinesonlyinsamepage}[apprefwithpage,SErefwithpage] +\newhookcommand@series{Xendlinerangeseparator}[apprefwithpage,SErefwithpage] +\newhookcommand@series{Xendbeforepagenumber}[apprefwithpage,SErefwithpage,SErefonlypage] +\newhookcommand@series{Xendafterpagenumber}[apprefwithpage,SErefwithpagem,SErefonlypage] +\newhookcommand@series{Xendlineprefixsingle}[apprefwithpage,SErefwithpage] +\newhookcommand@series{Xendlineprefixmore}[apprefwithpage,SErefwithpage] +\newhookcommand@series{Xendsublinesep}[apprefwithpage,SErefwithpage] + \newcommand{\newhooktoggle@specific}[1]{% \newtoggle{#1@}% \define@key[mac]{truefootnoteoption}{#1}[]{\global\settoggle{#1@}{true}}%When enabling footnote option @@ -4288,39 +4432,50 @@ \list@create{\labelref@list} \newcommand*{\zz@@@}{000|000} % set two counters to zero in one go - \newcommand*{\edlabel}[1]{% \ifl@dpairing\ifautopar% \strut% \fi\fi% \@bsphack% - \ifledRcol% - \write\linenum@outR{\string\@lab}% - \ifx\labelref@listR\empty% - \xdef\label@refs{\zz@@@}% + \ifboolexpr{bool{ledRcol} or bool{ledRcol@}}{% + \ifXnote@% + \protected@write\@auxout{}% + {\string\l@dmake@labelsR\space\thepage|\l@dparsedstartline|\l@dparsedstartsub|\the\c@pstartR|{#1}}% + \ifdef{\hypertarget}{\Hy@raisedlink{\hypertarget{#1}{}}}{}% \else% - \gl@p\labelref@listR\to\label@refs% - \fi% - \ifvmode% - \advancelabel@refs% + \write\linenum@outR{\string\@lab}% + \ifx\labelref@listR\empty% + \xdef\label@refs{\zz@@@}% + \else% + \gl@p\labelref@listR\to\label@refs% + \fi% + \ifvmode% + \advancelabel@refs% + \fi% + \protected@write\@auxout{}% + {\string\l@dmake@labelsR\space\thepage|\label@refs|\the\c@pstartR|{#1}}% + \ifdef{\hypertarget}{\Hy@raisedlink{\hypertarget{#1}{}}}{}% \fi% - \protected@write\@auxout{}% - {\string\l@dmake@labelsR\space\thepage|\label@refs|\the\c@pstartR|{#1}}% - \ifdef{\hypertarget}{\Hy@raisedlink{\hypertarget{#1}{}}}{}% - \else% - \write\linenum@out{\string\@lab}% - \ifx\labelref@list\empty% - \xdef\label@refs{\zz@@@}% + }{% + \ifXnote@% + \protected@write\@auxout{}% + {\string\l@dmake@labels\space\thepage|\l@dparsedstartline|\l@dparsedstartsub|\the\c@pstart|{#1}}% + \ifdef{\hypertarget}{\Hy@raisedlink{\hypertarget{#1}{}}}{}% \else% - \gl@p\labelref@list\to\label@refs% - \fi% - \ifvmode% - \advancelabel@refs% + \write\linenum@out{\string\@lab}% + \ifx\labelref@list\empty% + \xdef\label@refs{\zz@@@}% + \else% + \gl@p\labelref@list\to\label@refs% + \fi% + \ifvmode% + \advancelabel@refs% + \fi% + \protected@write\@auxout{}% + {\string\l@dmake@labels\space\thepage|\label@refs|\the\c@pstart|{#1}}% + \ifdef{\hypertarget}{\Hy@raisedlink{\hypertarget{#1}{}}}{}% \fi% - \protected@write\@auxout{}% - {\string\l@dmake@labels\space\thepage|\label@refs|\the\c@pstart|{#1}}% - \ifdef{\hypertarget}{\Hy@raisedlink{\hypertarget{#1}{}}}{}% - \fi% + }% \@esphack}% \newcounter{line}% @@ -4343,7 +4498,7 @@ \expandafter\ifx\csname the@label#5\endcsname \relax\else \led@warn@DuplicateLabel{#5}% \fi - \expandafter\gdef\csname the@label#5\endcsname{#1|#2|#3|#4}% + \expandafter\gdef\csname the@label#5\endcsname{#1|#2|#3|#4|\relax}% \ignorespaces} \AtBeginDocument{% @@ -4389,6 +4544,16 @@ \led@warn@AppLabelOutEdtext{#1}% \fi% }% +\newcommand{\edlabelS}[1]{% + \edlabel{#1:start}% +} +\newcommand{\edlabelE}[1]{% + \edlabel{#1:end}% +} +\newcommand{\edlabelSE}[1]{% + \edlabelS{#1}% + \edlabelE{#1}% +} \newrobustcmd{\wrap@edcrossref}[2]{% \ifdef{\hyperlink}% {\hyperlink{#1}{#2}}% @@ -4397,7 +4562,7 @@ \newcommand*{\edpageref}[1]{\l@dref@undefined{#1}\wrap@edcrossref{#1}{\l@dgetref@num{1}{#1}}} \newcommand*{\xpageref}[1]{\l@dgetref@num{1}{#1}} -\newcommand*{\edlineref}[1]{\l@dref@undefined{#1}\wrap@edcrossref{#1}{\l@dgetref@num{2}{#1}}}% +\newcommand*{\edlineref}[1]{\l@dref@undefined{#1}\wrap@edcrossref{#1}{\l@dgetref@num{2}{#1}\xflagref{#1}}}% \newcommand*{\xlineref}[1]{\l@dgetref@num{2}{#1}}% \newcommand*{\sublineref}[1]{\l@dref@undefined{#1}\wrap@edcrossref{#1}{\l@dgetref@num{3}{#1}}} @@ -4406,6 +4571,7 @@ \newcommand*{\pstartref}[1]{\l@dref@undefined{#1}\wrap@edcrossref{#1}{\l@dgetref@num{4}{#1}}} \newcommand*{\xpstartref}[1]{\l@dgetref@num{4}{#1}} +\newcommand*{\xflagref}[1]{\l@dgetref@num{5}{#1}} \newcommand*{\l@dref@undefined}[1]{% \expandafter\ifx\csname the@label#1\endcsname\relax \led@warn@RefUndefined{#1}% @@ -4421,12 +4587,13 @@ \fi} \newcommand*{\l@dlabel@parse}{} -\def\l@dlabel@parse#1|#2|#3|#4|#5{% - \ifcase #5% +\def\l@dlabel@parse#1|#2|#3|#4|#5|#6{% + \ifcase #6% \or #1% \or #2% \or #3% \or #4% + \or #5% \fi} \newcommand*{\xxref}[2]{% {% @@ -4440,69 +4607,189 @@ \else% \expandafter\def\csname the@@label#2\endcsname{\l@dgetref@num{1}{#2}|\l@dgetref@num{2}{#2}|\l@dgetref@num{3}{#2}}% \fi% - \ifdefined\@Rlineflag% - \StrDel{\csuse{the@@label#1}}{\@Rlineflag}[\@tempa]% - \StrDel{\csuse{the@@label#2}}{\@Rlineflag}[\@tempb]% - \else% \letcs{\@tempa}{the@@label#1}% \letcs{\@tempb}{the@@label#2}% - \fi% \linenum{\@tempa|% \@tempb}}}% \def\Xtwolines@appref{}% +\def\Xtwolines@SEref{}% + \def\Xmorethantwolines@appref{}% +\def\Xmorethantwolines@SEref{}% + \def\Xlinerangeseparator@appref{\endashchar}% +\def\Xlinerangeseparator@SEref{\endashchar}% + +\def\Xsublinesep@appref{\fullstop}% +\def\Xsublinesep@SEref{\fullstop}% + \newtoggle{Xtwolinesbutnotmore@appref}% +\newtoggle{Xtwolinesbutnotmore@SEref}% + \newtoggle{Xtwolinesonlyinsamepage@appref}% +\newtoggle{Xtwolinesonlyinsamepage@SEref}% + +\newtoggle{Xlineflag@appref}% +\toggletrue{Xlineflag@appref}%Here exception +\newtoggle{Xlineflag@SEref}% +\toggletrue{Xlineflag@SEref}%%Here exception + \def\Xendtwolines@apprefwithpage{}% +\def\Xendtwolines@SEwithpage{}% + \def\Xendmorethantwolines@apprefwithpage{}% -\def\Xendlinerangeseparator@apprefwithpage{\endashchar}% +\def\Xendmorethantwolines@SErefwithpage{}% + +\def\Xendlinerangeseparator@apprefwithpage{\endashchar} +\def\Xendlinerangeseparator@SErefwithpage{\endashchar} + +\def\Xendbeforepagenumber@apprefwithpage{p.}% +\def\Xendbeforepagenumber@SErefwithpage{p.}% +\def\Xendbeforepagenumber@SEonlypage{p.}% + +\def\Xendafterpagenumber@apprefwithpage{) }% +\def\Xendafterpagenumber@SErefwithpage{) }% +\def\Xendafterpagenumber@SErefonlypage{) }% + +\def\Xendlineprefixsingle@apprefwithpage{}% +\def\Xendlineprefixsingle@SErefwithpage{}% + +\def\Xendlineprefixmore@apprefwithpage{}% +\def\Xendlineprefixmore@SErefwithpage{}% + \newtoggle{Xendtwolinesbutnotmore@apprefwithpage}% +\newtoggle{Xendtwolinesbutnotmore@SErefwithpage}% + +\def\Xendsublinesep@apprefwithpage{\fullstop}% +\def\Xendsublinesep@SErefwithpage{\fullstop}% + \newtoggle{Xendtwolinesonlyinsamepage@apprefwithpage}% +\newtoggle{Xendtwolinesonlyinsamepage@SErefwithpage}% + +\newtoggle{Xendlineflag@apprefwithpage} +\toggletrue{Xendlineflag@apprefwithpage}%Here, exception +\newtoggle{Xendlineflag@SErefwithpage} +\toggletrue{Xendlineflag@SErefwithpage}%Here, exception \xdef\Xboxstartlinenum@appref{0pt} +\xdef\Xboxstartlinenum@SEref{0pt} + \xdef\Xboxendlinenum@appref{0pt} +\xdef\Xboxendlinenum@SEref{0pt} \xdef\Xendboxstartlinenum@apprefwithpage{0pt} +\xdef\Xendboxstartlinenum@SErefwithpage{0pt} + \xdef\Xendboxendlinenum@apprefwithpage{0pt} +\xdef\Xendboxendlinenum@SErefwithpage{0pt} \newcommand\@apprefprefixsingle{}% +\newcommand\@SErefprefixsingle{}% + \newcommand\@apprefprefixmore{}% +\newcommand\@SErefprefixmore{}% -\newcommand{\apprefprefixsingle}[1]{% +\newcommand{\setapprefprefixsingle}[1]{% \gdef\@apprefprefixsingle{#1}% } +\newcommand{\setSErefprefixsingle}[1]{% + \gdef\@SErefprefixsingle{#1}% +} \newcommand{\setapprefprefixmore}[1]{% \gdef\@apprefprefixmore{#1}% } +\newcommand{\setSErefprefixmore}[1]{% + \gdef\@SErefprefixmore{#1}% +} -\newcommandx{\appref}[2][1,usedefault]{% - \IfStrEq{#1}{fulllines}% - {\toggletrue{fulllines@}}% - {}% - \xdef\@currentseries{appref}% - \ifdefempty{\@apprefprefixmore}% + +\newcommandx{\appref}[2][1,usedefault]{\refformated@{#1}{#2}{appref}} +\newcommandx{\SEref}[2][1,usedefault]{\refformated@{#1}{#2}{SEref}} + +\newcommandx{\apprefwithpage}[2][1,usedefault]{\refformatedwithpage@{#1}{#2}{appref}} +\newcommandx{\SErefwithpage}[2][1,usedefault]{\refformatedwithpage@{#1}{#2}{SEref}} +\newcommandx{\SErefonlypage}[2][1,usedefault]{\refformatedonlypage@{#1}{#2}{SEref}} + +\newcommand{\refformated@}[3]{% + \def\do##1{% + \setkeys[mac]{truefootnoteoption}{##1}% + }% + \notblank{#1}{\docsvlist{#1}}{}% + \xdef\@currentseries{#3}% + \ifcsempty{@#3prefixmore}% {\@apprefprefixsingle}% {% \IfEq{\xlineref{#2:start}}{\xlineref{#2:end}}% - {\@apprefprefixsingle}% - {\@apprefprefixmore}% + {\csuse{@#3prefixsingle}}% + {\csuse{@#3prefixmore}}% }% - \printlines\xpageref{#2:start}|\xlineref{#2:start}|\xsublineref{#2:start}|\xpageref{#2:end}|\xlineref{#2:end}|\xsublineref{#2:end}||% - \togglefalse{fulllines@}% + \ifboolexpr{% + test{\ifcsundef{the@label#2:start}}% + or test{\ifcsundef{the@label#2:end}}% + }% + {\led@warn@pairRefUndefined{#2}\nfss@text{\reset@font\bfseries ??}}% + {\printlines\xpageref{#2:start}|\xlineref{#2:start}|\xsublineref{#2:start}|\xpageref{#2:end}|\xlineref{#2:end}|\xsublineref{#2:end}|\relax|\xflagref{#2:start}|}% + \def\do##1{% + \setkeys[mac]{falsefootnoteoption}{##1}% + }% + \notblank{#1}{\docsvlist{#1}}{}% }% -\newcommandx{\apprefwithpage}[2][1,usedefault]{% - \IfStrEq{#1}{fulllines}% - {\toggletrue{fulllines@}}% - {}% - \xdef\@currentseries{apprefwithpage}% - \printendlines\xpageref{#2:start}|\xlineref{#2:start}|\xsublineref{#2:start}|\xpageref{#2:end}|\xlineref{#2:end}|\xsublineref{#2:end}||% - \togglefalse{fulllines@}% +\newcommand{\refformatedwithpage@}[3]{% + \def\do##1{% + \setkeys[mac]{truefootnoteoption}{##1}% + }% + \notblank{#1}{\docsvlist{#1}}{}% + \xdef\@currentseries{#3withpage}% + \ifboolexpr{% + test{\ifcsundef{the@label#2:start}}% + or test{\ifcsundef{the@label#2:end}}% + }% + {\led@warn@pairRefUndefined{#2}\nfss@text{\reset@font\bfseries ??}}% + {\printendlines\xpageref{#2:start}|\xlineref{#2:start}|\xsublineref{#2:start}|\xpageref{#2:end}|\xlineref{#2:end}|\xsublineref{#2:end}|\relax|\xflagref{#2:start}|}% + \def\do##1{% + \setkeys[mac]{falsefootnoteoption}{##1}% + }% + \notblank{#1}{\docsvlist{#1}}{}% +}% + +\newcommand{\refformatedonlypage@}[3]{% + \def\do##1{% + \setkeys[mac]{truefootnoteoption}{##1}% + }% + \notblank{#1}{\docsvlist{#1}}{}% + \xdef\@currentseries{#3onlypage}% + \ifboolexpr{% + test{\ifcsundef{the@label#2:start}}% + or test{\ifcsundef{the@label#2:end}}% + }% + {\led@warn@pairRefUndefined{#2}\nfss@text{\reset@font\bfseries ??}}% + {\ifnum\xpageref{#2:start}=\xpageref{#2:end}% + \printnpnum{\xpageref{#2:start}} + \else% + \ifdefined\linerangesep@% + \printnpnum{% + \xpageref{#2:start}% + \linerangesep@% + \xpageref{#2:end}% + }% + \else% + \printnpnum{% + \xpageref{#2:start}% + \csuse{Xendlinerangeseparator@\@currentseries}% + \xpageref{#2:end}% + }% + \fi% + \fi% + }% + \def\do##1{% + \setkeys[mac]{falsefootnoteoption}{##1}% + }% + \notblank{#1}{\docsvlist{#1}}{}% }% \newcommand*{\edmakelabel}[2]{\expandafter\xdef\csname the@label#1\endcsname{#2}} @@ -4975,8 +5262,6 @@ \newcommand{\ledinnotehyperpage}[2]{\csuse{#1}{\ledinnotemark{\hyperpage{#2}}}}% \newcommand{\ledinnotemark}[1]{#1\emph{n}}% \newcommandx{\@wredindex}[2][1=\expandonce\jobname,usedefault]{%#1 = the index name, #2 = the text - \global\let\old@Rlineflag\@Rlineflag% - \gdef\@Rlineflag{}% \ifl@imakeidx% \if@edindex@fornote@% \IfSubStr[1]{#2}{|}{\get@index@command#2+}{\get@index@command#2|+}% @@ -5004,7 +5289,6 @@ \fi% \fi% \endgroup - \global\let\@Rlineflag\old@Rlineflag% \@esphack% } \pretocmd{\makeindex}{% @@ -5132,11 +5416,11 @@ \newcounter{stanzaindentsrepetition} \newcount\stanza@modulo -\newcommand*{\managestanza@modulo}[0]{ - \advance\stanza@modulo\@ne - \ifnum\stanza@modulo>\value{stanzaindentsrepetition} - \stanza@modulo\@ne - \fi +\newcommand*{\managestanza@modulo}[0]{% + \advance\stanza@modulo\@ne% + \ifnum\stanza@modulo>\value{stanzaindentsrepetition}% + \stanza@modulo\@ne% + \fi% } \newcommand{\stanzaindent}[1]{% \hspace{\dimexpr#1\stanzaindentbase-\parindent\relax}% @@ -6459,22 +6743,22 @@ \let\morethantwolines\Xmorethantwolines \let\twolinesbutnotmore\Xtwolinesbutnotmore \let\twolinesonlyinsamepage\Xtwolinesonlyinsamepage - \fi +\fi - \unless\ifnofamiliar@ +\unless\ifnofamiliar@ \let\notesXwidthliketwocolumns\noteswidthliketwocolumnsX - \fi - \newcommandx{\parafootsep}[2][1,usedefault]{% +\fi +\newcommandx{\parafootsep}[2][1,usedefault]{% \Xparafootsep[#1]{#2}% \parafootsepX[#1]{#2} - }% +}% - \newcommandx{\afternote}[2][1,usedefault]{% +\newcommandx{\afternote}[2][1,usedefault]{% \Xafternote[#1]{#2}% \afternoteX[#1]{#2}% - }% +}% - \unless\ifnoend@ +\unless\ifnoend@ \let\XendXtwolines\Xendtwolines \let\XendXmorethantwolines\Xendmorethantwolines \let\bhookXendnote\Xendbhooknote @@ -6486,13 +6770,13 @@ \let\XendXbeforelemmaseparator\Xendbeforelemmaseparator \let\XendXafterlemmaseparator\Xendafterlemmaseparator \let\XendXinplaceoflemmaseparator\Xendinplaceoflemmaseparator - \fi +\fi - \AtBeginDocument{% - \ifdef\lineref{}{\let\lineref\edlineref}% - }% +\AtBeginDocument{% + \ifdef\lineref{}{\let\lineref\edlineref}% +}% - \fi% +\fi% \endinput %% %% End of file `reledmac.sty'. diff --git a/Master/texmf-dist/tex/latex/reledmac/reledpar.sty b/Master/texmf-dist/tex/latex/reledmac/reledpar.sty index 296d26489e3..8c75f2dd8a2 100644 --- a/Master/texmf-dist/tex/latex/reledmac/reledpar.sty +++ b/Master/texmf-dist/tex/latex/reledmac/reledpar.sty @@ -28,7 +28,7 @@ \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{reledpar}[2015/10/26 v2.5.2 reledmac extension for parallel texts]% +\ProvidesPackage{reledpar}[2015/11/13 v2.6.0 reledmac extension for parallel texts]% \RequirePackage{xspace}% \RequirePackage{xkeyval} @@ -76,10 +76,17 @@ \newcommand*{\led@err@BadLeftRightPstarts}[2]{% \reledpar@error{The numbers of left (#1) and right (#2) \string\pstart s do not match}{\@ehc}} +\providebool{syntax@} \newcommand*{\led@err@LeftOnRightPage}{% - \reledpar@error{The left page has ended on a right page}{\@ehc}} + \notbool{syntax@}% + {\reledpar@error{The left page has ended on a right page}{\@ehc}}% + {}% + } \newcommand*{\led@err@RightOnLeftPage}{% - \reledpar@error{The right page has ended on a left page}{\@ehc}} + \notbool{syntax@}% + {\reledpar@error{The right page has ended on a left page}{\@ehc}} + {}% + }% \newcommand*{\led@err@Leftside@PreviousNotPrinted}{% \reledpar@error{You call a new Leftside environment while the previous one has not been typeset by \string\Pages\space or \string\Columns}{\@ehc}} \newcommand*{\led@err@Rightside@PreviousNotPrinted}{% @@ -88,6 +95,11 @@ \reledpar@error{\string\Pages\space must be called *outside* of the `pages` environment}{\@ehc}} \newcommand*{\led@err@Columns@InsideEnv}{% \reledpar@error{\string\Columns\space must be called *outside* of the `pairs` environment}{\@ehc}} +\newcommand*{\led@err@Pages@WithoutEnv}{% + \reledpar@error{\string\Pages\space called without previous `pages` environment}{\@ehc}} +\newcommand*{\led@err@Columns@WithoutEnv}{% + \reledpar@error{\string\Columns\space called without previous `pairs` environment}{\@ehc}} + \newcommand{\led@error@fail@patch@thepage}{% \reledpar@error{Fail to patch \string\@thepage\space command.}{\@ehc}% }% @@ -177,12 +189,34 @@ \newcounter{sectionR} \newcounter{subsectionR} \newcounter{subsubsectionR} + +\newcount\old@chapter% +\newcount\old@section% +\newcount\old@subsection% +\newcount\old@subsubsection% +\newcommand{\save@section@number}{% + \ifdefined\c@chapter% + \global\old@chapter\value{chapter}% + \fi% + \global\old@section\value{section}% + \global\old@subsection\value{subsection}% + \global\old@subsubsection\value{subsubsection}% +}% \newcommand{\initnumbering@sectcountR}{ - \let\c@chapter\c@chapterR - \let\c@section\c@sectionR - \let\c@subsection\c@subsectionR - \let\c@subsubsection\c@subsubsectionR + \ifdefined\c@chapter% + \setcounter{chapterR}{\old@chapter}% + \fi% + \setcounter{sectionR}{\old@section}% + \setcounter{subsectionR}{\old@subsection}% + \setcounter{subsubsectionR}{\old@subsubsection}% + \set@sectcountR% } +\newcommand{\set@sectcountR}{% + \let\c@chapter\c@chapterR% + \let\c@section\c@sectionR% + \let\c@subsection\c@subsectionR% + \let\c@subsubsection\c@subsubsectionR% +}% \newcommand*{\pausenumberingR}{% \endnumberingR\global\numberingRtrue} \newcommand*{\resumenumberingR}{% @@ -582,6 +616,8 @@ \csgdef{Xonlyside@#1}{}% \fi% \unless\ifnofamiliar@% + \expandafter\newcount\csname footnote#1@reading\endcsname% + \expandafter\newcount\csname footnote#1@typeset\endcsname% \expandafter\list@create\csname footnote#1@mk\endcsname% \expandafter\newcommand\csname footnote#1nomk\endcsname[1]{% \toggletrue{nomk@}% @@ -605,6 +641,20 @@ }% \fi }% +\newcommand{\save@familiarfootnote@number}{% + \unless\ifnofamiliar@% + \def\do##1{\csxdef{saved@footnote##1}{\the\csname c@footnote##1\endcsname}}% + \dolistloop{\@series}% + \fi% + \xdef\saved@footnote{\the\c@footnote}% +} +\newcommand{\get@familiarfootnote@number}{% + \unless\ifnofamiliar@% + \def\do##1{\global\expandafter\csname footnote##1@typeset\endcsname=\csuse{saved@footnote##1}}% + \dolistloop{\@series}% + \fi% + \global\footnote@typeset=\saved@footnote% +} \unless\ifnocritical@% \newhookcommand@series{Xonlyside}% \fi% @@ -617,6 +667,8 @@ \dolistloop{\@series}% }% \init@series@par% +\newcount\footnote@reading% +\newcount\footnote@typeset% \list@create{\list@pstartL@pc}% \list@create{\list@pstartR@pc}% @@ -646,6 +698,8 @@ \l@dpairingtrue \l@dpagingfalse \initnumbering@quote + \save@familiarfootnote@number% + \save@section@number% \at@begin@pairs% }{% \l@dpairingfalse @@ -658,6 +712,8 @@ \l@dpairingtrue \l@dpagingtrue \initnumbering@quote + \save@familiarfootnote@number% + \save@section@number% \setlength{\Lcolwidth}{\textwidth}% \setlength{\Rcolwidth}{\textwidth}% }{% @@ -1036,7 +1092,7 @@ \def\print@eledsectionR{% \addtocounter{pstartR}{-1}% - \initnumbering@sectcountR% + \set@sectcountR% \ifdefstring{\@eledsectnotoc}{R}{\ledsectnotoc}{}% \ifdefstring{\@eledsectmark}{R}{}{\ledsectnomark}% \numdef{\temp@}{\l@dpscR-1}% @@ -1386,16 +1442,6 @@ \global\let\@insertR=\undefined \repeat} -\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} \newcommand\print@Xnotes@forpages[1]{% \ifcsempty{Xonlyside@#1}{% @@ -1487,9 +1533,9 @@ \def\l@dmake@labelsR#1|#2|#3|#4|#5{% \expandafter\ifx\csname the@label#5\endcsname \relax\else - \led@warn@DuplicateLabel{#4}% + \led@warn@DuplicateLabel{#5}% \fi - \expandafter\gdef\csname the@label#5\endcsname{#1|#2\@Rlineflag|#3|#4}% + \expandafter\gdef\csname the@label#5\endcsname{#1|#2|#3|#4|\@Rlineflag}% \ignorespaces} \AtBeginDocument{% \def\l@dmake@labelsR#1|#2|#3|#4|#5{}% @@ -1665,7 +1711,7 @@ \else \gdef\theledlanguageL{#1}% \fi} \renewcommand*{\l@duselanguage}[1]{% - \l@doldselectlanguage{#1}} + \expandafter\l@doldselectlanguage\expandafter{#1}} \gdef\theledlanguageL{\bbl@main@language}% \gdef\theledlanguageR{\bbl@main@language}% }% @@ -1778,6 +1824,9 @@ \ifl@dpairing% \led@err@Columns@InsideEnv% \fi% + \expandafter\ifvoid\csname l@dRcolrawbox1\endcsname% + \led@err@Columns@WithoutEnv% + \else% \l@dprintingcolumnstrue% \eledsection@correcting@skip=-\baselineskip% Correction for sections' titles \ifnum\l@dnumpstartsL=\l@dnumpstartsR\else @@ -1791,6 +1840,7 @@ \global\par@lineR=\z@ \global\l@dpscL=\z@ \global\l@dpscR=\z@ + \get@familiarfootnote@number% \check@pstarts \loop\if@pstarts \global\pstartnumtrue @@ -1863,8 +1913,9 @@ \global\l@dnumpstartsR=\z@ \l@dprintingcolumnsfalse% \ignorespaces - \global\instanzaLfalse - \global\instanzaRfalse} + \global\instanzaLfalse% + \global\instanzaRfalse% + \fi} \def\print@columnseparator{% \ifdim\beforecolumnseparator<0pt% @@ -2001,7 +2052,7 @@ }% \print@columnseparator% \parbox[t][][t]{\Rcolwidth}{% - \initnumbering@sectcountR% + \set@sectcountR% \csuse{before@pstartR@\the\l@dpscR}% }% \ifdefstring{\columns@position}{R}{}{\hfill}% @@ -2024,7 +2075,7 @@ }% \print@columnseparator% \parbox[t][][t]{\Rcolwidth}{% - \initnumbering@sectcountR% + \set@sectcountR% \csuse{after@pendR@\the\l@dpscR}% }% \ifdefstring{\columns@position}{R}{}{\hfill}% @@ -2041,6 +2092,9 @@ \ifl@dpairing% \led@err@Pages@InsideEnv% \fi% + \expandafter\ifvoid\csname l@dRcolrawbox1\endcsname% + \led@err@Pages@WithoutEnv% + \else% \ifstrequal{#1}{mainmatter}{\Pages@mainmattertrue}{\Pages@mainmatterfalse}% \eledsection@correcting@skip=-2\baselineskip% line correcting for section titles. \parledgroup@notespacing@set@correction% @@ -2063,6 +2117,7 @@ \global\l@dpscR=\z@% \writtenlinesLfalse% \writtenlinesRfalse% + \get@familiarfootnote@number% \let\print@Xnotes\print@Xnotes@forpages% \let\print@notesX\print@notesX@forpages% \check@pstarts% @@ -2152,7 +2207,7 @@ \checkpageR% \l@duselanguage{\theledlanguageR}% { \loop\ifl@dsamepage% - \initnumbering@sectcountR% + \set@sectcountR% \ifdefstring{\@eledsectnotoc}{R}{\ledsectnotoc}{}% \csuse{before@pstartR@\the\l@dpscR}% \global\csundef{before@pstartR@\the\l@dpscR}% @@ -2226,7 +2281,7 @@ \global\instanzaRfalse% \l@dprintingpagesfalse% \finish@Pages@notes%Needed to prevent final notes overlap line number - \ignorespaces} + \ignorespaces\fi} \newcommand{\finish@Pages@notes}{% \def\do##1{% |