diff options
author | Karl Berry <karl@freefriends.org> | 2016-10-03 22:22:30 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-10-03 22:22:30 +0000 |
commit | cb087857d0f8ed2ed0dcea0e0b0024036ec471f3 (patch) | |
tree | 4fc2cee22a48ba6b36c92d2f371ec9a19218cf96 /Master/texmf-dist/tex | |
parent | 2c1a714ccc634f16564f814900d3dd8200c815d7 (diff) |
reledmac (3oct16)
git-svn-id: svn://tug.org/texlive/trunk@42197 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/reledmac/reledmac.sty | 387 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/reledmac/reledpar.sty | 120 |
2 files changed, 369 insertions, 138 deletions
diff --git a/Master/texmf-dist/tex/latex/reledmac/reledmac.sty b/Master/texmf-dist/tex/latex/reledmac/reledmac.sty index 739c82184b8..cdaef71ac5f 100644 --- a/Master/texmf-dist/tex/latex/reledmac/reledmac.sty +++ b/Master/texmf-dist/tex/latex/reledmac/reledmac.sty @@ -31,10 +31,12 @@ + + %% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{reledmac}[2016/09/26 v2.15.3 typeset critical editions]% +\ProvidesPackage{reledmac}[2016/10/02 v2.16.0 typesetting critical editions]% \RequirePackage{xkeyval} \newif\ifparledgroup \DeclareOptionX{series}[A,B,C,D,E]{\xdef\default@series{#1}} @@ -110,10 +112,14 @@ \RequirePackage{xargs} \RequirePackage{etoolbox} \@ifl@t@r\fmtversion{2015/10/01} - {}% + {\ifboolexpr{not test{\@ifl@t@r\fmtversion{2016/03/31}} or (test{\ifdefstring{\fmtversion}{2016/03/31}} and test {\ifnumless{\patch@level}{3}})}% + {\PackageWarning{reledmac}{You are using a LaTeX version older than 2016/03/31 patch 3.% + \MessageBreak You are strongly encouraged to use a newer version.}}% + {}% + }% {\RequirePackage{etex}% \csname reserveinserts\endcsname{32}% -} + }% \RequirePackage{suffix} \RequirePackage{xstring} \RequirePackage{ifluatex} @@ -206,16 +212,16 @@ \@latex@warning@no@line{Label `#1' multiply defined}% }% \newcommand*{\led@warn@AppLabelOutSecondArgEdtext}[1]{% - \reledmac@warning{\string\applabel\space outside of the second argument of an \string\edtext\space `#1' on page \the\pageno.}}% + \reledmac@warning{\string\applabel\space outside of the second argument of an \string\edtext\space `#1' on page \thepage.}}% \newcommand*{\led@warn@RefUndefined}[1]{% \G@refundefinedtrue% - \reledmac@warning{Reference `#1' on page \the\pageno\space undefined.% + \reledmac@warning{Reference `#1' on page \thepage\space undefined.% Using `000'.}% \@latex@warning{Reference `#1' undefined\on@line}% }% \newcommand*{\led@warn@pairRefUndefined}[1]{% \G@refundefinedtrue% - \reledmac@warning{Reference `#1:start' and/or `#1:end' on page \the\pageno\space undefined. + \reledmac@warning{Reference `#1:start' and/or `#1:end' on page \thepage\space undefined. Using `??'.}% \@latex@warning{Reference `#1:start' and/or `#1:end' undefined\on@line}% } @@ -228,6 +234,8 @@ \newcommand{\led@warn@SeriesStillExist}[1]{% \reledmac@warning{Series #1 is still existing !}% }% +\newcommand*{\led@err@StanzaIndentNotDefined}{% + \reledmac@error{You have not defined indentation for the line of verse \number\stanza@count}{\@ehc}}% \newcommand{\led@err@ManySidenotes}{% \ifledRcol@% \reledmac@warning{\itemcount@\space sidenotes on line \the\line@numR\space p. \the\page@numR}% @@ -290,6 +298,12 @@ \newcommand{\led@error@fail@patch@endminipage}{% \reledmac@error{Fail to patch \string\endminipage\space command.}{\@ehc}% }% +\newcommand{\led@error@fail@patch@makeindex}{% + \reledmac@error{Fail to patch \string\makeindex\space command.}{\@ehc}% +}% +\newcommand{\led@warn@edinde@outsidenumbering}{% + \reledmac@warning{\string\edindex\space called outside of \string\beginnumbering…\string\endnumbering. \MessageBreak Automatically switched to \string\index.}% +}% \newcommand{\led@warning@hsizeX@deprecated}{% \reledmac@warning{\string\hsizeX\space command deprecated, use \string\widthX\space instead.}% }% @@ -504,7 +518,9 @@ \fi \fi \fi}} -\newcount\line@margin +\newcount\line@margin% +\newcount\line@margin@columns%Only for parallel typesetting +\line@margin@columns=\m@ne% \newcommand*{\linenummargin}[1]{{% \l@dgetline@margin{#1}% @@ -1972,7 +1988,9 @@ \gdef\l@drd@ta{\rlap{{\rightlinenum}}}% \fi \else - \@l@dtempcntb=\line@margin + \ifboolexpr{bool {l@dprintingcolumns} and test {\ifnumgreater{\line@margin@columns}{\m@ne}}}% + {\@l@dtempcntb=\line@margin@columns}% + {\@l@dtempcntb=\line@margin}% \ifnum\@l@dtempcntb>\@ne \advance\@l@dtempcntb \page@num \fi @@ -2188,7 +2206,9 @@ {\noindent\csuse{Xtxtbeforenotes@#1}}% {\expandafter\insert\csname#1footins\endcsname% \bgroup% - \noindent\strut\csuse{Xnotefontsize@#1}\csuse{Xtxtbeforenotes@#1}% + \noindent% + \csuse{\csuse{series@display#1}@begin@insert}{#1}% + \strut\csuse{Xnotefontsize@#1}\csuse{Xtxtbeforenotes@#1}% \egroup% }% }% @@ -2660,18 +2680,7 @@ \csname #1footfmt\endcsname #2{#1}% }% \notbool{parapparatus@}{\newcommand*}{\newcommand}{\threecolfootfmt}[4]{% - \normal@pars% - \nottoggle{Xgroupbyline@#4}% - {\hsize \csuse{Xhsizethreecol@#4}}% - {}% - \nottoggle{Xparindent@#4}{\parindent=\z@}{}% - \tolerance=5000% - \hangindent=\csuse{Xhangindent@#4}% - \everypar{\hangindent=\csuse{Xhangindent@#4}}% - \@tempdima=\parindent% - \csuse{Xcolalign@#4}% - \parindent=\@tempdima% - \strut% + \threecol@begin@insert{#4}% \hspace{\parindent}% \printlinefootnote{#1}{#4}% \print@lemma{#1}{#2}{#4}% @@ -2680,6 +2689,20 @@ {\strut\par\allowbreak}% {}% }% +\newcommand{\threecol@begin@insert}[1]{% + \normal@pars% + \nottoggle{Xgroupbyline@#1}% + {\hsize \csuse{Xhsizethreecol@#1}}% + {}% + \nottoggle{Xparindent@#1}{\parindent=\z@}{}% + \tolerance=5000% + \hangindent=\csuse{Xhangindent@#1}% + \everypar{\hangindent=\csuse{Xhangindent@#1}}% + \@tempdima=\parindent% + \csuse{Xcolalign@#1}% + \parindent=\@tempdima% + \strut% +}% \newcommand*{\threecolfootgroup}[1]{% \csuse{Xbhookgroup@#1}\par% \splittopskip=\ht\strutbox @@ -2732,9 +2755,13 @@ \csxdef{default@#1footins}{500}% \multiply\dimen\csname #1footins\endcsname \tw@} \notbool{parapparatus@}{\newcommand*}{\newcommand}{\twocolvfootnote}[2]{% - \csuse{Xbeforeinserting@#1}% - \insert\csname #1footins\endcsname{% - \twocolvfootnote@inserted{#1}{#2}% + \iftoggle{Xgroupbyline@#1}{% + \prepare@Xgroupbyline{#1}{#2}{\twocolvfootnote@inserted}% + }{% + \X@beforeinsertion{#1}% + \insert\csname #1footins\endcsname{% + \twocolvfootnote@inserted{#1}{#2}% + }% }% }% \notbool{parapparatus@}{\newcommand*}{\newcommand}{\twocolvfootnote@inserted}[2]{% @@ -2745,16 +2772,7 @@ \csname #1footfmt\endcsname #2{#1}% }% \notbool{parapparatus@}{\newcommand*}{\newcommand}{\twocolfootfmt}[4]{% 4th arg is optional, for backward compatibility - \normal@pars% - \hsize \csuse{Xhsizetwocol@#4}% - \nottoggle{Xparindent@#4}{\parindent=\z@}{}% - \tolerance=5000% - \hangindent=\csuse{Xhangindent@#4}% - \everypar{\hangindent=\csuse{Xhangindent@#4}}% - \@tempdima=\parindent% - \csuse{Xcolalign@#4}% - \parindent=\@tempdima% - \strut% + \twocol@begin@insert{#4}% \hspace{\parindent}% \printlinefootnote{#1}{#4}% \print@lemma{#1}{#2}{#4}% @@ -2763,6 +2781,19 @@ {\strut\par\allowbreak}% {}% }% +\newcommand{\twocol@begin@insert}[1]{% + \normal@pars% + \hsize \csuse{Xhsizetwocol@#1}% + \nottoggle{Xparindent@#1}{\parindent=\z@}{}% + \tolerance=5000% + \hangindent=\csuse{Xhangindent@#1}% + \everypar{\hangindent=\csuse{Xhangindent@#1}}% + \@tempdima=\parindent% + \csuse{Xcolalign@#1}% + \parindent=\@tempdima% + \strut% +}% + \newcommand*{\twocolfootgroup}[1]{% \csuse{Xbhookgroup@#1}\par% \splittopskip=\ht\strutbox @@ -3065,7 +3096,7 @@ {\leavevmode\hbox to \csuse{Xboxstartlinenum@\@currentseries}\bgroup\hfill}% \ifl@d@pnum% \wrap@edcrossref{\@this@crossref@start}{#1}% - \csuse{Xsublinesep@\@currentseries}% + \csuse{Xpagelinesep@\@currentseries}% \fi% \wrap@edcrossref{\@this@crossref@start}{% \linenumrep{#2}% @@ -3095,7 +3126,7 @@ \fi% \ifl@d@pnum% \wrap@edcrossref{\@this@crossref@end}{#4}% - \csuse{Xsublinesep@\@currentseries}% + \csuse{Xpagelinesep@\@currentseries}% \fi% \ifl@d@elin% \wrap@edcrossref{\@this@crossref@end}{% @@ -3411,9 +3442,11 @@ {\footnotelang@poly[R]}% \xright@appenditem{% \noexpand\led@set@index@fornote{#1}% + \noexpand\prepare@edindex@fornote{\l@d@nums}% \unexpanded{\def\this@footnoteX@reading}{\the\csname footnote#1@reading\endcsname}% \noexpand\vbfnoteX{#1}{#2}{\expandonce\thisfootnote}% \noexpand\led@reinit@index@fornote% + \unexpanded{\advance\@edindex@fornote@\m@ne}% }% \to\inserts@listR \global\advance\insert@countR \@ne% @@ -3426,9 +3459,11 @@ {\footnotelang@poly}% \xright@appenditem{% \noexpand\led@set@index@fornote{#1}% + \noexpand\prepare@edindex@fornote{\l@d@nums}% \unexpanded{\def\this@footnoteX@reading}{\the\csname footnote#1@reading\endcsname}% \noexpand\vbfnoteX{#1}{#2}{\expandonce\thisfootnote}% \noexpand\led@reinit@index@fornote% + \unexpanded{\advance\@edindex@fornote@\m@ne}% }% \to\inserts@list \global\advance\insert@count \@ne% @@ -4153,6 +4188,8 @@ \newcommand*{\doendnotes}[1]{% \l@dend@close{#1}% \begingroup + \csxdef{prevpagenum@#1}{}% + \csxdef{prevpagerange@#1}{}% \makeatletter \expandafter\let\csname #1end\endcsname=\endprint \input\l@auxdir\jobname.#1end% @@ -4160,6 +4197,8 @@ \endgroup} \newcommand*{\doendnotesbysection}[1]{% \l@dend@close{#1}% + \csxdef{prevpagenum@#1}{}% + \csxdef{prevpagerange@#1}{}% \global\expandafter\advance\csname #1end@bysection\endcsname by 1% \begingroup% \makeatletter% @@ -4232,22 +4271,41 @@ }% \fi% }% -\def\printendlines#1|#2|#3|#4|#5|#6|#7|#8|{\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}% - \wrap@edcrossref{\@this@crossref@start}{\printnpnum{#1}}% + \ifboolexpr{% + (% + test{\ifcsstring{prevpagenum@\@currentseries}{#1}}% + and not% + (togl{Xendpagenumberonlyfirstifsingle@\@currentseries} and bool{l@d@pnum})% + )% + or% + (% + test {\ifcsstring{prevpagerange@\@currentseries}{#1-#4}}% + )% + }% + {% + \ifcsempty{Xendsympagenum@\@currentseries}% + {\hspace{\csuse{Xendinplaceofpagenumber@\@currentseries}}}% + {\csuse{Xendsympagenum@\@currentseries}}% + }% + {% + \wrap@edcrossref{\@this@crossref@start}{\printnpnum{#1}}% + }% \ifl@d@dash% - \ifl@d@pnum% - \csuse{Xendlineprefixsingle@\@currentseries}% - \else% - \ifcsempty{Xendlineprefixmore@\@currentseries}% - {\csuse{Xendlineprefixsingle@\@currentseries}} - {\csuse{Xendlineprefixmore@\@currentseries}}% - \fi% + \ifl@d@pnum% + \csuse{Xendlineprefixsingle@\@currentseries}% + \else% + \ifcsempty{Xendlineprefixmore@\@currentseries}% + {\csuse{Xendlineprefixsingle@\@currentseries}}% + {\csuse{Xendlineprefixmore@\@currentseries}}% + \fi% \else% - \csuse{Xendlineprefixsingle@\@currentseries}% + \csuse{Xendlineprefixsingle@\@currentseries}% \fi% \wrap@edcrossref{\@this@crossref@start}{\linenumrep{#2}}% \iftoggle{Xendlineflag@\@currentseries}{\ifledRcol@\@Rlineflag\fi}{}% @@ -4274,7 +4332,15 @@ \fi% \fi% \ifl@d@pnum% - \wrap@edcrossref{\@this@crossref@end}\printnpnum{#4}% + \ifcsstring{prevpagerange@\@currentseries}{#1-#4}% + {% + \ifcsempty{Xendsympagenum@\@currentseries}% + {\hspace{\csuse{Xendinplaceofpagenumber@\@currentseries}}}% + {\csuse{Xendsympagenum@\@currentseries}}% + }% + {% + \wrap@edcrossref{\@this@crossref@end}\printnpnum{#4}% + }% \fi% \ifl@d@elin% \ifl@d@pnum\csuse{Xendlineprefixsingle@\@currentseries}\fi% @@ -4292,6 +4358,12 @@ {}% {\hfill}%Prevent underfull hbox \egroup% + \iftoggle{Xendpagenumberonlyfirst@\@currentseries}% + {\iftoggle{Xendpagenumberonlyfirstintwo@\@currentseries}% + {\csxdef{prevpagerange@\@currentseries}{#1-#4}}% + {\csxdef{prevpagenum@\@currentseries}{#4}}% + }% + {}% \endgroup% }% @@ -4338,6 +4410,7 @@ \csgdef{Xtwolines@#1}{}% \csgdef{Xmorethantwolines@#1}{}% \csgdef{Xsublinesep@#1}{\fullstop}% + \csgdef{Xpagelinesep@#1}{\csname Xsublinesep@#1\endcsname}%for backward compatibility, call Xsublinesep@#1 \newtoggle{Xtwolinesbutnotmore@#1}% \newtoggle{Xtwolinesonlyinsamepage@#1}% \newtoggle{Xonlypstart@#1}% @@ -4413,6 +4486,7 @@ \noexpand\csuse{v#1footnote}{#1}% {{\l@d@nums}{\expandonce\@tag}{\expandonce\content}}% \noexpand\Xnote@false% + \unexpanded{\advance\@edindex@fornote@\m@ne}% \unexpanded{\undef\@this@crossref@start}% \unexpanded{\undef\@this@crossref@end}% \ifbool{indtl@innote}% @@ -4455,6 +4529,7 @@ \unexpanded{\undef\@this@crossref@start}% \unexpanded{\undef\@this@crossref@end}% \noexpand\Xnote@false% + \unexpanded{\advance\@edindex@fornote@\m@ne}% \ifbool{indtl@innote}% {\unexpanded{\let\index\orig@@index}}% {}% @@ -4644,6 +4719,13 @@ \newtoggle{Xendlineflag@#1} \csgdef{Xendlemmafont@#1}{}% + + \newtoggle{Xendpagenumberonlyfirst@#1}% + \newtoggle{Xendpagenumberonlyfirstifsingle@#1}% + \newtoggle{Xendpagenumberonlyfirstintwo@#1}% + \csgdef{Xendsympagenum@#1}{}% + \csgdef{Xendinplaceofpagenumber@#1}{0pt}% + \fi% \listxadd{\@series}{#1} } @@ -4819,7 +4901,8 @@ \newhooktoggle@series{Xlineflag}[appref,SEref] \newhookcommand@series{Xtwolines}[appref,SEref] \newhookcommand@series{Xmorethantwolines}[appref,SEref] -\newhookcommand@series{Xsublinesep}[appref,SEref,side] +\newhookcommand@series{Xsublinesep}[appref,SEref,side]% +\newhookcommand@series{Xpagelinesep}[appref,SEref,side]% \newhooktoggle@series{Xtwolinesbutnotmore}[appref,SEref] \newhooktoggle@series{Xtwolinesonlyinsamepage}[appref,SEref] \newhookcommand@series{Xlinerangeseparator}[appref,SEref] @@ -4897,6 +4980,12 @@ \newhookcommand@series{Xendhangindent}% + \newhooktoggle@series{Xendpagenumberonlyfirst}% + \newhooktoggle@series{Xendpagenumberonlyfirstifsingle}% + \newhooktoggle@series{Xendpagenumberonlyfirstintwo}% + \newhookcommand@series{Xendsympagenum}% + \newhookcommand@series{Xendinplaceofpagenumber}% + \fi \newhooktoggle@series{Xendlineflag}[apprefwithpage,SErefwithpage] \newhookcommand@series{Xendtwolines}[apprefwithpage,SErefwithpage] @@ -4925,25 +5014,46 @@ \newhookarg@specific{linerangesep} \newtoggle{nomk@}% \newcommandx*{\Xnolemmaseparator}[1][1]{\Xlemmaseparator[#1]{}} -\countdef\pageno=0 \pageno=1 -\newcommand*{\advancepageno}{\ifnum\pageno<\z@ \global\advance\pageno\m@ne - \else\global\advance\pageno\@ne\fi} - \newcommand*{\l@ddoxtrafeet}{% \IfStrEq{familiar-critical}{\@fnpos} - {\do@feetX\Xdo@feet}% + {\do@feetX\do@Xfeet}% {% \IfStrEq{critical-familiar}{\@fnpos}% - {\Xdo@feet\do@feetX}% - {\do@feetX\Xdo@feet}% + {\do@Xfeet\do@feetX}% + {% + \setbox\@outputbox \vbox{% + \unvbox\@outputbox% + \do@feet@custom@order{}{\@fnpos}% + }% + }% }% }% -\newcommand*{\Xdo@feet}{% +\newcommand{\do@feet@custom@order}[2]{% + \def\do##1{% + \edef\@@notesseries{\@firstoftwo##1}% + \edef\@@notetype{\@secondoftwo##1}% + \ifdefstring{\@@notetype}{critical}% + {\csuse{#1append@Xnotes}{\@@notesseries}}% + {\ifdefstring{\@@notetype}{familiar}% + {\csuse{#1append@notesX}{\@@notesseries}}% + {}% + }% + }% + \expandafter\docsvlist\expandafter{#2}% +}% +\newcommand*{\do@Xfeet}{% \setbox\@outputbox \vbox{% \unvbox\@outputbox \@opXfeet}} +\newcommand{\append@Xnotes}[1]{% + \ifvoid\csuse{#1footins}\else% + \global\skip\csuse{#1footins}=\csuse{Xbeforenotes@#1}% + \global\advance\skip\csuse{#1footins} by\csuse{Xafterrule@#1}% + \print@Xnotes{#1}% + \fi% +}% \newcommand\print@Xnotes[1]{% \xdef\@currentseries{#1}% \csuse{#1footstart}{#1}% @@ -4953,11 +5063,7 @@ \unless\ifnocritical@% \gdef\firstXseries@{}% \def\do##1{% - \ifvoid\csuse{##1footins}\else% - \global\skip\csuse{##1footins}=\csuse{Xbeforenotes@##1}% - \global\advance\skip\csuse{##1footins} by\csuse{Xafterrule@##1}% - \print@Xnotes{##1}% - \fi% + \append@Xnotes{##1}% }% \dolistloop{\@series}% \fi% @@ -4982,6 +5088,13 @@ \fi% } +\newcommand{\append@notesX}[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% +}% \newcommand\print@notesX[1]{% \xdef\@currentseries{#1}% \csuse{footstart#1}{#1}% @@ -4993,11 +5106,7 @@ \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% + \append@notesX{##1}% }% \dolistloop{\@series}}% \fi% @@ -5307,6 +5416,9 @@ \def\Xsublinesep@appref{\fullstop}% \def\Xsublinesep@SEref{\fullstop}% +\def\Xpagelinesep@appref{\fullstop}% +\def\Xpagelinesep@SEref{\fullstop}% + \newtoggle{Xtwolinesbutnotmore@appref}% \newtoggle{Xtwolinesbutnotmore@SEref}% @@ -5357,17 +5469,32 @@ \toggletrue{Xendlineflag@SErefwithpage}%Here, exception -\xdef\Xboxstartlinenum@appref{0pt} -\xdef\Xboxstartlinenum@SEref{0pt} +\gdef\Xboxstartlinenum@appref{0pt} +\gdef\Xboxstartlinenum@SEref{0pt} + +\gdef\Xboxendlinenum@appref{0pt} +\gdef\Xboxendlinenum@SEref{0pt} + +\gdef\Xendboxstartlinenum@apprefwithpage{0pt} +\gdef\Xendboxstartlinenum@SErefwithpage{0pt} + +\gdef\Xendboxendlinenum@apprefwithpage{0pt} +\gdef\Xendboxendlinenum@SErefwithpage{0pt} -\xdef\Xboxendlinenum@appref{0pt} -\xdef\Xboxendlinenum@SEref{0pt} +\newtoggle{Xendpagenumberonlyfirst@apprefwithpage} +\newtoggle{Xendpagenumberonlyfirst@SErefwithpage} -\xdef\Xendboxstartlinenum@apprefwithpage{0pt} -\xdef\Xendboxstartlinenum@SErefwithpage{0pt} +\newtoggle{Xendpagenumberonlyfirstifsingle@apprefwithpage} +\newtoggle{Xendpagenumberonlyfirstifsingle@SErefwithpage} -\xdef\Xendboxendlinenum@apprefwithpage{0pt} -\xdef\Xendboxendlinenum@SErefwithpage{0pt} +\newtoggle{Xendpagenumberonlyfirstintwo@apprefwithpage} +\newtoggle{Xendpagenumberonlyfirstintwo@SErefwithpage} + +\gdef\Xendsympagenum@apprefwithpage +\gdef\Xendsympagenum@SErefwithpage + +\gdef\Xendinplaceofpagenumber@apprefwithpage +\gdef\Xendinplaceofpagenumber@SErefwithpage \newcommand\@apprefprefixsingle{}% \newcommand\@SErefprefixsingle{}% @@ -5759,6 +5886,7 @@ \newcommand{\setsidenotesep}[1]{\gdef\@sidenotesep{#1}} \newcommand{\@sidenotesep}{, } \newcommand*{\affixside@note}{% + \prepare@edindex@fornote{\the\page@num|\the\line@num|\the\subline@num|\the\page@num|\the\line@num|\the\subline@num|}% \def\sidenotecontent@{}% \numgdef{\itemcount@}{0}% \def\do##1{% @@ -5802,6 +5930,7 @@ \fi% \fi% \fi% + \advance\@edindex@fornote@\m@ne% } \ifnoledgroup@\else% \newcommand*{\l@dfeetbeginmini}{\@ledgrouptrue\l@dedbeginmini\l@dfambeginmini} @@ -5811,7 +5940,7 @@ {% \IfStrEq{familiar-critical}{\@mpfnpos}% {\l@dfamendmini\l@dedendmini}% - {\l@dedendmini\l@dfamendmini}% + {\do@feet@custom@order{mp@}{\@mpfnpos}}% }% }% \newcommand*{\l@dedbeginmini}{% @@ -5832,31 +5961,36 @@ \fi% \fi \def\do##1{% - \ifvoid\csuse{mp##1footins}\else% - \ifl@dpairing\ifparledgroup% - \ifledRcol% - \dimgdef{\parledgroup@beforenotesR}{\parledgroup@beforenotesR+\skip\@nameuse{mp##1footins}}% - \else% - \dimgdef{\parledgroup@beforenotesL}{\parledgroup@beforenotesL+\skip\@nameuse{mp##1footins}}% - \fi% - \fi\fi% - \ifcsstring{series@display##1}{paragraph}{}{% - \setbox\@nameuse{mp##1footins}=\vbox{% - \csuse{Xnotefontsize@##1}% - \ifcsdef{Xhsize\csuse{series@display##1}@##1}{% - \hsize\csuse{Xhsize\csuse{series@display##1}@##1}% - }{}% - \noindent\csuse{Xtxtbeforenotes@##1}% - \unvbox\@nameuse{mp##1footins}% - \@parboxrestore% - }% - }% - \csuse{mp##1footgroup}{##1}% - \fi}% + \mp@append@Xnotes{##1}% + }% \dolistloop{\@series}% \fi% }% - +\newcommand{\mp@append@Xnotes}[1]{% +\ifvoid\csuse{mp#1footins}\else% + \ifl@dpairing% + \ifparledgroup% + \ifledRcol% + \dimgdef{\parledgroup@beforenotesR}{\parledgroup@beforenotesR+\skip\@nameuse{mp#1footins}}% + \else% + \dimgdef{\parledgroup@beforenotesL}{\parledgroup@beforenotesL+\skip\@nameuse{mp#1footins}}% + \fi% + \fi% + \fi% + \ifcsstring{series@display#1}{paragraph}{}{% + \setbox\@nameuse{mp#1footins}=\vbox{% + \csuse{Xnotefontsize@#1}% + \ifcsdef{Xhsize\csuse{series@display#1}@#1}{% + \hsize\csuse{Xhsize\csuse{series@display#1}@#1}% + }{}% + \noindent\csuse{Xtxtbeforenotes@#1}% + \unvbox\@nameuse{mp#1footins}% + \@parboxrestore% + }% + }% + \csuse{mp#1footgroup}{#1}% +\fi% +}% \newcommand*{\l@dfambeginmini}{% \unless\ifnofamiliar@% \def\do##1{\csletcs{vfootnote##1}{mpvfootnote##1}}% @@ -5867,12 +6001,16 @@ \newcommand*{\l@dfamendmini}{% \unless\ifnofamiliar@% \def\do##1{% - \ifvoid\csuse{mpfootins##1}\else% - \csuse{mpfootgroup##1}{##1}% - \fi}% + \mp@append@notesX{##1}% + }% \dolistloop{\@series}% \fi% }% +\newcommand{\mp@append@notesX}[1]{% + \ifvoid\csuse{mpfootins#1}\else% + \csuse{mpfootgroup#1}{#1}% + \fi% +}% \patchcmd% {\@iiiminipage}% {\let\@footnotetext\@mpfootnotetext}% @@ -5989,10 +6127,10 @@ \pagelinesep% \l@dparsedendline% } -\newif\if@edindex@fornote@ +\newcount\@edindex@fornote@ \newcommand{\prepare@edindex@fornote}[1]{% \l@dp@rsefootspec#1|% - \@edindex@fornote@true% + \advance\@edindex@fornote@\@ne% } \newcommand{\get@edindex@ledinnote@command}{% \ifxindy@% @@ -6058,7 +6196,7 @@ \newcommand{\ledinnotemark}[1]{#1\emph{n}}% \newcommandx{\@wredindex}[2][1=\expandonce\jobname,usedefault]{%#1 = the index name, #2 = the text \ifl@imakeidx% - \if@edindex@fornote@% + \ifnum\@edindex@fornote@>\z@% \IfSubStr[1]{#2}{|}{\get@index@command#2+}{\get@index@command#2|+}% \get@edindex@ledinnote@command% \expandafter\imki@wrindexentry{#1}{\@index@txt|(\@ledinnote@command}{\thestartpageline}% @@ -6068,7 +6206,7 @@ \imki@wrindexentry{#1}{\@index@txt\@edindex@hyperref}{\thepageline}% \fi% \else% - \if@edindex@fornote@% + \ifnum\@edindex@fornote@>\z@% \IfSubStr[1]{#2}{|}{\get@index@command#2+}{\get@index@command#2|+}% \get@edindex@ledinnote@command% \expandafter\protected@write\@indexfile{}% @@ -6087,11 +6225,22 @@ \@esphack% } \pretocmd{\makeindex}{% - \def\edindex{\@bsphack - \doedindexlabel - \begingroup - \@sanitize - \@wredindex}}{}{} + \def\edindex{% + \ifboolexpr{bool{numbering} or bool{numberingR}}{% + \@bsphack% + \doedindexlabel% + \begingroup% + \@sanitize% + \@wredindex% + }% + {% + \led@warn@edinde@outsidenumbering% + \index% + }% + }% +}% +{}% +{\led@error@fail@patch@makeindex}% \newcommand{\edindex}[1]{\@bsphack\@esphack} \newcommand{\hyperlinkformat}[3]{% \ifstrempty{#1}% @@ -6180,7 +6329,7 @@ {% \renewcommand{\index}[2][\indtl@jobname]{% \orig@@index[##1]{% - ##2|innotenumber{\csuse{thefootnote#1}}% + ##2|innotenumber{\this@footnoteX@reading}% }% }% }% @@ -6371,12 +6520,20 @@ \newcommandx{\stanza@line}[1][1]{ \ifnum\value{stanzaindentsrepetition}=0 - \parindent=\csname sza@\number\stanza@count - @\endcsname\stanzaindentbase + \ifcsdef{sza@\number\stanza@count @}% + {% + \parindent=\csname sza@\number\stanza@count @\endcsname\stanzaindentbase% + }{% + \led@err@StanzaIndentNotDefined% + }% \else - \parindent=\csname sza@\number\stanza@modulo - @\endcsname\stanzaindentbase - \managestanza@modulo + \ifcsdef{sza@\number\stanza@modulo @}{% + \parindent=\csname sza@\number\stanza@modulo @\endcsname\stanzaindentbase% + \managestanza@modulo% + }% + {% + \led@err@StanzaIndentNotDefined% + }% \fi \pstart[#1]\stanza@hang\ignorespaces} \xdef\stanza@hang{\noexpand\leavevmode\noexpand\startlock diff --git a/Master/texmf-dist/tex/latex/reledmac/reledpar.sty b/Master/texmf-dist/tex/latex/reledmac/reledpar.sty index 34ebcc9df1a..a959fc1da9c 100644 --- a/Master/texmf-dist/tex/latex/reledmac/reledpar.sty +++ b/Master/texmf-dist/tex/latex/reledmac/reledpar.sty @@ -29,7 +29,7 @@ \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{reledpar}[2016/09/26 v2.13.1 reledmac extension for parallel texts]% +\ProvidesPackage{reledpar}[2016/10/02 v2.14.0 reledmac extension for parallel texts]% \RequirePackage{xspace}% \RequirePackage{xkeyval} @@ -101,7 +101,14 @@ \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@err@Pages@WithoutRightside}{% + \reledpar@error{\string\Pages\space called without previous `Rightside` environment (or environment without content)}{\@ehc}}% +\newcommand*{\led@err@Pages@WithoutLeftside}{% + \reledpar@error{\string\Pages\space called without previous `Leftside` environment (or environment without content)}{\@ehc}}% + \newcommand*{\led@err@Columns@WithoutRightside}{% + \reledpar@error{\string\Columns\space called without previous `Rightside` environment (or environment without content)}{\@ehc}}% +\newcommand*{\led@err@Columns@WithoutLeftside}{% + \reledpar@error{\string\Columns\space called without previous `Leftside` environment (or environment without content)}{\@ehc}}% \newcommand{\led@error@fail@patch@thepage}{% \reledpar@error{Fail to patch \string\@thepage\space command.}{\@ehc}% }% @@ -145,6 +152,19 @@ \providecommand*{\namebox}[1]{% \csname #1\endcsname} +\newcommand*{\ifcsboxvoid}[1]{% + \ifcsname#1\endcsname% + \expandafter\ifvoid\csname #1\endcsname% + \expandafter\expandafter% + \expandafter\@firstoftwo% + \else% + \expandafter\expandafter% + \expandafter\@secondoftwo% + \fi% + \else% + \expandafter\@firstoftwo% + \fi% +}% \providecommand*{\newnamecount}[1]{% \expandafter\newcount\csname #1\endcsname} \providecommand*{\usenamecount}[1]{% @@ -351,6 +371,32 @@ \global\line@margin=\@l@dtempcntb% \fi% } + +\newcount\line@margin@columnsR% +\line@margin@columnsR=\m@ne% + +\newcommand{\linenummarginColumns}[1]{% + \l@dgetline@margin{#1}% + \ifnum\@l@dtempcntb>\m@ne% + \global\line@margin@columns=\@l@dtempcntb% + \fi% +}% + +\WithSuffix\newcommand\linenummarginColumns*[1]{% + \l@dgetline@margin{#1}% + \ifnum\@l@dtempcntb>\m@ne% + \global\line@margin@columns=\@l@dtempcntb% + \global\line@margin@columnsR=\@l@dtempcntb% + \fi% +}% + +\newcommand{\linenummarginColumnsR}[1]{% + \l@dgetline@margin{#1}% + \ifnum\@l@dtempcntb>\m@ne% + \global\line@margin@columnsR=\@l@dtempcntb% + \fi% +}% + \newcounter{firstlinenumR} \setcounter{firstlinenumR}{5} \newcounter{linenumincrementR} @@ -1403,6 +1449,7 @@ \global\sub@lockR \z@ \fi} +\let\linenumberlistR\empty% \newcommand*{\affixline@numR}{% \ifledgroupnotesR@\else\ifnumberline \ifl@dskipnumber @@ -1414,15 +1461,15 @@ \ch@cksub@lockR \else \@l@dtempcntb=\line@numR - \ifx\linenumberlist\empty + \ifx\linenumberlistR\empty% \l@dcalcnum{\line@numR}{\c@firstlinenumR}{\c@linenumincrementR}% \else \@l@dtempcnta=\line@numR - \edef\rem@inder{,\linenumberlist,\number\line@numR,}% + \edef\rem@inderR{,\linenumberlistR,\number\line@numR,}% \edef\sc@n@list{\def\noexpand\sc@n@list - ####1,\number\@l@dtempcnta,####2|{\def\noexpand\rem@inder{####2}}}% - \sc@n@list\expandafter\sc@n@list\rem@inder|% - \ifx\rem@inder\empty\advance\@l@dtempcnta\@ne\fi + ####1,\number\@l@dtempcnta,####2|{\def\noexpand\rem@inderR{####2}}}% + \sc@n@list\expandafter\sc@n@list\rem@inderR|% + \ifx\rem@inderR\empty\advance\@l@dtempcnta\@ne\fi% \fi \ch@ck@l@ckR \fi @@ -1435,7 +1482,9 @@ \gdef\l@drd@ta{\rlap{{\rightlinenumR}}}% \fi \else - \@l@dtempcntb=\line@marginR + \ifboolexpr{bool {l@dprintingcolumns} and test {\ifnumgreater{\line@margin@columnsR}{\m@ne}}}% + {\@l@dtempcntb=\line@margin@columnsR}% + {\@l@dtempcntb=\line@marginR}% \ifnum\@l@dtempcntb>\@ne \advance\@l@dtempcntb by\page@numR \fi @@ -1461,7 +1510,9 @@ \gdef\l@drd@ta{\rlap{{\rightpstartnumL}}}% \fi \else - \@l@dtempcntb=\line@margin + \ifboolexpr{bool {l@dprintingcolumns} and test {\ifnumgreater{\line@margin@columns}{\m@ne}}}% + {\@l@dtempcntb=\line@margin@columns}% + {\@l@dtempcntb=\line@margin}% \ifnum\@l@dtempcntb>\@ne \advance\@l@dtempcntb \page@num \fi @@ -1482,7 +1533,9 @@ \gdef\l@drd@ta{\rlap{{\rightpstartnumR}}}% \fi \else - \@l@dtempcntb=\line@marginR + \ifboolexpr{bool {l@dprintingcolumns} and test {\ifnumgreater{\line@margin@columnsR}{\m@ne}}}% + {\@l@dtempcntb=\line@margin@columnsR}% + {\@l@dtempcntb=\line@marginR}% \ifnum\@l@dtempcntb>\@ne \advance\@l@dtempcntb \page@numR \fi @@ -1702,6 +1755,7 @@ \newcommand*{\affixside@noteR}{% + \prepare@edindex@fornote{\the\page@numR|\the\line@numR|\the\subline@numR|\the\page@numR|\the\line@numR|\the\subline@numR|}% \def\sidenotecontent@{}% \numgdef{\itemcount@}{0}% \def\do##1{% @@ -1745,6 +1799,7 @@ \fi% \fi% \fi% + \advance\@edindex@fornote@\m@ne% } \newif\ifinserthangingsymbolR @@ -1803,12 +1858,20 @@ }% \newcommand*{\@astanza@line}{% \ifnum\value{stanzaindentsrepetition}=0 - \parindent=\csname sza@\number\stanza@count - @\endcsname\stanzaindentbase + \ifcsdef{sza@\number\stanza@count @}% + {% + \parindent=\csname sza@\number\stanza@count @\endcsname\stanzaindentbase% + }{% + \led@err@StanzaIndentNotDefined% + }% \else - \parindent=\csname sza@\number\stanza@modulo - @\endcsname\stanzaindentbase - \managestanza@modulo + \ifcsdef{sza@\number\stanza@modulo @}{% + \parindent=\csname sza@\number\stanza@modulo @\endcsname\stanzaindentbase% + \managestanza@modulo% + }% + {% + \led@err@StanzaIndentNotDefined% + }% \fi \endgraf \stanza@hang% @@ -1964,9 +2027,14 @@ \ifl@dpairing% \led@err@Columns@InsideEnv% \fi% - \expandafter\ifvoid\csname l@dRcolrawbox1\endcsname% - \led@err@Columns@WithoutEnv% - \else% + \ifboolexpr{test{\ifcsboxvoid{l@dRcolrawbox1}} or test{\ifcsboxvoid{l@dLcolrawbox1}}}{% + \ifcsboxvoid{l@dRcolrawbox1}{% + \ifcsboxvoid{l@dLcolrawbox1}% + {\led@err@Columns@WithoutEnv}% + {\led@err@Columns@WithoutRightside}% + }% + {\led@err@Columns@WithoutLeftside}% + }{% \global\l@dprintingcolumnstrue% \eledsection@correcting@skip=-\baselineskip% Correction for sections' titles \ifnum\l@dnumpstartsL=\l@dnumpstartsR\else @@ -2055,7 +2123,8 @@ \ignorespaces \global\instanzaLfalse% \global\instanzaRfalse% - \fi} + }% +}% \def\print@columnseparator{% \ifdim\beforecolumnseparator<0pt% @@ -2232,9 +2301,14 @@ \ifl@dpairing% \led@err@Pages@InsideEnv% \fi% - \expandafter\ifvoid\csname l@dRcolrawbox1\endcsname% - \led@err@Pages@WithoutEnv% - \else% + \ifboolexpr{test{\ifcsboxvoid{l@dRcolrawbox1}} or test{\ifcsboxvoid{l@dLcolrawbox1}}}{% + \ifcsboxvoid{l@dRcolrawbox1}{% + \ifcsboxvoid{l@dLcolrawbox1}% + {\led@err@Pages@WithoutEnv}% + {\led@err@Pages@WithoutRightside}% + }% + {\led@err@Pages@WithoutLeftside}% + }{% \ifstrequal{#1}{mainmatter}{\Pages@mainmattertrue}{\Pages@mainmatterfalse}% \eledsection@correcting@skip=-2\baselineskip% line correcting for section titles. \parledgroup@notespacing@set@correction% @@ -2427,7 +2501,7 @@ \global\edtext@later=\z@% \global\edtext@now=\z@% \finish@Pages@notes% - \ignorespaces\fi} + \ignorespaces}}% \newcommand{\finish@Pages@notes}{% \def\do##1{% |