summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/reledmac/reledmac.dtx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-11-19 22:41:35 +0000
committerKarl Berry <karl@freefriends.org>2015-11-19 22:41:35 +0000
commit8bc177aa284756939eeec5497c1799fbfae775ae (patch)
tree96ceb4277b4a1bd972fb505b7773656d9134c182 /Master/texmf-dist/source/latex/reledmac/reledmac.dtx
parent2f872d852a052b88a4c3c7e3442b63c3185d3770 (diff)
reledmac (19nov15)
git-svn-id: svn://tug.org/texlive/trunk@38896 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.dtx226
1 files changed, 151 insertions, 75 deletions
diff --git a/Master/texmf-dist/source/latex/reledmac/reledmac.dtx b/Master/texmf-dist/source/latex/reledmac/reledmac.dtx
index f2cb5c1a1a3..0c405ebefbf 100644
--- a/Master/texmf-dist/source/latex/reledmac/reledmac.dtx
+++ b/Master/texmf-dist/source/latex/reledmac/reledmac.dtx
@@ -347,8 +347,8 @@
% \changes{v2.4.0}{2015/10/19}{Fix bug of \protect\cs{parindentX} and \protect\cs{Xparindent} with two columns and three columns notes.}
% \changes{v2.4.0}{2015/10/19}{Fix spurious space when using optional argument of \protect{stanza} (introduced in v2.3.0).}
% \changes{v2.4.1}{2015/10/26}{Fix bug with \protect\cs{appref} and \protect\cs{apprefwithpage} (introduced in v2.4.0).}
-% \changes{v2.4.1}{2015/10/26}{Fix bug with tabular environments when using \protect\package{babel} or \protect\package{polyglossia} language which override \LaTeX\ \protect\cs{roman} command, like Greek.}
-% \changes{v2.4.1}{2015/10/26}{Fix bug with tabular environments when using \protect\package{babel} or \protect\package{polyglossia} language which override \LaTeX\ \protect\cs{roman} command, like greek language.}
+% \changes{v2.4.1}{2015/10/26}{Fix bug with tabular environments when using \protect\package{babel} or \protect\package{polyglossia} languages that override \LaTeX\ \protect\cs{roman} command, like Greek.}
+% \changes{v2.4.1}{2015/10/26}{Fix bug with tabular environments when using \protect\package{babel} or \protect\package{polyglossia} languages that override \LaTeX\ \protect\cs{roman} command, like Greek language.}
% \changes{v2.5.0}{2015/11/13}{Compatibility with new hook and tools of \protect\reledpar~2.6.0.}
% \changes{v2.5.0}{2015/11/13}{\protect\cs{lemma} can be used even when the \protect\option{nocritical} is enabled.}
% \changes{v2.5.0}{2015/11/13}{New hooks to customize page and line number appearance in endnotes.}
@@ -358,8 +358,11 @@
% \changes{v2.5.0}{2015/11/13}{\protect\cs{apprefwithpage} and \protect\cs{appref} print double quotation mark when the label was not defined.}
% \changes{v2.5.0}{2015/11/13}{\protect\cs{apprefwithpage} and \protect\cs{appref} work with right side crossref.}
% \changes{v2.5.0}{2015/11/13}{\protect\cs{edlabel} works now in \protect\cs{Xfootnote}.}
-% \changes{v2.5.0}{2015/11/13}{Log contains `There were undefined references` when using false references in \protect\cs{edlineref} or \protect{edpageref}.}
+% \changes{v2.5.0}{2015/11/13}{Log now states `There were undefined references` when using wrong references in \protect\cs{edlineref} or \protect{edpageref}.}
% \changes{v2.5.0}{2015/11/13}{Fix spurious vertical space in \protect\env{astanza} environment (\reledpar)}
+% \changes{v2.6.0}{2015/11/20}{Adds compatibility with \protect\option{innnote} and \protect\option{notenumber} options of \protect\package{indextools} package.}
+% \changes{v2.6.0}{2015/11/20}{Fix bug with footnote counter in \protect\env{ledgroup} (added in v2.5.0).}
+% \changes{v2.6.0}{2015/11/20}{Fix bug, introduced in v2.5.0, with footnote numbering in parallel typesetting when using \protect\package{perpage} package.}
%
%
% \title{\Macpackage \\
@@ -2418,11 +2421,11 @@
% auxiliary file will not have been updated yet.)
%
% \subsection{Cross-referencing to a critical note}
-% If you when to refer to a word which is a lemma word, the \cs{edlabel} command should be in the first argument of \cs{edtext} command.
+% If you want to refer to a word which is a lemma word, the \cs{edlabel} command should be in the first argument of \cs{edtext} command.
%
% If you want to refer to the content of a a \cs{Xfootnote}, the line and subline number printed will be the start line.
%
-% If you want to refers to the start and end lines, you should use \cs{appref} and related tools (\reff{appref}).
+% If you want to refer to starting and ending lines, you should use \cs{appref} and related tools (\reff{appref}).
% \subsection{Cross-referencing which return a number in any case}
% Where \verb+#1+ stands for the reference.
% \DescribeMacro{\xpageref}
@@ -2520,7 +2523,7 @@
% \DescribeMacro{\SErefonlypage}
% \cs{SErefonlypage} will make a cross-reference printed only with page number.
%
-% \subsubsection{References to lines commented in the apparatus}\label{appref}
+% \subsubsection{References to lines that are commented on in the apparatus}\label{appref}
% \changes{v1.21.0}{2015/03/09}{Add \protect\cs{applabel} and related}
% You may want to make a cross-reference to a passage that is referred to by \protect\cs{edtext}.
% \Macpackage provides specific tools for this scenario.
@@ -2693,17 +2696,17 @@
% \item Load \macpackage.
% \item Declare the index with the macro \cs{makeindex} of \package{imakeidx} and \package{indextools}.
% \end{enumerate}
-% \subsection{Refer to a critical notes}
+% \subsection{Referring to critical notes}
% If you want to refer to a word inside an
-% \protect\cs{edtext}\marg{lemma}\marg{app} command, the \protect\cs{edindex} should be defined inside
+% \protect\cs{edtext}\marg{lemma}\marg{app} command, \protect\cs{edindex} should be defined inside
% the first argument, e.g.,
% \begin{verbatim}
% The \edtext{creature\edlabel{elephant} was quite
% unafraid}{\Afootnote{Of the mouse, that is.}}
% \end{verbatim}
%
-% If you add the \protect\cs{edindex} inside some \protect\cs{Xfootnote} command,
-% it will refer to that note, and a suffix \emph{n} will be added to the reference.
+% If you add \protect\cs{edindex} inside some \protect\cs{Xfootnote} command,
+% it will refer to that note, and a suffix \emph{n} will be appended to the reference.
% You can redefine this suffix by redefining the command \protect\cs{ledinnotemark}.
% Its actual definition is:
% \begin{verbatim}
@@ -3389,7 +3392,7 @@
% \begin{macrocode}
%<*code>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{reledmac}[2015/11/13 v2.5.0 typeset critical edition]%
+\ProvidesPackage{reledmac}[2015/11/20 v2.6.0 typeset critical edition]%
% \end{macrocode}
%
% \subsection{Package options}
@@ -3964,26 +3967,13 @@
% \end{macro}
% \end{macro}
% \subsection{Prepare \parpackage}
-% \begin{macro}{\ifnumberingR}
% \begin{macro}{\ifl@dpairing}
% \begin{macro}{\ifl@dpaging}
-% \begin{macro}{\l@dpagingtrue}
-% \begin{macro}{\l@dpagingfalse}
% \begin{macro}{\ifl@dprintingpages}
-% \begin{macro}{\l@dprintingpagestrue}
-% \begin{macro}{\l@dprintingpagesfalse}
% \begin{macro}{\ifl@dprintingcolumns}
-% \begin{macro}{\l@dprintingcolumnstrue}
-% \begin{macro}{\l@dprintingcolumnsfalse}
-% \begin{macro}{\l@dpairingtrue}
-% \begin{macro}{\l@dpairingfalse}
% \begin{macro}{\ifpst@rtedL}
-% \begin{macro}{\pst@rtedLtrue}
-% \begin{macro}{\pst@rtedLfalse}
% \begin{macro}{\l@dnumpstartsL}
-% \begin{macro}{\ifledRcol}
-% \begin{macro}{\ifledRcol@}
-% \begin{macro}{\ifXnote@}
+
% In preparation for the \parpackage package, these are related to
% the `right' text of parallel texts (when \protect\cs{ifl@dpairing} is TRUE).
% They are explained in the \protect\package{eledpar}
@@ -4002,11 +3992,22 @@
\newif\ifpst@rtedL
\newcount\l@dnumpstartsL
% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\ifledRcol}
+% \begin{macro}{\ifledRcol@}
% \protect\cs{ifledRcol} is set to true in the \verb+Rightside+ environnement. It must be not confused with \protect\cs{ifledRcol@} which is set to true when a right line is processed, in \protect\cs{Pages} or \protect\cs{Columns}.
% \begin{macrocode}
\newif\ifledRcol
\newif\ifledRcol@
% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\ifnumberingR}
% The \protect\cs{ifnumberingR} flag is
% set to \verb"true" if we're within a right text numbered section.
% \begin{macrocode}
@@ -4017,25 +4018,17 @@
\newif\ifXnote@%
% \end{macrocode}
% \end{macro}
+% \subsection{Booleans provided by other optional packages which are required in any case}
+% \begin{macro}{\ifindtl@innote}
+% \begin{macro}{\ifindtl@notenumber}
+% The \cs{ifindtl@innote} and \cs{ifindtl@notenumber} are required even if \package{indextools} is not used.
+% \begin{macrocode}
+\providebool{indtl@innote}%
+\providebool{indtl@notenumber}%
+% \end{macrocode}
% \end{macro}
% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
+
%
%\section{Sectioning commands}
%
@@ -9687,8 +9680,8 @@
% \begin{macro}{\l@dparsedendpage}
% \begin{macro}{\l@dparsedendline}
% \begin{macro}{\l@dparsedendsub}
-% \changes{v2.5.0}{2015/11/13}{\protect\cs{l@dparsefootspec} deleted, not use anymore since \protect\eledmac release!}
-% \protect\cs{l@dp@rsefootspec} parses lines specification and defines macros holding the numeric values.
+% \changes{v2.5.0}{2015/11/13}{\protect\cs{l@dparsefootspec} deleted, for it is not anymore used since \protect\eledmac release!}
+% \protect\cs{l@dp@rsefootspec} parses lines specification and defines macros which hold the numeric values.
% Just a reminder of the arguments: \\
% \verb?\printlines #1 | #2 | #3 | #4 | #5 | #6 | #7?\\
% \verb?\printlines start-page | line | subline | end-page | line | subline | font?flag
@@ -10054,12 +10047,15 @@
%
% \begin{macro}{\l@dbfnote}
% \begin{macro}{\vl@dbfnote}
+% \begin{macro}{\vl@dbfnote}
% \begin{macro}{\footnote}
+% \begin{macro}{\get@fnmark}
+% \begin{macro}{\get@thisfootnote}
% \protect\cs{l@dbfnote} adds the footnote to the insert list, and
% \protect\cs{vl@dbfnote} calls the original \protect\cs{@footnotetext}.
% \changes{v0.6.0}{2004/11/23}{Changed \protect\cs{l@dbfnote} and \protect\cs{vl@dbfnote} as
% originals could give incorrect markers in the footnotes}
-% We also patch \cs{footnote} in order to get the correct footnote numbers when typesetting parallel texts.
+% We also patch \cs{footnote} in order to get the correct footnote numbers when typesetting parallel texts. This is moved into a \cs{get@fnmark} command.
% \changes{v1.4.1}{2012/11/16}{Compatibility of standard footnotes with \eledmac when these footnotes contain any commands.}
% \begin{macrocode}
@@ -10068,7 +10064,9 @@
{\stepcounter\@mpfn}%
{%
\ifl@dpairing%
- \global\advance\footnote@reading by \@ne%
+ \global\advance\footnote@reading by \@ne%
+ \get@thisfootnote%
+ \get@fnmark{\thisfootnote}%
\ifcsdef{footnotereading\the\footnote@reading=typeset}%
{\setcounter{\@mpfn}{\csuse{footnotereading\the\footnote@reading=typeset}}}%
{\setcounter{\@mpfn}{\footnote@reading}}%
@@ -10078,13 +10076,18 @@
}%
{}
{}
-\newcommand{\l@dbfnote}[1]{%
- \ifnumberedpar@
+
+\newcommand{\get@thisfootnote}{%
\ifl@dpairing
\protected@xdef\thisfootnote{\the\footnote@reading}%
\else%
\protected@xdef\thisfootnote{\thefootnote}%
\fi%
+}%
+
+\newcommand{\l@dbfnote}[1]{%
+ \ifnumberedpar@%
+ \get@thisfootnote%
\gdef\@tag{#1\relax}%
\ifledRcol%
\xright@appenditem{\noexpand\vl@dbfnote{{\expandonce\@tag}}{\thisfootnote}}%
@@ -10097,25 +10100,32 @@
\fi
\fi\ignorespaces}
-\newcommand{\vl@dbfnote}[2]{%
+\newcommand{\get@fnmark}[1]{%
\ifboolexpr{bool{l@dprintingpages} or bool{l@dprintingcolumns}}%
{%
- \global\advance\footnote@typeset by \@ne%
- \setcounter{footnote}{\footnote@typeset}%
+ \stepcounter{footnote@typeset}%
+ \setcounter{footnote}{\c@footnote@typeset}%
\immediate\write\@mainaux{%
- \global\csdef{footnotereading#2=typeset}{\the\footnote@typeset}%
+ \global\csdef{footnotereading#1=typeset}{\the\c@footnote@typeset}%
}%
- \def\@thefnmark{\the\footnote@typeset}%
+ \def\@thefnmark{\thefootnote}%
}%
{%
- \@namedef{@thefnmark}{#2}%
+ \@namedef{@thefnmark}{#1}%
}%
- \@footnotetext{#1}%
- }%
+}%
+
+\newcommand{\vl@dbfnote}[2]{%
+ \get@fnmark{#2}%
+ \@footnotetext{#1}%
+}%
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \subsection{Footnote formats}
%
@@ -10213,6 +10223,8 @@
% The minipage version.
% \begin{macrocode}
\newcommand*{\mpnormalvfootnoteX}[2]{%
+ \get@thisfootnoteX{#1}%
+ \get@fnmarkX{#1}{\thisfootnote}%
\global\setbox\@nameuse{mpfootins#1}\vbox{%
\unvbox\@nameuse{mpfootins#1}
\noindent\csuse{bhooknoteX@#1}%
@@ -10342,11 +10354,7 @@
\newcommand{\normalbfnoteX}[2]{%
\ifnumberedpar@
- \ifl@dpairing
- \protected@xdef\thisfootnote{\the\csname footnote#1@reading\endcsname}%
- \else%
- \protected@xdef\thisfootnote{\csuse{thefootnote#1}}%
- \fi%
+ \get@thisfootnoteX{#1}%
\ifledRcol%
\ifluatex
\footnotelang@lua[R]%
@@ -10373,31 +10381,50 @@
% \end{macrocode}
% \end{macro}
%
-%
+% \begin{macro}{\get@thisfootnoteX}
+% The macro \cs{get@thisfootnote} command just saves the footnote number in the \cs{thisfootnote} macro, depending on the use of pairing environments.
+% \begin{macrocode}
+\newcommand{\get@thisfootnoteX}[1]{%
+ \ifl@dpairing%
+ \protected@xdef\thisfootnote{\the\csname footnote#1@reading\endcsname}%
+ \else%
+ \protected@xdef\thisfootnote{\csuse{thefootnote#1}}%
+ \fi%
+}%
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{\vbfnoteX}
% This command calls the correct footnote-inserting commands.
-% It also gets the correct footnote number when typesetting parallel texts.
+%
% \begin{macrocode}
\newcommand{\vbfnoteX}[3]{%
+ \get@fnmarkX{#1}{#3}%
+ \@nameuse{regvfootnote#1}{#1}{#2}%
+}%
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\get@fnmarkX}
+% This command gets the correct footnote number when typesetting parallel texts.
+% \begin{macrocode}
+\newcommand{\get@fnmarkX}[2]{%
\ifboolexpr{bool{l@dprintingpages} or bool{l@dprintingcolumns}}%
{%
- \global\expandafter\advance\csname footnote#1@typeset\endcsname by \@ne%
- \setcounter{footnote#1}{\csuse{footnote#1@typeset}}%
+ \stepcounter{footnote#1@typeset}%
+ \setcounter{footnote#1}{\value{footnote#1@typeset}}%
\@namedef{@thefnmark#1}{\csuse{thefootnote#1}}%
\immediate\write\@mainaux{%
- \global\csdef{footnote#1reading#3=typeset}{\the\csname footnote#1@typeset\endcsname}%
+ \global\csdef{footnote#1reading#2=typeset}{\the\csname c@footnote#1@typeset\endcsname}%
}%
}%
{%
- \@namedef{@thefnmark#1}{#3}%
+ \@namedef{@thefnmark#1}{#2}%
}%
- \@nameuse{regvfootnote#1}{#1}{#2}%
}
-
+%
% \end{macrocode}
% \end{macro}
-%
-%
% \begin{macro}{\vnumfootnoteX}
% \changes{v0.7.0}{2005/02/18}{Removed extraneous space from \protect\cs{vnumfootnoteX}}
% \begin{macrocode}
@@ -10769,7 +10796,7 @@
% \protect\cs{para@vfootnoteX}\marg{series}\marg{text}
% \begin{macrocode}
\newcommand*{\para@vfootnoteX}[2]{%
- \insert\csname footins#1\endcsname
+ \insert\csname footins#1\endcsname%
\bgroup
\csuse{notefontsizeX@#1}
\footsplitskips
@@ -10784,6 +10811,8 @@
\penalty0
\egroup}
\newcommand*{\mppara@vfootnoteX}[2]{%
+ \get@thisfootnoteX{#1}%
+ \get@fnmarkX{#1}{\thisfootnote}%
\global\setbox\@nameuse{mpfootins#1}\vbox{%
\unvbox\@nameuse{mpfootins#1}
\csuse{notefontsizeX@#1}
@@ -11707,6 +11736,15 @@
{\footnotelang@poly[R]}%
\footnoteoptions@{R}{##1}{true}%
\xright@appenditem{%
+ \ifbool{indtl@innote}%
+ {\unexpanded{\let\index\nindex}}%
+ {}%
+ \ifbool{indtl@notenumber}%
+ {\unexpanded{\let\index\nindex}}%There is no note number… so
+ {}%
+ \ifbool{indtl@notenumber}%
+ {\unexpanded{\let\index\orig@@index}}%
+ {}%
\noexpand\Xnote@true%
\noexpand\prepare@preXnotes{#1}%
\noexpand\prepare@edindex@fornote{\l@d@nums}%
@@ -11715,6 +11753,9 @@
\noexpand\csuse{v#1footnote}{#1}%
{{\l@d@nums}{\expandonce\@tag}{\expandonce\content}}%
\noexpand\Xnote@false%
+ \ifbool{indtl@innote}%
+ {\unexpanded{\let\index\orig@@index}}%
+ {}%
}\to\inserts@listR
\footnoteoptions@{R}{##1}{false}%
\global\advance\insert@countR \@ne%
@@ -11727,6 +11768,12 @@
{\footnotelang@poly}%
\footnoteoptions@{L}{##1}{true}%
\xright@appenditem{%
+ \ifbool{indtl@innote}%
+ {\unexpanded{\let\index\nindex}}%
+ {}%
+ \ifbool{indtl@notenumber}%
+ {\unexpanded{\let\index\nindex}}%There is no note number… so
+ {}%
\noexpand\Xnote@true%
\noexpand\prepare@preXnotes{#1}%
\noexpand\prepare@edindex@fornote{\l@d@nums}%
@@ -11737,6 +11784,12 @@
\noexpand\csuse{v#1footnote}{#1}%
{{\l@d@nums}{\expandonce\@tag}{\expandonce\content}}%
\noexpand\Xnote@false%
+ \ifbool{indtl@innote}%
+ {\unexpanded{\let\index\orig@@index}}%
+ {}%
+ \ifbool{indtl@notenumber}%
+ {\unexpanded{\let\index\orig@@index}}%
+ {}%
}\to\inserts@list
\global\advance\insert@count \@ne%
\footnoteoptions@{L}{##1}{false}%
@@ -11828,7 +11881,25 @@
\xdef\footnote@luatextextdir{\the\textdir}%
\xdef\footnote@luatexpardir{\the\pardir}%
\fi%
+ \ifbool{indtl@innote}%
+ {\let\index\nindex}%
+ {}%
+ \ifbool{indtl@notenumber}%
+ {%
+ \renewcommand{\index}[2][]{%
+ \orig@@index[####1]{%
+ ####2|innotenumber{\csuse{thefootnote#1}}%
+ }%
+ }%
+ }%
+ {}%
\csuse{vfootnote#1}{#1}{\expandonce\content}\m@mmf@prepare%
+ \ifbool{indtl@innote}%
+ {\let\index\orig@@index}%
+ {}%
+ \ifbool{indtl@notenumber}%
+ {\let\index\orig@@index}%
+ {}%
\endgroup%
}
% \end{macrocode}
@@ -13802,8 +13873,9 @@
% \changes{v0.4.0}{2004/02/29}{Added \protect\cs{l@dfeetbeginmini}, \protect\cs{l@dfeetendmini}
% and all their supporting code}
% \begin{macrocode}
+\newif\if@ledgroup%
\ifnoledgroup@\else%
-\newcommand*{\l@dfeetbeginmini}{\l@dedbeginmini\l@dfambeginmini}
+\newcommand*{\l@dfeetbeginmini}{\@ledgrouptrue\l@dedbeginmini\l@dfambeginmini}
\newcommand*{\l@dfeetendmini}{%
\IfStrEq{critical-familiar}{\@mpfnpos}%
{\l@dedendmini\l@dfamendmini}%
@@ -13956,6 +14028,7 @@
% of unboxed, fixed width minipage.
% \changes{v0.4.0}{2004/02/29}{Added ledgroup environment}
% \begin{macrocode}
+
\newenvironment{ledgroup}{%
\resetprevpage@num%
\def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c@mpfootnote\z@%
@@ -13968,8 +14041,13 @@
\l@dunboxmpfoot
\fi
\l@dfeetendmini%
+ \@ledgroupfalse%
}
+\apptocmd{\endledgroup}{%
+ \l@dprintingpagesfalse%
+ \l@dprintingcolumnsfalse%
+}{}{}
% \end{macrocode}
% \end{environment}
%
@@ -13988,8 +14066,6 @@
% Set the various text measures.
% \begin{macrocode}
\hsize #2\relax
-%% \textwidth #2\relax
-%% \columnwidth #2\relax
% \end{macrocode}
% Initialize fills for centering.
% \begin{macrocode}