diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/reledmac/reledmac.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/reledmac/reledmac.sty | 165 |
1 files changed, 123 insertions, 42 deletions
diff --git a/Master/texmf-dist/tex/latex/reledmac/reledmac.sty b/Master/texmf-dist/tex/latex/reledmac/reledmac.sty index 74e63cd12c4..5e12a48f12f 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}[2017/07/31 v2.23.0 typesetting critical editions]% +\ProvidesPackage{reledmac}[2017/08/17 v2.24.0 typesetting critical editions]% \RequirePackage{xkeyval} \newif\ifparledgroup \DeclareOptionX{series}[A,B,C,D,E]{\xdef\default@series{#1}} @@ -114,6 +114,7 @@ \ProcessOptionsX*\relax \RequirePackage{xargs} +\RequirePackage{xparse}% \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}})}% @@ -370,7 +371,7 @@ \global\@afterindenttrue%In order to retablish normal feature if the \begingroup was not here \initnumbering@quote \ifwidthliketwocolumns% - \csuse{setwidthliketwocolumns@\columns@position}% + \setwidthliketwocolumns% \csuse{setpositionliketwocolumns@\columns@position}% \fi% \fi @@ -399,6 +400,11 @@ \global\sublines@false \global\let\next@page@num=\relax \global\let\sub@change=\relax + \global\last@page@num=-10000% + \ifdefined\line@numR% + \line@numR=\z@% + \last@page@numR=\z@% + \fi% \resetprevline@ \resetprevpage@num \global\stopmsdata@inserted@true% @@ -438,26 +444,34 @@ \endgroup \fi } +\newcount\pausenumbering@page@num% \newcommand{\pausenumbering}{% + \ifx\next@page@num\relax% + \global\pausenumbering@page@num=0% + \else% + \global\pausenumbering@page@num=\next@page@num% + \fi% \ifautopar\global\autopar@pausetrue\fi% \endnumbering\global\numberingtrue} +\newif\ifresumenumbering@start% \newcommand*{\resumenumbering}{% \ifnumbering \ifautopar@pause\autopar\fi \global\pst@rtedLtrue \global\advance\section@num \@ne + \global\resumenumbering@starttrue% \led@mess@SectionContinued{\the\section@num}% + \set@continuousnumberingforL% \line@list@stuff{\jobname.\extensionchars\the\section@num}% \l@dend@stuff \ifl@dpairing\else% \begingroup% \initnumbering@quote% \ifwidthliketwocolumns% - \csuse{setwidthliketwocolumns@\columns@position}% + \setwidthliketwocolumns% \csuse{setpositionliketwocolumns@\columns@position}% \fi% \fi% - \set@continuousnumberingforL% \else \led@err@NumberingShouldHaveStarted \endnumbering @@ -468,7 +482,9 @@ \ifcontinuousnumberingwithcolumns% \ifdefined\line@numR% \ifnum\line@numR>\line@num% - \expandafter\setlinenum\expandafter{\the\line@numR}% + \global\appto\next@line@list@stuff{% + \expandafter\setlinenum\expandafter{\the\line@numR}% + }% \fi% \ifnum\last@page@numR>\last@page@num% \global\last@page@num=\last@page@numR% @@ -733,12 +749,6 @@ \fi% \list@clear{\maxlinesinpar@list} \get@linelistfile{#1}% - \ifcontinuousnumberingwithcolumns - \global\page@numR=\page@numR\relax - \global\last@page@numR=\last@page@numR\relax - \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}% @@ -808,6 +818,7 @@ \newcommand*{\@nl@reg}{% \ifx\l@dchset@num\relax \else \advance\absline@num \@ne + \csgdef{l@dchset@num@\the\absline@num}{}%To remember this line have been marked by a \setlinenum \set@line@action \let\l@dchset@num=\relax \advance\absline@num \m@ne @@ -859,11 +870,13 @@ \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@ + \ifx\l@dchset@num\relax%Not resetting if preceded by a \setlinenum + \line@numR \z@ \subline@numR \z@% + \fi% \fi - \page@numR=#1\relax - \last@page@numR=#1\relax - \def\next@page@numR{#1}% + \global\page@numR=#1% + \global\last@page@numR=#1% + \global\def\next@page@numR{#1}% \fi \else \ifnum #1=\last@page@num @@ -871,11 +884,13 @@ \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@ + \ifx\l@dchset@num\relax%Not resetting if preceded by a \setlinenum + \line@num \z@ \subline@num \z@% + \fi% \fi - \page@num=#1\relax - \last@page@num=#1\relax - \def\next@page@num{#1}% + \global\page@num=#1% + \global\last@page@num=#1% + \global\def\next@page@num{#1}% \listxadd{\normal@page@break}{\the\absline@num} \fi \fi} @@ -1215,6 +1230,7 @@ \newif\iffirst@linenum@out@ \first@linenum@out@true \newcommand{\this@line@list@version}{7}% +\let\next@line@list@stuff\relax% \newcommand*{\line@list@stuff}[1]{% \global\newtoggle{notfirstrun@#1}% \IfFileExists{\l@auxdir#1}% @@ -1222,7 +1238,6 @@ {\global\togglefalse{notfirstrun@#1}}% \read@linelist{#1}% \iffirst@linenum@out@ - \immediate\closeout\linenum@out% \global\first@linenum@out@false% \immediate\openout\linenum@out=\l@auxdir#1\relax% \immediate\write\linenum@out{\string\line@list@version{\this@line@list@version}}% @@ -1239,7 +1254,10 @@ \ifl@dpaging% \write\linenum@out{\string\@par@sync@option{\@par@this@sync@option}}% \fi% - \fi} + \fi% + \next@line@list@stuff% + \global\let\next@line@list@stuff\relax% +}% \newcommand*{\new@line}{% \IfStrEq{\led@pb@setting}{after}% @@ -1551,12 +1569,7 @@ \newcommand{\get@sw@txt}[1]{% \begingroup% - \let\sameword\@firstofone%Allow to have nested \sameword - \let\emph\@firstofone% - \let\textit\@firstofone% - \let\textbf\@firstofone% - \let\textsc\@firstofone% - \let\framebox\@firstofone% + \swnoexpands% \ifsw@caseinsensitive% \def\@tmpa##1{\lowercase{##1}}% \else% @@ -1569,6 +1582,26 @@ \fi% \endgroup% }% +\newcommand{\swnoexpands}{% + \let\sameword\@firstofone%Allow to have nested \sameword + \let\emph\@firstofone% + \let\textit\@firstofone% + \let\textbf\@firstofone% + \let\textsc\@firstofone% + \let\framebox\@firstofone% + \RenewExpandableDocumentCommand{\edindex}{om}{}% + \ifdefined\index% + \RenewExpandableDocumentCommand{\index}{om}{}% + \fi% + \let\selectlanguage\@gobble% + \let\foreignlanguage\@secondoftwo% + \ifdefined\xpg@loaded% + \renewcommand\do[1]{% + \expandafter\RenewExpandableDocumentCommand\expandafter{\csname text##1\endcsname}{om}{####2}% + }% + \expandafter\docsvlist\expandafter{\xpg@loaded}% + \fi% +}% \newcommandx{\sameword}[2][1,usedefault]{% \leavevmode% \get@sw@txt{#2}% @@ -1754,8 +1787,8 @@ \fi% \fi% \numberedpar@true% - \iflabelpstart\protected@edef\@currentlabel% - {\p@pstart\thepstart} + \iflabelpstart% + \protected@edef\@currentlabel{\p@pstart\thepstart}% \fi% \l@dzeropenalties% \@at@start@every@pstart% @@ -1964,9 +1997,27 @@ \gdef\l@dcsnotetext{}} \newcommand{\l@dlsn@te}{% - \hb@xt@ \z@{\hss\box\l@dlp@rbox\kern\ledlsnotesep}} + \ifboolexpr{% + bool {l@dprintingcolumns}% + and bool {ledRcol@}% + }{% If we are on a right column + \@tempdima=\@morespace@leftnote@rightcolumn% + }{% + \@tempdima=\z@% + }% + \hb@xt@ \z@{\hss\box\l@dlp@rbox\kern\ledlsnotesep\hskip\@tempdima}% +}% \newcommand{\l@drsn@te}{% - \hb@xt@ \z@{\kern\ledrsnotesep\box\l@drp@rbox\hss}} + \ifboolexpr{% + bool {l@dprintingcolumns}% + and not bool {ledRcol@}% + }{% If we are on a left column + \@tempdima=\@morespace@rightnote@leftcolumn% + }{% + \@tempdima=\z@% + }% + \hb@xt@ \z@{\hskip\@tempdima\kern\ledrsnotesep\box\l@drp@rbox\hss}% +}% \newcommand*{\ledllfill}{\hfil} \newcommand*{\ledrlfill}{} @@ -2005,11 +2056,28 @@ \ifnum\absline@num<\next@actionline\else \ifnum\next@action>-1001 \global\page@num=\next@action - \global\@firstlineofpagetrue% + \ifresumenumbering@start% + \setbox0=\hbox{}%Required to get the correct page number, when the \resumenumbering is just after a \newpage + \ifnum\pausenumbering@page@num<\page@num% + \global\resumenumbering@startfalse% + \fi% + \fi% + \unless\ifresumenumbering@start% + \global\@firstlineofpagetrue% + \fi% \ifbypage@ - \global\line@num=\z@ \global\subline@num=\z@ - \resetprevline@ + \ifcsdef{l@dchset@num@\the\absline@num}% + {% + \global\csundef{l@dchset@num@\the\absline@num}% + }% + {% + \unless\ifresumenumbering@start% + \global\line@num=\z@ \global\subline@num=\z@% + \resetprevline@% + \fi% + }% \fi + \global\resumenumbering@startfalse% \add@msdata@firstlineofpage% \else \ifnum\next@action<-4999 @@ -2127,11 +2195,26 @@ \ifnum\@l@dtempcntb>\@ne \advance\@l@dtempcntb \page@num \fi - \ifodd\@l@dtempcntb + \ifboolexpr{% + bool {l@dprintingcolumns}% + and (% + (test {\ifdefstring{\linenum@OnlyPages@ForColumns}{left}}% + and test {\ifnumodd{\page@num}}% + )% + or% + (test {\ifdefstring{\linenum@OnlyPages@ForColumns}{right}}% + and not test {\ifnumodd{\page@num}}% + )% + )% + }% + {}% + {% + \ifodd\@l@dtempcntb% \gdef\l@drd@ta{\rlap{{\rightlinenum}}}% - \else + \else% \gdef\l@dld@ta{\llap{{\leftlinenum}}}% - \fi + \fi% + }% \fi \fi \fi @@ -4110,7 +4193,7 @@ \let\old@columwidth=\columnwidth% \iftoggle{Xnoteswidthliketwocolumns@#1}% {% - \csuse{setwidthliketwocolumns@\columns@position}% + \setwidthliketwocolumns% \global\let\hsize@fornote=\hsize% }% {}% @@ -4124,7 +4207,7 @@ \let\old@columwidth=\columnwidth% \iftoggle{noteswidthliketwocolumnsX@#1}% {% - \csuse{setwidthliketwocolumns@\columns@position}% + \setwidthliketwocolumns% \global\let\hsize@fornote=\hsize% }% {}% @@ -5446,9 +5529,7 @@ \newcommand*{\zz@@@}{000|000|000}% Set three counters to zero in one go \newcommand*{\edlabel}[1]{% - \ifl@dpairing\ifautopar% - \strut% - \fi\fi% + \leavevmode% \@bsphack% \ifboolexpr{bool{ledRcol} or bool{ledRcol@}}{% \ifXnote@% |