summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/reledmac/reledpar.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-08-17 21:16:23 +0000
committerKarl Berry <karl@freefriends.org>2017-08-17 21:16:23 +0000
commit8752481311daf908372f21728c152ca10ae0973e (patch)
treeec009734d0de97ee4fed31d17425243eaac1ccad /Master/texmf-dist/tex/latex/reledmac/reledpar.sty
parent0f4a34d1fe6262bc72205b50adb2ae5ab576d427 (diff)
reledmac (17aug17)
git-svn-id: svn://tug.org/texlive/trunk@45055 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/reledmac/reledpar.sty')
-rw-r--r--Master/texmf-dist/tex/latex/reledmac/reledpar.sty259
1 files changed, 193 insertions, 66 deletions
diff --git a/Master/texmf-dist/tex/latex/reledmac/reledpar.sty b/Master/texmf-dist/tex/latex/reledmac/reledpar.sty
index 04598785b77..af89d06a767 100644
--- a/Master/texmf-dist/tex/latex/reledmac/reledpar.sty
+++ b/Master/texmf-dist/tex/latex/reledmac/reledpar.sty
@@ -27,9 +27,8 @@
-
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{reledpar}[2017/08/10 v2.19.5 reledmac extension for parallel texts]%
+\ProvidesPackage{reledpar}[2017/08/17 v2.20.0 reledmac extension for parallel texts]%
\RequirePackage{xspace}%
\RequirePackage{xkeyval}
@@ -61,6 +60,10 @@
\DeclareOptionX{movecolumnspositiononrightpage}{%
\movecolumnspositiononrightpagetrue%
}%
+\newif\if@sidenotesmarginpage%
+\DeclareOptionX{sidenotesmarginpage}{%
+ \@sidenotesmarginpagetrue%
+}%
\DeclareOptionX{parledgroup}{\parledgrouptrue}
\DeclareOptionX{widthliketwocolumns}{\widthliketwocolumnstrue}%
\DeclareOptionX{continuousnumberingwithcolumns}{\continuousnumberingwithcolumnstrue}%
@@ -200,16 +203,19 @@
\global\sublines@Rfalse
\global\let\next@page@numR\relax
\global\let\sub@change\relax
+ \global\last@page@numR=-10000%
\global\stopmsdata@inserted@true%
\global\let\@msdata@list\relax%
\global\csundef{@msdata@\add@msd@cR @dataR}%
\ifcontinuousnumberingwithcolumns%
- \addtocounter{pstartR}{1}%
+ \ifnumberpstart%
+ \addtocounter{pstartR}{1}%
+ \fi%
\else%
\setcounter{pstartR}{1}%
\fi%
- \set@continuousnumberingforR%
\message{Section \the\section@numR R }%
+ \set@continuousnumberingforR%
\line@list@stuffR{\jobname.\extensionchars\the\section@numR R}%
\l@dend@stuff
\begingroup
@@ -286,20 +292,28 @@
\let\c@subsection\c@subsectionR%
\let\c@subsubsection\c@subsubsectionR%
}%
+\newcount\pausenumbering@page@numR%
\newcommand*{\pausenumberingR}{%
+ \ifx\next@page@numR\relax%
+ \global\pausenumbering@page@numR=0%
+ \else%
+ \global\pausenumbering@page@numR=\next@page@numR%
+ \fi%
\endnumberingR\global\numberingRtrue}
+\newif\ifresumenumberingR@start%
\newcommand*{\resumenumberingR}{%
\ifnumberingR
\global\pst@rtedRtrue
\global\advance\section@numR \@ne
+ \global\resumenumberingR@starttrue%
\led@mess@SectionContinued{\the\section@numR R}%
+ \set@continuousnumberingforR%
\line@list@stuffR{\jobname.\extensionchars\the\section@numR R}%
\l@dend@stuff
\begingroup%
\initnumbering@sectcountR%
- \set@continuousnumberingforR%
\else
- \led@err@numberingShouldHaveStarted
+ \led@err@NumberingShouldHaveStarted
\endnumberingR
\beginnumberingR
\fi}
@@ -360,7 +374,9 @@
\newcommand{\set@continuousnumberingforR}{%
\ifcontinuousnumberingwithcolumns%
\ifnum\line@numR<\line@num%
- \expandafter\setlinenum\expandafter{\the\line@num}%
+ \global\appto\next@line@list@stuffR{%
+ \expandafter\setlinenum\expandafter{\the\line@num}%
+ }%
\fi%
\ifnum\last@page@num>\last@page@numR%
\global\last@page@numR=\last@page@num%
@@ -418,6 +434,15 @@
\fi%
}%
+\def\linenum@OnlyPages@ForColumns{}%
+\newcommand{\linenumOnlyPagesForColumns}[1]{%
+ \gdef\linenum@OnlyPages@ForColumns{#1}%
+}%
+
+\def\linenum@OnlyPages@ForColumnsR{}%
+\newcommand{\linenumOnlyPagesForColumnsR}[1]{%
+ \gdef\linenum@OnlyPages@ForColumnsR{#1}%
+}%
\newcounter{firstlinenumR}
\setcounter{firstlinenumR}{5}
\newcounter{linenumincrementR}
@@ -529,6 +554,7 @@
\newcommand{\@nl@regR}{%
\ifx\l@dchset@num\relax \else
\advance\absline@numR \@ne
+ \csgdef{l@dchset@num@R\the\absline@numR}{}%To remember this line have been marked by a \setlinenum
\set@line@action
\let\l@dchset@num\relax
\advance\absline@numR \m@ne
@@ -700,6 +726,8 @@
\newwrite\linenum@outR
\newif\iffirst@linenum@out@R
\first@linenum@out@Rtrue
+
+\let\next@line@list@stuffR\relax%
\newcommand*{\line@list@stuffR}[1]{%
\global\newtoggle{notfirstrun@#1}%
\IfFileExists{\l@auxdir#1}%
@@ -707,7 +735,6 @@
{\global\togglefalse{notfirstrun@#1}}%
\read@linelist{#1}%
\iffirst@linenum@out@R
- \immediate\closeout\linenum@outR
\global\first@linenum@out@Rfalse
\immediate\openout\linenum@outR=\l@auxdir#1%
\immediate\write\linenum@outR{\string\line@list@version{\this@line@list@version}}%
@@ -720,7 +747,10 @@
\fi%
\closeout\linenum@outR%
\openout\linenum@outR=\l@auxdir#1%
- \fi}
+ \fi%
+ \next@line@list@stuffR%
+ \global\let\next@line@list@stuffR\relax%
+}%
\newcommand*{\new@lineL}{%
\write\linenum@out{\string\@nl[\the\c@page][\thepage]}}
@@ -954,8 +984,9 @@
\@at@start@every@pstart%
\hsize=\Lcolwidth%
\numberedpar@true%
- \iflabelpstart\protected@edef\@currentlabel%
- {\p@pstartL\thepstartL}\fi%
+ \iflabelpstart%
+ \protected@edef\@currentlabel{\p@pstartL\thepstartL}%
+ \fi%
\providetoggle{before@pstartL@\the\l@dnumpstartsL @par}%
\ifboolexpr{%
test {\ifstrempty{#1}}%
@@ -1026,8 +1057,9 @@
\@at@start@every@pstart%
\hsize=\Rcolwidth%
\numberedpar@true%
- \iflabelpstart\protected@edef\@currentlabel%
- {\p@pstartR\thepstartR}\fi%
+ \iflabelpstart%
+ \protected@edef\@currentlabel{\p@pstartR\thepstartR}%
+ \fi%
\providetoggle{before@pstartR@\the\l@dnumpstartsR @par}%
\ifboolexpr{%
test {\ifstrempty{#1}}%
@@ -1071,10 +1103,10 @@
\dump@pstartL@pc%
\ifnumberpstart%
\addtocounter{pstartL}{1}%
+ \ifcontinuousnumberingwithcolumns%
+ \addtocounter{pstart}{1}%
+ \fi%
\fi
- \ifcontinuousnumberingwithcolumns%
- \addtocounter{pstart}{1}%
- \fi%
\parledgroup@beforenotes@save{L}%
\providetoggle{after@pendL@\the\l@dnumpstartsL @par}%
\ifboolexpr{%
@@ -1500,11 +1532,23 @@
\@l@dtempcntb=\absline@numR
\ifnum\@l@dtempcntb<\next@actionlineR\else
\ifnum\next@actionR>-1001\relax
- \@firstlineofpageRtrue%
+ \unless\ifresumenumberingR@start%
+ \@firstlineofpageRtrue%
+ \fi%
\global\page@numR=\next@actionR
\ifbypage@R
- \global\line@numR \z@ \global\subline@numR \z@
+ \ifcsdef{l@dchset@num@R\the\absline@numR}%
+ {%
+ \global\csundef{l@dchset@num@R\the\absline@numR}%
+ }%
+ {%
+ \unless\ifresumenumberingR@start%
+ \global\line@numR \z@%
+ \global\subline@numR \z@%
+ \fi%
+ }%
\fi
+ \global\resumenumberingR@startfalse%
\add@msdata@firstlineofpage%
\else
\ifnum\next@actionR<-4999\relax % 9/05 added relax here
@@ -1630,11 +1674,26 @@
\ifnum\@l@dtempcntb>\@ne
\advance\@l@dtempcntb by\page@numR
\fi
- \ifodd\@l@dtempcntb
- \gdef\l@drd@ta{\rlap{{\rightlinenumR}}}%
- \else
- \gdef\l@dld@ta{\llap{{\leftlinenumR}}}%
- \fi
+ \ifboolexpr{%
+ bool {l@dprintingcolumns}%
+ and (%
+ (test {\ifdefstring{\linenum@OnlyPages@ForColumnsR}{left}}%
+ and test {\ifnumodd{\page@numR}}%
+ )%
+ or%
+ (test {\ifdefstring{\linenum@OnlyPages@ForColumnsR}{right}}%
+ and not test {\ifnumodd{\page@numR}}%
+ )%
+ )%
+ }%
+ {}%
+ {%
+ \ifodd\@l@dtempcntb%
+ \gdef\l@drd@ta{\rlap{{\rightlinenumR}}}%
+ \else%
+ \gdef\l@dld@ta{\llap{{\leftlinenumR}}}%
+ \fi%
+ }%
\fi
\fi
\fi
@@ -1911,7 +1970,18 @@
\sidenotemarginR{outer}%
\fi%
+\newdimen\@morespace@leftnote@rightcolumn%
+\newdimen\@morespace@rightnote@leftcolumn%
+\newcommand{\get@sidenote@morespace@columns}{%
+ \if@sidenotesmarginpage%
+ \global\@morespace@leftnote@rightcolumn=\dimexpr\intercolumns@width + \Lcolwidth\relax%
+ \global\@morespace@rightnote@leftcolumn=\dimexpr\intercolumns@width + \Rcolwidth\relax%
+ \else%
+ \global\@morespace@leftnote@rightcolumn=\z@%
+ \global\@morespace@rightnote@leftcolumn=\z@%
+ \fi%
+}%
\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@{}%
@@ -2214,6 +2284,8 @@
\global\l@dpscL=\z@
\global\l@dpscR=\z@
\get@familiarfootnote@number%
+ \get@intercolumns@width%
+ \get@sidenote@morespace@columns%
\check@pstarts
\loop\if@pstarts
\global\pstartnumtrue
@@ -2298,6 +2370,101 @@
\hspace{\aftercolumnseparator}%
\fi%
}%
+\newdimen\intercolumns@width%
+\newcommand{\get@intercolumns@width}{%
+ \global\intercolumns@width=\z@%
+ \ifdefstring{\columns@position}{C}%
+ {%
+ \ifboolexpr{%
+ test {\ifdimless{\beforecolumnseparator}{\z@}}%
+ and test {\ifdimless{\aftercolumnseparator}{\z@}}%
+ }%
+ {%
+ \global\intercolumns@width=\dimexpr%
+ \columnrulewidth +%
+ (\textwidth - \Lcolwidth - \Rcolwidth - \columnrulewidth)*1/2% The total of the width before and after column separator
+ \relax%
+ }%
+ {}%
+ \ifboolexpr{%
+ test {\ifdimgreater{\beforecolumnseparator}{\z@}}%
+ and test {\ifdimgreater{\aftercolumnseparator}{\z@}}%
+ }%
+ {%
+ \global\intercolumns@width=\dimexpr%
+ \columnrulewidth + \beforecolumnseparator + \aftercolumnseparator%
+ \relax%
+ }%
+ {}%
+ \ifboolexpr{%
+ test {\ifdimgreater{\beforecolumnseparator}{\z@}}%
+ and test {\ifdimless{\aftercolumnseparator}{\z@}}%
+ }%
+ {%
+ \global\intercolumns@width=\dimexpr%
+ \columnrulewidth + \beforecolumnseparator +%
+ (\textwidth - \Lcolwidth - \Rcolwidth - \columnrulewidth - \beforecolumnseparator) * 1/3%
+ \relax%
+ }%
+ {}%
+ \ifboolexpr{%
+ test {\ifdimless{\beforecolumnseparator}{\z@}}%
+ and test {\ifdimgreater{\aftercolumnseparator}{\z@}}%
+ }%
+ {%
+ \global\intercolumns@width=\dimexpr%
+ \columnrulewidth + \aftercolumnseparator +%
+ (\textwidth - \Lcolwidth - \Rcolwidth - \columnrulewidth - \aftercolumnseparator) * 1/3%
+ \relax%
+ }%
+ {}%
+ }%
+ {%
+ \ifboolexpr{%
+ test {\ifdimless{\beforecolumnseparator}{\z@}}%
+ and test {\ifdimless{\aftercolumnseparator}{\z@}}%
+ }%
+ {%
+ \global\intercolumns@width=\dimexpr%
+ \columnrulewidth +%
+ (\textwidth - \Lcolwidth - \Rcolwidth - \columnrulewidth)*2/3% The total of the width before and after column separator
+ \relax%
+ }%
+ {}%
+ \ifboolexpr{%
+ test {\ifdimgreater{\beforecolumnseparator}{\z@}}%
+ and test {\ifdimgreater{\aftercolumnseparator}{\z@}}%
+ }%
+ {%
+ \global\intercolumns@width=\dimexpr%
+ \columnrulewidth + \beforecolumnseparator + \aftercolumnseparator%
+ \relax%
+ }%
+ {}%
+ \ifboolexpr{%
+ test {\ifdimgreater{\beforecolumnseparator}{\z@}}%
+ and test {\ifdimless{\aftercolumnseparator}{\z@}}%
+ }%
+ {%
+ \global\intercolumns@width=\dimexpr%
+ \columnrulewidth + \beforecolumnseparator +%
+ (\textwidth - \Lcolwidth - \Rcolwidth - \columnrulewidth - \beforecolumnseparator) * 1/2%
+ \relax%
+ }%
+ {}%
+ \ifboolexpr{%
+ test {\ifdimless{\beforecolumnseparator}{\z@}}%
+ and test {\ifdimgreater{\aftercolumnseparator}{\z@}}%
+ }%
+ {%
+ \global\intercolumns@width=\dimexpr%
+ \columnrulewidth + \aftercolumnseparator +%
+ (\textwidth - \Lcolwidth - \Rcolwidth - \columnrulewidth - \aftercolumnseparator) * 1/2%
+ \relax%
+ }%
+ {}%
+ }%
+}%
\newcommand{\print@leftcolumn}{%
\if\page@num>\page@numR%
\@l@dtempcntb=\page@num%
@@ -2381,15 +2548,9 @@
\newlength{\aftercolumnseparator}%
\setlength{\aftercolumnseparator}{-2pt}%
-\newcommand{\setwidthliketwocolumns@L}{%
- \newdimen\temp%
- \temp=\hsize%
- \hsize=\Lcolwidth%
- \advance\hsize\Rcolwidth%
- \advance\temp-\hsize%
- \multiply\temp by 2%
- \divide\temp by 3%
- \advance\hsize\temp%
+\newcommand{\setwidthliketwocolumns}{%
+ \get@intercolumns@width%As \columns is not necessary called before \setwidthliketwocolumns
+ \hsize=\dimexpr \Lcolwidth + \intercolumns@width + \Rcolwidth \relax%
}%
\newcommand{\setpositionliketwocolumns@L}{%
@@ -2399,16 +2560,6 @@
\newcommand{\setnotespositionliketwocolumns@L}{%
}%
-\newcommand{\setwidthliketwocolumns@C}{%
- \newdimen\temp%
- \temp=\hsize%
- \hsize=\Lcolwidth%
- \advance\hsize\Rcolwidth%
- \advance\temp-\hsize%
- \divide\temp by 2%
- \advance\hsize\temp%
-}%
-
\newcommand{\setpositionliketwocolumns@C}{%
\doinsidelinehook{\hfill}%
\renewcommand{\ledrlfill}{\hfill}%
@@ -2426,33 +2577,9 @@
\rightskip=-\temp%
}%
-\newcommand{\setwidthliketwocolumns@R}{%
- \newdimen\temp%
- \temp=\hsize%
- \hsize=\Lcolwidth%
- \advance\hsize\Rcolwidth%
- \advance\temp-\hsize%
- \multiply\temp by 2%
- \divide\temp by 3%
- \advance\hsize\temp%
-}%
-
\newcommand{\setpositionliketwocolumns@R}{%
\doinsidelinehook{\hfill}%
}%
-
-\newcommand{\setnotespositionliketwocolumns@R}{%
- \newdimen\temp%
- \newdimen\tempa%
- \temp=\hsize%
- \tempa=\Lcolwidth%
- \advance\tempa\Rcolwidth%
- \advance\temp-\tempa%
- \divide\temp by 2%
- \leftskip=\temp%
- \rightskip=-\temp%
-}%
-
\newcommand{\Columns@print@before@pstart}{%
\ifboolexpr{%
test{\ifcsstring{before@pstartL@\the\l@dpscL}{\at@every@pstart}}%