diff options
author | Karl Berry <karl@freefriends.org> | 2016-06-11 23:16:49 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-06-11 23:16:49 +0000 |
commit | 611022b6b75a9f844b019178ff1f4b46228205c6 (patch) | |
tree | 00e206f54767b27dd11595c71081d79a71ae5c01 /Master/texmf-dist/tex/latex | |
parent | ef0df012fe93429bbd3ddef76a731386764fb398 (diff) |
reledmac (3jun16)
git-svn-id: svn://tug.org/texlive/trunk@41380 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/reledmac/reledmac.sty | 460 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/reledmac/reledpar.sty | 69 |
2 files changed, 457 insertions, 72 deletions
diff --git a/Master/texmf-dist/tex/latex/reledmac/reledmac.sty b/Master/texmf-dist/tex/latex/reledmac/reledmac.sty index e9f22a65574..558f8157ed7 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/05/08 v2.10.0 typeset critical editions]% +\ProvidesPackage{reledmac}[2016/06/03 v2.11.0a typeset critical editions]% \RequirePackage{xkeyval} \newif\ifparledgroup \DeclareOptionX{series}[A,B,C,D,E]{\xdef\default@series{#1}} @@ -99,6 +99,9 @@ \DeclareOptionX{eledmac-compat}{% \eledmaccompat@true% }% +\DeclareOptionX{nopenalties}{% + \AtBeginDocument{\let\add@penalties\relax}% +} \ProcessOptionsX*\relax \RequirePackage{xargs} @@ -129,6 +132,8 @@ \let\imki@wrindexentry\indtl@wrindexentry% }{}% \ifdef{\if@RTL}{}{\newif\if@RTL} +\newif\if@firstlineofpage% +\newif\if@firstlineofpageR% \newcommand{\reledmac@warning}[1]{\PackageWarning{reledmac}{#1}} \newcommand{\reledmac@error}[2]{\PackageError{reledmac}{#1}{#2}} \newcommand*{\led@err@NumberingStarted}{% @@ -285,6 +290,9 @@ \newcommand{\led@warning@Xhsize@deprecated}{% \reledmac@warning{\string\Xhsize\space command deprecated, use \string\Xwidth\space instead.}% }% +\newcommand{\led@warning@msdatawithoutstop}{% + \reledmac@warning{\string\msdata\space without corresponding \string\stopmsdata}% +}% \providecommand*{\@gobblethree}[3]{} \providecommand*{\@gobblefour}[4]{} \providecommand*{\@gobblefive}[5]{} @@ -361,6 +369,7 @@ \global\let\sub@change=\relax \resetprevline@ \resetprevpage@num + \global\stopmsdata@inserted@true% } \def\endnumbering{% @@ -657,7 +666,18 @@ \dolistloop{\@series}% } \newcommand*{\resetprevpage@num}{% - \def\do##1{\ifcsdef{prevpage##1@num}{\global\csname prevpage##1@num\endcsname=0}{}}% + \def\do##1{% + \ifcsdef{prevpage##1@num}{% + \global\csname prevpage##1@num\endcsname=\z@% + \global\csname prevpage##1@numR\endcsname=\z@% + }% + {}% + \ifcsdef{##1prevpage@num}{% + \global\csname ##1prevpage@num\endcsname=\z@% + \global\csname ##1prevpage@numR\endcsname=\z@% + }% + {}% + }% \dolistloop{\@series}% } \newread\@inputcheck @@ -675,6 +695,14 @@ \global\page@num=\page@num\relax \global\last@page@num=\last@page@num\relax \fi + \@stopmsd%Security if last \endms{} is forgotten + \unless\ifledRcol%Get the last line of the last page + \csnumgdef{@lastabsline@forpage@\the\page@num}{\the\absline@num}% + \csnumgdef{@lastline@forpage@\the\page@num}{\the\line@num}% + \else% + \csnumgdef{@lastabsline@forpageR@\the\page@numR}{\the\absline@numR}% + \csnumgdef{@lastline@forpageR@\the\page@numR}{\the\line@numR}% + \fi% \endgroup \ifledRcol \global\page@numR=\m@ne @@ -784,6 +812,8 @@ \ifledRcol \ifnum #1=\last@page@numR \else + \csnumgdef{@lastabsline@forpageR@\the\page@numR}{\the\absline@numR}% + \csnumgdef{@lastline@forpageR@\the\page@numR}{\the\line@numR}% \ifbypage@R \line@numR \z@ \subline@numR \z@ \fi @@ -794,6 +824,8 @@ \else \ifnum #1=\last@page@num \else + \csnumgdef{@lastabsline@forpage@\the\page@num}{\the\absline@num}% + \csnumgdef{@lastline@forpage@\the\page@num}{\the\line@num}% \ifbypage@ \line@num \z@ \subline@num \z@ \fi @@ -1109,7 +1141,7 @@ \IfStrEq{\led@pb@setting}{after}% {\xifinlist{\the\absline@num}{\l@prev@nopb}% {\xifinlist{\the\absline@num}{\normal@page@break}% - {\numgdef{\@next@page}{\c@page+1}% + {\numgdef{\@next@page}{\c@page+\@ne}% \write\linenum@out{\string\@nl[\@next@page][\@next@page]}% }% {\write\linenum@out{\string\@nl[\the\c@page][\thepage]}}% @@ -1117,10 +1149,10 @@ {\write\linenum@out{\string\@nl[\the\c@page][\thepage]}}}% {}% \IfStrEq{\led@pb@setting}{before}% - {\numdef{\next@absline}{\the\absline@num+1}% + {\numdef{\next@absline}{\the\absline@num+\@ne}% \xifinlist{\next@absline}{\l@prev@nopb}% {\xifinlist{\the\absline@num}{\normal@page@break}% - {\numgdef{\nc@page}{\c@page+1}% + {\numgdef{\nc@page}{\c@page+\@ne}% \write\linenum@out{\string\@nl[\nc@page][\nc@page]}% }% {\write\linenum@out{\string\@nl[\the\c@page][\thepage]}}% @@ -1375,10 +1407,10 @@ \leavevmode% \get@sw@txt{#2}% \unless\ifledRcol% - \csnumgdef{sw@\sw@txt}{\csuse{sw@\sw@txt}+1}% + \csnumgdef{sw@\sw@txt}{\csuse{sw@\sw@txt}+\@ne}% \protected@write\linenum@out{}{\string\@sw{\sw@txt}{\csuse{sw@\sw@txt}}{#1}}% \else% - \csnumgdef{sw@\sw@txt}{\csuse{sw@\sw@txt}+1}% + \csnumgdef{sw@\sw@txt}{\csuse{sw@\sw@txt}+\@ne}% \protected@write\linenum@outR{}{\string\@sw{\sw@txt}{\csuse{sw@\sw@txt}}{#1}}% \fi% #2% @@ -1542,7 +1574,7 @@ \global\par@line=0% \csnumdef{pstartline}{0}% \loop\ifvbox\raw@text% - \csnumdef{pstartline}{\pstartline+1}% + \csnumdef{pstartline}{\pstartline+\@ne}% \do@line% \ifbypstart@% \ifnumequal{\pstartline}{1}{% @@ -1634,15 +1666,20 @@ \def\print@line{ \affixpstart@num% \hb@xt@ \linewidth{% - \do@insidelinehook% - \l@dld@ta% + \do@insidelinehook% + \l@dld@ta% + \if@firstlineofpage% + \set@Xtxtbeforenotes% + \global\@firstlineofpagefalse% + \fi% + \insert@msdata% \add@inserts\affixside@note% \l@dlsn@te {\ledllfill\hb@xt@ \wd\one@line{\new@line% \ifluatex% \textdir\l@luatextextdir@L% \fi% - \inserthangingsymbol %Space keept for backward compatibility + \inserthangingsymbol% \l@dunhbox@line{\one@line}}% \ledrlfill\l@drd@ta% \l@drsn@te @@ -1650,6 +1687,11 @@ \add@penalties% } \def\print@eledsection{% + \if@firstlineofpage% + \set@Xtxtbeforenotes% + \global\@firstlineofpagefalse% + \fi% + \insert@msdata% \add@inserts\affixside@note% \numdef{\temp@}{\l@dnumpstartsL-1}% \xifinlist{\temp@}{\eled@sections@@}{\@nobreaktrue}{\@nobreakfalse}% @@ -1720,10 +1762,12 @@ \ifnum\absline@num<\next@actionline\else \ifnum\next@action>-1001 \global\page@num=\next@action + \global\@firstlineofpagetrue% \ifbypage@ \global\line@num=\z@ \global\subline@num=\z@ \resetprevline@ \fi + \add@msdata@firstlineofpage% \else \ifnum\next@action<-4999 \@l@dtempcnta=-\next@action @@ -1751,32 +1795,34 @@ \newcommand*{\do@actions@fixedcode}{% \ifcase\@l@dtempcnta - \or% % 1001 + \or% % 1001 = starting sublineation \global\sublines@true - \or% % 1002 + \or% % 1002 = ending sublineation \global\sublines@false - \or% % 1003 + \or% % 1003 = starting locking number \global\@lock=\@ne - \or% % 1004 + \or% % 1004 = ending locking number \ifnum\@lock=\tw@ \global\@lock=\thr@@ \else \global\@lock=\z@ \fi - \or% % 1005 + \or% % 1005 = starting locking subnumber \global\sub@lock=\@ne - \or% % 1006 + \or% % 1006 = ending locking subnumber \ifnum\sub@lock=\tw@ \global\sub@lock=\thr@@ \else \global\sub@lock=\z@ \fi - \or% % 1007 + \or% % 1007 = skipping numbering \l@dskipnumbertrue - \or% % 1008 + \or% % 1008 = skipping numbering in stanza \l@dskipversenumbertrue% - \or% % 1009 + \or% % 1009 = hiding number \l@dhidenumbertrue + \or% % 1010 = inserting msdata + \add@msdata% \else \led@warn@BadAction \fi} @@ -1991,6 +2037,29 @@ \def\body{#1\expandafter\body\fi}% \body} +\newcommand{\set@Xtxtbeforenotes}{% + \unless\ifnocritical@% + \def\do##1{% + \global\togglefalse{Xtxtbeforesnotes@##1@typeset}% + }% + \dolistloop{\@series}% + \fi% +}% +\newcommand{\insert@Xtxtbeforenotes}[1]{% + \nottoggle{Xtxtbeforesnotes@#1@typeset}{% + \global\toggletrue{Xtxtbeforesnotes@#1@typeset}% + \ifcsvoid{Xtxtbeforenotes@#1}{}{% + \ifcsstring{series@display#1}{paragraph}% + {\noindent\csuse{Xtxtbeforenotes@#1}}% + {\expandafter\insert\csname#1footins\endcsname% + \bgroup% + \noindent\strut\csuse{Xnotefontsize@#1}\csuse{Xtxtbeforenotes@#1}% + \egroup% + }% + }% + }% + {}% +}% \def\select@lemmafont#1|#2|#3|#4|#5|#6|#7|{\select@@lemmafont#7|} \def\select@@lemmafont#1/#2/#3/#4|% {\fontencoding{#1}\fontfamily{#2}\fontseries{#3}\fontshape{#4}% @@ -2094,6 +2163,7 @@ } \notbool{parapparatus@}{\newcommand*}{\newcommand}{\normalvfootnote}[2]{% + \insert@Xtxtbeforenotes{#1}% \csuse{Xbeforeinserting@#1}% \insert\csname #1footins\endcsname\bgroup \hsize=\expandafter\dimexpr\csuse{Xwidth@#1}\relax% @@ -2108,6 +2178,7 @@ \csname #1footfmt\endcsname #2{#1}\egroup} \notbool{parapparatus@}{\newcommand*}{\newcommand}{\mpnormalvfootnote}[2]{% \global\setbox\@nameuse{mp#1footins}\vbox{% + \insert@Xtxtbeforenotes{#1}% \unvbox\@nameuse{mp#1footins} \noindent\csuse{Xbhooknote@#1}% \csuse{Xnotefontsize@#1}% @@ -2131,7 +2202,7 @@ \iftoggle{preXnotes@}{% \togglefalse{preXnotes@}% \skip\csname #1footins\endcsname=% - \dimexpr\csuse{preXnotes@}+\csuse{Xafterrule@#1}\relax% + \glueexpr\csuse{preXnotes@}+\csuse{Xafterrule@#1}\relax% }% {}% }% @@ -2143,9 +2214,8 @@ \setXnoteswidthliketwocolumns@{#1}% \setXnotespositionliketwocolumns@{#1}% \print@Xfootnoterule{#1}% - \noindent\leavevmode} +}% \newcommand*{\normalfootgroup}[1]{% - {\csuse{Xnotefontsize@#1}\noindent\csuse{Xtxtbeforenotes@#1}}% \csuse{Xbhookgroup@#1}% \unvbox\csname #1footins\endcsname% \hsize=\old@hsize% @@ -2172,13 +2242,13 @@ \print@Xfootnoterule{#1}%% \fi% \setlength{\parindent}{0pt} - {\csuse{Xnotefontsize@#1}\csuse{Xtxtbeforenotes@#1}} \csuse{Xbhookgroup@#1}% \unvbox\csname mp#1footins\endcsname}} \fi \newcommand*{\Xarrangement@paragraph}[1]{% \csgdef{series@display#1}{paragraph} \expandafter\newcount\csname #1prevpage@num\endcsname + \expandafter\newcount\csname #1prevpage@numR\endcsname% \expandafter\let\csname #1footstart\endcsname=\parafootstart \expandafter\let\csname v#1footnote\endcsname=\paravfootnote \expandafter\let\csname #1footfmt\endcsname=\parafootfmt @@ -2218,7 +2288,7 @@ \iftoggle{preXnotes@}{% \togglefalse{preXnotes@}% \skip\csname #1footins\endcsname=% - \dimexpr\csuse{preXnotes@}+\csuse{Xafterrule@#1}\relax% + \glueexpr\csuse{preXnotes@}+\csuse{Xafterrule@#1}\relax% }% {}% }% @@ -2236,6 +2306,7 @@ \footsplitskips \setbox0=\vbox{\hsize=\maxdimen% \let\bidi@RTL@everypar\@empty% + \insert@Xtxtbeforenotes{#1}% \noindent\csuse{Xbhooknote@#1}% \csname #1footfmt\endcsname #2{#1}}% \setbox0=\hbox{\Xunvxh{0}{#1}}% @@ -2252,6 +2323,7 @@ \footsplitskips \setbox0=\vbox{\hsize=\maxdimen% \let\bidi@RTL@everypar\@empty% + \insert@Xtxtbeforenotes{#1}% \noindent\color@begingroup% \csuse{Xbhooknote@#1}% \csname #1footfmt\endcsname #2{#1}\color@endgroup}% @@ -2284,7 +2356,7 @@ \ifcsstring{Xragged@#1}{L}{\RaggedLeft}{}% \ifcsstring{Xragged@#1}{R}{\RaggedRight}{}% \makehboxofhboxes - \setbox0=\hbox{{\csuse{Xnotefontsize@#1}\csuse{Xtxtbeforenotes@#1}}\unhbox0 \removehboxes}% + \setbox0=\hbox{\unhbox0 \removehboxes}% \csuse{Xbhookgroup@#1}% \csuse{Xnotefontsize@#1}% \unhbox0\par% @@ -2315,7 +2387,7 @@ \ifcsstring{Xragged@#1}{L}{\RaggedLeft}{}% \ifcsstring{Xragged@#1}{R}{\RaggedRight}{}% \makehboxofhboxes - \setbox0=\hbox{{\csuse{Xnotefontsize@#1}\csuse{Xtxtbeforenotes@#1}}\unhbox0 \removehboxes}% + \setbox0=\hbox{\unhbox0 \removehboxes}% \csuse{Xbhookgroup@#1}% \csuse{Xnotefontsize@#1}% \nottoggle{Xparindent@#1}{\parindent=\z@}{}% @@ -2333,16 +2405,29 @@ \ifhbox0{\removehboxes}\unhbox0 \fi} \newcommand{\Xinsertparafootsep}[1]{% - \ifnumequal{\csuse{#1prevpage@num}}{\page@num}% - {\ifcsdef{prevline#1}% Be sur \prevline#1 exists. - {\ifnumequal{\csuse{prevline#1}}{\line@num}% - {\ifcsempty{Xsymlinenum@#1}{\csuse{Xparafootsep@#1}}{}}% - {\csuse{Xparafootsep@#1}}% - }% - {\csuse{Xparafootsep@#1}}% - }% - {}% - \global\csname #1prevpage@num\endcsname=\page@num% + \ifledRcol@% + \ifnumequal{\csuse{#1prevpage@numR}}{\page@numR}% + {\ifcsdef{prevline#1}% Be sur \prevline#1 exists. + {\ifnumequal{\csuse{prevline#1}}{\line@numR}% + {\ifcsempty{Xsymlinenum@#1}{\csuse{Xparafootsep@#1}}{}}% + {\csuse{Xparafootsep@#1}}% + }% + {\csuse{Xparafootsep@#1}}% + }% + {}% + \global\csname #1prevpage@numR\endcsname=\page@numR% + \else% + \ifnumequal{\csuse{#1prevpage@num}}{\page@num}% + {\ifcsdef{prevline#1}% Be sur \prevline#1 exists. + {\ifnumequal{\csuse{prevline#1}}{\line@num}% + {\ifcsempty{Xsymlinenum@#1}{\csuse{Xparafootsep@#1}}{}}% + {\csuse{Xparafootsep@#1}}% + }% + {\csuse{Xparafootsep@#1}}% + }% + {}% + \global\csname #1prevpage@num\endcsname=\page@num% + \fi% } \newcount\@k \newdimen\@h \newcommand*{\Xrigidbalance}[3]{% @@ -2419,8 +2504,7 @@ \print@lemma{#1}{#2}{#4}% \csuse{Xwrapcontent@#4}{#3}% \strut\par\allowbreak} -\newcommand*{\threecolfootgroup}[1]{{\csuse{Xnotefontsize@#1}% - \noindent\csuse{Xtxtbeforenotes@#1}}% +\newcommand*{\threecolfootgroup}[1]{% \csuse{Xbhookgroup@#1}\par% \splittopskip=\ht\strutbox \expandafter @@ -2444,7 +2528,6 @@ \setXnotespositionliketwocolumns@{#1}% \print@Xfootnoterule{#1}% \fi% - {\csuse{Xnotefontsize@#1}\noindent\csuse{Xtxtbeforenotes@#1}}% \csuse{Xbhookgroup@#1}\par% \splittopskip=\ht\strutbox \expandafter @@ -2497,8 +2580,7 @@ \print@lemma{#1}{#2}{#4}% \csuse{Xwrapcontent@#4}{#3}% \strut\par\allowbreak} -\newcommand*{\twocolfootgroup}[1]{{\csuse{Xnotefontsize@#1} - \noindent\csuse{Xtxtbeforenotes@#1}}% +\newcommand*{\twocolfootgroup}[1]{% \csuse{Xbhookgroup@#1}\par% \splittopskip=\ht\strutbox \expandafter @@ -2526,7 +2608,6 @@ \setXnotespositionliketwocolumns@{#1}% \print@Xfootnoterule{#1}% \fi% - {\csuse{Xnotefontsize@#1}\noindent\csuse{Xtxtbeforenotes@#1}}% \csuse{Xbhookgroup@#1}\par% \splittopskip=\ht\strutbox \expandafter @@ -3041,7 +3122,7 @@ \iftoggle{prenotesX@}{% \togglefalse{prenotesX@}% \skip\csname footins#1\endcsname=% - \dimexpr\csuse{prenotesX@}+\csuse{afterruleX@#1}\relax% + \glueexpr\csuse{prenotesX@}+\csuse{afterruleX@#1}\relax% }% {}% }% @@ -3159,7 +3240,8 @@ \newcommand*{\arrangementX@normal}[1]{% \csgdef{series@displayX#1}{normal} \expandafter\let\csname footstart#1\endcsname=\normalfootstartX - \expandafter\newcount\csname prevpage#1@num\endcsname + \expandafter\newcount\csname prevpage#1@num\endcsname% + \expandafter\newcount\csname prevpage#1@numR\endcsname% \@namedef{@footnotemark#1}{\normal@footnotemarkX{#1}} \@namedef{bodyfootmark#1}{\normalbodyfootmarkX{#1}} \expandafter\let\csname regvfootnote#1\endcsname=\normalvfootnoteX @@ -3353,7 +3435,8 @@ \newcommand*{\arrangementX@paragraph}[1]{% \csgdef{series@displayX#1}{paragraph}% - \expandafter\newcount\csname #1prevpage@num\endcsname + \expandafter\newcount\csname prevpage#1@num\endcsname% + \expandafter\newcount\csname prevpage#1@numR\endcsname% \expandafter\let\csname footstart#1\endcsname=\parafootstartX \expandafter\let\csname regvfootnote#1\endcsname=\para@vfootnoteX \expandafter\let\csname footfmt#1\endcsname=\parafootfmtX @@ -3393,7 +3476,7 @@ \iftoggle{prenotesX@}{% \togglefalse{prenotesX@}% \skip\csname footins#1\endcsname=% - \dimexpr\csuse{prenotesX@}+\csuse{afterruleX@#1}\relax% + \glueexpr\csuse{prenotesX@}+\csuse{afterruleX@#1}\relax% }% {}% }% @@ -3507,9 +3590,17 @@ \unhbox0\par}} \newcommand{\insertparafootsepX}[1]{% - \ifnumequal{\csuse{prevpage#1@num}}{\page@num}% - {\csuse{parafootsepX@#1}}% - {}% + \ifledRcol@% + \ifnumequal{\csuse{prevpage#1@numR}}{\page@numR}% + {\csuse{Xparafootsep@#1}}% + {}% + \global\csname prevpage#1@numR\endcsname=\page@numR% + \else% + \ifnumequal{\csuse{prevpage#1@num}}{\page@num}% + {\csuse{Xparafootsep@#1}}% + {}% + \global\csname prevpage#1@num\endcsname=\page@num% + \fi% } \newcommand{\wrapped@footfootmarkX}[1]{% \ifdefined\hypertarget% @@ -4014,7 +4105,10 @@ \csgdef{Xinplaceoflemmaseparator@#1}{1em}% \csgdef{Xbeforenotes@#1}{1.2em \@plus .6em \@minus .6em} \csgdef{Xafterrule@#1}{0pt} + \csgdef{Xtxtbeforenotes@#1}{} + \newtoggle{Xtxtbeforesnotes@#1@typeset}%Not directly used by user, but internal + \csgdef{Xmaxhnotes@#1}{0.8\vsize} \newtoggle{Xnoteswidthliketwocolumns@#1}% \csgdef{Xparafootsep@#1}{}% @@ -5300,7 +5394,7 @@ \ledlsnotefontsetup%We kept it outside of the vbox, because can affect the ragging \global\setbox\l@dlp@rbox% \ifleftnoteup% - =\vbox to\z@{{\ledlsnotefontsetup\vss #1}}%We put \ledlsnotefontsetup inside footnote because required for color command. Note the {} to kept setting local. + =\vbox to\z@{{\ledlsnotefontsetup\vss #1}}%We put \ledlsnotefontsetup inside footnote because required for color command. Note the {} to keep setting local. \else% =\vbox to 0.70\baselineskip{{\ledlsnotefontsetup\strut#1\vss}}% \fi% @@ -5313,7 +5407,7 @@ \ledrsnotefontsetup%We kept it outside of the vbox, because can affect the ragging \global\setbox\l@drp@rbox% \ifrightnoteup% - =\vbox to\z@{{\ledrsnotefontsetup\vss#1}}%We put \ledrsnotefontsetup inside footnote because required for color command. Note the {} to kept setting local. + =\vbox to\z@{{\ledrsnotefontsetup\vss#1}}%We put \ledrsnotefontsetup inside footnote because required for color command. Note the {} to keep setting local. \else% =\vbox to0.7\baselineskip{{\ledrsnotefontsetup\strut#1\vss}}% \fi% @@ -5332,7 +5426,7 @@ \appto\sidenotecontent@{##1}}% Not print not separator before the 1st note {\appto\sidenotecontent@{\@sidenotesep ##1}% }% - \numgdef{\itemcount@}{\itemcount@+1}% + \numgdef{\itemcount@}{\itemcount@+\@ne}% }% \dolistloop{\l@dcsnotetext}% \ifnumgreater{\itemcount@}{1}{\led@err@ManySidenotes}{}% @@ -6001,6 +6095,266 @@ \catcode`\@=\body \setstanzavalues{szp}{0} +\newcommand{\msdata}[1]{% + \leavevmode% + \unless\ifstopmsdata@inserted@% + \stopmsdata% + \led@warning@msdatawithoutstop% + \fi% + \global\stopmsdata@inserted@false% + \unless\ifledRcol% + \protected@write\linenum@out{}{% + \string\@msd{#1}% + }% + \else% + \protected@write\linenum@outR{}{% + \string\@msd{#1}% + }% + \fi% +}% +\newcommand{\stopmsdata}[0]{% + \leavevmode% + \unless\ifledRcol% + \protected@write\linenum@out{}{% + \string\@stopmsd% + }% + \else% + \protected@write\linenum@outR{}{% + \string\@stopmsd% + }% + \fi% + \global\stopmsdata@inserted@true% +}% +\newif\ifstopmsdata@inserted@% +\newcommand{\setmsdataseries}[1]{% + \gdef\@msdata@series{#1}% +}% +\def\@msdata@series{A}% +\def\ms@data@label{Ms.}% +\newcommand{\setmsdatalabel}[1]{% + \gdef\ms@data@label{#1}% +}% +\numdef{\@msd@c}{0} +\numdef{\@msd@cR}{0} +\numdef{\add@msd@c}{0}% +\numdef{\add@msd@cR}{0}% +\def\@msdata@list{}% +\newcommand{\@msd}[1]{% + \unless\ifledRcol% + \numdef{\@msd@c}{\@msd@c+\@ne}% + \csgdef{@msdata@\@msd@c @data}{#1}% + \csxdef{@msdata@\@msd@c @linenumber}{\the\line@num}% + \csxdef{@msdata@\@msd@c @abslinenumber}{\the\absline@num}% + \xright@appenditem{\the\absline@num}\to\actionlines@list% + \xright@appenditem{-1010}\to\actions@list% + \else% + \numdef{\@msd@cR}{\@msd@cR+\@ne}% + \csgdef{@msdata@\@msd@cR @dataR}{#1}% + \csxdef{@msdata@\@msd@cR @linenumberR}{\the\line@numR}% + \csxdef{@msdata@\@msd@cR @abslinenumberR}{\the\absline@numR}% + \xright@appenditem{\the\absline@numR}\to\actionlines@listR% + \xright@appenditem{-1010}\to\actions@listR% + \fi% +}% +\newcommand{\@stopmsd}[0]{% + \unless\ifledRcol% + \ifcsundef{@msdata@\@msd@c @stoplinenumber}{% + \csxdef{@msdata@\@msd@c @stopabslinenumber}{\the\absline@num}% + \csxdef{@msdata@\@msd@c @stoplinenumber}{\the\line@num}% + }{}% + \else% + \ifcsundef{@msdata@\@msd@cR @stoplinenumberR}{% + \csxdef{@msdata@\@msd@cR @stopabslinenumberR}{\the\absline@numR}% + \csxdef{@msdata@\@msd@cR @stoplinenumberR}{\the\line@numR}% + }% + {}% + \fi% +}% +\newcommand{\add@msdata}{% + \bgroup% + \normalfont% + \unless\ifledRcol@% + \numgdef{\add@msd@c}{\add@msd@c+\@ne}% + \ifcsdef{@msdata@\add@msd@c @data}{% + \letcs{\@data}{@msdata@\add@msd@c @data}% + \edef\l@d@nums{% + 000|% Start page = we don't print it + \csuse{@msdata@\add@msd@c @linenumber}|% Start line number + 000|% Start subline number, for now, not used + 000|% End page number, we don't print it + \ifnumless{\csuse{@msdata@\add@msd@c @stopabslinenumber}}{\csuse{@lastabsline@forpage@\the\page@num}}% + {\csuse{@msdata@\add@msd@c @stoplinenumber}}%End line number if in the same page + {\csuse{@lastline@forpage@\the\page@num}}%Otherwiser, last number of the page + |% + 000|% End sub line number, for now, not used + \edfont@info%Font + }% + \@msd@options@fullpagefalse% + \if@firstlineofpage%Try if the data are for the full page. If yes, will add options to the list. + \unless\if@msdata@insertedfrompreviouspage% + \ifnumless{\csuse{@lastabsline@forpage@\the\page@num}}{\csuse{@msdata@\add@msd@c @stopabslinenumber}+\@ne}% + {% + \numdef{\@tmp}{\add@msd@c+\@ne}% + \ifcsdef{@msdata@\@tmp @abslinenumber}% + {\ifnumequal{\csuse{@msdata@\@tmp @abslinenumber}}{\csuse{@lastabsline@forpage@\the\page@num}}% + {}% + {\@msd@options@fullpagetrue}% + }% + {\@msd@options@fullpagetrue}% + }% + {}% + \fi% + \fi% + \listxadd{\@msdata@list}{% + \@msd@options@iffullpage% + \noexpand\csuse{v\@msdata@series footnote}{\@msdata@series}{{\expandonce\l@d@nums}{\ms@data@label}{\expandonce\@data}}% + \reset@msd@options@iffullpage% + }% + }% + {}% + \else% + \numgdef{\add@msd@cR}{\add@msd@cR+\@ne}% + \ifcsdef{@msdata@\add@msd@cR @dataR}{% + \letcs{\@data}{@msdata@\add@msd@cR @dataR}% + \edef\l@d@nums{% + 000|% Start page = we don't print it + \csuse{@msdata@\add@msd@cR @linenumberR}|% Start line number + 000|% Start subline number, for now, not used + 000|% End page number, we don't print it + \ifnumless{\csuse{@msdata@\add@msd@cR @stopabslinenumberR}}{\csuse{@lastline@forpageR@\the\page@numR}}% + {\csuse{@msdata@\add@msd@cR @stoplinenumberR}}%End line number if in the same page + {\csuse{@lastline@forpageR@\the\page@numR}}%Otherwiser, last number of the page + |% + 000|% End sub line number, for now, not used + \edfont@info%Font + }% + \@msd@options@fullpagefalse% + \if@firstlineofpageR% + \unless\if@msdata@insertedfrompreviouspage% + \ifnumless{\csuse{@lastabsline@forpageR@\the\page@numR}}{\csuse{@msdata@\add@msd@c @stopabslinenumberR}+\@ne}% + {% + \numdef{\@tmp}{\add@msd@cR+\@ne}% + \ifcsdef{@msdata@\@tmp @abslinenumberR}% + {\ifnumequal{\csuse{@msdata@\@tmp @abslinenumberR}}{\csuse{@lastabsline@forpageR@\the\page@numR}}% + {}% + {\@msd@options@fullpagetrue}% + }% + {\@msd@options@fullpagetrue}% + }% + {}% + \fi% + \fi% + \listxadd{\@msdata@list}{% + \@msd@options@iffullpage% + \noexpand\csuse{v\@msdata@series footnote}{\@msdata@series}{{\expandonce\l@d@nums}{\ms@data@label}{\expandonce\@data}}% + \reset@msd@options@iffullpage% + }% + }% + {}% + \fi% + \egroup% +}% +\newif\if@msdata@insertedfrompreviouspage% +\newcommand{\add@msdata@firstlineofpage}{% + \bgroup% + \normalfont% + \unless\ifledRcol@% + \ifcsdef{@msdata@\add@msd@c @data}{% + \ifnumless{\the\absline@num-\@ne}{\csuse{@msdata@\add@msd@c @stopabslinenumber}}% + {% + \global\@msdata@insertedfrompreviouspagetrue% + \letcs{\@data}{@msdata@\add@msd@c @data}% + \edef\l@d@nums{% + 000|% Start page = we don't print it + \numexpr\the\line@num+\@ne\relax|% Start line number = first line of the page. As \add@msdata@firstlineofpage is called before line number has been incremented, we increment it for printing + 000|% Start subline number, for now, not used + 000|% End page number, we don't print it + \ifnumless{\csuse{@msdata@\add@msd@c @stopabslinenumber}}{\csuse{@lastabsline@forpage@\the\page@num}}% + {\csuse{@msdata@\add@msd@c @stoplinenumber}}%End line number if in the same page + {\csuse{@lastline@forpage@\the\page@num}}%Otherwise, last number of the page + |% + 000|% End sub line number, for now, not used + \edfont@info%Font + }% + \@msd@options@fullpagefalse% + \ifnumless{\csuse{@lastabsline@forpage@\the\page@num}}{\csuse{@msdata@\add@msd@c @stopabslinenumber}+\@ne}%We will test if the ms data is for the full page + {% + \numdef{\@tmp}{\add@msd@c+\@ne}% + \ifcsdef{@msdata@\@tmp @abslinenumber}% + {\ifnumequal{\csuse{@msdata@\@tmp @abslinenumber}}{\csuse{@lastabsline@forpage@\the\page@num}}% + {}% + {\@msd@options@fullpagetrue}% + }% + {\@msd@options@fullpagetrue}% + }% + {}% + \listxadd{\@msdata@list}{% + \@msd@options@iffullpage% + \noexpand\csuse{v\@msdata@series footnote}{\@msdata@series}{{\expandonce\l@d@nums}{\ms@data@label}{\expandonce\@data}}% + \reset@msd@options@iffullpage% + }% + }% + {\global\@msdata@insertedfrompreviouspagefalse}% + }{}% + \else% + \ifcsdef{@msdata@\add@msd@cR @dataR}{% + \ifnumless{\the\absline@numR-\@ne}{\csuse{@msdata@\add@msd@cR @stopabslinenumberR}}% + {% + \global\@msdata@insertedfrompreviouspagetrue% + \letcs{\@data}{@msdata@\add@msd@cR @dataR}% + \edef\l@d@nums{% + 000|% Start page = we don't print it + \numexpr\the\line@numR+\@ne\relax|% Start line number = first line of the page. As \add@msdata@firstlineofpage is called before line number has been incremented, we increment it for printing + 000|% Start subline number, for now, not used + 000|% End page number, we don't print it + \ifnumless{\csuse{@msdata@\add@msd@cR @stopabslinenumberR}}{\csuse{@lastline@forpageR@\the\page@numR}}% + {\csuse{@msdata@\add@msd@cR @stoplinenumberR}}%End line number if in the same page + {\csuse{@lastline@forpageR@\the\page@numR}}%Otherwise, last number of the page + |% + 000|% End sub line number, for now, not used + \edfont@info%Font + }% + \@msd@options@fullpagefalse% + \ifnumless{\csuse{@lastabsline@forpageR@\the\page@numR}}{\csuse{@msdata@\add@msd@cR @stopabslinenumberR}+\@ne}% + {% + \numdef{\@tmp}{\add@msd@cR+\@ne}% + \ifcsdef{@msdata@\@tmp @abslinenumberR}% + {\ifnumequal{\csuse{@msdata@\@tmp @abslinenumberR}}{\csuse{@lastabsline@forpageR@\the\page@numR}}% + {}% + {\@msd@options@fullpagetrue}% + }% + {\@msd@options@fullpagetrue}% + }% + {}% + \listxadd{\@msdata@list}{% + \@msd@options@iffullpage% + \noexpand\csuse{v\@msdata@series footnote}{\@msdata@series}{{\expandonce\l@d@nums}{\ms@data@label}{\expandonce\@data}}% + \reset@msd@options@iffullpage% + }% + }% + {\global\@msdata@insertedfrompreviouspagefalse}% + }{}% + \fi% + \egroup% +}% +\newcommand{\insert@msdata}{% + \def\do##1{##1}% + \dolistloop{\@msdata@list}% + \global\let\@msdata@list\relax% +}% +\newif\if@msd@options@fullpage% +\newcommand{\@msd@options@iffullpage}[0]{% + \if@msd@options@fullpage% + \noexpand\toggletrue{nonum@}% + \ifdefvoid{\ms@data@label}% + {\noexpand\toggletrue{nosep@}}% + {}% + \fi% +}% +\newcommand{\reset@msd@options@iffullpage}[0]{% + \noexpand\togglefalse{nonum@}% + \noexpand\togglefalse{nosep@}% +}% \newtoks\@emptytoks \newtoks\l@denvbody diff --git a/Master/texmf-dist/tex/latex/reledmac/reledpar.sty b/Master/texmf-dist/tex/latex/reledmac/reledpar.sty index 15719b6d6d2..d01c69337ba 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/05/08 v2.9.0 reledmac extension for parallel texts]% +\ProvidesPackage{reledpar}[2016/06/03 v2.10.0a reledmac extension for parallel texts]% \RequirePackage{xspace}% \RequirePackage{xkeyval} @@ -149,6 +149,7 @@ \global\sublines@false \global\let\next@page@numR\relax \global\let\sub@change\relax + \global\stopmsdata@inserted@true% \set@continuousnumberingforR% \message{Section \the\section@numR R }% \line@list@stuffR{\jobname.\extensionchars\the\section@numR R}% @@ -995,7 +996,15 @@ \affixline@num% \fi% \xifinlist{\the\l@dpscL}{\eled@sections@@}% - {\add@inserts\affixside@note}% + {% + \if@firstlineofpage% + \set@Xtxtbeforenotes% + \global\@firstlineofpagefalse% + \fi% + \add@inserts% + \insert@msdata% + \affixside@note% + }% {\print@lineL}% }% \add@penaltiesL% @@ -1008,7 +1017,7 @@ \getline@numL% \affixline@num% \setbox\l@dleftbox \hb@xt@ \Lcolwidth{% - \l@dld@ta %space kept for backward compatibility + \l@dld@ta% \hspace*{\Lcolwidth}% \ledrlfill\l@drd@ta% }% @@ -1021,9 +1030,14 @@ \def\print@lineL{% \affixpstart@numL% - \l@dld@ta %space kept for backward compatibility + \l@dld@ta% + \if@firstlineofpage% + \set@Xtxtbeforenotes% + \global\@firstlineofpagefalse% + \fi% + \insert@msdata% \add@inserts\affixside@note% - \l@dlsn@te %space kept for backward compatibility + \l@dlsn@te% \hb@xt@ \Lcolwidth{\ledllfill\hb@xt@ \wd\one@line{% \do@insidelineLhook% \ifluatex% @@ -1032,7 +1046,7 @@ \new@lineL% \inserthangingsymbolL% \l@dunhbox@line{\one@line}}\ledrlfill\l@drd@ta% - \l@drsn@te}} + \l@drsn@te}}% \def\print@eledsectionL{%% \addtocounter{pstartL}{-1}% @@ -1105,7 +1119,15 @@ \affixline@numR% \fi% \xifinlist{\the\l@dpscR}{\eled@sectionsR@@}% - {\add@insertsR\affixside@noteR}% + {% + \if@firstlineofpageR% + \set@Xtxtbeforenotes% + \global\@firstlineofpageRfalse% + \fi% + \insert@msdata% + \add@insertsR% + \affixside@noteR% + }% {\print@lineR}% }% \add@penaltiesR% @@ -1118,7 +1140,7 @@ \getline@numR% \setbox\l@drightbox \hb@xt@ \Rcolwidth{% \affixline@numR% - \l@dld@ta %space kept for backward compatibility + \l@dld@ta% \hspace*{\Rcolwidth}% \ledrlfill\l@drd@ta% }% @@ -1134,9 +1156,14 @@ \def\print@lineR{% \affixpstart@numR% - \l@dld@ta %space kept for backward compatibility + \l@dld@ta% + \if@firstlineofpageR% + \set@Xtxtbeforenotes% + \global\@firstlineofpageRfalse% + \fi% + \insert@msdata% \add@insertsR\affixside@noteR% - \l@dlsn@te %space kept for backward compatibility + \l@dlsn@te% \hb@xt@ \Rcolwidth{\ledllfill\hb@xt@ \wd\one@lineR{% \do@insidelineRhook% \new@lineR% @@ -1228,32 +1255,34 @@ \newif\ifl@dskipversenumberR \newcommand*{\do@actions@fixedcodeR}{% \ifcase\@l@dtempcnta% - \or% % 1001 + \or% % 1001 = starting sublineation \global\sublines@true - \or% % 1002 + \or% % 1002 = ending sublineation \global\sublines@false - \or% % 1003 + \or% % 1003 = starting locking number \global\@lockR=\@ne - \or% % 1004% + \or% % 1004 = ending locking number \ifnum\@lockR=\tw@ \global\@lockR=\thr@@ \else \global\@lockR=\z@ \fi - \or% % 1005 + \or% % 1005 = starting locking subnumber \global\sub@lockR=\@ne - \or% % 1006 + \or% % 1006 = ending locking subnumber \ifnum\sub@lockR=\tw@ \global\sub@lockR=\thr@@ \else \global\sub@lockR=\z@ \fi - \or% % 1007 + \or% % 1007 = skipping numbering \l@dskipnumbertrue - \or% % 1008 + \or% % 1008 = skipping numbering in stanza \l@dskipversenumberRtrue% - \or% % 1009 + \or% % 1009 = hiding number \l@dhidenumbertrue% + \or% % 1010 = inserting msdata + \add@msdata% \else% \led@warn@BadAction \fi% @@ -1264,10 +1293,12 @@ \@l@dtempcntb=\absline@numR \ifnum\@l@dtempcntb<\next@actionlineR\else \ifnum\next@actionR>-1001\relax + \@firstlineofpageRtrue% \global\page@numR=\next@actionR \ifbypage@R \global\line@numR \z@ \global\subline@numR \z@ \fi + \add@msdata@firstlineofpage% \else \ifnum\next@actionR<-4999\relax % 9/05 added relax here \@l@dtempcnta=-\next@actionR |