summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/reledmac
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-01-30 00:29:33 +0000
committerKarl Berry <karl@freefriends.org>2018-01-30 00:29:33 +0000
commit750b8a27ec779760cf55f2913236b41ea01987e2 (patch)
treef775a24c111bd215c595acd5d740575d7e7c8126 /Master/texmf-dist/source/latex/reledmac
parent23d86fdfc88da36147892fd0f28e12e9163d239d (diff)
reledmac (28jan18)
git-svn-id: svn://tug.org/texlive/trunk@46483 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/reledmac')
-rw-r--r--Master/texmf-dist/source/latex/reledmac/reledmac.dtx89
-rw-r--r--Master/texmf-dist/source/latex/reledmac/reledpar.dtx39
2 files changed, 89 insertions, 39 deletions
diff --git a/Master/texmf-dist/source/latex/reledmac/reledmac.dtx b/Master/texmf-dist/source/latex/reledmac/reledmac.dtx
index e5a26550096..01d28e59495 100644
--- a/Master/texmf-dist/source/latex/reledmac/reledmac.dtx
+++ b/Master/texmf-dist/source/latex/reledmac/reledmac.dtx
@@ -499,7 +499,11 @@
% \changes{v2.26.2}{2017/12/22}{Fix bug with \protect\cs{Xgroupbyline} and \protect\cs{Xparafootsep}.}
% \changes{v2.26.2}{2017/11/22}{Fix bug with \protect\cs{linenumberannotation} in parallel typesetting}
% \changes{v2.26.3}{2018/01/06}{Fix bug added by v2.26.0 with notes in parallel typesetting}
-% \changes{v2.26.4}{2018/01/18}{Fix bug when using \protect\cs{numberpstarttrue} and alterning between manual \protect\cs{pstart} and automatic produced by \protect\cs{autopar}}
+% \changes{v2.26.4}{2018/01/18}{Fix bug when using \protect\cs{numberpstarttrue} and alterning between manual \protect\cs{pstart} and automatic \protect\cs{pstart} produced by \protect\cs{autopar}}
+% \changes{v2.26.5}{2018/01/18}{Fix bug with using \protect\cs{eledsection} and related when alternate normal typesetting and parallel typesetting}
+% \changes{v2.26.5}{2018/01/28}{Check that users have a enough recent version of \protect\package{xparse}}
+% \changes{v2.26.5}{2018/01/18}{Fix bug when using \protect\cs{eledsection} with the \protect\option{continuousnumberingwithcolumns} of \protect\parpackage}
+% \changes{v2.26.5}{2018/01/28}{Fix bug with \protect\option{continuousnumberingwithcolumns}}
% Typeset scholarly editions with \LaTeX\thanks{This file (\dtxfilename)
% has version number \fileversion, last revised \filedate.}}
%
@@ -4177,7 +4181,7 @@
% \begin{macrocode}
%<*code>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{reledmac}[2018/01/18 v2.26.4 typesetting critical editions]%
+\ProvidesPackage{reledmac}[2018/01/28 v2.26.5 typesetting critical editions]%
% \end{macrocode}
%
% \subsection{Package options}
@@ -8366,6 +8370,23 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\pstarts@typeset@L}
+% \begin{macro}{\pstarts@read@L}
+% The \cs{pstarts@typeset@L} counts the number of LEFT \cs{pstart} typeset.
+% A left \cs{pstart} can be a \cs{pstart} typeset in normal mode, or \cs{pstart} typset in left column or page in parallel mode (with{\parpackage}).
+% In the first case, its value is increased at every \cs{pstart} command.
+% In the second case, its value is increased in \cs{Columns} or \cs{Pages} when we prepare to typeset a left \cs{pstart}.
+% The \cs{pstarts@readL} counts the number of LEFT \cs{pstart} read.
+% A left \cs{pstart} can be a \cs{pstart} typeset in normal mode, or \cs{pstart} typset in left column or page in parallel mode (with{\parpackage}).
+% In the first case, its value is increased at every \cs{pstart} command.
+% In the second case, its value is increased at every \cs{pstarL}.
+%
+% \begin{macrocode}
+\newcount\pstarts@typeset@L%
+\newcount\pstarts@read@L%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
% \begin{macro}{\pstart}
% \begin{macro}{\AtEveryPstart}
% \begin{macro}{\AtStartEveryPstart}
@@ -8449,6 +8470,8 @@
\global\let\next@insert=\empty%
\begingroup\normal@pars%
\global\advance \l@dnumpstartsL\@ne
+ \global\advance \pstarts@typeset@L\@ne%
+ \global\advance \pstarts@read@L\@ne%
\global\setbox\raw@text=\vbox\bgroup%
\if@nobreak%
\if@afterindent\else%
@@ -8722,6 +8745,8 @@
% do all the processing for a single line of text.
% \changes{v1.6.1}{2013/10/27}{Move the call to \protect\cs{inserthangingsymbol} to allow use \protect\cs{hfill} inside.}
% \changes{v1.12.2}{2014/08/07}{Fix a bug with critical notes at the tops of pages (added by v12.0.0)}
+% The \cs{l@dunhbox@line} macro only \cs{unhbox} one lines, but some package as \cs{microtype} can override it for custom needs.
+%
% \begin{macrocode}
\newcommand*{\l@dunhbox@line}[1]{\unhbox #1}
\newcommand*{\do@line}{%
@@ -8750,7 +8775,7 @@
% Depending weither a sectioning command is called at this pstart or not
% we print sectioning command or normal line,
% \begin{macrocode}
- \xifinlist{\the\l@dnumpstartsL}{\eled@sections@@}%
+ \xifinlist{\the\pstarts@typeset@L}{\eled@sections@@}%
{\print@eledsection}%
{\print@line}%
\IfStrEq{\led@pb@setting}{after}{\led@check@pb\led@check@nopb}{}
@@ -8818,14 +8843,7 @@
% \end{macrocode}
% If we use the \option{continuousnumberingwithcolumns}, we increase right line number.
% \begin{macrocode}
- \ifcontinuousnumberingwithcolumns%
- \unless\ifafterendnumberingR%
- \new@lineR%
- \xappto\next@line@list@stuffR{%
- \unexpanded{\global\line@numR=}\the\line@num%
- }%
- \fi%
- \fi%
+ \continuousnumberingwithcolumns@sync@linenumber@singletext%
% \end{macrocode}
% If we use \LuaLaTeX\, then restore the direction.
% \begin{macrocode}
@@ -8878,12 +8896,12 @@
\insert@msdata%
}%
\affixside@note%
- \numdef{\temp@}{\l@dnumpstartsL-1}%
+ \numdef{\temp@}{\pstarts@typeset@L-1}%
\xifinlist{\temp@}{\eled@sections@@}{\@nobreaktrue}{\@nobreakfalse}%
\@eled@sectioningtrue%
- \csuse{eled@sectioning@\the\l@dnumpstartsL}%
+ \csuse{eled@sectioning@\the\pstarts@typeset@L}%
\@eled@sectioningfalse%
- \global\csundef{eled@sectioning@\the\l@dnumpstartsL}%
+ \global\csundef{eled@sectioning@\the\pstarts@typeset@L}%
\if@RTL%
\hspace{-3\paperwidth}%
{\hbox{\l@dunhbox@line{\one@line}} \new@line}%
@@ -8892,6 +8910,7 @@
{\new@line \hbox{\l@dunhbox@line{\one@line}}}%
\fi%
\vskip-\baselineskip%
+ \continuousnumberingwithcolumns@sync@linenumber@singletext%
}
% \end{macrocode}
% \end{macro}
@@ -9207,6 +9226,30 @@
% \end{macrocode}
% \end{macro}
+% \subsection{Continuous line numbering between parallel typesetting and normal typesetting}
+% \begin{macro}{\continuousnumberingwithcolumns@sync@linenumber@singletext}
+% The \option{continuousnumberingwithcolumns}
+% option allows to alternate between single text and two parallels texts, keeping same line numbers when switching from one layout to the other one.
+% The lines counter for the text in a single column and for the text in the text in the left column in parallel typesetting is the same.
+% But the lines counter for the text in the same column is the not the same.
+%
+% When typesetting single column text, if the option is enabled, we need to \enquote{simulate} typesetting right line, in order to keep the two counters synchronized.
+% That is the aim of the \\
+% \cs{continuousnumberingwithcolumns@sync@linenumber@singletext}\\
+% macro.
+% \begin{macrocode}
+\newcommand{\continuousnumberingwithcolumns@sync@linenumber@singletext}{%
+ \ifcontinuousnumberingwithcolumns%
+ \unless\ifafterendnumberingR%
+ \new@lineR%
+ \xappto\next@line@list@stuffR{%
+ \unexpanded{\global\line@numR=}\the\line@num%
+ }%
+ \fi%
+ \fi%
+}%
+% \end{macrocode}
+% \end{macro}
% \section{Line number annotation}
% The \cs{linenumannotation} allows users to add manual annotations to line numbers, for example to refer to line numbers from an older edition.
%
@@ -19881,7 +19924,7 @@
% \begin{itemize}
% \item The section level.
% \item The section title.
-% \item The side (when \protect\package{eledpar} is used).
+% \item The side (when \parpackage\ is used).
% \item The pstart where the command is called.
% \item If we have starred version or not.
% \end{itemize}
@@ -20240,7 +20283,7 @@
}%
\else%
\immediate\write\eled@sectioning@out{%
- \string\eled@chapter{#1}{\unexpanded{#2}}{\the\l@dnumpstartsL}{}{}
+ \string\eled@chapter{#1}{\unexpanded{#2}}{\the\pstarts@read@L}{}{}%
}%
\fi%
}
@@ -20255,7 +20298,7 @@
}%
\else%
\immediate\write\eled@sectioning@out{%
- \string\eled@section{#1}{\unexpanded{#2}}{\the\l@dnumpstartsL}{}{}
+ \string\eled@section{#1}{\unexpanded{#2}}{\the\pstarts@read@L}{}{}%
}%
\fi%
}
@@ -20270,7 +20313,7 @@
}%
\else%
\immediate\write\eled@sectioning@out{%
- \string\eled@subsection{#1}{\unexpanded{#2}}{\the\l@dnumpstartsL}{}{}
+ \string\eled@subsection{#1}{\unexpanded{#2}}{\the\pstarts@read@L}{}{}%
}%
\fi%
}
@@ -20284,7 +20327,7 @@
}%
\else%
\immediate\write\eled@sectioning@out{%
- \string\eled@subsubsection{#1}{\unexpanded{#2}}{\the\l@dnumpstartsL}{}{}
+ \string\eled@subsubsection{#1}{\unexpanded{#2}}{\the\pstarts@read@L}{}{}%
}%
\fi%
}
@@ -20300,7 +20343,7 @@
}%
\else%
\immediate\write\eled@sectioning@out{%
- \string\eled@chapter{#1}{\unexpanded{#2}}{\the\l@dnumpstartsL}{*}{}
+ \string\eled@chapter{#1}{\unexpanded{#2}}{\the\pstarts@read@L}{*}{}%
}%
\fi%
}
@@ -20315,7 +20358,7 @@
}%
\else%
\immediate\write\eled@sectioning@out{%
- \string\eled@section{#1}{\unexpanded{#2}}{\the\l@dnumpstartsL}{*}{}
+ \string\eled@section{#1}{\unexpanded{#2}}{\the\pstarts@read@L}{*}{}%
}%
\fi%
}
@@ -20330,7 +20373,7 @@
}%
\else%
\immediate\write\eled@sectioning@out{%
- \string\eled@subsection{#1}{\unexpanded{#2}}{\the\l@dnumpstartsL}{*}{}
+ \string\eled@subsection{#1}{\unexpanded{#2}}{\the\pstarts@read@L}{*}{}%
}%
\fi%
}
@@ -20345,7 +20388,7 @@
}%
\else%
\immediate\write\eled@sectioning@out{%
- \string\eled@subsubsection{#1}{\unexpanded{#2}}{\the\l@dnumpstartsL}{*}{}
+ \string\eled@subsubsection{#1}{\unexpanded{#2}}{\the\pstarts@read@L}{*}{}%
}%
\fi%
}
diff --git a/Master/texmf-dist/source/latex/reledmac/reledpar.dtx b/Master/texmf-dist/source/latex/reledmac/reledpar.dtx
index 6d764788fc0..f3f10c08641 100644
--- a/Master/texmf-dist/source/latex/reledmac/reledpar.dtx
+++ b/Master/texmf-dist/source/latex/reledmac/reledpar.dtx
@@ -325,7 +325,8 @@
% \changes{v2.21.0}{2017/11/11}{Add compatibility with new features of \protect\reledmac 2.26.0}
% \changes{v2.21.1}{2017/11/22}{Fix bug with \protect\cs{linenumberannotation}}
% \changes{v2.21.2}{2018/01/08}{Fix bug with \protect\cs{Xpstart} and \protect\cs{edtextlater}}
-% \changes{v2.21.3}{2018/01/18}{Fix bug when using \protect\cs{numberpstarttrue} and alterning between manual \protect\cs{pstart} and automatic produced by \protect\cs{autopar}}
+% \changes{v2.21.3}{2018/01/18}{Fix bug when using \protect\cs{numberpstarttrue} and alterning between manual \protect\cs{pstart} and automatic \protect\cs{pstart} produced by \protect\cs{autopar}}
+% \changes{v2.21.4}{2018/01/18}{Fix bug with using \protect\cs{eledsection} and related when alternate normal typesetting and parallel typesetting}
% ^^A PW added following as the definitions are at some unknown elsewhere
%
% \newcommand{\egstart}{%
@@ -1371,7 +1372,7 @@
% \begin{macrocode}
%<*code>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{reledpar}[2018/01/18 v2.21.3 reledmac extension for parallel texts]%
+\ProvidesPackage{reledpar}[2018/01/28 v2.21.4 reledmac extension for parallel texts]%
% \end{macrocode}
% \subsection{Package's requirement}
@@ -3575,6 +3576,7 @@
% forthcoming text.
% \begin{macrocode}
\global\advance\l@dnumpstartsL \@ne%
+ \global\advance\pstarts@read@L \@ne%
\ifnum\l@dnumpstartsL>\l@dc@maxchunks%
\led@err@TooManyPstarts%
\global\l@dnumpstartsL=\l@dc@maxchunks%
@@ -3957,7 +3959,7 @@
\else%
\affixline@num%
\fi%
- \xifinlist{\the\l@dpscL}{\eled@sections@@}%
+ \xifinlist{\the\pstarts@typeset@L}{\eled@sections@@}%
{\unless\ifshiftedpstarts%
\add@apparatusL%
\fi%
@@ -4025,7 +4027,7 @@
\addtocounter{pstartL}{-1}%
\ifdefstring{\@eledsectnotoc}{L}{\ledsectnotoc}{}
\ifdefstring{\@eledsectmark}{L}{}{\ledsectnomark}
- \numdef{\temp@}{\l@dpscL-1}%
+ \numdef{\temp@}{\pstarts@typeset@L-1}%
\xifinlist{\temp@}{\eled@sections@@}{\@nobreaktrue}{\@nobreakfalse}%
\@eled@sectioningtrue%
\bgroup%
@@ -4035,10 +4037,10 @@
\bodydir\l@luatexbodydir@L%
\ifdefstring{\l@luatextextdir@L}{TRT}{\@RTLtrue}{}%
\fi%
- \csuse{eled@sectioning@\the\l@dpscL}%
+ \csuse{eled@sectioning@\the\pstarts@typeset@L}%
\egroup%
\@eled@sectioningfalse%
- \global\csundef{eled@sectioning@\the\l@dpscL}%
+ \global\csundef{eled@sectioning@\the\pstarts@typeset@L}%
\if@RTL%
\hspace{-3\paperwidth}%
{\hbox{\l@dunhbox@line{\one@line}} \new@line}%
@@ -5556,9 +5558,9 @@
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\l@pscL}
-% \begin{macro}{\l@pscR}
-% A couple of scratch counts for use in left and right texts, respectively.
+% \begin{macro}{\l@dpscL}
+% \begin{macro}{\l@dpscR}
+% A couple of scratch counts to count left and right \cs{pstart}, respectively.
% \begin{macrocode}
\newcount\l@dpscL
\newcount\l@dpscR
@@ -5778,12 +5780,14 @@
\global\pstartnumtrue
\global\pstartnumRtrue
% \end{macrocode}
-% Increment \protect\cs{l@dpscL} and \protect\cs{l@dpscR} which here count
+% Increase \protect\cs{l@dpscL} and \protect\cs{l@dpscR} which here count
% the numbers of left and right chunks.
+% Increase \cs{pstarts@typeset@L}, which counts the number of \cs{pstart} typeset both in not parallel mode and in the left side of parallel mode.
% Also restore the value of the public pstart counters.
% \begin{macrocode}
\global\advance\l@dpscL \@ne
\global\advance\l@dpscR \@ne
+ \global\advance\pstarts@typeset@L\@ne%
\restore@pstartL@pc%
\restore@pstartR@pc%
% \end{macrocode}
@@ -5806,12 +5810,12 @@
% \begin{macrocode}
\l@duselanguage{\theledlanguageL}%
\do@lineL
- \xifinlist{\the\l@dpscL}{\eled@sections@@}
+ \xifinlist{\the\pstarts@typeset@L}{\eled@sections@@}%
{%
\ifdefstring{\@eledsectmark}{L}%
- {\csuse{eled@sectmark@\the\l@dpscL}%
+ {\csuse{eled@sectmark@\the\pstarts@typeset@L}%
}{}%
- \global\csundef{eled@sectmark@\the\l@dpscL}%
+ \global\csundef{eled@sectmark@\the\pstarts@typeset@L}%
\savebox{\@eledsectionL}{\parbox[t][][t]{\Lcolwidth}{\vbox{}\print@eledsectionL}}%\vbox{}-> prevent alignment troubles with RTL language
}%
{}%
@@ -6381,7 +6385,8 @@
% \end{macrocode}
% Loop over the number of chunks, incrementing the chunk counts
% (\protect\cs{l@dpscL}
-% and \protect\cs{l@dpscR} are chunk (box) counts.)
+% and \protect\cs{l@dpscR} are chunk (box) counts).
+%
% \begin{macrocode}
\global\advance\l@dpscL \@ne%
\global\advance\l@dpscR \@ne%
@@ -6420,6 +6425,7 @@
% \begin{macrocode}
\global\advance\l@dpscL \@ne%
\global\advance\l@dpscR \@ne%
+ \global\advance\pstarts@typeset@L\@ne%
\restore@pstartL@pc%
\restore@pstartR@pc%
% \end{macrocode}
@@ -6455,7 +6461,7 @@
\csuse{before@pstartL@\the\l@dpscL}%
\global\csundef{before@pstartL@\the\l@dpscL}%
\do@lineL%
- \xifinlist{\the\l@dpscL}{\eled@sections@@}
+ \xifinlist{\the\pstarts@typeset@L}{\eled@sections@@}%
{\print@eledsectionL}%
{}%
\advance\numpagelinesL \@ne%
@@ -6473,7 +6479,7 @@
\parledgroup@correction@notespacing{L}%
\hb@xt@ \hsize{\ledstrutL\unhbox\l@dleftbox}%
\else%
- \xifinlist{\the\l@dpscL}{\eled@sections@@}%
+ \xifinlist{\the\pstarts@typeset@L}{\eled@sections@@}%
{\add@apparatusL}%
{}%
\unless\ifadvancedshiftedpstarts%
@@ -7174,6 +7180,7 @@
% Go to the next pstart
% \begin{macrocode}
\global\advance\l@dpscL \@ne
+ \global\advance\pstarts@typeset@L\@ne%
\global\pstartnumtrue%
\restore@pstartL@pc%
% \end{macrocode}