summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/reledmac/reledpar.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-11-13 22:34:12 +0000
committerKarl Berry <karl@freefriends.org>2015-11-13 22:34:12 +0000
commitc5e0cd049cb657a40e15cef1fddf373161d5615d (patch)
treeae6c99f7df2f58569060989b2f43ba3fdd71ab5f /Master/texmf-dist/tex/latex/reledmac/reledpar.sty
parent22e97b885e90c0253656b4ca0015e655034b05ad (diff)
reledmac (13nov15)
git-svn-id: svn://tug.org/texlive/trunk@38840 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.sty109
1 files changed, 82 insertions, 27 deletions
diff --git a/Master/texmf-dist/tex/latex/reledmac/reledpar.sty b/Master/texmf-dist/tex/latex/reledmac/reledpar.sty
index 296d26489e3..8c75f2dd8a2 100644
--- a/Master/texmf-dist/tex/latex/reledmac/reledpar.sty
+++ b/Master/texmf-dist/tex/latex/reledmac/reledpar.sty
@@ -28,7 +28,7 @@
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{reledpar}[2015/10/26 v2.5.2 reledmac extension for parallel texts]%
+\ProvidesPackage{reledpar}[2015/11/13 v2.6.0 reledmac extension for parallel texts]%
\RequirePackage{xspace}%
\RequirePackage{xkeyval}
@@ -76,10 +76,17 @@
\newcommand*{\led@err@BadLeftRightPstarts}[2]{%
\reledpar@error{The numbers of left (#1) and right (#2)
\string\pstart s do not match}{\@ehc}}
+\providebool{syntax@}
\newcommand*{\led@err@LeftOnRightPage}{%
- \reledpar@error{The left page has ended on a right page}{\@ehc}}
+ \notbool{syntax@}%
+ {\reledpar@error{The left page has ended on a right page}{\@ehc}}%
+ {}%
+ }
\newcommand*{\led@err@RightOnLeftPage}{%
- \reledpar@error{The right page has ended on a left page}{\@ehc}}
+ \notbool{syntax@}%
+ {\reledpar@error{The right page has ended on a left page}{\@ehc}}
+ {}%
+ }%
\newcommand*{\led@err@Leftside@PreviousNotPrinted}{%
\reledpar@error{You call a new Leftside environment while the previous one has not been typeset by \string\Pages\space or \string\Columns}{\@ehc}}
\newcommand*{\led@err@Rightside@PreviousNotPrinted}{%
@@ -88,6 +95,11 @@
\reledpar@error{\string\Pages\space must be called *outside* of the `pages` environment}{\@ehc}}
\newcommand*{\led@err@Columns@InsideEnv}{%
\reledpar@error{\string\Columns\space must be called *outside* of the `pairs` environment}{\@ehc}}
+\newcommand*{\led@err@Pages@WithoutEnv}{%
+ \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@error@fail@patch@thepage}{%
\reledpar@error{Fail to patch \string\@thepage\space command.}{\@ehc}%
}%
@@ -177,12 +189,34 @@
\newcounter{sectionR}
\newcounter{subsectionR}
\newcounter{subsubsectionR}
+
+\newcount\old@chapter%
+\newcount\old@section%
+\newcount\old@subsection%
+\newcount\old@subsubsection%
+\newcommand{\save@section@number}{%
+ \ifdefined\c@chapter%
+ \global\old@chapter\value{chapter}%
+ \fi%
+ \global\old@section\value{section}%
+ \global\old@subsection\value{subsection}%
+ \global\old@subsubsection\value{subsubsection}%
+}%
\newcommand{\initnumbering@sectcountR}{
- \let\c@chapter\c@chapterR
- \let\c@section\c@sectionR
- \let\c@subsection\c@subsectionR
- \let\c@subsubsection\c@subsubsectionR
+ \ifdefined\c@chapter%
+ \setcounter{chapterR}{\old@chapter}%
+ \fi%
+ \setcounter{sectionR}{\old@section}%
+ \setcounter{subsectionR}{\old@subsection}%
+ \setcounter{subsubsectionR}{\old@subsubsection}%
+ \set@sectcountR%
}
+\newcommand{\set@sectcountR}{%
+ \let\c@chapter\c@chapterR%
+ \let\c@section\c@sectionR%
+ \let\c@subsection\c@subsectionR%
+ \let\c@subsubsection\c@subsubsectionR%
+}%
\newcommand*{\pausenumberingR}{%
\endnumberingR\global\numberingRtrue}
\newcommand*{\resumenumberingR}{%
@@ -582,6 +616,8 @@
\csgdef{Xonlyside@#1}{}%
\fi%
\unless\ifnofamiliar@%
+ \expandafter\newcount\csname footnote#1@reading\endcsname%
+ \expandafter\newcount\csname footnote#1@typeset\endcsname%
\expandafter\list@create\csname footnote#1@mk\endcsname%
\expandafter\newcommand\csname footnote#1nomk\endcsname[1]{%
\toggletrue{nomk@}%
@@ -605,6 +641,20 @@
}%
\fi
}%
+\newcommand{\save@familiarfootnote@number}{%
+ \unless\ifnofamiliar@%
+ \def\do##1{\csxdef{saved@footnote##1}{\the\csname c@footnote##1\endcsname}}%
+ \dolistloop{\@series}%
+ \fi%
+ \xdef\saved@footnote{\the\c@footnote}%
+}
+\newcommand{\get@familiarfootnote@number}{%
+ \unless\ifnofamiliar@%
+ \def\do##1{\global\expandafter\csname footnote##1@typeset\endcsname=\csuse{saved@footnote##1}}%
+ \dolistloop{\@series}%
+ \fi%
+ \global\footnote@typeset=\saved@footnote%
+}
\unless\ifnocritical@%
\newhookcommand@series{Xonlyside}%
\fi%
@@ -617,6 +667,8 @@
\dolistloop{\@series}%
}%
\init@series@par%
+\newcount\footnote@reading%
+\newcount\footnote@typeset%
\list@create{\list@pstartL@pc}%
\list@create{\list@pstartR@pc}%
@@ -646,6 +698,8 @@
\l@dpairingtrue
\l@dpagingfalse
\initnumbering@quote
+ \save@familiarfootnote@number%
+ \save@section@number%
\at@begin@pairs%
}{%
\l@dpairingfalse
@@ -658,6 +712,8 @@
\l@dpairingtrue
\l@dpagingtrue
\initnumbering@quote
+ \save@familiarfootnote@number%
+ \save@section@number%
\setlength{\Lcolwidth}{\textwidth}%
\setlength{\Rcolwidth}{\textwidth}%
}{%
@@ -1036,7 +1092,7 @@
\def\print@eledsectionR{%
\addtocounter{pstartR}{-1}%
- \initnumbering@sectcountR%
+ \set@sectcountR%
\ifdefstring{\@eledsectnotoc}{R}{\ledsectnotoc}{}%
\ifdefstring{\@eledsectmark}{R}{}{\ledsectnomark}%
\numdef{\temp@}{\l@dpscR-1}%
@@ -1386,16 +1442,6 @@
\global\let\@insertR=\undefined
\repeat}
-\def\printlinesR#1|#2|#3|#4|#5|#6|#7|{\begingroup
- \setprintlines{#1}{#2}{#3}{#4}{#5}{#6}%
- \ifl@d@pnum #1\fullstop\fi
- \ifledplinenum \linenumr@p{#2}\@Rlineflag\else \symplinenum\fi
- \ifl@d@ssub \fullstop \sublinenumr@p{#3}\fi
- \ifl@d@dash \endashchar\fi
- \ifl@d@pnum #4\fullstop\fi
- \ifl@d@elin \linenumr@p{#5}\@Rlineflag\fi
- \ifl@d@esl \ifl@d@elin \fullstop\fi \sublinenumr@p{#6}\fi
-\endgroup}
\newcommand\print@Xnotes@forpages[1]{%
\ifcsempty{Xonlyside@#1}{%
@@ -1487,9 +1533,9 @@
\def\l@dmake@labelsR#1|#2|#3|#4|#5{%
\expandafter\ifx\csname the@label#5\endcsname \relax\else
- \led@warn@DuplicateLabel{#4}%
+ \led@warn@DuplicateLabel{#5}%
\fi
- \expandafter\gdef\csname the@label#5\endcsname{#1|#2\@Rlineflag|#3|#4}%
+ \expandafter\gdef\csname the@label#5\endcsname{#1|#2|#3|#4|\@Rlineflag}%
\ignorespaces}
\AtBeginDocument{%
\def\l@dmake@labelsR#1|#2|#3|#4|#5{}%
@@ -1665,7 +1711,7 @@
\else \gdef\theledlanguageL{#1}%
\fi}
\renewcommand*{\l@duselanguage}[1]{%
- \l@doldselectlanguage{#1}}
+ \expandafter\l@doldselectlanguage\expandafter{#1}}
\gdef\theledlanguageL{\bbl@main@language}%
\gdef\theledlanguageR{\bbl@main@language}%
}%
@@ -1778,6 +1824,9 @@
\ifl@dpairing%
\led@err@Columns@InsideEnv%
\fi%
+ \expandafter\ifvoid\csname l@dRcolrawbox1\endcsname%
+ \led@err@Columns@WithoutEnv%
+ \else%
\l@dprintingcolumnstrue%
\eledsection@correcting@skip=-\baselineskip% Correction for sections' titles
\ifnum\l@dnumpstartsL=\l@dnumpstartsR\else
@@ -1791,6 +1840,7 @@
\global\par@lineR=\z@
\global\l@dpscL=\z@
\global\l@dpscR=\z@
+ \get@familiarfootnote@number%
\check@pstarts
\loop\if@pstarts
\global\pstartnumtrue
@@ -1863,8 +1913,9 @@
\global\l@dnumpstartsR=\z@
\l@dprintingcolumnsfalse%
\ignorespaces
- \global\instanzaLfalse
- \global\instanzaRfalse}
+ \global\instanzaLfalse%
+ \global\instanzaRfalse%
+ \fi}
\def\print@columnseparator{%
\ifdim\beforecolumnseparator<0pt%
@@ -2001,7 +2052,7 @@
}%
\print@columnseparator%
\parbox[t][][t]{\Rcolwidth}{%
- \initnumbering@sectcountR%
+ \set@sectcountR%
\csuse{before@pstartR@\the\l@dpscR}%
}%
\ifdefstring{\columns@position}{R}{}{\hfill}%
@@ -2024,7 +2075,7 @@
}%
\print@columnseparator%
\parbox[t][][t]{\Rcolwidth}{%
- \initnumbering@sectcountR%
+ \set@sectcountR%
\csuse{after@pendR@\the\l@dpscR}%
}%
\ifdefstring{\columns@position}{R}{}{\hfill}%
@@ -2041,6 +2092,9 @@
\ifl@dpairing%
\led@err@Pages@InsideEnv%
\fi%
+ \expandafter\ifvoid\csname l@dRcolrawbox1\endcsname%
+ \led@err@Pages@WithoutEnv%
+ \else%
\ifstrequal{#1}{mainmatter}{\Pages@mainmattertrue}{\Pages@mainmatterfalse}%
\eledsection@correcting@skip=-2\baselineskip% line correcting for section titles.
\parledgroup@notespacing@set@correction%
@@ -2063,6 +2117,7 @@
\global\l@dpscR=\z@%
\writtenlinesLfalse%
\writtenlinesRfalse%
+ \get@familiarfootnote@number%
\let\print@Xnotes\print@Xnotes@forpages%
\let\print@notesX\print@notesX@forpages%
\check@pstarts%
@@ -2152,7 +2207,7 @@
\checkpageR%
\l@duselanguage{\theledlanguageR}%
{ \loop\ifl@dsamepage%
- \initnumbering@sectcountR%
+ \set@sectcountR%
\ifdefstring{\@eledsectnotoc}{R}{\ledsectnotoc}{}%
\csuse{before@pstartR@\the\l@dpscR}%
\global\csundef{before@pstartR@\the\l@dpscR}%
@@ -2226,7 +2281,7 @@
\global\instanzaRfalse%
\l@dprintingpagesfalse%
\finish@Pages@notes%Needed to prevent final notes overlap line number
- \ignorespaces}
+ \ignorespaces\fi}
\newcommand{\finish@Pages@notes}{%
\def\do##1{%