diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/reledmac/reledmac.sty | 416 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/reledmac/reledpar.sty | 130 |
2 files changed, 354 insertions, 192 deletions
diff --git a/Master/texmf-dist/tex/latex/reledmac/reledmac.sty b/Master/texmf-dist/tex/latex/reledmac/reledmac.sty index 558f8157ed7..2f3d8d2511d 100644 --- a/Master/texmf-dist/tex/latex/reledmac/reledmac.sty +++ b/Master/texmf-dist/tex/latex/reledmac/reledmac.sty @@ -35,7 +35,7 @@ %% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{reledmac}[2016/06/03 v2.11.0a typeset critical editions]% +\ProvidesPackage{reledmac}[2016/06/16 v2.12.0 typeset critical editions]% \RequirePackage{xkeyval} \newif\ifparledgroup \DeclareOptionX{series}[A,B,C,D,E]{\xdef\default@series{#1}} @@ -102,6 +102,10 @@ \DeclareOptionX{nopenalties}{% \AtBeginDocument{\let\add@penalties\relax}% } +\def\l@auxdir{}% +\DeclareOptionX{auxdir}{% + \xdef\l@auxdir{#1/}% +}% \ProcessOptionsX*\relax \RequirePackage{xargs} @@ -143,7 +147,7 @@ \newcommand*{\led@err@NumberingShouldHaveStarted}{% \reledmac@error{Numbering should already have been started}{\@ehc}} \newcommand*{\led@err@edtextoutsidepstart}{% - \reledmac@error{\string\edtext\space outside numbered paragraph (\pstart\ldots\pend)}{\@ehc}}% + \reledmac@error{\string\edtext\space outside numbered paragraph (\pstart…\pend)}{\@ehc}}% \newcommand*{\led@mess@NotesChanged}{% \typeout{reledmac reminder: }% \typeout{ The number of the footnotes in this section @@ -202,8 +206,8 @@ \reledmac@warning{Duplicate definition of label `#1'\@gobble}% \@latex@warning@no@line{Label `#1' multiply defined}% }% -\newcommand*{\led@warn@AppLabelOutEdtext}[1]{% - \reledmac@warning{\string\applabel\space outside of \string\edtext\space `#1' on page \the\pageno.}}% +\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.}}% \newcommand*{\led@warn@RefUndefined}[1]{% \G@refundefinedtrue% \reledmac@warning{Reference `#1' on page \the\pageno\space undefined.% @@ -257,11 +261,14 @@ \reledmac@error{End column is too high}{\@ehc}} \newcommand*{\led@err@ReverseColumns}{% \reledmac@error{Start column is greater than end column}{\@ehc}} +\newcommand{\led@err@toendnotes@outsidenumbering}{% + \reledmac@error{\string\toendnotes\space and related commands must be called inside a numbered texte (\string\beginnumbering…\string\endnumbering)}{\@ehc}% +}% \newcommand{\led@err@EdtextWithoutFootnote}{% - \reledmac@error{edtext without Xfootnote. Check syntaxis.}{\@ehc}% + \reledmac@error{edtext without Xfootnote. Check syntaxis}{\@ehc}% }% -\newcommand{\led@err@FootnoteWithoutEdtext}{% - \reledmac@error{Xfootnote without edtext. Check syntax.}{\@ehc}% +\newcommand{\led@err@FootnoteNotInSecondArgEdtext}[1]{% + \reledmac@error{#1footnote outside of the second argument of an edtext. Check syntax}{\@ehc}% }% \newcommand{\led@error@ImakeidxAfterEledmac}{% \reledmac@error{Imakeidx must be loaded before reledmac.}{\@ehc}% @@ -293,6 +300,9 @@ \newcommand{\led@warning@msdatawithoutstop}{% \reledmac@warning{\string\msdata\space without corresponding \string\stopmsdata}% }% +\newcommand{\led@warning@preXnotes@deprecated}{% + \reledmac@warning@preXnotes@deprecated% +}% \providecommand*{\@gobblethree}[3]{} \providecommand*{\@gobblefour}[4]{} \providecommand*{\@gobblefive}[5]{} @@ -349,8 +359,8 @@ \fi \gdef\eled@sections@@{}% \if@noeled@sec\else% - \makeatletter\InputIfFileExists{\jobname.eledsec\the\section@num}{}{}\makeatother% - \immediate\openout\eled@sectioning@out=\jobname.eledsec\the\section@num\relax% + \makeatletter\InputIfFileExists{\l@auxdir\jobname.eledsec\the\section@num}{}{}\makeatother% + \immediate\openout\eled@sectioning@out=\l@auxdir\jobname.eledsec\the\section@num\relax% \fi% } \newcommand*{\initnumbering@reg}{% @@ -731,12 +741,12 @@ \list@clear{\linesonpage@listL}% }% \newcommand*{\get@linelistfile}[1]{% - \InputIfFileExists{#1}{% + \InputIfFileExists{\l@auxdir#1}{% \global\noteschanged@false \begingroup \catcode`\[=1 \catcode`\]=2 \makeatletter \catcode`\^^M=9}{% - \led@warn@NoLineFile{#1}% + \led@warn@NoLineFile{\l@auxdir#1}% \global\noteschanged@true \begingroup}% } @@ -1061,6 +1071,50 @@ \xright@appenditem{-1009}\to\actions@list% \fi% } +\newcommand*{\hidenumberingonleftpage}{% + \ifledRcol% + \write\linenum@outR{\string\hide@num@left}% + \else% + \write\linenum@out{\string\hide@num@left}% + \fi% +}% + +\newcommand*{\hide@num@left}{% + \ifledRcol% + \ifodd\page@numR\else% + \xright@appenditem{\the\absline@numR}\to\actionlines@listR% + \xright@appenditem{-1009}\to\actions@listR% + \fi% + \else% + \ifodd\page@num\else% + \xright@appenditem{\the\absline@num}\to\actionlines@list%% + \xright@appenditem{-1009}\to\actions@list% + \fi% + \fi% +}% + +\newcommand*{\hidenumberingonrightpage}{% + \ifledRcol% + \write\linenum@outR{\string\hide@num@right}% + \else% + \write\linenum@out{\string\hide@num@right}% + \fi% +}% + +\newcommand*{\hide@num@right}{% + \ifledRcol% + \ifodd\page@numR% + \xright@appenditem{\the\absline@numR}\to\actionlines@listR% + \xright@appenditem{-1009}\to\actions@listR% + \fi% + \else% + \ifodd\page@num% + \xright@appenditem{\the\absline@num}\to\actionlines@list%% + \xright@appenditem{-1009}\to\actions@list% + \fi% + \fi% +}% + \newcount\insert@count \newcommand*{\dummy@ref}[2]{#2} \newcommand*{\@ref}[2]{% @@ -1120,7 +1174,7 @@ \iffirst@linenum@out@ \immediate\closeout\linenum@out% \global\first@linenum@out@false% - \immediate\openout\linenum@out=#1\relax% + \immediate\openout\linenum@out=\l@auxdir#1\relax% \immediate\write\linenum@out{\string\line@list@version{\this@line@list@version}}% \ifl@dpaging% \immediate\write\linenum@out{\string\@par@sync@option{\@par@this@sync@option}}% @@ -1130,7 +1184,7 @@ \leavevmode% \fi% \closeout\linenum@out% - \openout\linenum@out=#1\relax% + \openout\linenum@out=\l@auxdir#1\relax% \write\linenum@out{\string\line@list@version{\this@line@list@version}}% \ifl@dpaging% \write\linenum@out{\string\@par@sync@option{\@par@this@sync@option}}% @@ -1273,6 +1327,7 @@ \newcommand{\@tag}{} \newcount\@edtext@level% \@edtext@level=0% +\newif\if@edtext@secondarg@% \newcounter{edtext} \renewcommand{\theedtext}{edtxt@\arabic{edtext}}% \newcommand{\edtext}[2]{\leavevmode% @@ -1296,7 +1351,9 @@ \set@line% \ifledRcol \global\insert@countR \z@% \else \global\insert@count \z@ \fi% + \@edtext@secondarg@true% \ignorespaces #2\relax% + \@edtext@secondarg@false% \@ifundefined{xpg@main@language}{%if not polyglossia \flag@start}% {\if@RTL\flag@end\else\flag@start\fi% @@ -1311,7 +1368,7 @@ \endgroup% \ifdef{\hypertarget}% {% - \csedef{thisedtext@\the\@edtext@level}{\theedtext}% + \csedef{thisedtext@\the\@edtext@level}{\theedtext}%We need one macro by level, as #1 can contain new \edtext \Hy@raisedlink@left{\hypertarget{\csuse{thisedtext@\the\@edtext@level}:start}{}}% \showlemma{#1}% \Hy@raisedlink{\hypertarget{\csuse{thisedtext@\the\@edtext@level}:end}{}}% @@ -2190,19 +2247,20 @@ \notbool{parapparatus@}{\newcommand*}{\newcommand}{\normalfootfmt}[4]{% \Xledsetnormalparstuff{#4}% - \hangindent=\csuse{Xhangindent@#4} + \hangindent=\csuse{Xhangindent@#4}% \everypar{\hangindent=\csuse{Xhangindent@#4}}% - \strut{\printlinefootnote{#1}{#4}}% + \rule\z@\splittopskip% + {\printlinefootnote{#1}{#4}}% \print@lemma{#1}{#2}{#4}% \csuse{Xwrapcontent@#4}{#3}% \strut\par} \newcommand*{\normalfootstart}[1]{% - \ifdimequal{0pt}{\preXnotes@}{}% + \ifdimequal{0pt}{\Xprenotes@}{}% {% - \iftoggle{preXnotes@}{% - \togglefalse{preXnotes@}% + \iftoggle{Xprenotes@}{% + \togglefalse{Xprenotes@}% \skip\csname #1footins\endcsname=% - \glueexpr\csuse{preXnotes@}+\csuse{Xafterrule@#1}\relax% + \glueexpr\csuse{Xprenotes@}+\csuse{Xafterrule@#1}\relax% }% {}% }% @@ -2283,12 +2341,12 @@ \newcommand*{\parafootstart}[1]{% \rightskip=0pt \leftskip=0pt% \nottoggle{Xparindent@#1}{\parindent=\z@}{}% - \ifdimequal{0pt}{\preXnotes@}{}% + \ifdimequal{0pt}{\Xprenotes@}{}% {% - \iftoggle{preXnotes@}{% - \togglefalse{preXnotes@}% + \iftoggle{Xprenotes@}{% + \togglefalse{Xprenotes@}% \skip\csname #1footins\endcsname=% - \glueexpr\csuse{preXnotes@}+\csuse{Xafterrule@#1}\relax% + \glueexpr\csuse{Xprenotes@}+\csuse{Xafterrule@#1}\relax% }% {}% }% @@ -2974,26 +3032,26 @@ {\footnote}% {\stepcounter\@mpfn}% {% - \ifl@dpairing% - \global\advance\footnote@reading by \@ne% - \get@thisfootnote% - \get@fnmark{\thisfootnote}% - \ifcsdef{footnotereading\the\footnote@reading=typeset}% - {\setcounter{\@mpfn}{\csuse{footnotereading\the\footnote@reading=typeset}}}% - {\setcounter{\@mpfn}{\footnote@reading}}% - \else% - \stepcounter\@mpfn% - \fi% + \ifboolexpr{bool{l@dpairing} or bool{l@dprintingpages} or bool{l@dprintingcolumns}}{% + \global\advance\footnote@reading by \@ne% + \get@thisfootnote% + \get@fnmark{\thisfootnote}% + \ifcsdef{footnotereading\the\footnote@reading=typeset}% + {\setcounter{\@mpfn}{\csuse{footnotereading\the\footnote@reading=typeset}}}% + {\setcounter{\@mpfn}{\footnote@reading}}% + }{% + \stepcounter\@mpfn% + }% }% {} {} \newcommand{\get@thisfootnote}{% - \ifl@dpairing + \ifboolexpr{bool{l@dpairing} or bool{l@dprintingpages} or bool{l@dprintingcolumns}}{% \protected@xdef\thisfootnote{\the\footnote@reading}% - \else% - \protected@xdef\thisfootnote{\thefootnote}% - \fi% + }{% + \protected@xdef\thisfootnote{\the\c@footnote}% + }% }% \newcommand{\l@dbfnote}[1]{% @@ -3027,7 +3085,7 @@ \stepcounter{footnote@typeset}% \setcounter{footnote}{\c@footnote@typeset}% \immediate\write\@mainaux{% - \global\csdef{footnotereading#1=typeset}{\the\c@footnote@typeset}% + \csgdef{footnotereading#1=typeset}{\the\c@footnote@typeset}% }% \def\@thefnmark{\thefootnote}% }% @@ -3109,7 +3167,8 @@ \ledsetnormalparstuffX{#1}% \hangindent=\csuse{hangindentX@#1}% \everypar{\hangindent=\csuse{hangindentX@#1}}% - {{\csuse{notenumfontX@#1}\wrapped@footfootmarkX{#1}}\strut% + \rule\z@\splittopskip% + {{\csuse{notenumfontX@#1}\wrapped@footfootmarkX{#1}}% \csuse{wrapcontentX@#1}{#2}% \strut\par}} @@ -3204,11 +3263,11 @@ \ignorespaces} \newcommand{\get@thisfootnoteX}[1]{% - \ifl@dpairing% + \ifboolexpr{bool{l@dpairing} or bool{l@dprintingpages} or bool{l@dprintingcolumns}}{% \protected@xdef\thisfootnote{\the\csname footnote#1@reading\endcsname}% - \else% - \protected@xdef\thisfootnote{\csuse{thefootnote#1}}% - \fi% + }{% + \protected@xdef\thisfootnote{\the\csname c@footnote#1\endcsname}% + }% }% \newcommand{\vbfnoteX}[3]{% \get@fnmarkX{#1}{#3}% @@ -3222,7 +3281,7 @@ \setcounter{footnote#1}{\value{footnote#1@typeset}}% \@namedef{@thefnmark#1}{\csuse{thefootnote#1}}% \immediate\write\@mainaux{% - \global\csdef{footnote#1reading#2=typeset}{\the\csname c@footnote#1@typeset\endcsname}% + \csgdef{footnote#1reading#2=typeset}{\the\csname c@footnote#1@typeset\endcsname}% }% }% {% @@ -3234,6 +3293,8 @@ \edtext{}{\normalbfnoteX{#1}{#2}}% \else \def\this@footnoteX@reading{\the\csname footnote#1@reading\endcsname}% + \get@thisfootnoteX{#1}% + \get@fnmarkX{#1}{\expandonce\thisfootnote}% \@nameuse{regvfootnote#1}{#1}{#2}% \fi} @@ -3712,21 +3773,22 @@ \vskip\csuse{afterruleX@#1}% }% -\newtoggle{preXnotes@} -\toggletrue{preXnotes@} -\newcommand{\preXnotes@}{0pt} -\newcommand*{\preXnotes}[1]{\renewcommand{\preXnotes@}{#1}} +\newtoggle{Xprenotes@}% +\toggletrue{Xprenotes@}% +\newcommand{\Xprenotes@}{0pt}% +\newcommand*{\Xprenotes}[1]{\renewcommand{\Xprenotes@}{#1}}% +\newcommand{\preXnotes}[1]{\led@warning@preXnotes@deprecated\Xprenotes{#1}}%For compatibility \newtoggle{prenotesX@} \toggletrue{prenotesX@} \newcommand{\prenotesX@}{0pt} \newcommand*{\prenotesX}[1]{\renewcommand{\prenotesX@}{#1}} \gdef\firstXseries@{} -\newcommand{\prepare@preXnotes}[1]{% - \ifdimequal{0pt}{\preXnotes@}% +\newcommand{\prepare@Xprenotes}[1]{% + \ifdimequal{0pt}{\Xprenotes@}% {}% {% \IfStrEq{\firstXseries@}{}{% - \global\skip\csuse{#1footins}=\preXnotes@% + \global\skip\csuse{#1footins}=\Xprenotes@% \global\advance\skip\csname #1footins\endcsname by\csuse{Xafterrule@#1}% \gdef\firstXseries@{#1}% }% @@ -3768,7 +3830,7 @@ \expandafter\immediate% \expandafter\openout% \csname l@d@#1end\endcsname% - =\jobname.#1end\relax% + =\l@auxdir\jobname.#1end\relax% }% \newcommand{\l@dend@close}[1]{% \global\boolfalse{l@dend@#1}% @@ -3896,13 +3958,35 @@ \hspace{\csuse{Xendafternumber@#2}}% \csuse{Xendahooklinenumber@#2}% }% +\newcommandx{\toendnotes}[2][1,usedefault]{% + \ifboolexpr{bool{numbering} or bool{numberingR}}{% + \def\do##1{% + \reledmac@warning{toto}\expandafter\immediate\expandafter\write\csname l@d@##1end\endcsname% + {\unexpanded{#2}\@percentchar}% + }% + \ifstrempty{#1}% + {\dolistloop{\@series}}% + {\docsvlist{#1}}% + }{\led@err@toendnotes@outsidenumbering}% +}% +\WithSuffix\newcommandx\toendnotes*[2][1,usedefault]{% + \ifboolexpr{bool{numbering} or bool{numberingR}}{% + \def\do##1{% + \reledmac@warning{toto}\expandafter\immediate\expandafter\write\csname l@d@##1end\endcsname% + {#2\@percentchar}% + }% + \ifstrempty{#1}% + {\dolistloop{\@series}}% + {\docsvlist{#1}}% + }{\led@err@toendnotes@outsidenumbering}% +}% \newif\ifXendinsertsep@% \newcommand*{\doendnotes}[1]{% \l@dend@close{#1}% \begingroup \makeatletter \expandafter\let\csname #1end\endcsname=\endprint - \input\jobname.#1end% + \input\l@auxdir\jobname.#1end% \global\Xendinsertsep@false% \endgroup} \newcommand*{\doendnotesbysection}[1]{% @@ -3915,7 +3999,7 @@ {\cslet{#1end}{\endprint}}% {\cslet{#1end}{\@gobblefive}}% }% - \input\jobname.#1end% + \input\l@auxdir\jobname.#1end% \global\Xendinsertsep@false% \endgroup% }% @@ -4123,7 +4207,12 @@ \expandafter\newinsert\csname mp#1footins\endcsname% \fi% \global\notbool{parapparatus@}{\expandafter\newcommand\expandafter *}{\expandafter\newcommand}\csname #1footnote\endcsname[2][]{% - \ifnum\@edtext@level>0% + \if@edtext@secondarg@% + \ifledRcol% + \ifcsstring{Xonlyside@#1}{L}{\led@error@note@called@onrightside{#1footnote}}{}% + \else% + \ifcsstring{Xonlyside@#1}{R}{\led@error@note@called@onleftside{#1footnote}}{}% + \fi% \begingroup% \newcommand{\content}{##2}% \ifnumberedpar@% @@ -4143,7 +4232,7 @@ {\unexpanded{\let\index\nindex}}%There is no note number… so {}% \noexpand\Xnote@true% - \noexpand\prepare@preXnotes{#1}% + \noexpand\prepare@Xprenotes{#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 @@ -4179,7 +4268,7 @@ {\unexpanded{\let\index\nindex}}%There is no note number… so {}% \noexpand\Xnote@true% - \noexpand\prepare@preXnotes{#1}% + \noexpand\prepare@Xprenotes{#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. \ifl@dpairing% @@ -4208,7 +4297,7 @@ \fi% \endgroup% \else% - \led@err@FootnoteWithoutEdtext% + \led@err@FootnoteNotInSecondArgEdtext{#1}% \fi% \ignorespaces% } @@ -4245,13 +4334,18 @@ \prepare@prenotesX{#1}% \newcommand{\content}{##1}% \global\expandafter\advance\csname footnote#1@reading\endcsname by \@ne% - \ifl@dpairing% + \ifboolexpr{bool{l@dpairing} or bool{l@dprintingpages} or bool{l@dprintingcolumns}}{% \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% + }% + \ifledRcol% + \ifcsstring{onlysideX@#1}{L}{\led@error@note@called@onrightside{footnote#1}}{}% + \else% + \ifcsstring{onlysideX@#1}{R}{\led@error@note@called@onleftside{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}}% @@ -4288,6 +4382,7 @@ \newcommand{\content}{##2}% \stepcounter{labidx}% \expandafter\immediate\expandafter\write\csname l@d@#1end\endcsname{% + \unexpanded{\def\sw@list@inedtext}{\expandafter\unexpanded\expandafter{\sw@inthisedtext}} %Volountary space, to add linebreak in the output file \expandafter\string\csname #1end\endcsname% {\ifnumberedpar@\l@d@nums\fi}% {\ifnumberedpar@\expandonce\@tag\fi}% @@ -4302,6 +4397,15 @@ \ignorespaces% }% + \global\expandafter\newcommand\csname #1toendnotes\endcsname[1]{% + \toendnotes[#1]{##1}% + }% + + \expandafter\WithSuffix\expandafter\newcommand\csname #1toendnotes\endcsname*[1]{% + \toendnotes*[#1]{##1}% + }% + + \global\cslet{#1end}{\@gobblefive} \global\expandafter\newcount\csname #1end@bysection\endcsname% \csgdef{Xendwraplemma@#1}{} @@ -4907,7 +5011,7 @@ \to\labelref@list \fi} \newcommand*{\applabel}[1]{% - \ifnum\@edtext@level>0% + \if@edtext@secondarg@% \ifcsundef{the@label#1}{% \csdef{the@label#1}{applabel}% }% @@ -4935,7 +5039,7 @@ \fi% \@esphack% \else% - \led@warn@AppLabelOutEdtext{#1}% + \led@warn@AppLabelOutSecondArgEdtext{#1}% \fi% }% \newcommand{\edlabelS}[1]{% @@ -5284,24 +5388,9 @@ \newcommand*{\ledleftnote}[1]{\edtext{}{\l@dlsnote{#1}}} \newcommand*{\ledrightnote}[1]{\edtext{}{\l@drsnote{#1}}} - -\newcommand*{\ledinnernote}[1]{% - \ifodd\c@page% Do not use \page@num, because it is not yet calculated when command is called - \ledleftnote{#1}% - \else% - \ledrightnote{#1}% - \fi% -} - -\newcommand*{\ledouternote}[1]{% - \ifodd\c@page% Do not use \page@num, because it is not yet calculated when command is called - \ledrightnote{#1}% - \else% - \ledleftnote{#1}% - \fi% -} - -\newcommand*{\ledsidenote}[1]{\edtext{}{\l@dcsnote{#1}}} +\newcommand*{\ledsidenote}[1]{\edtext{}{\l@dcsnote{#1}}}% +\newcommand*{\ledinnernote}[1]{\edtext{}{\l@disnote{#1}}}% +\newcommand*{\ledouternote}[1]{\edtext{}{\l@dosnote{#1}}}% \newif\ifrightnoteup \rightnoteuptrue @@ -5318,7 +5407,10 @@ \to\inserts@list \global\advance\insert@count \@ne% \fi - \fi\ignorespaces\endgroup} + \fi% + \ignorespaces% + \endgroup% +}% \newcommand*{\l@drsnote}[1]{% \begingroup% @@ -5333,7 +5425,9 @@ \to\inserts@list \global\advance\insert@count \@ne% \fi - \fi\ignorespaces\endgroup} + \fi\ignorespaces% + \endgroup% +}% \newcommand*{\l@dcsnote}[1]{% \begingroup% @@ -5348,7 +5442,43 @@ \to\inserts@list \global\advance\insert@count \@ne% \fi - \fi\ignorespaces\endgroup} + \fi\ignorespaces% + \endgroup% +}% + +\newcommand*{\l@disnote}[1]{% + \begingroup% + \newcommand{\content}{#1}% + \ifnumberedpar@% + \ifledRcol% + \xright@appenditem{\noexpand\vl@disnote{\expandonce\content}}% + \to\inserts@listR% + \global\advance\insert@countR \@ne% + \else% + \xright@appenditem{\noexpand\vl@disnote{\expandonce\content}}% + \to\inserts@list% + \global\advance\insert@count \@ne% + \fi% + \fi\ignorespaces% + \endgroup% +}% + +\newcommand*{\l@dosnote}[1]{% + \begingroup% + \newcommand{\content}{#1}% + \ifnumberedpar@% + \ifledRcol% + \xright@appenditem{\noexpand\vl@dosnote{\expandonce\content}}% + \to\inserts@listR% + \global\advance\insert@countR \@ne% + \else% + \xright@appenditem{\noexpand\vl@dosnote{\expandonce\content}}% + \to\inserts@list% + \global\advance\insert@count \@ne% + \fi% + \fi\ignorespaces% + \endgroup% +}% \newcommand*{\vl@dlsnote}[1]{% \ifledRcol@% @@ -5388,6 +5518,32 @@ } \newcommand*{\vl@dcsnote}[1]{\listgadd{\l@dcsnotetext}{#1}} +\newcommand{\vl@disnote}[1]{% + \ifledRcol@% + \@tempcnta=\page@numR% + \else% + \@tempcnta=\page@num% + \fi% + \ifodd\@tempcnta% ODD => right page => inner side = left side + \vl@dlsnote{#1}% + \else% + \vl@drsnote{#1}% + \fi% +}% + +\newcommand{\vl@dosnote}[1]{% + \ifledRcol@% + \@tempcnta=\page@numR% + \else% + \@tempcnta=\page@num% + \fi% + \ifodd\@tempcnta% ODD => right page => outer side = right side + \vl@drsnote{#1}% + \else% + \vl@dlsnote{#1}% + \fi% +}% + \newcommand*{\setl@dlp@rbox}[1]{% \begingroup% \parindent\z@\hsize=\ledlsnotewidth% @@ -7062,7 +7218,6 @@ \fi% } \fi -\newif\if@eled@sectioning \def\print@rightmargin@eledsection{% \if@eled@sectioning% \begingroup% @@ -7095,15 +7250,6 @@ }% \AtBeginDocument{% -\patchcmd{\chapter}{\clearforchapter}{% - \if@eled@sectioning\else% - \ifl@dprintingpages\else% - \clearforchapter% - \fi% - \fi% - } - {} - {} \pretocmd{\M@sect} {\let\old@edtext=\edtext% @@ -7149,16 +7295,6 @@ {} {} -\patchcmd{\chapter}{\if@openright\cleardoublepage\else\clearpage\fi}{% - \if@eled@sectioning\else% - \ifl@dprintingpages\else% - \if@openright\cleardoublepage\else\clearpage\fi%No clearpage inside a \Pages: will keep critical notes from printing on the title page. Here for classical classes - \fi% - \fi% - }% - {}% - {}% - \patchcmd{\scr@startchapter}{\if@openright\cleardoublepage\else\clearpage\fi}{% \if@eled@sectioning\else% \ifl@dprintingpages\else% @@ -7287,9 +7423,33 @@ {} {} }% -} +}% {}}% \protect\catcode`\#=6 %Space NEEDS by \catcode +\AtBeginDocument{% +\patchcmd{\chapter}{\clearforchapter}{% + \if@eled@sectioning\else% + \ifl@dprintingpages\else% + \clearforchapter% + \fi% + \fi% + }% + {}% + {}% + +\patchcmd{\chapter}{\if@openright\cleardoublepage\else\clearpage\fi}{% + \if@eled@sectioning\else% + \ifl@dprintingpages% + \endgraf% + \else% + \if@openright\cleardoublepage\else\clearpage\fi%No clearpage inside a \Pages: will keep critical notes from printing on the title page. Here for classical classes + \fi% + \fi% + }% + {}% + {}% +}% +\newif\if@eled@sectioning% \notbool{@noeled@sec}{% \newwrite\eled@sectioning@out \newcommand{\eledchapter}[2][]{% @@ -7399,18 +7559,18 @@ {% \ifstrempty{#1}% {% - \global\csdef{eled@sectioning@#3#5}{\let\edtext=\dummy@edtext@showlemma\chapter{#2}}% - \global\csdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\chaptermark{#2}}% + \csgdef{eled@sectioning@#3#5}{\let\edtext=\dummy@edtext@showlemma\chapter{#2}}% + \csgdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\chaptermark{#2}}% }%Need for \pairs, because of using parbox. {% - \global\csdef{eled@sectioning@#3#5}{\let\edtext=\dummy@edtext@showlemma\chapter[#1]{#2}}% - \global\csdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\chaptermark{#2}}%Need for \pairs, because of using parbox. + \csgdef{eled@sectioning@#3#5}{\let\edtext=\dummy@edtext@showlemma\chapter[#1]{#2}}% + \csgdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\chaptermark{#2}}%Need for \pairs, because of using parbox. }% }% {% \ifstrempty{#1}% - {\global\csdef{eled@sectioning@#3#5}{\let\edtext=\dummy@edtext@showlemma\chapter*{#2}}}% - {\global\csdef{eled@sectioning@#3#5}{\let\edtext=\dummy@edtext@showlemma\chapter*[#1]{#2}}}%Bug in LaTeX! + {\csgdef{eled@sectioning@#3#5}{\let\edtext=\dummy@edtext@showlemma\chapter*{#2}}}% + {\csgdef{eled@sectioning@#3#5}{\let\edtext=\dummy@edtext@showlemma\chapter*[#1]{#2}}}%Bug in LaTeX! }% \listcsgadd{eled@sections#5@@}{#3}% } @@ -7418,17 +7578,17 @@ \ifstrempty{#4}% {\ifstrempty{#1}% {% - \global\csdef{eled@sectioning@#3#5}{\section{#2}}% - \global\csdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\sectionmark{#2}}%Need for \pairs, because of using parbox. + \csgdef{eled@sectioning@#3#5}{\section{#2}}% + \csgdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\sectionmark{#2}}%Need for \pairs, because of using parbox. }% {% - \global\csdef{eled@sectioning@#3#5}{\section[#1]{#2}}% - \global\csdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\sectionmark{#1}}%Need for \pairs, because of using parbox. + \csgdef{eled@sectioning@#3#5}{\section[#1]{#2}}% + \csgdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\sectionmark{#1}}%Need for \pairs, because of using parbox. }% }% {\ifstrempty{#1}% - {\global\csdef{eled@sectioning@#3#5}{\section*{#2}}}% - {\global\csdef{eled@sectioning@#3#5}{\section*[#1]{#2}}}%Bug in LaTeX! + {\csgdef{eled@sectioning@#3#5}{\section*{#2}}}% + {\csgdef{eled@sectioning@#3#5}{\section*[#1]{#2}}}%Bug in LaTeX! } \listcsgadd{eled@sections#5@@}{#3}% } @@ -7436,29 +7596,29 @@ \ifstrempty{#4}% {\ifstrempty{#1}% {% - \global\csdef{eled@sectioning@#3#5}{\subsection{#2}}% - \global\csdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\csuse{subsectionmark}{#2}}%Need for \pairs, because of using parbox. \csuse in case of \subsectionmark is not defined (book) + \csgdef{eled@sectioning@#3#5}{\subsection{#2}}% + \csgdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\csuse{subsectionmark}{#2}}%Need for \pairs, because of using parbox. \csuse in case of \subsectionmark is not defined (book) }% {% - \global\csdef{eled@sectioning@#3#5}{\subsection[#1]{#2}}% - \global\csdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\csuse{subsectionmark}{#1}}%Need for \pairs, because of using parbox. \csuse in case of \subsectionmark is not defined (book) + \csgdef{eled@sectioning@#3#5}{\subsection[#1]{#2}}% + \csgdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\csuse{subsectionmark}{#1}}%Need for \pairs, because of using parbox. \csuse in case of \subsectionmark is not defined (book) }% }% {\ifstrempty{#1}% - {\global\csdef{eled@sectioning@#3#5}{\subsection*{#2}}}% - {\global\csdef{eled@sectioning@#3#5}{\subsection*[#1]{#2}}}%Bug in LaTeX! + {\csgdef{eled@sectioning@#3#5}{\subsection*{#2}}}% + {\csgdef{eled@sectioning@#3#5}{\subsection*[#1]{#2}}}%Bug in LaTeX! } \listcsgadd{eled@sections#5@@}{#3}% } \def\eled@subsubsection#1#2#3#4#5{% \ifstrempty{#4}% {\ifstrempty{#1}% - {\global\csdef{eled@sectioning@#3#5}{\subsubsection{#2}}}% - {\global\csdef{eled@sectioning@#3#5}{\subsubsection[#1]{#2}}}% + {\csgdef{eled@sectioning@#3#5}{\subsubsection{#2}}}% + {\csgdef{eled@sectioning@#3#5}{\subsubsection[#1]{#2}}}% }% {\ifstrempty{#1}% - {\global\csdef{eled@sectioning@#3#5}{\subsubsection*{#2}}}% - {\global\csdef{eled@sectioning@#3#5}{\subsubsection*[#1]{#2}}}%Bug in LaTeX! + {\csgdef{eled@sectioning@#3#5}{\subsubsection*{#2}}}% + {\csgdef{eled@sectioning@#3#5}{\subsubsection*[#1]{#2}}}%Bug in LaTeX! } \listcsgadd{eled@sections#5@@}{#3}% } diff --git a/Master/texmf-dist/tex/latex/reledmac/reledpar.sty b/Master/texmf-dist/tex/latex/reledmac/reledpar.sty index d01c69337ba..02d69fc1c6e 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/06/03 v2.10.0a reledmac extension for parallel texts]% +\ProvidesPackage{reledpar}[2016/06/16 v2.11.0 reledmac extension for parallel texts]% \RequirePackage{xspace}% \RequirePackage{xkeyval} @@ -108,6 +108,12 @@ \newcommand{\led@error@fail@patch@pagenumbering}{% \reledpar@error{Fail to patch \string\pagenumbering\space command.}{\@ehc}% }% +\newcommand{\led@error@note@called@onrightside}[1]{% + \reledpar@error{#1 called on right side, despite your configuring it to be for the left side only}{\@ehc}% +}% +\newcommand{\led@error@note@called@onleftside}[1]{% + \reledpar@error{#1 called on left side, despite your configuring it to be for the right side only}{\@ehc}% +}% \newcommand{\led@error@fail@patch@@mempnum}{% \reledpar@error{Fail to patch \string\@mempnum\space command.}{\@ehc}% }% @@ -125,6 +131,22 @@ \newcommand{\led@error@missing@numbering}[1]{% \reledpar@error{Missing \string\pstart…\string\pend\space inside `#1` environment}{\@ehc}% }% +\providecommand*{\newnamebox}[1]{% + \expandafter\newbox\csname #1\endcsname} +\providecommand*{\setnamebox}[1]{% + \expandafter\setbox\csname #1\endcsname} +\providecommand*{\unhnamebox}[1]{% + \expandafter\unhbox\csname #1\endcsname} +\providecommand*{\unvnamebox}[1]{% + \expandafter\unvbox\csname #1\endcsname} +\providecommand*{\namebox}[1]{% + \csname #1\endcsname} + +\providecommand*{\newnamecount}[1]{% + \expandafter\newcount\csname #1\endcsname} +\providecommand*{\usenamecount}[1]{% + \csname #1\endcsname} + \newcount\section@numR \section@numR=\z@ \pst@rtedLfalse @@ -160,7 +182,7 @@ \gdef\eled@sectionsR@@{}% \if@noeled@sec\else% \makeatletter\InputIfFileExists{\jobname.eledsec\the\section@numR R}{}{}\makeatother% - \immediate\openout\eled@sectioningR@out=\jobname.eledsec\the\section@numR R\relax% + \immediate\openout\eled@sectioningR@out=\l@auxdir\jobname.eledsec\the\section@numR R\relax% \fi% } \def\endnumberingR{% @@ -608,7 +630,7 @@ \iffirst@linenum@out@R \immediate\closeout\linenum@outR \global\first@linenum@out@Rfalse - \immediate\openout\linenum@outR=#1 + \immediate\openout\linenum@outR=\l@auxdir#1% \immediate\write\linenum@outR{\string\line@list@version{\this@line@list@version}}% \ifl@dpaging% \immediate\write\linenum@outR{\string\@par@sync@option{\@par@this@sync@option}}% @@ -618,7 +640,7 @@ \leavevmode% \fi% \closeout\linenum@outR% - \openout\linenum@outR=#1% + \openout\linenum@outR=\l@auxdir#1% \fi} \newcommand*{\new@lineL}{% @@ -629,11 +651,11 @@ \newcommand{\newseries@par}[1]{% \unless\ifnofamiliar@% \csgdef{onlysideX@#1}{}% - \global\newbool{keepforsideX@#1}% + \newnamebox{footins#1@kept}% \fi% \unless\ifnocritical@% - \global\newbool{keepforXside@#1}% \csgdef{Xonlyside@#1}{}% + \newnamebox{#1footins@kept}% \fi% \unless\ifnofamiliar@% \newcounter{footnote#1@typeset}% @@ -1001,8 +1023,8 @@ \set@Xtxtbeforenotes% \global\@firstlineofpagefalse% \fi% - \add@inserts% \insert@msdata% + \add@inserts% \affixside@note% }% {\print@lineL}% @@ -1544,37 +1566,23 @@ (test {\ifcsstring{Xonlyside@#1}{R}} and test{\ifnumodd{\c@page}}))% }% {% - \correct@Xfootins@box{#1}% \csuse{#1footstart}{#1}% \csuse{#1footgroup}{#1}% - \global\count\csuse{#1footins}=0% - \global\skip\csuse{#1footins}=0pt% - \csuse{Xnotefontsize@#1}% - \global\advance\dimen\csuse{#1footins} by -\baselineskip% - \global\boolfalse{keepforXside@#1}% - }% + \global\count\csuse{#1footins}=\z@% + \global\skip\csuse{#1footins}=\z@% + \global\dimen\csuse{#1footins}=\maxdimen% + }% {% - \global\booltrue{keepforXside@#1}% \global\count\csuse{#1footins}=\csuse{default@#1footins}% \global\skip\csuse{#1footins}=\csuse{Xbeforenotes@#1}% \bgroup% \csuse{Xnotefontsize@#1}% - \global\advance\dimen\csuse{#1footins} by \baselineskip% + \global\dimen\csuse{#1footins}=\csuse{Xmaxhnotes@#1}% \egroup% + \global\setnamebox{#1footins@kept}=\box\namebox{#1footins}% }% }% }% -\newcommand{\correct@Xfootins@box}[1]{% - \ifbool{keepforXside@#1}{% - \csuse{Xnotefontsize@#1}% - \splittopskip=0pt% - \global\setbox\csuse{#1footins}=\vbox{% - \vsplit\csuse{#1footins} to \dimexpr\ht\csuse{#1footins}-1pt\relax% - \vskip \dimexpr-0.5\baselineskip-0.5\lineskip-0.5pt\relax% - \unvbox\csuse{#1footins}% - }% - }{}% -}% \newcommand\print@notesX@forpages[1]{% \ifcsempty{onlysideX@#1}{% \csuse{footstart#1}{#1}% @@ -1587,36 +1595,44 @@ (test {\ifcsstring{onlysideX@#1}{R}} and test{\ifnumodd{\c@page}}))% }% {% - \correct@footinsX@box{#1}% \csuse{footstart#1}{#1}% \csuse{footgroup#1}{#1}% - \global\count\csuse{footins#1}=0% - \global\skip\csuse{footins#1}=0pt% - \csuse{notefontsizeX@#1}% - \global\advance\dimen\csuse{footins#1} by -\baselineskip% - \global\boolfalse{keepforsideX@#1}% + \global\count\csuse{footins#1}=\z@% + \global\skip\csuse{footins#1}=\z@% + \global\dimen\csuse{footins#1}=\maxdimen% + }% {% - \global\booltrue{keepforsideX@#1}% \global\count\csuse{footins#1}=\csuse{default@footins#1}% \global\skip\csuse{footins#1}=\csuse{beforenotesX@#1}% \bgroup% - \csuse{notefontsizeX@#1}% - \global\advance\dimen\csuse{footins#1} by \baselineskip% + \csuse{Xnotefontsize@#1}% + \global\dimen\csuse{footins#1}=\csuse{maxhnotesX@#1}% \egroup% + \global\setnamebox{footins#1@kept}=\box\namebox{footins#1}% }% }% }% -\newcommand{\correct@footinsX@box}[1]{% - \ifbool{keepforsideX@#1}{% - \csuse{notefontsizeX@#1}% - \splittopskip=0pt% - \global\setbox\csuse{footins#1}=\vbox{% - \vsplit\csuse{footins#1} to \dimexpr\ht\csuse{footins#1}-1pt\relax% - \vskip \dimexpr-0.5\baselineskip-0.5\lineskip-0.5pt\relax% - \unvbox\csuse{footins#1}% - }% - }{}% +\newcommand{\insert@notes@for@onlyside}{% + \def\do##1{% + \unless\ifnocritical@% + \ifvoid\csuse{##1footins@kept}\else% + \expandafter\insert\csname ##1footins\endcsname% + \bgroup% + \unvnamebox{##1footins@kept}% + \egroup% + \fi% + \fi% + \unless\ifnofamiliar@% + \ifvoid\csuse{footins##1@kept}\else% + \expandafter\insert\csname footins##1\endcsname% + \bgroup% + \unvnamebox{footins##1@kept}% + \egroup% + \fi% + \fi% + }% + \dolistloop{\@series}% }% \list@create{\labelref@listR} @@ -1763,22 +1779,6 @@ \renewcommand{\thestanzaR}{% \textbf{\arabic{stanzaR}}% } -\providecommand*{\newnamebox}[1]{% - \expandafter\newbox\csname #1\endcsname} -\providecommand*{\setnamebox}[1]{% - \expandafter\setbox\csname #1\endcsname} -\providecommand*{\unhnamebox}[1]{% - \expandafter\unhbox\csname #1\endcsname} -\providecommand*{\unvnamebox}[1]{% - \expandafter\unvbox\csname #1\endcsname} -\providecommand*{\namebox}[1]{% - \csname #1\endcsname} - -\providecommand*{\newnamecount}[1]{% - \expandafter\newcount\csname #1\endcsname} -\providecommand*{\usenamecount}[1]{% - \csname #1\endcsname} - \newif\ifl@dusedbabel \patchcmd{\bbl@set@language}% {\select@language{\languagename}}% @@ -2381,10 +2381,10 @@ \newcommand{\finish@Pages@notes}{% \def\do##1{% \ifnocritical@% - \global\newnamebox{##1footins} + \global\newnamebox{##1footins}% \fi \ifnofamiliar@% - \global\newnamebox{footins##1} + \global\newnamebox{footins##1}% \fi \ifvoid\csuse{##1footins}% \ifvoid\csuse{footins##1}\else% @@ -2422,6 +2422,7 @@ \newcommand*{\clearl@dleftpage}{% \ifdim\pagetotal=0pt\hbox{}\fi% \newpage% + \insert@notes@for@onlyside% \ifodd\c@page\else \led@err@LeftOnRightPage \hbox{}% @@ -2431,6 +2432,7 @@ \newcommand*{\clearl@drightpage}{% \ifdim\pagetotal=0pt\hbox{}\fi% \newpage% + \insert@notes@for@onlyside% \ifodd\c@page \led@err@RightOnLeftPage \hbox{}% |