summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/reledmac/reledmac.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/reledmac/reledmac.dtx')
-rw-r--r--macros/latex/contrib/reledmac/reledmac.dtx179
1 files changed, 115 insertions, 64 deletions
diff --git a/macros/latex/contrib/reledmac/reledmac.dtx b/macros/latex/contrib/reledmac/reledmac.dtx
index 2634484f6a..97dfb0c005 100644
--- a/macros/latex/contrib/reledmac/reledmac.dtx
+++ b/macros/latex/contrib/reledmac/reledmac.dtx
@@ -532,13 +532,13 @@
% \changes{v2.31.1}{2019/03/03}{Fix bug in vertical spacing with \protect\cs{Xgroupbyline}.}
% \changes{v2.31.1}{2019/03/03}{Fix bug with indentation with \protect\cs{Xgroupbyline}.}
% \changes{v2.31.1}{2019/03/03}{Fix bug with \protect\cs{Xhangindent} and \protect\cs{hangindentX} for right-to-left texts.}
-% \changes{v2.31.2}{2019/04/03}{Fix bug with familiar footnote containing not default font (introduced with v.~2.20.0).}
+% \changes{v2.31.2}{2019/04/03}{Fix bug with familiar footnote containing non-default font (introduced with v.~2.20.0).}
% \changes{v2.31.3}{2019/06/19}{Fix bug with paragraphed footnote in RTL context.}
% \changes{v2.32.0}{2019/07/15}{Add \protect\cs{Xlinenumannotationonlyfirst}, \protect\cs{Xlinenumannotationonlyfirstintwo}, \protect\cs{Xsymlinenumannotation}, \protect\cs{Xendlinenumannotationonlyfirst}, \protect\cs{Xendlinenumannotationonlyfirstintwo} and \protect\cs{Xendsymlinenumannotation}.}
% \changes{v2.32.1}{2019/07/21}{Do not print \protect\cs{Xendsep} if we print \protect\cs{Xendsymlinenum}.}
% \changes{v2.32.1}{2019/07/21}{When using \protect\cs{parindentX} or \protect\cs{Xparindent} and stanza, use the normal indentation in the footnote, not the verse indentation.}
% \changes{v2.32.2}{2019/11/28}{Fix spurious vertical space in familiar footnotes with \protect\LuaLaTeX.}
-% \changes{v2.32.3}{2019/12/09}{Fix bug with critical footnotes when typesetting arabic text with \protect\package{polyglossia}.}
+% \changes{v2.32.3}{2019/12/09}{Fix bug with critical footnotes when typesetting Arabic text with \protect\package{polyglossia}.}
% \changes{v2.32.4}{2020/02/04}{Fix bug \protect\cs{footnoteXmark} and \protect\cs{footnoteXtext}.}
% \changes{v2.32.4}{2020/01/04}{\protect\cs{footnoteXmark} and \protect\cs{footnoteXtext} can now have an optional argument, setting the footnote number.}
% \changes{v2.32.4}{2020/02/04}{Fix bug when using \protect\cs{Xgroupbyline} and twocol arrangement.}
@@ -546,6 +546,8 @@
% \changes{v2.32.5}{2020/03/08}{Fix bug with \protect\cs{edindex} inside \protect\cs{eledsection} and related.}
% \changes{v2.32.5}{2020/03/08}{Fix bug with page number in index with \protect\cs{edindex} when indexing a critical notes.}
% \changes{v2.32.5}{2020/03/08}{Fix bug with macro inside \protect\cs{sameword} with no-\protect\XeTeX\ engines.}
+% \changes{v2.32.6}{2020/04/19}{Fix bug with glossary entries inside the first argument of \protect\cs{edtext}.}
+% \changes{v2.32.6}{2020/04/19}{Add hyperref link when inserting glossary entries.}
% Typeset scholarly editions with \LaTeX\thanks{This file (\dtxfilename)
% has version number \fileversion, last revised \filedate.}}
%
@@ -804,7 +806,7 @@
%
%Please read \reff{Xmaxhnotes}.
%
-% If you use \LuaTeX\ engine, you need \LuaTeX\ 1.1.0 or later.
+% If you use the \LuaTeX\ engine, you need \LuaTeX\ 1.1.0 or later.
% A file may mix \emph{numbered} and \emph{unnumbered} text.
%
% Numbered text is printed with marginal line numbers and can include
@@ -1100,7 +1102,7 @@
% \end{itemize}
% \item It must not be used if:
% \begin{itemize}
-% \item You just not want to have the line number in the margins, but want to use critical footnote. In this case, set \cs{firstlinenum} to a big value, such as 100,000 (\reff{firstlinenum}).
+% \item You do not want to have the line number in the margins, but do want to use critical footnotes. In this case, set \cs{firstlinenum} to a big value, such as 100,000 (\reff{firstlinenum}).
% \item You want to freeze the line numbering for some line, but still keep critical footnotes. In this case, use \cs{startlock} (\reff{startlock}).
% \end{itemize}
% \end{itemize}
@@ -1399,7 +1401,7 @@
% If you want to change the separator, you can use \\
% \cs{setlinenumannotationsep}\marg{sep}
% \subsubsection{Annotations in the apparatus}
-% Some other options for the annotation in the apparatus are described on \reff{annotation-inapparatus}
+% Some other options for annotations in the apparatus are described in \reff{annotation-inapparatus}
% \subsection{Executing code at each line}\label{linehook}
% \Macpackage provides an advanced feature for users.
% \DescribeMacro{\dolinehook}\DescribeMacro{\doinsidelinehook}
@@ -1556,7 +1558,7 @@
% \label{fulllines}The available options are:
% \begin{itemize}
% \item \verb|fulllines| to disable \protect\cs{Xtwolines} and \protect\cs{Xmorethantwolines} features for this note (cf. \reff{Xtwolines}).
-% \item \verb|nonum| disables line numbering for this note. A horizontal blank space is added instead. You can use \cs{Xinplaceofnumber} to set it (\reff{Xinplaceofnumber}).
+% \item \verb|nonum| disables line numbering for this note. A horizontal blank space is added instead. You can use \cs{Xinplaceofnumber} to set it (\reff{Xinplaceofnumber}).
% \item \verb|nosep| to disable the lemma separator for this note. A horizontal blank space is added instead. You can use \cs{Xinplaceoflemmaseparator} to set it (\reff{Xinplaceoflemmaseparator}).
% \item \verb|linerangesep=|\meta{c} to change to \meta{c} the separator between start line and end line for this particular note.
% \end{itemize}
@@ -1767,7 +1769,7 @@
% If you use UTF-8 processor, like \XeLaTeX\ or \LuaLaTeX, there should not be any glitches.
% However, pay attention to how characters are encoded. Similar-looking characters may be represented differently in unicode numbering.
%
-% For instance, in French, ``é'' has two possible unicode numbers:
+% For instance, in French, ``é'' has two possible Unicode codepoints:
% \begin{itemize}
% \item LATIN SMALL LETTER E (U+0065) + COMBINING ACUTE ACCENT (U+0301)
% \item LATIN SMALL LETTER E WITH ACUTE (U+00E9)
@@ -2040,7 +2042,7 @@
% [...]
% amet\stopmsdata{} \msdata{ABCD}sic transit [...]
% \end{verbatim}
-% Which means that the part of text containing \enquote{Lorem ipsum dolor [...] amet} is witnessed by manuscripts A, B and C, while the part of text starting by \enquote{sic transit} is witnessed by manuscripts A, B, C and D.
+% Which means that the part of text containing \enquote{Lorem ipsum dolor [...] amet} is witnessed by manuscripts A, B and C, while the part of text starting \enquote{sic transit} is witnessed by manuscripts A, B, C and D.
%
% \cs{stopmsdata} is also automatically inserted by \cs{msdata}.
%
@@ -2295,15 +2297,15 @@
% For endnotes, \cs{Xendnumberonlyfirstinline}; \cs{Xendnumberonlyfirstintwolines} and \cs{Xendsymlinenum} are the equivalents of
% \\ \cs{Xnumberonlyfirstinline}; \cs{Xnumberonlyfirstintwolines} and \cs{Xsymlinenum}.
%
-% \subsubsection{Print line number annotation only at first time}\label{annotation-inapparatus}
+% \subsubsection{Print line number annotation only the first time}\label{annotation-inapparatus}
% \DescribeMacro{\Xlinenumannotationonlyfirst}
-% By default, the line number annotation (\reff{annotion} is printed inside every note. If you want to print it only the first time for a given annotation
+% By default, the line number annotation (\reff{annotion} is printed in every note. If you want to print it only the first time for a given annotation
% you can use \cs{Xlinenumannotationonlyfirst}\oarg{s}.
%
% Note the two following points:
% \begin{itemize}
-% \item If you use \option{noresetlinenumannotation} option of \macpackage, the \cs{Xlinenumannotationonlyfirst} won't take account of the official line number.
-% \item The \cs{Xlinenumannotationonlyfirst} works for consecutive lemmas with the same annotation. That is, if you have for example a lemma with \verb+A+ annotation, then a lemma with \verb+B+ annotation, then a lemma with \verb+A+ annotation, all lemmas will have its own annotation in the apparatus.
+% \item If you use the \option{noresetlinenumannotation} option of \macpackage, the \cs{Xlinenumannotationonlyfirst} won't take account of the official line number.
+% \item The \cs{Xlinenumannotationonlyfirst} works for consecutive lemmas with the same annotation. That is, if you have for example a lemma with an \verb+A+ annotation, then a lemma with a \verb+B+ annotation, then a lemma with an \verb+A+ annotation, each lemma will have its own annotation in the apparatus.
% \end{itemize}
%
% \DescribeMacro{\Xlinenumannotationonlyfirstintwo}
@@ -2313,7 +2315,7 @@
%
%
% \DescribeMacro{\Xsymlinenumannotation}
-% For setting a particular symbol in place of the line number annotation, you can use \protect\cs{Xsymlinenumannotation}\oarg{s}\marg{symbol} in combination with \protect\cs{Xlinenumannotationonlyfirst}\oarg{s}. From the second lemma with the same line number annotation, the symbol will be used instead of the annotation. Note that any command called in \meta{symbol} must be robust. Use \protect\cs{robustify} to robustify a non-robust command.
+% To use a particular symbol in place of the line number annotation, you can use \protect\cs{Xsymlinenumannotation}\oarg{s}\marg{symbol} in combination with \protect\cs{Xlinenumannotationonlyfirst}\oarg{s}. From the second lemma with the same line number annotation, the symbol will be used instead of the annotation. Note that any command called in \meta{symbol} must be robust. Use \protect\cs{robustify} to robustify a non-robust command.
%
% \DescribeMacro{\Xendlinenumannotationonlyfirst}
% \DescribeMacro{\Xendlinenumannotationonlyfirstintwo}
@@ -4329,7 +4331,7 @@
% \begin{macrocode}
%<*code>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{reledmac}[2020/03/08 v2.32.5 typesetting critical editions]%
+\ProvidesPackage{reledmac}[2020/04/19 v2.32.6 typesetting critical editions]%
% \end{macrocode}
%
% \subsection{Package options}
@@ -7847,6 +7849,7 @@
\let\edtext=\dummy@edtext
\let\edindex\dummy@edindex%
\l@dtabnoexpands
+ \l@noexpands@edgl%
\let\linenumannotation=\@gobble%
\morenoexpands}
\let\morenoexpands=\relax
@@ -8279,7 +8282,7 @@
% The general mechanism is the following:
% \begin{itemize}
% \item \textbf{At the first run}, each \protect\cs{sameword} command increments an \protect\package{etoolbox} counter the name of which contains the argument of the \protect\cs{sameword} commands.
-% \item Then this counter, associated with the argument of \protect\cs{sameword} is stored with the \protect\cs{@sw} command in the auxiliary file of the current \macpackage\ section (the \verb+.1+, \verb+.2+\ldots\ file).
+% \item Then this counter associated with the argument of \protect\cs{sameword} is stored with the \protect\cs{@sw} command in the auxiliary file of the current \macpackage\ section (the \verb+.1+, \verb+.2+\ldots\ file).
% \item \textbf{When this auxiliary file is read at the second run}, different operations are achieved:
% \begin{enumerate}
% \item Get the rank of each \protect\cs{sameword} in a line (relative rank) from the rank of each \protect\cs{sameword} in all the numbered section (absolute rank):
@@ -18193,93 +18196,141 @@
% \end{macrocode}
% First those which arguments are \oarg{options}\marg{label}\oarg{insert}.
% \begin{macrocode}
+ \gdef\edglsomo{}%
+ \listgadd{\edglsomo}{gls}%
+ \listgadd{\edglsomo}{Gls}%
+ \listgadd{\edglsomo}{GLS}%
+ \listgadd{\edglsomo}{glspl}%
+ \listgadd{\edglsomo}{Glspl}%
+ \listgadd{\edglsomo}{GLSpl}%
+ \listgadd{\edglsomo}{glstext}%
+ \listgadd{\edglsomo}{Glstext}%
+ \listgadd{\edglsomo}{GLStext}%
+ \listgadd{\edglsomo}{Glsfirst}%
+ \listgadd{\edglsomo}{GLSfirst}%
+ \listgadd{\edglsomo}{glsplural}%
+ \listgadd{\edglsomo}{Glsplural}%
+ \listgadd{\edglsomo}{GLSplural}%
+ \listgadd{\edglsomo}{glsfirstplural}%
+ \listgadd{\edglsomo}{Glsfirstplural}%
+ \listgadd{\edglsomo}{GLSfirstplural}%
+ \listgadd{\edglsomo}{glsname}%
+ \listgadd{\edglsomo}{Glsname}%
+ \listgadd{\edglsomo}{GLSname}%
+ \listgadd{\edglsomo}{glssymbol}%
+ \listgadd{\edglsomo}{Glssymbol}%
+ \listgadd{\edglsomo}{GLSsymbol}%
+ \listgadd{\edglsomo}{glsdesc}%
+ \listgadd{\edglsomo}{Glsdesc}%
+ \listgadd{\edglsomo}{GLSdesc}%
+ \listgadd{\edglsomo}{glsuseri}%
+ \listgadd{\edglsomo}{Glsuseri}%
+ \listgadd{\edglsomo}{GLSuseri}%
+ \listgadd{\edglsomo}{glsuserii}%
+ \listgadd{\edglsomo}{Glsuserii}%
+ \listgadd{\edglsomo}{GLSuserii}%
+ \listgadd{\edglsomo}{glsuseriii}%
+ \listgadd{\edglsomo}{Glsuseriii}%
+ \listgadd{\edglsomo}{GLSuseriii}%
+ \listgadd{\edglsomo}{glsuseriv}%
+ \listgadd{\edglsomo}{Glsuseriv}%
+ \listgadd{\edglsomo}{GLSuseriv}%
+ \listgadd{\edglsomo}{glsuserv}%
+ \listgadd{\edglsomo}{Glsuserv}%
+ \listgadd{\edglsomo}{GLSuserv}%
+ \listgadd{\edglsomo}{glsuservi}%
+ \listgadd{\edglsomo}{Glsuservi}%
+ \listgadd{\edglsomo}{GLSuservi}%
\renewcommand{\do}[1]{%
\expandafter\DeclareRobustCommandx\csname ed#1\endcsname[3][1,3,usedefault]{%
\doedindexlabel%
+ \ifdef{\hypertarget}{%
+ \Hy@raisedlink@left{\hypertarget{pageline.\thepageline}{}}%
+ }{}%
\csname#1\endcsname[counter=pageline,##1]{##2}[##3]%
}%
\expandafter\WithSuffix\expandafter\DeclareRobustCommandx\csname ed#1\endcsname*[3][1,3,usedefault]{%
\doedindexlabel%
+ \ifdef{\hypertarget}{%
+ \Hy@raisedlink@left{\hypertarget{pageline.\thepageline}{}}%
+ }{}%
\csname#1\endcsname*[counter=pageline,##1]{##2}[##3]%
}%
}%
- \docsvlist{%
- gls,%
- Gls,%
- GLS,%
- glspl,%
- Glspl,%
- GLSpl,%
- glstext,%
- Glstext,%
- GLStext,%
- Glsfirst,%
- GLSfirst,%
- glsplural%
- Glsplural,%
- GLSplural,%
- glsfirstplural,%
- Glsfirstplural,%
- GLSfirstplural,%
- glsname,%
- Glsname,%
- GLSname,%
- glssymbol,%
- Glssymbol,%
- GLSsymbol,%
- glsdesc,%
- Glsdesc,%
- GLSdesc,%
- glsuseri,%
- Glsuseri,%
- GLSuseri,%
- glsuserii,%
- Glsuserii,%
- GLSuserii,%
- glsuseriii,%
- Glsuseriii,%
- GLSuseriii,%
- glsuseriv,%
- Glsuseriv,%
- GLSuseriv,%
- glsuserv,%
- Glsuserv,%
- GLSuserv,%
- glsuservi,%
- Glsuservi,%
- GLSuservi%
- }%
+ \dolistloop{\edglsomo}%
% \end{macrocode}
% Then those which arguments are \oarg{options}\marg{label}\marg{link text}.
% \begin{macrocode}
+ \gdef\edglsomm{}%
+ \listgadd\edglsomm{glsdisp}%
+ \listgadd\edglsomm{glslink}%
\renewcommand{\do}[1]{%
\expandafter\DeclareRobustCommandx\csname ed#1\endcsname[3][1,usedefault]{%
\doedindexlabel%
+ \ifdef{\hypertarget}{%
+ \Hy@raisedlink@left{\hypertarget{pageline.\thepageline}{}}%
+ }{}%
\csname#1\endcsname[counter=pageline,##1]{##2}{##3}%
}%
\expandafter\WithSuffix\expandafter\DeclareRobustCommandx\csname ed#1\endcsname*[3][1,usedefault]{%
\doedindexlabel%
+ \ifdef{\hypertarget}{%
+ \Hy@raisedlink@left{\hypertarget{pageline.\thepageline}{}}%
+ }{}%
\csname#1\endcsname*[counter=pageline,##1]{##2}{##3}%
}%
}%
- \docsvlist{glsdisp,glslink}%
+ \dolistloop{\edglsomm}%
% \end{macrocode}
% Then those which arguments are \oarg{options}\marg{label}.
% \begin{macrocode}
+ \gdef\edglsom{}%
+ \listgadd\edglsom{glsadd}%
\renewcommand{\do}[1]{%
\expandafter\DeclareRobustCommandx\csname ed#1\endcsname[2][1,usedefault]{%
\doedindexlabel%
+ \ifdef{\hypertarget}{%
+ \Hy@raisedlink@left{\hypertarget{pageline.\thepageline}{}}%
+ }{}%
\csname#1\endcsname[counter=pageline,##1]{##2}%
}%
\expandafter\WithSuffix\expandafter\DeclareRobustCommandx\csname ed#1\endcsname*[2][1,usedefault]{%
\doedindexlabel%
+ \ifdef{\hypertarget}{%
+ \Hy@raisedlink@left{\hypertarget{pageline.\thepageline}{}}%
+ }{}%
\csname#1\endcsname*[counter=pageline,##1]{##2}%
}%
}%
- \docsvlist{glsadd}%
- }{}%
+ \dolistloop{\edglsom}%
+% \end{macrocode}
+% \cs{l@noexpands@edgl} is a macro to avoid expanding glossaries macros in \cs{edtext} first argument. It is called by \cs{no@expands}.
+% Its definition is made dynamically.
+% \begin{macro}{\l@noexpands@edgl}
+% \begin{macrocode}
+ \def\l@noexpands@edgl{}%
+ \renewcommand\do[1]{%
+ \xappto\l@noexpands@edgl{%
+ \noexpand\RenewDocumentCommand\csname ed#1\endcsname{omos}{}%
+ }%
+ }%
+ \dolistloop{\edglsomo}%
+ \renewcommand\do[1]{%
+ \xappto\l@noexpands@edgl{%
+ \noexpand\RenewDocumentCommand\csname ed#1\endcsname{omms}{}%
+ }%
+ }%
+ \dolistloop{\edglsomm}%
+ \renewcommand\do[1]{%
+ \xappto\l@noexpands@edgl{%
+ \noexpand\RenewDocumentCommand\csname ed#1\endcsname{oms}{}%
+ }%
+ }%
+ \dolistloop{\edglsom}%
+ }{\let\l@noexpands@edgl\relax}%
}%
% \end{macrocode}
+% \end{macro}
% \section{Verse}
%
% The original code is principally Wayne Sullivan's\index{Sullivan, Wayne}