summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/eledmac/eledmac.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/eledmac/eledmac.dtx')
-rw-r--r--Master/texmf-dist/source/latex/eledmac/eledmac.dtx616
1 files changed, 496 insertions, 120 deletions
diff --git a/Master/texmf-dist/source/latex/eledmac/eledmac.dtx b/Master/texmf-dist/source/latex/eledmac/eledmac.dtx
index b327f5ee304..8b4e52d0118 100644
--- a/Master/texmf-dist/source/latex/eledmac/eledmac.dtx
+++ b/Master/texmf-dist/source/latex/eledmac/eledmac.dtx
@@ -51,7 +51,7 @@
%
% \fi
%
-% \CheckSum{7418}
+% \CheckSum{7909}
%
% \makeatletter
% \newcommand*{\DescribeIt}{\leavevmode\@bsphack\begingroup\MakePrivateLetters
@@ -144,6 +144,7 @@
% \def\fileversion{v0.17} \def\filedate{2012/08/03}
% \def\fileversion{v1.0}\def\filedate{2012/09/15}
% \def\fileversion{v1.0.1}\def\filedate{2012/09/16}
+% \def\fileversion{v1.1}\def\filedate{2012/09/25}
% \changes{v0.1}{2003/03/25}{First public release}
% \changes{v0.2}{2003/08/16}{Added tabmac code, and extended indexing}
% \changes{v0.2.1}{2003/09/13}{Bug fixes and match with mempatch v1.8}
@@ -178,6 +179,7 @@
% \changes{v0.13.1}{2011/11/18}{\cs{thepstartL} and \cs{thepstartR} use now \cs{bfseries} and not \cs{bf}, which is deprecated and makes conflicts with memoir class.}
% \changes{v0.14}{2012/04/04}{Tweaked \cs{edlabel} to get correct line number if the command is first element of a paragraph.}
% \changes{v1.0}{2012/09/15}{Some compatibility break with eledmac. Change of name: eledmac.}
+% \changes{v1.1}{2012/09/25}{New package option: parapparatus.}
% \hyphenation{man-u-script man-u-scripts}
%
% \newcommand{\Lpack}[1]{\textsf{#1}}
@@ -261,7 +263,7 @@
%
%
% \begin{abstract}
-% \edmac, a set of \PlainTeX\ macros, was made at the begining of 90's
+% \edmac, a set of \PlainTeX\ macros, was made at the beginning of 90's
% for typesetting critical editions in the traditional
% way, i.e., similar to the Oxford Classical Texts, Teubner, Arden
% Shakespeare and other series. A separate set of \PlainTeX\ macros,
@@ -395,7 +397,7 @@
% \Lpack{MauroTeX} (\url{http://www.maurolico.unipi.it/mtex/mtex.htm}).
% These sites are both in Italian.
% \item Dirk-Jan Dekker\index{Dekker, Dirk-Jan} maintains
-% \url{http://www.djdekker.net/eledmac}
+% \url{http://www.djdekker.net/ledmac}
% which is a FAQ for typesetting critical editions and \Eledmac.
% \end{itemize}
%
@@ -775,7 +777,11 @@
%\changes{v0.12}{2011/10/01}{Possibilty to number \cs{pstart}.}
% It's possible to insert a number at every \cs{pstart} command. You must use the \DescribeMacro{\numberpstarttrue}\cs{numberpstarttrue} command to have it. You can stop the numbering with \DescribeMacro{\numberpstartfalse}\cs{numberpstartfalse}. You can redefine the command \DescribeMacro{\thepstart}\cs{thepstart} to change style. On each \cs{beginnumbering} the numbering restarts.
% \changes{v0.15}{2012/06/11}{Possibilty to print \cs{pstart} number in side.}
+%
% With the \cs{sidepstartnumtrue} command, the number of \cs{pstart} will be printed in side. In this case, the line number will be not printed.
+%
+% \changes{v1.1}{2012/09/25}{Add \cs{labelpstarttrue}.}
+% With the \cs{labelpstarttrue} command, a \cs{label} added just after a \cs{pstart} will refer to the number of this pstart.
% \subsection{Lineation commands}
% \DescribeMacro{\numberlinefalse} \DescribeMacro{\numberlinetrue}
% Line numbering can be disabled with \cs{numberlinefalse}. It can be enabled again with \cs{numberlinetrue}.
@@ -948,7 +954,6 @@
%
%
% \section{The apparatus}
-%
% \subsection{Commands}
% \DescribeMacro{\edtext}
% Within numbered paragraphs, all footnotes and endnotes are generated
@@ -1058,6 +1063,12 @@
% (p.\,\pageref{doendnotes}) to call for their
% output at the appropriate point in your document.
%
+% By default, no paragraph can be made in the notes of critical apparatus.
+% You can allow it by adding the options \verb+parapparatus+ when loading the package :
+% \begin{verbatim}
+% \usepackage[parapparatus]{eledmac}
+% \end{verbatim}
+%
% \DescribeMacro{\lemma}
% \changes{v1.0}{2012/09/15}{\cs{lemma} can contain commands.}
% If you want to change the lemma that gets passed to the notes, you
@@ -1189,12 +1200,33 @@
% \changes{v1.0.1}{2012/09/16}{Correction on \cs{numberonlyfirstinline} with lineation by pstart or by page.}
% By default, the line number is printed in every note. If you want to print it only the first time for a value (i.e one time for line 1, one time for line 2 etc.), you can use \cs{numberonlyfirstinline}\oarg{s}. Use \cs{numberonlyfirstinline}\oarg{s}\oarg{false} to cancel it (\verb|<s>| can be empty if you want to disable it for every series).
%
+% \DescribeMacro{\numberonlyfirstintwolines}
+% \changes{v1.1}{2012/09/25}{Add \cs{numberonlyfirstintwolines}}
+% Suppose you have a lemma on line~2 and a lemma between line~2 and line~3.
+% With \cs{numberonlyfirstinline}, the second lemma is considered to be on the same line as the first lemma.
+% But if you add \cs{numberonlyfirstintwolines}\oarg{s}, the distinction is made.
+% Use \cs{numberonlyfirstintwolines}\oarg{s}\oarg{false} to cancel it (\verb|<s>| can be empty if you want to disable it for every series).
+%
% \DescribeMacro{\symlinenum}
% For setting a particular symbol in place of the line number, you can use \cs{symlinenum}\oarg{s}\marg{symbol} in combination with \cs{numberonlyfirstinline}\oarg{s}. From the second lemma of the same line, the symbol will be used instead of line number.
%
% \DescribeMacro{\nonumberinfootnote}
% You can use \cs{nonumberinfootnote}\oarg{s} if you don't want to have the line number in a footnote. To cancel it, use \cs{nonumberinfootnote}\oarg{s}\oarg{false}.
%
+% \changes{v1.1}{2012/09/25}{Add \cs{pstartinfootnote} and \cs{onlypstartinfootnote}}
+% \DescribeMacro{\pstartinfootnote}
+% You can use \cs{pstartinfootnote}\oarg{s} if you want to print the pstart number in the footnote, before the line and subline number.
+% Use \cs{pstartinfootnote}\oarg{s}\oarg{false} to cancel it (\verb|<s>| can be empty if you want to disable it for every series).
+% Note that when you change the lineation system, the option is automatically switched :
+% \begin{itemize}
+% \item If you use lineation by pstart, the option is enabled.
+% \item If you use lineation by section or by page, the option is disabled.
+% \end{itemize}
+%
+% \DescribeMacro{\onlypstartinfootnote}
+% In combination with \cs{pstartinfootnote}, you can use \cs{onlypstartinfootnote}\oarg{s} if you want to print only the pstart number in the footnote, and not the line and subline number.
+% Use \cs{onlypstartinfootnote}\oarg{s}\oarg{false} to cancel it (\verb|<s>| can be empty if you want to disable it for every series).
+%
% \DescribeMacro{\beforenumberinfootnote}
% With \cs{beforenumberinfootnote}\oarg{s}\marg{l}, you can add some space before the line number in a footnote. If the line number is not printed, the space is not either. The default value is 0~pt.
%
@@ -1273,6 +1305,26 @@
% \DescribeMacro{\hangindentX}
% For familiar notes NOT paragraphed you can define an indent with \cs{Xhangindent}\oarg{s}\marg{l}, which will be applied in the second line of notes. It can help to make a distinction between a new note and a break in anote.
%
+% \subsubsection{Arbitrary code at the beginninging of notes}
+% \changes{v1.1}{2012/09/25}{New hook to add arbitrary code at the beginning of the notes}
+% The three next commands add an arbitrary code at the beginning of notes.
+% As the name's space is local to the notes, you can use it to redefine some style inside the notes.
+% For example, if you don't want the pstart number to be in bold, use :
+% \begin{verbatim}
+% \bhookXnote{\renewcommand{\thepstart}{\arabic{pstart}.}}
+% \end{verbatim}
+%
+% \DescribeMacro{\bhookXnote}
+% \cs{bhookXnote}\oarg{series}\marg{code} is to be used at the beginning of the critical footnotes.
+%
+%
+% \DescribeMacro{\bhooknoteX}
+% \cs{bhooknoteX}\oarg{series}\marg{code} is to be used at the beginning of the familiar footnotes.
+%
+%
+% \DescribeMacro{\bhookXendnote}
+% \cs{bhookXendnote}\oarg{series}\marg{code} is to be used at the beginning of the endnotes.
+%
% \subsubsection{Options for notes in columns}
% For the following four macros, be careful that the columns are made from right to left.
%
@@ -1295,6 +1347,43 @@
% \DescribeMacro{\parafootsep}
% For paragraphed footnotes (see below), you can chooce the separator between each note by \cs{parafootsep}\oarg{s}\marg{l}. A common separator is double pipe (\verb+$||$+), which you can set by \cs{parafootsep}\verb+$||$+.
%
+%\subsubsection{Options for block of notes}
+% \changes{v1.1}{2012/09/12}{New options for block of notes.}
+% \DescribeMacro{\txtbeforeXnotes}
+% You can add some text before critical notes with \cs{textbeforeXnotes}\oarg{s}\marg{text}.
+%
+% \DescribeMacro{\beforeXnotes}
+% You can change the vertical space printed before the rule of the critical notes with \cs{beforeXnotes}\oarg{s}\marg{l}.
+% The default value is \verb|1.2em plus .6em minus .6em|.
+%
+% \DescribeMacro{\beforenotesX}
+% You can change the vertical space printed before the rule of the familiar notes with \cs{beforenotesX}\oarg{s}\marg{l}.
+% The default value is \verb|1.2em plus .6em minus .6em|.
+%
+% \DescribeMacro{\preXnotes}
+% You can set the space before the first series of critical notes printed on each page
+% and set a different amount of space for subsequent the series on the page.
+% You can do it with \cs{preXnotes}\marg{l}.
+% You can disable this feature by setting the length to 0~pt.
+%
+% \DescribeMacro{\prenotesX}
+% You can want the space before the first printed (in a page) series of familiar notes not to be the same as before other series.
+% You can do it with \cs{prenotesX}\marg{l}.
+% You can disable this feature by setting the length to 0~pt.
+%
+% \DescribeMacro{\maxhXnotes}
+% By default, one series of critical notes can take 80\% of the page size, before being broken to the next page.
+% If you want to change the size use \cs{maxhXnotes}\oarg{s}\marg{l}.
+% Be careful : the length can't be flexible, and is relative to the the current font.
+% For exemple, if you want that note takes, at most, 33% of the text height, do \verb|\maxhnotes{33\textheight}|.
+%
+% \DescribeMacro{\maxhnotesX}
+% \cs{maxhnotesX}\oarg{s}\marg{l} is the same as previous, but for familiar footnotes.
+%
+% Be careful with the two previous commands.
+% Actually, for technical purposes, one paragraphed note is considered as one block.
+% Consequently, it can't be broken between two pages, even if you used these commands.
+% The debug is in the todolist.
%\subsection{Page layout}
% You should set up the page layout parameters, and in particular the
% \cs{baselineskip} of the footnotes (this is done for you if you
@@ -1727,34 +1816,7 @@
% \DescribeMacro{\pageref}
% \changes{v0.2.1}{2003/08/25}{Added text about normal labeling}
% The normal \cs{label}, \cs{ref} and \cs{pageref} macros may be used
-% within numbered text, and operate in the familiar fashion. As an example,
-% here is one way of numbering paragraphs in numbered text, and then being
-% able to refer to the paragraph numbers, in addition to line and page numbers.
-% \begin{verbatim}
-% \newcounter{para} \setcounter{para}{0}
-% \newcommand{\newpara}{%
-% \refstepcounter{para}%
-% \noindent\llap{\thepar. }\quad}
-% \newcommand{\oldpara}[1]{%
-% \noindent\llap{\ref{#1}. }\quad}
-% \end{verbatim}
-% The definitions of \cs{newpara} and \cs{oldpara} put the numbers in the left
-% margin and the first line of the paragraph is indented. You can now
-% write things like:
-% \begin{verbatim}
-% \linenummargin{right}
-% \beginnumbering
-% \pstart
-% \newpara\label{P1} A paragraph about \ldots
-% \pend
-% In paragraph~\ref{P1} the author \ldots
-% \pstart
-% \oldpara{P1} This has the same
-% \edtext{number}{\Afootnote{\ref{P1} is the paragraph, not line}}
-% as the first paragraph.
-% \pend
-% \endnumbering
-% \end{verbatim}
+% within numbered text, and operate in the familiar fashion.
%
%
% \section{Side notes}
@@ -1808,7 +1870,9 @@
% \end{verbatim}
% These can of course be changed to suit.
%
-%
+% \DescribeMacro{\sidenotesep}
+% If you have two or more sidenotes for the same line, they are separated by a comma.
+% But if you want to change this separator, you can redefine the macro \cs{sidenotesep}.
% \section{Familiar footnotes} \label{sec:desc:familiar}
%
%
@@ -2170,6 +2234,30 @@
% produces a vertical dotted instead of a solid line.
%
%
+% \section{sectioning commands}
+% \changes{v1.1}{2012/09/25}{sectioning commands}
+% The standard sectioning command (\section{chapter}, \cs{section} etc.) can be used inside a numbered text.
+% But the line which contains it won't be numbered, and you can't add critical notes inside.
+%
+% However, eledmac provides the following commands :
+% \begin{itemize}
+% \item \cs{ledchapter}\oarg{text}\marg{critical text}
+% \item \cs{ledchapter*}
+% \item \cs{ledsection}\oarg{text}\marg{critical text}
+% \item \cs{ledsection*}
+% \item \cs{ledsubsection}\oarg{text}\marg{critical text}
+% \item \cs{ledsubsection*}
+% \item \cs{ledsubsubsection}\oarg{text}\marg{critical text}
+% \item \cs{ledsubsubsection*}
+% \end{itemize}
+% Which are the equivalent of the standard LaTeX commands, but be careful.
+% Note the following points :
+% \begin{enumerate}
+% \item All these commands close a \cs{pstart}, and open a new one. The content of the command itself is between \cs{pstart} and \cs{pend}.
+% \item Don't try to make \verb|\let\chapter\ledchapter|, or other things like it: the \cs{led}section commands call the standard commands.
+% \item For the non-starred sections, use the optional argument \meta{text} to provide the text to the table of contents.
+% \item The \cs{ledchapter} doesn't open a new page. You must use \cs{beforeledchapter} before. This also closes a \cs{pstart} and opens a new.
+% \end{enumerate}
% \section{Miscellaneous}
%
%
@@ -2540,7 +2628,7 @@
% \begin{macrocode}
%<*code>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{eledmac}[2012/09/16 v1.0.1 LaTeX port of EDMAC]
+\ProvidesPackage{eledmac}[2012/09/25 v1.1 LaTeX port of EDMAC]
% \end{macrocode}
%
@@ -2560,13 +2648,17 @@
%
%
% \begin{macro}{\ifledfinal}
+% \begin{macro}{\ifparapparatus@}
% Use this to remember which option is used, set and execute the options
% with final as the default.
% \changes{v0.4}{2004/02/29}{Added final/draft options}
% \begin{macrocode}
\newif\ifledfinal
+\newif\ifparapparatus@
+\parapparatus@false
\DeclareOption{final}{\ledfinaltrue}
\DeclareOption{draft}{\ledfinalfalse}
+\DeclareOption{parapparatus}{\parapparatus@true}
\ExecuteOptions{final}
% \end{macrocode}
% Use the starred form of \verb?\ProcessOptions? which executes options in
@@ -2579,11 +2671,12 @@
% \end{macrocode}
% \end{macro}
-%
-% Loading package \emph{xargs} to declare commands with optional arguments. \emph{Etoolbox} is also used for more clear code, for example in dynamic command names (it could remplace \cs{csname} etc.)
+% \end{macro}
+% Loading package \emph{xargs} to declare commands with optional arguments. \emph{Etoolbox} is also used for more clear code, for example in dynamic command names (it could replace \cs{csname} etc.). \emph{suffix} to declare commands with starred version.
% \begin{macrocode}
\RequirePackage{xargs}
\RequirePackage{etoolbox}
+\RequirePackage{suffix}
% \end{macrocode}
% \begin{macro}{\showlemma}
% \verb?\showlemma?\marg{lemma} typesets the lemma text in the body.
@@ -2966,6 +3059,8 @@
\line@list@stuff{\jobname.\extensionchars\the\section@num}%
\l@dend@stuff
\setcounter{pstart}{1}
+ \begingroup
+ \initnumbering@sectcmd
}
\newcommand*{\initnumbering@reg}{%
\global\pst@rtedLfalse
@@ -2985,6 +3080,88 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\initnumbering@sectcmd}
+% \begin{macro}{\ledsection}
+% \begin{macro}{\ledsection*}
+% \begin{macro}{\ledsubsection}
+% \begin{macro}{\ledsubsection*}
+% \begin{macro}{\ledsubsubsection}
+% \begin{macro}{\ledsubsubsection*}
+% \begin{macro}{\ledchapter}
+% \begin{macro}{\ledchapter*}
+% \cs{initnumbering@sectcmd} define sectioning commands inside numbered section.
+% Note that it's suppose user didn't change \cs{chapter}.
+% If he did, he should redefine \cs{initnumbering@sectcmd}.
+% \begin{macrocode}
+\newcommand{\initnumbering@sectcmd}{
+ \newcommand{\ledsection}[2][]{%
+ \leavevmode\pend\vspace{3.5ex \@plus 1ex \@minus .2ex}\skipnumbering%
+ \pstart%
+ \leavevmode\section[##1]{##2}\leavevmode\vspace{2.3ex \@plus.2ex}\skipnumbering\pend%
+ \vspace{-2\parskip}\vspace{-2\baselineskip}%
+ \pstart
+ }
+ \WithSuffix\newcommand\ledsection*[1]{%
+ \leavevmode\pend\vspace{3.5ex \@plus 1ex \@minus .2ex}\skipnumbering%
+ \pstart%
+ \leavevmode\section*{##1}\leavevmode\vspace{2.3ex \@plus.2ex}\skipnumbering\pend%
+ \vspace{-2\parskip}\vspace{-2\baselineskip}%
+ \pstart
+ }
+ \newcommand{\ledsubsection}[2][]{%
+ \leavevmode\pend\vspace{3.5ex \@plus 1ex \@minus .2ex}\skipnumbering%
+ \pstart%
+ \leavevmode\subsection[##1]{##2}\leavevmode\vspace{1.5ex \@plus .2ex}\skipnumbering\pend%
+ \vspace{-2\parskip}\vspace{-2\baselineskip}%
+ \pstart
+ }
+ \WithSuffix\newcommand\ledsubsection*[1]{%
+ \leavevmode\pend\vspace{3.5ex \@plus 1ex \@minus .2ex}\skipnumbering%
+ \pstart%
+ \leavevmode\subsection*{##1}\leavevmode\vspace{1.5ex \@plus .2ex}\skipnumbering\pend%
+ \vspace{-2\parskip}\vspace{-2\baselineskip}%
+ \pstart
+ }
+ \newcommand{\ledsubsubsection}[2][]{%
+ \leavevmode\pend\vspace{3.5ex \@plus 1ex \@minus .2ex}\skipnumbering%
+ \pstart%
+ \leavevmode\subsubsection[##1]{##2}\leavevmode\vspace{1.5ex \@plus .2ex}\skipnumbering\pend%
+ \vspace{-2\parskip}\vspace{-2\baselineskip}%
+ \pstart
+ }
+ \WithSuffix\newcommand\ledsubsubsection*[1]{%
+ \leavevmode\pend\vspace{3.5ex \@plus 1ex \@minus .2ex}\skipnumbering%
+ \pstart%
+ \leavevmode\subsubsection*{##1}\leavevmode\vspace{1.5ex \@plus .2ex}\skipnumbering\pend%
+ \vspace{-2\parskip}\vspace{-2\baselineskip}%
+ \pstart
+ }
+ \newcommand\ledchapter[2][]{~\pend\skipnumbering\pstart\chapter[##1]{##2}\pend\pstart}
+ \WithSuffix\newcommand\ledchapter*[1]{~\pend\skipnumbering\pstart\chapter*{##1}\pend\pstart}
+ \patchcmd{\@makeschapterhead}{1\par}{1}{}{}
+ \pretocmd{\@makeschapterhead}{\par}{}{}
+ \apptocmd{\@makeschapterhead}{\par}{}{}
+ \patchcmd{\@makeschapterhead}{\vskip 40\p@}{}{}{}
+ \patchcmd{\@makechapterhead}{1\par}{1}{}{}
+ \pretocmd{\@makechapterhead}{\par}{}{}
+ \apptocmd{\@makechapterhead}{\par}{}{}
+ \patchcmd{\@makechapterhead}{\vskip 40\p@}{}{}{}
+ \apptocmd{\@chapter}{\par\leavevmode\vspace{40 \p@}\skipnumbering}{}{}
+ \apptocmd{\@schapter}{\par\leavevmode\vspace{40 \p@}\skipnumbering}{}{}
+ \newcommand\beforeledchapter{\pend\cleardoublepage\pstart}
+ \patchcmd{\chapter}{\cleardoublepage}{\relax}{}{}
+ \patchcmd{\chapter}{\clearpage}{\relax}{}{}
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
% \begin{macro}{\endnumbering}
% \cs{endnumbering} must follow the last text for a numbered section.
% It takes care of notifying you when changes have been noted in the
@@ -3012,7 +3189,7 @@
\else
\led@err@NumberingNotStarted
\fi
- \autoparfalse}
+ \autoparfalse\endgroup}
% \end{macrocode}
% \end{macro}
%
@@ -3102,16 +3279,19 @@
\ifx\@tempa\@tempb
\global\bypage@true
\global\bypstart@false
+ \pstartinfootnote[][false]
\else
\def\@tempb{pstart}%
\ifx\@tempa\@tempb
\global\bypage@false
\global\bypstart@true
+ \pstartinfootnote
\else
\def\@tempb{section}
\ifx\@tempa\@tempb
\global\bypage@false
\global\bypstart@false
+ \pstartinfootnote[][false]
\else
\led@warn@BadLineation
\fi
@@ -5122,6 +5302,8 @@
% \begin{macro}{\pstart}
% \begin{macro}{\numberpstarttrue}
% \begin{macro}{\numberpstartfalse}
+% \begin{macro}{\labelpstarttrue}
+% \begin{macro}{\labelpstartfalse}
% \begin{macro}{thepstart}
% \cs{pstart} starts the paragraph by
% clearing the \cs{inserts@list} list and other
@@ -5146,6 +5328,8 @@
\renewcommand{\thepstart}{{\bfseries\@arabic\c@pstart}. }
\newif\ifnumberpstart
\numberpstartfalse
+\newif\iflabelpstart
+\labelpstartfalse
\newcommand*{\pstart}{
\if@nobreak
\let\@oldnobreak\@nobreaktrue
@@ -5165,12 +5349,17 @@
\global\let\next@insert=\empty
\begingroup\normal@pars
\global\setbox\raw@text=\vbox\bgroup\ifautopar\else\ifnumberpstart\ifinstanza\else\ifsidepstartnum\else\thepstart\fi\fi\fi\fi
- \numberedpar@true}
+ \numberedpar@true
+ \iflabelpstart\protected@edef\@currentlabel
+ {\p@pstart\thepstart}\fi
+ }
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
% \begin{macro}{\pend}
% \cs{pend} must be used to end a numbered paragraph.
%
@@ -5195,7 +5384,7 @@
\endgraf\global\num@lines=\prevgraf\egroup
\global\par@line=0
% \end{macrocode}
-% We check if lineation is by pstart: in this case, we reset line number, but only in the second line of the pstart, to prevent some trouble. We can't reset line number at the begining of \cs{pstart} \cs{setline} is parsed at the end of previous \cs{pend}, and so, we must do it at the end of first line of pstart.
+% We check if lineation is by pstart: in this case, we reset line number, but only in the second line of the pstart, to prevent some trouble. We can't reset line number at the beginning of \cs{pstart} \cs{setline} is parsed at the end of previous \cs{pend}, and so, we must do it at the end of first line of pstart.
% \begin{macrocode}
\csnumdef{pstartline}{0}
\loop\ifvbox\raw@text
@@ -5346,7 +5535,7 @@
% \begin{macro}{\l@drd@ta}
% \begin{macro}{\l@dcsnotetext}
% Nulls the \cs{...d@ta}, which may later hold line numbers.
-% Similarly for \cs{l@dcsnotetext} for the text of a sidenote.
+% Similarly for \cs{l@dcsnotetext} for the texts of the sidenotes.
% \changes{v0.7}{2005/02/18}{Added \cs{l@demptyd@ta}}
% \begin{macrocode}
\newcommand*{\l@demptyd@ta}{%
@@ -5849,7 +6038,7 @@
% \begin{macro}{\pstartnum}
% \begin{itemize}
% \item The pstarts counter is upgrade in the \cs{pend} command. Consequently, the \cs{affixpstart@num} command has not to upgrade it, unlike the \cs{affixline@num} which upgrades the lines counter.
-% \item To print the pstart number only at the begining of a pstart, and not in every line, a boolean test is made. The \cs{pstartnum} boolean is set to TRUE at every \cs{pend}. It's tried in the \cs{leftpstartnum} and \cs{rightstartnum} commands. After the try, it is set to FALSE.
+% \item To print the pstart number only at the beginning of a pstart, and not in every line, a boolean test is made. The \cs{pstartnum} boolean is set to TRUE at every \cs{pend}. It's tried in the \cs{leftpstartnum} and \cs{rightstartnum} commands. After the try, it is set to FALSE.
% \end{itemize}
% \begin{macro}{\leftpstartnum}
% \begin{macro}{\rightstartnum}
@@ -6169,8 +6358,9 @@
% \cs{insert} for this note, calling on the \cs{footfmt} macro for
% this note series to format the text of the note.
% \begin{macrocode}
-\newcommand*{\normalvfootnote}[2]{%
+\notbool{parapparatus@}{\newcommand*}{\newcommand}{\normalvfootnote}[2]{%
\insert\csname #1footins\endcsname\bgroup
+ \csuse{bhookXnote@#1}
\csuse{Xnotefontsize@#1}
\footsplitskips
\spaceskip=\z@skip \xspaceskip=\z@skip
@@ -6196,9 +6386,10 @@
% And a somewhat different version for minipages.
% \changes{v0.4}{2004/02/29}{Added \cs{mpnormalvfootnote}}
% \begin{macrocode}
-\newcommand*{\mpnormalvfootnote}[2]{%
+\notbool{parapparatus@}{\newcommand*}{\newcommand}{\mpnormalvfootnote}[2]{%
\global\setbox\@nameuse{mp#1footins}\vbox{%
\unvbox\@nameuse{mp#1footins}
+ \csuse{bhookXnote@#1}
\csuse{Xnotefontsize@#1}
\hsize\columnwidth
\@parboxrestore
@@ -6232,8 +6423,8 @@
% \begin{macrocode}
\newcommand*{\ledsetnormalparstuff}{%
\normal@pars
- \parindent \z@ \parfillskip \z@ \@plus 1fil}
-\newcommandx*{\normalfootfmt}[4][4=Z]{% 4th arg is optional, for backward compatibility
+ \noindent \parfillskip \z@ \@plus 1fil}
+\notbool{parapparatus@}{\newcommandx*}{\newcommandx}{\normalfootfmt}[4][4=Z]{% 4th arg is optional, for backward compatibility
\ledsetnormalparstuff%
\hangindent=\csuse{Xhangindent@#4}
\strut{\printlinefootnote{#1}{#4}}%
@@ -6273,6 +6464,23 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\printpstart}
+% The \cs{printpstart} macro prints the pstart number for a note.
+% \begin{macrocode}
+\newcommand{\printpstart}[0]{%
+ \ifl@dpairing%
+ \ifledRcol%
+ \thepstartR%
+ \else%
+ \thepstartL%
+ \fi%
+ \else%
+ \thepstart%
+ \fi%
+}
+% \end{macrocode}
+%
+% \end{macro}
% The \cs{printlines} macro prints the line
% numbers for a note---which, in the
% general case, is a rather complicated task.
@@ -6431,17 +6639,6 @@
% \changes{v0.15}{2012/06/11}{Line numbering can be reset at each pstart.}
% \begin{macrocode}
\def\printlines#1|#2|#3|#4|#5|#6|#7|{\begingroup
- \ifbypstart@%
- \ifl@dpairing%
- \ifledRcol%
- \thepstartR%
- \else%
- \thepstartL%
- \fi%
- \else%
- \thepstart%
- \fi%
- \fi%
\setprintlines{#1}{#2}{#3}{#4}{#5}{#6}%
% \end{macrocode}
% One subtlety left here is when to print a period between
@@ -6478,6 +6675,9 @@
% spacing problems if what you add takes up a different amount of
% space.
%
+% But if the skip \verb|\preXnotes@| is greater than 0~pt,
+% it's used instead of \verb"\skip\footins" for the first printed series.
+%
% The \cs{leftskip} and \cs{rightskip} values
% are both zeroed here.\phantomsection\label{footskips}
% Similarly, these skips are cancelled in the \verb"vfootnote" macros
@@ -6491,7 +6691,13 @@
% the footnotes. The footnotes continue to be of width \cs{hsize}.
% \begin{macrocode}
\newcommand*{\normalfootstart}[1]{%
- \vskip\skip\csname #1footins\endcsname
+ \ifdimequal{0pt}{\preXnotes@}{}%
+ {%
+ \iftoggle{preXnotes@}{%
+ \togglefalse{preXnotes@}\skip\csname #1footins\endcsname=\csuse{preXnotes@}}%
+ {}%
+ }%
+ \vskip\skip\csname #1footins\endcsname%
\leftskip0pt \rightskip0pt
\csname #1footnoterule\endcsname}
% \end{macrocode}
@@ -6512,7 +6718,7 @@
% contents of the footnote-insert box to the output page without
% alteration.
% \begin{macrocode}
-\newcommand*{\normalfootgroup}[1]{\unvbox\csname #1footins\endcsname}
+\newcommand*{\normalfootgroup}[1]{{\csuse{Xnotefontsize@#1}\noindent\csuse{txtbeforeXnotes@#1}}\unvbox\csname #1footins\endcsname}
% \end{macrocode}
% \end{macro}
@@ -6525,7 +6731,8 @@
\vskip\skip\@nameuse{mp#1footins}
\normalcolor
\@nameuse{#1footnoterule}
- \unvbox\csname mp#1footins\endcsname}}
+ {\csuse{Xnotefontsize@#1}\noindent\csuse{txtbeforeXnotes@#1}}
+ \unvbox\csname mp#1footins\endcsname}}
% \end{macrocode}
% \end{macro}
@@ -6568,17 +6775,43 @@
%
% \begin{macro}{\ledfootinsdim}
% Have a constant value for the \verb?\dimen\footins?
-% \changes{v0.4.1}{2004/03/25}{Added \cs{ledfootinsdim}}
+% \changes{v1.1}{2012/09/25}{Deprecated \cs{ledfootinsdim}}
% \begin{macrocode}
-\newcommand*{\ledfootinsdim}{0.8\vsize}
-
+\newcommand*{\ledfootinsdim}{0.8\vsize} % kept for backward compatibility, should'nt be used anymore.
% \end{macrocode}
% \end{macro}
+
%
+% \begin{macro}{\preXnotes@}
+% \begin{macro}{\preXnotes}
+% \changes{v1.1}{2012/09/25}{New skip \cs{preXnotes@}}
+% If user redefines \cs{preXnotes@}, via \cs{preXnotes} 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}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% The same, but for familiar footnotes.
+% \begin{macro}{\preXnotes}
+% \begin{macro}{\preXnotes@}
+% \begin{macrocode}
+\newtoggle{prenotesX@}
+\toggletrue{prenotesX@}
+\newcommand{\prenotes@X}{0pt}
+\newcommand*{\prenotesX}[1]{\renewcommand{\prenotesX@}{#1}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
% Now we set up the \cs{footnormal} macro itself. It takes
% one argument: the footnote series letter.
% \begin{macrocode}
\newcommand*{\footnormal}[1]{%
+ \csgdef{series@display#1}{normal}
\expandafter\let\csname #1footstart\endcsname=\normalfootstart
\expandafter\let\csname v#1footnote\endcsname=\normalvfootnote
\expandafter\let\csname #1footfmt\endcsname=\normalfootfmt
@@ -6586,8 +6819,8 @@
\expandafter\let\csname #1footnoterule\endcsname=%
\normalfootnoterule
\count\csname #1footins\endcsname=1000
- \dimen\csname #1footins\endcsname=\ledfootinsdim
- \skip\csname #1footins\endcsname=1.2em \@plus .6em \@minus .6em
+ \dimen\csname #1footins\endcsname=\csuse{maxhXnotes@#1}
+ \skip\csname #1footins\endcsname=\csuse{beforeXnotes@#1}
% \end{macrocode}
% Now do the setup for minipage footnotes. We use as much as possible of the
% normal setup as we can (so the notes will have a similar layout).
@@ -6596,8 +6829,8 @@
\expandafter\let\csname mpv#1footnote\endcsname=\mpnormalvfootnote
\expandafter\let\csname mp#1footgroup\endcsname=\mpnormalfootgroup
\count\csname mp#1footins\endcsname=1000
- \dimen\csname mp#1footins\endcsname=\ledfootinsdim
- \skip\csname mp#1footins\endcsname=1.2em \@plus .6em \@minus .6em
+ \dimen\csname mp#1footins\endcsname=\csuse{maxhXnotes@#1}
+ \skip\csname mp#1footins\endcsname=\csuse{beforeXnotes@#1}
}
% \end{macrocode}
@@ -6640,6 +6873,7 @@
% (\texttt{A}--\texttt{E}) denoting the series of notes to be paragraphed.
% \begin{macrocode}
\newcommand*{\footparagraph}[1]{%
+ \csgdef{series@display#1}{paragraph}
\expandafter\newcount\csname prevpage#1@num\endcsname
\expandafter\let\csname #1footstart\endcsname=\parafootstart
\expandafter\let\csname v#1footnote\endcsname=\para@vfootnote
@@ -6708,7 +6942,13 @@
% \begin{macrocode}
\newcommand*{\parafootstart}[1]{%
\rightskip=0pt \leftskip=0pt \parindent=0pt
- \vskip\skip\csname #1footins\endcsname
+ \ifdimequal{0pt}{\preXnotes@}{}%
+ {%
+ \iftoggle{preXnotes@}{%
+ \togglefalse{preXnotes@}\skip\csname #1footins\endcsname=\csuse{preXnotes@}}%
+ {}%
+ }%
+ \vskip\skip\csname #1footins\endcsname%
\csname #1footnoterule\endcsname}
% \end{macrocode}
% \end{macro}
@@ -6798,6 +7038,7 @@
\newcommand*{\para@vfootnote}[2]{%
\insert\csname #1footins\endcsname
\bgroup
+ \csuse{bhookXnote@#1}
\csuse{Xnotefontsize@#1}
\footsplitskips
\setbox0=\vbox{\hsize=\maxdimen
@@ -6837,6 +7078,7 @@
\newcommand*{\mppara@vfootnote}[2]{%
\global\setbox\@nameuse{mp#1footins}\vbox{%
\unvbox\@nameuse{mp#1footins}%
+ \csuse{bhookXnote@#1}
\csuse{Xnotefontsize@#1}
\footsplitskips
\setbox0=\vbox{\hsize=\maxdimen
@@ -6916,7 +7158,7 @@
\newcommand*{\para@footgroup}[1]{%
\unvbox\csname #1footins\endcsname
\makehboxofhboxes
- \setbox0=\hbox{\unhbox0 \removehboxes}%
+ \setbox0=\hbox{{\csuse{Xnotefontsize@#1}\csuse{txtbeforeXnotes@#1}}\unhbox0 \removehboxes}%
\csuse{Xnotefontsize@#1}
\noindent\unhbox0\par}
@@ -6932,7 +7174,7 @@
\@nameuse{#1footnoterule}%
\unvbox\csname mp#1footins\endcsname
\makehboxofhboxes
- \setbox0=\hbox{\unhbox0 \removehboxes}%
+ \setbox0=\hbox{{\csuse{Xnotefontsize@#1}\csuse{txtbeforeXnotes@#1}}\unhbox0 \removehboxes}%
\csuse{Xnotefontsize@#1}
\noindent\unhbox0\par}}
@@ -6958,7 +7200,7 @@
% \end{macro}
%
% \subsubsection{Insertion of the footnotes separator}
-%The command \cs{insertparafootsep}\marg{series} must be called at the begining of \cs{parafootftm} (and like commands).
+%The command \cs{insertparafootsep}\marg{series} must be called at the beginning of \cs{parafootftm} (and like commands).
% \begin{macro}{\prevpage@num}
% \begin{macro}{\insertparafootsep}
% \begin{macrocode}
@@ -7025,6 +7267,7 @@
% \cs{hsize} has been set for the document.
% \begin{macrocode}
\newcommand*{\footthreecol}[1]{%
+ \csgdef{series@display#1}{threecol}
\expandafter\let\csname v#1footnote\endcsname=\threecolvfootnote
\expandafter\let\csname #1footfmt\endcsname=\threecolfootfmt
\expandafter\let\csname #1footgroup\endcsname=\threecolfootgroup
@@ -7095,7 +7338,7 @@
% The arguments are 1)~the note series letter and 2)~the full text
% of the note (including numbers, lemma and text).
% \begin{macrocode}
-\newcommand*{\threecolvfootnote}[2]{%
+\notbool{parapparatus@}{\newcommand*}{\newcommand}{\threecolvfootnote}[2]{%
\insert\csname #1footins\endcsname\bgroup
\csuse{Xnotefontsize@#1}
\footsplitskips
@@ -7116,7 +7359,7 @@
% text of the \verb"-footnote" command 4) optional (for backward compatibility): the series.
%
% \begin{macrocode}
-\newcommandx*{\threecolfootfmt}[4][4=Z]{%
+\notbool{parapparatus@}{\newcommandx*}{\newcommandx}{\threecolfootfmt}[4][4=Z]{%
\normal@pars
\hsize \csuse{hsizethreecol@#4}
\parindent=0pt
@@ -7150,6 +7393,7 @@
% \cs{rigidbalance} directly, without any re-boxing.
% \begin{macrocode}
\newcommand*{\threecolfootgroup}[1]{{\notefontsetup
+ {\csuse{Xnotefontsize@#1}\noindent\csuse{txtbeforeXnotes@#1}}\par
\splittopskip=\ht\strutbox
\expandafter
\rigidbalance\csname #1footins\endcsname \thr@@ \splittopskip}}
@@ -7163,6 +7407,7 @@
\vskip\skip\@nameuse{mp#1footins}
\normalcolor
\@nameuse{#1footnoterule}
+ {\csuse{Xnotefontsize@#1}\noindent\csuse{txtbeforeXnotes@#1}}\par
\splittopskip=\ht\strutbox
\expandafter
\rigidbalance\csname mp#1footins\endcsname \thr@@ \splittopskip}}
@@ -7178,6 +7423,7 @@
% \cs{hsize} has been set for the document.
% \begin{macrocode}
\newcommand*{\foottwocol}[1]{%
+ \csgdef{series@display#1}{twocol}
\expandafter\let\csname v#1footnote\endcsname=\twocolvfootnote
\expandafter\let\csname #1footfmt\endcsname=\twocolfootfmt
\expandafter\let\csname #1footgroup\endcsname=\twocolfootgroup
@@ -7209,13 +7455,13 @@
\multiply\dimen\csname #1footins\endcsname \tw@}
% \end{macrocode}
% \begin{macrocode}
-\newcommand*{\twocolvfootnote}[2]{\insert\csname #1footins\endcsname\bgroup
+\notbool{parapparatus@}{\newcommand*}{\newcommand}{\twocolvfootnote}[2]{\insert\csname #1footins\endcsname\bgroup
\csuse{Xnotefontsize@#1}
\footsplitskips
\csname #1footfmt\endcsname #2[#1]\egroup}
% \end{macrocode}
% \begin{macrocode}
-\newcommandx*{\twocolfootfmt}[4][4=Z]{% 4th arg is optional, for backward compatibility
+\notbool{parapparatus@}{\newcommandx*}{\newcommandx}{\twocolfootfmt}[4][4=Z]{% 4th arg is optional, for backward compatibility
\normal@pars
\hsize \csuse{hsizetwocol@#4}
\parindent=0pt
@@ -7233,6 +7479,7 @@
% \end{macrocode}
% \begin{macrocode}
\newcommand*{\twocolfootgroup}[1]{{\csuse{Xnotefontsize@#1}
+ {\csuse{Xnotefontsize@#1}\noindent\csuse{txtbeforeXnotes@#1}}\par
\splittopskip=\ht\strutbox
\expandafter
\rigidbalance\csname #1footins\endcsname \tw@ \splittopskip}}
@@ -7256,6 +7503,7 @@
\vskip\skip\@nameuse{mp#1footins}
\normalcolor
\@nameuse{#1footnoterule}
+ {\csuse{Xnotefontsize@#1}\noindent\csuse{txtbeforeXnotes@#1}}\par
\splittopskip=\ht\strutbox
\expandafter
\rigidbalance\csname mp#1footins\endcsname \tw@ \splittopskip}}
@@ -7454,6 +7702,7 @@
% \begin{macrocode}
\newcommand*{\normalvfootnoteX}[2]{%
\insert\@nameuse{footins#1}\bgroup
+ \csuse{bhooknoteX@#1}
\csuse{notefontsizeX@#1}
\footsplitskips
\spaceskip=\z@skip \xspaceskip=\z@skip
@@ -7468,6 +7717,7 @@
\newcommand*{\mpnormalvfootnoteX}[2]{%
\global\setbox\@nameuse{mpfootins#1}\vbox{%
\unvbox\@nameuse{mpfootins#1}
+ \csuse{bhooknoteX@#1}
\csuse{notefontsizeX@#1}
\hsize\columnwidth
\@parboxrestore
@@ -7505,7 +7755,13 @@
% starting macro used in the output routine.
% \begin{macrocode}
\newcommand*{\normalfootstartX}[1]{%
- \vskip\skip\@nameuse{footins#1}%
+ \ifdimequal{0pt}{\prenotesX@}{}%
+ {%
+ \iftoggle{prenotesX@}{%
+ \togglefalse{prenotesX@} \skip\csname footins#1\endcsname=\csuse{prenotesX@}}%
+ {}%
+ }%
+ \vskip\skip\csname footins#1\endcsname%
\leftskip=\z@
\rightskip=\z@
\@nameuse{footnoterule#1}}
@@ -7589,6 +7845,7 @@
% each series.
% \begin{macrocode}
\newcommand*{\footnormalX}[1]{%
+ \csgdef{series@displayX#1}{normalX}
\expandafter\let\csname footstart#1\endcsname=\normalfootstartX
\@namedef{@footnotemark#1}{\normal@footnotemarkX{#1}}
\@namedef{bodyfootmark#1}{\normalbodyfootmarkX{#1}}
@@ -7599,17 +7856,16 @@
\expandafter\let\csname footgroup#1\endcsname=\normalfootgroupX
\expandafter\let\csname footnoterule#1\endcsname=\normalfootnoteruleX
\count\csname footins#1\endcsname=1000
- \dimen\csname footins#1\endcsname=\ledfootinsdim
- \skip\csname footins#1\endcsname=1.2em \@plus .6em \@minus .6em
+ \dimen\csname footins#1\endcsname=\csuse{maxhnotesX@#1}
+ \skip\csname footins#1\endcsname=\csuse{beforenotesX@#1}
% \end{macrocode}
% Aditions for minipages.
% \begin{macrocode}
\expandafter\let\csname mpvfootnote#1\endcsname=\mpnormalvfootnoteX
\expandafter\let\csname mpfootgroup#1\endcsname=\mpnormalfootgroupX
\count\csname mpfootins#1\endcsname=1000
-% \dimen\csname mpfootins#1\endcsname=0.8\vsize
- \dimen\csname mpfootins#1\endcsname=\ledfootinsdim
- \skip\csname mpfootins#1\endcsname=1.2em \@plus .6em \@minus .6em
+ \dimen\csname mpfootins#1\endcsname=\csuse{maxhnotesX@#1}
+ \skip\csname mpfootins#1\endcsname=\csuse{beforenotesX@#1}
}
% \end{macrocode}
@@ -7624,6 +7880,7 @@
% \cs{foottwocolX}\marg{series}
% \begin{macrocode}
\newcommand*{\foottwocolX}[1]{%
+ \csgdef{series@displayX#1}{twocol}
\expandafter\let\csname regvfootnote#1\endcsname=\twocolvfootnoteX
\expandafter\let\csname footfmt#1\endcsname=\twocolfootfmtX
\expandafter\let\csname footgroup#1\endcsname=\twocolfootgroupX
@@ -7711,6 +7968,7 @@
% \cs{footthreecolX}\marg{series}
% \begin{macrocode}
\newcommand*{\footthreecolX}[1]{%
+ \csgdef{series@displayX#1}{threecol}
\expandafter\let\csname regvfootnote#1\endcsname=\threecolvfootnoteX
\expandafter\let\csname footfmt#1\endcsname=\threecolfootfmtX
\expandafter\let\csname footgroup#1\endcsname=\threecolfootgroupX
@@ -7795,6 +8053,7 @@
% \cs{footparagraphX}\marg{series}
% \begin{macrocode}
\newcommand*{\footparagraphX}[1]{%
+ \csgdef{series@displayX#1}{paragraph}
\expandafter\newcount\csname prevpage#1@num\endcsname
\expandafter\let\csname footstart#1\endcsname=\parafootstartX
\expandafter\let\csname regvfootnote#1\endcsname=\para@vfootnoteX
@@ -7829,7 +8088,13 @@
% \cs{parafootstartX}\marg{series}
% \begin{macrocode}
\newcommand*{\parafootstartX}[1]{%
- \vskip\skip\@nameuse{footins#1}%
+ \ifdimequal{0pt}{\prenotesX@}{}%
+ {%
+ \iftoggle{prenotesX@}{%
+ \togglefalse{prenotesX@}\skip\csname footins#1\endcsname=\csuse{prenotesX@}}%
+ {}%
+ }%
+ \vskip\skip\csname footins#1\endcsname%
\leftskip=\z@
\rightskip=\z@
\parindent=\z@
@@ -7846,6 +8111,7 @@
\newcommand*{\para@vfootnoteX}[2]{%
\insert\csname footins#1\endcsname
\bgroup
+ \csuse{bhooknoteX@#1}
\csuse{notefontsizeX@#1}
\footsplitskips
\setbox0=\vbox{\hsize=\maxdimen
@@ -7859,6 +8125,7 @@
\newcommand*{\mppara@vfootnoteX}[2]{%
\global\setbox\@nameuse{mpfootins#1}\vbox{%
\unvbox\@nameuse{mpfootins#1}
+ \csuse{bhooknoteX@#1}
\csuse{notefontsizeX@#1}
\footsplitskips
\setbox0=\vbox{\hsize=\maxdimen
@@ -8001,9 +8268,15 @@
\csgdef{Xnotefontsize@#1}{\notefontsetup}%
\csgdef{notefontsizeX@#1}{\notefontsetup}%
\csgdef{Xendnotefontsize@#1}{\notefontsetup}%
+ \csgdef{bhooknoteX@#1}{}%
+ \csgdef{bhookXnote@#1}{}%
+ \csgdef{bhookXendnote@#1}{}%
\csgdef{boxlinenum@#1}{0pt}%
\csgdef{boxsymlinenum@#1}{0pt}%
\newtoggle{numberonlyfirstinline@#1}%
+ \newtoggle{numberonlyfirstintwolines@#1}%
+ \newtoggle{onlypstartinfootnote@#1}%
+ \newtoggle{pstartinfootnote@#1}%
\csgdef{symlinenum@#1}{\symplinenum}%
\newtoggle{nonumberinfootnote@#1}%
\csgdef{beforenumberinfootnote@#1}{0pt}%
@@ -8017,6 +8290,11 @@
\csgdef{inplaceoflemmaseparator@#1}{1em}%
\csgdef{afternote@#1}{1em plus.4em minus.4em}%
\csgdef{parafootsep@#1}{\parafootftmsep}%
+ \csgdef{beforeXnotes@#1}{1.2em \@plus .6em \@minus .6em}
+ \csgdef{beforenotesX@#1}{1.2em \@plus .6em \@minus .6em}
+ \csgdef{txtbeforeXnotes@#1}{}
+ \csgdef{maxhnotesX@#1}{\ledfootinsdim}%
+ \csgdef{maxhXnotes@#1}{\ledfootinsdim}
% \end{macrocode}
% \subsubsection{Create inserts, needed to add notes in foot}
% Concerning inserts, see chapter 15 of the TeXBook by D. Knuth
@@ -8031,7 +8309,7 @@
% Note the double \# in command: it's because command is made inside another command.
% \begin{macrocode}
- \global\expandafter\newcommand\expandafter *\csname #1footnote\endcsname[2][]{%
+ \global\notbool{parapparatus@}{\expandafter\newcommand\expandafter *}{\expandafter\newcommand}\csname #1footnote\endcsname[2][]{%
\begingroup%
\newcommand{\content}{##2}%
\ifnumberedpar@
@@ -8055,8 +8333,9 @@
\endgroup
}
% \end{macrocode}
-%Set standard display
+%Set standard display and remember the display.
% \begin{macrocode}
+ \csgdef{series@display#1}{}
\footnormal{#1}
% \end{macrocode}
%\subsubsection{Create tools for familiar footnotes (\cs{footnoteX})}
@@ -8080,6 +8359,7 @@
% \end{macrocode}
% Don't forget to initialize series
% \begin{macrocode}
+ \csgdef{series@displayX#1}{}
\footnormalX{#1}
% \end{macrocode}
% \subsubsection{The endnotes}
@@ -8125,28 +8405,60 @@
% \begin{macrocode}
\newseries{A,B,C,D,E,Z}
% \end{macrocode}
+% \subsubsection{Some tools}
+% \changes{v1.1}{2012/09/25}{New tools to change order of series}
+% \begin{macro}{\firstseries}
+% \cs{seriesatbegin}\marg{s} changes the order of series, to put the series \meta{s} at the beginning of the list.
+% The series can be the result of a command.
+% \begin{macrocode}
+\newcommand{\seriesatbegin}[1]{
+ \edef\series{#1}
+ \def\new{}
+ \listeadd{\new}{\series}
+ \renewcommand{\do}[1]{\ifcsstring{series}{##1}{}{\listadd{\new}{##1}}}
+ \dolistloop{\@series}
+ \xdef\@series{\new}
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\seriesatend}
+% And \cs{seriesatend} moves the series to the end of the list.
+% \begin{macrocode}
+\newcommand{\seriesatend}[1]{
+ \edef\series{#1}
+ \def\new{}
+ \renewcommand{\do}[1]{\ifcsstring{series}{##1}{}{\listadd{\new}{##1}}}
+ \dolistloop{\@series}
+ \listeadd{\new}{\series}
+ \xdef\@series{\new}
+}
+% \end{macrocode}
+% \end{macro}
% \subsection{Display}
% \changes{v1.0}{2012/09/15}{New generic commands to customize footnote display.}
% \subsubsection{Options}
% \begin{macro}{\settoggle@series}
+% \changes{v1.1}{2012/09/25}{\cs{settoggle@series} switch the global value of the toggle, not only the local value.}
% \cs{settoggle@series}\cs{series}{toggle}{value} is a generic command to switch one toggle for one series.
% \begin{macrocode}
\newcommand{\settoggle@series}[3]{%
- \renewcommand{\do}[1]{\settoggle{#2@##1}{#3}}
+ \renewcommand{\do}[1]{\global\settoggle{#2@##1}{#3}}
\ifstrempty{#1}{%
\dolistloop{\@series}%
- }%
- {%
+ }%
+ {%
\docsvlist{#1}%
- }%
+ }%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\setcommand@series}
% \cs{setcommand@series}\marg{series}\marg{command}\marg{value} is a generic command to change one command for one series.
% \begin{macrocode}
-\newcommand{\setcommand@series}[3]{%
- \renewcommand{\do}[1]{\csgdef{#2@##1}{#3}}
+\newcommandx{\setcommand@series}[4][4]{%
+ \renewcommand{\do}[1]{
+ \csgdef{#2@##1}{#3}
+ \ifstrequal{#4}{reload}{\csuse{foot\csuse{series@display##1}}{##1}}{}}
\ifstrempty{#1}{%
\dolistloop{\@series}%
}%
@@ -8176,9 +8488,15 @@
\newhookcommand@series{Xnotenumfont}
+\newhookcommand@series{notenumfontX}
+
\newhookcommand@series{Xendnotenumfont}
-\newhookcommand@series{notenumfontX}
+\newhookcommand@series{bhooknoteX}
+
+\newhookcommand@series{bhookXnote}
+
+\newhookcommand@series{bhookXendnote}
\newhookcommand@series{Xnotefontsize}
@@ -8214,8 +8532,28 @@
\newhookcommand@series{afternote}
+\newhookcommand@series{txtbeforeXnotes}
+
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\newhookcommand@series@reload}
+% \cs{newhookcommand@series@reload} does the same thing as \cs{newhookcommand@series}
+% but the commands created by this macro also reload the series displaying (normal, paragraph, twocol)
+% \begin{macrocode}
+\newcommand{\newhookcommand@series@reload}[1]{%
+ \global\expandafter\newcommand\expandafter*\csname #1\endcsname[2][]{%
+ \csuse{setcommand@series}{##1}{#1}{##2}[reload]
+ }%
+}
+\newhookcommand@series@reload{beforeXnotes}
+
+\newhookcommand@series@reload{beforenotesX}
+
+\newhookcommand@series@reload{maxhnotesX}
+
+\newhookcommand@series@reload{maxhXnotes}
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{\newhooktoggle@series}
%\cs{newhooktoggle@series}\cs{command names} is a generic command to add new commands for new toggle hook, like \cs{numberonlyfirstinline}.
% \begin{macrocode}
@@ -8223,7 +8561,10 @@
\global\expandafter\newcommandx\expandafter*\csname #1\endcsname[2][1,2={true},usedefault]{\settoggle@series{##1}{#1}{##2}}%
}
\newhooktoggle@series{numberonlyfirstinline}
+\newhooktoggle@series{numberonlyfirstintwolines}
\newhooktoggle@series{nonumberinfootnote}
+\newhooktoggle@series{pstartinfootnote}
+\newhooktoggle@series{onlypstartinfootnote}
% \end{macrocode}
% \end{macro}
% \subsubsection{Old commands, kept for backward compatibility}
@@ -8288,8 +8629,18 @@
% It controls whether the line number is printed or not, according to the previous options. Its first argument is the information about lines, its second is the series of the footnote.
% \begin{macrocode}
\newcommand{\printlinefootnote}[2]{%
+ \def\extractline@##1|##2|##3|##4|##5|##6|##7|{##2}%
+ \def\extractsubline@##1|##2|##3|##4|##5|##6|##7|{##3}%
+ \def\extractendline@##1|##2|##3|##4|##5|##6|##7|{##5}%
+ \def\extractendsubline@##1|##2|##3|##4|##5|##6|##7|{##6}%
+ \iftoggle{numberonlyfirstintwolines@#2}{%
+ \edef\lineinfo@{\extractline@ #1| - \extractsubline@ #1| - \extractendline@ #1| - \extractendsubline@ #1|}%
+ }%
+ {%
+ \edef\lineinfo@{\extractline@ #1| - \extractsubline@ #1|}%
+ }%
\iftoggle{nonum@}{%Try if the line number must printed for this specific not (by default, yes)
- \hspace{\csuse{inplaceofnumber@#2}}%
+ \hspace{\csuse{inplaceofnumber@#2}}%
}%
{%
{%
@@ -8302,7 +8653,7 @@
{%
\ifcsdef{prevline#2}%
{%Be sure the \prevline exists.
- \ifnumequal{\csuse{prevline#2}}{\line@num}%Try it
+ \ifcsequal{prevline#2}{lineinfo@}%Try it
{%
\ifcsempty{symlinenum@#2}% Try if a symbol is define
{%
@@ -8310,16 +8661,20 @@
}%
{\hspace{\csuse{beforesymlinenum@#2}}\csuse{Xnotenumfont@#2}%
\ifdimequal{\csuse{boxsymlinenum@#2}}{0pt}%
- {\csuse{symlinenum@#2}}%
- {\hbox to \csuse{boxsymlinenum@#2}{\csuse{symlinenum@#2}\hfill}}%
- \hspace{\csuse{aftersymlinenum@#2}}}%
+ {\csuse{symlinenum@#2}}%
+ {\hbox to \csuse{boxsymlinenum@#2}{\csuse{symlinenum@#2}\hfill}}%
+ \hspace{\csuse{aftersymlinenum@#2}}}%
}%
{%
\hspace{\csuse{beforenumberinfootnote@#2}}\csuse{Xnotenumfont@#2}%
\ifdimequal{\csuse{boxlinenum@#2}}{0pt}{%
+ \iftoggle{pstartinfootnote@#2}{\printpstart}{}%
\printlines#1|}%
{%
- \hbox to \csuse{boxlinenum@#2}{\printlines#1|\hfill}%
+ \hbox to \csuse{boxlinenum@#2}{%
+ \iftoggle{pstartinfootnote@#2}{\printpstart}{}%
+ \iftoggle{onlypstartinfootnote@#2}{}{\printlines#1|}%
+ \hfill}%
}%
\hspace{\csuse{afternumberinfootnote@#2}}%
}%
@@ -8327,9 +8682,13 @@
{%
\hspace{\csuse{beforenumberinfootnote@#2}}\csuse{Xnotenumfont@#2}%
\ifdimequal{\csuse{boxlinenum@#2}}{0pt}{%
- \printlines#1|}%
+ \iftoggle{pstartinfootnote@#2}{\printpstart}{}%
+ \iftoggle{onlypstartinfootnote@#2}{}{\printlines#1|}}%
{%
- \hbox to \csuse{boxlinenum@#2}{\printlines#1|\hfill}%
+ \hbox to \csuse{boxlinenum@#2}{%
+ \iftoggle{pstartinfootnote@#2}{\printpstart}{}%
+ \iftoggle{onlypstartinfootnote@#2}{}{\printlines#1|}%
+ \hfill}%
}%
\hspace{\csuse{afternumberinfootnote@#2}}%
}%
@@ -8337,13 +8696,18 @@
{%
\hspace{\csuse{beforenumberinfootnote@#2}}\csuse{Xnotenumfont@#2}%
\ifdimequal{\csuse{boxlinenum@#2}}{0pt}{%
- \printlines#1|}%
+ \iftoggle{pstartinfootnote@#2}{\printpstart}{}%
+ \iftoggle{onlypstartinfootnote@#2}{}{\printlines#1|}%
+ }%
{%
- \hbox to \csuse{boxlinenum@#2}{\printlines#1|\hfill}%
+ \hbox to \csuse{boxlinenum@#2}{%
+ \iftoggle{pstartinfootnote@#2}{\printpstart}{}%
+ \iftoggle{onlypstartinfootnote@#2}{}{\printlines#1|}%
+ \hfill}%
}%
\hspace{\csuse{afternumberinfootnote@#2}}%
}%
- \csnumgdef{prevline#2}{\line@num}%
+ \csxdef{prevline#2}{\lineinfo@}%
}%
}%
}%
@@ -9132,7 +9496,7 @@
% \changes{v0.2.2}{2003/11/05}{Used \cs{providecommand} for \cs{@gobblethree}
% to avoid clash with the amsfonts package}
% \begin{macrocode}
-\def\endprint#1#2#3#4{{\csuse{Xendnotefontsize@#4}{\csuse{Xendnotenumfont@#4}\printendlines#1|}%
+\def\endprint#1#2#3#4{{\csuse{bhookXendnote@#4}\csuse{Xendnotefontsize@#4}{\csuse{Xendnotenumfont@#4}\printendlines#1|}%
\enspace{\select@lemmafont#1|#2}\enskip#3\par}}
\providecommand*{\@gobblethree}[3]{}
@@ -9435,10 +9799,11 @@
% \begin{macro}{\vl@drsnote}
% \begin{macro}{\vl@dcsnote}
% Put the left/right text into boxes, but just save the moveable text.
+% \cs{l@dcsnotetext} is a etoolbox list (comma separated)
% \begin{macrocode}
\newcommand*{\vl@dlsnote}[1]{\setl@dlp@rbox{#1}}
\newcommand*{\vl@drsnote}[1]{\setl@drp@rbox{#1}}
-\newcommand*{\vl@dcsnote}[1]{\gdef\l@dcsnotetext{#1}}
+\newcommand*{\vl@dcsnote}[1]{\listgadd{\l@dcsnotetext}{#1}}
% \end{macrocode}
% \end{macro}
@@ -9461,7 +9826,6 @@
\else
=\vbox to 0.70\baselineskip{\strut#1\vss}%
\fi}}
-%% \global\setbox\l@dlp@rbox=\vbox to\z@{#3\vss}}}% aligns on top line
\newcommand*{\setl@drp@rbox}[1]{%
{\parindent\z@\hsize=\ledrsnotewidth\ledrsnotefontsetup
\global\setbox\l@drp@rbox
@@ -9476,30 +9840,43 @@
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\savel@dcsnote}
-% \begin{macro}{\l@dcsnotetext}
-% Save the moveable note text in \cs{l@dcsnotetext}.
-% \begin{macrocode}
-\newcommand*{\savel@dcsnote}[3]{%
- \gdef\l@dcsnotetext{#3}}
-
-% \end{macrocode}
-% \end{macro}
+% \begin{macro}{\sidenotesep}
+% This macro is used to separate sidenotes of the same line.
+% \begin{macrocode}
+\newcommand{\sidenotesep}{, }
+% \end{macrocode}
% \end{macro}
-%
% \begin{macro}{\affixside@note}
% This macro puts any moveable sidenote text into the left or right sidenote
% box, depending on which margin it is meant to go in. It's a very much
% stripped down version of \cs{affixlin@num}.
+%
+% Before do it, we concatenate all moveable sidenotes of the line, using \cs{sidenotesep} as separator.
+% It's the result that we put on the sidenote.
% \begin{macrocode}
\newcommand*{\affixside@note}{%
+ \def\sidenotecontent@{}%
+ \numdef{\itemcount@}{0}%
+ \renewcommand{\do}[1]{%
+ \ifnumequal{\itemcount@}{0}%
+ {%
+ \appto\sidenotecontent@{##1}}% Not print not separator before the 1st note
+ {\appto\sidenotecontent@{\sidenotesep ##1}%
+ }%
+ \numdef{\itemcount@}{\itemcount@+1}%
+ }%
+ \dolistloop{\l@dcsnotetext}%
+ \ifnumgreater{\itemcount@}{1}{\eledmac@warning{\itemcount@\space sidenotes on line \the\line@num\space p. \the\page@num,}}{}
+% \end{macrocode}
+% And now, the main part of the macro
+% \begin{macrocode}
\gdef\@templ@d{}%
\ifx\@templ@d\l@dcsnotetext \else
\if@twocolumn
\if@firstcolumn
- \setl@dlp@rbox{\l@dcsnotetext}%
+ \setl@dlp@rbox{##1}{\sidenotecontent@}%
\else
- \setl@drp@rbox{\l@dcsnotetext}%
+ \setl@drp@rbox{\sidenotecontent@}%
\fi
\else
\@l@dtempcntb=\sidenote@margin
@@ -9507,13 +9884,12 @@
\advance\@l@dtempcntb by\page@num
\fi
\ifodd\@l@dtempcntb
- \setl@drp@rbox{\l@dcsnotetext}%
+ \setl@drp@rbox{\sidenotecontent@}%
\else
- \setl@dlp@rbox{\l@dcsnotetext}%
+ \setl@dlp@rbox{\sidenotecontent@}%
\fi
\fi
- \fi}
-
+\fi}
% \end{macrocode}
% \end{macro}
%