summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/reledmac/reledmac.dtx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-08-17 21:16:23 +0000
committerKarl Berry <karl@freefriends.org>2017-08-17 21:16:23 +0000
commit8752481311daf908372f21728c152ca10ae0973e (patch)
treeec009734d0de97ee4fed31d17425243eaac1ccad /Master/texmf-dist/source/latex/reledmac/reledmac.dtx
parent0f4a34d1fe6262bc72205b50adb2ae5ab576d427 (diff)
reledmac (17aug17)
git-svn-id: svn://tug.org/texlive/trunk@45055 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.dtx406
1 files changed, 267 insertions, 139 deletions
diff --git a/Master/texmf-dist/source/latex/reledmac/reledmac.dtx b/Master/texmf-dist/source/latex/reledmac/reledmac.dtx
index 5ee3c68d709..ed2db006519 100644
--- a/Master/texmf-dist/source/latex/reledmac/reledmac.dtx
+++ b/Master/texmf-dist/source/latex/reledmac/reledmac.dtx
@@ -257,10 +257,10 @@
% \changes{v1.12.4}{2014/08/25}{Debug spurious page breaks before \protect\cs{chapter} (bug added in 1.12.0)}
% \changes{v1.13.1}{2014/09/25}{Debug quotation environment inside of a \protect\cs{pstart} preceded by a sectioning command.}
% \changes{v1.13.1}{2014/09/25}{Coming back of page and line breaking penalties's management, deleted by error in v0.17.}
-% \changes{v1.13.2}{2014/09/30}{Fix bug with normal footnotes, added by v1.13.0.}
+% \changes{v1.13.2}{2014/09/30}{Fix a bug with normal footnotes, added by v1.13.0.}
% \changes{v1.13.3}{2014/10/04}{Fix extra spaces with paragraphed footnotes, added by v1.13.0.}
-% \changes{v1.13.4}{2014/10/20}{Fix bug with index when memoir class is used without hyperref}
-% \changes{v1.15.0}{2015/01/12}{Fix bug with footnotes layout when using some options of the geometry package (bug add by v1.13.0).}
+% \changes{v1.13.4}{2014/10/20}{Fix a bug with index when memoir class is used without hyperref}
+% \changes{v1.15.0}{2015/01/12}{Fix a bug with footnotes layout when using some options of the geometry package (bug add by v1.13.0).}
% \changes{v1.16.0}{2015/01/23}{Compatibility of standard footnotes with some biblatex styles.}
% \changes{v1.16.0}{2015/01/23}{New \protect\cs{stanzaindent} command.}
% \changes{v1.18.0}{2015/02/23}{Compatibility with \LuaLaTeX\ RTL languages.}
@@ -272,13 +272,13 @@
% \changes{v1.20.0}{2015/03/22}{Fix issues with RTL text in notes when using \LuaLaTeX.}
% \changes{v1.20.0}{2015/03/22}{The \protect\cs{newif}s are not followed by boolean values set to false, because it is the \TeX\ default setting.}
% \changes{v1.20.0}{2015/03/22}{Explicit error message when calling \protect\cs{Xfootnote} outside of \protect\cs{edtext}.}
-% \changes{v1.20.0}{2015/03/22}{Fix bug with line number typesetting direction when using \protect\cs{eledsection} and similar commands for RTL texts with \LuaLaTeX.}
+% \changes{v1.20.0}{2015/03/22}{Fix a bug with line number typesetting direction when using \protect\cs{eledsection} and similar commands for RTL texts with \LuaLaTeX.}
% \changes{v1.21.0}{2015/04/13}{\protect\cs{AtEveryPstart} and \protect\cs{AtEveryPend} are now compatible with \protect\cs{autopar}}
-% \changes{v1.21.0}{2015/04/13}{Fix bug with space between columns with notes in two columns (bug added in v1.13.0).}
+% \changes{v1.21.0}{2015/04/13}{Fix a bug with space between columns with notes in two columns (bug added in v1.13.0).}
% \changes{v1.21.0}{2015/04/13}{Add nocritical, noend, nofamiliar and noledgroup options.}
-% \changes{v1.21.0}{2015/04/13}{Fix bug with \protect\cs{maxhnotesX} when using \protect\cs{foottwocolX} or \protect\cs{footthreecolX}.}
+% \changes{v1.21.0}{2015/04/13}{Fix a bug with \protect\cs{maxhnotesX} when using \protect\cs{foottwocolX} or \protect\cs{footthreecolX}.}
% \changes{v1.21.0}{2015/04/13}{Add \protect\cs{Xtwolinesbutnotmore} and \protect\cs{Xtwolinesonlyinsamepage}.}
-% \changes{v1.21.0}{2015/04/13}{Fix bug when a \protect\cs{Xfootnote} follows a \protect\cs{Xendnote} in the second argument of \protect\cs{edtext} (bug added in eledmac 1.0.0 !).}
+% \changes{v1.21.0}{2015/04/13}{Fix a bug when a \protect\cs{Xfootnote} follows a \protect\cs{Xendnote} in the second argument of \protect\cs{edtext} (bug added in eledmac 1.0.0 !).}
% \changes{v1.21.0}{2015/04/13}{Add noeledsec package option}
% \changes{v1.21.0}{2015/04/13}{parapparatus option works now with familiar footnotes.}
% \changes{v1.21.0}{2015/04/13}{Add \protect\cs{beforenotesX} and \protect\cs{Xbeforenotes} features for notes set in two and three column.}
@@ -291,66 +291,66 @@
% \changes{v1.22.0}{2015/04/25}{Provides support for xindy.}
% \changes{v1.22.0}{2015/04/25}{Adds hyperlink for references to notes in indices.}
% \changes{v1.22.0}{2015/04/25}{Fix conflict between noend package option and edtabularx environments}
-% \changes{v1.22.1}{2015/04/29}{Fix bug (added on v1.22.0) with \protect\cs{Xinplaceofnumber} hook.}
+% \changes{v1.22.1}{2015/04/29}{Fix a bug (added on v1.22.0) with \protect\cs{Xinplaceofnumber} hook.}
% \changes{v1.23.0}{2015/05/18}{Compatibility between nofamiliar/nocriticals option and minipage/ledgroup.}
% \changes{v1.23.0}{2015/05/18}{Fix error of \protect\cs{iftrue} not closed.}
% \changes{v1.23.0}{2015/05/18}{Allow use of \protect\cs{sameword} with inputenc managing of UTF-8.}
% \changes{v1.23.0}{2015/05/18}{Error message when using \protect\cs{beginnumbering}…\protect\cs{endnumbering} without \protect\cs{pstart}.}
% \changes{v1.23.0}{2015/05/18}{New tools to ensure the line-list file uses the right version of commands when upgrading the eledmac version.}
-% \changes{v1.23.0}{2015/05/18}{Fix bug with \protect\cs{skipnumbering} called immediately after a \protect\cs{pstart}.}
+% \changes{v1.23.0}{2015/05/18}{Fix a bug with \protect\cs{skipnumbering} called immediately after a \protect\cs{pstart}.}
% \changes{v1.23.0}{2015/05/18}{Fix spurious space with \protect\cs{skipnumbering} (bug added on v1.21.0).}
-% \changes{v1.23.1}{2015/05/20}{Fix bug with \protect\cs{lemma} command in the right side.}
+% \changes{v1.23.1}{2015/05/20}{Fix a bug with \protect\cs{lemma} command in the right side.}
% \changes{v1.23.2}{2015/05/29}{Compatibility with \LaTeX's release 2015.}
% \changes{v1.24.0}{2015/06/02}{We can reinitialize \protect\cs{AtEveryPstart} and \protect\cs{AtEveryPend} providing to it an empty argument.}
% \changes{v1.24.1}{2015/06/21}{\protect\cs{lemma} is disabled when using `nocritical` option.}
% \changes{v1.24.2}{2015/06/26}{Fix incompatibility between `nofamiliar` option and `memoir` package.}
% \changes{v1.24.3}{2015/07/07}{Restore marginal numbers and notes with sectioning command (bug introduced in v1.21.0)}
% \changes{v1.24.4}{2015/07/19}{Fix spurious space with \protect\cs{edindex} when using xindy+hyperref option.}
-% \changes{v1.24.5}{2015/07/16}{Fix bug of indent, when a added in 1.1.0, when a \protect\cs{beginnumbering} immediately follow a sectioning command.}
+% \changes{v1.24.5}{2015/07/16}{Fix a bug of indent, when a added in 1.1.0, when a \protect\cs{beginnumbering} immediately follow a sectioning command.}
% \changes{v2.0.0}{2015/07/19}{Package's name becomes \reledmac.}
% \changes{v2.0.0}{2015/07/19}{In order to have a more consistent name's convention, many names has been changed.}
% \changes{v2.0.0}{2015/07/19}{Many \LaTeX's output macros are now patched and not override.}
% \changes{v2.0.0}{2015/07/19}{Add nonum option for endnotes.}
% \changes{v2.0.0}{2015/07/19}{Add \protect\cs{Xendinplaceofnumber} hook.}
% \changes{v2.0.0}{2015/07/19}{Add \protect\cs{Xendnonumber} hook.}
-% \changes{v2.0.0}{2015/07/19}{Fix bug when printing only one series of endnotes, but wanted to keep endnotes for other series.}
+% \changes{v2.0.0}{2015/07/19}{Fix a bug when printing only one series of endnotes, but wanted to keep endnotes for other series.}
% \changes{v2.0.1}{2015/07/27}{Fix incompatibility between optional argument of \protect\cs{pstart} and \protect\cs{numberpstarttrue}}
-% \changes{v2.0.1}{2015/07/27}{Fix bug in eledmac-compat option}
+% \changes{v2.0.1}{2015/07/27}{Fix a bug in eledmac-compat option}
% \changes{v2.1.0}{2015/08/08}{New tools to number stanzas}
-% \changes{v2.1.0}{2015/08/02}{Fix bug with \protect\cs{chapter} in optional argument of \protect\cs{pstart} in parallel typesetting with \protect\ltxclass{scrbook}.}
-% \changes{v2.1.0}{2015/08/02}{Fix bug with \protect\cs{eledchapter} in parallel typesetting with \protect\ltxclass{scrbook}.}
-% \changes{v2.1.0}{2015/08/02}{Fix bug with \protect\cs{setline} at the beginning of a \protect\cs{pstart}.}
-% \changes{v2.1.0}{2015/08/02}{Fix bug with \protect\cs{advanceline} at the beginning of a \protect\cs{pstart}.}
+% \changes{v2.1.0}{2015/08/02}{Fix a bug with \protect\cs{chapter} in optional argument of \protect\cs{pstart} in parallel typesetting with \protect\ltxclass{scrbook}.}
+% \changes{v2.1.0}{2015/08/02}{Fix a bug with \protect\cs{eledchapter} in parallel typesetting with \protect\ltxclass{scrbook}.}
+% \changes{v2.1.0}{2015/08/02}{Fix a bug with \protect\cs{setline} at the beginning of a \protect\cs{pstart}.}
+% \changes{v2.1.0}{2015/08/02}{Fix a bug with \protect\cs{advanceline} at the beginning of a \protect\cs{pstart}.}
% \changes{v2.1.0}{2015/08/08}{Fix spacing bug with \protect\cs{Xbhooknote} and \protect\cs{bhooknoteX} when using them to insert text and not to execute code.}
% \changes{v2.1.0}{2015/08/08}{Fix spacing bug with \protect\cs{Xbhooknote} and \protect\cs{bhooknoteX} when using them to insert text and not to execute code.}
-% \changes{v2.1.1}{2015/08/13}{Fix bug with \protect\cs{ledpbsetting}\protect\arg{before}.}
-% \changes{v2.1.2}{2015/08/26}{Fix bug with lineation by pstart and tabular environments (added in 2.1.0).}
-% \changes{v2.1.3}{2015/09/05}{Fix bug with \protect\cs{edindex} when using not-Latin characters without UTF-8 engines}
+% \changes{v2.1.1}{2015/08/13}{Fix a bug with \protect\cs{ledpbsetting}\protect\arg{before}.}
+% \changes{v2.1.2}{2015/08/26}{Fix a bug with lineation by pstart and tabular environments (added in 2.1.0).}
+% \changes{v2.1.3}{2015/09/05}{Fix a bug with \protect\cs{edindex} when using not-Latin characters without UTF-8 engines}
% \changes{v2.1.3}{2015/09/05}{\protect\cs{Xhangindent} and \protect\cs{hangindentX} work now with all the paragraphs in the note.}
% \changes{v2.1.3}{2015/09/05}{\protect\cs{Xnoindent} and \protect\cs{noindentX} work now again (broken in 2.0.0).}
% \changes{v2.1.3}{2015/09/05}{Change some internal code in order to provide compatibility with \LaTeX\ release of october~2015}
-% \changes{v2.1.3}{2015/09/05}{Fix bug which inserted double space before paragraphed familiar notes.}
-% \changes{v2.2.0}{2015/09/29}{Fix bug with combination of \protect\cs{onehalfspacing} and two columns and three columns notes typeset.}
-% \changes{v2.2.0}{2015/09/29}{Fix bug with some setting command and optimization option.}
+% \changes{v2.1.3}{2015/09/05}{Fix a bug which inserted double space before paragraphed familiar notes.}
+% \changes{v2.2.0}{2015/09/29}{Fix a bug with combination of \protect\cs{onehalfspacing} and two columns and three columns notes typeset.}
+% \changes{v2.2.0}{2015/09/29}{Fix a bug with some setting command and optimization option.}
% \changes{v2.2.0}{2015/09/29}{New setting tools for endnotes: \protect\cs{Xendnumberonlyfirstinline}, \protect\cs{Xendnumberonlyfirstintwolines}, \protect\cs{Xendsymlinenum}, \protect\cs{Xendbeforenumber}, \protect\cs{Xendafterenumber}, \protect\cs{Xendbeforesymlinenum}, \protect\cs{Xendaftersymlinenum}, \protect\cs{Xendboxsymlinenum}, \protect\cs{Xendhangindent}, \protect\cs{Xendbhooklinenumber}, \protect\cs{Xendahooklinenumber}, \protect\cs{Xendbhookinplaceofnumber}, \protect\cs{Xendahookinplaceofnumber}.}
% \changes{v2.2.0}{2015/09/29}{Fix spurious space with paragraphed critical notes when using \LuaLaTeX.}
% \changes{v2.2.0}{2015/09/29}{Increase line list version number to ensure compatibility with new options of \reledpar package.}
% \changes{v2.2.1}{2015/10/05}{Compatibility with \LaTeX format 2015/10/01.}
-% \changes{v2.2.2}{2015/10/09}{Fix bug in \protect\cs{sethangingsymbol}.}
-% \changes{v2.2.2}{2015/10/09}{Fix bug with old version of \protect\package{etex}.}
+% \changes{v2.2.2}{2015/10/09}{Fix a bug in \protect\cs{sethangingsymbol}.}
+% \changes{v2.2.2}{2015/10/09}{Fix a bug with old version of \protect\package{etex}.}
% \hyphenation{man-u-script man-u-scripts}
% \changes{v2.3.0}{2015/10/14}{Warning message when using some setting commands inside rightside environment (deprecated behavior)}
% \changes{v2.3.0}{2015/10/14}{Disable empty lines as paragraph in stanza.}
-% \changes{v2.3.0}{2015/10/14}{Fix compatibility of paragraphed footnotes with \protect\package{bidi} v17.9 and following.}
+% \changes{v2.3.0}{2015/10/14}{Fix incompatibility of paragraphed footnotes with \protect\package{bidi} v17.9 and following.}
% \changes{v2.3.1}{2015/10/19}{Fix spurious space when using optional argument of \protect\cs{stanza} (introduced in v2.3.0).}
% \changes{v2.4.0}{2015/10/19}{\protect\cs{Xbhooknote} and \protect\cs{bhooknoteX} work with notes in columns.}
-% \changes{v2.4.0}{2015/10/19}{Fix bug with \protect\cs{sameword} in right side.}
+% \changes{v2.4.0}{2015/10/19}{Fix a bug with \protect\cs{sameword} in right side.}
% \changes{v2.4.0}{2015/10/19}{Fix spurious space in two columns and three columns notes.}
-% \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 a 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} 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.4.1}{2015/10/26}{Fix a bug with \protect\cs{appref} and \protect\cs{apprefwithpage} (introduced in v2.4.0).}
+% \changes{v2.4.1}{2015/10/26}{Fix a 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 a 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.}
@@ -363,11 +363,11 @@
% \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 a 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.}
% \changes{v2.7.0}{2015/11/29}{Warning for duplicate and undefined labels are parsable by latexmk}
% \changes{v2.7.0}{2015/11/29}{Warning for duplicate labels does not send any more a false line and page number}
-% \changes{v2.7.0}{2015/11/29}{Fix bug with \protect\cs{SErefwithpage}.}
+% \changes{v2.7.0}{2015/11/29}{Fix a bug with \protect\cs{SErefwithpage}.}
% \changes{v2.7.0}{2015/11/29}{Fix (again) bugs with footnote numbering in parallel typesetting while using \protect\env{ledgroup} environments (bug added in v2.5.0).}
% \changes{v2.7.0}{2015/11/29}{When using \protect\package{hyperref} package, add links for \protect\cs{SEref} and related, \protect\cs{appref} and related.}
% \changes{v2.7.0}{2015/11/29}{When using \protect\package{hyperref} package, add links from critical footnotes and critical endnotes to the line of text they refers}
@@ -384,106 +384,110 @@
% \changes{v2.8.0}{2016/01/15}{No indentation for paragraphed notes in ledgroup. Can be changed with \protect\cs{Xparindent} and \protect\cs{parindentX}.}
% \changes{v2.8.0}{2016/01/15}{More \protect\cs{edgls…} commands.}
% \changes{v2.8.1}{2016/02/22}{Warnings for undefined labels are really parsable by latexmk}
-% \changes{v2.8.2}{2016/02/27}{Fix bug with \protect\cs{AtEveryPstart} added in version 2.0.0.}
-% \changes{v2.8.2}{2016/02/27}{Fix bug with vertical space after the between-sectioning command as optional argument of a \protect\cs{pstart} and \protect\cs{pstart} content}
-% \changes{v2.8.2}{2016/02/27}{Fix bug concerning indent in a paragraph immediately following a sectioning command (bug NOT fixed on reledpar)}
+% \changes{v2.8.2}{2016/02/27}{Fix a bug with \protect\cs{AtEveryPstart} added in version 2.0.0.}
+% \changes{v2.8.2}{2016/02/27}{Fix a bug with vertical space after the between-sectioning command as optional argument of a \protect\cs{pstart} and \protect\cs{pstart} content}
+% \changes{v2.8.2}{2016/02/27}{Fix a bug concerning indent in a paragraph immediately following a sectioning command (bug NOT fixed on reledpar)}
% \changes{v2.9.0}{2016/03/23}{Allow continuing line numbering between normal text and parallel text, using \protect\cs{pausenumbering} and \protect\cs{resumenumbering} and the \protect\option{continuousnumberingwithcolumns} option.}
-% \changes{v2.9.0}{2016/03/23}{Fix bug when using \protect\cs{linenum}\protect\arg{page} and \protect\cs{pausenumbering}\protect\ldots\protect\cs{resumenumbering}.}
+% \changes{v2.9.0}{2016/03/23}{Fix a bug when using \protect\cs{lineneation}\protect\arg{page} and \protect\cs{pausenumbering}\protect\ldots\protect\cs{resumenumbering}.}
% \changes{v2.9.0}{2016/03/23}{Write correct metadata in numbered files when using \protect\cs{pausenumbering}\protect\ldots\protect\cs{resumenumbering}.}
-% \changes{v2.9.0}{2016/03/23}{Fix bug with three- and two-column footnote setting (added in v.2.4.0).}
+% \changes{v2.9.0}{2016/03/23}{Fix a bug with three- and two-column footnote setting (added in v.2.4.0).}
% \changes{v2.9.0}{2016/03/23}{Fix spurious space inside three-column familiar footnote.}
-% \changes{v2.9.1}{2016/04/09}{Fix bug when notes start with ``plus'' or ``minus''.}
-% \changes{v2.9.2}{2016/04/30}{Fix bug with \protect\package{hyperref} package when a lemma starts with ``plus'' or ``minus'' (bug introduced in v.~2.7.0).}
-% \changes{v2.9.3}{2016/05/02}{Fix bug with line number position and reset added by v.~2.9.0}
+% \changes{v2.9.1}{2016/04/09}{Fix a bug when notes start with ``plus'' or ``minus''.}
+% \changes{v2.9.2}{2016/04/30}{Fix a bug with \protect\package{hyperref} package when a lemma starts with ``plus'' or ``minus'' (bug introduced in v.~2.7.0).}
+% \changes{v2.9.3}{2016/05/02}{Fix a bug with line number position and reset added by v.~2.9.0}
% \changes{v2.10.0}{2016/05/08}{Add \protect\cs{AtEveryStanza} and \protect\cs{AtEveryStopStanza}.}
% \changes{v2.10.0}{2016/05/08}{More specific error messages.}
-% \changes{v2.10.0}{2016/05/08}{Fix bug in \protect\cs{ledlsnotefontsetup} and \protect\cs{ledrsnotefontsetup} which could not handle \protect\cs{color} command properly.}
+% \changes{v2.10.0}{2016/05/08}{Fix a bug in \protect\cs{ledlsnotefontsetup} and \protect\cs{ledrsnotefontsetup} which could not handle \protect\cs{color} command properly.}
% \changes{v2.10.1}{2016/05/18}{Add `nopenalties` option.}
-% \changes{v2.10.1}{2016/05/18}{Fix bug introduced in v.~1.4: not paragraphed critical footnotes could prevent marginal line number from being displayed}
+% \changes{v2.10.1}{2016/05/18}{Fix a bug introduced in v.~1.4: not paragraphed critical footnotes could prevent marginal line number from being displayed}
% \changes{v2.11.0}{2016/06/02}{Prevent \protect\cs{Xtxtbeforenotes} hook from causing notes to go beyond the bottom margin}
% \changes{v2.11.0}{2016/06/02}{Make \protect\cs{parafootsepX} work}
-% \changes{v2.11.0}{2016/06/02}{Fix bug in \protect\cs{Xparafootsep} in parallel typesetting}
+% \changes{v2.11.0}{2016/06/02}{Fix a bug in \protect\cs{Xparafootsep} in parallel typesetting}
% \changes{v2.11.0}{2016/06/02}{Add new tools to produce an apparatus of manuscripts}
-% \changes{v2.12.0}{2016/06/16}{Fix bug with familiar footnote number in optional argument of \protect\cs{pstart} or \protect\cs{pend} in parallel typesetting}
+% \changes{v2.12.0}{2016/06/16}{Fix a bug with familiar footnote number in optional argument of \protect\cs{pstart} or \protect\cs{pend} in parallel typesetting}
% \changes{v2.12.0}{2016/06/16}{Add \protect\cs{hidenumberingonleftpage} and \protect\cs{hidenumberingonrightpage}}
% \changes{v2.12.0}{2016/06/16}{\protect\cs{preXnotes} becomes \protect\cs{Xprenotes} (naming convention)}
% \changes{v2.12.0}{2016/06/16}{Add \protect\option{auxdir} option.}
% \changes{v2.12.0}{2016/06/16}{Add \protect\cs{toendnotes} and related.}
-% \changes{v2.12.0}{2016/06/16}{Fix bug when using \protect\cs{chapter} in optional argument of \protect\cs{pstart} in parallel typesetting in combination with the \protect\option{noeledsec} option.}
+% \changes{v2.12.0}{2016/06/16}{Fix a bug when using \protect\cs{chapter} in optional argument of \protect\cs{pstart} in parallel typesetting in combination with the \protect\option{noeledsec} option.}
% \changes{v2.12.0}{2016/06/16}{Fix spurious vertical space in \protect\cs{chapter} when used as optional argument of \protect\cs{pstart} in parallel tyepsetting.}
-% \changes{v2.12.0}{2016/06/16}{Fix bug with \protect\cs{ledinnernote} and \protect\cs{ledouternote} in parallel typesetting}
+% \changes{v2.12.0}{2016/06/16}{Fix a bug with \protect\cs{ledinnernote} and \protect\cs{ledouternote} in parallel typesetting}
% \changes{v2.12.0}{2016/06/16}{More accurate message to control the position of \protect\cs{Xfootnote} and \protect\cs{applabel} in the \protect\LaTeX\ code}
-% \changes{v2.12.0}{2016/06/16}{Fix bug in critical and familiar footnotes when using uppercase letters with accent mark}
+% \changes{v2.12.0}{2016/06/16}{Fix a bug in critical and familiar footnotes when using uppercase letters with accent mark}
% \changes{v2.12.0}{2016/06/16}{Make endnote compatible with \protect\cs{sameword} mechanism}
% \changes{v2.13.0}{2016/06/18}{Version 2.13.0 never existed.}
% \changes{v2.13.1}{2016/06/18}{In critical footnotes, the right side flag is printed only if requested explicitly with \protect\cs{Xlineflag} (bug added in v.~2.5.0).}
-% \changes{v2.13.2}{2016/06/24}{Fix bug added in v.~11.2 which could make parallel typesetting not work.}
+% \changes{v2.13.2}{2016/06/24}{Fix a bug added in v.~11.2 which could make parallel typesetting not work.}
% \changes{v2.13.3}{2016/06/28}{Makes \protect\cs{Xendafterpagenumbe} affecting \protect\cs{SErefwithpage}}
% \changes{v2.14.0}{2016/07/01}{Hyperref with the line number inside critical footnotes is correct when using \protect\cs{xxref}}
% \changes{v2.14.0}{2016/07/01}{Some internal changes for new features of \protect\reledpar.}
-% \changes{v2.14.1}{2016/07/04}{Fix bug when using \protect\cs{footnoteX} in the first argument of \protect\cs{edtext}.}
+% \changes{v2.14.1}{2016/07/04}{Fix a bug when using \protect\cs{footnoteX} in the first argument of \protect\cs{edtext}.}
% \changes{v2.14.1a}{2016/07/14}{Fix problematic typos in the handbook.}
% \changes{v2.15.0}{2016/07/22}{Add `byline` arrangement.}
% \changes{v2.15.0}{2016/07/22}{Fix \protect\cs{Xtxtbeforenotes} in ledgroup.}
% \changes{v2.15.1}{2016/09/07}{Fix \protect\cs{edindex} in tabular environments.}
-% \changes{v2.15.2}{2016/09/12}{Fix bug with \protect\package{fancyhdr} package 3.8 and later.}
-% \changes{v2.15.3}{2016/09/26}{Fix bug with \protect\cs{section} in optional argument of \protect\cs{pstart} and empty line before \protect\cs{pend} (bug added in v2.8.2).}
+% \changes{v2.15.2}{2016/09/12}{Fix a bug with \protect\package{fancyhdr} package 3.8 and later.}
+% \changes{v2.15.3}{2016/09/26}{Fix a bug with \protect\cs{section} in optional argument of \protect\cs{pstart} and empty line before \protect\cs{pend} (bug added in v2.8.2).}
% \changes{v2.15.3}{2016/09/26}{Simplification of the sectioning command code.}
% \changes{v2.16.0}{2016/10/02}{Display a warning message if using a version of \protect\LaTeX that is too old.}
% \changes{v2.16.0}{2016/10/02}{Deleted dead code.}
% \changes{v2.16.0}{2016/10/02}{New options for \protect\cs{fnpos} and \protect\cs{mpfnpos} to set a customized order for familiar and critical footnotes.}
% \changes{v2.16.0}{2016/10/02}{Compatibility with new features of \protect\reledpar}
-% \changes{v2.16.0}{2016/10/02}{Fix bug with \protect\cs{Xtxtbeforenotes} for notes in three or two columns}
-% \changes{v2.16.0}{2016/10/02}{Fix bug with \protect\cs{Xgroupbylines} for notes in two columns}
-% \changes{v2.16.0}{2016/10/02}{Fix bug with `notenumber' option of \protect\package{indextools} package when indexing texts in familiar footnotes.}
+% \changes{v2.16.0}{2016/10/02}{Fix a bug with \protect\cs{Xtxtbeforenotes} for notes in three or two columns}
+% \changes{v2.16.0}{2016/10/02}{Fix a bug with \protect\cs{Xgroupbylines} for notes in two columns}
+% \changes{v2.16.0}{2016/10/02}{Fix a bug with `notenumber' option of \protect\package{indextools} package when indexing texts in familiar footnotes.}
% \changes{v2.16.0}{2016/10/02}{When indexing texts in familiar footnotes with \protect\cs{edtext}, refer to the line number where the footnote is called.}
% \changes{v2.16.0}{2016/10/02}{When indexing texts in sidenotes with \protect\cs{edtext}, refer to the line number where the sidenote is called.}
% \changes{v2.16.0}{2016/10/02}{Fix potential bug when using \protect\cs{edindex} in critical footnotes.}
% \changes{v2.16.0}{2016/10/02}{Add \protect\cs{Xendpagenumberonlyfirst}, \protect\cs{Xendpagenumberonlyfirstifsingle}, \protect\cs{Xendpagenumberonlyfirstintwo}, \protect\cs{Xendinplaceofpagenumber} and \protect\cs{Xendsympagenum} hooks.}
% \changes{v2.16.0}{2016/10/02}{When \protect\cs{edindex} is called outside of a \protect\cs{beginnumbering}\protect\ldots\protect\cs{endnumbering} structure, it is automatically switched to \protect\cs{index}, with a warning message.}
-% \changes{v2.16.1}{2016/10/04}{Fix bug with redefinition of the style of the footnote number (bug added in v2.12.0)}
+% \changes{v2.16.1}{2016/10/04}{Fix a bug with redefinition of the style of the footnote number (bug added in v2.12.0)}
% \changes{v2.16.2}{2016/10/07}{Error message if \protect\package{footmisc} is loaded after \protect\package{reledmac}.}
-% \changes{v2.16.2}{2016/10/07}{Fix bug introduced by v2.16.1 when using non-expandable control sequence, like \protect\cs{normalfont}, in the footnote number style.}
-% \changes{v2.16.3}{2016/10/12}{Fix bug with \protect\cs{SEref} (bug added in v2.7.0).}
-% \changes{v2.16.4}{2016/10/16}{Fix bug with vertical space before sectioning command in optional argument of \protect\cs{pstart} (bug added in v2.15.3).}
+% \changes{v2.16.2}{2016/10/07}{Fix a bug introduced by v2.16.1 when using non-expandable control sequence, like \protect\cs{normalfont}, in the footnote number style.}
+% \changes{v2.16.3}{2016/10/12}{Fix a bug with \protect\cs{SEref} (bug added in v2.7.0).}
+% \changes{v2.16.4}{2016/10/16}{Fix a bug with vertical space before sectioning command in optional argument of \protect\cs{pstart} (bug added in v2.15.3).}
% \changes{v2.16.5}{2016/10/20}{Fix potential spurious spaces in endnotes.}
% \changes{v2.16.6}{2016/11/14}{Take into account \protect\cs{linenumberstyle} when using \protect\cs{edlineref}.}
-% \changes{v2.16.6}{2016/11/14}{Fix bug with the line number style in \protect\cs{doennotes} when referring to right side line in parallel typesetting.}
-% \changes{v2.16.7}{2016/12/12}{Fix bug with \protect\cs{numberpstarttrue} when using multiple \protect\cs{beginnumbering}…\protect\cs{endnumbering}.}
-% \changes{v2.16.7}{2016/12/12}{Fix bug with \protect\cs{msdata} when using multiple \protect\cs{beginnumbering}…\protect\cs{endnumbering}.}
-% \changes{v2.16.8}{2016/12/16}{Fix bug with \protect\cs{edindex} in footnotes in parallel typesetting.}
+% \changes{v2.16.6}{2016/11/14}{Fix a bug with the line number style in \protect\cs{doennotes} when referring to right side line in parallel typesetting.}
+% \changes{v2.16.7}{2016/12/12}{Fix a bug with \protect\cs{numberpstarttrue} when using multiple \protect\cs{beginnumbering}…\protect\cs{endnumbering}.}
+% \changes{v2.16.7}{2016/12/12}{Fix a bug with \protect\cs{msdata} when using multiple \protect\cs{beginnumbering}…\protect\cs{endnumbering}.}
+% \changes{v2.16.8}{2016/12/16}{Fix a bug with \protect\cs{edindex} in footnotes in parallel typesetting.}
% \changes{v2.17.0}{2016/12/23}{Add \protect\cs{edglsadd} command.}
% \changes{v2.17.0}{2016/12/23}{Add \protect\cs{setmsdataposition} setting.}
% \changes{v2.17.1}{2017/01/22}{Fix spurious space in paragraphed footnotes when using \protect\LuaLaTeX without using Right-To-Left text.}
% \changes{v2.17.2}{2017/01/25}{Change log message when numbered files still don't exist, in order to improve compatibility with \protect\emph{latexmk}.}
-% \changes{v2.17.3}{2017/01/31}{Fix bug with \protect\cs{doendnotesbysection} and \protect\cs{doendnotes}.}
-% \changes{v2.17.4}{2017/02/10}{Fix bug with \protect\cs{setSErefonlypageprefixsingle} and \protect\cs{setSErefonlypageprefixmore}.}
-% \changes{v2.17.5}{2017/02/12}{Fix bug with \protect\cs{pstartref} when refering to the left side in parallel typesetting.}
-% \changes{v2.18.0}{2017/02/22}{Fix bug when using both \protect\cs{Xnumberonlyfirstintwolines} or \protect\cs{Xnumberonlyfirstinline} and \protect\cs{Xparafootsep} and \protect\cs{Xsymlinenum}.}
-% \changes{v2.18.0}{2017/02/22}{Fix bug when using a \protect\cs{edtext} in two lines or more in right-to-left typesetting with \protect\XeLaTeX.}
-% \changes{v2.18.1}{2017/03/20}{Fix bug when using \protect\cs{msdata} with \protect\LuaLaTeX or with the \protect\package{hyperref} package.}
+% \changes{v2.17.3}{2017/01/31}{Fix a bug with \protect\cs{doendnotesbysection} and \protect\cs{doendnotes}.}
+% \changes{v2.17.4}{2017/02/10}{Fix a bug with \protect\cs{setSErefonlypageprefixsingle} and \protect\cs{setSErefonlypageprefixmore}.}
+% \changes{v2.17.5}{2017/02/12}{Fix a bug with \protect\cs{pstartref} when refering to the left side in parallel typesetting.}
+% \changes{v2.18.0}{2017/02/22}{Fix a bug when using both \protect\cs{Xnumberonlyfirstintwolines} or \protect\cs{Xnumberonlyfirstinline} and \protect\cs{Xparafootsep} and \protect\cs{Xsymlinenum}.}
+% \changes{v2.18.0}{2017/02/22}{Fix a bug when using a \protect\cs{edtext} in two lines or more in right-to-left typesetting with \protect\XeLaTeX.}
+% \changes{v2.18.1}{2017/03/20}{Fix a bug when using \protect\cs{msdata} with \protect\LuaLaTeX or with the \protect\package{hyperref} package.}
% \changes{v2.19.0}{2017/04/14}{Add better compatibility with the \protect\package{csquotes} package when using familiar footnotes.}
% \changes{v2.19.0}{2017/04/14}{Add \protect\cs{footnoteXmark} and \protect\cs{footnoteXtext} commands.}
% \title{\Macpackage \\
-% \changes{v2.19.0}{2017/04/14}{Fix bug with paragraph indent after sectioning command.}
-% \changes{v2.20.0}{2017/05/04}{Fix bug when using familiar footnotes in \protect\cs{eledsection} and related.}
+% \changes{v2.19.0}{2017/04/14}{Fix a bug with paragraph indent after sectioning command.}
+% \changes{v2.20.0}{2017/05/04}{Fix a bug when using familiar footnotes in \protect\cs{eledsection} and related.}
% \changes{v2.20.0}{2017/05/04}{Reset font specification at the beginning of familiar footnotes.}
% \changes{v2.20.0}{2017/05/04}{Add starred version of \protect\cs{AtEveryPstart}, \protect\cs{AtEveryPend}, \protect\cs{AtEveryStanza} and \protect\cs{AtEveryStopStanza}.}
% \changes{v2.20.0}{2017/05/04}{Add \protect\cs{AtStartEveryStanza}, \protect\cs{BeforeEveryStopStanza}, \protect\cs{AtEndEveryPend}, \protect\cs{AtStartEveryPstart}.}
% \changes{v2.20.0}{2017/05/04}{Add second optional argument of \protect\cs{pstart}, \protect\cs{pend} and \protect\cs{stanza}.}
% \changes{v2.20.0}{2017/05/04}{Add third and fourth optional argument of \protect\cs{newverse}.}
-% \changes{v2.21.0}{2017/06/04}{Fix bug when using formatting command in the argument of \protect\cs{edindex} inside \protect\cs{edtext}.}
+% \changes{v2.21.0}{2017/06/04}{Fix a bug when using formatting command in the argument of \protect\cs{edindex} inside \protect\cs{edtext}.}
% \changes{v2.21.0}{2017/06/04}{Now, as explained in the handbook, an \protect\cs{edindex} inside \protect\cs{edtext} only creates index reference to main text, and not to the critical footnote.}
% \changes{v2.21.0}{2017/06/04}{Add the possibility of nested \protect\cs{sameword}.}
-% \changes{v2.22.0}{2017/06/08}{Fix bug added in v2.16.0 when using \protect\cs{Xtxtbeforenotes} with paragraphed or normal footnotes.}
-% \changes{v2.22.0}{2017/06/08}{Fix bug with three and two columns critical footnotes, broken in v.~2.17.6.}
+% \changes{v2.22.0}{2017/06/08}{Fix a bug added in v2.16.0 when using \protect\cs{Xtxtbeforenotes} with paragraphed or normal footnotes.}
+% \changes{v2.22.0}{2017/06/08}{Fix a bug with three and two columns critical footnotes, broken in v.~2.17.6.}
% \changes{v2.22.0}{2017/06/08}{Add \protect\cs{txtbeforenotesX} hook.}
% \changes{v2.22.0}{2017/06/08}{Add \protect\cs{txtbeforenotesonlyonceX} and \protect\cs{Xtxtbeforenotesonlyonce} hooks.}
% \changes{v2.22.1}{2017/07/07}{Compatibility with new version of \protect\reledpar.}
-% \changes{v2.22.1}{2017/07/07}{Fix bug with some commands inside \protect\cs{sameword}.}
+% \changes{v2.22.1}{2017/07/07}{Fix a bug with some commands inside \protect\cs{sameword}.}
% \changes{v2.22.2}{2017/07/17}{Do not print footnotes at the first run.}
% \changes{v2.23.0}{2017/07/31}{Add \protect\option{swcaseinsensitive} option}
% \changes{v2.23.0}{2017/07/31}{Optimisation of the code added on v2.22.2 to not print footnotes at the first run.}
+% \changes{v2.24.0}{2017/08/17}{When a \protect\cs{setlinenum} is used, it is stronger than the \protect\cs{lineation}\protect\arg{page} setting.}
+% \changes{v2.24.0}{2017/08/17}{Fix a bug with \protect\cs{edlabel} at the beginning of a \protect\cs{pstart}.}
+% \changes{v2.24.0}{2017/08/17}{Add \protect\cs{swnoexpands} macro to avoid problems with not fully expandable macro inside \protect\cs{sameword}.}
+% \changes{v2.24.0}{2017/08/17}{Fix spurious space with \protect\cs{labelpstarttrue}}
% Typeset scholarly editions with \LaTeX\thanks{This file (\dtxfilename)
% has version number \fileversion, last revised \filedate.}}
%
@@ -1171,7 +1175,7 @@
% \DescribeMacro{\setlinenum}
% The \protect\cs{setline} and \protect\cs{advanceline} macros should only be used
% within a \protect\cs{pstart}\ldots\protect\cs{pend} group. The \protect\cs{setlinenum}\marg{num}
-% command can be used outside such a group, for example between
+% command can be used outside such a group, for example, between
% a \protect\cs{pend} and a \protect\cs{pstart}. It sets the line number
% to \meta{num}.
% It has no effect if used within a \protect\cs{pstart}\ldots\protect\cs{pend} group.
@@ -1530,9 +1534,9 @@
%
% \subsection{Disambiguation of identical words in the apparatus}
% \changes{v1.15.0}{2015/01/12}{New tools to prevent ambiguous references in lemma}
-% \changes{v1.23.0}{2015/05/18}{Fix bug with \protect\cs{sameword} when the same lemma is used for multiple notes or for nested \protect\cs{edtext}s.}
+% \changes{v1.23.0}{2015/05/18}{Fix a bug with \protect\cs{sameword} when the same lemma is used for multiple notes or for nested \protect\cs{edtext}s.}
% \changes{v1.23.0}{2015/05/18}{Optional argument of \protect\cs{sameword} can be a comma-separated list of \protect\cs{edtext} depth.}
-% \changes{v1.23.0}{2015/05/18}{Fix bug with \protect\cs{sameword} when the lemma overlaps multiple line.}
+% \changes{v1.23.0}{2015/05/18}{Fix a bug with \protect\cs{sameword} when the lemma overlaps multiple line.}
% Sometimes, the same word occurs twice (or more) in the same line.
% \Macpackage provides tools to disambiguate references in the critical notes.
% The lemma will be followed by a reference number if a given word occurs more that once in the same line.
@@ -1574,7 +1578,7 @@
% \subsubsection{Use with \protect\cs{lemma} command}
% If you use the \protect\cs{lemma} command, \macpackage\ cannot know to which occurence of \cs{sameword} in the first argument of \cs{edtext} a word marked with \cs{sameword} in \cs{lemma} should refer.
%
-% For example in the following example:
+% For example, in the following example:
% \begin{verbatim}
% some thing
% \edtext{\sameword{sw}
@@ -1752,7 +1756,34 @@
% #1\textsuperscript{#2}%
%}
% \end{verbatim}
+% \subsubsection{Problems with some macros}
+% \DescribeMacro{\swnoexpands}Macros inside \protect\cs{sameword} that are not fully expandable, mainly macros which manipulate font features, write on full or have optional argument, may cause problems during compilation. Custom commands inside \protect\cs{sameword} may therefore result in errors saying that \enquote{Use of \\sameword doesn't match its definition.} To solve this, include a redefinition of your custom commands in the \protect\cs{swnoexpands} macro.
+% In order to not include any content of a macro during comparison, identify the command with \protect\cs{@gobble} For example:
+% \begin{verbatim}
+%\makeatletter
+%\appto{\swnoexpands}{%
+% \let\somemacro\@gobble%
+%}
+%\makeatother
+% \end{verbatim}
+% This will drop the content of \protect\cs{somemacro} during comparison.
%
+% To include the content of the first and only one argument of a custom command in sameword comparison, use the \protect\cs{@firstofone} command. For example, this is how \cs{emph} is handled:
+% \begin{verbatim}
+%\makeatletter
+% \appto{\swnoexpands}{%
+% \let\emph\@firstofone%
+%}
+%\makeatother
+% \end{verbatim}
+% To include command which can take optional argument, use \cs{RenewExpandableDocumentCommand} of \cs{xparse}. For example, this is how \cs{edindex} is handled:
+% \begin{verbatim}
+%\makeatletter
+% \appto{\swnoexpands}{%
+% \RenewExpandableDocumentCommand{\edindex}{om}{}%
+%}
+%\makeatother
+% \end{verbatim}
% \subsubsection{Automatic sameword annotation}
% All potentially ambiguous apparatus entries must be annotated manually. That
% annotation process is laborious and includes a risk of errors.
@@ -1763,7 +1794,7 @@
% comments and questions as well as error reports are very welcome at
% \url{https://github.com/stenskjaer/samewords/issues}.
%
-% Please not that the maintener of this script is not the maintener of reledmac.
+% Please not that the maintainer of this script is not the maintainer of \macpackage.
%
% \subsection{Apparatus of Manuscripts}
% The critical notes mostly refer to textual variants between manuscripts which contain the text to be edited.
@@ -1907,7 +1938,7 @@
% As the number of series which are defined increases, \macpackage gets slower.
% If you do not need all of the six standard series (A--E),
% you can load the package with the \verb+series+ option.
-% For example if you need only series~A and~B, use:
+% For example, if you need only series~A and~B, use:
% \begin{verbatim}
% \usepackage[series={A,B}]{eledmac}
% \end{verbatim}
@@ -3335,7 +3366,7 @@
% \renewcommand{\pagelinesep}{:}
% \end{verbatim}
%
-% However, you also have to configure your \verb+.ist+ index style file. For example if you use \verb+:+ as separator\footnote{For further detail, you can read \url{http://tex.stackexchange.com/a/32783/7712}.}.
+% However, you also have to configure your \verb+.ist+ index style file. For example, if you use \verb+:+ as separator\footnote{For further detail, you can read \url{http://tex.stackexchange.com/a/32783/7712}.}.
% \begin{verbatim}
% page_compositor ":"
% \end{verbatim}
@@ -3516,7 +3547,7 @@
% The macro |\edrowfill|\marg{start}\marg{end}\marg{fill}
% fills columns number \meta{start} to \meta{end} inclusive with
% \meta{fill}. The \meta{fill} argument can be any horizontal `fill'.
-% For example |\hrulefill| or |\upbracefill|.
+% For example, |\hrulefill| or |\upbracefill|.
%
% Note that every row must have the same number of columns, even if
% some would not appear to be necessary.
@@ -4030,7 +4061,7 @@
% \begin{macrocode}
%<*code>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{reledmac}[2017/07/31 v2.23.0 typesetting critical editions]%
+\ProvidesPackage{reledmac}[2017/08/17 v2.24.0 typesetting critical editions]%
% \end{macrocode}
%
% \subsection{Package options}
@@ -4163,10 +4194,12 @@
% \end{macro}
% \subsection{Loading packages}
% Loading package \protect\package{xargs} to declare commands with optional arguments.
+% Loading package \package{xparse} to declare fully expandable commands with optional argument. Ideally, we should use only \package{xparse} and not \package{xargs}. For historical reasons, we use both.
% \protect\package{Etoolbox} is also used to make code clearer - for example, in dynamic command names (which can replace \protect\cs{csname} etc.).
% Use \protect\package{suffix} to declare commands with a starred version, \protect\package{xstring} to work with strings, \protect\package{ifluatex} and \protect\package{ifxetex} to test if \LuaTeX\ or \XeTeX\ is running, and \protect\package{ragged2e} to manage ragged justification for paragraphed notes.
% \begin{macrocode}
\RequirePackage{xargs}
+\RequirePackage{xparse}%
\RequirePackage{etoolbox}
\@ifl@t@r\fmtversion{2015/10/01}
{\ifboolexpr{not test{\@ifl@t@r\fmtversion{2016/03/31}} or (test{\ifdefstring{\fmtversion}{2016/03/31}} and test {\ifnumless{\patch@level}{3}})}%
@@ -4866,7 +4899,7 @@
\global\@afterindenttrue%In order to retablish normal feature if the \begingroup was not here
\initnumbering@quote
\ifwidthliketwocolumns%
- \csuse{setwidthliketwocolumns@\columns@position}%
+ \setwidthliketwocolumns%
\csuse{setpositionliketwocolumns@\columns@position}%
\fi%
\fi
@@ -4895,6 +4928,11 @@
\global\sublines@false
\global\let\next@page@num=\relax
\global\let\sub@change=\relax
+ \global\last@page@num=-10000%
+ \ifdefined\line@numR%
+ \line@numR=\z@%
+ \last@page@numR=\z@%
+ \fi%
\resetprevline@
\resetprevpage@num
\global\stopmsdata@inserted@true%
@@ -4913,6 +4951,7 @@
% to the right place.
% \changes{v0.7.0}{2005/02/24}{Changed \protect\cs{endnumbering} for eledpar}
% \changes{v1.12.5}{2014/08/31}{Allow to mix parallel columns and normal text when using \protect\cs{pausenumbering}}
+% We define it using \cs{def} and not \cs{newcommand} because \LaTeX\ does not allow defining command whose name starts by \enquote{end} except if we are currently creating an environment, which is not the case here.
% \begin{macrocode}
\def\endnumbering{%
\ifnumbering
@@ -4951,13 +4990,22 @@
%
% \begin{macro}{\pausenumbering}
% \begin{macro}{\resumenumbering}
+% \begin{macro}{\ifresumenumbering@start}
+% \begin{macro}{\pausenumbering@page@num}
% The \protect\cs{pausenumbering} macro is just the same as
% \protect\cs{endnumbering}, but with the \protect\cs{ifnumbering} flag set to \verb"true", to
% show that numbering continues across the gap.\footnote{Peter Wilson's thanks
% to Wayne Sullivan,\index{Sullivan, Wayne} who suggested the idea
% behind these macros.}
+% The \cs{pausenumbering@page@num} counter stores the \cs{next@page@num} when the \cs{pause@numbering} is called.
% \begin{macrocode}
+\newcount\pausenumbering@page@num%
\newcommand{\pausenumbering}{%
+ \ifx\next@page@num\relax%
+ \global\pausenumbering@page@num=0%
+ \else%
+ \global\pausenumbering@page@num=\next@page@num%
+ \fi%
\ifautopar\global\autopar@pausetrue\fi%
\endnumbering\global\numberingtrue}
% \end{macrocode}
@@ -4966,26 +5014,30 @@
% without resetting the various counters. Note that no check is made
% by \protect\cs{resumenumbering} to ensure that \protect\cs{pausenumbering} was actually
% invoked.
+% The boolean \cs{ifresumenumbering@start} is set to true. That allows us to avoid resetting the line number at the first line of \cs{resumenumbering} if the lineation is by page.
+% This boolean is set to false after the first action.
% \changes{v0.7.0}{2005/02/24}{Changed \protect\cs{resumenumbering} for eledpar}
% \changes{v1.12.5}{2014/08/31}{Debug \protect\cs{resumenumbering}}
% \begin{macrocode}
+\newif\ifresumenumbering@start%
\newcommand*{\resumenumbering}{%
\ifnumbering
\ifautopar@pause\autopar\fi
\global\pst@rtedLtrue
\global\advance\section@num \@ne
+ \global\resumenumbering@starttrue%
\led@mess@SectionContinued{\the\section@num}%
+ \set@continuousnumberingforL%
\line@list@stuff{\jobname.\extensionchars\the\section@num}%
\l@dend@stuff
\ifl@dpairing\else%
\begingroup%
\initnumbering@quote%
\ifwidthliketwocolumns%
- \csuse{setwidthliketwocolumns@\columns@position}%
+ \setwidthliketwocolumns%
\csuse{setpositionliketwocolumns@\columns@position}%
\fi%
\fi%
- \set@continuousnumberingforL%
\else
\led@err@NumberingShouldHaveStarted
\endnumbering
@@ -4996,14 +5048,18 @@
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
% \begin{macro}{\set@continuousnumberingforL}
-% \cs{set@continuousnumberingforl} set the left line numbers and pstart counter at a \cs{beginnumbering} or a \cs{resumenumbering} in order to have continuous numbering with single column text.
+% \cs{set@continuousnumberingforl} sets the left line numbers and pstart counters at a \cs{beginnumbering} or a \cs{resumenumbering} in order to have continuous numbering with single column text.
% \begin{macrocode}
\newcommand{\set@continuousnumberingforL}{%
\ifcontinuousnumberingwithcolumns%
\ifdefined\line@numR%
\ifnum\line@numR>\line@num%
- \expandafter\setlinenum\expandafter{\the\line@numR}%
+ \global\appto\next@line@list@stuff{%
+ \expandafter\setlinenum\expandafter{\the\line@numR}%
+ }%
\fi%
\ifnum\last@page@numR>\last@page@num%
\global\last@page@num=\last@page@numR%
@@ -5893,12 +5949,6 @@
%
% \begin{macrocode}
\get@linelistfile{#1}%
- \ifcontinuousnumberingwithcolumns
- \global\page@numR=\page@numR\relax
- \global\last@page@numR=\last@page@numR\relax
- \global\page@num=\page@num\relax
- \global\last@page@num=\last@page@num\relax
- \fi
\@stopmsd%Security if last \endms{} is forgotten
\unless\ifledRcol%Get the last line of the last page
\csnumgdef{@lastabsline@forpage@\the\page@num}{\the\absline@num}%
@@ -6071,6 +6121,7 @@
\newcommand*{\@nl@reg}{%
\ifx\l@dchset@num\relax \else
\advance\absline@num \@ne
+ \csgdef{l@dchset@num@\the\absline@num}{}%To remember this line have been marked by a \setlinenum
\set@line@action
\let\l@dchset@num=\relax
\advance\absline@num \m@ne
@@ -6147,11 +6198,13 @@
\csnumgdef{@lastabsline@forpageR@\the\page@numR}{\the\absline@numR}%
\csnumgdef{@lastline@forpageR@\the\page@numR}{\the\line@numR}%
\ifbypage@R
- \line@numR \z@ \subline@numR \z@
+ \ifx\l@dchset@num\relax%Not resetting if preceded by a \setlinenum
+ \line@numR \z@ \subline@numR \z@%
+ \fi%
\fi
- \page@numR=#1\relax
- \last@page@numR=#1\relax
- \def\next@page@numR{#1}%
+ \global\page@numR=#1%
+ \global\last@page@numR=#1%
+ \global\def\next@page@numR{#1}%
\fi
\else
\ifnum #1=\last@page@num
@@ -6159,11 +6212,13 @@
\csnumgdef{@lastabsline@forpage@\the\page@num}{\the\absline@num}%
\csnumgdef{@lastline@forpage@\the\page@num}{\the\line@num}%
\ifbypage@
- \line@num \z@ \subline@num \z@
+ \ifx\l@dchset@num\relax%Not resetting if preceded by a \setlinenum
+ \line@num \z@ \subline@num \z@%
+ \fi%
\fi
- \page@num=#1\relax
- \last@page@num=#1\relax
- \def\next@page@num{#1}%
+ \global\page@num=#1%
+ \global\last@page@num=#1%
+ \global\def\next@page@num{#1}%
\listxadd{\normal@page@break}{\the\absline@num}
\fi
\fi}
@@ -6782,11 +6837,14 @@
% \end{macrocode}
% \end{macro}
% \begin{macro}{\line@list@stuff}
+% \begin{macro}{\next@line@list@stuff}
% The \protect\cs{line@list@stuff}\marg{file} macro, which
% is called by \protect\cs{beginnumbering}, performs
% all the line-list operations needed at the start of a section.
% Its argument is the name of the line-list file.
+% \changes{v2.24.0}{2017/08/17}{Add \protect\cs{next@line@list@stuff} internal hook.}
% \begin{macrocode}
+\let\next@line@list@stuff\relax%
\newcommand*{\line@list@stuff}[1]{%
% \end{macrocode}
% First, define a toggle set to true when we are not in the first run.
@@ -6809,9 +6867,9 @@
% \protect\cs{line@list@stuff}}
% \changes{v0.7.0}{2005/02/25}{Deleted \protect\cs{page@start} from \protect\cs{line@list@stuff}}
% \changes{v1.15.1}{2015/01/16}{Revert modification of 1.5.2 which makes bug with numbering. Leave vertical mode to solve spurious space before minipage.}
+% \Macpackage and \parpackage can fill the \cs{next@line@list@stuff} hook between a \cs{endnumbering} (associated with numbered file $n$) and a \cs{beginnumbering} (associated with numbered file $n+1$). It allows adding content to the numbered file $n+1$ and not $n$.
% \begin{macrocode}
\iffirst@linenum@out@
- \immediate\closeout\linenum@out%
\global\first@linenum@out@false%
\immediate\openout\linenum@out=\l@auxdir#1\relax%
\immediate\write\linenum@out{\string\line@list@version{\this@line@list@version}}%
@@ -6833,11 +6891,14 @@
\ifl@dpaging%
\write\linenum@out{\string\@par@sync@option{\@par@this@sync@option}}%
\fi%
- \fi}
+ \fi%
+ \next@line@list@stuff%
+ \global\let\next@line@list@stuff\relax%
+}%
% \end{macrocode}
% \end{macro}
-%
+% \end{macro}
% \begin{macro}{\new@line}
% The \protect\cs{new@line} macro sends the \protect\cs{@nl} command to the line-list
% file, to mark the start of a new text line, and its page number.
@@ -7805,16 +7866,8 @@
% \begin{macrocode}
\newcommand{\get@sw@txt}[1]{%
\begingroup%
+ \swnoexpands%
%. \end{macrocode}
-% Allow some macros inside \sameword
-%. \begin{macrocode}
- \let\sameword\@firstofone%Allow to have nested \sameword
- \let\emph\@firstofone%
- \let\textit\@firstofone%
- \let\textbf\@firstofone%
- \let\textsc\@firstofone%
- \let\framebox\@firstofone%
-% \end{macrocode}
% Using case sensibility option.
% \begin{macrocode}
\ifsw@caseinsensitive%
@@ -7834,6 +7887,33 @@
}%
% \end{macrocode}
% \end{macro}
+% Allow some macros inside \cs{sameword}.
+% We use \cs{RenewExpandableDocumentCommand} to get expandable command with optional argument.
+% Cf. \url{https://tex.stackexchange.com/a/384783/7712}.
+% \begin{macro}{\sw@noexpand}
+% \begin{macrocode}
+\newcommand{\swnoexpands}{%
+ \let\sameword\@firstofone%Allow to have nested \sameword
+ \let\emph\@firstofone%
+ \let\textit\@firstofone%
+ \let\textbf\@firstofone%
+ \let\textsc\@firstofone%
+ \let\framebox\@firstofone%
+ \RenewExpandableDocumentCommand{\edindex}{om}{}%
+ \ifdefined\index%
+ \RenewExpandableDocumentCommand{\index}{om}{}%
+ \fi%
+ \let\selectlanguage\@gobble%
+ \let\foreignlanguage\@secondoftwo%
+ \ifdefined\xpg@loaded%
+ \renewcommand\do[1]{%
+ \expandafter\RenewExpandableDocumentCommand\expandafter{\csname text##1\endcsname}{om}{####2}%
+ }%
+ \expandafter\docsvlist\expandafter{\xpg@loaded}%
+ \fi%
+}%
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{\sameword}
% \changes{v1.23.0}{2015/05/18}{In order to allow use of \protect\cs{sameword} with inputenc, we detokenize its mandatory argument before using it in control sequence names.}
% The hight level macro \protect\cs{sameword}, used by the editor.
@@ -8156,8 +8236,8 @@
\fi%
\fi%
\numberedpar@true%
- \iflabelpstart\protected@edef\@currentlabel%
- {\p@pstart\thepstart}
+ \iflabelpstart%
+ \protected@edef\@currentlabel{\p@pstart\thepstart}%
\fi%
\l@dzeropenalties%
\@at@start@every@pstart%
@@ -8612,14 +8692,32 @@
%
% \begin{macro}{\l@dlsn@te}
% \begin{macro}{\l@drsn@te}
-% Zero width boxes of the left and right side notes, together with their kerns.
+% Zero width boxes of the left and right side notes, together with their kerns, and, eventually, with additional space if we are in parallel columns typesetting.
% \changes{v0.7.0}{2005/02/18}{Added \protect\cs{l@dlsn@te} and \protect\cs{l@drsn@te}
% for use in \protect\cs{do@line}}
% \begin{macrocode}
\newcommand{\l@dlsn@te}{%
- \hb@xt@ \z@{\hss\box\l@dlp@rbox\kern\ledlsnotesep}}
+ \ifboolexpr{%
+ bool {l@dprintingcolumns}%
+ and bool {ledRcol@}%
+ }{% If we are on a right column
+ \@tempdima=\@morespace@leftnote@rightcolumn%
+ }{%
+ \@tempdima=\z@%
+ }%
+ \hb@xt@ \z@{\hss\box\l@dlp@rbox\kern\ledlsnotesep\hskip\@tempdima}%
+}%
\newcommand{\l@drsn@te}{%
- \hb@xt@ \z@{\kern\ledrsnotesep\box\l@drp@rbox\hss}}
+ \ifboolexpr{%
+ bool {l@dprintingcolumns}%
+ and not bool {ledRcol@}%
+ }{% If we are on a left column
+ \@tempdima=\@morespace@rightnote@leftcolumn%
+ }{%
+ \@tempdima=\z@%
+ }%
+ \hb@xt@ \z@{\hskip\@tempdima\kern\ledrsnotesep\box\l@drp@rbox\hss}%
+}%
% \end{macrocode}
% \end{macro}
@@ -8733,11 +8831,28 @@
% \begin{macrocode}
\ifnum\next@action>-1001
\global\page@num=\next@action
- \global\@firstlineofpagetrue%
+ \ifresumenumbering@start%
+ \setbox0=\hbox{}%Required to get the correct page number, when the \resumenumbering is just after a \newpage
+ \ifnum\pausenumbering@page@num<\page@num%
+ \global\resumenumbering@startfalse%
+ \fi%
+ \fi%
+ \unless\ifresumenumbering@start%
+ \global\@firstlineofpagetrue%
+ \fi%
\ifbypage@
- \global\line@num=\z@ \global\subline@num=\z@
- \resetprevline@
+ \ifcsdef{l@dchset@num@\the\absline@num}%
+ {%
+ \global\csundef{l@dchset@num@\the\absline@num}%
+ }%
+ {%
+ \unless\ifresumenumbering@start%
+ \global\line@num=\z@ \global\subline@num=\z@%
+ \resetprevline@%
+ \fi%
+ }%
\fi
+ \global\resumenumbering@startfalse%
\add@msdata@firstlineofpage%
% \end{macrocode}
%
@@ -8987,11 +9102,26 @@
\ifnum\@l@dtempcntb>\@ne
\advance\@l@dtempcntb \page@num
\fi
- \ifodd\@l@dtempcntb
- \gdef\l@drd@ta{\rlap{{\rightlinenum}}}%
- \else
- \gdef\l@dld@ta{\llap{{\leftlinenum}}}%
- \fi
+ \ifboolexpr{%
+ bool {l@dprintingcolumns}%
+ and (%
+ (test {\ifdefstring{\linenum@OnlyPages@ForColumns}{left}}%
+ and test {\ifnumodd{\page@num}}%
+ )%
+ or%
+ (test {\ifdefstring{\linenum@OnlyPages@ForColumns}{right}}%
+ and not test {\ifnumodd{\page@num}}%
+ )%
+ )%
+ }%
+ {}%
+ {%
+ \ifodd\@l@dtempcntb%
+ \gdef\l@drd@ta{\rlap{{\rightlinenum}}}%
+ \else%
+ \gdef\l@dld@ta{\llap{{\leftlinenum}}}%
+ \fi%
+ }%
\fi
\fi
\fi
@@ -9334,7 +9464,7 @@
% of the paragraph. We can hope that is not
% too far from the proper location, to which they will move on the next
% run.
-% First the first run, we don't flush the notes,
+% For the first run, we do not flush the notes,
% as that means all the notes will be added at the end of numbered section,
% and so, very far of the expected position
% \begin{macrocode}
@@ -11712,7 +11842,7 @@
% \end{macro}
%
% \begin{macro}{\normalvfootnoteX}
-% \changes{v1.5.1}{2013/08/16}{Fix bug with normal familiar footnotes when mixing RTL and LTR text.}
+% \changes{v1.5.1}{2013/08/16}{Fix a bug with normal familiar footnotes when mixing RTL and LTR text.}
% \protect\cs{normalvfootnoteX}\marg{series}\marg{text} does the \protect\cs{insert} for
% the \meta{series} and calls the series' \protect\cs{footfmt...} to format the
% \meta{text}.
@@ -12582,7 +12712,7 @@
\let\old@columwidth=\columnwidth%
\iftoggle{Xnoteswidthliketwocolumns@#1}%
{%
- \csuse{setwidthliketwocolumns@\columns@position}%
+ \setwidthliketwocolumns%
\global\let\hsize@fornote=\hsize%
}%
{}%
@@ -12596,7 +12726,7 @@
\let\old@columwidth=\columnwidth%
\iftoggle{noteswidthliketwocolumnsX@#1}%
{%
- \csuse{setwidthliketwocolumns@\columns@position}%
+ \setwidthliketwocolumns%
\global\let\hsize@fornote=\hsize%
}%
{}%
@@ -13965,7 +14095,7 @@
% Otherwise, we understand the insinuated value is TRUE.
%
% For each ``hook'' command, we store the value in commands (first category) or a \protect\package{etoolbox}'s toggle (second category) which names are in the form \protect\cs{<hook>@<series>}.
-% For example when calling \protect\cs{twolines}\marg{sq.}, we store \verb+sq.+ in commands \protect\cs{twolines@A}, \protect\cs{twolines@B}, \protect\cs{twolines@C}\ldots for each series defined for use with \macpackage, or, if the \oarg{series} optional argument was send, for each series of this argument.
+% For example, when calling \protect\cs{twolines}\marg{sq.}, we store \verb+sq.+ in commands \protect\cs{twolines@A}, \protect\cs{twolines@B}, \protect\cs{twolines@C}\ldots for each series defined for use with \macpackage, or, if the \oarg{series} optional argument was send, for each series of this argument.
%
% These values are tested in some specific places, scattered in all the code, depending of their effects.
% The default values are defined by the \protect\cs{newseries@} command.
@@ -14759,12 +14889,10 @@
% \changes{v0.2.1}{2003/08/26}{Tweaked \protect\cs{edlabel} to get correct page numbers}
% \changes{v0.14.0}{2012/04/04}{Tweaked \protect\cs{edlabel} to get correct line number if the command is first element of a paragraph.}
% \changes{v1.18.0}{2015/02/23}{\protect\cs{edlabel} is now defined only one time for both \eledmac and \eledpar}
-% \changes{v2.5.0}{2015/11/13}{Fix bug when calling\protect\cs{edlabel} in a footnotes of the rightside}
+% \changes{v2.5.0}{2015/11/13}{Fix a bug when calling\protect\cs{edlabel} in a footnotes of the rightside}
% \begin{macrocode}
\newcommand*{\edlabel}[1]{%
- \ifl@dpairing\ifautopar%
- \strut%
- \fi\fi%
+ \leavevmode%
\@bsphack%
\ifboolexpr{bool{ledRcol} or bool{ledRcol@}}{%
\ifXnote@%
@@ -14843,7 +14971,7 @@
%\begin{macro}{\advancelabel@refs}
%\begin{macro}{\labelrefsparseline}
%\begin{macro}{\labelrefsparsesubline}
-% \changes{v1.4.1}{2012/11/16}{Fix bug with \protect\cs{edlabel}.}
+% \changes{v1.4.1}{2012/11/16}{Fix a bug with \protect\cs{edlabel}.}
%In cases where \protect\cs{edlabel} is the first element in a paragraph, we have a problem with line counts, because line counts change only at the first horizontal box of the paragraph.
%Hence, we need to test \protect\cs{edlabel} if it occurs at the start of a paragraph. To do so, we use \protect\cs{ifvmode}. If the test is true, we must advance by one unit the amount of text we write into the \verb].aux] file.
% We do so using \protect\cs{advancelabel@refs} command.
@@ -15192,7 +15320,7 @@
%
% \begin{macro}{\xxref}
% \changes{v1.19.0}{2015/03/06}{\protect\cs{xxref} works also with right side numbers, when \protect\cs{@Rlineflag} is not empty.}
-% \changes{v1.20.0}{2015/03/22}{Debug \protect\cs{xxref} when not loading \eledpar (fix bug added in 1.19.0).}
+% \changes{v1.20.0}{2015/03/22}{Debug \protect\cs{xxref} when not loading \eledpar (Fix a bug added in 1.19.0).}
% The \protect\cs{xxref} command takes two arguments, both of which are
% labels, e.g., \protect\cs{xxref}\verb+{mouse}{elephant}+. It first does some
% checking to make sure that the labels do exist (if one does not,