summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/reledmac
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-06-18 15:50:00 +0000
committerKarl Berry <karl@freefriends.org>2016-06-18 15:50:00 +0000
commit03876315ff094126d2d525b57a4f6324bbf8ef66 (patch)
tree081de0611c406525f64e65fdc3e079bb4c323cd1 /Master/texmf-dist/source/latex/reledmac
parent562ded580dece699235a00d600ec26bccb0b8383 (diff)
reledmac (16jun16)
git-svn-id: svn://tug.org/texlive/trunk@41481 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/reledmac')
-rw-r--r--Master/texmf-dist/source/latex/reledmac/reledmac.dtx583
-rw-r--r--Master/texmf-dist/source/latex/reledmac/reledpar.dtx274
2 files changed, 558 insertions, 299 deletions
diff --git a/Master/texmf-dist/source/latex/reledmac/reledmac.dtx b/Master/texmf-dist/source/latex/reledmac/reledmac.dtx
index 94416d35700..ea8a9997766 100644
--- a/Master/texmf-dist/source/latex/reledmac/reledmac.dtx
+++ b/Master/texmf-dist/source/latex/reledmac/reledmac.dtx
@@ -404,6 +404,17 @@
% \changes{v2.11.0}{2016/06/02}{Make \protect\cs{parafootsepX} work}
% \changes{v2.11.0}{2016/06/02}{Fix bug in \protect\cs{Xparafootsep} in parallel typesetting}
% \changes{v2.11.0}{2016/06/02}{Add new tools to produce an apparatus of manuscripts}
+% \changes{v2.12.0}{2016/06/16}{Fix bug with familiar footnote number in optional argument of \protect\cs{pstart} or \protect\cs{pend} in parallel typesetting}
+% \changes{v2.12.0}{2016/06/16}{Add \protect\cs{hidenumberingonleftpage} and \protect\cs{hidenumberingonrightpage}}
+% \changes{v2.12.0}{2016/06/16}{\protect\cs{preXnotes} become \protect\cs{Xprenotes} (naming convention)}
+% \changes{v2.12.0}{2016/06/16}{Add \protect\option{auxdir} option.}
+% \changes{v2.12.0}{2016/06/16}{Add \protect\cs{toendnotes} and related.}
+% \changes{v2.12.0}{2016/06/16}{Fix bug when using \protect\cs{chapter} in optional argument of \protect\cs{pstart} in parallel typesetting in combination with the \protect\option{noeledsec} option.}
+% \changes{v2.12.0}{2016/06/16}{Fix spurious vertical space in \protect\cs{chapter} when used as optional argument of \protect\cs{pstart} in parallel tyepsetting.}
+% \changes{v2.12.0}{2016/06/16}{Fix bug with \protect\cs{ledinnernote} and \protect\cs{ledouternote} in parallel typesetting}
+% \changes{v2.12.0}{2016/06/16}{More accurate message to control the position of \protect\cs{Xfootnote} and \protect\cs{applabel} in the \protect\LaTeX\ code}
+% \changes{v2.12.0}{2016/06/16}{Fix bug in critical and familiar footnotes when using uppercase letters with accent mark}
+% \changes{v2.12.0}{2016/06/16}{Make endnote compatible with \protect\cs{sameword} mechanism}
% \title{\Macpackage \\
% Typeset scholarly editions with \LaTeX\thanks{This file (\dtxfilename)
% has version number \fileversion, last revised \filedate.}}
@@ -681,6 +692,14 @@
% \subsection{Specific features}
% \begin{description}
% \item[draft] underlines lemmas in the main text.
+% \item[auxdir] \macpackage generates auxiliary files.
+% It could be useful to store them in a specific directory.
+% You can set it using \option{auxdir}=\meta{folder} option.
+% Note the two following point:
+% \begin{enumerate}
+% \item \TeX\ is not able to create folder. You should create it yourself.
+% \item The option does not change the default \LaTeX auxiliary files (.aux, .toc, \ldots).
+% \end{enumerate}
% \item[eledmac-compat] help to migrate from \eledmac to \reledmac (see \reff{eledmac-compat}).
% \item[nopenalties] must be called in some cases when using paragraphed endnotes (\reff{nopenalties)}
% \item[nopbinverse] prevents page break within verse environment.
@@ -1096,6 +1115,9 @@
% the number for that particular line to be hidden; namely, no line number will print.
% Note that if you use it in \protect\cs{stanza}, you must call it at the beginning of the verse.
%
+% \DescribeMacro{\hidenumberingonleftpage}
+% \cs{hidenumberingonleftpage} is like \protect{hidenumbering}, but is applied only on left page. \cs{hidenumberingonrightpage} is applied on right page.
+% They can be useful if the position of the line number is depending of the position of the page, but the position of marginal note is fixed.
% \subsubsection{Execute code at each line}
% \Macpackage provides an advanced feature for users.
% \DescribeMacro{\dolinehook}\DescribeMacro{\doinsidelinehook}
@@ -1237,6 +1259,7 @@
% Example: \protect\cs{Afootnote}\verb|[nonum]|\marg{text}.
%
% \subsubsection{Endnotes}
+% \paragraph{Inserting endnotes}
% \DescribeMacro{\Aendnote}
% \DescribeMacro{\Bendnote}
% \DescribeMacro{\Cendnote}
@@ -1257,6 +1280,8 @@
% \item \verb|linerangesep=|\meta{c} to change to \meta{c} the separator between start line and end line for this particular note.
% \end{itemize}
%
+%
+% \paragraph{Printing endnotes}
% \DescribeMacro{\doendnotes}\label{doendnotes} Normally, endnotes are not printed: you must use the
% \protect\cs{doendnotes}\marg{s}, where \meta{s} is the letter of the series to be printed. Put this command where you want the corresponding set of endnotes printed.
% In this case, all the endnotes of the \meta{s} series are printed, for all numbered sections.
@@ -1283,8 +1308,37 @@
% As endnotes may be printed at any point in the document they always
% start with the page number where they are called.
%
+% \paragraph{Code between endnotes}
+% \DescribeMacro{toendnotes}
+% \DescribeMacro{Xtoendnotes}
+% Sometimes, it is useful to insert content between endnotes of the same series: for example to separate endnotes of different sections of the same text.
+% In this case, you could use \emph{inside
+% numbered text} the command:\\
+% \cs{toendnotes}\oarg{series}\marg{content}
+% where \meta{series} is a comma-separated list of the series of endnotes where \meta{content} must be inserted.
+% If \meta{series} is empty, then \meta{content} is inserted to all the series.
+%
+% For example:
+% \begin{verbatim}
+% \toendnotes{\section{Section's title}}
+% \end{verbatim}
+%
+% Alternatively, you can use \cs{Xtoendnotes}\marg{content}, where \enquote{X} must be replaced by a series letter.
+%
+% Remember that the endnotes are temporarily stored in an auxiliary file. That means in general you want to write the \meta{content} in the auxiliary file \emph{without expanding it}, that is without interpreting \TeX\ content.
+%
+% However, in some case, you may want to write
+% once-expanded\footnote{The expansion mechanism' of \TeX is a quite complex problem, but fundamental. We have no place to explain it fully here. Read introduction to \TeX to understand well.}
+% version of the \meta{content}, that is the version where the commands are expanded on the first level.
+% This can be, for example, to get a counter value.
+% Use the starred version in this case.
+% For example:
+% \begin{verbatim}
+% \Atoendnotes*{\string\section{Letter 1 (chap. \thechapter)}}
+% \end{verbatim}
+%
% \subsubsection{Paragraph in critical apparatus}
-% By default, no paragraph can be made in the notes of critical apparatus.
+% By default, no paragraph can be made in the notes of the critical apparatus.
% You can allow it by adding the options \verb+parapparatus+ when loading the package :
% \begin{verbatim}
% \usepackage[parapparatus]{eledmac}
@@ -2173,10 +2227,10 @@
%
% \textbf{Be careful, the standard \LaTeX\ footnote rule, which is used by \macpackage, decreases 3pt. These 3pt are not changed by this command.}
%
-% \DescribeMacro{\preXnotes}
+% \DescribeMacro{\Xprenotes}
% You can set the space before the first series of critical notes printed on each page
% and set a different amount of space for each subsequent series on the page.
-% You can do it with \protect\cs{preXnotes}\marg{l}. The default value is \verb+0pt+.
+% You can do it with \protect\cs{Xprenotes}\marg{l}. The default value is \verb+0pt+.
% You can disable this feature by setting the length to 0pt.
%
% \DescribeMacro{\prenotesX}
@@ -3621,7 +3675,7 @@
% \begin{macrocode}
%<*code>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{reledmac}[2016/06/03 v2.11.0a typeset critical editions]%
+\ProvidesPackage{reledmac}[2016/06/16 v2.12.0 typeset critical editions]%
% \end{macrocode}
%
% \subsection{Package options}
@@ -3719,6 +3773,10 @@
\DeclareOptionX{nopenalties}{%
\AtBeginDocument{\let\add@penalties\relax}%
}
+\def\l@auxdir{}%
+\DeclareOptionX{auxdir}{%
+ \xdef\l@auxdir{#1/}%
+}%
% \end{macrocode}
% We use the starred form of \protect\cs{ProcessOptionsX} which executes options in
% the order listed in the source file: class options, then listed package
@@ -3860,7 +3918,7 @@
% \begin{macro}{\led@err@edtextoutsidepstart}
% \begin{macrocode}
\newcommand*{\led@err@edtextoutsidepstart}{%
- \reledmac@error{\string\edtext\space outside numbered paragraph (\pstart\ldots\pend)}{\@ehc}}%
+ \reledmac@error{\string\edtext\space outside numbered paragraph (\pstart…\pend)}{\@ehc}}%
% \end{macrocode}
% \end{macro}
% \begin{macro}{\led@mess@NotesChanged}
@@ -3988,7 +4046,7 @@
% \end{macro}
%
% \begin{macro}{\led@warn@DuplicateLabel}
-% \begin{macro}{\led@warn@AppLabelOutEdtext}
+% \begin{macro}{\led@warn@AppLabelOutSecondArgEdtext}
% \begin{macro}{\led@warn@RefUndefined}
% \begin{macro}{\led@warn@RefUndefined}
% \begin{macrocode}
@@ -3996,8 +4054,8 @@
\reledmac@warning{Duplicate definition of label `#1'\@gobble}%
\@latex@warning@no@line{Label `#1' multiply defined}%
}%
-\newcommand*{\led@warn@AppLabelOutEdtext}[1]{%
- \reledmac@warning{\string\applabel\space outside of \string\edtext\space `#1' on page \the\pageno.}}%
+\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.}}%
\newcommand*{\led@warn@RefUndefined}[1]{%
\G@refundefinedtrue%
\reledmac@warning{Reference `#1' on page \the\pageno\space undefined.%
@@ -4097,17 +4155,24 @@
% \end{macro}
% \end{macro}
%
+% \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}%
+}%
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{\led@err@EdtextWithoutFootnote}
% \begin{macrocode}
\newcommand{\led@err@EdtextWithoutFootnote}{%
- \reledmac@error{edtext without Xfootnote. Check syntaxis.}{\@ehc}%
+ \reledmac@error{edtext without Xfootnote. Check syntaxis}{\@ehc}%
}%
% \end{macrocode}
% \end{macro}
-% \begin{macro}{\led@err@FootnoteWithoutEdtext}
+% \begin{macro}{\led@err@FootnoteNotInSecondArgEdtext}
% \begin{macrocode}
-\newcommand{\led@err@FootnoteWithoutEdtext}{%
- \reledmac@error{Xfootnote without edtext. Check syntax.}{\@ehc}%
+\newcommand{\led@err@FootnoteNotInSecondArgEdtext}[1]{%
+ \reledmac@error{#1footnote outside of the second argument of an edtext. Check syntax}{\@ehc}%
}%
% \end{macrocode}
% \end{macro}
@@ -4182,6 +4247,13 @@
}%
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\led@warning@preXnotes@deprecated}
+% \begin{macrocode}
+\newcommand{\led@warning@preXnotes@deprecated}{%
+ \reledmac@warning@preXnotes@deprecated%
+}%
+% \end{macrocode}
+% \end{macro}
% \subsection{Gobbling}
% \changes{v1.14.0}{2014/10/27}{Provide \protect\cs{@gobblefour}}
% \changes{v1.14.0}{2014/10/27}{Move gobbling command}
@@ -4415,8 +4487,8 @@
\fi
\gdef\eled@sections@@{}%
\if@noeled@sec\else%
- \makeatletter\InputIfFileExists{\jobname.eledsec\the\section@num}{}{}\makeatother%
- \immediate\openout\eled@sectioning@out=\jobname.eledsec\the\section@num\relax%
+ \makeatletter\InputIfFileExists{\l@auxdir\jobname.eledsec\the\section@num}{}{}\makeatother%
+ \immediate\openout\eled@sectioning@out=\l@auxdir\jobname.eledsec\the\section@num\relax%
\fi%
}
\newcommand*{\initnumbering@reg}{%
@@ -5481,12 +5553,12 @@
% \changes{v0.7.0}{2005/02/22}{Added \protect\cs{get@linelistfile}}
% \begin{macrocode}
\newcommand*{\get@linelistfile}[1]{%
- \InputIfFileExists{#1}{%
+ \InputIfFileExists{\l@auxdir#1}{%
\global\noteschanged@false
\begingroup
\catcode`\[=1 \catcode`\]=2
\makeatletter \catcode`\^^M=9}{%
- \led@warn@NoLineFile{#1}%
+ \led@warn@NoLineFile{\l@auxdir#1}%
\global\noteschanged@true
\begingroup}%
}
@@ -6030,8 +6102,11 @@
% \end{macro}
% \begin{macro}{\ifl@dhidenumber}
% \begin{macro}{\hidenumbering}
+% \begin{macro}{\hidenumberingonleftpage}
+% \begin{macro}{\hidenumberingonrightpage}
% \protect\cs{hidenumbering} hides number in margin.
% It uses action code 1009.
+% \cs{hidenumberingonleftpage} and \cs{hidenumberingonrightpage} ara variant, using action code only conditionnaly
% \begin{macro}{\h@num}
% \begin{macrocode}
\newif\ifl@dhidenumber
@@ -6051,10 +6126,56 @@
\xright@appenditem{-1009}\to\actions@list%
\fi%
}
+\newcommand*{\hidenumberingonleftpage}{%
+ \ifledRcol%
+ \write\linenum@outR{\string\hide@num@left}%
+ \else%
+ \write\linenum@out{\string\hide@num@left}%
+ \fi%
+}%
+
+\newcommand*{\hide@num@left}{%
+ \ifledRcol%
+ \ifodd\page@numR\else%
+ \xright@appenditem{\the\absline@numR}\to\actionlines@listR%
+ \xright@appenditem{-1009}\to\actions@listR%
+ \fi%
+ \else%
+ \ifodd\page@num\else%
+ \xright@appenditem{\the\absline@num}\to\actionlines@list%%
+ \xright@appenditem{-1009}\to\actions@list%
+ \fi%
+ \fi%
+}%
+
+\newcommand*{\hidenumberingonrightpage}{%
+ \ifledRcol%
+ \write\linenum@outR{\string\hide@num@right}%
+ \else%
+ \write\linenum@out{\string\hide@num@right}%
+ \fi%
+}%
+
+\newcommand*{\hide@num@right}{%
+ \ifledRcol%
+ \ifodd\page@numR%
+ \xright@appenditem{\the\absline@numR}\to\actionlines@listR%
+ \xright@appenditem{-1009}\to\actions@listR%
+ \fi%
+ \else%
+ \ifodd\page@num%
+ \xright@appenditem{\the\absline@num}\to\actionlines@list%%
+ \xright@appenditem{-1009}\to\actions@list%
+ \fi%
+ \fi%
+}%
+
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
% \begin{macro}{\@ref}
% \begin{macro}{\insert@count}
% \protect\cs{@ref}
@@ -6255,7 +6376,7 @@
\iffirst@linenum@out@
\immediate\closeout\linenum@out%
\global\first@linenum@out@false%
- \immediate\openout\linenum@out=#1\relax%
+ \immediate\openout\linenum@out=\l@auxdir#1\relax%
\immediate\write\linenum@out{\string\line@list@version{\this@line@list@version}}%
\ifl@dpaging%
\immediate\write\linenum@out{\string\@par@sync@option{\@par@this@sync@option}}%
@@ -6270,7 +6391,7 @@
\leavevmode%
\fi%
\closeout\linenum@out%
- \openout\linenum@out=#1\relax%
+ \openout\linenum@out=\l@auxdir#1\relax%
\write\linenum@out{\string\line@list@version{\this@line@list@version}}%
\ifl@dpaging%
\write\linenum@out{\string\@par@sync@option{\@par@this@sync@option}}%
@@ -6728,12 +6849,18 @@
% \changes{v1.15.0}{2015/01/12}{New boolean \protect\cs{if@edtext@}.}
% \changes{v1.23.0}{2015/05/18}{The boolean \protect\cs{if@edtext@} becomes the counter \protect\cs{edtext@level}.}
% This counter is increased by 1 at each level of \protect\cs{edtext}.
-% That is useful for some commands which can have a different behavior if called inside or outside of the \marg{lemma} argument.
% \begin{macrocode}
\newcount\@edtext@level%
\@edtext@level=0%
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\if@edtext@secondarg@}
+% This boolean is set to TRUE before reading the second argument of a \cs{edtext}.
+% It is tested on some macro which must be executed only inside a second argument.
+% \begin{macrocode}
+\newif\if@edtext@secondarg@%
+% \end{macrocode}
+% \end{macro}
% \changes{v1.16.0}{2014/01/23}{\protect\cs{edtext} is now defined only in \eledmac, not in \eledpar. Debug wrong numbering when using \protect\cs{sameword} + \protect\package{eledpar} + \protect\cs{tag} command.}
%
%
@@ -6828,7 +6955,9 @@
% \protect\cs{ignorespaces} as well, to skip any spaces between macros when
% several are used in series.
% \begin{macrocode}
+ \@edtext@secondarg@true%
\ignorespaces #2\relax%
+ \@edtext@secondarg@false%
% \end{macrocode}
% With \protect\package{polyglossia}, you must track whether the language reads left to right (English) or right to left (Arabic).
% \begin{macrocode}
@@ -6860,7 +6989,7 @@
\endgroup%
\ifdef{\hypertarget}%
{%
- \csedef{thisedtext@\the\@edtext@level}{\theedtext}%
+ \csedef{thisedtext@\the\@edtext@level}{\theedtext}%We need one macro by level, as #1 can contain new \edtext
\Hy@raisedlink@left{\hypertarget{\csuse{thisedtext@\the\@edtext@level}:start}{}}%
\showlemma{#1}%
\Hy@raisedlink{\hypertarget{\csuse{thisedtext@\the\@edtext@level}:end}{}}%
@@ -8915,9 +9044,10 @@
\notbool{parapparatus@}{\newcommand*}{\newcommand}{\normalfootfmt}[4]{%
\Xledsetnormalparstuff{#4}%
- \hangindent=\csuse{Xhangindent@#4}
+ \hangindent=\csuse{Xhangindent@#4}%
\everypar{\hangindent=\csuse{Xhangindent@#4}}%
- \strut{\printlinefootnote{#1}{#4}}%
+ \rule\z@\splittopskip%
+ {\printlinefootnote{#1}{#4}}%
\print@lemma{#1}{#2}{#4}%
\csuse{Xwrapcontent@#4}{#3}%
\strut\par}
@@ -8938,7 +9068,7 @@
% spacing problems if what you add takes up a different amount of
% space.
%
-% But if the skip \protect\cs{preXnotes@} is greater than 0~pt,
+% But if the skip \protect\cs{Xprenotes@} is greater than 0~pt,
% it is used instead of \protect\cs{skip}\protect\cs{footins} for the first printed series in one page.
%
% The \protect\cs{leftskip} and \protect\cs{rightskip} values
@@ -8960,12 +9090,12 @@
% In order to insert this specific skip without overlap the bottom margin of the page, Maïeul Rouquette have defined an algorithm explained in \reff{skipfirstseries}.
% Here is part of this algorithm, when the block of notes are ready to be printed.
% \begin{macrocode}
- \ifdimequal{0pt}{\preXnotes@}{}%
+ \ifdimequal{0pt}{\Xprenotes@}{}%
{%
- \iftoggle{preXnotes@}{%
- \togglefalse{preXnotes@}%
+ \iftoggle{Xprenotes@}{%
+ \togglefalse{Xprenotes@}%
\skip\csname #1footins\endcsname=%
- \glueexpr\csuse{preXnotes@}+\csuse{Xafterrule@#1}\relax%
+ \glueexpr\csuse{Xprenotes@}+\csuse{Xafterrule@#1}\relax%
}%
{}%
}%
@@ -9141,12 +9271,12 @@
\newcommand*{\parafootstart}[1]{%
\rightskip=0pt \leftskip=0pt%
\nottoggle{Xparindent@#1}{\parindent=\z@}{}%
- \ifdimequal{0pt}{\preXnotes@}{}%
+ \ifdimequal{0pt}{\Xprenotes@}{}%
{%
- \iftoggle{preXnotes@}{%
- \togglefalse{preXnotes@}%
+ \iftoggle{Xprenotes@}{%
+ \togglefalse{Xprenotes@}%
\skip\csname #1footins\endcsname=%
- \glueexpr\csuse{preXnotes@}+\csuse{Xafterrule@#1}\relax%
+ \glueexpr\csuse{Xprenotes@}+\csuse{Xafterrule@#1}\relax%
}%
{}%
}%
@@ -10527,26 +10657,26 @@
{\footnote}%
{\stepcounter\@mpfn}%
{%
- \ifl@dpairing%
- \global\advance\footnote@reading by \@ne%
- \get@thisfootnote%
- \get@fnmark{\thisfootnote}%
- \ifcsdef{footnotereading\the\footnote@reading=typeset}%
- {\setcounter{\@mpfn}{\csuse{footnotereading\the\footnote@reading=typeset}}}%
- {\setcounter{\@mpfn}{\footnote@reading}}%
- \else%
- \stepcounter\@mpfn%
- \fi%
+ \ifboolexpr{bool{l@dpairing} or bool{l@dprintingpages} or bool{l@dprintingcolumns}}{%
+ \global\advance\footnote@reading by \@ne%
+ \get@thisfootnote%
+ \get@fnmark{\thisfootnote}%
+ \ifcsdef{footnotereading\the\footnote@reading=typeset}%
+ {\setcounter{\@mpfn}{\csuse{footnotereading\the\footnote@reading=typeset}}}%
+ {\setcounter{\@mpfn}{\footnote@reading}}%
+ }{%
+ \stepcounter\@mpfn%
+ }%
}%
{}
{}
\newcommand{\get@thisfootnote}{%
- \ifl@dpairing
+ \ifboolexpr{bool{l@dpairing} or bool{l@dprintingpages} or bool{l@dprintingcolumns}}{%
\protected@xdef\thisfootnote{\the\footnote@reading}%
- \else%
- \protected@xdef\thisfootnote{\thefootnote}%
- \fi%
+ }{%
+ \protected@xdef\thisfootnote{\the\c@footnote}%
+ }%
}%
\newcommand{\l@dbfnote}[1]{%
@@ -10580,7 +10710,7 @@
\stepcounter{footnote@typeset}%
\setcounter{footnote}{\c@footnote@typeset}%
\immediate\write\@mainaux{%
- \global\csdef{footnotereading#1=typeset}{\the\c@footnote@typeset}%
+ \csgdef{footnotereading#1=typeset}{\the\c@footnote@typeset}%
}%
\def\@thefnmark{\thefootnote}%
}%
@@ -10730,7 +10860,8 @@
\ledsetnormalparstuffX{#1}%
\hangindent=\csuse{hangindentX@#1}%
\everypar{\hangindent=\csuse{hangindentX@#1}}%
- {{\csuse{notenumfontX@#1}\wrapped@footfootmarkX{#1}}\strut%
+ \rule\z@\splittopskip%
+ {{\csuse{notenumfontX@#1}\wrapped@footfootmarkX{#1}}%
\csuse{wrapcontentX@#1}{#2}%
\strut\par}}
@@ -10872,11 +11003,11 @@
% The macro \cs{get@thisfootnote} command just saves the footnote number in the \cs{thisfootnote} macro, depending on the use of pairing environments.
% \begin{macrocode}
\newcommand{\get@thisfootnoteX}[1]{%
- \ifl@dpairing%
+ \ifboolexpr{bool{l@dpairing} or bool{l@dprintingpages} or bool{l@dprintingcolumns}}{%
\protected@xdef\thisfootnote{\the\csname footnote#1@reading\endcsname}%
- \else%
- \protected@xdef\thisfootnote{\csuse{thefootnote#1}}%
- \fi%
+ }{%
+ \protected@xdef\thisfootnote{\the\csname c@footnote#1\endcsname}%
+ }%
}%
% \end{macrocode}
% \end{macro}
@@ -10902,7 +11033,7 @@
\setcounter{footnote#1}{\value{footnote#1@typeset}}%
\@namedef{@thefnmark#1}{\csuse{thefootnote#1}}%
\immediate\write\@mainaux{%
- \global\csdef{footnote#1reading#2=typeset}{\the\csname c@footnote#1@typeset\endcsname}%
+ \csgdef{footnote#1reading#2=typeset}{\the\csname c@footnote#1@typeset\endcsname}%
}%
}%
{%
@@ -10920,6 +11051,8 @@
\edtext{}{\normalbfnoteX{#1}{#2}}%
\else
\def\this@footnoteX@reading{\the\csname footnote#1@reading\endcsname}%
+ \get@thisfootnoteX{#1}%
+ \get@fnmarkX{#1}{\expandonce\thisfootnote}%
\@nameuse{regvfootnote#1}{#1}{#2}%
\fi}
@@ -11629,7 +11762,7 @@
% \section{Specific skip for first series of footnotes}\label{skipfirstseries}
% \subsubsection{Overview}
% \protect\cs{Xbeforenotes} inserts a specific skip for the first series of notes in a page.
-% As we can't know in advance which series will be the first, we call \protect\cs{prepare@preXnotes} before inserting any critical notes, in order to prevent page number overlapping.
+% As we can't know in advance which series will be the first, we call \protect\cs{prepare@Xprenotes} before inserting any critical notes, in order to prevent page number overlapping.
% \begin{enumerate}
% \item If it is the first note of the current page, it changes the footnote skip for the series to the value specified to \protect\cs{Xbeforenotes}. It also keeps the series of the note as the first one of the current page.
% \item If it is not the first note of the current page:
@@ -11651,24 +11784,25 @@
%
% And now, implementation !
% \subsubsection{User level command}
-% \begin{macro}{\preXnotes@}
-% \begin{macro}{\preXnotes}
-% \changes{v1.1.0}{2012/09/25}{New skip \protect\cs{preXnotes@}}
+% \begin{macro}{\Xprenotes@}
+% \begin{macro}{\Xprenotes}
+% \changes{v1.1.0}{2012/09/25}{New skip \protect\cs{Xprenotes@}}
% \changes{v1.2.0}{2012/10/08}{Debug in familiar footnotes (bug introduced by v1.1).}
-% If user redefines \protect\cs{preXnotes@}, via \protect\cs{preXnotes} to a value greater than 0~pt,
+% If user redefines \protect\cs{Xprenotes@}, via \protect\cs{Xprenotes} to a value greater than 0~pt,
% this skip will be added before first series notes
% instead of the notes skip.
% \begin{macrocode}
-\newtoggle{preXnotes@}
-\toggletrue{preXnotes@}
-\newcommand{\preXnotes@}{0pt}
-\newcommand*{\preXnotes}[1]{\renewcommand{\preXnotes@}{#1}}
+\newtoggle{Xprenotes@}%
+\toggletrue{Xprenotes@}%
+\newcommand{\Xprenotes@}{0pt}%
+\newcommand*{\Xprenotes}[1]{\renewcommand{\Xprenotes@}{#1}}%
+\newcommand{\preXnotes}[1]{\led@warning@preXnotes@deprecated\Xprenotes{#1}}%For compatibility
% \end{macrocode}
% \end{macro}
% \end{macro}
% The same, but for familiar footnotes.
-% \begin{macro}{\preXnotes}
-% \begin{macro}{\preXnotes@}
+% \begin{macro}{\Xprenotes}
+% \begin{macro}{\Xprenotes@}
% \begin{macrocode}
\newtoggle{prenotesX@}
\toggletrue{prenotesX@}
@@ -11680,15 +11814,15 @@
%
% \subsubsection{Internal commands}
% \begin{macro}{firstXseries@}
-% \begin{macro}{prepare@preXnotes}
+% \begin{macro}{prepare@Xprenotes}
% \begin{macrocode}
\gdef\firstXseries@{}
-\newcommand{\prepare@preXnotes}[1]{%
- \ifdimequal{0pt}{\preXnotes@}%
+\newcommand{\prepare@Xprenotes}[1]{%
+ \ifdimequal{0pt}{\Xprenotes@}%
{}%
{%
\IfStrEq{\firstXseries@}{}{%
- \global\skip\csuse{#1footins}=\preXnotes@%
+ \global\skip\csuse{#1footins}=\Xprenotes@%
\global\advance\skip\csname #1footins\endcsname by\csuse{Xafterrule@#1}%
\gdef\firstXseries@{#1}%
}%
@@ -11745,6 +11879,7 @@
\ifbool{noend@}{}{%Used instead of \ifnoend@ to prevent expansion problem
% \end{macrocode}
%
+% \subsection{Internal commands}
% \begin{macro}{\l@dend@open}
% \begin{macro}{\l@dend@close}
% \protect\cs{l@dend@open} and \protect\cs{l@dend@close} are the
@@ -11760,7 +11895,7 @@
\expandafter\immediate%
\expandafter\openout%
\csname l@d@#1end\endcsname%
- =\jobname.#1end\relax%
+ =\l@auxdir\jobname.#1end\relax%
}%
\newcommand{\l@dend@close}[1]{%
\global\boolfalse{l@dend@#1}%
@@ -11947,6 +12082,42 @@
}%
% \end{macrocode}
% \end{macro}
+% \subsection{User level commands}
+% \subsubsection{Inserting contents to endnotes}
+% The \cs{Xendnotes} commands are defined upper, when defining apparatus commands by series.
+% Here, we define.
+% only \cs{toendnotes} command not specific to a series, in order to insert arbitrary code.
+% The regular version writes an unexpanded argument, while the regular version writes a once-expanded argument.
+%
+% \begin{macro}{\toendnotes*}
+% \begin{macro}{\toendnotes*}
+% \begin{macrocode}
+\newcommandx{\toendnotes}[2][1,usedefault]{%
+ \ifboolexpr{bool{numbering} or bool{numberingR}}{%
+ \def\do##1{%
+ \reledmac@warning{toto}\expandafter\immediate\expandafter\write\csname l@d@##1end\endcsname%
+ {\unexpanded{#2}\@percentchar}%
+ }%
+ \ifstrempty{#1}%
+ {\dolistloop{\@series}}%
+ {\docsvlist{#1}}%
+ }{\led@err@toendnotes@outsidenumbering}%
+}%
+\WithSuffix\newcommandx\toendnotes*[2][1,usedefault]{%
+ \ifboolexpr{bool{numbering} or bool{numberingR}}{%
+ \def\do##1{%
+ \reledmac@warning{toto}\expandafter\immediate\expandafter\write\csname l@d@##1end\endcsname%
+ {#2\@percentchar}%
+ }%
+ \ifstrempty{#1}%
+ {\dolistloop{\@series}}%
+ {\docsvlist{#1}}%
+ }{\led@err@toendnotes@outsidenumbering}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \subsubsection{Printing endnotes}
% \begin{macro}{\doendnotes}
% \begin{macro}{\ifXendinsertsep@}
% \protect\cs{doendnotes} is
@@ -11961,7 +12132,7 @@
\begingroup
\makeatletter
\expandafter\let\csname #1end\endcsname=\endprint
- \input\jobname.#1end%
+ \input\l@auxdir\jobname.#1end%
\global\Xendinsertsep@false%
\endgroup}
% \end{macrocode}
@@ -11982,7 +12153,7 @@
{\cslet{#1end}{\endprint}}%
{\cslet{#1end}{\@gobblefive}}%
}%
- \input\jobname.#1end%
+ \input\l@auxdir\jobname.#1end%
\global\Xendinsertsep@false%
\endgroup%
}%
@@ -12302,7 +12473,12 @@
% \changes{v1.23.0}{2015/04/29}{Prevent spurious spaces when \protect\cs{Afootnote} and similar commands are followed by spaces (bug added on 1.0.0!).}
% \begin{macrocode}
\global\notbool{parapparatus@}{\expandafter\newcommand\expandafter *}{\expandafter\newcommand}\csname #1footnote\endcsname[2][]{%
- \ifnum\@edtext@level>0%
+ \if@edtext@secondarg@%
+ \ifledRcol%
+ \ifcsstring{Xonlyside@#1}{L}{\led@error@note@called@onrightside{#1footnote}}{}%
+ \else%
+ \ifcsstring{Xonlyside@#1}{R}{\led@error@note@called@onleftside{#1footnote}}{}%
+ \fi%
\begingroup%
\newcommand{\content}{##2}%
\ifnumberedpar@%
@@ -12322,7 +12498,7 @@
{\unexpanded{\let\index\nindex}}%There is no note number… so
{}%
\noexpand\Xnote@true%
- \noexpand\prepare@preXnotes{#1}%
+ \noexpand\prepare@Xprenotes{#1}%
\noexpand\prepare@edindex@fornote{\l@d@nums}%
\unexpanded{\def\sw@list@inedtext}{\expandafter\unexpanded\expandafter{\sw@inthisedtext}}%The value of the \sw@inthisedtext of current \edtext will be pushed to \sw@list@inedtext when the notes are expanded.
\noexpand\setcounter{stanzaR}{\the\c@stanzaR}%Save stanzaR counter for footnote
@@ -12358,7 +12534,7 @@
{\unexpanded{\let\index\nindex}}%There is no note number… so
{}%
\noexpand\Xnote@true%
- \noexpand\prepare@preXnotes{#1}%
+ \noexpand\prepare@Xprenotes{#1}%
\noexpand\prepare@edindex@fornote{\l@d@nums}%
\unexpanded{\def\sw@list@inedtext}{\expandafter\unexpanded\expandafter{\sw@inthisedtext}}%The value of the \sw@inthisedtext of current edtext will be pushed to \sw@list@inedtext when the notes are expanded.
\ifl@dpairing%
@@ -12387,7 +12563,7 @@
\fi%
\endgroup%
\else%
- \led@err@FootnoteWithoutEdtext%
+ \led@err@FootnoteNotInSecondArgEdtext{#1}%
\fi%
\ignorespaces%
}
@@ -12454,13 +12630,21 @@
% Read \parpackage's handbook about that (\reff{reledpar-familiarfootnotenumber}).
% \begin{macrocode}
\global\expandafter\advance\csname footnote#1@reading\endcsname by \@ne%
- \ifl@dpairing%
+ \ifboolexpr{bool{l@dpairing} or bool{l@dprintingpages} or bool{l@dprintingcolumns}}{%
\ifcsdef{footnote#1reading\the\csname footnote#1@reading\endcsname=typeset}%
{\setcounter{footnote#1}{\csuse{footnote#1reading\the\csname footnote#1@reading\endcsname=typeset}}}%
{\setcounter{footnote#1}{\the\csname footnote#1@reading\endcsname}}%
- \else%
+ }{%
\stepcounter{footnote#1}%
- \fi%
+ }%
+% \end{macrocode}
+% We also have to check consistency with \cs{onlysideX} setting.
+% \begin{macrocode}
+ \ifledRcol%
+ \ifcsstring{onlysideX@#1}{L}{\led@error@note@called@onrightside{footnote#1}}{}%
+ \else%
+ \ifcsstring{onlysideX@#1}{R}{\led@error@note@called@onleftside{footnote#1}}{}%
+ \fi%
% \end{macrocode}
% And now, the feature not depending of wether we are preparing parallel typesetting
% \begin{macrocode}
@@ -12539,6 +12723,7 @@
\newcommand{\content}{##2}%
\stepcounter{labidx}%
\expandafter\immediate\expandafter\write\csname l@d@#1end\endcsname{%
+ \unexpanded{\def\sw@list@inedtext}{\expandafter\unexpanded\expandafter{\sw@inthisedtext}} %Volountary space, to add linebreak in the output file
\expandafter\string\csname #1end\endcsname%
{\ifnumberedpar@\l@d@nums\fi}%
{\ifnumberedpar@\expandonce\@tag\fi}%
@@ -12553,6 +12738,21 @@
\ignorespaces%
}%
% \end{macrocode}
+% \subsubsection{Tools}
+% The \cs{Xtoendnotes} command inserts any arbitrary content into the endnote file.
+% It is an alias of the more generalist \cs{addtoennotes}
+% \begin{macrocode}
+
+ \global\expandafter\newcommand\csname #1toendnotes\endcsname[1]{%
+ \toendnotes[#1]{##1}%
+ }%
+
+ \expandafter\WithSuffix\expandafter\newcommand\csname #1toendnotes\endcsname*[1]{%
+ \toendnotes*[#1]{##1}%
+ }%
+
+% \end{macrocode}
+% \subsubsection{Internal commands}
% \protect\cs{Xendnote} commands called \protect\cs{Xend} commands on to the endnote file; these are analogous to the various
% \verb"footfmt" commands above, and they take the same arguments.
% When we process this file, we want to pick out the notes of one
@@ -12568,6 +12768,7 @@
% \begin{macrocode}
\global\expandafter\newcount\csname #1end@bysection\endcsname%
% \end{macrocode}
+%
% \subsubsection{The options}
% \begin{macrocode}
\csgdef{Xendwraplemma@#1}{}
@@ -13614,7 +13815,7 @@
% \protect\cs{applabel}, if called in \protect\cs{edtext} will insert automatically both a start and an end label for the current edtext lines.
% \begin{macrocode}
\newcommand*{\applabel}[1]{%
- \ifnum\@edtext@level>0%
+ \if@edtext@secondarg@%
% \end{macrocode}
% Label should not be already defined.
% \begin{macrocode}
@@ -13660,7 +13861,7 @@
% Warning if \protect\cs{applabel} is called outside of \protect\cs{edtext}.
% \begin{macrocode}
\else%
- \led@warn@AppLabelOutEdtext{#1}%
+ \led@warn@AppLabelOutSecondArgEdtext{#1}%
\fi%
% \end{macrocode}
% End of \protect\cs{applabel}
@@ -14199,10 +14400,10 @@
% the default for line numbers).
% \protect\cs{l@dgetsidenote@margin} returns the number associated to side note margin:
% \begin{description}
-% \item[left]: 0
-% \item[right]: 1
-% \item[outer]: 2
-% \item[inner]: 3
+% \item[left:] 0
+% \item[right:] 1
+% \item[outer:] 2
+% \item[inner:] 3
% \end{description}
% \changes{v0.5.1}{2004/04/10}{Added \protect\cs{sidenotemargin} and \protect\cs{sidenote@margin}}
% \changes{v0.7.0}{2005/02/23}{Added \protect\cs{l@dgetsidenote@margin}}
@@ -14298,24 +14499,9 @@
% \begin{macrocode}
\newcommand*{\ledleftnote}[1]{\edtext{}{\l@dlsnote{#1}}}
\newcommand*{\ledrightnote}[1]{\edtext{}{\l@drsnote{#1}}}
-
-\newcommand*{\ledinnernote}[1]{%
- \ifodd\c@page% Do not use \page@num, because it is not yet calculated when command is called
- \ledleftnote{#1}%
- \else%
- \ledrightnote{#1}%
- \fi%
-}
-
-\newcommand*{\ledouternote}[1]{%
- \ifodd\c@page% Do not use \page@num, because it is not yet calculated when command is called
- \ledrightnote{#1}%
- \else%
- \ledleftnote{#1}%
- \fi%
-}
-
-\newcommand*{\ledsidenote}[1]{\edtext{}{\l@dcsnote{#1}}}
+\newcommand*{\ledsidenote}[1]{\edtext{}{\l@dcsnote{#1}}}%
+\newcommand*{\ledinnernote}[1]{\edtext{}{\l@disnote{#1}}}%
+\newcommand*{\ledouternote}[1]{\edtext{}{\l@dosnote{#1}}}%
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -14327,6 +14513,8 @@
% \begin{macro}{\l@dlsnote}
% \begin{macro}{\l@drsnote}
% \begin{macro}{\l@dcsnote}
+% \begin{macro}{\l@desnote}
+% \begin{macro}{\l@disnote}
% \changes{v1.12.0}{2014/08/05}{\protect\cs{l@dlsnote},\protect\cs{l@drsnote} and \protect\cs{l@dcsnote} defined only one time, in \eledmac, including needs for eledpar case.}.
% The `footnotes' for left, right, and moveable sidenotes. The whole
% scheme is reminiscent of the critical footnotes code.
@@ -14347,7 +14535,10 @@
\to\inserts@list
\global\advance\insert@count \@ne%
\fi
- \fi\ignorespaces\endgroup}
+ \fi%
+ \ignorespaces%
+ \endgroup%
+}%
\newcommand*{\l@drsnote}[1]{%
\begingroup%
@@ -14362,7 +14553,9 @@
\to\inserts@list
\global\advance\insert@count \@ne%
\fi
- \fi\ignorespaces\endgroup}
+ \fi\ignorespaces%
+ \endgroup%
+}%
\newcommand*{\l@dcsnote}[1]{%
\begingroup%
@@ -14377,16 +14570,56 @@
\to\inserts@list
\global\advance\insert@count \@ne%
\fi
- \fi\ignorespaces\endgroup}
+ \fi\ignorespaces%
+ \endgroup%
+}%
+
+\newcommand*{\l@disnote}[1]{%
+ \begingroup%
+ \newcommand{\content}{#1}%
+ \ifnumberedpar@%
+ \ifledRcol%
+ \xright@appenditem{\noexpand\vl@disnote{\expandonce\content}}%
+ \to\inserts@listR%
+ \global\advance\insert@countR \@ne%
+ \else%
+ \xright@appenditem{\noexpand\vl@disnote{\expandonce\content}}%
+ \to\inserts@list%
+ \global\advance\insert@count \@ne%
+ \fi%
+ \fi\ignorespaces%
+ \endgroup%
+}%
+
+\newcommand*{\l@dosnote}[1]{%
+ \begingroup%
+ \newcommand{\content}{#1}%
+ \ifnumberedpar@%
+ \ifledRcol%
+ \xright@appenditem{\noexpand\vl@dosnote{\expandonce\content}}%
+ \to\inserts@listR%
+ \global\advance\insert@countR \@ne%
+ \else%
+ \xright@appenditem{\noexpand\vl@dosnote{\expandonce\content}}%
+ \to\inserts@list%
+ \global\advance\insert@count \@ne%
+ \fi%
+ \fi\ignorespaces%
+ \endgroup%
+}%
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \begin{macro}{\vl@dlsnote}
% \begin{macro}{\vl@drsnote}
% \begin{macro}{\vl@dcsnote}
+% \begin{macro}{\vl@disnote}
+% \begin{macro}{\vl@dosnote}
% Put the left/right text into boxes, but just save the moveable text.
% \protect\cs{l@dcsnotetext}, \protect\cs{l@dcsnotetext@l} and \protect\cs{l@dcsnotetext@r} are \protect\package{etoolbox}'s lists which will store the content of side notes.
% We store the content in lists, because we need to loop later on them, in case many sidenote co-exist for the same line.
@@ -14404,6 +14637,7 @@
% \item \protect\cs{l@dcsnotetext@l} if \protect\cs{ledsidenote} is to be put on right.
% \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}
\newcommand*{\vl@dlsnote}[1]{%
\ifledRcol@%
@@ -14443,10 +14677,38 @@
}
\newcommand*{\vl@dcsnote}[1]{\listgadd{\l@dcsnotetext}{#1}}
+\newcommand{\vl@disnote}[1]{%
+ \ifledRcol@%
+ \@tempcnta=\page@numR%
+ \else%
+ \@tempcnta=\page@num%
+ \fi%
+ \ifodd\@tempcnta% ODD => right page => inner side = left side
+ \vl@dlsnote{#1}%
+ \else%
+ \vl@drsnote{#1}%
+ \fi%
+}%
+
+\newcommand{\vl@dosnote}[1]{%
+ \ifledRcol@%
+ \@tempcnta=\page@numR%
+ \else%
+ \@tempcnta=\page@num%
+ \fi%
+ \ifodd\@tempcnta% ODD => right page => outer side = right side
+ \vl@drsnote{#1}%
+ \else%
+ \vl@dlsnote{#1}%
+ \fi%
+}%
+
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
%
%
% \begin{macro}{\setl@dlp@rbox}
@@ -17573,12 +17835,6 @@
% \end{macrocode}
% \end{macro}
% \subsection{Auxiliary commands}
-% \begin{macro}{\if@eled@sectioning}
-% The boolean \protect\cs{if@eled@sectioning} is set to true when a sectioning command is called by a \protect\cs{eledxxx} command, and set to false after. It is used to enable/disable line number printing.
-% \begin{macrocode}
-\newif\if@eled@sectioning
-% \end{macrocode}
-% \end{macro}
% \begin{macro}{\print@leftmargin@eledsection}
% \begin{macro}{\print@rightmargin@eledsection}
% \protect\cs{print@leftmargin@eledsection} and \protect\cs{print@rightmargin@eledsection} are added by \macpackage inside the code of sectioning command, in order to affix lines numbers.
@@ -17619,7 +17875,6 @@
% \end{macro}
% \end{macro}
% \subsection{Patching standard commands}
-% \begin{macro}{\chapter}
% \begin{macro}{\M@sect}
% \begin{macro}{\@mem@old@ssect}
% \begin{macro}{\@makechapterhead}
@@ -17640,15 +17895,6 @@
%
% \begin{macrocode}
\AtBeginDocument{%
-\patchcmd{\chapter}{\clearforchapter}{%
- \if@eled@sectioning\else%
- \ifl@dprintingpages\else%
- \clearforchapter%
- \fi%
- \fi%
- }
- {}
- {}
\pretocmd{\M@sect}
@@ -17695,15 +17941,7 @@
{}
{}
-\patchcmd{\chapter}{\if@openright\cleardoublepage\else\clearpage\fi}{%
- \if@eled@sectioning\else%
- \ifl@dprintingpages\else%
- \if@openright\cleardoublepage\else\clearpage\fi%No clearpage inside a \Pages: will keep critical notes from printing on the title page. Here for classical classes
- \fi%
- \fi%
- }%
- {}%
- {}%
+
\patchcmd{\scr@startchapter}{\if@openright\cleardoublepage\else\clearpage\fi}{%
\if@eled@sectioning\else%
@@ -17837,13 +18075,13 @@
{}
{}
}%
-}
+}%
% \end{macrocode}
-% Now, we have finished to patch the commands, using \# with a catcode equals to 12. We close the \verb+\notbool{@noeled@sec}+ statement, restore the normal catcode for \# and reopen a new \verb+\notbool{@noeled@sec}+ statement.
+% Close the \verb+\notbool{@noeled@sec}+ statement.
+% Also, we have finished patching the commands, using \# with a catcode equal to 12, so we are restoring the normal catcode for \#.
% \begin{macrocode}
{}}%
\protect\catcode`\#=6 %Space NEEDS by \catcode
-\notbool{@noeled@sec}{%
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -17852,7 +18090,44 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \begin{macro}{\chapter}
+% We patch the \protect\cs{chapter} command even if the \option{noeledsec} option is called, because we can use \cs{chapter} in the optional argument of a \cs{pstart} in parallel typesetting.
+% \begin{macrocode}
+\AtBeginDocument{%
+\patchcmd{\chapter}{\clearforchapter}{%
+ \if@eled@sectioning\else%
+ \ifl@dprintingpages\else%
+ \clearforchapter%
+ \fi%
+ \fi%
+ }%
+ {}%
+ {}%
+
+\patchcmd{\chapter}{\if@openright\cleardoublepage\else\clearpage\fi}{%
+ \if@eled@sectioning\else%
+ \ifl@dprintingpages%
+ \endgraf%
+ \else%
+ \if@openright\cleardoublepage\else\clearpage\fi%No clearpage inside a \Pages: will keep critical notes from printing on the title page. Here for classical classes
+ \fi%
+ \fi%
+ }%
+ {}%
+ {}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\if@eled@sectioning}
+% The boolean \protect\cs{if@eled@sectioning} is set to true when a sectioning command is called by a \protect\cs{eledxxx} command, and set to false after. It is used to enable/disable line number printing.
+% \begin{macrocode}
+\newif\if@eled@sectioning%
+% \end{macrocode}
% \end{macro}
+% We reopen a new \verb+\notbool{@noeled@sec}+ statement, as we will define the \cs{elesection} commands.
+% \begin{macrocode}
+\notbool{@noeled@sec}{%
+% \end{macrocode}
% \subsection{Main code of \protect\cs{eledxxx} commands}
% \begin{macro}{\eled@sectioning@out}
% \protect\cs{eled@sectioning@out} is the output file, to dump the pstarts where a sectioning command is used.
@@ -18001,18 +18276,18 @@
{%
\ifstrempty{#1}%
{%
- \global\csdef{eled@sectioning@#3#5}{\let\edtext=\dummy@edtext@showlemma\chapter{#2}}%
- \global\csdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\chaptermark{#2}}%
+ \csgdef{eled@sectioning@#3#5}{\let\edtext=\dummy@edtext@showlemma\chapter{#2}}%
+ \csgdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\chaptermark{#2}}%
}%Need for \pairs, because of using parbox.
{%
- \global\csdef{eled@sectioning@#3#5}{\let\edtext=\dummy@edtext@showlemma\chapter[#1]{#2}}%
- \global\csdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\chaptermark{#2}}%Need for \pairs, because of using parbox.
+ \csgdef{eled@sectioning@#3#5}{\let\edtext=\dummy@edtext@showlemma\chapter[#1]{#2}}%
+ \csgdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\chaptermark{#2}}%Need for \pairs, because of using parbox.
}%
}%
{%
\ifstrempty{#1}%
- {\global\csdef{eled@sectioning@#3#5}{\let\edtext=\dummy@edtext@showlemma\chapter*{#2}}}%
- {\global\csdef{eled@sectioning@#3#5}{\let\edtext=\dummy@edtext@showlemma\chapter*[#1]{#2}}}%Bug in LaTeX!
+ {\csgdef{eled@sectioning@#3#5}{\let\edtext=\dummy@edtext@showlemma\chapter*{#2}}}%
+ {\csgdef{eled@sectioning@#3#5}{\let\edtext=\dummy@edtext@showlemma\chapter*[#1]{#2}}}%Bug in LaTeX!
}%
\listcsgadd{eled@sections#5@@}{#3}%
}
@@ -18020,17 +18295,17 @@
\ifstrempty{#4}%
{\ifstrempty{#1}%
{%
- \global\csdef{eled@sectioning@#3#5}{\section{#2}}%
- \global\csdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\sectionmark{#2}}%Need for \pairs, because of using parbox.
+ \csgdef{eled@sectioning@#3#5}{\section{#2}}%
+ \csgdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\sectionmark{#2}}%Need for \pairs, because of using parbox.
}%
{%
- \global\csdef{eled@sectioning@#3#5}{\section[#1]{#2}}%
- \global\csdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\sectionmark{#1}}%Need for \pairs, because of using parbox.
+ \csgdef{eled@sectioning@#3#5}{\section[#1]{#2}}%
+ \csgdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\sectionmark{#1}}%Need for \pairs, because of using parbox.
}%
}%
{\ifstrempty{#1}%
- {\global\csdef{eled@sectioning@#3#5}{\section*{#2}}}%
- {\global\csdef{eled@sectioning@#3#5}{\section*[#1]{#2}}}%Bug in LaTeX!
+ {\csgdef{eled@sectioning@#3#5}{\section*{#2}}}%
+ {\csgdef{eled@sectioning@#3#5}{\section*[#1]{#2}}}%Bug in LaTeX!
}
\listcsgadd{eled@sections#5@@}{#3}%
}
@@ -18038,29 +18313,29 @@
\ifstrempty{#4}%
{\ifstrempty{#1}%
{%
- \global\csdef{eled@sectioning@#3#5}{\subsection{#2}}%
- \global\csdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\csuse{subsectionmark}{#2}}%Need for \pairs, because of using parbox. \csuse in case of \subsectionmark is not defined (book)
+ \csgdef{eled@sectioning@#3#5}{\subsection{#2}}%
+ \csgdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\csuse{subsectionmark}{#2}}%Need for \pairs, because of using parbox. \csuse in case of \subsectionmark is not defined (book)
}%
{%
- \global\csdef{eled@sectioning@#3#5}{\subsection[#1]{#2}}%
- \global\csdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\csuse{subsectionmark}{#1}}%Need for \pairs, because of using parbox. \csuse in case of \subsectionmark is not defined (book)
+ \csgdef{eled@sectioning@#3#5}{\subsection[#1]{#2}}%
+ \csgdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\csuse{subsectionmark}{#1}}%Need for \pairs, because of using parbox. \csuse in case of \subsectionmark is not defined (book)
}%
}%
{\ifstrempty{#1}%
- {\global\csdef{eled@sectioning@#3#5}{\subsection*{#2}}}%
- {\global\csdef{eled@sectioning@#3#5}{\subsection*[#1]{#2}}}%Bug in LaTeX!
+ {\csgdef{eled@sectioning@#3#5}{\subsection*{#2}}}%
+ {\csgdef{eled@sectioning@#3#5}{\subsection*[#1]{#2}}}%Bug in LaTeX!
}
\listcsgadd{eled@sections#5@@}{#3}%
}
\def\eled@subsubsection#1#2#3#4#5{%
\ifstrempty{#4}%
{\ifstrempty{#1}%
- {\global\csdef{eled@sectioning@#3#5}{\subsubsection{#2}}}%
- {\global\csdef{eled@sectioning@#3#5}{\subsubsection[#1]{#2}}}%
+ {\csgdef{eled@sectioning@#3#5}{\subsubsection{#2}}}%
+ {\csgdef{eled@sectioning@#3#5}{\subsubsection[#1]{#2}}}%
}%
{\ifstrempty{#1}%
- {\global\csdef{eled@sectioning@#3#5}{\subsubsection*{#2}}}%
- {\global\csdef{eled@sectioning@#3#5}{\subsubsection*[#1]{#2}}}%Bug in LaTeX!
+ {\csgdef{eled@sectioning@#3#5}{\subsubsection*{#2}}}%
+ {\csgdef{eled@sectioning@#3#5}{\subsubsection*[#1]{#2}}}%Bug in LaTeX!
}
\listcsgadd{eled@sections#5@@}{#3}%
}
diff --git a/Master/texmf-dist/source/latex/reledmac/reledpar.dtx b/Master/texmf-dist/source/latex/reledmac/reledpar.dtx
index e39a8041965..5bddd610f98 100644
--- a/Master/texmf-dist/source/latex/reledmac/reledpar.dtx
+++ b/Master/texmf-dist/source/latex/reledmac/reledpar.dtx
@@ -274,6 +274,7 @@
% \changes{v2.9.0}{2016/05/08}{More specific error messages.}
% \changes{v2.9.1}{2016/05/25}{Prevent \protect\cs{Xtxtbeforenotes} hook from causing notes to go beyond the bottom margin}
% \changes{v2.10.0}{2016/06/02}{Add new tools to make apparatuses of manuscripts}
+% \changes{v2.11.0}{2016/06/16}{Compatibility with \protect\reledmac's \protect\option{auxdir} option.}
% ^^A PW added following as the definitions are at some unknown elsewhere
%
% \newcommand{\egstart}{%
@@ -770,6 +771,9 @@
% You may want to typeset notes on one side only (either left or right).
% Use \protect\cs{Xonlyside}\oarg{s}\marg{p} to set critical notes, and \protect\cs{onlysideX}\oarg{s}\marg{p} to set familiar notes.
% \meta{p} must be set to \verb+L+ for notes to be confined only on the left side and to \verb+R+ for notes to be confined only on the right side.
+%
+% Notice that these options just tell you \LaTeX\ to not continue long notes on the other side.
+% It is not designed to allow you to call footnotes on one side but print them on the other side.
% \subsubsection{Familiar notes called in the right side, but to be printed in the left side}
% \DescribeMacro{\footnoteXnomk}
% \DescribeMacro{\footnoteXmk}
@@ -1174,7 +1178,7 @@
% \begin{macrocode}
%<*code>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{reledpar}[2016/06/03 v2.10.0a reledmac extension for parallel texts]%
+\ProvidesPackage{reledpar}[2016/06/16 v2.11.0 reledmac extension for parallel texts]%
% \end{macrocode}
% \subsection{Package's requirement}
@@ -1405,6 +1409,18 @@
}%
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\led@error@note@called@onrightside}
+% \begin{macro}{\led@error@note@called@onleftside}
+% \begin{macrocode}
+\newcommand{\led@error@note@called@onrightside}[1]{%
+ \reledpar@error{#1 called on right side, despite your configuring it to be for the left side only}{\@ehc}%
+}%
+\newcommand{\led@error@note@called@onleftside}[1]{%
+ \reledpar@error{#1 called on left side, despite your configuring it to be for the right side only}{\@ehc}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
% \begin{macro}{\led@error@fail@patch@@mempnum}
% \begin{macrocode}
\newcommand{\led@error@fail@patch@@mempnum}{%
@@ -1442,6 +1458,52 @@
}%
% \end{macrocode}
% \end{macro}
+% \subsection{Naming macros}
+%
+% The \LaTeX\ kernel provides \protect\cs{@namedef} and \protect\cs{@namuse} for defining
+% and using macros that may have non-letters in their names. We need
+% something similar here as we are going to need and use some numbered
+% boxes and counters.
+%
+% \begin{macro}{\newnamebox}
+% \begin{macro}{\setnamebox}
+% \begin{macro}{\unhnamebox}
+% \begin{macro}{\unvnamebox}
+% \begin{macro}{\namebox}
+% A set of macros for creating and using `named' boxes; the macros are called
+% after the regular box macros, but including the string `name'.
+% \begin{macrocode}
+\providecommand*{\newnamebox}[1]{%
+ \expandafter\newbox\csname #1\endcsname}
+\providecommand*{\setnamebox}[1]{%
+ \expandafter\setbox\csname #1\endcsname}
+\providecommand*{\unhnamebox}[1]{%
+ \expandafter\unhbox\csname #1\endcsname}
+\providecommand*{\unvnamebox}[1]{%
+ \expandafter\unvbox\csname #1\endcsname}
+\providecommand*{\namebox}[1]{%
+ \csname #1\endcsname}
+
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\newnamecount}
+% \begin{macro}{\usenamecount}
+% Macros for creating and using `named' counts.
+% \begin{macrocode}
+\providecommand*{\newnamecount}[1]{%
+ \expandafter\newcount\csname #1\endcsname}
+\providecommand*{\usenamecount}[1]{%
+ \csname #1\endcsname}
+
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
% \section{Sectioning commands}
%
% \begin{macro}{\section@numR}
@@ -1510,7 +1572,7 @@
\gdef\eled@sectionsR@@{}%
\if@noeled@sec\else%
\makeatletter\InputIfFileExists{\jobname.eledsec\the\section@numR R}{}{}\makeatother%
- \immediate\openout\eled@sectioningR@out=\jobname.eledsec\the\section@numR R\relax%
+ \immediate\openout\eled@sectioningR@out=\l@auxdir\jobname.eledsec\the\section@numR R\relax%
\fi%
}
% \end{macrocode}
@@ -2518,7 +2580,7 @@
\iffirst@linenum@out@R
\immediate\closeout\linenum@outR
\global\first@linenum@out@Rfalse
- \immediate\openout\linenum@outR=#1
+ \immediate\openout\linenum@outR=\l@auxdir#1%
\immediate\write\linenum@outR{\string\line@list@version{\this@line@list@version}}%
\ifl@dpaging%
\immediate\write\linenum@outR{\string\@par@sync@option{\@par@this@sync@option}}%
@@ -2528,7 +2590,7 @@
\leavevmode%
\fi%
\closeout\linenum@outR%
- \openout\linenum@outR=#1%
+ \openout\linenum@outR=\l@auxdir#1%
\fi}
% \end{macrocode}
@@ -2653,17 +2715,17 @@
% \subsubsection{Notes to be printed on one side only}
% \Parpackage allows notes to be printed on one side only.
% We need to declare these options.
-% We also need boolean flags, and to set them to true when a note series is not printed on one side.
-% We check the \verb+nofamiliar+ and \verb+nocritical+ \Eledmac{} options.
+% We also need box to store temporary the footnote not printed.
+% We check the \verb+nofamiliar+ and \verb+nocritical+ \macpackage\ options.
% \changes{v1.16.0}{2015/05/18}{Fix bug with \protect\cs{onlysideX}.}
% \begin{macrocode}
\unless\ifnofamiliar@%
\csgdef{onlysideX@#1}{}%
- \global\newbool{keepforsideX@#1}%
+ \newnamebox{footins#1@kept}%
\fi%
\unless\ifnocritical@%
- \global\newbool{keepforXside@#1}%
\csgdef{Xonlyside@#1}{}%
+ \newnamebox{#1footins@kept}%
\fi%
% \end{macrocode}
% \subsection{Tools specific to familiar footnotes}
@@ -3417,8 +3479,8 @@
\set@Xtxtbeforenotes%
\global\@firstlineofpagefalse%
\fi%
- \add@inserts%
\insert@msdata%
+ \add@inserts%
\affixside@note%
}%
{\print@lineL}%
@@ -4190,6 +4252,8 @@
% \begin{macro}{\correct@footinsX@box}
% \changes{v1.13.1}{2015/03/12}{Correct \protect\cs{correct@footinsX@box} and \protect\cs{correct@Xfootins@box}}
% \changes{v1.13.1}{2015/03/12}{Call \protect\cs{correct@footinsX@box} and \protect\cs{correct@Xfootins@box} directly in \protect\cs{print@notesX@forpages} and \protect\cs{print@Xnotes@forpages}.}
+% \changes{v2.11.0}{2016/06/16}{New implementation of \protect\cs{Xonlyside} and \protect\cs{onlysideX} hooks, prevent trouble with vertical spacing.}
+% \changes{v2.11.0}{2016/06/16}{Clarification in the handbook about the use of \protect\cs{Xonlyside} and \protect{onlysideX} and error message if mesuse.}
% The \protect\cs{Xonlyside} and \protect\cs{onlysideX} hooks for \protect\cs{Pages}
% allow notes to be printed either in left or right pages only.
% The implementation of such features is delegated to \protect\cs{print@Xnotes@forpages},
@@ -4201,23 +4265,11 @@
% \item However, that is not enough. Because the problem does not only consists in printing notes in any particular page. It is also not to put aside room for notes in the pages where we do not want to print them.
% To take an example: if some note in the left side is too long by 160pt to be printed in full in the left page, we do not want to put aside 160pt a space for it in the following right page.
% \item To solve this problem, we change the magnification factor associated with notes before going to the next page.
-% If we start a page where no notes are supposed to be printed, the magnification counter is set to 0. We also set the note skip to 0pt. Before starting a new page where these notes are supposed to be printed, we reset these counter and skip to their default values. (About these counter and skip, read \thetexbook\ p.~122-125).
-% \item There still remains a last problem. This problem is quite complex to understand, so an example will speak for itself. Suppose we allow 10 lines of notes by page.
-% Suppose a long note, be it 25 lines, which needs three pages to be printed. Suppose it must be printed only on left pages, namely odd pages.
-%
-% On p.~2, the first 10 lines of the notes are printed.
-% On p.~3, the box associated to the notes contains 10 lines. However, as we are in a right page, we do not void this box. So \TeX\ will keep its content for the pages to come. However, on p.~4 it will also add one line in the footnote box, because in any case, \TeX adds some content in the box when preparing the output routines, even if there is some content left in this box from the previous pages.
-% So the lines in the note box at p.~4 will be $10+1=11$. There is one line which should not be there. Furthermore, as the box size is for 10~lines and not for 11~lines, this last line will be glued to the previous one.
-%
-% To fix this double issue:
-% \begin{itemize}
-% \item For the pages where notes must be NOT printed, we allow to every note box one line less than it ought to be.
-% In our example, that means that we allow \TeX\ to add only $10-1=9$ line in the note box on p.~3.
-% Before shifting to the pages where notes must be printed, we allow to every notes the expected number of lines. In our example, that means that we allow \TeX to add 10~lines in the note box on p.~4. As on p.~3 only 9 lines were allowed, that means note box of p.~4 will contain $9+1=10$ lines. So the ``one line too many'' problem is solved.
-% \item Still remains the ``glue'' problem. We solve it by recreating a clean note box. We split the one which is created by \TeX\ to get the next line printed. Then, we create the new box, by bringing together the first part and the last part of the split box, adding some skip between them. That is achieved by \protect\cs{correct@Xfootins@box} (or \protect\cs{correct@footinsX@box} for familiar notes).
-% \end{itemize}
+% If we start a page where no notes are supposed to be printed, the magnification counter is set to 0. The dimension associated to footnote is set to \cs{maxdimen}, and so we can keep all the notes we want, without any break inside We also set the note skip to 0pt. Before starting a new page where these notes are supposed to be printed, we reset these counter and skip to their default values. (About these counter, dimension and skip, read \thetexbook\ p.~122-125).
+% \item In the output macro of the page where notes must NOT be printed, we store the content of the footnote box produced by \TeX\ to a temporary box.
+% \item After going to the next page, before typesetting any thing in this page, we put the content of this temporary box the footnote insert box.
% \end{itemize}
-% The code to print critical notes, when processing \protect\cs{Pages}.
+% The code to print critical notes, when processing \protect\cs{Pages}, called in the output routine.
% \begin{macrocode}
\newcommand\print@Xnotes@forpages[1]{%
% \end{macrocode}
@@ -4238,77 +4290,39 @@
(test {\ifcsstring{Xonlyside@#1}{R}} and test{\ifnumodd{\c@page}}))%
}%
% \end{macrocode}
-% If we are in a page where notes must be printed, print the notes, after having made the corrections which are needed for boxes.
+% If we are in a page where notes must be printed, print the notes.
% \begin{macrocode}
{%
- \correct@Xfootins@box{#1}%
\csuse{#1footstart}{#1}%
\csuse{#1footgroup}{#1}%
% \end{macrocode}
-% Then, say not to keep room for notes in the next page.
+% Then, set to not to keep room for notes in the next page.
+% Also set to that, in the next page, notes are not to be split, using \cs{maxdimen}.
% \begin{macrocode}
- \global\count\csuse{#1footins}=0%
- \global\skip\csuse{#1footins}=0pt%
-% \end{macrocode}
-% And also, allow one line less for notes in the next page.
-% \begin{macrocode}
- \csuse{Xnotefontsize@#1}%
- \global\advance\dimen\csuse{#1footins} by -\baselineskip%
-% \end{macrocode}
-% Now we have printed the notes. So we put aside this fact.
-% \begin{macrocode}
- \global\boolfalse{keepforXside@#1}%
- }%
+ \global\count\csuse{#1footins}=\z@%
+ \global\skip\csuse{#1footins}=\z@%
+ \global\dimen\csuse{#1footins}=\maxdimen%
+ }%
% \end{macrocode}
% In case we are on a page where notes must NOT be printed.
-% First, memorize that we have not printed the notes, despite having some to print.
+% First restore expected rooms for notes on the next page. Also reset expected vertical size allowed to notes.
% \begin{macrocode}
{%
- \global\booltrue{keepforXside@#1}%
-% \end{macrocode}
-% Then restore expected rooms for notes on the next page.
-% \begin{macrocode}
\global\count\csuse{#1footins}=\csuse{default@#1footins}%
\global\skip\csuse{#1footins}=\csuse{Xbeforenotes@#1}%
-% \end{macrocode}
-% Last but not least, restore the normal line number allowed to notes for the following page.
-% \begin{macrocode}
\bgroup%
\csuse{Xnotefontsize@#1}%
- \global\advance\dimen\csuse{#1footins} by \baselineskip%
+ \global\dimen\csuse{#1footins}=\csuse{Xmaxhnotes@#1}%
\egroup%
% \end{macrocode}
+% Then, save the current insert box to a temporary insert box.
% \begin{macrocode}
-% End of \protect\cs{print@Xnotes@forpages}.
+ \global\setnamebox{#1footins@kept}=\box\namebox{#1footins}%
}%
- }%
-}%
-% \end{macrocode}
-% Now, \protect\cs{correct@Xfootins@box}, to fix problem of last line being glued to the previous one.
-% \begin{macrocode}
-\newcommand{\correct@Xfootins@box}[1]{%
% \end{macrocode}
-% We need to make correction only in case we have not printed any note in the previous page,
-% although there was to be ``normally'' printed.
-% \begin{macrocode}
- \ifbool{keepforXside@#1}{%
-% \end{macrocode}
-% Some setting needed to do the right splitting.
-% \begin{macrocode}
- \csuse{Xnotefontsize@#1}%
- \splittopskip=0pt%
-% \end{macrocode}
-% And now, split the last line, and push in the right place.
-% \begin{macrocode}
- \global\setbox\csuse{#1footins}=\vbox{%
- \vsplit\csuse{#1footins} to \dimexpr\ht\csuse{#1footins}-1pt\relax%
- \vskip \dimexpr-0.5\baselineskip-0.5\lineskip-0.5pt\relax%
- \unvbox\csuse{#1footins}%
- }%
-% \end{macrocode}
-% End of the macro.
+% End of \protect\cs{print@Xnotes@forpages}.
% \begin{macrocode}
- }{}%
+ }%
}%
% \end{macrocode}
% And now, the same for familiar footnotes.
@@ -4325,42 +4339,56 @@
(test {\ifcsstring{onlysideX@#1}{R}} and test{\ifnumodd{\c@page}}))%
}%
{%
- \correct@footinsX@box{#1}%
\csuse{footstart#1}{#1}%
\csuse{footgroup#1}{#1}%
- \global\count\csuse{footins#1}=0%
- \global\skip\csuse{footins#1}=0pt%
- \csuse{notefontsizeX@#1}%
- \global\advance\dimen\csuse{footins#1} by -\baselineskip%
- \global\boolfalse{keepforsideX@#1}%
+ \global\count\csuse{footins#1}=\z@%
+ \global\skip\csuse{footins#1}=\z@%
+ \global\dimen\csuse{footins#1}=\maxdimen%
+
}%
{%
- \global\booltrue{keepforsideX@#1}%
\global\count\csuse{footins#1}=\csuse{default@footins#1}%
\global\skip\csuse{footins#1}=\csuse{beforenotesX@#1}%
\bgroup%
- \csuse{notefontsizeX@#1}%
- \global\advance\dimen\csuse{footins#1} by \baselineskip%
- \egroup%
+ \csuse{Xnotefontsize@#1}%
+ \global\dimen\csuse{footins#1}=\csuse{maxhnotesX@#1}%
+ \egroup%
+ \global\setnamebox{footins#1@kept}=\box\namebox{footins#1}%
}%
}%
}%
-\newcommand{\correct@footinsX@box}[1]{%
- \ifbool{keepforsideX@#1}{%
- \csuse{notefontsizeX@#1}%
- \splittopskip=0pt%
- \global\setbox\csuse{footins#1}=\vbox{%
- \vsplit\csuse{footins#1} to \dimexpr\ht\csuse{footins#1}-1pt\relax%
- \vskip \dimexpr-0.5\baselineskip-0.5\lineskip-0.5pt\relax%
- \unvbox\csuse{footins#1}%
- }%
- }{}%
-}%
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
+% \begin{macro}{\insert@notes@for@onlyside}
+% \cs{insert@notes@for@onlyside} is everytime \cs{Pages} go to the next side.
+% It just reinsert the notes note printed on the previous side because of \protect{Xonlyside} or \cs{onlysideX} setting.
+% \begin{macrocode}
+\newcommand{\insert@notes@for@onlyside}{%
+ \def\do##1{%
+ \unless\ifnocritical@%
+ \ifvoid\csuse{##1footins@kept}\else%
+ \expandafter\insert\csname ##1footins\endcsname%
+ \bgroup%
+ \unvnamebox{##1footins@kept}%
+ \egroup%
+ \fi%
+ \fi%
+ \unless\ifnofamiliar@%
+ \ifvoid\csuse{footins##1@kept}\else%
+ \expandafter\insert\csname footins##1\endcsname%
+ \bgroup%
+ \unvnamebox{footins##1@kept}%
+ \egroup%
+ \fi%
+ \fi%
+ }%
+ \dolistloop{\@series}%
+}%
+% \end{macrocode}
+% \end{macro}
% \section{Cross referencing}
% \label{xref}
%
@@ -4651,52 +4679,6 @@
% \end{macrocode}
% \end{macro}
% \end{macro}
-% \section{Naming macros}
-%
-% The \LaTeX\ kernel provides \protect\cs{@namedef} and \protect\cs{@namuse} for defining
-% and using macros that may have non-letters in their names. We need
-% something similar here as we are going to need and use some numbered
-% boxes and counters.
-%
-% \begin{macro}{\newnamebox}
-% \begin{macro}{\setnamebox}
-% \begin{macro}{\unhnamebox}
-% \begin{macro}{\unvnamebox}
-% \begin{macro}{\namebox}
-% A set of macros for creating and using `named' boxes; the macros are called
-% after the regular box macros, but including the string `name'.
-% \begin{macrocode}
-\providecommand*{\newnamebox}[1]{%
- \expandafter\newbox\csname #1\endcsname}
-\providecommand*{\setnamebox}[1]{%
- \expandafter\setbox\csname #1\endcsname}
-\providecommand*{\unhnamebox}[1]{%
- \expandafter\unhbox\csname #1\endcsname}
-\providecommand*{\unvnamebox}[1]{%
- \expandafter\unvbox\csname #1\endcsname}
-\providecommand*{\namebox}[1]{%
- \csname #1\endcsname}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\newnamecount}
-% \begin{macro}{\usenamecount}
-% Macros for creating and using `named' counts.
-% \begin{macrocode}
-\providecommand*{\newnamecount}[1]{%
- \expandafter\newcount\csname #1\endcsname}
-\providecommand*{\usenamecount}[1]{%
- \csname #1\endcsname}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
% \section{Fixing babel and polyglossia}
%
% With parallel texts there is the possibility that the two sides
@@ -5816,10 +5798,10 @@
% E.g. if familiar or critical notes were disabled by \macpackage's options.
% \begin{macrocode}
\ifnocritical@%
- \global\newnamebox{##1footins}
+ \global\newnamebox{##1footins}%
\fi
\ifnofamiliar@%
- \global\newnamebox{footins##1}
+ \global\newnamebox{footins##1}%
\fi
% \end{macrocode}
% And now, add a \protect\cs{newpage} if there is no more footnote to print.
@@ -5898,6 +5880,7 @@
\newcommand*{\clearl@dleftpage}{%
\ifdim\pagetotal=0pt\hbox{}\fi%
\newpage%
+ \insert@notes@for@onlyside%
\ifodd\c@page\else
\led@err@LeftOnRightPage
\hbox{}%
@@ -5907,6 +5890,7 @@
\newcommand*{\clearl@drightpage}{%
\ifdim\pagetotal=0pt\hbox{}\fi%
\newpage%
+ \insert@notes@for@onlyside%
\ifodd\c@page
\led@err@RightOnLeftPage
\hbox{}%