summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/reledmac
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-09-02 21:44:34 +0000
committerKarl Berry <karl@freefriends.org>2017-09-02 21:44:34 +0000
commita7f7f3b04a2de49df22e775296655dc13bfe53bc (patch)
tree138cb34a518ba5fc6d2a6b7fcd02e9037d7fb71d /Master/texmf-dist/source/latex/reledmac
parent61fbab0a750d1a8e32eacd11f3421b7c84820fe7 (diff)
reledmac (1sep17)
git-svn-id: svn://tug.org/texlive/trunk@45201 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/reledmac')
-rw-r--r--Master/texmf-dist/source/latex/reledmac/reledmac.dtx138
-rw-r--r--Master/texmf-dist/source/latex/reledmac/reledpar.dtx161
2 files changed, 180 insertions, 119 deletions
diff --git a/Master/texmf-dist/source/latex/reledmac/reledmac.dtx b/Master/texmf-dist/source/latex/reledmac/reledmac.dtx
index f92506cd050..de88625b0c0 100644
--- a/Master/texmf-dist/source/latex/reledmac/reledmac.dtx
+++ b/Master/texmf-dist/source/latex/reledmac/reledmac.dtx
@@ -295,7 +295,7 @@
% \changes{v1.23.0}{2015/05/18}{Compatibility between nofamiliar/nocriticals option and minipage/ledgroup.}
% \changes{v1.23.0}{2015/05/18}{Fix error of \protect\cs{iftrue} not closed.}
% \changes{v1.23.0}{2015/05/18}{Allow use of \protect\cs{sameword} with inputenc managing of UTF-8.}
-% \changes{v1.23.0}{2015/05/18}{Error message when using \protect\cs{beginnumbering}…\protect\cs{endnumbering} without \protect\cs{pstart}.}
+% \changes{v1.23.0}{2015/05/18}{Error message when using \protect\cs{beginnumbering}\ …\ \protect\cs{endnumbering} without \protect\cs{pstart}.}
% \changes{v1.23.0}{2015/05/18}{New tools to ensure the line-list file uses the right version of commands when upgrading the eledmac version.}
% \changes{v1.23.0}{2015/05/18}{Fix a bug with \protect\cs{skipnumbering} called immediately after a \protect\cs{pstart}.}
% \changes{v1.23.0}{2015/05/18}{Fix spurious space with \protect\cs{skipnumbering} (bug added on v1.21.0).}
@@ -449,8 +449,8 @@
% \changes{v2.16.5}{2016/10/20}{Fix potential spurious spaces in endnotes.}
% \changes{v2.16.6}{2016/11/14}{Take into account \protect\cs{linenumberstyle} when using \protect\cs{edlineref}.}
% \changes{v2.16.6}{2016/11/14}{Fix a bug with the line number style in \protect\cs{doennotes} when referring to right side line in parallel typesetting.}
-% \changes{v2.16.7}{2016/12/12}{Fix a bug with \protect\cs{numberpstarttrue} when using multiple \protect\cs{beginnumbering}…\protect\cs{endnumbering}.}
-% \changes{v2.16.7}{2016/12/12}{Fix a bug with \protect\cs{msdata} when using multiple \protect\cs{beginnumbering}…\protect\cs{endnumbering}.}
+% \changes{v2.16.7}{2016/12/12}{Fix a bug with \protect\cs{numberpstarttrue} when using multiple \protect\cs{beginnumbering}\ …\ \protect\cs{endnumbering}.}
+% \changes{v2.16.7}{2016/12/12}{Fix a bug with \protect\cs{msdata} when using multiple \protect\cs{beginnumbering}\ …\ \protect\cs{endnumbering}.}
% \changes{v2.16.8}{2016/12/16}{Fix a bug with \protect\cs{edindex} in footnotes in parallel typesetting.}
% \changes{v2.17.0}{2016/12/23}{Add \protect\cs{edglsadd} command.}
% \changes{v2.17.0}{2016/12/23}{Add \protect\cs{setmsdataposition} setting.}
@@ -488,6 +488,7 @@
% \changes{v2.24.0}{2017/08/17}{Fix a bug with \protect\cs{edlabel} at the beginning of a \protect\cs{pstart}.}
% \changes{v2.24.0}{2017/08/17}{Add \protect\cs{swnoexpands} macro to avoid problems with not fully expandable macro inside \protect\cs{sameword}.}
% \changes{v2.24.0}{2017/08/17}{Fix spurious space with \protect\cs{labelpstarttrue}}
+% \changes{v2.24.1}{2017/08/31}{Compatibility with \protect\parpackage 2.20.2}
% Typeset scholarly editions with \LaTeX\thanks{This file (\dtxfilename)
% has version number \fileversion, last revised \filedate.}}
%
@@ -1828,7 +1829,7 @@
% […]
% amet\stopmsdata{} \msdata{ABCD}sic transit […]
% \end{verbatim}
-% Which means that the part of text containing \enquote{Lorem ipsum dolor … amet} is witnessed by manuscripts A, B and C, while the part of text starting by \enquote{sic transit} is witnessed by manuscripts A, B, C and D.
+% Which means that the part of text containing \enquote{Lorem ipsum dolor […] amet} is witnessed by manuscripts A, B and C, while the part of text starting by \enquote{sic transit} is witnessed by manuscripts A, B, C and D.
%
% \cs{stopmsdata} is also automatically inserted by \cs{msdata}.
%
@@ -4060,7 +4061,7 @@
% \begin{macrocode}
%<*code>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{reledmac}[2017/08/17 v2.24.0 typesetting critical editions]%
+\ProvidesPackage{reledmac}[2017/08/31 v2.24.1 typesetting critical editions]%
% \end{macrocode}
%
% \subsection{Package options}
@@ -4322,7 +4323,7 @@
% \begin{macro}{\led@err@edtextoutsidepstart}
% \begin{macrocode}
\newcommand*{\led@err@edtextoutsidepstart}{%
- \reledmac@error{\string\edtext\space outside numbered paragraph (\pstart…\pend)}{\@ehc}}%
+ \reledmac@error{\string\edtext\space outside numbered paragraph (\pstart\space …\space\pend)}{\@ehc}}%
% \end{macrocode}
% \end{macro}
% \begin{macro}{\led@mess@NotesChanged}
@@ -4420,7 +4421,7 @@
\newcommand*{\led@err@PstartNotNumbered}{%
\reledmac@error{\string\pstart\space must be used within a
numbered section %
- (\string\beginnumbering…\string\endnumbering)}{\@ehc}}%
+ (\string\beginnumbering\space …\space\string\endnumbering)}{\@ehc}}%
\newcommand*{\led@err@PstartInPstart}{%
\reledmac@error{\string\pstart\space encountered while another
\string\pstart\space was in effect}{\@ehc}}
@@ -4568,7 +4569,7 @@
% \begin{macro}{\led@err@toendnotes@outsidenumbering}
% \begin{macrocode}
\newcommand{\led@err@toendnotes@outsidenumbering}{%
- \reledmac@error{\string\toendnotes\space and related commands must be called inside a numbered texte (\string\beginnumbering…\string\endnumbering)}{\@ehc}%
+ \reledmac@error{\string\toendnotes\space and related commands must be called inside a numbered texte (\string\beginnumbering\space …\space\string\endnumbering)}{\@ehc}%
}%
% \end{macrocode}
% \end{macro}
@@ -4639,7 +4640,7 @@
% \begin{macro}{\led@warn@edinde@outsidenumbering}
% \begin{macrocode}
\newcommand{\led@warn@edinde@outsidenumbering}{%
- \reledmac@warning{\string\edindex\space called outside of \string\beginnumbering…\string\endnumbering. \MessageBreak Automatically switched to \string\index.}%
+ \reledmac@warning{\string\edindex\space called outside of \string\beginnumbering\space …\space \string\endnumbering. \MessageBreak Automatically switched to \string\index.}%
}%
% \end{macrocode}
% \end{macro}
@@ -4739,7 +4740,7 @@
% In preparation for the \parpackage package, these are related to
% the `right' text of parallel texts (when \protect\cs{ifl@dpairing} is TRUE).
-% They are explained in the \protect\package{eledpar}
+% They are explained in the \protect\parpackage
% manual.
% \changes{v0.7.0}{2005/02/24}{Added \protect\cs{l@dnumpstartsL}, \protect\cs{ifl@dpairing}
% and \protect\cs{ifpst@rted} for/from eledpar}
@@ -4776,6 +4777,12 @@
% \begin{macrocode}
\newif\ifnumberingR
% \end{macrocode}
+% \begin{macro}{\ifafterendnumberingR}
+% The \cs{ifafterendnumberingR} boolean is set to TRUE at \cs{endnumberingR} and to FALSE at next \cs{beginnumberingR} or real \cs{beginnumbering} (not \cs{resumenumbering}). It is mainly used for the \option{continuousnumberingwithcolumns}, to avoid incrementing right column line counters after a \cs{endnumberingR}.
+% \begin{macrocode}
+\newif\ifafterendnumberingR%
+% \end{macrocode}
+% \end{macro}
% The \cs{ifXnote@} macro is set to true when we are typesetting a critical footnote.
% \begin{macrocode}
\newif\ifXnote@%
@@ -4876,10 +4883,22 @@
\endnumbering
\fi
\global\numberingtrue
+ \global\afterendnumberingRfalse%
\global\advance\section@num \@ne
\initnumbering@reg
\message{Section \the\section@num }%
\line@list@stuff{\jobname.\extensionchars\the\section@num}%
+ \ifcontinuousnumberingwithcolumns%
+ \unless\ifafterendnumberingR%
+ \unless\ifl@dpairing%
+ \ledRcoltrue%
+ \global\advance\section@numR \@ne%
+ \message{Section \the\section@numR R (continuoousnumbering)}%
+ \line@list@stuffR{\jobname.\extensionchars\the\section@numR R}%
+ \ledRcolfalse%
+ \fi%
+ \fi%
+ \fi%
\l@dend@stuff
\setcounter{pstart}{1}
\ifl@dpairing
@@ -5028,6 +5047,17 @@
\led@mess@SectionContinued{\the\section@num}%
\set@continuousnumberingforL%
\line@list@stuff{\jobname.\extensionchars\the\section@num}%
+ \ifcontinuousnumberingwithcolumns%
+ \unless\ifafterendnumberingR%
+ \unless\ifl@dpairing%
+ \ledRcoltrue%
+ \global\advance\section@numR \@ne%
+ \message{Section \the\section@numR R (continuoousnumbering)}%
+ \line@list@stuffR{\jobname.\extensionchars\the\section@numR R}%
+ \ledRcolfalse%
+ \fi%
+ \fi%
+ \fi%
\l@dend@stuff
\ifl@dpairing\else%
\begingroup%
@@ -5050,20 +5080,10 @@
% \end{macro}
% \end{macro}
% \begin{macro}{\set@continuousnumberingforL}
-% \cs{set@continuousnumberingforl} sets the left line numbers and pstart counters at a \cs{beginnumbering} or a \cs{resumenumbering} in order to have continuous numbering with single column text.
+% \cs{set@continuousnumberingforl} sets pstart counters at a \cs{beginnumbering} or a \cs{resumenumbering} in order to have continuous numbering with single column text.
% \begin{macrocode}
\newcommand{\set@continuousnumberingforL}{%
\ifcontinuousnumberingwithcolumns%
- \ifdefined\line@numR%
- \ifnum\line@numR>\line@num%
- \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%
- \fi%
- \fi%
\ifl@dpairing%
\unless\ifl@dpaging%
\global\c@pstartL=\c@pstart%
@@ -6198,7 +6218,16 @@
\csnumgdef{@lastline@forpageR@\the\page@numR}{\the\line@numR}%
\ifbypage@R
\ifx\l@dchset@num\relax%Not resetting if preceded by a \setlinenum
- \line@numR \z@ \subline@numR \z@%
+ \ifboolexpr{%
+ bool{resumenumberingR@start}%
+ and test {\ifnumequal{\last@page@numR}{-10000}}%
+ }%
+ {}%
+ {%
+ \line@numR \z@%
+ \subline@numR \z@%
+ \global\csdef{reset@lineR\the\numexpr\absline@numR+1\relax @\the\section@numR}{}%
+ }%
\fi%
\fi
\global\page@numR=#1%
@@ -6213,6 +6242,7 @@
\ifbypage@
\ifx\l@dchset@num\relax%Not resetting if preceded by a \setlinenum
\line@num \z@ \subline@num \z@%
+ \global\csdef{reset@line\the\numexpr\absline@num+1\relax @\the\section@num}{}%
\fi%
\fi
\global\page@num=#1%
@@ -6853,6 +6883,11 @@
{\global\toggletrue{notfirstrun@#1}}%
{\global\togglefalse{notfirstrun@#1}}%
% \end{macrocode}
+% A internal hook (not used yet).
+% \begin{macrocode}
+ \next@line@list@stuff%
+ \global\let\next@line@list@stuff\relax%
+% \end{macrocode}
% Use the commands of the previous section to interpret the
% line-list file from the last run.
% \begin{macrocode}
@@ -6891,8 +6926,6 @@
\write\linenum@out{\string\@par@sync@option{\@par@this@sync@option}}%
\fi%
\fi%
- \next@line@list@stuff%
- \global\let\next@line@list@stuff\relax%
}%
% \end{macrocode}
@@ -8329,7 +8362,7 @@
}%
% \end{macrocode}
% Restore standard \enquote{nobreak} and \enquote{autopar} settings.
-% Normally, \cs{if@nobreak} is true only immediately after a sectioning command (see latex.ltx file). As a \cs{pstart}…\cs{pend} structure can't contain any sectioning command, we set \cs{if@nobreak} to false.
+% Normally, \cs{if@nobreak} is true only immediately after a sectioning command (see latex.ltx file). As a \cs{pstart}\ …\ \cs{pend} structure can't contain any sectioning command, we set \cs{if@nobreak} to false.
% \begin{macrocode}
\@nobreakfalse%
\ifautopar%
@@ -8567,29 +8600,41 @@
% \end{macrocode}
% Boxes the line, writes information about new line in the numbered file.
% \begin{macrocode}
- {\ledllfill\hb@xt@ \wd\one@line{\new@line%
+ {\ledllfill\hb@xt@ \wd\one@line{%
+ \new@line%
% \end{macrocode}
-% If we use \LuaLaTeX\, then restore the direction.
+% If we use the \option{continuousnumberingwithcolumns}, we increase right line number.
% \begin{macrocode}
- \ifluatex%
- \textdir\l@luatextextdir@L%
+ \ifcontinuousnumberingwithcolumns%
+ \unless\ifafterendnumberingR%
+ \new@lineR%
+ \xappto\next@line@list@stuffR{%
+ \unexpanded{\global\line@numR=}\the\line@num%
+ }%
+ \fi%
\fi%
% \end{macrocode}
+% If we use \LuaLaTeX\, then restore the direction.
+% \begin{macrocode}
+ \ifluatex%
+ \textdir\l@luatextextdir@L%
+ \fi%
+% \end{macrocode}
% Insert, if needed, the hanging symbol.
% \begin{macrocode}
- \inserthangingsymbol%
+ \inserthangingsymbol%
% \end{macrocode}
% And so, print the line.
% \begin{macrocode}
- \l@dunhbox@line{\one@line}}%
+ \l@dunhbox@line{\one@line}}%
% \end{macrocode}
% Right line number
% \begin{macrocode}
- \ledrlfill\l@drd@ta%
+ \ledrlfill\l@drd@ta%
% \end{macrocode}
% Print right notes.
% \begin{macrocode}
- \l@drsn@te
+ \l@drsn@te%
}}%
% \end{macrocode}
% And reinsert penalties (for page breaking)...
@@ -8836,21 +8881,18 @@
\global\resumenumbering@startfalse%
\fi%
\fi%
- \unless\ifresumenumbering@start%
- \global\@firstlineofpagetrue%
- \fi%
- \ifbypage@
- \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
+ \ifboolexpr{%
+ bool{resumenumbering@start}%
+ and test {\ifdimgreater{\pagedepth}{\z@}}%
+ }%
+ {}%
+ {\global\@firstlineofpagetrue}%
+ \ifcsdef{reset@line\the\absline@num @\the\section@num}%
+ {%
+ \global\line@num=\z@ \global\subline@num=\z@%
+ \resetprevline@%
+ }%
+ {}%
\global\resumenumbering@startfalse%
\add@msdata@firstlineofpage%
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/reledmac/reledpar.dtx b/Master/texmf-dist/source/latex/reledmac/reledpar.dtx
index a238bc265ea..b6330367cac 100644
--- a/Master/texmf-dist/source/latex/reledmac/reledpar.dtx
+++ b/Master/texmf-dist/source/latex/reledmac/reledpar.dtx
@@ -225,7 +225,7 @@
% \changes{v1.15.0}{2015/04/13}{Fix vertical spurious space before right \protect\cs{eledchapter} (bug added in v1.13.0).}
% \changes{v1.15.0}{2015/04/13}{Prevent vertical space when using \protect\cs{AtEveryPstart} or \protect\cs{AtEveryPend} with a command which prints nothing}
% \changes{v1.16.0}{2015/05/18}{Fix a bug with nofamiliar / nocritical option of eledmac.}
-% \changes{v1.16.0}{2015/05/18}{Error message when using \protect\cs{beginnumbering}…\protect\cs{endnumbering} without \protect\cs{pstart}.}
+% \changes{v1.16.0}{2015/05/18}{Error message when using \protect\cs{beginnumbering}\ …\ \protect\cs{endnumbering} without \protect\cs{pstart}.}
% \changes{v1.16.0}{2015/05/18}{Error message when starting a Leftside/a Rightside while the previous one has not been yet typeset.}
% \changes{v1.16.0}{2015/05/18}{Error message when calling \protect\cs{Pages} inside `pages' environment and \protect\cs{Columns} inside `pairs' environment.}
% \changes{v1.16.0}{2015/05/18}{New package option sameparallelpagenumber to have the same page number for both left and right side.}
@@ -293,7 +293,7 @@
% \changes{v2.14.4}{2016/11/14}{Take into account \protect\cs{linenumberstyle} when using \protect\cs{edlineref}.}
% \changes{v2.15.0}{2016/12/12}{Add \protect\option{movecolumnspositiononrightpage} option.}
% \changes{v2.15.0}{2016/12/12}{New macro \protect\cs{sidenotemarginR}, fix default value to right.}
-% \changes{v.2.15.0}{2016/12/12}{Fix a bug with \protect\cs{msdata} when using multiple \protect\cs{beginnumbering}…\protect\cs{endnumbering}}
+% \changes{v.2.15.0}{2016/12/12}{Fix a bug with \protect\cs{msdata} when using multiple \protect\cs{beginnumbering}\ …\ \protect\cs{endnumbering}}
% \changes{v2.15.0}{2016/12/12}{Fix a bug about space before sectioning commands after a pairs environment (bug added in v.~2.14.4).}
% \changes{v2.15.0}{2016/12/12}{Fix a bug with page break when using \protect\cs{columns} (bug added in v.~2.14.1).}
% \changes{v2.16.0}{2016/12/23}{Compatibility with \protect\cs{setmsdataposition}}
@@ -317,11 +317,11 @@
% \changes{v2.20.0}{2017/08/17}{Fix a bug with \protect\cs{continuousnumberingwithcolumns} when using multiple series of continued numbering text. Now, the line number are correctly reset at each \protect\cs{beginnumbering}.}
% \changes{v2.20.0}{2017/08/17}{Fix a bug with \protect\option{continuousnumberingwithcolumns} and inner / outer notes and line numbering.}
% \changes{v2.20.0}{2017/08/17}{Add \protect\cs{linenumOnlyPagesForColumns} and \protect\cs{linenumOnlyPagesForColumnsR} to tell to print the line numbers associated with a column only on some specific pages (for example, only on right pages).}
-% \changes{v2.20.0}{2017/08/17}{Fix a bug with \protect\option{continuousnumberingwithcolumns} when a \protect\cs{beginnumbering} is called after an other \protect\cs{beginnumbering}…\protect\cs{endnumbering}.}
+% \changes{v2.20.0}{2017/08/17}{Fix a bug with \protect\option{continuousnumberingwithcolumns} when a \protect\cs{beginnumbering} is called after an other \protect\cs{beginnumbering}\ …\ \protect\cs{endnumbering}.}
% \changes{v2.20.0}{2017/08/17}{Fix a bug with \protect\option{widthliketwocolumns} when manually setting \protect\cs{beforecolumnseparator} and \protect\cs{aftercolumnseparator}.}
% \changes{v2.20.0}{2017/08/17}{Fix compatibility between \protect\option{continuousnumberingwithcolumns} and \protect\cs{numberpstartfalse}.}
-% \changes{v2.20.1}{2017/08/23}{Fix bug with \protect\cs{continuousnumberingwithcolumns} when left column and right column have not the same size.}
-
+% \changes{v2.20.1}{2017/08/23}{Fix bug with \protect\option{continuousnumberingwithcolumns} when left column and right column have not the same size.}
+% \changes{v2.20.2}{2017/08/31}{Fix bugs with \protect\option{continuousnumberingwithcolumns} when going to a new page}
% ^^A PW added following as the definitions are at some unknown elsewhere
%
% \newcommand{\egstart}{%
@@ -602,17 +602,47 @@
% In most cases, you should use \protect\cs{widthliketwocolumns} in combination with \protect\cs{Xnoteswidthliketwocolumns} and \protect\cs{notesXwidthliketwocolumns} to align the critical/familiar footnotes with the two colums.
% See \macpackage's handbook for more details.
%
-% \label{continuousnumberingwithcolumns}If you want to have continuous line numbers between multiple columns and single columns, use the \option{continuousnumberingwithcolumns} option when loading \macpackage or \parpackage.
-% You will need to use \cs{pausenumbering}\ldots\cs{resumenumbering} instead of \cs{endnumbering}\ldots{endnumbering} (see \reff{reledmac-pause}).
-%
-% The first time you start \textbf{a left column or a single column}, use \cs{beginnumbering}, then use \cs{resumenumbering}. When you stop a left or a single column, use \cs{pausenumbering}, except the last time, where you must use \cs{endnumbering}.
-%
-% The first time you start \textbf{a right column}, use \cs{beginnumbering}, then use \cs{resumenumbering}. When you stop a right column, use \cs{pausenumbering}, except the last time, where you must use \cs{endnumbering}.
-%
% \subsubsection{Schemas of column typesetting}
% Domenico Cufalo wrote a schema of the parallel column typesetting parameters, with explanations.
% You can read the file \href{run:doc-more/page-typesetting-columns.pdf}{doc-more/page-typesetting-columns.pdf}.
%
+% \subsubsection{Continuous numbering between single and double column texts}
+% \label{continuousnumberingwithcolumns}If you want to have continuous line
+% numbers between multiple columns and single columns, use the
+% \option{continuousnumberingwithcolumns} option when loading \macpackage
+% or \parpackage.
+% You will need to use \cs{pausenumbering}~…\
+% \cs{resumenumbering} in addition to \cs{beginnumbering}~…\
+% \cs{endnumbering} (see \reff{reledmac-pause}).
+%
+% The best way to understand the behaviour of \cs{pausenumbering} and
+% \cs{resumenumbering} is to think of the left-column text as a continuation of
+% single-column text (or, vice versa, to think of single-column text as
+% left-column text), and of the right-column as independent text, which needs to be
+% synchronised with the left one manually. The numbering commands in a
+% right column are interconnected with each other, and not with the respective
+% left-column commands.
+%
+% This means that you must switch between single-column and left-column
+% text using \cs{beginnumbering}~…\ \cs{pausenumbering}~…\
+% \cs{resumenumbering}~…\ \cs{pausenumbering}~…\
+% \cs{resumenumbering}~…\ \cs{endnumbering}.
+%
+% On the other side, the first right column must always begin with
+% \cs{beginnumbering}, no matter if the corresponding left-column started
+% with \cs{resumenumbering} or not; this is because numbering in the right
+% column has not been started yet. Then, for consecutive chunks of
+% right-column text you should use \cs{pausenumbering}~…\
+% \cs{resumenumbering}. The important thing to remember is that you have
+% to use \cs{endnumbering} in a right column before every
+% \cs{endnumbering} in single-column text or in parallel with
+% \cs{endnumbering} in a left-column text (the latter is the case when a
+% document or a section ends in a two-columns mode). Without this, you will
+% get wrong numbering when a right column reappears next time.
+%
+% The file
+% \file{examples/4-reledpar_column_mix_with_not_column-continuous-numbering.tex}
+% covers all these cases.
% \subsection{Note about \cs{AtEveryPstart*} and \cs{AtEveryPend*}}
% The content of \cs{AtEveryPstart} / \cs{AtEveryPend} (without star) is added before every \cs{pstart} / after every \cs{pend}, respecting the left / right side.
%
@@ -1047,9 +1077,9 @@
% \DescribeMacro{\linenummarginColumns}
% \DescribeMacro{\linenummarginColumnsR}
% \DescribeMacro{\linenummarginColumns*}
-% Suppose you typeset parallel texts both in parallel pages and in parallel columns.
-% In this case, your setting of line margin in parallel pages could be different from your setting of line margin in parallel columns.
-% For example, you could want to have line numbers on the right when your are in parallel pages, but when you are in parallel columns, to have them on the left for the left column and on the right for the right column.
+% Suppose you typeset texts both in parallel pages (or in normal typesetting) and in parallel columns.
+% In this case, your setting of line margin in parallel pages (or in normal typesetting) could be different from your setting of line margin in parallel columns.
+% For example, you could want to have line numbers on the right when your are in parallel pages (or in normal typesetting), but when you are in parallel columns, to have them on the left for the left column and on the right for the right column.
%
% In this case, you can use \cs{linenummarginColumns}, which overrides the default setting for the left column, \cs{linenummarginColumnsR} which overrides the default setting for the right column, and \cs{linenummarginColumns*}, which overrides the default for both left and right columns.
%
@@ -1336,7 +1366,7 @@
% \begin{macrocode}
%<*code>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{reledpar}[2017/08/23 v2.20.1 reledmac extension for parallel texts]%
+\ProvidesPackage{reledpar}[2017/08/31 v2.20.2 reledmac extension for parallel texts]%
% \end{macrocode}
% \subsection{Package's requirement}
@@ -1658,7 +1688,7 @@
% \begin{macro}{\led@error@missing@numbering}
% \begin{macrocode}
\newcommand{\led@error@missing@numbering}[1]{%
- \reledpar@error{Missing \string\pstart…\string\pend\space inside `#1` environment}{\@ehc}%
+ \reledpar@error{Missing \string\pstart\space …\space\string\pend\space inside `#1` environment}{\@ehc}%
}%
% \end{macrocode}
% \end{macro}
@@ -1774,6 +1804,7 @@
\global\l@dnumpstartsR \z@
\global\pst@rtedRfalse
\global\numberingRtrue
+ \global\afterendnumberingRfalse%
\global\advance\section@numR \@ne
\global\absline@numR \z@
\gdef\normal@page@breakR{}
@@ -1790,6 +1821,9 @@
\global\let\@msdata@list\relax%
\global\csundef{@msdata@\add@msd@cR @dataR}%
\ifcontinuousnumberingwithcolumns%
+ \ifnumbering%
+ \global\resumenumberingR@starttrue%
+ \fi%
\ifnumberpstart%
\addtocounter{pstartR}{1}%
\fi%
@@ -1797,7 +1831,6 @@
\setcounter{pstartR}{1}%
\fi%
\message{Section \the\section@numR R }%
- \set@continuousnumberingforR%
\line@list@stuffR{\jobname.\extensionchars\the\section@numR R}%
\l@dend@stuff
\begingroup
@@ -1829,6 +1862,7 @@
\def\endnumberingR{%
\ifnumberingR
\global\numberingRfalse
+ \global\afterendnumberingRtrue%
\normal@pars
\ifnum\l@dnumpstartsR=0%
\led@err@NumberingWithoutPstart%
@@ -1918,7 +1952,10 @@
\else%
\global\pausenumbering@page@numR=\next@page@numR%
\fi%
- \endnumberingR\global\numberingRtrue}
+ \endnumberingR%
+ \global\numberingRtrue%
+ \global\afterendnumberingRfalse%
+}%
\newif\ifresumenumberingR@start%
\newcommand*{\resumenumberingR}{%
\ifnumberingR
@@ -1926,7 +1963,6 @@
\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%
@@ -2029,23 +2065,6 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\set@continuousnumberingforR}
-% \cs{set@continuousnumberingforR} set the right line number and the pstart counters at a \cs{beginnumberingR} or a \cs{resumenumberingR} in order to have continuous numbering with single column text.
-% \begin{macrocode}
-\newcommand{\set@continuousnumberingforR}{%
- \ifcontinuousnumberingwithcolumns%
- \ifnum\line@numR<\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%
- \fi%
- \fi%
-}
-% \end{macrocode}
-% \end{macro}
% \begin{macro}{\lineation*}
% \changes{v1.8.2}{2014/08/15}{Add \protect\cs{lineation*}}
% \protect\cs{lineation*} change the lineation system for both sides.
@@ -2908,6 +2927,8 @@
\IfFileExists{\l@auxdir#1}%
{\global\toggletrue{notfirstrun@#1}}%
{\global\togglefalse{notfirstrun@#1}}%
+ \next@line@list@stuffR%
+ \global\let\next@line@list@stuffR\relax%
\read@linelist{#1}%
\iffirst@linenum@out@R
\global\first@linenum@out@Rfalse
@@ -2923,8 +2944,6 @@
\closeout\linenum@outR%
\openout\linenum@outR=\l@auxdir#1%
\fi%
- \next@line@list@stuffR%
- \global\let\next@line@list@stuffR\relax%
}%
% \end{macrocode}
@@ -3913,21 +3932,23 @@
\global\advance\@donetotallinesL\@ne%
\else%
\iflinenumberLevenifblank
- \new@lineL%
- \l@demptyd@ta%
- \getline@numL%
- \affixline@num%
\setbox\l@dleftbox \hb@xt@ \Lcolwidth{%
+ \new@lineL%
+ \l@demptyd@ta%
+ \getline@numL%
+ \affixline@num%
\l@dld@ta%
\hspace*{\Lcolwidth}%
\ledrlfill\l@drd@ta%
}%
\else%
- \ifcontinuousnumberingwithcolumns%
- \new@lineL%
- \getline@numL%
- \fi%
- \setbox\l@dleftbox \hb@xt@ \Lcolwidth{\hspace*{\Lcolwidth}}%
+ \setbox\l@dleftbox \hb@xt@ \Lcolwidth{%
+ \ifcontinuousnumberingwithcolumns%
+ \new@lineL%
+ \getline@numL%
+ \fi%
+ \hspace*{\Lcolwidth}%
+ }%
\fi%
\global\advance\@donetotallinesL\@ne%
\fi%
@@ -4101,21 +4122,23 @@
\global\advance\@donetotallinesR\@ne%
\else%
\iflinenumberRevenifblank%
- \new@lineR
- \l@demptyd@ta%
- \getline@numR%
\setbox\l@drightbox \hb@xt@ \Rcolwidth{%
+ \new@lineR%
+ \l@demptyd@ta%
+ \getline@numR%
\affixline@numR%
\l@dld@ta%
\hspace*{\Rcolwidth}%
\ledrlfill\l@drd@ta%
}%
\else%
- \ifcontinuousnumberingwithcolumns%
- \new@lineR%
- \getline@numR%
- \fi%
- \setbox\l@drightbox \hb@xt@ \Rcolwidth{\hspace*{\Rcolwidth}}%
+ \setbox\l@drightbox \hb@xt@ \Rcolwidth{%
+ \ifcontinuousnumberingwithcolumns%
+ \new@lineR%
+ \getline@numR%
+ \fi%
+ \hspace*{\Rcolwidth}%
+ }%
\fi%
\global\advance\@donetotallinesR\@ne%
\fi%
@@ -4329,22 +4352,18 @@
\@l@dtempcntb=\absline@numR
\ifnum\@l@dtempcntb<\next@actionlineR\else
\ifnum\next@actionR>-1001\relax
- \unless\ifresumenumberingR@start%
- \@firstlineofpageRtrue%
- \fi%
+ \ifboolexpr{%
+ bool{resumenumberingR@start}%
+ and test {\ifdimgreater{\pagedepth}{\z@}}%
+ }%
+ {}%
+ {\@firstlineofpageRtrue}%
\global\page@numR=\next@actionR
- \ifbypage@R
- \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
+ \ifcsdef{reset@lineR\the\absline@numR @\the\section@numR}%
+ {%
+ \global\line@numR=\z@ \global\subline@numR=\z@%
+ }%
+ {}%
\global\resumenumberingR@startfalse%
\add@msdata@firstlineofpage%
\else