summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/reledmac
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-03-04 22:12:40 +0000
committerKarl Berry <karl@freefriends.org>2019-03-04 22:12:40 +0000
commit270f51a641098929ca9083788eb12f01203014cd (patch)
tree07a191f2df180d12f23392d33f837b905751e501 /Master/texmf-dist/source/latex/reledmac
parentcdcd34b4700774946edede081d49d6a110feba9c (diff)
reledmac (4mar19)
git-svn-id: svn://tug.org/texlive/trunk@50229 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/reledmac')
-rw-r--r--Master/texmf-dist/source/latex/reledmac/reledmac.dtx203
1 files changed, 146 insertions, 57 deletions
diff --git a/Master/texmf-dist/source/latex/reledmac/reledmac.dtx b/Master/texmf-dist/source/latex/reledmac/reledmac.dtx
index aec7bc9adc4..bae73f9fe41 100644
--- a/Master/texmf-dist/source/latex/reledmac/reledmac.dtx
+++ b/Master/texmf-dist/source/latex/reledmac/reledmac.dtx
@@ -525,6 +525,13 @@
% \changes{v2.30.0}{2019/01/22}{Add \protect\cs{Xnoidenticallinenumannotation} and \protect\cs{Xendnoidenticallinenumannotation} hooks}
% \changes{v2.30.0}{2019/01/22}{Add separator between line number annotations in margin. Add \protect\cs{setlinenumannotationsep}}
% \changes{v2.31.0}{2019/02/22}{Add \protect\option{noprefix} and \protect\option{prefixmore} to \protect\cs{appref} and \protect\cs{SEref}.}
+% \changes{v2.31.1}{2019/03/03}{Fix bug with \protect\cs{Xgroupbyline}, which could produce spurious blank line}
+% \changes{v2.31.1}{2019/03/03}{Fix bug with multiple footnote layer and \protect\cs{Xgroupbyline}}
+% \changes{v2.31.1}{2019/03/03}{Fix incompatibility between \protect\cs{Xgroupbyline} and \protect\package{hyperref} package}
+% \changes{v2.31.1}{2019/03/03}{Fix incompatibility between \protect\cs{Xgroupbyline} and optional argument of critical footnotes}
+% \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.}
% Typeset scholarly editions with \LaTeX\thanks{This file (\dtxfilename)
% has version number \fileversion, last revised \filedate.}}
%
@@ -4260,7 +4267,7 @@
% \begin{macrocode}
%<*code>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{reledmac}[2019/02/22 v2.31.0 typesetting critical editions]%
+\ProvidesPackage{reledmac}[2019/03/03 v2.31.1 typesetting critical editions]%
% \end{macrocode}
%
% \subsection{Package options}
@@ -9969,12 +9976,13 @@
% \end{macro}
%
% \begin{macro}{\add@Xgroupbyline}
-% If you use \cs{Xgroupbyline}, the insertion of the critical footnotes are not made immediately in \cs{add@inserts}, but the content to be inserted is stored, to be inserted in one block.
+% If you use \cs{Xgroupbyline}, the insertion of the critical footnotes are not made immediately in \cs{add@inserts}, but the content to be inserted is stored, in order to be inserted later in one block.
% This insertion in one block is made by \cs{add@Xgroupbyline}.
% \begin{macrocode}
\newcommand{\add@Xgroupbyline}{%
\unless\ifnocritical@%
\def\do##1{%Looping on the series
+ \let\olddo\do%Save the old \do macro, that is this macro itself!
\def\do####1{%Looping on the ##1@forinserting command
\ifcsdef{##1@forinserting@####1}{%
\X@beforeinsertion{##1}%
@@ -9984,6 +9992,7 @@
\insert\csname ##1footins\endcsname%
\fi%
{%
+ \nottoggle{Xparindent@##1}{\parindent=\z@}{}%
\ifcsdef{Xhsize\csuse{series@display##1}@##1}%
{\hsize \csuse{Xhsize\csuse{series@display##1}@##1}}%
{}%
@@ -10008,6 +10017,7 @@
\dolistcsloop{##1@forinserting}%
}{}%
\global\csundef{##1@forinserting}%
+ \let\do\olddo%Restore old do
}%
\dolistloop{\@series}%
\fi%
@@ -10490,11 +10500,12 @@
% \end{macro}
%
% \begin{macro}{\normalvfootnote@inserted}
-% The \cs{normalvfootnote@inserted} macro is expanded to the content to be add to a \cs{insert} for normal critical footnote.
+% The \cs{normalvfootnote@inserted} macro is expanded to the content to be added to a \cs{insert} for normal critical footnote.
% \begin{macrocode}
\notbool{parapparatus@}{\newcommand*}{\newcommand}{\normalvfootnote@inserted}[2]{%
\nottoggle{Xgroupbyline@#1}{\noindent}{}\csuse{Xbhooknote@#1}%
\csuse{Xnotefontsize@#1}%
+ \iftoggle{Xgroupbyline@#1}{\strut}{}%
\footsplitskips
\ifl@dpairing\ifl@dpaging\else%
\setXnoteswidthliketwocolumns@{#1}%
@@ -10583,8 +10594,7 @@
\notbool{parapparatus@}{\newcommand*}{\newcommand}{\normalfootfmt}[4]{%
\Xstorelineinfo{#1}{#4}%
\nottoggle{Xgroupbyline@#4}{\Xledsetnormalparstuff{#4}}{}%
- \hangindent=\csuse{Xhangindent@#4}%
- \everypar{\hangindent=\csuse{Xhangindent@#4}}%
+ \Xsethangindent{#4}%
\nottoggle{Xgroupbyline@#4}{\rule\z@\splittopskip}{}%
{\printlinefootnote{#1}{#4}}%
\print@lemma{#1}{#2}{#4}%
@@ -11339,8 +11349,7 @@
{}%
\nottoggle{Xparindent@#1}{\parindent=\z@}{}%
\tolerance=5000%
- \hangindent=\csuse{Xhangindent@#1}%
- \everypar{\hangindent=\csuse{Xhangindent@#1}}%
+ \Xsethangindent{#1}%
\@tempdima=\parindent%
\csuse{Xcolalign@#1}%
\parindent=\@tempdima%
@@ -11488,8 +11497,7 @@
\hsize \csuse{Xhsizetwocol@#1}%
\nottoggle{Xparindent@#1}{\parindent=\z@}{}%
\tolerance=5000%
- \hangindent=\csuse{Xhangindent@#1}%
- \everypar{\hangindent=\csuse{Xhangindent@#1}}%
+ \Xsethangindent{#1}%
\@tempdima=\parindent%
\csuse{Xcolalign@#1}%
\parindent=\@tempdima%
@@ -11552,6 +11560,32 @@
% \end{macro}
%
%
+% \subsection{Footnote hanging indent}
+% \begin{macro}{\Xsethangindent}
+% \begin{macro}{\sethangindentX}
+% \cs{Xsethangindent} set the hangindent for a critical footnote, while \cs{sethangindentX} does it for a familiar footnote.
+% \begin{macrocode}
+\newcommand{\Xsethangindent}[1]{%
+ \if@RTL%
+ \hangindent=-\csuse{Xhangindent@#1}%
+ \everypar{\hangindent=-\csuse{Xhangindent@#1}}%
+ \else%
+ \hangindent=\csuse{Xhangindent@#1}%
+ \everypar{\hangindent=\csuse{Xhangindent@#1}}%
+ \fi%
+}%
+\newcommand{\sethangindentX}[1]{%
+ \if@RTL%
+ \hangindent=-\csuse{hangindentX@#1}%
+ \everypar{\hangindent=-\csuse{hangindentX@#1}}%
+ \else%
+ \hangindent=\csuse{hangindentX@#1}%
+ \everypar{\hangindent=\csuse{hangindentX@#1}}%
+ \fi%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
% \subsection{Critical notes presentation}
% Here, we define some commons macro which are used in order to print a critical notes, that is a note with 1) line number 2) lemma 3) lemma separator 4) text associated to the lemma.
@@ -12224,53 +12258,64 @@
% \subsubsection{Footnote grouped by line}
% \begin{macro}{\prepare@Xgroupbyline}
% \cs{prepare@Xgroupbyline} is a macro called on the \cs{meta{XXX}vfootnote} if \cs{Xgroupbyline} is set to true, instead of calling \cs{insert} directly.
+% \#1 The series\\
+% \#2 The content of the footnote, that is also the line number indication\\
+% \#3 This macro which prepare the content of the insertion \\
% \begin{macrocode}
\newcommand{\prepare@Xgroupbyline}[3]{%
\iftoggle{Xgroupbylineseparetwolines@#1}{%
\l@dparsefootspec#2%
\ifcsdef{#1@forinserting@\l@dparsedendpage-\l@dparsedendline-\l@dparsedendsub}%
- {%
- \csgappto%
- {#1@forinserting@\l@dparsedendpage-\l@dparsedendline-\l@dparsedendsub}%
- {%
- \ifcsempty{Xsymlinenum@#1}%
- {\csuse{Xparafootsep@#1}}%
- {}%
- #3{#1}{#2}%
- \hskip\csuse{Xafternote@#1}\relax%
- }%
- }%
- {%
- \csdef%
- {#1@forinserting@\l@dparsedendpage-\l@dparsedendline-\l@dparsedendsub}%
- {%
- #3{#1}{#2}%
+ {%
+ \csgappto{#1@forinserting@\l@dparsedendpage-\l@dparsedendline-\l@dparsedendsub}{%
\hskip\csuse{Xafternote@#1}\relax%
}%
- }%
- \listcsxadd{#1@forinserting}{\l@dparsedendpage-\l@dparsedendline-\l@dparsedendsub}%
- }{%
- \ifcsdef{#1@forinserting@all}{%
- \csgappto%
- {#1@forinserting@all}%
- {%
+ }%
+ {}%
+ \add@hooktoggle@specific@to@cs{#1@forinserting@\l@dparsedendpage-\l@dparsedendline-\l@dparsedendsub}%
+ \add@hookarg@specific@to@cs{#1@forinserting@\l@dparsedendpage-\l@dparsedendline-\l@dparsedendsub}%
+ \csxappto%
+ {#1@forinserting@\l@dparsedendpage-\l@dparsedendline-\l@dparsedendsub}%
+ {%
+ \keep@this@crossref@forinserting%
+ \unexpanded{%
\ifcsempty{Xsymlinenum@#1}%
{\csuse{Xparafootsep@#1}}%
{}%
#3{#1}{#2}%
- \hskip\csuse{Xafternote@#1}\relax%
}%
- }%
+ }%
+ \listcsxadd{#1@forinserting}{\l@dparsedendpage-\l@dparsedendline-\l@dparsedendsub}%
+ }{%
+ \ifcsdef{#1@forinserting@all}{%
+ \csgappto%
+ {#1@forinserting@all}%
+ {\hskip\csuse{Xafternote@#1}\relax}%
+ }{}%
+ \add@hooktoggle@specific@to@cs{#1@forinserting@all}%
+ \add@hookarg@specific@to@cs{#1@forinserting@all}%
+ \csxappto%
+ {#1@forinserting@all}%
{%
- \csdef%
- {#1@forinserting@all}%
- {%
- #3{#1}{#2}%
- \hskip\csuse{Xafternote@#1}\relax%
- }%
+ \keep@this@crossref@forinserting%
+ \unexpanded{%
+ \ifcsempty{Xsymlinenum@#1}%
+ {\csuse{Xparafootsep@#1}}%
+ {}%
+ #3{#1}{#2}%
+ }%
}%
- \listcsgadd{#1@forinserting}{all}%
}%
+ \listcsgadd{#1@forinserting}{all}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\keep@this@crossref@forinserting}
+% \cs{keep@this@crossref@forinserting} is called by \cs{prepare@Xgroupbyline}. It just ensures that \cs{@this@crossref@start} and \cs{this@crossref@end} value are kept in memory.
+% \begin{macrocode}
+\newcommand{\keep@this@crossref@forinserting}{%
+ \unexpanded{\gdef\@this@crossref@start}{\@this@crossref@start}%
+ \unexpanded{\gdef\@this@crossref@end}{\@this@crossref@end}%
}%
% \end{macrocode}
% \end{macro}
@@ -12610,8 +12655,7 @@
\@nameuse{@thefnmark#1}%
}%
\ledsetnormalparstuffX{#1}%
- \hangindent=\csuse{hangindentX@#1}%
- \everypar{\hangindent=\csuse{hangindentX@#1}}%
+ \sethangindentX{#1}%
\rule\z@\splittopskip%
{{\csuse{notenumfontX@#1}\wrapped@footfootmarkX{#1}}%
\csuse{wrapcontentX@#1}{#2}%
@@ -12930,8 +12974,7 @@
\@nameuse{@thefnmark#1}%
}%
\normal@pars%
- \hangindent=\csuse{hangindentX@#1}%
- \everypar{\hangindent=\csuse{hangindentX@#1}}%
+ \sethangindentX{#1}%
\hsize \csuse{hsizetwocolX@#1}%
\nottoggle{parindentX@#1}{\parindent=\z@}{}%
\tolerance=5000\relax%
@@ -13053,8 +13096,7 @@
\protected@edef\@currentlabel{%
\@nameuse{@thefnmark#1}%
}%
- \hangindent=\csuse{hangindentX@#1}%
- \everypar{\hangindent=\csuse{hangindentX@#1}}%
+ \sethangindentX{#1}%
\normal@pars%
\hsize \csuse{hsizethreecolX@#1}%
\nottoggle{parindentX@#1}{\parindent=\z@}{}%
@@ -13738,8 +13780,6 @@
\def\@this@crossref@end{#7:end}%
\printlineendnote{#1}{#4}%
\IfStrEq{#6}{R}{\ledRcol@false}{}%
- \undef\@this@crossref@start%
- \undef\@this@crossref@end%
\nottoggle{Xendlemmadisablefontselection@#4}%
{\select@lemmafont#1|}%
{}%
@@ -14452,8 +14492,6 @@
{{\l@d@nums}{\expandonce\@tag}{\expandonce\content}}%
\noexpand\Xnote@false%
\unexpanded{\advance\@edindex@fornote@\m@ne}%
- \unexpanded{\undef\@this@crossref@start}%
- \unexpanded{\undef\@this@crossref@end}%
\ifbool{indtl@innote}%
{\unexpanded{\let\index\orig@@index}}%
{}%
@@ -14492,8 +14530,6 @@
\noexpand\csuse{v#1footnote}%
{#1}%
{{\l@d@nums}{\expandonce\@tag}{\expandonce\content}}%
- \unexpanded{\undef\@this@crossref@start}%
- \unexpanded{\undef\@this@crossref@end}%
\noexpand\Xnote@false%
\unexpanded{\advance\@edindex@fornote@\m@ne}%
\ifbool{indtl@innote}%
@@ -15267,6 +15303,7 @@
% \begin{macrocode}
\newcommand{\newhooktoggle@specific}[1]{%
\newtoggle{#1@}%
+ \listgadd{\hooktoggle@specific}{#1}%
\define@key[mac]{truefootnoteoption}{#1}[]{\global\settoggle{#1@}{true}}%When enabling footnote option
\define@key[mac]{falsefootnoteoption}{#1}[]{\global\settoggle{#1@}{false}}
}
@@ -15276,11 +15313,67 @@
% \cs{newhookarg@specific} is a generic command to create argumen hook specific to a note.
% \begin{macrocode}
\newcommand{\newhookarg@specific}[1]{%
+ \listgadd{\hookarg@specific}{#1}%
\define@key[mac]{truefootnoteoption}{#1}{\csgdef{#1@}{##1}}%When enabling footnote option
\define@key[mac]{falsefootnoteoption}{#1}{\global\csundef{#1@}}%When disabling footnote option
}
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\hooktoggle@specific}
+% \begin{macro}{\add@hooktoggle@specific@to@cs}
+% The \cs{add@hooktoggle@specific@to@cs} macro stores to a macro
+% all the current values of hook toggle specific to a command.
+% It is useful for \cs{Xgroupbyline} option, which does not add immediately notes to the inserts list.
+% It uses the \cs{hooktoggle@specific} list.
+% \begin{macrocode}
+\def\hooktoggle@specific{}%
+\newcommand{\add@hooktoggle@specific@to@cs}[1]{%
+ \def\do##1{%
+ \iftoggle{##1@}{%
+ \ifcsdef{#1}{%
+ \csgappto{#1}{\toggletrue{##1@}}%
+ }{%
+ \csgdef{#1}{\toggletrue{##1@}}%
+ }%
+ }{%
+ \ifcsdef{#1}{%
+ \csgappto{#1}{\togglefalse{##1@}}%
+ }{%
+ \csgdef{#1}{\togglefalse{##1@}}%
+ }%
+ }%
+ }%
+ \dolistloop{\hooktoggle@specific}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\hookarg@specific}
+% \begin{macro}{\add@hookarg@specific@to@cs}
+% The same, but for optional argument of critical footnotes with assigned value.
+% \begin{macrocode}
+\def\hookarg@specific{}%
+\newcommand{\add@hookarg@specific@to@cs}[1]{%
+ \def\do##1{%
+ \ifcsvoid{##1@}{}{%
+ \ifcsdef{#1}{%
+ \csxappto{#1}{%
+ \noexpand\csdef%
+ {##1@}{\csname##1@\endcsname}%
+ }%
+ }{%
+ \csxdef{#1}{%
+ \noexpand\csdef%
+ {##1@}{\csname##1@\endcsname}%
+ }%
+ }%
+ }%
+ }%
+ \dolistloop{\hookarg@specific}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
% And now, we define some hooks specific to a note.
% \begin{macrocode}
\newhooktoggle@specific{fulllines}%
@@ -16534,8 +16627,6 @@
\xdef\annot@start{\xannotationref{#2:start}}%
\xdef\annot@end{\xannotationref{#2:end}}%
\printlines\xpageref{#2:start}|\xlineref{#2:start}|\xsublineref{#2:start}|\xpageref{#2:end}|\xlineref{#2:end}|\xsublineref{#2:end}|\relax|\xflagref{#2:start}|%
- \undef\@this@crossref@end%
- \undef\@this@crossref@start%
}%
\def\do##1{%
\setkeys[mac]{falsefootnoteoption}{##1}%
@@ -16558,8 +16649,6 @@
\def\@this@crossref@start{#2:start}%
\def\@this@crossref@end{#2:end}%
\printendlines\xpageref{#2:start}|\xlineref{#2:start}|\xsublineref{#2:start}|\xpageref{#2:end}|\xlineref{#2:end}|\xsublineref{#2:end}|\relax|\xflagref{#2:start}|%
- \undef\@this@crossref@end%
- \undef\@this@crossref@start%
}%
\def\do##1{%
\setkeys[mac]{falsefootnoteoption}{##1}%