diff options
author | Karl Berry <karl@freefriends.org> | 2016-06-11 23:16:49 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-06-11 23:16:49 +0000 |
commit | 611022b6b75a9f844b019178ff1f4b46228205c6 (patch) | |
tree | 00e206f54767b27dd11595c71081d79a71ae5c01 /Master/texmf-dist/source/latex/reledmac/reledmac.dtx | |
parent | ef0df012fe93429bbd3ddef76a731386764fb398 (diff) |
reledmac (3jun16)
git-svn-id: svn://tug.org/texlive/trunk@41380 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/reledmac/reledmac.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/reledmac/reledmac.dtx | 685 |
1 files changed, 617 insertions, 68 deletions
diff --git a/Master/texmf-dist/source/latex/reledmac/reledmac.dtx b/Master/texmf-dist/source/latex/reledmac/reledmac.dtx index 5231f29f8fb..94416d35700 100644 --- a/Master/texmf-dist/source/latex/reledmac/reledmac.dtx +++ b/Master/texmf-dist/source/latex/reledmac/reledmac.dtx @@ -39,6 +39,7 @@ \usepackage{xspace} \usepackage{doctools} \usepackage{graphicx,metalogo} +\usepackage{csquotes} % Index and Changelog in one column \makeatletter \renewenvironment{theglossary}{% @@ -395,8 +396,14 @@ % \changes{v2.9.2}{2016/04/30}{Fix bug with \protect\package{hyperref} package when a lemma starts with ``plus'' or ``minus'' (bug introduced in v.~2.7.0).} % \changes{v2.9.3}{2016/05/02}{Fix bug with line number position and reset added by v.~2.9.0} % \changes{v2.10.0}{2016/05/08}{Add \protect\cs{AtEveryStanza} and \protect\cs{AtEveryStopStanza}.} -% \changes{v2.10.0}{2016/05/08}{More accurate error messages.} -% \changes{v2.10.0}{2016/05/08}{Fix bug with \protect\cs{ledlsnotefontsetup} and \protect\cs{ledrsnotefontsetup} when using \protect\cs{color} command inside.} +% \changes{v2.10.0}{2016/05/08}{More specific error messages.} +% \changes{v2.10.0}{2016/05/08}{Fix bug in \protect\cs{ledlsnotefontsetup} and \protect\cs{ledrsnotefontsetup} which could not handle \protect\cs{color} command properly.} +% \changes{v2.10.1}{2016/05/18}{Add `nopenalties` option.} +% \changes{v2.10.1}{2016/05/18}{Fix bug introduced in v.~1.4: not paragraphed critical footnotes could prevent marginal line number from being displayed} +% \changes{v2.11.0}{2016/06/02}{Prevent \protect\cs{Xtxtbeforenotes} hook from causing notes to go beyond the bottom margin} +% \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} % \title{\Macpackage \\ % Typeset scholarly editions with \LaTeX\thanks{This file (\dtxfilename) % has version number \fileversion, last revised \filedate.}} @@ -675,11 +682,12 @@ % \begin{description} % \item[draft] underlines lemmas in the main text. % \item[eledmac-compat] help to migrate from \eledmac to \reledmac (see \reff{eledmac-compat}). -% \item[nopbinverse] prevents page breaks inside verses. -% \item[noquotation] by default, the quotation environment is redefined inside numbered text. You can disable this redefinition with \verb|noquotation| (see \reff{noquotation}). +% \item[nopenalties] must be called in some cases when using paragraphed endnotes (\reff{nopenalties)} +% \item[nopbinverse] prevents page break within verse environment. +% \item[noquotation] by default, the quotation environment is redefined within numbered text. You can disable this redefinition with \verb|noquotation| (see \reff{noquotation}). % \item[parapparatus] by default, the apparatus cannot contain paragraph breaks; this option enables paragraphing inside the apparatus. -% \item[xindy] and \verb|xindy+hyperref| are for selecting \verb+xindy+ as the index processor (\reff{xindy}). % \item[widthliketwocolumns] set the width of the text printed in a single column to be the same as the width of the text printed in two parallel columns with \parpackage. This is useful when alternating between normal and parallel typesetting. +% \item[xindy] and \verb|xindy+hyperref| select \verb+xindy+ as the index processor (\reff{xindy}). % \end{description} % % \subsection{Optimizing package performance}\label{option:performance} @@ -1480,6 +1488,66 @@ %} % \end{verbatim} % +% \subsection{Apparatus of Manuscripts} +% The critical notes mostly refer to textual variants between manuscripts which contain the text to be edited. +% It may so happen that the manuscripts only contain parts of the text. +% Depending on one's wishes, \macpackage\ can generate lists of relevant manuscripts for any delimited portion of text. +% Such lists are referred to as \enquote{apparatuses of manuscripts}. +% +% To produce an apparatus of manuscripts with \macpackage, you have to insert specific commands that are used to mark the sections for which only part of the manuscripts are relevant. +% These commands will be processed, and \textbf{after the second \TeX{} run}, corresponding apparatuses of manuscripts will be inserted in the first (viz. 'A' series) level of footnotes. +% +% As the insertion of this apparatus can change the page breaks, you may have to run \TeX{} two or more times. +% We strongly recommend to use tools like \emph{latexmk} to do that. +% +% \subsubsection{Marking sections of text} +% \DescribeMacro{\msdata} +% \cs{msdata}\marg{text} must be inserted at the point where a section for which only part of the manuscripts are relevant starts. +% \meta{text} can be any arbitrary text, viz. a list of the manuscripts that are used for the section that starts. +% The command must be attached right at the point where the section starts, with no space, like so: +% \begin{verbatim} +% \msdata{ABC}Lorem ipsum +% \end{verbatim} +% Which means that the section of text starting by \enquote{Lorem ipsum} is witnessed by manuscripts A, B and C. +% +% \DescribeMacro{\stopmsdata} +% \cs{stopmsdata} must be inserted at the point where the section of text previously marked by \cs{msdata} ends. +% The command must be attached right to the end of the section, with no space. +% As \cs{stopmsdata} is a \LaTeX\ argumentless macro, it will gobble the following space. +% To keep that space, you have to either append a backslash followed by a space or \verb+{}+ to \cs{stopmsdata}, like so: +% \begin{verbatim} +% \msdata{ABC}Lorem ipsum dolor +% […] +% amet\stopmsdata{} \msdata{ABCD}sic transit […] +% \end{verbatim} +% Which means that the part of text containing \enquote{Lorem ipsum dolor … amet} is witnessed by manuscripts A, B and C, while the part of text starting by \enquote{sic transit} is witnessed by manuscripts A, B, C and D. +% +% \cs{stopmsdata} is also automatically inserted by \cs{msdata}. +% +% Note that in most cases, any \cs{stopmsdata} is followed by \cs{msdata}. However, as these two command are usually separated by a space, it may happen that a line break be automatically inserted between them. +% This is why it is advised to always insert \cs{stopmsdata}, even if \cs{msdata} inserts it in case it is forgotten. +% +% \subsubsection{Layout of the apparatus of manuscripts} +% On every page, the apparatus of manuscripts marks the corresponding section with starting and ending line numbers. +% However, the following rules will be applied: +% \begin{itemize} +% \item If the section does not start on the current page, the starting line number will be the line number of the first line on the page. +% \item If the section does not stop on the current page, the ending line number will be the line number of the last line on the page. +% \item If the section neither starts nor ends on the current page, no line number will be printed. The same is true in case both \cs{msdata} is called at the very beginning of the page and \cs{endmsdata} is called at the very end of the page. +% \end{itemize} +% \subsubsection{Settings} +% As the apparatus of manuscripts technically consists of first-level critical notes ('A' series), any setting available for critical notes can be applied (\reff{displayoptions}). +% However, the following \emph{additional} commands are available. +% +% \DescribeMacro{\setmsdataseries} +% The series used by default for the apparatus of manuscripts is series A. +% However, you can change it with \cs{setmsdataseries}\marg{series}. +% +% \DescribeMacro{\setmsdatalabel} +% As the apparatus of manuscripts consists of regular critical footnotes, a lemma is associated to them. +% By default, it is \enquote{Ms.}. +% You can change it using \cs{setmsdatalabel}\marg{txt}. +% % \subsection{Familiar notes} \label{sec:desc:familiar} % % @@ -3330,7 +3398,7 @@ % % However, if with these options you still have such messages, here are some tricks. % \begin{description} -% \item['no room for a new count'] is often caused by a use in conjunction with \protect\package{biblatex}. +% \item['no room for a new count'] is often caused by \protect\package{biblatex} being used at the same time. % Load \macpackage (and \parpackage) \emph{before} \protect\package{biblatex}. % \item['no room for a new write'] can be caused by multiple indexes. % In this case, use \protect\package{indextools} of \protect\package{imakeidx} with the \verb+splitindex+ option, in order to obtain only one \verb+.idx+ file. @@ -3379,7 +3447,12 @@ % solutions, described by Michael Downes\index{Downes, Michael}, % but this area remains unsatisfactory. % +% \label{nopenalties}If you use more than one series of paragraphed notes, it may happen, in some particular cases, that only the footnote rule, with no accompanying footnotes, be printed. +% In this case use \reledmac\ package option \option{nopenalties} +% which should solve the problem, but also may produce widow or orphan lines. +% For the time being, we have no solution of this problem. % +% % % \DescribeMacro{\footfudgefiddle} % For paragraphed footnotes \TeX{} has to estimate the amount of space @@ -3548,7 +3621,7 @@ % \begin{macrocode} %<*code> \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{reledmac}[2016/05/08 v2.10.0 typeset critical editions]% +\ProvidesPackage{reledmac}[2016/06/03 v2.11.0a typeset critical editions]% % \end{macrocode} % % \subsection{Package options} @@ -3643,6 +3716,9 @@ \DeclareOptionX{eledmac-compat}{% \eledmaccompat@true% }% +\DeclareOptionX{nopenalties}{% + \AtBeginDocument{\let\add@penalties\relax}% +} % \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 @@ -3735,6 +3811,14 @@ \ifdef{\if@RTL}{}{\newif\if@RTL} % \end{macrocode} % \end{macro} +% \begin{macro}{\if@firstlineofpage} +% \cs{if@firstlineofpage} is set to TRUE at the first line of every page. +% \cs{if@firstlineofpageR} is for the right side. +% \begin{macrocode} +\newif\if@firstlineofpage% +\newif\if@firstlineofpageR% +% \end{macrocode} +% \end{macro} % \subsection{Messages} % % All the messages are grouped here as macros. This saves \TeX's memory @@ -4091,6 +4175,13 @@ }% % \end{macrocode} % \end{macro} +% \begin{macro}{\led@warning@msdatawithoutstop} +% \begin{macrocode} +\newcommand{\led@warning@msdatawithoutstop}{% + \reledmac@warning{\string\msdata\space without corresponding \string\stopmsdata}% +}% +% \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} @@ -4344,6 +4435,7 @@ \global\let\sub@change=\relax \resetprevline@ \resetprevpage@num + \global\stopmsdata@inserted@true% } % \end{macrocode} @@ -5250,7 +5342,18 @@ % \begin{macro}{\resetprevpage@} % \begin{macrocode} \newcommand*{\resetprevpage@num}{% - \def\do##1{\ifcsdef{prevpage##1@num}{\global\csname prevpage##1@num\endcsname=0}{}}% + \def\do##1{% + \ifcsdef{prevpage##1@num}{% + \global\csname prevpage##1@num\endcsname=\z@% + \global\csname prevpage##1@numR\endcsname=\z@% + }% + {}% + \ifcsdef{##1prevpage@num}{% + \global\csname ##1prevpage@num\endcsname=\z@% + \global\csname ##1prevpage@numR\endcsname=\z@% + }% + {}% + }% \dolistloop{\@series}% } % \end{macrocode} @@ -5317,6 +5420,14 @@ \global\page@num=\page@num\relax \global\last@page@num=\last@page@num\relax \fi + \@stopmsd%Security if last \endms{} is forgotten + \unless\ifledRcol%Get the last line of the last page + \csnumgdef{@lastabsline@forpage@\the\page@num}{\the\absline@num}% + \csnumgdef{@lastline@forpage@\the\page@num}{\the\line@num}% + \else% + \csnumgdef{@lastabsline@forpageR@\the\page@numR}{\the\absline@numR}% + \csnumgdef{@lastline@forpageR@\the\page@numR}{\the\line@numR}% + \fi% \endgroup % \end{macrocode} % @@ -5554,6 +5665,8 @@ \ifledRcol \ifnum #1=\last@page@numR \else + \csnumgdef{@lastabsline@forpageR@\the\page@numR}{\the\absline@numR}% + \csnumgdef{@lastline@forpageR@\the\page@numR}{\the\line@numR}% \ifbypage@R \line@numR \z@ \subline@numR \z@ \fi @@ -5564,6 +5677,8 @@ \else \ifnum #1=\last@page@num \else + \csnumgdef{@lastabsline@forpage@\the\page@num}{\the\absline@num}% + \csnumgdef{@lastline@forpage@\the\page@num}{\the\line@num}% \ifbypage@ \line@num \z@ \subline@num \z@ \fi @@ -6174,7 +6289,7 @@ \IfStrEq{\led@pb@setting}{after}% {\xifinlist{\the\absline@num}{\l@prev@nopb}% {\xifinlist{\the\absline@num}{\normal@page@break}% - {\numgdef{\@next@page}{\c@page+1}% + {\numgdef{\@next@page}{\c@page+\@ne}% \write\linenum@out{\string\@nl[\@next@page][\@next@page]}% }% {\write\linenum@out{\string\@nl[\the\c@page][\thepage]}}% @@ -6182,10 +6297,10 @@ {\write\linenum@out{\string\@nl[\the\c@page][\thepage]}}}% {}% \IfStrEq{\led@pb@setting}{before}% - {\numdef{\next@absline}{\the\absline@num+1}% + {\numdef{\next@absline}{\the\absline@num+\@ne}% \xifinlist{\next@absline}{\l@prev@nopb}% {\xifinlist{\the\absline@num}{\normal@page@break}% - {\numgdef{\nc@page}{\c@page+1}% + {\numgdef{\nc@page}{\c@page+\@ne}% \write\linenum@out{\string\@nl[\nc@page][\nc@page]}% }% {\write\linenum@out{\string\@nl[\the\c@page][\thepage]}}% @@ -6643,7 +6758,7 @@ % \begin{macrocode} \ifnumberedpar@% % \end{macrocode} -% We increase the \cs{@edtext@level} \TeX\ counter to know in which level of \protect\cs{edtext} we are. +% we increment the \cs{@edtext@level} \TeX\ counter to know in which level of \protect\cs{edtext} we are. % \begin{macrocode} \global\advance\@edtext@level by 1% % \end{macrocode} @@ -7057,7 +7172,7 @@ % Now, the real code. First, increment the counter corresponding to the argument. % \begin{macrocode} \unless\ifledRcol% - \csnumgdef{sw@\sw@txt}{\csuse{sw@\sw@txt}+1}% + \csnumgdef{sw@\sw@txt}{\csuse{sw@\sw@txt}+\@ne}% % \end{macrocode} % Then, write its value to the numbered file. % \begin{macrocode} @@ -7066,7 +7181,7 @@ % Do the same thing if we are in the right columns. % \begin{macrocode} \else% - \csnumgdef{sw@\sw@txt}{\csuse{sw@\sw@txt}+1}% + \csnumgdef{sw@\sw@txt}{\csuse{sw@\sw@txt}+\@ne}% \protected@write\linenum@outR{}{\string\@sw{\sw@txt}{\csuse{sw@\sw@txt}}{#1}}% \fi% % \end{macrocode} @@ -7380,7 +7495,7 @@ % \begin{macrocode} \csnumdef{pstartline}{0}% \loop\ifvbox\raw@text% - \csnumdef{pstartline}{\pstartline+1}% + \csnumdef{pstartline}{\pstartline+\@ne}% \do@line% \ifbypstart@% \ifnumequal{\pstartline}{1}{% @@ -7593,11 +7708,22 @@ % \end{macrocode} % User hook. % \begin{macrocode} - \do@insidelinehook% + \do@insidelinehook% % \end{macrocode} % Left line number % \begin{macrocode} - \l@dld@ta% + \l@dld@ta% +% \end{macrocode} +% Prepare text to be inserted before notes. +% \begin{macrocode} + \if@firstlineofpage% + \set@Xtxtbeforenotes% + \global\@firstlineofpagefalse% + \fi% +% \end{macrocode} +% Insert footnotes made of manuscripts data. +% \begin{macrocode} + \insert@msdata% % \end{macrocode} % Restore marginal and footnotes. % \begin{macrocode} @@ -7619,7 +7745,7 @@ % \end{macrocode} % Insert, if needed, the hanging symbol. % \begin{macrocode} - \inserthangingsymbol %Space keept for backward compatibility + \inserthangingsymbol% % \end{macrocode} % And so, print the line. % \begin{macrocode} @@ -7647,6 +7773,11 @@ % Because of how this prints, a vertical spacing correction is added. % \begin{macrocode} \def\print@eledsection{% + \if@firstlineofpage% + \set@Xtxtbeforenotes% + \global\@firstlineofpagefalse% + \fi% + \insert@msdata% \add@inserts\affixside@note% \numdef{\temp@}{\l@dnumpstartsL-1}% \xifinlist{\temp@}{\eled@sections@@}{\@nobreaktrue}{\@nobreakfalse}% @@ -7840,10 +7971,12 @@ % \begin{macrocode} \ifnum\next@action>-1001 \global\page@num=\next@action + \global\@firstlineofpagetrue% \ifbypage@ \global\line@num=\z@ \global\subline@num=\z@ \resetprevline@ \fi + \add@msdata@firstlineofpage% % \end{macrocode} % % Next, we handle @@ -7904,35 +8037,38 @@ % This macro handles the fixed codes for \protect\cs{do@actions}. It is % one big case statement. % \changes{v0.7.0}{2005/02/24}{Added \protect\cs{do@actions@fixedcode}} +% \changes{v2.11.0}{2016/06/02}{Add action 1010} % \begin{macrocode} \newcommand*{\do@actions@fixedcode}{% \ifcase\@l@dtempcnta - \or% % 1001 + \or% % 1001 = starting sublineation \global\sublines@true - \or% % 1002 + \or% % 1002 = ending sublineation \global\sublines@false - \or% % 1003 + \or% % 1003 = starting locking number \global\@lock=\@ne - \or% % 1004 + \or% % 1004 = ending locking number \ifnum\@lock=\tw@ \global\@lock=\thr@@ \else \global\@lock=\z@ \fi - \or% % 1005 + \or% % 1005 = starting locking subnumber \global\sub@lock=\@ne - \or% % 1006 + \or% % 1006 = ending locking subnumber \ifnum\sub@lock=\tw@ \global\sub@lock=\thr@@ \else \global\sub@lock=\z@ \fi - \or% % 1007 + \or% % 1007 = skipping numbering \l@dskipnumbertrue - \or% % 1008 + \or% % 1008 = skipping numbering in stanza \l@dskipversenumbertrue% - \or% % 1009 + \or% % 1009 = hiding number \l@dhidenumbertrue + \or% % 1010 = inserting msdata + \add@msdata% \else \led@warn@BadAction \fi} @@ -8420,7 +8556,42 @@ % \end{macrocode} % \end{macro} -% +% \subsection{Text before notes} +% \begin{macro}{\set@Xtxtbeforenotes} +% The \cs{set@Xtxtbeforenotes} macro resets the Xtxtbeforesnotes@\meta{series}@typeset boolean to false. Just before the first note of the \meta{series} in a page, the Xtextbeforenotes will be inserted. +% \begin{macrocode} +\newcommand{\set@Xtxtbeforenotes}{% + \unless\ifnocritical@% + \def\do##1{% + \global\togglefalse{Xtxtbeforesnotes@##1@typeset}% + }% + \dolistloop{\@series}% + \fi% +}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\insert@Xtxtbeforenotes} +% \cs{insert@Xtxtbeforenotes}\marg{series}, called when inserting a note, will insert the text before the note if it is not already inserted. +% For paragraphed footnotes, it will insert it as a component of the first footnote. +% For other types of footnotes, it will insert it as a regular footnote. +% \begin{macrocode} +\newcommand{\insert@Xtxtbeforenotes}[1]{% + \nottoggle{Xtxtbeforesnotes@#1@typeset}{% + \global\toggletrue{Xtxtbeforesnotes@#1@typeset}% + \ifcsvoid{Xtxtbeforenotes@#1}{}{% + \ifcsstring{series@display#1}{paragraph}% + {\noindent\csuse{Xtxtbeforenotes@#1}}% + {\expandafter\insert\csname#1footins\endcsname% + \bgroup% + \noindent\strut\csuse{Xnotefontsize@#1}\csuse{Xtxtbeforenotes@#1}% + \egroup% + }% + }% + }% + {}% +}% +% \end{macrocode} +% \end{macro} % \section{Critical footnotes} % \label{footnotes} % @@ -8691,6 +8862,7 @@ % this note series to format the text of the note. % \begin{macrocode} \notbool{parapparatus@}{\newcommand*}{\newcommand}{\normalvfootnote}[2]{% + \insert@Xtxtbeforenotes{#1}% \csuse{Xbeforeinserting@#1}% \insert\csname #1footins\endcsname\bgroup \hsize=\expandafter\dimexpr\csuse{Xwidth@#1}\relax% @@ -8712,6 +8884,7 @@ % \begin{macrocode} \notbool{parapparatus@}{\newcommand*}{\newcommand}{\mpnormalvfootnote}[2]{% \global\setbox\@nameuse{mp#1footins}\vbox{% + \insert@Xtxtbeforenotes{#1}% \unvbox\@nameuse{mp#1footins} \noindent\csuse{Xbhooknote@#1}% \csuse{Xnotefontsize@#1}% @@ -8792,7 +8965,7 @@ \iftoggle{preXnotes@}{% \togglefalse{preXnotes@}% \skip\csname #1footins\endcsname=% - \dimexpr\csuse{preXnotes@}+\csuse{Xafterrule@#1}\relax% + \glueexpr\csuse{preXnotes@}+\csuse{Xafterrule@#1}\relax% }% {}% }% @@ -8812,7 +8985,7 @@ % And now, print the footnote's rule to finish the footnote's introduction. % \begin{macrocode} \print@Xfootnoterule{#1}% - \noindent\leavevmode} +}% % \end{macrocode} % \end{macro} % @@ -8824,7 +8997,6 @@ % alteration. % \begin{macrocode} \newcommand*{\normalfootgroup}[1]{% - {\csuse{Xnotefontsize@#1}\noindent\csuse{Xtxtbeforenotes@#1}}% \csuse{Xbhookgroup@#1}% \unvbox\csname #1footins\endcsname% \hsize=\old@hsize% @@ -8859,7 +9031,6 @@ \print@Xfootnoterule{#1}%% \fi% \setlength{\parindent}{0pt} - {\csuse{Xnotefontsize@#1}\csuse{Xtxtbeforenotes@#1}} \csuse{Xbhookgroup@#1}% \unvbox\csname mp#1footins\endcsname}} \fi @@ -8892,6 +9063,7 @@ \newcommand*{\Xarrangement@paragraph}[1]{% \csgdef{series@display#1}{paragraph} \expandafter\newcount\csname #1prevpage@num\endcsname + \expandafter\newcount\csname #1prevpage@numR\endcsname% \expandafter\let\csname #1footstart\endcsname=\parafootstart \expandafter\let\csname v#1footnote\endcsname=\paravfootnote \expandafter\let\csname #1footfmt\endcsname=\parafootfmt @@ -8974,7 +9146,7 @@ \iftoggle{preXnotes@}{% \togglefalse{preXnotes@}% \skip\csname #1footins\endcsname=% - \dimexpr\csuse{preXnotes@}+\csuse{Xafterrule@#1}\relax% + \glueexpr\csuse{preXnotes@}+\csuse{Xafterrule@#1}\relax% }% {}% }% @@ -9077,6 +9249,7 @@ \footsplitskips \setbox0=\vbox{\hsize=\maxdimen% \let\bidi@RTL@everypar\@empty% + \insert@Xtxtbeforenotes{#1}% \noindent\csuse{Xbhooknote@#1}% \csname #1footfmt\endcsname #2{#1}}% \setbox0=\hbox{\Xunvxh{0}{#1}}% @@ -9118,6 +9291,7 @@ \footsplitskips \setbox0=\vbox{\hsize=\maxdimen% \let\bidi@RTL@everypar\@empty% + \insert@Xtxtbeforenotes{#1}% \noindent\color@begingroup% \csuse{Xbhooknote@#1}% \csname #1footfmt\endcsname #2{#1}\color@endgroup}% @@ -9184,7 +9358,7 @@ % \thetexbook, p.\,399. The only difference is the \protect\cs{unpenalty} % in \protect\cs{makehboxofhboxes}, which is there to remove the penalty of % $0$ which was added to the end of each footnote by -% \protect\cs{para@vfootnote}. +% \protect\cs{paravfootnote}. % % The call to \protect\cs{Xnotefontsize@\meta{s}} is to ensure that the correct % \protect\cs{baselineskip} for the footnotes is used. The argument is the @@ -9196,7 +9370,7 @@ \ifcsstring{Xragged@#1}{L}{\RaggedLeft}{}% \ifcsstring{Xragged@#1}{R}{\RaggedRight}{}% \makehboxofhboxes - \setbox0=\hbox{{\csuse{Xnotefontsize@#1}\csuse{Xtxtbeforenotes@#1}}\unhbox0 \removehboxes}% + \setbox0=\hbox{\unhbox0 \removehboxes}% \csuse{Xbhookgroup@#1}% \csuse{Xnotefontsize@#1}% \unhbox0\par% @@ -9233,7 +9407,7 @@ \ifcsstring{Xragged@#1}{L}{\RaggedLeft}{}% \ifcsstring{Xragged@#1}{R}{\RaggedRight}{}% \makehboxofhboxes - \setbox0=\hbox{{\csuse{Xnotefontsize@#1}\csuse{Xtxtbeforenotes@#1}}\unhbox0 \removehboxes}% + \setbox0=\hbox{\unhbox0 \removehboxes}% \csuse{Xbhookgroup@#1}% \csuse{Xnotefontsize@#1}% \nottoggle{Xparindent@#1}{\parindent=\z@}{}% @@ -9270,16 +9444,29 @@ % \begin{macro}{\Xinsertparafootsep} % \begin{macrocode} \newcommand{\Xinsertparafootsep}[1]{% - \ifnumequal{\csuse{#1prevpage@num}}{\page@num}% - {\ifcsdef{prevline#1}% Be sur \prevline#1 exists. - {\ifnumequal{\csuse{prevline#1}}{\line@num}% - {\ifcsempty{Xsymlinenum@#1}{\csuse{Xparafootsep@#1}}{}}% - {\csuse{Xparafootsep@#1}}% - }% - {\csuse{Xparafootsep@#1}}% - }% - {}% - \global\csname #1prevpage@num\endcsname=\page@num% + \ifledRcol@% + \ifnumequal{\csuse{#1prevpage@numR}}{\page@numR}% + {\ifcsdef{prevline#1}% Be sur \prevline#1 exists. + {\ifnumequal{\csuse{prevline#1}}{\line@numR}% + {\ifcsempty{Xsymlinenum@#1}{\csuse{Xparafootsep@#1}}{}}% + {\csuse{Xparafootsep@#1}}% + }% + {\csuse{Xparafootsep@#1}}% + }% + {}% + \global\csname #1prevpage@numR\endcsname=\page@numR% + \else% + \ifnumequal{\csuse{#1prevpage@num}}{\page@num}% + {\ifcsdef{prevline#1}% Be sur \prevline#1 exists. + {\ifnumequal{\csuse{prevline#1}}{\line@num}% + {\ifcsempty{Xsymlinenum@#1}{\csuse{Xparafootsep@#1}}{}}% + {\csuse{Xparafootsep@#1}}% + }% + {\csuse{Xparafootsep@#1}}% + }% + {}% + \global\csname #1prevpage@num\endcsname=\page@num% + \fi% } % \end{macrocode} % \end{macro} @@ -9481,8 +9668,7 @@ % box. Here, we just print the \protect\cs{line} which comes out of % \protect\cs{rigidbalance} directly, without any re-boxing. % \begin{macrocode} -\newcommand*{\threecolfootgroup}[1]{{\csuse{Xnotefontsize@#1}% - \noindent\csuse{Xtxtbeforenotes@#1}}% +\newcommand*{\threecolfootgroup}[1]{% \csuse{Xbhookgroup@#1}\par% \splittopskip=\ht\strutbox \expandafter @@ -9512,7 +9698,6 @@ \setXnotespositionliketwocolumns@{#1}% \print@Xfootnoterule{#1}% \fi% - {\csuse{Xnotefontsize@#1}\noindent\csuse{Xtxtbeforenotes@#1}}% \csuse{Xbhookgroup@#1}\par% \splittopskip=\ht\strutbox \expandafter @@ -9594,8 +9779,7 @@ \strut\par\allowbreak} % \end{macrocode} % \begin{macrocode} -\newcommand*{\twocolfootgroup}[1]{{\csuse{Xnotefontsize@#1} - \noindent\csuse{Xtxtbeforenotes@#1}}% +\newcommand*{\twocolfootgroup}[1]{% \csuse{Xbhookgroup@#1}\par% \splittopskip=\ht\strutbox \expandafter @@ -9635,7 +9819,6 @@ \setXnotespositionliketwocolumns@{#1}% \print@Xfootnoterule{#1}% \fi% - {\csuse{Xnotefontsize@#1}\noindent\csuse{Xtxtbeforenotes@#1}}% \csuse{Xbhookgroup@#1}\par% \splittopskip=\ht\strutbox \expandafter @@ -10574,7 +10757,7 @@ \iftoggle{prenotesX@}{% \togglefalse{prenotesX@}% \skip\csname footins#1\endcsname=% - \dimexpr\csuse{prenotesX@}+\csuse{afterruleX@#1}\relax% + \glueexpr\csuse{prenotesX@}+\csuse{afterruleX@#1}\relax% }% {}% }% @@ -10753,7 +10936,8 @@ \newcommand*{\arrangementX@normal}[1]{% \csgdef{series@displayX#1}{normal} \expandafter\let\csname footstart#1\endcsname=\normalfootstartX - \expandafter\newcount\csname prevpage#1@num\endcsname + \expandafter\newcount\csname prevpage#1@num\endcsname% + \expandafter\newcount\csname prevpage#1@numR\endcsname% \@namedef{@footnotemark#1}{\normal@footnotemarkX{#1}} \@namedef{bodyfootmark#1}{\normalbodyfootmarkX{#1}} \expandafter\let\csname regvfootnote#1\endcsname=\normalvfootnoteX @@ -11038,7 +11222,8 @@ % \begin{macrocode} \newcommand*{\arrangementX@paragraph}[1]{% \csgdef{series@displayX#1}{paragraph}% - \expandafter\newcount\csname #1prevpage@num\endcsname + \expandafter\newcount\csname prevpage#1@num\endcsname% + \expandafter\newcount\csname prevpage#1@numR\endcsname% \expandafter\let\csname footstart#1\endcsname=\parafootstartX \expandafter\let\csname regvfootnote#1\endcsname=\para@vfootnoteX \expandafter\let\csname footfmt#1\endcsname=\parafootfmtX @@ -11092,7 +11277,7 @@ \iftoggle{prenotesX@}{% \togglefalse{prenotesX@}% \skip\csname footins#1\endcsname=% - \dimexpr\csuse{prenotesX@}+\csuse{afterruleX@#1}\relax% + \glueexpr\csuse{prenotesX@}+\csuse{afterruleX@#1}\relax% }% {}% }% @@ -11234,17 +11419,23 @@ % \end{macro} % \paragraph{Insertion of the footnotes separator} % The command \protect\cs{insertparafootsepX}\marg{series} must be called at the beginning of \protect\cs{parafootftmX}. -% \begin{macro}{\prevpage@num} -% \begin{macro}{\Xinsertparafootsep} +% \begin{macro}{\insertparafootsepX} % \begin{macrocode} \newcommand{\insertparafootsepX}[1]{% - \ifnumequal{\csuse{prevpage#1@num}}{\page@num}% - {\csuse{parafootsepX@#1}}% - {}% + \ifledRcol@% + \ifnumequal{\csuse{prevpage#1@numR}}{\page@numR}% + {\csuse{Xparafootsep@#1}}% + {}% + \global\csname prevpage#1@numR\endcsname=\page@numR% + \else% + \ifnumequal{\csuse{prevpage#1@num}}{\page@num}% + {\csuse{Xparafootsep@#1}}% + {}% + \global\csname prevpage#1@num\endcsname=\page@num% + \fi% } % \end{macrocode} % \end{macro} -% \end{macro} % \subsection{Wrapping footnote marks in hyperlink} % \begin{macro}{\wrapped@footfootmarkX} % \cs{wrapped@footfootmarkX} prints the footnote mark of the footpage, wrapped in \package{hyperref} package's commands, if needed. @@ -12083,7 +12274,10 @@ \csgdef{Xinplaceoflemmaseparator@#1}{1em}% \csgdef{Xbeforenotes@#1}{1.2em \@plus .6em \@minus .6em} \csgdef{Xafterrule@#1}{0pt} + \csgdef{Xtxtbeforenotes@#1}{} + \newtoggle{Xtxtbeforesnotes@#1@typeset}%Not directly used by user, but internal + \csgdef{Xmaxhnotes@#1}{0.8\vsize} \newtoggle{Xnoteswidthliketwocolumns@#1}% \csgdef{Xparafootsep@#1}{}% @@ -12891,7 +13085,7 @@ % Now we begin the output routine and associated things. % % -% \subsubsection{Page number management} +% \subsection{Page number management} % \begin{macro}{\pageno} % \begin{macro}{\advancepageno} % \protect\cs{pageno} is a page number, starting at 1, and \protect\cs{advancepageno} @@ -12906,7 +13100,7 @@ % \end{macro} % % -% \subsubsection{Extra footnotes output} +% \subsection{Extra footnotes output} % % With luck we might only have to change \protect\cs{@makecol} and % \protect\cs{@reinserts} of the \LaTeX's kernel. @@ -13070,7 +13264,7 @@ % \end{macro} % \end{macro} % -% \subsubsection{Standard output's commands patching} +% \subsection{Patching standard output of 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 @@ -14268,7 +14462,7 @@ \ledlsnotefontsetup%We kept it outside of the vbox, because can affect the ragging \global\setbox\l@dlp@rbox% \ifleftnoteup% - =\vbox to\z@{{\ledlsnotefontsetup\vss #1}}%We put \ledlsnotefontsetup inside footnote because required for color command. Note the {} to kept setting local. + =\vbox to\z@{{\ledlsnotefontsetup\vss #1}}%We put \ledlsnotefontsetup inside footnote because required for color command. Note the {} to keep setting local. \else% =\vbox to 0.70\baselineskip{{\ledlsnotefontsetup\strut#1\vss}}% \fi% @@ -14281,7 +14475,7 @@ \ledrsnotefontsetup%We kept it outside of the vbox, because can affect the ragging \global\setbox\l@drp@rbox% \ifrightnoteup% - =\vbox to\z@{{\ledrsnotefontsetup\vss#1}}%We put \ledrsnotefontsetup inside footnote because required for color command. Note the {} to kept setting local. + =\vbox to\z@{{\ledrsnotefontsetup\vss#1}}%We put \ledrsnotefontsetup inside footnote because required for color command. Note the {} to keep setting local. \else% =\vbox to0.7\baselineskip{{\ledrsnotefontsetup\strut#1\vss}}% \fi% @@ -14318,7 +14512,7 @@ \appto\sidenotecontent@{##1}}% Not print not separator before the 1st note {\appto\sidenotecontent@{\@sidenotesep ##1}% }% - \numgdef{\itemcount@}{\itemcount@+1}% + \numgdef{\itemcount@}{\itemcount@+\@ne}% }% \dolistloop{\l@dcsnotetext}% \ifnumgreater{\itemcount@}{1}{\led@err@ManySidenotes}{}% @@ -15526,7 +15720,362 @@ % % % +% \section{Apparatus of Manuscripts} +% \subsection{User level macro} +% \begin{macro}{\msdata} +% The user level \cs{msdata} command only writes the manuscripts data in numbered auxiliary file. +% \begin{macrocode} +\newcommand{\msdata}[1]{% + \leavevmode% + \unless\ifstopmsdata@inserted@% + \stopmsdata% + \led@warning@msdatawithoutstop% + \fi% + \global\stopmsdata@inserted@false% + \unless\ifledRcol% + \protected@write\linenum@out{}{% + \string\@msd{#1}% + }% + \else% + \protected@write\linenum@outR{}{% + \string\@msd{#1}% + }% + \fi% +}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\stopmsdata} +% The user level \cs{stopmsdata} command only writes information about the end of manuscripts data in numbered auxiliary file. +% \begin{macrocode} +\newcommand{\stopmsdata}[0]{% + \leavevmode% + \unless\ifledRcol% + \protected@write\linenum@out{}{% + \string\@stopmsd% + }% + \else% + \protected@write\linenum@outR{}{% + \string\@stopmsd% + }% + \fi% + \global\stopmsdata@inserted@true% +}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\ifstopmsdata@inserted@} +% The \cs{ifstopmsdata@inserted@} boolean is set to TRUE at every \cs{stopmsdata} and reset to FALSE at all \cs{msdata}. It also set to TRUE at every \cs{beginnumbering}. +% It is used to automatically insert \cs{stopmsdata} if forgotten before \cs{msdata} +% \begin{macrocode} +\newif\ifstopmsdata@inserted@% +% \end{macrocode} +% \end{macro} +% \subsection{Setting macro} +% Setting macros for the manuscripts apparatus tools is very easy: they just save their argument in an internal macro. +% \begin{macro}{\setmsdataseries} +% In which series of notes will be printed the apparatus of manuscripts? +% \begin{macrocode} +\newcommand{\setmsdataseries}[1]{% + \gdef\@msdata@series{#1}% +}% +\def\@msdata@series{A}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\setmsdatalabel} +% The label for the manuscripts data. +% \begin{macrocode} +\def\ms@data@label{Ms.}% +\newcommand{\setmsdatalabel}[1]{% + \gdef\ms@data@label{#1}% +}% +% \end{macrocode} +% \end{macro} +% \subsection{Counters and lists} +% \begin{macro}{\@msd@c} +% \cs{@msd@c} is a counter incremented at each \cs{@msd} read in auxiliary file. +% \begin{macrocode} +\numdef{\@msd@c}{0} +\numdef{\@msd@cR}{0} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\@msd@c} +% \cs{add@msd@} is a counter incremented at each \cs{add@msddata}, that is at each time we prepare the insertion of manuscripts data footnote. +% \begin{macrocode} +\numdef{\add@msd@c}{0}% +\numdef{\add@msd@cR}{0}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\@msdata@list} +% The \cs{@msdata@list} will contain, for each line, the lists of command to be executed to insert the manuscripts apparatus. +% It will be filled on \cs{add@msdata} and looped on \cs{insert@msdata}, then emptied. +% \begin{macrocode} +\def\@msdata@list{}% +% \end{macrocode} +% \end{macro} +% \subsection{Auxiliary file macros} +% \begin{macro}{\@msd} +% The \cs{@msd} macro is written in the auxiliary file. +% It just defines three macros by \cs{msdata} macro, which allow us to know the manuscripts data, the line number and the absolute line number where it was called % +% It also stores the action code $1010$ in the list of actions by line. +% \begin{macrocode} +\newcommand{\@msd}[1]{% + \unless\ifledRcol% + \numdef{\@msd@c}{\@msd@c+\@ne}% + \csgdef{@msdata@\@msd@c @data}{#1}% + \csxdef{@msdata@\@msd@c @linenumber}{\the\line@num}% + \csxdef{@msdata@\@msd@c @abslinenumber}{\the\absline@num}% + \xright@appenditem{\the\absline@num}\to\actionlines@list% + \xright@appenditem{-1010}\to\actions@list% + \else% + \numdef{\@msd@cR}{\@msd@cR+\@ne}% + \csgdef{@msdata@\@msd@cR @dataR}{#1}% + \csxdef{@msdata@\@msd@cR @linenumberR}{\the\line@numR}% + \csxdef{@msdata@\@msd@cR @abslinenumberR}{\the\absline@numR}% + \xright@appenditem{\the\absline@numR}\to\actionlines@listR% + \xright@appenditem{-1010}\to\actions@listR% + \fi% +}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\@endmsd} +% Inserted in the auxiliary file by \cs{stopmsd}, the \cs{@stopmsd} macro will store in two commands the line number and the absolute line number on which it is called. +% \begin{macrocode} +\newcommand{\@stopmsd}[0]{% + \unless\ifledRcol% + \ifcsundef{@msdata@\@msd@c @stoplinenumber}{% + \csxdef{@msdata@\@msd@c @stopabslinenumber}{\the\absline@num}% + \csxdef{@msdata@\@msd@c @stoplinenumber}{\the\line@num}% + }{}% + \else% + \ifcsundef{@msdata@\@msd@cR @stoplinenumberR}{% + \csxdef{@msdata@\@msd@cR @stopabslinenumberR}{\the\absline@numR}% + \csxdef{@msdata@\@msd@cR @stoplinenumberR}{\the\line@numR}% + }% + {}% + \fi% +}% +% \end{macrocode} +% \end{macro} +% \subsection{Action macro} +% \begin{macro}{\add@msdata} +% \cs{add@msdata} is executed on each line when action code $1010$ is seen. +% It will not insert immediately the manuscript data footnote, as action code are executed before the line be typeset, and, consequently, could be on the previous page. +% So it just store the manuscript data footnote to \cs{@msdata@list}. +% \begin{macrocode} +\newcommand{\add@msdata}{% + \bgroup% + \normalfont% + \unless\ifledRcol@% + \numgdef{\add@msd@c}{\add@msd@c+\@ne}% + \ifcsdef{@msdata@\add@msd@c @data}{% + \letcs{\@data}{@msdata@\add@msd@c @data}% + \edef\l@d@nums{% + 000|% Start page = we don't print it + \csuse{@msdata@\add@msd@c @linenumber}|% Start line number + 000|% Start subline number, for now, not used + 000|% End page number, we don't print it + \ifnumless{\csuse{@msdata@\add@msd@c @stopabslinenumber}}{\csuse{@lastabsline@forpage@\the\page@num}}% + {\csuse{@msdata@\add@msd@c @stoplinenumber}}%End line number if in the same page + {\csuse{@lastline@forpage@\the\page@num}}%Otherwiser, last number of the page + |% + 000|% End sub line number, for now, not used + \edfont@info%Font + }% + \@msd@options@fullpagefalse% + \if@firstlineofpage%Try if the data are for the full page. If yes, will add options to the list. + \unless\if@msdata@insertedfrompreviouspage% + \ifnumless{\csuse{@lastabsline@forpage@\the\page@num}}{\csuse{@msdata@\add@msd@c @stopabslinenumber}+\@ne}% + {% + \numdef{\@tmp}{\add@msd@c+\@ne}% + \ifcsdef{@msdata@\@tmp @abslinenumber}% + {\ifnumequal{\csuse{@msdata@\@tmp @abslinenumber}}{\csuse{@lastabsline@forpage@\the\page@num}}% + {}% + {\@msd@options@fullpagetrue}% + }% + {\@msd@options@fullpagetrue}% + }% + {}% + \fi% + \fi% + \listxadd{\@msdata@list}{% + \@msd@options@iffullpage% + \noexpand\csuse{v\@msdata@series footnote}{\@msdata@series}{{\expandonce\l@d@nums}{\ms@data@label}{\expandonce\@data}}% + \reset@msd@options@iffullpage% + }% + }% + {}% + \else% + \numgdef{\add@msd@cR}{\add@msd@cR+\@ne}% + \ifcsdef{@msdata@\add@msd@cR @dataR}{% + \letcs{\@data}{@msdata@\add@msd@cR @dataR}% + \edef\l@d@nums{% + 000|% Start page = we don't print it + \csuse{@msdata@\add@msd@cR @linenumberR}|% Start line number + 000|% Start subline number, for now, not used + 000|% End page number, we don't print it + \ifnumless{\csuse{@msdata@\add@msd@cR @stopabslinenumberR}}{\csuse{@lastline@forpageR@\the\page@numR}}% + {\csuse{@msdata@\add@msd@cR @stoplinenumberR}}%End line number if in the same page + {\csuse{@lastline@forpageR@\the\page@numR}}%Otherwiser, last number of the page + |% + 000|% End sub line number, for now, not used + \edfont@info%Font + }% + \@msd@options@fullpagefalse% + \if@firstlineofpageR% + \unless\if@msdata@insertedfrompreviouspage% + \ifnumless{\csuse{@lastabsline@forpageR@\the\page@numR}}{\csuse{@msdata@\add@msd@c @stopabslinenumberR}+\@ne}% + {% + \numdef{\@tmp}{\add@msd@cR+\@ne}% + \ifcsdef{@msdata@\@tmp @abslinenumberR}% + {\ifnumequal{\csuse{@msdata@\@tmp @abslinenumberR}}{\csuse{@lastabsline@forpageR@\the\page@numR}}% + {}% + {\@msd@options@fullpagetrue}% + }% + {\@msd@options@fullpagetrue}% + }% + {}% + \fi% + \fi% + \listxadd{\@msdata@list}{% + \@msd@options@iffullpage% + \noexpand\csuse{v\@msdata@series footnote}{\@msdata@series}{{\expandonce\l@d@nums}{\ms@data@label}{\expandonce\@data}}% + \reset@msd@options@iffullpage% + }% + }% + {}% + \fi% + \egroup% +}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\if@msdata@insertedfrompreviouspage} +% The \cs{if@msdata@insertedfrompreviouspage} boolean is set to TRUE if \macpackage\ automatically inserts data from previous page in the first line of a page. +% \begin{macrocode} +\newif\if@msdata@insertedfrompreviouspage% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\add@msdata@firstlineofpage} +% \cs{add@msdata@firstlineofpage} is called at the first line of every page. It inserts manuscript data which start on one of the previous pages and continue on this page. +% \begin{macrocode} +\newcommand{\add@msdata@firstlineofpage}{% + \bgroup% + \normalfont% + \unless\ifledRcol@% + \ifcsdef{@msdata@\add@msd@c @data}{% + \ifnumless{\the\absline@num-\@ne}{\csuse{@msdata@\add@msd@c @stopabslinenumber}}% + {% + \global\@msdata@insertedfrompreviouspagetrue% + \letcs{\@data}{@msdata@\add@msd@c @data}% + \edef\l@d@nums{% + 000|% Start page = we don't print it + \numexpr\the\line@num+\@ne\relax|% Start line number = first line of the page. As \add@msdata@firstlineofpage is called before line number has been incremented, we increment it for printing + 000|% Start subline number, for now, not used + 000|% End page number, we don't print it + \ifnumless{\csuse{@msdata@\add@msd@c @stopabslinenumber}}{\csuse{@lastabsline@forpage@\the\page@num}}% + {\csuse{@msdata@\add@msd@c @stoplinenumber}}%End line number if in the same page + {\csuse{@lastline@forpage@\the\page@num}}%Otherwise, last number of the page + |% + 000|% End sub line number, for now, not used + \edfont@info%Font + }% + \@msd@options@fullpagefalse% + \ifnumless{\csuse{@lastabsline@forpage@\the\page@num}}{\csuse{@msdata@\add@msd@c @stopabslinenumber}+\@ne}%We will test if the ms data is for the full page + {% + \numdef{\@tmp}{\add@msd@c+\@ne}% + \ifcsdef{@msdata@\@tmp @abslinenumber}% + {\ifnumequal{\csuse{@msdata@\@tmp @abslinenumber}}{\csuse{@lastabsline@forpage@\the\page@num}}% + {}% + {\@msd@options@fullpagetrue}% + }% + {\@msd@options@fullpagetrue}% + }% + {}% + \listxadd{\@msdata@list}{% + \@msd@options@iffullpage% + \noexpand\csuse{v\@msdata@series footnote}{\@msdata@series}{{\expandonce\l@d@nums}{\ms@data@label}{\expandonce\@data}}% + \reset@msd@options@iffullpage% + }% + }% + {\global\@msdata@insertedfrompreviouspagefalse}% + }{}% + \else% + \ifcsdef{@msdata@\add@msd@cR @dataR}{% + \ifnumless{\the\absline@numR-\@ne}{\csuse{@msdata@\add@msd@cR @stopabslinenumberR}}% + {% + \global\@msdata@insertedfrompreviouspagetrue% + \letcs{\@data}{@msdata@\add@msd@cR @dataR}% + \edef\l@d@nums{% + 000|% Start page = we don't print it + \numexpr\the\line@numR+\@ne\relax|% Start line number = first line of the page. As \add@msdata@firstlineofpage is called before line number has been incremented, we increment it for printing + 000|% Start subline number, for now, not used + 000|% End page number, we don't print it + \ifnumless{\csuse{@msdata@\add@msd@cR @stopabslinenumberR}}{\csuse{@lastline@forpageR@\the\page@numR}}% + {\csuse{@msdata@\add@msd@cR @stoplinenumberR}}%End line number if in the same page + {\csuse{@lastline@forpageR@\the\page@numR}}%Otherwise, last number of the page + |% + 000|% End sub line number, for now, not used + \edfont@info%Font + }% + \@msd@options@fullpagefalse% + \ifnumless{\csuse{@lastabsline@forpageR@\the\page@numR}}{\csuse{@msdata@\add@msd@cR @stopabslinenumberR}+\@ne}% + {% + \numdef{\@tmp}{\add@msd@cR+\@ne}% + \ifcsdef{@msdata@\@tmp @abslinenumberR}% + {\ifnumequal{\csuse{@msdata@\@tmp @abslinenumberR}}{\csuse{@lastabsline@forpageR@\the\page@numR}}% + {}% + {\@msd@options@fullpagetrue}% + }% + {\@msd@options@fullpagetrue}% + }% + {}% + \listxadd{\@msdata@list}{% + \@msd@options@iffullpage% + \noexpand\csuse{v\@msdata@series footnote}{\@msdata@series}{{\expandonce\l@d@nums}{\ms@data@label}{\expandonce\@data}}% + \reset@msd@options@iffullpage% + }% + }% + {\global\@msdata@insertedfrompreviouspagefalse}% + }{}% + \fi% + \egroup% +}% +% \end{macrocode} +% \end{macro} +% \subsection{Inserting footnote} +% Just before inserting standard insert (familiar and critical footnotes, sidenotes), we call \cs{insert@msdata} to insert manuscripts data's footnotes. +% \begin{macro}{\insert@msdata} +% \begin{macrocode} +\newcommand{\insert@msdata}{% + \def\do##1{##1}% + \dolistloop{\@msdata@list}% + \global\let\@msdata@list\relax% +}% +% \end{macrocode} +% \end{macro} +% \subsection{Other} +% \begin{macro}{\@msd@options@iffullpage} +% \begin{macro}{\reset@msd@options@iffullpage} +% \cs{@msd@options@iffullpage} sets some options if the manuscripts data are for all the page. +% \cs{reset@msd@options@iffullpage} resets them after the footnote. +% \cs{if@msd@options@fullpage} is switch to true in \protect{add@msdata@firstlineofpage} if these option must be inserted. +% \begin{macrocode} +\newif\if@msd@options@fullpage% +\newcommand{\@msd@options@iffullpage}[0]{% + \if@msd@options@fullpage% + \noexpand\toggletrue{nonum@}% + \ifdefvoid{\ms@data@label}% + {\noexpand\toggletrue{nosep@}}% + {}% + \fi% +}% +\newcommand{\reset@msd@options@iffullpage}[0]{% + \noexpand\togglefalse{nonum@}% + \noexpand\togglefalse{nosep@}% +}% +% \end{macrocode} +% \end{macro} +% \end{macro} % \section{Arrays and tables} % \subsection{Preamble: macro as environment} % |