summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/reledmac
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-10-03 22:22:30 +0000
committerKarl Berry <karl@freefriends.org>2016-10-03 22:22:30 +0000
commitcb087857d0f8ed2ed0dcea0e0b0024036ec471f3 (patch)
tree4fc2cee22a48ba6b36c92d2f371ec9a19218cf96 /Master/texmf-dist/source/latex/reledmac
parent2c1a714ccc634f16564f814900d3dd8200c815d7 (diff)
reledmac (3oct16)
git-svn-id: svn://tug.org/texlive/trunk@42197 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/reledmac')
-rw-r--r--Master/texmf-dist/source/latex/reledmac/reledmac.dtx612
-rw-r--r--Master/texmf-dist/source/latex/reledmac/reledpar.dtx167
2 files changed, 594 insertions, 185 deletions
diff --git a/Master/texmf-dist/source/latex/reledmac/reledmac.dtx b/Master/texmf-dist/source/latex/reledmac/reledmac.dtx
index 926e17c0054..3f8299fe575 100644
--- a/Master/texmf-dist/source/latex/reledmac/reledmac.dtx
+++ b/Master/texmf-dist/source/latex/reledmac/reledmac.dtx
@@ -428,7 +428,20 @@
% \changes{v2.15.1}{2016/09/07}{Fix \protect\cs{edindex} in tabular environments.}
% \changes{v2.15.2}{2016/09/12}{Fix bug with \protect\package{fancyhdr} package 3.8 and later.}
% \changes{v2.15.3}{2016/09/26}{Fix bug with \protect\cs{section} in optional argument of \protect\cs{pstart} and empty line before \protect\cs{pend} (bug added in v2.8.2).}
-% \changes{v2.15.3}{2016/09/26}{Simplification of the code concerning sectioning command.}
+% \changes{v2.15.3}{2016/09/26}{Simplification of the sectioning command code.}
+% \changes{v2.16.0}{2016/10/02}{Display warning message if using a version of \protect\LaTeX that is too old.}
+% \changes{v2.16.0}{2016/10/02}{Deleting dead code.}
+% \changes{v2.16.0}{2016/10/02}{New options of \protect\cs{fnpos} and \protect\cs{mpfnpos} to set a customized order for familiar and critical footnotes.}
+% \changes{v2.16.0}{2016/10/02}{Compatibility with new features of \protect\reledpar}
+% \changes{v2.16.0}{2016/10/02}{Fix bug with \protect\cs{Xtxtbeforenotes} for notes in three or two columns}
+% \changes{v2.16.0}{2016/10/02}{Fix bug with \protect\cs{Xgroupbylines} for notes in two columns}
+% \changes{v2.16.0}{2016/10/02}{Fix bug with `notenumber' option of \protect\package{indextools} package when indexing texts in familiar footnotes.}
+% \changes{v2.16.0}{2016/10/02}{When indexing texts in familiar footnotes with \protect\cs{edtext}, referring to the line number where the footnote is called.}
+% \changes{v2.16.0}{2016/10/02}{When indexing texts in sidenotes with \protect\cs{edtext}, referring to the line number where the sidenote is called.}
+% \changes{v2.16.0}{2016/10/02}{Fix potential bug when using \protect\cs{edindex} in critical footnotes.}
+% \changes{v2.16.0}{2016/10/02}{Add \protect\cs{Xendpagenumberonlyfirst}, \protect\cs{Xendpagenumberonlyfirstifsingle}, \protect\cs{Xendpagenumberonlyfirstintwo}, \protect\cs{Xendinplaceofpagenumber} and \protect\cs{Xendsympagenum} hooks.}
+% \changes{v2.16.0}{2016/10/02}{When \protect\cs{edindex} is called outside of a \protect\cs{beginnumbering}\protect\ldots\protect\cs{endnumbering} structure, it is automatically switched to \protect\cs{index}, with a warning message.}
+
% \title{\Macpackage \\
% Typeset scholarly editions with \LaTeX\thanks{This file (\dtxfilename)
% has version number \fileversion, last revised \filedate.}}
@@ -965,16 +978,16 @@
% There are similar commands, \protect\cs{firstsublinenum}\marg{num} and
% \protect\cs{sublinenumincrement}\marg{num} for controlling sub-line numbering.
%
-% \DescribeMacro{\linenumberlist}
+% \DescribeMacro{\linenumberlist}\label{linenumberlist}
% You can define \protect\cs{linenumberlist} to specify a non-uniform distribution
% of printed line numbers. For example: \\
-% \verb?\def\linenumberlist{1,2,3,5,7,11,13,17,19,23,29}? \\
+% \verb?\gdef\linenumberlist{1,2,3,5,7,11,13,17,19,23,29}? \\
% to have numbers printed on prime-numbered lines only. There must be
% no spaces within the definition which consists of comma-separated integer
% numbers. The numbers can be in any order but it is easier to read if you
% put them in numerical order. Either omitting the definition of
% \protect\cs{linenumberlist} or following the empty definition \\
-% \verb?\def\linenumberlist{}? \\
+% \verb?\gdef\linenumberlist{}? \\
% the standard numbering sequence is applied. The standard sequence
% is that specified by the combination of the \verb+firstlinenum+,
% \verb+linenumincrement+, \verb+firstsublinenum+ and
@@ -1759,6 +1772,33 @@
% \begin{verbatim}
% \mpfnpos{familiar-critical}
% \end{verbatim}
+%
+% You can also decide to alternate familiar and critical footnotes with your own order.
+% In this case, the second argument of \cs{fnpos} or \cs{mpfnpos} is a comma separated list of values.
+% Each value has the following form:\\
+% \meta{series}\meta{type}
+%
+% \meta{series} is a series letter (A,B,C etc.), while \meta{type} must be either \enquote{critical} or \enquote{familiar}.
+%
+% For example, suppose you want to first print the familiar footnotes of the \enquote{A} series, then all the series of critical footnotes, and finally all the series of familiar footnotes, except the \enquote{A} series.
+% In this case, use the following command:
+% \begin{verbatim}
+%\fnpos{%
+% {A}{familiar},
+% {A}{critical},%
+% {B}{critical},%
+% {C}{critical},%
+% {D}{critical},%
+% {E}{critical},%
+% {B}{familiar},%
+% {C}{familiar},%
+% {D}{familiar},%
+% {E}{familiar}%
+%}
+% \end{verbatim}
+% Note that you must define the position of all the series of footnotes you use.
+% If you don't, you will have infinite runs of \LaTeX.
+%
% \section{Critical apparatus appearance}
% \label{displayoptions}
% \changes{v1.0.0}{2012/09/15}{New generic commands to customize footnote display.}
@@ -1849,6 +1889,33 @@
% \DescribeMacro{\Xendsymlinenum}
% For endnotes, \cs{Xendnumberonlyfirstinline}; \cs{Xendnumberonlyfirstintwolines} and \cs{Xendsymlinenum} are the equivalents of
% \\ \cs{Xnumberonlyfirstinline}; \cs{Xnumberonlyfirstintwolines} and \cs{Xsymlinenum}.
+%
+% \subsubsection{Print page number only at first time}
+% For endnotes, \reledmac provides tools to print the page number only the first time it is seen.
+% However, when a lemma spans over two pages, the line numbers are normally printed following this pattern: start page number - start line number - end page number - end line number.
+% Consequently, what is the `page number' is not obvious. So:
+% \DescribeMacro{\Xendpagenumberonlyfirst} \cs{Xendpagenumberonlyfirst}\oarg{s} can be called to tell that the start page number of a lemma is not printed if it is equal to the end page number of the previous lemma.
+% You can use \emph{as complement} one (and only one) of the following commands:
+% \begin{itemize}
+% \item \cs{Xendpagenumberonlyfirstifsingle}\oarg{s}:
+% the first page number of the lemma will not be printed only if the following conditions are true:
+% \begin{enumerate}
+% \item The start page number of the lemma is equal to the end page number of the previous lemma.
+% \item The end page number of the lemma is equal to the start page number of the lemma.
+% \end{enumerate}
+% In this case the end page number will always be printed if differing from the start page number.
+% \item \cs{Xendpagenumberonlyfirstintwo}\oarg{s}: both the start page number and the end page number of a lemma are not printed if they are both equal to respectively the start page number and the end page number of the previous lemma.
+%
+% \end{itemize}
+
+%
+% In any case, you can use:
+% \begin{itemize}
+% \item \DescribeMacro{\Xendsympagenum} \cs{Xendsympagenum}\oarg{series}\marg{c} to tell to print \meta{c} when the page number is not printed.
+% \item \DescribeMacro{\Xendinplaceofpagenumber} \cs{Xendinplaceofpagenumber}\oarg{series}\marg{l} to tell to print a horizontal space of \meta{l} if no symbol is printed instead of page number.
+%
+% \end{itemize}
+%
% \subsubsection{Arbitrary text before line number}
% \DescribeMacro{\Xbeforenumber}
% \cs{Xbeforenumber}\oarg{s}\marg{txt} allow to insert \meta{txt} before the line number, only when the line number is printed, so taking into accout \cs{Xnumberonlyfirstinline} and similar.
@@ -1949,6 +2016,13 @@
% \textbf{However, it does not change anything for the separator in side number. Use \cs{Xsublinesep} without optional argument or \cs{Xsublinesepside}\marg{txt} to do it.}
%
% The default value is \verb+\textnormal{.}+.
+% \subsubsection{Separator between page and line numbers}
+% \changes{v2.16.0}{2016/01/10}{Add \protect\cs{Xpagelinesep} hook.}
+% \DescribeMacro{\Xpagelinesep}
+% \cs{Xpagelinesep}\oarg{s}\marg{txt} changes the separator between the page and line number in footnotes.
+%
+% By default, the value defined for \cs{Xsublinesep} is used.
+%
% \subsubsection{Space around number}
% \DescribeMacro{\Xbeforenumber}
% With \protect\cs{Xbeforenumber}\oarg{s}\marg{l}, you can add some space before the line number in a footnote. If the line number is not printed, the space is not either. The default value is 0~pt.
@@ -2971,9 +3045,9 @@
% If two note commands for the same side are called in the same line, they will
% be appended and separated by a comma.
%
-% \textbf{The notes will appear only at the second \LaTeX\ run. If the note positions change in your \texttt{.tex} file,
+% \textbf{The notes will appear only after the second \LaTeX\ run. If the note positions change in your \texttt{.tex} file,
% you need two runs to get the correction position in the output file.
-% You are strongly encouraged to use tools like \emph{latexmk}, to be sure to get the good number of runs.}
+% You are strongly encouraged to use tools like \emph{latexmk}, to be sure to get the correct number of runs.}
% \subsection{Setting}
%
% \subsubsection{Width}
@@ -3038,6 +3112,8 @@
% \item Load \macpackage.
% \item Declare the index with the macro \cs{makeindex} of \package{imakeidx} and \package{indextools}.
% \end{enumerate}
+%
+% Also note that using \cs{edtext} in familiar footnotes refer to the line the footnotes are called
% \subsection{Referring to critical notes}
% If you want to refer to a word inside an
% \protect\cs{edtext}\marg{lemma}\marg{app} command, \protect\cs{edindex} should be defined inside
@@ -3761,7 +3837,7 @@
% \begin{macrocode}
%<*code>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{reledmac}[2016/09/26 v2.15.3 typeset critical editions]%
+\ProvidesPackage{reledmac}[2016/10/02 v2.16.0 typesetting critical editions]%
% \end{macrocode}
%
% \subsection{Package options}
@@ -3895,10 +3971,14 @@
\RequirePackage{xargs}
\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}})}%
+ {\PackageWarning{reledmac}{You are using a LaTeX version older than 2016/03/31 patch 3.%
+ \MessageBreak You are strongly encouraged to use a newer version.}}%
+ {}%
+ }%
{\RequirePackage{etex}%
\csname reserveinserts\endcsname{32}%
-}
+ }%
\RequirePackage{suffix}
\RequirePackage{xstring}
\RequirePackage{ifluatex}
@@ -4141,16 +4221,16 @@
\@latex@warning@no@line{Label `#1' multiply defined}%
}%
\newcommand*{\led@warn@AppLabelOutSecondArgEdtext}[1]{%
- \reledmac@warning{\string\applabel\space outside of the second argument of an \string\edtext\space `#1' on page \the\pageno.}}%
+ \reledmac@warning{\string\applabel\space outside of the second argument of an \string\edtext\space `#1' on page \thepage.}}%
\newcommand*{\led@warn@RefUndefined}[1]{%
\G@refundefinedtrue%
- \reledmac@warning{Reference `#1' on page \the\pageno\space undefined.%
+ \reledmac@warning{Reference `#1' on page \thepage\space undefined.%
Using `000'.}%
\@latex@warning{Reference `#1' undefined\on@line}%
}%
\newcommand*{\led@warn@pairRefUndefined}[1]{%
\G@refundefinedtrue%
- \reledmac@warning{Reference `#1:start' and/or `#1:end' on page \the\pageno\space undefined.
+ \reledmac@warning{Reference `#1:start' and/or `#1:end' on page \thepage\space undefined.
Using `??'.}%
\@latex@warning{Reference `#1:start' and/or `#1:end' undefined\on@line}%
}
@@ -4188,6 +4268,12 @@
}%
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\led@err@BadAction}
+% \begin{macrocode}
+\newcommand*{\led@err@StanzaIndentNotDefined}{%
+ \reledmac@error{You have not defined indentation for the line of verse \number\stanza@count}{\@ehc}}%
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{\led@err@ManySidenotes}
% \begin{macro}{\led@err@ManyLeftnotes}
% \begin{macro}{\led@err@ManyRightnotes}
@@ -4312,6 +4398,20 @@
}%
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\led@error@fail@patch@endminipage}
+% \begin{macrocode}
+\newcommand{\led@error@fail@patch@makeindex}{%
+ \reledmac@error{Fail to patch \string\makeindex\space command.}{\@ehc}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \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.}%
+}%
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{\led@warning@hsizeX@deprecated}
% \begin{macrocode}
\newcommand{\led@warning@hsizeX@deprecated}{%
@@ -4902,7 +5002,9 @@
% $0$ for left, $1$ for right, $2$ for outer, and $3$ for inner.
% \changes{v0.7.0}{2005/02/23}{Added \protect\cs{l@dgetline@margin}}
% \begin{macrocode}
-\newcount\line@margin
+\newcount\line@margin%
+\newcount\line@margin@columns%Only for parallel typesetting
+\line@margin@columns=\m@ne%
\newcommand*{\linenummargin}[1]{{%
\l@dgetline@margin{#1}%
@@ -7354,7 +7456,7 @@
% \item \textbf{When this auxiliary file is read at the second run}, different operations are achieved:
% \begin{enumerate}
% \item Get the rank of each \protect\cs{sameword} in a line (relative rank) from the rank of each \protect\cs{sameword} in all the numbered section (absolute rank):
-% \begin{itemize}
+% \begin{itemize}
% \item For each paired \protect\cs{sameword} argument and absolute line number, a counter is defined. Its value corresponds to the number of times \protect\cs{sameword}\marg{argument} is called from the beginning of the lineation to the end of the current line. We also store the same data for the preceding absolute line number, if it does not have \protect\cs{sameword}\marg{argument}.
% \item For each \protect\cs{sameword} having the same argument, we subtract from its absolute rank the number stored for the paired \protect\cs{sameword} argument and previous absolute line number. Consequently, we obtain the relative rank.
% \item See the following example which explains how, for same \protect\cs{sameword}, absolute ranks are transformed to relative ranks.
@@ -7373,7 +7475,7 @@
% absolute rank 4 becomes relative rank 4-3 = 1
% 4 is stored for this \sameword and line 4
% \end{verbatim}
-% \end{itemize}
+% \end{itemize}
% \item Create lists of lists of \protect\cs{sameword} by depth of \protect\cs{edtext}.
% That is: create a list for \protect\cs{edtext}s of level~1, a list for \protect\cs{edtext}s of level~2, a list for \protect\cs{edtext}s of level~3 etc.
% For each \protect\cs{edtext} in these lists, we store all of the relative ranks of \protect\cs{saweword} which are called as lemma information. That is: 1) either called in the first argument of \protect\cs{sameword}, or, 2) called in the \protect\cs{lemma} macro of the second argument of \protect\cs{sameword} AND marked by the optional argument of \protect\cs{saweword} in first argument of \protect\cs{edtext}.
@@ -7400,7 +7502,7 @@
%The list for \protect\cs{edtext}s of level~2 is $\{\{1,2,2,3\},\{5\}\}$.
%
% As you can see, the mandatory argument of \protect\cs{sameword} does not matter: we store the rank informations for every word potentially ambiguous.
-% \end{enumerate}
+% \end{enumerate}
% \item At the second run, when a critical notes is called, we associate it to the next item of the list associated to its \protect\cs{edtext} level. So, in the previous example:
% \begin{itemize}
% \item Critical notes (A) and (B) are associated with $\{1,2,2,3\}$.
@@ -7413,10 +7515,10 @@
% \item The \protect\cs{sameword} command is let \protect\cs{sameword@inedtext}.
% \item At each call of this \protect\cs{sameword@inedtext}, we step to the next element of the list associated to the note. Let it be $r$.
% \item For the word marked by \protect\cs{sameword}, we calculate how many time it is called in its line. To do it:
-% \begin{itemize}
+% \begin{itemize}
% \item We get the absolute line number of the current \protect\cs{sameword}. This absolute line number was stored with a list of relative ranks for the current \protect\cs{edtext}. That means, in the previous example, that if the absolute line number of \protect\cs{edtext} was 1, that critical notes (A) and (B) were not associated with $\{1,2,2,3\}$ but with $\{(1,1),(2,1),(2,1),(3,1)\}$. Such a method of knowing the absolute line number associated to a \protect\cs{sameword} is required because a \protect\cs{edtext} can overlap many lines, but \protect\cs{sameword} can't get it.
% \item When reading the auxiliary file, we get the value associated to the pair composed by the current marked word and the current absolute line number. To this value, we subtract the value associated to the pair composed by the current marked word and the previous absolute line number. Let the result be $n$.
-% \end{itemize}
+% \end{itemize}
% \item If $n >1 $, that means the current word appears more than once in its line. In this case, we call \protect\cs{showwordrank} with the word as the first argument and $r$ as the second argument. If the word is called only once, we just print it.
% \end{itemize}
% \end{itemize}
@@ -8504,7 +8606,9 @@
\gdef\l@drd@ta{\rlap{{\rightlinenum}}}%
\fi
\else
- \@l@dtempcntb=\line@margin
+ \ifboolexpr{bool {l@dprintingcolumns} and test {\ifnumgreater{\line@margin@columns}{\m@ne}}}%
+ {\@l@dtempcntb=\line@margin@columns}%
+ {\@l@dtempcntb=\line@margin}%
\ifnum\@l@dtempcntb>\@ne
\advance\@l@dtempcntb \page@num
\fi
@@ -8916,7 +9020,9 @@
{\noindent\csuse{Xtxtbeforenotes@#1}}%
{\expandafter\insert\csname#1footins\endcsname%
\bgroup%
- \noindent\strut\csuse{Xnotefontsize@#1}\csuse{Xtxtbeforenotes@#1}%
+ \noindent%
+ \csuse{\csuse{series@display#1}@begin@insert}{#1}%
+ \strut\csuse{Xnotefontsize@#1}\csuse{Xtxtbeforenotes@#1}%
\egroup%
}%
}%
@@ -10024,18 +10130,7 @@
%
% \begin{macrocode}
\notbool{parapparatus@}{\newcommand*}{\newcommand}{\threecolfootfmt}[4]{%
- \normal@pars%
- \nottoggle{Xgroupbyline@#4}%
- {\hsize \csuse{Xhsizethreecol@#4}}%
- {}%
- \nottoggle{Xparindent@#4}{\parindent=\z@}{}%
- \tolerance=5000%
- \hangindent=\csuse{Xhangindent@#4}%
- \everypar{\hangindent=\csuse{Xhangindent@#4}}%
- \@tempdima=\parindent%
- \csuse{Xcolalign@#4}%
- \parindent=\@tempdima%
- \strut%
+ \threecol@begin@insert{#4}%
\hspace{\parindent}%
\printlinefootnote{#1}{#4}%
\print@lemma{#1}{#2}{#4}%
@@ -10046,7 +10141,25 @@
}%
% \end{macrocode}
% \end{macro}
-%
+% \begin{macro}{\threecol@begin@insert}
+% The \cs{threecol@begin@insert} contains code used at the beginning of any \cs{insert} for critical footnotes in three columns. It is used both by \cs{threecolfootfmt} and by \cs{insert@Xtxtbeforenotes}.
+% \begin{macrocode}
+\newcommand{\threecol@begin@insert}[1]{%
+ \normal@pars%
+ \nottoggle{Xgroupbyline@#1}%
+ {\hsize \csuse{Xhsizethreecol@#1}}%
+ {}%
+ \nottoggle{Xparindent@#1}{\parindent=\z@}{}%
+ \tolerance=5000%
+ \hangindent=\csuse{Xhangindent@#1}%
+ \everypar{\hangindent=\csuse{Xhangindent@#1}}%
+ \@tempdima=\parindent%
+ \csuse{Xcolalign@#1}%
+ \parindent=\@tempdima%
+ \strut%
+}%
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{\threecolfootgroup}
% And here is the \verb"footgroup" macro that is called within the
% output routine to regroup the notes into three columns. Once
@@ -10146,9 +10259,13 @@
% \end{macrocode}
% \begin{macrocode}
\notbool{parapparatus@}{\newcommand*}{\newcommand}{\twocolvfootnote}[2]{%
- \csuse{Xbeforeinserting@#1}%
- \insert\csname #1footins\endcsname{%
- \twocolvfootnote@inserted{#1}{#2}%
+ \iftoggle{Xgroupbyline@#1}{%
+ \prepare@Xgroupbyline{#1}{#2}{\twocolvfootnote@inserted}%
+ }{%
+ \X@beforeinsertion{#1}%
+ \insert\csname #1footins\endcsname{%
+ \twocolvfootnote@inserted{#1}{#2}%
+ }%
}%
}%
\notbool{parapparatus@}{\newcommand*}{\newcommand}{\twocolvfootnote@inserted}[2]{%
@@ -10161,16 +10278,7 @@
% \end{macrocode}
% \begin{macrocode}
\notbool{parapparatus@}{\newcommand*}{\newcommand}{\twocolfootfmt}[4]{% 4th arg is optional, for backward compatibility
- \normal@pars%
- \hsize \csuse{Xhsizetwocol@#4}%
- \nottoggle{Xparindent@#4}{\parindent=\z@}{}%
- \tolerance=5000%
- \hangindent=\csuse{Xhangindent@#4}%
- \everypar{\hangindent=\csuse{Xhangindent@#4}}%
- \@tempdima=\parindent%
- \csuse{Xcolalign@#4}%
- \parindent=\@tempdima%
- \strut%
+ \twocol@begin@insert{#4}%
\hspace{\parindent}%
\printlinefootnote{#1}{#4}%
\print@lemma{#1}{#2}{#4}%
@@ -10181,6 +10289,19 @@
}%
% \end{macrocode}
% \begin{macrocode}
+\newcommand{\twocol@begin@insert}[1]{%
+ \normal@pars%
+ \hsize \csuse{Xhsizetwocol@#1}%
+ \nottoggle{Xparindent@#1}{\parindent=\z@}{}%
+ \tolerance=5000%
+ \hangindent=\csuse{Xhangindent@#1}%
+ \everypar{\hangindent=\csuse{Xhangindent@#1}}%
+ \@tempdima=\parindent%
+ \csuse{Xcolalign@#1}%
+ \parindent=\@tempdima%
+ \strut%
+}%
+
\newcommand*{\twocolfootgroup}[1]{%
\csuse{Xbhookgroup@#1}\par%
\splittopskip=\ht\strutbox
@@ -10753,7 +10874,7 @@
{\leavevmode\hbox to \csuse{Xboxstartlinenum@\@currentseries}\bgroup\hfill}%
\ifl@d@pnum%
\wrap@edcrossref{\@this@crossref@start}{#1}%
- \csuse{Xsublinesep@\@currentseries}%
+ \csuse{Xpagelinesep@\@currentseries}%
\fi%
\wrap@edcrossref{\@this@crossref@start}{%
\linenumrep{#2}%
@@ -10789,7 +10910,7 @@
\fi%
\ifl@d@pnum%
\wrap@edcrossref{\@this@crossref@end}{#4}%
- \csuse{Xsublinesep@\@currentseries}%
+ \csuse{Xpagelinesep@\@currentseries}%
\fi%
\ifl@d@elin%
\wrap@edcrossref{\@this@crossref@end}{%
@@ -11309,9 +11430,11 @@
{\footnotelang@poly[R]}%
\xright@appenditem{%
\noexpand\led@set@index@fornote{#1}%
+ \noexpand\prepare@edindex@fornote{\l@d@nums}%
\unexpanded{\def\this@footnoteX@reading}{\the\csname footnote#1@reading\endcsname}%
\noexpand\vbfnoteX{#1}{#2}{\expandonce\thisfootnote}%
\noexpand\led@reinit@index@fornote%
+ \unexpanded{\advance\@edindex@fornote@\m@ne}%
}%
\to\inserts@listR
\global\advance\insert@countR \@ne%
@@ -11324,9 +11447,11 @@
{\footnotelang@poly}%
\xright@appenditem{%
\noexpand\led@set@index@fornote{#1}%
+ \noexpand\prepare@edindex@fornote{\l@d@nums}%
\unexpanded{\def\this@footnoteX@reading}{\the\csname footnote#1@reading\endcsname}%
\noexpand\vbfnoteX{#1}{#2}{\expandonce\thisfootnote}%
\noexpand\led@reinit@index@fornote%
+ \unexpanded{\advance\@edindex@fornote@\m@ne}%
}%
\to\inserts@list
\global\advance\insert@count \@ne%
@@ -12463,6 +12588,8 @@
\newcommand*{\doendnotes}[1]{%
\l@dend@close{#1}%
\begingroup
+ \csxdef{prevpagenum@#1}{}%
+ \csxdef{prevpagerange@#1}{}%
\makeatletter
\expandafter\let\csname #1end\endcsname=\endprint
\input\l@auxdir\jobname.#1end%
@@ -12478,6 +12605,8 @@
% \begin{macrocode}
\newcommand*{\doendnotesbysection}[1]{%
\l@dend@close{#1}%
+ \csxdef{prevpagenum@#1}{}%
+ \csxdef{prevpagerange@#1}{}%
\global\expandafter\advance\csname #1end@bysection\endcsname by 1%
\begingroup%
\makeatletter%
@@ -12600,7 +12729,8 @@
% \changes{v0.3.0}{2004/02/14}{Added \protect\cs{linenumr@p} and \protect\cs{sublinenumr@p}
% to \protect\cs{printendlines}}
% \begin{macrocode}
-\def\printendlines#1|#2|#3|#4|#5|#6|#7|#8|{\begingroup
+\def\printendlines#1|#2|#3|#4|#5|#6|#7|#8|{%
+ \begingroup
\setprintendlines{#1}{#2}{#3}{#4}{#5}{#6}%
% \end{macrocode}
% The only subtlety left here is when to print a period between
@@ -12609,36 +12739,69 @@
% sub-line number (in which case we want only the dash) or after an
% ending line number (in which case we need to insert a period).
%
-% So, first, print the start lines.
+% So, first, start the start line box, if required.
% \begin{macrocode}
\ifdimequal{\csuse{Xendboxstartlinenum@\@currentseries}}{0pt}%
{\bgroup}%
{\leavevmode\hbox to \csuse{Xendboxstartlinenum@\@currentseries}\bgroup\hfill}%
- \wrap@edcrossref{\@this@crossref@start}{\printnpnum{#1}}%
+% \end{macrocode}
+% Then, print the start page-
+% \begin{macrocode}
+ \ifboolexpr{%
+ (%
+ test{\ifcsstring{prevpagenum@\@currentseries}{#1}}%
+ and not%
+ (togl{Xendpagenumberonlyfirstifsingle@\@currentseries} and bool{l@d@pnum})%
+ )%
+ or%
+ (%
+ test {\ifcsstring{prevpagerange@\@currentseries}{#1-#4}}%
+ )%
+ }%
+ {%
+ \ifcsempty{Xendsympagenum@\@currentseries}%
+ {\hspace{\csuse{Xendinplaceofpagenumber@\@currentseries}}}%
+ {\csuse{Xendsympagenum@\@currentseries}}%
+ }%
+ {%
+ \wrap@edcrossref{\@this@crossref@start}{\printnpnum{#1}}%
+ }%
+% \end{macrocode}
+% Then, determine what must be printed before the start line.
+% \begin{macrocode}
\ifl@d@dash%
- \ifl@d@pnum%
- \csuse{Xendlineprefixsingle@\@currentseries}%
- \else%
- \ifcsempty{Xendlineprefixmore@\@currentseries}%
- {\csuse{Xendlineprefixsingle@\@currentseries}}
- {\csuse{Xendlineprefixmore@\@currentseries}}%
- \fi%
+ \ifl@d@pnum%
+ \csuse{Xendlineprefixsingle@\@currentseries}%
+ \else%
+ \ifcsempty{Xendlineprefixmore@\@currentseries}%
+ {\csuse{Xendlineprefixsingle@\@currentseries}}%
+ {\csuse{Xendlineprefixmore@\@currentseries}}%
+ \fi%
\else%
- \csuse{Xendlineprefixsingle@\@currentseries}%
+ \csuse{Xendlineprefixsingle@\@currentseries}%
\fi%
+% \end{macrocode}
+% The print the start line, following, if required, by the side flag and the start sub line.
+% \begin{macrocode}
\wrap@edcrossref{\@this@crossref@start}{\linenumrep{#2}}%
\iftoggle{Xendlineflag@\@currentseries}{\ifledRcol@\@Rlineflag\fi}{}%
\ifl@d@ssub%
\csuse{Xendsublinesep@\@currentseries}%
\wrap@edcrossref{\@this@crossref@start}{\sublinenumrep{#3}}%
\fi%
+% \end{macrocode}
+% Close the box.
+% \begin{macrocode}
\egroup%
% \end{macrocode}
-% And now, print the dash + the end line number, or the line number range symbol.
+% Open the box for the end line.
% \begin{macrocode}
\ifdimequal{\csuse{Xendboxendlinenum@\@currentseries}}{0pt}%
{\bgroup}%
{\hbox to \csuse{Xendboxendlinenum@\@currentseries}\bgroup}%
+% \end{macrocode}
+% Print the dash + the end line number, or the line number range symbol.
+% \begin{macrocode}
\ifl@d@Xtwolines%
\ifl@d@Xmorethantwolines%
\csuse{Xendmorethantwolines@\@currentseries}%
@@ -12653,9 +12816,23 @@
\csuse{Xendlinerangeseparator@\@currentseries}%
\fi%
\fi%
+% \end{macrocode}
+% Print the end page number.
+% \begin{macrocode}
\ifl@d@pnum%
- \wrap@edcrossref{\@this@crossref@end}\printnpnum{#4}%
+ \ifcsstring{prevpagerange@\@currentseries}{#1-#4}%
+ {%
+ \ifcsempty{Xendsympagenum@\@currentseries}%
+ {\hspace{\csuse{Xendinplaceofpagenumber@\@currentseries}}}%
+ {\csuse{Xendsympagenum@\@currentseries}}%
+ }%
+ {%
+ \wrap@edcrossref{\@this@crossref@end}\printnpnum{#4}%
+ }%
\fi%
+% \end{macrocode}
+% Print the end line number, with if required the line prefix, and followed by the side flag and the subline number.
+% \begin{macrocode}
\ifl@d@elin%
\ifl@d@pnum\csuse{Xendlineprefixsingle@\@currentseries}\fi%
\wrap@edcrossref{\@this@crossref@end}{\linenumrep{#5}}%
@@ -12668,10 +12845,25 @@
\wrap@edcrossref{\@this@crossref@end}{\sublinenumrep{#6}}%
\fi%
\fi%
+% \end{macrocode}
+% Close the end line box.
+% \begin{macrocode}
\ifdimequal{\csuse{Xendboxendlinenum@\@currentseries}}{0pt}%
{}%
{\hfill}%Prevent underfull hbox
\egroup%
+% \end{macrocode}
+% And, finally, save, if needed, the current page number for the Xendpagenumberonlyfirst hooks.
+% \begin{macrocode}
+ \iftoggle{Xendpagenumberonlyfirst@\@currentseries}%
+ {\iftoggle{Xendpagenumberonlyfirstintwo@\@currentseries}%
+ {\csxdef{prevpagerange@\@currentseries}{#1-#4}}%
+ {\csxdef{prevpagenum@\@currentseries}{#4}}%
+ }%
+ {}%
+% \end{macrocode}
+% Now, the end of \cs{printendlines} macro.
+% \begin{macrocode}
\endgroup%
}%
@@ -12758,6 +12950,7 @@
\csgdef{Xtwolines@#1}{}%
\csgdef{Xmorethantwolines@#1}{}%
\csgdef{Xsublinesep@#1}{\fullstop}%
+ \csgdef{Xpagelinesep@#1}{\csname Xsublinesep@#1\endcsname}%for backward compatibility, call Xsublinesep@#1
\newtoggle{Xtwolinesbutnotmore@#1}%
\newtoggle{Xtwolinesonlyinsamepage@#1}%
\newtoggle{Xonlypstart@#1}%
@@ -12843,6 +13036,7 @@
\noexpand\csuse{v#1footnote}{#1}%
{{\l@d@nums}{\expandonce\@tag}{\expandonce\content}}%
\noexpand\Xnote@false%
+ \unexpanded{\advance\@edindex@fornote@\m@ne}%
\unexpanded{\undef\@this@crossref@start}%
\unexpanded{\undef\@this@crossref@end}%
\ifbool{indtl@innote}%
@@ -12885,6 +13079,7 @@
\unexpanded{\undef\@this@crossref@start}%
\unexpanded{\undef\@this@crossref@end}%
\noexpand\Xnote@false%
+ \unexpanded{\advance\@edindex@fornote@\m@ne}%
\ifbool{indtl@innote}%
{\unexpanded{\let\index\orig@@index}}%
{}%
@@ -13180,6 +13375,13 @@
\newtoggle{Xendlineflag@#1}
\csgdef{Xendlemmafont@#1}{}%
+
+ \newtoggle{Xendpagenumberonlyfirst@#1}%
+ \newtoggle{Xendpagenumberonlyfirstifsingle@#1}%
+ \newtoggle{Xendpagenumberonlyfirstintwo@#1}%
+ \csgdef{Xendsympagenum@#1}{}%
+ \csgdef{Xendinplaceofpagenumber@#1}{0pt}%
+
% \end{macrocode}
% End of endnotes declaration
% \begin{macrocode}
@@ -13482,7 +13684,8 @@
\newhooktoggle@series{Xlineflag}[appref,SEref]
\newhookcommand@series{Xtwolines}[appref,SEref]
\newhookcommand@series{Xmorethantwolines}[appref,SEref]
-\newhookcommand@series{Xsublinesep}[appref,SEref,side]
+\newhookcommand@series{Xsublinesep}[appref,SEref,side]%
+\newhookcommand@series{Xpagelinesep}[appref,SEref,side]%
\newhooktoggle@series{Xtwolinesbutnotmore}[appref,SEref]
\newhooktoggle@series{Xtwolinesonlyinsamepage}[appref,SEref]
\newhookcommand@series{Xlinerangeseparator}[appref,SEref]
@@ -13567,7 +13770,12 @@
\newhookcommand@series{Xendahookinplaceofnumber}%
\newhookcommand@series{Xendhangindent}%
-
+
+ \newhooktoggle@series{Xendpagenumberonlyfirst}%
+ \newhooktoggle@series{Xendpagenumberonlyfirstifsingle}%
+ \newhooktoggle@series{Xendpagenumberonlyfirstintwo}%
+ \newhookcommand@series{Xendsympagenum}%
+ \newhookcommand@series{Xendinplaceofpagenumber}%
\fi
\newhooktoggle@series{Xendlineflag}[apprefwithpage,SErefwithpage]
@@ -13639,19 +13847,6 @@
% Now we begin the output routine and associated things.
%
%
-% \subsection{Page number management}
-% \begin{macro}{\pageno}
-% \begin{macro}{\advancepageno}
-% \protect\cs{pageno} is a page number, starting at 1, and \protect\cs{advancepageno}
-% increments the number.
-% \begin{macrocode}
-\countdef\pageno=0 \pageno=1
-\newcommand*{\advancepageno}{\ifnum\pageno<\z@ \global\advance\pageno\m@ne
- \else\global\advance\pageno\@ne\fi}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
%
%
% \subsection{Extra footnotes output}
@@ -13673,23 +13868,47 @@
% \begin{macrocode}
\newcommand*{\l@ddoxtrafeet}{%
\IfStrEq{familiar-critical}{\@fnpos}
- {\do@feetX\Xdo@feet}%
+ {\do@feetX\do@Xfeet}%
{%
\IfStrEq{critical-familiar}{\@fnpos}%
- {\Xdo@feet\do@feetX}%
- {\do@feetX\Xdo@feet}%
+ {\do@Xfeet\do@feetX}%
+ {%
+ \setbox\@outputbox \vbox{%
+ \unvbox\@outputbox%
+ \do@feet@custom@order{}{\@fnpos}%
+ }%
+ }%
}%
}%
% \end{macrocode}
% \end{macro}
-%
-% \begin{macro}{\Xdo@feet}
-% \protect\cs{Xdo@feet} is the code extending \protect\cs{@makecol} to cater for
+% \begin{macro}{\do@feet@custom@order}
+% \cs{do@feet@custom@order} is called when \cs{@fnpos} is neither `familiar-critical', nor `critical-familiar', that is, when the order is more complex.
+% In this case, people must define the order for all footnote series.
+% If they don't, \LaTeX\ could perform an infinite run.
+% \begin{macrocode}
+\newcommand{\do@feet@custom@order}[2]{%
+ \def\do##1{%
+ \edef\@@notesseries{\@firstoftwo##1}%
+ \edef\@@notetype{\@secondoftwo##1}%
+ \ifdefstring{\@@notetype}{critical}%
+ {\csuse{#1append@Xnotes}{\@@notesseries}}%
+ {\ifdefstring{\@@notetype}{familiar}%
+ {\csuse{#1append@notesX}{\@@notesseries}}%
+ {}%
+ }%
+ }%
+ \expandafter\docsvlist\expandafter{#2}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\do@Xfeet}
+% \protect\cs{do@Xfeet} is the code extending \protect\cs{@makecol} to cater to
% the extra critical feet.
-% \changes{v0.4.1}{2004/03/06}{Changed \protect\cs{Xdo@feet} code for easier extensions}
+% \changes{v0.4.1}{2004/03/06}{Changed \protect\cs{do@Xfeet} code for easier extensions}
% \begin{macrocode}
-\newcommand*{\Xdo@feet}{%
+\newcommand*{\do@Xfeet}{%
\setbox\@outputbox \vbox{%
\unvbox\@outputbox
\@opXfeet}}
@@ -13697,9 +13916,20 @@
% \end{macro}
%
% \begin{macro}{\@opXfeet}
+% \begin{macro}{\append@Xnotes}
% \begin{macro}{\print@Xnotes}
% The extra critical feet to be added to the output.
-% \changes{v0.4.1}{2004/03/06}{Added \protect\cs{@opXfeet}}
+% \changes{v0.4.1}{2004/03/06}{Added \protect\cs{@opXfeet}}.
+% A macro which appends critical notes to the output's routine, also adding vertical space before notes
+% \begin{macrocode}
+\newcommand{\append@Xnotes}[1]{%
+ \ifvoid\csuse{#1footins}\else%
+ \global\skip\csuse{#1footins}=\csuse{Xbeforenotes@#1}%
+ \global\advance\skip\csuse{#1footins} by\csuse{Xafterrule@#1}%
+ \print@Xnotes{#1}%
+ \fi%
+}%
+% \end{macrocode}
% The normal way to add one series,
% \protect\cs{print@Xnotes}, is replaced by \parpackage when using \protect\cs{Pages}.
% \begin{macrocode}
@@ -13716,11 +13946,7 @@
\unless\ifnocritical@%
\gdef\firstXseries@{}%
\def\do##1{%
- \ifvoid\csuse{##1footins}\else%
- \global\skip\csuse{##1footins}=\csuse{Xbeforenotes@##1}%
- \global\advance\skip\csuse{##1footins} by\csuse{Xafterrule@##1}%
- \print@Xnotes{##1}%
- \fi%
+ \append@Xnotes{##1}%
}%
\dolistloop{\@series}%
\fi%
@@ -13728,6 +13954,7 @@
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \end{macro}
%
%
% \begin{macro}{\l@ddodoreinxtrafeet}
@@ -13768,11 +13995,22 @@
% \end{macro}
%
% \begin{macro}{\print@notesX}
+% \begin{macro}{\append@notesX}
% \begin{macro}{\do@feetX}
% \begin{macro}{\@doreinfeetX}
% We have to add all the new kinds of familiar footnotes to the output
% routine.
-% The normal way to add one series.
+% A macro which appends the familiar footnotes of one series onto the output routine, also adding vertical skip before notes.
+% \begin{macrocode}
+\newcommand{\append@notesX}[1]{%
+ \ifvoid\csuse{footins#1}\else%
+ \global\skip\csuse{footins#1}=\csuse{beforenotesX@#1}%
+ \global\advance\skip\csuse{footins#1} by\csuse{afterruleX@#1}%
+ \print@notesX{#1}%
+ \fi%
+}%
+% \end{macrocode}
+% The normal way to print one series of notes.
% \protect\cs{print@Xnotes} is replaced by \parpackage when using \protect\cs{Pages}.
% \begin{macrocode}
\newcommand\print@notesX[1]{%
@@ -13790,11 +14028,7 @@
\setbox\@outputbox \vbox{%
\unvbox\@outputbox%
\def\do##1{%
- \ifvoid\csuse{footins##1}\else%
- \global\skip\csuse{footins##1}=\csuse{beforenotesX@##1}%
- \global\advance\skip\csuse{footins##1} by\csuse{afterruleX@##1}%
- \print@notesX{##1}%
- \fi%
+ \append@notesX{##1}%
}%
\dolistloop{\@series}}%
\fi%
@@ -13817,8 +14051,9 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
%
-% \subsection{Patching standard output of commands}
+% \subsection{Patching standard output's commands}
% The \protect\ltxclass{memoir} class does not use the `standard' versions of
% \protect\cs{@makecol} and \protect\cs{@reinserts}, due to its sidebar insert.
% We had better add that code if \protect\ltxclass{memoir} is used. (It can
@@ -13826,11 +14061,13 @@
% |\ifl@dmemoir| here.)
% \changes{v0.2.1}{2003/09/13}{Major changes to insert code when memoir is loaded}
% \changes{v2.0.0}{2015/07/19}{\protect\cs{@makecol}, \protect\cs{@reinserts} and \protect\cs{@doclearpage} are patched instead of begin redefined}
-% \changes{v2.0.0}{2015/07/19}{\protect\cs{doxtrafeeti} becomes \protect\cs{do@feetX};
-% \protect\cs{doxtrafeetii} becomes \protect\cs{Xdo@feet};
+% \changes{v2.0.0}{2015/07/19}{\protect\cs{doxtrafeeti} becomes \protect\cs{Xdo@feet};
+% \protect\cs{doxtrafeetii} becomes \protect\cs{do@Xfeet};
% \protect\cs{@opxtrafeeti} becomes \protect\cs{@opfeetX};
% \protect\cs{doreinxtrafeetii} becomes \protect\cs{X@doreinfeet};
% \protect\cs{doreinxtrafeeti} becomes \protect\cs{@doreinfeetX}.}
+% \changes{v2.16.0}{2016/10/02}{\protect\cs{Xdo@feet} becomes \protect\cs{do@Xfeet}}
+% \changes{v2.16.0}{2016/10/02}{More explicit error message when missing to define stanza indent.}
% \begin{macrocode}
\@ifclassloaded{memoir}{%
% \end{macrocode}
@@ -13842,9 +14079,9 @@
% \end{macrocode}
% \protect\ltxclass{memoir} has not been loaded, so patch \protect\cs{@makecol} and
% \protect\cs{@reinserts}.
-% If the \package{fancyhdr} package $<$ 3.8 has been loaded, we patch the \cs{latex@makecol} command, because this package redefines in the preamble the standard \cs{@makecol}, to call \cs{latex@makecol} which have been \cs{let} to \cs{@makecol}.
+% If the \package{fancyhdr} package $<$ version 3.8 has been loaded, we patch the \cs{latex@makecol} command, because this package redefines the standard \cs{@makecol} in the preamble, to call \cs{latex@makecol} which have been \cs{let} to \cs{@makecol}.
% If this package is not loaded, we directly patch \cs{@makecol}.
-% If the \package{fancyhdr} package $\geq$ 3.8, we also directly patch \cs{@makecol}, because \package{fancyhdr} does its own patch \cs{AtBeginDocument}.
+% If the \package{fancyhdr} package $\geq$ version 3.8, we also directly patch \cs{@makecol}, because \package{fancyhdr} does its own patch \cs{AtBeginDocument}.
% \begin{macrocode}
\ifboolexpr{%
test{\@ifpackageloaded{fancyhdr}}%
@@ -14448,6 +14685,10 @@
\def\Xsublinesep@appref{\fullstop}%
\def\Xsublinesep@SEref{\fullstop}%
+\def\Xpagelinesep@appref{\fullstop}%
+\def\Xpagelinesep@SEref{\fullstop}%
+
+
\newtoggle{Xtwolinesbutnotmore@appref}%
\newtoggle{Xtwolinesbutnotmore@SEref}%
@@ -14502,17 +14743,32 @@
% Note that some of these hooks are declared but no user command can change their values. Such hooks are not pertinent for \verb+appref+ and \verb+apprefwithpage+ pseudo-series, but their values are nonetheless tested in some macros.
% \begin{macrocode}
-\xdef\Xboxstartlinenum@appref{0pt}
-\xdef\Xboxstartlinenum@SEref{0pt}
+\gdef\Xboxstartlinenum@appref{0pt}
+\gdef\Xboxstartlinenum@SEref{0pt}
+
+\gdef\Xboxendlinenum@appref{0pt}
+\gdef\Xboxendlinenum@SEref{0pt}
-\xdef\Xboxendlinenum@appref{0pt}
-\xdef\Xboxendlinenum@SEref{0pt}
+\gdef\Xendboxstartlinenum@apprefwithpage{0pt}
+\gdef\Xendboxstartlinenum@SErefwithpage{0pt}
-\xdef\Xendboxstartlinenum@apprefwithpage{0pt}
-\xdef\Xendboxstartlinenum@SErefwithpage{0pt}
+\gdef\Xendboxendlinenum@apprefwithpage{0pt}
+\gdef\Xendboxendlinenum@SErefwithpage{0pt}
-\xdef\Xendboxendlinenum@apprefwithpage{0pt}
-\xdef\Xendboxendlinenum@SErefwithpage{0pt}
+\newtoggle{Xendpagenumberonlyfirst@apprefwithpage}
+\newtoggle{Xendpagenumberonlyfirst@SErefwithpage}
+
+\newtoggle{Xendpagenumberonlyfirstifsingle@apprefwithpage}
+\newtoggle{Xendpagenumberonlyfirstifsingle@SErefwithpage}
+
+\newtoggle{Xendpagenumberonlyfirstintwo@apprefwithpage}
+\newtoggle{Xendpagenumberonlyfirstintwo@SErefwithpage}
+
+\gdef\Xendsympagenum@apprefwithpage
+\gdef\Xendsympagenum@SErefwithpage
+
+\gdef\Xendinplaceofpagenumber@apprefwithpage
+\gdef\Xendinplaceofpagenumber@SErefwithpage
% \end{macrocode}
% Now, declare the default values of \protect\cs{@apprefprefixsingle} and \protect\cs{@apprefprefixmore}, \cs{@SErefprefix}, \cs{@SErefprefixmore} and the commands which defines them.
@@ -14988,15 +15244,15 @@
% \begin{itemize}
% \item Store the content of \protect\cs{ledsidenote} to \protect\cs{l@dcsnotetext} in any cases.
% \item Store the content of \protect\cs{rightsidenote} to:
-% \begin{itemize}
+% \begin{itemize}
% \item \protect\cs{l@dcsnotetext} if \protect\cs{ledsidenote} is to be put on right.
% \item \protect\cs{l@dcsnotetext@r} if \protect\cs{ledsidenote} is to be put on left.
-% \end{itemize}
+% \end{itemize}
% \item Store the content of \protect\cs{leftsidenote} to:
-% \begin{itemize}
+% \begin{itemize}
% \item \protect\cs{l@dcsnotetext} if \protect\cs{ledsidenote} is to be put on left.
% \item \protect\cs{l@dcsnotetext@l} if \protect\cs{ledsidenote} is to be put on right.
-% \end{itemize}
+% \end{itemize}
% \end{itemize}
% \cs{vl@disnote} and \cs{vl@dosnote} just call \cs{vl@dlsnote} or \cs{vl@drsnote}, depending of the page.
% \begin{macrocode}
@@ -15127,6 +15383,7 @@
% \changes{v1.4.1}{2012/11/16}{Remove spurious spaces.}
% \begin{macrocode}
\newcommand*{\affixside@note}{%
+ \prepare@edindex@fornote{\the\page@num|\the\line@num|\the\subline@num|\the\page@num|\the\line@num|\the\subline@num|}%
\def\sidenotecontent@{}%
\numgdef{\itemcount@}{0}%
\def\do##1{%
@@ -15173,6 +15430,7 @@
\fi%
\fi%
\fi%
+ \advance\@edindex@fornote@\m@ne%
}
% \end{macrocode}
% \end{macro}%
@@ -15205,7 +15463,7 @@
{%
\IfStrEq{familiar-critical}{\@mpfnpos}%
{\l@dfamendmini\l@dedendmini}%
- {\l@dedendmini\l@dfamendmini}%
+ {\do@feet@custom@order{mp@}{\@mpfnpos}}%
}%
}%
% \end{macrocode}
@@ -15214,6 +15472,7 @@
%
% \begin{macro}{\l@dedbeginmini}
% \begin{macro}{\l@dedendmini}
+% \begin{macro}{\mp@append@Xnotes}
% These handle the initiation and closure of critical footnotes in a
% minipage environment.
% \begin{macrocode}
@@ -15235,37 +15494,44 @@
\fi%
\fi
\def\do##1{%
- \ifvoid\csuse{mp##1footins}\else%
- \ifl@dpairing\ifparledgroup%
- \ifledRcol%
- \dimgdef{\parledgroup@beforenotesR}{\parledgroup@beforenotesR+\skip\@nameuse{mp##1footins}}%
- \else%
- \dimgdef{\parledgroup@beforenotesL}{\parledgroup@beforenotesL+\skip\@nameuse{mp##1footins}}%
- \fi%
- \fi\fi%
- \ifcsstring{series@display##1}{paragraph}{}{%
- \setbox\@nameuse{mp##1footins}=\vbox{%
- \csuse{Xnotefontsize@##1}%
- \ifcsdef{Xhsize\csuse{series@display##1}@##1}{%
- \hsize\csuse{Xhsize\csuse{series@display##1}@##1}%
- }{}%
- \noindent\csuse{Xtxtbeforenotes@##1}%
- \unvbox\@nameuse{mp##1footins}%
- \@parboxrestore%
- }%
- }%
- \csuse{mp##1footgroup}{##1}%
- \fi}%
+ \mp@append@Xnotes{##1}%
+ }%
\dolistloop{\@series}%
\fi%
}%
-
+\newcommand{\mp@append@Xnotes}[1]{%
+\ifvoid\csuse{mp#1footins}\else%
+ \ifl@dpairing%
+ \ifparledgroup%
+ \ifledRcol%
+ \dimgdef{\parledgroup@beforenotesR}{\parledgroup@beforenotesR+\skip\@nameuse{mp#1footins}}%
+ \else%
+ \dimgdef{\parledgroup@beforenotesL}{\parledgroup@beforenotesL+\skip\@nameuse{mp#1footins}}%
+ \fi%
+ \fi%
+ \fi%
+ \ifcsstring{series@display#1}{paragraph}{}{%
+ \setbox\@nameuse{mp#1footins}=\vbox{%
+ \csuse{Xnotefontsize@#1}%
+ \ifcsdef{Xhsize\csuse{series@display#1}@#1}{%
+ \hsize\csuse{Xhsize\csuse{series@display#1}@#1}%
+ }{}%
+ \noindent\csuse{Xtxtbeforenotes@#1}%
+ \unvbox\@nameuse{mp#1footins}%
+ \@parboxrestore%
+ }%
+ }%
+ \csuse{mp#1footgroup}{#1}%
+\fi%
+}%
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\l@dfambeginmini}
% \begin{macro}{\l@dfamendmini}
+% \begin{macro}{\mp@append@notesX}
% These handle the initiation and closure of familiar footnotes in a
% minipage environment.
% \begin{macrocode}
@@ -15279,15 +15545,20 @@
\newcommand*{\l@dfamendmini}{%
\unless\ifnofamiliar@%
\def\do##1{%
- \ifvoid\csuse{mpfootins##1}\else%
- \csuse{mpfootgroup##1}{##1}%
- \fi}%
+ \mp@append@notesX{##1}%
+ }%
\dolistloop{\@series}%
\fi%
}%
+\newcommand{\mp@append@notesX}[1]{%
+ \ifvoid\csuse{mpfootins#1}\else%
+ \csuse{mpfootgroup#1}{#1}%
+ \fi%
+}%
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\@iiiminipage}
% This is our extended form of the kernel \protect\cs{@iiiminipage} defined in
@@ -15532,11 +15803,11 @@
% \end{macro}
%
% \subsection{Code specific to \cs{edindex} in critical footnotes}
-% \begin{macro}{\if@edindex@fornote@true}
-% This boolean test is switching at the beginning of each critical note,
-% to allow index referring to this note.
+% \begin{macro}{\@edindex@fornote@}
+% This counter is increased at the beginning of every notes (footnote and and sidenotes), and decreased at the end of every notes.
+% If its value is greater than 0, that means we are inside a note.
% \begin{macrocode}
-\newif\if@edindex@fornote@
+\newcount\@edindex@fornote@
% \end{macrocode}
% \end{macro}
% \begin{macro}{\prepare@edindex@fornote}
@@ -15547,7 +15818,7 @@
% \begin{macrocode}
\newcommand{\prepare@edindex@fornote}[1]{%
\l@dp@rsefootspec#1|%
- \@edindex@fornote@true%
+ \advance\@edindex@fornote@\@ne%
}
% \end{macrocode}
% \end{macro}
@@ -15665,7 +15936,7 @@
% \begin{macrocode}
\newcommandx{\@wredindex}[2][1=\expandonce\jobname,usedefault]{%#1 = the index name, #2 = the text
\ifl@imakeidx%
- \if@edindex@fornote@%
+ \ifnum\@edindex@fornote@>\z@%
\IfSubStr[1]{#2}{|}{\get@index@command#2+}{\get@index@command#2|+}%
\get@edindex@ledinnote@command%
\expandafter\imki@wrindexentry{#1}{\@index@txt|(\@ledinnote@command}{\thestartpageline}%
@@ -15675,7 +15946,7 @@
\imki@wrindexentry{#1}{\@index@txt\@edindex@hyperref}{\thepageline}%
\fi%
\else%
- \if@edindex@fornote@%
+ \ifnum\@edindex@fornote@>\z@%
\IfSubStr[1]{#2}{|}{\get@index@command#2+}{\get@index@command#2|+}%
\get@edindex@ledinnote@command%
\expandafter\protected@write\@indexfile{}%
@@ -15698,11 +15969,22 @@
% \protect\cs{edindex} to do nothing.
% \begin{macrocode}
\pretocmd{\makeindex}{%
- \def\edindex{\@bsphack
- \doedindexlabel
- \begingroup
- \@sanitize
- \@wredindex}}{}{}
+ \def\edindex{%
+ \ifboolexpr{bool{numbering} or bool{numberingR}}{%
+ \@bsphack%
+ \doedindexlabel%
+ \begingroup%
+ \@sanitize%
+ \@wredindex%
+ }%
+ {%
+ \led@warn@edinde@outsidenumbering%
+ \index%
+ }%
+ }%
+}%
+{}%
+{\led@error@fail@patch@makeindex}%
\newcommand{\edindex}[1]{\@bsphack\@esphack}
% \end{macrocode}
% \end{macro}
@@ -15854,7 +16136,7 @@
{%
\renewcommand{\index}[2][\indtl@jobname]{%
\orig@@index[##1]{%
- ##2|innotenumber{\csuse{thefootnote#1}}%
+ ##2|innotenumber{\this@footnoteX@reading}%
}%
}%
}%
@@ -16215,12 +16497,20 @@
% \begin{macrocode}
\newcommandx{\stanza@line}[1][1]{
\ifnum\value{stanzaindentsrepetition}=0
- \parindent=\csname sza@\number\stanza@count
- @\endcsname\stanzaindentbase
+ \ifcsdef{sza@\number\stanza@count @}%
+ {%
+ \parindent=\csname sza@\number\stanza@count @\endcsname\stanzaindentbase%
+ }{%
+ \led@err@StanzaIndentNotDefined%
+ }%
\else
- \parindent=\csname sza@\number\stanza@modulo
- @\endcsname\stanzaindentbase
- \managestanza@modulo
+ \ifcsdef{sza@\number\stanza@modulo @}{%
+ \parindent=\csname sza@\number\stanza@modulo @\endcsname\stanzaindentbase%
+ \managestanza@modulo%
+ }%
+ {%
+ \led@err@StanzaIndentNotDefined%
+ }%
\fi
\pstart[#1]\stanza@hang\ignorespaces}
\xdef\stanza@hang{\noexpand\leavevmode\noexpand\startlock
@@ -18163,19 +18453,19 @@
% The system of \protect\cs{eledxxxx} commands to section text work like this:
% \begin{enumerate}
% \item When one of these commands is called, \macpackage writes to an auxiliary files:
-% \begin{itemize}
+% \begin{itemize}
% \item The section level.
% \item The section title.
% \item The side (when \protect\package{eledpar} is used).
% \item The pstart where the command is called.
% \item If we have starred version or not.
-% \end{itemize}
+% \end{itemize}
% \item \macpackage adds the title of the section to pstart, as normal content. This is to enable critical notes.
% \item When \LaTeX\ is run a other time, this file is read. That:
-% \begin{itemize}
+% \begin{itemize}
% \item Adds the pstart number to a list of pstarts where a sectioning command is used.
% \item Defines a command, the name of which contains the pstart number, and which calls the normal \LaTeX\ sectioning command.
-% \end{itemize}
+% \end{itemize}
% \item This last command is called when the pstart is effectively printed.
% \end{enumerate}
% \subsection{\protect\cs{beforeeledchapter} command}
diff --git a/Master/texmf-dist/source/latex/reledmac/reledpar.dtx b/Master/texmf-dist/source/latex/reledmac/reledpar.dtx
index d556831e0c5..0d11dfbdd5c 100644
--- a/Master/texmf-dist/source/latex/reledmac/reledpar.dtx
+++ b/Master/texmf-dist/source/latex/reledmac/reledpar.dtx
@@ -279,7 +279,12 @@
% \changes{v2.12.0}{2016/07/01}{Fix bug with \protect\cs{lineationR}.}
% \changes{v2.12.0}{2016/07/01}{Fix bug with \protect\cs{AtBeginPairs}.}
% \changes{v2.13.0}{2016/07/22}{Compatibility with the new features of \protect\macpackage 2.15.0}
-% \changes{v2.13.1}{2016/09/26}{Simplification of the code concerning sectioning command}
+% \changes{v2.13.1}{2016/09/26}{Simplification of the code concerning the sectioning command}
+% \changes{v2.14.0}{2016/10/02}{New commands to have specific line margins for text in parallel columns}
+% \changes{v2.14.0}{2016/10/02}{Add \protect\cs{linenumberlistR}, equivalent to \protect\cs{linenumberlist} for the right side.}
+% \changes{v2.14.0}{2016/10/02}{When indexing texts in sidenotes with \protect\cs{edtext}, referring to the line number where the sidenote is called.}
+% \changes{v2.14.0}{2016/10/02}{More explicit error message when missing to define stanza indent.}
+% \changes{v2.14.0}{2016/10/02}{Error message when missing to define left / right side.}
% ^^A PW added following as the definitions are at some unknown elsewhere
%
% \newcommand{\egstart}{%
@@ -945,6 +950,10 @@
% \protect\cs{lineation*} macro is the equivalent of \macpackage \protect\cs{lineation} macro for both sides.
%
+% \Macpackage allows you to define a \cs{linenumberlist} to explicitly define (\reff{reledmac-linenumberlist}) in which line the line number will be printed.
+% In parallel typesetting, this command affects only left side.
+% For right side, you have to define \cs{linenumberlistR}.
+%
% \DescribeMacro{\linenumberstyleR}
% \DescribeMacro{\sublinenumberstyleR}
% \DescribeMacro{\linenumberstyle*}
@@ -958,6 +967,16 @@
% \cs{linenummarginR}\marg{margin} sets the line margin for right side.
% \cs{linenummargin*}\marg{margin} sets for both side.
% \meta{margin} can be, as for \macpackage's \cs{linenummargin} one of these values: \verb+left+, \verb+right+, \verb+inner+, \verb+outer+.
+%
+% \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.
+%
+% 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.
+%
% \DescribeMacro{\setRlineflag}\label{Rlineflag}
% A ``R'' is appended to the line numbers of the
% right texts.
@@ -1199,7 +1218,7 @@
% \begin{macrocode}
%<*code>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{reledpar}[2016/09/26 v2.13.1 reledmac extension for parallel texts]%
+\ProvidesPackage{reledpar}[2016/10/02 v2.14.0 reledmac extension for parallel texts]%
% \end{macrocode}
% \subsection{Package's requirement}
@@ -1414,7 +1433,24 @@
% \end{macrocode}
% \end{macro}
% \end{macro}
-
+% \begin{macro}{\led@err@Pages@WithoutRightside}
+% \begin{macro}{\led@err@Pages@WithoutLeftside}
+% \begin{macro}{\led@err@Columns@WithoutRightside}
+% \begin{macro}{\led@err@Columns@WithoutLeftside}
+% \begin{macrocode}
+\newcommand*{\led@err@Pages@WithoutRightside}{%
+ \reledpar@error{\string\Pages\space called without previous `Rightside` environment (or environment without content)}{\@ehc}}%
+\newcommand*{\led@err@Pages@WithoutLeftside}{%
+ \reledpar@error{\string\Pages\space called without previous `Leftside` environment (or environment without content)}{\@ehc}}%
+ \newcommand*{\led@err@Columns@WithoutRightside}{%
+ \reledpar@error{\string\Columns\space called without previous `Rightside` environment (or environment without content)}{\@ehc}}%
+\newcommand*{\led@err@Columns@WithoutLeftside}{%
+ \reledpar@error{\string\Columns\space called without previous `Leftside` environment (or environment without content)}{\@ehc}}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \begin{macro}{\led@error@fail@patch@thepage}
% \begin{macrocode}
@@ -1518,6 +1554,26 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \begin{macro}{\ifcsboxvoid}
+% The \cs{ifcsboxvoid} is a complement to the \package{etoolbox} package.
+% The first argument is a box name, the second is a the \meta{true} value, the third the \meta{false} value.
+% If the first argument refers to a not existing box, or if it refers to a void box, the \meta{true} value is returned. In other case, the \meta{false} is returned.
+% \begin{macrocode}
+\newcommand*{\ifcsboxvoid}[1]{%
+ \ifcsname#1\endcsname%
+ \expandafter\ifvoid\csname #1\endcsname%
+ \expandafter\expandafter%
+ \expandafter\@firstoftwo%
+ \else%
+ \expandafter\expandafter%
+ \expandafter\@secondoftwo%
+ \fi%
+ \else%
+ \expandafter\@firstoftwo%
+ \fi%
+}%
+% \end{macrocode}
+% \end{macro}
%
% \begin{macro}{\newnamecount}
% \begin{macro}{\usenamecount}
@@ -1883,6 +1939,41 @@
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \begin{macro}{\linenummarginColumns*}
+% \begin{macro}{\linenummarginColumns}
+% \begin{macro}{\linenummarginColumnsR}
+% The \cs{linenummarginColumns} macro overrides the definition of the line margin when typesetting in parallel columns.
+% \begin{macrocode}
+
+\newcount\line@margin@columnsR%
+\line@margin@columnsR=\m@ne%
+
+\newcommand{\linenummarginColumns}[1]{%
+ \l@dgetline@margin{#1}%
+ \ifnum\@l@dtempcntb>\m@ne%
+ \global\line@margin@columns=\@l@dtempcntb%
+ \fi%
+}%
+
+\WithSuffix\newcommand\linenummarginColumns*[1]{%
+ \l@dgetline@margin{#1}%
+ \ifnum\@l@dtempcntb>\m@ne%
+ \global\line@margin@columns=\@l@dtempcntb%
+ \global\line@margin@columnsR=\@l@dtempcntb%
+ \fi%
+}%
+
+\newcommand{\linenummarginColumnsR}[1]{%
+ \l@dgetline@margin{#1}%
+ \ifnum\@l@dtempcntb>\m@ne%
+ \global\line@margin@columnsR=\@l@dtempcntb%
+ \fi%
+}%
+
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
% \subsection{Setting lineation start and step}
% \begin{macro}{\c@firstlinenumR}
% \begin{macro}{\c@linenumincrementR}
@@ -4007,6 +4098,7 @@
\fi}
+\let\linenumberlistR\empty%
\newcommand*{\affixline@numR}{%
\ifledgroupnotesR@\else\ifnumberline
\ifl@dskipnumber
@@ -4018,15 +4110,15 @@
\ch@cksub@lockR
\else
\@l@dtempcntb=\line@numR
- \ifx\linenumberlist\empty
+ \ifx\linenumberlistR\empty%
\l@dcalcnum{\line@numR}{\c@firstlinenumR}{\c@linenumincrementR}%
\else
\@l@dtempcnta=\line@numR
- \edef\rem@inder{,\linenumberlist,\number\line@numR,}%
+ \edef\rem@inderR{,\linenumberlistR,\number\line@numR,}%
\edef\sc@n@list{\def\noexpand\sc@n@list
- ####1,\number\@l@dtempcnta,####2|{\def\noexpand\rem@inder{####2}}}%
- \sc@n@list\expandafter\sc@n@list\rem@inder|%
- \ifx\rem@inder\empty\advance\@l@dtempcnta\@ne\fi
+ ####1,\number\@l@dtempcnta,####2|{\def\noexpand\rem@inderR{####2}}}%
+ \sc@n@list\expandafter\sc@n@list\rem@inderR|%
+ \ifx\rem@inderR\empty\advance\@l@dtempcnta\@ne\fi%
\fi
\ch@ck@l@ckR
\fi
@@ -4039,7 +4131,9 @@
\gdef\l@drd@ta{\rlap{{\rightlinenumR}}}%
\fi
\else
- \@l@dtempcntb=\line@marginR
+ \ifboolexpr{bool {l@dprintingcolumns} and test {\ifnumgreater{\line@margin@columnsR}{\m@ne}}}%
+ {\@l@dtempcntb=\line@margin@columnsR}%
+ {\@l@dtempcntb=\line@marginR}%
\ifnum\@l@dtempcntb>\@ne
\advance\@l@dtempcntb by\page@numR
\fi
@@ -4085,7 +4179,9 @@
\gdef\l@drd@ta{\rlap{{\rightpstartnumL}}}%
\fi
\else
- \@l@dtempcntb=\line@margin
+ \ifboolexpr{bool {l@dprintingcolumns} and test {\ifnumgreater{\line@margin@columns}{\m@ne}}}%
+ {\@l@dtempcntb=\line@margin@columns}%
+ {\@l@dtempcntb=\line@margin}%
\ifnum\@l@dtempcntb>\@ne
\advance\@l@dtempcntb \page@num
\fi
@@ -4106,7 +4202,9 @@
\gdef\l@drd@ta{\rlap{{\rightpstartnumR}}}%
\fi
\else
- \@l@dtempcntb=\line@marginR
+ \ifboolexpr{bool {l@dprintingcolumns} and test {\ifnumgreater{\line@margin@columnsR}{\m@ne}}}%
+ {\@l@dtempcntb=\line@margin@columnsR}%
+ {\@l@dtempcntb=\line@marginR}%
\ifnum\@l@dtempcntb>\@ne
\advance\@l@dtempcntb \page@numR
\fi
@@ -4601,6 +4699,7 @@
% \changes{v1.1.2}{2012/10/06}{Remove spurious space between line number and line content}
% \begin{macrocode}
\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@{}%
\numgdef{\itemcount@}{0}%
\def\do##1{%
@@ -4644,6 +4743,7 @@
\fi%
\fi%
\fi%
+ \advance\@edindex@fornote@\m@ne%
}
% \end{macrocode}
@@ -4749,12 +4849,20 @@
% \begin{macrocode}
\newcommand*{\@astanza@line}{%
\ifnum\value{stanzaindentsrepetition}=0
- \parindent=\csname sza@\number\stanza@count
- @\endcsname\stanzaindentbase
+ \ifcsdef{sza@\number\stanza@count @}%
+ {%
+ \parindent=\csname sza@\number\stanza@count @\endcsname\stanzaindentbase%
+ }{%
+ \led@err@StanzaIndentNotDefined%
+ }%
\else
- \parindent=\csname sza@\number\stanza@modulo
- @\endcsname\stanzaindentbase
- \managestanza@modulo
+ \ifcsdef{sza@\number\stanza@modulo @}{%
+ \parindent=\csname sza@\number\stanza@modulo @\endcsname\stanzaindentbase%
+ \managestanza@modulo%
+ }%
+ {%
+ \led@err@StanzaIndentNotDefined%
+ }%
\fi
\endgraf
\stanza@hang%
@@ -5139,9 +5247,14 @@
\ifl@dpairing%
\led@err@Columns@InsideEnv%
\fi%
- \expandafter\ifvoid\csname l@dRcolrawbox1\endcsname%
- \led@err@Columns@WithoutEnv%
- \else%
+ \ifboolexpr{test{\ifcsboxvoid{l@dRcolrawbox1}} or test{\ifcsboxvoid{l@dLcolrawbox1}}}{%
+ \ifcsboxvoid{l@dRcolrawbox1}{%
+ \ifcsboxvoid{l@dLcolrawbox1}%
+ {\led@err@Columns@WithoutEnv}%
+ {\led@err@Columns@WithoutRightside}%
+ }%
+ {\led@err@Columns@WithoutLeftside}%
+ }{%
\global\l@dprintingcolumnstrue%
\eledsection@correcting@skip=-\baselineskip% Correction for sections' titles
\ifnum\l@dnumpstartsL=\l@dnumpstartsR\else
@@ -5269,7 +5382,8 @@
\ignorespaces
\global\instanzaLfalse%
\global\instanzaRfalse%
- \fi}
+ }%
+}%
% \end{macrocode}
% \end{macro}
@@ -5586,9 +5700,14 @@
\ifl@dpairing%
\led@err@Pages@InsideEnv%
\fi%
- \expandafter\ifvoid\csname l@dRcolrawbox1\endcsname%
- \led@err@Pages@WithoutEnv%
- \else%
+ \ifboolexpr{test{\ifcsboxvoid{l@dRcolrawbox1}} or test{\ifcsboxvoid{l@dLcolrawbox1}}}{%
+ \ifcsboxvoid{l@dRcolrawbox1}{%
+ \ifcsboxvoid{l@dLcolrawbox1}%
+ {\led@err@Pages@WithoutEnv}%
+ {\led@err@Pages@WithoutRightside}%
+ }%
+ {\led@err@Pages@WithoutLeftside}%
+ }{%
\ifstrequal{#1}{mainmatter}{\Pages@mainmattertrue}{\Pages@mainmatterfalse}%
\eledsection@correcting@skip=-2\baselineskip% line correcting for section titles.
\parledgroup@notespacing@set@correction%
@@ -5899,7 +6018,7 @@
% Prevent final notes from overlapping the line number
% \begin{macrocode}
\finish@Pages@notes%
- \ignorespaces\fi}
+ \ignorespaces}}%
% \end{macrocode}