diff options
author | Karl Berry <karl@freefriends.org> | 2013-12-18 22:03:54 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-12-18 22:03:54 +0000 |
commit | 00be60da8df9f90d4ad3914ed813951c0639b409 (patch) | |
tree | d5bcf7fdfd0e514b240cd782008473fa76b10f8a /Master/texmf-dist/source/latex/eledmac/eledmac.dtx | |
parent | 2953c24114166c782e7828ec3aaf9b8d594ef9d1 (diff) |
eledmac (18dec13)
git-svn-id: svn://tug.org/texlive/trunk@32441 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/eledmac/eledmac.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/eledmac/eledmac.dtx | 644 |
1 files changed, 396 insertions, 248 deletions
diff --git a/Master/texmf-dist/source/latex/eledmac/eledmac.dtx b/Master/texmf-dist/source/latex/eledmac/eledmac.dtx index e6bf5d84352..3ffe9d3d20d 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{8620} +% \CheckSum{8881} % % \makeatletter % \newcommand*{\DescribeIt}{\leavevmode\@bsphack\begingroup\MakePrivateLetters @@ -177,6 +177,7 @@ % \changes{v1.4.6}{2013/04/15}{Bug with memoir class introduced by 1.4.5.} % \changes{v1.4.8}{2013/07/02}{Corrects a bug with parallel texts introduced by 1.1.} % \changes{v1.6.1}{2013/10/27}{Corrects a false hanging verse when a verse is exactly the length of a line.} +% \changes{v1.8.0}{2013/12/13}{Compatibility with parledgroup option of eledpar package.} % \hyphenation{man-u-script man-u-scripts} % % \newcommand{\Lpack}[1]{\textsf{#1}} @@ -2336,6 +2337,10 @@ % \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} +% +% \changes{v1.8.0}{2013/12/13}{Add \cs{ledsecnolinenumber} option.} +% If you use \Lpack{eledpar}, you must use these commands to have parallel sectioning. +% However, if you want not to have lineation for sectioning commands, use the \verb+ledsecnolinenumber+ option when loading eledmac. Or add \cs{ledsecnolinenumbertrue} in your preamble. % \changes{v1.2}{2012/10/13}{Add \cs{ledsectnotoc} command.} % \DescribeMacro{\ledsectnotoc} % You can create a table of contents that indexes only the titles that appear on the left side of the edition: @@ -2747,7 +2752,7 @@ % \begin{macrocode} %<*code> \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{eledmac}[2013/11/08 v1.7.0 LaTeX port of EDMAC] +\ProvidesPackage{eledmac}[2013/12/15 v1.8.1 LaTeX port of EDMAC] % \end{macrocode} % % Generally, these are the modifications to the original. @@ -2775,12 +2780,15 @@ \newif\ifparapparatus@ \newif\ifnoquotation@ \newif\iflednopbinverse +\newif\ifparledgroup +\newif\ifledsecnolinenumber \parapparatus@false \DeclareOption{noquotation}{\noquotation@true} \DeclareOption{final}{\ledfinaltrue} \DeclareOption{draft}{\ledfinalfalse} \DeclareOption{parapparatus}{\parapparatus@true} \DeclareOption{nopbinverse}{\lednopbinversetrue} +\DeclareOption{ledsecnolinenumber}{\ledsecnolinenumbertrue} \ExecuteOptions{final} % \end{macrocode} % Use the starred form of \verb?\ProcessOptions? which executes options in @@ -3219,6 +3227,7 @@ \global\let\next@page@num=\relax \global\let\sub@change=\relax \resetprevline@ + \resetprevpage@num } % \end{macrocode} @@ -3241,52 +3250,53 @@ % \changes{v1.2}{2012/10/08}{Compatibility of \cs{ledchapter} with the \emph{memoir} class.} % \changes{v1.3}{2012/11/01}{\emph{Quotation} and {quote} environment inside the numbering sections.} % \changes{v1.4.1}{2012/11/16}{New option \emph{noquotation}.} -% \changes{v1.4.7}{2012/06/07}{Compatibility of sectionning commands with \cs{autopar}.} +% \changes{v1.4.7}{2012/06/07}{Compatibility of sectioning commands with \cs{autopar}.} +% \changes{v1.8.0}{2013/12/13}{Correction of sectioning commands in parallel texts.} % \cs{initnumbering@sectcmd} defines sectioning commands inside numbered section. % It also defines quotation environment. -% Note: this supposes that the user didn't change \cs{chapter}. +% Note: this assumes that the 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% + \ifl@dpairing\else\leavevmode\fi\pend\vspace{3.5ex \@plus 1ex \@minus .2ex}\ifl@dpairing\else\skipnumbering\fi%% \pstart% - \leavevmode\section[##1]{##2}\leavevmode\vspace{2.3ex \@plus.2ex}\skipnumbering\pend% + \leavevmode\ifledsecnolinenumber\skipnumbering\fi\section[##1]{##2}\leavevmode\vspace{2.3ex \@plus.2ex}\skipnumbering\pend% \vspace{-2\parskip}\vspace{-2\baselineskip}% \ifautopar\else\pstart\fi } \WithSuffix\newcommand\ledsection*[1]{% - \leavevmode\pend\vspace{3.5ex \@plus 1ex \@minus .2ex}\skipnumbering% + \ifl@dpairing\else\leavevmode\fi\pend\vspace{3.5ex \@plus 1ex \@minus .2ex}\ifl@dpairing\else\skipnumbering\fi% \pstart% - \leavevmode\section*{##1}\leavevmode\vspace{2.3ex \@plus.2ex}\skipnumbering\pend% + \leavevmode\ifledsecnolinenumber\skipnumbering\fi\section*{##1}\leavevmode\vspace{2.3ex \@plus.2ex}\skipnumbering\pend% \vspace{-2\parskip}\vspace{-2\baselineskip}% \ifautopar\else\pstart\fi } \newcommand{\ledsubsection}[2][]{% - \leavevmode\pend\vspace{3.5ex \@plus 1ex \@minus .2ex}\skipnumbering% + \ifl@dpairing\else\leavevmode\fi\pend\vspace{3.5ex \@plus 1ex \@minus .2ex}\ifl@dpairing\else\skipnumbering\fi% \pstart% - \leavevmode\subsection[##1]{##2}\leavevmode\vspace{1.5ex \@plus .2ex}\skipnumbering\pend% + \leavevmode\ifledsecnolinenumber\skipnumbering\fi\subsection[##1]{##2}\leavevmode\vspace{1.5ex \@plus .2ex}\skipnumbering\pend% \vspace{-2\parskip}\vspace{-2\baselineskip}% \ifautopar\else\pstart\fi } \WithSuffix\newcommand\ledsubsection*[1]{% - \leavevmode\pend\vspace{3.5ex \@plus 1ex \@minus .2ex}\skipnumbering% + \ifl@dpairing\else\leavevmode\fi\pend\vspace{3.5ex \@plus 1ex \@minus .2ex}\ifl@dpairing\else\skipnumbering\fi% \pstart% - \leavevmode\subsection*{##1}\leavevmode\vspace{1.5ex \@plus .2ex}\skipnumbering\pend% + \leavevmode\ifledsecnolinenumber\skipnumbering\fi\subsection*{##1}\leavevmode\vspace{1.5ex \@plus .2ex}\skipnumbering\pend% \vspace{-2\parskip}\vspace{-2\baselineskip}% \ifautopar\else\pstart\fi } \newcommand{\ledsubsubsection}[2][]{% - \leavevmode\pend\vspace{3.5ex \@plus 1ex \@minus .2ex}\skipnumbering% + \ifl@dpairing\else\leavevmode\fi\pend\vspace{3.5ex \@plus 1ex \@minus .2ex}\ifl@dpairing\else\skipnumbering\fi% \pstart% - \leavevmode\subsubsection[##1]{##2}\leavevmode\vspace{1.5ex \@plus .2ex}\skipnumbering\pend% + \leavevmode\ifledsecnolinenumber\skipnumbering\fi\subsubsection[##1]{##2}\leavevmode\vspace{1.5ex \@plus .2ex}\skipnumbering\pend% \vspace{-2\parskip}\vspace{-2\baselineskip}% \ifautopar\else\pstart\fi } \WithSuffix\newcommand\ledsubsubsection*[1]{% - \leavevmode\pend\vspace{3.5ex \@plus 1ex \@minus .2ex}\skipnumbering% + \ifl@dpairing\else\leavevmode\fi\pend\vspace{3.5ex \@plus 1ex \@minus .2ex}\ifl@dpairing\else\skipnumbering\fi% \pstart% - \leavevmode\subsubsection*{##1}\leavevmode\vspace{1.5ex \@plus .2ex}\skipnumbering\pend% + \leavevmode\ifledsecnolinenumber\skipnumbering\fi\subsubsection*{##1}\leavevmode\vspace{1.5ex \@plus .2ex}\skipnumbering\pend% \vspace{-2\parskip}\vspace{-2\baselineskip}% \ifautopar\else\pstart\fi } @@ -4135,10 +4145,10 @@ % \end{macro} % % \DescribeMacro{\resetprevline@} -% Inside the apparatus, at each note, the line number is memorized in a macro called \cs{prevlineX}, +% Inside the apparatus, at each note, the line number is stored in a macro called \cs{prevlineX}, % where X is the letter of the current series. % This macro is called when using \cs{numberonlyfirstinline}. -% This maco must be reset at the same time as the line number. +% This macro must be reset at the same time as the line number. % The \cs{resetprevline@} does this resetting for every series. % \begin{macro}{\resetprevline@} % \begin{macrocode} @@ -4148,6 +4158,20 @@ } % \end{macrocode} % \end{macro} +% \DescribeMacro{\resetprevpage@num} +% Inside the apparatus, at each note, the page number is stored in a macro called \cs{prevpageX@num}, +% where X is the letter of the current series. +% This macro is called when using \cs{parafootsep}. +% This macro must be reset at the begining of each numbered section +% The \cs{resetprevpage@} command resets this macro for every series. +% \begin{macro}{\resetprevpage@} +% \begin{macrocode} +\newcommand*{\resetprevpage@num}{% + \def\do##1{\ifcsdef{prevpage##1@num}{\global\csname prevpage##1@num\endcsname=0}{}}% + \dolistloop{\@series}% +} +% \end{macrocode} +% \end{macro} % \subsection{Reading the line-list file} % % @@ -4449,10 +4473,10 @@ \newcommand*{\sub@on}{\ifsublines@ \let\sub@change=\relax \else - \def\sub@change{1}% + \def\sub@changes{1}% \fi} \newcommand*{\sub@off}{\ifsublines@ - \def\sub@change{-1}% + \def\sub@changes{-1}% \else \let\sub@change=\relax \fi} @@ -6096,7 +6120,7 @@ % No number is attached if \cs{ifnumberline} is FALSE (the normal value is TRUE). % \changes{v0.15}{2012/06/11}{Line numbering can be disabled.} % \begin{macrocode} -\ifnumberline +\ifledgroupnotesL@\else\ifnumberline \ifl@dskipnumber \global\l@dskipnumberfalse \else @@ -6228,6 +6252,7 @@ \f@x@l@cks \fi \fi +\fi } % \end{macrocode} @@ -7081,9 +7106,21 @@ % \begin{macrocode} \newcommand*{\mpnormalfootgroup}[1]{{ \vskip\skip\@nameuse{mp#1footins} - \normalcolor - \@nameuse{#1footnoterule} - {\csuse{Xnotefontsize@#1}\noindent\csuse{txtbeforeXnotes@#1}} + \ifl@dpairing\ifparledgroup% + \leavevmode\marks\parledgroup@{begin}% + \marks\parledgroup@series{#1}% + \marks\parledgroup@type{Xfootnote}% + \fi\fi\normalcolor% + \ifparledgroup% + \ifl@dpairing% + \else% + \@nameuse{#1footnoterule}% + \fi% + \else% + \@nameuse{#1footnoterule}% + \fi% + \setlength{\parindent}{0pt} + {\csuse{Xnotefontsize@#1}\csuse{txtbeforeXnotes@#1}} \unvbox\csname mp#1footins\endcsname}} % \end{macrocode} @@ -7523,8 +7560,19 @@ % \begin{macrocode} \newcommand*{\mppara@footgroup}[1]{{% \vskip\skip\@nameuse{mp#1footins} - \normalcolor - \@nameuse{#1footnoterule}% + \ifl@dpairing\ifparledgroup% + \leavevmode\marks\parledgroup@{begin}% + \marks\parledgroup@series{#1}% + \marks\parledgroup@type{Xfootnote}% + \fi\fi\normalcolor + \ifparledgroup% + \ifl@dpairing% + \else% + \@nameuse{#1footnoterule}% + \fi% + \else% + \@nameuse{#1footnoterule}% + \fi% \unvbox\csname mp#1footins\endcsname \makehboxofhboxes \setbox0=\hbox{{\csuse{Xnotefontsize@#1}\csuse{txtbeforeXnotes@#1}}\unhbox0 \removehboxes}% @@ -7555,6 +7603,7 @@ % \subsubsection{Insertion of the footnotes separator} %The command \cs{insertparafootsep}\marg{series} must be called at the beginning of \cs{parafootftm} (and like commands). % \begin{macro}{\prevpage@num} +% \changes{v1.8.0}{2013/12/13}{Correct \cs{parafootsep} when using with ledgroup.} % \begin{macro}{\insertparafootsep} % \begin{macrocode} \newcommand{\insertparafootsep}[1]{% @@ -7758,8 +7807,19 @@ % \begin{macrocode} \newcommand*{\mpthreecolfootgroup}[1]{{% \vskip\skip\@nameuse{mp#1footins} - \normalcolor - \@nameuse{#1footnoterule} + \ifl@dpairing\ifparledgroup% + \leavevmode\marks\parledgroup@{begin}% + \marks\parledgroup@series{#1}% + \marks\parledgroup@type{Xfootnote}% + \fi\fi\normalcolor + \ifparledgroup% + \ifl@dpairing% + \else% + \@nameuse{#1footnoterule}% + \fi% + \else% + \@nameuse{#1footnoterule}% + \fi% {\csuse{Xnotefontsize@#1}\noindent\csuse{txtbeforeXnotes@#1}}\par \splittopskip=\ht\strutbox \expandafter @@ -7854,8 +7914,19 @@ % \begin{macrocode} \newcommand*{\mptwocolfootgroup}[1]{{% \vskip\skip\@nameuse{mp#1footins} - \normalcolor - \@nameuse{#1footnoterule} + \ifl@dpairing\ifparledgroup% + \leavevmode\marks\parledgroup@{begin}% + \marks\parledgroup@series{#1}% + \marks\parledgroup@type{Xfootnote}% + \fi\fi\normalcolor + \ifparledgroup% + \ifl@dpairing% + \else% + \@nameuse{#1footnoterule}% + \fi% + \else% + \@nameuse{#1footnoterule}% + \fi% {\csuse{Xnotefontsize@#1}\noindent\csuse{txtbeforeXnotes@#1}}\par \splittopskip=\ht\strutbox \expandafter @@ -8150,8 +8221,19 @@ % \begin{macrocode} \newcommand*{\mpnormalfootgroupX}[1]{% \vskip\skip\@nameuse{mpfootins#1} - \normalcolor - \@nameuse{footnoterule#1} + \ifl@dpairing\ifparledgroup% + \leavevmode\marks\parledgroup@{begin}% + \marks\parledgroup@series{#1}% + \marks\parledgroup@type{footnoteX}% + \fi\fi\normalcolor + \ifparledgroup% + \ifl@dpairing% + \else% + \@nameuse{footnoterule#1}% + \fi% + \else% + \@nameuse{footnoterule#1}% + \fi% \unvbox\@nameuse{mpfootins#1}} % \end{macrocode} @@ -8311,8 +8393,19 @@ \rigidbalance\csname footins#1\endcsname \tw@ \splittopskip}} \newcommand*{\mptwocolfootgroupX}[1]{{% \vskip\skip\@nameuse{mpfootins#1} - \normalcolor - \@nameuse{footnoterule#1} + \ifl@dpairing\ifparledgroup% + \leavevmode\marks\parledgroup@{begin}% + \marks\parledgroup@series{#1}% + \marks\parledgroup@type{footnoteX}% + \fi\fi\normalcolor + \ifparledgroup% + \ifl@dpairing% + \else% + \@nameuse{footnoterule#1}% + \fi% + \else% + \@nameuse{footnoterule#1}% + \fi% \splittopskip=\ht\strutbox \expandafter \rigidbalance\csname mpfootins#1\endcsname \tw@ \splittopskip}} @@ -8401,8 +8494,19 @@ \rigidbalance\csname footins#1\endcsname \thr@@ \splittopskip}} \newcommand*{\mpthreecolfootgroupX}[1]{{% \vskip\skip\@nameuse{mpfootins#1} - \normalcolor - \@nameuse{footnoterule#1} + \ifl@dpairing\ifparledgroup + \leavevmode\marks\parledgroup@{begin}% + \marks\parledgroup@series{#1}% + \marks\parledgroup@type{footnoteX}% + \fi\fi\normalcolor + \ifparledgroup% + \ifl@dpairing% + \else% + \@nameuse{footnoterule#1}% + \fi% + \else% + \@nameuse{footnoterule#1}% + \fi% \splittopskip=\ht\strutbox \expandafter \rigidbalance\csname mpfootins#1\endcsname \thr@@ \splittopskip}} @@ -8533,8 +8637,20 @@ \noindent\unhbox0\par} \newcommand*{\mppara@footgroupX}[1]{{% \vskip\skip\@nameuse{mpfootins#1} - \normalcolor - \@nameuse{footnoterule#1} + \ifl@dpairing\ifparledgroup + \leavevmode% + \leavevmode\marks\parledgroup@{begin}% + \marks\parledgroup@series{#1}% + \marks\parledgroup@type{footnoteX}% + \fi\fi\normalcolor + \ifparledgroup% + \ifl@dpairing% + \else% + \@nameuse{footnoterule#1}% + \fi% + \else% + \@nameuse{footnoterule#1}% + \fi% \unvbox\csname mpfootins#1\endcsname \makehboxofhboxes \setbox0=\hbox{\unhbox0 \removehboxes}% @@ -8595,7 +8711,202 @@ } % \end{macrocode} % \end{macro} +% \section{Endnotes} +% \changes{v1.8.1}{2013/12/15}{Debug endnotes when more than one series is used (change the position where tools for endnotes are defined).} +% \label{endnotes}\relax % +% \begin{macro}{\l@d@end} +% \begin{macro}{\ifl@dend@} +% \begin{macro}{\l@dend@true} +% \begin{macro}{\l@dend@false} +% Endnotes of all varieties are saved up in a file, typically named +% \meta{jobname}\file{.end}. +% \cs{l@d@end} is the output stream number for +% this file, and \verb"\ifl@dend@" is a flag that's \verb"true" when the file is open. +% \begin{macrocode} +\newwrite\l@d@end +\newif\ifl@dend@ +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\l@dend@open} +% \begin{macro}{\l@dend@close} +% \cs{l@dend@open} and \cs{l@dend@close} are the +% macros that are used to open and close the endnote file. Note that +% all our writing to this file is \cs{immediate}: all page and +% line numbers for the endnotes are generated by the same mechanism +% we use for the footnotes, so that there's no need to defer any +% writing to catch information from the output routine. +% \begin{macrocode} +\newcommand{\l@dend@open}[1]{\global\l@dend@true\immediate\openout\l@d@end=#1\relax} +\newcommand{\l@dend@close}{\global\l@dend@false\immediate\closeout\l@d@end} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\l@dend@stuff} +% \cs{l@dend@stuff} is used by \cs{beginnumbering} to +% do everything that's necessary for the endnotes at the +% start of each section: it opens the \cs{l@d@end} file, if necessary, +% and writes the section number to the endnote file. +% \begin{macrocode} +\newcommand{\l@dend@stuff}{% + \ifl@dend@\relax\else + \l@dend@open{\jobname.end}% + \fi + \immediate\write\l@d@end{\string\l@d@section{\the\section@num}}} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\endprint} +% \begin{macro}{\@gobblethree} +% \begin{macro}{\l@d@section} +% The \cs{endprint} here is nearly identical in its +% functioning to \cs{normalfootfmt}. +% +% The endnote file also contains \cs{l@d@section} commands, which +% supply the section numbers from the main text; standard \Eledmac{} does +% nothing with this information, but it's there if you want to write +% custom macros to do something with it. +% \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{bhookXendnote@#4}\csuse{Xendnotefontsize@#4}{\csuse{Xendnotenumfont@#4}\printendlines#1|}% + \enspace{\select@lemmafont#1|#2}\enskip#3\par}} +\providecommand*{\@gobblethree}[3]{} + +\let\l@d@section=\@gobble + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\setprintendlines} +% The \cs{printendlines} macro is similar to \cs{printlines} but is +% for printing endnotes rather than footnotes. +% +% The principal difference between foot- and endnotes is that footnotes +% are printed on the page where they are specified but endnotes +% are printed at a different point in the document. We need an indication +% of the source of an endnote; \cs{setprintendlines} provides this +% by always printing the page number. The coding is slightly simpler than +% \cs{setprintlines}. +% +% First of all, we print the second page number only if +% the ending page number is different +% from the starting page number.\phantomsection\label{printendlines} +% \changes{v0.7}{2005/02/18}{Added \cs{setprintendlines} for use by +% \cs{printendlines}} +% \begin{macrocode} +\newcommand*{\setprintendlines}[6]{% + \l@d@pnumfalse \l@d@dashfalse + \ifnum#4=#1 \else + \l@d@pnumtrue + \l@d@dashtrue + \fi +% \end{macrocode} +% +% We print the ending line number if\/: (1)~we're printing the ending +% page number, or (2)~it's different from the starting line number. +% \begin{macrocode} + \ifl@d@pnum \l@d@elintrue \else \l@d@elinfalse \fi + \ifnum#2=#5 \else + \l@d@elintrue + \l@d@dashtrue + \fi +% \end{macrocode} +% +% We print the starting sub-line if it's nonzero. +% \begin{macrocode} + \l@d@ssubfalse + \ifnum#3=0 \else + \l@d@ssubtrue + \fi +% \end{macrocode} +% +% We print the ending sub-line if it's nonzero and: (1)~it's different +% from the starting sub-line number, or (2)~the ending line number is +% being printed. +% \begin{macrocode} + \l@d@eslfalse + \ifnum#6=0 \else + \ifnum#6=#3 + \ifl@d@elin \l@d@esltrue \else \l@d@eslfalse \fi + \else + \l@d@esltrue + \l@d@dashtrue + \fi + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\printendlines} +% Now we're ready to print it all. +% \changes{v0.3}{2004/02/14}{Added \cs{linenumr@p} and \cs{sublinenumr@p} +% to \cs{printendlines}} +% \begin{macrocode} +\def\printendlines#1|#2|#3|#4|#5|#6|#7|{\begingroup + \setprintendlines{#1}{#2}{#3}{#4}{#5}{#6}% +% \end{macrocode} +% The only subtlety left here is when to print a period between +% numbers. But the only instance in which this is tricky is for the +% ending sub-line number: it could be coming after the starting +% sub-line number (in which case we want only the dash) or after an +% ending line number (in which case we need to insert a period). +% \begin{macrocode} + \printnpnum{#1} \linenumrep{#2}% + \ifl@d@ssub \fullstop \sublinenumrep{#3}\fi + \ifl@d@dash \endashchar\fi + \ifl@d@pnum \printnpnum{#4}\fi + \ifl@d@elin \linenumrep{#5}\fi + \ifl@d@esl \ifl@d@elin \fullstop\fi \sublinenumrep{#6}\fi +\endgroup} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\printnpnum} +% A macro to print a page number in an endnote. +% \begin{macrocode} +\newcommand*{\printnpnum}[1]{p.#1) } + +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\doendnotes} +% \cs{doendnotes} is +% the command you use to print one series of endnotes; it +% takes one argument, the series letter of the note series you want +% to print. +% \begin{macrocode} +\newcommand*{\doendnotes}[1]{\l@dend@close + \begingroup + \makeatletter + \expandafter\let\csname #1end\endcsname=\endprint + \input\jobname.end + \endgroup} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\noendnotes} +% You can say \cs{noendnotes} before the first +% \cs{beginnumbering} in your file if you aren't going to be using +% any of the endnote commands: this will suppress the creation of +% an \file{.end} file. If you do have some lingering endnote +% commands in your file, +% the notes will be written to your terminal and to the log file. +% \begin{macrocode} +\newcommand*{\noendnotes}{\global\let\l@dend@stuff=\relax + \global\chardef\l@d@end=16 } +% \end{macrocode} +% \end{macro} % \section{Generate series}% % In this section, X means the name of the series (A, B etc.) % \begin{macro}{\series} @@ -8618,12 +8929,12 @@ % \begin{macrocode} \newcommand{\newseries@}[1]{ % \end{macrocode} -% \subsubsection{Test if series is still existing} +% \subsection{Test if series is still existing} % \begin{macrocode} \xifinlist{#1}{\@series}{\eledmac@warning{Series #1 is still existing !}} {% % \end{macrocode} -% \subsubsection{Create all commands to memorize display options} +% \subsection{Create all commands to memorize display options} % \begin{macrocode} \csgdef{Xhangindent@#1}{0pt}% \csgdef{hangindentX@#1}{0pt} @@ -8666,7 +8977,7 @@ \csgdef{maxhnotesX@#1}{\ledfootinsdim}% \csgdef{maxhXnotes@#1}{\ledfootinsdim} % \end{macrocode} -% \subsubsection{Create inserts, needed to add notes in foot} +% \subsection{Create inserts, needed to add notes in foot} % Concerning inserts, see chapter 15 of the TeXBook by D. Knuth % \begin{macrocode} @@ -8675,7 +8986,7 @@ \expandafter\newinsert\csname #1footins\endcsname \expandafter\newinsert\csname mp#1footins\endcsname % \end{macrocode} -% \subsubsection{Create command for critical apparatus, \cs{Xfootnote}} +% \subsection{Create commands for critical apparatus, \cs{Xfootnote}} % Note the double \# in command: it's because command is made inside another command. % \changes{v1.4}{2012/11/16}{Remembers the language of the lemma, in order to create a correct direction for the footnote separator.} % \begin{macrocode} @@ -8723,7 +9034,7 @@ \csgdef{series@display#1}{} \footnormal{#1} % \end{macrocode} -%\subsubsection{Create tools for familiar footnotes (\cs{footnoteX})} +%\subsection{Create tools for familiar footnotes (\cs{footnoteX})} % First, create the \cs{footnoteX} command. % \begin{macrocode} @@ -8747,7 +9058,7 @@ \csgdef{series@displayX#1}{} \footnormalX{#1} % \end{macrocode} -% \subsubsection{The endnotes} +% \subsection{The endnotes} % The \cs{Xendnote} macro functions to % write one endnote to the \file{.end} file. We change % \cs{newlinechar} so that in the file every space becomes the @@ -8786,11 +9097,11 @@ }% End of \newseries % \end{macrocode} % \end{macro} -% \subsubsection{Init standards series (A,B,C,D,E,Z)} +% \subsection{Init standards series (A,B,C,D,E,Z)} % \begin{macrocode} \newseries{A,B,C,D,E,Z} % \end{macrocode} -% \subsubsection{Some tools} +% \subsection{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. @@ -8843,7 +9154,10 @@ \newcommandx{\setcommand@series}[4][4]{% \def\do##1{ \csgdef{#2@##1}{#3} - \ifstrequal{#4}{reload}{\csuse{foot\csuse{series@display##1}}{##1}}{}} + \ifstrequal{#4}{reload}{ + \csuse{foot\csuse{series@display##1}}{##1} + \csuse{foot\csuse{series@displayX##1}}{##1} + }{}} \ifstrempty{#1}{% \dolistloop{\@series}% }% @@ -8922,6 +9236,7 @@ % \end{macrocode} % \end{macro} % \begin{macro}{\newhookcommand@series@reload} +% \changes{v1.8.0}{2013/11/24}{Debug \cs{beforenotesX} and \cs{maxhnotesX} which didn'nt work.} % \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} @@ -8953,7 +9268,7 @@ \newhooktoggle@series{nonbreakableafternumber} % \end{macrocode} % \end{macro} -% \subsubsection{Old commands, kept for backward compatibility} +% \subsection{Old commands, kept for backward compatibility} % The next commands are kept for ascendant compatibily, but should'nt be used anymore. % \begin{macro}{\notenumfont} % \begin{macro}{\notefontsetup} @@ -8970,7 +9285,7 @@ % \end{macro} % \end{macro} % \end{macro} -% \subsubsection{Hooks for a particular footnote} +% \subsection{Hooks for a particular footnote} % \begin{macro}{\nonum@} %\cs{nonum@} toggle is used to disable line number printing in a particular footnote. % \begin{macrocode} @@ -8983,7 +9298,7 @@ \newtoggle{nosep@} % \end{macrocode} % \end{macro} -% \subsubsection{Alias} +% \subsection{Alias} % \begin{macro}{\nolemmaseparator} %\cs{nolemmaseparator}\oarg{series} is just an alias for \cs{lemmaseparator}\oarg{series}\verb|{}|. % \begin{macrocode} @@ -9009,7 +9324,7 @@ % \end{macrocode} % \end{macro} % -% \subsubsection{Line number printing} +% \subsection{Line number printing} % \begin{macro}{\printlinefootnote} % The \cs{printlinefootnote} macro is called in each \cs{<type>footfmt} command. % 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. @@ -9825,201 +10140,6 @@ % \end{macro} % % -% \section{Endnotes} -% \label{endnotes}\relax -% -% \begin{macro}{\l@d@end} -% \begin{macro}{\ifl@dend@} -% \begin{macro}{\l@dend@true} -% \begin{macro}{\l@dend@false} -% Endnotes of all varieties are saved up in a file, typically named -% \meta{jobname}\file{.end}. -% \cs{l@d@end} is the output stream number for -% this file, and \verb"\ifl@dend@" is a flag that's \verb"true" when the file is open. -% \begin{macrocode} -\newwrite\l@d@end -\newif\ifl@dend@ -% \end{macrocode} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% -% \begin{macro}{\l@dend@open} -% \begin{macro}{\l@dend@close} -% \cs{l@dend@open} and \cs{l@dend@close} are the -% macros that are used to open and close the endnote file. Note that -% all our writing to this file is \cs{immediate}: all page and -% line numbers for the endnotes are generated by the same mechanism -% we use for the footnotes, so that there's no need to defer any -% writing to catch information from the output routine. -% \begin{macrocode} -\newcommand{\l@dend@open}[1]{\global\l@dend@true\immediate\openout\l@d@end=#1\relax} -\newcommand{\l@dend@close}{\global\l@dend@false\immediate\closeout\l@d@end} - -% \end{macrocode} -% \end{macro} -% \end{macro} -% -% \begin{macro}{\l@dend@stuff} -% \cs{l@dend@stuff} is used by \cs{beginnumbering} to -% do everything that's necessary for the endnotes at the -% start of each section: it opens the \cs{l@d@end} file, if necessary, -% and writes the section number to the endnote file. -% \begin{macrocode} -\newcommand{\l@dend@stuff}{% - \ifl@dend@\relax\else - \l@dend@open{\jobname.end}% - \fi - \immediate\write\l@d@end{\string\l@d@section{\the\section@num}}} - -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\endprint} -% \begin{macro}{\@gobblethree} -% \begin{macro}{\l@d@section} -% The \cs{endprint} here is nearly identical in its -% functioning to \cs{normalfootfmt}. -% -% The endnote file also contains \cs{l@d@section} commands, which -% supply the section numbers from the main text; standard \Eledmac{} does -% nothing with this information, but it's there if you want to write -% custom macros to do something with it. -% \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{bhookXendnote@#4}\csuse{Xendnotefontsize@#4}{\csuse{Xendnotenumfont@#4}\printendlines#1|}% - \enspace{\select@lemmafont#1|#2}\enskip#3\par}} -\providecommand*{\@gobblethree}[3]{} - -\let\l@d@section=\@gobble - -% \end{macrocode} -% \end{macro} -% \end{macro} -% \end{macro} -% -% \begin{macro}{\setprintendlines} -% The \cs{printendlines} macro is similar to \cs{printlines} but is -% for printing endnotes rather than footnotes. -% -% The principal difference between foot- and endnotes is that footnotes -% are printed on the page where they are specified but endnotes -% are printed at a different point in the document. We need an indication -% of the source of an endnote; \cs{setprintendlines} provides this -% by always printing the page number. The coding is slightly simpler than -% \cs{setprintlines}. -% -% First of all, we print the second page number only if -% the ending page number is different -% from the starting page number.\phantomsection\label{printendlines} -% \changes{v0.7}{2005/02/18}{Added \cs{setprintendlines} for use by -% \cs{printendlines}} -% \begin{macrocode} -\newcommand*{\setprintendlines}[6]{% - \l@d@pnumfalse \l@d@dashfalse - \ifnum#4=#1 \else - \l@d@pnumtrue - \l@d@dashtrue - \fi -% \end{macrocode} -% -% We print the ending line number if\/: (1)~we're printing the ending -% page number, or (2)~it's different from the starting line number. -% \begin{macrocode} - \ifl@d@pnum \l@d@elintrue \else \l@d@elinfalse \fi - \ifnum#2=#5 \else - \l@d@elintrue - \l@d@dashtrue - \fi -% \end{macrocode} -% -% We print the starting sub-line if it's nonzero. -% \begin{macrocode} - \l@d@ssubfalse - \ifnum#3=0 \else - \l@d@ssubtrue - \fi -% \end{macrocode} -% -% We print the ending sub-line if it's nonzero and: (1)~it's different -% from the starting sub-line number, or (2)~the ending line number is -% being printed. -% \begin{macrocode} - \l@d@eslfalse - \ifnum#6=0 \else - \ifnum#6=#3 - \ifl@d@elin \l@d@esltrue \else \l@d@eslfalse \fi - \else - \l@d@esltrue - \l@d@dashtrue - \fi - \fi} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\printendlines} -% Now we're ready to print it all. -% \changes{v0.3}{2004/02/14}{Added \cs{linenumr@p} and \cs{sublinenumr@p} -% to \cs{printendlines}} -% \begin{macrocode} -\def\printendlines#1|#2|#3|#4|#5|#6|#7|{\begingroup - \setprintendlines{#1}{#2}{#3}{#4}{#5}{#6}% -% \end{macrocode} -% The only subtlety left here is when to print a period between -% numbers. But the only instance in which this is tricky is for the -% ending sub-line number: it could be coming after the starting -% sub-line number (in which case we want only the dash) or after an -% ending line number (in which case we need to insert a period). -% \begin{macrocode} - \printnpnum{#1} \linenumrep{#2}% - \ifl@d@ssub \fullstop \sublinenumrep{#3}\fi - \ifl@d@dash \endashchar\fi - \ifl@d@pnum \printnpnum{#4}\fi - \ifl@d@elin \linenumrep{#5}\fi - \ifl@d@esl \ifl@d@elin \fullstop\fi \sublinenumrep{#6}\fi -\endgroup} - -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\printnpnum} -% A macro to print a page number in an endnote. -% \begin{macrocode} -\newcommand*{\printnpnum}[1]{p.#1) } - -% \end{macrocode} -% \end{macro} -% -% -% \begin{macro}{\doendnotes} -% \cs{doendnotes} is -% the command you use to print one series of endnotes; it -% takes one argument, the series letter of the note series you want -% to print. -% \begin{macrocode} -\newcommand*{\doendnotes}[1]{\l@dend@close - \begingroup - \makeatletter - \expandafter\let\csname #1end\endcsname=\endprint - \input\jobname.end - \endgroup} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\noendnotes} -% You can say \cs{noendnotes} before the first -% \cs{beginnumbering} in your file if you aren't going to be using -% any of the endnote commands: this will suppress the creation of -% an \file{.end} file. If you do have some lingering endnote -% commands in your file, -% the notes will be written to your terminal and to the log file. -% \begin{macrocode} -\newcommand*{\noendnotes}{\global\let\l@dend@stuff=\relax - \global\chardef\l@d@end=16 } -% \end{macrocode} -% \end{macro} % % \section{Side notes} % @@ -10330,7 +10450,17 @@ \flush@notes \fi \fi - \def\do##1{\ifvoid\csuse{mp##1footins}\else\csuse{mp##1footgroup}{##1}\fi}% + \def\do##1{ + \ifvoid\csuse{mp##1footins}\else% + \ifl@dpairing\ifparledgroup% + \ifledRcol% + \dimgdef{\parledgroup@beforenotesR}{\parledgroup@beforenotesR+\skip\@nameuse{mp##1footins}} + \else% + \dimgdef{\parledgroup@beforenotesL}{\parledgroup@beforenotesL+\skip\@nameuse{mp##1footins}} + \fi% + \fi\fi% + \csuse{mp##1footgroup}{##1}% + \fi}% \dolistloop{\@series}% } @@ -10412,6 +10542,15 @@ \vskip\skip\@mpfootins \normalcolor \footnoterule + \ifparledgroup + \ifl@dpairing + \ifledRcol + \dimgdef{\parledgroup@beforenotesR}{\parledgroup@beforenotesR+\skip\@mpfootins} + \else + \dimgdef{\parledgroup@beforenotesL}{\parledgroup@beforenotesL+\skip\@mpfootins} + \fi + \fi + \fi \unvbox\@mpfootins} % \end{macrocode} @@ -10427,7 +10566,7 @@ % \begin{macrocode} \newif\if@ledgroup \newenvironment{ledgroup}{% - \@ledgrouptrue\def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c@mpfootnote\z@ + \resetprevpage@num\@ledgrouptrue\def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c@mpfootnote\z@ \let\@footnotetext\@mpfootnotetext \l@dfeetbeginmini% }{% @@ -10501,6 +10640,15 @@ % \end{macrocode} % \end{environment} % +% \begin{macro}{\ifledgroupnotesL@} +% \begin{macro}{\ifledgroupnotesR@} +% These boolean tests check if we are in the notes of a ledgroup. If we are, we don't number the lines. +% \begin{macrocode} +\newif\ifledgroupnotesL@ +\newif\ifledgroupnotesR@ +% \end{macrocode} +% \end{macro} +% \end{macro} % \section{Indexing} % % \changes{v1.5}{2013/07/11}{Correct indexing when the call is made in critical notes.} |