Debian Codegraph @

texmf-dist/source/latex/eledmac/eledmac.dtx

raw
1 % \iffalse meta-comment
2 %
3 % eledmac.dtx
4 % Author: Peter Wilson (Herries Press) herries dot press at earthlink dot net
5 % Maintainer:Maïeul Rouquette maieul at maieul dot net
6 % Copyright 2003 -- 2005 Peter R. Wilson / 2011-.. Maïeul Rouquette
7 %
8 % This work may be distributed and/or modified under the
9 % conditions of the LaTeX Project Public License, either
10 % version 1.3 of this license or (at your option) any
11 % later version.
12 % The latest version of the license is in
13 % http://www.latex-project.org/lppl.txt
14 % and version 1.3 or later is part of all distributions of
15 % LaTeX version 2003/06/01 or later.
16 %
17 % This work has the LPPL maintenance status "maintained".
18 %
19 % This work consists of the files listed in the README file.
20 %
21 %
22 %<*driver>
23 \documentclass[twoside]{ltxdoc}
24 \usepackage{url}
25 \usepackage[draft=false,
26 plainpages=false,
27 pdfpagelabels,
28 bookmarksnumbered,
29 % hyperindex=true
30 hyperindex=false
31 ]{hyperref}
32 \usepackage{fontspec}
33 \usepackage[english]{babel}
34 \usepackage[,noreledmac]{eledmac}
35 \usepackage{graphicx,metalogo}
36 % Index and Changelog in one column
37 \makeatletter
38 \renewenvironment{theglossary}{%
39 \@restonecoltrue\if@twocolumn\@restonecolfalse\fi
40 \columnseprule \z@ \columnsep 35\p@
41 \glossary@prologue%
42 \GlossaryParms \let\item\@idxitem \ignorespaces}
43 {\if@restonecol\onecolumn\else\clearpage\fi}
44 \def\theindex{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi
45 \columnseprule \z@ \columnsep 35\p@
46 \index@prologue%
47 \IndexParms \let\item\@idxitem \ignorespaces}
48 \def\endtheindex{\if@restonecol\onecolumn\else\clearpage\fi}
49 \@mparswitchfalse
50 \makeatother
51 \EnableCrossrefs
52 \RecordChanges
53 \CodelineIndex
54 %%\OnlyDescription
55 \renewcommand{\MakeUppercase}[1]{#1}
56 \pagestyle{headings}
57 \setcounter{StandardModuleDepth}{1}
58 \begin{document}
59 \raggedbottom
60 \DocInput{eledmac.dtx}
61 \end{document}
62 %</driver>
63 %
64 % \fi
65 %
66 % \newcommand{\reff}[1]{\ref{#1} p.~\pageref{#1}}
67 % \CheckSum{12032}
68 %
69 % \makeatletter
70 % \newcommand*{\DescribeIt}{\leavevmode\@bsphack\begingroup\MakePrivateLetters
71 % \Describe@It}
72 % \newcommand*{\Describe@It}[1]{\endgroup
73 % \marginpar{\raggedleft\PrintDescribeEnv{#1}}%
74 % \SpecialItIndex{#1}\@esphack\ignorespaces}
75 % \newcommand*{\SpecialItIndex}[1]{\@bsphack
76 % \index{#1\actualchar{\protect\ttfamily#1}\encapchar usage}\@esphack}
77 %
78 % \DoNotIndex{\@,\@@par,\@beginparpenalty,\@empty}
79 % \DoNotIndex{\@flushglue,\@input}
80 % \DoNotIndex{\@makefnmark,\@makeother,\@maketitle}
81 % \DoNotIndex{\@namedef,\@ne,\@spaces,\@tempa}
82 % \DoNotIndex{\@tempb,\@tempswafalse,\@tempswatrue}
83 % \DoNotIndex{\@thanks,\@thefnmark,\@topnum}
84 % \DoNotIndex{\@@,\@elt,\@forloop,\@fortmp,\@gtempa,\@totalleftmargin}
85 % \DoNotIndex{\",\/,\@ifundefined,\@nil,\@verbatim,\@vobeyspaces}
86 % \DoNotIndex{\|,\~,\ ,\active,\advance,\aftergroup,\begingroup,\bgroup}
87 % \DoNotIndex{\mathcal,\csname,\def,\documentstyle,\dospecials,\edef}
88 % \DoNotIndex{\egroup}
89 % \DoNotIndex{\else,\endcsname,\endgroup,\endinput,\endtrivlist}
90 % \DoNotIndex{\expandafter,\fi,\fnsymbol,\futurelet,\gdef,\global}
91 % \DoNotIndex{\hbox,\hss,\if,\if@inlabel,\if@tempswa,\if@twocolumn}
92 % \DoNotIndex{\ifcase}
93 % \DoNotIndex{\ifcat,\iffalse,\ifx,\ignorespaces,\index,\input,\item}
94 % \DoNotIndex{\jobname,\kern,\leavevmode,\leftskip,\let,\llap,\lower}
95 % \DoNotIndex{\m@ne,\next,\newpage,\nobreak,\noexpand,\nonfrenchspacing}
96 % \DoNotIndex{\obeylines,\or,\protect,\raggedleft,\rightskip,\rm,\sc}
97 % \DoNotIndex{\setbox,\setcounter,\small,\space,\string,\strut}
98 % \DoNotIndex{\strutbox}
99 % \DoNotIndex{\thefootnote,\thispagestyle,\topmargin,\trivlist,\tt}
100 % \DoNotIndex{\twocolumn,\typeout,\vss,\vtop,\xdef,\z@}
101 % \DoNotIndex{\,,\@bsphack,\@esphack,\@noligs,\@vobeyspaces,\@xverbatim}
102 % \DoNotIndex{\`,\catcode,\end,\escapechar,\frenchspacing,\glossary}
103 % \DoNotIndex{\hangindent,\hfil,\hfill,\hskip,\hspace,\ht,\it,\langle}
104 % \DoNotIndex{\leaders,\long,\makelabel,\marginpar,\markboth,\mathcode}
105 % \DoNotIndex{\mathsurround,\mbox,\newcount,\newdimen,\newskip}
106 % \DoNotIndex{\nopagebreak}
107 % \DoNotIndex{\parfillskip,\parindent,\parskip,\penalty,\raise,\rangle}
108 % \DoNotIndex{\section,\setlength,\TeX,\topsep,\underline,\unskip,\verb}
109 % \DoNotIndex{\vskip,\vspace,\widetilde,\\,\%,\@date,\@defpar}
110 % \DoNotIndex{\[,\{,\},\]}
111 % \DoNotIndex{\count@,\ifnum,\loop,\today,\uppercase,\uccode}
112 % \DoNotIndex{\baselineskip,\begin,\tw@}
113 % \DoNotIndex{\a,\b,\c,\d,\e,\f,\g,\h,\i,\j,\k,\l,\m,\n,\o,\p,\q}
114 % \DoNotIndex{\r,\s,\t,\u,\v,\w,\x,\y,\z,\A,\B,\C,\D,\E,\F,\G,\H}
115 % \DoNotIndex{\I,\J,\K,\L,\M,\N,\O,\P,\Q,\R,\S,\T,\U,\V,\W,\X,\Y,\Z}
116 % \DoNotIndex{\1,\2,\3,\4,\5,\6,\7,\8,\9,\0}
117 % \DoNotIndex{\!,\#,\$,\&,\',\(,\),\+,\.,\:,\;,\<,\=,\>,\?,\_}
118 % \DoNotIndex{\discretionary,\immediate,\makeatletter,\makeatother}
119 % \DoNotIndex{\meaning,\newenvironment,\par,\relax,\renewenvironment}
120 % \DoNotIndex{\repeat,\scriptsize,\selectfont,\the,\undefined}
121 % \DoNotIndex{\arabic,\do,\makeindex,\null,\number,\show,\write,\@ehc}
122 % \DoNotIndex{\@author,\@ehc,\@ifstar,\@sanitize,\@title,\everypar}
123 % \DoNotIndex{\if@minipage,\if@restonecol,\ifeof,\ifmmode}
124 % \DoNotIndex{\lccode,\newtoks,\onecolumn,\openin,\p@,\SelfDocumenting}
125 % \DoNotIndex{\settowidth,\@resetonecoltrue,\@resetonecolfalse,\bf}
126 % \DoNotIndex{\clearpage,\closein,\lowercase,\@inlabelfalse}
127 % \DoNotIndex{\selectfont,\mathcode,\newmathalphabet,\rmdefault}
128 % \DoNotIndex{\bfdefault}
129 % \DoNotIndex{\newcommand,\renewcommand,\providecommand}
130 % \DoNotIndex{\ ,\to,\hsize,\multiply,\textit}
131 %
132 % \newcommand{\dtxfilename}{\texttt{eledmac.dtx}}
133 % \GetFileInfo{eledmac.sty}
134 % ^^A To put the changes in the right order : see http://tex.stackexchange.com/a/74113/7712
135 %\makeatletter
136 % \let\org@changes@\changes@
137 % \def\my@changes v#1.#2.#3\@nil{%
138 % \org@changes@{v#1.\six@digits{#2}.#3=v#1.#2.#3}%
139 % }%
140 % \newcommand*{\six@digits}[1]{%
141 % \ifnum#1<100000 0\fi
142 % \ifnum#1<10000 0\fi
143 % \ifnum#1<1000 0\fi
144 % \ifnum#1<100 0\fi
145 % \two@digits{#1}%
146 % }%
147 % \renewcommand*{\changes@}[1]{%
148 % \my@changes#1.\@nil
149 % }%
150 %\makeatother
151 % \newcommand{\Lpack}[1]{\textsf{#1}}
152 % \newcommand{\Lclass}[1]{\textsf{#1}}
153 % \newcommand{\file}[1]{\texttt{#1}}
154 % \newcommand{\Eledpar}{\Lpack{eledpar}}
155 % \newcommand{\eledmac}{eledmac}
156 % \newcommand{\Eledmac}{\Lpack{\eledmac}}
157 % \newcommand{\edmac}{\texttt{EDMAC}}
158 % \newcommand{\tabmac}{\texttt{TABMAC}}
159 % \newcommand{\edstanza}{\texttt{EDSTANZA}}
160 % \newcommand{\texbook}{\textit{TeXbook}}
161 % \newcommand{\thetexbook}{\textit{The TeXbook}}
162 %
163 % \changes{v0.1.0}{2003/03/25}{First public release}
164 % \changes{v0.2.0}{2003/08/16}{Added tabmac code, and extended indexing}
165 % \changes{v0.2.1}{2003/09/13}{Bug fixes and match with mempatch v1.8}
166 % \changes{v0.2.2}{2003/11/09}{Improved paragraph footnotes}
167 % \changes{v0.2.2}{2003/11/09}{New Dekker example}
168 % \changes{v0.3.0}{2004/02/14}{Includes edstanza and more}
169 % \changes{v0.3.1}{2004/02/18}{Not released. Added remarks about the parallel package}
170 % \changes{v0.4.0}{2004/02/29}{Added minipage, etc., support}
171 % \changes{v0.4.1}{2004/03/28}{Not released. Minor editorial improvements and code tweaks}
172 % \changes{v0.5.0}{2004/04/04}{Added sidenotes, familiar footnotes in numbered text}
173 % \changes{v0.5.1}{2004/04/10}{Fixed right line numbers killed in v0.5}
174 % \changes{v0.6.0}{2004/11/16}{Fixed long paragraphs looping}
175 % \changes{v0.6.0}{2004/11/16}{Prepared for eledpar package}
176 % \changes{v0.6.0}{2004/12/10}{Fixed minor typos}
177 % \changes{v0.7.0}{2005/02/18}{Tidying up for eledpar and ledarab packages}
178 % \changes{v0.7.0}{2005/02/18}{Replaced all \cs{interAfootnotelinepenalty}, etc.,
179 % by just \cs{interfootnotelinepenalty}}
180 % \changes{v0.7.0}{2005/03/02}{eledmac having been available for 2 years,
181 % deleted the commented out original edmac texts}
182 % \changes{v0.7.0}{2011/06/17}{Ma\"ieul Rouquette new maintainer}
183 % \changes{v0.8.0}{2011/17/06}{Bug on endnotes fixed: in a // text, all endnotes will print and be placed at the ends of columns (!)}
184 % \changes{v0.8.1}{2011/07/14}{Bug on \cs{edtext} ; \cs{critex} ; \cs{lemma} fixed: we can now us non-switching commands}
185 % \changes{v0.9.0}{2011/08/03}{No more ledpatch. All patches are now in the main file.}
186 % \changes{v0.9.1}{2011/08/08}{Fix some bugs linked to integrating ledpatch on the main file.}
187 % \changes{v0.10.0}{2011/08/22}{Corrections to \cs{section} and other titles in numbered sections}
188 % \changes{v0.11.0}{2011/09/16}{Makes it possible to add a symbol on each verse's hanging, as in French typography. Redefines the command \cs{hangingsymbol} to define the character.}
189 % \changes{v0.12.0}{2011/10/01}{Possibility to number the pstart with the commands \cs{numberpstarttrue}.}
190 % \changes{v0.12.0}{2011/10/01}{For compatibility with eledpar, possibility to use \cs{autopar} on the right side.}
191 % \changes{v0.12.1}{2011/10/02}{The numbering of \cs{pstarts} restarts on each \cs{beginnumbering}.}
192 % \changes{v0.12.1}{2011/10/02}{Don't number \cs{pstarts} of stanza.}
193 % \changes{v0.13.0}{2011/11/08}{New stanzaindentsrepetition counter: to repeat stanza indents every \emph{n} verses.}
194 % \changes{v0.13.1}{2011/11/18}{\cs{thepstartL} and \cs{thepstartR} use now \cs{bfseries} and not \cs{bf}, which is deprecated and makes conflicts with memoir class.}
195 % \changes{v0.14.0}{2012/04/04}{Tweaked \cs{edlabel} to get correct line number if the command is first element of a paragraph.}
196 % \changes{v1.0.0}{2012/09/15}{Some compatibility break with eledmac. Change of name: eledmac.}
197 % \changes{v1.1.0}{2012/09/25}{New package option: parapparatus.}
198 % \changes{v1.4.0}{2012/11/16}{Compatibility with LuaTeX of RTL notes.}
199 % \changes{v1.4.2}{2012/12/12}{Debug with some special classes.}
200 % \changes{v1.4.3}{2012/12/18}{Spurious space after familiar footnotes.}
201 % \changes{v1.4.4}{2013/02/18}{Label inside familiar footnotes.}
202 % \changes{v1.4.5}{2013/03/02}{Bug with komasscript + eledpar + chapter.}
203 % \changes{v1.4.6}{2013/04/15}{Bug with memoir class introduced by 1.4.5.}
204 % \changes{v1.4.8}{2013/07/02}{Corrects a bug with parallel texts introduced by 1.1.}
205 % \changes{v1.6.1}{2013/10/27}{Corrects a false hanging verse when a verse is exactly the length of a line.}
206 % \changes{v1.4.0}{2012/11/16}{Compatibility with LuaTeX of RTL notes.}
207 % \changes{v1.8.0}{2013/12/13}{Compatibility with parledgroup option of eledpar package.}
208 % \changes{v1.8.2}{2014/01/31}{Debug compatibility problem with hebrew option of babel package.}
209 % \changes{v1.8.3}{2014/02/03}{Fixes spurious spaces added by v1.7.0.}
210 % \changes{v1.10.0}{2014/02/27}{Add \cs{pstartref} and \cs{xpstartref} to refer to a pstart number (extension of \cs{edlabel}).}
211 % \changes{v1.10.1}{2014/02/28}{Compatibility with \textsf{cleveref}.}
212 % \changes{v1.10.2}{2014/03/17}{Compatibility of stanza with v1.8a of babel-greek.}
213 % \changes{v1.10.3}{2014/04/07}{Debug of cross-referencing.}
214 % \changes{v1.10.4}{2014/04/09}{Debug of critical notes in edtabular environnment.}
215 % \changes{v1.10.5}{2014/04/14}{Debug of \cs{xxref}.}
216 % \changes{v1.10.5}{2014/04/14}{Debug of \cs{pausenumbering}.}
217 % \changes{v1.10.6}{2014/05/01}{Debug of interaction between \cs{autopar} and\cs{pausenumbering}.}
218 % \changes{v1.11.1}{2014/05/29}{Correct a bug when a critical note starts with plus or minus.}
219 % \changes{v1.12.0}{2014/08/05}{Compatibility with \Lpack{musixtex}.}
220 % \changes{v1.12.0}{2014/08/05}{Debug eledmac sectioning command after using \cs{resumenumbering}.}
221 % \changes{v1.12.3}{2014/08/15}{Underline lemma in \cs{eledxxx} when using draft mode.}
222 % \changes{v1.12.3}{2014/08/15}{Correct bug with side and familiar notes in tabular environments.}
223 % \changes{v1.12.3}{2014/08/15}{Debug left and right notes (bugs added by 1.12.0)}
224 % \changes{v1.12.3}{2014/08/15}{Debug \cs{eledxxx} with some paper size}
225 % \changes{v1.12.4}{2014/08/25}{Debug spurious page breaks before \cs{chapter} (bug added in 1.12.0)}
226 % \changes{v1.13.1}{2014/09/25}{Debug quotation environment inside of a \cs{pstart} preceded by a sectioning command.}
227 % \changes{v1.13.1}{2014/09/25}{Coming back of page and line breaking penalties's management, deleted by error in v0.17.}
228 % \changes{v1.13.2}{2014/09/30}{Fix bug with normal footnotes, added by v1.13.0.}
229 % \changes{v1.13.3}{2014/10/04}{Fix extra spaces with paragraphed footnotes, added by v1.13.0.}
230 % \changes{v1.13.4}{2014/10/20}{Fix bug with index when memoir class is used without hyperref}
231 % \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).}
232 % \changes{v1.16.0}{2015/01/23}{Compatibility of standard footnotes with some biblatex styles.}
233 % \changes{v1.16.0}{2015/01/23}{New \cs{stanzaindent} command.}
234 % \changes{v1.18.0}{2015/02/23}{Compatibility with \LuaLaTeX\ RTL languages.}
235 % \changes{v1.19.0}{2015/03/06}{\cs{maxhXnotes} and \cs{maxhnotesX} work now for both two-columns and three-columns setting.}
236 % \changes{v1.19.0}{2015/03/06}{Compatibility with \Lpack{eledpar} v.1.13.0.}
237 % \changes{v1.19.1}{2015/03/12}{Call \cs{correct@footinsX@box} and \cs{correct@Xfootins@box} directly in \cs{print@notesX@forpages} and \cs{print@Xnotes@forpages}, that is in \Lpack{eledpar}.}
238 % \changes{v1.20.0}{2015/03/22}{Correct \cs{inplaceofnumber} hook.}
239 % \changes{v1.20.0}{2015/03/22}{Add series option.}
240 % \changes{v1.20.0}{2015/03/22}{Fix issues with RTL text in notes when using \LuaLaTeX.}
241 % \changes{v1.20.0}{2015/03/22}{The \cs{newif}s are not followed by boolean values set to false, because it is the \TeX\ default setting.}
242 % \changes{v1.20.0}{2015/03/22}{Explicit error message when calling \cs{Xfootnote} outside of \cs{edtext}.}
243 % \changes{v1.20.0}{2015/03/22}{Fix bug with line number typesetting direction when using \cs{eledsection} and similar commands for RTL texts with \LuaLaTeX.}
244 % \changes{v1.21.0}{2015/04/13}{\cs{AtEveryPstart} and \cs{AtEveryPend} are now compatible with \cs{autopar}}
245 % \changes{v1.21.0}{2015/04/13}{Fix bug with space between columns with notes in two columns (bug added in v1.13.0).}
246 % \changes{v1.21.0}{2015/04/13}{Add nocritical, noend, nofamiliar and noledgroup options.}
247 % \changes{v1.21.0}{2015/04/13}{Fix bug with \cs{maxhnotesX} when using \cs{foottwocolX} or \cs{footthreecolX}.}
248 % \changes{v1.21.0}{2015/04/13}{Add \cs{twolinesbutnotmore} and \cs{twolinesonlyinsamepage}.}
249 % \changes{v1.21.0}{2015/04/13}{Fix bug when a \cs{Xfootnote} follows a \cs{Xendnote} in the second argument of \cs{edtext} (bug added in eledmac 1.0.0 !).}
250 % \changes{v1.21.0}{2015/04/13}{Add noeledsec package option}
251 % \changes{v1.21.0}{2015/04/13}{parapparatus option works now with familiar footnotes.}
252 % \changes{v1.21.0}{2015/04/13}{Add \cs{beforenotesX} and \cs{beforeXnotes} features for notes set in two and three column.}
253 % \changes{v1.21.0}{2015/04/13}{Debug \cs{beforenotesX} \cs{maxhnotesX} \cs{notesXwidthliketwocolumns} and \cs{afterruleX} with footnotes set in two and three columns.}
254 % \changes{v1.21.0}{2015/04/13}{\cs{afterXrule} and \cs{afterruleX} features no longer create problems of overflowing at the bottom of the page.}
255 % \changes{v1.21.0}{2015/04/13}{\cs{preXnotes} and \cs{prenotesX} features no longer create problems of overflowing at the bottom of the page.}
256 % \changes{v1.21.0}{2015/04/13}{Fix spurious space after first page number in \cs{doendnotes}. oldprintnpnumspace option allows to come back to previous setting}
257 % \changes{v1.21.0}{2015/04/13}{\cs{chapter} inside optional argument of \cs{pstart} works when typesetting parallel pages}
258 % \changes{v1.22.0}{2015/04/25}{When using hyperref package, internal links in index or with \cs{edlineref} are now targeted to the top and not longer to the bottom of the lines they refer to.}
259 % \changes{v1.22.0}{2015/04/25}{Provides support for xindy.}
260 % \changes{v1.22.0}{2015/04/25}{Adds hyperlink for references to notes in indices.}
261 % \changes{v1.22.0}{2015/04/25}{Fix conflict between noend package option and edtabularx environments}
262 % \changes{v1.22.1}{2015/04/29}{Fix bug (added on v1.22.0) with \cs{inplaceofnumber} hook.}
263 % \changes{v1.23.0}{2015/05/18}{Compatibility between nofamiliar/nocriticals option and minipage/ledgroup.}
264 % \changes{v1.23.0}{2015/05/18}{Fix error of \cs{iftrue} not closed.}
265 % \changes{v1.23.0}{2015/05/18}{Allow use of \cs{sameword} with inputenc managing of UTF-8.}
266 % \changes{v1.23.0}{2015/05/18}{Error message when using \cs{beginnumbering}…\cs{endnumbering} without \cs{pstart}.}
267 % \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.}
268 % \changes{v1.23.0}{2015/05/18}{Fix bug with \cs{skipnumbering} called immediately after a \cs{pstart}.}
269 % \changes{v1.23.0}{2015/05/18}{Fix spurious space with \cs{skipnumbering} (bug added on v1.21.0).}
270 % \changes{v1.23.1}{2015/05/20}{Fix bug with \cs{lemma} command in the right side.}
271 % \changes{v1.23.2}{2015/05/29}{Compatibility with \LaTeX's release 2015.}
272 % \changes{v1.24.0}{2015/06/02}{We can reinitialize \cs{AtEveryPstart} and \cs{AtEveryPend} providing to it an empty argument.}
273 % \changes{v1.24.1}{2015/06/21}{\cs{lemma} is disabled when using `nocritical` option.}
274 % \changes{v1.24.2}{2015/06/26}{Fix incompatibility between `nofamiliar` option and `memoir` package.}
275 % \changes{v1.24.3}{2015/07/07}{Restore marginal numbers and notes with sectioning command (bug introduced in v1.21.0)}
276 % \changes{v1.24.4}{2015/07/14}{Fix spurious space with \cs{edindex} when using xindy+hyperref option.}
277 % \changes{v1.24.5}{2015/07/16}{Fix bug of indent, when a added in 1.1.0, when a \cs{beginnumbering} immediately follow a sectioning command.}
278 % \changes{v1.24.6}{2015/07/19}{Eledmac support ends. Migrate to reledmac.}
279 % \changes{v1.24.7}{2015/09/01}{Change some internal code in order to provide compatibility with \LaTeX\ release of october 2015}
280 % \changes{v1.24.8}{2015/09/02}{Fix one bug of v1.24.7 in parallel typesetting with \LuaTeX}
281 % \changes{v1.24.9}{2015/10/05}{Compatibility with \LaTeX format 2015/10/01.}
282 % \changes{v1.24.10}{2015/10/07}{Fix bug with old version of etex.}
283 % \changes{v1.24.11}{2015/10/14}{Fix compatibility with bidi 17.9 and following.}
284 % \changes{v1.24.12}{2017/09/25}{Fix little bug with \protect\cs{lednopb}.}
285 % \hyphenation{man-u-script man-u-scripts}
286 %
287 %
288 % ^^A PW added following as the definitions are at some unknown elsewhere
289 % \newcommand{\egstart}{}
290 % \newcommand{\egmid}{}
291 % \newcommand{\egend}{}
292 %
293 % \renewcommand{\egstart}{%
294 % \par
295 % \begingroup
296 % \centering
297 % \begin{minipage}{0.45\textwidth}}
298 % \renewcommand{\egmid}{%
299 % \end{minipage}\hfill\begin{minipage}{0.45\textwidth}}
300 % \renewcommand{\egend}{%
301 % \end{minipage}\par\endgroup}
302 %
303 % \title{\Lpack{\eledmac} \\
304 % Typeset scholarly editions with \LaTeX\thanks{This file (\dtxfilename)
305 % has version number \fileversion, last revised \filedate.}}
306 %
307 % \author{%
308 % Ma\"ieul Rouquette\thanks{\texttt{maieul at maieul dot net}} \\
309 % {\small based on the original \Lpack{ledmac} by} \\
310 % Peter Wilson \\
311 % Herries Press \\
312 % {\small which was based on the original \edmac, \tabmac{} and \edstanza{} by} \\
313 % John Lavagnino, Dominik Wujastyk, Herbert Breger and Wayne Sullivan.
314 % }
315 %
316 % \date{}
317 %
318 % \iffalse This is a METACOMMENT
319 % This METACOMMENT is part of the original EDMAC
320 % Everything up to the next `\ fi' (without a blank) will
321 % be ignored. This is necessary because `%' may no longer
322 % be a comment mark when this file is read in.
323 %
324 % The original EDMAC was written by:
325 % \author{John Lavagnino\thanks{%
326 % Department of English and American Literature,
327 % Brandeis University,
328 % 415 South Street,
329 % Waltham, MA 02254--9110, USA.
330 % Internet: {\tt [email protected]},
331 % Bitnet: {\tt lav@brandeis}.}
332 % \and Dominik Wujastyk\thanks{%
333 % Wellcome Institute for the History of Medicine,
334 % 183 Euston Road,
335 % London NW1 2BE, UK.
336 % Internet: {\tt [email protected]},
337 % Bitnet: {\tt dow@harvunxw}.}}
338 % \date{}
339 %
340 %
341 % Macro file `EDMAC' for use with Plain TeX.
342 % Copyright (C) 1990, 1991, 1992, 1993, 1994 John Lavagnino and Dominik
343 % Wujastyk, all rights reserved.
344 %
345 % Copying of this file is authorized only if either
346 % (1) you make absolutely no changes to your copy, including name, or
347 % (2) if you do make changes, you name it something other than
348 % edmac.tex or edmac.doc
349 % This restriction helps to ensure that the macro development is orderly.
350 %
351 % \fi
352 %
353 % \maketitle
354 %
355 % \textbf{This is documentation of deprecated eledmac package. If you are beginning a new project, we suggest that you use reledmac instead. If for old projects you can't migrate to reledmac, you can continue to use this documentation and the eledmac package. You should add noreledmac option when loading package, to disable message about reledmac.}
356 %
357 % \begin{abstract}
358 % \edmac, a set of \PlainTeX\ macros, was made at the beginning of 90's
359 % for typesetting critical editions in the traditional
360 % way, i.e., similar to the Oxford Classical Texts, Teubner, Arden
361 % Shakespeare and other series. A separate set of \PlainTeX\ macros,
362 % \tabmac, provides for tabular material. Another set of \PlainTeX\
363 % macros, \edstanza, assists in typesetting verse.
364 %
365 % The \Eledmac{} package makes the
366 % \edmac, \tabmac{} and \edstanza{} facilities available to authors
367 % who would prefer
368 % to use \LaTeX. The principal functions provided by the package
369 % are marginal line numbering and multiple series of
370 % foot- and endnotes keyed to line numbers.
371 %
372 % In addition to the \edmac, \tabmac{} and \edstanza{} functions the package
373 % also provides for index entries keyed to both page and line numbers.
374 % Multiple series of the familiar numbered footnotes are also available.
375 %
376 % Other \LaTeX\ packages for critical editions include EDNOTES, and
377 % \Lpack{poemscol} for poetical works.
378 %
379 % \Lpack{eledmac} provides many tools and options. Normally, they are all documented in this file.
380 % Also provided is a help folder, ``\href{examples/.}{examples}''. The folder contains additional examples (although not for all cases).
381 % Example starting by ``1-'' are for basic uses, those starting by ``2-'' are for advanced uses.
382 %
383 % To report bugs or request a new feature, please go to ledmac GitHub page and click on ``New Issue'': \url{https://github.com/maieul/ledmac/issues/}. You must create an account on github.com to access my page (maieul/ledmac). GitHub accounts are free for open-source users. You can post messages in English or in French (preferred).
384 %
385 % You can subscribe to the eledmac mail list in:\\ \url{http://geekographie.maieul.net/146}
386 % \end{abstract}
387 %
388 % \renewcommand{\numberline}[1]{#1~}
389 % \tableofcontents
390 %
391 %
392 %
393 % \section{Introduction}
394 %
395 % The \edmac{} macros \cite{EDMACTUG} for typesetting critical editions of texts
396 % have been available for use with TeX since 90's. Since \edmac{}
397 % was introduced there has been a small but constant demand for a
398 % version of \edmac{} that could be used with LaTeX. The \Lpack{eledmac}
399 % package is an attempt to satisfy that request.
400 %
401 %
402 % \Eledmac{} would not have been possible without the amazing work by
403 % John Lavagnino\index{Lavagnino, John}
404 % and Dominik Wujastyk\index{Wujastyk, Dominik},
405 % the original authors of \edmac.
406 % I, Peter Wilson, am very grateful for their encouragement and permission to use
407 % \edmac{} as a base.
408 % The majority of both the code and this manual are by these two.
409 % The tabular material is based on the
410 % \tabmac{} code~\cite{TABMAC}, by permission of its author,
411 % Herbert Breger\index{Breger, Herbert}.
412 % The verse-related code is by courtesy of Wayne Sullivan, the author
413 % of \edstanza~\cite{EDSTANZA}, who has kindly supplied more than
414 % his original macros.
415 %
416 % Since 2011's Maïeul Rouquette begun to maintain and extend \eledmac{}. As plain \TeX{} is used by little people, and \LaTeX{} by more people \Eledmac{} and original \edmac{} are more and more distant.
417 %
418 %
419 %
420 %
421 % \subsection{Overview}
422 %
423 %
424 % The \Eledmac{} package, together with LaTeX, provides several
425 % important facilities for formatting critical editions of texts in
426 % a traditional manner. Major features include:
427 % \begin{itemize}\addtolength{\itemsep}{-1ex}
428 % \item automatic stepped line numbering, by page or by section;
429 % \item sub-lineation within the main series of line numbers;
430 % \item variant readings automatically keyed to line numbers;
431 % \item caters for both prose and verse;
432 % \item multiple series of the footnotes and endnotes;
433 % \item block or columnar formatting of the footnotes;
434 % \item simple tabular material may be line numbered;
435 % \item indexing keyed to page and line numbers.
436 % \end{itemize}
437 %
438 %
439 % \Eledmac{} allows the scholar engaged in preparing a critical
440 % edition to focus attention wholly on the task of creating the
441 % critical text and evaluating the variant readings, text-critical
442 % notes and testimonia. \LaTeX{} and \Eledmac{} will take care of
443 % the formatting and visual correlation of all the disparate types
444 % of information.
445 %
446 %
447 %
448 %
449 %
450 % The original \edmac{} can be used as a `stand alone' processor
451 % or as part of a process. One example is its use as the formatting
452 % engine or `back end' for the output of an automatic manuscript
453 % collation program. \texttt{COLLATE}, written by
454 % Peter\index{Robinson, Peter} Robinson,
455 % runs on the Apple Macintosh, can collate simultaneously up to a
456 % hundred manuscripts of any length, and provides facilities for
457 % the scholar to tailor the collation interactively. For further
458 % details of this and other related work, visit the \edmac{} home page
459 % at \url{http://www.homepages.ucl.ac.uk/~ucgadkw/edmac/index.html}.
460 %
461 % Apart from \Eledmac{} there are some other \LaTeX\ packages for
462 % critical edition typesetting. As Peter Wilson is not an author, or even a
463 % prospective one, of any critical
464 % edition work he could not provide any opinions on what authors in this
465 % area might feel comfortable with or how well any of the packages
466 % meet their needs.
467 %
468 % \texttt{EDNOTES}~\cite{EDNOTES}, by Uwe L\"{u}ck\index{L\"uck, Uwe} and
469 % Christian Tapp\index{Tapp, Christian}, is another
470 % \LaTeX\ package being developed for critical editions. Unlike \Eledmac{}
471 % which is based on \edmac, \texttt{EDNOTES} takes a different (internal)
472 % approach and provides a different set of features. For example it
473 % provides additional facilities for overlapping lemmas and for
474 % handling tables. For more information there is a web site at
475 % \url{http://ednotes.sty.de.vu} or
476 % email to \url{[email protected]}.
477 %
478 % The \Lpack{poemscol} package~\cite{POEMSCOLTUG} by John Burt\index{Burt, John}
479 % is designed for typesetting
480 % critical editions of collections of poems. I do not know how, or whether,
481 % \Lpack{poemscol} and \Eledmac{} will work together.
482 %
483 % Critical authors may find it useful
484 % to look at \edmac, \texttt{EDNOTES}, \Eledmac, and \Lpack{poemscol} to
485 % see which best meets their needs.
486 %
487 % At the time of writing Peter Wilson knows of two web sites, apart from the \edmac{}
488 % home page, that have information on \Eledmac, and other programs.
489 % \begin{itemize}
490 % \item Jer\'{o}nimo Leal\index{Leal, Jeronimo@Leal, Jer\'{o}nimo}
491 % pointed me to \url{http://www.guit.sssup.it/latex/critical.html}. This
492 % also mentions another package for critical editions called
493 % \Lpack{MauroTeX} (\url{http://www.maurolico.unipi.it/mtex/mtex.htm}).
494 % These sites are both in Italian.
495 % \item Dirk-Jan Dekker\index{Dekker, Dirk-Jan} maintains
496 % \url{http://www.djdekker.net/ledmac}
497 % which is a FAQ for typesetting critical editions and \Eledmac.
498 % \end{itemize}
499 %
500 %
501 % This manual contains a general description of how to use the \LaTeX\ version of \edmac, namely \Eledmac
502 % (in sections~\ref{howto} through~\ref{sec:lastuser});
503 % the complete source code for the package,
504 % with extensive documentation (in sections~\ref{overview} and following)
505 % ; and an Index to the
506 % source code. We do not suggest that you need to
507 % read the source code for this package in order to use it; we
508 % provide this code primarily for reference, and many of our
509 % comments on it repeat material that is also found in
510 % the earlier sections. But no documentation, however
511 % thorough, can cover every question that comes up, and many can be
512 % answered quickly by consultation of the code. On a first reading,
513 % we suggest that you should read only the general documentation in
514 % sections~\ref{howto}, unless you are particularly interested in the innards of \Eledmac.
515 %
516 % \subsection{History}
517 %
518 % \subsubsection{EDMAC}
519 %
520 % The original version of \edmac{} was \texttt{TEXTED.TEX}, written
521 % by John Lavagnino\index{Lavagnino, John}
522 % in late 1987 and early 1988 for formatting
523 % critical editions of English plays.
524 %
525 % John passed these macros on to Dominik Wujastyk\index{Wujastyk, Dominik}
526 % who, in
527 % September--October 1988, added the footnote paragraphing mechanism,
528 % margin swapping and other changes to suit his own purposes, making the
529 % style more like that traditionally used for classical texts in Latin and
530 % Greek (e.g., the Oxford Classical Texts series). He also wrote some
531 % extra documentation and sent the files out to several people. This
532 % version of the macros was the first to be called \edmac.
533 %
534 % The present version was developed in the summer of 1990, with the
535 % intent of adding necessary features, streamlining and documenting
536 % the code, and further generalizing it to make it easily adaptable
537 % to the needs of editors in different disciplines. John did most
538 % of the general reworking and documentation, with the financial
539 % assistance of the Division of the Humanities and Social Sciences,
540 % California Institute of Technology. Dominik adapted the code to
541 % the conventions of Frank Mittelbach's\index{Mittelbach, Frank}
542 % \verb"doc" option, and added some documentation, multiple-column
543 % footnotes, cross-references, and crop marks.\footnote{This version of
544 % the macros was used to format the Sanskrit text in volume I of {\em
545 % Metarules of P\=a\d ninian Grammar\/} by Dominik Wujastyk (Groningen:
546 % Forsten, 1993).} A description by John and Dominik of this version of
547 % \edmac{} was published as `An overview of \edmac: a \PlainTeX\
548 % format for critical editions', \emph{TUGboat} \textit{11} (1990),
549 % pp.\,623--643.
550 %
551 % From 1991 through 1994, the macros continued
552 % to evolve, and were tested at a
553 % number of sites. We are very grateful to all the members of the
554 % (now defunct)
555 % \verb"[email protected]" discussion group who helped us with
556 % smoothing out bugs and infelicities in the macros.
557 % Ron Whitney\index{Whitney, Ron} and our anonymous reviewer at
558 % the TUG were both of great help in ironing out last-minute
559 % wrinkles, while Ron made some important suggestions which may help
560 % to make future versions of \edmac{} even more efficient.
561 % Wayne
562 % Sullivan,\index{Sullivan, Wayne} in particular, provided several
563 % important fixes and contributions, including adapting the
564 % Mittelbach\slash
565 % Sch\"opf\index{Sch\"opf, Rainer}\index{Mittelbach, Frank} `New
566 % Font Selection Scheme' for use with \PlainTeX\ and \edmac.
567 % Another project Wayne has worked
568 % on is a \verb"DVI" post-processor which works with an \edmac{}
569 % that has been slightly modified to output \cs{special}s. This
570 % combination enables you to recover to some extent the text of
571 % each line, as {\sc ascii} code, facilitating the creation of
572 % concordances, an {\em index verborum}, etc.
573 %
574 % At the time of writing (1994), we are pleased to be able to say that \edmac{} is
575 % being used for real-life book production of several interesting
576 % editions, such as the Latin texts of Euclid's {\sl
577 % Elements},\footnote{Gerhard Brey\index{Brey, Gerhard} used \edmac{} in
578 % the production of Hubert L. L. Busard\index{Busard, Hubert L. L.} and
579 % Menso Folkerts,\index{Folkerts, Menso} {\em Robert of Chester's
580 % (?)\index{Chester, Robert of} Redaction of Euclid's\index{Euclid} {\em
581 % Elements}, the so-called Adelard II\index{Adelard II} Version}, 2 vols.,
582 % (Basel, Boston, Berlin: Birkh\"auser, 1992).} an edition of the letters
583 % of Nicolaus Copernicus,\footnote{Being prepared at the German Copernicus
584 % Research Institute, Munich.}\index{Copernicus, Nicolaus} Simon
585 % Bredon's\index{Bredon, Simon} {\em Arithmetica},\footnote{Being prepared
586 % by Menso Folkerts {\em et al.}, at the Institut f\"ur Geschichte der
587 % Naturwissenschaften in Munich.} a Latin translation by Plato of
588 % Tivoli\index{Plato of Tivoli} of an Arabic astrolabe
589 % text,\footnote{Richard Lorch,\index{Lorch, Richard} Gerhard
590 % Brey\index{Brey, Gerhard} {\em et al.}, at the same Institute.} a Latin
591 % translation of part II of the Arabic {\em Algebra\/} by Ab\=u K\=amil
592 % Shuj\=a' b. Aslam,\index{Abu Kamil Shuja' b. Aslam}\footnote{Richard
593 % Lorch, `Ab\=u K\=amil on the Pentagon and Decagon' in {\em Vestigia
594 % Mathematica}, ed.\ M. Folkerts and J. P. Hogendijk (Amsterdam, Atlanta:
595 % Rodopi, 1993).} the Latin {\em Rithmachia\/} of Werinher von
596 % Tegernsee,\footnote{Menso Folkerts, `Die {\em Rithmachia\/} des Werinher
597 % von Tegernsee', ibid.} a middle-Dutch romance epic on the
598 % Crusades,\footnote{Geert H. M. Claassens,\index{Claassens, Geert H. M.}
599 % {\em De Middelnederlandse Kruisvaartromans}, (Amsterdam: Schiphower en
600 % Brinkman, 1993).} a seventeenth-century Hungarian politico-philosophical
601 % tract,\footnote{Emil Hargittay, {\em Cs\'aky Istv\'an: Politica
602 % philosophiai Okoskod\'as-szerint val\'o rendes \'eletnek p\'eld\'aja
603 % (1664--1674)\/} (Budapest: Argumentum Kiad\'o, 1992).} an anonymous
604 % Latin compilation from Hungary entitled {\em Sermones Compilati in
605 % Studio Gererali Quinqeecclesiensi in Regno Ungarie},\footnote{Being
606 % produced, as was the previous book, by Gyula Mayer\index{Mayer, Gyula}
607 % in Budapest.} the collected letters and papers of
608 % Leibniz,\index{Leibniz}\footnote{Leibniz, {\em S\"amtliche Schriften und
609 % Briefe}, series {\sc I, III, VII,} being edited by Dr.\ H.
610 % Breger\index{Breger, Herbert}, Dr. N. G\"adeke\index{G\"adeke, Nora} and
611 % others,
612 % at the Leibniz-Archiv, Nieders\"achsische Landesbibliothek, Hannover.
613 % (see \url{http://www.nlb-hannover.de/Leibniz})}
614 % Theodosius's\index{Theodosius} {\em Spherics}, the German {\em
615 % Algorismus} of Sacrobosco,\index{Sacrobosco} the Sanskrit text of the
616 % {\em K\={a}\'{s}ik\={a}\-v\d{r}tti\/} of V\={a}mana\index{Vamana} and
617 % Jay\={a}ditya\index{Jayaditya},\footnote{Being prepared at Poona and
618 % Lausanne Universities.} and the English texts of Thomas
619 % Middleton's\index{Middleton, Thomas} collected works.
620 %
621 % \subsubsection{eledmac}
622 %
623 %
624 %
625 % Version 1.0 of \tabmac{} was released by
626 % Herbert Breger\index{Breger, Herbert} in October
627 % 1996. This added the capability for typesetting tabular material.
628 %
629 % Version 0.01 of \edstanza{} was released by
630 % Wayne Sullivan~\index{Sullivan, Wayne}
631 % in June 1992, to help a colleague with typesetting Irish verse.
632 %
633 % In March 2003 Peter Wilson started an attempt to port \edmac{}
634 % from TeX to LaTeX. The starting point was \edmac{} version 3.16
635 % as documented on 19 July 1994 (available from CTAN). In August 2003
636 % the \tabmac{} functions were added; the starting point for these
637 % being version 1.0 of Ocober 1996. The \edstanza{} (v0.01) functions were
638 % added in February 2004. Sidenotes and regular footnotes in numbered
639 % text were added in April 2004.
640 %
641 % This port was called \emph{ledmac}.
642 %
643 % Since July~2011, ledmac is maintained by Ma\"ieul Rouquette.
644 %
645 % Important changes were put in version 1.0, to make eledmac more easily extensible (see \reff{displayoptions}).
646 % These changes can trigger small problems with the old customization.
647 % That is why a new name was selected: \emph{eledmac}. To migrate from ledmac to eledmac, please read Appendix \ref{migration} (p.~\pageref{migration}).
648 %
649 % \subsubsection{List of works edited with (e)ledmac}
650 % A collaborative list of works edited with (e)ledmac is available on \url{https://www.zotero.org/groups/critical_editions_typeset_with_edmac_ledmac_and_eledmac/items}. Please add your own edition made with (e)ledmac.
651 %
652 % \section{The \Eledmac{} package}\label{howto}
653 %
654 %
655 % \Eledmac{} is a three-pass package like
656 % \LaTeX\ itself.
657 % Although your textual apparatus and line
658 % numbers will be printed even on the first run, it takes two more
659 % passes through \LaTeX\ to be sure that everything gets to its right
660 % place. Any changes you make to the input file may similarly
661 % require three passes to get everything to the right place, if the
662 % changes alter the number of lines or notes. \Eledmac{} will tell
663 % you that you need to make more runs, when it notices, but it does
664 % not expend the labor to check this thoroughly. If you have
665 % problems with a line or two misnumbered at the top of a page, try
666 % running \LaTeX\ once or twice more.
667 %
668 % A file may mix \emph{numbered} and \emph{unnumbered} text.
669 % Numbered text is printed with marginal line numbers and can include
670 % footnotes and endnotes that are referenced to those line numbers:
671 % this is how you'll want to print the text that you're editing.
672 % Unnumbered text is not printed with line numbers, and you can't
673 % use \eledmac's note commands with it: this is appropriate for
674 % introductions and other material added by the editor around the
675 % edited text.
676 %
677 %
678 % \section{Options}
679 % The package can be loaded with a number of global options which are listed here.
680 % It is advised to read the relevant parts of the handbook before reading this section.
681 % \begin{description}
682 % \item[draft] underlines lemmas in the main text.
683 % \item[ledsecnolinenumber] is deprecated.
684 % \item[nocritical] disables tools for critical footnotes (\cs{Afootnote}, \cs{Bfootnote} etc.). If you do not need critical footnotes, this option lets \eledmac\ run faster.
685 % It will also preserve room for other packages.
686 % \item[noeledsec] disables tools for \cs{eledsection} and related commands (\reff{eledsection}).
687 % \item[noend] disables tools for endnotes (\cs{Aendnote}, \cs{Bendnote} etc.). If you do not need endnotes, this option lets \eledmac\ run faster.
688 % It will also preserve room for other packages.
689 % \item[nofamiliar] disables tools for familiar footnotes (\cs{footnoteA}, \cs{footnoteB} etc.). If you do not need familiar footnotes, this option lets \eledmac\ run faster.
690 % It will also preserve room for other packages.
691 % \item[noledgroup] \eledmac{} allows to use of (two or more) critical series of notes and (two or more) new series of normal notes inside minipage and ledgroup environments (see~\reff{ledgroup}). However, such features use up computer memory, at the expense of other processing needs. So if you do not need this feature, use \verb+noledgroup+ option. This should make \eledmac{} faster.
692 % \item[nopbinverse] prevents page break inside verses.
693 % \item[noquotation] by default, the quotation environment is redefined inside numbered text. You can disable this redefinition with \verb|noquotation| (see \reff{noquotation}).
694 % \item[oldprintnpnumspace] is only to be used if you want to have the (bugged) behavior of \cs{doendnotes} of \Eledmac{} versions prior to v.1.21.0 (see \reff{oldprintnpnumspace})
695 % \item[parapparatus] by default, the apparatus cannot contain paragraph breaks; this option enables paragraphing inside the apparatus.
696 % \item[series] \Lpack{eledmac} defines six levels of notes: A, B, C, D, E, Z.
697 % Using all these levels consumes memory space and processing speed.
698 % This is why, if your work does not require all of the A-E, Z series, you can narrow down the available number of series.
699 % For example, if you only need A and B series, call the package with \verb+series={A,B}+ option.
700 % \item[xindy] and \verb|xindy+hyperref| are for selecting \verb+xindy+ as the index processor (\reff{xindy}).
701 % \item[widthliketwocolumns] set the width of the text disposed on one column to be the same as the width of the text disposed on two parallel columns with \Lpack{eledpar}. This is useful when alternating between normal and parallel typesetting.
702 % \end{description}
703 % \section{Text lines and paragraphs numbering}
704 % \subsection{Text lines numbering}
705 % \DescribeMacro{\beginnumbering}
706 % \DescribeMacro{\endnumbering}
707 % Each section of numbered text must be preceded by
708 % \cs{beginnumbering} and followed by \cs{endnumbering}, like: \\
709 % \cs{beginnumbering} \\
710 % \meta{text} \\
711 % \cs{endnumbering}
712 %
713 % The \cs{beginnumbering} macro resets the line number to zero,
714 % reads an auxiliary file called \meta{jobname}.\file{nn} (where
715 % \meta{jobname} is the name of the main input file for this job,
716 % and \file{nn} is 1 for the first numbered section, 2 for
717 % the second section, and so on), and then creates a new version of
718 % this auxiliary file to collect information during this run. The
719 % first instance of \cs{beginnumbering} also opens a file called
720 % \meta{jobname}\file{.end} to receive the text of the endnotes.
721 % \cs{endnumbering} closes the \meta{jobname}.\file{nn} file.
722 %
723 % If the line numbering of a text is to be continuous from start to end,
724 % then the whole text will be typed between one pair of
725 % \cs{beginnumbering} and \cs{endnumbering} commands. But your text
726 % will most often contain chapter or other divisions marking sections
727 % that should be independently numbered, and these will be appropriate
728 % places to begin new numbered sections. \Eledmac{} has to read and store
729 % in memory
730 % a certain amount of information about the entire section when it
731 % encounters a \cs{beginnumbering} command, so it speeds up the
732 % processing and reduces memory use when a text is divided into a larger
733 % number of sections (at the expense of multiplying the number of
734 % external files that are generated).
735 %
736 % \subsection{Paragraphs}
737 % \subsubsection{Basis}
738 % \DescribeMacro{\pstart}
739 % \DescribeMacro{\pend}
740 % Within a numbered section, each paragraph of numbered text must
741 % be marked using the \cs{pstart} and \cs{pend} commands: \\
742 % \cs{pstart} \\
743 % \meta{paragraph of text} \\
744 % \cs{pend}
745 %
746 % Text that appears within a numbered section but isn't marked with
747 % \cs{pstart} and \cs{pend} will not be numbered.
748 %
749 % The following example shows the proper section and paragraph
750 % markup, and the kind of output that would typically be generated:
751 % \egstart
752 % \begin{verbatim}
753 % \beginnumbering
754 % \pstart
755 % This is a sample paragraph, with
756 % lines numbered automatically.
757 % \pend
758 %
759 % \pstart
760 % This paragraph too has its
761 % lines automatically numbered.
762 % \pend
763 %
764 % The lines of this paragraph are
765 % not numbered.
766 %
767 % \pstart
768 % And here the numbering begins
769 % again.
770 % \pend
771 % \endnumbering
772 % \end{verbatim}
773 % \egmid
774 % {\parskip0pt \count255=0
775 % \everypar{\advance \count255 by 1 \hbox to 1.5em{\the\count255\hfil}}
776 % This is a sample paragraph\par
777 % with lines numbered\par
778 % automatically.\smallskip
779 %
780 % This paragraph too\par
781 % has its lines automatically\par
782 % numbered.\smallskip
783 %
784 % \everypar{\hbox to 1.5em{\hfil}}
785 % The lines of this paragraph\par
786 % are not numbered.\smallskip
787 %
788 % \everypar{\advance \count255 by 1 \hbox to 1.5em{\the\count255\hfil}}
789 % And here the numbering\par
790 % begins again.\par}
791 % \egend
792 %
793 % \subsubsection{Content before specific \cs{pstart} and after \cs{pend}}\label{pstart:optionalarg}
794 % \changes{v1.12.0}{2014/08/05}{Optional arguments for \cs{pstart} and \cs{pend}.}
795 % Both \cs{pstart} and \cs{pend} can take a optional argument, in brackets.
796 % Its content will be printed before the beginning of \cs{pstart} / after the end of \cs{pend} instead of the argument of \cs{AtEveryPstart} / \cs{AtEveryPend}.
797 % If you need to start a \cs{pstart} by brackets, or to add brackets after a \cs{pend}, just add a \cs{relax} between \cs{pstart}/\cs{pend} and the brackets.
798 %
799 % For example, \Lpack{eledmac} does not insert \cs{parskip} between paragraphs. This feature allows you to insert it:
800 % \begin{verbatim}
801 % \parskip=2\baselineskip% Set the skip between paragraphs
802 % \AtEveryPend{\vskip\parskip}% Apply after every \Pend
803 % \end{verbatim}
804
805 %. This feature is also useful when typesetting verses (see~\reff{verse}) or \Lpack{eledpar} (see~\reff{eledpar}).
806 %
807 % A \cs{noindent} is automatically added before this argument.
808 % \subsubsection{Content before every \cs{pstart} and after every \cs{pend}}
809 % \changes{v1.15.0}{2015/01/12}{New commands \cs{AtEveryPstart} and \cs{AtEveryPend}.}
810 % \label{AtEveryPstart} \DescribeMacro{\AtEveryPstart}\DescribeMacro{\AtEveryPend}
811 % You can use both \cs{AtEveryPstart} and \cs{AtEveryPend}.
812 % Their arguments will be printed before every \cs{pstart} begins / after every \cs{pend} ends.
813 % \subsubsection{Producting automatically \cs{pstart}\ldots{}\cs{pend}}
814 % \DescribeMacro{\autopar}
815 % You can use \cs{autopar} to avoid the nuisance of this paragraph markup
816 % and still have every paragraph automatically numbered. The scope of the
817 % \cs{autopar} command needs to be limited by keeping it within a group, as
818 % follows:
819 % \egstart
820 % \begin{verbatim}
821 % \begingroup
822 % \beginnumbering
823 % \autopar
824 %
825 % A paragraph of numbered text.
826 %
827 % Another paragraph of numbered
828 % text.
829 %
830 % \endnumbering
831 % \endgroup
832 % \end{verbatim}
833 % \egmid
834 % {\parskip0pt \count255=0
835 % \everypar{\advance \count255 by 1 \hbox to 1.5em{\the\count255\hfil}}
836 % A paragraph of numbered\par
837 % text.\smallskip
838 %
839 % Another paragraph of\par
840 % numbered text.\par}
841 % \egend
842 %
843 % \cs{autopar} fails, however, on paragraphs that start with a
844 % \verb"{" or with any other command that starts a new group before it
845 % generates any text. Such paragraphs need to be started explicitly,
846 % before the new group is opened,
847 % using \cs{indent}, \cs{noindent}, or \cs{leavevmode}, or using
848 % \cs{pstart} itself.\footnote{For a detailed study of the
849 % reasons for this restriction, see Barbara Beeton, `Initiation
850 % rites', \textit{TUGboat} \textbf{12} (1991),
851 % pp.\,257--258.\protect\index{Beeton, Barbara Ann Neuhaus Friend}}
852 %
853 % \subsubsection{Numbering paragraphs (\cs{pstart})}
854 %\changes{v0.12.0}{2011/10/01}{Possibility to number \cs{pstart}.}
855 % It is possible to insert a number at every \cs{pstart} command. You must use the \DescribeMacro{\numberpstarttrue}\cs{numberpstarttrue} command to have it. You can stop the numbering with \DescribeMacro{\numberpstartfalse}\cs{numberpstartfalse}.
856 % You can redefine the command \DescribeMacro{\thepstart}\cs{thepstart} to change style.
857 % You can change the value of the pstart number by using \emph{after} \cs{beginnumbering}:
858 % \begin{verbatim}
859 % \setcounter{numberpstart}{value}
860 % \end{verbatim}
861 % On each \cs{beginnumbering} the numbering restarts.
862 % \changes{v0.15.0}{2012/06/11}{Possibility to print \cs{pstart} number inside.}
863 %
864 % With the \cs{sidepstartnumtrue} command, the number of \cs{pstart} will be printed inside. In this case, the line number will be not printed.
865 %
866 % \changes{v1.1.0}{2012/09/25}{Add \cs{labelpstarttrue}.}
867 % With the \cs{labelpstarttrue} command, a \cs{label} added just after a \cs{pstart} will refer to the number of this pstart.
868 % \subsubsection{Languages written in Right to Left}
869 % If you use languages written in right to left, we \LuaLaTeX\ or \XeLaTeX, so
870 % you must switch text direction \cs{before} the \cs{pstart} command.
871 % \subsubsection{Memory limits}
872 % \textbf{This paragraph is kept for history, but problem described below should not appear with \Lpack{eledmac}.}
873 % \DescribeMacro{\pausenumbering}
874 % \DescribeMacro{\resumenumbering}
875 % \phantomsection\label{pause}\relax
876 % \Eledmac{} stores a lot of information about line numbers and
877 % footnotes in memory as it goes through a numbered section. But
878 % at the end of such a section, it empties its memory out, so to
879 % speak. If your text has a very long numbered section it is
880 % possible that your \LaTeX\ may reach its memory limit. There are
881 % two solutions to this. The first is to get a larger \LaTeX\ with
882 % increased memory.
883 % The second solution is to
884 % split your long section into several smaller ones. The trouble
885 % with this is that your line numbering will start again at zero
886 % with each new section. To avoid this problem, we provide
887 % \cs{pausenumbering} and \cs{resumenumbering} which are just
888 % like \cs{endnumbering} \ldots\ \cs{beginnumbering}, except that
889 % they arrange for your line numbering to continue across the break.
890 % Use \cs{pausenumbering} only between numbered paragraphs:
891 % \egstart
892 % \begin{verbatim}
893 % \beginnumbering
894 % \pstart
895 % Paragraph of text.
896 % \pend
897 % \pausenumbering
898 %
899 % \resumenumbering
900 % \pstart
901 % Another paragraph.
902 % \pend
903 % \endnumbering
904 % \end{verbatim}
905 % \egmid
906 % {\parskip0pt \count255=0
907 % \everypar{\advance \count255 by 1 \hbox to 1.5em{\the\count255\hfil}}
908 % Paragraph of\par
909 % text.\medskip
910 %
911 % Another paragraph.\par}
912 % \egend
913 %
914 % We have
915 % defined these commands as two macros, in case you find it necessary
916 % to insert text between numbered sections without disturbing the
917 % line numbering. But if you are really just using these macros to
918 % save memory, you might as well say
919 % \begin{verbatim}
920 % \newcommand{\memorybreak}{\pausenumbering\resumenumbering}
921 % \end{verbatim}
922 % and say \cs{memorybreak} between the relevant \cs{pend} and
923 % \cs{pstart}.
924 %
925 % \subsection{Lineation commands}
926 % \subsubsection{Disabling lineation}
927 % \DescribeMacro{\numberlinefalse} \DescribeMacro{\numberlinetrue}
928 % Line numbering can be disabled with \cs{numberlinefalse}. It can be enabled again with \cs{numberlinetrue}.
929 % \subsubsection{Setting lineation start and step}
930 % \DescribeMacro{\firstlinenum}
931 % \DescribeMacro{\linenumincrement}
932 % By default, \Eledmac{} numbers every 5th line. There are two counters,
933 % \verb?firstlinenum? and \verb?linenumincrement?, that control this
934 % behaviour; they can be changed using \cs{firstlinenum}\marg{num} and
935 % \cs{linenumincrement}\marg{num}. \cs{firstlinenum} specifies the first
936 % line that will have a printed number, and \cs{linenumincrement} is
937 % the difference between succesive
938 % numbered lines. For example, to start printing numbers at the first line
939 % and to have every other line numbered: \\
940 % \verb?\firstlinenum{1} \linenumincrement{2}?
941 %
942 % \DescribeMacro{\firstsublinenum}
943 % \DescribeMacro{\sublinenumincrement}
944 % There are similar commands, \cs{firstsublinenum}\marg{num} and
945 % \cs{sublinenumincrement}\marg{num} for controlling sub-line numbering.
946 % \DescribeMacro{\linenumberlist}
947 % You can define \cs{linenumberlist} to specify a non-uniform distribution
948 % of printed line numbers. For example: \\
949 % \verb?\def\linenumberlist{1,2,3,5,7,11,13,17,19,23,29}? \\
950 % to have numbers printed on prime-numbered lines only. There must be
951 % no spaces within the definition which consists of comma-separated decimal
952 % numbers. The numbers can be in any order but it is easier to read if you
953 % put them in numerical order. Either omitting the definition of
954 % \cs{linenumberlist} or following the vacuous definition \\
955 % \verb?\def\linenumberlist{}? \\
956 % the standard numbering sequence is applied. The standard sequence
957 % is that specified by the combination of the \texttt{firstlinenum},
958 % \texttt{linenumincrement}, \texttt{firstsublinenum} and
959 % \texttt{linenumincrement} counter values.
960 % \subsubsection{Setting lineation reset}
961 % \DescribeMacro{\lineation}
962 % \changes{v1.0.0}{2012/09/15}{Debug in lineation command}
963 % Lines can be numbered either by page, by pstart or by section; you specify
964 % this using the \cs{lineation}\marg{arg}
965 % macro, where \meta{arg} is either
966 % \texttt{page}, \texttt{pstart} or \texttt{section}. You may only use this command at places
967 % where numbering is not in effect; you can't change the lineation system
968 % within a section. You can change it between sections: they don't all
969 % have to use the same lineation system.
970 % The package's standard setting is \verb"\lineation{section}". If the lineation is by pstart, the pstart number will be printed before the line number in the notes.
971 %
972 % \subsubsection{Setting line number margin}
973 % \DescribeMacro{\linenummargin}
974 % The command \cs{linenummargin}\meta{location} specifies the margin
975 % where the line (or pstart) numbers will be printed. The permissable value
976 % for \meta{location} is one out of the list \texttt{left}, \texttt{right},
977 % \texttt{inner}, or \texttt{outer},
978 % for example \verb"\linenummargin{inner}".
979 % The package's default setting is \\
980 % \verb"\linenummargin{left}" \\
981 % to typeset the numbers in the left hand margin.
982 % You can change this whenever you're not in the middle of
983 % making a paragraph.
984 %
985 % More precisely, the value of
986 % \cs{linenummargin} used is that in effect at the \cs{pend}
987 % of a numbered paragraph. Apart from an initial setting for
988 % \cs{linenummargin}, only change it after a \cs{pend}, whereupon
989 % it will apply to all following numbered paragraphs, until
990 % changed again (changing it between a \cs{pstart} and \cs{pend}
991 % pair will apply the change to all the current paragraph).
992 %
993 %
994 % \subsubsection{Other settings}
995 %
996 % \DescribeMacro{\leftlinenum}
997 % \DescribeMacro{\rightlinenum}
998 % \DescribeMacro{\linenumsep}
999 % When a marginal line number is to be printed, there are a
1000 % lot of ways to display it.
1001 % You can redefine \cs{leftlinenum} and \cs{rightlinenum} to
1002 % change the way marginal line numbers are printed in the
1003 % left and right margins respectively; the initial
1004 % versions print the number in font \cs{numlabfont} (described
1005 % below) at a distance \cs{linenumsep} (initially set to one pica)
1006 % from the text.
1007 %
1008 % \subsection{Changing the line numbers}
1009 %
1010 % Normally the line numbering starts at 1 for the first line of
1011 % a section and steps up by one for each line thereafter. There
1012 % are various common modifications of this system, however; the
1013 % commands described here allow you to put such modifications
1014 % into effect.
1015 %
1016 % \DescribeMacro{\startsub}
1017 % \DescribeMacro{\endsub}
1018 % You insert the \cs{startsub} and \cs{endsub} commands in your text
1019 % to turn sub-lineation on and off. In plays, for
1020 % example, stage directions are often numbered with sub-line
1021 % numbers: as line $10.1$, $10.2$,
1022 % $10.3$, rather than as $11$, $12$, and $13$.
1023 % Titles and headings are sometimes numbered with sub-line numbers
1024 % as well.
1025 %
1026 % When sub-lineation is in effect, the line number counter is
1027 % frozen and the sub-line counter advances instead. If one of these
1028 % commands appears in the middle of a line, it doesn't take effect
1029 % until the next line; in other words, a line is counted as a line
1030 % or sub-line depending on what it started out as, even if that
1031 % changes in the middle.
1032 %
1033 % \DescribeMacro{\startlock}
1034 % \DescribeMacro{\endlock}
1035 % The \cs{startlock} command, used in running text, locks the
1036 % line number at its current value, until you say \cs{endlock}.
1037 % It can tell for itself whether you are in a patch of line or
1038 % sub-line numbering. One use for line-number locking is in printing
1039 % poetry: there the line numbers should be those of verse lines
1040 % rather than of printed lines, even when a verse line requires several
1041 % printed lines.
1042 %
1043 % \DescribeMacro{\lockdisp}
1044 % When line-number locking is used,
1045 % several printed lines may have the same line number, and you have to
1046 % specify whether you want the number attached to the first printed
1047 % line or the last, or whether you just want the number printed by
1048 % them all. (This assumes that, on the basis of the settings of
1049 % the previous parameters, it is necessary to display a line number for
1050 % this line.) You specify your preference using \cs{lockdisp}\marg{arg}; its
1051 % argument is a word, either \texttt{first}, \texttt{last}, or \texttt{all}.
1052 % The package initially sets this as \verb"\lockdisp{first}".
1053 %
1054 % \DescribeMacro{\setline}
1055 % \DescribeMacro{\advanceline}
1056 % In some cases you may want to modify the line numbers that are
1057 % automatically calculated: if you are printing only fragments
1058 % of a work but want to print line numbers appropriate to a complete
1059 % version, for example. The \cs{setline}\marg{num} and
1060 % \cs{advanceline}\marg{num} commands
1061 % may be used to change the current line's number (or the sub-line
1062 % number, if sub-lineation is currently on). They change both the
1063 % marginal line numbers and the line numbers passed to the notes.
1064 % \cs{setline} takes one argument, the value to which you want
1065 % the line number set; it must be $0$ or greater. \cs{advanceline}
1066 % takes one argument, an amount that should be added to the current
1067 % line number; it may be positive or negative.
1068 %
1069 % \DescribeMacro{\setlinenum}
1070 % The \verb?\setline? and \verb?\advanceline? macros should only be used
1071 % within a \verb?\pstart...\pend? group. The \cs{setlinenum}\marg{num}
1072 % command can be used outside such a group, for example between
1073 % a \verb?pend? and a \verb?\pstart?. It sets the line number
1074 % to \meta{num}.
1075 % It has no effect if used within a \verb?\pstart...\pend? group
1076 %
1077 % \DescribeMacro{\linenumberstyle}
1078 % \DescribeMacro{\sublinenumberstyle}
1079 % Line numbers are nomally printed as arabic numbers. You can
1080 % use \cs{linenumberstyle}\marg{style} to change the numbering style.
1081 % \meta{style} must be one of:
1082 % \begin{itemize}
1083 % \item[\texttt{Alph}] Uppercase letters (A\ldots\ Z).
1084 % \item[\texttt{alph}] Lowercase letters (a\ldots\ z).
1085 % \item[\texttt{arabic}] Arabic numerals (1, 2, \ldots)
1086 % \item[\texttt{Roman}] Uppercase Roman numerals (I, II, \ldots)
1087 % \item[\texttt{roman}] Lowercase Roman numerals (i, ii, \ldots)
1088 % \end{itemize}
1089 % Note that with the \texttt{Alph} or \texttt{alph} styles, `numbers'
1090 % must be between 1 and 26 inclusive.
1091 %
1092 % Similarly \cs{sublinenumberstyle}\marg{style} can be used to change
1093 % the numbering style of sub-line numbers, which is normally arabic numerals.
1094 %
1095 % \DescribeMacro{\skipnumbering}
1096 % When inserted into a numbered line the macro \cs{skipnumbering} causes
1097 % the numbering of that particular line to be skipped; that is, the line
1098 % number is unchanged and no line number will be printed.
1099 % Note that if you use it in \cs{stanza}, you must call it at the beginning of the verse.
1100 %
1101 % \DescribeMacro{\hidenumbering}
1102 % \changes{v1.21.0}{2015/04/13}{Add \cs{hidenumbering}}
1103 % When inserted into a numbered line the macro \cs{hidenumbering} causes
1104 % the number for that particular line to be hidden; namely, no line number will print.
1105 % Note that if you use it in \cs{stanza}, you must call it at the beginning of the verse.
1106 % \section{The apparatus}
1107 % \subsection{Commands}
1108 % \subsubsection{The lemma}
1109 % \DescribeMacro{\edtext}
1110 % Within numbered paragraphs, all footnotes and endnotes are generated
1111 % by the \cs{edtext} macro:
1112 % \begin{verse}
1113 % \cs{edtext}\marg{lemma}\marg{commands}
1114 % \end{verse}
1115 %
1116 %
1117 % The \meta{lemma} argument is the lemma in the main text: \cs{edtext}
1118 % both prints this as part of the text, and makes it available to the
1119 % \meta{commands} you specify to generate notes.
1120 %
1121 % For example:
1122 % \egstart
1123 % \begin{verbatim}
1124 % I saw my friend \edtext{Smith}{
1125 % \Afootnote{Jones C, D.}}
1126 % on Tuesday.
1127 % \end{verbatim}
1128 % \egmid
1129 % 1\enspace I saw my friend\\
1130 % 2\enspace Smith on Tuesday.\smallskip
1131 % \hrule width 1.5cm
1132 % \strut {\bf 2} Smith] Jones C, D.
1133 % \egend
1134 %
1135 % The lemma \verb?Smith? is printed as part of this sentence in
1136 % the text, and is also made available to the footnote
1137 % that specifies a variant, \verb?Jones C, D?. The footnote macro
1138 % is supplied with the line number at which the lemma appears
1139 % in the main text.
1140 %
1141 % The \meta{lemma} may contain further \cs{edtext} commands.
1142 % Nesting makes
1143 % it possible to print an explanatory note on a long passage together with
1144 % notes on variants for individual words within the passage. For
1145 % example:
1146 % \egstart
1147 % \begin{verbatim}
1148 % \edtext{I saw my friend
1149 % \edtext{Smith}{\Afootnote{Jones
1150 % C, D.}} on Tuesday.}{
1151 % \Bfootnote{The date was
1152 % July 16, 1954.}
1153 % }
1154 % \end{verbatim}
1155 % \egmid
1156 % 1\enspace I saw my friend\\
1157 % 2\enspace Smith on Tuesday.\smallskip
1158 % \hrule width 1.5cm
1159 % \strut {\bf 2} Smith] Jones C, D.\smallskip
1160 % \hrule width 1.5cm
1161 % \strut {\bf 1--2} I saw my friend \\
1162 % Smith on Tuesday.] The\\ date was
1163 % July 16, 1954.
1164 % \egend
1165 %
1166 % However, \cs{edtext} cannot handle overlapping but unnested
1167 % notes---for example, one note covering lines 10--15, and another
1168 % covering 12--18; a \cs{edtext} that starts in the \meta{lemma}
1169 % argument of another \cs{edtext} must end there, too. (The
1170 % \cs{lemma} and \cs{linenum} commands may be used to
1171 % generate overlapping notes if necessary.)
1172 %
1173 % \subsubsection{Footnotes}
1174 %
1175 % The second argument of the \cs{edtext} macro, \meta{commands},
1176 % may contain a series of subsidiary commands that generate
1177 % various kinds of notes.
1178 %
1179 % \DescribeMacro{\Afootnote}
1180 % \DescribeMacro{\Bfootnote}
1181 % \DescribeMacro{\Cfootnote}
1182 % \DescribeMacro{\Dfootnote}
1183 % \DescribeMacro{\Efootnote}
1184 % \DescribeMacro{\Zfootnote}
1185 % Six separate series of the footnotes are maintained; each macro
1186 % takes one argument like \cs{Afootnote}\marg{text}.
1187 % When all of the six
1188 % are used, the \texttt{A} notes appear in a layer just below the main
1189 % text, followed by the rest in turn, down to the \texttt{Z} notes at
1190 % the bottom.
1191 % These are the main macros that you will use to construct
1192 % the critical apparatus of your text.
1193 %
1194 % If you need more series of critical notes, please look at \reff{newseries}.
1195 %
1196 %\changes{v1.0.0}{2012/09/15}{Options nonum and nosep in \cs{Xfootnote}.}
1197 %\changes{v1.20.0}{2015/03/22}{Options fulllines in \cs{Xfootnote}.}\label{Xfootnoteopt}
1198 %An optional argument can be added before the text of the footnote. Its value is a comma separated list of options.
1199 % \label{fulllines}The available options are:
1200 % \begin{itemize}
1201 % \item \verb|fulllines| to disable \cs{twolines} and \cs{morethantwolines} features for this note (cf. \reff{twolines}).
1202 % \item \verb|nonum| to disable line numbering for this note.
1203 % \item \verb|nosep| to disable the lemma separator for this note.
1204 % \end{itemize}
1205 %
1206 % Example: \cs{Afootnote}\verb|[nonum]|\marg{text}.
1207 %
1208 % \subsubsection{Endnotes}
1209 % \DescribeMacro{\Aendnote}
1210 % \DescribeMacro{\Bendnote}
1211 % \DescribeMacro{\Cendnote}
1212 % \DescribeMacro{\Dendnote}
1213 % \DescribeMacro{\Eendnote}
1214 % \DescribeMacro{\Zendnote}
1215 % The package also maintains six separate series of endnotes.
1216 %
1217 % If you do not need the endnotes facility, you should use \verb+noend+ option when loading \Lpack{eledmac}.
1218 %
1219 % The mechanism is similar to the one for footnotes: each macro takes one or more optional arguments and one single argument, like:\\
1220 % \cs{Aendnote}\oarg{option}\marg{text}.
1221 %
1222 % \verb+[<option>]+ can contain a comma separated list of values. Allowed values are:
1223 % \begin{itemize}
1224 % \item \verb|fulllines| to disable \cs{Xendtwolines} and \cs{Xendmorethantwolines} features for this particular note (cf. \reff{twolines}).
1225 % \item \verb|nosep| to disable the lemma separator for this particular note.
1226 % \end{itemize}
1227 %
1228 % \label{doendnotes} Normally, endnotes are not printed: you must use the
1229 % \cs{doendnotes}\marg{s}, where \meta{s} is the letter of the series to be printed. Put this command where you want the corresponding set of endnotes printed.
1230 %
1231 % \changes{v1.22.0}{2015/04/25}{Add \cs{doendnotesbysection} command.}
1232 % \changes{v1.22.0}{2015/04/25}{Standardize endnotes handbook.}
1233 % In this case, all the endnotes of the \meta{s} series are printed, for all numbered section.
1234 % \DescribeMacro{\doendnotesbysection}However, you may want to print the endnotes of one given series covering the first numbered section, then the endnotes of another given series covering the first numbered section, then the endnotes of the first given series covering the second numbered section, then the endnotes of the second given series covering the second numbered section, and so forth.
1235 % In this case, use \cs{doendnotesbysection}\marg{s}.
1236 % For each value of \meta{s}, the first call of the command will print the notes for the first series, the second call will print the notes for the second series etc.
1237 % For example, do:
1238 % \begin{verbatim}
1239 % \section{Endnotes}
1240 % \subsection{First text}
1241 % \doendnotesbysection{A}
1242 % \doendnotesbysection{B}
1243 % \subsection{Second text}
1244 % \doendnotesbysection{A}
1245 % \doendnotesbysection{B}
1246 % \end{verbatim}
1247 %
1248 % Note that by default inside endnotes no separator is used between the lemma and the content.
1249 % However you can use the \cs{Xendlemmaseparator} macro to define one (\reff{Xendlemmaseparator}).
1250 %
1251 % As endnotes may be printed at any point in the document they always
1252 % start with the page number where they are called. The
1253 % macro \cs{printnpnum}\marg{num} is used to print these numbers.
1254 % Its default definition is: \\
1255 % \verb?\newcommand*{\printnpnum}[1]{p.#1) }?
1256 %
1257 %
1258 % \subsubsection{Paragraph in critical apparatus}
1259 % By default, no paragraph can be made in the notes of critical apparatus.
1260 % You can allow it by adding the options \verb+parapparatus+ when loading the package :
1261 % \begin{verbatim}
1262 % \usepackage[parapparatus]{eledmac}
1263 % \end{verbatim}
1264 %
1265 % \DescribeMacro{\lemma}
1266 % \changes{v1.0.0}{2012/09/15}{\cs{lemma} can contain commands.}
1267 % If you want to change the lemma that gets passed to the notes, you
1268 % can do this by using \cs{lemma}\marg{alternative} within the
1269 % second argument to \cs{edtext}, before the note commands.
1270 % The most common use of this command is to abbreviate the lemma that's
1271 % printed in the notes. For example:
1272 % \egstart
1273 % \begin{verbatim}
1274 % \edtext{I saw my friend
1275 % \edtext{Smith}{\Afootnote{Jones
1276 % C, D.}} on Tuesday.}
1277 % {\lemma{I \dots\ Tuesday.}
1278 % \Bfootnote{The date was
1279 % July 16, 1954.}
1280 % }
1281 % \end{verbatim}
1282 % \egmid
1283 % 1\enspace I saw my friend\\
1284 % 2\enspace Smith on Tuesday.\smallskip
1285 % \hrule width 1.5cm
1286 % \strut {\bf 2} Smith] Jones C, D.\smallskip
1287 % \hrule width 1.5cm
1288 % \strut {\bf 1--2} I \dots\ Tuesday.] \\
1289 % The date was July 16, 1954.
1290 % \egend
1291 %
1292 % \DescribeMacro{\linenum}
1293 % \phantomsection\label{linenum}\relax
1294 % You can use \cs{linenum}\marg{arg} to change the line numbers passed to
1295 % the notes. The notes are actually given seven parameters: the page,
1296 % line, and sub-line number for the start of the lemma; the same
1297 % three numbers for the end of the lemma; and the font specifier
1298 % for the lemma. As the argument to \cs{linenum}, you specify
1299 % those seven parameters in that order, separated by vertical bars
1300 % (the \verb"|" character). However, you can retain the value
1301 % computed by \eledmac{} for any number by simply omitting it; and
1302 % you can omit a sequence of vertical bars at the end of the
1303 % argument. For example, \verb"\linenum{|||23}" changes one number,
1304 % the ending page number of the current lemma.
1305 %
1306 % This command doesn't change the marginal line numbers in any way;
1307 % it just changes the numbers passed to the footnotes. Its use comes in
1308 % situations that \cs{edtext} has trouble dealing with for
1309 % whatever reason. If you need notes for overlapping passages that
1310 % aren't nested, for instance, you can use \cs{lemma} and
1311 % \cs{linenum} to generate such notes despite the limitations of
1312 % \cs{edtext}. If the \meta{lemma} argument to \cs{edtext} is
1313 % extremely long, you may run out of memory; here again you can
1314 % specify a note with an abbreviated lemma using \cs{lemma} and
1315 % \cs{linenum}. The numbers used in \cs{linenum} need not be
1316 % entered manually; you can use the `\texttt{x-}' symbolic cross-referencing
1317 % commands below (\reff{crossref}) to compute them
1318 % automatically.
1319 %
1320 % Similarly, being able to manually change the lemma's font specifier
1321 % in the notes might be important if you were using multiple scripts or
1322 % languages. The form of the font specifier is three
1323 % separate codes separated by \verb"/" characters, giving the family,
1324 % series, and shape codes as defined within NFSS.
1325 %
1326 % \paragraph{Changing the names of these commands}
1327 %
1328 % The commands for generating the apparatus have been given
1329 % rather bland names, because editors in different fields have
1330 % widely divergent notions of what sort of notes are required, where
1331 % they should be printed, and what they should be called. But this
1332 % doesn't mean you have to type \cs{Afootnote} when you'd rather
1333 % say something you find more meaningful, like \cs{variant}. We
1334 % recommend that you create a series of such aliases and use them
1335 % instead of the names chosen here; all you have to do is put commands
1336 % of this form at the start of your file%
1337 %\footnote{We use \cs{newcommand} and \cs{newcommandx} instead of classical \cs{let} command because the edtabular environments have to modify the notes definition, and we need to use the newest definition of notes. Read the handbook of \Lpack{xargs} to know more about \cs{newcommandx}.}:
1338 % \begin{verbatim}
1339 % \newcommandx{\variant}[2][1,usedefault]{\Afootnote[#1]{#2}}
1340 % \newcommandx{\explanatory}[2][1,usedefault]{\Bfootnote[#1]{#2}}
1341 % \newcommand{\trivial}[1]{\Aendnote{#1}}
1342 % \newcommandx{\testimonia}[2][1,usedefault]{\Cfootnote[#1]{#2}}
1343 % \end{verbatim}
1344 %
1345 %
1346 % \subsection{Disambiguation of identical words in the apparatus}
1347 % \changes{v1.15.0}{2015/01/12}{New tools to prevent ambiguous references in lemma}
1348 % \changes{v1.23.0}{2015/05/18}{Fix bug with \cs{sameword} when the same lemma is used for multiple notes or for nested \cs{edtext}s.}
1349 % \changes{v1.23.0}{2015/05/18}{Optional argument of \cs{sameword} can be a comma separated list of \cs{edtext} depth.}
1350 % \changes{v1.23.0}{2015/05/18}{Fix bug with \cs{sameword} when the lemma overlaps multiple line.}
1351 % Sometimes, the same word occurs twice (or more) in the same line.
1352 % \Lpack{eledmac} provides tools to disambiguate references in the critical notes.
1353 % The lemma will be followed by a reference number if a given word occurs more that once in the same line.
1354 %
1355 % \subsubsection{Basic use}
1356 % \DescribeMacro{\sameword} To use this tool, you have to mark every occurrence of the potentially ambiguous term with the \cs{sameword} command:
1357 % \begin{verbatim}
1358 % Lupus \sameword{aut} canis \edtext{\sameword{aut}}{\Afootnote{et}} felix
1359 % \end{verbatim}
1360 % In this example, \verb+aut+ will be followed, in the critical note, by the exponent \verb+2+ if it is printed in the same line as the first \verb+aut+, but it won't if it is printed in a different line. The number is printed only after the second run.
1361 %
1362 % \subsubsection{Note about input encoding with UTF-8 processor}
1363 %
1364 % If you use UTF-8 processor, like \XeLaTeX\ or \LuaLaTeX, there should not be any glitches.
1365 % However, pay attention to how characters are encoded. Similar-looking characters may be represented differently in unicode numbering.
1366 %
1367 % For instance, in Greek, \verb+ᾳ+ has two possible unicode numbers:
1368 % \begin{itemize}
1369 % \item GREEK SMALL LETTER ALPHA (U+03B1) + COMBINING GREEK YPOGEGRAMMENI (U+0345)
1370 % \item GREEK SMALL LETTER ALPHA WITH YPOGEGRAMMENI (U+1FB3)
1371 % \end{itemize}
1372 %
1373 % Which unicode number you use depends, many times, on your keyboard configuration (the computer-input system).
1374 %
1375 % Inside \eledmac, the \cs{sameword} command considers these two unicodes options as different characters. If you use only one unicode number consistently, the distinction will probably make no difference to how your text looks, but \cs{sameword} will process the text inaccurately, based on the unicode numbers. To prevent this, do the following:
1376 % \begin{itemize}
1377 % \item If you use \XeLaTeX, add this line in your preamble: \verb+ \XeTeXinputnormalization 1+.
1378 % \item If you use \LuaLaTeX, use the \Lpack{uninormalize} of Michal Hoftich\footnote{\url{https://github.com/michal-h21/uninormalize}.} with the \verb+buffer+ option set to true.
1379 % \end{itemize}
1380 %
1381 % With these tools, \XeTeX\ / \LuaTeX\ will dynamicaly normalize unicode input when reading the file.
1382 % Consequently, you will have no problems with the \cs{sameword} command.
1383 % \subsubsection{Use with \cs{lemma} command}
1384 % If you use the \cs{lemma} command, \Lpack{eledmac} 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.
1385 %
1386 % For example in the following example:
1387 % \begin{verbatim}
1388 % some thing
1389 % \edtext{\sameword{sw}
1390 % and other \sameword{sw}
1391 % and again \sameword{sw}
1392 % it is all}%
1393 % }{\lemma{\sameword{sw} \ldots all}\Afootnote{critical note}}.%
1394 % \end{verbatim}
1395 % \Lpack{eledmac} cannot know if the ``sw'' in \cs{lemma} refers to the word after ``thing'', after ``other'', or after ``again''.
1396 %
1397 % Consequently, you have to tell \Lpack{eledmac} which instance of \cs{sameword} in the first argument of \cs{edtext} you want to reference:
1398 % \begin{itemize}
1399 % \item In the content of \cs{lemma}, use \cs{sameword} with no optional argument.
1400 % \item In the first argument of \cs{edtext}, use \cs{sameword} with the optional argument \oarg{X}. \meta{X} is the depth of the \cs{edtext} where the \cs{lemma} is used.
1401 % So if the \cs{lemma} is called in a \cs{edtext} inside another \cs{edtext}, \meta{X} is equal to \verb+2+.
1402 % If the \cs{lemma} is called in a \cs{edtext} ``of first level'', \meta{X} is equal to \verb|1|. If the lemma is called in both 1 and 2 \cs{edtext} depth, \meta{X} is \verb+1,2+. If that word is referenced in the lemma of every \cs{edtext} depth, \meta{X} can also be set to \verb+inlemma+.
1403 % \end{itemize}
1404 % Note that only words that are actually referenced in a \cs{lemma} need the optional argument. Therefore, the first \cs{sameword} in the example above should have ``1'' as its optional argument, to be referenced correctly in the lemma.
1405 %
1406 % Note also that the \meta{X} does not refer to the level where the \cs{sameword} occurs, but to the level of the \cs{lemma} that refers to that \cs{sameword}. For example:
1407 % \begin{verbatim}
1408 % \edtext{some \edtext{\sameword[1]{word}}{\Afootnote{om. M}}
1409 % and other \sameword{word}
1410 % and again a \sameword{word}
1411 % it is all}%
1412 % }{\lemma{some \sameword{word} \ldots all}\Afootnote{critical note}}.%
1413 % \end{verbatim}
1414 % Here the \cs{sameword} occurs in an \cs{edtext} of level 2, but since it is referenced by \cs{lemma} on level 1, it has ``1'' in the optional argument.
1415
1416 % In the following schema, each framed box represents an \cs{edtext} level. Each number is an occurrence of \cs{sameword}. After a framed box, the text in superscript represents the content of \cs{lemma} for that \cs{edtext} level. The text in subscript at the right of a number represents the content of the optional argument of \cs{sameword}.
1417 %
1418 %\fbox{%
1419 % \fbox{%
1420 % $1_{inlemma}$
1421 % \fbox{$2$}
1422 % $3_2$%
1423 % }\textsuperscript{$1$\ldots$3$}%
1424 % 4
1425 % $5_1$
1426 % }\textsuperscript{1\ldots5}
1427 %
1428 % The \cs{sameword} number~3 is called in a \cs{lemma} related to an \cs{edtext} of level~2.
1429 % It must be marked by ``2''.
1430 %
1431 % The \cs{sameword} number~5 is called in a \cs{lemma} related to \cs{edtext} of level~1. It must be marked by ``1''.
1432 %
1433 % The \cs{sameword} number is called in two \cs{lemma}s: one related to a \cs{edtext} of level~1, the other related to \cs{edtext} of level~2.
1434 % It must be marked by ``1,2''.
1435 % However, as \cs{lemma} is called only in level~1 and~2, ``1,2'' could replaced by ``inlemma''.
1436 %
1437 % The \cs{sameword} number ``2'' is in the first argument of a \cs{edtext} of level~3, but it has no \cs{lemma}-command, so there is no need to mark it.
1438 %
1439 %
1440 %
1441 % \subsubsection{Customizing}
1442 % \DescribeMacro{\showwordrank}You can redefine the \cs{showwordrank} macro to change the way the number is printed. The default value is
1443 % \begin{verbatim}
1444 %\newcommand{\showwordrank}[2]{%
1445 % #1\textsuperscript{#2}%
1446 %}
1447 % \end{verbatim}
1448 %
1449 % \subsection{Alternate footnote formatting}
1450 % If you just launch into \Eledmac{} using the commands outlined
1451 % above, you will get a standard layout for your text and notes. You
1452 % may be happy to accept this at the very beginning, while you
1453 % get the hang of things, but the standard layout is not particularly
1454 % pretty, and you will certainly want to modify it in due course.
1455 % The package provides ways of changing the fonts and layout of
1456 % your text, but these are not aimed at being totally comprehensive.
1457 % They are enough to deal with simple variations from the norm, and
1458 % to exemplify how you might go on to make more signifiant changes.
1459 %
1460 % \DescribeMacro{\footparagraph}
1461 % \DescribeMacro{\foottwocol}
1462 % \DescribeMacro{\footthreecol}
1463 % By default, all footnotes are formatted as a series of separate
1464 % paragraphs in one column. Three other formats are also
1465 % available for notes, and using these macros you can select a
1466 % different format for a series of notes.
1467 % \begin{itemize}
1468 % \item \cs{footparagraph} formats
1469 % all the footnotes of a series as a single paragraph;
1470 % \item \cs{foottwocol} formats them as separate paragraphs,
1471 % but in two columns;
1472 % \item \cs{footthreecol}, in three columns.
1473 % \end{itemize}
1474 % Each of these macros
1475 % takes one argument: a letter (between \verb"A" and \verb"E") for
1476 % the series of notes you want changed.
1477 % So a text with three layers of notes might begin thus:
1478 % \begin{verbatim}
1479 % \footnormal{A}
1480 % \footthreecol{B}
1481 % \footparagraph{C}
1482 % \end{verbatim}
1483 % This would make the A-notes ordinary, B-notes would be in three
1484 % columns, and the bottom layer of notes would be formed into
1485 % a paragraph on each page.
1486
1487 %
1488 % \subsection{Display options}
1489 % \label{displayoptions}
1490 % \changes{v1.0.0}{2012/09/15}{New generic commands to customize footnote display.}
1491 % Since version 1.0, some commands can be used to change the display of the footnotes. All can have an optional argument \oarg{s}, which is the letter of the series --- or a list of letters separated by comma --- depending on which option is applied.
1492 %
1493 % When a length, noted \meta{l}, is used, it can be stretchable: \verb|a plus b minus c|. The final length |m| is calculated by \LaTeX{} to have: $a-c \leq m \leq a+b$. If you use some relative unity\footnote{Like \verb|em| which is the width of a mg.}, it will be relative to fontsize of the footnote, except for commands concerning the place kept by the notes --- including blank space.
1494 %
1495 % \subsubsection{Control line number printing}
1496 % \DescribeMacro{\numberonlyfirstinline}
1497 % \changes{v1.0.1}{2012/09/16}{Correction on \cs{numberonlyfirstinline} with lineation by pstart or by page.}
1498 % By default, the line number is printed in every note. If you want to print it only the first time for a given line number (i.e one time for line 1, one time for line 2 etc.), you can use \cs{numberonlyfirstinline}\oarg{s}.
1499 %
1500 % Use \cs{numberonlyfirstinline}\oarg{s}\verb+[false]+ to disable this (\meta{s} can be empty if you want to disable it for every series).
1501 %
1502 % \DescribeMacro{\numberonlyfirstintwolines}
1503 % \changes{v1.1.0}{2012/09/25}{Add \cs{numberonlyfirstintwolines}}
1504 % Suppose you have a lemma on line~2 and a lemma between line~2 and line~3.
1505 % With \cs{numberonlyfirstinline}, the second lemma is considered to be on the same line as the first lemma.
1506 % But if you use both \cs{numberonlyfirstinline}\oarg{s} and \cs{numberonlyfirstintwolines}\oarg{s}, the distinction is made.
1507 % Use \cs{numberonlyfirstintwolines}\oarg{s}\verb+[false]+ to disable this (\meta{s} can be empty if you want to disable it for every series).
1508 %
1509 % \changes{v1.20.0}{2015/03/22}{Add \cs{twolines} and \cs{morethantwolines} hooks}
1510 % \label{twolines}
1511 % \DescribeMacro{\twolines}\DescribeMacro{\morethantwolines}
1512 % If a lemma is printed on two subsequent lines, \Eledmac\ will print the first and the last line numbers.
1513 % Instead of this, it is also possible to print an abbreviation which stands for ``line 1 and subsequent line(s)''.
1514 %
1515 % To achieve this, use \cs{twolines}\oarg{s}\marg{text} and \cs{morethantwolines}\oarg{s}\marg{text}.
1516 % The \meta{text} argument of \cs{twolines} will be printed if the lemma is on two lines, and the \meta{text} argument of \cs{morethantwolines} will be printed if the lemma is on three or more lines.
1517 % For example:
1518 % \begin{verbatim}
1519 % \twolines{sq.}
1520 % \morethantwolines{sqq.}
1521 % \end{verbatim}
1522 % Will print ``1sq.'' for a lemma which falls on lines 1-2 and ``1sqq.'' for a lemma which falls on lines 1-4.
1523 %
1524 % \DescribeMacro{\morethantwolines} If you use \cs{twolines} without setting \cs{morethantwolines}, the \meta{text} argument of \cs{twolines} will be used for lemmas which fall on three or more lines.
1525 %
1526 % However, if you want to use a short form (when the lemma overlaps two lines, but not more than two), use \cs{twolinesbutnotmore}\oarg{series}.
1527 %
1528 % It is possible to disable \cs{twolinesbutnotmore}\oarg{series} with \cs{twolinesbutnotmore}\oarg{series}\verb+[false]+.
1529 %
1530 % When you use lineation by page, the final page number, if different from the initial page number,
1531 % will not be printed, because the final page number is included in the \cs{Xendtwolines} symbol.
1532 %
1533 % \DescribeMacro{\twolinesonlyinsamepage}
1534 % However, you can force print the final page number with\\
1535 % \cs{twolinesonlyinsamepage}\oarg{series}.
1536 %
1537 % Use \cs{twolinesonlyinsamepage}\oarg{series}\verb+[false]+ to disable this.
1538 %
1539 % You can disable \cs{twolines} and related for a specific note by using the `[fulllines]` argument in the note macro cf.~\reff{fulllines}.
1540 %
1541 % \label{Xendtwolines}\changes{v1.21.0}{2015/04/13}{Add \cs{Xendtwolines}, \cs{Xendmorethantwolines}, \cs{Xendtwolinesbutnotmore} and \cs{Xendtwolinesonlyinsamepage}.}
1542 % \DescribeMacro{\Xendtwolines}\DescribeMacro{\Xendmorethantwolines}\DescribeMacro{\Xendtwolinesbutnotmore}
1543 % For endnotes, use \cs{Xendtwolines}; \cs{Xendmorethantwolines}; \cs{Xendtwolinesbutnotmore}; \cs{Xendtwolinesonlyinsamepage} instead of \cs{twolines}; \cs{morethantwolines}; \cs{twolinesbutnotmore}; \cs{twolinesonlyinsamepage}.
1544 %
1545 %
1546 % \DescribeMacro{\symlinenum}
1547 % For setting a particular symbol in place of the line number, you can use \cs{symlinenum}\oarg{s}\marg{symbol} in combination with \cs{numberonlyfirstinline}\oarg{s}. From the second lemma of the same line, the symbol will be used instead of the line number. Note that any command called in \meta{symbol} must be robust. Use \cs{robustify} to robustify a not robust command.
1548 %
1549 % \DescribeMacro{\nonumberinfootnote}
1550 % You can use \cs{nonumberinfootnote}\oarg{s} if you don't want to have the line number in a footnote. To cancel it, use \cs{nonumberinfootnote}\oarg{s}\verb+[false]+.
1551 %
1552 % \changes{v1.1.0}{2012/09/25}{Add \cs{pstartinfootnote} and \cs{onlypstartinfootnote}}
1553 % \changes{v1.18.0}{2015/02/23}{Add \cs{pstartinfootnoteeverytime}}
1554 % \changes{v1.18.0}{2015/02/23}{Debug \cs{onlypstartinfootnote} when using \cs{numberonlyfirstinline} and the current line number differs from the previous.}
1555 % \DescribeMacro{\pstartinfootnote}
1556 % You can use \cs{pstartinfootnote}\oarg{s} if you want to print the pstart number in the footnote, before the line and subline number.
1557 % Use \cs{pstartinfootnote}\oarg{s}\verb+[false]+ to disable this (\meta{s} can be empty if you want to disable it for every series).
1558 % Note that when you change the lineation system, the option is automatically switched :
1559 % \begin{itemize}
1560 % \item If you use lineation by pstart, the option is enabled.
1561 % \item If you use lineation by section or by page, the option is disabled.
1562 % \end{itemize}
1563 %
1564 % \DescribeMacro{\pstartinfootnoteeverytime}
1565 % By default, the pstart number is printed only in the part of text where you have called \cs{numberpstarttrue}.
1566 % We don't know why you would like to print the pstart number in the notes and not in the main text.
1567 % However, if you want to do it, you can call \cs{pstartinfootnoteeverytime}\oarg{s}.
1568 % In this case, the pstart number will be printed every time in footnote.
1569 %
1570 % \DescribeMacro{\onlypstartinfootnote}
1571 % In combination with \cs{pstartinfootnote}, you can use \cs{onlypstartinfootnote}\oarg{s} if you want to print only the pstart number in the footnote, and not the line and subline number.
1572 % Use \cs{onlypstartinfootnote}\oarg{s}\verb+[false]+ disable this it (\meta{s} can be empty if you want to disable it for every series).
1573 %
1574 % \DescribeMacro{\beforenumberinfootnote}
1575 % With \cs{beforenumberinfootnote}\oarg{s}\marg{l}, you can add some space before the line number in a footnote. If the line number is not printed, the space is not either. The default value is 0~pt.
1576 %
1577 % \DescribeMacro{\afternumberinfootnote}
1578 % With \cs{afternumberinfootnote}\oarg{s}\marg{l} you can add some space after the line number in a footnote. If the line number is not printed, the space is not either. The default value is 0.5~em.
1579 %
1580 %\changes{v1.4.3}{2012/12/18}{Add \cs{nonbreakableafternumber}.}
1581 %\DescribeMacro{\nonbreakableafternumber}
1582 % By default, the space defined by \cs{afternumberinfootnote} is breakable. With \cs{nonbreakableafternumber}\oarg{s} it becomes nonbreakable. Use \cs{nonbreakableafternumber}\oarg{s}\verb+[false]+ to disable this (\meta{s} can be empty if you want to disable it for every series).
1583 %
1584 % \DescribeMacro{\beforesymlinenum}
1585 % With \cs{beforesymlinenum}\oarg{s}\marg{l} you can add some space before the line symbol in a footnote. The default value is value set by \cs{beforenumberinfootnote}.
1586 %
1587 % \DescribeMacro{\aftersymlinenum}
1588 % With \cs{aftersymlinenum}\oarg{s}\marg{l} you can add some space after the line symbol in a footnote. The default value is value set by \cs{afternumberinfootnote}.
1589 %
1590 % \DescribeMacro{\inplaceofnumber}
1591 % If no number or symbolic line number is printed, you can add a space, with \cs{inplaceofnumber}\oarg{s}\marg{l}. The default value is 1~em.
1592 %
1593 % \DescribeMacro{\boxlinenum}
1594 % It could be useful to put the line number inside a fixed box: the content of the note will be printed after this box.
1595 % You can use \cs{boxlinenum}\oarg{s}\marg{l} to do that.
1596 % To subsequently disable this feature, use \cs{boxlinenum} with length equal to 0~pt.
1597 % One use of this feature is to print line number in a column, and the note in an other column:
1598 % \begin{verbatim}
1599 %\Xhangindent{1em}
1600 %\afternumberinfootnote{0em}
1601 %\boxlinenum{1em}
1602 % \end{verbatim}
1603 %
1604 % \DescribeMacro{\boxsymlinenum}
1605 % \cs{boxsymlinenum}\oarg{s}\marg{l} is the same as \cs{boxlinenum} but for the line number symbol.
1606 %
1607 % \changes{v1.23.0}{2015/05/18}{Add \cs{boxlinenumalign} and \cs{boxXendlinenumalign}.}
1608 % \DescribeMacro{boxlinenumalign}
1609 % If you put line number in box, it will be aligned left inside the box.
1610 % However, you can change it using \cs{boxlinenumalign}\oarg{s}\marg{text} where \meta{text} can be the following:
1611 % \begin{description}
1612 % \item[L] to align left (default value);
1613 % \item[R] to align right;
1614 % \item[C] to center.
1615 % \end{description}
1616 %
1617 % \changes{v1.23.0}{2015/05/18}{Add \cs{boxstartlinenum}, \cs{boxXendstartlinenum}, \cs{boxendlinenum}, \cs{boxXendendlinenum}.}
1618 % When using boxlinenum, \Eledmac{} put all the line number description in the same box. That is, the same box will contain: the start line number, the dash, and either the end line number or the range symbol (like \verb+ff.+).
1619 % However, it is possible to box them in two different boxes.
1620 % \begin{itemize}
1621 % \item \cs{boxstartlinenum}\oarg{s}\marg{l} will box the start line number in a box of length \meta{l}. The content will be put at the right of the box.
1622 % \item \cs{boxendlinenum}\oarg{s}\marg{l} will box the dash plus the end line number or the range symbol in a box of length \meta{l}. The content will be put at the left of the box.
1623 % \end{itemize}
1624 %
1625 % With these two commands, it is possible to horizontaly align the dash of line number when using critical notes, to obtain something like:
1626 % \begin{verbatim}
1627 % 1
1628 % 12-23
1629 % 24ff.
1630 % \end{verbatim}
1631 % \DescribeMacro{\boxXendlinenum}
1632 % \DescribeMacro{\boxXendlinenumalign}
1633 % \DescribeMacro{\boxXendstartlinenumalign}
1634 % \DescribeMacro{\boxXendendlinenumalign}
1635 % \changes{v1.20.0}{2015/03/22}{Add \cs{boxXendlinenum}}
1636 % \cs{boxXendlinenum}\oarg{s}\marg{l}, \cs{boxXendlinenumalign}\oarg{s}\marg{text}, \cs{boxXendstartlinenum}\oarg{s}\marg{l}, \cs{boxXendendlinenum}\oarg{s}\marg{l} are the same as, respectively, \cs{boxlinenum} and \cs{boxlinenumalign}, \cs{boxstartlinenum}, \cs{boxendlinenum} except in endnotes.
1637 %
1638 %
1639 %\subsubsection{Separator between the lemma and the note}
1640 % \paragraph{For footnotes}
1641 % \DescribeMacro{\lemmaseparator}
1642 % By default, in a footnote, the separator between the lemma and the note is a right bracket (\cs{rbracket}). You can use \cs{lemmaseparator}\oarg{s}\marg{lemmaseparator} to change it. The optional argument can be used to specify the series in which it is used. Note that there is a non-breakable space between the lemma and the separator, but a \textbf{breakable} space between the separator and the lemma.
1643 %
1644 % \DescribeMacro{\beforelemmaseparator}
1645 % Using \cs{beforelemmaseparator}\oarg{s}\marg{l} you can add some space between lemma and separator. If your lemma separator is empty, this space won't be printed. The default value is 0~em.
1646 %
1647 % \DescribeMacro{\afterlemmaseparator}
1648 % Using \cs{afterlemmaseparator}\oarg{s}\marg{l} you can add some space between separator and note. If your lemma separator is empty, this space won't be printed. The default value is 0.5~em.
1649 %
1650 % \DescribeMacro{\nolemmaseparator}
1651 % You can suppress the lemma separator, using \cs{nolemmaseparator}\oarg{s}, which is simply a alias of \cs{lemmaseparator}\oarg{s}\verb|{}|.
1652 %
1653 % \DescribeMacro{\inplaceoflemmaseparator}
1654 % With \cs{inplaceoflemmaseparator}\oarg{s}\marg{l} you can add a space if no lemma separator is printed. The default value is 1~em.
1655 %
1656 %
1657 % \paragraph{For endnotes}\label{Xendlemmaseparator}
1658 % \changes{v1.22.0}{2015/04/25}{Add option for lemma separator inside endnotes}
1659 % \DescribeMacro{\Xendlemmaseparator}
1660 % By default, there is no separator inside endnotes between the lemma and the content of the note. You can use \cs{lemmaseparator}\oarg{s}\marg{lemmaseparator} to change this. The optional argument can be used to specify the series in which it is used.
1661 % An common value of \verb+<lemmaseparator>+ is \verb+\rbracket+.
1662 %
1663 % Note that there is a non-breakable space between the lemma and the separator, but a \textbf{breakable} space between the separator and the lemma.
1664 %
1665 % \DescribeMacro{\Xendbeforelemmaseparator}
1666 % Using \cs{Xendbeforelemmaseparator}\oarg{s}\marg{l} you can add some space between the lemma and the separator. If your lemma separator is empty, this space won't be printed. The default value is 0~em.
1667 %
1668 % \DescribeMacro{\Xendafterlemmaseparator}
1669 % Using \cs{Xendafterlemmaseparator}\oarg{s}\marg{l} you can add some space between the separator and the content of the note. If your lemma separator is empty, this space won't be printed. The default value is 0.5~em.
1670 %
1671 %
1672 % \DescribeMacro{\Xendinplaceoflemmaseparator}
1673 % With \cs{Xendinplaceoflemmaseparator}\oarg{s}\marg{l} you can add some space if you chose to remove the lemma separator. The default value is 0.5~em.
1674 %
1675 %
1676 % \subsubsection{Font style}
1677 % \DescribeMacro{\Xnotenumfont}
1678 % \cs{Xnotenumfont}\oarg{s}\marg{command} is used to change the font style for line numbers in critical footnotes ;
1679 % \meta{command} must be one (or more) switching command, like \cs{bfseries}.
1680 %
1681 % \DescribeMacro{\Xendnotenumfont}
1682 % \cs{Xendnotenumfont}\oarg{s}\marg{command} is used to change the font style for line numbers in critical footnotes.
1683 % \meta{command} must be one (or more) switching command, like \cs{bfseries}.
1684 %
1685 % \DescribeMacro{\notenumfontX}
1686 % \cs{notenumfontX}\oarg{s}\marg{command} is used to change the font style for note numbers in familiar footnotes.
1687 % \meta{command} must be one (or more) switching command, like \cs{bfseries}.
1688 %
1689 % \DescribeMacro{\Xnotefontsize}
1690 % \cs{Xnotefontsize}\oarg{s}\marg{command} is used to define the font size of critical footnotes of the series. The default value is \cs{footnotesize}.
1691 % The \meta{command} must not be a size in pt, but a standard \LaTeX\ size, like \cs{small}.
1692 %
1693 % \DescribeMacro{\notefontsizeX}
1694 % \cs{notefontsizeX}\oarg{s}\marg{command} is used to define the font size of critical footnotes of the series. The default value is \cs{footnotesize}.
1695 % The \meta{command} must not be a size in pt, but a standard \LaTeX\ size, like \cs{small}.
1696 %
1697 % \DescribeMacro{\Xendnotefontsize}
1698 % \cs{Xendnotefontsize}\oarg{s}\marg{l} is used to define the font size of end critical footnotes of the series. The default value is \cs{footnotesize}.
1699 % The \meta{command} must not be a size in pt, but a standard \LaTeX\ size, like \cs{small}.
1700 % \subsubsection{Font of the lemma}
1701 % \changes{v1.11.0}{2014/05/09}{Add hooks to disable the font selection for lemma in footnote.}
1702 % \DescribeMacro{\Xlemmadisablefontselection}
1703 % By default, font of the lemma in footnote is the same as font of the lemma in the main text. For example, if the lemma is in italic in the main text, it is also in italic in note. The \cs{Xlemmadisablefontselection}\oarg{s} command allows to disable it for a specific series.
1704 %
1705 % \DescribeMacro{\Xendlemmadisablefontselection}
1706 % By default, font of the lemma in endnote is the same as font of the lemma in the main text. For example, if the lemma is in italic in the main text, it is also in italic in note. The command allows \cs{Xendlemmadisablefontselection}\oarg{s} to disable it for a specific series.
1707 %
1708 %
1709 % \subsubsection{Styles of notes content}
1710 % \changes{v1.21.0}{2015/04/13}{Add \cs{Xparindent} and \cs{hangindentX}}
1711 % \DescribeMacro{\Xparindent}
1712 % By default, \Eledmac{} does not add indentation before the paragraphs inside critical footnotes.
1713 % Use \cs{Xparindent}\oarg{series} to enable indentation.
1714 %
1715 % \DescribeMacro{\parindentX}
1716 % By default, \Eledmac{} does not add indentation before the paragraphs inside familiar footnotes.
1717 % Use \cs{parindentX}\oarg{series} to enable indentation.
1718 %
1719 % \DescribeMacro{\Xhangindent}
1720 % For critical notes NOT paragraphed you can define an indent with \cs{Xhangindent}\oarg{s}\marg{l}, which will be applied in the second line of notes. It can help to make distinction between a new note and a break in a note. The default value is 0~pt.
1721 %
1722 % \DescribeMacro{\hangindentX}
1723 % For familiar notes NOT paragraphed you can define an indentation with \cs{Xhangindent}\oarg{s}\marg{l}, which will be applied in the second line of notes. It can help to make a distinction between a new note and a break in a note.
1724 %
1725 % \subsubsection{Arbitrary code at the beginninging of notes}
1726 % \changes{v1.1.0}{2012/09/25}{New hook to add arbitrary code at the beginning of the notes}
1727 % The three next commands add an arbitrary code at the beginning of notes.
1728 % As the name's space is local to the notes, you can use it to redefine some style inside the notes.
1729 % For example, if you don't want the pstart number to be in bold, use :
1730 % \begin{verbatim}
1731 % \bhookXnote{\renewcommand{\thepstart}{\arabic{pstart}.}}
1732 % \end{verbatim}
1733 %
1734 % \DescribeMacro{\bhookXnote}
1735 % \cs{bhookXnote}\oarg{series}\marg{code} is to be used at the beginning of the critical footnotes.
1736 %
1737 %
1738 % \DescribeMacro{\bhooknoteX}
1739 % \cs{bhooknoteX}\oarg{series}\marg{code} is to be used at the beginning of the familiar footnotes.
1740 %
1741 %
1742 % \DescribeMacro{\bhookXendnote}
1743 % \cs{bhookXendnote}\oarg{series}\marg{code} is to be used at the beginning of the endnotes.
1744 %
1745 % \subsubsection{Options for footnotes in columns}
1746 % \paragraph{Alignement}
1747 % \changes{v1.21.0}{2015/04/13}{Add \cs{Xcolalign} and \cs{colalignX} hooks}
1748 % By default, texts in footnotes in two or three columns are flushed left without hyphenation.
1749 % However, you can change this with \cs{Xcolalign}\oarg{s}\marg{code}, for critical footnotes, and \cs{colalignX}\oarg{s}\marg{code}, for familiar footnotes.
1750 %
1751 % \verb+<code>+ must be one of the following command:
1752 % \begin{description}
1753 % \item[\cs{justifying}] to have text justified, as usual with \LaTeX. You can also let \verb+<code>+ empty.
1754 % \item[\cs{raggedright}] to have text left aligned, but \emph{without hyphenation}. That is the default \Lpack{eledmac} setting.
1755 % \item[\cs{RaggedRight}] to have text left aligned \emph{with hyphenation}.
1756 % \item[\cs{raggedleft}] to have text right aligned, but \emph{without hyphenation}.
1757 % \item[\cs{RaggedLeft}] to have text right aligned \emph{with hyphenation}.
1758 % \item[\cs{centering}] to have text centered, but \emph{without hyphenation}.
1759 % \item[\cs{Centering}] to have text centered \emph{with hyphenation}.
1760 % \end{description}
1761 %
1762 % \paragraph{Size of the columns}
1763 % For the following four macros, be careful that the columns are made from right to left.
1764 %
1765 % \DescribeMacro{\hsizetwocol}
1766 % \cs{hsizetwocol}\oarg{s}\marg{l} is used to change width of a column when critical notes are displaying in two columns. Defaut value is \verb+.45 \hsize+.
1767 %
1768 % \DescribeMacro{\hsizethreecol}
1769 % \cs{hsizethreecol}\oarg{s}\marg{l} is used to change width of a column when critical notes are displaying in three columns. Defaut value is \verb+.3 \hsize+.
1770 %
1771 % \DescribeMacro{\hsizetwocolX}
1772 % \cs{hsizetwocol}\oarg{s}\marg{l} is used to change width of a column when familiar notes are displaying in two columns. Defaut value is \verb+.45 \hsize+.
1773 %
1774 % \DescribeMacro{\hsizethreecolX}
1775 % \cs{hsizethreecolX}\oarg{s}\marg{l} is used to change width of a column when familiar notes are displaying in three columns. Defaut value is \verb+.3 \hsize+.
1776 %
1777 % \subsubsection{Options for paragraphed footnotes}
1778 % \DescribeMacro{\afternote}
1779 % You can add some space after a note by using \cs{afternote}\oarg{s}\marg{l}. The default value is \verb|1em plus.4em minus.4em|.
1780 %
1781 % \DescribeMacro{\parafootsep}
1782 % For paragraphed footnotes (see below), you can choose the separator between each note by using \cs{parafootsep}\oarg{s}\marg{text}. A common separator is the double pipe (\verb+$||$+), which you can set by using \cs{parafootsep}\verb+{$\parallel$}+.
1783 % Note that if the symbol defined by \cs{symlinenum} must be used at the beginning of a note, the \cs{parafootsep} is not used before this note.
1784 %
1785 % \changes{v1.12.0}{2014/08/05}{New options for ragged-paragraph notes}
1786 % \DescribeMacro{\Xragged}
1787 % Text in paragraphed critical notes is justified, but you can use \cs{Xragged}\oarg{s}+{L}+ if you want it to be ragged left, or \cs{Xragged}\oarg{s}+{R} if you want it to be ragged right.
1788
1789 % \DescribeMacro{\raggedX}
1790 % Text in paragraphed footnotes is justified, but you can use \cs{raggedX}\oarg{s}+{L}+ if you want it to be ragged left, or \cs{raggedX}\oarg{s}+{R} if you want it to be ragged right.
1791 %
1792 %\subsubsection{Options for block of notes}
1793 % \changes{v1.1.0}{2012/09/12}{New options for block of notes.}
1794 % \DescribeMacro{\txtbeforeXnotes}
1795 % You can add some text before critical notes with \cs{txtbeforeXnotes}\oarg{s}\marg{text}.
1796 %
1797 % \DescribeMacro{\beforeXnotes}
1798 % You can change the vertical space printed before the rule of the critical notes with \cs{beforeXnotes}\oarg{s}\marg{l}.
1799 % The default value is \verb|1.2em plus .6em minus .6em|.
1800 %
1801 % \textbf{Be careful, the standard \LaTeX\ footnote rule, which is used by \Lpack{eledmac}, decreases by 3pt. This 3pt decrease is not changed by this command..}
1802 % \DescribeMacro{\beforenotesX}
1803 %
1804 % You can change the vertical space printed before the rule of the familiar notes with \cs{beforenotesX}\oarg{s}\marg{l}.
1805 % The default value is \verb|1.2em plus .6em minus .6em|.
1806 %
1807 % \textbf{Be careful, the standard \LaTeX\ footnote rule, which is used by \Lpack{eledmac}, decreases 3pt. These 3pt are not changed by this command.}
1808 %
1809 % \changes{v1.12.0}{2014/08/05}{New hooks: \cs{afterXrule} and \cs{afterruleX}}
1810 % \DescribeMacro{\afterXrule}
1811 % You can change the vertical space printed after the rule of the critical notes with \cs{afterXrule}\oarg{s}\marg{l}.
1812 % The default value is \verb|0pt|.
1813 %
1814 % \textbf{Be careful, the standard \LaTeX\ footnote rule, which is used by \Lpack{eledmac}, adds 2.6pt. These 2.6pt are not changed by this command.}
1815 %
1816 %
1817 % \DescribeMacro{\afterruleX}
1818 % You can change the vertical space printed after the rule of the familiar notes with \cs{beforenotesX}\oarg{s}\marg{l}.
1819 % % The default value is \verb|0pt|.
1820 %
1821 % \textbf{Be careful, the standard \LaTeX\ footnote rule, which is used by \Lpack{eledmac}, adds 2.6pt. These 2.6pt are not changed by this command.}
1822 %
1823 %
1824 % \DescribeMacro{\preXnotes}
1825 % You can set the space before the first series of critical notes printed on each page
1826 % and set a different amount of space for subsequent the series on the page.
1827 % You can do it with \cs{preXnotes}\marg{l}. Default value is \verb+0pt+.
1828 % You can disable this feature by setting the length to 0pt.
1829 %
1830 %
1831 %
1832 % \DescribeMacro{\prenotesX}
1833 % You can want the space before the first printed (in a page) series of familiar notes not to be the same as before other series. Default value is \verb+0pt+.
1834 % You can do it with \cs{prenotesX}\marg{l}.
1835 % You can disable this feature by setting the length to 0~pt.
1836 %
1837 %
1838 % \DescribeMacro{\maxhXnotes}\label{maxhXnotes}
1839 % By default, one series of critical notes can take 80\% of the page size, before being broken to the next page.
1840 % If you want to change the size use \cs{maxhXnotes}\oarg{s}\marg{l}.
1841 % Be careful : the length can't be flexible, and is relative to the the current font.
1842 % For example, if you want the note to take, at most, 33% of the text height, do \verb|\maxhXnotes{.33\textheight}|.
1843 %
1844 % \DescribeMacro{\maxhnotesX}
1845 % \cs{maxhnotesX}\oarg{s}\marg{l} is the same as previous, but for familiar footnotes.
1846 %
1847 % Be careful with the two previous commands.
1848 % Actually, for technical purposes, one paragraphed note is considered as one block.
1849 % Consequently, it can't be broken between two pages, even if you used these commands.
1850 % The debug is in the todolist.
1851 %\subsection{Page layout}
1852 % You should set up the page layout parameters, and in particular the
1853 % \cs{baselineskip} of the footnotes (this is done for you if you
1854 % use the standard \cs{notefontsetup}), before you call any
1855 % of these macros because their action depends on these;
1856 % too much or too little space will be allotted for the notes on
1857 % the page if these macros use the wrong
1858 % values.\footnote{\phantomsection\label{nobreaks}There
1859 % is one tiny proviso about using paragraphed notes: you shouldn't
1860 % force any explicit line-breaks inside such notes: do not use
1861 % {\tt \bslash par},
1862 % {\tt \bslash break}, or {\tt \bslash penalty=-10000}. If
1863 % you must have a line-break for some obscure reason, just suggest
1864 % the break very strongly: {\tt \bslash penalty=-9999} will do
1865 % the trick. \reff{nobreak} explains why this restriction
1866 % is necessary.}
1867 %
1868 % \changes{v1.13.0}{2014/09/16}{Add \cs{Xnoteswidthliketwocolumns} and \cs{notesXwidthliketwocolumns}}
1869 % \DescribeMacro{Xnoteswidthliketwocolumns}\DescribeMacro{notesXwidthliketwocolumns}
1870 % If you use \Lpack{eledpar} \cs{columns} macro, you can call :
1871 % \begin{itemize}
1872 % \item \cs{Xnoteswidthliketwocolumns}\oarg{s} to create critical notes with a two-column size width. Use \cs{Xnoteswidthliketwocolumns}\oarg{s}\verb+[false]+ to disable it.
1873 % \item \cs{notesXwidthliketwocolumns}\oarg{s} to create familiar notes with a two-column size width. Use \cs{notesXwidthliketwocolumns}\oarg{s}\verb+[false]+ to disable it.
1874 % \end{itemize}
1875 % \subsubsection{Endnotes in one paragraph}
1876 % \changes{v1.12.0}{2015/04/25}{Add \cs{Xendparagraph} and related settings.}
1877 % \DescribeMacro{\Xendparagraph}
1878 % By default, any new endnote starts a new paragraph.
1879 % Use \cs{Xendparagraph}\oarg{series} to have all end notes of one given series set in one paragraph.
1880 %
1881 % \DescribeMacro{\Xendafternote}
1882 % You can add some space after a endnote series by using \cs{Xendafternote}\oarg{s}\marg{l}. The default value is \verb|1em plus.4em minus.4em|.
1883 %
1884 % \DescribeMacro{\Xendsep}
1885 % you can choose the separator between each note by \cs{Xendsep}\oarg{s}\marg{text}. A common separator is the double pipe (\verb+$||$+), which you can set by using \cs{Xendsep}\verb+{$\parallel$}+.
1886 % \subsection{Fonts}\label{fonts}
1887 % One of the most important features of the appearance of the notes,
1888 % and indeed of your whole document, will be the fonts used. We will
1889 % first describe the commands that give you control over the
1890 % use of fonts in the different structural elements of the document,
1891 % especially within the notes, and then in
1892 % subsequent sections specify how these commands are used.
1893 %
1894 % For those who are setting up for a large job, here is
1895 % a list of the complete set of \Eledmac{} macros relating to fonts that
1896 % are intended for manipulation by the user:
1897 % \cs{endashchar},
1898 % \cs{fullstop},
1899 % \cs{numlabfont}, and
1900 % \cs{rbracket}.
1901 %
1902 %
1903 % \DescribeMacro{\numlabfont}
1904 % Line numbers for the main text
1905 % are usually printed in a smaller font in the margin.
1906 % The \cs{numlabfont} macro is provided as a standard name for
1907 % that font: it is initially defined as \\
1908 % \verb"\newcommand{\numlabfont}{\normalfont\scriptsize}" \\
1909 % You might wish to use a different font if, for example,
1910 % you preferred to have these line numbers printed using
1911 % old-style numerals.
1912 %
1913 %
1914 %
1915 % \DescribeMacro{\endashchar}
1916 % \DescribeMacro{\fullstop}
1917 % \DescribeMacro{\rbracket}
1918 % \font\teni=cmmi10
1919 % A relatively trivial matter relates to punctuation. In your
1920 % footnotes, there will sometimes be spans of line numbers like
1921 % this: 12--34, or lines with sub-line numbers like this: 55.6. The
1922 % en-dash and the full stop are taken from the same font as the
1923 % numbers, and it all works nicely. But what if you wanted to use
1924 % old-style numbers, like {\teni12} and {\teni34}? These look nice
1925 % in an edition, but when you use the fonts provided by \PlainTeX\
1926 % they are taken from a math font which does not
1927 % have the en-dash or full stop in the same places as a text font.
1928 % If you (or your macros) just typed \verb"$\oldstyle 12--34$" or
1929 % \verb"$\oldstyle 55.6$" you would get `{\teni12--34}'and
1930 % `{\teni55.6}'. So we define \cs{endashchar} and
1931 % \cs{fullstop}, which produce an en-dash and a full stop
1932 % respectively from the normal document font, whatever font you are using
1933 % for the numbers. These two macros are used in the
1934 % macros which format the line numbers in the margins and
1935 % footnotes, instead of explicit punctuation.
1936 % We also define an \cs{rbracket} macro for the
1937 % right square bracket printed at the end of the lemma in many
1938 % styles of textual notes (including \Eledmac's standard style).
1939 % For polyglossia, when the lemma is RTL, the bracket automatically switches to a left bracket.
1940 %
1941 %
1942 %
1943 % \DescribeMacro{\select@lemmafont}
1944 % We will briefly discuss \cs{select@lemmafont}
1945 % here because it is important to know about
1946 % it now, although it is not one of the macros you would expect to
1947 % change in the course of a simple job. Hence it is `protected'
1948 % by having the @-sign in its name.
1949 %
1950 % When you use the \cs{edtext} macro to mark a word in your text
1951 % as a lemma, that word will normally be printed again in your
1952 % apparatus. If the word in the text happens to be in a font such
1953 % as italic or bold you would probably expect it to appear in the
1954 % apparatus in the same font. This becomes an absolute necessity
1955 % if the font is actually a different script, such as Arabic or
1956 % Cyrillic. \cs{select@lemmafont} does the work of
1957 % decoding \Eledmac's data about the fonts used to print the lemma in
1958 % the main text and calling up those fonts for printing the lemma in
1959 % the note.
1960 %
1961 % \cs{select@lemmafont} is a macro that takes one long
1962 % argument---the cluster of line numbers passed to the note
1963 % commands. This cluster ends with a code indicating what
1964 % fonts were in use at the start of the lemma.
1965 % \cs{select@lemmafont} selects the appropriate font for the
1966 % note using that font specifier.
1967 %
1968 % \Eledmac{} uses \cs{select@lemmafont} in a standard footnote
1969 % format macro called \cs{normalfootfmt}. The footnote formats
1970 % for each of the layers \texttt{A} to \texttt{E} are \cs{let} equal
1971 % to \cs{normalfootfmt}. So all the layers of the footnotes are
1972 % formatted in the same way.
1973 %
1974 %
1975 % \subsection{Changing series}
1976 % \subsubsection{Create a new series}\label{newseries}
1977 %
1978 % If you need more than six series of critical footnotes you can
1979 % create extra series, using \cs{newseries} command. For example to create G and H series \cs{newseries}\verb+G,H+.
1980 %
1981 % \subsubsection{Delete series}
1982 % As the number of series which are defined increases, \Eledmac{} gets slower.
1983 % If you do not need all of the six standard series (A, B, C, D, E, Z),
1984 % you can load the package with the \verb+series+ option.
1985 % For example if you need only series~A and~B, use:
1986 % \begin{verbatim}
1987 % \usepackage[series={A,B}]{eledmac}
1988 % \end{verbatim}
1989 % \subsubsection{Series order}
1990 % The default series order is the one called with the \verb+series+ option of the package, or, if this option is not used, A, B, C, D, E, Z.
1991 % Series order determines footnotes order.
1992 %
1993 % \DescribeMacro{seriesatbegin}\DescribeMacro{seriesatend} However in some specific cases, you need to change the series order at some point inside the document.
1994 % You can use \cs{seriesatbegin}\marg{<s>} to pull up a given series \verb+<s>+ to the beginning, or \cs{seriesatend}\marg{<s>} to push it down to the end.
1995 % \section{Verse}\label{verse}
1996 %
1997 %
1998 % In 1992 Wayne Sullivan\footnote{Department of Mathematics,
1999 % University College,
2000 % Dublin 4, Ireland}
2001 % wrote the \edstanza{} macros~\cite{EDSTANZA}
2002 % for typesetting verse in a critical edition. More specifically
2003 % they were for handling poetry stanzas which use indentation to
2004 % indicate rhyme or metre.
2005 %
2006 % With Wayne Sullivan's\index{Sullivan, Wayne} permission the majority
2007 % of this section has
2008 % been taken from~\cite{EDSTANZA}. Peter has made a few changes to enable his
2009 % macros to be used in the \LaTeX\ \Lpack{ledmac}, and now in \Lpack{eledmac}.
2010 % package.
2011 %
2012 %
2013 % \DescribeMacro{\stanza}
2014 % \DescribeMacro{\&}
2015 % Use \verb?\stanza? at the start of a stanza. Each line in a stanza
2016 % is ended by an ampersand (\&), and the stanza itself is ended
2017 % by putting \verb?\&? at the end of the last line.
2018 %
2019 %
2020 % \DescribeMacro{\stanzaindentbase}
2021 % Lines within a stanza may be indented. The indents are integer multiples
2022 % of the length \verb?\stanzaindentbase?, whose default value is 20pt.
2023 %
2024 % \DescribeMacro{\setstanzaindents}
2025 % In order to use the stanza macros, \textbf{one must set the indentation values}.
2026 % First the value of \verb+\stanzaindentbase+ should be set,
2027 % unless the default value 20pt is desired.
2028 % Every stanza line indentation is a multiple of this.
2029 %
2030 % To specify these
2031 % multiples one invokes, for example \\
2032 % \verb+\setstanzaindents{3,1,2,1,2}+. \\
2033 %
2034 % The numerical entries must be whole numbers, 0 or greater, separated by
2035 % commas without embedded spaces. The first entry
2036 % gives the hanging indentation to be used if the stanza line requires more
2037 % than one print line.
2038 %
2039 % If it is known that each stanza line will fit on more than one print line,
2040 % then this first entry should be 0; \TeX\ does less
2041 % work in this case, but no harm ensues if the hanging indentation is not
2042 % 0 but is never used.
2043 %
2044 % If you want the hanging verse to be flush right,
2045 % you can use \cs{hanginsymbol}: see p.~\reff{hfillhanging}.
2046 %
2047 % Enumeration is by stanza lines, not by print lines.
2048 % In the above example the lines are indented one unit, two units, one unit,
2049 % two units, with 3 units of hanging indentation in case a stanza line is too
2050 % long to fit on one print line.
2051 %
2052 % \subsection{Repeating stanza indents}
2053 %\changes{v0.13.0}{2011/11/08}{New stanzaindentsrepetition counter to repeat stanza indents every \emph{n} verses.}
2054 % \label{stanzaindentsrepetition}Since version 0.13, if the indentation is repeated every \emph{n} verses of the stanza, you can define only the \emph{n} first indentations, and say they are repeated, defining the value of the \verb+stanzaindentsrepetition+ counter at \emph{n}. For example:
2055 %\begin{verbatim}
2056 %\setstanzaindents{5,1,0}
2057 %\setcounter{stanzaindentsrepetition}{2}
2058 % \end{verbatim}
2059 %
2060 % is like
2061 %\begin{verbatim}
2062 %\setstanzaindents{0,1,0,1,0,1,0,1,0,1,0}
2063 % \end{verbatim}
2064 %
2065 % \textbf{Be careful: the feature is changed in eledmac 1.5.1. See \reff{change151}.}
2066 %
2067 %If you don't use the \verb+stanzaindentsrepetition+ counter, make sure you have at least one more numerical
2068 % entry in \verb+\setstanzavalues+ than the number of lines in the stanza.
2069 %
2070 % If you want to disable this feature again, just put the counter to 0:
2071 % \begin{verbatim}
2072 % \setcounter{stanzaindentsrepetition}{0}
2073 % \end{verbatim}
2074 % The macros make no restriction on the number of lines in a stanza.
2075 % Stanza indentation values (and penalty values) obey \TeX's grouping
2076 % conventions, so if one stanza among several has a different structure,
2077 % its indentations (penalties) may be set within a group; the prior values
2078 % will be restored when the group ends.
2079 %
2080 % \subsection{Manual stanza indent}
2081 % \DescribeMacro{\stanzaindent}
2082 % \DescribeMacro{\stanzaindent*}
2083 % You can set the indent of some specific verse by calling \cs{stanzaindent}\marg{value} at the beginning of the verse, before any other character. In this case, the indent defined by \cs{setstanzaindents} for this verse is skipped, and \marg{value} is used instead.
2084 %
2085 % If you use the mechanism of indent repetition, the next verse will be printed as it should be even if the current verse would have its normal indent value.
2086 % In other words, using \cs{stanzaindent} in a verse does not shift the indent repetition.
2087 %
2088 % However, if you want to shift the indent repetition, so the next verse has the indent normally used for the current verse, use \cs{stanzaindent*} instead of \cs{stanzaindent}.
2089 % \subsection{Stanza breaking}
2090 % \DescribeMacro{\setstanzapenalties}
2091 % When the stanzas run over several pages, it is often
2092 % desirable that page breaks should arise between certain lines in the
2093 % stanza, so a facility for including penalties after stanza lines is
2094 % provided. If you are satisfied with the page breaks, you need not set the
2095 % penalty values.
2096 %
2097 % The command \\
2098 % \verb+\setstanzapenalties{1,5000,10100,5000,0}+ \\
2099 % results in a penalty of
2100 % 5000 being placed after the first and third lines of the stanza, and a
2101 % penalty of ${-100}$ after the second.
2102 %
2103 % The first entry ``1'' is a control
2104 % value. If it is zero, then no penalties are passed on to \TeX,
2105 % which is the default. Values between 0 and 10000 are penalty
2106 % values; values between 10001 and 20000 have 10000 subtracted and the result
2107 % is given as a negative penalty. The mechanism used for indentations and
2108 % penalties requires unsigned values less than 32768. No penalty is placed
2109 % after the last line, so the final \verb+,0+ in then example above could
2110 % be omitted. The control sequence \verb+\endstanzaextra+ can be defined to
2111 % include a penalty. A penalty of 10000 will prevent a page break; such a
2112 % penalty is included automatically where there is stanza hanging indentation.
2113 % A penalty of ${-10000}$ (corresponding to the entry value 20000 in this
2114 % context) forces a page break. Values in between act as suggestions as to the
2115 % desirability of a page break at a given line. There is a subtle interaction
2116 % between penalties and \textit{glue}, so it may take some adjustment of skips
2117 % and penalties to achieve the best results.
2118 % \subsection{Hanging symbol}
2119 % It's possible to insert a symbol in each line of hanging verse, as in French typography for `['. To insert in eledmac, redefine macro \DescribeMacro{\hangingsymbol}\cmd{\hangingsymbol} with this code:
2120 % \begin{verbatim}
2121 % \renewcommand{\hangingsymbol}{[\,}
2122 % \end{verbatim}
2123 % \label{hfillhanging} You can also use it to force hanging verse to be flush right:
2124 % \begin{verbatim}
2125 % \renewcommand{\hangingsymbol}{\protect\hfill}
2126 % \end{verbatim}
2127 % \subsection{Long verse and page break}
2128 % If you want to prevent page breaks inside long verses, use the option \verb+nopbinverse+ when loading package, or use \cs{lednopbinversetrue}.
2129 % Read \reff{lednopbinversetrue} for further details.
2130 % \subsection{Various tools}
2131 % \DescribeMacro{\ampersand}
2132 % If you need to print an \& symbol in a stanza, use the \verb?\ampersand?
2133 % macro, not \verb?\&? which will end the stanza.
2134 %
2135 % \DescribeMacro{\endstanzaextra}
2136 % The macro \verb?\endstanzaextra?, if it is defined, is
2137 % called at the end of a stanza. You could define this, for example,
2138 % to add extra space between stanzas (by default there is no extra
2139 % space between stanzas); if you are using the \Lpack{memoir} class,
2140 % it provides a length \verb?\stanzaskip? which may come in handy.
2141 %
2142 % \DescribeMacro{\startstanzahook}
2143 % Similarly, if \verb?\startstanzahook? is defined, it is called by
2144 % \verb?\stanza? at the
2145 % start. This can be defined to do something.
2146 %
2147 % \DescribeMacro{\flagstanza}
2148 % Putting \cs{flagstanza}\oarg{len}\marg{text} at the start of a line
2149 % in a stanza (or elsewhere) will typeset \meta{text} at a
2150 % distance \meta{len} before
2151 % the line. The default \meta{len} is \verb?\stanzaindentbase?.
2152 %
2153 % For example, to put a verse number before the first line of a stanza
2154 % you could proceed along the lines:
2155 % \begin{verbatim}
2156 % \newcounter{stanzanum}
2157 % \setcounter{stanzanum}{0}
2158 % \newcommand*{\startstanzahook}{\refstepcounter{stanzanum}}
2159 % \newcommand{\numberit}{\flagstanza{\thestanzanum}}
2160 % ...
2161 % \stanza
2162 % \numberit First line...&
2163 % rest of stanza\&
2164 %
2165 % \stanza
2166 % \numberit First line, second stanza...
2167 % \end{verbatim}
2168 % \subsection{Hanging symbol}
2169 %It's possible to insert a symbol on each line of hanging verse, as in French typography for `['. To insert in eledmac, redefine macro \DescribeMacro{\hangingsymbol}\cmd{\hangingsymbol} with this code:
2170 %\begin{verbatim}
2171 %\renewcommand{\hangingsymbol}{[\,}
2172 %\end{verbatim}
2173 % \subsection{Text before/after verses}
2174 % It is possible to add text, like a subtitle, before or after verse:
2175 % \begin{itemize}
2176 % \item \cs{stanza} command can take a optional argument (in brackets). Its content will be printed before the stanza.
2177 % \item \verb+&+ can be replaced by \cs{newverse} with two optional arguments (in brackets). The first will be printed after the current verse, the second before the next verse.
2178 % \item \verb+\&+ can take a optional argument (in brackets). Its content will be printed after the stanza.
2179 % \end{itemize}
2180 % \section{Grouping}
2181 % In a \verb?minipage? environment \LaTeX\ changes \verb?\footnote? numbering from
2182 % arabic to alphabetic and puts the footnotes at the end of the minipage.
2183 %
2184 % \DescribeEnv{minipage}
2185 % You can put numbered text with critical footnotes in a minipage and
2186 % the footnotes are set at the end of the minipage.
2187 %
2188 % You can also put familiar footnotes (see section~\ref{sec:desc:familiar})
2189 % in a minipage but unlike with \verb?\footnote? the numbering scheme is
2190 % unaltered.
2191 %
2192 % \DescribeEnv{ledgroup}\label{ledgroup}
2193 % Minipages, of course, aren't broken across pages. Footnotes in a \verb?ledgroup?
2194 % environment are typeset at the end of the environment, as with minipages,
2195 % but the environment includes normal page breaks. The environment makes no
2196 % change to the textwidth so it appears as normal text; it just might be that
2197 % footnotes appear in the middle of a page, with text above and below.
2198 %
2199 % \DescribeEnv{ledgroupsized}
2200 % The \verb?ledgroupsized? environment is similar to \verb?ledroup? except that
2201 % you must specify a width for the environment, as with a minipage. \\
2202 % \verb?\begin{ledgroupsized}?\oarg{pos}\marg{width}.
2203 %
2204 % The required \meta{width} argument is the text width for the environment. The
2205 % optional \meta{pos} argument is for positioning numbered text within
2206 % the normal textwidth. It may be one of the characters:
2207 % \begin{itemize}
2208 % \item[l] (left) numbered text is flush left with respect to the normal
2209 % textwidth. This is the default.
2210 % \item[c] (center) numbered text is in the center of the textwidth.
2211 % \item[r] (right) numbered text is flush right with respect to the
2212 % normal textwidth.
2213 % \end{itemize}
2214 % Note that normal text, footnotes, and so forth are all flush left.
2215 %
2216 % \verb?\begin{ledgroupsized}{\textwidth}? is effectively the same as
2217 % \verb?\begin{ledgroup}?
2218 %
2219 %
2220 %
2221 % \section{Crop marks}
2222 %
2223 % The \Lpack{\eledmac} package does not provide crop marks. These are
2224 % available with either the \Lclass{memoir} class~\cite{MEMOIR} or the \Lpack{crop}
2225 % package.
2226 %
2227 %
2228 %
2229 % \section{Cross referencing}
2230 % \changes{v1.12.0}{2014/08/05}{Add hyperlink to crossref (needs \Lpack{hyperref} package).}
2231 % \label{crossref}\relax
2232 % The package provides a simple cross-referencing facility that allows
2233 % you to mark places in the text with labels, and generate page and
2234 % line number references to those places elsewhere
2235 % using those labels.
2236 %
2237 % \subsection{Basic use}
2238 %
2239 % \DescribeMacro{\edlabel}
2240 % First you place a label in the text using the command
2241 % \cs{edlabel}\marg{lab}. \meta{lab} can be almost anything you like, including
2242 % letters, numbers, punctuation, or a combination---anything but spaces;
2243 % you might say \verb"\edlabel{toves-3}", for example.\footnote{More precisely,
2244 % you should stick to characters in the \TeX\ categories of `letter'
2245 % and `other'.}
2246 %
2247 % \DescribeMacro{\edpageref}
2248 % \DescribeMacro{\edlineref}
2249 % \DescribeMacro{\sublineref}
2250 % \DescribeMacro{\pstartref}
2251 % Elsewhere in the text, either before or after the \cs{edlabel},
2252 % you can refer to its location via \cs{edpageref}\marg{lab}, or
2253 % \cs{edlineref}\marg{lab}\footnote{Previously, the \cs{edlineref} command was \cs{lineref}. But some packages also define \cs{lineref}. That is why you should use \cs{edlineref} insteaf of \cs{lineref}. \Lpack{eledmac} defines \cs{lineref} as equal to \cs{edlineref}, except if one package has also defined a \cs{lineref} command.}, \cs{sublineref}\marg{lab}, or \cs{pstartref}\marg{lab}. These commands
2254 % will produce, respectively, the page, line, sub-line and pstart on which
2255 % the \cs{edlabel}\marg{lab} command occurred.
2256 %
2257 %
2258 % An \cs{edlabel} command may appear in the main text, or in the
2259 % first argument of \cs{edtext}, but not in the apparatus itself. But
2260 % \cs{edpageref}, \cs{edlineref}, \cs{sublineref}, \cs{pstartref} commands can also be used in
2261 % the apparatus to refer to \cs{edlabel}s in the text.
2262 %
2263 % The \cs{edlabel} command works by writing macros to \LaTeX
2264 % \file{.aux} file. You will need to process
2265 % your document through \LaTeX\ twice in order for the references to
2266 % be resolved.
2267 %
2268 % You will be warned if you say \verb"\edlabel{foo}" and \verb"foo"
2269 % has been used as a label before. The \verb"ref" commands will
2270 % return references to the last place in the file marked with this
2271 % label. You will also be warned if a reference is made to an
2272 % undefined label. (This will also happen the first time you
2273 % process a document after adding a new \cs{edlabel} command: the
2274 % auxiliary file will not have been updated yet.)
2275 %
2276 % If you want to refer to a word inside an
2277 % \verb"\edtext{...}{...}" command, the \cs{edlabel} should be defined inside
2278 % the first argument, e.g.,
2279 % \begin{verbatim}
2280 % The \edtext{creature\edlabel{elephant} was quite
2281 % unafraid}{\Afootnote{Of the mouse, that is.}}
2282 % \end{verbatim}
2283 %
2284 % If you add the \cs{edlabel} inside some \cs{Xfootnote} command,
2285 % it will refer to that note, and a suffix \emph{n} will be added to the reference.
2286 % You can redefine this suffix by redefining the command \cs{ledinnotemark}.
2287 % Its actual definition is:
2288 % \begin{verbatim}
2289 % \newcommand{\ledinnotemark}[1]{#1\emph{n}}
2290 % \end{verbatim}
2291 % Where \verb+#1+ stands for the reference.
2292 % \DescribeMacro{\xpageref}
2293 % \DescribeMacro{\xlineref}
2294 % \DescribeMacro{\xsublineref}
2295 % \DescribeMacro{\xpstartref}
2296 % However, there are situations in which you'll want \Eledmac{} to
2297 % return a number without displaying any
2298 % warning messages about undefined labels or the like: if you want to
2299 % use the reference in a context where \LaTeX{} is looking for a
2300 % number, such a warning will lead to a complaint that the number
2301 % is missing. This is the case for references used within the
2302 % argument to \cs{linenum}, for example. For this situation,
2303 % three variants of the reference commands, with the \verb"x"
2304 % prefix, are supplied: \cs{xpageref}, \cs{xlineref}, \cs{xsublineref} and \cs{xpstartref}.
2305 % They have these limitations:
2306 % \begin{itemize}
2307 % \item They will not tell you if the label is undefined.
2308 % \item They must
2309 % be preceded in the file by at least one of the four other
2310 % cross-reference commands---e.g., a \verb"\edlabel{foo}" command,
2311 % even if you never refer to that label---since those commands can all
2312 % do the necessary processing of the \file{.aux} file, and the \cs{x...}
2313 % ones cannot.
2314 % \item When \Lpack{hyperref} is loaded, the hyperref link won't be added. (Indeed,
2315 % it's not a limitation, but a feature.)
2316 % \end{itemize}
2317 %
2318 % \DescribeMacro{\xxref}
2319 % The macros \cs{xxref} and
2320 % \cs{edmakelabel} let you manipulate numbers
2321 % and labels in ways which you may find helpful in tricky
2322 % situations.
2323 %
2324 % The \cs{xxref}\marg{lab1}\marg{lab2} command generates a reference to a sequence of
2325 % lines, for use in the second argument of \cs{edtext}.
2326 % It takes two arguments, both of which are
2327 % labels: e.g., \verb"\xxref{mouse}{elephant}". It calls \cs{linenum}
2328 % (q.v., \reff{linenum} above) and sets the beginning page,
2329 % line, and sub-line numbers to those of the place where
2330 % \verb"\edlabel{mouse}" was placed, and the ending numbers to those where
2331 % \verb"\edlabel{elephant}" occurs.
2332 %
2333 % \DescribeMacro{\edmakelabel}
2334 % Sometimes the \cs{edlabel} command cannot be used to specify exactly
2335 % the page and line desired---for example, if you want to refer to a
2336 % page and line number in another volume of your edition. In such
2337 % cases, you can use the \cs{edmakelabel}\marg{lab}\marg{numbers}
2338 % macro so that you can `roll your own' label.
2339 % For example, if you say `\verb"\edmakelabel{elephant}{10|25|0}"'
2340 % you will create a new
2341 % label, and a later call to \verb"\edpageref{elephant}" would print
2342 % `10' and \verb"\lineref{elephant}" would print `25'. The sub-line
2343 % number here is zero. It is usually best to collect your
2344 % \cs{edmakelabel} statements near the top of your document, so that
2345 % you can see them at a glance.
2346 % \subsection{Normal \LaTeX\ cross-referencing}
2347 % \DescribeMacro{\label}
2348 % \DescribeMacro{\ref}
2349 % \DescribeMacro{\pageref}
2350 % \changes{v0.2.1}{2003/08/25}{Added text about normal labeling}
2351 % The normal \cs{label}, \cs{ref} and \cs{pageref} macros may be used
2352 % within numbered text, and operate in the familiar fashion.
2353 % \subsection{References to lines commented in the apparatus}
2354 % \changes{v1.21.0}{2015/03/09}{Add \cs{applabel} and related}
2355 % You may want to make a cross-reference to a passage that is referred to by \cs{edtext}.
2356 % \Eledmac{} provides specific tools for this scenario.
2357 %
2358 % \DescribeMacro{\applabel}
2359 % If you use \cs{applabel}\marg{label} inside the second argument of a \cs{edtext},
2360 % \Eledmac\ will add a \cs{edlabel} at the beginning and end of the marked passage.
2361 % The label at the beginning of the passage will have the title \verb+<label>:start+, while the label at the end will have the title \verb+<label>:end+.
2362 %
2363 % If you use \cs{linenum} (\reff{linenum}) to
2364 % refer to these labels, \Eledmac\ will use your line settings to refer
2365 % to the passage.
2366 %
2367 % \DescribeMacro{\appref}\DescribeMacro{\apprefwithpage}
2368 % You can also use \cs{appref}\marg{label} and
2369 % \cs{apprefwithpage}\marg{label} to refer to these lines.
2370 % The first one will print the lines as they are printed in the critical footnotes,
2371 % while the second will print the lines as they are printed in endnotes.
2372 %
2373 % \DescribeMacro{\apprefprefixsingle}\DescribeMacro{\apprefprefixmore}
2374 % If you redefine \cs{apprefprefixsingle}, its content will be printed
2375 % before the line numbers of a \cs{appref}-reference.
2376 % If you redefine \cs{apprefprefixmore}, its content will be printed
2377 % before the line numbers, if you refer to more than one line.
2378 %
2379 % For example, you may use:
2380 % \begin{verbatim}
2381 % \renewcommand{\apprefprefixsingle}{line~}
2382 % \renewcommand{\apprefprefixmore}{lines~}
2383 % \end{verbatim}
2384 %
2385 % Note that if \cs{apprefprefixmore} is empty, \cs{apprefprefixsingle} will used in any case.
2386 %
2387 % \DescribeMacro{\twolinesappref}
2388 % \DescribeMacro{\morethantwolinesappref}
2389 % \DescribeMacro{\twolinesbutnotmoreappref}
2390 % \DescribeMacro{\twolinesonlyinsamepage}
2391 % If you use \cs{twolines}, \cs{morethantwolines}, \cs{twolinesbutnotmore} and/or \cs{twolinesonlyinsamepage}
2392 % (\reff{twolines}) \emph{without the optional
2393 % series argument}, the setting will also be available for \cs{appref}.
2394 %
2395 % The commands \cs{twolinesappref}\marg{text},
2396 % \cs{morethantwolinesappref}\marg{text}, \cs{twolinesbutnotmoreappref} \cs{twolinesonlyinsamepageappref} can also be used, if you
2397 % only want to change the reference style of \cs{appref}.
2398 %
2399 % It is possible to disable this setting for a specific \cs{appref} command by
2400 % using \cs{appref}\verb+[fulllines]+\marg{label}.
2401 %
2402 %
2403 % \DescribeMacro{\Xendtwolinesapprefwithpage}
2404 % \DescribeMacro{\Xendmorethantwolinesapprefwithpage}
2405 % \DescribeMacro{\Xendtwolinesbutnotmoreapprefwithpage}
2406 % \DescribeMacro{\Xendtwolinesonlyinsamepageapprefwithpage}
2407 % If you use one of \cs{Xendtwolines}, \cs{Xendmorethantwolines}, \cs{Xendtwolinesbutnotmore},
2408 % \cs{Xendtwolinesonlyinsamepage})
2409 % (\reff{Xendtwolines}) \emph{without the optional
2410 % series argument}, the setting will also be available for \cs{apprefwithpage}.
2411 %
2412 % The commands \cs{Xendtwolinesappref}\marg{text},
2413 % \cs{Xendmorethantwolinesappref}\marg{text}, \cs{Xendtwolinesbutnotmoreappref}, \cs{Xendtwolinesonlyinsamepageappref} can also be used, if you
2414 % only want to change the reference style of \cs{apprefwithpage}.
2415 %
2416 % It is possible to disable this setting for a specific \cs{apprefwithpage} command by
2417 % using \cs{apprefwithpage}\verb+[fulllines]+\marg{label}.
2418 %
2419 % \section{Side notes}
2420 %
2421 %
2422 % The \cs{marginpar} command does not work in numbered text. Instead
2423 % the package provides for non-floating sidenotes in either margin.
2424 %
2425 % \DescribeMacro{\ledinnernote}
2426 % \DescribeMacro{\ledouternote}
2427 % \cs{ledinnernote}\marg{text} will put \meta{text} into the inner margin level
2428 % with where the command was issued. Similarly, \cs{ledouternote}\marg{text}
2429 % puts \meta{text} in the outer margin.
2430 %
2431 % \changes{v1.12.0}{2014/08/05}{Add \cs{ledinnernote} and \cs{ledouternote} commands.}
2432 % \changes{v1.12.3}{2014/08/15}{Debug \cs{ledinnernote} and \cs{ledouternote} commands in the top of pages.}
2433 % \DescribeMacro{\ledleftnote}
2434 % \DescribeMacro{\ledrightnote}
2435 % \changes{v1.0.0}{2012/09/15}{Possibility to have commands in sidenotes.}
2436 % \DescribeMacro{\ledsidenote}
2437 % \DescribeMacro{\sidenotemargin}
2438 % \cs{ledsidenote}\marg{text} will put \meta{text} into the margin specified
2439 % by the current setting of \cs{sidenotemargin}\marg{location}. The
2440 % permissible value for \meta{location} is one out of the list
2441 % \texttt{left}, \texttt{right}, \texttt{inner}, or \texttt{outer}, for
2442 % example \verb?\sidenotemargin{outer}?. The package's default setting
2443 % is \\
2444 % \verb?\sidenotemargin{right}? \\
2445 % to typeset \cs{ledsidenote}s in the right hand margin. This is the opposite
2446 % to the default margin for line numbers. The style for a \cs{ledsidenote}
2447 % follows that for a \cs{ledleftnote} or a \cs{ledrightnote} depending
2448 % on the margin it is put in.
2449 %
2450 % If two, say, \cs{ledleftnote}, commands are called in the same line the
2451 % second \meta{text} will obliterate the first. There is no problem though with
2452 % having both a left and a right sidenote on the same line.
2453 %
2454 % \DescribeMacro{\ledlsnotewidth}
2455 % \DescribeMacro{\ledrsnotewidth}
2456 % The left sidenote text is put into a box of width \cs{ledlsnotewidth}
2457 % and the right text into a box of width \cs{ledrsnotewidth}. These
2458 % are initially set to the value of \cs{marginparwidth}.
2459 %
2460 %
2461 % \DescribeMacro{\rightnoteupfalse}
2462 % \DescribeMacro{\leftnoteupfalse}
2463 % By default, Sidenotes are placed to align with the last line of the note to which it refers.
2464 % If you want they to be placed to align with the first line of the note to which it refers, use \cs{leftnoteupfalse} (for left note) and/or \cs{rightnoteupfalse} (for right note).
2465 %
2466 % \DescribeMacro{\ledlsnotesep}
2467 % \DescribeMacro{\ledrsnotesep}
2468 % The texts are put a distance \cs{ledlsnotesep} (or \cs{ledrsnotesep})
2469 % into the left (or right) margin. These lengths are initially set to
2470 % the value of \cs{linenumsep}.
2471 %
2472 % \DescribeMacro{\ledlsnotefontsetup}
2473 % \DescribeMacro{\ledrsnotefontsetup}
2474 % These macros specify how the sidenote texts are to be typeset. The
2475 % initial definitions are:
2476 % \begin{verbatim}
2477 % \newcommand*{\ledlsnotefontsetup}{\raggedleft\footnotesize}% left
2478 % \newcommand*{\ledrsnotefontsetup}{\raggedright\footnotesize}% right
2479 % \end{verbatim}
2480 % These can of course be changed to suit.
2481 %
2482 % \DescribeMacro{\sidenotesep}
2483 % If you have two or more sidenotes for the same line, they are separated by a comma.
2484 % But if you want to change this separator, you can redefine the macro \cs{sidenotesep}.
2485 % \section{Familiar footnotes} \label{sec:desc:familiar}
2486 %
2487 %
2488 % The \Lpack{footmisc} package~\cite{FOOTMISC} by Robin
2489 % Fairbairns\index{Fairbairns, Robin} has an option whereby
2490 % sequential footnote
2491 % marks in the text can be separated by
2492 % commas\textsuperscript{3,4} like so.
2493 % As a convenience \Eledmac{} provides this automatically.
2494 %
2495 % \DescribeMacro{\multfootsep}
2496 % \cs{multfootsep} is used as the separator between footnote markers.
2497 % Its default definition is: \\
2498 % \verb?\providecommand*{\multfootsep}{\textsuperscript{\normalfont,}}? \\
2499 % and can be changed if necessary.
2500 %
2501 % \DescribeMacro{\footnoteA}
2502 % \DescribeMacro{\footnoteB}
2503 % \DescribeMacro{\footnoteC}
2504 % \DescribeMacro{\footnoteD}
2505 % \DescribeMacro{\footnoteE}
2506 % \DescribeMacro{\footnoteZ}
2507 % As well as the standard \LaTeX\ footnotes generated via \cs{footnote},
2508 % the package also provides
2509 % six series of additional footnotes called \cs{footnoteA} through
2510 % \cs{footnoteZ}. These have the familiar marker in the text, and
2511 % the marked text at the foot of the page can be formated using
2512 % any of the styles described for the critical footnotes. Note that
2513 % the `regular' footnotes have the series letter at the end of the macro
2514 % name whereas the critical footnotes have the series letter at the start
2515 % of the name.
2516 %
2517 % \DescribeMacro{\footnormalX}
2518 % \DescribeMacro{\footparagraphX}
2519 % \DescribeMacro{\foottwocolX}
2520 % \DescribeMacro{\footthreecolX}
2521 % Each of the \verb?\foot...X? macros takes one argument which is the
2522 % series letter (e.g., \texttt{B}). \cs{footnormalX} is the typical
2523 % footnote format. With \cs{footparagraphX} the series is typeset as one
2524 % paragraph, with \cs{foottwocolX} the notes are set in two columns, and are
2525 % set in three columns with \cs{footthreecolX}.
2526 %
2527 % \DescribeMacro{\thefootnoteA}
2528 % \DescribeMacro{\bodyfootmarkA}
2529 % \DescribeMacro{\footfootmarkA}
2530 % As well as using the \verb?\foot...X? macros to specify the general
2531 % footnote arrangement for a series, each series uses a set of macros for
2532 % styling the marks. The mark numbering scheme is defined by the
2533 % \cs{thefootnoteA} macro; the default is: \\
2534 % \verb?\renewcommand*{\thefootnoteA}{\arabic{footnoteA}}?\\
2535 % The appearance of the mark in the text is controlled by \cs{bodyfootmarkA}
2536 % which is defined as: \\
2537 % \verb?\newcommand*{\bodyfootmarkA}{%? \\
2538 % \verb? \hbox{\textsuperscript{\normalfont\@nameuse{@thefnmarkA}}}}? \\
2539 % The command \cs{footfootmarkA} controls the appearance of the mark at the
2540 % start of the footnote text. It is defined as: \\
2541 % \verb?\newcommand*{\footfootmarkA}{\textsuperscript{\@nameuse{@thefnmarkA}}}?
2542 %
2543 % There are similar command triples for the other series.
2544 %
2545 % Additional footnote series can be easily defined: you just have to use \cs{newseries}, defined above (see \reff{newseries}).
2546 %
2547 % \subsection{Position of the familiar footnotes}
2548 % \DescribeMacro{\fnpos}\DescribeMacro{\mpfnpos}
2549 % There is a historical incoherence in \Lpack{(e)ledmac}. The familiar footnotes are
2550 % before the critical footnotes in a normal page, but after in a minipage or in a ledgroup.
2551 % However, it is possible to change the relative position of both types of footnotes.
2552 % If you want to have familiar footnotes after critical footnotes in a normal page, use:
2553 % \begin{verbatim}
2554 % \fnpos{critical-familiar}
2555 % \end{verbatim}
2556 % Or, if you want a minipage or ledgroup to have critical footnotes after familiar footnotes, use:
2557 % \begin{verbatim}
2558 % \mpfnpos{familiar-critical}
2559 % \end{verbatim}
2560 % \section{Indexing}
2561 %
2562 % \DescribeMacro{\edindex}
2563 % \LaTeX\ provides the |\index|\marg{item} command for specifying that \meta{item}
2564 % and the current page number should be added to the raw index (\file{idx}) file.
2565 % The |\edindex|\marg{item} macro can be used in numbered text to specify
2566 % that \meta{item} and the current page \& linenumber should be added to
2567 % the raw index file.
2568 %
2569 % Note that the file \verb+.idx+ will contain the right reference only after the third run, because of the internal indexing mechanism of \Lpack{eledmac}.
2570 % That means you must first run three times (Xe/Lua)\LaTeX, then run \verb+makeindex+ and finally run again (Xe/Lua)\LaTeX to get an index with the right page numbers.
2571 %
2572 % If the \Lclass{memoir} class or the \Lpack{imakeidx} or \Lpack{indextools} package is used then the macro takes an optional
2573 % argument, which is the name of a raw index file. For example
2574 % |\edindex[line]{item}| will use |line.idx| as the raw file instead of
2575 % |\jobname.idx|.
2576 %
2577 % The minimal version of \Lpack{imakeidx} package to be used is the version 1.3a uploaded on CTAN on 2013/07/11.
2578 %
2579 % Be careful with the order of package loading and index declaration. You must use this order:
2580 % \begin{enumerate}
2581 % \item Load \Lpack{imakeidx} or \Lpack{indextools} .
2582 % \item Load \Lpack{eledmac}.
2583 % \item Declare the index with the macro \cs{makeindex} of \Lpack{imakeidx}/\Lpack{indextools}.
2584 % \end{enumerate}
2585 % \DescribeMacro{\pagelinesep}
2586 % The page \& linenumber combination is written as |page\pagelinesep line|,
2587 % where the default definition is |\newcommand{\pagelinesep}{-}| so that
2588 % an item on page 3, line 5 will be noted as being at |3-5|. You can
2589 % renew |\pagelinesep| to get a different separator.
2590 %
2591 % |-| is the default
2592 % separator used by the \textsc{MakeIndex} program.
2593 %
2594 % Consequently, if you want to use an other \cs{pagelinesep}, you 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}.}.
2595 % \begin{verbatim}
2596 % page_compositor ":"
2597 % delim_r ":
2598 % \end{verbatim}
2599 %
2600 % Read the \textsc{MakeIndex} program's handbook about the \verb+.ist+ file.
2601 % \DescribeMacro{\edindexlab}
2602 % The |\edindex| process uses a |\label|/|\ref| mechanism to get
2603 % the correct line number. It automatically generates labels
2604 % of the form |\label{\edindexlab N}|, where N is a number, and
2605 % the default definition of |\edindexlab| is: \\
2606 % |\newcommand*{\edindexlab}{$&}| \\
2607 % in the hopes that this will not be used by any other labels
2608 % (|\edindex|'s labels are like |\label{$&27}|).
2609 % You can change |\edindexlab| to something else if you need to.
2610 %
2611 % \subsection{Using xindy}\label{xindy}
2612 % Should you decide to use \verb+xindy+ instead of \verb+makeindex+
2613 % to transform your \verb+.idx+ files into \verb+.ind+ files,
2614 % you must use some specific configuration file (\verb+.xdy+) so that
2615 % \verb+xindy+ can understand \Lpack{eledmac} reference syntax of which the scheme is:\\
2616 % \verb+pagenumber-linenumber+
2617 %
2618 % An example of such a file is provided in the ``\href{examples/.}{examples}'' folder.
2619 % Read the xindy handbook to learn how to use it.\footnote{Or, for people
2620 % who read French, read \url{http://geekographie.maieul.net/174}.}
2621 %
2622 % This file also provides, with an explanation, the settings that are needed to put
2623 % eledmac lines numbers in parenthesis, in order
2624 % to make a better distinction between line numbers and page ranges.
2625 %
2626 % In any case, you must load \Lpack{eledmac} with the \verb+xindy+ option,
2627 % in order to generate a \verb|.xdy| file which is specific to your document.
2628 % This file is needed by the \verb+.xdy+ example file which is in the ``\href{examples/.}{examples}'' folder.
2629 % Its default name is \verb+eledmac-markup-attr.xdy+,
2630 % but you can change it by using your own as an argument of the \verb|xindy+hyperref| option.
2631 %
2632 % If you chose to use both \verb+xindy+ and the \verb+hyperref+ package,
2633 % you must do three more things:
2634 % \begin{enumerate}
2635 % \item Use \verb|xindy+hyperref| option when loading the \Lpack{eledmac} package.
2636 % When you run (Xe/Lua)\LaTeX with this option, a \verb+.xdy+ configuration file will be generated with all the settings needed to allow internal hyperlinking in each index entry which is created by \cs{edindex}.
2637 % \item Use \verb+hyperindex=false+ option when loading hyperref.
2638 % \item Uncomment --- by removing the semicolons at the beginning of the relevant lines --- some lines in the <code>.xdy</code> file provided in the ``\href{examples/.}{examples}'' folder in order to restore internal links in the index to be used by the standard \verb+index+ command.\footnote{These are the recommended lines to provide the best possible compatibility between hyperref and xindy, even without using \Lpack{eledmac}.}.
2639 % \end{enumerate}
2640 % \section{Tabular material}
2641 %
2642 % \LaTeX's normal |tabular| and |array| environments cannot be used where
2643 % line numbering is being done; more precisely, they can be used but with
2644 % odd results, so don't use them. However, \eledmac{} provides some simple
2645 % tabulation environments that can be line numbered. The environments
2646 % can also be used in normal unnumbered text.
2647 %
2648 % \DescribeEnv{edarrayl}
2649 % \DescribeEnv{edarrayc}
2650 % \DescribeEnv{edarrayr}
2651 % \DescribeEnv{edtabularl}
2652 % \DescribeEnv{edtabularc}
2653 % \DescribeEnv{edtabularr}
2654 % There are six environments; the |edarray*| environments are for math
2655 % and |edtabular*| for text entries. The final |l|, |c|, or |r|
2656 % in the environment names indicate that the entries will be flushleft (|l|),
2657 % centered (|c|) or flushright (|r|). There is no means of specifying
2658 % different formats for each column, nor for specifying a fixed width for
2659 % a column. The environments are centered with respect to the surrounding text.
2660 %
2661 % \egstart
2662 % \begin{verbatim}
2663 % \begin{edtabularc}
2664 % 1 & 2 & 3 \\
2665 % a & bb & ccc \\
2666 % AAA & BB & C
2667 % \end{edtabularc}
2668 % \end{verbatim}
2669 % \egmid
2670 % \centering
2671 % \begin{tabular}{ccc}
2672 % 1 & 2 & 3 \\
2673 % a & bb & ccc \\
2674 % AAA & BB & C
2675 % \end{tabular}\par
2676 % \egend
2677 %
2678 % Entries in the environments are the same as for the normal
2679 % |array| and |tabular| environments but there must be no ending
2680 % \verb?\\? at the end of the last row.
2681 % \emph{There must be the same number of column designators (the \&)
2682 % in each row.} There is no equivalent
2683 % to any line drawing commands (such as \cs{hline}).
2684 % However, unlike the normal environments, the |ed...| environments
2685 % can cross page breaks.
2686 %
2687 % Macros like \cs{edtext} can be used as part of an entry.
2688 %
2689 % For example:
2690 % \begin{verbatim}
2691 % \beginnumbering
2692 % \pstart
2693 % \begin{edtabularl}
2694 % \textbf{\Large I} & wish I was a little bug\edindex{bug} &
2695 % \textbf{\Large I} & eat my peas with honey\edindex{honey} \\
2696 % & With whiskers \edtext{round}{\Afootnote{around}} my tummy &
2697 % & I've done it all my life. \\
2698 % & I'd climb into a honey\edindex{honey} pot &
2699 % & It makes the peas taste funny \\
2700 % & And get my tummy gummy.\edindex{gummy} &
2701 % & But it keeps them on the knife.
2702 % \end{edtabularr}
2703 % \pend
2704 % \endnumbering
2705 % \end{verbatim}
2706 % produces the following parallel pair of verses.
2707 %
2708 % \begin{center}
2709 % \setlength{\tabcolsep}{2pt}
2710 % \begin{tabular}{p{4em}rlrl}
2711 % {\footnotesize 1} & \textbf{\Large I} & wish I was a little bug &
2712 % \textbf{\Large I} & eat my peas with honey \\
2713 % {\footnotesize 2} & & With whiskers round my tummy &
2714 % & I've done it all my life. \\
2715 % {\footnotesize 3} & & I'd climb into a honey pot &
2716 % & It makes the peas taste funny \\
2717 % {\footnotesize 4} & & And get my tummy gummy. &
2718 % & But it keeps them on the knife.
2719 % \end{tabular}
2720 % \end{center}
2721 %
2722 %
2723 %
2724 %
2725 %
2726 % \DescribeMacro{\edtabcolsep}
2727 % The distance between the columns is controlled by the length |\edtabcolsep|.
2728 %
2729 % \DescribeMacro{\spreadmath}
2730 % \DescribeMacro{\spreadtext}
2731 % |\spreadmath|\marg{math} typesets \marg{math} but the \marg{math} has
2732 % no effect on the calculation of column widths.
2733 % |\spreadtext|\marg{text} is the analagous command for use in |edtabular|
2734 % environments.
2735 %
2736 % \egstart
2737 % \begin{verbatim}
2738 % \begin{edarrayl}
2739 % 1 & 2 & 3 & 4 \\
2740 % & \spreadmath{F+G+C} & & \\
2741 % a & bb & ccc & dddd
2742 % \end{edarrayl}
2743 % \end{verbatim}
2744 % \egmid
2745 % \begin{displaymath}
2746 % \begin{array}{llll}
2747 % 1 & 2 & 3 & 4 \\
2748 % & \multicolumn{3}{l}{F+G+C} \\
2749 % a & bb & ccc & dddd
2750 % \end{array}
2751 % \end{displaymath}
2752 % \egend
2753 %
2754 % \DescribeMacro{\edrowfill}
2755 % The macro |\edrowfill|\marg{start}\marg{end}\marg{fill}
2756 % fills columns number \meta{start} to \meta{end} inclusive with
2757 % \meta{fill}. The \meta{fill} argument can be any horizontal `fill'.
2758 % For example |\hrulefill| or |\upbracefill|.
2759 %
2760 % Note that every row must have the same number of columns, even if
2761 % some would not appear to be necessary.
2762 %
2763 % The |\edrowfill| macro can be used in both tabular and array environments.
2764 % The typeset appearance of the following code is shown below.
2765 % \begin{verbatim}
2766 % \begin{edtabularr}
2767 % 1 & 2 & 3 & 4 & 5 \\
2768 % Q & & fd & h & qwertziohg \\
2769 % v & wptz & x & y & vb \\
2770 % g & nnn & \edrowfill{3}{5}{\upbracefill} & & \\
2771 % \edrowfill{1}{3}{\downbracefill} & & & pq & dgh \\
2772 % k & & l & co & ghweropjklmnbvcxys \\
2773 % 1 & 2 & 3 & \edrowfill{4}{5}{\hrulefill} &
2774 % \end{tabularr}
2775 % \end{verbatim}
2776 %
2777 % \begin{center}
2778 % \begin{tabular}{rrrrr}
2779 % 1 & 2 & 3 & 4 & 5 \\
2780 % Q & & fd & h & qwertziohg \\
2781 % v & wptz & x & y & vb \\
2782 % g & nnn & \multicolumn{3}{c}{\upbracefill} \\
2783 % \multicolumn{3}{c}{\downbracefill} & pq & dgh \\
2784 % k & & l & co & ghweropjklmnbvcxys \\
2785 % 1 & 2 & 3 & \multicolumn{2}{c}{\hrulefill}
2786 % \end{tabular}
2787 % \end{center}
2788 %
2789 % You can also define your own `fill'. For example:
2790 % \begin{verbatim}
2791 % \newcommand*{\upbracketfill}{%
2792 % \vrule height 4pt depth 0pt\hrulefill\vrule height 4pt depth 0pt}
2793 % \end{verbatim}
2794 % is a fill like |\upbracefill| except it has the appearance of a
2795 % (horizontal) bracket instead of a brace. It can be used like
2796 % this:
2797 %
2798 % \newcommand*{\upbracketfill}{%
2799 % \vrule height 4pt depth 0pt\hrulefill\vrule height 4pt depth 0pt}
2800 %
2801 % \begin{verbatim}
2802 % \begin{edarrayc}
2803 % 1 & 2 & 3 & 4 \\
2804 % a & \edrowfill{2}{3}{\upbracketfill} & & d \\
2805 % A & B & C & D
2806 % \end{edarrayc}
2807 % \end{verbatim}
2808 %
2809 % \begin{displaymath}
2810 % \begin{array}{cccc}
2811 % 1 & 2 & 3 & 4 \\
2812 % a & \multicolumn{2}{c}{\upbracketfill} & d \\
2813 % A & B & C & D
2814 % \end{array}
2815 % \end{displaymath}
2816 %
2817 %
2818 %
2819 % \DescribeMacro{\edatleft}
2820 % \DescribeMacro{\edatright}
2821 % |\edatleft|\oarg{math}\marg{symbol}\marg{halfheight} typesets the math
2822 % \meta{symbol} as |\left<symbol>|
2823 % with the optional \meta{math} centered before it. The \meta{symbol} is
2824 % twice \meta{halfheight} tall. The |\edatright| macro is similar
2825 % and it typesets |\right<symbol>| with \meta{math} centered after it.
2826 %
2827 % \begin{verbatim}
2828 % \begin{edarrayc}
2829 % & 1 & 2 & 3 & \\
2830 % & 4 & 5 & 6 & \\
2831 % \edatleft[left =]{\{}{1.5\baselineskip}
2832 % & 7 & 8 & 9 &
2833 % \edatright[= right]{)}{1.5\baselineskip}
2834 % \end{edarrayc}
2835 % \end{verbatim}
2836 %
2837 % \begin{displaymath}
2838 % left = \left\{
2839 % \begin{array}{ccc}
2840 % 1 & 2 & 3 \\
2841 % 4 & 5 & 6 \\
2842 % 7 & 8 & 9
2843 % \end{array}
2844 % \right) = right
2845 % \end{displaymath}
2846 %
2847 %
2848 %
2849 % \DescribeMacro{\edbeforetab}
2850 % \DescribeMacro{\edaftertab}
2851 % |\edbeforetab|\marg{text}\marg{entry}, where \meta{entry} is an entry in the
2852 % leftmost column, typesets \meta{text} left justified before the \meta{entry}.
2853 % Similarly |\edaftertab|\marg{entry}\marg{text}, where \meta{entry} is an entry
2854 % in the rightmost column, typesets \meta{text} right justified after the
2855 % \meta{entry}.
2856 %
2857 % For example:
2858 % \begin{verbatim}
2859 % \begin{edarrayl}
2860 % A & 1 & 2 & 3 \\
2861 % \edbeforetab{Before}{B} & 1 & 3 & 6 \\
2862 % C & 1 & 4 & \edaftertab{8}{After} \\
2863 % D & 1 & 5 & 0
2864 % \end{edarrayl}
2865 % \end{verbatim}
2866 %
2867 %
2868 % \begin{displaymath}
2869 % \begin{array}{p{0.4\textwidth}llp{0.4\textwidth}}
2870 % \mbox{} \hfill $A$ & 1 & 2 & $3$ \\
2871 % Before \hfill $B$ & 1 & 3 & $6$ \\
2872 % \mbox{} \hfill $C$ & 1 & 4 & $8$ \hfill After \\
2873 % \mbox{} \hfill $D$ & 1 & 5 & $0$
2874 % \end{array}
2875 % \end{displaymath}
2876 %
2877 % \DescribeMacro{\edvertline}
2878 % \DescribeMacro{\edvertdots}
2879 % The macro |\edvertline|\marg{height} draws a vertical line \meta{height} high
2880 % (contrast this with |\edatright| where the size argument is half the desired
2881 % height).
2882 % \begin{verbatim}
2883 % \begin{edarrayr}
2884 % a & b & C & d & \\
2885 % v & w & x & y & \\
2886 % m & n & o & p & \\
2887 % k & & L & cvb & \edvertline{4pc}
2888 % \end{edarrayr}
2889 % \end{verbatim}
2890 %
2891 % \DeleteShortVerb{\|}
2892 % \begin{displaymath}
2893 % \left.
2894 % \begin{array}{rrrr}
2895 % a & b & C & d \\
2896 % v & w & x & y \\
2897 % m & n & o & p \\
2898 % k & & L & cvb
2899 % \end{array}
2900 % \right|
2901 % \end{displaymath}
2902 % \MakeShortVerb{\|}
2903 %
2904 % The |\edvertdots| macro is similar to |\edvertline| except that it
2905 % produces a vertical dotted instead of a solid line.
2906 %
2907 %
2908 % \section{Sectioning commands}
2909 % \changes{v1.1.0}{2012/09/25}{Sectioning commands.}
2910 % \changes{v1.12.0}{2014/08/05}{New sectioning commands.}\label{eledsection}
2911 % \subsection{Sectioning commands without line numbers or critical notes}
2912 % The standard sectioning commands (\cs{chapter}, \cs{section} etc.) can be used inside numbered text.
2913 % In this case, you must call them as an optional argument of \cs{pstart} (\reff{pstart:optionalarg}):
2914 % \begin{verbatim}
2915 % \pstart[\section{section}]
2916 % Pstart content.
2917 % \pend
2918 % \end{verbatim}
2919 % The line which contains them won't be numbered, and you can't add critical notes inside.
2920 % \subsection{Sectioning commands with line numbering and critical notes}
2921 % In the past (between versions 1.1.0 and 1.12.0),
2922 % these following commands were provided:
2923 % \begin{itemize}
2924 % \item \cs{ledchapter}\oarg{text}\marg{critical text}
2925 % \item \cs{ledchapter*}
2926 % \item \cs{ledsection}\oarg{text}\marg{critical text}
2927 % \item \cs{ledsection*}
2928 % \item \cs{ledsubsection}\oarg{text}\marg{critical text}
2929 % \item \cs{ledsubsection*}
2930 % \item \cs{ledsubsubsection}\oarg{text}\marg{critical text}
2931 % \item \cs{ledsubsubsection*}
2932 % \end{itemize}
2933 % \label{eledsection} These commands are deprecated, and won't be maintened anymore, because of a bad concept.
2934 % Since version 1.12.0, you have to use the following commands:
2935 % \begin{itemize}
2936 % \item \cs{eledchapter}\oarg{text}\marg{critical text}
2937 % \item \cs{eledchapter*}
2938 % \item \cs{eledsection}\oarg{text}\marg{critical text}
2939 % \item \cs{eledsection*}
2940 % \item \cs{eledsubsection}\oarg{text}\marg{critical text}
2941 % \item \cs{eledsubsection*}
2942 % \item \cs{eledsubsubsection}\oarg{text}\marg{critical text}
2943 % \item \cs{eledsubsubsection*}
2944 % \end{itemize}
2945 % Which are equivalent to the \LaTeX\ commands. Each indivual command must be called alone in a \cs{pstart}\ldots\cs{pend}:
2946 % \begin{verbatim}
2947 %\pstart
2948 %\eledsection*{xxxx\ledsidenote{section}}
2949 %\pend
2950 %\pstart
2951 %\eledsubsection*{xxxx\ledsidenote{sub}}
2952 %\pend
2953 %\pstart
2954 %normal text
2955 %\pend
2956 % \end{verbatim}
2957 % At the first run, you will see only the text. It's normal.
2958 % At the second run, you will see the formating.
2959 % And consequently, at the third run, you will see the table of contents.
2960 %
2961 % For technical reasons, the page break before \cs{elechapter} can't be added automatically. You have to insert it manually via \cs{beforeeledchapter}, which must be called outside of a numbered section.
2962 % \DescribeMacro{\noeledsec}
2963 % If you aren't going to have any \cs{eledxxx} commands, then load \Eledmac{} with \cs{noeledsec} option.
2964 % That will suppress the generation of unneeded \file{.eledsec} file, keep memory and make \Lpack{eledmac} faster.
2965 % \section{Quotation environments}
2966 % The \verb+quotation+ and \verb+quote+ environment can be used so that same definition/note appears both inside and outside a numbered section.
2967 % The typographical consequences will resemble the outside numbered sections, based on the styles of the \emph{book} class.
2968 % However, if you use a package that redefines these environments, these redefinitions won't be available inside the numbered section.
2969 % You must open any quotation environments inside a \cs{start}-\cs{pend} block, not outside.
2970 % A quotation environment MUST not be opened immediately after a \cs{pstart}
2971 % and MUST not be closed immediately before a \cs{pend}.
2972 %
2973 % \label{noquotation} In some cases, you don't want these environments to be redefined in numbered sections.
2974 % You can load the package with the option \verb+noquotation+ to prevent this redefinition.
2975 % \section{Page breaks}
2976 % \changes{v1.7.0}{2013/11/08}{New features for managing page breaks.}
2977 % \Lpack{Eledmac} and \Lpack{eledpar} break pages automatically.
2978 % However, you may sometimes want to either force page breaks or prevent them.
2979 % \DescribeMacro{\ledpb} \DescribeMacro{\lednopb} The packages provide two macros:
2980 % \begin{itemize}
2981 % \item \cs{ledpb} adds a page break.
2982 % \item \cs{lednopb} prevents a page break, by adding one line to the current page if needed.
2983 % \end{itemize}
2984 % \textbf{These commands have effect only at the second run}.
2985 %
2986 % These two commands take effect at the beginning of line in which they are called. For example, if you call \cs{ledpb} at l.~444, the l.~443 will be at the p.~$n$, and the l.~444 at the p.~$n+1$.
2987 % \DescribeMacro{\ledpbsetting} However you can change the behavior, and decide they will have effect after the end of the line, adding \verb+\ledpbsetting{after}+ at the beginning of your file (better: in your preamble). With the previous example, the l.~444 will be at the p.~$n$ and the l.~445 will be at the p.~$n+1$.
2988 %
2989 % If you are using \Lpack{eledpar} to typeset parallel pages you must use \cs{lednopb} on
2990 % both sides in the two corresponding lines. This is especially important when you are using
2991 % stanzas; otherwise the pages will run out of sync.
2992 % \label{lednopbinversetrue}\DescribeMacro{\lednopbinversetrue} You can also decide to prevent page breaks between two lines of a long verse. To do this, use \verb+nopbinverse+ when loading package, or add \cs{lednopbinversetrue} in the beginning of your file (better: in your preamble). This feature works only with verse of 2 lines, not more. It works at the third run, or at fourth run with \Lpack{eledpar}.
2993 % By default, when a long verse runs normally between two pages, a page break will be placed at the beginning of the verse. However, if you have added\verb+ledpbsetting{after}+, the page break will be placed at the end of the long verse, and the page containing the long verse will have one extra line.
2994 % \section{Miscellaneous}
2995 %
2996 %
2997 % \DescribeMacro{\extensionchars}
2998 % When the package assembles the name of the auxiliary file for a
2999 % section, it prefixes \cs{extensionchars} to the section number.
3000 % This is initially defined to be empty, but you can add some characters to
3001 % help distinguish these files if you like; what you use is likely
3002 % to be system-dependent. If, for example, you said
3003 % \verb"\renewcommand{\extensionchars}{!}", then you would get temporary
3004 % files called \file{jobname.!1}, \file{jobname.!2}, etc.
3005 %
3006 % \DescribeMacro{\ifledfinal}
3007 % The package can take options. The option `final', which is the default
3008 % is for final typesetting; this sets \verb?\ifledfinal? to TRUE. The other
3009 % option, `draft', may be useful during earlier stages and sets
3010 % \verb?\ifledfinal? to FALSE.
3011 %
3012 % \DescribeMacro{\showlemma}
3013 % The lemma within the text is printed via \verb?\showlemma{lemma}?.
3014 % Normally, or with the `final' option, the definition of \verb?\showlemma?
3015 % is: \\
3016 % \verb?\newcommand*{\showlemma}[1]{#1}? \\
3017 % so it just produces its argument.
3018 % With the `draft' option it is defined as \\
3019 % \verb?\newcommand*{\showlemma}[1]{\textit{#1}}? \\
3020 % so that its argument is typeset in an italic font, which may make it
3021 % easier to check that all lemmas have been treated.
3022 %
3023 % If you would prefer some other style, you could put something like this
3024 % in the preamble:
3025 % \begin{verbatim}
3026 % \ifledfinal\else
3027 % \renewcommand{\showlemma}[1]{\textbf{#1}}% or simply ...[1]{#1}
3028 % \fi
3029 % \end{verbatim}
3030 %
3031 %
3032 % \subsection{Known and suspected limitations}
3033 %
3034 % In general, \Eledmac's system for adding marginal line numbers
3035 % breaks anything that makes direct use of the \LaTeX\ insert system,
3036 % which includes marginpars, footnotes and floats.
3037 %
3038 % However, you can use both \cs{footnote} and the familiar footnote
3039 % series notes in numbered text. A \cs{marginpar} in numbered text
3040 % will throw away its contents and send a warning message to the terminal
3041 % and log file, but will do no harm.
3042 %
3043 % \cs{parshape} cannot be used within numbered text, except in a
3044 % very restricted way.
3045 %
3046 % \DescribeMacro{\ballast}
3047 % \phantomsection\label{ballastdesc}\relax
3048 % \LaTeX\ is a three-pass system, but even after a document has
3049 % been processed three times, there are some tricky situations in
3050 % which the page breaks decided by \TeX\ never settle down. At
3051 % each successive run, \Eledmac{} may oscillate between two
3052 % different sets of page decisions. To stop this happening, should
3053 % it arise, Wayne Sullivan\index{Sullivan, Wayne} suggested the
3054 % inclusion of the quantity \cs{ballast}. The amount of \cs{ballast}
3055 % will be subtracted from the penalties which apply to the page
3056 % breaks calculated on the \emph{previous} run through \TeX, thus
3057 % reinforcing these breaks. So if you find your page breaks
3058 % oscillating, say \\
3059 % \verb"\setcounter{ballast}{100}" \\
3060 % or some such figure, and with any
3061 % luck the page breaks will settle down. Luckily, this problem
3062 % doesn't crop up at all often.
3063 %
3064 % The restriction on explicit line-breaking in paragraphed footnotes,
3065 % mentioned in a footnote \reff{nobreaks}, and
3066 % described in more detail on \reff{nobreaks-detail}, really is a
3067 % nuisance if that is something you need to do. There are some possible
3068 % solutions, described by Michael Downes\index{Downes, Michael},
3069 % but this area remains unsatisfactory.
3070 %
3071 %
3072 % \LaTeX\ has a reputation for putting things in the wrong margin after
3073 % a page break. The \Eledmac{} package does nothing to improve the situation
3074 % --- in fact it just makes it more obvious if numbered text crosses a
3075 % page (or column) boundary and the numbers are meant to flip from side
3076 % to side. Try and keep the numbers in the same margin all the time.
3077 % Another aspect of TeX's page breaking mechanism is that when numbering
3078 % lines by the page, the first few numbers after a page break may continue
3079 % as though the lines were still on the previous page.
3080 %
3081 % \DescribeMacro{\pageparbreak}
3082 % If you can't resist flipping the numbers or numbering by the page,
3083 % then you might find that
3084 % judicious use of \cs{pageparbreak} may help if numbering goes awry
3085 % across a page (or column) break. It tries to force TeX into partitioning
3086 % the current paragraph into two invisibly joined paragraphs with a page
3087 % break between them. Insert the command between the last word on one page
3088 % and the first word on the next page. If later you change something earlier
3089 % in the document the natural page break may be in a different place, and you
3090 % will have to adjust the location of \cs{pageparbreak} accordingly.
3091 %
3092 % \DescribeMacro{\footfudgefiddle}
3093 % For paragraphed footnotes \TeX{} has to estimate the amount of space
3094 % required. If it underestimates this then the notes may get too long and
3095 % run off the bottom of the text block. \cs{footfudgefiddle} can be increased
3096 % from its default 64 (say to 68) to increase the estimate. You have to use
3097 % \cs{renewcommand} for this, like: \\
3098 % \verb?\renewcommand{\footfudgefiddle}{68}?
3099 %
3100 %
3101 %
3102 % Help, suggestions and corrections will be gratefully received.
3103 %
3104 % \subsection{Use with other packages}
3105 %
3106 %
3107 % Because of \Eledmac's complexity it may not play well with other
3108 % packages. In particular \Eledmac{} is sensitive to commands in the
3109 % arguments to the \cs{edtext} and \cs{*footnote} macros (this is
3110 % discussed in more detail in section~\ref{text}, and in particular
3111 % the discussion about \cs{no@expands} and \cs{morenoexpands}). You
3112 % will have to see what works or doesn't work in your particular case.
3113 %
3114 %
3115 % It is possible that \Eledmac{} and the \Lpack{hyperref} package may
3116 % work together. I have not tried this combination but past experience
3117 % with \Lpack{hyperref} suggests that cooperation is unlikely; \Lpack{hyperref}
3118 % changes many \LaTeX\ internals and \Lpack{eledmac} does things that are
3119 % not normally seen in \LaTeX.
3120 %
3121 % If you want to use the option \emph{bottom} of the \Lpack{footmisc} package,
3122 % you must load this package \emph{before} the \Eledmac\ package.
3123 %
3124 % \DescribeMacro{\morenoexpands}
3125 % You can define the macro \cs{morenoexpands} to modify macros that you
3126 % call within \cs{edtext}. Because of the way \Eledmac{} numbers the lines
3127 % the arguments to \cs{edtext} can be processed more than once and in some
3128 % cases a macro should only be processed once. One example is the \cs{colorbox}
3129 % macro from the \Lpack{color} package, which you might use like this:
3130 % \begin{verbatim}
3131 % ... \edtext{\colorbox{mycolor}{lemma}}{\Afootnote{...\colorbox...}}
3132 % \end{verbatim}
3133 % If you actually try
3134 % this\footnote{Reported by Dirk-Jan Dekker\index{Dekker, Dirk-Jan}
3135 % in the CTT thread `Incompatibility
3136 % of ``color'' package' on 2003/08/28.}
3137 % you will find \LaTeX\ whinging
3138 % `\texttt{Missing \{ inserted}', and then things start to fall apart.
3139 % The trick in this case is to specify either:
3140 % \begin{verbatim}
3141 % \newcommand{\morenoexpands}{\let\colorbox=0}
3142 % \end{verbatim}
3143 % or
3144 % \begin{verbatim}
3145 % \makeatletter
3146 % \newcommand{\morenoexpands}{\let\colorbox\@secondoftwo}
3147 % \makeatother
3148 % \end{verbatim}
3149 % (\cs{@secondoftwo} is an internal \LaTeX\ macro that takes two arguments and
3150 % thows away the first one.)
3151 % The first incantation lets color show in both the main text and footnotes
3152 % whereas the second one shows color in the main text but kills it
3153 % in the lemma and footnotes. On the other hand if you use
3154 % \cs{textcolor} instead, like
3155 % \begin{verbatim}
3156 % ... \edtext{\textcolor{mycolor}{lemma}}{\Afootnote{...\textcolor...}}
3157 % \end{verbatim}
3158 % there is no need to fiddle with \cs{morenoexpands} as the color will
3159 % naturally be displayed in both the text and footnotes. To kill the color
3160 % in the lemma and footnotes, though, you can do:
3161 % \begin{verbatim}
3162 % \makeatletter
3163 % \newcommand{\morenoexpands}{\let\textcolor\@secondoftwo}
3164 % \makeatother
3165 % \end{verbatim}
3166 % It took me a little while to discover all this. If you run into this sort
3167 % of problem you may have to spend some time experimenting before hitting
3168 % on a solution.
3169 %
3170 %
3171 % \subsection{Parallel typesetting}\label{eledpar}
3172 %
3173 %
3174 % Peter Wilson has developed the Ledpar package
3175 % as an extension to \Eledmac{} specifically for parallel typesetting
3176 % of critical texts. This also cooperates with the \Lpack{babel} / \Lpack{polyglossia}
3177 % packages for typesetting in multiple languages. The package has been called \emph{eledpar} since September 2012.
3178
3179 % He also developed
3180 % the \Lpack{ledarab} package for
3181 % handling parallel Arabic text in critical editions.
3182 % However, this package is not maintened by Maïeul Rouquette.
3183 % You should use the capabilities of a modern TeX processor, like Xe(La)TeX
3184 %
3185 %
3186 %
3187 %
3188 % \StopEventually{}
3189 %
3190 % \clearpage
3191 % \section{Implementation overview}\label{overview}
3192 %
3193 %
3194 % We present the \Eledmac{} code in roughly the order in which it's used
3195 % during a run of \TeX. The order is \emph{exactly} that in which
3196 % it's read when you load The \Eledmac{} package, because the same file
3197 % is used to generate this manual and to generate the \LaTeX\ package file.
3198 % Most of what follows consists of macro definitions, but there
3199 % are some commands that are executed immediately---especially
3200 % at the start of the code. The documentation generally describes the
3201 % code from the point of view of what happens when the macros are
3202 % executed, though. As each macro is introduced, its name is printed
3203 % in the margin.
3204 %
3205 % We begin with the commands you use to start and
3206 % stop line numbering in a section of text (Section~\ref{preliminaries}).
3207 % Next comes the machinery for writing and reading the auxiliary file for
3208 % each section that helps us count lines, and for creating list macros
3209 % encoding the information from that file (Section~\ref{lineation}); this
3210 % auxiliary file will be read at the start of each section, to create
3211 % those list macros, and a new version of the file will be started to
3212 % collect information from the body of the section.
3213 %
3214 % Next are commands for marking sections of
3215 % the text for footnotes (Section~\ref{text}), followed by the macros
3216 % that take each paragraph apart, attach the line numbers and insertions,
3217 % and send the result to the vertical list (Section~\ref{paragraph}). The
3218 % footnote commands (Section~\ref{footnotes}) and output routine
3219 % (Section~\ref{output}) finish the main part of the processing;
3220 % cross-referencing (Section~\ref{xref}) and endnotes
3221 % (Section~\ref{endnotes}) complete the story.
3222 %
3223 % In what follows, macros with an @ in their name are more internal
3224 % to the workings of \Eledmac{} than those made up just of
3225 % ordinary letters, just as in \PlainTeX\ (see \thetexbook,
3226 % p.\,344). You are meant to be able to make free with
3227 % ordinary macros, but the `@' ones should be treated with more
3228 % respect, and changed only if you are pretty sure of what you are
3229 % doing.
3230 %
3231 %
3232 % \section{Preliminaries}
3233 % \label{preliminaries}\relax
3234 %
3235 % We try and use \texttt{l@d} in macro names to help avoid
3236 % name clashes, but this is not a hard and fast rule. For example,
3237 % if an original \edmac{} macro includes \texttt{edmac} We will simply
3238 % change that to \texttt{eledmac}.
3239 %
3240 % Announce the name and version of the package, which is
3241 % targetted for LaTeX2e.
3242 %
3243 % \begin{macrocode}
3244 %<*code>
3245 \NeedsTeXFormat{LaTeX2e}
3246 \ProvidesPackage{eledmac}[2017/09/25 v1.24.12 LaTeX port of EDMAC]%
3247 % \end{macrocode}
3248 %
3249 % Generally, these are the modifications to the original.
3250 % \edmac{} code:
3251 % \begin{itemize}
3252 % \item Replace as many \cs{def}'s by \cs{newcommand}'s as possible
3253 % to avoid overwriting \LaTeX\ macros.
3254 %
3255 % \item Replace user-level \TeX\ counts by \LaTeX\ counters.
3256 %
3257 % \item Use the \LaTeX\ font handling mechanisms.
3258 %
3259 % \item Use \LaTeX\ messaging and file facilities.
3260 %
3261 % \end{itemize}
3262 %
3263 % \subsection{Package options}
3264 % \changes{v0.4.0}{2004/02/29}{Added final/draft options}
3265 % \changes{v1.13.0}{2014/09/16}{Added widthliketwocolumns option}
3266 % \begin{macro}{\ifledfinal}
3267 % \begin{macro}{\ifoldprintnpnumspace@}
3268 % \begin{macro}{\ifnocritical@}
3269 % \begin{macro}{\if@noeled@sec}
3270 % \begin{macro}{\ifnoend@}
3271 % \begin{macro}{\ifnofamiliar@}
3272 % \begin{macro}{\ifnoledgroup@}
3273 % \begin{macro}{\ifparapparatus@}
3274 % \begin{macro}{\ifnoquotation@}
3275 % \begin{macro}{\iflednopbinverse}
3276 % \begin{macro}{\ifparledgroup}
3277 % \begin{macro}{\ifwidthliketwocolumns}
3278 % \begin{macro}{\ifledsecnolinenumber}
3279 % \begin{macro}{\ifxindy@}
3280 % \begin{macro}{\ifxindyhyperref@}
3281 % Use this to remember which option is used, set and execute the options
3282 % with final as the default.
3283 % \begin{macrocode}
3284 \newif\ifledfinal
3285 \newif\ifoldprintnpnumspace@
3286 \newif\ifnocritical@%
3287 \newif\if@noeled@sec%
3288 \newif\ifnoend@%
3289 \newif\ifnofamiliar@%
3290 \newif\ifnoledgroup@%
3291 \newif\ifparapparatus@
3292 \newif\ifnoquotation@
3293 \newif\iflednopbinverse
3294 \newif\ifparledgroup
3295 \newif\ifwidthliketwocolumns%
3296 \newif\ifledsecnolinenumber
3297 \newif\ifxindy@
3298 \newif\ifxindyhyperref@
3299 \parapparatus@false
3300 \RequirePackage{xkeyval}
3301 \DeclareOptionX{series}[A,B,C,D,E,Z]{\xdef\default@series{#1}}
3302 \DeclareOptionX{noeledsec}{\@noeled@sectrue}
3303 \DeclareOptionX{nocritical}{\nocritical@true}%
3304 \DeclareOptionX{nofamiliar}{\nofamiliar@true}%
3305 \DeclareOptionX{noledgroup}{\noledgroup@true}%
3306 \DeclareOptionX{noend}{%
3307 \let\l@dend@open\@gobble%
3308 \let\l@d@end\relax
3309 \let\l@dend@close\relax%
3310 \global\let\l@dend@stuff=\relax%
3311 \global\chardef\l@d@end=16%
3312 \noend@true%
3313 }%
3314 \DeclareOptionX{noquotation}{\noquotation@true}
3315 \DeclareOptionX{oldprintnpnumspace}{\oldprintnpnumspace@true}
3316 \DeclareOptionX{final}{\ledfinaltrue}
3317 \DeclareOptionX{draft}{\ledfinalfalse}
3318 \DeclareOptionX{parapparatus}{\parapparatus@true}
3319 \DeclareOptionX{nopbinverse}{\lednopbinversetrue}
3320 \DeclareOptionX{ledsecnolinenumber}{\ledsecnolinenumbertrue}
3321 \DeclareOptionX{widthliketwocolumns}{\widthliketwocolumnstrue}%
3322 \DeclareOptionX{xindy}[eledmac-markup-attr.xdy]{%
3323 \AtBeginDocument{\immediate\openout\eledmac@xindy@out=#1}%
3324 \newwrite\eledmac@xindy@out%
3325 \xindy@true%
3326 \gdef\eledmacmarkuplocrefdepth{:depth 1}%
3327 \AtEndDocument{\immediate\closeout\eledmac@xindy@out}%
3328 }%
3329 \DeclareOptionX{xindy+hyperref}{%
3330 \xindyhyperref@true%
3331 }%
3332 \ExecuteOptionsX{series}%
3333 \ExecuteOptionsX{final}
3334 % \end{macrocode}
3335 % Suggest to migrate to reledmac.
3336 % \changes{v1.24.6}{2015/07/19}{Add an optional message to suggest to migrate to reledmac.}
3337 % \begin{macrocode}
3338 \newif\ifnoreledmac
3339 \DeclareOptionX{noreledmac}{\noreledmactrue}
3340 % \end{macrocode}
3341 % \begin{macrocode}
3342 % Use the starred form of \verb?\ProcessOptions? which executes options in
3343 % the order listed in the source file: class options, then listed package
3344 % options, so a package option can override a class option with the same name.
3345 % This was suggested by Dan Luecking\index{Luecking, Dan} in the \texttt{ctt}
3346 % thread \textit{Class/package option processing}, on 27 February 2004.
3347 % \begin{macrocode}
3348 \ProcessOptionsX*\relax
3349
3350 % \end{macrocode}
3351 % \end{macro}
3352 % \end{macro}
3353 % \end{macro}
3354 % \end{macro}
3355 % \end{macro}
3356 % \end{macro}
3357 % \end{macro}
3358 % \end{macro}
3359 % \end{macro}
3360 % \end{macro}
3361 % \end{macro}
3362 % \end{macro}
3363 % \end{macro}
3364 % \end{macro}
3365 % \end{macro}
3366 % \subsection{Loading packages}
3367 % Loading package \Lpack{xargs} to declare commands with optional arguments.
3368 % \Lpack{Etoolbox} is also used to make code clearer - for example, in dynamic command names (which can replace \cs{csname} etc.).
3369 % Use \Lpack{suffix} to declare commands with a starred version, \Lpack{xstring} to work with strings, \Lpack{ifluatex} and \Lpack{ifxetex} to test if \LuaTeX\ or \XeTeX\ is running, and \Lpack{ragged2e} to manage ragged for paragraphed notes.
3370 % \begin{macrocode}
3371 \RequirePackage{xargs}
3372 \RequirePackage{etoolbox}
3373 \@ifl@t@r\fmtversion{2015/10/01}
3374 {}%
3375 {\RequirePackage{etex}%
3376 \csname reserveinserts\endcsname{32}%
3377 }
3378 \RequirePackage{suffix}
3379 \RequirePackage{xstring}
3380 \RequirePackage{ifluatex}
3381 \RequirePackage{ragged2e}
3382 \RequirePackage{ragged2e}
3383 \RequirePackage{ifxetex}%
3384 % \end{macrocode}
3385 %
3386 % \subsection{Compatibility with \LuaTeX}
3387 %Here, we enable some primitives for \LuaTeX.
3388 % \begin{macrocode}
3389 \ifx\directlua\undefined\else%
3390 \directlua{tex.enableprimitives("",{"textdir","pardir","bodydir"})}
3391 \fi
3392 % \end{macrocode}
3393 % \subsection{Boolean flags}
3394 % \begin{macro}{\ifl@dmemoir}
3395 % Define a flag for if the \Lpack{memoir} class has been used.
3396 % \changes{v0.2.0}{2003/07/25}{Added \cs{ifl@dmemoir} for memoir class having been used}
3397 % \begin{macrocode}
3398 \newif\ifl@dmemoir
3399 \@ifclassloaded{memoir}{\l@dmemoirtrue}{\l@dmemoirfalse}
3400
3401 % \end{macrocode}
3402 % \end{macro}
3403 %
3404 %
3405 % \begin{macro}{\ifl@imakeidx}
3406 % Define a flag for if the \Lpack{imakeidx} package has been used.
3407 % \begin{macrocode}
3408 \newif\ifl@imakeidx
3409 \@ifpackageloaded{imakeidx}{\l@imakeidxtrue}{}%False is the default value
3410 % \end{macrocode}
3411 % \end{macro}
3412 % \begin{macro}{\ifl@indextools}
3413 % Define a flag for if the \Lpack{indextools} package has been used.
3414 % \begin{macrocode}
3415 \newif\ifl@indextools%
3416 \@ifpackageloaded{indextools}{%
3417 \l@indextoolstrue%
3418 \l@imakeidxtrue%
3419 \let\imki@wrindexentry\indtl@wrindexentry%
3420 }{}%False is the default value. We consider indextools as a variant of imakeidx. That's why we set `l@imakeidx` to true. We also let \imki@wrindexentry to \indtl@wrindexentry
3421 % \end{macrocode}
3422 % \end{macro}
3423 % \begin{macro}{\if@RTL}
3424 % The \cs{if@RTL} is defined by the bidi package, which is sometimes loaded by \emph{polyglossia}.
3425 % But we define it as well if the \Lpack{bidi} package is not loaded.
3426 % \begin{macrocode}
3427 \ifdef{\if@RTL}{}{\newif\if@RTL}
3428 % \end{macrocode}
3429 % \end{macro}
3430 % \begin{macro}{\if@RTL}
3431 % The \cs{if@RTL} is defined by the bidi package, which is sometimes loaded by \emph{polyglossia}.
3432 % But we define it if the bidi package is not loaded.
3433 % \begin{macrocode}
3434 \ifdef{\if@RTL}{}{\newif\if@RTL}
3435 % \end{macrocode}
3436 % \end{macro}
3437 % \subsection{Messages}
3438 %
3439 % All the messages are grouped here as macros. This saves TeX's memory
3440 % when the same message is repeated and also lets them be edited easily.
3441 % \changes{v0.7.0}{2005/02/21}{Made macros of all messages}
3442 % \changes{v1.12.3}{2012/08/15}{Add macros for new messages since v0.7}
3443 %
3444 % \begin{macro}{\eledmac@warning}
3445 % Write a warning message.
3446 % \begin{macrocode}
3447 \newcommand{\eledmac@warning}[1]{\PackageWarning{eledmac}{#1}}
3448 % \end{macrocode}
3449 % \end{macro}
3450 %
3451 % \begin{macro}{\eledmac@error}
3452 % Write an error message.
3453 % \changes{v0.2.0}{2003/07/25}{Added \cs{eledmac@error} and replaced error messages}
3454 % \changes{v1.12.3}{2014/08/15}{Replaced error messages}
3455 % \begin{macrocode}
3456 \newcommand{\eledmac@error}[2]{\PackageError{eledmac}{#1}{#2}}
3457 % \end{macrocode}
3458 % \end{macro}
3459 % First, suggest to use reledmac.
3460 % \begin{macrocode}
3461 \ifnoreledmac\else%
3462 \eledmac@error{Using package `eledmac' is deprecated. We suggest\MessageBreak using `reledmac' instead. If you want to continue\MessageBreak with `eledmac', you can disable this message by\MessageBreak adding the option `noreledmac' when loading `eledmac'}{\@ehc}
3463 \fi%
3464 % \end{macrocode}
3465 % \begin{macro}{\led@err@NumberingStarted}
3466 % \begin{macro}{\led@err@NumberingNotStarted}
3467 % \begin{macro}{\led@err@NumberingShouldHaveStarted}
3468 % \begin{macrocode}
3469 \newcommand*{\led@err@NumberingStarted}{%
3470 \eledmac@error{Numbering has already been started}{\@ehc}}
3471 \newcommand*{\led@err@NumberingNotStarted}{%
3472 \eledmac@error{Numbering was not started}{\@ehc}}
3473 \newcommand*{\led@err@NumberingShouldHaveStarted}{%
3474 \eledmac@error{Numbering should already have been started}{\@ehc}}
3475 % \end{macrocode}
3476 % \end{macro}
3477 % \end{macro}
3478 % \end{macro}
3479 %
3480 % \begin{macro}{\led@err@edtextoutsidepstart}
3481 % \begin{macrocode}
3482 \newcommand*{\led@err@edtextoutsidepstart}{%
3483 \eledmac@error{\string\edtext\space outside numbered paragraph (\pstart\ldots\pend)}{\@ehc}}%
3484 % \end{macrocode}
3485 % \end{macro}
3486 % \begin{macro}{\led@mess@NotesChanged}
3487 % \begin{macrocode}
3488 \newcommand*{\led@mess@NotesChanged}{%
3489 \typeout{eledmac reminder: }%
3490 \typeout{ The number of the footnotes in this section
3491 has changed since the last run.}%
3492 \typeout{ You will need to run LaTeX two more times
3493 before the footnote placement}%
3494 \typeout{ and line numbering in this section are
3495 correct.}}
3496 % \end{macrocode}
3497 % \end{macro}
3498 %
3499 % \begin{macro}{\led@mess@SectionContinued}
3500 % \begin{macrocode}
3501 \newcommand*{\led@mess@SectionContinued}[1]{%
3502 \message{Section #1 (continuing the previous section)}}
3503 % \end{macrocode}
3504 % \end{macro}
3505 %
3506 % \begin{macro}{\led@err@LineationInNumbered}
3507 % \begin{macrocode}
3508 \newcommand*{\led@err@LineationInNumbered}{%
3509 \eledmac@error{You can't use \string\lineation\space within
3510 a numbered section}{\@ehc}}
3511 % \end{macrocode}
3512 % \end{macro}
3513 %
3514 %
3515 % \begin{macro}{\led@warn@BadLineation}
3516 % \begin{macro}{\led@warn@BadLinenummargin}
3517 % \begin{macro}{\led@warn@BadLockdisp}
3518 % \begin{macro}{\led@warn@BadSublockdisp}
3519 % \begin{macrocode}
3520 \newcommand*{\led@warn@BadLineation}{%
3521 \eledmac@warning{Bad \string\lineation\space argument}}
3522 \newcommand*{\led@warn@BadLinenummargin}{%
3523 \eledmac@warning{Bad \string\linenummargin\space argument}}
3524 \newcommand*{\led@warn@BadLockdisp}{%
3525 \eledmac@warning{Bad \string\lockdisp\space argument}}
3526 \newcommand*{\led@warn@BadSublockdisp}{%
3527 \eledmac@warning{Bad \string\sublockdisp\space argument}}
3528 % \end{macrocode}
3529 % \end{macro}
3530 % \end{macro}
3531 % \end{macro}
3532 % \end{macro}
3533 %
3534 % \begin{macro}{\led@warn@NoLineFile}
3535 % \begin{macrocode}
3536 \newcommand*{\led@warn@NoLineFile}[1]{%
3537 \eledmac@warning{Can't find line-list file #1}}
3538 % \end{macrocode}
3539 % \end{macro}
3540 % \begin{macro}{\led@warn@LineFileObsolete}
3541 % \begin{macrocode}
3542 \newcommand*{\led@warn@Obsolete}[1]{%
3543 \eledmac@warning{Line-list file #1 was obsolete. We have not read it. Please run LaTeX again.}}
3544 % \end{macrocode}
3545 % \end{macro}
3546 %
3547 % \begin{macro}{\led@warn@BadAdvancelineSubline}
3548 % \begin{macro}{\led@warn@BadAdvancelineLine}
3549 % \begin{macrocode}
3550 \newcommand*{\led@warn@BadAdvancelineSubline}{%
3551 \eledmac@warning{\string\advanceline\space produced a sub-line
3552 number less than zero.}}
3553 \newcommand*{\led@warn@BadAdvancelineLine}{%
3554 \eledmac@warning{\string\advanceline\space produced a line
3555 number less than zero.}}
3556 % \end{macrocode}
3557 % \end{macro}
3558 % \end{macro}
3559 %
3560 % \begin{macro}{\led@warn@BadSetline}
3561 % \begin{macro}{\led@warn@BadSetlinenum}
3562 % \begin{macrocode}
3563 \newcommand*{\led@warn@BadSetline}{%
3564 \eledmac@warning{Bad \string\setline\space argument}}
3565 \newcommand*{\led@warn@BadSetlinenum}{%
3566 \eledmac@warning{Bad \string\setlinenum\space argument}}
3567 % \end{macrocode}
3568 % \end{macro}
3569 % \end{macro}
3570 %
3571 % \begin{macro}{\led@err@PstartNotNumbered}
3572 % \begin{macro}{\led@err@PstartInPstart}
3573 % \begin{macro}{\led@err@PendNotNumbered}
3574 % \begin{macro}{\led@err@PendNoPstart}
3575 % \begin{macro}{\led@err@AutoparNotNumbered}
3576 % \begin{macro}{\led@err@NumberingWithoutPstart}
3577 % \begin{macrocode}
3578 \newcommand*{\led@err@PstartNotNumbered}{%
3579 \eledmac@error{\string\pstart\space must be used within a
3580 numbered section}{\@ehc}}
3581 \newcommand*{\led@err@PstartInPstart}{%
3582 \eledmac@error{\string\pstart\space encountered while another
3583 \string\pstart\space was in effect}{\@ehc}}
3584 \newcommand*{\led@err@PendNotNumbered}{%
3585 \eledmac@error{\string\pend\space must be used within a
3586 numbered section}{\@ehc}}
3587 \newcommand*{\led@err@PendNoPstart}{%
3588 \eledmac@error{\string\pend\space must follow a \string\pstart}{\@ehc}}
3589 \newcommand*{\led@err@AutoparNotNumbered}{%
3590 \eledmac@error{\string\autopar\space must be used within a
3591 numbered section}{\@ehc}}
3592 \newcommand*{\led@err@NumberingWithoutPstart}{%
3593 \eledmac@error{\string\beginnumbering...\string\endnumbering\space without \string\pstart}{\@ehc}}%
3594 % \end{macrocode}
3595 % \end{macro}
3596 % \end{macro}
3597 % \end{macro}
3598 % \end{macro}
3599 % \end{macro}
3600 % \end{macro}
3601 %
3602 % \begin{macro}{\led@warn@BadAction}
3603 % \begin{macrocode}
3604 \newcommand*{\led@warn@BadAction}{%
3605 \eledmac@warning{Bad action code, value \next@action.}}
3606 % \end{macrocode}
3607 % \end{macro}
3608 %
3609 % \begin{macro}{\led@warn@DuplicateLabel}
3610 % \begin{macro}{\led@warn@AppLabelOutEdtext}
3611 % \begin{macro}{\led@warn@RefUndefined}
3612 % \begin{macrocode}
3613 \newcommand*{\led@warn@DuplicateLabel}[1]{%
3614 \eledmac@warning{Duplicate definition of label `#1' on page \the\pageno.}}
3615 \newcommand*{\led@warn@AppLabelOutEdtext}[1]{%
3616 \eledmac@warning{\string\applabel\space outside of \string\edtext\space `#1' on page \the\pageno.}}%
3617 \newcommand*{\led@warn@RefUndefined}[1]{%
3618 \eledmac@warning{Reference `#1' on page \the\pageno\space undefined.
3619 Using `000'.}}
3620 % \end{macrocode}
3621 % \end{macro}
3622 % \end{macro}
3623 % \end{macro}
3624 %
3625 % \begin{macro}{\led@warn@NoMarginpars}
3626 % \begin{macrocode}
3627 \newcommand*{\led@warn@NoMarginpars}{%
3628 \eledmac@warning{You can't use \string\marginpar\space in numbered text}}
3629 % \end{macrocode}
3630 % \end{macro}
3631 %
3632 % \begin{macro}{\led@warn@BadSidenotemargin}
3633 % \begin{macrocode}
3634 \newcommand*{\led@warn@BadSidenotemargin}{%
3635 \eledmac@warning{Bad \string\sidenotemmargin\space argument}}
3636 % \end{macrocode}
3637 % \end{macro}
3638 %
3639 % \begin{macro}{\led@warn@NoIndexFile}
3640 % \begin{macrocode}
3641 \newcommand*{\led@warn@NoIndexFile}[1]{%
3642 \eledmac@warning{Undefined index file #1}}
3643 % \end{macrocode}
3644 % \end{macro}
3645 % \begin{macro}{\led@warn@AddfootinsXobsolete}
3646 % \begin{macro}{\led@warn@Addfootinsobsolete}
3647 % \begin{macrocode}
3648 \newcommand{\led@warn@AddfootinsXObsolete}{%
3649 \eledmac@warning{AddfootinsX is obsolete in eledmac 1.0. Use newseries instead.}%
3650 }%
3651 \newcommand{\led@warn@AddfootinsObsolete}{%
3652 \eledmac@warning{Addfootins is obsolete in eledmac 1.0. Use newseries instead.}%
3653 }%
3654 % \end{macrocode}
3655 % \end{macro}
3656 % \end{macro}
3657 % \begin{macro}{\led@warn@SeriesStillExist}
3658 % \begin{macrocode}
3659 \newcommand{\led@warn@SeriesStillExist}[1]{%
3660 \eledmac@warning{Series #1 is still existing !}%
3661 }%
3662 % \end{macrocode}
3663 % \end{macro}
3664 % \begin{macro}{\led@err@ManySidenotes}
3665 % \begin{macro}{\led@err@ManyLeftnotes}
3666 % \begin{macro}{\led@err@ManyRightnotes}
3667 % \begin{macrocode}
3668 \newcommand{\led@err@ManySidenotes}{%
3669 \ifledRcol@%
3670 \eledmac@warning{\itemcount@\space sidenotes on line \the\line@numR\space p. \the\page@numR}%
3671 \else%
3672 \eledmac@warning{\itemcount@\space sidenotes on line \the\line@num\space p. \the\page@num}%
3673 \fi%
3674 }%
3675 \newcommand{\led@err@ManyLeftnotes}{%
3676 \ifledRcol@%
3677 \eledmac@warning{\itemcount@\space leftnotes on line \the\line@numR\space p. \the\page@numR}%
3678 \else%
3679 \eledmac@warning{\itemcount@\space leftnotes on line \the\line@num\space p. \the\page@num}%
3680 \fi%
3681 }%
3682 \newcommand{\led@err@ManyRightnotes}{%
3683 \ifledRcol@%
3684 \eledmac@warning{\itemcount@\space rightnotes on line \the\line@numR\space p. \the\page@numR}%
3685 \else%
3686 \eledmac@warning{\itemcount@\space rightnotes on line \the\line@num\space p. \the\page@num}%
3687 \fi%
3688 }%
3689 % \end{macrocode}
3690 % \end{macro}
3691 % \end{macro}
3692 % \end{macro}
3693 % \begin{macro}{\led@war@ledsetnormalparstuffDeprecated}
3694 % \begin{macro}{\led@war@noeledsecDeprecated}
3695 % \begin{macro}{\led@war@FalseverseDeprecated}
3696 % \begin{macro}{\led@war@ledxxxDeprecated}
3697 % \begin{macro}{\led@war@noendnotesDeprecated}
3698 % \begin{macrocode}
3699 \newcommand{\led@war@noeledsecDeprecated}[0]{%
3700 \eledmac@warning{\string\noeledsec\space deprecated. Use `noeledsec` option instead.}%
3701 }%
3702 \newcommand{\led@war@ledsetnormalparstuffDeprecated}{%
3703 \eledmac@warning{\string\ledsetnormalparstuff\space deprecated. Look at \string\Xledsetnormalparstuff\space and \ledsetnormalparstuffX\space instead.}%
3704 }%
3705 \newcommand{\led@war@ledxxxDeprecated}[1]{%
3706 \eledmac@warning{\string\led#1\space deprecated. Look at \string\e#1 instead.}%
3707 }%
3708 \newcommand{\led@war@noendnotesDeprecated}[0]{%
3709 \eledmac@warning{\string\noendnotes\space deprecated. Use `noend` option instead.}%
3710 }%
3711 % \end{macrocode}
3712 % \end{macro}
3713 % \end{macro}
3714 % \end{macro}
3715 % \end{macro}
3716 % \end{macro}
3717 % \begin{macro}{\led@err@TooManyColumns}
3718 % \begin{macro}{\led@err@UnequalColumns}
3719 % \begin{macro}{\led@err@LowStartColumn}
3720 % \begin{macro}{\led@err@HighEndColumn}
3721 % \begin{macro}{\led@err@ReverseColumns}
3722 % \begin{macrocode}
3723 \newcommand*{\led@err@TooManyColumns}{%
3724 \eledmac@error{Too many columns}{\@ehc}}
3725 \newcommand*{\led@err@UnequalColumns}{%
3726 \eledmac@error{Number of columns is not equal to the number
3727 in the previous row (or \protect\\ \space forgotten?)}{\@ehc}}
3728 \newcommand*{\led@err@LowStartColumn}{%
3729 \eledmac@error{Start column is too low}{\@ehc}}
3730 \newcommand*{\led@err@HighEndColumn}{%
3731 \eledmac@error{End column is too high}{\@ehc}}
3732 \newcommand*{\led@err@ReverseColumns}{%
3733 \eledmac@error{Start column is greater than end column}{\@ehc}}
3734 % \end{macrocode}
3735 % \end{macro}
3736 % \end{macro}
3737 % \end{macro}
3738 % \end{macro}
3739 % \end{macro}
3740 %
3741 % \begin{macro}{\led@err@EdtextWithoutFootnote}
3742 % \begin{macrocode}
3743 \newcommand{\led@err@EdtextWithoutFootnote}{%
3744 \eledmac@error{edtext without Xfootnote. Check syntaxis.}{\@ehd}%
3745 }%
3746 % \end{macrocode}
3747 % \end{macro}
3748 % \begin{macro}{\led@err@FootnoteWithoutEdtext}
3749 % \begin{macrocode}
3750 \newcommand{\led@err@FootnoteWithoutEdtext}{%
3751 \eledmac@error{Xfootnote without edtext. Check syntax.}{\@ehd}%
3752 }%
3753 % \end{macrocode}
3754 % \end{macro}
3755 % \begin{macro}{\led@error@ImakeidxAfterEledmac}
3756 % \begin{macrocode}
3757 \newcommand{\led@error@ImakeidxAfterEledmac}{%
3758 \eledmac@error{Imakeidx must be loaded before eledmac.}{\@ehd}%
3759 }%
3760 % \end{macrocode}
3761 % \end{macro}
3762 % \begin{macro}{\led@error@IndextoolsAfterEledmac}
3763 % \begin{macrocode}
3764 \newcommand{\led@error@IndextoolsAfterEledmac}{%
3765 \eledmac@error{Indextools must be loaded before eledmac.}{\@ehd}%
3766 }%
3767 % \end{macrocode}
3768 % \end{macro}
3769
3770 %
3771 % \subsection{Gobbling}
3772 % \changes{v1.14.0}{2014/10/27}{Provide \cs{@gobblefour}}
3773 % \changes{v1.14.0}{2014/10/27}{Moves gobbling command}
3774 % \changes{v1.21.0}{2015/04/13}{Provide \cs{@gobblefive}}
3775 % \changes{v0.2.2}{2003/11/05}{Used \cs{providecommand} for \cs{@gobblethree}
3776 % to avoid clash with the amsfonts package}
3777 % \begin{macro}{\@gobblethree}
3778 % \begin{macro}{\@gobblefour}
3779 % \begin{macrocode}
3780 \providecommand*{\@gobblethree}[3]{}
3781 \providecommand*{\@gobblefour}[4]{}
3782 \providecommand*{\@gobblefive}[5]{}
3783 % \end{macrocode}
3784 % \end{macro}
3785 % \end{macro}
3786 % Here, we define some commands which gobble their arguments.
3787 % \subsection{Miscellaneous commands}
3788 % \begin{macro}{\showlemma}
3789 % \verb?\showlemma?\marg{lemma} typesets the lemma text in the body.
3790 % It depends on the option.
3791 % \changes{v0.4.0}{2004/02/29}{Added \cs{showlemma}}
3792 % \begin{macrocode}
3793 \ifledfinal
3794 \newcommand*{\showlemma}[1]{#1}
3795 \else
3796 \newcommand*{\showlemma}[1]{\underline{#1}}
3797 \fi
3798
3799 % \end{macrocode}
3800 % \end{macro}
3801 % \begin{macro}{\linenumberlist}
3802 % The code for the \verb?\linenumberlist? mechanism was given to Peter Wilson by Wayne
3803 % Sullivan\index{Sullivan, Wayne} on 2004/02/11.
3804 %
3805 % Initialize it as \verb?\empty?
3806 % \changes{v0.3.0}{2004/02/14}{Added \cs{linenumberlist} mechanism}
3807 % \begin{macrocode}
3808 \let\linenumberlist=\empty
3809
3810 % \end{macrocode}
3811 % \end{macro}
3812 %
3813 % \begin{macro}{\@l@dtempcnta}
3814 % \begin{macro}{\@l@dtempcntb}
3815 % In imitation of \LaTeX, we create a couple of scratch counters.
3816 %
3817 % \LaTeX\ already defines \cs{@tempcnta} and \cs{@tempcntb} but Peter Wilson
3818 % found in the past that it can be dangerous to use these (for example
3819 % one of the AMS packages did something nasty to the \Lpack{ccaption}
3820 % package's use of one of these).
3821 % \begin{macrocode}
3822 \newcount\@l@dtempcnta \newcount\@l@dtempcntb
3823 % \end{macrocode}
3824 % \end{macro}
3825 % \end{macro}
3826 %
3827 %
3828 % \section{Sectioning commands}
3829 %
3830 % \begin{macro}{\section@num}
3831 % You use \cs{beginnumbering} and \cs{endnumbering} to begin
3832 % and end a line-numbered section of the text; the pair of commands may
3833 % be used as many times as you like within one document to start
3834 % and end multiple, separately line-numbered sections. \LaTeX\ will
3835 % maintain and display
3836 % a `section number' as a count named
3837 % \cs{section@num} that counts how many
3838 % \cs{beginnumbering} and \cs{resumenumbering}
3839 % commands have appeared; it needn't be
3840 % related to the logical divisions of your text.
3841 %
3842 % \begin{macro}{\extensionchars}
3843 % Each section will read and write an associated `line-list
3844 % file', containing information used to do the numbering; the file
3845 % will be called \meta{jobname}\file{.nn}, where \file{nn} is the
3846 % section number. However, you may direct that
3847 % an extra string be added before the
3848 % \file{nn} in that filename, in order to distinguish these
3849 % temporary files from others: that string is called
3850 % \cs{extensionchars}. Initially it's empty, since different
3851 % operating systems have greatly varying ideas about what
3852 % characters are permitted in file names. So
3853 % \verb"\renewcommand{\extensionchars}{-}" gives temporary files called
3854 % \file{jobname.-1}, \file{jobname.-2}, etc.
3855 % \begin{macrocode}
3856 \newcount\section@num
3857 \section@num=0
3858 \let\extensionchars=\empty
3859 % \end{macrocode}
3860 % \end{macro}
3861 % \end{macro}
3862 %
3863 % \begin{macro}{\ifnumbering}
3864 % \begin{macro}{\numberingtrue}
3865 % \begin{macro}{\numberingfalse}
3866 % The \cs{ifnumbering} flag is
3867 % set to \verb"true" if we're within a numbered section (that is, between
3868 % \cs{beginnumbering} and \cs{endnumbering}). You can use \cs{ifnumbering}
3869 % in your own code to check whether you're in a numbered section, but
3870 % don't change the flag's value.
3871 % \begin{macrocode}
3872 \newif\ifnumbering
3873 % \end{macrocode}
3874 % \end{macro}
3875 % \end{macro}
3876 % \end{macro}
3877 %
3878 % \begin{macro}{\ifnumberingR}
3879 % \begin{macro}{\ifl@dpairing}
3880 % \begin{macro}{\ifl@dpaging}
3881 % \begin{macro}{\l@dpagingtrue}
3882 % \begin{macro}{\l@dpagingfalse}
3883 % \begin{macro}{\ifl@dprintingpages}
3884 % \begin{macro}{\l@dprintingpagestrue}
3885 % \begin{macro}{\l@dprintingpagesfalse}
3886 % \begin{macro}{\ifl@dprintingcolumns}
3887 % \begin{macro}{\l@dprintingcolumnstrue}
3888 % \begin{macro}{\l@dprintingcolumnsfalse}
3889 % \begin{macro}{\l@dpairingtrue}
3890 % \begin{macro}{\l@dpairingfalse}
3891 % \begin{macro}{\ifpst@rtedL}
3892 % \begin{macro}{\pst@rtedLtrue}
3893 % \begin{macro}{\pst@rtedLfalse}
3894 % \begin{macro}{\l@dnumpstartsL}
3895 % \begin{macro}{\ifledRcol}
3896 % \begin{macro}{\ifledRcol@}
3897 % In preparation for the \Lpack{eledpar} package, these are related to
3898 % the `left' text of parallel texts (when \cs{ifl@dpairing} is TRUE).
3899 % They are explained in the \Lpack{eledpar}
3900 % manual.
3901 % \changes{v0.7.0}{2005/02/24}{Added \cs{l@dnumpstartsL}, \cs{ifl@dpairing}
3902 % and \cs{ifpst@rted} for/from eledpar}
3903 % \changes{v0.12.0}{2005/10/01}{Added \cs{ifledRcol} and \cs{ifnumberingR} for/from \Lpack{eledpar}}
3904 % \changes{v1.12.0}{2014/08/05}{Add \cs{ifledRcol@} for \Lpack{eledpar}}
3905 % \changes{v1.13.2}{2014/09/31}{Add \cs{ifl@dpaging} for \Lpack{eledpar}}
3906 % \changes{v1.18.0}{2015/02/23}{Add \cs{ifl@dprintingpages} and \cs{@dprintingcolumns} for \Lpack{eledpar}}
3907 % \begin{macrocode}
3908 \newif\ifl@dpairing
3909 \newif\ifl@dpaging%
3910 \newif\ifl@dprintingpages%
3911 \newif\ifl@dprintingcolumns%
3912 \newif\ifpst@rtedL
3913 \newcount\l@dnumpstartsL
3914 % \end{macrocode}
3915 % \cs{ifledRcol} is set to true in the \verb+Rightside+ environnement. It must be distingued from \cs{ifledRcol@} which is set to true when a right line is processed, in \cs{Pages} or \cs{Columns}.
3916 % \begin{macrocode}
3917 \newif\ifledRcol
3918 \newif\ifledRcol@
3919 % \end{macrocode}
3920 % The \cs{ifnumberingR} flag is
3921 % set to \verb"true" if we're within a right text numbered section.
3922 % \begin{macrocode}
3923 \newif\ifnumberingR
3924 % \end{macrocode}
3925 % \end{macro}
3926 % \end{macro}
3927 % \end{macro}
3928 % \end{macro}
3929 % \end{macro}
3930 % \end{macro}
3931 % \end{macro}
3932 % \end{macro}
3933 % \end{macro}
3934 % \end{macro}
3935 % \end{macro}
3936 % \end{macro}
3937 % \end{macro}
3938 % \end{macro}
3939 % \end{macro}
3940 % \end{macro}
3941 % \end{macro}
3942 % \end{macro}
3943 % \end{macro}
3944 % \begin{macro}{\beginnumbering}
3945 % \begin{macro}{\initnumbering@reg}
3946 % \cs{beginnumbering} begins a section of numbered text.
3947 % When it's executed we increment the section number,
3948 % initialize our counters, send a message to your terminal, and
3949 % call macros to start the lineation machinery and endnote files.
3950 %
3951 % The initializations here are trickier than they look.
3952 % \cs{line@list@stuff} will use all of the counters
3953 % that are zeroed here when it assembles
3954 % the line-list and other lists of information about the lineation.
3955 % But it will do all of this locally and
3956 % within a group, and when it's done the
3957 % lists will remain but the counters will return to zero. Those same
3958 % counters will then be used as we process the text of this section,
3959 % but the assignments will be made globally. These initializations
3960 % actually apply to both uses, though in all other respects there
3961 % should be no direct interaction between the use of these counters
3962 % and variables in the two processing steps.
3963 % \changes{v0.7.0}{2005/02/24}{Added \cs{initnumbering@reg}}
3964 % \changes{v1.12.0}{2014/08/05}{\cs{beginnumbering} is defined only on \Lpack{eledmac}, not on \Lpack{eledpar}.}
3965 % For parallel processing :
3966 %\begin{itemize}
3967 % \item zero \cs{l@dnumpstartsL} --- the number of chunks to be processed.
3968 % \item set \cs{ifpst@rtedL} to FALSE.
3969 % \end{itemize}
3970 % \begin{macrocode}
3971 \newcommand*{\beginnumbering}{%
3972 \ifnumbering
3973 \led@err@NumberingStarted
3974 \endnumbering
3975 \fi
3976 \global\numberingtrue
3977 \global\advance\section@num \@ne
3978 \initnumbering@reg
3979 \message{Section \the\section@num }%
3980 \line@list@stuff{\jobname.\extensionchars\the\section@num}%
3981 \l@dend@stuff
3982 \setcounter{pstart}{1}
3983 \ifl@dpairing
3984 \global\l@dnumpstartsL \z@
3985 \global\pst@rtedLfalse
3986 % \end{macrocode}
3987 % The tools for section's title commands are called:
3988 % \begin{itemize}
3989 % \item Define old (deprecated) sectioning commands.
3990 % \item Define an empty list of pstart number where sectioning commands are called.
3991 % \item Input auxiliary file with the description of section titles.
3992 % \item Open the same auxiliary file to write in.
3993 % \end{itemize}
3994 % \begin{macrocode}
3995 \else
3996 \begingroup
3997 \global\@afterindenttrue%In order to retablish normal feature if the \begingroup was not here
3998 \initnumbering@sectcmd
3999 \ifwidthliketwocolumns%
4000 \csuse{setwidthliketwocolumns@\columns@position}%
4001 \csuse{setpositionliketwocolumns@\columns@position}%
4002 \fi%
4003 \fi
4004 \gdef\eled@sections@@{}%
4005 \if@noeled@sec\else%
4006 \makeatletter\InputIfFileExists{\jobname.eledsec\the\section@num}{}{}\makeatother%
4007 \immediate\openout\eled@sectioning@out=\jobname.eledsec\the\section@num\relax%
4008 \fi%
4009 }
4010 \newcommand*{\initnumbering@reg}{%
4011 \global\pst@rtedLfalse
4012 \global\l@dnumpstartsL \z@
4013 \global\absline@num \z@
4014 \gdef\normal@page@break{}
4015 \gdef\l@prev@pb{}
4016 \gdef\l@prev@nopb{}
4017 \global\line@num \z@
4018 \global\subline@num \z@
4019 \global\@lock \z@
4020 \global\sub@lock \z@
4021 \global\sublines@false
4022 \global\let\next@page@num=\relax
4023 \global\let\sub@change=\relax
4024 \resetprevline@
4025 \resetprevpage@num
4026 }
4027
4028 % \end{macrocode}
4029 % \end{macro}
4030 % \end{macro}
4031 %
4032 % \begin{macro}{\endnumbering}
4033 % \cs{endnumbering} must follow the last text for a numbered section.
4034 % It takes care of notifying you when changes have been noted in the
4035 % input that require running the file through again to move everything
4036 % to the right place.
4037 % \changes{v0.7.0}{2005/02/24}{Changed \cs{endnumbering} for eledpar}
4038 % \changes{v1.12.5}{2014/08/31}{Allow to mix parallel columns and normal text when using \cs{pausenumbering}}
4039 % \begin{macrocode}
4040 \def\endnumbering{%
4041 \ifnumbering
4042 \global\numberingfalse
4043 \normal@pars
4044 \ifnum\l@dnumpstartsL=0%
4045 \led@err@NumberingWithoutPstart%
4046 \fi%
4047 \ifl@dpairing
4048 \global\pst@rtedLfalse
4049 \else
4050 \ifx\insertlines@list\empty\else
4051 \global\noteschanged@true
4052 \fi
4053 \ifx\line@list\empty\else
4054 \global\noteschanged@true
4055 \fi
4056 \fi
4057 \ifnoteschanged@
4058 \led@mess@NotesChanged
4059 \fi
4060 \else
4061 \led@err@NumberingNotStarted
4062 \fi
4063 \autoparfalse
4064 \if@noeled@sec\else%
4065 \immediate\closeout\eled@sectioning@out%
4066 \fi%
4067 \ifl@dpairing\else
4068 \global\l@dnumpstartsL=\z@%
4069 \endgroup
4070 \fi
4071 }
4072 % \end{macrocode}
4073 % \end{macro}
4074 %
4075 % \begin{macro}{\pausenumbering}
4076 % \begin{macro}{\resumenumbering}
4077 % The \cs{pausenumbering} macro is just the same as
4078 % \cs{endnumbering}, but with the \cs{ifnumbering} flag set to \verb"true", to
4079 % show that numbering continues across the gap.\footnote{Our thanks
4080 % to Wayne Sullivan,\index{Sullivan, Wayne} who suggested the idea
4081 % behind these macros.}
4082 % \begin{macrocode}
4083 \newcommand{\pausenumbering}{%
4084 \ifautopar\global\autopar@pausetrue\fi%
4085 \endnumbering\global\numberingtrue}
4086 % \end{macrocode}
4087 % The \cs{resumenumbering} macro is a bit more involved, but not much.
4088 % It does most of the same things as \cs{beginnumbering}, but
4089 % without resetting the various counters. Note that no check is made
4090 % by \cs{resumenumbering} to ensure that \cs{pausenumbering} was actually
4091 % invoked.
4092 % \changes{v0.7.0}{2005/02/24}{Changed \cs{resumenumbering} for eledpar}
4093 % \changes{v1.12.5}{2014/08/31}{Debug \cs{resumenumbering}}
4094 % \begin{macrocode}
4095 \newcommand*{\resumenumbering}{%
4096 \ifnumbering
4097 \ifautopar@pause\autopar\fi
4098 \global\pst@rtedLtrue
4099 \global\advance\section@num \@ne
4100 \led@mess@SectionContinued{\the\section@num}%
4101 \line@list@stuff{\jobname.\extensionchars\the\section@num}%
4102 \l@dend@stuff
4103 \ifl@dpairing\else%
4104 \begingroup%
4105 \initnumbering@sectcmd%
4106 \ifwidthliketwocolumns%
4107 \csuse{setwidthliketwocolumns@\columns@position}%
4108 \csuse{setpositionliketwocolumns@\columns@position}%
4109 \fi%
4110 \fi%
4111 \else
4112 \led@err@NumberingShouldHaveStarted
4113 \endnumbering
4114 \beginnumbering
4115 \fi}
4116
4117
4118 % \end{macrocode}
4119 % \end{macro}
4120 % \end{macro}
4121 %
4122 % \section{Line counting}
4123 % \label{lineation}\relax
4124 %
4125 % \subsection{Choosing the system of lineation}
4126 % \changes{v0.15.0}{2012/06/11}{Line numbering can be reset at each pstart.}
4127 % Sometimes you want line numbers that start at $1$ at the top of each
4128 % page; sometimes you want line numbers that start at $1$ at each \cs{pstart}; other times you want line numbers that start at $1$ at the start
4129 % of each section and increase regardless of page breaks.
4130 % \Eledmac{} can do it either way, and you can switch from one to the
4131 % other within one work.
4132 % But you have to choose one or the other for all line numbers and
4133 % line references within each section. Here we will define
4134 % internal codes for these systems and the macros you use to select them.
4135 %
4136 % \begin{macro}{\ifbypstart@}
4137 % \begin{macro}{\bypstart@true}
4138 % \begin{macro}{\bypstart@false}
4139 % \begin{macro}{\ifbypage@}
4140 % \begin{macro}{\bypage@true}
4141 % \begin{macro}{\bypage@false}
4142 % The \cs{ifbypage@} and \cs{ifbypstart@} flag specifie the current lineation
4143 % system: \begin{itemize}
4144 % \item line-of-page: \verb|bypstart@ = false| and \verb|bypage@ = true|.
4145 % \item line-of-pstart: \verb|bypstart@ = true| and \verb|bypage@ = false|.
4146 % \end{itemize}
4147 % \Eledmac{} will use the line-of-section system unless instructed otherwise.
4148 % \begin{macrocode}
4149 \newif\ifbypage@
4150 \newif\ifbypstart@
4151 % \end{macrocode}
4152 % \end{macro}
4153 % \end{macro}
4154 % \end{macro}
4155 % \end{macro}
4156 % \end{macro}
4157 % \end{macro}
4158 %
4159 % \begin{macro}{\lineation}
4160 % \cs{lineation}\marg{word} is the macro you use to select the
4161 % lineation system.
4162 % Its argument is a string: either \texttt{page} or \texttt{section} or \texttt{pstart}.
4163 % \begin{macrocode}
4164 \newcommand*{\lineation}[1]{{%
4165 \ifnumbering
4166 \led@err@LineationInNumbered
4167 \else
4168 \def\@tempa{#1}\def\@tempb{page}%
4169 \ifx\@tempa\@tempb
4170 \global\bypage@true
4171 \global\bypstart@false
4172 \unless\ifnocritical@%
4173 \pstartinfootnote[][false]%
4174 \fi%
4175 \else
4176 \def\@tempb{pstart}%
4177 \ifx\@tempa\@tempb
4178 \global\bypage@false
4179 \global\bypstart@true
4180 \unless\ifnocritical@%
4181 \pstartinfootnote%
4182 \fi%
4183 \else
4184 \def\@tempb{section}
4185 \ifx\@tempa\@tempb
4186 \global\bypage@false
4187 \global\bypstart@false
4188 \unless\ifnocritical@%
4189 \pstartinfootnote[][false]%
4190 \fi%
4191 \else
4192 \led@warn@BadLineation
4193 \fi
4194 \fi
4195 \fi
4196 \fi}}
4197 % \end{macrocode}
4198 % \end{macro}
4199 %
4200 % \begin{macro}{\linenummargin}
4201 % \begin{macro}{\line@margin}
4202 % \begin{macro}{\l@dgetline@margin}
4203 % You call \cs{linenummargin}\marg{word} to specify which margin you want your
4204 % line numbers in; it takes one argument, a string.
4205 % You can put the line numbers in the same margin on every page using
4206 % \texttt{left} or \texttt{right}; or you can use \texttt{inner} or
4207 % \texttt{outer} to get them in the inner or outer margins. (These last
4208 % two options assume that even-numbered pages will be on the
4209 % left-hand side of every opening in your book.)
4210 % You can change this within a numbered section, but the
4211 % change may not take effect just when you'd like; if it's done between
4212 % paragraphs nothing surprising should happen.
4213 %
4214 % The selection is recorded in the count \cs{line@margin}:
4215 % $0$ for left, $1$ for right, $2$ for outer, and $3$ for inner.
4216 % \changes{v0.7.0}{2005/02/23}{Added \cs{l@dgetline@margin}}
4217 % \begin{macrocode}
4218 \newcount\line@margin
4219 \newcommand*{\linenummargin}[1]{{%
4220 \l@dgetline@margin{#1}%
4221 \ifnum\@l@dtempcntb>\m@ne
4222 \global\line@margin=\@l@dtempcntb
4223 \fi}}
4224 \newcommand*{\l@dgetline@margin}[1]{%
4225 \def\@tempa{#1}\def\@tempb{left}%
4226 \ifx\@tempa\@tempb
4227 \@l@dtempcntb \z@
4228 \else
4229 \def\@tempb{right}%
4230 \ifx\@tempa\@tempb
4231 \@l@dtempcntb \@ne
4232 \else
4233 \def\@tempb{outer}%
4234 \ifx\@tempa\@tempb
4235 \@l@dtempcntb \tw@
4236 \else
4237 \def\@tempb{inner}%
4238 \ifx\@tempa\@tempb
4239 \@l@dtempcntb \thr@@
4240 \else
4241 \led@warn@BadLinenummargin
4242 \@l@dtempcntb \m@ne
4243 \fi
4244 \fi
4245 \fi
4246 \fi}
4247
4248 % \end{macrocode}
4249 % \end{macro}
4250 % \end{macro}
4251 % \end{macro}
4252 %
4253 % \begin{macro}{\c@firstlinenum}
4254 % \begin{macro}{\c@linenumincrement}
4255 % The following counters tell \Eledmac{} which lines should be
4256 % printed with line numbers. \texttt{firstlinenum} is the number of the
4257 % first line in each section that gets a number;
4258 % \texttt{linenumincrement}
4259 % is the difference between successive numbered lines. The initial
4260 % values of these counters produce labels on lines $5$, $10$, $15$, etc.
4261 % \texttt{linenumincrement} must be at least $1$.
4262 %
4263 % \begin{macrocode}
4264 \newcounter{firstlinenum}
4265 \setcounter{firstlinenum}{5}
4266 \newcounter{linenumincrement}
4267 \setcounter{linenumincrement}{5}
4268 % \end{macrocode}
4269 % \end{macro}
4270 % \end{macro}
4271 %
4272 % \begin{macro}{\c@firstsublinenum}
4273 % \begin{macro}{\c@sublinenumincrement}
4274 % The following parameters are just like \texttt{firstlinenum} and
4275 % \texttt{linenumincrement}, but for sub-line numbers.
4276 % \texttt{sublinenumincrement} must be at least $1$.
4277 %
4278 % \begin{macrocode}
4279 \newcounter{firstsublinenum}
4280 \setcounter{firstsublinenum}{5}
4281 \newcounter{sublinenumincrement}
4282 \setcounter{sublinenumincrement}{5}
4283
4284 % \end{macrocode}
4285 % \end{macro}
4286 % \end{macro}
4287 %
4288 % \begin{macro}{\firstlinenum}
4289 % \begin{macro}{\linenumincrement}
4290 % \begin{macro}{\firstsublinenum}
4291 % \begin{macro}{\sublinenumincrement}
4292 % These macros can be used to set the corresponding counters.
4293 % \changes{v0.7.0}{2005/02/18}{Added \cs{firstlinenum}, \cs{linenumincrement},
4294 % \cs{firstsublinenum} and \cs{linenumincrement}}
4295 % \begin{macrocode}
4296 \newcommand*{\firstlinenum}[1]{\setcounter{firstlinenum}{#1}}
4297 \newcommand*{\linenumincrement}[1]{\setcounter{linenumincrement}{#1}}
4298 \newcommand*{\firstsublinenum}[1]{\setcounter{firstsublinenum}{#1}}
4299 \newcommand*{\sublinenumincrement}[1]{\setcounter{sublinenumincrement}{#1}}
4300
4301 % \end{macrocode}
4302 % \end{macro}
4303 % \end{macro}
4304 % \end{macro}
4305 % \end{macro}
4306 %
4307 % \begin{macro}{\lockdisp}
4308 % \begin{macro}{\lock@disp}
4309 % \begin{macro}{\l@dgetlock@disp}
4310 % When line locking is being used, the \cs{lockdisp}\marg{word} macro
4311 % specifies whether a line number---if one is due to
4312 % appear---should be printed on the first printed line or on the
4313 % last, or by all of them. Its argument is a word, either
4314 % \texttt{first}, \texttt{last}, or \texttt{all}.
4315 % Initially, it is set to \texttt{first}.
4316 %
4317 % \cs{lock@disp} encodes the selection: $0$ for first, $1$ for last,
4318 % $2$ for all.
4319 % \changes{v0.7.0}{2005/02/23}{Added \cs{l@dgetlock@disp}}
4320 % \begin{macrocode}
4321 \newcount\lock@disp
4322 \newcommand{\lockdisp}[1]{{%
4323 \l@dgetlock@disp{#1}%
4324 \ifnum\@l@dtempcntb>\m@ne
4325 \global\lock@disp=\@l@dtempcntb
4326 \else
4327 \led@warn@BadLockdisp
4328 \fi}}
4329 \newcommand*{\l@dgetlock@disp}[1]{
4330 \def\@tempa{#1}\def\@tempb{first}%
4331 \ifx\@tempa\@tempb
4332 \@l@dtempcntb \z@
4333 \else
4334 \def\@tempb{last}%
4335 \ifx\@tempa\@tempb
4336 \@l@dtempcntb \@ne
4337 \else
4338 \def\@tempb{all}%
4339 \ifx\@tempa\@tempb
4340 \@l@dtempcntb \tw@
4341 \else
4342 \@l@dtempcntb \m@ne
4343 \fi
4344 \fi
4345 \fi}
4346
4347 % \end{macrocode}
4348 % \end{macro}
4349 % \end{macro}
4350 % \end{macro}
4351 %
4352 % \begin{macro}{\sublockdisp}
4353 % \begin{macro}{\sublock@disp}
4354 % The same questions about where to print the line number apply to
4355 % sub-lines, and these are the analogous macros for dealing with
4356 % the problem.
4357 % \begin{macrocode}
4358 \newcount\sublock@disp
4359 \newcommand{\sublockdisp}[1]{{%
4360 \l@dgetlock@disp{#1}%
4361 \ifnum\@l@dtempcntb>\m@ne
4362 \global\sublock@disp=\@l@dtempcntb
4363 \else
4364 \led@warn@BadSublockdisp
4365 \fi}}
4366
4367 % \end{macrocode}
4368 % \end{macro}
4369 % \end{macro}
4370 %
4371 % \begin{macro}{\linenumberstyle}
4372 % \begin{macro}{\linenumrep}
4373 % \begin{macro}{\linenumr@p}
4374 % \begin{macro}{\sublinenumberstyle}
4375 % \begin{macro}{\sublinenumrep}
4376 % \begin{macro}{\sublinenumr@p}
4377 % We provide a mechanism for using different representations of the
4378 % line numbers, not just the normal arabic.
4379 %
4380 % NOTE: In v0.7 \cs{linenumrep} and \cs{sublinenumrep} replaced
4381 % the internal \cs{linenumr@p} and \cs{sublinenumr@p}.
4382 %
4383 % \verb?\linenumberstyle? and \verb?\sublinenumberstyle? are user level
4384 % macros for setting the number represention (\verb?\linenumrep?
4385 % and \verb?\sublinenumrep?) for line and sub-line numbers.
4386 % \changes{v0.3.0}{2004/02/14}{Added \cs{linenumberstyle} and \cs{sublinenumberstyle}}
4387 % \changes{v0.7.0}{2005/02/18}{Using \cs{linenumrep} instead of \cs{linenumr@p}}
4388 % \changes{v0.7.0}{2005/02/18}{Using \cs{sublinenumrep} instead of \cs{sublinenumr@p}}
4389 % \begin{macrocode}
4390 \newcommand*{\linenumberstyle}[1]{%
4391 \def\linenumrep##1{\@nameuse{@#1}{##1}}}
4392 \newcommand*{\sublinenumberstyle}[1]{%
4393 \def\sublinenumrep##1{\@nameuse{@#1}{##1}}}
4394 % \end{macrocode}
4395 % Initialise the number styles to arabic.
4396 % \begin{macrocode}
4397 \linenumberstyle{arabic}
4398 \let\linenumr@p\linenumrep
4399 \sublinenumberstyle{arabic}
4400 \let\sublinenumr@p\sublinenumrep
4401
4402 % \end{macrocode}
4403 % \end{macro}
4404 % \end{macro}
4405 % \end{macro}
4406 % \end{macro}
4407 % \end{macro}
4408 % \end{macro}
4409 %
4410 % \begin{macro}{\leftlinenum}
4411 % \begin{macro}{\rightlinenum}
4412 % \begin{macro}{\linenumsep}
4413 % \begin{macro}{\numlabfont}
4414 % \begin{macro}{\ledlinenum}
4415 % \cs{leftlinenum} and \cs{rightlinenum} are the macros that are
4416 % called to print marginal line numbers on
4417 % a page, for left- and right-hand margins respectively.
4418 % They're made easy to access and change, since you may
4419 % often want to change the styling in some way. These standard versions
4420 % illustrate the general sort of thing that will be needed; they're
4421 % based on the \cs{leftheadline} macro in \thetexbook, p.\,416.
4422 %
4423 % Whatever these macros output gets printed in a box that will be
4424 % put into the appropriate margin without any space between it and the
4425 % line of text. You'll generally want a kern between a line number and
4426 % the text, and \cs{linenumsep} is provided as a standard way of
4427 % storing its size. Line numbers are usually printed in a smaller
4428 % font, and \cs{numlabfont} is provided as a standard name for that
4429 % font. When called, these macros
4430 % will be executed within a group, so font changes and the like will
4431 % remain local.
4432 %
4433 % \cs{ledlinenum} typesets the line (and subline) number.
4434 %
4435 % The original \cs{numlabfont} specification is equivalent to
4436 % the \LaTeX\ \cs{scriptsize} for a 10pt document.
4437 % \changes{v0.3.0}{2004/02/14}{Added \cs{linenumr@p} and \cs{sublinenum@rep}
4438 % to \cs{leftlinenum} and \cs{rightlinenum}}
4439 % \changes{v0.7.0}{2005/02/18}{Added \cs{ledlinenum} for use by
4440 % \cs{leftlinenum} and \cs{rightlinenum}}
4441 % \begin{macrocode}
4442 \newlength{\linenumsep}
4443 \setlength{\linenumsep}{1pc}
4444 \newcommand*{\numlabfont}{\normalfont\scriptsize}
4445 \newcommand*{\ledlinenum}{%
4446 \bgroup%
4447 \ifluatex%
4448 \textdir TLT%
4449 \fi%
4450 \numlabfont\linenumrep{\line@num}%
4451 \ifsublines@
4452 \ifnum\subline@num>0\relax
4453 \unskip\fullstop\sublinenumrep{\subline@num}%
4454 \fi
4455 \fi%
4456 \egroup%
4457 }%
4458
4459 \newcommand*{\leftlinenum}{%
4460 \ledlinenum
4461 \kern\linenumsep}
4462 \newcommand*{\rightlinenum}{%
4463 \kern\linenumsep
4464 \ledlinenum}
4465
4466 % \end{macrocode}
4467 % \end{macro}
4468 % \end{macro}
4469 % \end{macro}
4470 % \end{macro}
4471 % \end{macro}
4472 %
4473 % \subsection{List macros}
4474 %
4475 % Reminder: compare these with the \LaTeX\ list macros in case they
4476 % would be suitable instead.
4477 %
4478 % We will make heavy use of lists of information, which will be built
4479 % up and taken apart by the following macros; they are
4480 % adapted from \thetexbook, pp.\,378--379, which discusses
4481 % their use in more detail.
4482 %
4483 % These macros consume a large amount of the run-time of this code.
4484 % We intend to replace them in a future version, and in anticipation
4485 % of doing so have defined their interface in such a way that it is
4486 % not sensitive to details of the underlying code.
4487 %
4488 % \begin{macro}{\list@create}
4489 % The \cs{list@create} macro creates a new list. In this version of
4490 % \Eledmac{} this macro doesn't do anything beyond initializing an empty
4491 % list macro, but in future versions it may do more.
4492 % \begin{macrocode}
4493 \newcommand*{\list@create}[1]{\global\let#1=\empty}
4494 % \end{macrocode}
4495 % \end{macro}
4496 %
4497 % \begin{macro}{\list@clear}
4498 % The \cs{list@clear} macro just initializes a list to the empty list;
4499 % in this version of \Eledmac{} it is no different from
4500 % \cs{list@create}.
4501 % \begin{macrocode}
4502 \newcommand*{\list@clear}[1]{\global\let#1=\empty}
4503 % \end{macrocode}
4504 % \end{macro}
4505 %
4506 % \begin{macro}{\xright@appenditem}
4507 % \begin{macro}{\led@toksa}
4508 % \begin{macro}{\led@toksb}
4509 % \cs{xright@appenditem} expands an item and appends it to the right
4510 % end of a list macro. We want the expansion because we'll often
4511 % be using this to store the current value of a counter.
4512 % \cs{xright@appenditem} creates global control sequences, like \cs{xdef}, and uses two
4513 % temporary token-list registers, \cs{@toksa} and \cs{@toksb}.
4514 % \begin{macrocode}
4515 \newtoks\led@toksa \newtoks\led@toksb
4516 \global\led@toksa={\\}
4517 \long\def\xright@appenditem#1\to#2{%
4518 \global\led@toksb=\expandafter{#2}%
4519 \xdef#2{\the\led@toksb\the\led@toksa\expandafter{#1}}%
4520 \global\led@toksb={}}
4521 % \end{macrocode}
4522 % \end{macro}
4523 % \end{macro}
4524 % \end{macro}
4525 %
4526 % \begin{macro}{\xleft@appenditem}
4527 % \cs{xleft@appenditem} expands an item and appends it to the left
4528 % end of a list macro; it is otherwise identical to
4529 % \cs{xright@appenditem}.
4530 % \begin{macrocode}
4531 \long\def\xleft@appenditem#1\to#2{%
4532 \global\led@toksb=\expandafter{#2}%
4533 \xdef#2{\the\led@toksa\expandafter{#1}\the\led@toksb}%
4534 \global\led@toksb={}}
4535 % \end{macrocode}
4536 % \end{macro}
4537 %
4538 % \begin{macro}{\gl@p}
4539 % The \cs{gl@p} macro removes the leftmost
4540 % item from a list and places it in a
4541 % control sequence. You say \verb"\gl@p\l\to\z"
4542 % (where \verb"\l" is the list macro, and
4543 % \verb"\z" receives the left item). \verb"\l" is assumed nonempty: say
4544 % \verb"\ifx\l\empty" to test for an empty \verb"\l". The control
4545 % sequences created by \cs{gl@p} are all global.
4546 % \begin{macrocode}
4547 \def\gl@p#1\to#2{\expandafter\gl@poff#1\gl@poff#1#2}
4548 \long\def\gl@poff\\#1#2\gl@poff#3#4{\gdef#4{#1}\gdef#3{#2}}
4549
4550 % \end{macrocode}
4551 % \end{macro}
4552 %
4553 % \subsection{Line-number counters and lists}
4554 %
4555 % Footnote references using line numbers rather than symbols can't be
4556 % generated in one pass, because we don't know the line numbers till we
4557 % ship out the pages. It would be possible if footnotes were never keyed
4558 % to more than one line; but some footnotes gloss passages that may run
4559 % for several lines, and they must be tied to the first line of the
4560 % passage glossed. And even one-line passages require two passes if we
4561 % want line-per-page numbering rather than line-per-section numbering.
4562 %
4563 % So we run \LaTeX\ over the text several times, and each time save
4564 % information about page and line numbers in a `line-list file' to
4565 % be used during the next pass. At the start of each section---whenever
4566 % \cs{beginnumbering} is executed---the line-list file
4567 % for that section
4568 % is read, and the information from it is encoded into a few list
4569 % macros.
4570 %
4571 % We need first to define the different line numbers that are involved
4572 % in these macros, and the associated counters.
4573 %
4574 % \begin{macro}{\line@num}
4575 % The count \cs{line@num} stores the line number that's used in
4576 % marginal line numbering and in notes: counting either from the start of
4577 % the page or from the start of the section, depending on your
4578 % choice for this section. This may be qualified by \cs{subline@num}.
4579 % \begin{macrocode}
4580 \newcount\line@num
4581 % \end{macrocode}
4582 % \end{macro}
4583 %
4584 % \begin{macro}{\subline@num}
4585 % The count \cs{subline@num} stores
4586 % a sub-line number that qualifies \cs{line@num}. For example,
4587 % line $10$ might have sub-line numbers $1$, $2$ and $3$, which might be
4588 % printed as lines $10.1$, $10.2$, $10.3$.
4589 % \begin{macrocode}
4590 \newcount\subline@num
4591 % \end{macrocode}
4592 % \end{macro}
4593 %
4594 % \begin{macro}{\ifsublines@}
4595 % \begin{macro}{\sublines@true}
4596 % \begin{macro}{\sublines@false}
4597 % We maintain an associated flag, \cs{ifsublines@},
4598 % to tell us whether we're within
4599 % a sub-line range or not.
4600 %
4601 % You may wonder why we don't just use the value of \cs{subline@num}
4602 % to determine this---treating anything greater than $0$ as an
4603 % indication that sub-lineation is on. We need a separate flag because
4604 % sub-lineation can be used together with line-number locking in odd
4605 % ways: several pieces of a logical line might be interrupted by
4606 % pieces of sub-lineated text, and those sub-line numbers should not
4607 % return to zero until the next change in the major line number. This
4608 % is common in the typesetting of English Renaissance verse
4609 % drama\index{Middleton, Thomas}, in which stage directions are
4610 % given sub-line numbers: a single line of verse may be
4611 % interrupted by several stage directions.
4612 % \begin{macrocode}
4613 \newif\ifsublines@
4614 % \end{macrocode}
4615 % \end{macro}
4616 % \end{macro}
4617 % \end{macro}
4618 %
4619 % \begin{macro}{\absline@num}
4620 % The count \cs{absline@num} stores the
4621 % absolute number of lines since the start
4622 % of the section: that is, the number we've actually printed, no matter
4623 % what numbers we attached to them.
4624 % This value is never printed on an output page, though
4625 % \cs{line@num} will often be equal to it. It is used internally to
4626 % keep track of where notes are to appear and where new
4627 % pages start: using this value rather than \cs{line@num} is a lot
4628 % simpler, because it doesn't depend on the lineation system in use.
4629 % \begin{macrocode}
4630 \newcount\absline@num
4631 % \end{macrocode}
4632 % \end{macro}
4633 %
4634 % We'll be calling \cs{absline@num} numbers `absolute' numbers, and
4635 % \cs{line@num} and \cs{subline@num} numbers `visible' numbers.
4636 %
4637 % \begin{macro}{\@lock}
4638 % \begin{macro}{\sub@lock}
4639 % The counts \cs{@lock} and \cs{sub@lock}
4640 % tell us the state of line-number
4641 % and sub-line-number locking. $0$ means we're not within a locked set of
4642 % lines; $1$ means we're at the first line in the set; $2$, at some
4643 % intermediate line; and $3$, at the last line.
4644 % \begin{macrocode}
4645 \newcount\@lock
4646 \newcount\sub@lock
4647 % \end{macrocode}
4648 % \end{macro}
4649 % \end{macro}
4650 %
4651 % \begin{macro}{\line@list}
4652 % \begin{macro}{\insertlines@list}
4653 % \begin{macro}{\actionlines@list}
4654 % \begin{macro}{\actions@list}
4655 % Now we can define the list macros that will be created from the
4656 % line-list file. We will maintain the following lists:
4657 % \begin{itemize}\addtolength{\itemsep}{-1ex}
4658 % \item \cs{line@list}: the page and line numbers for every
4659 % lemma marked by \cs{edtext}.
4660 % There are seven pieces of information, separated by vertical bars:
4661 % \phantomsection\label{linenumbers}
4662 % \begin{enumerate}\addtolength{\itemsep}{-1ex}
4663 % \item the starting page,
4664 % \item line, and
4665 % \item sub-line numbers, followed by the
4666 % \item ending page,
4667 % \item line, and
4668 % \item sub-line numbers, and then the
4669 % \item font specifier for the lemma.
4670 % \end{enumerate}
4671 %
4672 %
4673 % These line numbers are all visible numbers.
4674 % The font specifier is a set of four codes for font encoding,
4675 % family, series, and shape, separated by \verb"/" characters.
4676 % Thus a lemma that
4677 % started on page $23$, line $35$ and
4678 % went on until page $24$, line $3$
4679 % (with no sub-line numbering), and was typeset in a normal roman font
4680 % would have a line list entry like this: \\
4681 % \verb"23|35|0|24|3|0|OT1/cmr/m/n".
4682 %
4683 % There is one item in this list for every lemma marked by
4684 % \cs{edtext}, even if there are several notes to that lemma, or no
4685 % notes at all. \cs{edtext} reads the data in this list, making it
4686 % available for use in the text of notes.
4687 %
4688 % \item \cs{insertlines@list}: the line numbers of lines that have
4689 % footnotes or other insertions.
4690 % These are the absolute numbers where the corresponding
4691 % lemmas begin. This list contains one entry for every footnote in the
4692 % section; one lemma may contribute no footnotes or many footnotes.
4693 % This list is used by \cs{add@inserts} within \cs{do@line}, to tell
4694 % it where to insert notes.
4695 %
4696 % \item \cs{actionlines@list}: a list of absolute line numbers at
4697 % which we are to perform special
4698 % actions; these actions are specified by the \cs{actions@list} list
4699 % defined below.
4700 %
4701 % \item \cs{actions@list}: action codes corresponding to the line
4702 % numbers in \cs{actionlines@list}. These codes tell \Eledmac{} what action
4703 % it's supposed to take at each of these lines. One action, the
4704 % page-start action, is generated behind the scenes by \Eledmac{} itself;
4705 % the others, for specifying sub-lineation, line-number locking, and
4706 % line-number alteration, are generated only by explicit commands in
4707 % your input file. The page-start and line-number-alteration actions
4708 % require arguments, to specify the new values for the page or line
4709 % numbers; instead of storing those arguments in another list, we have
4710 % chosen the action-code values so that they can encode both the action
4711 % and the argument in these cases. Action codes greater than $-1000$
4712 % are page-start actions, and the code value is the page number; action
4713 % codes less than $-5000$ specify line numbers, and the code value is
4714 % a transformed version of the line number; action codes between these
4715 % two values specify other actions which require no argument.
4716 %
4717 % Here is the full list of action codes and their meanings:
4718 %
4719 % Any number greater than $-1000$ is a page-start action: the line number
4720 % associated with it is the first line on a page, and the action number is
4721 % the page number. (The cutoff of $-1000$ is chosen because negative
4722 % page-number values are used by some macro packages; we assume that
4723 % page-number values less than $-1000$ are not common.)
4724 % Page-start action codes are added to the list by
4725 % the \cs{page@action} macro, which is (indirectly) triggered by the
4726 % workings of the \cs{page@start} macro; that macro should always be
4727 % called in the output routine, just before the page contents are
4728 % assembled. \Eledmac{} calls it in \cs{pagecontents}.
4729 %
4730 % The action code $-1001$ specifies the start of sub-lineation: meaning
4731 % that, starting with the next line, we should be advancing
4732 % \cs{subline@num} at each start-of-line command, rather than
4733 % \cs{line@num}.
4734 %
4735 % The action code $-1002$ specifies the end of sub-lineation. At the
4736 % next start-of-line, we should clear the sub-line counter and start
4737 % advancing the line number. The action codes for starting and ending
4738 % sub-lineation are added to the list by the \cs{sub@action} macro, as
4739 % called to implement the \cs{startsub} and \cs{endsub} macros.
4740 %
4741 % The action code $-1003$ specifies the start of line number locking.
4742 % After the number for the current line is computed, it will remain
4743 % at that value through the next line that has an action code to end
4744 % locking.
4745 %
4746 % The action code $-1004$ specifies the end of line number locking.
4747 %
4748 % The action code $-1005$ specifies the start of sub-line number locking.
4749 % After the number for the current sub-line is computed, it will remain
4750 % at that value through the next sub-line that has an action code to end
4751 % locking.
4752 %
4753 % The action code $-1006$ specifies the end of sub-line number locking.
4754 %
4755 % The four action codes for line and sub-line number locking are added
4756 % to the list by the \cs{do@lockon} and \cs{do@lockoff} macros, as called
4757 % to implement the \cs{startlock} and \cs{endlock} macros.
4758 %
4759 % An action code of $-5000$ or less sets the current visible line
4760 % number (either the line number or the sub-line number, whichever is
4761 % currently being advanced) to a specific positive value. The value of
4762 % the code is $-(5000+n)$, where $n$ is the value (always $\ge 0$)
4763 % assigned to the current line number. Action codes of this type are
4764 % added to the list by the \cs{set@line@action} macro, as called to
4765 % implement the \cs{advanceline} and \cs{setline} macros: this action only
4766 % occurs when the user has specified some change to the line numbers
4767 % using those macros. Normally \Eledmac{} computes the visible line numbers
4768 % from the absolute line numbers with reference to the other
4769 % action codes and the settings they invoke; it doesn't require an
4770 % entry in the action-code list for every line.
4771 %
4772 % Here are the commands to create these lists:
4773 %
4774 % \begin{macrocode}
4775 \list@create{\line@list}
4776 \list@create{\insertlines@list}
4777 \list@create{\actionlines@list}
4778 \list@create{\actions@list}
4779
4780 % \end{macrocode}
4781 %
4782 % \end{itemize}
4783 % \end{macro}
4784 % \end{macro}
4785 % \end{macro}
4786 % \end{macro}
4787 %
4788 % \begin{macro}{\page@num}
4789 % \begin{macro}{\endpage@num}
4790 % \begin{macro}{\endline@num}
4791 % \begin{macro}{\endsubline@num}
4792 % We'll need some counts while we read the line-list,
4793 % for the page number and the ending page, line, and sub-line numbers.
4794 % Some of these will be used again later on, when we are acting on the
4795 % data in our list macros.
4796 % \begin{macrocode}
4797 \newcount\page@num
4798 \newcount\endpage@num
4799 \newcount\endline@num
4800 \newcount\endsubline@num
4801 % \end{macrocode}
4802 % \end{macro}
4803 % \end{macro}
4804 % \end{macro}
4805 % \end{macro}
4806 %
4807 % \begin{macro}{\ifnoteschanged@}
4808 % \begin{macro}{\noteschanged@true}
4809 % \begin{macro}{\noteschanged@false}
4810 % If the number of the footnotes in a section is different from what it was
4811 % during the last run, or if this is the very first time you've run
4812 % \LaTeX,
4813 % on this file, the information from the line-list used to place the
4814 % notes will be wrong, and some notes will probably be misplaced.
4815 % When this happens, we prefer
4816 % to give a single error message for the whole section rather than
4817 % messages at every point where we notice the problem, because
4818 % we don't really know where in the section notes were added or removed,
4819 % and the solution in any case is simply to run \LaTeX\ two more times;
4820 % there's no fix needed to the document. The
4821 % \cs{ifnoteschanged@} flag is set if such
4822 % a change in the number of notes is discovered at any point.
4823 % \begin{macrocode}
4824 \newif\ifnoteschanged@
4825 % \end{macrocode}
4826 % \end{macro}
4827 % \end{macro}
4828 % \end{macro}
4829 %
4830 % \DescribeMacro{\resetprevline@}
4831 % Inside the apparatus, at each note, the line number is stored in a macro called \cs{prevlineX},
4832 % where X is the letter of the current series.
4833 % This macro is called when using \cs{numberonlyfirstinline}.
4834 % This macro must be reset at the same time as the line number.
4835 % The \cs{resetprevline@} does this resetting for every series.
4836 % \begin{macro}{\resetprevline@}
4837 % \begin{macrocode}
4838 \newcommand*{\resetprevline@}{%
4839 \def\do##1{\global\csundef{prevline##1}}%
4840 \dolistloop{\@series}%
4841 }
4842 % \end{macrocode}
4843 % \end{macro}
4844 % \DescribeMacro{\resetprevpage@num}
4845 % Inside the apparatus, at each note, the page number is stored in a macro called \cs{prevpageX@num},
4846 % where X is the letter of the current series.
4847 % This macro is called when using \cs{parafootsep}.
4848 % This macro must be reset at the beginning of each numbered section
4849 % The \cs{resetprevpage@} command resets this macro for every series.
4850 % \begin{macro}{\resetprevpage@}
4851 % \begin{macrocode}
4852 \newcommand*{\resetprevpage@num}{%
4853 \def\do##1{\ifcsdef{prevpage##1@num}{\global\csname prevpage##1@num\endcsname=0}{}}%
4854 \dolistloop{\@series}%
4855 }
4856 % \end{macrocode}
4857 % \end{macro}
4858 % \subsection{Reading the line-list file}
4859 %
4860 %
4861 % \begin{macro}{\read@linelist}
4862 % \cs{read@linelist}\marg{file} is the control sequence
4863 % that's called by \cs{beginnumbering}
4864 % (via \cs{line@list@stuff}) to open and process a
4865 % line-list file; its argument is the name of the file.
4866 % \phantomsection\label{readlinelist}
4867 % \begin{macrocode}
4868 \newread\@inputcheck
4869 \newcommand*{\read@linelist}[1]{%
4870 \list@clearing@reg
4871 % \end{macrocode}
4872 %
4873 % When the file is there we start a new group and make some special
4874 % definitions we'll need to process it: it's a sequence of \TeX\
4875 % commands, but they require a few special settings. We make [ and
4876 % ] become grouping characters: they're used that way in the
4877 % line-list file, because we need to write them out one at a time
4878 % rather than in balanced pairs, and it's easier to just use
4879 % something other than real braces. @ must become a letter, since
4880 % this is run in the ordinary \LaTeX\ context. We ignore carriage
4881 % returns, since if we're in horizontal mode they can get
4882 % interpreted as spaces to be printed.
4883 %
4884 %
4885 % Our line, page, and line-locking counters were already zeroed
4886 % by \cs{line@list@stuff} if this is being called from within
4887 % \cs{beginnumbering}; sub-lineation will be turned off as well
4888 % in that case. On the other hand,
4889 % if this is being called from \cs{resumenumbering}, those things
4890 % should still have the values they had when \cs{pausenumbering}
4891 % was executed.
4892 %
4893 % If the file is not there, we print an informative message.
4894 %
4895 % Now, after these preliminaries, we start interpreting the file.
4896 %
4897 %
4898 % \begin{macrocode}
4899 \get@linelistfile{#1}%
4900 \endgroup
4901 % \end{macrocode}
4902 %
4903 % When the reading is done, we're all through with the
4904 % line-list file. All the information we needed
4905 % from it will now be encoded in our list macros.
4906 %
4907 % Finally, we
4908 % initialize the \cs{next@actionline} and \cs{next@action} macros,
4909 % which specify where and what the next action to be taken is.
4910 % \begin{macrocode}
4911 \global\page@num=\m@ne
4912 \ifx\actionlines@list\empty
4913 \gdef\next@actionline{1000000}%
4914 \else
4915 \gl@p\actionlines@list\to\next@actionline
4916 \gl@p\actions@list\to\next@action
4917 \fi}
4918
4919 % \end{macrocode}
4920 % \end{macro}
4921 %
4922 % \begin{macro}{\list@clearing@reg}
4923 % Clears the lists for \cs{read@linelist}
4924 % \changes{v0.7.0}{2005/02/22}{Added \cs{list@clearing@reg}}
4925 % \begin{macrocode}
4926 \newcommand*{\list@clearing@reg}{%
4927 \list@clear{\line@list}%
4928 \list@clear{\insertlines@list}%
4929 \list@clear{\actionlines@list}%
4930 \list@clear{\actions@list}%
4931 }%
4932 % \end{macrocode}
4933 % \end{macro}
4934 %
4935 % \begin{macro}{\get@linelistfile}
4936 % \Eledmac{} can take advantage of the \LaTeX\ `safe file input' macros
4937 % to get the line-list file.
4938 % \changes{v0.7.0}{2005/02/22}{Added \cs{get@linelistfile}}
4939 % \begin{macrocode}
4940 \newcommand*{\get@linelistfile}[1]{%
4941 \InputIfFileExists{#1}{%
4942 \global\noteschanged@false
4943 \begingroup
4944 \catcode`\[=1 \catcode`\]=2
4945 \makeatletter \catcode`\^^M=9}{%
4946 \led@warn@NoLineFile{#1}%
4947 \global\noteschanged@true
4948 \begingroup}%
4949 }
4950
4951 % \end{macrocode}
4952 % \end{macro}
4953 %
4954 % This version of \cs{read@linelist} creates list macros
4955 % containing data for the entire section, so they could get rather
4956 % large. It would be no more difficult to read the line-list file
4957 % incrementally rather than all at once: we could read, at the
4958 % start of each paragraph, only the commands relating to that
4959 % paragraph. But this would require that we
4960 % have two line-lists open at once, one for reading, one for
4961 % writing, and on systems without version numbers we'd have to do
4962 % some file renaming outside of \LaTeX\ for that to work. We've
4963 % retained this slower approach to avoid that sort of hacking
4964 % about, but have provided the \cs{pausenumbering} and
4965 % \cs{resumenumbering} macros to help you if you run into
4966 % macro memory limitations (see \reff{pause} above).
4967 %
4968 % \subsection{Commands within the line-list file}
4969 %
4970 % This section defines the commands that can appear within a
4971 % line-list file. They all have very short names because we are
4972 % likely to be writing very large numbers of them out. One macro,
4973 % \cs{@nl}, is especially short, since it will be written to the
4974 % line-list file once for every line of text in a numbered section.
4975 % (Another of these commands, \cs{@lab}, will be introduced in a
4976 % later section, among the cross-referencing commands it is
4977 % associated with.)
4978 %
4979 % When these commands modify the various page and line counters,
4980 % they deliberately do not say \cs{global}. This is because we
4981 % want them to affect only the counter values within the current
4982 % group when nested calls of \cs{@ref} occur. (The code assumes
4983 % throughout that the value of \cs{globaldefs} is zero.)
4984 %
4985 % The macros with \verb"action" in their names contain all the code
4986 % that modifies the action-code list: again, this is so that they
4987 % can be turned off easily for nested calls of \cs{@ref}.
4988 %
4989 % \begin{macro}{\line@list@version}
4990 % The \cs{line@list@version} check if the line-list file does not refers to the older commands of \Lpack{eledmac}.
4991 % In this case, we stop reading the line-list file.
4992 % Consequently, \cs{line@list@version} should be the first line of a line-number file.
4993 % \begin{macrocode}
4994 \newcommand{\line@list@version}[1]{%
4995 \IfStrEq{#1}{\this@line@list@version}%
4996 {}%
4997 {\ifledRcol%
4998 \led@warn@Obsolete{\jobname.\extensionchars\the\section@num}%
4999 \else%
5000 \led@warn@Obsolete{\jobname.\extensionchars\the\section@num}%
5001 \fi%
5002 \endinput%
5003 }%
5004 }%
5005 % \end{macrocode}
5006 % \end{macro}
5007 % \begin{macro}{\@nl}
5008 % \begin{macro}{\@nl@reg}
5009 % \changes{v1.12.0}{2014/08/05}{To ensure compatibility with \cs{musixtex}, \cs{@l} becomes \cs{@l}. Consequently, \cs{@l@reg} becomes \cs{@nl@reg}.}
5010 % \cs{@nl} does everything related to the start of a
5011 % new line of numbered text.
5012 %
5013 % In order to get the \verb?\setlinenum? to work Peter Wilson had to slip in some new
5014 % code at the start of the macro, to get the timing of the actions
5015 % correct. The problem was that his original naive implementation
5016 % of \verb?\setlinenum? had a unfortunate tendency to change the
5017 % number of the last line of the \emph{preceding} paragraph.
5018 % The new code is sort of based on the page number handling and
5019 % \verb?\setline? It seems
5020 % that a lot of fiddling with the line number internals is required.
5021 %
5022 % In November 2004 in order to accurately determine page numbers Peter Wilson added
5023 % these to the macro. It is now: \\
5024 % \cs{@nl}\marg{page counter number}\marg{printed page number} \\
5025 % I don't (yet) use the printed number (i.e., the \verb?\thepage?) but
5026 % it may come in handy later. The macro \cs{fix@page} checks if a new
5027 % page has started.
5028 %
5029 % \changes{v0.3.0}{2004/02/14}{Added a bunch of code to \cs{@nl} for handling
5030 % \cs{setlinenum}}
5031 % \changes{v0.6.0}{2004/11/16}{Extended \cs{@nl} to include the page number}
5032 % \changes{v0.6.0}{2004/11/16}{Added \cs{fix@page} to \cs{@nl}}
5033 % \changes{v0.7.0}{2005/02/22}{Added \cs{@nl@reg}}
5034 % \begin{macrocode}
5035 \newcommand{\@nl}[2]{%
5036 \fix@page{#1}%
5037 \@nl@reg}
5038 \newcommand*{\@nl@reg}{%
5039 \ifx\l@dchset@num\relax \else
5040 \advance\absline@num \@ne
5041 \set@line@action
5042 \let\l@dchset@num=\relax
5043 \advance\absline@num \m@ne
5044 \advance\line@num \m@ne
5045 \fi
5046 % \end{macrocode}
5047 %
5048 % First increment the absolute line-number, and perform
5049 % deferred actions relating to page starts and sub-lines.
5050 % \begin{macrocode}
5051 \advance\absline@num \@ne
5052 \ifx\next@page@num\relax \else
5053 \page@action
5054 \let\next@page@num=\relax
5055 \fi
5056 \ifx\sub@change\relax \else
5057 \ifnum\sub@change>\z@
5058 \sublines@true
5059 \else
5060 \sublines@false
5061 \fi
5062 \sub@action
5063 \let\sub@change=\relax
5064 \fi
5065 % \end{macrocode}
5066 %
5067 % Fix the lock counters, if necessary. A value of $1$ is advanced to
5068 % $2$; $3$ advances to $0$; other values are unchanged.
5069 % \begin{macrocode}
5070 \ifcase\@lock
5071 \or
5072 \@lock \tw@
5073 \or \or
5074 \@lock \z@
5075 \fi
5076 \ifcase\sub@lock
5077 \or
5078 \sub@lock \tw@
5079 \or \or
5080 \sub@lock \z@
5081 \fi
5082 % \end{macrocode}
5083 %
5084 % Now advance the visible line number, unless it's been locked.
5085 % \begin{macrocode}
5086 \ifsublines@
5087 \ifnum\sub@lock<\tw@
5088 \advance\subline@num \@ne
5089 \fi
5090 \else
5091 \ifnum\@lock<\tw@
5092 \advance\line@num \@ne \subline@num \z@
5093 \fi
5094 \fi}
5095
5096 % \end{macrocode}
5097 % \end{macro}
5098 % \end{macro}
5099 %
5100 %
5101 % \begin{macro}{\last@page@num}
5102 % \begin{macro}{\fix@page}
5103 % \cs{fix@page} basically replaces \cs{@page}. It determines whether or not
5104 % a new page has been started, based on the page values held by \cs{@nl}.
5105 % \changes{v0.6.0}{2004/11/16}{Added \cs{last@page@num} and \cs{fix@page}}
5106 % \begin{macrocode}
5107 \newcount\last@page@num
5108 \last@page@num=-10000
5109 \newcommand*{\fix@page}[1]{%
5110 \ifnum #1=\last@page@num
5111 \else
5112 \ifbypage@
5113 \csxdef{lastlinenumberon@\the\last@page@num}{\the\line@num}%
5114 \line@num=\z@ \subline@num=\z@
5115 \fi
5116 \page@num=#1\relax
5117 \last@page@num=#1\relax
5118 \def\next@page@num{#1}%
5119 \listxadd{\normal@page@break}{\the\absline@num}
5120 \fi}
5121
5122 % \end{macrocode}
5123 % \end{macro}
5124 % \end{macro}
5125 %
5126 % \begin{macro}{\@pend}
5127 % \begin{macro}{\@pendR}
5128 % \begin{macro}{\@lopL}
5129 % \begin{macro}{\@lopR}
5130 % These don't do anything at this point, but will have been added to the
5131 % auxiliary file(s) if the \Lpack{eledpar} package has been used. They
5132 % are just here to stop \Lpack{\eledmac} from moaning if the \Lpack{eledpar}
5133 % is used for one run and then not for the following one.
5134 % \changes{v0.6.0}{2004/11/16}{Added \cs{@pend},\cs{@pendR}, \cs{@lopL} and
5135 % \cs{@lopR} in anticipation of parallel processing}
5136 % \begin{macrocode}
5137 \newcommand*{\@pend}[1]{}
5138 \newcommand*{\@pendR}[1]{}
5139 \newcommand*{\@lopL}[1]{}
5140 \newcommand*{\@lopR}[1]{}
5141
5142 % \end{macrocode}
5143 % \end{macro}
5144 % \end{macro}
5145 % \end{macro}
5146 % \end{macro}
5147 %
5148 % \begin{macro}{\sub@on}
5149 % \begin{macro}{\sub@off}
5150 % The \cs{sub@on} and \cs{sub@off} macros
5151 % turn sub-lineation on and off\/: but not directly, since such changes
5152 % don't really take effect until the next line of text. Instead
5153 % they set a flag that notifies \cs{@nl} of the necessary action.
5154 % \begin{macrocode}
5155 \newcommand*{\sub@on}{\ifsublines@
5156 \let\sub@change=\relax
5157 \else
5158 \def\sub@change{1}%
5159 \fi}
5160 \newcommand*{\sub@off}{\ifsublines@
5161 \def\sub@change{-1}%
5162 \else
5163 \let\sub@change=\relax
5164 \fi}
5165
5166 % \end{macrocode}
5167 % \end{macro}
5168 % \end{macro}
5169 %
5170 % \begin{macro}{\@adv}
5171 % The \cs{@adv}\marg{num} macro advances
5172 % the current visible line number by the amount specified as
5173 % its argument. This is used to implement \cs{advanceline}.
5174 % \begin{macrocode}
5175 \newcommand*{\@adv}[1]{\ifsublines@
5176 \advance\subline@num by #1\relax
5177 \ifnum\subline@num<\z@
5178 \led@warn@BadAdvancelineSubline
5179 \subline@num \z@
5180 \fi
5181 \else
5182 \advance\line@num by #1\relax
5183 \ifnum\line@num<\z@
5184 \led@warn@BadAdvancelineLine
5185 \line@num \z@
5186 \fi
5187 \fi
5188 \set@line@action}
5189
5190 % \end{macrocode}
5191 % \end{macro}
5192 %
5193 % \begin{macro}{\@set}
5194 % The \cs{@set}\marg{num} macro sets
5195 % the current visible line number to the value specified as
5196 % its argument. This is used to implement \cs{setline}.
5197 % \begin{macrocode}
5198 \newcommand*{\@set}[1]{\ifsublines@
5199 \subline@num=#1\relax
5200 \else
5201 \line@num=#1\relax
5202 \fi
5203 \set@line@action}
5204
5205 % \end{macrocode}
5206 % \end{macro}
5207 %
5208 % \begin{macro}{\l@d@set}
5209 % \begin{macro}{\l@dchset@num}
5210 % The \cs{l@d@set}\marg{num} macro sets
5211 % the line number for the next \verb?\pstart...? to the value specified as
5212 % its argument. This is used to implement \cs{setlinenum}.
5213 %
5214 % \verb?\l@dchset@num? is a flag to the \verb?\@l? macro. If it is not
5215 % \verb?\relax? then a linenumber change is to be done.
5216 % \begin{macrocode}
5217 \newcommand*{\l@d@set}[1]{%
5218 \line@num=#1\relax
5219 \advance\line@num \@ne
5220 \def\l@dchset@num{#1}}
5221 \let\l@dchset@num\relax
5222
5223 % \end{macrocode}
5224 % \end{macro}
5225 % \end{macro}
5226
5227 %
5228 % \begin{macro}{\page@action}
5229 % \cs{page@action}
5230 % adds an entry to the action-code list to change the page number.
5231 % \begin{macrocode}
5232 \newcommand*{\page@action}{%
5233 \xright@appenditem{\the\absline@num}\to\actionlines@list
5234 \xright@appenditem{\next@page@num}\to\actions@list}
5235 % \end{macrocode}
5236 % \end{macro}
5237 %
5238 % \begin{macro}{\set@line@action}
5239 % \cs{set@line@action} adds an entry to the action-code
5240 % list to change the visible line number.
5241 % \begin{macrocode}
5242 \newcommand*{\set@line@action}{%
5243 \xright@appenditem{\the\absline@num}\to\actionlines@list
5244 \ifsublines@
5245 \@l@dtempcnta=-\subline@num
5246 \else
5247 \@l@dtempcnta=-\line@num
5248 \fi
5249 \advance\@l@dtempcnta by -5000
5250 \xright@appenditem{\the\@l@dtempcnta}\to\actions@list}
5251 % \end{macrocode}
5252 % \end{macro}
5253 %
5254 % \begin{macro}{\sub@action}
5255 % \cs{sub@action}
5256 % adds an entry to the action-code list to turn sub-lineation on or
5257 % off, according to the current value of the \cs{ifsublines@} flag.
5258 % \begin{macrocode}
5259 \newcommand*{\sub@action}{%
5260 \xright@appenditem{\the\absline@num}\to\actionlines@list
5261 \ifsublines@
5262 \xright@appenditem{-1001}\to\actions@list
5263 \else
5264 \xright@appenditem{-1002}\to\actions@list
5265 \fi}
5266 % \end{macrocode}
5267 % \end{macro}
5268 %
5269 % \begin{macro}{\lock@on}
5270 % \begin{macro}{\do@lockon}
5271 % \begin{macro}{\do@lockonL}
5272 % \cs{lock@on}
5273 % adds an entry to the action-code list to turn line number
5274 % locking on. The current setting of the sub-lineation flag tells us
5275 % whether this applies to line numbers or sub-line numbers.
5276 %
5277 % Adding commands to the action list is slow, and it's very often the
5278 % case that a lock-on command is immediately followed by a lock-off
5279 % command in the line-list file, and therefore really does nothing.
5280 % We use a look-ahead scheme here to detect such pairs, and add nothing
5281 % to the line-list in those cases.
5282 % \begin{macrocode}
5283 \newcommand*{\lock@on}{\futurelet\next\do@lockon}
5284 \newcommand*{\do@lockon}{%
5285 \ifx\next\lock@off
5286 \global\let\lock@off=\skip@lockoff
5287 \else
5288 \do@lockonL
5289 \fi}
5290 \newcommand*{\do@lockonL}{%
5291 \xright@appenditem{\the\absline@num}\to\actionlines@list
5292 \ifsublines@
5293 \xright@appenditem{-1005}\to\actions@list
5294 \ifnum\sub@lock=\z@
5295 \sub@lock \@ne
5296 \else
5297 \ifnum\sub@lock=\thr@@
5298 \sub@lock \@ne
5299 \fi
5300 \fi
5301 \else
5302 \xright@appenditem{-1003}\to\actions@list
5303 \ifnum\@lock=\z@
5304 \@lock \@ne
5305 \else
5306 \ifnum\@lock=\thr@@
5307 \@lock \@ne
5308 \fi
5309 \fi
5310 \fi}
5311
5312 % \end{macrocode}
5313 % \end{macro}
5314 % \end{macro}
5315 % \end{macro}
5316 %
5317 % \begin{macro}{\lock@off}
5318 % \begin{macro}{\do@lockoff}
5319 % \begin{macro}{\do@lockoffL}
5320 % \begin{macro}{\skip@lockoff}
5321 % \cs{lock@off} adds an entry to the action-code list
5322 % to turn line number locking off.
5323 % \begin{macrocode}
5324 \newcommand*{\do@lockoffL}{%
5325 \xright@appenditem{\the\absline@num}\to\actionlines@list
5326 \ifsublines@
5327 \xright@appenditem{-1006}\to\actions@list
5328 \ifnum\sub@lock=\tw@
5329 \sub@lock \thr@@
5330 \else
5331 \sub@lock \z@
5332 \fi
5333 \else
5334 \xright@appenditem{-1004}\to\actions@list
5335 \ifnum\@lock=\tw@
5336 \@lock \thr@@
5337 \else
5338 \@lock \z@
5339 \fi
5340 \fi}
5341 \newcommand*{\do@lockoff}{\do@lockoffL}
5342 \newcommand*{\skip@lockoff}{\global\let\lock@off=\do@lockoff}
5343 \global\let\lock@off=\do@lockoff
5344
5345 % \end{macrocode}
5346 % \end{macro}
5347 % \end{macro}
5348 % \end{macro}
5349 % \end{macro}
5350 %
5351 % \begin{macro}{\n@num}
5352 % These macros implement the \cs{skipnumbering} command.
5353 % They use a new action code, namely 1007.
5354 % \changes{v0.7.0}{2005/02/22}{Added \cs{n@num}}
5355 % \changes{v1.21.0}{2015/04/13}{\cs{n@num} defined only one time for both \Eledmac{} and \Eledpar{}}
5356 % \changes{v1.21.0}{2015/04/13}{\cs{n@num@ref} deleted}
5357 % \begin{macrocode}
5358 \newcommand*{\n@num}{%
5359 \ifledRcol%
5360 \xright@appenditem{\the\absline@numR}\to\actionlines@listR
5361 \xright@appenditem{-1007}\to\actions@listR
5362 \else%
5363 \xright@appenditem{\the\absline@num}\to\actionlines@list%
5364 \xright@appenditem{-1007}\to\actions@list%
5365 \fi%
5366 }%
5367
5368 % \end{macrocode}
5369 % \end{macro}
5370 % \begin{macro}{\n@num@stanza}
5371 % This macro implements the \cs{skipnumbering} for stanza command.
5372 % It uses a new action code, namely 1008.
5373 % \begin{macrocode}
5374 \newcommand*{\n@num@stanza}{%
5375 \ifledRcol%
5376 \xright@appenditem{\the\absline@numR}\to\actionlines@listR%
5377 \xright@appenditem{-1008}\to\actions@listR%
5378 \else%
5379 \xright@appenditem{\the\absline@num}\to\actionlines@list%%
5380 \xright@appenditem{-1008}\to\actions@list%
5381 \fi%
5382 }
5383 % \end{macrocode}
5384 % \end{macro}
5385 % \begin{macro}{\ifl@dhidenumber}
5386 % \begin{macro}{\hidenumbering}
5387 % \cs{hidenumbering} hides number in margin.
5388 % It uses action code 1009.
5389 % \begin{macro}{\h@num}
5390 % \begin{macrocode}
5391 \newif\ifl@dhidenumber
5392 \newcommand*{\hidenumbering}{
5393 \ifledRcol%
5394 \write\linenum@outR{\string\hide@num}%
5395 \else%
5396 \write\linenum@out{\string\hide@num}%
5397 \fi%
5398 }%
5399 \newcommand*{\hide@num}{%
5400 \ifledRcol%
5401 \xright@appenditem{\the\absline@numR}\to\actionlines@listR%
5402 \xright@appenditem{-1009}\to\actions@listR%
5403 \else%
5404 \xright@appenditem{\the\absline@num}\to\actionlines@list%%
5405 \xright@appenditem{-1009}\to\actions@list%
5406 \fi%
5407 }
5408 % \end{macrocode}
5409 % \end{macro}
5410 % \end{macro}
5411 % \end{macro}
5412 % \begin{macro}{\@ref}
5413 % \begin{macro}{\insert@count}
5414 % \cs{@ref}
5415 % marks the start of a passage, for creation of a footnote reference.
5416 % It takes two arguments:
5417 % \begin{itemize}\addtolength{\itemsep}{-1ex}
5418 % \item \verb"#1", the number of entries to add to \cs{insertlines@list}
5419 % for this reference. \SpecialMainIndex{\insert@count}
5420 % This value, here and within \cs{edtext},
5421 % which computes it and writes it to the line-list file,
5422 % will be stored in the count \cs{insert@count}.
5423 % \begin{macrocode}
5424 \newcount\insert@count
5425 % \end{macrocode}
5426 %
5427 % \item \verb"#2", a sequence of other line-list-file commands, executed to
5428 % determine the ending line-number. (This may also include other
5429 % \cs{@ref} commands, corresponding to uses of \cs{edtext}
5430 % within the first argument of another instance of \cs{edtext}.)
5431 % \end{itemize}
5432 %
5433 % \begin{macro}{\dummy@ref}
5434 % When nesting of \cs{@ref} commands does occur, it's necessary to
5435 % temporarily redefine \cs{@ref} within \cs{@ref}, so that we're only
5436 % doing one of these at a time.
5437 % \begin{macrocode}
5438 \newcommand*{\dummy@ref}[2]{#2}
5439 % \end{macrocode}
5440 % \end{macro}
5441 %
5442 % \begin{macro}{\@ref@reg}
5443 % The first thing \cs{@ref} (i.e. \cs{@ref@reg}) itself does is to add
5444 % the specified number
5445 % of items to the \cs{insertlines@list} list.
5446 % \changes{v0.7.0}{2005/02/22}{Added \cs{@ref@reg}}
5447 % \begin{macrocode}
5448 \newcommand*{\@ref}[2]{%
5449 \@ref@reg{#1}{#2}}
5450 \newcommand*{\@ref@reg}[2]{%
5451 \global\insert@count=#1\relax
5452 \global\advance\@edtext@level by 1%
5453 \loop\ifnum\insert@count>\z@
5454 \xright@appenditem{\the\absline@num}\to\insertlines@list
5455 \global\advance\insert@count \m@ne
5456 \repeat
5457 % \end{macrocode}
5458 %
5459 % Next, process the second argument to determine the page
5460 % and line numbers for the end of this lemma.
5461 % We temporarily equate \cs{@ref} to a different macro that just executes
5462 % its argument, so that nested \cs{@ref} commands are just skipped
5463 % this time. Some other macros need to be temporarily redefined to
5464 % suppress their action.
5465 % \begin{macrocode}
5466 \begingroup
5467 \let\@ref=\dummy@ref
5468 \let\@lopL\@gobble
5469 \let\page@action=\relax
5470 \let\sub@action=\relax
5471 \let\set@line@action=\relax
5472 \let\@lab=\relax
5473 \let\@lemma=\relax%
5474 \let\@sw\@gobblethree%
5475 #2
5476 \global\endpage@num=\page@num
5477 \global\endline@num=\line@num
5478 \global\endsubline@num=\subline@num
5479 \endgroup
5480 % \end{macrocode}
5481 %
5482 % Now store all the information about the location of the lemma's
5483 % start and end in \cs{line@list}.
5484 % \begin{macrocode}
5485 \xright@appenditem%
5486 {\the\page@num|\the\line@num|%
5487 \ifsublines@ \the\subline@num \else 0\fi|%
5488 \the\endpage@num|\the\endline@num|%
5489 \ifsublines@ \the\endsubline@num \else 0\fi}\to\line@list
5490 % \end{macrocode}
5491 % Create a list which stores every second argument of each \cs{@sw}
5492 % in this lemma, at this level.
5493 % Also set the boolean about the use of lemma in this edtext level to false.
5494 % \begin{macrocode}
5495 \expandafter\list@create\expandafter{\csname sw@list@edtext@tmp@\the\@edtext@level\endcsname}%
5496 \providebool{lemmacommand@\the\@edtext@level}%
5497 \boolfalse{lemmacommand@\the\@edtext@level}%
5498 % \end{macrocode}
5499 % Execute the second argument of \cs{@ref} again,
5500 % to perform for real all the commands within it.
5501 % \begin{macrocode}
5502 #2%
5503 % \end{macrocode}
5504 % Now, we store the list of \cs{@sw} of this current \cs{edtext} as an element of
5505 % the global list of list of \cs{@sw} for a \cs{edtext} depth.
5506 % \begin{macrocode}
5507 \ifnum\@edtext@level>0%
5508 \def\create@this@edtext@level{\expandafter\list@create\expandafter{\csname sw@list@edtext@\the\@edtext@level\endcsname}}%
5509 \ifcsundef{sw@list@edtext@\the\@edtext@level}{\create@this@edtext@level}{}%
5510 \letcs{\@tmp}{sw@list@edtext@\the\@edtext@level}%
5511 \letcs{\@tmpp}{sw@list@edtext@tmp@\the\@edtext@level}
5512 \xright@appenditem{\expandonce\@tmpp}\to\@tmp%
5513 \global\cslet{sw@list@edtext@\the\@edtext@level}{\@tmp}%
5514 \fi%
5515 % \end{macrocode}
5516 % Decrease edtext level counter.
5517 % \begin{macrocode}
5518 \global\advance\@edtext@level by -1%
5519 % \end{macrocode}
5520 % \begin{macrocode}
5521 }
5522
5523 % \end{macrocode}
5524 % \end{macro}
5525 % \end{macro}
5526 % \end{macro}
5527 %
5528 % \subsection{Writing to the line-list file}
5529 %
5530 % We've now defined all the counters, lists, and commands involved in
5531 % reading the line-list file at the start of a section. Now we'll
5532 % cover the commands that \Eledmac{} uses within the text of a
5533 % section to write commands out to the line-list.
5534 %
5535 % \begin{macro}{\linenum@out}
5536 % The file will be opened on output stream \cs{linenum@out}.
5537 % \begin{macrocode}
5538 \newwrite\linenum@out
5539 % \end{macrocode}
5540 % \end{macro}
5541 %
5542 % \begin{macro}{\iffirst@linenum@out@}
5543 % \begin{macro}{\first@linenum@out@true}
5544 % \begin{macro}{\first@linenum@out@false}
5545 % Once any file is opened on this stream, we keep it open forever, or
5546 % else switch to another file that we keep open. The reason is that
5547 % we want the output routine to write the page number for every page
5548 % to this file; otherwise we'd have to write it at the start of
5549 % every line.
5550 % But it's not very easy for the output routine to tell whether an
5551 % output stream is open or not. There's no way to test the status of
5552 % a particular output stream directly, and
5553 % the asynchronous nature of output routines makes the
5554 % status hard to determine by other means.
5555 %
5556 % We can manage pretty well by means of the \cs{iffirst@linenum@out@}
5557 % flag; its inelegant name suggests the nature of the problem that
5558 % made its creation necessary. It's set
5559 % to be \verb"true" before any \cs{linenum@out} file is opened. When such a file
5560 % is opened for the first time, it's done using \cs{immediate}, so that
5561 % it will at once be safe for the output routine to write to it; we then
5562 % set this flag to \verb"false".
5563 % \begin{macrocode}
5564 \newif\iffirst@linenum@out@
5565 \first@linenum@out@true
5566 % \end{macrocode}
5567 % \end{macro}
5568 % \end{macro}
5569 % \end{macro}
5570 %
5571 % \begin{macro}{\this@line@list@version}
5572 % The commands allowed in the line-list file and their arguments
5573 % can change between two version of \Eledmac.
5574 % The \cs{this@line@list@version} command is upgraded when it happens.
5575 % It is written in the file list.
5576 % If we process a line-list file which used a older version, that means the commands used insided are deprecated, and we can't use them.
5577 % \begin{macrocode}
5578 \newcommand{\this@line@list@version}{2}%
5579 % \end{macrocode}
5580 % \end{macro}
5581 % \begin{macro}{\line@list@stuff}
5582 % The \cs{line@list@stuff}\marg{file} macro, which
5583 % is called by \cs{beginnumbering}, performs
5584 % all the line-list operations needed at the start of a section.
5585 % Its argument is the name of the line-list file.
5586 % \begin{macrocode}
5587 \newcommand*{\line@list@stuff}[1]{%
5588 % \end{macrocode}
5589 %
5590 % First, use the commands of the previous section to interpret the
5591 % line-list file from the last run.
5592 % \begin{macrocode}
5593 \read@linelist{#1}%
5594 % \end{macrocode}
5595 %
5596 % Now close the current output line-list file, if any, and open a new one.
5597 % The first time we open a line-list file for output, we do it using
5598 % \cs{immediate}, and clear the \cs{iffirst@linenum@out@} flag.
5599 % \changes{v0.2.2}{2003/11/09}{Added initial write of page number in
5600 % \cs{line@list@stuff}}
5601 % \changes{v0.7.0}{2005/02/25}{Deleted \cs{page@start} from \cs{line@list@stuff}}
5602 % \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.}
5603 % \begin{macrocode}
5604 \iffirst@linenum@out@
5605 \immediate\closeout\linenum@out%
5606 \global\first@linenum@out@false%
5607 \immediate\openout\linenum@out=#1\relax%
5608 \immediate\write\linenum@out{\string\line@list@version{\this@line@list@version}}%
5609 \else
5610 % \end{macrocode}
5611 % If we get here, then this is
5612 % not the first line-list we've seen, so we
5613 % don't open or close the files immediately.
5614 % \begin{macrocode}
5615 \if@minipage%
5616 \leavevmode%
5617 \fi%
5618 \closeout\linenum@out%
5619 \openout\linenum@out=#1\relax%
5620 \fi}
5621
5622 % \end{macrocode}
5623 % \end{macro}
5624 %
5625 % \begin{macro}{\new@line}
5626 % The \cs{new@line} macro sends the \cs{@nl} command to the line-list
5627 % file, to mark the start of a new text line, and its page number.
5628 % \changes{v0.6.0}{2004/11/16}{Extended \cs{new@line} to output page numbers}
5629 % \begin{macrocode}
5630 \newcommand*{\new@line}{%
5631 \IfStrEq{\led@pb@setting}{after}%
5632 {\xifinlist{\the\absline@num}{\l@prev@nopb}%
5633 {\xifinlist{\the\absline@num}{\normal@page@break}%
5634 {\numgdef{\@next@page}{\thepage+1}%
5635 \write\linenum@out{\string\@nl[\@next@page][\@next@page]}%
5636 }%
5637 {\write\linenum@out{\string\@nl[\the\c@page][\thepage]}}%
5638 }%
5639 {\write\linenum@out{\string\@nl[\the\c@page][\thepage]}}}%
5640 {}%
5641 \IfStrEq{\led@pb@setting}{before}%
5642 {\numdef{\next@absline}{\the\absline@num+1}%
5643 \xifinlist{\next@absline}{\l@prev@nopb}%
5644 {\xifinlist{\the\absline@num}{\normal@page@break}%
5645 {\numgdef{\nc@page}{\c@page+1}%
5646 \write\linenum@out{\string\@nl[\nc@page][\nc@page]}%
5647 }%
5648 {\write\linenum@out{\string\@nl[\the\c@page][\thepage]}}%
5649 }%
5650 {\write\linenum@out{\string\@nl[\the\c@page][\thepage]}}%
5651 }%
5652 {}%
5653 \IfStrEqCase{\led@pb@setting}{{before}{\relax}{after}{\relax}}[\write\linenum@out{\string\@nl[\the\c@page][\thepage]}]%
5654 }
5655
5656 % \end{macrocode}
5657 % \end{macro}
5658 % \begin{macro}{\if@noneed@Footnote}
5659 % \cs{if@noneed@Footnote} is a boolean to check if we have to print a error message when a \cs{edtext} is called without any footnotes.
5660 % \begin{macro}{\flag@start}
5661 % \begin{macro}{\flag@end}
5662 % \changes{v1.12.3}{2014/08/15}{\cs{flag@start} and \cs{flag@end} are now defined only one time for eledmac and eledpar}
5663 % \changes{v1.12.3}{2014/08/15}{\cs{flag@start} send a error message when a \cs{edtext} is done without insert (note)}
5664 % \changes{v1.12.8}{2014/09/12}{\cs{flag@start} don't send a error message when a \cs{edtext} is done without insert (note) but have a endnote}
5665 % We enclose a lemma marked by \cs{edtext} in
5666 % \cs{flag@start} and \cs{flag@end}: these send the \cs{@ref}
5667 % command to the line-list file. \cs{edtext} is responsible for
5668 % setting the value of \cs{insert@count} appropriately; it
5669 % actually gets done by the various footnote macros.
5670 % \begin{macrocode}
5671 \newif\if@noneed@Footnote%
5672
5673 \newcommand*{\flag@start}{%
5674 \ifledRcol%
5675 \edef\next{\write\linenum@outR{%
5676 \string\@ref[\the\insert@countR][}}%
5677 \next%
5678 \ifnum\insert@countR<1%
5679 \if@noneed@Footnote\else%
5680 \led@err@EdtextWithoutFootnote%
5681 \fi%
5682 \fi%
5683 \else%
5684 \edef\next{\write\linenum@out{%
5685 \string\@ref[\the\insert@count][}}%
5686 \next%
5687 \ifnum\insert@count<1%
5688 \if@noneed@Footnote\else%
5689 \led@err@EdtextWithoutFootnote%
5690 \fi%
5691 \fi%
5692 \fi}%
5693
5694 % \end{macrocode}
5695 % \end{macro}
5696 % \end{macro}
5697 % \end{macro}
5698 %
5699 % \begin{macro}{\page@start}
5700 % Originally the commentary was: \cs{page@start} writes a command to the line-list
5701 % file noting the current page number;
5702 % when used within an output routine, this should be called so as to place
5703 % its \cs{write} within the box that gets shipped out, and as close to
5704 % the top of that box as possible.
5705 %
5706 % However, in October 2004 Alexej Krukov\index{Krukov, Alexej} discovered that
5707 % when processing long paragraphs that included Russian, Greek and Latin texts
5708 % \Eledmac{} would go into an infinite loop, emitting thousands of blank pages.
5709 % This was caused by being unable to find an appropriate place in the
5710 % output routine. A different algorithm is now used for getting page numbers.
5711 % \changes{v0.6.0}{2004/11/16}{Made \cs{page@start} a no-op}
5712 % \begin{macrocode}
5713 \newcommand*{\page@start}{}
5714
5715 % \end{macrocode}
5716 % \end{macro}
5717 %
5718 % \begin{macro}{\startsub}
5719 % \begin{macro}{\endsub}
5720 % \changes{v1.15.0}{2015/01/12}{Restore subline feature (disabled by mistake in v1.8.0).}
5721 % \cs{startsub} and \cs{endsub}
5722 % turn sub-lineation on and off, by writing
5723 % appropriate instructions to the line-list file. When
5724 % sub-lineation is in effect, the line number counter is frozen and
5725 % the sub-line counter advances instead. If one of these commands
5726 % appears in the middle of a line, it doesn't take effect until the
5727 % next line; in other words, a line is counted as a line or
5728 % sub-line depending on what it started out as, even if that
5729 % changes in the middle.
5730 %
5731 % We tinker with \cs{lastskip} because a command of either sort
5732 % really needs to be attached to the last word preceding the change, not
5733 % the first word that follows the change. This is because sub-lineation
5734 % will often turn on and off in mid-line---stage directions, for example,
5735 % often are mixed with dialogue in that way---and when a line is mixed
5736 % we want to label it using the system that was in effect at its start.
5737 % But when sub-lineation begins at the very start of a line we have a
5738 % problem, if we don't put in this code.
5739 % \begin{macrocode}
5740 \newcommand*{\startsub}{\dimen0\lastskip
5741 \ifdim\dimen0>0pt \unskip \fi
5742 \write\linenum@out{\string\sub@on}%
5743 \ifdim\dimen0>0pt \hskip\dimen0 \fi}
5744 \def\endsub{\dimen0\lastskip
5745 \ifdim\dimen0>0pt \unskip \fi
5746 \write\linenum@out{\string\sub@off}%
5747 \ifdim\dimen0>0pt \hskip\dimen0 \fi}
5748
5749 % \end{macrocode}
5750 % \end{macro}
5751 % \end{macro}
5752 %
5753 % \begin{macro}{\advanceline}
5754 % You can use \cs{advanceline}\marg{num}
5755 % in running text to advance the current visible
5756 % line-number by a specified value, positive or negative.
5757 % \begin{macrocode}
5758 \newcommand*{\advanceline}[1]{\write\linenum@out{\string\@adv[#1]}}
5759 % \end{macrocode}
5760 % \end{macro}
5761 %
5762 % \begin{macro}{\setline}
5763 % You can use \cs{setline}\marg{num}
5764 % in running text (i.e., within \verb?\pstart...\pend?) to set the
5765 % current visible
5766 % line-number to a specified positive value.
5767 % \begin{macrocode}
5768 \newcommand*{\setline}[1]{%
5769 \ifnum#1<\z@
5770 \led@warn@BadSetline
5771 \else
5772 \write\linenum@out{\string\@set[#1]}%
5773 \fi}
5774
5775 % \end{macrocode}
5776 % \end{macro}
5777 %
5778 % \begin{macro}{\setlinenum}
5779 % You can use \cs{setlinenum}\marg{num}
5780 % before a \verb?\pstart? to set the visible line-number to a specified
5781 % positive value. It writes a \verb?\l@d@set? command to the line-list file.
5782 % \begin{macrocode}
5783 \newcommand*{\setlinenum}[1]{%
5784 \ifnum#1<\z@
5785 \led@warn@BadSetlinenum
5786 \else
5787 \write\linenum@out{\string\l@d@set[#1]}%
5788 \fi}
5789
5790 % \end{macrocode}
5791 % \end{macro}
5792 %
5793 % \begin{macro}{\startlock}
5794 % \begin{macro}{\endlock}
5795 % You can use \cs{startlock} or \cs{endlock}
5796 % in running text to start or end line number locking at
5797 % the current line. They decide whether line numbers or sub-line numbers
5798 % are affected, depending on the current state of the sub-lineation flags.
5799 % \begin{macrocode}
5800 \newcommand*{\startlock}{\write\linenum@out{\string\lock@on}}
5801 \def\endlock{\write\linenum@out{\string\lock@off}}
5802
5803 % \end{macrocode}
5804 % \end{macro}
5805 % \end{macro}
5806 %
5807 % \begin{macro}{\ifl@dskipnumber}
5808 % \begin{macro}{\ifl@dskipversenumber}
5809 % \begin{macro}{\l@dskipnumbertrue}
5810 % \begin{macro}{\l@dskipnumberfalse}
5811 % \begin{macro}{\skipnumbering}
5812 % In numbered text \cs{skipnumbering} will suspend the numbering
5813 % for that particular line.
5814 % \changes{v0.7.0}{2005/02/22}{Added \cs{skipnumbering} and supports}
5815 % \changes{v1.21.0}{2015/04/13}{\cs{skipnumbering} defined only one time for both \Eledmac{} and \Eledpar{}.}
5816 % \changes{v1.21.0}{2015/04/13}{Correct \cs{skipnumbering} for stanza.}
5817 % \changes{v1.21.0}{2015/04/13}{Delete \cs{skipnumbering@reg}.}
5818 % \begin{macrocode}
5819 \newif\ifl@dskipnumber
5820 \newif\ifl@dskipversenumber%
5821 \newcommand*{\skipnumbering}{%
5822 \leavevmode%
5823 \ifledRcol%
5824 \ifinstanza%
5825 \write\linenum@outR{\string\n@num@stanza}%
5826 \else%
5827 \write\linenum@outR{\string\n@num}%
5828 \fi%
5829 \advanceline{-1}%
5830 \else%
5831 \ifinstanza%
5832 \write\linenum@out{\string\n@num@stanza}%
5833 \else%
5834 \write\linenum@out{\string\n@num}%
5835 \fi%
5836 \advanceline{-1}%
5837 \fi%
5838 }%
5839
5840 % \end{macrocode}
5841 % \end{macro}
5842 % \end{macro}
5843 % \end{macro}
5844 % \end{macro}
5845 % \end{macro}
5846 %
5847 % \section{Marking text for notes}
5848 % \label{text}\relax
5849 %
5850 % The \cs{edtext} (or \cs{critext}) macro is used to create all
5851 % footnotes and endnotes,
5852 % as well as to print the portion of the main text to which a given note
5853 % or notes is keyed. The idea is to have that lemma appear only once in
5854 % the \file{.tex} file: all instances of it in the main text and in the
5855 % notes are copied from that one appearance.
5856 %
5857 % For convenience, I will use \cs{*text} when I do not need to distinguish
5858 % between \cs{edtext} and \cs{critext}.
5859 % The \cs{*text} macros take two arguments, the only difference between
5860 % \cs{edtext} and \cs{critext} is how the second argument is delineated.
5861 %
5862 % \cs{critext} requires two arguments. At any point within numbered
5863 % text, you use it by saying:
5864 % \begin{verbatim}
5865 % \critext{#1}#2/
5866 % \end{verbatim}
5867 % Similarly \cs{edtext} requires the same two arguments
5868 % but you use it by saying:
5869 % \begin{verbatim}
5870 % \edtext{#1}{#2}
5871 % \end{verbatim}
5872 %
5873 % \begin{itemize}\addtolength{\itemsep}{-1ex}
5874 % \item \verb"#1" is the piece of the main text being glossed;
5875 % it gets added to the
5876 % main text, and is also used as a lemma for notes to it.
5877 %
5878 % \item \verb"#2" is a series of subsidiary macros that generate
5879 % various kinds of notes. With \cs{critext} the \verb"/" after \verb"#2" \emph{must} appear:
5880 % it marks the end of the macro. (\thetexbook,
5881 % p.\,204, points out that when
5882 % additional text to be matched follows the arguments like this, spaces
5883 % following the macro are not skipped, which is very desirable since
5884 % this macro will never be used except within text. Having an
5885 % explicit terminator also helps keep things straight when nested
5886 % calls to \cs{critext} are used.) Braces around
5887 % \verb"#2" are optional with \cs{critext} and required for \cs{edtext}.
5888 % \end{itemize}
5889 %
5890 % The \cs{*text} macro may be used (somewhat) recursively; that
5891 % is, \cs{*text} may be used within its own first argument. The
5892 % code would be much simpler without this feature, but nested notes
5893 % will commonly be necessary: it's quite likely that we'll have an
5894 % explanatory note for a long passage and notes on variants for
5895 % individual words within that passage. The situation we can't
5896 % handle is overlapping notes that aren't nested: for example, one
5897 % note covering lines 10--15, and another covering 12--18. You can
5898 % handle such cases by using the \cs{lemma} and \cs{linenum}
5899 % macros within \verb"#2": they alter the copy of the lemma and the
5900 % line numbers that are passed to the notes, and hence allow you to
5901 % overcome any limitations of this system, albeit with extra
5902 % effort.
5903 %
5904 % The recursive operation of \cs{*text} will fail if you try to use a copy
5905 % that is called something other than \cs{*text}. In order to handle
5906 % recursion, \cs{*text} needs to redefine its own definition temporarily
5907 % at one point, and that doesn't work if the macro you are calling is
5908 % not actually named \cs{*text}. There's no problem as long as \cs{*text}
5909 % is not invoked in the first argument. If you want to call \cs{*text}
5910 % something else, it is best to create instead a macro that expands
5911 % to an invocation of \cs{*text}, rather than copying \cs{*text} and giving
5912 % it a new name; otherwise you will need to add an appropriate
5913 % definition for your new macro to \cs{morenoexpands}.
5914 %
5915 % Side effects of our line-numbering code make it impossible to use
5916 % the usual footnote macros directly within a paragraph whose lines are
5917 % numbered (see comments to
5918 % \cs{do@line}, \reff{doline}).
5919 % Instead, the appropriate note-generating command
5920 % is appended to the list macro \cs{inserts@list}, and when \cs{pend}
5921 % completes the paragraph it inserts all the notes at the proper places.
5922 %
5923 % Note that we don't provide previous-note information, although it's
5924 % often wanted; your own macros must handle that. We can't do it
5925 % correctly without keeping track of what kind of notes have gone past:
5926 % it's not just a matter of remembering the line numbers associated with
5927 % the previous invocation of \cs{*text}, because that might have been for
5928 % a different kind of note. It is preferable for your footnote macros
5929 % to store and recall this kind of information if they need it.
5930 %
5931 %
5932 % \subsection{{\tt \protect\bslash edtext} (and {\tt \protect\bslash critext})
5933 % itself}
5934 %
5935 % The various note-generating macros might want to request that
5936 % commands be executed not at once, but in close connection with the
5937 % start or end of the lemma. For example, footnote numbers in the text
5938 % should be connected to the end of the lemma; or, instead of a single
5939 % macro to create a note listing variants, you might want to use
5940 % several macros in series to create individual variants, which would
5941 % each add information to a private macro or token register, which in
5942 % turn would be formatted and output when all of \verb"#2" for the lemma
5943 % has been read.
5944 %
5945 % \begin{macro}{\end@lemmas}
5946 % To accomodate this, we provide a list macro
5947 % to which macros may add commands that should subsequently
5948 % be executed at the end of the lemma when that lemma is added
5949 % to the text of the paragraph. A macro should add its contribution to
5950 % \cs{end@lemmas} by using \cs{xleft@appenditem}.
5951 % (Anything that needs to be done at
5952 % the \emph{start} of the lemma may be handled using \cs{aftergroup}, since
5953 % the commands specified within \cs{edtext}'s second argument are
5954 % executed within a group that ends just before the lemma is added to
5955 % the main text.)
5956 %
5957 % \cs{end@lemmas} is intended for the few things that need to be
5958 % associated with the end of the lemma, like footnote numbers. Such
5959 % numbers are not implemented in the current version, and indeed
5960 % no use is currently made of \cs{end@lemmas} or of the \cs{aftergroup}
5961 % trick. The general
5962 % approach would be to define a macro to be used within the second
5963 % argument of \cs{edtext} that would add the appropriate command to
5964 % \cs{end@lemmas}.
5965 %
5966 % Commands that are added to this list should always take care
5967 % not to do anything that adds possible line-breaks to the output;
5968 % otherwise line numbering could be thrown off.
5969 % \begin{macrocode}
5970 \list@create{\end@lemmas}
5971 % \end{macrocode}
5972 % \end{macro}
5973 %
5974 % \begin{macro}{\dummy@text}
5975 % We now need to define a number of macros that allow us to weed out
5976 % nested instances of \cs{edtext}, and other problematic macros, from
5977 % our lemma. This is similar to what we did in reading the line-list
5978 % file using \cs{dummy@ref} and various redefinitions---and that's
5979 % because nested \cs{edtext}s macros create nested \cs{@ref} entries
5980 % in the line-list file.
5981 %
5982 % Here's a macro that takes the same arguments as
5983 % \cs{critext} but merely returns the first argument and ignores
5984 % the second.
5985 % \begin{macrocode}
5986 \long\def\dummy@text#1#2/{#1}
5987 % \end{macrocode}
5988 % \end{macro}
5989 %
5990 % \begin{macro}{\dummy@edtext}
5991 % \LaTeX\ users are not used to delimited arguments, so we provide
5992 % a \cs{edtext} macro as well.
5993 % \begin{macrocode}
5994 \newcommand{\dummy@edtext}[2]{#1}
5995 % \end{macrocode}
5996 % \end{macro}
5997 %
5998 % \begin{macro}{\dummy@edtext@showlemma}
5999 % Some time, we want to obtain only the first argument of \cs{edtext}, while also wrapping it in \cs{showlemma}. For example, when printing a \cs{eledsection}.
6000 % \begin{macrocode}
6001 \newcommand{\dummy@edtext@showlemma}[2]{\showlemma{#1}}%
6002 % \end{macrocode}
6003 % \end{macro}
6004 %
6005 % We're going to need another macro that takes one argument and ignores
6006 % it entirely. This is supplied by the \LaTeX\ \cs{@gobble}\marg{arg}.
6007 %
6008 % \begin{macro}{\no@expands}
6009 % \begin{macro}{\morenoexpands}
6010 % We need to turn off macro expansion for certain sorts of macros we're
6011 % likely to see within the lemma and within the notes.
6012 %
6013 % The first class is font-changing macros. We suppress expansion for
6014 % them by letting them become equal to zero.\footnote{Since `control
6015 % sequences equivalent to characters are not expandable'---\thetexbook,
6016 % answer to Exercise 20.14.} This is done because we want to
6017 % pass into our notes the generic commands to change to roman or
6018 % whatever, and not their expansions that will ask for a particular style at
6019 % a specified size. The notes may well be in a smaller font, so the
6020 % command should be expanded later, when the note's environment is in
6021 % effect.
6022 %
6023 % A second sort to turn off includes a few of the accent macros.
6024 % Most are not a problem: an accent that's expanded to an \cs{accent}
6025 % command may be harder to read but it works just the same. The
6026 % ones that cause problems are: those that use alignments---\TeX\
6027 % seems to get confused about the difference between alignment
6028 % parameters and macro parameters; those that use temporary control
6029 % sequences; and those that look carefully at what the current font
6030 % is.
6031 %
6032 % (The \cs{copyright} macro defined in \PlainTeX\ has this sort of
6033 % problem as well, but isn't used enough to bother with. That macro,
6034 % and any other that causes trouble, will get by all right if you put
6035 % a \cs{protect} in front of it in your file.)
6036 %
6037 % We also need to eliminate all \Eledmac{} macros like \cs{edlabel} and
6038 % \cs{setline} that write things to auxiliary files: that writing
6039 % should be done only once. And we make
6040 % \cs{edtext} itself, if it appears within its own
6041 % argument, do nothing but copy its first argument.
6042 %
6043 % Finally, we execute \cs{morenoexpands}. The version of
6044 % \cs{morenoexpands} defined here does nothing; but you may define
6045 % a version of your own when you need to add more expansion
6046 % suppressions as needed with your macros. That makes it possible
6047 % to make such additions without needing to copy or modify the
6048 % standard \Eledmac{} code. If you define your own
6049 % \cs{morenoexpands}, you must be very careful about spaces: if the
6050 % macro adds any spaces to the text when it runs, extra space
6051 % will appear in the main text when \cs{edtext} is used.
6052 %
6053 % (A related problem, not addressed by these two macros,
6054 % is that of characters whose category code is changed by any
6055 % the macros used in the arguments to \cs{edtext}. Since the
6056 % category codes are set when the arguments are scanned, macros
6057 % that depend on changing them will not work. We have most often
6058 % encountered this with characters that are made `active' within
6059 % text in some, but not all, of the languages used within the document.
6060 % One way around the problem, if it takes this form,
6061 % is to ensure that those characters are \emph{always} active; within
6062 % languages that make no special use of them, their associated
6063 % control sequences should simply return the proper character.)
6064 % \changes{v0.2.0}{2003/07/25}{Added \cs{l@dtabnoexpands} to \cs{no@expands}}
6065 % \changes{v0.2.1}{203/08/25}{Removed some \cs{let}s from \cs{no@expands}.
6066 % These were in \edmac{} but I feel that they should not have been as they
6067 % disabled page/line refs in a footnotes}
6068 % \changes{v1.0.0}{2012/09/15}{Change to be compatible with new features}
6069 % \begin{macrocode}
6070 \newcommand*{\no@expands}{%
6071 \let\select@@lemmafont=0%
6072 \let\startsub=\relax \let\endsub=\relax
6073 \let\startlock=\relax \let\endlock=\relax
6074 \let\edlabel=\@gobble
6075 \let\setline=\@gobble \let\advanceline=\@gobble
6076 \let\critext=\dummy@text
6077 \let\sameword\sameword@inedtext%
6078 \let\edtext=\dummy@edtext
6079 \l@dtabnoexpands
6080 \morenoexpands}
6081 \let\morenoexpands=\relax
6082
6083 % \end{macrocode}
6084 % \end{macro}
6085 % \end{macro}
6086 %
6087 % \begin{macro}{\@tag}
6088 % Now, we define an empty \cs{@tag} command. It will be redefine by \cs{edtext}: its value is the first args. It will be used by the \cs{Xfootnote} commands.
6089 % \begin{macrocode}
6090 \newcommand{\@tag}{}
6091 % \end{macrocode}
6092 % \end{macro}
6093 % \begin{macro}{\@edtext@level}
6094 % \changes{v1.15.0}{2015/01/12}{New boolean \cs{if@edtext@}.}
6095 % \changes{v1.23.0}{2015/05/18}{The boolean \cs{if@edtext@} becomes the counter \cs{edtext@level}.}
6096 % This counter is increased by 1 at each level of \cs{edtext} (or \cs{critext}).
6097 % That is useful for some commands which can have a different behavior if called inside or outside of the \marg{lemma} argument.
6098 % \begin{macrocode}
6099 \newcount\@edtext@level%
6100 \@edtext@level=0%
6101 % \end{macrocode}
6102 % \end{macro}
6103 % \begin{macro}{\critext}
6104 % \changes{v1.16.0}{2014/01/23}{\cs{critext} and \cs{edtext} are now defined only in eledmac, not in \Lpack{eledpar}. Debug wrong numbering when using \cs{sameword} + \Lpack{eledpar} + \cs{tag} command.}
6105 % Now we begin \cs{critext} itself. The definition requires a \verb"/" after
6106 % the arguments: this eliminates the possibility of problems about
6107 % knowing where \verb"#2" ends. This also changes the handling of spaces
6108 % following an invocation of the macro: normally such spaces are
6109 % skipped, but in this case they're significant because \verb"#2" is
6110 % a `delimited parameter'. Since \cs{critext} is always used in running
6111 % text, it seems more appropriate to pay attention to spaces than to
6112 % skip them.
6113 %
6114 % \changes{v1.17.0}{2015/02/09}{The historical \cs{critext} now just refers to \cs{edtext} (code refactoring).}
6115 % Since v.1.17.0, \cs{critext} only refers to \cs{edtext}.
6116 % \begin{macrocode}
6117 \long\def\critext#1#2/{\edtext{#1}{#2}}%
6118 % \end{macrocode}
6119 % \end{macro}
6120 %
6121 % \begin{macro}{\edtext}
6122 % \changes{v0.4.0}{2004/02/29}{Added \cs{showlemma} to \cs{edtext} (and \cs{critext})}
6123 % \changes{v1.4.0}{2012/11/16}{Compatibility of \cs{edtext} (and \cs{critext}) with the right-to-left direction (with Polyglossia).}
6124 % \changes{v1.17.0}{2015/02/09}{Error message when calling \cs{edtext} outside of a numbered paragraph.}
6125 % When executed, \cs{edtext} first ensures that we're in
6126 % horizontal mode.
6127 % \begin{macrocode}
6128 \newcommand{\edtext}[2]{\leavevmode%
6129 % \end{macrocode}
6130 % Then, check if we are in a numbered paragraph (\cs{pstart}\ldots\cs{pend})..
6131 % \begin{macrocode}
6132 \ifnumberedpar@%
6133 % \end{macrocode}
6134 % We increase the \cs{@edtext@} counter to know in which level of \cs{edtext} we are.
6135 % \begin{macrocode}
6136 \global\advance\@edtext@level by 1%
6137 % \end{macrocode}
6138 % By default, we don't use \cs{lemma}
6139 % \begin{macrocode}
6140 \global\@lemmacommand@false%
6141 % \end{macrocode}
6142 % \begin{macrocode}
6143 \begingroup%
6144 % \end{macrocode}
6145 % We get the next series of samewords data in the list of samewords data for the current edtext level. We push them inside \cs{sw@inthisedtext}.
6146 % \begin{macrocode}
6147 \ifledRcol%
6148 \ifcsundef{sw@list@edtextR@\the\@edtext@level}%
6149 {\global\let\sw@inthisedtext\empty}%
6150 {\ifcsempty{sw@list@edtextR@\the\@edtext@level}%
6151 {\global\let\sw@inthisedtext\empty}%
6152 {\expandafter\gl@p\csname sw@list@edtextR@\the\@edtext@level\endcsname\to\sw@inthisedtext}%
6153 }%
6154 \else%
6155 \ifcsundef{sw@list@edtext@\the\@edtext@level}%
6156 {\global\let\sw@inthisedtext\empty}%
6157 {\ifcsempty{sw@list@edtext@\the\@edtext@level}%
6158 {\global\let\sw@inthisedtext\empty}%
6159 {\expandafter\gl@p\csname sw@list@edtext@\the\@edtext@level\endcsname\to\sw@inthisedtext}%
6160 }%
6161 \fi%
6162 % \end{macrocode}
6163 % \begin{macro}{\@tag}
6164 % \label{@tag}Our normal lemma is just argument \verb"#1"; but that argument could have
6165 % further invocations of \cs{edtext} within it. We get a copy of the
6166 % lemma without any \cs{edtext} macros within it by temporarily redefining
6167 % \cs{edtext} to just copy its first argument and ignore the other,
6168 % and then expand \verb"#1" into \cs{@tag}, our lemma.
6169 %
6170 % This is done within a group that starts here, in order to get the
6171 % original \cs{edtext} restored; within this group we've also turned
6172 % off the expansion of those control sequences commonly found within text
6173 % that can cause trouble for us.
6174 %
6175 % \begin{macrocode}
6176 \global\renewcommand{\@tag}{%
6177 \no@expands #1%
6178 }%
6179 % \end{macrocode}
6180 % \end{macro}
6181 % \begin{macro}{\l@d@nums}
6182 % \phantomsection\label{nums}
6183 % Prepare more data for the benefit of note-generating macros: the line
6184 % references and font specifier for this lemma go to \cs{l@d@nums}.
6185 % \begin{macrocode}
6186 \set@line%
6187 % \end{macrocode}
6188 % \end{macro}
6189 % \cs{insert@count} will be altered by the note-generating macros:
6190 % it counts the number of deferred footnotes or other insertions
6191 % generated by this instance of \cs{edtext}.
6192 % If we are in a right column (eledpar), we use \cs{insert@countR}
6193 % instead of \cs{insert@count}.
6194 % \begin{macrocode}
6195 \ifledRcol \global\insert@countR \z@%
6196 \else \global\insert@count \z@ \fi%
6197 % \end{macrocode}
6198 % Now process the note-generating macros in argument \verb"#2"
6199 % (i.e., \cs{Afootnote}, \cs{lemma}, etc.). \cs{ignorespaces} is here to
6200 % skip over any spaces that might appear at the start of \verb"#2";
6201 % otherwise they wind up in the main text. Footnote and other
6202 % macros that are used within \verb"#2" should all end with
6203 % \cs{ignorespaces} as well, to skip any spaces between macros when
6204 % several are used in series.
6205 % \begin{macrocode}
6206 \ignorespaces #2\relax%
6207 % \end{macrocode}
6208 % With polyglossia, you must track whether the language reads left to right (English) or right to left (Arabic).
6209 % \begin{macrocode}
6210 \@ifundefined{xpg@main@language}{%if not polyglossia
6211 \flag@start}%
6212 {\if@RTL\flag@end\else\flag@start\fi%
6213 }%
6214 % \end{macrocode}
6215 % We write in the numbered file wether the current \cs{edtext} has a \cs{lemma} in the the second argument.
6216 % \begin{macrocode}
6217 \if@lemmacommand@%
6218 \ifledRcol%
6219 \write\linenum@outR{\string\@lemma}%
6220 \else%
6221 \write\linenum@out{\string\@lemma}%
6222 \fi%
6223 \fi%
6224 % \end{macrocode}
6225 % Finally, we're ready to admit the first argument into the current
6226 % paragraph.
6227 %
6228 % It's important that we generate and output all the notes for this
6229 % chunk of text \emph{before} putting the text into the paragraph: notes
6230 % that are referenced by line number should generally be tied to the
6231 % start of the passage they gloss, not the end. That should all be done
6232 % within the expansion of \verb"#2" above, or in \cs{aftergroup}
6233 % commands within that expansion.
6234 % \begin{macrocode}
6235 \endgroup%
6236 \showlemma{#1}%
6237 % \end{macrocode}
6238 %
6239 % Finally, we add any insertions that are
6240 % associated with the \emph{end} of
6241 % the lemma. Footnotes that are identified by symbols rather than by
6242 % where the lemma begins in the main text need to be done here, and
6243 % not above.
6244 %
6245 % \begin{macrocode}
6246 \ifx\end@lemmas\empty \else%
6247 \gl@p\end@lemmas\to\x@lemma%
6248 \x@lemma%
6249 \global\let\x@lemma=\relax%
6250 \fi%
6251 \@ifundefined{xpg@main@language}{%if not polyglossia
6252 \flag@end}%
6253 {\if@RTL\flag@start\else\flag@end\fi% With polyglossia, you must track whether the language reads left to right (English) or right to left (Arabic).
6254 }%
6255 % \end{macrocode}
6256 % We switch to false some flags.
6257 % \begin{itemize}
6258 % \item The one that checks having footnotes inside a \cs{edtext}.
6259 % \item The one that says we are inside a \cs{edtext}.
6260 % \item The one that says we are inside à \cs{@lemma}.
6261 % \end{itemize}
6262 % \begin{macrocode}
6263 \global\@noneed@Footnotefalse%
6264 \global\advance\@edtext@level by -1%
6265 \global\@lemmacommand@false%
6266 % \end{macrocode}
6267 % If we are outside of a numbered paragraph,
6268 % we send error message and print the first argument.
6269 % \begin{macrocode}
6270 \else%
6271 \showlemma{#1} (\textbf{\textsc{Edtext outside numbered paragraph}})\led@err@edtextoutsidepstart%
6272 \fi%
6273 }%
6274
6275 \newcommand*{\flag@end}{%
6276 \ifledRcol%
6277 \write\linenum@outR{]}%
6278 \else%
6279 \write\linenum@out{]}%
6280 \fi}%
6281
6282 % \end{macrocode}
6283 % \end{macro}
6284 %
6285 %
6286 % \begin{macro}{\ifnumberline}
6287 % The \cs{ifnumberline} option can be set to FALSE to disable line numbering.
6288 % \begin{macrocode}
6289 \newif\ifnumberline
6290 \numberlinetrue
6291 % \end{macrocode}
6292 % \end{macro}
6293 % \begin{macro}{\set@line}
6294 % The \cs{set@line} macro
6295 % is called by \cs{critext} to put the line-reference field and
6296 % font specifier for the current block of text into \cs{l@d@nums}.
6297 %
6298 % One instance of \cs{critext} may generate several notes, or it
6299 % may generate none---it's legitimate for argument \verb"#2" to \cs{critext} to
6300 % be empty. But \cs{flag@start} and \cs{flag@end} induce the generation of
6301 % a single entry in \cs{line@list} during the next run, and it's vital
6302 % to also remove one and only one \cs{line@list} entry here.
6303 % \begin{macrocode}
6304 \newcommand*{\set@line}{%
6305 % \end{macrocode}
6306 %
6307 % If no more lines are listed in \cs{line@list}, something's
6308 % wrong---probably just some change in the input. We set all the numbers
6309 % to zeros, following an old publishing convention for numerical
6310 % references that haven't yet been resolved.
6311 % \begin{macrocode}
6312 \ifx\line@list\empty
6313 \global\noteschanged@true
6314 \xdef\l@d@nums{000|000|000|000|000|000|\edfont@info}%
6315 \else
6316 \gl@p\line@list\to\@tempb
6317 \xdef\l@d@nums{\@tempb|\edfont@info}%
6318 \global\let\@tempb=\undefined
6319 \fi}
6320
6321 % \end{macrocode}
6322 % \end{macro}
6323 %
6324 % \begin{macro}{\edfont@info}
6325 % The macro \cs{edfont@info} returns coded information about the
6326 % current font.
6327 %
6328 % \begin{macrocode}
6329 \newcommand*{\edfont@info}{\f@encoding/\f@family/\f@series/\f@shape}
6330
6331 % \end{macrocode}
6332 % \end{macro}
6333 %
6334 % \subsection{Substitute lemma}
6335 %
6336 % \begin{macro}{\lemma}
6337 % \changes{v1.23.0}{2015/05/18}{Fix spurious space after \cs{lemma} command}
6338 % The \cs{lemma}\marg{text} macro allows you to change the lemma
6339 % that's passed on to the notes.
6340 % Read about \cs{@tag} in normal \cs{edtext} macro for more details about \cs{sw@list@inedtext} and \cs{no@expands} (\reff{@tag}).
6341 % \begin{macrocode}
6342 \unless\ifnocritical@
6343 \newcommand*{\lemma}[1]{%
6344 \global\@lemmacommand@true%
6345 \global\renewcommand{\@tag}{%
6346 \no@expands #1%
6347 }%
6348 \ignorespaces%
6349 }%
6350 % \end{macrocode}
6351 % \end{macro}
6352 %
6353 % \begin{macro}{\@lemma}
6354 % The \cs{@lemma} is written in the numbered file to set which \cs{edtext} has an
6355 % \cs{lemma} as second argument.
6356 % \begin{macrocode}
6357 \newcommand{\@lemma}{%
6358 \booltrue{lemmacommand@\the\@edtext@level}%
6359 }%
6360 \fi
6361 % \end{macrocode}
6362 % \end{macro}
6363 % \begin{macro}{\if@lemmacommand@}
6364 % \changes{v1.15.0}{2015/01/12}{New boolean \cs{iflemmacommand@}.}
6365 % This boolean is set to TRUE inside a \cs{edtext} (or \cs{critext}) when a \cs{lemma} command is called.
6366 % That is useful for some commands which can have a different behavior if the lemma in the note is different from the lemma in the main text.
6367 % \begin{macrocode}
6368 \newif\if@lemmacommand@%
6369 % \end{macrocode}
6370 % \end{macro}
6371 % \subsection{Substitute line numbers}
6372 %
6373 % \begin{macro}{\linenum}
6374 % \phantomsection\label{linenumdef}\relax
6375 % The \cs{linenum} macro can change any or all of
6376 % the page and line numbers that are
6377 % passed on to the notes.
6378 %
6379 % As argument \cs{linenum} takes a set of seven parameters
6380 % separated by vertical bars, in the format used internally for
6381 % \cs{l@d@nums} (see \reff{linenumbers}): the starting page,
6382 % line, and sub-line numbers, followed by the ending page, line, and
6383 % sub-line numbers, and then the font specifier for the lemma.
6384 % However, you can omit any parameters you don't want to change, and
6385 % you can omit a string of vertical bars at the end of the
6386 % argument. Hence \verb"\linenum{18|4|0|18|7|1|0}" is an invocation
6387 % that changes all the parameters, but \verb"\linenum{|3}" only
6388 % changes the starting line number, and leaves the rest unaltered.
6389 %
6390 % We use \verb"\\" as an internal separator for the macro parameters.
6391 % \begin{macrocode}
6392 \newcommand*{\linenum}[1]{%
6393 \xdef\@tempa{#1|||||||\noexpand\\\l@d@nums}%
6394 \global\let\l@d@nums=\empty
6395 \expandafter\line@set\@tempa|\\\ignorespaces}
6396 % \end{macrocode}
6397 %
6398 % \begin{macro}{\line@set}
6399 % \cs{linenum} calls \cs{line@set} to do the actual work; it
6400 % looks at the first number in the argument to \cs{linenum},
6401 % sets the corresponding value in \cs{l@d@nums}, and then calls
6402 % itself to process the next number in the \cs{linenum}
6403 % argument, if there are more numbers in \cs{l@d@nums} to process.
6404 % \begin{macrocode}
6405 \def\line@set#1|#2\\#3|#4\\{%
6406 \gdef\@tempb{#1}%
6407 \ifx\@tempb\empty
6408 \l@d@add{#3}%
6409 \else
6410 \l@d@add{#1}%
6411 \fi
6412 \gdef\@tempb{#4}%
6413 \ifx\@tempb\empty\else
6414 \l@d@add{|}\line@set#2\\#4\\%
6415 \fi}
6416 % \end{macrocode}
6417 % \end{macro}
6418 %
6419 % \begin{macro}{\l@d@add}
6420 % \cs{line@set} uses \cs{l@d@add} to tack numbers or vertical bars
6421 % onto the right hand end of \cs{l@d@nums}.
6422 % \begin{macrocode}
6423 \newcommand{\l@d@add}[1]{\xdef\l@d@nums{\l@d@nums#1}}
6424
6425 % \end{macrocode}
6426 % \end{macro}
6427 % \end{macro}
6428 %
6429 % \subsection{Lemma disambiguation}
6430 % The mechanism which counts the occurrence of a same word in a same line is quite complex, because, when \LaTeX\ reads a command between a \cs{pstart} and a \cs{pend}, it does not know yet which are the line numbers.
6431 %
6432 % The general mechanism is the following:
6433 % \begin{itemize}
6434 % \item \textbf{At the first run}, each \cs{sameword} command increments an \Lpack{etoolbox} counter the name of which contains the argument of the \cs{sameword} commands.
6435 % \item Then this counter, associated with the argument of \cs{sameword} is stored, with the \cs{@sw} command, in the auxiliary file of the current \Lpack{eledmac} section (the \verb+.1+, \verb+.2+… file).
6436 % \item \textbf{When this auxiliary file is read at the second run}, different operations are achieved:
6437 % \begin{enumerate}
6438 % \item Get the rank of each \cs{sameword} in a line (relative rank) from the rank of each \cs{sameword} in all the numbered section (absolute rank):
6439 % \begin{itemize}
6440 % \item For each paired \cs{sameword} argument and absolute line number, a counter is defined. Its value corresponds to the number of times \verb+\sameword{argument}+ is called from the beginning of the lineation to the end of the current line. We also store the same data for the preceding absolute line number, if it does not have \verb+\sameword{argument}+.
6441 % \item For each \cs{sameword} having the same argument, we substract from its absolute rank the number stored for the paired \cs{sameword} argument and previous absolute line number. Consequently, we obtain the relative rank.
6442 % \item See the following example which explain how for same \cs{sameword} absolute ranks are transformed to relative rank.
6443 % \begin{verbatim}
6444 % At line 1:
6445 % absolute rank 1 becomes relative rank 1-0 = 1
6446 % 1 is stored for this \sameword and the line 1
6447 % At line 2:
6448 % absolute rank 2 becomes relative rank 2-1 = 1
6449 % absolute rank 3 becomes relative rank 3-2 = 2
6450 % 3 is stored for this \sameword and the line 2
6451 % At line 3:
6452 % no \sameword for this line.
6453 % 3 is stored for this \sameword and the line 3
6454 % At line 4:
6455 % absolute rank 4 becomes relative rank 4-3 = 1
6456 % 3 is stored for this \sameword and the line 4
6457 % \end{verbatim}
6458 % \end{itemize}
6459 % \item Create lists of lists of \cs{sameword} by depth of \cs{edtext}.
6460 % That is: create a list for \cs{edtext} of level~1, a list for \cs{edtext} of level~2, a list for \cs{edtext} of level~3 etc.
6461 % For each \cs{edtext} in these list, we store all the relative rank of \cs{saweword} which are called as lemma information, that is 1) or called in the first argument of \cs{sameword} 2) or called in the \cs{lemma} macro of the second argument of \cs{sameword} AND marked by the optional argument of \cs{saweword} in first argument of \cs{edtext}.
6462 %
6463 % For example, suppose a line with nested \cs{edtext}s which contains some
6464 % word marked by \cs{sameword} and having the following relative rank:\\
6465 %
6466 %
6467 %\let\up\textsuperscript
6468 %bar\up{1} \fbox{%
6469 % \fbox{foo\up{1} foo\up{2} bar\up{2} foo\up{3}} (A)(B)
6470 % foo\up{4} bar\up{3}%
6471 % } (C)
6472 % \fbox{%
6473 % \fbox{foo\up{5}} (D)
6474 % bar\up{4}
6475 % } (E)
6476 %
6477 % In this example, all lemma information for \cs{edtext} is framed. The text in parenthesis is the content of critical notes associated to the preceding frame.
6478 % As you can see, we have two level of \cs{edtext}.
6479 %
6480 %The list for \cs{edtext}s of level~1 is $\{\{1,2,2,3,4,3\},\{5,4\}\}$.
6481 %
6482 %The list for \cs{edtext}s of level~2 is $\{\{1,2,2,3\},\{5\}\}$.
6483 %
6484 % As you can see, the mandatory argument of \cs{sameword} does not matter: we store the rank informations for every word potentially ambiguous.
6485 % \end{enumerate}
6486 % \item At the second run, when a critical notes is called, we associate it to the next item of the list associated to is \cs{edtext} level. So, in the previous example:
6487 % \begin{itemize}
6488 % \item Critical notes (A) and (B) are associated with $\{1,2,2,3\}$.
6489 % \item Critical note (C) is associated with $\{1,2,2,3,4,3\}$.
6490 % \item Critical note (D) is associated with $\{5\}$.
6491 % \item Critical note (E) is associated with $\{5,4\}$.
6492 % \end{itemize}
6493 % \item At the second run, when a critical note is printed:
6494 % \begin{itemize}
6495 % \item The \cs{sameword} command is let \cs{sameword@inedtext}.
6496 % \item At each call of this \cs{sameword@inedtext}, we step to the next element of the list associated to the note. Let it be $r$.
6497 % \item For the word marked by \cs{sameword}, we calculate how many time it is called in its line. To do it:
6498 % \begin{itemize}
6499 % \item We get the absolute line number of the current \cs{sameword}. This absolute line number was stored with list of relative rank for the current \cs{edtext}. That means, in the previous example, that, if the absolute line number of \cs{edtext} was 1, that critical notes (A) and (B) were not associated with $\{1,2,2,3\}$ but with $\{(1,1),(2,1),(2,1),(3,1)\}$. Such method to know the absolute line number associated to a \cs{sameword} is required because a \cs{edtext} can be overlap many lines, but \cs{sameword} can get it.
6500 % \item We get the value associated, when reading the auxiliary file, to the pair compose by the current marked word and the current absolute line number. Let this value be $n$.
6501 % \end{itemize}
6502 % \item If $n >1 $, that mean the current word appears more than once time in its line. In this case, we call \cs{showwordrank} with the word as first argument and $r$ as second argument. If the word is called only once, we just print it.
6503 % \end{itemize}
6504 % \end{itemize}
6505 % After theory, implementation.
6506 % \begin{macro}{\get@sw@txt}
6507 % As the argument of \cs{sameword} can contain active character if we
6508 % use \Lpack{inputenc} with \verb+utf8+ option instead of native UTF-8 engine,
6509 % we store its detokenized content in a macro in order to allow dynamic name of macro with \cs{csname}.\footnote{See \url{http://tex.stackexchange.com/q/244538/7712}.}
6510 %
6511 % Because there is a bug with \cs{detokenize} and \XeTeX\ when using non BMP characters\footnote{\url{http://sourceforge.net/p/xetex/bugs/108/}},
6512 % we detokenize only for not \XeTeX engines. In any case, in \XeTeX, a \cs{csname} construction can contain UTF-8 characters without a problem, as UTF-8 characters are not managed with category code, but instead read directly as UTF-8 characters.
6513 % \begin{macrocode}
6514 \newcommand{\get@sw@txt}[1]{%
6515 \ifxetex%
6516 \xdef\sw@txt{#1}%
6517 \else%
6518 \expandafter\xdef\expandafter\sw@txt\expandafter{\detokenize{#1}}%
6519 \fi%
6520 }%
6521 % \end{macrocode}
6522 % \end{macro}
6523 % \begin{macro}{\sameword}
6524 % \changes{v1.23.0}{2015/05/18}{In order to allow use of \cs{sameword} with inputenc, we detokenize its mandatory argument before using it in control sequence names.}
6525 % The hight level macro \cs{sameword}, used by the editor.
6526 % \begin{macrocode}
6527 \newcommandx{\sameword}[2][1,usedefault]{%
6528 \leavevmode%
6529 \get@sw@txt{#2}%
6530 % \end{macrocode}
6531 % Now, the real code. First, increment the counter corresponding to the argument.
6532 % \begin{macrocode}
6533 \unless\ifledRcol%
6534 \csnumgdef{sw@\sw@txt}{\csuse{sw@\sw@txt}+1}%
6535 % \end{macrocode}
6536 % Then, write its value to the numbered file.
6537 % \begin{macrocode}
6538 \protected@write\linenum@out{}{\string\@sw{\sw@txt}{\csuse{sw@\sw@txt}}{#1}}%
6539 % \end{macrocode}
6540 % Do the same thing if we are in the right columns.
6541 % \begin{macrocode}
6542 \else%
6543 \csnumgdef{sw@\sw@txt@R}{\csuse{sw@\sw@txt@R}+1}%
6544 \protected@write\linenum@outR{}{\string\@sw{\sw@txt}{\csuse{sw@\sw@txt@R}}{#1}}%
6545 \fi%
6546 % \end{macrocode}
6547 % And print the word.
6548 % \begin{macrocode}
6549 #2%
6550 }%
6551 % \end{macrocode}
6552 % \end{macro}
6553 % A flag set to true if a \cs{@sw} relative rank must be added to the list of ranks for a specific \cs{edtext}.
6554 % \begin{macro}{\if@addsw}
6555 % \begin{macrocode}
6556 \newif\if@addsw%
6557 % \end{macrocode}
6558 % \end{macro}
6559 % \begin{macro}{\@sw}
6560 % The command printed in the auxiliary files.
6561 % \begin{macrocode}
6562 \newcommand{\@sw}[3]{%
6563 \get@sw@txt{#1}%
6564 \unless\ifledRcol%
6565 % \end{macrocode}
6566 % First, define a counter which store the second argument as value for a each paired absolute line number/first argument
6567 % \begin{macrocode}
6568 \csxdef{sw@\sw@txt @\the\absline@num @\the\section@num}{#2}%
6569 % \end{macrocode}
6570 % If such argument was not defined for the preceding line, define it.
6571 % \begin{macrocode}
6572 \numdef{\prev@line}{\the\absline@num-1}%
6573 \ifcsundef{sw@\sw@txt @\prev@line @\the\section@num}{%
6574 \csnumgdef{sw@\sw@txt @\prev@line @\the\section@num}{#2-1}%
6575 }{}%
6576 % \end{macrocode}
6577 % Then, calculate the position of the word in the line.
6578 % \begin{macrocode}
6579 \numdef{\the@sw}{#2-\csuse{sw@\sw@txt @\prev@line @\the\section@num}}%
6580 % \end{macrocode}
6581 % And do the same thing for the right side.
6582 % \begin{macrocode}
6583 \else%
6584 \csxdef{sw@\sw@txt @\the\absline@numR @\the\section@numR @R}{#2}%
6585 \numdef{\prev@line}{\the\absline@numR-1}%
6586 \ifcsundef{sw@\sw@txt @\prev@line @\the\section@numR @R}{%
6587 \csnumgdef{sw@\sw@txt @\prev@line @\the\section@numR @R}{#2-1}%
6588 }{}%
6589 \numdef{\the@sw}{#2-\csuse{sw@\sw@txt @\prev@line @\the\section@numR @R}}%
6590 \fi%
6591 % \end{macrocode}
6592 % And now, add it to the list of \cs{@sw} for the current edtext, in all depth.
6593 % \begin{macrocode}
6594 \@tempcnta=\@edtext@level
6595 \@whilenum{\@tempcnta>0}\do{%
6596 \ifcsdef{sw@list@edtext@tmp@\the\@tempcnta}%
6597 {%
6598 \@addswfalse%
6599 \notbool{lemmacommand@\the\@tempcnta}%
6600 {\@addswtrue}%
6601 {\IfStrEq{#3}{inlemma}%
6602 {\@addswtrue}%
6603 {%
6604 \def\do##1{%
6605 \ifnumequal{##1}{\the\@tempcnta}%
6606 {\@addswtrue\listbreak}%
6607 {}%
6608 }%
6609 \docsvlist{#3}%
6610 }%
6611 }%
6612 \if@addsw%
6613 \letcs{\@tmp}{sw@list@edtext@tmp@\the\@tempcnta}%
6614 \ifledRcol%
6615 \xright@appenditem{{\the@sw}{\the\absline@numR}}\to\@tmp%
6616 \else%
6617 \xright@appenditem{{\the@sw}{\the\absline@num}}\to\@tmp%
6618 \fi%
6619 \cslet{sw@list@edtext@tmp@\the\@tempcnta}{\@tmp}%
6620 \fi%
6621 }%
6622 {}%
6623 \advance\@tempcnta by -1%
6624 }%
6625 }%
6626 % \end{macrocode}
6627 % \end{macro}
6628 % \begin{macro}{\sameword@inedtext}
6629 % The command called when \cs{sameword} is called in a edtext.
6630 % \begin{macrocode}
6631 \newcommandx{\sameword@inedtext}[2][1,usedefault]{%
6632 \get@sw@txt{#2}%
6633 \unless\ifledRcol@%
6634 % \end{macrocode}
6635 % Just a precaution.
6636 % \begin{macrocode}
6637 \ifx\sw@list@inedtext\empty%
6638 \def\the@sw{999}%
6639 \def\this@absline{-99}%
6640 \else%
6641 % \end{macrocode}
6642 % But in many cases, at this step, we should have some content in the list \cs{sw@list@inedtext}, which contains the reference for edtext.
6643 % \begin{macrocode}
6644 \gl@p\sw@list@inedtext\to\@tmp%
6645 \edef\the@sw{\expandafter\@firstoftwo\@tmp}%
6646 \edef\this@absline{\expandafter\@secondoftwo\@tmp}%
6647 \fi%
6648 % \end{macrocode}
6649 % First, calculate the number of occurrences of the word in the current line
6650 % \begin{macrocode}
6651 \ifcsdef{sw@\sw@txt @\this@absline @\the\section@num}{%
6652 \numdef{\prev@line}{\this@absline-1}%
6653 \numdef{\sw@atthisline}{\csuse{sw@\sw@txt @\this@absline @\the\section@num}-\csuse{sw@\sw@txt @\prev@line @\the\section@num}}%
6654 }%
6655 {\numdef{\sw@atthisline}{0}}%
6656 % \end{macrocode}
6657 % Finally, print the rank, but only if there is more than one occurrence of the word in the current line.
6658 % \begin{macrocode}
6659 \ifnumgreater{\sw@atthisline}{1}%
6660 {\showwordrank{#2}{\the@sw}}%
6661 {#2}%
6662 % \end{macrocode}
6663 % And the same for right side.
6664 % \begin{macrocode}
6665 \else%
6666 \ifx\sw@list@inedtext\empty%
6667 \def\the@sw{999}%
6668 \def\this@absline{-99}%
6669 \else%
6670 \gl@p\sw@list@inedtext\to\@tmp%
6671 \edef\the@sw{\expandafter\@firstoftwo\@tmp}%
6672 \edef\this@absline{\expandafter\@secondoftwo\@tmp}%
6673 \fi%
6674 \ifcsdef{sw@\sw@txt @\this@absline @\the\section@numR @R}{%
6675 \numdef{\prev@line}{\this@absline-1}%
6676 \numdef{\sw@atthisline}{\csuse{sw@\sw@txt @\this@absline @\the\section@numR @R}-\csuse{sw@\sw@txt @\prev@line @\the\section@numR @R}}%
6677 }%
6678 {\numdef{\sw@atthisline}{0}}%
6679 \ifnumgreater{\sw@atthisline}{1}%
6680 {\showwordrank{#2}{\the@sw}}%
6681 {#2}%
6682 \fi%
6683 }%
6684 % \end{macrocode}
6685 % \end{macro}
6686 % \begin{macro}{\showwordrank}
6687 % \begin{macrocode}
6688 % Finally, the way the rank will be printed.
6689 \newcommand{\showwordrank}[2]{%
6690 #1\textsuperscript{#2}%
6691 }%
6692 % \end{macrocode}
6693 % \end{macro}
6694
6695 % \section{Paragraph decomposition and reassembly}
6696 % \label{paragraph}\relax
6697 %
6698 % In order to be able to count the lines of text and affix line
6699 % numbers, we add an extra stage of processing for each paragraph.
6700 % We send the paragraph into a box
6701 % register, rather than straight onto the vertical list, and when
6702 % the paragraph ends we
6703 % slice the paragraph into its component lines; to each line we
6704 % add any notes or line numbers, add a command to write to the
6705 % line-list, and then at last send the line to the vertical list.
6706 % This section contains all the code for this processing.
6707 %
6708 % \subsection{Boxes, counters, {\tt\protect\bslash pstart}
6709 % and {\tt\protect\bslash pend}}
6710 %
6711 % \begin{macro}{\raw@text}
6712 % \begin{macro}{\ifnumberedpar@}
6713 % \begin{macro}{\numberedpar@true}
6714 % \begin{macro}{\numberedpar@false}
6715 % \begin{macro}{\num@lines}
6716 % \begin{macro}{\one@line}
6717 % \begin{macro}{\par@line}
6718 % Here are numbers and flags that are used internally in the course
6719 % of the paragraph decomposition.
6720 %
6721 % When we first form the paragraph, it goes into a box register,
6722 % \cs{raw@text}, instead of onto the current vertical list.
6723 % The \cs{ifnumberedpar@} flag will be \verb"true" while a paragraph is
6724 % being processed in that way.
6725 % \cs{num@lines} will store the number of lines in the paragraph
6726 % when it's complete. When we chop it up into lines, each line
6727 % in turn goes into the
6728 % \cs{one@line} register, and \cs{par@line} will be the number
6729 % of that line within the paragraph.
6730 % \begin{macrocode}
6731 \newbox\raw@text
6732 \newif\ifnumberedpar@
6733 \newcount\num@lines
6734 \newbox\one@line
6735 \newcount\par@line
6736 % \end{macrocode}
6737 % \end{macro}
6738 % \end{macro}
6739 % \end{macro}
6740 % \end{macro}
6741 % \end{macro}
6742 % \end{macro}
6743 % \end{macro}
6744 %
6745 % \begin{macro}{\pstart}
6746 % \begin{macro}{\AtEveryPstart}
6747 % \changes{v1.6.1}{2013/10/27}{Spurious space in \cs{pstart}.}
6748 % \changes{v1.12.0}{2014/08/05}{New optional argument for \cs{pstart}, to execute code before it.}
6749 % \begin{macro}{\numberpstarttrue}
6750 % \begin{macro}{\numberpstartfalse}
6751 % \begin{macro}{\labelpstarttrue}
6752 % \begin{macro}{\labelpstartfalse}
6753 % \begin{macro}{\thepstart}
6754 % \cs{pstart} starts the paragraph by
6755 % clearing the \cs{inserts@list} list and other
6756 % relevant variables, and then arranges for the
6757 % subsequent text to go into the
6758 % \cs{raw@text} box. \cs{pstart} needs to appear at the start of
6759 % every paragraph that's to be numbered; the \cs{autopar} command below
6760 % may be used to insert these commands automatically.
6761 %
6762 % Beware: everything that occurs between \cs{pstart} and \cs{pend}
6763 % is happening within a group; definitions must be global if you want
6764 % them to survive past the end of the paragraph.
6765 % \changes{v1.13.1}{2014/09/25}{Add \cs{l@dzeropenalties} in \cs{pstart}}
6766 % \begin{macrocode}
6767
6768 \newcommand{\AtEveryPstart}[1]{%
6769 \ifstrempty{#1}%
6770 {\xdef\at@every@pstart{}}%
6771 {\xdef\at@every@pstart{\noindent\unexpanded{#1}}}%
6772 }%
6773 \xdef\at@every@pstart{}%
6774
6775 \newcounter{pstart}
6776 \renewcommand{\thepstart}{{\bfseries\@arabic\c@pstart}. }
6777 \newif\ifnumberpstart
6778 \numberpstartfalse
6779 \newif\iflabelpstart
6780 \labelpstartfalse
6781 \newcommandx*{\pstart}[1][1]{%
6782 \normal@pars%
6783 \ifstrempty{#1}{\at@every@pstart}{\noindent#1}%
6784 \ifautopar%
6785 \autopar%
6786 \fi%
6787 \ifluatex%
6788 \edef\l@luatextextdir@L{\the\textdir}%
6789 \fi%
6790 \if@nobreak%
6791 \let\@oldnobreak\@nobreaktrue%
6792 \else%
6793 \let\@oldnobreak\@nobreakfalse%
6794 \fi%
6795 \@nobreaktrue%
6796 \ifnumbering \else%
6797 \led@err@PstartNotNumbered%
6798 \beginnumbering%
6799 \fi%
6800 \ifnumberedpar@%
6801 \led@err@PstartInPstart%
6802 \pend%
6803 \fi%
6804 \list@clear{\inserts@list}%
6805 \global\let\next@insert=\empty%
6806 \begingroup\normal@pars%
6807 \global\advance \l@dnumpstartsL\@ne
6808 \global\setbox\raw@text=\vbox\bgroup%
6809 \ifautopar\else%
6810 \ifnumberpstart%
6811 \ifinstanza\else%
6812 \ifsidepstartnum\else%
6813 \thepstart%
6814 \fi%
6815 \fi%
6816 \fi%
6817 \fi%
6818 \numberedpar@true%
6819 \iflabelpstart\protected@edef\@currentlabel%
6820 {\p@pstart\thepstart}
6821 \fi%
6822 \l@dzeropenalties%
6823 }
6824 % \end{macrocode}
6825 % \end{macro}
6826 % \end{macro}
6827 % \end{macro}
6828 % \end{macro}
6829 % \end{macro}
6830 % \end{macro}
6831 % \end{macro}
6832 % \begin{macro}{\pend}
6833 % \changes{v1.12.0}{2014/08/05}{New optional argument for \cs{pend}, to execute code after it.}
6834 % \changes{v1.6.1}{2013/10/27}{Spurious space in \cs{pend}.}
6835 % \cs{pend} must be used to end a numbered paragraph.
6836 %
6837 % \begin{macrocode}
6838 \newcommandx*{\pend}[1][1]{\ifnumbering \else%
6839 \led@err@PendNotNumbered%
6840 \fi%
6841 \global\l@dskipversenumberfalse%
6842 \ifnumberedpar@ \else%
6843 \led@err@PendNoPstart%
6844 \fi%
6845 % \end{macrocode}
6846 % We set all the usual interline penalties to zero and then immediately
6847 % call \cs{endgraf} to end the paragraph; this ensures that there'll
6848 % be no large interline penalties to prevent us from slicing the
6849 % paragraph into pieces. These penalties revert to the values
6850 % that you set when the group for the \cs{vbox} ends. Then we call
6851 % \cs{do@line} to slice a line off the top of the
6852 % paragraph, add a line number and footnotes, and restore it to the page;
6853 % we keep doing this until there aren't any more lines left.
6854 % \begin{macrocode}
6855 \l@dzeropenalties%
6856 \endgraf\global\num@lines=\prevgraf\egroup%
6857 \global\par@line=0%
6858 % \end{macrocode}
6859 % We check if lineation is by pstart: in this case, we reset line number, but only in the second line of the pstart, to prevent some trouble. We can't reset line number at the beginning of \cs{pstart} \cs{setline} is parsed at the end of previous \cs{pend}, and so, we must do it at the end of first line of pstart.
6860 % \begin{macrocode}
6861 \csnumdef{pstartline}{0}%
6862 \loop\ifvbox\raw@text%
6863 \csnumdef{pstartline}{\pstartline+1}%
6864 \do@line%
6865 \ifbypstart@%
6866 \ifnumequal{\pstartline}{1}{\setline{1}\resetprevline@}{}%
6867 \fi%
6868 \repeat%
6869 % \end{macrocode}
6870 % Deal with any leftover notes, and then end the group that was begun
6871 % in the \cs{pstart}.
6872 % \begin{macrocode}
6873 \flush@notes%
6874 \endgroup%
6875 \ignorespaces%
6876 \ifnumberpstart%
6877 \pstartnumtrue%
6878 \fi%
6879 \@oldnobreak%
6880 \addtocounter{pstart}{1}%
6881 \normal@pars%
6882 \ifstrempty{#1}{\at@every@pend}{\noindent#1}%
6883 \ifautopar%
6884 \autopar%
6885 \fi%
6886 }
6887
6888 % \end{macrocode}
6889 % \end{macro}
6890 % \begin{macro}{\AtEveryPend}
6891 % \begin{macro}{\at@every@pend}
6892 % \begin{macrocode}
6893
6894 \newcommand{\AtEveryPend}[1]{%
6895 \ifstrempty{#1}%
6896 {\xdef\at@every@pend{}}%
6897 {\xdef\at@every@pend{\noindent\unexpanded{#1}}}%
6898 }%
6899 \xdef\at@every@pend{}%
6900
6901 % \end{macrocode}
6902 % \end{macro}
6903 % \end{macro}
6904 %
6905 % \begin{macro}{\l@dzeropenalties}
6906 % A macro to zero penalties for \cs{pend} or \cs{pstart}.
6907 % \changes{v0.7.0}{2005/02/22}{Added \cs{l@dzeropenalties}}
6908 % \begin{macrocode}
6909 \newcommand*{\l@dzeropenalties}{%
6910 \brokenpenalty \z@ \clubpenalty \z@
6911 \displaywidowpenalty \z@ \interlinepenalty \z@ \predisplaypenalty \z@
6912 \postdisplaypenalty \z@ \widowpenalty \z@}
6913
6914 % \end{macrocode}
6915 % \end{macro}
6916 %
6917 % \begin{macro}{\autopar}
6918 % In most cases it's only an annoyance to have to label the paragraphs
6919 % to be numbered with \cs{pstart} and \cs{pend}. \cs{autopar} will
6920 % do that automatically, allowing you to start a paragraph with its
6921 % first word and no other preliminaries, and to end it with a blank line
6922 % or a \verb"\par" command. The command should be issued within a
6923 % group, after \cs{beginnumbering} has been used to start the
6924 % numbering; all paragraphs within the group will be affected.
6925 %
6926 % A few situations can cause problems. One is a paragraph that begins with
6927 % a begin-group character or command: \cs{pstart} will not get invoked
6928 % until after such a group beginning is processed; as a result the
6929 % character that ends the group will be mistaken for the end of the
6930 % \cs{vbox} that \cs{pstart} creates, and the rest of the paragraph
6931 % will not be numbered. Such paragraphs need to be started explicitly
6932 % using \cs{indent}, \cs{noindent}, or \cs{leavevmode}---or \cs{pstart}, since
6933 % you can still include your own \cs{pstart} and \cs{pend}
6934 % commands even with \cs{autopar} on.
6935 %
6936 % Prematurely ending the group within which \cs{autopar} is in
6937 % effect will cause a similar problem. You must either leave a
6938 % blank line or use \verb"\par" to end the last paragraph before
6939 % you end the group.
6940 %
6941 % The functioning of this macro is more tricky than the usual
6942 % \cs{everypar}: we don't want anything to go onto the vertical
6943 % list at all, so we have to end the paragraph, erase any evidence
6944 % that it ever existed, and start it again using \cs{pstart}.
6945 % We remove the paragraph-indentation box using \cs{lastbox} and
6946 % save the width, and then skip backwards over the \cs{parskip}
6947 % that's been added for this paragraph. Then we start again with
6948 % \cs{pstart}, restoring the indentation that we saved, and
6949 % locally change \verb"\par" so that it'll do our \cs{pend} for us.
6950 % \begin{macrocode}
6951 \newif\ifautopar
6952 \autoparfalse
6953 \newcommand*{\autopar}{
6954 \ifledRcol
6955 \ifnumberingR \else
6956 \led@err@AutoparNotNumbered
6957 \beginnumberingR
6958 \fi
6959 \else
6960 \ifnumbering \else
6961 \led@err@AutoparNotNumbered
6962 \beginnumbering
6963 \fi
6964 \fi
6965 \autopartrue
6966 \everypar{\setbox0=\lastbox
6967 \endgraf \vskip-\parskip
6968 \pstart \noindent \kern\wd0 \ifnumberpstart\ifinstanza\else\thepstart\fi\fi
6969 \let\par=\pend}%
6970 \ignorespaces}
6971 % \end{macrocode}
6972 % \end{macro}
6973 %
6974 % \begin{macro}{\normal@pars}
6975 % We also define a macro which we can rely on to turn off the
6976 % \cs{autopar} definitions at various important places, if they
6977 % are in force. We'll want to do this within a footnotes, for
6978 % example.
6979 % \begin{macrocode}
6980 \newcommand*{\normal@pars}{\everypar{}\let\par\endgraf}
6981
6982 % \end{macrocode}
6983 % \end{macro}
6984 %
6985 % \begin{macro}{\ifautopar@pause}
6986 % We define a boolean test switched to true at the beginning
6987 % of the \cs{pausenumbering} command if the autopar is enabled.
6988 % This boolean will be tested at the beginning of \cs{resumenumbering}
6989 % to continue the autopar if neeeded.
6990 % \begin{macrocode}
6991 \newif\ifautopar@pause
6992 % \end{macrocode}
6993 % \end{macro}
6994 % \subsection{Processing one line}
6995 %
6996 % \begin{macro}{\do@line}\label{doline}
6997 % \begin{macro}{\l@dunhbox@line}
6998 % The \cs{do@line} macro is called by \cs{pend} to
6999 % do all the processing for a single line of text.
7000 % \changes{v1.6.1}{2013/10/27}{Move the call to \cs{inserthangingsymbol} to allow use \cs{hfill} inside.}
7001 % \changes{v1.12.2}{2014/08/07}{Fix a bug with critical notes at the tops of pages (added by v12.0.0)}
7002 % \begin{macrocode}
7003 \newcommand*{\l@dunhbox@line}[1]{\unhbox #1}
7004 \newcommand*{\do@line}{%
7005 {\vbadness=10000
7006 \splittopskip=\z@
7007 \do@linehook
7008 \l@demptyd@ta
7009 \global\setbox\one@line=\vsplit\raw@text to\baselineskip}%
7010 \unvbox\one@line \global\setbox\one@line=\lastbox
7011 \getline@num
7012 \IfStrEq{\led@pb@setting}{before}{\led@check@pb\led@check@nopb}{}
7013 \ifnum\@lock>\@ne
7014 \inserthangingsymboltrue
7015 \else
7016 \inserthangingsymbolfalse
7017 \fi
7018 \check@pb@in@verse
7019 \ifl@dhidenumber%
7020 \global\l@dhidenumberfalse%
7021 \f@x@l@cks%
7022 \else%
7023 \affixline@num%
7024 \fi%
7025 % \end{macrocode}
7026 % \changes{v1.12.0}{2014/08/05}{\cs{do@line} is split in more little commands.}
7027 % Depending wether a sectioning command is called at this pstart or not
7028 % we print sectioning command or normal line,
7029 % \begin{macrocode}
7030 \xifinlist{\the\l@dnumpstartsL}{\eled@sections@@}%
7031 {\print@eledsection}%
7032 {\print@line}%
7033 \IfStrEq{\led@pb@setting}{after}{\led@check@pb\led@check@nopb}{}
7034 }%
7035 % \end{macrocode}
7036 % \end{macro}
7037 % \end{macro}
7038 %
7039 % \begin{macro}{\print@line}
7040 % \changes{v1.13.1}{2014/09/25}{Coming back of add@penalties, mistakenly deleted in version 0.17!}
7041 % \changes{v1.18.0}{2015/02/23}{Compatibility with \LuaLaTeX\ RTL languages.}
7042 % \cs{print@line} is for normal line, i. e line without sectioning command.
7043 % \begin{macrocode}
7044 \def\print@line{
7045 % \end{macrocode}
7046 % Insert the pstart number in side, if we are in the first line of a pstart.
7047 % \begin{macrocode}
7048 \affixpstart@num%
7049 % \end{macrocode}
7050 % The line will be boxed, to have the good width.
7051 % \begin{macrocode}
7052 \hb@xt@ \linewidth{%
7053 % \end{macrocode}
7054 % User hook.
7055 % \begin{macrocode}
7056 \do@insidelinehook%
7057 % \end{macrocode}
7058 % Left line number
7059 % \begin{macrocode}
7060 \l@dld@ta%
7061 % \end{macrocode}
7062 % Restore marginal and footnotes.
7063 % \begin{macrocode}
7064 \add@inserts\affixside@note%
7065 % \end{macrocode}
7066 % Print left notes.
7067 % \begin{macrocode}
7068 \l@dlsn@te
7069 % \end{macrocode}
7070 % Boxes the line, writes information about new line in the numbered file.
7071 % \begin{macrocode}
7072 {\ledllfill\hb@xt@ \wd\one@line{\new@line%
7073 % \end{macrocode}
7074 % If we use \LuaLaTeX\, then restore the direction.
7075 % \begin{macrocode}
7076 \ifluatex%
7077 \textdir\l@luatextextdir@L%
7078 \fi%
7079 % \end{macrocode}
7080 % Insert, if needed, the hanging symbol.
7081 % \begin{macrocode}
7082 \inserthangingsymbol %Space keept for backward compatibility
7083 % \end{macrocode}
7084 % And so, print the line.
7085 % \begin{macrocode}
7086 \l@dunhbox@line{\one@line}}%
7087 % \end{macrocode}
7088 % Right line number
7089 % \begin{macrocode}
7090 \ledrlfill\l@drd@ta%
7091 % \end{macrocode}
7092 % Print right notes.
7093 % \begin{macrocode}
7094 \l@drsn@te
7095 }}%
7096 % \end{macrocode}
7097 % And reinsert penalties (for page breaking)...
7098 % \begin{macrocode}
7099 \add@penalties%
7100 }
7101 % \end{macrocode}
7102 % \end{macro}
7103 % \begin{macro}{\print@eledsection}
7104 % \cs{print@eledsection} to print sectioning command with line number.
7105 % It sets the correct spacing, depending whether a sectioning command was called at previous \cs{pstart}, calls the sectioning command, prints the normal line outside of the paper, to be able to have critical footnotes.
7106 % Because of how this prints, a vertical spacing correction is added.
7107 % \begin{macrocode}
7108 \def\print@eledsection{%
7109 \add@inserts\affixside@note%
7110 \numdef{\temp@}{\l@dnumpstartsL-1}%
7111 \xifinlist{\temp@}{\eled@sections@@}{\@nobreaktrue}{\@nobreakfalse}%
7112 \@eled@sectioningtrue%
7113 \csuse{eled@sectioning@\the\l@dnumpstartsL}%
7114 \@eled@sectioningfalse%
7115 \global\csundef{eled@sectioning@\the\l@dnumpstartsL}%
7116 \if@RTL%
7117 \hspace{-3\paperwidth}%
7118 {\hbox{\l@dunhbox@line{\one@line}} \new@line}%
7119 \else%
7120 \hspace{3\paperwidth}%
7121 {\new@line \hbox{\l@dunhbox@line{\one@line}}}%
7122 \fi%
7123 \vskip-\baselineskip%
7124 }
7125 % \end{macrocode}
7126 % \end{macro}
7127 % \begin{macro}{\dolinehook}
7128 % \begin{macro}{\doinsidelinehook}
7129 % These hight level commands just redefine the low level commands.
7130 % They have to be used be user, without \cs{makeatletter}.
7131 % \changes{v1.12.5}{2014/08/31}{Added \cs{dolinehook} and \cs{doinsidelinehook}}
7132 % \begin{macrocode}
7133 \newcommand*{\dolinehook}[1]{\gdef\do@linehook{#1}}%
7134 \newcommand*{\doinsidelinehook}[1]{\gdef\do@insidelinehook{#1}}%
7135
7136 % \end{macrocode}
7137 % \end{macro}
7138 % \end{macro}
7139 % \begin{macro}{\do@linehook}
7140 % \begin{macro}{\do@insidelinehook}
7141 % Two hooks into \cs{do@line}. The first is called at the beginning of \cs{do@line}, the second is called in the line box.
7142 % The second can, for example, have a \cs{markboth} command inside, the first can't.
7143 % \changes{v0.7.0}{2005/02/18}{Added \cs{do@linehook} for use in \cs{do@line}}
7144 % \changes{v1.5.0}{2013/07/11}{Added \cs{do@insidelinehook} for use in \cs{do@line}}
7145 % \begin{macrocode}
7146 \newcommand*{\do@linehook}{}
7147 \newcommand*{\do@insidelinehook}{}
7148 % \end{macrocode}
7149 % \end{macro}
7150 % \end{macro}
7151 %
7152 % \begin{macro}{\l@demptyd@ta}
7153 % \begin{macro}{\l@dld@ta}
7154 % \begin{macro}{\l@drd@ta}
7155 % \begin{macro}{\l@dcsnotetext}
7156 % \begin{macro}{\l@dcsnotetext@l}
7157 % \begin{macro}{\l@dcsnotetext@r}
7158 % Nulls the \cs{...d@ta}, which may later hold line numbers.
7159 % Similarly for \cs{l@dcsnotetext}, \cs{l@dcsnotetext@l}, \cs{l@dcsnotetext@r} for the texts of the sidenotes, left and right notes.
7160 % \changes{v0.7.0}{2005/02/18}{Added \cs{l@demptyd@ta}}
7161 % \begin{macrocode}
7162 \newcommand*{\l@demptyd@ta}{%
7163 \gdef\l@dld@ta{}%
7164 \gdef\l@drd@ta{}%
7165 \gdef\l@dcsnotetext@l{}%
7166 \gdef\l@dcsnotetext@r{}%
7167 \gdef\l@dcsnotetext{}}
7168
7169 % \end{macrocode}
7170 % \end{macro}
7171 % \end{macro}
7172 % \end{macro}
7173 % \end{macro}
7174 % \end{macro}
7175 % \end{macro}
7176 %
7177 % \begin{macro}{\l@dlsn@te}
7178 % \begin{macro}{\l@drsn@te}
7179 % Zero width boxes of the left and right side notes, together with their kerns.
7180 % \changes{v0.7.0}{2005/02/18}{Added \cs{l@dlsn@te} and \cs{l@drsn@te}
7181 % for use in \cs{do@line}}
7182 % \begin{macrocode}
7183 \newcommand{\l@dlsn@te}{%
7184 \hb@xt@ \z@{\hss\box\l@dlp@rbox\kern\ledlsnotesep}}
7185 \newcommand{\l@drsn@te}{%
7186 \hb@xt@ \z@{\kern\ledrsnotesep\box\l@drp@rbox\hss}}
7187
7188 % \end{macrocode}
7189 % \end{macro}
7190 % \end{macro}
7191 %
7192 %
7193 % \begin{macro}{\ledllfill}
7194 % \begin{macro}{\ledrlfill}
7195 % These macros are called at the left (\verb?\ledllfill?) and the right
7196 % (\verb?\ledllfill?) of each numbered line. The initial definitions
7197 % correspond to the original code for \verb?\do@line?.
7198 % \begin{macrocode}
7199 \newcommand*{\ledllfill}{\hfil}
7200 \newcommand*{\ledrlfill}{}
7201
7202 % \end{macrocode}
7203 % \end{macro}
7204 % \end{macro}
7205 %
7206 % \subsection{Line and page number computation}
7207 %
7208 % \begin{macro}{\getline@num}
7209 % The \cs{getline@num} macro
7210 % determines the page and line numbers for the line we're about to
7211 % send to the vertical list.
7212 % \begin{macrocode}
7213 \newcommand*{\getline@num}{%
7214 \global\advance\absline@num \@ne%
7215 \do@actions
7216 \do@ballast
7217 \ifnumberline
7218 \ifsublines@
7219 \ifnum\sub@lock<\tw@
7220 \global\advance\subline@num \@ne
7221 \fi
7222 \else
7223 \ifnum\@lock<\tw@
7224 \global\advance\line@num \@ne
7225 \global\subline@num \z@
7226 \fi
7227 \fi
7228 \fi
7229 }
7230 % \end{macrocode}
7231 % \end{macro}
7232 %
7233 % \begin{macro}{\do@ballast}
7234 % \phantomsection\label{do@ballast}\relax
7235 % The real work in the macro above is done in \cs{do@actions}, but
7236 % before we plunge into that, let's get \cs{do@ballast} out of the
7237 % way. This macro looks to see if there is an action to be
7238 % performed on the \emph{next} line, and if it is going to be a
7239 % page break action, \cs{do@ballast} decreases the count \cs{ballast@count}
7240 % counter
7241 % by the amount of \verb"ballast". This means, in practice, that when
7242 % \cs{add@penalties} assigns penalties at this point, \TeX\ will be
7243 % given extra encouragement to break the page here (see
7244 % \reff{add@penalties}).
7245 %
7246 % \begin{macro}{\ballast@count}
7247 % \begin{macro}{\c@ballast}
7248 % First we set up the required counters; they are initially
7249 % set to zero, and will remain so unless you say
7250 % \verb"\setcounter{ballast}"\marg{some figure} in your document.
7251 % \begin{macrocode}
7252 \newcount\ballast@count
7253 \newcounter{ballast}
7254 \setcounter{ballast}{0}
7255 % \end{macrocode}
7256 % \end{macro}
7257 % \end{macro}
7258 % And here is \cs{do@ballast} itself. It advances \cs{absline@num}
7259 % within the protection of a group to make its check for what
7260 % happens on the next line.
7261 % \begin{macrocode}
7262 \newcommand*{\do@ballast}{\global\ballast@count \z@
7263 \begingroup
7264 \advance\absline@num \@ne
7265 \ifnum\next@actionline=\absline@num
7266 \ifnum\next@action>-1001\relax
7267 \global\advance\ballast@count by -\c@ballast
7268 \fi
7269 \fi
7270 \endgroup}
7271 % \end{macrocode}
7272 % \end{macro}
7273 %
7274 % \begin{macro}{\do@actions}
7275 % \begin{macro}{\do@actions@next}
7276 %
7277 % The \cs{do@actions} macro
7278 % looks at the list of actions to take at particular absolute line
7279 % numbers, and does everything that's specified for the current line.
7280 %
7281 % It may call itself recursively, and to do this efficiently (using
7282 % \TeX's optimization for tail recursion), we define a control-sequence
7283 % called \cs{do@actions@next} that is always the last thing that
7284 % \cs{do@actions} does. If there could be more actions to process for
7285 % this line, \cs{do@actions@next} is set equal to \cs{do@actions};
7286 % otherwise it's just \cs{relax}.
7287 % \changes{v0.7.0}{2005/02/22}{Added number skipping to \cs{do@actions}}
7288 % \begin{macrocode}
7289 \newcommand*{\do@actions}{%
7290 \global\let\do@actions@next=\relax
7291 \ifnum\absline@num<\next@actionline\else
7292 % \end{macrocode}
7293 %
7294 % First, page number changes, which will generally be the most common
7295 % actions. If we're restarting lineation on each page, this is where it
7296 % happens.
7297 % \begin{macrocode}
7298 \ifnum\next@action>-1001
7299 \global\page@num=\next@action
7300 \ifbypage@
7301 \global\line@num=\z@ \global\subline@num=\z@
7302 \resetprevline@
7303 \fi
7304 % \end{macrocode}
7305 %
7306 % Next, we handle
7307 % commands that change the line-number values. (We subtract $5001$ rather
7308 % than $5000$ here because the line number is going to be incremented
7309 % automatically in \cs{getline@num}.)
7310 % \begin{macrocode}
7311 \else
7312 \ifnum\next@action<-4999
7313 \@l@dtempcnta=-\next@action
7314 \advance\@l@dtempcnta by -5001
7315 \ifsublines@
7316 \global\subline@num=\@l@dtempcnta
7317 \else
7318 \global\line@num=\@l@dtempcnta
7319 \fi
7320 % \end{macrocode}
7321 %
7322 % It's one of the fixed codes. We rescale the value in
7323 % \cs{@l@dtempcnta} so that we can use a case statement.
7324 % \begin{macrocode}
7325 \else
7326 \@l@dtempcnta=-\next@action
7327 \advance\@l@dtempcnta by -1000
7328 \do@actions@fixedcode
7329 \fi
7330 \fi
7331 % \end{macrocode}
7332 %
7333 % Now we get information about the next action off the list,
7334 % and then set \cs{do@actions@next} so that we'll
7335 % call ourself recursively: the next action might also be for this
7336 % line.
7337 %
7338 % There's no warning if we find \cs{actionlines@list} empty,
7339 % since that will always happen near the end of the section.
7340 %
7341 % \begin{macrocode}
7342 \ifx\actionlines@list\empty
7343 \gdef\next@actionline{1000000}%
7344 \else
7345 \gl@p\actionlines@list\to\next@actionline
7346 \gl@p\actions@list\to\next@action
7347 \global\let\do@actions@next=\do@actions
7348 \fi
7349 \fi
7350 % \end{macrocode}
7351 %
7352 % Make the recursive call, if necessary.
7353 %
7354 % \begin{macrocode}
7355 \do@actions@next}
7356
7357 % \end{macrocode}
7358 % \end{macro}
7359 % \end{macro}
7360 % \begin{macro}{\do@actions@fixedcode}
7361 % This macro handles the fixed codes for \cs{do@actions}. It is
7362 % one big case statement.
7363 % \changes{v0.7.0}{2005/02/24}{Added \cs{do@actions@fixedcode}}
7364 % \begin{macrocode}
7365 \newcommand*{\do@actions@fixedcode}{%
7366 \ifcase\@l@dtempcnta
7367 \or% % 1001
7368 \global\sublines@true
7369 \or% % 1002
7370 \global\sublines@false
7371 \or% % 1003
7372 \global\@lock=\@ne
7373 \or% % 1004
7374 \ifnum\@lock=\tw@
7375 \global\@lock=\thr@@
7376 \else
7377 \global\@lock=\z@
7378 \fi
7379 \or% % 1005
7380 \global\sub@lock=\@ne
7381 \or% % 1006
7382 \ifnum\sub@lock=\tw@
7383 \global\sub@lock=\thr@@
7384 \else
7385 \global\sub@lock=\z@
7386 \fi
7387 \or% % 1007
7388 \l@dskipnumbertrue
7389 \or% % 1008
7390 \l@dskipversenumbertrue%
7391 \or% % 1009
7392 \l@dhidenumbertrue
7393 \else
7394 \led@warn@BadAction
7395 \fi}
7396
7397
7398 % \end{macrocode}
7399 % \end{macro}
7400 % \section{Line number printing}
7401 %
7402 % \begin{macro}{\affixline@num}
7403 % \cs{affixline@num} originally took a single argument, a series of
7404 % commands for printing the line just split off by \cs{do@line}; it
7405 % put that line back on the vertical list, and added a line number if
7406 % necessary. It now just puts a left line number into \cs{l@dld@ta}
7407 % or a right line number into \cs{l@drd@ta} if required.
7408 %
7409 % To determine whether we need to affix a line number to this line,
7410 % we compute the following:
7411 % \begin{tabbing}
7412 % \quad $m$ \= \kill
7413 % $n$ \> $= \mbox{\it int\/} ( ( \mbox{\it linenum\/} -
7414 % \mbox{\it firstlinenum\/} ) /
7415 % \mbox{\it linenumincrement\/} )$ \\
7416 % $m$ \> $= \mbox{\it firstlinenum\/} +
7417 % ( n \times \mbox{\it linenumincrement\/})$
7418 % \end{tabbing}
7419 % (where {\it int\/} truncates a real number to an integer).
7420 % $m$ will be equal to {\it linenum\/} only
7421 % if we're to paste a number on here.
7422 % However, the formula breaks down for the first line to number (and any
7423 % before that), so we check that case separately: if \cs{line@num} $\le$
7424 % \cs{firstlinenum}, we compare the two directly instead of making these
7425 % calculations.
7426 %
7427 % We compute, in the scratch counter \cs{@l@dtempcnta}, the number
7428 % of the next line that should be printed with a number ($m$ in the
7429 % above discussion), and move the current line number into the
7430 % counter \cs{@l@dtempcntb} for comparison.
7431 %
7432 %
7433 % First, the case when we're within a sub-line range.
7434 % \changes{v0.5.1}{2004/04/10}{Changed \cs{affixline@num} to cater for sidenotes}
7435 % \changes{v0.7.0}{2005/02/22}{Added skipnumering to \cs{affixline@num}}
7436 % \begin{macrocode}
7437 \newcommand*{\affixline@num}{%
7438 % \end{macrocode}
7439 % No number is attached if \cs{ifl@dskipnumber} is TRUE (and then it
7440 % is set to its normal FALSE value).
7441 % No number is attached if \cs{ifnumberline} is FALSE (the normal value is TRUE).
7442 % \changes{v0.15.0}{2012/06/11}{Line numbering can be disabled.}
7443 % \begin{macrocode}
7444 \ifledgroupnotesL@\else
7445 \ifnumberline
7446 \ifl@dskipnumber
7447 \global\l@dskipnumberfalse
7448 \else
7449 \ifsublines@
7450 \@l@dtempcntb=\subline@num
7451 \ifnum\subline@num>\c@firstsublinenum
7452 \@l@dtempcnta=\subline@num
7453 \advance\@l@dtempcnta by-\c@firstsublinenum
7454 \divide\@l@dtempcnta by\c@sublinenumincrement
7455 \multiply\@l@dtempcnta by\c@sublinenumincrement
7456 \advance\@l@dtempcnta by\c@firstsublinenum
7457 \else
7458 \@l@dtempcnta=\c@firstsublinenum
7459 \fi
7460 % \end{macrocode}
7461 %
7462 % That takes care of computing the values for comparison, but if line
7463 % number locking is in effect we have to make a further check. If this
7464 % check fails, then we disable the line-number display by setting the
7465 % counters to arbitrary but unequal values.
7466 % \begin{macrocode}
7467 \ch@cksub@l@ck
7468 % \end{macrocode}
7469 %
7470 % Now the line number case, which works the same way.
7471 % \begin{macrocode}
7472 \else
7473 \@l@dtempcntb=\line@num
7474 % \end{macrocode}
7475 % Check on the \verb?\linenumberlist? If it's \verb?\empty? use the standard
7476 % algorithm.
7477 % \begin{macrocode}
7478 \ifx\linenumberlist\empty
7479 \ifnum\line@num>\c@firstlinenum
7480 \@l@dtempcnta=\line@num
7481 \advance\@l@dtempcnta by-\c@firstlinenum
7482 \divide\@l@dtempcnta by\c@linenumincrement
7483 \multiply\@l@dtempcnta by\c@linenumincrement
7484 \advance\@l@dtempcnta by\c@firstlinenum
7485 \else
7486 \@l@dtempcnta=\c@firstlinenum
7487 \fi
7488 \else
7489 % \end{macrocode}
7490 % The \verb?\linenumberlist? wasn't \verb?\empty?, so here's Wayne's
7491 % numbering mechanism. This takes place in TeX's mouth.
7492 % \begin{macrocode}
7493 \@l@dtempcnta=\line@num
7494 \edef\rem@inder{,\linenumberlist,\number\line@num,}%
7495 \edef\sc@n@list{\def\noexpand\sc@n@list
7496 ####1,\number\@l@dtempcnta,####2|{\def\noexpand\rem@inder{####2}}}%
7497 \sc@n@list\expandafter\sc@n@list\rem@inder|%
7498 \ifx\rem@inder\empty%
7499 \advance\@l@dtempcnta\@ne
7500 \fi
7501 \fi
7502 % \end{macrocode}
7503 %
7504 %
7505 % A locking check for lines, just like the version for sub-line
7506 % numbers above.
7507 % \begin{macrocode}
7508 \ch@ck@l@ck
7509 \fi
7510 % \end{macrocode}
7511 %
7512 % The following tests are true if we need to print a line number.
7513 % \begin{macrocode}
7514 \ifnum\@l@dtempcnta=\@l@dtempcntb
7515 \ifl@dskipversenumber\else
7516 % \end{macrocode}
7517 %
7518 % If we got here,
7519 % we're going to print a line number; so now we need to
7520 % calculate a number that will tell us which side of the page will get
7521 % the line number. We start from \cs{line@margin}, which asks for
7522 % one side always if it's less than $2$; and then if the side does
7523 % depend on the page number, we simply add the page number to this
7524 % side code---because the values of \cs{line@margin} have been devised so
7525 % that this produces a number that's even for left-margin numbers and
7526 % odd for right-margin numbers.
7527 %
7528 % For \LaTeX\ we have to consider two column documents as well. In this case
7529 % I think we need to put the numbers at the outside of the column ---
7530 % the left of the first column and the right of the second. Do the twocolumn
7531 % stuff before going on with the original code.
7532 % \begin{macro}{\l@dld@ta}
7533 % \begin{macro}{\l@drd@ta}
7534 % A left line number is stored in \cs{l@dld@ta} and a right one in
7535 % \cs{l@drd@ta}.
7536 %
7537 % \begin{macrocode}
7538 \if@twocolumn
7539 \if@firstcolumn
7540 \gdef\l@dld@ta{\llap{{\leftlinenum}}}%
7541 \else
7542 \gdef\l@drd@ta{\rlap{{\rightlinenum}}}%
7543 \fi
7544 \else
7545 % \end{macrocode}
7546 % Continuing the original code \ldots
7547 % \begin{macrocode}
7548 \@l@dtempcntb=\line@margin
7549 \ifnum\@l@dtempcntb>\@ne
7550 \advance\@l@dtempcntb \page@num
7551 \fi
7552 % \end{macrocode}
7553 %
7554 % Now print the line (\verb"#1") with its page number.
7555 % \begin{macrocode}
7556 \ifodd\@l@dtempcntb
7557 \gdef\l@drd@ta{\rlap{{\rightlinenum}}}%
7558 \else
7559 \gdef\l@dld@ta{\llap{{\leftlinenum}}}%
7560 \fi
7561 \fi
7562 \fi
7563 \fi
7564 % \end{macrocode}
7565 % \end{macro}
7566 % \end{macro}
7567 %
7568 % Now fix the lock counters, if necessary.
7569 % A value of $1$ is advanced to
7570 % $2$; $3$ advances to $0$; other values are unchanged.
7571 % \begin{macrocode}
7572 \f@x@l@cks
7573 \fi
7574 \fi
7575 \fi
7576 }
7577
7578 % \end{macrocode}
7579 % \end{macro}
7580 %
7581 % \begin{macro}{\ch@cksub@l@ck}
7582 % \begin{macro}{\ch@ck@l@ck}
7583 % \begin{macro}{\f@x@l@cks}
7584 % These macros handle line number locking for \cs{affixline@num}.
7585 % \changes{v0.7.0}{2005/02/24}{Added \cs{ch@cksub@l@ck}, \cs{ch@ck@l@ck}
7586 % and \cs{f@x@l@cks}}
7587 % \cs{ch@cksub@l@ck} checks subline locking. If it fails, then we disable
7588 % the line-number display by setting the counters to arbitrary but unequal
7589 % values.
7590 % \begin{macrocode}
7591 \newcommand*{\ch@cksub@l@ck}{%
7592 \ifcase\sub@lock
7593 \or
7594 \ifnum\sublock@disp=\@ne
7595 \@l@dtempcntb=\z@ \@l@dtempcnta=\@ne
7596 \fi
7597 \or
7598 \ifnum\sublock@disp=\tw@ \else
7599 \@l@dtempcntb=\z@ \@l@dtempcnta=\@ne
7600 \fi
7601 \or
7602 \ifnum\sublock@disp=\z@
7603 \@l@dtempcntb=\z@ \@l@dtempcnta=\@ne
7604 \fi
7605 \fi}
7606 % \end{macrocode}
7607 % Similarly for line numbers.
7608 % \begin{macrocode}
7609 \newcommand*{\ch@ck@l@ck}{%
7610 \ifcase\@lock
7611 \or
7612 \ifnum\lock@disp=\@ne
7613 \@l@dtempcntb=\z@ \@l@dtempcnta=\@ne
7614 \fi
7615 \or
7616 \ifnum\lock@disp=\tw@ \else
7617 \@l@dtempcntb=\z@ \@l@dtempcnta=\@ne
7618 \fi
7619 \or
7620 \ifnum\lock@disp=\z@
7621 \@l@dtempcntb=\z@ \@l@dtempcnta=\@ne
7622 \fi
7623 \fi}
7624 % \end{macrocode}
7625 % Fix the lock counters.
7626 % A value of $1$ is advanced to
7627 % $2$; $3$ advances to $0$; other values are unchanged.
7628 % \begin{macrocode}
7629 \newcommand*{\f@x@l@cks}{%
7630 \ifcase\@lock
7631 \or
7632 \global\@lock=\tw@
7633 \or \or
7634 \global\@lock=\z@
7635 \fi
7636 \ifcase\sub@lock
7637 \or
7638 \global\sub@lock=\tw@
7639 \or \or
7640 \global\sub@lock=\z@
7641 \fi}
7642
7643 % \end{macrocode}
7644 % \end{macro}
7645 % \end{macro}
7646 % \end{macro}
7647 %
7648 %
7649 %
7650 %
7651 % \begin{macro}{\pageparbreak}
7652 % Because of TeX's asynchronous page breaking mechanism we can never be
7653 % sure juust where it will make a break and, naturally, it has already decided
7654 % exactly how it will typeset any remainder of a paragraph that crosses
7655 % the break. This is disconcerting when trying to number lines by the page
7656 % or put line numbers in different margins. This macro tries to force an invisible
7657 % paragraph break and a page break.
7658 % \begin{macrocode}
7659 \newcommand{\pageparbreak}{\pend\newpage\pstart\noindent}
7660
7661 % \end{macrocode}
7662 % \end{macro}
7663 %
7664 % \subsection{Pstart number printing in side}
7665 % In side, the printing of pstart number is running like the printing of line number. There is only some differences:
7666 % \begin{macro}{\affixpstart@num}
7667 % \begin{macro}{\pstartnum}
7668 % \begin{itemize}
7669 % \item The pstarts counter is upgrade in the \cs{pend} command. Consequently, the \cs{affixpstart@num} command has not to upgrade it, unlike the \cs{affixline@num} which upgrades the lines counter.
7670 % \item To print the pstart number only at the beginning of a pstart, and not in every line, a boolean test is made. The \cs{pstartnum} boolean is set to TRUE at every \cs{pend}. It's tried in the \cs{leftpstartnum} and \cs{rightstartnum} commands. After the try, it is set to FALSE.
7671 % \end{itemize}
7672 % \begin{macro}{\leftpstartnum}
7673 % \begin{macro}{\rightstartnum}
7674 % \begin{macro}{\ifsidepstartnum}
7675 % \begin{macrocode}
7676
7677 \newif\ifsidepstartnum
7678 \newcommand*{\affixpstart@num}{%
7679 \ifsidepstartnum
7680 \if@twocolumn
7681 \if@firstcolumn
7682 \gdef\l@dld@ta{\llap{{\leftpstartnum}}}%
7683 \else
7684 \gdef\l@drd@ta{\rlap{{\rightpstartnum}}}%
7685 \fi
7686 \else
7687 \@l@dtempcntb=\line@margin
7688 \ifnum\@l@dtempcntb>\@ne
7689 \advance\@l@dtempcntb \page@num
7690 \fi
7691 \ifodd\@l@dtempcntb
7692 \gdef\l@drd@ta{\rlap{{\rightpstartnum}}}%
7693 \else
7694 \gdef\l@dld@ta{\llap{{\leftpstartnum}}}%
7695 \fi
7696 \fi
7697 \fi
7698
7699 }
7700 %
7701
7702 \newif\ifpstartnum
7703 \pstartnumtrue
7704 \newcommand*{\leftpstartnum}{
7705 \ifpstartnum\thepstart
7706 \kern\linenumsep\fi
7707 \global\pstartnumfalse
7708 }
7709 \newcommand*{\rightpstartnum}{
7710 \ifpstartnum
7711 \kern\linenumsep
7712 \thepstart
7713 \fi
7714 \global\pstartnumfalse
7715 }
7716 % \end{macrocode}
7717 % \end{macro}
7718 % \end{macro}
7719 % \end{macro}
7720 % \end{macro}
7721 % \end{macro}
7722 % \subsection{Add insertions to the vertical list}
7723 %
7724 % \begin{macro}{\inserts@list}
7725 % \cs{inserts@list} is the list macro that contains the inserts that
7726 % we save up for one paragraph.
7727 %
7728 % \begin{macrocode}
7729 \list@create{\inserts@list}
7730 % \end{macrocode}
7731 % \end{macro}
7732 %
7733 % \begin{macro}{\add@inserts}
7734 % \begin{macro}{\add@inserts@next}
7735 % \cs{add@inserts}
7736 % is the penultimate macro used by \cs{do@line}; it takes
7737 % insertions saved in a list macro and sends them onto the vertical list.
7738 %
7739 % It may call itself recursively, and to do this efficiently (using
7740 % \TeX's optimization for tail recursion), we define a control-sequence
7741 % called \cs{add@inserts@next} that is always the last thing that
7742 % \cs{add@inserts} does. If there could be more inserts to process for
7743 % this line, \cs{add@inserts@next} is set equal to \cs{add@inserts};
7744 % otherwise it's just \cs{relax}.
7745 %
7746 % \begin{macrocode}
7747 \newcommand*{\add@inserts}{%
7748 \global\let\add@inserts@next=\relax
7749 % \end{macrocode}
7750 %
7751 % If \cs{inserts@list} is empty, there aren't any more notes or insertions
7752 % for this paragraph, and we needn't waste our time.
7753 % \begin{macrocode}
7754 \ifx\inserts@list\empty \else
7755 % \end{macrocode}
7756 %
7757 % The \cs{next@insert} macro records the number of the line that
7758 % receives the next footnote or other insert; it's empty when we start
7759 % out, and just after we've affixed a note or insert.
7760 % \begin{macrocode}
7761 \ifx\next@insert\empty
7762 \ifx\insertlines@list\empty
7763 \global\noteschanged@true
7764 \gdef\next@insert{100000}%
7765 \else
7766 \gl@p\insertlines@list\to\next@insert
7767 \fi
7768 \fi
7769 % \end{macrocode}
7770 %
7771 % If the next insert's for this line, tack it on (and then erase the
7772 % contents of the insert macro, as it could be quite large).
7773 % In that case, we also set \cs{add@inserts@next} so that we'll
7774 % call ourself recursively: there might be another insert for this same
7775 % line.
7776 %
7777 % \begin{macrocode}
7778 \ifnum\next@insert=\absline@num
7779 \gl@p\inserts@list\to\@insert
7780 \@insert
7781 \global\let\@insert=\undefined
7782 \global\let\next@insert=\empty
7783 \global\let\add@inserts@next=\add@inserts
7784 \fi
7785 \fi
7786 % \end{macrocode}
7787 %
7788 % Make the recursive call, if necessary.
7789 %
7790 % \begin{macrocode}
7791 \add@inserts@next}
7792
7793 % \end{macrocode}
7794 % \end{macro}
7795 % \end{macro}
7796 %
7797 % \subsection{Penalties}
7798 %
7799 % \begin{macro}{\add@penalties}
7800 % \cs{add@penalties} is
7801 % the last macro used by \cs{do@line}. It adds up the club,
7802 % widow, and interline penalties, and puts a single penalty
7803 % of the appropriate size
7804 % back into the paragraph; these penalties get
7805 % removed by the \cs{vsplit} operation. \cs{displaywidowpenalty} and
7806 % \cs{brokenpenalty} are not restored, since we have no easy way to
7807 % find out where we should insert them.
7808 %
7809 % \phantomsection\label{add@penalties}
7810 % In this code, \cs{num@lines} is the number of lines in the whole
7811 % paragraph, and \cs{par@line} is the line we're working on at the
7812 % moment. The count \cs{@l@dtempcnta} is used to calculate and
7813 % accumulate the penalty; it is initially set to the value of
7814 % \cs{ballast@count}, which has been worked out in \cs{do@ballast}
7815 % above (\reff{do@ballast}). Finally, the penalty is
7816 % checked to see that it doesn't go below $-10000$.
7817 % \begin{macrocode}
7818 \newcommand*{\add@penalties}{\@l@dtempcnta=\ballast@count
7819 \ifnum\num@lines>\@ne
7820 \global\advance\par@line \@ne
7821 \ifnum\par@line=\@ne
7822 \advance\@l@dtempcnta \clubpenalty
7823 \fi
7824 \@l@dtempcntb=\par@line \advance\@l@dtempcntb \@ne
7825 \ifnum\@l@dtempcntb=\num@lines
7826 \advance\@l@dtempcnta \widowpenalty
7827 \fi
7828 \ifnum\par@line<\num@lines
7829 \advance\@l@dtempcnta \interlinepenalty
7830 \fi
7831 \fi
7832 \ifnum\@l@dtempcnta=\z@
7833 \relax
7834 \else
7835 \ifnum\@l@dtempcnta>-10000
7836 \penalty\@l@dtempcnta
7837 \else
7838 \penalty -10000
7839 \fi
7840 \fi}
7841
7842 % \end{macrocode}
7843 % \end{macro}
7844 %
7845 % \subsection{Printing leftover notes}
7846 %
7847 % \begin{macro}{\flush@notes}
7848 % The \cs{flush@notes}
7849 % macro is called after the entire paragraph has been sliced up
7850 % and sent on to the vertical list.
7851 % If the number of notes to this paragraph has increased since the last
7852 % run of \TeX, then there can be leftover notes that haven't yet been
7853 % printed. An appropriate error message will be printed elsewhere; but
7854 % it's best to go ahead and
7855 % print these notes somewhere, even if it's not in quite the
7856 % right place. What we do is dump them all out here, so that they should
7857 % be printed on the same page as the last line
7858 % of the paragraph. We can hope that's not
7859 % too far from the proper location, to which they'll move on the next
7860 % run.
7861 % \begin{macrocode}
7862 \newcommand*{\flush@notes}{%
7863 \@xloop
7864 \ifx\inserts@list\empty \else
7865 \gl@p\inserts@list\to\@insert
7866 \@insert
7867 \global\let\@insert=\undefined
7868 \repeat}
7869
7870 % \end{macrocode}
7871 % \end{macro}
7872 %
7873 % \begin{macro}{\@xloop}
7874 % \cs{@xloop} is
7875 % a variant of the \PlainTeX\ \cs{loop} macro, useful when it's
7876 % hard to construct a positive test using the \TeX\ \verb"\if" commands---as
7877 % in \cs{flush@notes} above. One says \cs{@xloop} \verb"..." \verb"\if" \verb"..." \verb"\else"
7878 % \verb"..." \verb"\repeat", and the action following \verb"\else" is repeated as long
7879 % as the \verb"\if" test fails. (This macro will work wherever the \PlainTeX\
7880 % \cs{loop} is used, too, so we could just call it \cs{loop};
7881 % but it seems preferable not to change the definitions of any of
7882 % the standard macros.)
7883 %
7884 % This variant of \cs{loop} was introduced by
7885 % Alois Kabelschacht\index{Kabelschacht, Alois} in
7886 % \textit{TUGboat} \textbf{8} (1987), pp.\,184--5.
7887 %
7888 % \begin{macrocode}
7889 \def\@xloop#1\repeat{%
7890 \def\body{#1\expandafter\body\fi}%
7891 \body}
7892
7893 % \end{macrocode}
7894 % \end{macro}
7895 %
7896 % \section{Critical footnotes}
7897 % \label{footnotes}\relax
7898 %
7899 % The footnote macros are adapted from those in \PlainTeX, but they
7900 % differ in these respects: the outer-level commands must add other
7901 % commands to a list macro rather than doing insertions immediately;
7902 % there are five separate levels of the footnotes, not just one; and there
7903 % are options to reformat footnotes into paragraphs or into multiple
7904 % columns.
7905 %
7906 % \subsection{Fonts}
7907 % \label{fontcode}\relax
7908 % Before getting into the details of formatting the notes, we set
7909 % up some font macros. It is the notes that present the greatest
7910 % challenge for our font-handling mechanism, because we need to be
7911 % able to take fragments of our main text and print them in
7912 % different forms: it is common to reduce the size,
7913 % for example, without otherwise changing the fonts used.
7914 %
7915 %
7916 % \begin{macro}{\select@lemmafont}\label{notefonts}
7917 % \begin{macro}{\select@@lemmafont}
7918 % \cs{select@lemmafont} is provided to set the right font for
7919 % the lemma in a note. This macro extracts the font specifier
7920 % from the line and page number cluster, and issues the associated
7921 % font-changing command, so that the lemma is printed in its
7922 % original font.
7923 % \begin{macrocode}
7924 \def\select@lemmafont#1|#2|#3|#4|#5|#6|#7|{\select@@lemmafont#7|}
7925 \def\select@@lemmafont#1/#2/#3/#4|%
7926 {\fontencoding{#1}\fontfamily{#2}\fontseries{#3}\fontshape{#4}%
7927 \selectfont}
7928
7929 % \end{macrocode}
7930 % \end{macro}
7931 % \end{macro}
7932 %
7933 %
7934 % \subsection{Outer-level footnote commands}
7935 % \changes{v1.0.0}{2012/09/15}{Options of \cs{Xfootnote}s.}
7936 % \begin{macro}{\footnoteoptions@}
7937 % The \cs{footnoteoption@}\oarg{side}\marg{options}\marg{value} change the value of on options of Xfootnote, to switch between true and false.
7938 % \begin{macrocode}
7939 \newcommandx*{\footnoteoptions@}[3][1=L,usedefault]{%
7940 \def\do##1{%
7941 \ifstrequal{#1}{L}{% In Leftside
7942 \xright@appenditem{\global\noexpand\settoggle{##1@}{#3}}\to\inserts@list% Switch toogle, in all case
7943 \global\advance\insert@count \@ne% Increment the left insert counter.
7944 }%
7945 {%
7946 \xright@appenditem{\global\noexpand\settoggle{##1@}{#3}}\to\inserts@listR% Switch toogle, in all case
7947 \global\advance\insert@countR \@ne% Increment the right insert counter insert.
7948 }%
7949 }%
7950 \notblank{#2}{\docsvlist{#2}}{}% Parsing all options
7951 }
7952 % \end{macrocode}
7953 % \end{macro}
7954 %
7955 %
7956 % \begin{macro}{\footnotelang@lua}
7957 % \cs{footnotelang@lua} is called to remember the information about the language of a lemma when LuaLaTeX is used.
7958 % \begin{macrocode}
7959 \newcommandx*{\footnotelang@lua}[1][1=L,usedefault]{%
7960 \ifstrequal{#1}{L}{%
7961 \xright@appenditem{{\csxdef{footnote@luatextextdir}{\the\textdir}}}\to\inserts@list%Know the dir of lemma
7962 \global\advance\insert@count \@ne%
7963 \xright@appenditem{{\csxdef{footnote@luatexpardir}{\the\pardir}}}\to\inserts@list%Know the dir of lemma
7964 \global\advance\insert@count \@ne%
7965 }%
7966 {%
7967 \xright@appenditem{{\csxdef{footnote@luatextextdir}{\the\textdir}}}\to\inserts@listR%Know the dir of lemma
7968 \global\advance\insert@countR \@ne%
7969 \xright@appenditem{{\csxdef{footnote@luatexpardir}{\the\pardir}}}\to\inserts@listR%Know the dir of lemma
7970 \global\advance\insert@countR \@ne%
7971 }%
7972 }
7973 % \end{macrocode}
7974 % \end{macro}
7975 % \begin{macro}{\footnotelang@poly}
7976 % \cs{footnotelang@poly} is called to remember the information about the language of a lemma when Polyglossia is used.
7977 % \begin{macrocode}
7978 \newcommandx*{\footnotelang@poly}[1][1=L,usedefault]{%
7979 \ifstrequal{#1}{L}{%
7980 \if@RTL%
7981 \xright@appenditem{{\csxdef{footnote@dir}{@RTLtrue}}}\to\inserts@list%Know the language used in the lemma
7982 \global\advance\insert@count \@ne%
7983 \else
7984 \xright@appenditem{{\csxdef{footnote@dir}{@RTLfalse}}}\to\inserts@list%Know the language of lemma
7985 \global\advance\insert@count \@ne%
7986 \fi%
7987 \xright@appenditem{{\csxdef{footnote@lang}{\expandonce\languagename}}}\to\inserts@list%Know the language of lemma
7988 \global\advance\insert@count \@ne%
7989 }%
7990 {%
7991 \if@RTL
7992 \xright@appenditem{{\csxdef{footnote@dir}{@RTLtrue}}}\to\inserts@listR%Know the language of lemma
7993 \global\advance\insert@countR \@ne%
7994 \else
7995 \xright@appenditem{{\csxdef{footnote@dir}{@RTLfalse}}}\to\inserts@listR%Know the language of lemma
7996 \global\advance\insert@countR \@ne%
7997 \fi
7998 \xright@appenditem{{\csxdef{footnote@lang}{\expandonce\languagename}}}\to\inserts@listR%Know the language of lemma
7999 \global\advance\insert@countR \@ne%
8000 }%
8001 }
8002 % \end{macrocode}
8003 % \end{macro}
8004 % \subsection{Normal footnote formatting} \label{sec:nfootformat}
8005 %
8006 % The processing of each note is done
8007 % by four principal macros: the \cs{vfootnote} macro takes the text
8008 % of the footnote and does the \cs{insert}; it calls on the
8009 % \cs{footfmt} macro to select the right fonts, print the line
8010 % number and lemma, and do any other formatting needed for that individual
8011 % note. Within the output routine, the two other macros, \cs{footstart}
8012 % and \cs{footgroup}, are called; the first prints extra vertical
8013 % space and a footnote rule, if desired; the second does any reformatting
8014 % of the whole set of the footnotes in this series for this page---such
8015 % as paragraphing or division into columns---and then sends them to the
8016 % page.
8017 %
8018 % These four macros, and the other macros and parameters shown
8019 % here, are distinguished by the `series letter'
8020 % that indicates which set of the footnotes
8021 % we're dealing with---\texttt{A}, \texttt{B}, \texttt{C}, \texttt{D}, or \texttt{E}.
8022 % The series letter always precedes the string \verb"foot" in macro
8023 % and parameter names. Hence, for the \texttt{A} series, the four macros
8024 % are called \cs{vAfootnote}, \cs{Afootfmt}, \cs{Afootstart},
8025 % and \cs{Afootgroup}.
8026 %
8027 % \begin{macro}{\normalvfootnote}
8028 % We now begin a series of commands that do `normal' footnote
8029 % formatting: a format much like that implemented
8030 % in \PlainTeX{}, in which each footnote
8031 % is a separate paragraph.
8032 %
8033 % \cs{normalvfootnote} takes the series letter as \verb"#1",
8034 % and the entire text of the footnote is \verb"#2". It does the
8035 % \cs{insert} for this note, calling on the \cs{footfmt} macro for
8036 % this note series to format the text of the note.
8037 % \begin{macrocode}
8038 \notbool{parapparatus@}{\newcommand*}{\newcommand}{\normalvfootnote}[2]{%
8039 \insert\csname #1footins\endcsname\bgroup
8040 \csuse{bhookXnote@#1}
8041 \csuse{Xnotefontsize@#1}
8042 \footsplitskips
8043 \ifl@dpairing\ifl@dpaging\else%
8044 \setXnoteswidthliketwocolumns@{#1}%
8045 \fi\fi%
8046 \setXnotespositionliketwocolumns@{#1}%
8047 \spaceskip=\z@skip \xspaceskip=\z@skip
8048 \csname #1footfmt\endcsname #2[#1]\egroup}
8049 % \end{macrocode}
8050 % \end{macro}
8051 %
8052 % \begin{macro}{\footsplitskips}
8053 % Some setup code that is common for a variety of the footnotes.
8054 % The setup is for :
8055 % \begin{itemize}
8056 % \item \cs{interlinepenalty}.
8057 % \item \cs{splittopskip} (skip before last part of notes that flow from one page to another).
8058 % \item \cs{splitmaxdepth}.
8059 % \item \cs{floatingpenalty}, that is penalty values being added when a long note flows from one page to another.
8060 % Here, we let it to 0 when we are processing parallel pages in \Lpack{eledpar}, in order to allow notes to flow from left to right pages and \emph{vice-versa}.
8061 % Otherwise, we let it to \cs{@MM}, which is the standard \LaTeX\ \cs{floatingpenalty}.
8062 % \end{itemize}
8063 % \changes{v0.7.0}{2005/02/18}{Added \cs{footsplitskips} for use in many
8064 % footnote styles}
8065 % \changes{v1.19.0}{2015/03/06}{\cs{footsplitskips} doesn't set \cs{floatingpenalty} to \cs{@MM} when processing parallel pages.}
8066 % \begin{macrocode}
8067 \newcommand*{\footsplitskips}{%
8068 \interlinepenalty=\interfootnotelinepenalty
8069 \unless\ifl@dprintingpages%
8070 \floatingpenalty=\@MM%
8071 \fi%
8072 \splittopskip=\ht\strutbox \splitmaxdepth=\dp\strutbox
8073 \leftskip=\z@skip \rightskip=\z@skip}
8074
8075 % \end{macrocode}
8076 % \end{macro}
8077 %
8078 % \begin{macro}{\mpnormalvfootnote}
8079 % And a somewhat different version for minipages.
8080 % \changes{v0.4.0}{2004/02/29}{Added \cs{mpnormalvfootnote}}
8081 % \begin{macrocode}
8082 \notbool{parapparatus@}{\newcommand*}{\newcommand}{\mpnormalvfootnote}[2]{%
8083 \global\setbox\@nameuse{mp#1footins}\vbox{%
8084 \unvbox\@nameuse{mp#1footins}
8085 \csuse{bhookXnote@#1}
8086 \csuse{Xnotefontsize@#1}
8087 \hsize\columnwidth
8088 \@parboxrestore
8089 \color@begingroup
8090 \csname #1footfmt\endcsname #2[#1]\color@endgroup}}
8091
8092 % \end{macrocode}
8093 % \end{macro}
8094 %
8095 % \begin{macro}{\ledsetnormalparstuff@common}
8096 % \begin{macro}{\ledsetnormalparstuff}
8097 % \begin{macro}{\Xledsetnormalparstuff}
8098 % \begin{macro}{\ledsetnormalparstuffX}
8099 % \begin{macro}{\normalfootfmt}
8100 % \phantomsection\label{normalfootfmt}\relax
8101 % \cs{normalfootfmt} is a `normal' macro
8102 % to take the footnote line and page
8103 % number information (see \reff{linenumbers}), and the
8104 % desired text, and output what's to be printed.
8105 % Argument \verb"#1" contains the line and page number information
8106 % and lemma font specifier;
8107 % \verb"#2" is the lemma;
8108 % \verb"#3" is the note's text. This version is very
8109 % rudimentary---it uses \cs{printlines}
8110 % to print just the range of line numbers,
8111 % followed by a square bracket, the lemma, and the note text;
8112 % it's intended to be copied and modified as necessary.
8113 %
8114 % \verb"\par" should always be redefined to \verb"\endgraf" within
8115 % the format macro (this is what \cs{normal@pars} does),
8116 % to override tricky material in the main text
8117 % to get the lines numbered automatically (as set up by
8118 % \cs{autopar}, for example).
8119 %
8120 % \changes{v1.4.0}{2012/11/16}{Direction of footnotes with polyglossia.}
8121 % \changes{v1.21.0}{2015/04/13}{\cs{ledsetnormalparstuff} is deprecated and becomes \cs{ledsetnormalparstuffX} and \cs{Xledsetnormalparstuff}.}
8122 % \begin{macrocode}
8123 \newcommand*{\ledsetnormalparstuff}{%
8124 \led@war@ledsetnormalparstuffDeprecated%
8125 \ifluatex%
8126 \textdir\footnote@luatextextdir%
8127 \pardir\footnote@luatexpardir%
8128 \fi%
8129 \csuse{\csuse{footnote@dir}}%
8130 \normal@pars%
8131 \noindent \parfillskip \z@ \@plus 1fil}%
8132
8133 \newcommand*{\ledsetnormalparstuff@common}{%
8134 \ifluatex%
8135 \textdir\footnote@luatextextdir%
8136 \pardir\footnote@luatexpardir%
8137 \fi%
8138 \csuse{\csuse{footnote@dir}}%
8139 \normal@pars%
8140 \parfillskip \z@ \@plus 1fil}%
8141
8142 \newcommand*{\Xledsetnormalparstuff}[1]{%
8143 \ledsetnormalparstuff@common%
8144 \nottoggle{Xparindent@#1}{\noindent}{}%\noindent and and not \parindent=0pt to avoid to break the (bad) change made when moving from ledmac to eledmac
8145 }%
8146
8147 \newcommand*{\ledsetnormalparstuffX}[1]{%
8148 \ledsetnormalparstuff@common%
8149 \nottoggle{parindentX@#1}{\noindent}{}%\noindent and and not \parindent=0pt to avoid to break the (bad) change made when moving from ledmac to eledmac
8150 }%
8151
8152 \notbool{parapparatus@}{\newcommandx*}{\newcommandx}{\normalfootfmt}[4][4=Z]{% 4th arg is optional, for backward compatibility
8153 \Xledsetnormalparstuff{#4}%
8154 \hangindent=\csuse{Xhangindent@#4}
8155 \strut{\printlinefootnote{#1}{#4}}%
8156 {\nottoggle{Xlemmadisablefontselection@#4}{\select@lemmafont#1|#2}{#2}}%
8157 \iftoggle{nosep@}{\hskip\csuse{inplaceoflemmaseparator@#4}}{\ifcsempty{lemmaseparator@#4}%
8158 {\hskip\csuse{inplaceoflemmaseparator@#4}}%
8159 {\nobreak\hskip\csuse{beforelemmaseparator@#4}\csuse{lemmaseparator@#4}\hskip\csuse{afterlemmaseparator@#4}\relax%
8160 }}%
8161 #3\strut\par}
8162 % \end{macrocode}
8163 % \end{macro}
8164 % \end{macro}
8165 % \end{macro}
8166 % \end{macro}
8167 % \end{macro}
8168 %
8169 % \begin{macro}{\endashchar}
8170 % \begin{macro}{\fullstop}
8171 % \begin{macro}{\rbracket}
8172 % The fonts that are used for printing notes might not have the
8173 % character mapping we expect: for example, the Computer Modern font
8174 % that contains old-style numerals does not contain an en-dash or
8175 % square brackets, and its period and comma are in odd locations.
8176 % To allow use of the standard footnote macros with such fonts, we use
8177 % the following macros for certain characters.
8178 %
8179 % The \cs{endashchar} macro is simply an en-dash from the
8180 % normal font and is immune to changes in the surrounding
8181 % font. The same goes for the full stop. These two are used in
8182 % \cs{printlines}. The right bracket macro is the same again;
8183 % it crops up in \cs{normalfootfmt} and the other footnote
8184 % macros for controlling the format of the footnotes.
8185 %
8186 % With polyglossia, each critical note has a \cs{footnote@lang} which shows the language of the lemma,
8187 % and which can be used to switch the bracket from right to left.
8188 % \changes{v1.4.0}{2012/11/16}{Switch the right bracket to a left bracket when the lemma is RTL (needs polyglossia or LuaTeX).}
8189 % \begin{macrocode}
8190 \def\endashchar{\textnormal{--}}
8191 \newcommand*{\fullstop}{\textnormal{.}}
8192 \newcommand*{\rbracket}{\textnormal{%
8193 \csuse{text\csuse{footnote@lang}}{%
8194 \ifluatex%
8195 \ifdefstring{\footnote@luatextextdir}{TRT}{\thinspace[}{\thinspace]}%
8196 \else%
8197 \thinspace]%
8198 \fi}%
8199 }%
8200 }
8201
8202 % \end{macrocode}
8203 % \end{macro}
8204 % \end{macro}
8205 % \end{macro}
8206 %
8207 % \begin{macro}{\printpstart}
8208 % The \cs{printpstart} macro prints the pstart number for a note.
8209 % \changes{v1.18.0}{2015/02/23}{Debug \cs{pstartinfootnote} with parallel pages and columns (eledpar)}
8210 % \begin{macrocode}
8211 \newcommand{\printpstart}[0]{%
8212 \ifboolexpr{bool{l@dpairing} or bool{l@dprintingpages} or bool{l@dprintingcolumns}}{%
8213 \ifledRcol%
8214 \thepstartR%
8215 \else%
8216 \thepstartL%
8217 \fi%
8218 }{%
8219 \thepstart%
8220 }%
8221 }
8222 % \end{macrocode}
8223 %
8224 % \end{macro}
8225 % The \cs{printlines} macro prints the line
8226 % numbers for a note---which, in the
8227 % general case, is a rather complicated task.
8228 % The seven parameters of the
8229 % argument are the line numbers as stored in \cs{l@d@nums}, in the
8230 % form described on \reff{linenumbers}: the starting
8231 % page, line, and sub-line numbers, followed by the ending page,
8232 % line, and sub-line numbers, and then the font specifier for
8233 % the lemma.
8234 %
8235 % The original \edmac{} code used several counters at this point,
8236 % saying:
8237 % \begin{quote}
8238 % To simplify the logic, we use a lot of counters to tell us which
8239 % numbers need to get printed (using $1$ for yes, $0$ for no, so
8240 % that \verb"\ifodd" tests for `yes'). The counter assignments are:
8241 % \begin{itemize}\addtolength{\itemsep}{-1ex}
8242 % \item \cs{@pnum} for page numbers;
8243 % \item \cs{@ssub} for starting sub-line;
8244 % \item \cs{@elin} for ending line;
8245 % \item \cs{@esl} for ending sub-line; and
8246 % \item \cs{@dash} for the dash between the starting and ending groups.
8247 % \end{itemize}
8248 % There's no counter for the line number because it's always printed.
8249 % \end{quote}
8250 % \LaTeX\ tends to use a lot of counters and packages should try and
8251 % minimise the number of new ones they create. In line with this
8252 % Peter Wilson has reverted to traditional booleans.
8253 %
8254 % Maïeul Rouquette has added \cs{ifl@d@twolines} and \cs{ifl@d@morethantwolines}
8255 % to print a symbol which stands for ``and subsequent`` when there are two, three or more lines.
8256 % \begin{macro}{\ifl@d@pnum}
8257 % \begin{macro}{\ifl@d@ssub}
8258 % \begin{macro}{\ifl@d@elin}
8259 % \begin{macro}{\ifl@d@esl}
8260 % \begin{macro}{\ifl@d@dash}
8261 % \begin{macro}{\ifl@d@twolines}
8262 % \begin{macro}{\ifl@d@morethantwolines}
8263 % \begin{macrocode}
8264 \newif\ifl@d@pnum
8265 \newif\ifl@d@ssub
8266 \newif\ifl@d@elin
8267 \newif\ifl@d@esl
8268 \newif\ifl@d@dash
8269 \newif\ifl@d@twolines%
8270 \newif\ifl@d@morethantwolines%
8271 % \end{macrocode}
8272 % \end{macro}
8273 % \end{macro}
8274 % \end{macro}
8275 % \end{macro}
8276 % \end{macro}
8277 % \end{macro}
8278 % \end{macro}
8279 %
8280 %
8281 % \begin{macro}{\l@dparsefootspec}
8282 % \begin{macro}{\l@dp@rsefootspec}
8283 % \begin{macro}{\l@dparsedstartpage}
8284 % \begin{macro}{\l@dparsedstartline}
8285 % \begin{macro}{\l@dparsedstartsub}
8286 % \begin{macro}{\l@dparsedendpage}
8287 % \begin{macro}{\l@dparsedendline}
8288 % \begin{macro}{\l@dparsedendsub}
8289 % \cs{l@dparsefootspec}\marg{spec}\marg{lemma}\marg{text} parses a footnote
8290 % specification. \meta{lemma} and \meta{text} are the lemma and text
8291 % respectively. \meta{spec} is the line and page number and lemma font
8292 % specifier in \cs{l@d@nums} style format. The real work is done
8293 % by \cs{l@dp@rsefootspec} which defines macros holding the numeric values.
8294 % \begin{macrocode}
8295 \newcommand*{\l@dparsefootspec}[3]{\l@dp@rsefootspec#1|}
8296 \def\l@dp@rsefootspec#1|#2|#3|#4|#5|#6|#7|{%
8297 \gdef\l@dparsedstartpage{#1}%
8298 \gdef\l@dparsedstartline{#2}%
8299 \gdef\l@dparsedstartsub{#3}%
8300 \gdef\l@dparsedendpage{#4}%
8301 \gdef\l@dparsedendline{#5}%
8302 \gdef\l@dparsedendsub{#6}%
8303 }
8304 % \end{macrocode}
8305 % Initialise the several number value macros.
8306 % \begin{macrocode}
8307 \def\l@dparsedstartpage{0}%
8308 \def\l@dparsedstartline{0}%
8309 \def\l@dparsedstartsub{0}%
8310 \def\l@dparsedendpage{0}%
8311 \def\l@dparsedendline{0}%
8312 \def\l@dparsedendsub{0}%
8313
8314 % \end{macrocode}
8315 % \end{macro}
8316 % \end{macro}
8317 % \end{macro}
8318 % \end{macro}
8319 % \end{macro}
8320 % \end{macro}
8321 % \end{macro}
8322 % \end{macro}
8323 %
8324 %
8325 % \begin{macro}{\setistwofollowinglines}
8326 % The \cs{ifistwofollowinglines} boolean, used by the \cs{twolines} and related tools, is set to true by \cs{setistwofollowinglines}.
8327 % This command takes the following arguments:
8328 % \begin{itemize}
8329 % \item \verb+#1+ First page number.
8330 % \item \verb+#2+ First line number.
8331 % \item \verb+#3+ Last page number.
8332 % \item \verb+#4+ Last line number.
8333 % \end{itemize}
8334 % If \verb+#3+-\verb+#2+ = 1, then that means the two lines are subsequent, and consequently \cs{ifistwofollowinglines} is set to true.
8335 % However, if we use lineation by page, two given lines can be subsequent if:
8336 % \begin{itemize}
8337 % \item The first line number is equal to the last line number of the first page.
8338 % \item The last line number is equal to 1.
8339 % \item \verb+#3+-\verb+#1+ is equal to 1.
8340 % \end{itemize}
8341 % \begin{macrocode}
8342 \newif\ifistwofollowinglines@%
8343 \newcommand{\setistwofollowinglines}[4]{%
8344 \ifcsdef{lastlinenumberon@#1}%
8345 {\numdef{\tmp}{\csuse{lastlinenumberon@#1}}}%
8346 {\numdef{\tmp}{0}}%
8347 \istwofollowinglines@false%
8348 \ifnumequal{#4-#2}{1}%
8349 {\istwofollowinglines@true}%
8350 {\ifbypage@%
8351 \ifnumequal{#3-#1}{1}%
8352 {%
8353 \ifnumequal{#2}{\tmp}%
8354 {\ifnumequal{#4}{1}{\istwofollowinglines@true}{}}%
8355 {}%
8356 }%
8357 {}%
8358 \fi%
8359 }%
8360 }%
8361 % \end{macrocode}
8362 % \end{macro}
8363 %
8364 % \begin{macro}{\setprintlines}
8365 % We print the page numbers only if\/: 1)~we're doing
8366 % the lineation by page, and 2)~the ending page number is different
8367 % from the starting page number.\phantomsection\label{printlines}
8368 %
8369 % Just a reminder of the arguments: \\
8370 % \verb?\printlines #1 | #2 | #3 | #4 | #5 | #6 | #7? \\
8371 % \verb?\printlines start-page | line | subline | end-page | line | subline | font ?
8372 %
8373 % The macro \cs{setprintlines} does the work of deciding what numbers should
8374 % be printed. Its arguments are the same as the first 6 of \cs{printlines}.
8375 % \changes{v0.7.0}{2005/02/18}{Added \cs{setprintlines} for use by \cs{printlines}}
8376 % \begin{macrocode}
8377 \newcommand*{\setprintlines}[6]{%
8378 \l@d@pnumfalse \l@d@dashfalse
8379 \ifbypage@
8380 \ifnum#4=#1 \else
8381 \l@d@pnumtrue
8382 \l@d@dashtrue
8383 \fi
8384 \fi
8385 % \end{macrocode}
8386 %
8387 % We print the ending line number if\/: (1)~we're printing the ending
8388 % page number, or (2)~it's different from the starting line number.
8389 % \begin{macrocode}
8390 \ifl@d@pnum \l@d@elintrue \else \l@d@elinfalse \fi
8391 \ifnum#2=#5 \else
8392 \l@d@elintrue
8393 \l@d@dashtrue
8394 \fi
8395 % \end{macrocode}
8396 %
8397 % We print the starting sub-line if it's nonzero.
8398 % \begin{macrocode}
8399 \l@d@ssubfalse
8400 \ifnum#3=0 \else
8401 \l@d@ssubtrue
8402 \fi
8403 % \end{macrocode}
8404 %
8405 % We print the ending sub-line if it's nonzero and: (1)~it's different
8406 % from the starting sub-line number, or (2)~the ending line number is
8407 % being printed.
8408 % \begin{macrocode}
8409 \l@d@eslfalse
8410 \ifnum#6=0 \else
8411 \ifnum#6=#3
8412 \ifl@d@elin \l@d@esltrue \else \l@d@eslfalse \fi
8413 \else
8414 \l@d@esltrue
8415 \l@d@dashtrue
8416 \fi
8417 \fi%
8418 % \end{macrocode}
8419 % However, if the \cs{twolines} is set for the current series, we don't print the last line number.
8420 % \begin{macrocode}
8421 \ifl@d@dash%
8422 \ifboolexpr{togl{fulllines@} or test{\ifcsempty{twolines@\@currentseries}}}%
8423 {}%
8424 {%
8425 \setistwofollowinglines{#1}{#2}{#4}{#5}%
8426 \ifboolexpr{%
8427 (%
8428 togl {twolinesbutnotmore@\@currentseries}%
8429 and not%
8430 (%
8431 bool {istwofollowinglines@}%
8432 )%
8433 )%
8434 or%
8435 (%
8436 (not test{\ifnumequal{#1}{#4}})%
8437 and togl{twolinesonlyinsamepage@\@currentseries}%
8438 )%
8439 }%
8440 {}%
8441 {%
8442 \l@d@dashfalse%
8443 \l@d@twolinestrue%
8444 \l@d@elinfalse%
8445 \l@d@eslfalse%
8446 \ifcsempty{morethantwolines@\@currentseries}%
8447 {}%
8448 {\ifistwofollowinglines@\else%
8449 \l@d@morethantwolinestrue%
8450 \fi%
8451 }%
8452 }%
8453 }%
8454 \fi%
8455 % \end{macrocode}
8456 % End of \cs{setprintlines}.
8457 % \begin{macrocode}
8458 }%
8459 % \end{macrocode}
8460 % \end{macro}
8461 %
8462 % \begin{macro}{\printlines}
8463 % Now we're ready to print it all. If the lineation is by pstart, we print the pstart.
8464 % \changes{v0.15.0}{2012/06/11}{Line numbering can be reset at each pstart.}
8465 % \begin{macrocode}
8466 \def\printlines#1|#2|#3|#4|#5|#6|#7|{%
8467 \begingroup%
8468 \ifluatex%
8469 \textdir TLT%
8470 \fi%
8471 \setprintlines{#1}{#2}{#3}{#4}{#5}{#6}%
8472 % \end{macrocode}
8473 % One subtlety left here is when to print a period between
8474 % numbers. But the only instance in which this is tricky is for the
8475 % ending sub-line number: it could come after the starting
8476 % sub-line number (in which case we want only the dash) or after an
8477 % ending line number (in which case we need to insert a period).
8478 % So, first, print ths start line number.
8479 % \begin{macrocode}
8480 \ifdimequal{\csuse{boxstartlinenum@\@currentseries}}{0pt}%
8481 {\bgroup}%
8482 {\leavevmode\hbox to \csuse{boxstartlinenum@\@currentseries}\bgroup\hfill}%
8483 \ifl@d@pnum #1\fullstop\fi
8484 \linenumrep{#2}
8485 \ifl@d@ssub \fullstop \sublinenumrep{#3}\fi
8486 \egroup%
8487 % \end{macrocode}
8488 % Then print the dash + end linuber, or the range symbol.
8489 % \changes{v0.3.0}{2004/02/14}{Added \cs{linenumr@p} and \cs{sublinenumr@p}
8490 % to \cs{printlines}}
8491 % \changes{v1.20.0}{2015/03/22}{Added \cs{ifl@d@morethantwolines} and \cs{ifl@d@morethantwolines} to \cs{printlines}}
8492 % \begin{macrocode}
8493 \ifdimequal{\csuse{boxendlinenum@\@currentseries}}{0pt}%
8494 {\bgroup}%
8495 {\hbox to \csuse{boxendlinenum@\@currentseries}\bgroup}%
8496 \ifl@d@twolines%
8497 \ifl@d@morethantwolines%
8498 \csuse{morethantwolines@\@currentseries}%
8499 \else%
8500 \csuse{twolines@\@currentseries}%
8501 \fi%
8502 \else%
8503 \ifl@d@dash \endashchar\fi%
8504 \ifl@d@pnum #4\fullstop\fi%
8505 \ifl@d@elin \linenumrep{#5}\fi%
8506 \ifl@d@esl \ifl@d@elin \fullstop\fi \sublinenumrep{#6}\fi%
8507 \fi%
8508 \ifdimequal{\csuse{boxendlinenum@\@currentseries}}{0pt}%
8509 {}%
8510 {\hfill}%Prevent underfull hbox
8511 \egroup%
8512 \endgroup%
8513 }%
8514 % \end{macrocode}
8515 % \end{macro}
8516 % \begin{macro}{\normalfootstart}\label{normalvalues}
8517 % \phantomsection\relax
8518 % \cs{normalfootstart}
8519 % is a standard footnote-starting macro, called in the output
8520 % routine whenever there are footnotes of this series to be
8521 % printed: it skips a bit and then draws a rule.
8522 %
8523 % Any \verb"footstart" macro must put onto the page something that
8524 % takes up space exactly equal to the \verb"\skip\footins" value for
8525 % the associated series of notes. \TeX\ makes page computations based
8526 % on that \cs{skip} value, and the output pages will suffer from
8527 % spacing problems if what you add takes up a different amount of
8528 % space.
8529 %
8530 % But if the skip \verb|\preXnotes@| is greater than 0~pt,
8531 % it's used instead of \verb"\skip\footins" for the first printed series.
8532 %
8533 % The \cs{leftskip} and \cs{rightskip} values
8534 % are both zeroed here.\phantomsection\label{footskips}
8535 % Similarly, these skips are cancelled in the \verb"vfootnote" macros
8536 % for the various types of notes. Strictly speaking,
8537 % this is necessary only
8538 % if you are using paragraphed footnotes, but we have put it here
8539 % and in the other \verb"vfootnote" macros too so that the behavior of
8540 % \Eledmac{} in this respect is general across all footnote types
8541 % (you can change this). What this means is that any \cs{leftskip}
8542 % and \cs{rightskip} you specify applies to the main text, but not
8543 % the footnotes. The footnotes continue to be of width \cs{hsize}.
8544 % \begin{macrocode}
8545 \newcommand*{\normalfootstart}[1]{%
8546 \ifdimequal{0pt}{\preXnotes@}{}%
8547 {%
8548 \iftoggle{preXnotes@}{%
8549 \togglefalse{preXnotes@}%
8550 \skip\csname #1footins\endcsname=%
8551 \dimexpr\csuse{preXnotes@}+\csuse{afterXrule@#1}\relax%
8552 }%
8553 {}%
8554 }%
8555 \vskip\skip\csname #1footins\endcsname%
8556 \leftskip0pt \rightskip0pt
8557 \ifl@dpairing\else%
8558 \hsize=\old@hsize%
8559 \fi%
8560 \setXnoteswidthliketwocolumns@{#1}%
8561 \setXnotespositionliketwocolumns@{#1}%
8562 \print@Xfootnoterule{#1}%
8563 \noindent\leavevmode}
8564 % \end{macrocode}
8565 % \end{macro}
8566 %
8567 % \begin{macro}{\normalfootnoterule}
8568 % \cs{normalfootnoterule} is
8569 % a standard footnote-rule macro, for use by a \verb"footstart"
8570 % macro: just the same as the \PlainTeX\ footnote rule.
8571 % \begin{macrocode}
8572 \let\normalfootnoterule=\footnoterule
8573 % \end{macrocode}
8574 % \end{macro}
8575 %
8576 % \begin{macro}{\normalfootgroup}
8577 % \cs{normalfootgroup} is
8578 % a standard footnote-grouping macro: it sends the
8579 % contents of the footnote-insert box to the output page without
8580 % alteration.
8581 % \begin{macrocode}
8582 \newcommand*{\normalfootgroup}[1]{%
8583 {\csuse{Xnotefontsize@#1}\noindent\csuse{txtbeforeXnotes@#1}}%
8584 \unvbox\csname #1footins\endcsname%
8585 \hsize=\old@hsize%
8586 }%
8587
8588 % \end{macrocode}
8589 % \end{macro}
8590 %
8591 % \begin{macro}{\mpnormalfootgroup}
8592 % A somewhat different version for minipages.
8593 % \changes{v0.4.0}{2004/02/29}{Added \cs{mpnormalfootgroup}}
8594 % \begin{macrocode}
8595 \newcommand*{\mpnormalfootgroup}[1]{{
8596 \vskip\skip\@nameuse{mp#1footins}
8597 \ifl@dpairing\ifparledgroup%
8598 \leavevmode\marks\parledgroup@{begin}%
8599 \marks\parledgroup@series{#1}%
8600 \marks\parledgroup@type{Xfootnote}%
8601 \fi\fi\normalcolor%
8602 \ifparledgroup%
8603 \ifl@dpairing%
8604 \else%
8605 \setXnoteswidthliketwocolumns@{#1}%
8606 \setXnotespositionliketwocolumns@{#1}%
8607 \print@Xfootnoterule{#1}%%
8608 \fi%
8609 \else%
8610 \setXnoteswidthliketwocolumns@{#1}%
8611 \setXnotespositionliketwocolumns@{#1}%
8612 \print@Xfootnoterule{#1}%%
8613 \fi%
8614 \setlength{\parindent}{0pt}
8615 {\csuse{Xnotefontsize@#1}\csuse{txtbeforeXnotes@#1}}
8616 \unvbox\csname mp#1footins\endcsname}}
8617
8618 % \end{macrocode}
8619 % \end{macro}
8620 %
8621 % \subsection{Standard footnote definitions}
8622 %
8623 % \begin{macro}{\footnormal}
8624 % We can now define all the parameters for the six series of
8625 % footnotes; initially they use the `normal' footnote formatting,
8626 % which is set up by calling \cs{footnormal}.
8627 % You can switch to another type of formatting by using
8628 % \cs{footparagraph}, \cs{foottwocol}, or \cs{footthreecol}.
8629 %
8630 % Switching to a variation of `normal'
8631 % formatting requires changing the
8632 % quantities defined in \cs{footnormal}. The best way to
8633 % proceed would be to make a copy of this macro, with a different
8634 % name, make your desired changes in that copy, and then invoke it,
8635 % giving it the letter of the footnote series you wish to control.
8636 %
8637 % (We have not defined baseline skip values like
8638 % \cs{abaselineskip}, since this is one of the quantities set in
8639 % \cs{notefontsetup}.)
8640 %
8641 % What we want to do here is to say something like the following
8642 % for each footnote series. (This is an example, not part of the
8643 % actual \Eledmac{} code.)
8644 % \begin{verbatim}
8645 % \skip\Afootins=12pt plus5pt minus5pt
8646 % \count\Afootins=1000
8647 % \dimen\Afootins=0.8\vsize
8648 % \let\vAfootnote=\normalvfootnote \let\Afootfmt=\normalfootfmt
8649 % \let\Afootstart=\normalfootstart \let\Afootgroup=\normalfootgroup
8650 % \let\Afootnoterule=\normalfootnoterule
8651 % \end{verbatim}
8652 % Instead of repeating ourselves, we define a \cs{footnormal}
8653 % macro that makes all these assignments for us, for any given
8654 % series letter. This also makes it easy to change from any
8655 % different system of formatting back to the \verb"normal" setting.
8656 %
8657 % \begin{macro}{\ledfootinsdim}
8658 % Have a constant value for the \verb?\dimen\footins?
8659 % \changes{v1.1.0}{2012/09/25}{Deprecated \cs{ledfootinsdim}}
8660 % \begin{macrocode}
8661 \newcommand*{\ledfootinsdim}{0.8\vsize} % kept for backward compatibility, should'nt be used anymore.
8662 % \end{macrocode}
8663 % \end{macro}
8664
8665 %
8666 % \begin{macro}{\preXnotes@}
8667 % \begin{macro}{\preXnotes}
8668 % \changes{v1.1.0}{2012/09/25}{New skip \cs{preXnotes@}}
8669 % \changes{v1.2.0}{2012/10/08}{Debug in familiar footnotes (but introduced by v1.1).}
8670 % If user redefines \cs{preXnotes@}, via \cs{preXnotes} to a value greater than 0~pt,
8671 % this skip will be added before first series notes
8672 % instead of the notes skip.
8673 % \begin{macrocode}
8674 \newtoggle{preXnotes@}
8675 \toggletrue{preXnotes@}
8676 \newcommand{\preXnotes@}{0pt}
8677 \newcommand*{\preXnotes}[1]{\renewcommand{\preXnotes@}{#1}}
8678 % \end{macrocode}
8679 % \end{macro}
8680 % \end{macro}
8681 % The same, but for familiar footnotes.
8682 % \begin{macro}{\preXnotes}
8683 % \begin{macro}{\preXnotes@}
8684 % \begin{macrocode}
8685 \newtoggle{prenotesX@}
8686 \toggletrue{prenotesX@}
8687 \newcommand{\prenotesX@}{0pt}
8688 \newcommand*{\prenotesX}[1]{\renewcommand{\prenotesX@}{#1}}
8689 % \end{macrocode}
8690 % \end{macro}
8691 % \end{macro}
8692 % Now we set up the \cs{footnormal} macro itself. It takes
8693 % one argument: the footnote series letter.
8694 % \begin{macrocode}
8695 \newcommand*{\footnormal}[1]{%
8696 \csgdef{series@display#1}{normal}
8697 \expandafter\let\csname #1footstart\endcsname=\normalfootstart
8698 \expandafter\let\csname v#1footnote\endcsname=\normalvfootnote
8699 \expandafter\let\csname #1footfmt\endcsname=\normalfootfmt
8700 \expandafter\let\csname #1footgroup\endcsname=\normalfootgroup
8701 \expandafter\let\csname #1footnoterule\endcsname=%
8702 \normalfootnoterule
8703 \count\csname #1footins\endcsname=1000
8704 \csxdef{default@#1footins}{1000}%Use this to confine the notes to one side only
8705 \dimen\csname #1footins\endcsname=\csuse{maxhXnotes@#1}
8706 \skip\csname #1footins\endcsname=\csuse{beforeXnotes@#1}%
8707 \advance\skip\csname #1footins\endcsname by\csuse{afterXrule@#1}%
8708 % \end{macrocode}
8709 % Now do the setup for minipage footnotes. We use as much as possible of the
8710 % normal setup as we can (so the notes will have a similar layout).
8711 % \changes{v0.4.0}{2004/02/29}{Added minpage footnote setup to \cs{footnormal}}
8712 % \begin{macrocode}
8713 \ifnoledgroup@\else%
8714 \expandafter\let\csname mpv#1footnote\endcsname=\mpnormalvfootnote
8715 \expandafter\let\csname mp#1footgroup\endcsname=\mpnormalfootgroup
8716 \count\csname mp#1footins\endcsname=1000
8717 \dimen\csname mp#1footins\endcsname=\csuse{maxhXnotes@#1}
8718 \skip\csname mp#1footins\endcsname=\csuse{beforeXnotes@#1}%
8719 \advance\skip\csname mp#1footins\endcsname by\csuse{afterXrule@#1}%
8720 \fi
8721 }
8722
8723 % \end{macrocode}
8724 % \end{macro}
8725 % Some of these values deserve comment: the \cs{dimen}
8726 % setting allows 80\% of the page to be occupied by notes; the
8727 % \cs{skip} setting is deliberately flexible, since pages with
8728 % lots of notes attached to many of the lines can be a bit hard
8729 % for \TeX\ to make.
8730 %
8731 %
8732 %
8733 % \subsection{Paragraphed footnotes}
8734 %
8735 % The paragraphed-footnote option
8736 % reformats all the footnotes of one series for a page into
8737 % a single paragraph; this is especially appropriate when the notes are
8738 % numerous and brief. The code is based
8739 % on \thetexbook, pp.\,398--400, with
8740 % alterations for our environment. This algorithm uses a considerable
8741 % amount of save-stack space: a \TeX\ of ordinary size may not be able
8742 % to handle more than about $100$ notes of this kind on a page.
8743 %
8744 % \begin{macro}{\footparagraph}
8745 % The \cs{footparagraph} macro
8746 % sets up everything for one series of the footnotes so that
8747 % they'll be paragraphed; it takes the series letter as argument.
8748 % We include the setting of \verb"\count\footins" to $1000$ for the
8749 % footnote series just in case you are switching to paragraphed
8750 % footnotes after having columnar ones, since they change this
8751 % value (see below).
8752 %
8753 % It is important to call \cs{footparagraph} only after
8754 % \cs{hsize} has been set for the pages that use
8755 % this series of notes; otherwise \TeX\ will try to put too
8756 % many or too few of these notes on each page. If you need to
8757 % change the \cs{hsize} within the document, call
8758 % \cs{footparagraph} again afterwards to take account of the new
8759 % value. The argument of \cs{footparagraph} is the letter
8760 % (\texttt{A}--\texttt{E}) denoting the series of notes to be paragraphed.
8761 % \begin{macrocode}
8762 \newcommand*{\footparagraph}[1]{%
8763 \csgdef{series@display#1}{paragraph}
8764 \expandafter\newcount\csname prevpage#1@num\endcsname
8765 \expandafter\let\csname #1footstart\endcsname=\parafootstart
8766 \expandafter\let\csname v#1footnote\endcsname=\para@vfootnote
8767 \expandafter\let\csname #1footfmt\endcsname=\parafootfmt
8768 \expandafter\let\csname #1footgroup\endcsname=\para@footgroup
8769 \count\csname #1footins\endcsname=1000
8770 \csxdef{default@#1footins}{1000}%Use this to confine the notes to one side only
8771 \dimen\csname #1footins\endcsname=\csuse{maxhXnotes@#1}
8772 \skip\csname #1footins\endcsname=\csuse{beforeXnotes@#1}%
8773 \advance\skip\csname #1footins\endcsname by\csuse{afterXrule@#1}%
8774 \para@footsetup{#1}
8775 % \end{macrocode}
8776 % And the extra setup for minipages.
8777 % \begin{macrocode}
8778 \ifnoledgroup@\else
8779 \expandafter\let\csname mpv#1footnote\endcsname=\mppara@vfootnote
8780 \expandafter\let\csname mp#1footgroup\endcsname=\mppara@footgroup
8781 \count\csname mp#1footins\endcsname=1000
8782 \dimen\csname mp#1footins\endcsname=\csuse{maxhXnotes@#1}
8783 \skip\csname mp#1footins\endcsname=\csuse{beforeXnotes@#1}%
8784 \advance\skip\csname mp#1footins\endcsname by\csuse{afterXrule@#1}%
8785 \fi
8786 }
8787 % \end{macrocode}
8788 % \end{macro}
8789 % \begin{macro}{\footfudgefiddle}
8790 % For paragraphed footnotes \TeX{} has to estimate the amount of space
8791 % required. If it underestimates this then the notes may get too long and
8792 % run off the bottom of the text block. \cs{footfudgefiddle} can be increased
8793 % from its default 64 (say to 70) to increase the estimate.
8794 % \changes{v0.2.2}{2003/11/04}{Added \cs{footfudgefiddle}}
8795 % \begin{macrocode}
8796 \providecommand{\footfudgefiddle}{64}
8797 % \end{macrocode}
8798 % \end{macro}
8799 % \begin{macro}{\para@footsetup}
8800 % \cs{footparagraph} calls the
8801 % \cs{para@footsetup} macro to calculate a special
8802 % fudge factor, which is the ratio of the \cs{baselineskip}
8803 % to the \cs{hsize}. We assume that the proper value of
8804 % \cs{baselineskip} for the footnotes (normally 9\,pt) has been set
8805 % already, in \cs{notefontsetup}. The argument of the macro is
8806 % again the note series letter.
8807 %
8808 % Peter Wilson thinks that \cs{columnwidth} should be used here for \LaTeX\, not \cs{hsize}.
8809 % I've also included \cs{footfudgefiddle}.
8810 % \changes{v0.2.2}{2003/11/04}{Added \cs{footfudgefiddle} to \cs{para@footsetup}}
8811 % \begin{macrocode}
8812 \newcommand*{\para@footsetup}[1]{{\csuse{Xnotefontsize@#1}
8813 \setXnoteswidthliketwocolumns@{#1}%
8814 \dimen0=\baselineskip
8815 \multiply\dimen0 by 1024
8816 \divide \dimen0 by \columnwidth \multiply\dimen0 by \footfudgefiddle\relax
8817 \csxdef{#1footfudgefactor}{%
8818 \expandafter\strip@pt\dimen0 }}}
8819
8820 % \end{macrocode}
8821 % \end{macro}
8822 %
8823 % \edmac{} defines \cs{en@number} which does the same as the \LaTeX\ kernel
8824 % \cs{strip@pt}, namely strip the characters \verb"pt" from a dimen value.
8825 % Eledmac use \cs{strip@pt}.
8826 %
8827 % \begin{macro}{\parafootstart}
8828 % \cs{parafootstart} is the same as \cs{normalfootstart}, but we give it
8829 % again to ensure that \cs{rightskip} and \cs{leftskip} are
8830 % zeroed (this needs to be done before \cs{para@footgroup} in the
8831 % output routine). You might have decided to change this for other
8832 % kinds of note, but here it should stay as it is. The size of
8833 % paragraphed notes is calculated using a fudge factor which in
8834 % turn is based on \cs{hsize}. So the paragraph of notes needs to be
8835 % that wide.
8836 %
8837 % The argument of the macro is again the note series letter.
8838 % \begin{macrocode}
8839 \newcommand*{\parafootstart}[1]{%
8840 \rightskip=0pt \leftskip=0pt \parindent=0pt
8841 \ifdimequal{0pt}{\preXnotes@}{}%
8842 {%
8843 \iftoggle{preXnotes@}{%
8844 \togglefalse{preXnotes@}%
8845 \skip\csname #1footins\endcsname=%
8846 \dimexpr\csuse{preXnotes@}+\csuse{afterXrule@#1}\relax%
8847 }%
8848 {}%
8849 }%
8850 \vskip\skip\csname #1footins\endcsname%
8851 \setXnoteswidthliketwocolumns@{#1}%
8852 \setXnotespositionliketwocolumns@{#1}%
8853 \print@Xfootnoterule{#1}%
8854 \let\bidi@RTL@everypar\@empty%
8855 \noindent\leavevmode}
8856 % \end{macrocode}
8857 % \end{macro}
8858 %
8859 % \begin{macro}{\para@vfootnote}
8860 % \cs{para@vfootnote}
8861 % is a version of the \cs{vfootnote} command that's used for
8862 % paragraphed notes. It gets appended to the \cs{inserts@list} list
8863 % by an outer-level footnote command like \cs{Afootnote}. The first
8864 % argument is the note series letter; the second is the full text
8865 % of the printed note itself, including line numbers, lemmata, and
8866 % footnote text.
8867 %
8868 % The initial model for this insertion is, of course, the
8869 % \verb"\insert\footins" definition in \thetexbook, p.\,398.
8870 % There, the footnotes are first collected up in hboxes, and these
8871 % hboxes are later unpacked and stuck together into a paragraph.
8872 %
8873 % However, Michael Downes\index{Downes, Michael} has pointed out
8874 % that because text in hboxes gets typeset in restricted horizontal
8875 % mode, there are some undesirable side-effects if you later want
8876 % to break such text across lines. In restricted horizontal mode,
8877 % where \TeX\ does not expect to have to break lines, it does not
8878 % insert certain items like \cs{discretionary}s. If you later unbox
8879 % these hboxes and stick them together, as the \texbook{}
8880 % macros do to make these footnotes, you lose the ability to
8881 % hyphenate after an explicit hyphen. This can lead to overfull
8882 % \cs{hbox}es when you would not expect to find them, and to the
8883 % uninitiated it might be very hard to see why the problem had
8884 % arisen.\footnote{Michael Downes, `Line Breaking in \cs{unhbox}ed
8885 % Text', \textit{TUGboat} \textbf{11} (1990), pp.\,605--612.}
8886 %
8887 % Wayne Sullivan\index{Sullivan, Wayne} pointed out to us another
8888 % subtle problem that arises from the same cause: \TeX\ also leaves
8889 % the \cs{language} whatsit nodes out of the horizontal
8890 % list.\footnote{See \thetexbook, p.\,455 (editions after
8891 % January 1990).} So changes from one language to another will not
8892 % invoke the proper hyphenation rules in such footnotes. Since
8893 % critical editions often do deal with several languages,
8894 % especially in a footnotes, we really ought to get this bit of code
8895 % right.
8896 %
8897 % To get around these problems, Wayne suggested emendations to the
8898 % \texbook{} versions of these macros which are broadly the
8899 % same as those described by Michael: the central idea (also
8900 % suggested by Donald Knuth in a letter to Michael) is to avoid collecting
8901 % the text in an \cs{hbox} in the first place, but instead to collect
8902 % it in a \cs{vbox} whose width is (virtually)
8903 % infinite.\phantomsection\label{hboxproblem} The text is therefore typeset in
8904 % unrestricted horizontal mode, as a paragraph consisting of a
8905 % single long line. Later, there is an extra level of unboxing to
8906 % be done: we have to unpack the \cs{vbox}, as well as the hboxes
8907 % inside it, but that's not too hard. For details, we refer you to
8908 % Michael's article, where the issues are clearly
8909 % explained.\footnote{Wayne supplied his own macros to do this, but
8910 % since they were almost identical to Michael's, we have used the
8911 % latter's \cs{unvxh} macro since it is publicly
8912 % documented.} Michael's unboxing macro is called \cs{unvxh}: unvbox,
8913 % extract the last line, and unhbox it.
8914 %
8915 % Doing things this way has an important
8916 % consequence:\phantomsection\label{nobreaks-detail} as Michael
8917 % pointed out, you really can't put an explicit line-break into a
8918 % note built in a \cs{vbox} the way we are doing.\footnote{`Line
8919 % Breaking', p.\,610.} In other words, be very careful not to say
8920 % \cs{break}, or \verb"\penalty-10000", or any equivalent inside your
8921 % para-footnote.\phantomsection\label{nobreak} If you do, most of the note will
8922 % probably disappear. You \emph{are} allowed to make strong
8923 % suggestions; in fact \verb"\penalty-9999" will be quite okay. Just
8924 % don't make the break mandatory. We haven't applied any of
8925 % Michael's solutions here, since we feel that the problem is
8926 % exiguous, and \Eledmac{} is quite baroque enough already. If
8927 % you think you are having this problem, look up Michael's
8928 % solutions.
8929 %
8930 % One more thing; we set \cs{leftskip} and \cs{rightskip} to zero.
8931 % This has the effect of neutralizing any such skips which may
8932 % apply to the main text (cf.~\reff{footskips} above).
8933 % We need to do this, since \verb"footfudgefactor" is calculated on
8934 % the assumption that the notes are \cs{hsize} wide.
8935 %
8936 % So, finally, here is the modified foot-paragraph code, which
8937 % sets the footnote in vertical mode so that language and
8938 % discretionary nodes are included.
8939 %
8940 % \begin{macrocode}
8941 \newcommand*{\para@vfootnote}[2]{%
8942 \insert\csname #1footins\endcsname
8943 \bgroup
8944 \csuse{bhookXnote@#1}
8945 \csuse{Xnotefontsize@#1}
8946 \footsplitskips
8947 \setbox0=\vbox{\hsize=\maxdimen%
8948 \let\bidi@RTL@everypar\@empty%
8949 \noindent\csname #1footfmt\endcsname#2[#1]}%
8950 \setbox0=\hbox{\unvxh0[#1]}%
8951 \dp0=0pt
8952 \ht0=\csname #1footfudgefactor\endcsname\wd0
8953 % \end{macrocode}
8954 % Here we produce the contents of the footnote from box $0$, and
8955 % add a penalty of $0$ between boxes in this insert.
8956 % \begin{macrocode}
8957 \if@RTL\noindent \leavevmode\fi\box0%
8958 \penalty0
8959 \egroup}
8960
8961 % \end{macrocode}
8962 % The final penalty of $0$
8963 % was added here at Wayne's\index{Sullivan, Wayne}
8964 % suggestion to avoid a weird page-breaking problem, which occurs on
8965 % those occasions when \TeX\ attempts to split foot paragraphs.
8966 % After trying out such a split (see \thetexbook, p.\,124),
8967 % \TeX\ inserts a penalty of $-10000$ here, which
8968 % nearly always forces the break at the end of the whole footnote
8969 % paragraph (since individual notes can't be split) even when this
8970 % leads to an overfull vbox. The change above results in a penalty
8971 % of $0$ instead which allows, but doesn't force, such breaks. This
8972 % penalty of $0$ is later removed, after page breaks have been
8973 % decided, by the \cs{unpenalty} macro in \cs{makehboxofhboxes}. So it
8974 % does not affect how the footnote paragraphs are typeset (the
8975 % notes still have a penalty of $-10$ between them, which is added
8976 % by \cs{parafootfmt}).
8977 % \end{macro}
8978 %
8979 % \begin{macro}{\mppara@vfootnote}
8980 % This version is for minipages.
8981 % \begin{macrocode}
8982 \newcommand*{\mppara@vfootnote}[2]{%
8983 \global\setbox\@nameuse{mp#1footins}\vbox{%
8984 \unvbox\@nameuse{mp#1footins}%
8985 \csuse{bhookXnote@#1}
8986 \csuse{Xnotefontsize@#1}
8987 \footsplitskips
8988 \setbox0=\vbox{\hsize=\maxdimen%
8989 \let\bidi@RTL@everypar\@empty%
8990 \noindent\color@begingroup\csname #1footfmt\endcsname #2[#1]\color@endgroup}%
8991 \setbox0=\hbox{\unvxh0[#1]}%
8992 \dp0=\z@
8993 \ht0=\csname #1footfudgefactor\endcsname\wd0
8994 \box0
8995 \penalty0
8996 }}
8997
8998 % \end{macrocode}
8999 % \end{macro}
9000 %
9001 % \begin{macro}{\unvxh}
9002 % Here is (modified) Michael's\index{Downes, Michael} definition of \cs{unvxh},
9003 % used above. Michael's macro also takes care to remove some
9004 % unwanted penalties and glue that \TeX\ automatically attaches to
9005 % the end of paragraphs. When \TeX\ finishes a paragraph, it
9006 % throws away any remaining glue, and then tacks on the following
9007 % items: a \cs{penalty} of $10000$, a \cs{parfillskip} and a
9008 % \cs{rightskip} (\thetexbook, pp.\,99--100). \cs{unvxh}
9009 % cancels these unwanted paragraph-final items using \cs{unskip} and
9010 % \cs{unpenalty}.
9011 % \begin{macrocode}
9012 \newcommandx*{\unvxh}[2][2=Z]{% 2th is optional for retro-compatibility
9013 \setbox0=\vbox{\unvbox#1%
9014 \global\setbox1=\lastbox}%
9015 \unhbox1
9016 \unskip % remove \rightskip,
9017 \unskip % remove \parfillskip,
9018 \unpenalty % remove \penalty of 10000,
9019 \hskip\csuse{afternote@#2}} % but add the glue to go between the notes
9020
9021 % \end{macrocode}
9022 % \end{macro}
9023 %
9024 %
9025 %
9026 % \begin{macro}{\parafootfmt}
9027 % \cs{parafootfmt} is
9028 % \cs{normalfootfmt} adapted to do the special stuff
9029 % needed for paragraphed notes---leaving out the \verb"\endgraf" at the
9030 % end, sticking in special penalties and kern, and leaving out the
9031 % \cs{footstrut}. The first argument is the line and page
9032 % number information, the second is the lemma, the third is the
9033 % text of the footnote, and the fourth is the series (optional, for backward compatibility).
9034 % \begin{macrocode}
9035 \newcommandx*{\parafootfmt}[4][4=Z]{%
9036 \insertparafootsep{#4}%
9037 \Xledsetnormalparstuff{#4}%
9038 \printlinefootnote{#1}{#4}%
9039 {\nottoggle{Xlemmadisablefontselection@#4}{\select@lemmafont#1|#2}{#2}}%
9040 \iftoggle{nosep@}{\hskip\csuse{inplaceoflemmaseparator@#4}}{\ifcsempty{lemmaseparator@#4}%
9041 {\hskip\csuse{inplaceoflemmaseparator@#4}}%
9042 {\nobreak\hskip\csuse{beforelemmaseparator@#4}\csuse{lemmaseparator@#4}\hskip\csuse{afterlemmaseparator@#4}%
9043 }}%
9044 #3\penalty-10 }
9045 % \end{macrocode}
9046 % Note that in the above definition, the penalty of $-10$
9047 % encourages a line break between notes, so that notes have a
9048 % slight tendency to begin on new lines.
9049 % The \cs{insertparafootsep} command is used to insert the \cs{parafootsep@series} between each note in the \emph{same} page.
9050 % \end{macro}
9051 %
9052 % \begin{macro}{\para@footgroup}
9053 % This \verb"footgroup" code is modelled on the macros in
9054 % \thetexbook, p.\,399. The only difference is the \cs{unpenalty}
9055 % in \cs{makehboxofhboxes}, which is there to remove the penalty of
9056 % $0$ which was added to the end of each footnote by
9057 % \cs{para@vfootnote}.
9058 %
9059 % The call to \cs{notefontsetup} is to ensure that the correct
9060 % \cs{baselineskip} for the footnotes is used. The argument is the
9061 % note series letter.
9062 % \begin{macrocode}
9063 \newcommand*{\para@footgroup}[1]{%
9064 \unvbox\csname #1footins\endcsname
9065 \ifcsstring{Xragged@#1}{L}{\RaggedLeft}{}%
9066 \ifcsstring{Xragged@#1}{R}{\RaggedRight}{}%
9067 \makehboxofhboxes
9068 \setbox0=\hbox{{\csuse{Xnotefontsize@#1}\csuse{txtbeforeXnotes@#1}}\unhbox0 \removehboxes}%
9069 \csuse{Xnotefontsize@#1}
9070 \noindent\unhbox0\par%
9071 \global\hsize=\old@hsize%
9072 }%
9073
9074 % \end{macrocode}
9075 % \end{macro}
9076 %
9077 % \begin{macro}{\mppara@footgroup}
9078 % The minipage version.
9079 % \begin{macrocode}
9080 \newcommand*{\mppara@footgroup}[1]{{%
9081 \setXnoteswidthliketwocolumns@{#1}%
9082 \vskip\skip\@nameuse{mp#1footins}
9083 \ifl@dpairing\ifparledgroup%
9084 \leavevmode\marks\parledgroup@{begin}%
9085 \marks\parledgroup@series{#1}%
9086 \marks\parledgroup@type{Xfootnote}%
9087 \fi\fi\normalcolor
9088 \ifparledgroup%
9089 \ifl@dpairing%
9090 \else%
9091 \setXnoteswidthliketwocolumns@{#1}%
9092 \setXnotespositionliketwocolumns@{#1}%
9093 \print@Xfootnoterule{#1}%%
9094 \fi%
9095 \else%
9096 \setXnoteswidthliketwocolumns@{#1}%
9097 \setXnotespositionliketwocolumns@{#1}%
9098 \print@Xfootnoterule{#1}%
9099 \fi%
9100 \unvbox\csname mp#1footins\endcsname
9101 \ifcsstring{Xragged@#1}{L}{\RaggedLeft}{}%
9102 \ifcsstring{Xragged@#1}{R}{\RaggedRight}{}%
9103 \makehboxofhboxes
9104 \setbox0=\hbox{{\csuse{Xnotefontsize@#1}\csuse{txtbeforeXnotes@#1}}\unhbox0 \removehboxes}%
9105 \csuse{Xnotefontsize@#1}
9106 \noindent\unhbox0\par}}
9107
9108 % \end{macrocode}
9109 % \end{macro}
9110 %
9111 % \begin{macro}{\makehboxofhboxes}
9112 % \begin{macro}{\removehboxes}
9113 % \begin{macrocode}
9114 \newcommand*{\makehboxofhboxes}{\setbox0=\hbox{}%
9115 \loop
9116 \unpenalty
9117 \setbox2=\lastbox
9118 \ifhbox2
9119 \setbox0=\hbox{\box2\unhbox0}%
9120 \repeat}
9121
9122 \newcommand*{\removehboxes}{\setbox0=\lastbox
9123 \ifhbox0{\removehboxes}\unhbox0 \fi}
9124
9125 % \end{macrocode}
9126 % \end{macro}
9127 % \end{macro}
9128 %
9129 % \subsubsection{Insertion of the footnotes separator}
9130 %The command \cs{insertparafootsep}\marg{series} must be called at the beginning of \cs{parafootftm} (and like commands).
9131 % \begin{macro}{\prevpage@num}
9132 % \changes{v1.8.0}{2013/12/13}{Correct \cs{parafootsep} when using with ledgroup.}
9133 % \changes{v1.22.1}{2015/04/29}{Correct double symbol when using both \cs{parafootsep} and \cs{symlinenum}.}
9134 % \begin{macro}{\insertparafootsep}
9135 % \begin{macrocode}
9136 \newcommand{\insertparafootsep}[1]{%
9137 \ifnumequal{\csuse{prevpage#1@num}}{\page@num}%
9138 {\ifcsdef{prevline#1}% Be sur \prevline#1 exists.
9139 {\ifnumequal{\csuse{prevline#1}}{\line@num}%
9140 {\IfStrEq{\csuse{symlinenum@#1}}{\csuse{parafootsep@#1}}{}}%
9141 {\csuse{parafootsep@#1}}%
9142 }%
9143 {\csuse{parafootsep@#1}}%
9144 }%
9145 {}%
9146 \global\csname prevpage#1@num\endcsname=\page@num%
9147 }
9148 % \end{macrocode}
9149 % \end{macro}
9150 % \end{macro}
9151 % \subsection{Columnar footnotes}
9152 %
9153 % \begin{macro}{\rigidbalance}
9154 % \begin{macro}{\dosplits}
9155 % \begin{macro}{\splitoff}
9156 % \begin{macro}{\@h}
9157 % \begin{macro}{\@k}
9158 % We will now define macros for three-column notes and two-column
9159 % notes. Both sets of macros will use \cs{rigidbalance}, which splits a
9160 % box (\verb"#1") into into a number (\verb"#2") of columns, each
9161 % with a space (\verb"#3") between the top baseline and the top of
9162 % the \cs{vbox}. The \cs{rigidbalance} macro is taken from
9163 % \thetexbook, p.\,397, with a slight change to the syntax of
9164 % the arguments so that they don't depend on white space. Note also
9165 % the extra unboxing in \cs{splitoff}, which allows the new \cs{vbox} to
9166 % have its natural height as it goes into the alignment.
9167 %
9168 % The \LaTeX\ \cs{line} macro has no relationship to the
9169 % TeX \cs{line}. The \LaTeX\ equivalent is \cs{@@line}.
9170 % \begin{macrocode}
9171 \newcount\@k \newdimen\@h
9172 \newcommand*{\rigidbalance}[3]{\setbox0=\box#1 \@k=#2 \@h=#3
9173 \@@line{\splittopskip=\@h \vbadness=\@M \hfilneg
9174 \valign{##\vfil\cr\dosplits}}}
9175
9176 \newcommand*{\dosplits}{\ifnum\@k>0 \noalign{\hfil}\splitoff
9177 \global\advance\@k-1\cr\dosplits\fi}
9178
9179 \newcommand*{\splitoff}{\dimen0=\ht0
9180 \divide\dimen0 by\@k \advance\dimen0 by\@h
9181 \setbox2 \vsplit0 to \dimen0
9182 \unvbox2 }
9183
9184 % \end{macrocode}
9185 % \end{macro}
9186 % \end{macro}
9187 % \end{macro}
9188 % \end{macro}
9189 % \end{macro}
9190 %
9191 % \subsubsection{Three columns}
9192 %
9193 % \begin{macro}{\footthreecol}
9194 % You say \verb"\footthreecol{A}" to have the \texttt{A} series of the footnotes
9195 % typeset in three columns. It is important to call this only after
9196 % \cs{hsize} has been set for the document.
9197 % \begin{macrocode}
9198 \newcommand*{\footthreecol}[1]{%
9199 \csgdef{series@display#1}{threecol}
9200 \expandafter\let\csname v#1footnote\endcsname=\threecolvfootnote
9201 \expandafter\let\csname #1footfmt\endcsname=\threecolfootfmt
9202 \expandafter\let\csname #1footgroup\endcsname=\threecolfootgroup
9203 \dimen\csname #1footins\endcsname=\csuse{maxhXnotes@#1}%
9204 \skip\csname #1footins\endcsname=\csuse{beforeXnotes@#1}%
9205 \advance\skip\csname #1footins\endcsname by\csuse{afterXrule@#1}%
9206 \threecolfootsetup{#1}
9207 % \end{macrocode}
9208 % The additional setup for minipages.
9209 % \begin{macrocode}
9210 \ifnoledgroup@\else
9211 \expandafter\let\csname mpv#1footnote\endcsname=\mpnormalvfootnote
9212 \expandafter\let\csname mp#1footgroup\endcsname=\mpthreecolfootgroup
9213 \skip\csname mp#1footins\endcsname=\csuse{beforeXnotes@#1}%
9214 \advance\skip\csname mp#1footins\endcsname by\csuse{afterXrule@#1}%
9215 \mpthreecolfootsetup{#1}
9216 \fi
9217 }
9218
9219 % \end{macrocode}
9220 % The \cs{footstart} and \cs{footnoterule} macros for these notes assume
9221 % the normal values (\reff{normalvalues} above).
9222 % \end{macro}
9223 %
9224 % \begin{macro}{\threecolfootsetup}
9225 % The \cs{threecolfootsetup} macro calculates and sets some numbers
9226 % for three-column footnotes.
9227 %
9228 % We set the \cs{count} of the foot insert to $333$.
9229 % Each footnote can be thought of as contributing only one third of
9230 % its height to the page, since the footnote insertion has been
9231 % made as a long narrow column, which then gets trisected by the
9232 % \cs{rigidbalance} routine (inside \cs{threecolfootgroup}).
9233 % These new, shorter columns are saved in a box, and then that box
9234 % is \emph{put back} into the footnote insert, replacing the
9235 % original collection of the footnotes. This new box is, therefore,
9236 % only about a third of the height of the original one.
9237 %
9238 % The \cs{dimen} value for this note series has to change in the
9239 % inverse way: it needs to be three times
9240 % the actual limit on the amount of space these notes are allowed to
9241 % fill on the page, because when \TeX\ is
9242 % accumulating material for the page
9243 % and checking that limit, it doesn't apply the \cs{count} scaling.
9244 % \begin{macrocode}
9245 \newcommand*{\threecolfootsetup}[1]{%
9246 \count\csname #1footins\endcsname 333
9247 \csxdef{default@#1footins}{333}%Use this to confine the notes to one side only
9248 \multiply\dimen\csname #1footins\endcsname \thr@@}
9249 % \end{macrocode}
9250 % \end{macro}
9251 %
9252 % \begin{macro}{\mpthreecolfootsetup}
9253 % The setup for minipages.
9254 % \begin{macrocode}
9255 \newcommand*{\mpthreecolfootsetup}[1]{%
9256 \count\csname mp#1footins\endcsname 333
9257 \multiply\dimen\csname mp#1footins\endcsname \thr@@}
9258
9259 % \end{macrocode}
9260 % \end{macro}
9261 %
9262 % \begin{macro}{\threecolvfootnote}
9263 % \cs{threecolvfootnote}
9264 % is the \cs{vfootnote} command for three-column notes. The
9265 % call to \cs{notefontsetup} ensures that the
9266 % \cs{splittopskip} and \cs{splitmaxdepth} take their values
9267 % from the right \cs{strutbox}: the one used in a footnotes.
9268 % Note especially the importance of temporarily reducing the
9269 % \cs{hsize} to $0.3$ of its normal value. This determines the
9270 % widths of the individual columns. So if the normal \cs{hsize}
9271 % is, say, 10\,cm, then each column will be $0.3\times10=3$\,cm
9272 % wide, leaving a gap of 1\,cm spread equally between columns
9273 % (i.e., .5\,cm between each).
9274 %
9275 % The arguments are 1)~the note series letter and 2)~the full text
9276 % of the note (including numbers, lemma and text).
9277 % \begin{macrocode}
9278 \notbool{parapparatus@}{\newcommand*}{\newcommand}{\threecolvfootnote}[2]{%
9279 \insert\csname #1footins\endcsname\bgroup
9280 \csuse{Xnotefontsize@#1}
9281 \footsplitskips
9282 \csname #1footfmt\endcsname #2[#1]\egroup}
9283 % \end{macrocode}
9284 % \end{macro}
9285 %
9286 %
9287 % \begin{macro}{\threecolfootfmt}
9288 % \cs{threecolfootfmt}
9289 % is the command that formats one note.
9290 % It uses \cs{raggedright}, which will usually be
9291 % preferable with such short lines. Setting the \cs{parindent}
9292 % to zero means that, within each individual note, the lines begin
9293 % flush left.
9294 %
9295 % The arguments are 1)~the line numbers, 2)~the lemma and 3)~the
9296 % text of the \verb"-footnote" command 4) optional (for backward compatibility): the series.
9297 %
9298 % \begin{macrocode}
9299 \notbool{parapparatus@}{\newcommandx*}{\newcommandx}{\threecolfootfmt}[4][4=Z]{%
9300 \normal@pars
9301 \hsize \csuse{hsizethreecol@#4}
9302 \nottoggle{Xparindent@#4}{\parindent=\z@}{}
9303 \tolerance=5000
9304 \hangindent=\csuse{Xhangindent@#4}
9305 \leavevmode
9306 \csuse{Xcolalign@#4}%
9307 \strut{\printlinefootnote{#1}{#4}}%
9308 {\nottoggle{Xlemmadisablefontselection@#4}{\select@lemmafont#1|#2}{#2}}%
9309 \iftoggle{nosep@}{\hskip\csuse{inplaceoflemmaseparator@#4}}{\ifcsempty{lemmaseparator@#4}%
9310 {\hskip\csuse{inplaceoflemmaseparator@#4}}%
9311 {\nobreak\hskip\csuse{beforelemmaseparator@#4}\csuse{lemmaseparator@#4}\hskip\csuse{afterlemmaseparator@#4}%
9312 }}%
9313 #3\strut\par\allowbreak}
9314 % \end{macrocode}
9315 % \end{macro}
9316 %
9317 % \begin{macro}{\threecolfootgroup}
9318 % And here is the \verb"footgroup" macro that's called within the
9319 % output routine to regroup the notes into three columns. Once
9320 % again, the call to \cs{notefontsetup} is there to ensure that
9321 % it is the right \cs{splittopskip}---the one used in
9322 % footnotes---which is used to provide the third argument for
9323 % \cs{rigidbalance}. This third argument (\cs{@h}) is the
9324 % \verb"topskip" for the box containing the text of the
9325 % footnotes, and does the job of making sure the top lines of the
9326 % columns line up horizontally. In \thetexbook, p.\,398,
9327 % Donald Knuth suggests retrieving the ouput of \cs{rigidbalance},
9328 % putting it back into the insertion box, and then printing the
9329 % box. Here, we just print the \cs{line} which comes out of
9330 % \cs{rigidbalance} directly, without any re-boxing.
9331 % \begin{macrocode}
9332 \newcommand*{\threecolfootgroup}[1]{{\csuse{Xnotefontsize@#1}%
9333 \noindent\csuse{txtbeforeXnotes@#1}\par%
9334 \splittopskip=\ht\strutbox
9335 \expandafter
9336 \rigidbalance\csname #1footins\endcsname \thr@@ \splittopskip}}
9337 % \end{macrocode}
9338 % \end{macro}
9339 %
9340 % \begin{macro}{\mpthreecolfootgroup}
9341 % The setup for minipages.
9342 % \begin{macrocode}
9343 \newcommand*{\mpthreecolfootgroup}[1]{{%
9344 \vskip\skip\@nameuse{mp#1footins}
9345 \ifl@dpairing\ifparledgroup%
9346 \leavevmode\marks\parledgroup@{begin}%
9347 \marks\parledgroup@series{#1}%
9348 \marks\parledgroup@type{Xfootnote}%
9349 \fi\fi\normalcolor
9350 \ifparledgroup%
9351 \ifl@dpairing%
9352 \else%
9353 \setXnoteswidthliketwocolumns@{#1}%
9354 \setXnotespositionliketwocolumns@{#1}%
9355 \print@Xfootnoterule{#1}%
9356 \fi%
9357 \else%
9358 \setXnoteswidthliketwocolumns@{#1}%
9359 \setXnotespositionliketwocolumns@{#1}%
9360 \print@Xfootnoterule{#1}%
9361 \fi%
9362 {\csuse{Xnotefontsize@#1}\noindent\csuse{txtbeforeXnotes@#1}}\par
9363 \splittopskip=\ht\strutbox
9364 \expandafter
9365 \rigidbalance\csname mp#1footins\endcsname \thr@@ \splittopskip}}
9366
9367 % \end{macrocode}
9368 % \end{macro}
9369 %
9370 % \subsubsection{Two columns}
9371 %
9372 % \begin{macro}{\foottwocol}
9373 % You say \verb"\foottwocol{A}" to have the \texttt{A} series of the footnotes
9374 % typeset in two columns. It is important to call this only after
9375 % \cs{hsize} has been set for the document.
9376 % \begin{macrocode}
9377 \newcommand*{\foottwocol}[1]{%
9378 \csgdef{series@display#1}{twocol}
9379 \expandafter\let\csname v#1footnote\endcsname=\twocolvfootnote
9380 \expandafter\let\csname #1footfmt\endcsname=\twocolfootfmt
9381 \expandafter\let\csname #1footgroup\endcsname=\twocolfootgroup
9382 \dimen\csname #1footins\endcsname=\csuse{maxhXnotes@#1}%
9383 \skip\csname #1footins\endcsname=\csuse{beforeXnotes@#1}%
9384 \advance\skip\csname #1footins\endcsname by\csuse{afterXrule@#1}%
9385 \twocolfootsetup{#1}
9386 % \end{macrocode}
9387 % The additional setup for minipages.
9388 % \begin{macrocode}
9389 \ifnoledgroup@\else
9390 \expandafter\let\csname mpv#1footnote\endcsname=\mpnormalvfootnote
9391 \expandafter\let\csname mp#1footgroup\endcsname=\mptwocolfootgroup
9392 \skip\csname mp#1footins\endcsname=\csuse{beforeXnotes@#1}%
9393 \advance\skip\csname mp#1footins\endcsname by\csuse{afterXrule@#1}%
9394 \mptwocolfootsetup{#1}
9395 \fi
9396 }
9397
9398 % \end{macrocode}
9399 % \end{macro}
9400 %
9401 % \begin{macro}{\twocolfootsetup}
9402 % \begin{macro}{\twocolvfootnote}
9403 % \begin{macro}{\twocolfootfmt}
9404 % \begin{macro}{\twocolfootgroup}
9405 % Here is a series of macros which are very similar to their
9406 % three-column counterparts. In this case,
9407 % each note is assumed to contribute only a half a line of text.
9408 % And the notes are set in columns
9409 % giving a gap between them of one tenth
9410 % of the \cs{hsize}.
9411 % \begin{macrocode}
9412 \newcommand*{\twocolfootsetup}[1]{%
9413 \count\csname #1footins\endcsname 500
9414 \csxdef{default@#1footins}{500}%Use this to confine the notes to one side only
9415 \multiply\dimen\csname #1footins\endcsname \tw@}
9416 % \end{macrocode}
9417 % \begin{macrocode}
9418 \notbool{parapparatus@}{\newcommand*}{\newcommand}{\twocolvfootnote}[2]{\insert\csname #1footins\endcsname\bgroup
9419 \csuse{Xnotefontsize@#1}
9420 \footsplitskips
9421 \csname #1footfmt\endcsname #2[#1]\egroup}
9422 % \end{macrocode}
9423 % \begin{macrocode}
9424 \notbool{parapparatus@}{\newcommandx*}{\newcommandx}{\twocolfootfmt}[4][4=Z]{% 4th arg is optional, for backward compatibility
9425 \normal@pars
9426 \hsize \csuse{hsizetwocol@#4}
9427 \nottoggle{Xparindent@#4}{\parindent=\z@}{}
9428 \tolerance=5000
9429 \hangindent=\csuse{Xhangindent@#4}
9430 \leavevmode
9431 \csuse{Xcolalign@#4}%
9432 \strut{\printlinefootnote{#1}{#4}}%
9433 {\nottoggle{Xlemmadisablefontselection@#4}{\select@lemmafont#1|#2}{#2}}%
9434 \iftoggle{nosep@}{\hskip\csuse{inplaceoflemmaseparator@#4}}{\ifcsempty{lemmaseparator@#4}%
9435 {\hskip\csuse{inplaceoflemmaseparator@#4}}%
9436 {\nobreak\hskip\csuse{beforelemmaseparator@#4}\csuse{lemmaseparator@#4}\hskip\csuse{afterlemmaseparator@#4}%
9437 }}%
9438 #3\strut\par\allowbreak}
9439 % \end{macrocode}
9440 % \begin{macrocode}
9441 \newcommand*{\twocolfootgroup}[1]{{\csuse{Xnotefontsize@#1}
9442 \noindent\csuse{txtbeforeXnotes@#1}\par%
9443 \splittopskip=\ht\strutbox
9444 \expandafter
9445 \rigidbalance\csname #1footins\endcsname \tw@ \splittopskip}}
9446
9447 % \end{macrocode}
9448 % \end{macro}
9449 % \end{macro}
9450 % \end{macro}
9451 % \end{macro}
9452 %
9453 % \begin{macro}{\mptwocolfootsetup}
9454 % \begin{macro}{\mptwocolfootgroup}
9455 % The versions for minipages.
9456 % \begin{macrocode}
9457 \newcommand*{\mptwocolfootsetup}[1]{%
9458 \count\csname mp#1footins\endcsname 500
9459 \multiply\dimen\csname mp#1footins\endcsname \tw@}
9460 % \end{macrocode}
9461 % \begin{macrocode}
9462 \newcommand*{\mptwocolfootgroup}[1]{{%
9463 \vskip\skip\@nameuse{mp#1footins}
9464 \ifl@dpairing\ifparledgroup%
9465 \leavevmode\marks\parledgroup@{begin}%
9466 \marks\parledgroup@series{#1}%
9467 \marks\parledgroup@type{Xfootnote}%
9468 \fi\fi\normalcolor
9469 \ifparledgroup%
9470 \ifl@dpairing%
9471 \else%
9472 \setXnoteswidthliketwocolumns@{#1}%
9473 \setXnotespositionliketwocolumns@{#1}%
9474 \print@Xfootnoterule{#1}%
9475 \fi%
9476 \else%
9477 \setXnoteswidthliketwocolumns@{#1}%
9478 \setXnotespositionliketwocolumns@{#1}%
9479 \print@Xfootnoterule{#1}%
9480 \fi%
9481 {\csuse{Xnotefontsize@#1}\noindent\csuse{txtbeforeXnotes@#1}}\par
9482 \splittopskip=\ht\strutbox
9483 \expandafter
9484 \rigidbalance\csname mp#1footins\endcsname \tw@ \splittopskip}}
9485
9486 % \end{macrocode}
9487 % \end{macro}
9488 % \end{macro}
9489 %
9490 %
9491 % \section{Familiar footnotes}
9492 %
9493 % \subsection{Generality}
9494 % The original \edmac{} provided users with five series of critical footnotes (\cs{Afootnote} \cs{Bfootnote} \cs{Cfootnote} \cs{Dfootnote} \cs{Efootnote}),
9495 % and \LaTeX\ provides a single numbered footnote. The \Eledmac{} package
9496 % uses the \edmac{} mechanism to provide six series of numbered footnotes.
9497 %
9498 % First, though, the \Lpack{footmisc} package has an option whereby
9499 % two or more consecutive \cs{footnote}s have their marks separated
9500 % by commas. This seems such a useful ability that it is provided
9501 % automatically by \Eledmac.
9502 %
9503 % \begin{macro}{\multiplefootnotemarker}
9504 % \begin{macro}{\multfootsep}
9505 % These macros may have been defined by the \Lclass{memoir} class,
9506 % are provided by the \Lpack{footmisc} package and perhaps
9507 % by other footnote packages.
9508 % \begin{macrocode}
9509 \providecommand*{\multiplefootnotemarker}{3sp}
9510 \providecommand*{\multfootsep}{\textsuperscript{\normalfont,}}
9511
9512 % \end{macrocode}
9513 % \end{macro}
9514 % \end{macro}
9515 %
9516 % \begin{macro}{\m@mmf@prepare}
9517 % A pair of self-cancelling kerns. This may have been defined in the
9518 % \Lclass{memoir} class.
9519 % \begin{macrocode}
9520 \providecommand*{\m@mmf@prepare}{%
9521 \kern-\multiplefootnotemarker
9522 \kern\multiplefootnotemarker\relax}
9523 % \end{macrocode}
9524 % \end{macro}
9525 %
9526 % \begin{macro}{\m@mmf@check}
9527 % This may have been defined in the \Lclass{memoir} class. If it recognises
9528 % the last kern as \cs{multiplefootnotemarker} it typesets \cs{multfootsep}.
9529 % \begin{macrocode}
9530 \providecommand*{\m@mmf@check}{%
9531 \ifdim\lastkern=\multiplefootnotemarker\relax
9532 \edef\@x@sf{\the\spacefactor}%
9533 \unkern
9534 \multfootsep
9535 \spacefactor\@x@sf\relax
9536 \fi}
9537
9538 % \end{macrocode}
9539 % \end{macro}
9540 %
9541 % We have to modify \verb?\@footnotetext? and \verb?\@footnotemark?. However,
9542 % if \Lclass{memoir} is used the modifications have already been made.
9543 % \changes{v0.4.1}{2004/03/25}{Only change \cs{@footnotetext} and
9544 % \cs{@footnotemark} if memoir not used}
9545 % \begin{macrocode}
9546 \@ifclassloaded{memoir}{}{%
9547 % \end{macrocode}
9548 % \begin{macro}{\@footnotetext}
9549 % Add \cs{m@mmf@prepare} at the end of \cs{@footnotetext}.
9550 % \begin{macrocode}
9551 \apptocmd{\@footnotetext}{\m@mmf@prepare}{}{}
9552 % \end{macrocode}
9553 % \end{macro}
9554 %
9555 % \begin{macro}{\@footnotemark}
9556 % Modify \cs{@footnotemark} to cater for adjacent \cs{footnote}s.
9557 % \begin{macrocode}
9558 \renewcommand*{\@footnotemark}{%
9559 \leavevmode
9560 \ifhmode
9561 \edef\@x@sf{\the\spacefactor}%
9562 \m@mmf@check
9563 \nobreak
9564 \fi
9565 \@makefnmark
9566 \m@mmf@prepare
9567 \ifhmode\spacefactor\@x@sf\fi
9568 \relax}
9569 % \end{macrocode}
9570 % \end{macro}
9571 % Finished the modifications for the non-memoir case.
9572 % \begin{macrocode}
9573 }
9574
9575 % \end{macrocode}
9576 %
9577 % \begin{macro}{\l@doldold@footnotetext}
9578 % \begin{macro}{\@footnotetext}
9579 % In order to enable the regular \verb?\footnote?s in numbered text
9580 % we have to play around with its \verb?\@footnotetext?, using
9581 % different forms for when in numbered or regular text.
9582 % \changes{v0.5.0}{2004/04/03}{Enabled regular \cs{footnote} in numbered text}
9583 % \begin{macrocode}
9584 \pretocmd{\@footnotetext}{%
9585 \ifnumberedpar@
9586 \edtext{}{\l@dbfnote{#1}}%
9587 \else
9588 }{}{}
9589 \apptocmd{\@footnotetext}{\fi}{}{}%
9590 % \end{macrocode}
9591 % \end{macro}
9592 % \end{macro}
9593 %
9594 % \begin{macro}{\l@dbfnote}
9595 % \begin{macro}{\vl@dbfnote}
9596 % \verb?\l@dbfnote? adds the footnote to the insert list, and
9597 % \verb?\vl@dbfnote? calls the original \verb?\@footnotetext?.
9598 % \changes{v0.6.0}{2004/11/23}{Changed \cs{l@dbfnote} and \cs{vl@dbfnote} as
9599 % originals could give incorrect markers in the footnotes}
9600 % \changes{v1.4.1}{2012/11/16}{Compatibility of standard footnotes with eledmac when these footnotes contain any commands.}
9601 % \begin{macrocode}
9602 \newcommand{\l@dbfnote}[1]{%
9603 \ifnumberedpar@
9604 \gdef\@tag{#1\relax}%
9605 \xright@appenditem{\noexpand\vl@dbfnote{{\expandonce\@tag}}{\@thefnmark}}%
9606 \to\inserts@list
9607 \global\advance\insert@count \@ne
9608 \fi\ignorespaces}
9609 \newcommand{\vl@dbfnote}[2]{%
9610 \def\@thefnmark{#2}%
9611 \@footnotetext{#1}%
9612 }%
9613 % \end{macrocode}
9614 % \end{macro}
9615 % \end{macro}
9616 %
9617 %
9618 %
9619 %
9620 %
9621 %
9622 % \subsection{Footnote formats}
9623 %
9624 % Some of the code for the various formats is remarkably similar to that
9625 % in section~\ref{sec:nfootformat}.
9626 %
9627 % The following macros generally set things up for the `standard' footnote
9628 % format.
9629 %
9630 % \begin{macro}{\prebodyfootmark}
9631 % \begin{macro}{\postbodyfootmark}
9632 % Two convenience macros for use by \cs{...@footnotemark...} macros.
9633 % \begin{macrocode}
9634 \newcommand*{\prebodyfootmark}{%
9635 \leavevmode
9636 \ifhmode
9637 \edef\@x@sf{\the\spacefactor}%
9638 \m@mmf@check
9639 \nobreak
9640 \fi}
9641 \newcommand{\postbodyfootmark}{%
9642 \m@mmf@prepare
9643 \ifhmode\spacefactor\@x@sf\fi\relax}
9644
9645 % \end{macrocode}
9646 % \end{macro}
9647 % \end{macro}
9648 %
9649 %
9650 % \begin{macro}{\normal@footnotemarkX}
9651 % \cs{normal@footnotemarkX}\marg{series} sets up the typesetting of the
9652 % marker at the point where the footnote is called for.
9653 % \begin{macrocode}
9654 \newcommand*{\normal@footnotemarkX}[1]{%
9655 \prebodyfootmark
9656 \@nameuse{bodyfootmark#1}%
9657 \postbodyfootmark}
9658
9659 % \end{macrocode}
9660 % \end{macro}
9661 %
9662 % \begin{macro}{\normalbodyfootmarkX}
9663 % The \cs{normalbodyfootmarkX}\marg{series} \emph{really} typesets the
9664 % in-text marker. The style is the normal superscript.
9665 % \begin{macrocode}
9666 \newcommand*{\normalbodyfootmarkX}[1]{%
9667 \hbox{\textsuperscript{\normalfont\@nameuse{@thefnmark#1}}}}
9668 % \end{macrocode}
9669 % \end{macro}
9670 %
9671 % \begin{macro}{\normalvfootnoteX}
9672 % \changes{v1.5.1}{2013/08/16}{Fix bug with normal familiar footnotes when mixing RTL and LTR text.}
9673 % \cs{normalvfootnoteX}\marg{series}\marg{text} does the \cs{insert} for
9674 % the \meta{series} and calls the series' \cs{footfmt...} to format the
9675 % \meta{text}.
9676 % \begin{macrocode}
9677 \notbool{parapparatus@}{\newcommand*}{\newcommand}{\normalvfootnoteX}[2]{%
9678 \insert\@nameuse{footins#1}\bgroup
9679 \csuse{bhooknoteX@#1}
9680 \csuse{notefontsizeX@#1}
9681 \footsplitskips
9682 \ifl@dpairing\ifl@dpaging\else%
9683 \setnotesXwidthliketwocolumns@{#1}%
9684 \fi\fi%
9685 \setnotesXpositionliketwocolumns@{#1}%
9686 \spaceskip=\z@skip \xspaceskip=\z@skip
9687 \csuse{\csuse{footnote@dir}}\@nameuse{footfmt#1}{#1}{#2}\egroup}
9688
9689 % \end{macrocode}
9690 % \end{macro}
9691 %
9692 % \begin{macro}{\mpnormalvfootnoteX}
9693 % The minipage version.
9694 % \begin{macrocode}
9695 \newcommand*{\mpnormalvfootnoteX}[2]{%
9696 \global\setbox\@nameuse{mpfootins#1}\vbox{%
9697 \unvbox\@nameuse{mpfootins#1}
9698 \csuse{bhooknoteX@#1}
9699 \csuse{notefontsizeX@#1}
9700 \hsize\columnwidth
9701 \@parboxrestore
9702 \color@begingroup
9703 \@nameuse{footfmt#1}{#1}{#2}\color@endgroup}}
9704
9705 % \end{macrocode}
9706 % \end{macro}
9707 %
9708 % \begin{macro}{\normalfootfmtX}
9709 % \cs{normalfootfmtX}\marg{series}\marg{text} typesets the footnote text,
9710 % prepended by the marker.
9711 % \begin{macrocode}
9712 \notbool{parapparatus@}{\newcommand*}{\newcommand}{\normalfootfmtX}[2]{%
9713 \ifluatex%
9714 \textdir\footnote@luatextextdir%
9715 \pardir\footnote@luatexpardir%
9716 \par%
9717 \fi%
9718 \protected@edef\@currentlabel{%
9719 \@nameuse{@thefnmark#1}%
9720 }%
9721 \ledsetnormalparstuffX{#1}%
9722 \hangindent=\csuse{hangindentX@#1}%
9723 {{\csuse{notenumfontX@#1}\@nameuse{footfootmark#1}}\strut%
9724 #2\strut\par}}
9725
9726 % \end{macrocode}
9727 % \end{macro}
9728 %
9729 % \begin{macro}{\normalfootfootmarkX}
9730 % \cs{normalfootfootmarkX}\marg{series} is called by \cs{normalfootfmtX}
9731 % to typeset the footnote marker in the footer before the footnote text.
9732 % \begin{macrocode}
9733 \newcommand*{\normalfootfootmarkX}[1]{%
9734 \textsuperscript{\@nameuse{@thefnmark#1}}}
9735
9736 % \end{macrocode}
9737 % \end{macro}
9738 %
9739 % \begin{macro}{\normalfootstartX}
9740 % \cs{normalfootstartX}\marg{series} is the \meta{series} footnote
9741 % starting macro used in the output routine.
9742 % \begin{macrocode}
9743 \newcommand*{\normalfootstartX}[1]{%
9744 \ifdimequal{0pt}{\prenotesX@}{}%
9745 {%
9746 \iftoggle{prenotesX@}{%
9747 \togglefalse{prenotesX@}%
9748 \skip\csname footins#1\endcsname=%
9749 \dimexpr\csuse{prenotesX@}+\csuse{afterruleX@#1}\relax%
9750 }%
9751 {}%
9752 }%
9753 \vskip\skip\csname footins#1\endcsname%
9754 \leftskip=\z@
9755 \rightskip=\z@
9756 \ifl@dpairing\else%
9757 \hsize=\old@hsize%
9758 \fi%
9759 \setnotesXwidthliketwocolumns@{#1}%
9760 \setnotesXpositionliketwocolumns@{#1}%
9761 \print@footnoteXrule{#1}%
9762 }%
9763
9764 % \end{macrocode}
9765 % \end{macro}
9766 %
9767 % \begin{macro}{\normalfootnoteruleX}
9768 % The rule drawn before the footnote series group.
9769 % \begin{macrocode}
9770 \let\normalfootnoteruleX=\footnoterule
9771
9772 % \end{macrocode}
9773 % \end{macro}
9774 %
9775 % \begin{macro}{\normalfootgroupX}
9776 % \cs{normalfootgroupX}\marg{series} sends the contents of the \meta{series}
9777 % insert box to the output page without alteration.
9778 % \begin{macrocode}
9779 \newcommand*{\normalfootgroupX}[1]{%
9780 \unvbox\@nameuse{footins#1}%
9781 \hsize=\old@hsize%
9782 }%
9783
9784 % \end{macrocode}
9785 % \end{macro}
9786 %
9787 % \begin{macro}{\mpnormalfootgroupX}
9788 % The minipage version.
9789 % \begin{macrocode}
9790 \newcommand*{\mpnormalfootgroupX}[1]{%
9791 \vskip\skip\@nameuse{mpfootins#1}
9792 \ifl@dpairing\ifparledgroup%
9793 \leavevmode\marks\parledgroup@{begin}%
9794 \marks\parledgroup@series{#1}%
9795 \marks\parledgroup@type{footnoteX}%
9796 \fi\fi\normalcolor
9797 \ifparledgroup%
9798 \ifl@dpairing%
9799 \else%
9800 \setnotesXwidthliketwocolumns@{#1}%
9801 \setnotesXpositionliketwocolumns@{#1}%
9802 \print@footnoteXrule{#1}%
9803 \fi%
9804 \else%
9805 \setnotesXwidthliketwocolumns@{#1}%
9806 \setnotesXpositionliketwocolumns@{#1}%
9807 \print@footnoteXrule{#1}%
9808 \fi%
9809 \unvbox\@nameuse{mpfootins#1}}
9810
9811 % \end{macrocode}
9812 % \end{macro}
9813 %
9814 %
9815 % \begin{macro}{\normalbfnoteX}
9816 % \changes{v0.7.0}{2005/02/18}{Removed extraneous space from \cs{normalbfnoteX}}
9817 % \changes{v1.4.9}{2013/07/10}{Allow to redefine \cs{thefootnoteX} with \c{alph} when some packages are loaded.}
9818 % \begin{macrocode}
9819 \newcommand{\normalbfnoteX}[2]{%
9820 \ifnumberedpar@
9821 \protected@xdef\thisfootnote{\csuse{thefootnote#1}}%
9822 \xright@appenditem{\noexpand\vbfnoteX{#1}{#2}{\expandonce\thisfootnote}}%
9823 \to\inserts@list
9824 \global\advance\insert@count \@ne
9825 \fi\ignorespaces}
9826
9827 % \end{macrocode}
9828 % \end{macro}
9829 %
9830 %
9831 % \begin{macro}{\vbfnoteX}
9832 % \begin{macrocode}
9833 \newcommand{\vbfnoteX}[3]{%
9834 \@namedef{@thefnmark#1}{#3}%
9835 \@nameuse{regvfootnote#1}{#1}{#2}}
9836
9837 % \end{macrocode}
9838 % \end{macro}
9839 %
9840 %
9841 % \begin{macro}{\vnumfootnoteX}
9842 % \changes{v0.7.0}{2005/02/18}{Removed extraneous space from \cs{vnumfootnoteX}}
9843 % \begin{macrocode}
9844 \newcommand{\vnumfootnoteX}[2]{%
9845 \ifnumberedpar@
9846 \edtext{}{\normalbfnoteX{#1}{#2}}%
9847 \else
9848 \@nameuse{regvfootnote#1}{#1}{#2}%
9849 \fi}
9850
9851 % \end{macrocode}
9852 % \end{macro}
9853 %
9854 %
9855 %
9856 % \begin{macro}{\footnormalX}
9857 % \cs{footnormalX}\marg{series} initialises the settings for
9858 % the \meta{series} footnotes. This should always be called for
9859 % each series.
9860 % \begin{macrocode}
9861 \newcommand*{\footnormalX}[1]{%
9862 \csgdef{series@displayX#1}{normalX}
9863 \expandafter\let\csname footstart#1\endcsname=\normalfootstartX
9864 \@namedef{@footnotemark#1}{\normal@footnotemarkX{#1}}
9865 \@namedef{bodyfootmark#1}{\normalbodyfootmarkX{#1}}
9866 \expandafter\let\csname regvfootnote#1\endcsname=\normalvfootnoteX
9867 \expandafter\let\csname vfootnote#1\endcsname=\vnumfootnoteX
9868 \expandafter\let\csname footfmt#1\endcsname=\normalfootfmtX
9869 \@namedef{footfootmark#1}{\normalfootfootmarkX{#1}}
9870 \expandafter\let\csname footgroup#1\endcsname=\normalfootgroupX
9871 \expandafter\let\csname footnoterule#1\endcsname=\normalfootnoteruleX
9872 \count\csname footins#1\endcsname=1000
9873 \csxdef{default@footins#1}{1000}%Use to have note only for one side
9874 \dimen\csname footins#1\endcsname=\csuse{maxhnotesX@#1}
9875 \skip\csname footins#1\endcsname=\csuse{beforenotesX@#1}%
9876 \advance\skip\csname footins#1\endcsname by\csuse{afterruleX@#1}%
9877 % \end{macrocode}
9878 % Additions for minipages.
9879 % \begin{macrocode}
9880 \ifnoledgroup@\else%
9881 \expandafter\let\csname mpvfootnote#1\endcsname=\mpnormalvfootnoteX
9882 \expandafter\let\csname mpfootgroup#1\endcsname=\mpnormalfootgroupX
9883 \count\csname mpfootins#1\endcsname=1000
9884 \dimen\csname mpfootins#1\endcsname=\csuse{maxhnotesX@#1}
9885 \skip\csname mpfootins#1\endcsname=\csuse{beforenotesX@#1}%
9886 \advance\skip\csname mpfootins#1\endcsname by\csuse{afterruleX@#1}%
9887 \fi
9888 }
9889
9890 % \end{macrocode}
9891 % \end{macro}
9892 %
9893 % \subsection{Two columns footnotes}
9894 %
9895 % The following macros set footnotes in two columns. It is assumed
9896 % that the length of each footnote is less than the column width.
9897 %
9898 % \begin{macro}{\foottwocoolX}
9899 % \cs{foottwocolX}\marg{series}
9900 % \begin{macrocode}
9901 \newcommand*{\foottwocolX}[1]{%
9902 \csgdef{series@displayX#1}{twocolX}
9903 \expandafter\let\csname regvfootnote#1\endcsname=\twocolvfootnoteX
9904 \expandafter\let\csname footfmt#1\endcsname=\twocolfootfmtX
9905 \expandafter\let\csname footgroup#1\endcsname=\twocolfootgroupX
9906 \dimen\csname footins#1\endcsname=\csuse{maxhnotesX@#1}%
9907 \skip\csname footins#1\endcsname=\csuse{beforenotesX@#1}%
9908 \advance\skip\csname footins#1\endcsname by \csuse{afterruleX@#1}\relax%
9909 \twocolfootsetupX{#1}
9910 \ifnoledgroup@\else%
9911 \expandafter\let\csname mpvfootnote#1\endcsname=\mpnormalvfootnoteX
9912 \expandafter\let\csname mpfootgroup#1\endcsname=\mptwocolfootgroupX
9913 \skip\csname mpfootins#1\endcsname=\csuse{beforenotesX@#1}%
9914 \advance\skip\csname mpfootins#1\endcsname by\csuse{afterruleX@#1}
9915 \mptwocolfootsetupX{#1}
9916 \fi%
9917 }
9918
9919 % \end{macrocode}
9920 % \end{macro}
9921 %
9922 % \begin{macro}{\twocolfootsetupX}
9923 % \begin{macro}{\mptwocolfootsetupX}
9924 % \cs{twocolfootsetupX}\marg{series}
9925 % \begin{macrocode}
9926 \newcommand*{\twocolfootsetupX}[1]{%
9927 \count\csname footins#1\endcsname 500
9928 \csxdef{default@footins#1}{500}%Use this to confine the notes to one side only
9929 \multiply\dimen\csname footins#1\endcsname by \tw@}
9930 \newcommand*{\mptwocolfootsetupX}[1]{%
9931 \count\csname mpfootins#1\endcsname 500
9932 \multiply\dimen\csname mpfootins#1\endcsname by \tw@}
9933
9934 % \end{macrocode}
9935 % \end{macro}
9936 % \end{macro}
9937 %
9938 % \begin{macro}{\twocolvfootnoteX}
9939 % \cs{twocolvfootnoteX}\marg{series}
9940 % \begin{macrocode}
9941 \notbool{parapparatus@}{\newcommand*}{\newcommand}{\twocolvfootnoteX}[2]{%
9942 \insert\csname footins#1\endcsname\bgroup
9943 \csuse{notefontsizeX@#1}
9944 \footsplitskips
9945 \spaceskip=\z@skip \xspaceskip=\z@skip
9946 \@nameuse{footfmt#1}{#1}{#2}\egroup}
9947
9948 % \end{macrocode}
9949 % \end{macro}
9950 %
9951 % \begin{macro}{\twocolfootfmtX}
9952 % \cs{twocolfootfmtX}\marg{series}
9953 % \begin{macrocode}
9954 \notbool{parapparatus@}{\newcommand*}{\newcommand}{\twocolfootfmtX}[2]{%
9955 \protected@edef\@currentlabel{%
9956 \@nameuse{@thefnmark#1}%
9957 }%
9958 \normal@pars
9959 \hangindent=\csuse{hangindentX@#1}%
9960 \hsize \csuse{hsizetwocolX@#1}
9961 \nottoggle{parindentX@#1}{\parindent=\z@}{}
9962 \tolerance=5000\relax
9963 \leavevmode
9964 \csuse{colalignX@#1}%
9965 {\csuse{notenumfontX@#1}\@nameuse{footfootmark#1}\strut%
9966 #2\strut\par}\allowbreak}
9967
9968 % \end{macrocode}
9969 % \end{macro}
9970 %
9971 % \begin{macro}{\twocolfootgroupX}
9972 % \begin{macro}{\mptwocolfootgroupX}
9973 % \cs{twocolfootgroupX}\marg{series}
9974 % \begin{macrocode}
9975 \newcommand*{\twocolfootgroupX}[1]{{\csuse{notefontsizeX@#1}
9976 \splittopskip=\ht\strutbox
9977 \expandafter
9978 \rigidbalance\csname footins#1\endcsname \tw@ \splittopskip}}
9979 \newcommand*{\mptwocolfootgroupX}[1]{{%
9980 \vskip\skip\@nameuse{mpfootins#1}
9981 \ifl@dpairing\ifparledgroup%
9982 \leavevmode\marks\parledgroup@{begin}%
9983 \marks\parledgroup@series{#1}%
9984 \marks\parledgroup@type{footnoteX}%
9985 \fi\fi\normalcolor
9986 \ifparledgroup%
9987 \ifl@dpairing%
9988 \else%
9989 \setnotesXwidthliketwocolumns@{#1}%
9990 \setnotesXpositionliketwocolumns@{#1}%
9991 \print@footnoteXrule{#1}%
9992 \fi%
9993 \else%
9994 \setnotesXwidthliketwocolumns@{#1}%
9995 \setnotesXpositionliketwocolumns@{#1}%
9996 \print@footnoteXrule{#1}%
9997 \fi%
9998 \splittopskip=\ht\strutbox
9999 \expandafter
10000 \rigidbalance\csname mpfootins#1\endcsname \tw@ \splittopskip}}
10001
10002 % \end{macrocode}
10003 % \end{macro}
10004 % \end{macro}
10005 %
10006 % \subsection{Three columns footnotes}
10007 %
10008 % The following macros set footnotes in three columns. It is assumed
10009 % that the length of each footnote is less than the column width.
10010 %
10011 %
10012 % \begin{macro}{\footthreecolX}
10013 % \cs{footthreecolX}\marg{series}
10014 % \begin{macrocode}
10015 \newcommand*{\footthreecolX}[1]{%
10016 \csgdef{series@displayX#1}{threecolX}
10017 \expandafter\let\csname regvfootnote#1\endcsname=\threecolvfootnoteX
10018 \expandafter\let\csname footfmt#1\endcsname=\threecolfootfmtX
10019 \expandafter\let\csname footgroup#1\endcsname=\threecolfootgroupX
10020 \dimen\csname footins#1\endcsname=\csuse{maxhnotesX@#1}%
10021 \skip\csname footins#1\endcsname=\csuse{beforenotesX@#1}%
10022 \advance\skip\csname footins#1\endcsname by \csuse{afterruleX@#1}\relax%
10023 \threecolfootsetupX{#1}
10024 \ifnoledgroup@\else%
10025 \expandafter\let\csname mpvfootnote#1\endcsname=\mpnormalvfootnoteX
10026 \expandafter\let\csname mpfootgroup#1\endcsname=\mpthreecolfootgroupX
10027 \skip\csname mpfootins#1\endcsname=\csuse{beforenotesX@#1}%
10028 \advance\skip\csname mpfootins#1\endcsname by\csuse{afterruleX@#1}
10029 \mpthreecolfootsetupX{#1}
10030 \fi%
10031 }
10032
10033 % \end{macrocode}
10034 % \end{macro}
10035 %
10036 % \begin{macro}{\threecolfootsetupX}
10037 % \begin{macro}{\mpthreecolfootsetupX}
10038 % \cs{threecolfootsetupX}\marg{series}
10039 % \begin{macrocode}
10040 \newcommand*{\threecolfootsetupX}[1]{%
10041 \count\csname footins#1\endcsname 333
10042 \csxdef{default@footins#1}{333}%Use this to confine the notes to one side only
10043 \multiply\dimen\csname footins#1\endcsname by \thr@@}
10044 \newcommand*{\mpthreecolfootsetupX}[1]{%
10045 \count\csname mpfootins#1\endcsname 333
10046 \multiply\dimen\csname mpfootins#1\endcsname by \thr@@}
10047
10048 % \end{macrocode}
10049 % \end{macro}
10050 % \end{macro}
10051 %
10052 % \begin{macro}{\threecolvfootnoteX}
10053 % \cs{threecolvfootnoteX}\marg{series}\marg{text}
10054 % \begin{macrocode}
10055 \notbool{parapparatus@}{\newcommand*}{\newcommand}{\threecolvfootnoteX}[2]{%
10056 \insert\csname footins#1\endcsname\bgroup
10057 \csuse{notefontsizeX@#1}
10058 \footsplitskips
10059 \@nameuse{footfmt#1}{#1}{#2}\egroup}
10060
10061 % \end{macrocode}
10062 % \end{macro}
10063 %
10064 % \begin{macro}{\threecolfootfmtX}
10065 % \cs{threecolfootfmtX}\marg{series}
10066 % \begin{macrocode}
10067 \notbool{parapparatus@}{\newcommand*}{\newcommand}{\threecolfootfmtX}[2]{%
10068 \protected@edef\@currentlabel{%
10069 \@nameuse{@thefnmark#1}%
10070 }%
10071 \hangindent=\csuse{hangindentX@#1}%
10072 \normal@pars
10073 \hsize \csuse{hsizethreecolX@#1}
10074 \nottoggle{parindentX@#1}{\parindent=\z@}{} %
10075 \tolerance=5000\relax
10076 \leavevmode
10077 \csuse{colalignX@#1}%
10078 {\csuse{notenumfontX@#1}\@nameuse{footfootmark#1}\strut%
10079 #2\strut\par}\allowbreak}
10080
10081 % \end{macrocode}
10082 % \end{macro}
10083 %
10084 % \begin{macro}{\threecolfootgroupX}
10085 % \begin{macro}{\mpthreecolfootgroupX}
10086 % \cs{threecolfootgroupX}\marg{series}
10087 % \begin{macrocode}
10088 \newcommand*{\threecolfootgroupX}[1]{{\csuse{notefontsizeX@#1}
10089 \splittopskip=\ht\strutbox
10090 \expandafter
10091 \rigidbalance\csname footins#1\endcsname \thr@@ \splittopskip}}
10092 \newcommand*{\mpthreecolfootgroupX}[1]{{%
10093 \vskip\skip\@nameuse{mpfootins#1}
10094 \ifl@dpairing\ifparledgroup
10095 \leavevmode\marks\parledgroup@{begin}%
10096 \marks\parledgroup@series{#1}%
10097 \marks\parledgroup@type{footnoteX}%
10098 \fi\fi\normalcolor
10099 \ifparledgroup%
10100 \ifl@dpairing%
10101 \else%
10102 \setnotesXwidthliketwocolumns@{#1}%
10103 \setnotesXpositionliketwocolumns@{#1}%
10104 \print@footnoteXrule{#1}%
10105 \fi%
10106 \else%
10107 \setnotesXwidthliketwocolumns@{#1}%
10108 \setnotesXpositionliketwocolumns@{#1}%
10109 \print@footnoteXrule{#1}%
10110 \fi%
10111 \splittopskip=\ht\strutbox
10112 \expandafter
10113 \rigidbalance\csname mpfootins#1\endcsname \thr@@ \splittopskip}}
10114
10115 % \end{macrocode}
10116 % \end{macro}
10117 % \end{macro}
10118 %
10119 % \subsection{Paragraphed footnotes}
10120 %
10121 % The following macros set footnotes as one paragraph.
10122 %
10123 % \begin{macro}{\footparagraphX}
10124 % \changes{v1.15.0}{2015/01/12}{Correct bug with paragraphed familiar footnotes setting.}
10125 % \cs{footparagraphX}\marg{series}
10126 % \begin{macrocode}
10127 \newcommand*{\footparagraphX}[1]{%
10128 \csgdef{series@displayX#1}{paragraphX}%
10129 \expandafter\newcount\csname prevpage#1@num\endcsname
10130 \expandafter\let\csname footstart#1\endcsname=\parafootstartX
10131 \expandafter\let\csname regvfootnote#1\endcsname=\para@vfootnoteX
10132 \expandafter\let\csname footfmt#1\endcsname=\parafootfmtX
10133 \expandafter\let\csname footgroup#1\endcsname=\para@footgroupX
10134 \expandafter\let\csname footnoterule#1\endcsname=\normalfootnoteruleX
10135 \count\csname footins#1\endcsname=1000
10136 \csxdef{default@footins#1}{1000}%Use this to confine the notes to one side only
10137 \dimen\csname footins#1\endcsname=\csuse{maxhnotesX@#1}
10138 \skip\csname footins#1\endcsname=\csuse{beforenotesX@#1}%
10139 \advance\skip\csname footins#1\endcsname by\csuse{afterruleX@#1}%
10140 \para@footsetupX{#1}
10141 \ifnoledgroup@\else
10142 \expandafter\let\csname mpvfootnote#1\endcsname=\mppara@vfootnoteX
10143 \expandafter\let\csname mpfootgroup#1\endcsname=\mppara@footgroupX
10144 \count\csname mpfootins#1\endcsname=1000
10145 \dimen\csname mpfootins#1\endcsname=\csuse{maxhnotesX@#1}
10146 \skip\csname mpfootins#1\endcsname=\csuse{beforenotesX@#1}%
10147 \advance\skip\csname mpfootins#1\endcsname by\csuse{afterruleX@#1}%
10148 \fi
10149 }
10150
10151 % \end{macrocode}
10152 % \end{macro}
10153 %
10154 % \begin{macro}{\para@footsetupX}
10155 % \cs{para@footsetupX}\marg{series}
10156 % \changes{v0.2.2}{2003/11/04}{Added \cs{footfudgefiddle} to \cs{para@footsetupX}}
10157 % \changes{v1.13.0}{2014/09/16}{In \cs{para@footsetupX}, use \cs{columnwidth} instead of \cs{hsize}}
10158 % \begin{macrocode}
10159 \newcommand*{\para@footsetupX}[1]{{\csuse{notefontsizeX@#1}
10160 \setnotesXwidthliketwocolumns@{#1}%
10161 \dimen0=\baselineskip
10162 \multiply\dimen0 by 1024
10163 \divide\dimen0 by \columnwidth \multiply\dimen0 by \footfudgefiddle\relax%
10164 \expandafter
10165 \xdef\csname footfudgefactor#1\endcsname{%
10166 \expandafter\strip@pt\dimen0 }}}
10167
10168 % \end{macrocode}
10169 % \end{macro}
10170 %
10171 % \begin{macro}{\parafootstartX}
10172 % \cs{parafootstartX}\marg{series}
10173 % \begin{macrocode}
10174 \newcommand*{\parafootstartX}[1]{%
10175 \ifdimequal{0pt}{\prenotesX@}{}%
10176 {%
10177 \iftoggle{prenotesX@}{%
10178 \togglefalse{prenotesX@}%
10179 \skip\csname footins#1\endcsname=%
10180 \dimexpr\csuse{prenotesX@}+\csuse{afterruleX@#1}\relax%
10181 }%
10182 {}%
10183 }%
10184 \vskip\skip\csname footins#1\endcsname%
10185 \leftskip=\z@
10186 \rightskip=\z@
10187 \parindent=\z@
10188 \vskip\skip\@nameuse{footins#1}%
10189 \setnotesXwidthliketwocolumns@{#1}%
10190 \setnotesXpositionliketwocolumns@{#1}%
10191 \print@footnoteXrule{#1}%
10192 }
10193
10194 % \end{macrocode}
10195 % \end{macro}
10196 %
10197 % \begin{macro}{\para@vfootnoteX}
10198 % \begin{macro}{\mppara@vfootnoteX}
10199 % \cs{para@vfootnoteX}\marg{series}\marg{text}
10200 % \begin{macrocode}
10201 \newcommand*{\para@vfootnoteX}[2]{%
10202 \insert\csname footins#1\endcsname
10203 \bgroup
10204 \csuse{bhooknoteX@#1}
10205 \csuse{notefontsizeX@#1}
10206 \footsplitskips
10207 \setbox0=\vbox{\hsize=\maxdimen%
10208 \let\bidi@RTL@everypar\@empty%
10209 \noindent\@nameuse{footfmt#1}{#1}{#2}}%
10210 \setbox0=\hbox{\unvxh0[#1]}%
10211 \dp0=\z@
10212 \ht0=\csname footfudgefactor#1\endcsname\wd0
10213 \box0
10214 \penalty0
10215 \egroup}
10216 \newcommand*{\mppara@vfootnoteX}[2]{%
10217 \global\setbox\@nameuse{mpfootins#1}\vbox{%
10218 \unvbox\@nameuse{mpfootins#1}
10219 \csuse{bhooknoteX@#1}
10220 \csuse{notefontsizeX@#1}
10221 \footsplitskips
10222 \setbox0=\vbox{\hsize=\maxdimen%
10223 \let\bidi@RTL@everypar\@empty%
10224 \noindent\color@begingroup\@nameuse{footfmt#1}{#1}{#2}\color@endgroup}%
10225 \setbox0=\hbox{\unvxh0[#1]}%
10226 \dp0=\z@
10227 \ht0=\csname footfudgefactor#1\endcsname\wd0
10228 \box0
10229 \penalty0}}
10230
10231 % \end{macrocode}
10232 % \end{macro}
10233 % \end{macro}
10234 %
10235 % \begin{macro}{\parafootfmtX}
10236 % \cs{parafootfmtX}\marg{series}
10237 % \begin{macrocode}
10238 \newcommand*{\parafootfmtX}[2]{%
10239 \protected@edef\@currentlabel{%
10240 \@nameuse{@thefnmark#1}%
10241 }%
10242 \insertparafootsep{#1}%
10243 \ledsetnormalparstuffX{#1}%
10244 {\csuse{notenumfontX@#1}\csuse{notenumfontX@#1}\@nameuse{footfootmark#1}\strut%
10245 #2\penalty-10}}
10246
10247 % \end{macrocode}
10248 % \end{macro}
10249 %
10250 % \begin{macro}{\para@footgroupX}
10251 % \begin{macro}{\mppara@footgroupX}
10252 % \cs{para@footgroupX}\marg{series}
10253 % \begin{macrocode}
10254 \newcommand*{\para@footgroupX}[1]{%
10255 \unvbox\csname footins#1\endcsname
10256 \ifcsstring{raggedX@#1}{L}{\RaggedLeft}{}%
10257 \ifcsstring{raggedX@#1}{R}{\RaggedRight}{}%
10258 \makehboxofhboxes
10259 \setbox0=\hbox{\unhbox0 \removehboxes}%
10260 \csuse{notefontsizeX@#1}
10261 \noindent\unhbox0\par}
10262 \newcommand*{\mppara@footgroupX}[1]{{%
10263 \setnotesXwidthliketwocolumns@{#1}%
10264 \vskip\skip\@nameuse{mpfootins#1}
10265 \ifl@dpairing\ifparledgroup
10266 \leavevmode%
10267 \leavevmode\marks\parledgroup@{begin}%
10268 \marks\parledgroup@series{#1}%
10269 \marks\parledgroup@type{footnoteX}%
10270 \fi\fi\normalcolor
10271 \ifparledgroup%
10272 \ifl@dpairing%
10273 \else%
10274 \setnotesXwidthliketwocolumns@{#1}%
10275 \setnotesXpositionliketwocolumns@{#1}%
10276 \print@footnoteXrule{#1}%
10277 \fi%
10278 \else%
10279 \setnotesXwidthliketwocolumns@{#1}%
10280 \setnotesXpositionliketwocolumns@{#1}%
10281 \print@footnoteXrule{#1}%
10282 \fi%
10283 \unvbox\csname mpfootins#1\endcsname
10284 \ifcsstring{raggedX@#1}{L}{\RaggedLeft}{}%
10285 \ifcsstring{raggedX@#1}{R}{\RaggedRight}{}%
10286 \makehboxofhboxes
10287 \setbox0=\hbox{\unhbox0 \removehboxes}%
10288 \csuse{notefontsizeX@#1}
10289 \noindent\unhbox0\par}}
10290
10291 % \end{macrocode}
10292 % \end{macro}
10293 % \end{macro}
10294 %
10295 % \section{Footnotes' width for two columns}
10296 % We define here some commands which make sense only with \Lpack{eledpar}, but must be called when defining notes paramaters.
10297 % These commands change the width of block notes to allow them to have the same size than two parallel columns.
10298 % \begin{macro}{\old@hsize}
10299 % \begin{macro}{\setXnoteswidthliketwocolumns@}
10300 % \begin{macro}{\setnotesXwidthliketwocolumns@}
10301 % These two commands are called at the beginning of critical or familiar notes groups.
10302 % They set, if the option is enabled, the \cs{hsize}. They are also called at the on the setup for paragraphed notes.
10303 % \begin{macrocode}
10304
10305 \newdimen\old@hsize%
10306 \AtBeginDocument{\old@hsize=\hsize}%
10307
10308 \newcommand{\setXnoteswidthliketwocolumns@}[1]{%
10309 \global\let\hsize@fornote=\hsize%
10310 \global\old@hsize=\hsize%
10311 \iftoggle{Xnoteswidthliketwocolumns@#1}%
10312 {%
10313 \csuse{setwidthliketwocolumns@\columns@position}%
10314 \global\let\hsize@fornote=\hsize%
10315 }%
10316 {}%
10317 \let\hsize=\hsize@fornote%
10318 \let\columnwidth=\hsize@fornote%
10319 }%
10320
10321 \newcommand{\setnotesXwidthliketwocolumns@}[1]{%
10322 \global\let\hsize@fornote=\hsize%
10323 \global\old@hsize=\hsize%
10324 \iftoggle{notesXwidthliketwocolumns@#1}%
10325 {%
10326 \csuse{setwidthliketwocolumns@\columns@position}%
10327 \global\let\hsize@fornote=\hsize%
10328 }%
10329 {}%
10330 \let\hsize=\hsize@fornote%
10331 \let\columnwidth=\hsize@fornote%
10332 }%
10333
10334 % \end{macrocode}
10335 % \end{macro}
10336 % \end{macro}
10337 % \end{macro}
10338 % \begin{macro}{\setXnotespositionliketwocolumns@}
10339 % \begin{macro}{\setnotesXpositionliketwocolumns@}
10340 % These two commands set the position of the critical / familiar
10341 % footnotes, depending on the hooks
10342 % \verb+Xnoteswidthliketwocolumns+ and \verb+notesXwidthliketwocolumns+.
10343 % They call commands which are defined only in \Lpack{eledpar}, because this feature has no sens without \Lpack{eledpar}.
10344 % \begin{macrocode}
10345 \newcommand{\setXnotespositionliketwocolumns@}[1]{%
10346 \iftoggle{Xnoteswidthliketwocolumns@#1}{%
10347 \csuse{setnotespositionliketwocolumns@\columns@position}%
10348 }{}%
10349 }%
10350
10351 \newcommand{\setnotesXpositionliketwocolumns@}[1]{%
10352 \iftoggle{notesXwidthliketwocolumns@#1}{%
10353 \csuse{setnotespositionliketwocolumns@\columns@position}%
10354 }{}%
10355 }%
10356
10357 % \end{macrocode}
10358 % \end{macro}
10359 % \end{macro}
10360 % \section{Footnotes' order}
10361 % \begin{macro}{\fnpos}
10362 % \begin{macro}{\mpfnpos}
10363 % \begin{macro}{\@fnpos}
10364 % \begin{macro}{\@mpfnpos}
10365 % The \cs{fnpos} and \cs{mpfnpos} simply place their arguments in \cs{@fnpos} and \cs{@mpfnpos}, which will be used later in the output routine.
10366 % \begin{macrocode}
10367 \def\@fnpos{familiar-critical}
10368 \def\@mpfnpos{critical-familiar}
10369 \newcommand{\fnpos}[1]{\xdef\@fnpos{#1}}
10370 \newcommand{\mpfnpos}[1]{\xdef\@mpfnpos{#1}}
10371 % \end{macrocode}
10372 % \end{macro}
10373 % \end{macro}
10374 % \end{macro}
10375 % \end{macro}
10376 % \section{Footnotes' rule}
10377 % Because the footnotes' rules can be shifted to the right when footnotes are set like two columns, we don't print them directly, but we put them in a \cs{vbox}.
10378 %
10379 % \begin{macro}{\print@Xfootnoterule}
10380 % \begin{macro}{\print@footnoteXrule}
10381 % \changes{v1.21.0}{2015/04/13}{Code refactoring: the spaces after the footnote rules are directly managed in \cs{print@Xfootnoterule} and \cs{print@footnoteXrule}}
10382 % \begin{macrocode}
10383 \newcommand{\print@Xfootnoterule}[1]{%
10384 \vskip-\csuse{afterXrule@#1}%Because count in \dimen\csuse{#1footins}
10385 \nointerlineskip%
10386 \moveleft-\leftskip\vbox{\csuse{#1footnoterule}}%
10387 \nointerlineskip%
10388 \vskip\csuse{afterXrule@#1}%
10389 }%
10390
10391 \newcommand{\print@footnoteXrule}[1]{%
10392 \vskip-\csuse{afterruleX@#1}%Because count in \dimen\csuse{footins#1}
10393 \nointerlineskip%
10394 \moveleft-\leftskip\vbox{\csuse{footnoterule#1}}%
10395 \nointerlineskip%
10396 \vskip\csuse{afterruleX@#1}%
10397 }%
10398
10399 % \end{macrocode}
10400 % \end{macro}
10401 % \end{macro}
10402 % \section{Specific skip for first series of footnotes}
10403 % \cs{beforeXnotes} insert a specific skip for the first series of notes in a page.
10404 % As we can know in advance which series will be the first, we call \cs{prepare@preXnotes} before inserting any critical notes, in order to prevent page number overlapping.
10405 % \begin{enumerate}
10406 % \item If it is the first note of the current page, it changes the footnote skip for the series to the value specified to \cs{beforeXnotes}. Keeps the series of the note as the first one of the current page.
10407 % \item If it is not the first note of the current page:
10408 % \begin{itemize}
10409 % \item If the current series is printed after the series kept as the first of the current page, then nothing happens.
10410 % \item If the current series is printed before the series kept as the first of the current page, then it changes the footnote of the current series to the value normally used by the series which was marked as the first of the page. Keeps the current series as the new first one of the current page.
10411 % \end{itemize}
10412 % \end{enumerate}
10413 %
10414 %
10415 % For example, suppose the series order is A,B. We call first a \cs{Bfootnote} and a \cs{Afootnote}. The only skips used are, finally, the skip specific to the first series of the page, and the skip for the B series. If we have not called \cs{Afootnote}, the only skip used is the skip specific to the first series of the page.
10416 %
10417 % That is perfect.
10418 %
10419 %
10420 % The series skip and the first series of the current page are reset before the footnotes are printed. Then, the footstart macros manage the problem of the first series of the page.
10421 %
10422 % After the rule, the space which is defined by \cs{afterXrule} does not depend on whether the series is the first one of the page or not. So we use its normal value for each series.
10423 % \begin{macro}{firstXseries@}
10424 % \begin{macro}{prepare@preXnotes}
10425 % \begin{macrocode}
10426 \gdef\firstXseries@{}
10427 \newcommand{\prepare@preXnotes}[1]{%
10428 \ifdimequal{0pt}{\preXnotes@}%
10429 {}%
10430 {%
10431 \IfStrEq{\firstXseries@}{}{%
10432 \global\skip\csuse{#1footins}=\preXnotes@%
10433 \global\advance\skip\csname #1footins\endcsname by\csuse{afterXrule@#1}%
10434 \gdef\firstXseries@{#1}%
10435 }%
10436 {%
10437 \ifseriesbefore{#1}{\firstXseries@}%
10438 {%
10439 \global\skip\csuse{#1footins}=\csuse{beforeXnotes@\firstXseries@}%
10440 \global\advance\skip\csname #1footins\endcsname by\csuse{afterXrule@#1}%
10441 \gdef\firstXseries@{#1}%
10442 }%
10443 {}%
10444 }%
10445 }%
10446 }
10447 % \end{macrocode}
10448 % \end{macro}
10449 % \end{macro}
10450 %
10451 % The same thing is required for familiar notes and \cs{prenotesX}.
10452 % \begin{macro}{firstseriesX@}
10453 % \begin{macro}{prepare@prenotesX}
10454 % \begin{macrocode}
10455 \gdef\firstseriesX@{}
10456 \newcommand{\prepare@prenotesX}[1]{%
10457 \ifdimequal{0pt}{\prenotesX@}%
10458 {}%
10459 {%
10460 \IfStrEq{\firstseriesX@}{}{%
10461 \global\skip\csuse{footins#1}=\prenotesX@%
10462 \global\advance\skip\csname footins#1\endcsname by\csuse{afterruleX@#1}%
10463 \gdef\firstseriesX@{#1}%
10464 }%
10465 {%
10466 \ifseriesbefore{#1}{\firstseriesX@}%
10467 {%
10468 \global\skip\csuse{footins#1}=\csuse{beforenotesX@\firstseriesX@}%
10469 \global\advance\skip\csname footins#1\endcsname by\csuse{afterruleX@#1}%
10470 \gdef\firstXseries@{#1}%
10471 }%
10472 {}%
10473 }%
10474 }%
10475 }
10476 % \end{macrocode}
10477 % \end{macro}
10478 % \end{macro}
10479 % \section{Footnotes' output}
10480 % \begin{macro}{\print@notesX}
10481 % \begin{macro}{\doxtrafeeti}
10482 % \begin{macro}{\doreinxtrafeeti}
10483 % We have to add all the new kinds of familiar footnotes to the output
10484 % routine. These are the class 1 feet\index{class 1 feet}.
10485 % The normal way to add one series.
10486 % \cs{print@Xnotes} is replaced by \Lpack{eledpar} when using \cs{Pages}.
10487 % \begin{macrocode}
10488 \newcommand\print@notesX[1]{%
10489 \csuse{footstart#1}{#1}%
10490 \csuse{footgroup#1}{#1}%
10491 }%
10492 % \end{macrocode}
10493 % We print all the series of notes by looping on them.
10494 % We check before printing them that they are not voided.
10495 % \begin{macrocode}
10496 \newcommand*{\doxtrafeeti}{%
10497 \unless\ifnofamiliar@%
10498 \gdef\firstseriesX@{}%
10499 \setbox\@outputbox \vbox{%
10500 \unvbox\@outputbox%
10501 \def\do##1{%
10502 \ifvoid\csuse{footins##1}\else%
10503 \global\skip\csuse{footins##1}=\csuse{beforenotesX@##1}%
10504 \global\advance\skip\csuse{footins##1} by\csuse{afterruleX@##1}%
10505 \print@notesX{##1}%
10506 \fi%
10507 }%
10508 \dolistloop{\@series}}%
10509 \fi%
10510 }%
10511
10512 \newcommand{\doreinxtrafeeti}{%
10513 \unless\ifnofamiliar@%
10514 \def\do##1{%
10515 \ifvoid\csuse{footins##1}\else
10516 \insert%
10517 \csuse{footins##1}
10518 {\unvbox\csuse{footins##1}}%
10519 \fi%
10520 }%
10521 \dolistloop{\@series}%
10522 \fi%
10523 }%
10524
10525 % \end{macrocode}
10526 % \end{macro}
10527 % \end{macro}
10528 % \end{macro}
10529 %
10530 % \begin{macro}{\addfootinsX}
10531 % Juste for backward compatibility: print a warning message.
10532 % \begin{macrocode}
10533 \newcommand*{\addfootinsX}[1]{%
10534 \led@warn@AddfootinsXObsolete%
10535 \footnormalX{#1}%
10536 \g@addto@macro{\doxtrafeeti}{%
10537 \setbox\@outputbox \vbox{%
10538 \unvbox\@outputbox
10539 \ifvoid\@nameuse{footins#1}\else
10540 \@nameuse{footstart#1}{#1}\@nameuse{footgroup#1}{#1}\fi}}%as
10541 \g@addto@macro{\doreinxtrafeeti}{%
10542 \ifvoid\@nameuse{footins#1}\else
10543 \insert\@nameuse{footins#1}{\unvbox\@nameuse{footins#1}}\fi}%
10544 \g@addto@macro{\l@dfambeginmini}{%
10545 \expandafter\expandafter\expandafter\let\expandafter\expandafter
10546 \csname footnote#1\endcsname \csname mpfootnote#1\endcsname}%
10547 \g@addto@macro{\l@dfamendmini}{%
10548 \ifvoid\@nameuse{mpfootins#1}\else\@nameuse{mpfootgroup#1}{#1}\fi}%
10549 }
10550 % \end{macrocode}
10551 % \end{macro}
10552 % \section{Endnotes}
10553 % \changes{v1.8.1}{2013/12/15}{Debug endnotes when more than one series is used (change the position where tools for endnotes are defined).}
10554 % \changes{v1.14.0}{2014/10/20}{Debug spurious characters before endnotes.}
10555 % \label{endnotes}\relax
10556 %
10557 % First, check the noend option.
10558 % \begin{macrocode}
10559 \ifbool{noend@}{}{%Used instead of \ifnoend@ to prevent expansion problem
10560 % \end{macrocode}
10561 % \begin{macro}{\l@d@end}
10562 % \begin{macro}{\ifl@dend@}
10563 % \begin{macro}{\l@dend@true}
10564 % \begin{macro}{\l@dend@false}
10565 % Endnotes of all varieties are saved up in a file, typically named
10566 % \meta{jobname}\file{.end}.
10567 % \cs{l@d@end} is the output stream number for
10568 % this file, and \verb"\ifl@dend@" is a flag that's \verb"true" when the file is open.
10569 % \begin{macrocode}
10570 \newwrite\l@d@end
10571 \newif\ifl@dend@
10572 % \end{macrocode}
10573 % \end{macro}
10574 % \end{macro}
10575 % \end{macro}
10576 % \end{macro}
10577 %
10578 % \begin{macro}{\l@dend@open}
10579 % \begin{macro}{\l@dend@close}
10580 % \cs{l@dend@open} and \cs{l@dend@close} are the
10581 % macros that are used to open and close the endnote file. Note that
10582 % all our writing to this file is \cs{immediate}: all page and
10583 % line numbers for the endnotes are generated by the same mechanism
10584 % we use for the footnotes, so that there's no need to defer any
10585 % writing to catch information from the output routine.
10586 % \begin{macrocode}
10587 \newcommand{\l@dend@open}[1]{\global\l@dend@true\immediate\openout\l@d@end=#1\relax}
10588 \newcommand{\l@dend@close}{\global\l@dend@false\immediate\closeout\l@d@end}
10589
10590 % \end{macrocode}
10591 % \end{macro}
10592 % \end{macro}
10593 %
10594 % \begin{macro}{\l@dend@stuff}
10595 % \cs{l@dend@stuff} is used by \cs{beginnumbering} to
10596 % do everything that's necessary for the endnotes at the
10597 % start of each section: it opens the \cs{l@d@end} file, if necessary,
10598 % and writes the section number to the endnote file.
10599 % \begin{macrocode}
10600 \newcommand{\l@dend@stuff}{%
10601 \ifl@dend@\relax\else
10602 \l@dend@open{\jobname.end}%
10603 \fi
10604 \immediate\write\l@d@end{\string\l@d@section{\the\section@num}}}
10605
10606 % \end{macrocode}
10607 % \end{macro}
10608 %
10609 % \begin{macro}{\endprint}
10610 % \begin{macro}{\l@d@section}
10611 % The \cs{endprint} here is nearly identical in its
10612 % functioning to \cs{normalfootfmt}.
10613 %
10614 % The endnote file also contains \cs{l@d@section} commands, which
10615 % supply the section numbers from the main text; standard \Eledmac{} does
10616 % nothing with this information, but it's there if you want to write
10617 % custom macros to do something with it.
10618 % \changes{v1.18.0}{2015/02/23}{Option parapparatus works for endnotes.}
10619 % \changes{v1.21.0}{2015/04/13}{\cs{endnotes} take five arguments.}
10620 % Arguments are:
10621 % \begin{itemize}
10622 % \item \verb+#1+ Line numbers and font selection.
10623 % \item \verb+#2+ Lemma.
10624 % \item \verb+#3+ Note content.
10625 % \item \verb+#4+ Series.
10626 % \item \verb+#5+ Optional argument of \cs{Xendnote}.
10627 % \end{itemize}
10628 % \begin{macrocode}
10629 \global\notbool{parapparatus@}{}{\long}\def\endprint#1#2#3#4#5{{%
10630 \ifXendinsertsep@%
10631 \hskip\csuse{Xendafternote@#4}%
10632 \csuse{Xendsep@#4}%
10633 \else%
10634 \iftoggle{Xendparagraph@#4}%
10635 {\global\Xendinsertsep@true}%
10636 {}%
10637 \fi%
10638 \xdef\@currentseries{#4}%
10639 \def\do##1{%
10640 \toggletrue{##1@}%
10641 }%
10642 \notblank{#5}{\docsvlist{#5}}{}%
10643 \csuse{bhookXendnote@#4}%
10644 \csuse{Xendnotefontsize@#4}%
10645 {%
10646 \csuse{Xendnotenumfont@#4}%
10647 \ifdimequal{\csuse{boxXendlinenum@#4}}{0pt}%
10648 {\printendlines#1|}%
10649 {\leavevmode%
10650 \hbox to \csuse{boxXendlinenum@#4}%
10651 {%
10652 \IfSubStr{RC}{\csuse{boxXendlinenumalign@#4}}{\hfill}{}%
10653 \printendlines#1|%
10654 \IfSubStr{LC}{\csuse{boxXendlinenumalign@#4}}{\hfill}{}%
10655 }}%
10656 }%
10657 \enspace{%
10658 \nottoggle{Xendlemmadisablefontselection@#4}%
10659 {\select@lemmafont#1|#2}%
10660 {#2}%
10661 }%
10662 \ifboolexpr{%
10663 togl {nosep@}%
10664 or test{\ifcsempty{Xendlemmaseparator@#4}}%
10665 }%
10666 {\hskip\csuse{Xendinplaceoflemmaseparator@#4}}%
10667 {\nobreak%
10668 \hskip\csuse{Xendbeforelemmaseparator@#4}%
10669 \csuse{Xendlemmaseparator@#4}%
10670 \hskip\csuse{Xendafterlemmaseparator@#4}%
10671 }%
10672 #3%
10673 \nottoggle{Xendparagraph@#4}{\par}{}%
10674 \togglefalse{fulllines@}%
10675 \togglefalse{nosep@}%
10676 }}%
10677
10678 \let\l@d@section=\@gobble
10679
10680 % \end{macrocode}
10681 % \end{macro}
10682 % \end{macro}
10683
10684 %
10685 % \begin{macro}{\setprintendlines}
10686 % The \cs{printendlines} macro is similar to \cs{printlines} but is
10687 % for printing endnotes rather than footnotes.
10688 %
10689 % The principal difference between foot- and endnotes is that footnotes
10690 % are printed on the page where they are specified but endnotes
10691 % are printed at a different point in the document. We need an indication
10692 % of the source of an endnote; \cs{setprintendlines} provides this
10693 % by always printing the page number. The coding is slightly simpler than
10694 % \cs{setprintlines}.
10695 %
10696 % First of all, we print the second page number only if
10697 % the ending page number is different
10698 % from the starting page number.\phantomsection\label{printendlines}
10699 % \changes{v0.7.0}{2005/02/18}{Added \cs{setprintendlines} for use by
10700 % \cs{printendlines}}
10701 % \begin{macrocode}
10702 \newcommand*{\setprintendlines}[6]{%
10703 \l@d@pnumfalse \l@d@dashfalse
10704 \ifnum#4=#1 \else
10705 \l@d@pnumtrue
10706 \l@d@dashtrue
10707 \fi
10708 % \end{macrocode}
10709 %
10710 % We print the ending line number if\/: (1)~we're printing the ending
10711 % page number, or (2)~it's different from the starting line number.
10712 % \begin{macrocode}
10713 \ifl@d@pnum \l@d@elintrue \else \l@d@elinfalse \fi
10714 \ifnum#2=#5 \else
10715 \l@d@elintrue
10716 \l@d@dashtrue
10717 \fi
10718 % \end{macrocode}
10719 %
10720 % We print the starting sub-line if it's nonzero.
10721 % \begin{macrocode}
10722 \l@d@ssubfalse
10723 \ifnum#3=0 \else
10724 \l@d@ssubtrue
10725 \fi
10726 % \end{macrocode}
10727 %
10728 % We print the ending sub-line if it's nonzero and: (1)~it's different
10729 % from the starting sub-line number, or (2)~the ending line number is
10730 % being printed.
10731 % \begin{macrocode}
10732 \l@d@eslfalse
10733 \ifnum#6=0 \else
10734 \ifnum#6=#3
10735 \ifl@d@elin \l@d@esltrue \else \l@d@eslfalse \fi
10736 \else
10737 \l@d@esltrue
10738 \l@d@dashtrue
10739 \fi
10740 \fi%
10741 % \end{macrocode}
10742 % \begin{macrocode}
10743 \ifl@d@dash%
10744 \ifboolexpr{togl{fulllines@} or test{\ifcsempty{Xendtwolines@\@currentseries}}}%
10745 {}%
10746 {%
10747 \setistwofollowinglines{#1}{#2}{#4}{#5}%
10748 \ifboolexpr{%
10749 (%
10750 togl {Xendtwolinesbutnotmore@\@currentseries}%
10751 and not%
10752 (%
10753 bool {istwofollowinglines@}%
10754 )%
10755 )%
10756 or%
10757 (%
10758 (not test{\ifnumequal{#1}{#4}})%
10759 and togl{Xendtwolinesonlyinsamepage@\@currentseries}%
10760 )%
10761 }%
10762 {}%
10763 {%
10764 \l@d@dashfalse%
10765 \l@d@twolinestrue%
10766 \l@d@elinfalse%
10767 \l@d@eslfalse%
10768 \ifcsempty{Xendmorethantwolines@\@currentseries}%
10769 {}%
10770 {\ifistwofollowinglines@\else%
10771 \l@d@morethantwolinestrue%
10772 \fi%
10773 }%
10774 }%
10775 }%
10776 \fi%
10777 % \end{macrocode}
10778 % End of \cs{setprintendlines}.
10779 % \begin{macrocode}
10780 }%
10781 % \end{macrocode}
10782 % \end{macro}
10783 %
10784 % \begin{macro}{\printendlines}
10785 % Now we're ready to print it all.
10786 % \changes{v0.3.0}{2004/02/14}{Added \cs{linenumr@p} and \cs{sublinenumr@p}
10787 % to \cs{printendlines}}
10788 % \begin{macrocode}
10789 \def\printendlines#1|#2|#3|#4|#5|#6|#7|{\begingroup
10790 \setprintendlines{#1}{#2}{#3}{#4}{#5}{#6}%
10791 % \end{macrocode}
10792 % The only subtlety left here is when to print a period between
10793 % numbers. But the only instance in which this is tricky is for the
10794 % ending sub-line number: it could be coming after the starting
10795 % sub-line number (in which case we want only the dash) or after an
10796 % ending line number (in which case we need to insert a period).
10797 %
10798 % So, first, print the start lines.
10799 % \begin{macrocode}
10800 \ifdimequal{\csuse{boxXendstartlinenum@\@currentseries}}{0pt}%
10801 {\bgroup}%
10802 {\leavevmode\hbox to \csuse{boxXendstartlinenum@\@currentseries}\bgroup\hfill}%
10803 \printnpnum{#1}%
10804 \ifoldprintnpnumspace@\space\fi%
10805 \linenumrep{#2}%
10806 \ifl@d@ssub \fullstop \sublinenumrep{#3}\fi
10807 \egroup%
10808 % \end{macrocode}
10809 % And now, print the dash + the end line number, or the line number range symbol.
10810 % \begin{macrocode}
10811 \ifdimequal{\csuse{boxXendendlinenum@\@currentseries}}{0pt}%
10812 {\bgroup}%
10813 {\hbox to \csuse{boxXendendlinenum@\@currentseries}\bgroup}%
10814 \ifl@d@twolines%
10815 \ifl@d@morethantwolines%
10816 \csuse{Xendmorethantwolines@\@currentseries}%
10817 \else%
10818 \csuse{Xendtwolines@\@currentseries}%
10819 \fi%
10820 \else%
10821 \ifl@d@dash \endashchar\fi%
10822 \ifl@d@pnum \printnpnum{#4}\fi%
10823 \ifl@d@elin \linenumrep{#5}\fi%
10824 \ifl@d@esl \ifl@d@elin \fullstop\fi \sublinenumrep{#6}\fi%
10825 \fi%
10826 \ifdimequal{\csuse{boxXendendlinenum@\@currentseries}}{0pt}%
10827 {}%
10828 {\hfill}%Prevent underfull hbox
10829 \egroup%
10830 \endgroup%
10831 }%
10832
10833 % \end{macrocode}
10834 % \end{macro}
10835 %
10836 % \begin{macro}{\printnpnum}
10837 % A macro to print a page number in an endnote.
10838 % \begin{macrocode}
10839 \newcommand*{\printnpnum}[1]{p.#1) }
10840
10841 % \end{macrocode}
10842 % \end{macro}
10843 %
10844 %
10845 % \begin{macro}{\doendnotes}
10846 % \begin{macro}{\ifXendinsertsep@}
10847 % \cs{doendnotes} is
10848 % the command you use to print one series of endnotes; it
10849 % takes one argument: the series letter of the note series you want
10850 % to print.
10851 % \cs{Xendinsertsep@} is set to true at the first note of the series, and to false at the last one.
10852 % \begin{macrocode}
10853 \newif\ifXendinsertsep@%
10854 \newcommand*{\doendnotes}[1]{\l@dend@close
10855 \begingroup
10856 \makeatletter
10857 \expandafter\let\csname #1end\endcsname=\endprint
10858 \input\jobname.end
10859 \global\Xendinsertsep@false%
10860 \endgroup}
10861 % \end{macrocode}
10862 % \end{macro}
10863 % \end{macro}
10864 % \begin{macro}{\doendnotesbysection}
10865 % \cs{doendnotesbysection} is a variant of the previous macro.
10866 % While \cs{doendnotes} print endnotes for all of numbered sections
10867 % \cs{doendnotesbysection} print the endnotes for the first numbered section at its first call for a series, then for the second section at its second call for the same series, then for the third section at its third call for the same series, and so on.
10868 % \begin{macrocode}
10869 \newcommand*{\doendnotesbysection}[1]{%
10870 \l@dend@close%
10871 \global\expandafter\advance\csname #1end@bysection\endcsname by 1%
10872 \begingroup%
10873 \makeatletter%
10874 \def\l@d@section##1{%
10875 \ifnumequal{##1}{\csname #1end@bysection\endcsname}%
10876 {\cslet{#1end}{\endprint}}%
10877 {\cslet{#1end}{\@gobblefive}}%
10878 }%
10879 \input\jobname.end%
10880 \global\Xendinsertsep@false%
10881 \endgroup%
10882 }%
10883 % \end{macrocode}
10884 % \end{macro}
10885 % \begin{macro}{\noendnotes}
10886 % \changes{v1.21.0}{2015/04/13}{\cs{noendnotes} deprecated, prefer noend option.}
10887 % The \cs{noendnotes} command is deprecated.
10888 % You should prefer \verb+noend+ options.
10889 % \begin{macrocode}
10890 \newcommand*{\noendnotes}{%
10891 \led@war@noendnotesDeprecated%
10892 \global\let\l@dend@stuff=\relax%
10893 \global\chardef\l@d@end=16%
10894 }%
10895 % \end{macrocode}
10896 % \end{macro}
10897 % End of section for end notes
10898 % \begin{macrocode}
10899 }%
10900 % \end{macrocode}
10901 % \section{Generate series}%
10902 % In this section, X means the name of the series (A, B etc.)
10903 % \begin{macro}{\series}
10904 % \cs{series}\cs{series} creates one more newseries. It's the public command, which just loops on the private command \cs{newseries@}.
10905 % \begin{macrocode}
10906 \newcommand{\newseries}[1]{%
10907 \def\do##1{\newseries@{##1}}%
10908 \docsvlist{#1}
10909 }
10910 % \end{macrocode}
10911 % \end{macro}
10912 % \begin{macro}{\@series}
10913 % The \cs{series@} macro is an etoolbox list, which contains the name of all series.
10914 % \begin{macrocode}
10915 \newcommand{\@series}{}
10916 % \end{macrocode}
10917 % \end{macro}
10918 % The command \cs{newseries@}\cs{series} creates a new series of the footnote.
10919 % \begin{macro}{\newseries@}
10920 % \begin{macrocode}
10921 \newcommand{\newseries@}[1]{
10922 % \end{macrocode}
10923 % \subsection{Test if series is still existing}
10924 % \begin{macrocode}
10925 \xifinlist{#1}{\@series}{\led@warn@SeriesStillExist{#1}}%
10926 {%
10927 % \end{macrocode}
10928 % \subsection{Init specific to \Lpack{eledpar}}
10929 % When calling \cs{newseries@} after having loaded \Lpack{eledpar}
10930 % \begin{macrocode}
10931 \ifdefined\newseries@eledpar%
10932 \newseries@eledpar{#1}%
10933 \fi%
10934 % \end{macrocode}
10935 % \subsection{For critical footnotes}
10936 % Critical footnotes are those which start with letters.
10937 % We look for the \cs{nocritical} option of \Eledmac{}.
10938 % \begin{macrocode}
10939 \unless\ifnocritical@
10940 % \end{macrocode}
10941 % \subsubsection{Options}
10942 % \begin{macrocode}
10943 \newtoggle{Xparindent@#1}
10944 \newtoggle{Xlemmadisablefontselection@#1}
10945 \csgdef{Xhangindent@#1}{0pt}%
10946 \csgdef{Xragged@#1}{}%
10947 \csgdef{hsizetwocol@#1}{0.45 \hsize}%
10948 \csgdef{hsizethreecol@#1}{.3 \hsize}%
10949 \csgdef{Xcolalign@#1}{\raggedright}%
10950 \csgdef{Xnotenumfont@#1}{\notenumfont}%
10951 \csgdef{Xnotefontsize@#1}{\notefontsetup}%
10952 \csgdef{bhookXnote@#1}{}%
10953
10954 \csgdef{boxlinenum@#1}{0pt}%
10955 \csgdef{boxlinenumalign@#1}{L}%
10956
10957 \csgdef{boxstartlinenum@#1}{0pt}%
10958 \csgdef{boxendlinenum@#1}{0pt}%
10959
10960 \csgdef{boxsymlinenum@#1}{0pt}%
10961 \newtoggle{numberonlyfirstinline@#1}%
10962 \newtoggle{numberonlyfirstintwolines@#1}%
10963 \csgdef{twolines@#1}{}%
10964 \csgdef{morethantwolines@#1}{}%
10965 \newtoggle{twolinesbutnotmore@#1}%
10966 \newtoggle{twolinesonlyinsamepage@#1}%
10967 \newtoggle{onlypstartinfootnote@#1}%
10968 \newtoggle{pstartinfootnoteeverytime@#1}%
10969 \newtoggle{pstartinfootnote@#1}%
10970 \csgdef{symlinenum@#1}{\symplinenum}%
10971 \newtoggle{nonumberinfootnote@#1}%
10972 \csgdef{beforenumberinfootnote@#1}{0pt}%
10973 \csgdef{afternumberinfootnote@#1}{0.5em}%
10974 \newtoggle{nonbreakableafternumber@#1}%
10975 \csgdef{beforesymlinenum@#1}{\csuse{beforenumberinfootnote@#1}}%
10976 \csgdef{aftersymlinenum@#1}{\csuse{afternumberinfootnote@#1}}%
10977 \csgdef{inplaceofnumber@#1}{1em}%
10978 \global\cslet{lemmaseparator@#1}{\rbracket}%
10979 \csgdef{beforelemmaseparator@#1}{0em}%
10980 \csgdef{afterlemmaseparator@#1}{0.5em}%
10981 \csgdef{inplaceoflemmaseparator@#1}{1em}%
10982 \csgdef{beforeXnotes@#1}{1.2em \@plus .6em \@minus .6em}
10983 \csgdef{afterXrule@#1}{0pt}
10984 \csgdef{txtbeforeXnotes@#1}{}
10985 \csgdef{maxhXnotes@#1}{\ledfootinsdim}
10986 \newtoggle{Xnoteswidthliketwocolumns@#1}%
10987 % \end{macrocode}
10988 % \subsubsection{Create inserts, needed to add notes in foot}
10989 % As regards inserts, see chapter 15 of the TeXBook by D. Knuth.
10990 % \begin{macrocode}
10991 \expandafter\newinsert\csname #1footins\endcsname%
10992 \unless\ifnoledgroup@%
10993 \expandafter\newinsert\csname mp#1footins\endcsname%
10994 \fi%
10995 % \end{macrocode}
10996 % \subsubsection{Create commands for critical apparatus, \cs{Afootnote}, \cs{Bfootnote} etc.}
10997 % Note the double \# in command: it's because command is made inside another command.
10998 % \changes{v1.4.0}{2012/11/16}{Remembers the language of the lemma, in order to create a correct direction for the footnote separator.}
10999 % \changes{v1.23.0}{2015/04/29}{Prevent spurious spaces when \cs{Afootnote} and similar commands are followed by spaces (bug added on 1.0.0!).}
11000 % \begin{macrocode}
11001 \global\notbool{parapparatus@}{\expandafter\newcommand\expandafter *}{\expandafter\newcommand}\csname #1footnote\endcsname[2][]{%
11002 \ifnum\@edtext@level>0%
11003 \begingroup%
11004 \newcommand{\content}{##2}%
11005 \ifnumberedpar@%
11006 \ifledRcol%
11007 \ifluatex%
11008 \footnotelang@lua[R]%
11009 \fi%
11010 \@ifundefined{xpg@main@language}%if polyglossia
11011 {}%
11012 {\footnotelang@poly[R]}%
11013 \footnoteoptions@[R]{##1}{true}%
11014 \xright@appenditem{%
11015 \noexpand\prepare@preXnotes{#1}%
11016 \noexpand\prepare@edindex@fornote{\l@d@nums}%
11017 \unexpanded{\def\sw@list@inedtext}{\expandafter\unexpanded\expandafter{\sw@inthisedtext}}%The value of the \sw@inthisedtext of current edtext will be pushed to \sw@list@inedtext when the notes are expanded.
11018 \noexpand\csuse{v#1footnote}{#1}%
11019 {{\l@d@nums}{\expandonce\@tag}{\expandonce\content}}%
11020 }\to\inserts@listR
11021 \footnoteoptions@[R]{##1}{false}%
11022 \global\advance\insert@countR \@ne%
11023 \else%
11024 \ifluatex%
11025 \footnotelang@lua%
11026 \fi%
11027 \@ifundefined{xpg@main@language}%if polyglossia
11028 {}%
11029 {\footnotelang@poly}%
11030 \footnoteoptions@{##1}{true}%
11031 \xright@appenditem{%
11032 \noexpand\prepare@preXnotes{#1}%
11033 \noexpand\prepare@edindex@fornote{\l@d@nums}%
11034 \unexpanded{\def\sw@list@inedtext}{\expandafter\unexpanded\expandafter{\sw@inthisedtext}}%The value of the \sw@inthisedtext of current edtext will be pushed to \sw@list@inedtext when the notes are expanded.
11035 \noexpand\csuse{v#1footnote}{#1}%
11036 {{\l@d@nums}{\expandonce\@tag}{\expandonce\content}}%
11037 }\to\inserts@list
11038 \global\advance\insert@count \@ne%
11039 \footnoteoptions@{##1}{false}%
11040 \fi
11041 \else
11042 \csuse{v#1footnote}{#1}{{0|0|0|0|0|0|0}{}{##1}}%
11043 \fi%
11044 \endgroup%
11045 \else%
11046 \led@err@FootnoteWithoutEdtext%
11047 \fi%
11048 \ignorespaces%
11049 }
11050 % \end{macrocode}
11051 % We need to be able to modify \Eledmac's footnote macros and restore their
11052 % \begin{macrocode}
11053 \global\csletcs{#1@@footnote}{#1footnote}
11054 % \end{macrocode}
11055 % \subsubsection{Set standard display}
11056 % \begin{macrocode}
11057 \footnormal{#1}
11058 % \end{macrocode}
11059 % End of for critical footnotes.
11060 % \begin{macrocode}
11061 \fi
11062 % \end{macrocode}
11063 % \subsection{For familiar footnotes}
11064 % Familiar footnotes are those which end with letters.
11065 % We look for the \cs{nofamiliar} option of \Eledmac{}.
11066 % \begin{macrocode}
11067 \unless\ifnofamiliar@
11068 % \end{macrocode}
11069 % \subsubsection{Options}
11070 % \begin{macrocode}
11071 \newtoggle{parindentX@#1}
11072 \csgdef{hangindentX@#1}{0pt}%
11073 \csgdef{raggedX@#1}{}%
11074 \csgdef{hsizetwocolX@#1}{0.45 \hsize}%
11075 \csgdef{hsizethreecolX@#1}{.3 \hsize}%
11076 \csgdef{colalignX@#1}{\raggedright}%
11077 \csgdef{notenumfontX@#1}{\notenumfont}%
11078 \csgdef{notefontsizeX@#1}{\notefontsetup}%
11079 \csgdef{bhooknoteX@#1}{}%
11080 \csgdef{afterruleX@#1}{0pt}
11081 \csgdef{beforenotesX@#1}{1.2em \@plus .6em \@minus .6em}
11082 \csgdef{maxhnotesX@#1}{\ledfootinsdim}%
11083 \newtoggle{notesXwidthliketwocolumns@#1}%
11084 % End of for familiar footnotes.
11085 % \subsubsection{Create inserts, needed to add notes in foot}
11086 % As regards inserts, see chapter 15 of the TeXBook by D. Knuth.
11087 % \begin{macrocode}
11088 \expandafter\newinsert\csname footins#1\endcsname%
11089 \unless\ifnoledgroup@%
11090 \expandafter\newinsert\csname mpfootins#1\endcsname%
11091 \fi%
11092 % \end{macrocode}
11093 %\subsubsection{Create tools for familiar footnotes (\cs{footnoteX})}
11094 % First, create the \cs{footnoteX} command.
11095 % Note the double \# in command: it is because a command is called inside another command.
11096 % \begin{macrocode}
11097
11098 \global\expandafter\newcommand\csname footnote#1\endcsname[1]{%
11099 \begingroup%
11100 \prepare@prenotesX{#1}%
11101 \newcommand{\content}{##1}%
11102 \stepcounter{footnote#1}%
11103 \protected@csxdef{@thefnmark#1}{\csuse{thefootnote#1}}%
11104 \nottoggle{nomk@}%Nomk is set to true when using \footnoteXnomk with eledpar
11105 {\csuse{@footnotemark#1}}%
11106 {}%
11107 \ifluatex%
11108 \xdef\footnote@luatextextdir{\the\textdir}%
11109 \xdef\footnote@luatexpardir{\the\pardir}%
11110 \fi%
11111 \csuse{vfootnote#1}{#1}{\expandonce\content}\m@mmf@prepare%
11112 \endgroup%
11113 }
11114 % \end{macrocode}
11115 % Then define the counters.
11116 % \begin{macrocode}
11117 \newcounter{footnote#1}
11118 \global\expandafter\renewcommand\csname thefootnote#1\endcsname{\arabic{footnote#1}}
11119 % \end{macrocode}
11120 % Don't forget to initialize series
11121 % \begin{macrocode}
11122 \footnormalX{#1}
11123 \fi
11124 % \end{macrocode}
11125 % \subsection{Common options to critical and familiar footnotes}
11126 % For historical reasons, \verb+parafootsep+ and \verb+afternote+ hooks are common to critical and familiar footnotes.
11127 % \begin{macrocode}
11128 \csgdef{parafootsep@#1}{\parafootftmsep}%
11129 \csgdef{afternote@#1}{1em plus.4em minus.4em}%
11130 % \end{macrocode}
11131 % \subsection{The endnotes}
11132 % Endnotes are commands like \cs{Xendnote}, where X is a series letter.
11133 % First, we check for the \verb+noend+ options.
11134 % \begin{macrocode}
11135 \unless\ifnoend@
11136 % \end{macrocode}
11137 % \subsubsection{The main macro}
11138 % The \cs{Xendnote} macro functions to
11139 % write one endnote to the \file{.end} file. We change
11140 % \cs{newlinechar} so that in the file every space becomes the
11141 % start of a new line; this generally ensures that a long note doesn't
11142 % exceed restrictions on the length of lines in files.
11143 % \begin{macrocode}
11144
11145 \global\expandafter\newcommandx\csname #1endnote\endcsname[2][1,usedefault]{%
11146 \bgroup%
11147 \newlinechar='40%
11148 \global\@noneed@Footnotetrue%
11149 \newcommand{\content}{##2}%
11150 \immediate\write\l@d@end{%
11151 \expandafter\string\csname #1end\endcsname%
11152 {\ifnumberedpar@\l@d@nums\fi}%
11153 {\ifnumberedpar@\expandonce\@tag\fi}%
11154 {\expandonce\content}%
11155 {#1}%
11156 {##1}%
11157 \@percentchar%
11158 }%
11159 \egroup%
11160 \ignorespaces%
11161 }%
11162 % \end{macrocode}
11163 % \cs{Xendnote} commands called \cs{Xend} commands on to the endnote file; these are analogous to the various
11164 % \verb"footfmt" commands above, and they take the same arguments.
11165 % When we process this file, we want to pick out the notes of one
11166 % series and ignore all the rest. To do that, we equate the \verb"end"
11167 % command for the series we want to \cs{endprint}, and leave the
11168 % rest equated to \cs{@gobblefive}, which just skips over its five
11169 % arguments.
11170 % \begin{macrocode}
11171
11172 \global\cslet{#1end}{\@gobblefive}
11173 % \end{macrocode}
11174 % We need to store the number of times \cs{doendnotesbysection} is called for one series.
11175 % \begin{macrocode}
11176 \global\expandafter\newcount\csname #1end@bysection\endcsname%
11177 % \end{macrocode}
11178 % \subsubsection{The options}
11179 % \begin{macrocode}
11180 \csgdef{Xendtwolines@#1}{}%
11181 \csgdef{Xendmorethantwolines@#1}{}%
11182 \newtoggle{Xendtwolinesbutnotmore@#1}{}%
11183 \newtoggle{Xendtwolinesonlyinsamepage@#1}{}%
11184 \newtoggle{Xendlemmadisablefontselection@#1}%
11185 \csgdef{Xendnotenumfont@#1}{\notenumfont}%
11186 \csgdef{Xendnotefontsize@#1}{\notefontsetup}%
11187 \csgdef{bhookXendnote@#1}{}%
11188
11189 \csgdef{boxXendlinenum@#1}{0pt}%
11190 \csgdef{boxXendlinenumalign@#1}{L}%
11191
11192 \csgdef{boxXendstartlinenum@#1}{0pt}%
11193 \csgdef{boxXendendlinenum@#1}{0pt}%
11194
11195 \csgdef{Xendlemmaseparator@#1}{}%
11196 \csgdef{Xendbeforelemmaseparator@#1}{0em}%
11197 \csgdef{Xendafterlemmaseparator@#1}{0.5em}%
11198 \csgdef{Xendinplaceoflemmaseparator@#1}{0.5em}%
11199
11200 \newtoggle{Xendparagraph@#1}%
11201 \csgdef{Xendafternote@#1}{1em plus.4em minus.4em}%
11202 \csgdef{Xendsep@#1}{}%
11203 % \end{macrocode}
11204 % End of endnotes declaration
11205 % \begin{macrocode}
11206 \fi%
11207 % \end{macrocode}
11208 % Dump series in \cs{@series}
11209 % \begin{macrocode}
11210 \listxadd{\@series}{#1}
11211 }
11212 }% End of \newseries
11213 % \end{macrocode}
11214 % \end{macro}
11215 % \subsection{Init standards series (A,B,C,D,E,Z)}
11216 % \begin{macrocode}
11217 \expandafter\newseries\expandafter{\default@series}
11218 % \end{macrocode}
11219 % \section{Display}
11220 % \subsection{Change series order}
11221 % \changes{v1.1.0}{2012/09/25}{New tools to change order of series}
11222 % \changes{v1.21.0}{2015/04/13}{\cs{seriesatbegin} and \cs{seriesatbegin} more efficient}
11223 % \begin{macro}{\seriesatbegin}
11224 % \cs{seriesatbegin}\marg{s} changes the order of series, to put the series \meta{s} at the beginning of the list.
11225 % The series can be the result of a command.
11226 % \begin{macrocode}
11227 \newcommand{\seriesatbegin}[1]{%
11228 \StrDel{\@series}{#1}[\@series]%
11229 \edef\@new{}%
11230 \listeadd{\@new}{#1}%
11231 \listeadd{\@new}{\@series}%
11232 \xdef\@series{\@new}%
11233 }
11234 % \end{macrocode}
11235 % \end{macro}
11236 % \begin{macro}{\seriesatend}
11237 % \changes{v1.21.0}{2015/04/13}{Fix spurious space in \cs{seriesatend}}
11238 % And \cs{seriesatend} moves the series to the end of the list.
11239 % \begin{macrocode}
11240 \newcommand{\seriesatend}[1]{%
11241 \StrDel{\@series}{#1}[\@series]%
11242 \edef\@new{}%
11243 \listeadd{\@new}{\@series}%
11244 \listeadd{\@new}{#1}%
11245 \xdef\@series{\@new}%
11246 }
11247 % \end{macrocode}
11248 % \end{macro}
11249 % \subsection{Test series order}
11250 % \begin{macro}{\ifseriesbefore}
11251 % \cs{ifseriesbefore}\marg{seriesA}\marg{seriesB}\marg{true}\marg{false} expands \verb+<true>+ if \verb+<seriesA+> is printed before \verb+<seriesB>+, expands \verb+<false>+ otherwise.
11252 % \begin{macrocode}
11253 \newcommand{\ifseriesbefore}[4]{%
11254 \StrPosition{\@series}{#1}[\@first]%
11255 \StrPosition{\@series}{#2}[\@second]%
11256 \ifnumgreater{\@second}{\@first}{#3}{#4}%
11257 }
11258 % \end{macrocode}
11259 % \end{macro}
11260 % \changes{v1.0.0}{2012/09/15}{New generic commands to customize footnote display.}
11261 % \subsection{Options}
11262 % \subsubsection{Tools to set options}
11263 % \begin{macro}{\settoggle@series}
11264 % \changes{v1.1.0}{2012/09/25}{\cs{settoggle@series} switch the global value of the toggle, not only the local value.}
11265 % \changes{v1.13.0}{2014/09/16}{\cs{settoggle@series} can take an optional arguments to reload series setup.}
11266 % \cs{settoggle@series}\marg{series}\marg{toggle}\marg{value} is a generic command to switch toggles for some series.
11267 % The arguments are:
11268 % \begin{itemize}
11269 % \item \verb+#1+ (mandatory): the series for which the hooks should be set. If empty, all the series will be affected.
11270 % \item \verb+#2+ (mandatory): the name of the hook.
11271 % \item \verb+#3+ (mandatory): the new value of toggle (true or false).
11272 % \item \verb+#4+ (optional): if equal to \verb+reload+, reload the footnote setting (call \cs{footnormal} or \cs{footparagraph} or \ldots\ depending of the footnote display).
11273 % \item \verb+#5+ (optional): if not empty, and if \verb+#1+ is empty, change the hook setting for pseudo-series, as \verb+appref+.
11274 % \end{itemize}
11275 % \begin{macrocode}
11276 \newcommandx{\settoggle@series}[5][4,5,usedefault]{%
11277 \def\do##1{%
11278 \global\settoggle{#2@##1}{#3}%
11279 \ifstrequal{#4}{reload}%
11280 {%
11281 \csuse{foot\csuse{series@display##1}}{##1}%
11282 \csuse{foot\csuse{series@displayX##1}}{##1}%
11283 }%
11284 {}%
11285 }%
11286 \ifstrempty{#1}{%
11287 \dolistloop{\@series}%
11288 \ifstrempty{#5}{}{%
11289 \docsvlist{#5}%
11290 }
11291 }%
11292 {%
11293 \docsvlist{#1}%
11294 }%
11295 }
11296 % \end{macrocode}
11297 % \end{macro}
11298 % \begin{macro}{\setcommand@series}
11299 % \cs{setcommand@series}\marg{series}\marg{command}\marg{value} is a generic command to change hooks into form of commands for some series.
11300 % The arguments are:
11301 % \begin{itemize}
11302 % \item \verb+#1+ (mandatory): the series for which the hooks should be set. If empty, all the series will be affected.
11303 % \item \verb+#2+ (mandatory): the name of the hook.
11304 % \item \verb+#3+ (mandatory): the new value of the hook/command.
11305 % \item \verb+#4+ (optional): if equal to \verb+reload+, reload the footnote setting (call \cs{footnormal} or \cs{footparagraph} or \ldots\ depending of the footnote display).
11306 % \item \verb+#5+ (optional): if not empty, and if \verb+#1+ is empty, change the hook setting for pseudo-series, as \verb+appref+.
11307 % \end{itemize}
11308 % \begin{macrocode}
11309 \newcommandx{\setcommand@series}[5][4,5,usedefault]{%
11310 \def\do##1{
11311 \csgdef{#2@##1}{#3}
11312 \ifstrequal{#4}{reload}{
11313 \csuse{foot\csuse{series@display##1}}{##1}
11314 \csuse{foot\csuse{series@displayX##1}}{##1}
11315 }{}}
11316 \ifstrempty{#1}{%
11317 \dolistloop{\@series}%
11318 \ifstrempty{#5}{}{%
11319 \docsvlist{#5}
11320 }
11321 }%
11322 {%
11323 \docsvlist{#1}%
11324 }%
11325 }%
11326 % \end{macrocode}
11327 % \end{macro}
11328 % \subsubsection{Tools to generate options commands}
11329 % \begin{macro}{\newhookcommand@series}
11330 % \cs{newhookcommand@series}\cs{command names} is a generic command to add new commands for hooks, like \cs{hsizetwocol}.
11331 % The first argument is the name of the hook, the second a comma separated list of pseudo-series where the hook can be used, like \verb+appref+ in the case of \cs{twolines}.
11332 % The second argument is also used to create commands named \cs{<hookname><pseudoseries>},
11333 % like \cs{twolinesappref}.
11334 % \changes{v1.21.0}{2015/04/13}{\cs{newhookcommand@series} can take an optional argument.}
11335 % \begin{macrocode}
11336 \newcommandx{\newhookcommand@series}[2][2,usedefault]{%
11337 \global\expandafter\newcommand\expandafter*\csname #1\endcsname[2][]{%
11338 \setcommand@series{##1}{#1}{##2}[][#2]%
11339 }%
11340 \ifstrempty{#2}{}{%
11341 \def\do##1{%
11342 \global\expandafter\newcommand\expandafter*\csname #1##1\endcsname[1]{%
11343 \csuse{#1}[##1]{####1}%
11344 }%
11345 }%
11346 \docsvlist{#2}%
11347 }%
11348 }
11349 % \end{macrocode}
11350 % \end{macro}
11351 % \begin{macro}{\newhooktoggle@series}
11352 %\cs{newhooktoggle@series}\cs{command names} is a generic command to add new commands for a new toggle hook, like \cs{numberonlyfirstinline}.
11353 % The second argument is also used to create commands named \cs{<hookname><pseudoseries>},
11354 % like \cs{twolinesbutnotmoreappref}.
11355 % \changes{v1.21.0}{2015/04/13}{\cs{newhooktoggle@series} can take an optional argument.}
11356 % \begin{macrocode}
11357 \newcommandx{\newhooktoggle@series}[2][2,usedefault]{%
11358 \global\expandafter\newcommandx\expandafter*\csname #1\endcsname[2][1,2={true},usedefault]{%
11359 \settoggle@series{##1}{#1}{##2}[][#2]%
11360 }%
11361 \ifstrempty{#2}{}{%
11362 \def\do##1{%
11363 \global\expandafter\newcommand\expandafter*\csname #1##1\endcsname{%
11364 \csuse{#1}[##1]%
11365 }%
11366 }%
11367 \docsvlist{#2}%
11368 }%
11369 }
11370 % \end{macrocode}
11371 % \end{macro}
11372 % \begin{macro}{\newhooktoggle@series}
11373 % \changes{v1.13.0}{2014/09/16}{Add \cs{newhookcommand@toggle@reload}}
11374 % \cs{newhookcommand@toggle@reload} does the same thing as \cs{newhooktoggle@series}
11375 % but the commands created by this macro also reload the series which is displayed (normal, paragraph, twocol, threecol).
11376 % \begin{macrocode}
11377 \newcommand{\newhooktoggle@series@reload}[1]{%
11378 \global\expandafter\newcommandx\expandafter*\csname #1\endcsname[2][1,2={true},usedefault]{%
11379 \settoggle@series{##1}{#1}{##2}[reload]%
11380 }%
11381 }%
11382 % \end{macrocode}
11383 % \end{macro}
11384 % \begin{macro}{\newhookcommand@series@reload}
11385 % \changes{v1.8.0}{2013/11/24}{Debug \cs{beforenotesX} and \cs{maxhnotesX} which didn't work.}
11386 % \changes{v1.12.0}{2014/08/05}{Debug \cs{beforenotesX} and \cs{maxhnotesX} which didn't work when called after \cs{footparagraphX}.}
11387 % \changes{v1.12.0}{2014/08/05}{Debug \cs{beforeXnotes} and \cs{maxhXnotes} which didn't work when called after \cs{footparagraph}.}
11388 % \cs{newhookcommand@series@reload} does the same thing as \cs{newhookcommand@series}
11389 % but the commands created by this macro also reload the series which is displayed (normal, paragraph, twocol, threecol).
11390 % \begin{macrocode}
11391 \newcommand{\newhookcommand@series@reload}[1]{%
11392 \global\expandafter\newcommand\expandafter*\csname #1\endcsname[2][]{%
11393 \setcommand@series{##1}{#1}{##2}[reload]%
11394 }%
11395 }
11396 % \end{macrocode}
11397 % \end{macro}
11398 % \subsubsection{Options for critical notes}
11399 % Before generating the commands that are used to set the critical notes, such as \verb+\numberonlyfirstinline+, \verb+\lemmaseparator+ and the like, we check the \verb+nocritical+ option.
11400 % \begin{macrocode}
11401 \unless\ifnocritical@
11402 \newhooktoggle@series{Xparindent}
11403 \newhookcommand@series{twolines}[appref]
11404 \newhookcommand@series{morethantwolines}[appref]
11405 \newhooktoggle@series{twolinesbutnotmore}[appref]
11406 \newhooktoggle@series{twolinesonlyinsamepage}[appref]
11407 \newhookcommand@series{Xhangindent}
11408 \newhookcommand@series{Xragged}
11409 \newhookcommand@series{hsizetwocol}
11410 \newhookcommand@series{hsizethreecol}
11411 \newhookcommand@series{Xcolalign}%
11412 \newhookcommand@series{Xnotenumfont}
11413 \newhookcommand@series{bhookXnote}
11414 \newhookcommand@series{boxsymlinenum}%
11415 \newhookcommand@series{symlinenum}
11416 \newhookcommand@series{beforenumberinfootnote}
11417 \newhookcommand@series{afternumberinfootnote}
11418 \newhookcommand@series{beforesymlinenum}
11419 \newhookcommand@series{aftersymlinenum}
11420 \newhookcommand@series{inplaceofnumber}
11421 \newhookcommand@series{lemmaseparator}
11422 \newhookcommand@series{beforelemmaseparator}
11423 \newhookcommand@series{afterlemmaseparator}
11424 \newhookcommand@series{inplaceoflemmaseparator}
11425 \newhookcommand@series{txtbeforeXnotes}
11426 \newhookcommand@series@reload{afterXrule}
11427 \newhooktoggle@series{numberonlyfirstinline}
11428 \newhooktoggle@series{numberonlyfirstintwolines}
11429 \newhooktoggle@series{nonumberinfootnote}
11430 \newhooktoggle@series{pstartinfootnote}
11431 \newhooktoggle@series{pstartinfootnoteeverytime}%
11432 \newhooktoggle@series{onlypstartinfootnote}
11433 \newhooktoggle@series{nonbreakableafternumber}
11434 \newhooktoggle@series{Xlemmadisablefontselection}
11435 \newhookcommand@series@reload{maxhXnotes}
11436 \newhookcommand@series@reload{beforeXnotes}
11437 \newhooktoggle@series@reload{Xnoteswidthliketwocolumns}%
11438 \newhookcommand@series{Xnotefontsize}
11439
11440 \newhookcommand@series{boxlinenum}%
11441 \newhookcommand@series{boxlinenumalign}%
11442
11443 \newhookcommand@series{boxstartlinenum}%
11444 \newhookcommand@series{boxendlinenum}%
11445
11446 \fi
11447 % \end{macrocode}
11448 % \subsubsection{Options for familiar notes}
11449 % Before generating the optional commands for familiar notes, we check the \verb+nofamiliar+ option.
11450 % \begin{macrocode}
11451 \unless\ifnofamiliar@
11452 \newhooktoggle@series{parindentX}
11453 \newhookcommand@series{hangindentX}
11454 \newhookcommand@series{raggedX}
11455 \newhookcommand@series{hsizetwocolX}
11456 \newhookcommand@series{hsizethreecolX}
11457 \newhookcommand@series{colalignX}%
11458 \newhookcommand@series{notenumfontX}
11459 \newhookcommand@series{bhooknoteX}
11460 \newhookcommand@series@reload{beforenotesX}
11461 \newhookcommand@series@reload{maxhnotesX}
11462 \newhooktoggle@series@reload{notesXwidthliketwocolumns}%
11463 \newhookcommand@series@reload{afterruleX}
11464 \newhookcommand@series{notefontsizeX}
11465 \fi
11466 % \end{macrocode}
11467 % \subsubsection{Common options to critical and familiar footnotes}
11468 % For historical reasons, \verb+parafootsep+ and \verb+afternote+ hooks are common to critical and familiar footnotes.
11469 % \begin{macrocode}
11470 \newhookcommand@series{parafootsep}
11471 \newhookcommand@series{afternote}
11472 % \end{macrocode}
11473 % \subsubsection{Options for endnotes}
11474 % Before generating the commands that are used to set the endnotes, such as \verb+\numberonlyfirstinline+, \verb+\lemmaseparator+ and the like, we check the \verb+noend+ option.
11475 % \begin{macrocode}
11476 \unless\ifnoend@
11477 \newhookcommand@series{Xendtwolines}[apprefwithpage]
11478 \newhookcommand@series{Xendmorethantwolines}[apprefwithpage]
11479 \newhooktoggle@series{Xendtwolinesbutnotmore}[apprefwithpage]
11480 \newhooktoggle@series{Xendtwolinesonlyinsamepage}[apprefwithpage]
11481 \newhookcommand@series{Xendnotenumfont}
11482 \newhookcommand@series{bhookXendnote}
11483
11484 \newhookcommand@series{boxXendlinenum}%
11485 \newhookcommand@series{boxXendlinenumalign}%
11486
11487 \newhookcommand@series{boxXendstartlinenum}%
11488 \newhookcommand@series{boxXendendlinenum}%
11489
11490 \newhookcommand@series{Xendnotefontsize}
11491 \newhooktoggle@series{Xendlemmadisablefontselection}
11492 \newhookcommand@series{Xendlemmaseparator}
11493 \newhookcommand@series{Xendbeforelemmaseparator}
11494 \newhookcommand@series{Xendafterlemmaseparator}
11495 \newhookcommand@series{Xendinplaceoflemmaseparator}
11496
11497 \newhooktoggle@series{Xendparagraph}
11498 \newhookcommand@series{Xendafternote}
11499 \newhookcommand@series{Xendsep}
11500 \fi
11501 % \end{macrocode}
11502 % \subsection{Old commands, kept for backward compatibility}
11503 % The next commands are kept for backward compatibility, but should not be used anymore.
11504 % \begin{macro}{\notenumfont}
11505 % \begin{macro}{\notefontsetup}
11506 % \begin{macro}{\ifledplinenum}
11507 % \begin{macro}{\symplinenum}
11508 % \begin{macrocode}
11509 \newcommand*{\notenumfont}{\normalfont}
11510 \newcommand*{\notefontsetup}{\footnotesize}
11511 \newif\ifledplinenum
11512 \ledplinenumtrue
11513 \newcommand*{\symplinenum}{}
11514 % \end{macrocode}
11515 % \end{macro}
11516 % \end{macro}
11517 % \end{macro}
11518 % \end{macro}
11519 % \begin{macro}{\textbardbl}
11520 % \changes{v1.22.1}{2015/04/29}{Robustify \cs{textbardbl}}
11521 % We need to robustify \cs{textbardbl} in order to allow it use in \cs{IfStrEq} when using as \cs{symlinenum}.
11522 % \begin{macrocode}
11523 % \robustify{\textbardbl}
11524 % \end{macrocode}
11525 % \end{macro}
11526 % \subsection{Hooks for a particular footnote}
11527 % \begin{macro}{\fulllines@}
11528 %\cs{fulllines@} toggle is used to print the fulllines references, and not the abbreviated form defined by \cs{twolines} and \cs{morethantwolines}.
11529 % \begin{macrocode}
11530 \newtoggle{fulllines@}%
11531 % \end{macrocode}
11532 % \end{macro}
11533 % \begin{macro}{\nonum@}
11534 %\cs{nonum@} toggle is used to disable line number printing in a particular footnote.
11535 % \begin{macrocode}
11536 \newtoggle{nonum@}
11537 % \end{macrocode}
11538 % \end{macro}
11539 % \begin{macro}{\nosep@}
11540 %\cs{nonum@} toggle is used to disable the lemma separator in a particular footnote.
11541 % \begin{macrocode}
11542 \newtoggle{nosep@}
11543 % \end{macrocode}
11544 % \end{macro}
11545 % \begin{macro}{\nomk@}
11546 %\cs{nomk@} toggle is used by \Lpack{eledpar} to remove the footnote mark in the text when using \cs{footnoteXmk}. Read \Lpack{eledpar} handbook.
11547 % \begin{macrocode}
11548 \newtoggle{nomk@}%
11549 % \end{macrocode}
11550 % \end{macro}
11551 % \subsection{Alias}
11552 % \begin{macro}{\nolemmaseparator}
11553 %\cs{nolemmaseparator}\oarg{series} is just an alias for \cs{lemmaseparator}\oarg{series}\verb|{}|.
11554 % \begin{macrocode}
11555 \newcommandx*{\nolemmaseparator}[1][1]{\lemmaseparator[#1]{}}
11556 % \end{macrocode}
11557 % \end{macro}
11558 % \begin{macro}{\interparanoteglue}
11559 % \begin{macro}{\ipn@skip}
11560 % The \cs{ipn@skip} skip and \cs{interparanoteglue} command are kept for backward compatibility, but should not be used anymore.
11561 % \begin{macrocode}
11562 \newskip\ipn@skip
11563 \newcommand*{\interparanoteglue}[1]{%
11564 {\notefontsetup\global\ipn@skip=#1 \relax}}
11565 \interparanoteglue{1em plus.4em minus.4em}
11566 % \end{macrocode}
11567 % \end{macro}
11568 % \end{macro}
11569 %
11570 % \begin{macro}{\parafootftmsep}
11571 % The \cs{parafootftmsep} macro is kept for backward compatibility. It is default value of \cs{parafootsep@series}.
11572 % \begin{macrocode}
11573 \newcommand{\parafootftmsep}{}
11574 % \end{macrocode}
11575 % \end{macro}
11576 %
11577 % \section{Line number printing}
11578 % \begin{macro}{\printlinefootnote}
11579 % The \cs{printlinefootnote} macro is called in each \cs{<type>footfmt} command.
11580 % It controls whether the line number is printed or not, according to the previous options. Its first argument is the information about lines ; its second is the series of the footnote.
11581 % The printing of the line number is shared in
11582 % \cs{printlinefootnotenumbers}.
11583 % \changes{v1.18.0}{2015/02/23}{Code refactoring in \cs{printlinefootnote}: the printing of the numbers are factorized in \cs{printlinefootnotearea}}
11584 % \begin{macrocode}
11585 \newcommand{\printlinefootnote}[2]{%
11586 \def\extractline@##1|##2|##3|##4|##5|##6|##7|{##2}%
11587 \def\extractsubline@##1|##2|##3|##4|##5|##6|##7|{##3}%
11588 \def\extractendline@##1|##2|##3|##4|##5|##6|##7|{##5}%
11589 \def\extractendsubline@##1|##2|##3|##4|##5|##6|##7|{##6}%
11590 \iftoggle{numberonlyfirstintwolines@#2}{%
11591 \edef\lineinfo@{\extractline@ #1| - \extractsubline@ #1| - \extractendline@ #1| - \extractendsubline@ #1|}%
11592 }%
11593 {%
11594 \edef\lineinfo@{\extractline@ #1| - \extractsubline@ #1|}%
11595 }%
11596 \iftoggle{nonum@}{%Try if the line number must printed for this specific not (by default, yes)
11597 \hspace{\csuse{inplaceofnumber@#2}}%
11598 }%
11599 {%
11600 {%
11601 \iftoggle{nonumberinfootnote@#2}%Try if the line number must printed (by default, yes)
11602 {%
11603 \hspace{\csuse{inplaceofnumber@#2}}%
11604 }%
11605 {%
11606 {\iftoggle{numberonlyfirstinline@#2}% If for this series the line number must be printed only in the first time.
11607 {%
11608 \ifcsdef{prevline#2}%
11609 {%Be sure the \prevline exists.
11610 \ifcsequal{prevline#2}{lineinfo@}%Try it
11611 {%
11612 \IfStrEq{\csuse{symlinenum@#2}}{}%
11613 {%
11614 \hspace{\csuse{inplaceofnumber@#2}}%
11615 }%
11616 {\hspace{\csuse{beforesymlinenum@#2}}\csuse{Xnotenumfont@#2}%
11617 \ifdimequal{\csuse{boxsymlinenum@#2}}{0pt}%
11618 {\csuse{symlinenum@#2}}%
11619 {\hbox to \csuse{boxsymlinenum@#2}{\csuse{symlinenum@#2}\hfill}}%
11620 \hspace{\csuse{aftersymlinenum@#2}}}%
11621 }%
11622 {%
11623 \printlinefootnotearea{#1}{#2}%
11624 }%
11625 }%
11626 {%
11627 \printlinefootnotearea{#1}{#2}%
11628 }%
11629 }%
11630 {%
11631 \printlinefootnotearea{#1}{#2}%
11632 }%
11633 \csxdef{prevline#2}{\lineinfo@}%
11634 }%
11635 }%
11636 }%
11637 }%
11638 }
11639 % \end{macrocode}
11640 % \end{macro}
11641 % \begin{macro}{\printlinefootnotearea}
11642 % This macro prints the space before the line number, changes the font, then prints the line number and the space after it.
11643 % It is called by \cs{printlinefootnote}
11644 % depending of the options about repeating line numbers.
11645 % The first argument is line information, the second is the notes series (A, B, C. etc.)
11646 % \begin{macrocode}
11647 \newcommand{\printlinefootnotearea}[2]{%
11648 \printbeforenumberinfootnote{#2}%
11649 \csuse{Xnotenumfont@#2}%
11650 \boxfootnotenumbers{#1}{#2}%
11651 \printafternumberinfootnote{#2}%
11652 }%
11653 % \end{macrocode}
11654 % \end{macro}
11655 % \begin{macro}{\boxfootnotenumbers}
11656 % Depending on the user settings, this macro will box line numbers (or not).
11657 % The first argument is line information, the second is the notes series (A, B, C. etc.)
11658 % The previous \cs{printlinefootnotearea} calls it.
11659 % \begin{macrocode}
11660 \newcommand{\boxfootnotenumbers}[2]{%
11661 \ifdimequal{\csuse{boxlinenum@#2}}{0pt}{%
11662 \printlinefootnotenumbers{#1}{#2}%
11663 }%
11664 {%
11665 \hbox to \csuse{boxlinenum@#2}%
11666 {%
11667 \IfSubStr{RC}{\csuse{boxlinenumalign@#2}}{\hfill}{}%
11668 \printlinefootnotenumbers{#1}{#2}%
11669 \IfSubStr{LC}{\csuse{boxlinenumalign@#2}}{\hfill}{}%
11670 }%
11671 }%
11672 }%
11673 % \end{macrocode}
11674 % \end{macro}
11675 % \begin{macro}{\printlinefootnotenumbers}
11676 % This macro prints, if needed, the pstart number and the line number.
11677 % The first argument is line information, the second is the notes series (A, B, C. etc.)
11678 % The previous \cs{boxlinefootnote} calls it.
11679 % \begin{macrocode}
11680 \newcommand{\printlinefootnotenumbers}[2]{%
11681 \xdef\@currentseries{#2}%
11682 \ifboolexpr{%
11683 (togl{pstartinfootnote@#2} and bool{numberpstart})%
11684 or togl{pstartinfootnoteeverytime@#2}}%
11685 {\printpstart}{}%
11686 \iftoggle{onlypstartinfootnote@#2}{}{\printlines#1|}%
11687 }%
11688 % \end{macrocode}
11689 % \end{macro}
11690 % \begin{macro}{\printbeforenumberinfootnote}
11691 % This macro prints a space (before the line number) in footnote.
11692 % It is called by \cs{printlinefootnotearea}.
11693 % Its only argument is the series
11694 % \begin{macrocode}
11695 \newcommand{\printbeforenumberinfootnote}[1]{%
11696 \hspace{\csuse{beforenumberinfootnote@#1}}%
11697 }%
11698 % \end{macrocode}
11699 % \end{macro}
11700 % \begin{macro}{\printafternumberinfootnote}
11701 % This macro prints the space, adding eventually a \cs{nobreak}, after the line number, in footnote.
11702 % It is called by \cs{printlinefootnotearea}.
11703 % Its only argument is the series
11704 % \begin{macrocode}
11705 \newcommand{\printafternumberinfootnote}[1]{%
11706 \iftoggle{nonbreakableafternumber@#1}{\nobreak}{}%
11707 \hspace{\csuse{afternumberinfootnote@#1}}%
11708 }%
11709 % \end{macrocode}
11710 % \end{macro}
11711 % \section{Output routine}
11712 % \label{output}\relax
11713 %
11714 % Now we begin the output routine and associated things.
11715 %
11716 %
11717 %
11718 % \begin{macro}{\pageno}
11719 % \begin{macro}{\advancepageno}
11720 % \cs{pageno} is a page number, starting at 1, and \cs{advancepageno}
11721 % increments the number.
11722 % \begin{macrocode}
11723 \countdef\pageno=0 \pageno=1
11724 \newcommand*{\advancepageno}{\ifnum\pageno<\z@ \global\advance\pageno\m@ne
11725 \else\global\advance\pageno\@ne\fi}
11726
11727 % \end{macrocode}
11728 % \end{macro}
11729 % \end{macro}
11730 %
11731 %
11732 %
11733 % The next portion is probably the trickiest part of moving from
11734 % TeX to \LaTeX\. The original code is below, but we need
11735 % something very different.
11736 %
11737 % This is a new output routine, with changes to handle printing all our
11738 % footnotes. Those changes have not been added directly, but are in macros
11739 % that get called here: that should make it easier to see what would need
11740 % to be taken over to a different output routine. We continue to use the
11741 % \cs{pagebody}, \cs{makeheadline}, \cs{makefootline}, and \cs{dosupereject}
11742 % macros of \PlainTeX; for those macros, and the original version of
11743 % \cs{output}, see \thetexbook, p.\,364.
11744 % \begin{verbatim}
11745 % \output{\edmac@output}
11746 % \def\edmac@output{\shipout\vbox{\normal@pars
11747 % \vbox{\makeheadline\pagebody\makefootline}%
11748 % }%
11749 % \advancepageno
11750 % \ifnum\outputpenalty>-\@MM\else\dosupereject\fi}
11751 %
11752 % \def\pagecontents{\page@start
11753 % \ifvoid\topins\else\unvbox\topins\fi
11754 % \dimen@=\dp\@cclv \unvbox\@cclv % open up \box255
11755 % \do@feet
11756 % \ifr@ggedbottom \kern-\dimen@ \vfil \fi}
11757 % \end{verbatim}
11758 %
11759 % \cs{do@feet} ships out all the footnotes. Standard \edmac{} has only
11760 % five feet, but there is nothing in principal to prevent you
11761 % from creating an arachnoid or centipedal edition; straightforward
11762 % modifications of \edmac{} are all that's required. However, the
11763 % myria\-pedal edition is ruled out by eTeX limitations: the number
11764 % of insertion classes is limited to $2^16$.
11765 %
11766 %
11767 % With luck we might only have to change \cs{@makecol} and
11768 % \cs{@reinserts}. The kernel
11769 % definition of these, and perhaps some other things, is:
11770 % \begin{verbatim}
11771 % \gdef \@makecol {%
11772 % \ifvoid\footins
11773 % \setbox\@outputbox \box\@cclv
11774 % \else
11775 % \setbox\@outputbox \vbox {%
11776 % \boxmaxdepth \@maxdepth
11777 % \@tempdima\dp\@cclv
11778 % \unvbox \@cclv
11779 % \vskip \skip\footins
11780 % \color@begingroup
11781 % \normalcolor
11782 % \footnoterule
11783 % \unvbox \footins
11784 % \color@endgroup
11785 % }%
11786 % \fi
11787 % \xdef\@freelist{\@freelist\@midlist}%
11788 % \global \let \@midlist \@empty
11789 % \@combinefloats
11790 % \ifvbox\@kludgeins
11791 % \@makespecialcolbox
11792 % \else
11793 % \setbox\@outputbox \vbox to\@colht {%
11794 % \@texttop
11795 % \dimen@ \dp\@outputbox
11796 % \unvbox\@outputbox
11797 % \vskip -\dimen@
11798 % \@textbottom
11799 % }%
11800 % \fi
11801 % \global \maxdepth \@maxdepth
11802 % }
11803 %
11804 % \gdef \@reinserts{%
11805 % \ifvoid\footins\else\insert\footins{\unvbox\footins}\fi
11806 % \ifvbox\@kludgeins\insert\@kludgeins{\unvbox\@kludgeins}\fi
11807 % }
11808 % \end{verbatim}
11809 %
11810 % Now we start actually changing things.
11811 %
11812 % \begin{macro}{\m@m@makecolfloats}
11813 % \begin{macro}{\m@m@makecoltext}
11814 % \begin{macro}{\m@m@makecolintro}
11815 % These macros are defined in the \Lclass{memoir} class and form part
11816 % of the definition of \verb?\@makecol?.
11817 % \changes{v0.2.1}{2003/09/13}{Added \cs{m@m@makecolfloats}, \cs{m@m@makecoltext}
11818 % and \cs{m@m@makecolintro}}
11819 % \begin{macrocode}
11820 \providecommand{\m@m@makecolfloats}{%
11821 \xdef\@freelist{\@freelist\@midlist}%
11822 \global \let \@midlist \@empty
11823 \@combinefloats}
11824 \providecommand{\m@m@makecoltext}{%
11825 \ifvbox\@kludgeins
11826 \@makespecialcolbox
11827 \else
11828 \setbox\@outputbox \vbox to\@colht {%
11829 \@texttop
11830 \dimen@ \dp\@outputbox
11831 \unvbox\@outputbox
11832 \vskip -\dimen@
11833 \@textbottom}%
11834 \fi}
11835 \providecommand{\m@m@makecolintro}{}
11836
11837 % \end{macrocode}
11838 % \end{macro}
11839 % \end{macro}
11840 % \end{macro}
11841 %
11842 % \begin{macro}{\l@d@makecol}
11843 % This is a partitioned version of the `standard' \cs{@makecol},
11844 % with the initial code put into another macro.
11845 % \changes{v0.2.1}{2003/09/13}{Rewrote \cs{@makecol}, calling it \cs{l@d@makecol}}
11846 % \begin{macrocode}
11847 \gdef\l@d@makecol{%
11848 \l@ddofootinsert
11849 \m@m@makecolfloats
11850 \m@m@makecoltext
11851 \global \maxdepth \@maxdepth}
11852
11853 % \end{macrocode}
11854 % \end{macro}
11855 % \begin{macro}{\ifFN@bottom}
11856 % \changes{v1.5.0}{2013/07/11}{Use the bottom option of \Lpack{footmisc} package.}
11857 % The \cs{ifFN@bottom} macro is defined by the \Lpack{footmisc} package. If this package is not loaded, we define it.
11858 % \begin{macrocode}
11859 \AtBeginDocument{\@ifpackageloaded{footmisc}{}{\newif\ifFN@bottom}}
11860 % \end{macrocode}
11861 % \end{macro}
11862 % \begin{macro}{\l@ddofootinsert}
11863 % This macro essentially holds the initial portion of the kernel
11864 % \cs{@makecol} code.
11865 % \changes{v0.2.1}{2003/09/13}{Renamed \cs{dofootinsert} as \cs{l@ddofootinsert}}
11866 % \changes{v0.7.0}{2005/02/25}{Deleted \cs{page@start} from \cs{l@ddofootinsert}}
11867 % \begin{macrocode}
11868 \newcommand*{\l@ddofootinsert}{%
11869 \ifvoid\footins
11870 \setbox\@outputbox \box\@cclv
11871 \else
11872 \setbox\@outputbox \vbox {%
11873 \boxmaxdepth \@maxdepth
11874 \@tempdima\dp\@cclv
11875 \unvbox \@cclv
11876 \ifFN@bottom\vfill\fi\vskip \skip\footins% If the option bottom of loadmisc package is loaded
11877 \color@begingroup
11878 \normalcolor
11879 \footnoterule
11880 \unvbox \footins
11881 \color@endgroup
11882 }%
11883 \fi
11884 % \end{macrocode}
11885 % That's the end of the copy of the kernel code. We finally call a macro
11886 % to handle all the additional \edmac{} feet.
11887 % \begin{macrocode}
11888 \l@ddoxtrafeet
11889 }
11890
11891 % \end{macrocode}
11892 % \end{macro}
11893 %
11894 % \begin{macro}{\doxtrafeet}
11895 % \cs{doxtrafeet} is the code extending \cs{@makecol} to cater for
11896 % the extra \Eledmac{} feet. We have two classes of extra footnotes.
11897 % By default, we order the footnote inserts so that the regular footnotes are first,
11898 % then class 1\index{class 1 feet} (familiar footnotes) and finally
11899 % class 2\index{class 2 feet} (critical footnotes).
11900 % \changes{v0.2.1}{2003/09/13}{Renamed \cs{doxtrafeet} to \cs{l@ddoxtrafeet}}
11901 % \changes{v1.9.0}{2014/02/05}{Add \cs{fnpos} to choice the order of footnotes.}
11902 % \begin{macrocode}
11903 \newcommand*{\l@ddoxtrafeet}{%
11904 \IfStrEq{familiar-critical}{\@fnpos}
11905 {\doxtrafeeti\doxtrafeetii}%
11906 {%
11907 \IfStrEq{critical-familiar}{\@fnpos}%
11908 {\doxtrafeetii\doxtrafeeti}%
11909 {\doxtrafeeti\doxtrafeetii}%
11910 }%
11911 }%
11912
11913 % \end{macrocode}
11914 % \end{macro}
11915 %
11916 % \begin{macro}{\doxtrafeetii}
11917 % \cs{doxtrafeetii} is the code extending \cs{@makecol} to cater for
11918 % the extra critical feet (class 2 feet\index{class 2 feet}).
11919 % NOTE: the code is likely to be
11920 % `featurefull'.
11921 % \changes{v0.4.1}{2004/03/06}{Changed \cs{doxtrafeetii} code for easier extensions}
11922 % \begin{macrocode}
11923 \newcommand*{\doxtrafeetii}{%
11924 \setbox\@outputbox \vbox{%
11925 \unvbox\@outputbox
11926 \@opxtrafeetii}}
11927 % \end{macrocode}
11928 % \end{macro}
11929 %
11930 % \begin{macro}{\@opxtrafeetii}
11931 % \begin{macro}{\print@Xnotes}
11932 % The extra critical feet to be added to the output.
11933 % \changes{v0.4.1}{2004/03/06}{Added \cs{@opxtrafeetii}}
11934 % The normal way to add one series.
11935 % \cs{print@Xnotes} is replaced by \Lpack{eledpar} when using \cs{Pages}.
11936 % \begin{macrocode}
11937 \newcommand\print@Xnotes[1]{%
11938 \csuse{#1footstart}{#1}%
11939 \csuse{#1footgroup}{#1}%%
11940 }%
11941 % \end{macrocode}
11942 % We print all series of notes by looping on them.
11943 % We check before printing them that they are not voided.
11944 % \begin{macrocode}
11945 \newcommand*{\@opxtrafeetii}{%
11946 \unless\ifnocritical@%
11947 \gdef\firstXseries@{}%
11948 \def\do##1{%
11949 \ifvoid\csuse{##1footins}\else%
11950 \global\skip\csuse{##1footins}=\csuse{beforeXnotes@##1}%
11951 \global\advance\skip\csuse{##1footins} by\csuse{afterXrule@##1}%
11952 \print@Xnotes{##1}%
11953 \fi%
11954 }%
11955 \dolistloop{\@series}%
11956 \fi%
11957 }%
11958 % \end{macrocode}
11959 % \end{macro}
11960 % \end{macro}
11961 %
11962 %
11963 % \begin{macro}{\l@ddodoreinxtrafeet}
11964 % \cs{l@ddodoreinxtrafeet} is the code for catering for the extra footnotes
11965 % within \cs{@reinserts}. The implementation may well have to change.
11966 % We use the same classes and ordering as in \cs{l@ddoxtrafeet}.
11967 % \changes{v0.2.1}{203/09/13}{Renamed \cs{dodoreinxtrafeet} to \cs{l@ddodoreinxtrafeet}}
11968 % \begin{macrocode}
11969 \newcommand*{\l@ddodoreinxtrafeet}{%
11970 \doreinxtrafeeti
11971 \doreinxtrafeetii}
11972
11973 % \end{macrocode}
11974 % \end{macro}
11975 %
11976 % \begin{macro}{\doreinxtrafeetii}
11977 % \cs{doreinxtrafeetii} is the code for catering for the
11978 % class 2\index{class 2 feet} extra critical footnotes
11979 % within \cs{@reinserts}. The implementation may well have to change.
11980 % \begin{macrocode}
11981 \newcommand*{\doreinxtrafeetii}{%
11982 \unless\ifnocritical@%
11983 \def\do##1{%
11984 \ifvoid\csuse{##1footins}\else%
11985 \insert\csuse{##1footins}{\unvbox\csuse{##1footins}}%
11986 \fi}%
11987 \dolistloop{\@series}
11988 \fi%
11989 }
11990
11991 % \end{macrocode}
11992 % \end{macro}
11993 %
11994 % \begin{macro}{\l@d@reinserts}
11995 % And here is the modified version of \cs{@reinserts}.
11996 % \begin{macrocode}
11997 \gdef \l@d@reinserts{%
11998 \ifvoid\footins\else\insert\footins{\unvbox\footins}\fi
11999 \l@ddodoreinxtrafeet
12000 \ifvbox\@kludgeins\insert\@kludgeins{\unvbox\@kludgeins}\fi
12001 }
12002
12003 % \end{macrocode}
12004 % \end{macro}
12005 %
12006 % The \Lclass{memoir} class does not use the `standard' versions of
12007 % \cs{@makecol} and \cs{@reinserts}, due to its sidebar insert.
12008 % We had better add that code if \Lclass{memoir} is used. (It can
12009 % be awkward dealing with |\if| code within |\if| code, so don't use
12010 % |\ifl@dmemoir| here.)
12011 % \changes{v0.2.1}{2003/09/13}{Major changes to insert code when memoir is loaded}
12012 % \begin{macrocode}
12013 \@ifclassloaded{memoir}{%
12014 % \end{macrocode}
12015 % \Lclass{memoir} is loaded so we use \Lclass{memoir}'s built in hooks.
12016 % \begin{macrocode}
12017 \g@addto@macro{\m@mdoextrafeet}{\l@ddoxtrafeet}%
12018 \g@addto@macro{\m@mdodoreinextrafeet}{\l@ddodoreinxtrafeet}%
12019 }{%
12020 % \end{macrocode}
12021 % \Lclass{memoir} has not been loaded, so redefine \verb?@makecol? and
12022 % \verb?@reinserts?.
12023 % \begin{macrocode}
12024 \gdef\@makecol{\l@d@makecol}%
12025 \gdef\@reinserts{\l@d@reinserts}%
12026 }
12027
12028 % \end{macrocode}
12029 %
12030 %
12031 % \begin{macro}{\addfootins}
12032 %
12033 % \cs{addfootins} is for backward compatibility, but should'nt be used anymore.
12034 % \begin{macrocode}
12035 \newcommand*{\addfootins}[1]{%
12036 \led@warn@AddfootinsObsolete%
12037 \footnormal{#1}
12038 \g@addto@macro{\@opxtrafeetii}{%
12039 \ifvoid\@nameuse{#1footins}\else
12040 \@nameuse{#1footstart{#1}}\@nameuse{#1footgroup}{#1}\fi}
12041 \g@addto@macro{\doreinxtrafeetii}{%
12042 \ifvoid\@nameuse{#1footins}\else
12043 \insert\@nameuse{#1footins}{\unvbox\@nameuse{#1footins}}\fi}
12044 \g@addto@macro{\l@dedbeginmini}{%
12045 \expandafter\let\csname #1footnote\endcsname = \@nameuse{mp#1footnote}}
12046 \g@addto@macro{\l@dedendmini}{%
12047 \ifvoid\@nameuse{mp#1footins}\else\@nameuse{mpfootgroup#1{#1}}\fi}
12048 }
12049 % \end{macrocode}
12050 % \end{macro}
12051 %
12052 % It turns out that \verb?\@doclearpage? also needs modifying.
12053 % \changes{v0.4.1}{2004/03/25}{Added code for changing \cs{@doclearpage}}
12054 % \begin{macro}{\if@led@nofoot}
12055 % \begin{macro}{\@led@extranofeet}
12056 % We have to check if there are any leftover feet. \verb?\@led@extranofeet?
12057 % is a hook for handling further footnotes.
12058 % \begin{macrocode}
12059 \newif\if@led@nofoot
12060 \newcommand*{\@led@extranofeet}{}
12061
12062 % \end{macrocode}
12063 % \end{macro}
12064 % \end{macro}
12065 %
12066 % \begin{macrocode}
12067 \@ifclassloaded{memoir}{%
12068 % \end{macrocode}
12069 % If the \Lclass{memoir} class is loaded we hook into its modified
12070 % \verb?\@doclearpage?.
12071 % \begin{macro}{\@mem@extranofeet}
12072 % \begin{macrocode}
12073 \g@addto@macro{\@mem@extranofeet}{%%
12074 \def\do#1{%
12075 \unless\ifnocritical@%
12076 \ifvoid\csuse{#1footins}\else\@mem@nofootfalse\fi%
12077 \fi%
12078 \unless\ifnofamiliar@%
12079 \ifvoid\csuse{footins#1}\else\@mem@nofootfalse\fi%
12080 \fi%
12081 }
12082 \dolistloop{\@series}%
12083 \@led@extranofeet%
12084 }%
12085 }{%
12086 % \end{macrocode}
12087 % \end{macro}
12088 % As \Lclass{memoir} is not loaded we have to do it all here.
12089 % \begin{macro}{\@led@testifnofoot}
12090 % \begin{macro}{\@doclearpage}
12091 % \begin{macrocode}
12092 \newcommand*{\@led@testifnofoot}{%
12093 \@led@nofoottrue%
12094 \ifvoid\footins\else%
12095 \@led@nofootfalse%
12096 \fi%
12097 \def\do##1{%
12098 \unless\ifnocritical@%
12099 \ifvoid\csuse{##1footins}\else%
12100 \@led@nofootfalse%
12101 \fi%
12102 \fi%
12103 \unless\ifnofamiliar@%
12104 \ifvoid\csuse{footins##1}\else%
12105 \@led@nofootfalse%
12106 \fi%
12107 \fi%
12108 }%
12109 \dolistloop{\@series}%
12110 \@led@extranofeet%
12111 }%
12112
12113 \renewcommand{\@doclearpage}{%
12114 \@led@testifnofoot
12115 \if@led@nofoot
12116 \setbox\@tempboxa\vsplit\@cclv to\z@ \unvbox\@tempboxa
12117 \setbox\@tempboxa\box\@cclv
12118 \xdef\@deferlist{\@toplist\@botlist\@deferlist}%
12119 \global \let \@toplist \@empty
12120 \global \let \@botlist \@empty
12121 \global \@colroom \@colht
12122 \ifx \@currlist\@empty
12123 \else
12124 \@latexerr{Float(s) lost}\@ehb
12125 \global \let \@currlist \@empty
12126 \fi
12127 \@makefcolumn\@deferlist
12128 \@whilesw\if@fcolmade \fi{\@opcol\@makefcolumn\@deferlist}%
12129 \if@twocolumn
12130 \if@firstcolumn
12131 \xdef\@dbldeferlist{\@dbltoplist\@dbldeferlist}%
12132 \global \let \@dbltoplist \@empty
12133 \global \@colht \textheight
12134 \begingroup
12135 \@dblfloatplacement
12136 \@makefcolumn\@dbldeferlist
12137 \@whilesw\if@fcolmade \fi{\@outputpage
12138 \@makefcolumn\@dbldeferlist}%
12139 \endgroup
12140 \else
12141 \vbox{}\clearpage
12142 \fi
12143 \fi
12144 \else
12145 \setbox\@cclv\vbox{\box\@cclv\vfil}%
12146 \l@d@makecol\@opcol
12147 \clearpage
12148 \fi}
12149 }
12150
12151 % \end{macrocode}
12152 % \end{macro}
12153 % \end{macro}
12154 %
12155 %
12156 % \section{Cross referencing}
12157 % \label{xref}\relax
12158 %
12159 % Peter Wilson has rewritten portions of the code in this section so that
12160 % the LaTeX \file{.aux} file is used. This will also handle \cs{include}d
12161 % files.
12162 %
12163 % Further, I have renamed some of the original \edmac{} macros so that
12164 % they do not clash with the LaTeX label/ref commands (\edmac{} and LaTeX
12165 % use very different mechanisms). In particular,
12166 % the original \edmac{} \cs{label} and \cs{pageref} have been renamed
12167 % as \cs{edlabel} and \cs{edpageref} respectively.
12168 %
12169 %
12170 % You can mark a place in the text using a command of the form
12171 % \verb"\edlabel{foo}", and later refer to it using the label
12172 % \verb"foo" by saying \verb"\edpageref{foo}", or \verb"\lineref{foo}" or
12173 % \verb"\sublineref{foo}". These reference commands will produce,
12174 % respectively, the page, line and sub-line on which the
12175 % \verb"\edlabel{foo}" command occurred.
12176 %
12177 % The reference macros warn you if a reference is made to an
12178 % undefined label. If \verb"foo" has been used as a label before,
12179 % the \verb"\edlabel{foo}" command will issue a complaint; subsequent
12180 % \cs{edpageref} and \cs{edlineref} commands will refer to the
12181 % latest occurrence of \verb"\label{foo}".
12182 %
12183 % \begin{macro}{\labelref@list}
12184 % Set up a new list, \cs{labelref@list}, to hold the page, line and
12185 % sub-line numbers for each label.
12186 % \begin{macrocode}
12187 \list@create{\labelref@list}
12188 % \end{macrocode}
12189 % \end{macro}
12190 %
12191 %
12192 % \begin{macro}{\zz@@@}
12193 % A convenience macro to zero two labeling counters in one go.
12194 % \changes{v0.2.1}{2003/08/26}{Minor change to \cs{zz@@@}}
12195 % \begin{macrocode}
12196 %% \newcommand*{\zz@@@}{000|000|000} % set three counters to zero in one go
12197 \newcommand*{\zz@@@}{000|000} % set two counters to zero in one go
12198
12199 % \end{macrocode}
12200 % \end{macro}
12201 %
12202 % \begin{macro}{\edlabel}
12203 % The \cs{edlabel} command first writes a \cs{@lab} macro to
12204 % the \cs{linenum@out} file. It then checks to see that the
12205 % \cs{labelref@list} actually has something in it (if not, it
12206 % creates a dummy entry), and pops the next value for the current
12207 % label, storing it in \cs{label@refs}. Finally it defines the
12208 % label to be \cs{empty} so that any future check will turn up
12209 % the fact that it has been used.\footnote{The remaining macros
12210 % in this section were kindly revised by Wayne
12211 % Sullivan,\index{Sullivan, Wayne} who
12212 % substantially improved their efficiency and flexibility.}
12213 %
12214 % This version of the original \edmac{} \cs{label} uses \cs{@bsphack}
12215 % and \cs{@esphack} to eliminate extra space problems and also the LaTeX
12216 % write methods for the \file{.aux} file.
12217 %
12218 % Jesse Billett\footnote{(\url{[email protected]}) via the \texttt{ctt}
12219 % thread `ledmac cross referencing', 25 August 2003.}
12220 % found that the original code could be off by several pages. This version,
12221 % hopefully cures that, and also allows for non-arabic page numbering.
12222 %
12223 % \changes{v0.2.1}{2003/08/26}{Tweaked \cs{edlabel} to get correct page numbers}
12224 % \changes{v0.14.0}{2012/04/04}{Tweaked \cs{edlabel} to get correct line number if the command is first element of a paragraph.}
12225 % \changes{v1.18.0}{2015/02/23}{\cs{edlabel} is now defined only one time for both eledmac and eledpar}
12226
12227 % \begin{macrocode}
12228 \newcommand*{\edlabel}[1]{%
12229 \ifl@dpairing\ifautopar%
12230 \strut%
12231 \fi\fi%
12232 \@bsphack%
12233 \ifledRcol%
12234 \write\linenum@outR{\string\@lab}%
12235 \ifx\labelref@listR\empty%
12236 \xdef\label@refs{\zz@@@}%
12237 \else%
12238 \gl@p\labelref@listR\to\label@refs%
12239 \fi%
12240 \ifvmode%
12241 \advancelabel@refs%
12242 \fi%
12243 % \end{macrocode}
12244 % Use code from the kernel \cs{label} command to write the correct
12245 % page number (it seems possible that the original \edmac's \cs{page@num}
12246 % scheme might also have had problems in this area).
12247 % Also define an hypertarget if \Lpack{hyperref} package is loaded.
12248 % \begin{macrocode}
12249 \protected@write\@auxout{}%
12250 {\string\l@dmake@labelsR\space\thepage|\label@refs|\the\c@pstartR|{#1}}%
12251 \ifdef{\hypertarget}{\Hy@raisedlink{\hypertarget{#1}{}}}{}%
12252 \else%
12253 \write\linenum@out{\string\@lab}%
12254 \ifx\labelref@list\empty%
12255 \xdef\label@refs{\zz@@@}%
12256 \else%
12257 \gl@p\labelref@list\to\label@refs%
12258 \fi%
12259 \ifvmode%
12260 \advancelabel@refs%
12261 \fi%
12262 \protected@write\@auxout{}%
12263 {\string\l@dmake@labels\space\thepage|\label@refs|\the\c@pstart|{#1}}%
12264 \ifdef{\hypertarget}{\Hy@raisedlink{\hypertarget{#1}{}}}{}%
12265 \fi%
12266 \@esphack}%
12267
12268 % \end{macrocode}
12269 % \end{macro}
12270 %
12271 %
12272 %\begin{macro}{\advancelabel@refs}
12273 %\begin{macro}{\labelrefsparseline}
12274 %\begin{macro}{\labelrefsparsesubline}
12275 % \changes{v1.4.1}{2012/11/16}{Fix bug with \cs{edlabel}.}
12276 %In cases where \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.
12277 %Hence, we need to test \cs{edlabel} if it occurs at the start of a paragraph. To do so, we use \cs{ifvmode}. If the test is true, we must advance by one unit the amount of text we write into the \verb].aux] file.
12278 % We do so using \cs{advancelabel@refs} command.
12279 % \begin{macrocode}
12280 \newcounter{line}%
12281 \newcounter{subline}%
12282 \newcommand{\advancelabel@refs}{%
12283 \setcounter{line}{\expandafter\labelrefsparseline\label@refs}%
12284 \stepcounter{line}%
12285 \ifsublines@%
12286 \setcounter{subline}{\expandafter\labelrefsparsesubline\label@refs}%
12287 \stepcounter{subline}{1}%
12288 \def\label@refs{\theline|\thesubline}%
12289 \else%
12290 \def\label@refs{\theline|0}%
12291 \fi%
12292 }
12293 \def\labelrefsparseline#1|#2{#1}
12294 \def\labelrefsparsesubline#1|#2{#2}
12295 % \end{macrocode}
12296 % \end{macro}
12297 % \end{macro}
12298 % \end{macro}
12299 % \begin{macro}{\l@dmake@labels}
12300 % The \cs{l@dmake@labels} macro gets executed when the labels file is
12301 % read. For each label it defines a macro, whose name is made up
12302 % partly from the label you supplied, that contains the page, line
12303 % and sub-line numbers. But first it checks to see whether the
12304 % label has already been used (and complains if it has).
12305 %
12306 % The initial use of \cs{newcommand} is to catch if \cs{l@dmake@labels}
12307 % has been previously defined (by a class or package).
12308 % \begin{macrocode}
12309 \newcommand*{\l@dmake@labels}{}
12310 \def\l@dmake@labels#1|#2|#3|#4|#5{%
12311 \expandafter\ifx\csname the@label#5\endcsname \relax\else
12312 \led@warn@DuplicateLabel{#5}%
12313 \fi
12314 \expandafter\gdef\csname the@label#5\endcsname{#1|#2|#3|#4}%
12315 \ignorespaces}
12316
12317 % \end{macrocode}
12318 % \end{macro}
12319 %
12320 % LaTeX reads the \texttt{aux} file at both the beginning and end of
12321 % the document, so we have to switch off duplicate label checking
12322 % after the first time the file is read.
12323 %
12324 % \begin{macrocode}
12325 \AtBeginDocument{%
12326 \def\l@dmake@labels#1|#2|#3|#4|#5{}%
12327 }
12328
12329 % \end{macrocode}
12330 %
12331 % \begin{macro}{\@lab}
12332 % The \cs{@lab} command, which appears in the \cs{linenum@out} file,
12333 % appends the current values of page, line and sub-line to the
12334 % \cs{labelref@list}. These values are defined by the earlier
12335 % \cs{@page}, \cs{@nl}, and the \cs{sub@on} and \cs{sub@off} commands
12336 % appearing in the \cs{linenum@out} file.
12337 %
12338 % LaTeX uses the \texttt{page} counter for page numbers. However,
12339 % it appears that this is not the right place to grab the page number.
12340 % That task is now done in the \cs{edlabel} macro. This version
12341 % of \cs{@lab} appends just the current line and sub-line numbers
12342 % to \cs{labelref@list}.
12343 % \changes{v0.2.1}{2003/08/26}{Removed page setting from \cs{@lab}}
12344 % \changes{v0.3.0}{2004/02/14}{Replaced \cs{the}\cs{line@num} by
12345 % \cs{linenumr@p}\cs{line@num} in
12346 % \cs{@lab}, and similar for sub-lines}
12347 % \begin{macrocode}
12348 \newcommand*{\@lab}{\xright@appenditem
12349 {\linenumrep{\line@num}|%
12350 \ifsublines@ \sublinenumrep{\subline@num}\else 0\fi}\to\labelref@list}
12351
12352 % \end{macrocode}
12353 % \end{macro}
12354 % \begin{macro}{\applabel}
12355 % \cs{applabel}, if called in \cs{edtext} will insert automatically both a start and an end label for the current edtext lines.
12356 % \begin{macrocode}
12357 \newcommand*{\applabel}[1]{%
12358 \ifnum\@edtext@level>0%
12359 % \end{macrocode}
12360 % Label should not be already defined.
12361 % \begin{macrocode}
12362 \ifcsundef{the@label#1}{%
12363 \csdef{the@label#1}{applabel}%
12364 }%
12365 {%
12366 \led@warn@DuplicateLabel{#1 (applabel)}%
12367 }%
12368 % \end{macrocode}
12369 % Parse the edtext line numbers.
12370 % \begin{macrocode}
12371 \expandafter\l@dp@rsefootspec\l@d@nums|%
12372 % \end{macrocode}% Use the \LaTeX standard hack for label.
12373 % \begin{macrocode}
12374 \@bsphack%
12375 % \end{macrocode}% And now, write the data in the auxiliary file.
12376 % \begin{macrocode}
12377 \ifledRcol%
12378 \protected@write\@auxout{}%
12379 {\string\l@dmake@labelsR\space\l@dparsedstartpage|\l@dparsedstartline|\l@dparsedstartsub|\the\c@pstartR|{#1:start}}%
12380 \ifdef{\hypertarget}{\Hy@raisedlink{\hypertarget{#1:start}{}}}{}%
12381 \protected@write\@auxout{}%
12382 {\string\l@dmake@labelsR\space\l@dparsedendpage|\l@dparsedendline|\l@dparsedendsub|\the\c@pstartR|{#1:end}}%
12383 \else%
12384 \protected@write\@auxout{}%
12385 {\string\l@dmake@labels\space\l@dparsedstartpage|\l@dparsedstartline|\l@dparsedstartsub|\the\c@pstart|{#1:start}}%
12386 \ifdef{\hypertarget}{\Hy@raisedlink{\hypertarget{#1:start}{}}}{}%
12387 \protected@write\@auxout{}%
12388 {\string\l@dmake@labels\space\l@dparsedendpage|\l@dparsedendline|\l@dparsedendsub|\the\c@pstart|{#1:end}}%
12389 \fi%
12390 % \end{macrocode}% Use the \LaTeX standard hack for label.
12391 % \begin{macrocode}
12392 \@esphack%
12393 % \end{macrocode}% Warning if \cs{edlabel} is called outside of edtext.
12394 % \begin{macrocode}
12395 \else%
12396 \led@warn@AppLabelOutEdtext{#1}%
12397 \fi%
12398 % \end{macrocode}% End of \cs{applabel}
12399 % \begin{macrocode}
12400 }%
12401 % \end{macrocode}
12402 % \end{macro}
12403 % \begin{macro}{\wrap@edcrossref}
12404 % \changes{v1.12.1}{2014/08/06}{Fix spurious spaces.}
12405 % \changes{v1.12.7}{2014/09/07}{\cs{wrap@edcrossref} is now robust}
12406 % \cs{wrap@edcrossref} is called around all eledmac crossref commands, except those which start with x. It adds the hyperlink.
12407 % \begin{macrocode}
12408 \newrobustcmd{\wrap@edcrossref}[2]{%
12409 \ifdef{\hyperlink}%
12410 {\hyperlink{#1}{#2}}%
12411 {#2}%
12412 }
12413 % \end{macrocode}
12414 % \end{macro}
12415 % \begin{macro}{\edpageref}
12416 % \begin{macro}{\xpageref}
12417 % If the specified label exists, \cs{edpageref} gives its page number.
12418 % For this reference command, as for the other two, a special
12419 % version with prefix \verb"x" is provided for use in places where the
12420 % command is to be scanned as a number, as in \cs{linenum}. These
12421 % special versions have two limitations: they don't print error
12422 % messages if the reference is unknown, and they can't appear as
12423 % the first label or reference command in the file; you must ensure
12424 % that a \cs{edlabel} or a normal reference command appears first, or
12425 % these x-commands will always return zeros.
12426 % LaTeX already defines a \cs{pageref}, so changing the name
12427 % to \cs{edpageref}.
12428 % \begin{macrocode}
12429 \newcommand*{\edpageref}[1]{\l@dref@undefined{#1}\wrap@edcrossref{#1}{\l@dgetref@num{1}{#1}}}
12430 \newcommand*{\xpageref}[1]{\l@dgetref@num{1}{#1}}
12431
12432 % \end{macrocode}
12433 % \end{macro}
12434 % \end{macro}
12435 %
12436 % \begin{macro}{\edlineref}
12437 % \begin{macro}{\lineref}
12438 % \changes{v1.16.1}{2015/02/05}{\cs{lineref} is not defined if defined by some other package, like lineno. Eledmac provides \cs{edlineref} instead.}
12439 % \begin{macro}{\xlineref}
12440 % If the specified label exists, \cs{lineref} gives its line number.
12441 % \begin{macrocode}
12442 \newcommand*{\edlineref}[1]{\l@dref@undefined{#1}\wrap@edcrossref{#1}{\l@dgetref@num{2}{#1}}}%
12443 \AtBeginDocument{%
12444 \ifdef\lineref{}{\let\lineref\edlineref}%
12445 }%
12446 \newcommand*{\xlineref}[1]{\l@dgetref@num{2}{#1}}%
12447
12448 % \end{macrocode}
12449 % \end{macro}
12450 % \end{macro}
12451 % \end{macro}
12452 %
12453 % \begin{macro}{\sublineref}
12454 % \begin{macro}{\xsublineref}
12455 % If the specified label exists, \cs{sublineref} gives its sub-line number.
12456 % \begin{macrocode}
12457 \newcommand*{\sublineref}[1]{\l@dref@undefined{#1}\wrap@edcrossref{#1}{\l@dgetref@num{3}{#1}}}
12458 \newcommand*{\xsublineref}[1]{\l@dgetref@num{3}{#1}}
12459
12460 % \end{macrocode}
12461 % \end{macro}
12462 % \end{macro}
12463 %
12464 % \begin{macro}{\pstarteref}
12465 % \begin{macro}{\xpstartref}
12466 % If the specified label exists, \cs{pstartref} gives its pstart number.
12467 % \begin{macrocode}
12468 \newcommand*{\pstartref}[1]{\l@dref@undefined{#1}\wrap@edcrossref{#1}{\l@dgetref@num{4}{#1}}}
12469 \newcommand*{\xpstartref}[1]{\l@dgetref@num{4}{#1}}
12470
12471 % \end{macrocode}
12472 % \end{macro}
12473 % \end{macro}
12474 % The next three macros are used by the referencing commands above,
12475 % and do the job of extracting the right numbers from the label
12476 % macro that contains the page, line, and sub-line number.
12477 %
12478 % \begin{macro}{\l@dref@undefined}
12479 % The \cs{l@dref@undefined} macro is called when you refer to a label with
12480 % the normal referencing macros. Its argument is a label, and it
12481 % just checks that the label has been defined.
12482 %
12483 % \begin{macrocode}
12484 \newcommand*{\l@dref@undefined}[1]{%
12485 \expandafter\ifx\csname the@label#1\endcsname\relax
12486 \led@warn@RefUndefined{#1}%
12487 \fi}
12488
12489 % \end{macrocode}
12490 % \end{macro}
12491 %
12492 % \begin{macro}{\l@dgetref@num}
12493 % Next, \cs{l@dgetref@num} fetches the number we want. It has two
12494 % arguments: the first is simply a digit, specifying whether to
12495 % fetch a page (1), line (2) or sub-line (3) number. (This
12496 % switching is done by calling \cs{l@dlabel@parse}.) The second argument
12497 % is the label-macro, which because of the \cs{@lab} macro above is
12498 % defined to be a string of the type \verb"123|456|789".
12499 % \begin{macrocode}
12500 \newcommand*{\l@dgetref@num}[2]{%
12501 \expandafter
12502 \ifx\csname the@label#2\endcsname \relax
12503 000%
12504 \else
12505 \expandafter\expandafter\expandafter
12506 \l@dlabel@parse\csname the@label#2\endcsname|#1%
12507 \fi}
12508
12509 % \end{macrocode}
12510 % \end{macro}
12511 %
12512 % \begin{macro}{\l@dlabel@parse}
12513 % Notice that we slipped another \verb"|" delimiter into the
12514 % penultimate line of \cs{l@dgetref@num}, to
12515 % keep the `switch-number' separate from the reference numbers. This
12516 % \verb"|" is used as another parameter delimiter by \cs{l@dlabel@parse},
12517 % which extracts the appropriate number from its first arguments.
12518 % The \verb"|"-delimited arguments consist of the expanded label-macro
12519 % (three reference numbers), followed by the switch-number (1,
12520 % 2, or 3) which defines which of the earlier three numbers to
12521 % pick out. (It was earlier given as the first argument of
12522 % \cs{l@dgetref@num}.)
12523 % \begin{macrocode}
12524 \newcommand*{\l@dlabel@parse}{}
12525 \def\l@dlabel@parse#1|#2|#3|#4|#5{%
12526 \ifcase #5%
12527 \or #1%
12528 \or #2%
12529 \or #3%
12530 \or #4%
12531 \fi}
12532 % \end{macrocode}
12533 % \end{macro}
12534 %
12535 % \begin{macro}{\xxref}
12536 % \changes{v1.19.0}{2015/03/06}{\cs{xxref} works also with right side numbers, when \cs{Rlineflag} is not empty.}
12537 % \changes{v1.20.0}{2015/03/22}{Debug \cs{xxref} when not loading eledpar (fix bug added in 1.19.0).}
12538 % The \cs{xxref} command takes two arguments, both of which are
12539 % labels, e.g., \verb"\xxref{mouse}{elephant}". It first does some
12540 % checking to make sure that the labels do exist (if one doesn't,
12541 % those numbers are set to zero). Then it calls \cs{linenum} and sets
12542 % the beginning page, line, and sub-line numbers to those of the
12543 % place where \verb"\label{mouse}" was placed, and the ending
12544 % numbers to those at \verb"\label{elephant}". The point of this is
12545 % to be able to manufacture footnote line references to passages
12546 % which can't be specified in the normal way as the first argument
12547 % to \cs{critext} for one reason or another. Using \cs{xxref} in the
12548 % second argument of \cs{critext} lets you set things up at least
12549 % semi-automatically.
12550 % \begin{macrocode}
12551 \newcommand*{\xxref}[2]{%
12552 {%
12553 \expandafter\ifx\csname the@label#1\endcsname \relax%
12554 \expandafter\let\csname the@@label#1\endcsname\zz@@@%
12555 \else%
12556 \expandafter\def\csname the@@label#1\endcsname{\l@dgetref@num{1}{#1}|\l@dgetref@num{2}{#1}|\l@dgetref@num{3}{#1}}%
12557 \fi%
12558 \expandafter\ifx\csname the@label#2\endcsname \relax%
12559 \expandafter\let\csname the@@label#2\endcsname\zz@@@%
12560 \else%
12561 \expandafter\def\csname the@@label#2\endcsname{\l@dgetref@num{1}{#2}|\l@dgetref@num{2}{#2}|\l@dgetref@num{3}{#2}}%
12562 \fi%
12563 \ifdefined\Rlineflag%
12564 \StrDel{\csuse{the@@label#1}}{\Rlineflag}[\@tempa]%
12565 \StrDel{\csuse{the@@label#2}}{\Rlineflag}[\@tempb]%
12566 \else%
12567 \letcs{\@tempa}{the@@label#1}%
12568 \letcs{\@tempb}{the@@label#2}%
12569 \fi%
12570 \linenum{\@tempa|%
12571 \@tempb}}}%
12572
12573 % \end{macrocode}
12574 % \end{macro}
12575 %
12576 % \begin{macro}{\appref}
12577 % \begin{macro}{\apprefwithpage}
12578 % \begin{macro}{\apprefprefixsingle}
12579 % \begin{macro}{\apprefprefixmore}
12580 % \cs{appref} prints a crossref to some lines of the apparatus defined by \cs{applabel}.
12581 % It prints the lines as they should be printed in the apparatus.
12582 %
12583 % If \cs{apprefprefixsingle} is not empty, it prints it before the line number.
12584 % If \cs{apprefprefixsingles} is not empty, it prints it before the line numbers when the first line is not the same as the last line.
12585 % \cs{apprefwithpage} prints a crossref to some lines of the apparatus defined by \cs{applabel}.
12586 % It always prints the page number, as it should be printed in the end notes.
12587 % The \cs{twolinesappref} and \cs{morethantwolinesappref} are similar to the footnote
12588 % hooks and \cs{twolines} \cs{morethantwolines}.
12589 %
12590 % So, first declare the default value of the hooks for the pseudo-series appref.
12591 % Also declare the internal toggle which are switch by \eledmac{}.
12592 % \begin{macrocode}
12593 \xdef\twolines@appref{}%
12594 \xdef\morethantwolines@appref{}%
12595 \newtoggle{twolinesbutnotmore@appref}%
12596 \newtoggle{twolinesonlyinsamepage@appref}%
12597
12598 \xdef\Xendtwolines@apprefwithpage{}%
12599 \xdef\Xendmorethantwolines@apprefwithpage{}%
12600 \newtoggle{Xendtwolinesbutnotmore@apprefwithpage}%
12601 \newtoggle{Xendtwolinesonlyinsamepage@apprefwithpage}%
12602
12603 % \end{macrocode}
12604 % Note that some of these hooks are declared but no user command can change their values. Such hooks are not pertinent for appref and apprefwithpage pseudo-series, but their values are nonetheless tested in some macros.
12605 % \begin{macrocode}
12606
12607 \xdef\boxstartlinenum@appref{0pt}
12608 \xdef\boxendlinenum@appref{0pt}
12609
12610 \xdef\boxXendstartlinenum@apprefwithpage{0pt}
12611 \xdef\boxXendendlinenum@apprefwithpage{0pt}
12612
12613 % \end{macrocode}
12614 % Now, declare the default value of \cs{apprefprefixsingle} and \cs{apprefprefixmore}.
12615 % \begin{macrocode}
12616 \newcommand\apprefprefixsingle{}%
12617 \newcommand\apprefprefixmore{}%
12618
12619 % \end{macrocode}
12620 % And now, the main commands: \cs{appref} and \cs{apprefwithpage}.
12621 % These commands call \cs{printlines} and \cs{printendlines}. That is why we have previously declared all hooks values tested inside these last commands.
12622 % \begin{macrocode}
12623 \newcommandx{\appref}[2][1,usedefault]{%
12624 \IfStrEq{#1}{fulllines}%
12625 {\toggletrue{fulllines@}}%
12626 {}%
12627 \xdef\@currentseries{appref}%
12628 \ifdefempty{\apprefprefixmore}%
12629 {\apprefprefixsingle}%
12630 {%
12631 \IfEq{\xlineref{#2:start}}{\xlineref{#2:end}}%
12632 {\apprefprefixsingle}%
12633 {\apprefprefixmore}%
12634 }%
12635 \printlines\xpageref{#2:start}|\xlineref{#2:start}|\xsublineref{#2:start}|\xpageref{#2:end}|\xlineref{#2:end}|\xsublineref{#2:end}||%
12636 \togglefalse{fulllines@}%
12637 }%
12638
12639 % \changes{v1.23.0}{2015/05/18}{Debug \cs{Xendtwolines}, \cs{Xendmorethantwolines}, \cs{Xendtwolinesbutnotmore} and \cs{Xendtwolinesonlyinsamepage} when using \cs{apprefwithpage}.}
12640 \newcommandx{\apprefwithpage}[2][1,usedefault]{%
12641 \IfStrEq{#1}{fulllines}%
12642 {\toggletrue{fulllines@}}%
12643 {}%
12644 \xdef\@currentseries{apprefwithpage}%
12645 \printendlines\xpageref{#2:start}|\xlineref{#2:start}|\xsublineref{#2:start}|\xpageref{#2:end}|\xlineref{#2:end}|\xsublineref{#2:end}||%
12646 \togglefalse{fulllines@}%
12647 }%
12648 % \end{macrocode}
12649 % \end{macro}
12650 % \end{macro}
12651 % \end{macro}
12652 % \end{macro}
12653 % \begin{macro}{\edmakelabel}
12654 % Sometimes the \cs{edlabel} command cannot be used to specify
12655 % exactly the page and line desired; you can use the \cs{edmakelabel} macro
12656 % make your own label. For example, if you say
12657 % `\verb"\edmakelabel{elephant}{10|25|0}"' you will have created a
12658 % new label, and a later call to \verb"\edpageref{elephant}" would
12659 % print `10' and \verb"\lineref{elephant}" would print `25'.
12660 % The sub-line number here is zero.
12661 % \cs{edmakelabel} takes a label, followed by a page and a line number(s)
12662 % as arguments.
12663 % LaTeX defines a \cs{makelabel} macro which is used in lists.
12664 % I've changed the name to \cs{edmakelabel}.
12665 % \begin{macrocode}
12666 \newcommand*{\edmakelabel}[2]{\expandafter\xdef\csname the@label#1\endcsname{#2}}
12667
12668 % \end{macrocode}
12669 % (If you are only going to refer to such a label using
12670 % \cs{xxref}, then you can omit entries in the same way as with
12671 % \cs{linenum} (see \reff{linenumdef} and
12672 % \reff{linenumbers}), since \cs{xxref} makes a call to
12673 % \cs{linenum} in order to do its work.)
12674 % \end{macro}
12675 %
12676 %
12677 %
12678 % \section{Side notes}
12679 %
12680 % Regular \verb?\marginpar?s do not work inside numbered text --- they
12681 % don't produce any note but do put an extra unnumbered blank line into
12682 % the text.
12683 %
12684 % \begin{macro}{\l@dold@xympar}
12685 % \begin{macro}{\@xympar}
12686 % Changing \verb?\@xympar? a little at least ensures that \verb?\marginpar?s
12687 % in numbered text do not disturb the flow.
12688 % \changes{v0.5.0}{2004/04/0}{Eliminated \cs{marginpar} disturbance}
12689 % \begin{macrocode}
12690 \let\l@dold@xympar\@xympar
12691 \renewcommand{\@xympar}{%
12692 \ifnumberedpar@
12693 \led@warn@NoMarginpars
12694 \@esphack
12695 \else
12696 \l@dold@xympar
12697 \fi}
12698
12699 % \end{macrocode}
12700 % \end{macro}
12701 % \end{macro}
12702 %
12703 % We provide side notes as replacement for \verb?\marginpar? in numbered text.
12704 % \changes{v0.5.0}{2004/04/03}{Added left and right side notes}
12705 % \changes{v0.5.1}{2004/04/10}{Added moveable side note}
12706 %
12707 % \begin{macro}{\sidenote@margin}
12708 % \begin{macro}{\sidenotemargin}
12709 % \begin{macro}{\l@dgetsidenote@margin}
12710 % These are the sidenote equivalents to \cs{line@margin} and \cs{linenummargin}
12711 % for specifying which margin. The default is the right margin (opposite to
12712 % the default for line numbers).
12713 % \cs{l@dgetsidenote@margin} returns the number associated to side note margin:
12714 % \begin{description}
12715 % \item[left] : 0
12716 % \item[right] : 1
12717 % \item[outer] : 2
12718 % \item[inner] : 3
12719 % \end{description}
12720 % \changes{v0.5.1}{2004/04/10}{Added \cs{sidenotemargin} and \cs{sidenote@margin}}
12721 % \changes{v0.7.0}{2005/02/23}{Added \cs{l@dgetsidenote@margin}}
12722 % \changes{v1.12.0}{2014/08/05}{\cs{sidenotemargin} is now directly defined in \Lpack{eledmac} to be able to manage \Lpack{eledpar}.}
12723 % \begin{macrocode}
12724 \newcount\sidenote@margin
12725 \newcommand*{\sidenotemargin}[1]{{%
12726 \l@dgetsidenote@margin{#1}%
12727 \ifnum\@l@dtempcntb>\m@ne
12728 \ifledRcol
12729 \global\sidenote@marginR=\@l@dtempcntb
12730 \else
12731 \global\sidenote@margin=\@l@dtempcntb
12732 \fi
12733 \fi}}
12734 \newcommand*{\l@dgetsidenote@margin}[1]{%
12735 \def\@tempa{#1}\def\@tempb{left}%
12736 \ifx\@tempa\@tempb
12737 \@l@dtempcntb \z@
12738 \else
12739 \def\@tempb{right}%
12740 \ifx\@tempa\@tempb
12741 \@l@dtempcntb \@ne
12742 \else
12743 \def\@tempb{outer}%
12744 \ifx\@tempa\@tempb
12745 \@l@dtempcntb \tw@
12746 \else
12747 \def\@tempb{inner}%
12748 \ifx\@tempa\@tempb
12749 \@l@dtempcntb \thr@@
12750 \else
12751 \led@warn@BadSidenotemargin
12752 \@l@dtempcntb \m@ne
12753 \fi
12754 \fi
12755 \fi
12756 \fi}
12757 \sidenotemargin{right}
12758
12759 % \end{macrocode}
12760 % \end{macro}
12761 % \end{macro}
12762 % \end{macro}
12763 %
12764 % \begin{macro}{\l@dlp@rbox}
12765 % \begin{macro}{\l@drp@rbox}
12766 % We need two boxes to store sidenote texts.
12767 % \begin{macrocode}
12768 \newbox\l@dlp@rbox
12769 \newbox\l@drp@rbox
12770
12771 % \end{macrocode}
12772 % \end{macro}
12773 % \end{macro}
12774 %
12775 %
12776 % \begin{macro}{\ledlsnotewidth}
12777 % \begin{macro}{\ledrsnotewidth}
12778 % \begin{macro}{\ledlsnotesep}
12779 % \begin{macro}{\ledrsnotesep}
12780 % \begin{macro}{\ledlsnotefontsetup}
12781 % \begin{macro}{\ledrsnotefontsetup}
12782 % These specify the width of the left/right boxes (initialised to
12783 % \verb?\marginparwidth?, their distance from
12784 % the text (initialised to \verb?\linenumsep?, and the fonts used.
12785 % \begin{macrocode}
12786 \newdimen\ledlsnotewidth \ledlsnotewidth=\marginparwidth
12787 \newdimen\ledrsnotewidth \ledrsnotewidth=\marginparwidth
12788 \newdimen\ledlsnotesep \ledlsnotesep=\linenumsep
12789 \newdimen\ledrsnotesep \ledrsnotesep=\linenumsep
12790 \newcommand*{\ledlsnotefontsetup}{\raggedleft\footnotesize}
12791 \newcommand*{\ledrsnotefontsetup}{\raggedright\footnotesize}
12792
12793 % \end{macrocode}
12794 % \end{macro}
12795 % \end{macro}
12796 % \end{macro}
12797 % \end{macro}
12798 % \end{macro}
12799 % \end{macro}
12800 %
12801 %
12802 % \begin{macro}{\ledleftnote}
12803 % \begin{macro}{\ledrightnote}
12804 % \begin{macro}{\ledinnernote}
12805 % \begin{macro}{\ledouterote}
12806 % \begin{macro}{\ledsidenote}
12807 % \cs{ledleftnote}, \cs{ledrightnote}, \cs{ledinnernote}, \cs{ledouternote} are the
12808 % user commands for left, right, inner and outer sidenotes.
12809 % The two last one are just alias for the two first one, depending of the page number.
12810 % \verb?\ledsidenote?\marg{text} is the command for a moveable sidenote.
12811 % \begin{macrocode}
12812 \newcommand*{\ledleftnote}[1]{\edtext{}{\l@dlsnote{#1}}}
12813 \newcommand*{\ledrightnote}[1]{\edtext{}{\l@drsnote{#1}}}
12814
12815 \newcommand*{\ledinnernote}[1]{%
12816 \ifodd\c@page% Do not use \page@num, because it is not yet calculated when command is called
12817 \ledleftnote{#1}%
12818 \else%
12819 \ledrightnote{#1}%
12820 \fi%
12821 }
12822
12823 \newcommand*{\ledouternote}[1]{%
12824 \ifodd\c@page% Do not use \page@num, because it is not yet calculated when command is called
12825 \ledrightnote{#1}%
12826 \else%
12827 \ledleftnote{#1}%
12828 \fi%
12829 }
12830
12831 \newcommand*{\ledsidenote}[1]{\edtext{}{\l@dcsnote{#1}}}
12832 % \end{macrocode}
12833 % \end{macro}
12834 % \end{macro}
12835 % \end{macro}
12836 % \end{macro}
12837 % \end{macro}
12838 %
12839 %
12840 % \begin{macro}{\l@dlsnote}
12841 % \begin{macro}{\l@drsnote}
12842 % \begin{macro}{\l@dcsnote}
12843 % \changes{v1.12.0}{2014/08/05}{\cs{l@dlsnote},\cs{l@drsnote} and \cs{l@dcsnote} defined only one time, in \Lpack{eledmac}, including needs for eledpar case.}.
12844 % The `footnotes' for left, right, and moveable sidenotes. The whole
12845 % scheme is reminiscent of the critical footnotes code.
12846 % \begin{macrocode}
12847 \newif\ifrightnoteup
12848 \rightnoteuptrue
12849
12850 \newcommand*{\l@dlsnote}[1]{%
12851 \begingroup%
12852 \newcommand{\content}{#1}%
12853 \ifnumberedpar@
12854 \ifledRcol%
12855 \xright@appenditem{\noexpand\vl@dlsnote{\expandonce\content}}%
12856 \to\inserts@listR
12857 \global\advance\insert@countR \@ne%
12858 \else%
12859 \xright@appenditem{\noexpand\vl@dlsnote{\expandonce\content}}%
12860 \to\inserts@list
12861 \global\advance\insert@count \@ne%
12862 \fi
12863 \fi\ignorespaces\endgroup}
12864
12865 \newcommand*{\l@drsnote}[1]{%
12866 \begingroup%
12867 \newcommand{\content}{#1}%
12868 \ifnumberedpar@
12869 \ifledRcol%
12870 \xright@appenditem{\noexpand\vl@drsnote{\expandonce\content}}%
12871 \to\inserts@listR
12872 \global\advance\insert@countR \@ne%
12873 \else%
12874 \xright@appenditem{\noexpand\vl@drsnote{\expandonce\content}}%
12875 \to\inserts@list
12876 \global\advance\insert@count \@ne%
12877 \fi
12878 \fi\ignorespaces\endgroup}
12879
12880 \newcommand*{\l@dcsnote}[1]{%
12881 \begingroup%
12882 \newcommand{\content}{#1}%
12883 \ifnumberedpar@
12884 \ifledRcol%
12885 \xright@appenditem{\noexpand\vl@dcsnote{\expandonce\content}}%
12886 \to\inserts@listR
12887 \global\advance\insert@countR \@ne%
12888 \else%
12889 \xright@appenditem{\noexpand\vl@dcsnote{\expandonce\content}}%
12890 \to\inserts@list
12891 \global\advance\insert@count \@ne%
12892 \fi
12893 \fi\ignorespaces\endgroup}
12894
12895 % \end{macrocode}
12896 % \end{macro}
12897 % \end{macro}
12898 % \end{macro}
12899 %
12900 % \begin{macro}{\vl@dlsnote}
12901 % \begin{macro}{\vl@drsnote}
12902 % \begin{macro}{\vl@dcsnote}
12903 % Put the left/right text into boxes, but just save the moveable text.
12904 % \cs{l@dcsnotetext}, \cs{l@dcsnotetext@l} and \cs{l@dcsnotetext@r} are etoolbox lists which will store the content of side notes.
12905 % We store the content in lists, because we need to loop later on them, in case many sidenote co-exist for the same line.
12906 % That is there some special test to do, in order to:
12907 % \begin{itemize}
12908 % \item Store the content of \cs{ledsidenote} to \cs{l@dcsnotetext} in any cases.
12909 % \item Store the content of \cs{rightsidenote} to:
12910 % \begin{itemize}
12911 % \item \cs{l@dcsnotetext} if \cs{ledsidenote} is to be put on right.
12912 % \item \cs{l@dcsnotetext@r} if \cs{ledsidenote} is to be put on left.
12913 % \end{itemize}
12914 % \item Store the content of \cs{leftsidenote} to:
12915 % \begin{itemize}
12916 % \item \cs{l@dcsnotetext} if \cs{ledsidenote} is to be put on left.
12917 % \item \cs{l@dcsnotetext@l} if \cs{ledsidenote} is to be put on right.
12918 % \end{itemize}
12919 % \end{itemize}
12920 % \begin{macrocode}
12921 \newcommand*{\vl@dlsnote}[1]{%
12922 \ifledRcol@%
12923 \@l@dtempcntb=\sidenote@marginR%
12924 \ifnum\@l@dtempcntb>\@ne%
12925 \advance\@l@dtempcntb by\page@numR%
12926 \fi%
12927 \else%
12928 \@l@dtempcntb=\sidenote@margin%
12929 \ifnum\@l@dtempcntb>\@ne%
12930 \advance\@l@dtempcntb by\page@num%
12931 \fi%
12932 \fi%
12933 \ifodd\@l@dtempcntb%
12934 \listgadd{\l@dcsnotetext@l}{#1}%
12935 \else%
12936 \listgadd{\l@dcsnotetext}{#1}%
12937 \fi
12938 }
12939 \newcommand*{\vl@drsnote}[1]{%
12940 \ifledRcol@%
12941 \@l@dtempcntb=\sidenote@marginR%
12942 \ifnum\@l@dtempcntb>\@ne%
12943 \advance\@l@dtempcntb by\page@numR%
12944 \fi%
12945 \else%
12946 \@l@dtempcntb=\sidenote@margin%
12947 \ifnum\@l@dtempcntb>\@ne%
12948 \advance\@l@dtempcntb by\page@num%
12949 \fi%
12950 \fi%
12951 \ifodd\@l@dtempcntb%
12952 \listgadd{\l@dcsnotetext}{#1}%
12953 \else%
12954 \listgadd{\l@dcsnotetext@r}{#1}%
12955 \fi%
12956 }
12957 \newcommand*{\vl@dcsnote}[1]{\listgadd{\l@dcsnotetext}{#1}}
12958
12959 % \end{macrocode}
12960 % \end{macro}
12961 % \end{macro}
12962 % \end{macro}
12963 %
12964 %
12965 % \begin{macro}{\setl@dlp@rbox}
12966 % \begin{macro}{\setl@drpr@box}
12967 % \verb?\setl@dlprbox?\marg{lednums}\marg{tag}\marg{text} puts \meta{text}
12968 % into the \verb?\l@dlp@rbox? box. And similarly for the right side box.
12969 % It is these boxes that finally
12970 % get displayed in the margins.
12971 % \begin{macrocode}
12972 \newcommand*{\setl@dlp@rbox}[1]{%
12973 {\parindent\z@\hsize=\ledlsnotewidth\ledlsnotefontsetup
12974 \global\setbox\l@dlp@rbox
12975 \ifleftnoteup
12976 =\vbox to\z@{\vss #1}%
12977 \else
12978 =\vbox to 0.70\baselineskip{\strut#1\vss}%
12979 \fi}}
12980 \newcommand*{\setl@drp@rbox}[1]{%
12981 {\parindent\z@\hsize=\ledrsnotewidth\ledrsnotefontsetup
12982 \global\setbox\l@drp@rbox
12983 \ifrightnoteup
12984 =\vbox to\z@{\vss#1}%
12985 \else
12986 =\vbox to0.7\baselineskip{\strut#1\vss}%
12987 \fi}}
12988 \newif\ifleftnoteup
12989 \leftnoteuptrue
12990 % \end{macrocode}
12991 % \end{macro}
12992 % \end{macro}
12993 %
12994 % \begin{macro}{\sidenotesep}
12995 % This macro is used to separate sidenotes of the same line.
12996 % \begin{macrocode}
12997 \newcommand{\sidenotesep}{, }
12998 % \end{macrocode}
12999 % \end{macro}
13000 % \begin{macro}{\affixside@note}
13001 % This macro puts any moveable sidenote text into the left or right sidenote
13002 % box, depending on which margin it is meant to go in. It's a very much
13003 % stripped down version of \cs{affixlin@num}.
13004 %
13005 % Before do it, we concatenate all moveable sidenotes of the line, using \cs{sidenotesep} as separator.
13006 % It's the result that we put on the sidenote.
13007 % \changes{v1.4.1}{2012/11/16}{Remove spurious spaces.}
13008 % \begin{macrocode}
13009 \newcommand*{\affixside@note}{%
13010 \def\sidenotecontent@{}%
13011 \numgdef{\itemcount@}{0}%
13012 \def\do##1{%
13013 \ifnumequal{\itemcount@}{0}%
13014 {%
13015 \appto\sidenotecontent@{##1}}% Not print not separator before the 1st note
13016 {\appto\sidenotecontent@{\sidenotesep ##1}%
13017 }%
13018 \numgdef{\itemcount@}{\itemcount@+1}%
13019 }%
13020 \dolistloop{\l@dcsnotetext}%
13021 \ifnumgreater{\itemcount@}{1}{\led@err@ManySidenotes}{}%
13022 % \end{macrocode}
13023 % And we do the same for left and right notes (not movable).
13024 % \begin{macrocode}
13025 \gdef\@templ@d{}%
13026 \gdef\@templ@n{\l@dcsnotetext\l@dcsnotetext@l\l@dcsnotetext@r}%
13027 \ifx\@templ@d\@templ@n \else%
13028 \if@twocolumn%
13029 \if@firstcolumn%
13030 \setl@dlp@rbox{##1}{\sidenotecontent@}%
13031 \else%
13032 \setl@drp@rbox{\sidenotecontent@}%
13033 \fi%
13034 \else%
13035 \@l@dtempcntb=\sidenote@margin%
13036 \ifnum\@l@dtempcntb>\@ne%
13037 \advance\@l@dtempcntb by\page@num%
13038 \fi%
13039 \ifodd\@l@dtempcntb%
13040 \setl@drp@rbox{\sidenotecontent@}%
13041 \gdef\sidenotecontent@{}%
13042 \numgdef{\itemcount@}{0}%
13043 \dolistloop{\l@dcsnotetext@l}%
13044 \ifnumgreater{\itemcount@}{1}{\led@err@ManyLeftnotes}{}%
13045 \setl@dlp@rbox{\sidenotecontent@}%
13046 \else%
13047 \setl@dlp@rbox{\sidenotecontent@}%
13048 \gdef\sidenotecontent@{}%
13049 \numgdef{\itemcount@}{0}%
13050 \dolistloop{\l@dcsnotetext@r}%
13051 \ifnumgreater{\itemcount@}{1}{\led@err@ManyRightnotes}{}%
13052 \setl@drp@rbox{\sidenotecontent@}%
13053 \fi%
13054 \fi%
13055 \fi%
13056 }
13057 % \end{macrocode}
13058 % \end{macro}%
13059 %
13060 %
13061 %
13062 %
13063 % \section{Minipages and such}
13064 %
13065 % We can put footnotes into minipages. The preparatory code has
13066 % been set up earlier, all that remains is to ensure that it is available
13067 % inside a minipage box. This requires some alteration to the kernel code,
13068 % specifically the \verb?\@iiiminipage? and \verb?\endminipage? macros.
13069 % We'll arrange this so that additional series can be easily added.
13070 %
13071 % \begin{macro}{\l@dfeetbeginmini}
13072 % \begin{macro}{\l@dfeetendmini}
13073 % \changes{v1.9.0}{2014/02/05}{Add \cs{mpfnpos} to choice the order of footnotes in minipage / ledgroup.}
13074 % These will be the hooks in \verb?\@iiiminpage? and \verb?\endminipage?
13075 % They can be extended to handle other things if necessary.
13076 % \changes{v0.4.0}{2004/02/29}{Added \cs{l@dfeetbeginmini}, \cs{l@dfeetendmini}
13077 % and all their supporting code}
13078 % \begin{macrocode}
13079 \ifnoledgroup@\else%
13080 \newcommand*{\l@dfeetbeginmini}{\l@dedbeginmini\l@dfambeginmini}
13081 \newcommand*{\l@dfeetendmini}{%
13082 \IfStrEq{critical-familiar}{\@mpfnpos}%
13083 {\l@dedendmini\l@dfamendmini}%
13084 {%
13085 \IfStrEq{familiar-critical}{\@mpfnpos}%
13086 {\l@dfamendmini\l@dedendmini}%
13087 {\l@dedendmini\l@dfamendmini}%
13088 }%
13089 }%
13090 % \end{macrocode}
13091 % \end{macro}
13092 % \end{macro}
13093 %
13094 % \begin{macro}{\l@dedbeginmini}
13095 % \begin{macro}{\l@dedendmini}
13096 % These handle the initiation and closure of critical footnotes in a
13097 % minipage environment.
13098 % \begin{macrocode}
13099 \newcommand*{\l@dedbeginmini}{%
13100 \unless\ifnocritical@%
13101 \def\do##1{\csletcs{v##1footnote}{mpv##1footnote}}%
13102 \dolistloop{\@series}%
13103 \fi%
13104 }
13105 \newcommand*{\l@dedendmini}{%
13106 \unless\ifnocritical@%
13107 \ifl@dpairing%
13108 \ifledRcol%
13109 \flush@notesR%
13110 \else%
13111 \flush@notes%
13112 \fi%
13113 \fi
13114 \def\do##1{%
13115 \ifvoid\csuse{mp##1footins}\else%
13116 \ifl@dpairing\ifparledgroup%
13117 \ifledRcol%
13118 \dimgdef{\parledgroup@beforenotesR}{\parledgroup@beforenotesR+\skip\@nameuse{mp##1footins}}%
13119 \else%
13120 \dimgdef{\parledgroup@beforenotesL}{\parledgroup@beforenotesL+\skip\@nameuse{mp##1footins}}%
13121 \fi%
13122 \fi\fi%
13123 \csuse{mp##1footgroup}{##1}%
13124 \fi}%
13125 \dolistloop{\@series}%
13126 \fi%
13127 }%
13128
13129 % \end{macrocode}
13130 % \end{macro}
13131 % \end{macro}
13132 %
13133 % \begin{macro}{\l@dfambeginmini}
13134 % \begin{macro}{\l@dfamendmini}
13135 % These handle the initiation and closure of familiar footnotes in a
13136 % minipage environment.
13137 % \begin{macrocode}
13138 \newcommand*{\l@dfambeginmini}{%
13139 \unless\ifnofamiliar@%
13140 \def\do##1{\csletcs{vfootnote##1}{mpvfootnote##1}}%
13141 \dolistloop{\@series}%
13142 \fi%
13143 }%
13144
13145 \newcommand*{\l@dfamendmini}{%
13146 \unless\ifnofamiliar@%
13147 \def\do##1{\ifvoid\csuse{mpfootins##1}\else\csuse{mpfootgroup##1}{##1}\fi}%
13148 \dolistloop{\@series}%
13149 \fi%
13150 }%
13151 % \end{macrocode}
13152 % \end{macro}
13153 % \end{macro}
13154 %
13155 % \begin{macro}{\@iiiminipage}
13156 % This is our extended form of the kernel \verb?\@iiiminipage? defined in
13157 % \file{ltboxes.dtx}.
13158 % \changes{v0.4.0}{2004/02/29}{Modified kernel \cs{@iiiminipage} and
13159 % \cs{endminipage} to cater for critical footnotes}
13160 % \begin{macrocode}
13161 \def\@iiiminipage#1#2[#3]#4{%
13162 \leavevmode
13163 \@pboxswfalse
13164 \setlength\@tempdima{#4}%
13165 \def\@mpargs{{#1}{#2}[#3]{#4}}%
13166 \setbox\@tempboxa\vbox\bgroup
13167 \color@begingroup
13168 \hsize\@tempdima
13169 \textwidth\hsize \columnwidth\hsize
13170 \@parboxrestore
13171 \def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c@mpfootnote\z@
13172 \let\@footnotetext\@mpfootnotetext
13173 % \end{macrocode}
13174 % The next line is our addition to the original.
13175 % \begin{macrocode}
13176 \l@dfeetbeginmini% added
13177 \let\@listdepth\@mplistdepth \@mplistdepth\z@
13178 \@minipagerestore
13179 \@setminipage}
13180
13181 % \end{macrocode}
13182 % \end{macro}
13183 %
13184 % \begin{macro}{\endminipage}
13185 % This is our extended form of the kernel \verb?\endminipage? defined in
13186 % \file{ltboxes.dtx}.
13187 % \begin{macrocode}
13188 \def\endminipage{%
13189 \par
13190 \unskip
13191 \ifvoid\@mpfootins\else
13192 \l@dunboxmpfoot
13193 \fi
13194 % \end{macrocode}
13195 % The next line is our addition to the original.
13196 % \begin{macrocode}
13197 \l@dfeetendmini% added
13198 \@minipagefalse
13199 \color@endgroup
13200 \egroup
13201 \expandafter\@iiiparbox\@mpargs{\unvbox\@tempboxa}}
13202
13203 % \end{macrocode}
13204 % \end{macro}
13205 %
13206 % \begin{macro}{\l@dunboxmpfoot}
13207 % \changes{v0.7.0}{2005/02/18}{Added \cs{l@dunboxmpfoot} containing
13208 % some common code}
13209 % \begin{macrocode}
13210 \newcommand*{\l@dunboxmpfoot}{%
13211 \vskip\skip\@mpfootins
13212 \normalcolor
13213 \footnoterule
13214 \ifparledgroup
13215 \ifl@dpairing
13216 \ifledRcol
13217 \dimgdef{\parledgroup@beforenotesR}{\parledgroup@beforenotesR+\skip\@mpfootins}
13218 \else
13219 \dimgdef{\parledgroup@beforenotesL}{\parledgroup@beforenotesL+\skip\@mpfootins}
13220 \fi
13221 \fi
13222 \fi
13223 \unvbox\@mpfootins}
13224
13225 % \end{macrocode}
13226 % \end{macro}
13227 %
13228 %
13229 % \begin{environment}{ledgroup}
13230 % This environment puts footnotes at the end, even if that happens to
13231 % be in the middle of a page, or crossing a page boundary. It is a sort
13232 % of unboxed, fixed width minipage.
13233 % \changes{v0.4.0}{2004/02/29}{Added ledgroup environment}
13234 % \begin{macrocode}
13235 \newenvironment{ledgroup}{%
13236 \resetprevpage@num%
13237 \def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c@mpfootnote\z@%
13238 \let\@footnotetext\@mpfootnotetext
13239 \l@dfeetbeginmini%
13240 }{%
13241 \par
13242 \unskip
13243 \ifvoid\@mpfootins\else
13244 \l@dunboxmpfoot
13245 \fi
13246 \l@dfeetendmini%
13247 }
13248
13249 % \end{macrocode}
13250 % \end{environment}
13251 %
13252 % \begin{environment}{ledgroupsized}
13253 % \verb?\begin{ledgroupsized}?\oarg{pos}\marg{width} \\
13254 % This environment puts footnotes at the end, even if that happens to
13255 % be in the middle of a page, or crossing a page boundary. It is a sort
13256 % of unboxed, variable \meta{width} minipage. The optional \meta{pos}
13257 % controls the sideways position of numbered text.
13258 % \changes{v0.4.0}{2004/02/29}{Added ledgroupsized environment}
13259 % \changes{v0.5.1}{2004/04/10}{Only change \cs{hsize} in ledgroupsized
13260 % environment otherwise page number can be in wrong place}
13261 % \begin{macrocode}
13262 \newenvironment{ledgroupsized}[2][l]{%
13263 % \end{macrocode}
13264 % Set the various text measures.
13265 % \begin{macrocode}
13266 \hsize #2\relax
13267 %% \textwidth #2\relax
13268 %% \columnwidth #2\relax
13269 % \end{macrocode}
13270 % Initialize fills for centering.
13271 % \begin{macrocode}
13272 \let\ledllfill\hfil
13273 \let\ledrlfill\hfil
13274 \def\@tempa{#1}\def\@tempb{l}%
13275 % \end{macrocode}
13276 % Left adjusted numbered lines
13277 % \begin{macrocode}
13278 \ifx\@tempa\@tempb
13279 \let\ledllfill\relax
13280 \else
13281 \def\@tempb{r}%
13282 \ifx\@tempa\@tempb
13283 % \end{macrocode}
13284 % Right adjusted numbered lines
13285 % \begin{macrocode}
13286 \let\ledrlfill\relax
13287 \fi
13288 \fi
13289 % \end{macrocode}
13290 % Set up the footnoting.
13291 % \begin{macrocode}
13292 \def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c@mpfootnote\z@
13293 \let\@footnotetext\@mpfootnotetext
13294 \l@dfeetbeginmini%
13295 }{%
13296 \par
13297 \unskip
13298 \ifvoid\@mpfootins\else
13299 \l@dunboxmpfoot
13300 \fi
13301 \l@dfeetendmini%
13302 }
13303
13304 % \end{macrocode}
13305 % \end{environment}
13306 %
13307 % Close the \cs{ifnoledgroup@}\cs{else}.
13308 % \begin{macrocode}
13309 \fi%
13310 % \end{macrocode}
13311 % \begin{macro}{\ifledgroupnotesL@}
13312 % \begin{macro}{\ifledgroupnotesR@}
13313 % These boolean tests check if we are in the notes of a ledgroup. If we are, we don't number the lines.
13314 % \begin{macrocode}
13315 \newif\ifledgroupnotesL@
13316 \newif\ifledgroupnotesR@
13317 % \end{macrocode}
13318 % \end{macro}
13319 % \end{macro}
13320 % \section{Indexing}
13321 %
13322 % \changes{v1.5.0}{2013/07/11}{Correct indexing when the call is made in critical notes.}
13323 % \changes{v1.8.0}{2014/07/21}{If \Lpack{imakeidx} and \Lpack{hyperref} are loaded, adds hyperref in the index.}
13324 % \changes{v1.8.5}{2014/08/28}{Debug indexing in right column, with eledpar.}
13325 % Here's some code for indexing using page \& line numbers.
13326 %
13327 % First, ensure that \Lpack{imakeidx} or \Lpack{indextools} is loaded \emph{before} \Lpack{eledmac}.
13328 % \changes{v1.12.0}{2014/08/05}{Ensure that \Lpack{imakeidx} is loaded \emph{before} \Lpack{eledmac}}
13329 % \begin{macrocode}
13330 \AtBeginDocument{%
13331 \unless\ifl@imakeidx%
13332 \@ifpackageloaded{imakeidx}{\led@error@ImakeidxAfterEledmac}{}%
13333 \fi%
13334 \unless\ifl@indextools%
13335 \@ifpackageloaded{indextools}{\led@error@indextoolsAfterEledmac}{}%
13336 \fi%
13337 }
13338 % \end{macrocode}
13339 % \begin{macro}{\pagelinesep}
13340 % \begin{macro}{\edindexlab}
13341 % \begin{macro}{\c@labidx}
13342 % In order to get a correct line number we have to use the label/ref
13343 % mechanism. These macros are for that.
13344 % \begin{macrocode}
13345 \newcommand{\pagelinesep}{-}
13346 \newcommand{\edindexlab}{$&}
13347 \newcounter{labidx}
13348 \setcounter{labidx}{0}
13349
13350 % \end{macrocode}
13351 % \end{macro}
13352 % \end{macro}
13353 % \end{macro}
13354 %
13355 % \begin{macro}{\doedindexlabel}
13356 % This macro sets an |\edlabel|.
13357 % \begin{macrocode}
13358 \newcommand{\doedindexlabel}{\stepcounter{labidx}%
13359 \edlabel{\edindexlab\thelabidx}}
13360
13361 % \end{macrocode}
13362 % \end{macro}
13363 %
13364 % \begin{macro}{\thepageline}
13365 % This macro makes up the page/line number combo from the label/ref.
13366 % \begin{macrocode}
13367 \newcommand{\thepageline}{%
13368 \thepage\pagelinesep\xlineref{\edindexlab\thelabidx}}
13369 % \end{macrocode}
13370 % \end{macro}
13371 %
13372 % \begin{macro}{\thestartpageline}
13373 % \begin{macro}{\theendpageline}
13374 % These macros make up the page/line start/end number when the \cs{edindex} command is called in critical notes.
13375 % \begin{macrocode}
13376 \newcommand{\thestartpageline}{\l@dparsedstartpage\pagelinesep\l@dparsedstartline}
13377 \newcommand{\theendpageline}{\l@dparsedendpage\pagelinesep\l@dparsedendline}
13378 % \end{macrocode}
13379 % \end{macro}
13380 % \end{macro}
13381 %
13382 % \begin{macro}{\if@edindex@fornote@true}
13383 % This boolean test is switching at the beginning of each critical note,
13384 % to allow indexing in this note.
13385 % \begin{macrocode}
13386 \newif\if@edindex@fornote@
13387 % \end{macrocode}
13388 % \end{macro}
13389 % \begin{macro}{\prepare@edindex@fornote}
13390 % This macro is called at the beginning of each critical note.
13391 % It switches some parameters,
13392 % to allow indexing in this note, with reference to page and line number.
13393 % It also defines \cs{@ledinnote@command} which will be printed as an encapsulating command after the \verb+|+.
13394 % \begin{macrocode}
13395 \newcommand{\prepare@edindex@fornote}[1]{%
13396 \l@dp@rsefootspec#1|%
13397 \@edindex@fornote@true%
13398 }
13399 % \end{macrocode}
13400 % \end{macro}
13401 % \begin{macro}{\get@edindex@ledinnote@command}
13402 % The \cs{get@edindex@ledinnote@command} macro defines
13403 % a \cs{@ledinnote@command} command which is added as an attribute (text inserted after \verb+|+) of the next index entry.
13404 %
13405 % Consequently, we write the definition of the location reference attribute in the \verb+.xdy+ file.
13406 % \begin{macrocode}
13407 \newcommand{\get@edindex@ledinnote@command}{%
13408 \ifxindy@%
13409 \gdef\@ledinnote@command{%
13410 ledinnote\thelabidx%
13411 }%
13412 \ifxindyhyperref@%
13413 \immediate\write\eledmac@xindy@out{%
13414 (define-attributes ("ledinnote\thelabidx"))^^J
13415 \space\space(markup-locref^^J
13416 \eledmacmarkuplocrefdepth^^J
13417 :open "\string\ledinnote[\edindexlab\thelabidx]{\@index@command}{"^^J
13418 :close "}"^^J
13419 :attr "ledinnote\thelabidx"^^J
13420 )
13421 }%
13422 \else%
13423 \immediate\write\eledmac@xindy@out{%
13424 (define-attributes ("ledinnote\thelabidx"))^^J
13425 \space\space(markup-locref^^J
13426 \eledmacmarkuplocrefdepth^^J
13427 :open "\string\ledinnote{\@index@command}{"^^J
13428 :close "}"^^J
13429 :attr "ledinnote\thelabidx"^^J
13430 )
13431 }%
13432 \fi%
13433 % \end{macrocode}
13434 % If we do not use \verb+xindy+ option, \cs{@ledinnote@command} will produce
13435 % something like \verb+ledinnote{formatingcommand}+.
13436 % \begin{macrocode}
13437 \else%
13438 \gdef\@ledinnote@command{%
13439 ledinnote[\edindexlab\thelabidx]{\@index@command}%
13440 }%
13441 \fi%
13442 }
13443 % \end{macrocode}
13444 % \end{macro}
13445 % \begin{macro}{\get@index@command}
13446 % This macro is used to analyse if a text to be indexed has a command after a \verb+|+.
13447 % \changes{v1.8.0}{2014/07/21}{Debug \cs{get@index@command} and compatibility with \Lpack{hyperref} package.}
13448 % \begin{macrocode}
13449 \def\get@index@command#1|#2+{%
13450 \gdef\@index@txt{#1}%
13451 \gdef\@index@command{#2}%
13452 \xdef\@index@parenthesis{}%
13453 \IfBeginWith{\@index@command}{(}{%
13454 \StrGobbleLeft{\@index@command}{1}[\@index@command@]%
13455 \global\let\@index@command\@index@command@%
13456 \xdef\@index@parenthesis{(}%
13457 }{}%
13458 \IfBeginWith{\@index@command}{)}{%
13459 \StrGobbleLeft{\@index@command}{1}[\@index@command@]%
13460 \global\let\@index@command\@index@command@%
13461 \xdef\@index@parenthesis{)}%
13462 }{}%
13463 }
13464 % \end{macrocode}
13465 % \end{macro}
13466 % \begin{macro}{\ledinnote}
13467 % \changes{v1.22.0}{2015/04/25}{\cs{ledinnote} takes a fisrt optional argument, which is the label for hyperlinks.}
13468 % \begin{macro}{\ledinnotehyperpage}
13469 % \begin{macro}{\ledinnotemark}
13470 % \changes{v1.21.0}{2015/04/13}{Add \cs{ledinnotemark}.}
13471 % These macros are used to specifiy that an index reference points to a note.
13472 % Arguments of \cs{ledinnote} are: \verb+#1+ (optional): the label for the hyperlink, \verb+#2+: command applied to the number, \verb+#3+: the number itself.
13473 % \begin{macrocode}
13474 \newcommandx{\ledinnote}[3][1,usedefault]{%
13475 \ifboolexpr{%
13476 test{\ifdefequal{\iftrue}{\ifHy@hyperindex}}%
13477 or%
13478 bool {xindyhyperref@}%
13479 }%
13480 {%
13481 \csuse{#2}{\hyperlink{#1}{\ledinnotemark{#3}}}%
13482 }%
13483 {%
13484 \csuse{#2}{\ledinnotemark{#3}}%
13485 }%
13486 }%
13487 \newcommand{\ledinnotehyperpage}[2]{\csuse{#1}{\ledinnotemark{\hyperpage{#2}}}}%
13488 \newcommand{\ledinnotemark}[1]{#1\emph{n}}%
13489 % \end{macrocode}
13490 % \end{macro}
13491 % \end{macro}
13492 % \end{macro}
13493 % The \Lpack{memoir} class provides more flexible indexing than the
13494 % standard classes. We need different code if the \Lpack{memoir}
13495 % class is being used, except if \Lpack{imakeidx} or \Lpack{indextools} is used.
13496 % \begin{macro}{\edindex}
13497 % \changes{v0.4.1}{2003/03/29}{Let eledmac take advantage of memoir's indexing}
13498 % \changes{v1.5.0}{2013/07/11}{Compatibility with \Lpack{imakeidx} package, and possibility to use multiple index with \cs{edindex}.}
13499 % \changes{v1.12.0}{2014/08/05}{Use correctly default index when \Lpack{imakeidx} is loaded.}
13500 % \changes{v1.14.0}{2014/10/27}{Let eledmac take advantage of imakeidx even when memoir class is used}
13501 % \subsection{Memoir compatibility}
13502 % \begin{macro}{\create@edindex@for@memoir}
13503 % \cs{create@edindex@for@memoir} define the \cs{edindex} command and related tool when:
13504 % \begin{enumerate}
13505 % \item Memoir class is used.
13506 % \item AND \Lpack{imakeidx} is not used.
13507 % \item AND \Lpack{indextools} is not used.
13508 % \end{enumerate}
13509 % Need to add the definition of |\edindex| to |\makeindex|, and initialise
13510 % |\edindex| to do nothing. In this case |\edindex| has an optional
13511 % argument. We use the hook provided in \Lpack{memoir} v1.61.
13512 % \begin{macrocode}
13513 \def\create@edindex@for@memoir{
13514 % \end{macrocode}
13515 % \begin{macrocode}
13516 \g@addto@macro{\makememindexhook}{%
13517 \def\edindex{\@bsphack%
13518 \@ifnextchar [{\l@d@index}{\l@d@index[\jobname]}}}
13519 \newcommand{\edindex}[2][\jobname]{\@bsphack\@esphack}
13520 % \end{macrocode}
13521 %
13522 % \begin{macro}{\l@d@index}
13523 % |\l@d@index[file]| is the first stage of |\edindex|, handling the
13524 % |idx| file. This a virtually a verbatim copy of \Lpack{memoir}'s |\@index|,
13525 % the change being calling |\l@dwrindexm@m| instead of |\@wrindexm@m|.
13526 % \begin{macrocode}
13527 \def\l@d@index[##1]{%
13528 \@ifundefined{##1@idxfile}%
13529 {\ifreportnoidxfile
13530 \led@warn@NoIndexFile{##1}%
13531 \fi
13532 \begingroup
13533 \@sanitize
13534 \@nowrindex}%
13535 {\def\@idxfile{##1}%
13536 \doedindexlabel
13537 \begingroup
13538 \@sanitize
13539 \l@d@wrindexm@m}}
13540 % \end{macrocode}
13541 % \end{macro}
13542 %
13543 % \begin{macro}{\l@d@wrindexm@m}
13544 % \begin{macro}{\l@d@@wrindexhyp}
13545 % |\l@d@wrindexm@m{item}| writes the |idx| file name and the indexed
13546 % item to the |aux| file. These are almost verbatim copies of \Lpack{memoir}'s
13547 % |\@wrindexm@m| and |\@@wrindexhyp|.
13548 % \begin{macrocode}
13549 \newcommand{\l@d@wrindexm@m}[1]{\l@d@@wrindexhyp##1||\\}
13550 \def\l@d@@wrindexhyp##1|##2|##3\\{%
13551 \ifshowindexmark\@showidx{##1}\fi
13552 \ifx\\##2\\%
13553 \if@edindex@fornote@%
13554 \protected@write\@auxout{}%
13555 {\string\@@wrindexm@m{\@idxfile}{##1|(ledinnotehyperpage}{\thestartpageline}}%
13556 \protected@write\@auxout{}%
13557 {\string\@@wrindexm@m{\@idxfile}{##1|)ledinnotehyperpage}{\theendpageline}}%
13558 \else%
13559 \protected@write\@auxout{}%
13560 {\string\@@wrindexm@m{\@idxfile}{##1|hyperpage}{\thepageline}}%
13561 \fi%
13562 \else
13563 \def\Hy@temp@A{##2}%
13564 \ifx\Hy@temp@A\HyInd@ParenLeft
13565 \if@edindex@fornote@%
13566 \protected@write\@auxout{}%
13567 {\string\@@wrindexm@m{\@idxfile}{##1|(ledinnotehyperpage{##2}}{\thestartpageline}}%
13568 \protected@write\@auxout{}%
13569 {\string\@@wrindexm@m{\@idxfile}{##1|)ledinnotehyperpage{##2}}{\theendpageline}}%
13570 \else%
13571 \protected@write\@auxout{}%
13572 {\string\@@wrindexm@m{\@idxfile}{##1|##2hyperpage}{\thepageline}}%
13573 \fi%
13574 \else
13575 \if@edindex@fornote@%
13576 \protected@write\@auxout{}%
13577 {\string\@@wrindexm@m{\@idxfile}{##1|(ledinnote{##2}}{\thestartpageline}}%
13578 \protected@write\@auxout{}%
13579 {\string\@@wrindexm@m{\@idxfile}{##1|)ledinnote{##2}}{\theendpageline}}%
13580 \else%
13581 \protected@write\@auxout{}%
13582 {\string\@@wrindexm@m{\@idxfile}{##1|##2}{\thepageline}}%
13583 \fi%
13584 \fi
13585 \fi
13586 \endgroup
13587 \@esphack}
13588 % \end{macrocode}
13589 % \end{macro}
13590 % \end{macro}
13591 % \end{macro}
13592 % This finishes the \Lpack{memoir}-specific code.
13593 % \begin{macrocode}
13594 }
13595 % \end{macrocode}
13596 % \subsection{Normal setting}
13597 % \begin{macro}{\create@edindex@notfor@memoir}
13598 % \cs{create@edindex@notfor@memoir} define the \cs{edindex} command and related tool when:
13599 % \begin{enumerate}
13600 % \item Memoir class is NOT used.
13601 % \item OR \Lpack{imakeidx} is used.
13602 % \item OR \Lpack{indextools} is used.
13603 % \end{enumerate}
13604 % \begin{macrocode}
13605 \def\create@edindex@notfor@memoir{
13606 % \end{macrocode}
13607 % \begin{macro}{\@wredindex}
13608 % Write the index information to the \file{idx} file.
13609 % \begin{macrocode}
13610 \newcommandx{\@wredindex}[2][1=\expandonce\jobname,usedefault]{%#1 = the index name, #2 = the text
13611 \global\let\old@Rlineflag\Rlineflag%
13612 \gdef\Rlineflag{}%
13613 \ifl@imakeidx%
13614 \if@edindex@fornote@%
13615 \IfSubStr[1]{##2}{|}{\get@index@command##2+}{\get@index@command##2|+}%
13616 \get@edindex@ledinnote@command%
13617 \expandafter\imki@wrindexentry{##1}{\@index@txt|(\@ledinnote@command}{\thestartpageline}%
13618 \expandafter\imki@wrindexentry{##1}{\@index@txt|)\@ledinnote@command}{\theendpageline}%
13619 \else%
13620 \get@edindex@hyperref{##2}%
13621 \imki@wrindexentry{##1}{\@index@txt\@edindex@hyperref}{\thepageline}%
13622 \fi%
13623 \else%
13624 \if@edindex@fornote@%
13625 \IfSubStr[1]{##2}{|}{\get@index@command##2+}{\get@index@command##2|+}%
13626 \get@edindex@ledinnote@command%
13627 \expandafter\protected@write\@indexfile{}%
13628 {\string\indexentry{\@index@txt|(\@ledinnote@command}{\thestartpageline}
13629 }%
13630 \expandafter\protected@write\@indexfile{}%
13631 {\string\indexentry{\@index@txt|)\@ledinnote@command}{\theendpageline}
13632 }%
13633 \else%
13634 \protected@write\@indexfile{}%
13635 {\string\indexentry{##2}{\thepageline}
13636 }%
13637 \fi%
13638 \fi%
13639 \endgroup
13640 \global\let\Rlineflag\old@Rlineflag%
13641 \@esphack}
13642 % \end{macrocode}
13643 % Need to add the definition of |\edindex| to |\makeindex|, and initialise
13644 % |\edindex| to do nothing.
13645 % \begin{macrocode}
13646 \pretocmd{\makeindex}{%
13647 \def\edindex{\@bsphack
13648 \doedindexlabel
13649 \begingroup
13650 \@sanitize
13651 \@wredindex}}{}{}
13652 \newcommand{\edindex}[1]{\@bsphack\@esphack}
13653 % \end{macrocode}
13654 % \begin{macrocode}
13655 % That finishes the non-\Lpack{memoir} index code.
13656 }
13657 % \end{macrocode}
13658 % \end{macro}
13659 % \end{macro}
13660 % \end{macro}
13661 % \subsection{Choose the right variant}
13662 % Then call \cs{create@edindex@for@memoir} or \cs{create@edindex@notfor@memoir} depending on the use of \Lpack{memoir} and \Lpack{imakeidx}
13663 % \begin{macrocode}
13664 \@ifclassloaded{memoir}{%
13665 \@ifpackageloaded{imakeidx}%
13666 {\create@edindex@notfor@memoir}%
13667 {%
13668 \@ifpackageloaded{indextools}%
13669 {\create@edindex@notfor@memoir}%
13670 {\create@edindex@for@memoir}%
13671 }%
13672 }%
13673 {\create@edindex@notfor@memoir}%
13674 % \end{macrocode}
13675 %
13676 % \subsection{hyperref compatibility}
13677 % \begin{macro}{\hyperlinkformat}
13678 % \cs{hyperlinkformat} command is to be used to have both a internal hyperlink and a format, when indexing.
13679 % \begin{macrocode}
13680 \newcommand{\hyperlinkformat}[3]{%
13681 \ifstrempty{#1}%
13682 {\hyperlink{#2}{#3}}%
13683 {\csuse{#1}{\hyperlink{#2}{#3}}%
13684 }}
13685 % \end{macrocode}
13686 % \end{macro}
13687 % \begin{macro}{\hyperlinkR}
13688 % \cs{hyperlinkR} command is to be used to create a internal hyperlink and \cs{ledRflag}, when indexing.
13689 % \begin{macrocode}
13690 \newcommand{\hyperlinkR}[2]{%
13691 \hyperlink{#1}{#2\Rlineflag}%
13692 }%
13693
13694 % \end{macrocode}
13695 % \end{macro}
13696 % \begin{macro}{\hyperlinkformatR}
13697 % \cs{hyperlinkformatR} command is to be used to create a internal hyperlink, a format and a \cs{Rlineflag}, when indexing.
13698 % \begin{macrocode}
13699 \newcommand{\hyperlinkformatR}[3]{%
13700 \hyperlinkformat{#1}{#2}{#3\Rlineflag}%
13701 }%
13702
13703 % \end{macrocode}
13704 % \end{macro}
13705 % \begin{macro}{\get@edindex@hyperref}
13706 % \begin{macro}{\@edindex@hyperref}
13707 % \changes{v1.12.5}{2014/08/28}{Debug \cs{edindex} when \Lpack{hyperref} is not loaded}
13708 % \cs{get@edindex@hyperref} is to be used to define the \cs{@edindex@hyperref} macro, which, in index, links to the point where the index was called (with \Lpack{hyperref}.
13709 % \changes{v1.18.0}{2014/08/21}{Fix spurious space with \cs{edindex} when using \Lpack{imakeidx}/\Lpack{indextools} + hyperref.}
13710 % \changes{v1.21.0}{2015/0}{Look at the hyperindex option of hyperref before inserting hyperref}
13711 % \begin{macrocode}
13712 \newcommand{\get@edindex@hyperref}[1]{%
13713 % \end{macrocode}
13714 % We have to disable temporary spaces to work through a \Lpack{xstring} bug (or feature?)
13715 % \begin{macrocode}
13716 \edef\temp@{%
13717 \catcode`\ =9 %space need for catcode
13718 #1%
13719 \catcode`\ =10 % space need for catcode
13720 }%
13721 % \end{macrocode}
13722 % Now, we define \cs{@edindex@hyperref} if the \verb+hyperindex+ of \Lpack{hyperref} is enabled.
13723 % \begin{macrocode}
13724 \ifdefequal{\iftrue}{\ifHy@hyperindex}{%
13725 \IfSubStr{\temp@}{|}%
13726 {\get@index@command#1+%
13727 \ifledRcol%
13728 \gdef\@edindex@hyperref{|\@index@parenthesis %space kept
13729 hyperlinkformatR{\@index@command}%
13730 {\edindexlab\thelabidx}}%
13731 \else%
13732 \gdef\@edindex@hyperref{|\@index@parenthesis %space kept
13733 hyperlinkformat{\@index@command}%
13734 {\edindexlab\thelabidx}}%
13735 \fi%
13736 }%
13737 {\get@index@command#1|+%
13738 \ifledRcol%
13739 \gdef\@edindex@hyperref{|hyperlinkR{\edindexlab\thelabidx}}%
13740 \else%
13741 \gdef\@edindex@hyperref{|hyperlink{\edindexlab\thelabidx}}%
13742 \fi%
13743 }%
13744 }%
13745 % \end{macrocode}
13746 % \begin{macrocode}
13747 % If we use both xindy and hyperref, first get the \cs{index@command} command.
13748 % Then define \cs{@edindex@hyperref} in the form \verb+eledmacXXX+
13749 % \begin{macrocode}
13750 {\ifxindyhyperref@%
13751 \IfSubStr{\temp@}{|}%
13752 {\get@index@command#1+}%
13753 {\get@index@command#1|+}%
13754 \gdef\@edindex@hyperref{|eledmac\thelabidx}%
13755 % \end{macrocode}
13756 % If we start a reference range by a opening parenthesis,
13757 % store the \cs{thelabidx} for the current \cs{edindex}, then define \cs{@edindex@hyperref} in the form \verb+|(eledmac\thelabidx+.
13758 % \begin{macrocode}
13759 \IfStrEq{\@index@parenthesis}{(}%
13760 {%
13761 \csxdef{xindyparenthesis@\@index@txt}{\thelabidx}%
13762 \gdef\@edindex@hyperref{|(eledmac\thelabidx}%
13763 }%
13764 {}%
13765 % \end{macrocode}
13766 % This \cs{thelabidx} will be called back at the closing parenthesis, to have the same number in
13767 % \cs{@edindex@hyperref} command that we had at the opening parenthesis.
13768 % \cs{@edindex@hyperref} start by a closing parenthesis, then followed by \verb+eledmacXXX+ where \verb+XXX+ is the \cs{thelabidx} of the opening \cs{edindex}.
13769 % \begin{macrocode}
13770 \IfStrEq{\@index@parenthesis}{)}%
13771 {%
13772 \xdef\@edindex@hyperref{|)eledmac\csuse{xindyparenthesis@\@index@txt}}%
13773 \global\csundef{xindyparenthesis@\@index@txt}%
13774 }%
13775 % \end{macrocode}
13776 % Write in the .xdy file the attributes of the location.
13777 % \begin{macrocode}
13778 {%
13779 \immediate\write\eledmac@xindy@out{%
13780 (define-attributes ("eledmac\thelabidx"))^^J
13781 \space\space(markup-locref^^J
13782 \eledmacmarkuplocrefdepth^^J
13783 :open "\string\hyperlink%
13784 \ifledRcol R\fi%
13785 {\edindexlab\thelabidx}%
13786 {\ifdefempty{\@index@command}%
13787 {}%
13788 {\@backslashchar\@index@command}%
13789 {"^^J
13790 :close "}}"^^J
13791 :attr "eledmac\thelabidx"^^J
13792 )
13793 }%
13794 }%
13795 % \end{macrocode}
13796 % And now, in any other case.
13797 % \begin{macrocode}
13798 \else%
13799 \gdef\@index@txt{#1}%
13800 \gdef\@edindex@hyperref{}%
13801 \fi%
13802 }%
13803 }
13804 % \end{macrocode}
13805 % \end{macro}
13806 % \end{macro}
13807 % \changes{v1.14.0}{2014/10/27}{Delete previous override of \cs{l@d@@wrindexhyp} at the beginning of a document when hyperref is not loaded.}
13808 %
13809 %
13810 % \section{Macro as environment}
13811 %
13812 %
13813 % The following is borrowed, and renamed, from the \Lpack{amsmath}
13814 % package. See also the CTT thread `eeq and amstex', 1995/08/31, started
13815 % by Keith Reckdahl and ended definitively by David M. Jones.
13816 %
13817 %
13818 % Several of the [math] macros scan their body twice. This means we must
13819 % collect all text in the body of an environment form before calling
13820 % the macro.
13821 %
13822 % \begin{macro}{\@emptytoks}
13823 % This is actually defined in the \Lpack{amsgen} package.
13824 % \begin{macrocode}
13825 \newtoks\@emptytoks
13826
13827 % \end{macrocode}
13828 % \end{macro}
13829 %
13830 % The rest is from \Lpack{amsmath}.
13831 %
13832 % \begin{macro}{\l@denvbody}
13833 % A token register to contain the body.
13834 % \begin{macrocode}
13835 \newtoks\l@denvbody
13836
13837 % \end{macrocode}
13838 % \end{macro}
13839 %
13840 % \begin{macro}{\addtol@denvbody}
13841 % |\addtol@denvdody{arg}| adds |arg| to the token register |\l@denvbody|.
13842 % \begin{macrocode}
13843 \newcommand{\addtol@denvbody}[1]{%
13844 \global\l@denvbody\expandafter{\the\l@denvbody#1}}
13845
13846 % \end{macrocode}
13847 % \end{macro}
13848 %
13849 % \begin{macro}{\l@dcollect@body}
13850 % The macro |\l@dcollect@body| starts the scan for the |\end{...}| command
13851 % of the current environment. It takes a macro name as argument. This macro
13852 % is supposed to take the whole body of the environment as its argument.
13853 % For example, given |cenv#1{...}| as a macro that processes |#1|, then
13854 % the environment form, |\begin{env}| would call |\l@dcollect@body\cenv|.
13855 %
13856 % \begin{macrocode}
13857 \newcommand{\l@dcollect@body}[1]{%
13858 \l@denvbody{\expandafter#1\expandafter{\the\l@denvbody}}%
13859 \edef\processl@denvbody{\the\l@denvbody\noexpand\end{\@currenvir}}%
13860 \l@denvbody\@emptytoks \def\l@dbegin@stack{b}%
13861 \begingroup
13862 \expandafter\let\csname\@currenvir\endcsname\l@dcollect@@body
13863 \edef\processl@denvbody{\expandafter\noexpand\csname\@currenvir\endcsname}%
13864 \processl@denvbody%
13865 }%
13866
13867 % \end{macrocode}
13868 % \end{macro}
13869 %
13870 % \begin{macro}{\l@dpush@begins}
13871 % When adding a piece of the current environment's contents to |\l@denvbody|,
13872 % we scan it to check for additional |\begin| tokens, and add a `b' to the
13873 % stack for any that we find.
13874 % \begin{macrocode}
13875 \def\l@dpush@begins#1\begin#2{%
13876 \ifx\end#2\else b\expandafter\l@dpush@begins\fi}
13877
13878 % \end{macrocode}
13879 % \end{macro}
13880 %
13881 % \begin{macro}{\l@dcollect@@body}
13882 % |\l@dcollect@@body| takes two arguments: the first will consist of all text
13883 % up to the next |\end| command, and the second will be the |\end| command's
13884 % argument. If therte are any extra |\begin| commands in the body text,
13885 % a marker is pushed onto a stack by the |l@dpush@begins| function.
13886 % Empty state for this stack means we have reached the |\end| that matches
13887 % our original |\begin|. Otherwise we need to include the |\end| and its
13888 % argument in the material we are adding to the environment body accumulator.
13889 % \begin{macrocode}
13890 \def\l@dcollect@@body#1\end#2{%
13891 \edef\l@dbegin@stack{\l@dpush@begins#1\begin\end
13892 \expandafter\@gobble\l@dbegin@stack}%
13893 \ifx\@empty\l@dbegin@stack
13894 \endgroup
13895 \@checkend{#2}%
13896 \addtol@denvbody{#1}%
13897 \else
13898 \addtol@denvbody{#1\end{#2}}%
13899 \fi
13900 \processl@denvbody % A little tricky! Note the grouping
13901 }
13902
13903 % \end{macrocode}
13904 % \end{macro}
13905 %
13906 % There was a question on CTT about how to use |\collect@body| for a macro
13907 % taking an argument. The following is part of that thread.
13908 % \begin{verbatim}
13909 % From: Heiko Oberdiek <[email protected]>
13910 % Newsgroups: comp.text.tex
13911 % Subject: Re: Using \collect@body with commands that take >1 argument
13912 % Date: Fri, 08 Aug 2003 09:03:20 +0200
13913 %
13914 % [email protected] (Evan) wrote:
13915 % > I'm trying to make a new Latex environment that acts like the>
13916 % \colorbox command that is part of the color package. I looked through
13917 % > the FAQ and ran across this bit about using the \collect@body command
13918 % > that is part of AMSLaTeX:
13919 % > http://www.tex.ac.uk/cgi-bin/texfaq2html?label=cmdasenv
13920 % >
13921 % > It almost works. If I do something like the following:
13922 % > \newcommand{\redbox}[1]{\colorbox{red}{#1}}
13923 % >
13924 % > \makeatletter
13925 % > \newenvironment{redbox}{\collect@body \redbox}{}
13926 %
13927 % You will get an error message: Command \redbox already defined.
13928 % Thus you must rename either the command \redbox or the environment
13929 % name.
13930 %
13931 % > \begin{coloredbox}{blue}
13932 % > Yadda yadda yadda... this is on a blue background...
13933 % > \end{coloredbox}
13934 % > and can't figure out how to make the \collect@body take this.
13935 %
13936 % > \collect@body \colorbox{red}
13937 % > \collect@body {\colorbox{red}}
13938 %
13939 % The argument of \collect@body has to be one token exactly.
13940 %
13941 % \documentclass{article}
13942 % \usepackage{color}
13943 % \usepackage{amsmath}
13944 %
13945 % \newcommand{\redbox}[1]{\colorbox{red}{#1}}
13946 % \makeatletter
13947 % \newenvironment{coloredbox}[1]{%
13948 % \def\next@{\colorbox{#1}}%
13949 % \collect@body\next@
13950 % }{}
13951 %
13952 % % ignore spaces at begin and end of environment
13953 % \newenvironment{coloredboxII}[1]{%
13954 % \def\next@{\mycoloredbox{#1}}%
13955 % \collect@body\next@
13956 % }{}
13957 % \newcommand{\mycoloredbox}[2]{%
13958 % \colorbox{#1}{\ignorespaces#2\unskip}%
13959 % }
13960 %
13961 % % support of optional color model argument
13962 % \newcommand\coloredboxIII\endcsname{}
13963 % \def\coloredboxIII#1#{%
13964 % \@coloredboxIII{#1}%
13965 % }
13966 % \def\@coloredboxIII#1#2{%
13967 % \def\next@{\mycoloredboxIII{#1}{#2}}%
13968 % \collect@body\next@
13969 % }
13970 % \newcommand{\mycoloredboxIII}[3]{%
13971 % \colorbox#1{#2}{\ignorespaces#3\unskip}%
13972 % }
13973 %
13974 % \makeatother
13975 %
13976 % \begin{document}
13977 % Black text before
13978 % \begin{coloredbox}{blue}
13979 % Hello World
13980 % \end{coloredbox}
13981 % Black text after
13982 %
13983 % Black text before
13984 % \begin{coloredboxII}{blue}
13985 % Hello World
13986 % \end{coloredboxII}
13987 % Black text after
13988 %
13989 % Black text before
13990 % \begin{coloredboxIII}[rgb]{0,0,1}
13991 % Hello World
13992 % \end{coloredboxIII}
13993 % Black text after
13994 %
13995 % \end{document}
13996 %
13997 % Yours sincerely
13998 % Heiko <[email protected]>
13999 % \end{verbatim}
14000 %
14001 %
14002 % \section{Verse}
14003 %
14004 % This is principally Wayne Sullivan's\index{Sullivan, Wayne}
14005 % code and commentary from \edstanza~\cite{EDSTANZA}.
14006 %
14007 %
14008 % The macro \cmd{\hangingsymbol} is used to insert a symbol on each hanging of verses.
14009 %For example, in french typographie the symbol is `['. We obtain it by the next code:
14010 %\begin{verbatim}
14011 %\renewcommand{\hangingsymbol}{[\,}
14012 %\end{verbatim}
14013 % The \cs{ifinstanza} boolean is used to be sure that we are in a stanza part.
14014 % \begin{macro}{\hangingsymbol}
14015 % \begin{macro}{\ifinstanza}
14016 % \begin{macrocode}
14017 \newcommand*{\hangingsymbol}{}
14018 \newif\ifinstanza
14019 % \end{macrocode}
14020 % \end{macro}
14021 % \end{macro}
14022 % \begin{macro}{\inserthangingymbol}
14023 % \begin{macro}{\ifinserthangingsymbol}
14024 % The boolean \cs{ifinserthangingsymbol} is set to TRUE when \cs{@lock} is greater than 1, i.e. when we are not in the first line of a verse. The switch of \cs{ifinserthangingsymbol} is made in \cs{do@line} before the printing of line but after the line number calculation.
14025 %\changes{v0.15.0}{2012/06/11}{New management of hangingsymbol insertion, preventing undesirable insertions.}
14026 %\changes{v0.17.0}{2012/08/03}{New new management of hangingsymbol insertion, preventing undesirable insertions.}
14027 % \changes{v1.6.1}{2013/10/27}{Hang verse is now not automatically flush right.}
14028 % \begin{macrocode}
14029 \newif\ifinserthangingsymbol
14030 \newcommand{\inserthangingsymbol}{%
14031 \ifinserthangingsymbol%
14032 \ifinstanza%
14033 \hangingsymbol%
14034 \fi%
14035 \fi%
14036 }
14037 % \end{macrocode}
14038 % \end{macro}
14039 % \end{macro}
14040 % \begin{macro}{\ampersand}
14041 % Within a stanza the \verb?\&? macro is going to be usurped. We need an
14042 % alias in case an \& needs to be typeset in a stanza. Define it rather
14043 % than letting it in case some other package has already defined it.
14044 % \begin{macrocode}
14045 \newcommand*{\ampersand}{\char`\&}
14046
14047 % \end{macrocode}
14048 % \end{macro}
14049 %
14050 %
14051 % \begin{macro}{\stanza@count}
14052 % \begin{macro}{\stanzaindentbase}
14053 % Before we can define the main macros we need to save and reset
14054 % some category codes. To save the current values we use
14055 % \verb+\next+ and \verb+\body+ from the \verb+\loop+ macro.
14056 % \begin{macrocode}
14057 \chardef\body=\catcode`\@
14058 \catcode`\@=11
14059 \chardef\next=\catcode`\&
14060 \catcode`\&=\active
14061
14062 % \end{macrocode}
14063 %
14064 % A count register is allocated for counting lines in a stanza; also allocated
14065 % is a dimension register which is used to specify the base value for
14066 % line indentation; all stanza indentations are multiples of this
14067 % value. The default value of \verb+\stanzaindentbase+ is 20pt.
14068 % \begin{macrocode}
14069 \newcount\stanza@count
14070 \newlength{\stanzaindentbase}
14071 \setlength{\stanzaindentbase}{20pt}
14072
14073 % \end{macrocode}
14074 % \end{macro}
14075 % \end{macro}
14076 %
14077 % \begin{macro}{\strip@szacnt}
14078 % \begin{macro}{\setstanzavalues}
14079 % The indentations of stanza lines are non-negative integer multiples of the
14080 % unit called
14081 % \verb+\stanzaindentbase+. To make it easier for the user to specify these
14082 % numbers, some list macros are defined. These take numerical values
14083 % in a list separated by commas and assign the values to special control
14084 % sequences using \verb+\mathchardef+. Though this does limit the range
14085 % from 0 to 32767, it should suffice for most applications,
14086 % including \emph{penalties}, which will be discussed below.
14087 % \begin{macrocode}
14088 \def\strip@szacnt#1,#2|{\def\@tempb{#1}\def\@tempa{#2|}}
14089 \newcommand*{\setstanzavalues}[2]{\def\@tempa{#2,,|}%
14090 \stanza@count\z@
14091 \def\next{\expandafter\strip@szacnt\@tempa
14092 \ifx\@tempb\empty\let\next\relax\else
14093 \expandafter\mathchardef\csname #1@\number\stanza@count
14094 @\endcsname\@tempb\relax
14095 \advance\stanza@count\@ne\fi\next}%
14096 \next}
14097
14098 % \end{macrocode}
14099 % \end{macro}
14100 % \end{macro}
14101 %
14102 % \begin{macro}{\setstanzaindents}
14103 % \begin{macro}{\setstanzapenalties}
14104 % \begin{macro}{\managestanza@modulo}
14105 % In the original \verb?\setstanzavalues{sza}{...}? had to be called to
14106 % set the indents, and similarly \verb?\setstanzavalues{szp}{...}?
14107 % to set the penalties. These two macros are a convenience to give
14108 % the user one less thing to worry about (misspelling the first argument).
14109 % Since version 0.13, the \verb+stanzaindentsrepetition+ counter can be used when the indentation is repeated every n verses. The \cs{managestanza@modulo} is a command which modifies the counter stanza@modulo. The command adds 1 to stanza@modulo, but if stanza@modulo is equal to the stanzaindentsrepetition counter, the command restarts it.
14110 %\changes{v0.13.0}{2011/11/08}{New stanzaindentsrepetition counter to repeat stanza indents every \emph{n} verses.}
14111 % % \changes{v1.5.1}{2013/08/16}{Correct stanzaindentsrepetition counter}
14112 % \begin{macrocode}
14113 \newcommand*{\setstanzaindents}[1]{\setstanzavalues{sza}{#1}}
14114 \newcommand*{\setstanzapenalties}[1]{\setstanzavalues{szp}{#1}}
14115
14116 \newcounter{stanzaindentsrepetition}
14117 \newcount\stanza@modulo
14118
14119 \newcommand*{\managestanza@modulo}[0]{
14120 \advance\stanza@modulo\@ne
14121 \ifnum\stanza@modulo>\value{stanzaindentsrepetition}
14122 \stanza@modulo\@ne
14123 \fi
14124 }
14125 % \end{macrocode}
14126 % \end{macro}
14127 % \end{macro}
14128 % \end{macro}
14129 %
14130 % \begin{macro}{\stanzaindent}
14131 % \begin{macro}{\stanzaindent*}
14132 % The macro \cs{stanzaindent}, when called at the beginning of a verse, changes the indentation normally defined for this verse by \cs{setstanzaindent}.
14133 % The starred version skips the current verse for the repetition of stanza indent.
14134 % \begin{macrocode}
14135 \newcommand{\stanzaindent}[1]{%
14136 \hspace{\dimexpr#1\stanzaindentbase-\parindent\relax}%
14137 \ignorespaces%
14138 }%
14139 \WithSuffix\newcommand\stanzaindent*[1]{%
14140 \stanzaindent{#1}%
14141 \global\advance\stanza@modulo-\@ne%
14142 \ifnum\stanza@modulo=0%
14143 \global\stanza@modulo=\value{stanzaindentsrepetition}%
14144 \fi%
14145 \ignorespaces%
14146 }%
14147 % \end{macrocode}
14148 % \end{macro}
14149 % \end{macro}
14150 % \begin{macro}{\stanza@line}
14151 % \begin{macro}{\stanza@hang}
14152 % \begin{macro}{\sza@penalty}
14153 % Now we arrive at the main works. \verb+\stanza@line+ sets the
14154 % indentation for the line and starts a numbered paragraph---each
14155 % line is treated as a paragraph. \verb+\stanza@hang+ sets the
14156 % hanging indentation to be used if the stanza line requires
14157 % more than one print line. If it is known that each stanza line
14158 % will fit on one print line, it is advisable to set the
14159 % hanging indentation to zero. \verb+\sza@penalty+ places the
14160 % specified penalty following each stanza line. By default, this
14161 % facility is turned off so that no penalty is included. However,
14162 % the user may initiate these penalties to indicate good and bad
14163 % places in the stanza for page breaking.
14164 % \begin{macrocode}
14165 \newcommandx{\stanza@line}[1][1]{
14166 \ifnum\value{stanzaindentsrepetition}=0
14167 \parindent=\csname sza@\number\stanza@count
14168 @\endcsname\stanzaindentbase
14169 \else
14170 \parindent=\csname sza@\number\stanza@modulo
14171 @\endcsname\stanzaindentbase
14172 \managestanza@modulo
14173 \fi
14174 \pstart[#1]\stanza@hang\ignorespaces}
14175 \xdef\stanza@hang{\noexpand\leavevmode\noexpand\startlock
14176 \hangindent\expandafter
14177 \noexpand\csname sza@0@\endcsname\stanzaindentbase
14178 \hangafter\@ne}
14179 \def\sza@penalty{\count@\csname szp@\number\stanza@count @\endcsname
14180 \ifnum\count@>\@M\advance\count@-\@M\penalty-\else
14181 \penalty\fi\count@}
14182 % \end{macrocode}
14183 % \end{macro}
14184 % \end{macro}
14185 % \end{macro}
14186 %
14187 % \begin{macro}{\startstanzahook}
14188 % \begin{macro}{\endstanzaextra}
14189 % \begin{macro}{\@startstanza}
14190 % \begin{macro}{\stanza}
14191 % \changes{v1.12.0}{2014/08/05}{Add \cs{newverse} macro, \cs{falseverse} deprecated.}
14192 % \changes{v1.12.0}{2014/08/05}{\cs{Stanza} can have an optional argument: content to be printed before.}
14193 % \changes{v1.12.0}{2014/08/05}{\ampersand can have an optional argument: content to be printed after.}
14194 % \changes{v1.20.0}{2015/03/22}{\ampersand\ and \textbackslash\ampersand\ can be preceded by spaces.}
14195 % \begin{macro}{\@stopstanza}
14196 % \begin{macro}{\newverse}
14197 % \begin{macro}{\falseverse}
14198 % \changes{v1.6.0}{2013/10/09}{Add \cs{falseverse} macro.}
14199 % Now we have the components of the \verb+\stanza+ macro,
14200 % which appears at the start of a group of lines. This macro
14201 % initializes the count and checks to see if hanging indentation
14202 % and penalties are to be included. Hanging indentation suspends
14203 % the line count, so that the enumeration is by verse line
14204 % rather than by print line. If the print line count is desired,
14205 % invoke \verb+\let\startlock=\relax+ and do the same for
14206 % \verb+\endlock+. Here and above we have used \verb+\xdef+ to
14207 % make the stored macros take up a bit less space, but it also
14208 % makes them more obscure to the reader. Lines of the stanza are
14209 % delimited by ampersands \&.
14210 % The last line of the stanza must
14211 % end with \verb+\&+.
14212 % For convenience the macro
14213 % \verb+\endstanzaextra+ is included. The user may use this to add
14214 % vertical space or penalties between stanzas.
14215 %
14216 %
14217 % As a further convenience, the macro \verb?\startstanzahook? is
14218 % called at the beginning of a stanza. This can be defined to
14219 % do something useful.
14220 %
14221 % \begin{macrocode}
14222 \let\startstanzahook\relax
14223 \let\endstanzaextra\relax
14224 \xdef\@startstanza[#1]{%
14225 \noexpand\instanzatrue\expandafter
14226 \begingroup\startstanzahook%
14227 \catcode`\noexpand\&\active%
14228 \global\stanza@count\@ne\stanza@modulo\@ne
14229 \noexpand\ifnum\expandafter\noexpand
14230 \csname sza@0@\endcsname=\z@\let\noexpand\stanza@hang\relax
14231 \let\noexpand\endlock\relax\noexpand\else\interlinepenalty
14232 \@M\rightskip\z@ plus 1fil\relax\noexpand\fi\noexpand\ifnum
14233 \expandafter\noexpand\csname szp@0@\endcsname=\z@
14234 \let\noexpand\sza@penalty\relax\noexpand\fi%
14235 \def\noexpand\falseverse{%
14236 \noexpand\led@war@FalseverseDeprecated%
14237 \global\advance\stanza@modulo-\@ne%
14238 \global\advance\stanza@count-\@ne%
14239 \relax\noexpand&\leavevmode\skipnumbering}
14240 \def\noexpand&{%
14241 \noexpand\newverse[][]}%
14242 \def\noexpand\&{\noexpand\@stopstanza}%
14243 \noexpand\stanza@line[#1]}
14244
14245 \newcommandx{\stanza}[1][1,usedefault]{\@startstanza[#1]}
14246
14247 \newcommandx{\@stopstanza}[1][1,usedefault]{%
14248 \unskip%
14249 \endlock%
14250 \pend[#1]%
14251 \endgroup%
14252 \instanzafalse%
14253 \endstanzaextra%
14254 }
14255
14256 \newcommandx*{\newverse}[2][1,2,usedefault]{%
14257 \unskip%
14258 \endlock\pend[#1]\sza@penalty\global%
14259 \advance\stanza@count\@ne\stanza@line[#2]%
14260 }
14261
14262 % \end{macrocode}
14263 % \end{macro}
14264 % \end{macro}
14265 % \end{macro}
14266 % \end{macro}
14267 % \end{macro}
14268 % \end{macro}
14269 % \end{macro}
14270 % \begin{macro}{\flagstanza}
14271 % Use \verb?\flagstanza[len]{text}? at the start of a line to put \texttt{text}
14272 % a distance \texttt{len} before the start of the line. The default for
14273 % \texttt{len} is \verb?\stanzaindentbase?.
14274 % \begin{macrocode}
14275 \newcommand*{\flagstanza}[2][\stanzaindentbase]{%
14276 \hskip -#1\llap{#2}\hskip #1\ignorespaces}
14277
14278 % \end{macrocode}
14279 % \end{macro}
14280 %
14281 % The ampersand \& is used to mark the end of each stanza line, except the
14282 % last, which is marked with \verb+\&+. This means that \verb+\halign+ may
14283 % not be used directly within a stanza line. This does not affect macros
14284 % involving alignments defined outside \verb+\stanza \&+. Since these
14285 % macros usurp the control sequence \verb+\&+, the replacement
14286 % \verb+\ampersand+ is defined to be used if this symbol is needed in a
14287 % stanza. Also we reset the modified category codes and initialize the
14288 % penalty default.
14289 % \begin{macrocode}
14290 \catcode`\&=\next
14291 \catcode`\@=\body
14292 %% \let\ampersand=\&
14293 \setstanzavalues{szp}{0}
14294
14295 % \end{macrocode}
14296 %
14297 %
14298 %
14299 %
14300 % \section{Arrays and tables}
14301 %
14302 %
14303 % This is based on the work by Herbert Breger\index{Breger, Herbert}
14304 % in developing \file{tabmac.tex}.
14305 % \begin{verbatim}
14306 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14307 % % This is file tabmac.tex 1.0.
14308 % % You find here macros for tabular structures compatible with
14309 % % Edmac (authored by Lavagnino/Wujastyk). The use of the macros is
14310 % % explained in German language in file tabanlei.dvi. The macros were
14311 % % developed for Edmac 2.3, but this file has been adjusted to Edmac 3.16.
14312 % %
14313 % % ATTENTION: This file uses some Edmac control sequences (like
14314 % % \text, \Afootnote etc.) and redefines \morenoexpands. If you yourself
14315 % % redefined some Edmac control sequences, be careful: some adjustements
14316 % % might be necessary.
14317 % % October 1996
14318 % %
14319 % % My kind thanks to Nora G^?deke for valuable support. Any hints and
14320 % % comments are welcome, please contact Herbert Breger,
14321 % % Leibniz-Archiv, Waterloostr. 8, D -- 30169 Hannover, Germany
14322 % % Tel.: 511 - 1267 327
14323 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14324 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14325 % \end{verbatim}
14326 %
14327 % The original \file{tabmac.tex} file was void of comments or any explanatory
14328 % text other than the above notice. The algorithm is Breger's. I have made
14329 % some cosmetic changes to the original code and reimplemented some things
14330 % so they are more LaTeX-like. All the commentary is mine, as are any mistakes
14331 % or errors.
14332 %
14333 % \begin{macro}{\l@dtabnoexpands}
14334 % An extended and modified version of the original additional no expansions..
14335 % \begin{macrocode}
14336 \newcommand*{\l@dtabnoexpands}{%
14337 \let\rtab=0%
14338 \let\ctab=0%
14339 \let\ltab=0%
14340 \let\rtabtext=0%
14341 \let\ltabtext=0%
14342 \let\ctabtext=0%
14343 \let\edbeforetab=0%
14344 \let\edaftertab=0%
14345 \let\edatab=0%
14346 \let\edatabell=0%
14347 \let\edatleft=0%
14348 \let\edatright=0%
14349 \let\edvertline=0%
14350 \let\edvertdots=0%
14351 \let\edrowfill=0%
14352 }
14353
14354 % \end{macrocode}
14355 % \end{macro}
14356 % \begin{macro}{\disable@familiarnotes}
14357 % \begin{macro}{\restore@familiarnotes}
14358 % Macros to disable and restore familiar notes, to prevent them from printing multiple times in edtabularx and edarrayx environments.
14359 % \begin{macrocode}
14360 \newcommand{\disable@familiarnotes}{%
14361 \unless\ifnofamiliar@%
14362 \def\do##1{%
14363 \csletcs{footnote@@##1}{footnote##1}%
14364 \expandafter\renewcommand \csname footnote##1\endcsname[1]{%
14365 \protected@csxdef{@thefnmark##1}{\csuse{thefootnote##1}}%
14366 \csuse{@footnotemark##1}%
14367 }%
14368 }%
14369 \dolistloop{\@series}%
14370 \fi%
14371 }%
14372 \newcommand{\restore@familiarnotes}{%
14373 \unless\ifnofamiliar@%
14374 \def\do##1{%
14375 \csletcs{footnote##1}{footnote@@##1}%
14376 }%
14377 \dolistloop{\@series}%
14378 \fi%
14379 }%
14380
14381 % \end{macrocode}
14382 % \end{macro}
14383 % \end{macro}
14384 % \begin{macro}{\disable@sidenotes}
14385 % \begin{macro}{\restore@sidenotes}
14386 % The sames, for side notes.
14387 % \begin{macrocode}
14388 \newcommand{\disable@sidenotes}{%
14389 \let\@@ledrightnote\ledrightnote%
14390 \let\@@ledleftnote\ledleftnote%
14391 \let\@@ledsidenote\ledsidenote%
14392 \let\ledrightnote\@gobble%
14393 \let\ledleftnote\@gobble%
14394 \let\ledsidenote\@gobble%
14395 }%
14396 \newcommand{\restore@sidenotes}{%
14397 \let\ledrightnote\@@ledrightnote%
14398 \let\ledleftnote\@@ledleftnote%
14399 \let\ledsidenote\@@ledsidenote%
14400 }%
14401 % \end{macrocode}
14402 % \end{macro}
14403 % \end{macro}
14404 % \begin{macro}{\disable@notes}
14405 % \begin{macro}{\restore@notes}
14406 % Disable/restore side and familiar notes.
14407 % \begin{macrocode}
14408 \newcommand{\disable@notes}{%
14409 \disable@sidenotes%
14410 \disable@familiarnotes%
14411 }%
14412 \newcommand{\restore@notes}{%
14413 \restore@sidenotes%
14414 \restore@familiarnotes%
14415 }%
14416 % \end{macrocode}
14417 % \end{macro}
14418 % \end{macro}
14419 % \begin{macro}{\l@dampcount}
14420 % \begin{macro}{\l@dcolcount}
14421 % |\l@dampcount| is a counter for the \& column dividers and
14422 % |\l@dcolcount| is a counter for the columns. These were
14423 % |\Undcount| and |\stellencount| respectively.
14424 % \begin{macrocode}
14425 \newcount\l@dampcount
14426 \l@dampcount=1\relax
14427 \newcount\l@dcolcount
14428 \l@dcolcount=0\relax
14429
14430 % \end{macrocode}
14431 % \end{macro}
14432 % \end{macro}
14433 %
14434 % \begin{macro}{\hilfsbox}
14435 % \begin{macro}{\hilfsskip}
14436 % \begin{macro}{\Hilfsbox}
14437 % \begin{macro}{\hilfscount}
14438 % Some (temporary) helper items.
14439 % \begin{macrocode}
14440 \newbox\hilfsbox
14441 \newskip\hilfsskip
14442 \newbox\Hilfsbox
14443 \newcount\hilfscount
14444
14445 % \end{macrocode}
14446 % \end{macro}
14447 % \end{macro}
14448 % \end{macro}
14449 % \end{macro}
14450 %
14451 % 30 columns should be adequate (compared to the original 60).
14452 % These are the column widths. (Originally these were German spelled numbers
14453 % e.g., |\eins|, |\zwei|, etc).
14454 % \begin{macrocode}
14455 \newdimen\dcoli
14456 \newdimen\dcolii
14457 \newdimen\dcoliii
14458 \newdimen\dcoliv
14459 \newdimen\dcolv
14460 \newdimen\dcolvi
14461 \newdimen\dcolvii
14462 \newdimen\dcolviii
14463 \newdimen\dcolix
14464 \newdimen\dcolx
14465 \newdimen\dcolxi
14466 \newdimen\dcolxii
14467 \newdimen\dcolxiii
14468 \newdimen\dcolxiv
14469 \newdimen\dcolxv
14470 \newdimen\dcolxvi
14471 \newdimen\dcolxvii
14472 \newdimen\dcolxviii
14473 \newdimen\dcolxix
14474 \newdimen\dcolxx
14475 \newdimen\dcolxxi
14476 \newdimen\dcolxxii
14477 \newdimen\dcolxxiii
14478 \newdimen\dcolxxiv
14479 \newdimen\dcolxxv
14480 \newdimen\dcolxxvi
14481 \newdimen\dcolxxvii
14482 \newdimen\dcolxxviii
14483 \newdimen\dcolxxix
14484 \newdimen\dcolxxx
14485 \newdimen\dcolerr % added for error handling
14486
14487 % \end{macrocode}
14488 %
14489 % \begin{macro}{\l@dcolwidth}
14490 % This is a cunning way of storing the columnwidths indexed by
14491 % the column number |\l@dcolcount|, like an array. (was |\Dimenzuordnung|)
14492 % \begin{macrocode}
14493 \newcommand{\l@dcolwidth}{\ifcase \the\l@dcolcount \dcoli %???
14494 \or \dcoli \or \dcolii \or \dcoliii
14495 \or \dcoliv \or \dcolv \or \dcolvi
14496 \or \dcolvii \or \dcolviii \or \dcolix \or \dcolx
14497 \or \dcolxi \or \dcolxii \or \dcolxiii
14498 \or \dcolxiv \or \dcolxv \or \dcolxvi
14499 \or \dcolxvii \or \dcolxviii \or \dcolxix \or \dcolxx
14500 \or \dcolxxi \or \dcolxxii \or \dcolxxiii
14501 \or \dcolxxiv \or \dcolxxv \or \dcolxxvi
14502 \or \dcolxxvii \or \dcolxxviii \or \dcolxxix \or \dcolxxx
14503 \else \dcolerr \fi}
14504
14505 % \end{macrocode}
14506 % \end{macro}
14507 %
14508 % \begin{macro}{\stepl@dcolcount}
14509 % This increments the column counter, and issues an error message
14510 % if it is too large.
14511 % \begin{macrocode}
14512 \newcommand*{\stepl@dcolcount}{\advance\l@dcolcount\@ne
14513 \ifnum\l@dcolcount>30\relax
14514 \led@err@TooManyColumns
14515 \fi}
14516
14517 % \end{macrocode}
14518 % \end{macro}
14519 %
14520 % \begin{macro}{\l@dsetmaxcolwidth}
14521 % Sets the column width to the maximum value seen so far. (was |\dimenzuordnung|)
14522 % \begin{macrocode}
14523 \newcommand{\l@dsetmaxcolwidth}{%
14524 \ifdim\l@dcolwidth < \wd\hilfsbox
14525 \l@dcolwidth = \wd\hilfsbox
14526 \else \relax \fi}
14527
14528 % \end{macrocode}
14529 % \end{macro}
14530 %
14531 % \begin{macro}{\EDTEXT}
14532 % \begin{macro}{\xedtext}
14533 % \begin{macro}{\CRITEXT}
14534 % \begin{macro}{\xcritext}
14535 % We need to be able to modify the |\edtext| and |\critext| macros
14536 % and also restore their original definitions.
14537 % \begin{macrocode}
14538 \let\EDTEXT=\edtext
14539 \newcommand{\xedtext}[2]{\EDTEXT{#1}{#2}}
14540 \let\CRITEXT=\critext
14541 \long\def\xcritext #1#2/{\CRITEXT{#1}{#2}/}
14542 % \end{macrocode}
14543 % \end{macro}
14544 % \end{macro}
14545 % \end{macro}
14546 % \end{macro}
14547 %
14548 % \begin{macro}{\EDLABEL}
14549 % \begin{macro}{\xedlabel}
14550 % We need to be able to modify and restore the |\edlabel| macro.
14551 % \begin{macrocode}
14552 \let\EDLABEL=\edlabel
14553 \newcommand*{\xedlabel}[1]{\EDLABEL{#1}}
14554 % \end{macrocode}
14555 % \end{macro}
14556 % \end{macro}
14557 %
14558 %
14559 % \begin{macro}{\EDINDEX}
14560 % \begin{macro}{\xedindex}
14561 % \begin{macro}{\nulledindex}
14562 % Macros supporting modification and restoration of |\edindex|.
14563 % \begin{macrocode}
14564 \let\EDINDEX=\edindex
14565 \ifl@dmemoir
14566 \newcommand{\xedindex}{\@bsphack%
14567 \@ifnextchar [{\l@d@index}{\l@d@index[\jobname]}}
14568 \newcommand{\nulledindex}[2][\jobname]{\@bsphack\@esphack}
14569 \else
14570 \newcommand{\xedindex}{\@bsphack%
14571 \doedindexlabel
14572 \begingroup
14573 \@sanitize
14574 \@wredindex}
14575 \newcommand{\nulledindex}[1]{\@bsphack\@esphack}
14576 \fi
14577
14578 % \end{macrocode}
14579 % \end{macro}
14580 % \end{macro}
14581 % \end{macro}
14582 %
14583 %
14584 % \begin{macro}{\@line@@num}
14585 % Macro supporting restoration of |\linenum|.
14586 % \begin{macrocode}
14587 \let\@line@@num=\linenum
14588 % \end{macrocode}
14589 % \end{macro}
14590 %
14591 % \begin{macro}{\l@dgobbledarg}
14592 % \begin{macro}{\l@dgobblearg}
14593 % |\l@dgobbledarg| replaces its delineated argument by |\relax|
14594 % (was |\verschwinden|).
14595 % |\l@dgobbleoptarg|\oarg{arg}\marg{arg} replaces these two arguments (first is optional) by |\relax|.
14596 % \changes{v1.12.5}{2014/08/28}{\cs{l@dgobblearg} becomes \cs{l@dgobbeloptarg}}
14597 % \begin{macrocode}
14598 \def\l@dgobbledarg #1/{\relax}
14599 \newcommand*{\l@dgobbleoptarg}[2][]{\relax}%
14600
14601 % \end{macrocode}
14602 % \end{macro}
14603 % \end{macro}
14604 %
14605 % \begin{macro}{\Relax}
14606 % \begin{macro}{\NEXT}
14607 % \begin{macro}{\@hilfs@count}
14608 % \begin{macrocode}
14609 \let\Relax=\relax
14610 \let\NEXT=\next
14611 \newcount\@hilfs@count
14612
14613 % \end{macrocode}
14614 % \end{macro}
14615 % \end{macro}
14616 % \end{macro}
14617 %
14618 % \begin{macro}{\measuremcell}
14619 % Measure (recursively) the width required for a math cell. (was |\messen|)
14620 % \begin{macrocode}
14621 \def\measuremcell #1&{%
14622 \ifx #1\\ \ifnum\l@dcolcount=0\let\NEXT\relax%
14623 \else\l@dcheckcols%
14624 \l@dcolcount=0%
14625 \let\NEXT\measuremcell%
14626 \fi%
14627 \else\setbox\hilfsbox=\hbox{$\displaystyle{#1}$}%
14628 \stepl@dcolcount%
14629 \l@dsetmaxcolwidth%
14630 \let\NEXT\measuremcell%
14631 \fi\NEXT}
14632
14633 % \end{macrocode}
14634 % \end{macro}
14635 %
14636 % \begin{macro}{\measuretcell}
14637 % Measure (recursively) the width required for a text cell. (was |\messentext|)
14638 % \begin{macrocode}
14639 \def\measuretcell #1&{%
14640 \ifx #1\\ \ifnum\l@dcolcount=0\let\NEXT\relax%
14641 \else\l@dcheckcols%
14642 \l@dcolcount=0%
14643 \let\NEXT\measuretcell%
14644 \fi%
14645 \else\setbox\hilfsbox=\hbox{#1}%
14646 \stepl@dcolcount%
14647 \l@dsetmaxcolwidth%
14648 \let\NEXT\measuretcell%
14649 \fi\NEXT}
14650
14651 % \end{macrocode}
14652 % \end{macro}
14653 %
14654 % \begin{macro}{\measuremrow}
14655 % Measure (recursively) the width required for a math row. (was |\Messen|)
14656 % \begin{macrocode}
14657 \def\measuremrow #1\\{%
14658 \ifx #1&\let\NEXT\relax%
14659 \else\measuremcell #1&\\&\\&%
14660 \let\NEXT\measuremrow%
14661 \fi\NEXT}
14662 % \end{macrocode}
14663 % \end{macro}
14664 %
14665 % \begin{macro}{\measuretrow}
14666 % Measure (recursively) the width required for a text row. (was |\Messentext|)
14667 % \begin{macrocode}
14668 \def\measuretrow #1\\{%
14669 \ifx #1&\let\NEXT\relax%
14670 \else\measuretcell #1&\\&\\&%
14671 \let\NEXT\measuretrow%
14672 \fi\NEXT}
14673
14674 % \end{macrocode}
14675 % \end{macro}
14676 %
14677 % \begin{macro}{\edtabcolsep}
14678 % The length |\edtabcolsep| controls the distance between columns.
14679 % (was |\abstand|)
14680 % \begin{macrocode}
14681 \newskip\edtabcolsep
14682 \global\edtabcolsep=10pt
14683
14684 % \end{macrocode}
14685 % \end{macro}
14686 %
14687 % \begin{macro}{\NEXT}
14688 % \begin{macro}{\Next}
14689 % \begin{macrocode}
14690 \let\NEXT\relax
14691 \let\Next=\next
14692 % \end{macrocode}
14693 % \end{macro}
14694 % \end{macro}
14695 %
14696 % \begin{macro}{\variab}
14697 % \begin{macrocode}
14698 \newcommand{\variab}{\relax}
14699
14700 % \end{macrocode}
14701 % \end{macro}
14702 %
14703 % \begin{macro}{\l@dcheckcols}
14704 % Check that the number of columns is consistent. (was |\tabfehlermeldung|)
14705 % \begin{macrocode}
14706 \newcommand*{\l@dcheckcols}{%
14707 \ifnum\l@dcolcount=1\relax
14708 \else
14709 \ifnum\l@dampcount=1\relax
14710 \else
14711 \ifnum\l@dcolcount=\l@dampcount\relax
14712 \else
14713 \l@d@err@UnequalColumns
14714 \fi
14715 \fi
14716 \l@dampcount=\l@dcolcount
14717 \fi}
14718
14719 % \end{macrocode}
14720 % \end{macro}
14721 %
14722 % \begin{macro}{\l@dmodforcritext}
14723 % \begin{macro}{\l@drestoreforcritext}
14724 % Modify and restore various macros for when |\critext| is used.
14725 % \begin{macrocode}
14726 \newcommand{\l@dmodforcritext}{%
14727 \let\critext\relax%
14728 \def\do##1{\global\csletcs{##1footnote}{l@dgobbledarg}}
14729 \dolistloop{\@series}%
14730 \let\edindex\nulledindex%
14731 \let\linenum\@gobble}
14732 \newcommand{\l@drestoreforcritext}{%
14733 \def\do##1{\csdef{##1footnote}##1##2/{\csuse{##1@@footnote}{##1}{##2}}}
14734 \dolistloop{\@series}%
14735 \let\edindex\xedindex}
14736
14737 % \end{macrocode}
14738 % \end{macro}
14739 % \end{macro}
14740 %
14741 % \begin{macro}{\l@dmodforedtext}
14742 % \begin{macro}{\l@drestoreforedtext}
14743 % Modify and restore various macros for when |\edtext| is used.
14744 % \changes{v1.12.5}{2014/08/28}{Debug optional arguments of \cs{Xfootnote} in tabular context}
14745 % \begin{macrocode}
14746 \newcommand{\l@dmodforedtext}{%
14747 \let\edtext\relax
14748 \def\do##1{\global\csletcs{##1footnote}{l@dgobbleoptarg}}%
14749 \dolistloop{\@series}%
14750 \let\edindex\nulledindex
14751 \let\linenum\@gobble}
14752 \newcommand{\l@drestoreforedtext}{%
14753 \def\do##1{\global\csletcs{##1footnote}{##1@@footnote}}
14754 \dolistloop{\@series}%
14755 \let\edindex\xedindex}
14756 % \end{macrocode}
14757 % \end{macro}
14758 % \end{macro}
14759 %
14760 % \begin{macro}{\l@dnullfills}
14761 % \begin{macro}{\l@drestorefills}
14762 % Nullify and restore some column fillers, etc.
14763 % \begin{macrocode}
14764 \newcommand{\l@dnullfills}{%
14765 \def\edlabel##1{}%
14766 \def\edrowfill##1##2##3{}%
14767 }
14768 \newcommand{\l@drestorefills}{%
14769 \def\edrowfill##1##2##3{\@EDROWFILL@{##1}{##2}{##3}}%
14770 }
14771
14772 % \end{macrocode}
14773 % \end{macro}
14774 % \end{macro}
14775 %
14776 %
14777 %
14778 % The original definition of |\rverteilen| and friends
14779 % (`verteilen' is approximately `distribute') was along the lines:
14780 % \begin{verbatim}
14781 % \def\rverteilen #1&{\def\label##1{}%
14782 % \ifx #1! \ifnum\l@dcolcount=0%\removelastskip
14783 % \let\Next\relax%
14784 % \else\l@dcolcount=0%
14785 % \let\Next=\rverteilen%
14786 % \fi%
14787 % \else%
14788 % \footnoteverschw%
14789 % \stepl@dcolcount%
14790 % \setbox\hilfsbox=\hbox{$\displaystyle{#1}$}%
14791 % \let\critext=\xcritext\let\Dfootnote=\D@@footnote
14792 % \let\Afootnote=\A@@footnote\let\Bfootnote=\B@@footnote
14793 % \let\Cfootnote=\C@@footnote\let\linenum=\@line@@num%
14794 % \hilfsskip=\Dimenzuordnung%
14795 % \advance\hilfsskip by -\wd\hilfsbox
14796 % \def\label##1{\xlabel{##1}}%
14797 % \hskip\hilfsskip$\displaystyle{#1}$%
14798 % \hskip\edtabcolsep%
14799 % \let\Next=\rverteilen%
14800 % \fi\Next}
14801 % \end{verbatim}
14802 % where the lines
14803 % \begin{verbatim}
14804 % \let\critext=\xcritext\let\Dfootnote=\D@@footnote
14805 % \let\Afootnote=\A@@footnote\let\Bfootnote=\B@@footnote
14806 % \let\Cfootnote=\C@@footnote\let\linenum=\@line@@num%
14807 % \hilfsskip=\Dimenzuordnung%
14808 % \advance\hilfsskip by -\wd\hilfsbox
14809 % \def\label##1{\xlabel{##1}}%
14810 % \end{verbatim}
14811 % were common across the several |*verteilen*| macros, and also
14812 % \begin{verbatim}
14813 % \def\footnoteverschw{%
14814 % \let\critext\relax
14815 % \let\Afootnote=\verschwinden
14816 % \let\Bfootnote=\verschwinden
14817 % \let\Cfootnote=\verschwinden
14818 % \let\Dfootnote=\verschwinden
14819 % \let\linenum=\@gobble}
14820 % \end{verbatim}
14821 %
14822 % \begin{macro}{\letsforverteilen}
14823 % Gathers some lets and other code that is common to the |*verteilen*| macros.
14824 % \begin{macrocode}
14825 \newcommand{\letsforverteilen}{%
14826 \let\critext\xcritext
14827 \let\edtext\xedtext
14828 \let\edindex\xedindex
14829 \def\do##1{\global\csletcs{##1footnote}{##1@@footnote}}
14830 \dolistloop{\@series}%
14831 \let\linenum\@line@@num
14832 \hilfsskip=\l@dcolwidth%
14833 \advance\hilfsskip by -\wd\hilfsbox
14834 \def\edlabel##1{\xedlabel{##1}}}
14835
14836 % \end{macrocode}
14837 % \end{macro}
14838 %
14839 % \begin{macro}{\setmcellright}
14840 % Typeset (recursively) cells of display math right justified. (was |\rverteilen|)
14841 % \begin{macrocode}
14842 \def\setmcellright #1&{\def\edlabel##1{}%
14843 \let\edindex\nulledindex
14844 \ifx #1\\ \ifnum\l@dcolcount=0%\removelastskip
14845 \let\Next\relax%
14846 \else\l@dcolcount=0%
14847 \let\Next=\setmcellright%
14848 \fi%
14849 \else%
14850 \disablel@dtabfeet%
14851 \stepl@dcolcount%
14852 \disable@notes%
14853 \setbox\hilfsbox=\hbox{$\displaystyle{#1}$}%
14854 \restore@notes%
14855 \letsforverteilen%
14856 \hskip\hilfsskip$\displaystyle{#1}$%
14857 \hskip\edtabcolsep%
14858 \let\Next=\setmcellright%
14859 \fi\Next}
14860
14861 % \end{macrocode}
14862 % \end{macro}
14863 %
14864 % \begin{macro}{\settcellright}
14865 % Typeset (recursively) cells of text right justified. (was |\rverteilentext|)
14866 % \begin{macrocode}
14867 \def\settcellright #1&{\def\edlabel##1{}%
14868 \let\edindex\nulledindex
14869 \ifx #1\\ \ifnum\l@dcolcount=0%\removelastskip
14870 \let\Next\relax%
14871 \else\l@dcolcount=0%
14872 \let\Next=\settcellright%
14873 \fi%
14874 \else%
14875 \disablel@dtabfeet%
14876 \stepl@dcolcount%
14877 \disable@notes%
14878 \setbox\hilfsbox=\hbox{#1}%
14879 \restore@notes%
14880 \letsforverteilen%
14881 \hskip\hilfsskip#1%
14882 \hskip\edtabcolsep%
14883 \let\Next=\settcellright%
14884 \fi\Next}
14885 % \end{macrocode}
14886 % \end{macro}
14887 %
14888 % \begin{macro}{\setmcellleft}
14889 % Typeset (recursively) cells of display math left justified. (was |\lverteilen|)
14890 % \begin{macrocode}
14891 \def\setmcellleft #1&{\def\edlabel##1{}%
14892 \let\edindex\nulledindex
14893 \ifx #1\\ \ifnum\l@dcolcount=0 \let\Next\relax%
14894 \else\l@dcolcount=0%
14895 \let\Next=\setmcellleft%
14896 \fi%
14897 \else \disablel@dtabfeet%
14898 \stepl@dcolcount%
14899 \disable@notes%
14900 \setbox\hilfsbox=\hbox{$\displaystyle{#1}$}%
14901 \restore@notes%
14902 \letsforverteilen%
14903 $\displaystyle{#1}$\hskip\hilfsskip\hskip\edtabcolsep%
14904 \let\Next=\setmcellleft%
14905 \fi\Next}
14906
14907 % \end{macrocode}
14908 % \end{macro}
14909 %
14910 % \begin{macro}{\settcellleft}
14911 % Typeset (recursively) cells of text left justified. (was |\lverteilentext|)
14912 % \begin{macrocode}
14913 \def\settcellleft #1&{\def\edlabel##1{}%
14914 \let\edindex\nulledindex
14915 \ifx #1\\ \ifnum\l@dcolcount=0 \let\Next\relax%
14916 \else\l@dcolcount=0%
14917 \let\Next=\settcellleft%
14918 \fi%
14919 \else \disablel@dtabfeet%
14920 \stepl@dcolcount%
14921 \disable@notes%
14922 \setbox\hilfsbox=\hbox{#1}%
14923 \restore@notes%
14924 \letsforverteilen%
14925 #1\hskip\hilfsskip\hskip\edtabcolsep%
14926 \let\Next=\settcellleft%
14927 \fi\Next}
14928 % \end{macrocode}
14929 % \end{macro}
14930 %
14931 % \begin{macro}{\setmcellcenter}
14932 % Typeset (recursively) cells of display math centered. (was |\zverteilen|)
14933 % \begin{macrocode}
14934 \def\setmcellcenter #1&{\def\edlabel##1{}%
14935 \let\edindex\nulledindex
14936 \ifx #1\\ \ifnum\l@dcolcount=0\let\Next\relax%
14937 \else\l@dcolcount=0%
14938 \let\Next=\setmcellcenter%
14939 \fi%
14940 \else \disablel@dtabfeet%
14941 \stepl@dcolcount%
14942 \disable@notes%
14943 \setbox\hilfsbox=\hbox{$\displaystyle{#1}$}%
14944 \restore@notes%
14945 \letsforverteilen%
14946 \hskip 0.5\hilfsskip$\displaystyle{#1}$\hskip0.5\hilfsskip%
14947 \hskip\edtabcolsep%
14948 \let\Next=\setmcellcenter%
14949 \fi\Next}
14950
14951 % \end{macrocode}
14952 % \end{macro}
14953 %
14954 % \begin{macro}{\settcellcenter}
14955 % Typeset (recursively) cells of text centered. (new)
14956 % \begin{macrocode}
14957 \def\settcellcenter #1&{\def\edlabel##1{}%
14958 \let\edindex\nulledindex
14959 \ifx #1\\ \ifnum\l@dcolcount=0 \let\Next\relax%
14960 \else\l@dcolcount=0%
14961 \let\Next=\settcellcenter%
14962 \fi%
14963 \else \disablel@dtabfeet%
14964 \stepl@dcolcount%
14965 \disable@notes%
14966 \setbox\hilfsbox=\hbox{#1}%
14967 \restore@notes%
14968 \letsforverteilen%
14969 \hskip 0.5\hilfsskip #1\hskip 0.5\hilfsskip%
14970 \hskip\edtabcolsep%
14971 \let\Next=\settcellcenter%
14972 \fi\Next}
14973
14974 % \end{macrocode}
14975 % \end{macro}
14976 %
14977 % \begin{macro}{\NEXT}
14978 % \begin{macrocode}
14979 \let\NEXT=\relax
14980
14981 % \end{macrocode}
14982 % \end{macro}
14983 %
14984 % \begin{macro}{\setmrowright}
14985 % Typeset (recursively) rows of right justified math. (was |\rsetzen|)
14986 % \begin{macrocode}
14987 \def\setmrowright #1\\{%
14988 \ifx #1& \let\NEXT\relax
14989 \else \centerline{\setmcellright #1&\\&\\&}
14990 \let\NEXT=\setmrowright
14991 \fi\NEXT}
14992 % \end{macrocode}
14993 % \end{macro}
14994 %
14995 % \begin{macro}{\settrowright}
14996 % Typeset (recursively) rows of right justified text. (was |\rsetzentext|)
14997 % \begin{macrocode}
14998 \def\settrowright #1\\{%
14999 \ifx #1& \let\NEXT\relax
15000 \else \centerline{\settcellright #1&\\&\\&}
15001 \let\NEXT=\settrowright
15002 \fi\NEXT}
15003
15004 % \end{macrocode}
15005 % \end{macro}
15006 %
15007 % \begin{macro}{\setmrowleft}
15008 % Typeset (recursively) rows of left justified math. (was |\lsetzen|)
15009 % \begin{macrocode}
15010 \def\setmrowleft #1\\{%
15011 \ifx #1&\let\NEXT\relax
15012 \else \centerline{\setmcellleft #1&\\&\\&}
15013 \let\NEXT=\setmrowleft
15014 \fi\NEXT}
15015 % \end{macrocode}
15016 % \end{macro}
15017 %
15018 % \begin{macro}{\settrowleft}
15019 % Typeset (recursively) rows of left justified text. (was |\lsetzentext|)
15020 % \begin{macrocode}
15021 \def\settrowleft #1\\{%
15022 \ifx #1& \let\NEXT\relax
15023 \else \centerline{\settcellleft #1&\\&\\&}
15024 \let\NEXT=\settrowleft
15025 \fi\NEXT}
15026
15027 % \end{macrocode}
15028 % \end{macro}
15029 %
15030 % \begin{macro}{\setmrowcenter}
15031 % Typeset (recursively) rows of centered math. (was |\zsetzen|)
15032 % \begin{macrocode}
15033 \def\setmrowcenter #1\\{%
15034 \ifx #1& \let\NEXT\relax%
15035 \else \centerline{\setmcellcenter #1&\\&\\&}
15036 \let\NEXT=\setmrowcenter
15037 \fi\NEXT}
15038 % \end{macrocode}
15039 % \end{macro}
15040 %
15041 % \begin{macro}{\settrowcenter}
15042 % Typeset (recursively) rows of centered text. (new)
15043 % \begin{macrocode}
15044 \def\settrowcenter #1\\{%
15045 \ifx #1& \let\NEXT\relax
15046 \else \centerline{\settcellcenter #1&\\&\\&}
15047 \let\NEXT=\settrowcenter
15048 \fi\NEXT}
15049
15050 % \end{macrocode}
15051 % \end{macro}
15052 %
15053 % \begin{macro}{\nullsetzen}
15054 % (was |\nullsetzen|)
15055 % \begin{macrocode}
15056 \newcommand{\nullsetzen}{%
15057 \stepl@dcolcount%
15058 \l@dcolwidth=0pt%
15059 \ifnum\l@dcolcount=30\let\NEXT\relax%
15060 \l@dcolcount=0\relax
15061 \else\let\NEXT\nullsetzen%
15062 \fi\NEXT}
15063
15064 % \end{macrocode}
15065 % \end{macro}
15066 %
15067 % \begin{macro}{\edatleft}
15068 % |\edatleft|\oarg{math}\marg{symbol}\marg{len} (combination and
15069 % generalisation of original |\Seklam| and |\Seklamgl|).
15070 % Left \meta{symbol}, 2\meta{len} high with prepended \meta{math} vertically centered.
15071 % \begin{macrocode}
15072 \newcommand{\edatleft}[3][\@empty]{%
15073 \ifx#1\@empty
15074 \vbox to 10pt{\vss\hbox{$\left#2\vrule width0pt height #3
15075 depth 0pt \right. $\hss}\vfil}
15076 \else
15077 \vbox to 4pt{\vss\hbox{$#1\left#2\vrule width0pt height #3
15078 depth 0pt \right. $}\vfil}
15079 \fi}
15080 % \end{macrocode}
15081 % \end{macro}
15082 %
15083 %
15084 % \begin{macro}{\edatright}
15085 % |\edatright|\oarg{math}\marg{symbol}\marg{len} (combination and
15086 % generalisation of original |\seklam| and |\seklamgl|).
15087 % Right \meta{symbol}, 2\meta{len} high with appended \meta{math} vertically centered.
15088 % \begin{macrocode}
15089 \newcommand{\edatright}[3][\@empty]{%
15090 \ifx#1\@empty
15091 \vbox to 10pt{\vss\hbox{$\left.\vrule width0pt height #3
15092 depth 0pt \right#2 $\hss}\vfil}
15093 \else
15094 \vbox to 4pt{\vss\hbox{$\left.\vrule width0pt height #3
15095 depth 0pt \right#2 #1 $}\vfil}
15096 \fi}
15097
15098 % \end{macrocode}
15099 % \end{macro}
15100 %
15101 %
15102 % \begin{macro}{\edvertline}
15103 % |\edvertline|\marg{len} vertical line \meta{len} high. (was |\sestrich|)
15104 % \begin{macrocode}
15105 \newcommand{\edvertline}[1]{\vbox to 8pt{\vss\hbox{\vrule height #1}\vfil}}
15106
15107 % \end{macrocode}
15108 % \end{macro}
15109 %
15110 % \begin{macro}{\edvertdots}
15111 % |\edvertdots|\marg{len} vertical dotted line \meta{len} high. (was |\sepunkte|)
15112 % \begin{macrocode}
15113 \newcommand{\edvertdots}[1]{\vbox to 1pt{\vss\vbox to #1%
15114 {\cleaders\hbox{$\m@th\hbox{.}\vbox to 0.5em{ }$}\vfil}}}
15115
15116 % \end{macrocode}
15117 % \end{macro}
15118 %
15119 % I don't know if this is relevant here, and I haven't tried it,
15120 % but the following appeared on CTT.
15121 % \begin{verbatim}
15122 % From: [email protected] (Mark Wooding)
15123 % Newsgroups: comp.text.tex
15124 % Subject: Re: Dotted line
15125 % Date: 13 Aug 2003 13:51:14 GMT
15126 %
15127 % Alexis Eisenhofer <[email protected]> wrote:
15128 % > Can anyone provide me with the LaTex command for a vertical dotted line?
15129 %
15130 % How dotted? Here's the basic rune.
15131 % \newbox\linedotbox
15132 % \setbox\linedotbox=\vbox{...}
15133 % \leaders\copy\linedotbox\vskip2in
15134 %
15135 % For just dots, this works:
15136 % \setbox\linedotbox=\vbox{\hbox{\normalfont.}\kern2pt}
15137 %
15138 % For dashes, something like
15139 % \setbox\linedotbox=\vbox{\leaders\vrule\vskip2pt\vskip2pt}
15140 % is what you want. (Adjust the `2pt' values to taste. The first one is
15141 % the length of the dashes, the second is the length of the gaps.)
15142 %
15143 % For dots in mid-paragraph, you need to say something like
15144 % \lower10pt\vbox{\leaders\copy\linedotbox\vskip2in}
15145 % which is scungy but works.
15146 %
15147 % -- [mdw]
15148 % \end{verbatim}
15149 %
15150 % \begin{macro}{\edfilldimen}
15151 % A length. (was |\klamdimen|)
15152 % \begin{macrocode}
15153 \newdimen\edfilldimen
15154 \edfilldimen=0pt
15155
15156 % \end{macrocode}
15157 % \end{macro}
15158 %
15159 % \begin{macro}{\c@addcolcount}
15160 % \begin{macro}{\theaddcolcount}
15161 % A counter to hold the number of a column. We use a roman number so
15162 % that we can grab the column dimension from |\dcol...|.
15163 % \begin{macrocode}
15164 \newcounter{addcolcount}
15165 \renewcommand{\theaddcolcount}{\roman{addcolcount}}
15166 % \end{macrocode}
15167 % \end{macro}
15168 % \end{macro}
15169 %
15170 % \begin{macro}{\l@dtabaddcols}
15171 % |\l@dtabaddcols|\marg{startcol}\marg{endcol} adds the widths of
15172 % the columns \meta{startcol} through \meta{endcol} to |\edfilldimen|.
15173 % It is a LaTeX style
15174 % reimplementation of the original |\@add@|.
15175 % \begin{macrocode}
15176 \newcommand{\l@dtabaddcols}[2]{%
15177 \l@dcheckstartend{#1}{#2}%
15178 \ifl@dstartendok
15179 \setcounter{addcolcount}{#1}%
15180 \@whilenum \value{addcolcount}<#2\relax \do
15181 {\advance\edfilldimen by \the \csname dcol\theaddcolcount\endcsname
15182 \advance\edfilldimen by \edtabcolsep
15183 \stepcounter{addcolcount}}%
15184 \advance\edfilldimen by \the \csname dcol\theaddcolcount\endcsname
15185 \fi
15186 }
15187
15188 % \end{macrocode}
15189 % \end{macro}
15190 %
15191 % \begin{macro}{\ifl@dstartendok}
15192 % \begin{macro}{\l@dcheckstartend}
15193 % |\l@dcheckstartend|\marg{startcol}\marg{endcol} checks that the values
15194 % of \meta{startcol} and \meta{endcol} are sensible. If they are then
15195 % |\ifl@dstartendok| is set TRUE, otherwise it is set FALSE.
15196 % \begin{macrocode}
15197 \newif\ifl@dstartendok
15198 \newcommand{\l@dcheckstartend}[2]{%
15199 \l@dstartendoktrue
15200 \ifnum #1<\@ne
15201 \l@dstartendokfalse
15202 \led@err@LowStartColumn
15203 \fi
15204 \ifnum #2>30\relax
15205 \l@dstartendokfalse
15206 \led@err@HighEndColumn
15207 \fi
15208 \ifnum #1>#2\relax
15209 \l@dstartendokfalse
15210 \led@err@ReverseColumns
15211 \fi
15212 }
15213
15214 % \end{macrocode}
15215 % \end{macro}
15216 % \end{macro}
15217 %
15218 % \begin{macro}{\edrowfill}
15219 % \begin{macro}{\@edrowfill@}
15220 % \begin{macro}{\@EDROWFILL@}
15221 % |\edrowfill|\marg{startcol}\marg{endcol}{fill}
15222 % fills columns \meta{startcol} to \meta{endcol} inclusive with
15223 % \meta{fill} (e.g. |\hrulefill|, |\upbracefill|).
15224 % This is a LaTex style reimplementation and generalization of the
15225 % original |\waklam|, |\Waklam|, |\waklamec|, |\wastricht|
15226 % and |\wapunktel| macros.
15227 % \begin{macrocode}
15228 \newcommand*{\edrowfill}[3]{%
15229 \l@dtabaddcols{#1}{#2}%
15230 \hb@xt@ \the\l@dcolwidth{\hb@xt@ \the\edfilldimen{#3}\hss}}
15231 \let\@edrowfill@=\edrowfill
15232 \def\@EDROWFILL@#1#2#3{\@edrowfill@{#1}{#2}{#3}}
15233
15234 % \end{macrocode}
15235 % \end{macro}
15236 % \end{macro}
15237 % \end{macro}
15238 %
15239 %
15240 % \DescribeMacro{\edbeforetab}
15241 % \DescribeMacro{\edaftertab}
15242 % The macro |\edbeforetab|\marg{text}\marg{math} puts \meta{text} at
15243 % the left margin before array cell entry \meta{math}. Conversely,
15244 % the macro |\edaftertab|\marg{math}\marg{text} puts \meta{text}
15245 % at the right margin after array cell entry \meta{math}.
15246 % |\edbeforetab| should be in the first column and |\edaftertab| in the
15247 % last column.
15248 % The following macros support these.
15249 %
15250 % \begin{macro}{\leftltab}
15251 % |\leftltab|\marg{text} for |\edbeforetab| in |\ltab|. (was |\linksltab|)
15252 % \begin{macrocode}
15253 \newcommand{\leftltab}[1]{%
15254 \hb@xt@\z@{\vbox{\edtabindent%
15255 \moveleft\Hilfsskip\hbox{\ #1}}\hss}}
15256
15257 % \end{macrocode}
15258 % \end{macro}
15259 %
15260 % \begin{macro}{\leftrtab}
15261 % |\leftrtab|\marg{text}\marg{math} for |\edbeforetab| in |\rtab|. (was |\linksrtab|)
15262 % \begin{macrocode}
15263 \newcommand{\leftrtab}[2]{%
15264 #2\hb@xt@\z@{\vbox{\edtabindent%
15265 \advance\Hilfsskip by\dcoli%
15266 \moveleft\Hilfsskip\hbox{\ #1}}\hss}}
15267
15268 % \end{macrocode}
15269 % \end{macro}
15270 %
15271 % \begin{macro}{\leftctab}
15272 % |\leftctab|\marg{text}\marg{math} for |\edbeforetab| in |\ctab|. (was |\linksztab|)
15273 % \begin{macrocode}
15274 \newcommand{\leftctab}[2]{%
15275 \hb@xt@\z@{\vbox{\edtabindent\l@dcolcount=\l@dampcount%
15276 \advance\Hilfsskip by 0.5\dcoli%
15277 \setbox\hilfsbox=\hbox{\def\edlabel##1{}%
15278 \disablel@dtabfeet$\displaystyle{#2}$}%
15279 \advance\Hilfsskip by -0.5\wd\hilfsbox%
15280 \moveleft\Hilfsskip\hbox{\ #1}}\hss}%
15281 #2}
15282
15283 % \end{macrocode}
15284 % \end{macro}
15285 %
15286 % \begin{macro}{\rightctab}
15287 % |\rightctab|\marg{math}\marg{text} for |\edaftertab| in |\ctab|. (was |\rechtsztab|)
15288 % \begin{macrocode}
15289 \newcommand{\rightctab}[2]{%
15290 \setbox\hilfsbox=\hbox{\def\edlabel##1{}%
15291 \disablel@dtabfeet#2}\l@dampcount=\l@dcolcount%
15292 #1\hb@xt@\z@{\vbox{\edtabindent\l@dcolcount=\l@dampcount%
15293 \advance\Hilfsskip by 0.5\l@dcolwidth%
15294 \advance\Hilfsskip by -\wd\hilfsbox%
15295 \setbox\hilfsbox=\hbox{\def\edlabel##1{}%
15296 \disablel@dtabfeet$\displaystyle{#1}$}%
15297 \advance\Hilfsskip by -0.5\wd\hilfsbox%
15298 \advance\Hilfsskip by \edtabcolsep%
15299 \moveright\Hilfsskip\hbox{ #2}}\hss}%
15300 }
15301
15302 % \end{macrocode}
15303 % \end{macro}
15304 %
15305 % \begin{macro}{\rightltab}
15306 % |\rightltab|\marg{math}\marg{text} for |\edaftertab| in |\ltab|. (was |\rechtsltab|)
15307 % \begin{macrocode}
15308 \newcommand{\rightltab}[2]{%
15309 \setbox\hilfsbox=\hbox{\def\edlabel##1{}%
15310 \disablel@dtabfeet#2}\l@dampcount=\l@dcolcount%
15311 #1\hb@xt@\z@{\vbox{\edtabindent\l@dcolcount=\l@dampcount%
15312 \advance\Hilfsskip by\l@dcolwidth%
15313 \advance\Hilfsskip by-\wd\hilfsbox%
15314 \setbox\hilfsbox=\hbox{\def\edlabel##1{}%
15315 \disablel@dtabfeet$\displaystyle{#1}$}%
15316 \advance\Hilfsskip by-\wd\hilfsbox%
15317 \advance\Hilfsskip by\edtabcolsep%
15318 \moveright\Hilfsskip\hbox{ #2}}\hss}%
15319 }
15320
15321 % \end{macrocode}
15322 % \end{macro}
15323 %
15324 % \begin{macro}{\rightrtab}
15325 % |\rightrtab|\marg{math}\marg{text} for |\edaftertab| in |\rtab|. (was |\rechtsrtab|)
15326 % \begin{macrocode}
15327 \newcommand{\rightrtab}[2]{%
15328 \setbox\hilfsbox=\hbox{\def\edlabel##1{}%
15329 \disablel@dtabfeet#2}%
15330 #1\hb@xt@\z@{\vbox{\edtabindent%
15331 \advance\Hilfsskip by-\wd\hilfsbox%
15332 \advance\Hilfsskip by\edtabcolsep%
15333 \moveright\Hilfsskip\hbox{ #2}}\hss}%
15334 }
15335
15336 % \end{macrocode}
15337 % \end{macro}
15338 %
15339 % \begin{macro}{\rtab}
15340 % \begin{macro}{\edbeforetab}
15341 % \begin{macro}{\edaftertab}
15342 % |\rtab|\marg{body} typesets \meta{body} as an array with the
15343 % entries right justified. (was |\rtab|)
15344 % (Here and elsewhere,
15345 % |\edbeforetab| and |\edaftertab| were originally |\davor| and |\danach|)
15346 % The original |\rtab| and friends included a fair bit of common code
15347 % which I have extracted into macros.
15348 %
15349 % The process is first to measure the \meta{body} to get the column
15350 % widths, and then in a second pass to typeset the body.
15351 % \begin{macrocode}
15352 \newcommand{\rtab}[1]{%
15353 \l@dnullfills
15354 \def\edbeforetab##1##2{\leftrtab{##1}{##2}}%
15355 \def\edaftertab##1##2{\rightrtab{##1}{##2}}%
15356 \measurembody{#1}%
15357 \l@drestorefills
15358 \variab
15359 \setmrowright #1\\&\\%
15360 \enablel@dtabfeet}
15361
15362 % \end{macrocode}
15363 % \end{macro}
15364 % \end{macro}
15365 % \end{macro}
15366 %
15367 % \begin{macro}{\measurembody}
15368 % |\measurembody|\marg{body} measures the array \meta{body}.
15369 % \begin{macrocode}
15370 \newcommand{\measurembody}[1]{%
15371 \disablel@dtabfeet%
15372 \l@dcolcount=0%
15373 \nullsetzen%
15374 \l@dcolcount=0
15375 \measuremrow #1\\&\\%
15376 \global\l@dampcount=1}
15377
15378 % \end{macrocode}
15379 % \end{macro}
15380 %
15381 % \begin{macro}{\rtabtext}
15382 % |\rtabtext|\marg{body} typesets \meta{body} as a tabular with the
15383 % entries right justified. (was |\rtabtext|)
15384 % \begin{macrocode}
15385 \newcommand{\rtabtext}[1]{%
15386 \l@dnullfills
15387 \measuretbody{#1}%
15388 \l@drestorefills
15389 \variab
15390 \settrowright #1\\&\\%
15391 \enablel@dtabfeet}
15392
15393 % \end{macrocode}
15394 % \end{macro}
15395 %
15396 % \begin{macro}{\measuretbody}
15397 % |\measuretbody|\marg{body} measures the tabular \meta{body}.
15398 % \begin{macrocode}
15399 \newcommand{\measuretbody}[1]{%
15400 \disable@notes%
15401 \disablel@dtabfeet%
15402 \l@dcolcount=0%
15403 \nullsetzen%
15404 \l@dcolcount=0
15405 \measuretrow #1\\&\\%
15406 \restore@notes%
15407 \global\l@dampcount=1}
15408
15409 % \end{macrocode}
15410 % \end{macro}
15411 %
15412 % \begin{macro}{\ltab}
15413 % \begin{macro}{\edbeforetab}
15414 % \begin{macro}{\edaftertab}
15415 % Array with entries left justified. (was |\ltab|)
15416 % \begin{macrocode}
15417 \newcommand{\ltab}[1]{%
15418 \l@dnullfills
15419 \def\edbeforetab##1##2{\leftltab{##1}{##2}}%
15420 \def\edaftertab##1##2{\rightltab{##1}{##2}}%
15421 \measurembody{#1}%
15422 \l@drestorefills
15423 \variab
15424 \setmrowleft #1\\&\\%
15425 \enablel@dtabfeet}
15426
15427 % \end{macrocode}
15428 % \end{macro}
15429 % \end{macro}
15430 % \end{macro}
15431 %
15432 % \begin{macro}{\ltabtext}
15433 % Tabular with entries left justified. (was |\ltabtext|)
15434 % \begin{macrocode}
15435 \newcommand{\ltabtext}[1]{%
15436 \l@dnullfills
15437 \measuretbody{#1}%
15438 \l@drestorefills
15439 \variab
15440 \settrowleft #1\\&\\%
15441 \enablel@dtabfeet}
15442
15443 % \end{macrocode}
15444 % \end{macro}
15445 %
15446 % \begin{macro}{\ctab}
15447 % \begin{macro}{\edbeforetab}
15448 % \begin{macro}{\edaftertab}
15449 % Array with centered entries. (was |\ztab|)
15450 % \begin{macrocode}
15451 \newcommand{\ctab}[1]{%
15452 \l@dnullfills
15453 \def\edbeforetab##1##2{\leftctab{##1}{##2}}%
15454 \def\edaftertab##1##2{\rightctab{##1}{##2}}%
15455 \measurembody{#1}%
15456 \l@drestorefills
15457 \variab
15458 \setmrowcenter #1\\&\\%
15459 \enablel@dtabfeet}
15460
15461 % \end{macrocode}
15462 % \end{macro}
15463 % \end{macro}
15464 % \end{macro}
15465 %
15466 % \begin{macro}{\ctabtext}
15467 % Tabular with entries centered. (new)
15468 % \begin{macrocode}
15469 \newcommand{\ctabtext}[1]{%
15470 \l@dnullfills
15471 \measuretbody{#1}%
15472 \l@drestorefills
15473 \variab
15474 \settrowcenter #1\\&\\%
15475 \enablel@dtabfeet}
15476
15477 % \end{macrocode}
15478 % \end{macro}
15479 %
15480 % \begin{macro}{\spreadtext}
15481 % (was |\breitertext|)
15482 % \begin{macrocode}
15483 \newcommand{\spreadtext}[1]{%\l@dcolcount=\l@dampcount%
15484 \hb@xt@ \the\l@dcolwidth{\hbox{#1}\hss}}
15485 % \end{macrocode}
15486 % \end{macro}
15487 %
15488 % \begin{macro}{\spreadmath}
15489 % (was |\breiter|, `breiter' = `broadly')
15490 % \begin{macrocode}
15491 \newcommand{\spreadmath}[1]{%
15492 \hb@xt@ \the\l@dcolwidth{\hbox{$\displaystyle{#1}$}\hss}}
15493
15494 % \end{macrocode}
15495 % \end{macro}
15496 %
15497 % I have left the remaining \tabmac{} alone, apart from changing some names.
15498 % I'm not yet sure what they do or how they do it. Authors should not use
15499 % any of these as they are likely to be mutable.
15500 %
15501 % \begin{macro}{\tabellzwischen}
15502 % (was |\tabellzwischen|)
15503 % \begin{macrocode}
15504 \def\tabellzwischen #1&{%
15505 \ifx #1\\ \let\NEXT\relax \l@dcolcount=0
15506 \else \stepl@dcolcount%
15507 \l@dcolwidth = #1 mm
15508 \let\NEXT=\tabellzwischen
15509 \fi \NEXT }
15510
15511 % \end{macrocode}
15512 % \end{macro}
15513 %
15514 % \begin{macro}{\edatabell}
15515 % For example |\edatabell 4 & 19 & 8 \\| specifies 3 columns with widths
15516 % of 4, 19, and 8mm. (was |\atabell|)
15517 % \begin{macrocode}
15518 \def\edatabell #1\\{%
15519 \tabellzwischen #1&\\&}
15520 % \end{macrocode}
15521 % \end{macro}
15522 %
15523 % \begin{macro}{\Setzen}
15524 % (was |\Setzen|, `setzen' = `set')
15525 % \begin{macrocode}
15526 \def\Setzen #1&{%
15527 \ifx #1\relax \let\NEXT=\relax
15528 \else \stepl@dcolcount%
15529 \let\tabelskip=\l@dcolwidth
15530 \EDTAB #1|
15531 \let\NEXT=\Setzen
15532 \fi\NEXT}
15533
15534 % \end{macrocode}
15535 % \end{macro}
15536 %
15537 % \begin{macro}{\EDATAB}
15538 % (was |\ATAB|)
15539 % \begin{macrocode}
15540 \def\EDATAB #1\\{%
15541 \ifx #1\Relax \centerline{\Setzen #1\relax&}
15542 \let\Next\relax
15543 \else \centerline{\Setzen #1&\relax&}
15544 \let\Next=\EDATAB
15545 \fi\Next}
15546 % \end{macrocode}
15547 % \end{macro}
15548 %
15549 % \begin{macro}{\edatab}
15550 % (was |\atab|)
15551 % \begin{macrocode}
15552 \newcommand{\edatab}[1]{%
15553 \variab%
15554 \EDATAB #1\\\Relax\\}
15555
15556 % \end{macrocode}
15557 % \end{macro}
15558 %
15559 % \begin{macro}{\HILFSskip}
15560 % \begin{macro}{\Hilfsskip}
15561 % More helpers.
15562 % \begin{macrocode}
15563 \newskip\HILFSskip
15564 \newskip\Hilfsskip
15565
15566 % \end{macrocode}
15567 % \end{macro}
15568 % \end{macro}
15569 %
15570 % \begin{macro}{\EDTABINDENT}
15571 % (was |\TABINDENT|)
15572 % \begin{macrocode}
15573 \newcommand{\EDTABINDENT}{%
15574 \ifnum\l@dcolcount=30\let\NEXT\relax\l@dcolcount=0%
15575 \else\stepl@dcolcount%
15576 \advance\Hilfsskip by\l@dcolwidth%
15577 \ifdim\l@dcolwidth=0pt\advance\hilfscount\@ne
15578 \else\advance\Hilfsskip by \the\hilfscount\edtabcolsep%
15579 \hilfscount=1\fi%
15580 \let\NEXT=\EDTABINDENT%
15581 \fi\NEXT}%
15582 % \end{macrocode}
15583 % \end{macro}
15584 %
15585 % \begin{macro}{\edtabindent}
15586 % (was |\tabindent|)
15587 % \begin{macrocode}
15588 \newcommand{\edtabindent}{%
15589 \l@dcolcount=0\relax
15590 \Hilfsskip=0pt%
15591 \hilfscount=1\relax
15592 \EDTABINDENT%
15593 \hilfsskip=\hsize%
15594 \advance\hilfsskip -\Hilfsskip%
15595 \Hilfsskip=0.5\hilfsskip%
15596 }%
15597
15598 % \end{macrocode}
15599 % \end{macro}
15600 %
15601 % \begin{macro}{\EDTAB}
15602 % (was |\TAB|)
15603 % \begin{macrocode}
15604 \def\EDTAB #1|#2|{%
15605 \setbox\tabhilfbox=\hbox{$\displaystyle{#1}$}%
15606 \setbox\tabHilfbox=\hbox{$\displaystyle{#2}$}%
15607 \advance\tabelskip -\wd\tabhilfbox%
15608 \advance\tabelskip -\wd\tabHilfbox%
15609 \unhbox\tabhilfbox\hskip\tabelskip%
15610 \unhbox\tabHilfbox}%
15611
15612 % \end{macrocode}
15613 % \end{macro}
15614 %
15615 % \begin{macro}{\EDTABtext}
15616 % (was |\TABtext|)
15617 % \begin{macrocode}
15618 \def\EDTABtext #1|#2|{%
15619 \setbox\tabhilfbox=\hbox{#1}%
15620 \setbox\tabHilfbox=\hbox{#2}%
15621 \advance\tabelskip -\wd\tabhilfbox%
15622 \advance\tabelskip -\wd\tabHilfbox%
15623 \unhbox\tabhilfbox\hskip\tabelskip%
15624 \unhbox\tabHilfbox}%
15625 % \end{macrocode}
15626 % \end{macro}
15627 %
15628 % \begin{macro}{\tabhilfbox}
15629 % \begin{macro}{\tabHilfbox}
15630 % Further helpers.
15631 % \begin{macrocode}
15632 \newbox\tabhilfbox
15633 \newbox\tabHilfbox
15634
15635 % \end{macrocode}
15636 % \end{macro}
15637 % \end{macro}
15638 %
15639 % \begin{verbatim}
15640 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
15641 % % That finishes tabmac
15642 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
15643 % \end{verbatim}
15644 %
15645 % \begin{environment}{edarrayl}
15646 % \begin{environment}{edarrayc}
15647 % \begin{environment}{edarrayr}
15648 % The `environment' forms for |\ltab|, |\ctab| and |\rtab|.
15649 % \begin{macrocode}
15650 \newenvironment{edarrayl}{\l@dcollect@body\ltab}{}
15651 \newenvironment{edarrayc}{\l@dcollect@body\ctab}{}
15652 \newenvironment{edarrayr}{\l@dcollect@body\rtab}{}
15653
15654 % \end{macrocode}
15655 % \end{environment}
15656 % \end{environment}
15657 % \end{environment}
15658 %
15659 % \begin{environment}{edtabularl}
15660 % \begin{environment}{edtabularc}
15661 % \begin{environment}{edtabularr}
15662 % The `environment' forms for |\ltabtext|, |\ctabtext| and |\rtabtext|.
15663 % \begin{macrocode}
15664 \newenvironment{edtabularl}{\l@dcollect@body\ltabtext}{}
15665 \newenvironment{edtabularc}{\l@dcollect@body\ctabtext}{}
15666 \newenvironment{edtabularr}{\l@dcollect@body\rtabtext}{}
15667
15668 % \end{macrocode}
15669 % \end{environment}
15670 % \end{environment}
15671 % \end{environment}
15672 %
15673 % Here's the code for enabling |\edtext| (instead of |\critext|).
15674 %
15675 % \begin{macro}{\usingcritext}
15676 % \begin{macro}{\disablel@dtabfeet}
15677 % \begin{macro}{\enablel@dtabfeet}
15678 % \begin{macro}{\usingedtext}
15679 % Declarations for using |\critext{}.../| or using |\edtext{}{}| inside
15680 % tabulars.
15681 % The default at this point is for |\edtext|.
15682 % \begin{macrocode}
15683 \newcommand{\usingcritext}{%
15684 \def\disablel@dtabfeet{\l@dmodforcritext}%
15685 \def\enablel@dtabfeet{\l@drestoreforcritext}}
15686 \newcommand{\usingedtext}{%
15687 \def\disablel@dtabfeet{\l@dmodforedtext}%
15688 \def\enablel@dtabfeet{\l@drestoreforedtext}}
15689
15690 \usingedtext
15691
15692 % \end{macrocode}
15693 % \end{macro}
15694 % \end{macro}
15695 % \end{macro}
15696 % \end{macro}
15697 %
15698 %
15699 %
15700 % \section{Section's title commands}
15701 % \subsection{Deprecated commands}
15702 % \begin{macro}{\initnumbering@sectcmd}
15703 % \begin{macro}{\ledsection}
15704 % \begin{macro}{\ledsection*}
15705 % \begin{macro}{\ledsubsection}
15706 % \begin{macro}{\ledsubsection*}
15707 % \begin{macro}{\ledsubsubsection}
15708 % \begin{macro}{\ledsubsubsection*}
15709 % \begin{macro}{\ledchapter}
15710 % \begin{macro}{\ledchapter*}
15711 % \begin{macro}{\@patchforledchapter}
15712 % \begin{macro}{\quotation}
15713 % \begin{macro}{\endquotation}
15714 % \begin{macro}{\quote}
15715 % \begin{macro}{\endquote}
15716 % \changes{v1.12.0}{2014/08/05}{\cs{ledxxx} sectioning commands are deprecated and replaced by \cs{eledxxx} commands.}
15717 % \changes{v1.2.0}{2012/10/08}{Compatibility of \cs{ledchapter} with the \emph{memoir} class.}
15718 % \changes{v1.3.0}{2012/11/01}{\emph{Quotation} and {quote} environment inside numbered sections.}
15719 % \changes{v1.4.1}{2012/11/16}{New option \emph{noquotation}.}
15720 % \changes{v1.4.7}{2012/06/07}{Compatibility of sectioning commands with \cs{autopar}.}
15721 % \changes{v1.8.0}{2013/12/13}{Correction of sectioning commands in parallel texts.}
15722 % \changes{v1.10.0}{2014/02/27}{Correction of sectioning commands in parallel texts.}
15723 % \cs{initnumbering@sectcmd} defines \cs{ledxxx} commands. These commands are deprecated.
15724 % It also defines quotation environment.
15725 % Note: this assumes that the user didn't change \cs{chapter}.
15726 % If he did, he should redefine \cs{initnumbering@sectcmd}.
15727 % \begin{macrocode}
15728 \newcommand{\initnumbering@sectcmd}{
15729 \newcommand{\ledsection}[2][]{%
15730 \led@war@ledxxxDeprecated{section}%
15731 \leavevmode\pend\vspace{3.5ex \@plus 1ex \@minus .2ex}\ifl@dpairing\else\skipnumbering\fi%%
15732 \pstart%
15733 \leavevmode\ifledsecnolinenumber\skipnumbering\fi\section[##1]{##2}\leavevmode\vspace{2.3ex \@plus.2ex}\skipnumbering\pend%
15734 \vspace{-2\parskip}\vspace{-2\baselineskip}%
15735 \ifautopar\else\pstart\fi
15736 }
15737 \WithSuffix\newcommand\ledsection*[1]{%
15738 \led@war@ledxxxDeprecated{section*}%
15739 \leavevmode\pend\vspace{3.5ex \@plus 1ex \@minus .2ex}\ifl@dpairing\else\skipnumbering\fi%
15740 \pstart%
15741 \leavevmode\ifledsecnolinenumber\skipnumbering\fi\section*{##1}\leavevmode\vspace{2.3ex \@plus.2ex}\skipnumbering\pend%
15742 \vspace{-2\parskip}\vspace{-2\baselineskip}%
15743 \ifautopar\else\pstart\fi
15744 }
15745 \newcommand{\ledsubsection}[2][]{%
15746 \led@war@ledxxxDeprecated{subsection}%
15747 \leavevmode\pend\vspace{3.5ex \@plus 1ex \@minus .2ex}\ifl@dpairing\else\skipnumbering\fi%
15748 \pstart%
15749 \leavevmode\ifledsecnolinenumber\skipnumbering\fi\subsection[##1]{##2}\leavevmode\vspace{1.5ex \@plus .2ex}\skipnumbering\pend%
15750 \vspace{-2\parskip}\vspace{-2\baselineskip}%
15751 \ifautopar\else\pstart\fi
15752 }
15753 \WithSuffix\newcommand\ledsubsection*[1]{%
15754 \led@war@ledxxxDeprecated{subsection*}%
15755 \leavevmode\pend\vspace{3.5ex \@plus 1ex \@minus .2ex}\ifl@dpairing\else\skipnumbering\fi%
15756 \pstart%
15757 \leavevmode\ifledsecnolinenumber\skipnumbering\fi\subsection*{##1}\leavevmode\vspace{1.5ex \@plus .2ex}\skipnumbering\pend%
15758 \vspace{-2\parskip}\vspace{-2\baselineskip}%
15759 \ifautopar\else\pstart\fi
15760 }
15761 \newcommand{\ledsubsubsection}[2][]{%
15762 \led@war@ledxxxDeprecated{subsubsection}%
15763 \leavevmode\pend\vspace{3.5ex \@plus 1ex \@minus .2ex}\ifl@dpairing\else\skipnumbering\fi%
15764 \pstart%
15765 \leavevmode\ifledsecnolinenumber\skipnumbering\fi\subsubsection[##1]{##2}\leavevmode\vspace{1.5ex \@plus .2ex}\skipnumbering\pend%
15766 \vspace{-2\parskip}\vspace{-2\baselineskip}%
15767 \ifautopar\else\pstart\fi
15768 }
15769 \WithSuffix\newcommand\ledsubsubsection*[1]{%
15770 \led@war@ledxxxDeprecated{subsubsection*}%
15771 \leavevmode\pend\vspace{3.5ex \@plus 1ex \@minus .2ex}\ifl@dpairing\else\skipnumbering\fi%
15772 \pstart%
15773 \leavevmode\ifledsecnolinenumber\skipnumbering\fi\subsubsection*{##1}\leavevmode\vspace{1.5ex \@plus .2ex}\skipnumbering\pend%
15774 \vspace{-2\parskip}\vspace{-2\baselineskip}%
15775 \ifautopar\else\pstart\fi
15776 }
15777 \newcommand\ledchapter[2][]{%
15778 \led@war@ledxxxDeprecated{chapter}%
15779 \ifl@dmemoir%
15780 \gdef\ch@pt@c{##1}%
15781 \fi%
15782 ~\pend\skipnumbering%
15783 \pstart%
15784 \@patchforledchapter\chapter[##1]{##2}%
15785 \pend\pstart}
15786 \WithSuffix\newcommand\ledchapter*[1]{%
15787 \led@war@ledxxxDeprecated{chapter*}%
15788 ~\pend\skipnumbering%
15789 \pstart%
15790 \@patchforledchapter\chapter*{##1}\pend%
15791 \pstart}
15792 \def\@patchforledchapter{
15793 \patchcmd{\@makeschapterhead}{1\par}{1}{}{}
15794 \pretocmd{\@makeschapterhead}{\par}{}{}
15795 \apptocmd{\@makeschapterhead}{\par}{}{}
15796 \patchcmd{\@makeschapterhead}{\vskip 40\p@}{}{}{}
15797 \patchcmd{\@makechapterhead}{1\par}{1}{}{}
15798 \pretocmd{\@makechapterhead}{\par}{}{}
15799 \apptocmd{\@makechapterhead}{\par}{}{}
15800 \patchcmd{\@makechapterhead}{\vskip 40\p@}{}{}{}
15801 \apptocmd{\@chapter}{\par\leavevmode\vspace{40 \p@}\skipnumbering}{}{}
15802 \apptocmd{\@schapter}{\par\leavevmode\vspace{40 \p@}\skipnumbering}{}{}
15803 \newcommand\beforeledchapter{\pend\cleardoublepage\pstart}
15804 \patchcmd{\chapter}{\cleardoublepage}{\relax}{}{}
15805 \patchcmd{\chapter}{\clearpage}{\relax}{}{}
15806 }
15807 \ifnoquotation@\else
15808 \renewcommand{\quotation}{\par\leavevmode%
15809 \parindent=1.5em%
15810 \skipnumbering%
15811 \ifautopar%
15812 \vskip-\parskip%
15813 \else%
15814 \vskip\topsep%
15815 \fi%
15816 \global\leftskip=\leftmargin%
15817 \global\rightskip=\leftmargin%
15818 }
15819 \renewcommand{\endquotation}{\par%
15820 \global\leftskip=0pt%
15821 \global\rightskip=0pt%
15822 \leavevmode%
15823 \skipnumbering%
15824 \ifautopar%
15825 \vskip-\parskip%
15826 \else%
15827 \vskip\topsep%
15828 \fi%
15829 }
15830 \renewcommand{\quote}{\par\leavevmode%
15831 \parindent=0pt%
15832 \skipnumbering%
15833 \ifautopar%
15834 \vskip-\parskip%
15835 \else%
15836 \vskip\topsep%
15837 \fi%
15838 \global\leftskip=\leftmargin%
15839 \global\rightskip=\leftmargin%
15840 }
15841 \renewcommand{\endquote}{\par%
15842 \global\leftskip=0pt%
15843 \global\rightskip=0pt%
15844 \leavevmode%
15845 \skipnumbering%
15846 \ifautopar%
15847 \vskip-\parskip%
15848 \else%
15849 \vskip\topsep%
15850 \fi%
15851 }
15852 \fi
15853 }
15854 % \end{macrocode}
15855 % \end{macro}
15856 % \end{macro}
15857 % \end{macro}
15858 % \end{macro}
15859 % \end{macro}
15860 % \end{macro}
15861 % \end{macro}
15862 % \end{macro}
15863 % \end{macro}
15864 % \end{macro}
15865 % \end{macro}
15866 % \end{macro}
15867 % \end{macro}
15868 % \end{macro}
15869 % \begin{macro}{\ledsectnotoc}
15870 % The \cs{ledsectnotoc} only disables the \cs{addcontentsline} macro.
15871 % \begin{macrocode}
15872 \newcommand{\ledsectnotoc}{\let\addcontentsline\@gobblethree}
15873 % \end{macrocode}
15874 % \end{macro}
15875 % \begin{macro}{\ledsectnomark}
15876 % The \cs{ledsectnomark} only disables the \cs{chaptermark}, \cs{sectionmark} and \cs{subsectionmark} macros.
15877 % \begin{macrocode}
15878 \newcommand{\ledsectnomark}{%
15879 \let\chaptermark\@gobble%
15880 \let\sectionmark\@gobble%
15881 \let\subsectionmark\@gobble%
15882 }
15883 % \end{macrocode}
15884 % \end{macro}
15885 %
15886 % \subsection{New commands : \cs{eledxxx}}
15887 % The new system of \cs{eledxxxx} commands to section text work like this:
15888 % \begin{enumerate}
15889 % \item When one of these commands is called, \Lpack{eledmac} writes to an auxiliary files:
15890 % \begin{itemize}
15891 % \item The section level.
15892 % \item The section title.
15893 % \item The side (when \Lpack{eledpar} is used).
15894 % \item The pstart where the command is called.
15895 % \item If we have starred version or not.
15896 % \end{itemize}
15897 % \item \Lpack{eledmac} adds the title of the section to pstart, as normal content. This is to enable critical notes.
15898 % \item When \LaTeX\ is run a other time, this file is read. That:
15899 % \begin{itemize}
15900 % \item Adds the pstart number to a list of pstarts where a sectioning command is used.
15901 % \item Defines a command, the name of which contains the pstart number, and which calls the normal \LaTeX\ sectioning command.
15902 % \end{itemize}
15903 % \item This last command is called when the pstart is effectively printed.
15904 % \end{enumerate}
15905 %
15906 % We do not define commands for \cs{eledsection} and related if the \verb+noeledsec+ option is loaded.
15907 % We use etoolbox tests and not the \verb+\ifxxx…\else…\fi+ structure to prevent problem of expansions with command after the \verb+\ifxxx+ which contains \verb+fi+.
15908 % As we patch command inside this test, we need to change the category code of \# character \emph{before} \cs{notbool} statement, because the second argument is read with the standard catcode (read \thetexbook to understand when the catcode's change has effect).
15909 % \begin{macrocode}
15910 \catcode`\#=12
15911 \notbool{@noeled@sec}{%
15912 % \end{macrocode}
15913 % \begin{macro}{\beforeeledchapter}
15914 % For technical reasons, not yet solved, page-breaking before chapters can't be made automatically by eledmac. Users have to use \cs{beforeeledchapter}.
15915 % \begin{macrocode}
15916 \ifl@dmemoir
15917 \newcommand\beforeeledchapter{\clearforchapter}
15918 \else
15919 \newcommand\beforeeledchapter{\if@openright\cleardoublepage\else\clearpage\fi}
15920 \fi
15921 % \end{macrocode}
15922 % \end{macro}
15923 % \begin{macro}{\if@eled@sectioning}
15924 % The boolean \cs{if@eled@sectioning} is set to true when a sectioning command is called by a \cs{eledxxx} command, and set to false after. It is used to enable/disable line number printing.
15925 % \begin{macrocode}
15926 \newif\if@eled@sectioning
15927 % \end{macrocode}
15928 % \end{macro}
15929 % \begin{macro}{\print@leftmargin@eledsection}
15930 % \begin{macro}{\print@rightmargin@eledsection}
15931 % \cs{print@leftmargin@eledsection} and \cs{print@rightmargin@eledsection} are added by eledmac inside the code of sectioning command, in order to affix lines numbers.
15932 % They include tests for RTL languages.
15933 % \begin{macrocode}
15934 \def\print@rightmargin@eledsection{%
15935 \if@eled@sectioning%
15936 \begingroup%
15937 \if@RTL%
15938 \let\llap\rlap%
15939 \let\leftlinenum\rightlinenum%
15940 \let\leftlinenumR\rightlinenumR%
15941 \let\l@drd@ta\l@dld@ta%
15942 \let\l@drsn@te\l@dlsn@te%
15943 \fi%
15944 \hfill\l@drd@ta \csuse{LR}{\l@drsn@te}%
15945 \endgroup%
15946 \fi%
15947 }%
15948
15949 \def\print@leftmargin@eledsection{%
15950 \if@eled@sectioning%
15951 \leavevmode%
15952 \begingroup%
15953 \if@RTL%
15954 \let\rlap\llap%
15955 \let\rightlinenum\leftlinenum%
15956 \let\rightlinenumR\leftlinenumR%
15957 \let\l@dld@ta\l@drd@ta%
15958 \let\l@dlsn@te\l@drsn@te%
15959 \fi%
15960 \l@dld@ta\csuse{LR}{\l@dlsn@te}%
15961 \endgroup%
15962 \fi%
15963 }%
15964
15965 % \end{macrocode}
15966 % \end{macro}
15967 % \end{macro}
15968 % \begin{macro}{\chapter}
15969 % \begin{macro}{\M@sect}
15970 % \begin{macro}{\@mem@old@ssect}
15971 % \begin{macro}{\@makechapterhead}
15972 % \begin{macro}{\@makechapterhead}
15973 % \begin{macro}{\@makeschapterhead}
15974 % \begin{macro}{\@sect}
15975 % \begin{macro}{\@ssect}
15976 % \changes{v1.12.5}{2014/08/28}{Debug \cs{eledchapter} in parallel with \Lpack{memoir}}
15977 % \changes{v1.14.2}{2014/12/17}{Debug \cs{edtext} after starred sectioning commands when using \Lclass{memoir} class.}
15978 % We have to patch \LaTeX, \Lclass{book} and \Lclass{memoir} sectioning commands in order to:
15979 % \begin{itemize}
15980 % \item Disable \cs{edtext} inside.
15981 % \item Disable page breaking (for \cs{chapter}).
15982 % \item Add line numbers and sidenotes.
15983 % \end{itemize}
15984 % Unfortunately, Maïeul Rouquette was not able to try if \Lclass{memoir} is loaded. That is why \Lpack{eledmac} tries to define for both standard class and \Lclass{memoir} class.
15985 %
15986 %
15987 % \begin{macrocode}
15988 \AtBeginDocument{%
15989 \patchcmd{\chapter}{\clearforchapter}{%
15990 \if@eled@sectioning\else%
15991 \ifl@dprintingpages\else%
15992 \clearforchapter%
15993 \fi%
15994 \fi%
15995 }
15996 {}
15997 {}
15998
15999 \pretocmd{\M@sect}
16000 {\let\old@edtext=\edtext%
16001 \let\edtext=\dummy@edtext@showlemma%
16002 }
16003 {}
16004 {}
16005
16006 \apptocmd{\M@sect}
16007 {\let\edtext=\old@edtext}
16008 {}
16009 {}
16010
16011 \patchcmd{\M@sect}
16012 { #9}
16013 { #9%
16014 \print@rightmargin@eledsection%
16015 }
16016 {}
16017 {}
16018
16019 \patchcmd{\M@sect}
16020 {\hskip #3\relax}
16021 {\hskip #3\relax%
16022 \print@leftmargin@eledsection%
16023 }
16024 {}
16025 {}
16026
16027
16028
16029 \patchcmd{\@mem@old@ssect}
16030 {#5}
16031 {#5%
16032 \print@leftmargin@eledsection%
16033 }
16034 {}
16035 {}
16036
16037 \patchcmd{\@mem@old@ssect}
16038 {\hskip #1}
16039 {\hskip #1%
16040 \print@rightmargin@eledsection%
16041 }
16042 {}
16043 {}
16044
16045
16046 \patchcmd{\chapter}{\if@openright\cleardoublepage\else\clearpage\fi}{%
16047 \if@eled@sectioning\else%
16048 \ifl@dprintingpages\else%
16049 \if@openright\cleardoublepage\else\clearpage\fi%No clearpage inside a \eledsection: will keep critical notes from printing on the title page.
16050 \fi%
16051 \fi%
16052 }%
16053 {}%
16054 {}%
16055
16056 \patchcmd{\@makechapterhead}
16057 {#1}
16058 {\print@leftmargin@eledsection%
16059 #1%
16060 \print@rightmargin@eledsection%
16061 }
16062 {}
16063 {}
16064
16065 \patchcmd{\@makechapterhead}% For BIDI
16066 {\if@RTL\raggedleft\else\raggedright\fi}%
16067 {\if@eled@sectioning\else%
16068 \if@RTL\raggedleft\else\raggedright\fi%
16069 \fi%
16070 }%
16071 {}%
16072 {}%
16073
16074 \patchcmd{\@makeschapterhead}
16075 {#1}
16076 {\print@leftmargin@eledsection%
16077 #1%
16078 \print@rightmargin@eledsection%
16079 }
16080 {}
16081 {}
16082
16083 \pretocmd{\@sect}
16084 {\let\old@edtext=\edtext
16085 \let\edtext=\dummy@edtext@showlemma%
16086 }
16087 {}
16088 {}
16089
16090 \apptocmd{\@sect}
16091 {\let\edtext=\old@edtext}
16092 {}
16093 {}
16094
16095 \pretocmd{\@ssect}
16096 {\let\old@edtext=\edtext%
16097 \let\edtext=\dummy@edtext@showlemma%
16098 }
16099 {}
16100 {}
16101
16102 \apptocmd{\@ssect}
16103 {\let\edtext=\old@edtext}
16104 {}
16105 {}
16106
16107 % \end{macrocode}
16108 % \changes{v1.14.1}{2014/12/15}{Debug sectioning commands when using both \Lpack{handout} and \Lpack{hyperref} package.}
16109 % \Lpack{hyperref} also redefines \cs{@sect}. That's why, when manipulating arguments, we patch \cs{@sect} and the same only if \Lpack{hyperref} is not used. If it is, we patch the \cs{NR} commands.
16110 % \begin{macrocode}
16111 \@ifpackageloaded{nameref}{
16112
16113 \patchcmd{\NR@sect}
16114 {#8}
16115 {#8%
16116 \print@rightmargin@eledsection%
16117 }
16118 {}
16119 {}
16120
16121 \patchcmd{\NR@sect}
16122 {\hskip #3\relax}
16123 {\hskip #3\relax%
16124 \print@leftmargin@eledsection%
16125 }
16126 {}
16127 {}
16128
16129 \patchcmd{\NR@ssect}
16130 {#5}
16131 {#5%
16132 \print@rightmargin@eledsection%
16133 }
16134 {}
16135 {}
16136
16137 \patchcmd{\NR@ssect}
16138 {\hskip #1}
16139 {\hskip #1%
16140 \print@leftmargin@eledsection%
16141 }
16142 {}
16143 {}
16144 }%
16145 {
16146 \patchcmd{\@sect}
16147 {#8}
16148 {#8%
16149 \print@rightmargin@eledsection%
16150 }
16151 {}
16152 {}
16153
16154 \patchcmd{\@sect}
16155 {\hskip #3\relax}
16156 {\hskip #3\relax%
16157 \print@leftmargin@eledsection%
16158 }
16159 {}
16160 {}
16161
16162 \patchcmd{\@ssect}
16163 {#5}
16164 {#5%
16165 \print@rightmargin@eledsection%
16166 }
16167 {}
16168 {}
16169
16170 \patchcmd{\@ssect}
16171 {\hskip #1}
16172 {\hskip #1%
16173 \print@leftmargin@eledsection%
16174 }
16175 {}
16176 {}
16177 }%
16178 }
16179 % \end{macrocode}
16180 % Now, we have finished to patch the commands, using \# with a catcode equals to 12. We close the \verb+\notbool{@noeled@sec}+ statement, restore the normal catcode for \# and reopen a new \verb+\notbool{@noeled@sec}+ statement.
16181 % \begin{macrocode}
16182 {}}%
16183 \protect\catcode`\#=6 %Space NEEDS by \catcode
16184 \notbool{@noeled@sec}{%
16185 % \end{macrocode}
16186 % \end{macro}
16187 % \end{macro}
16188 % \end{macro}
16189 % \end{macro}
16190 % \end{macro}
16191 % \end{macro}
16192 % \end{macro}
16193 % \end{macro}
16194 % \begin{macro}{\eled@sectioning@out}
16195 % \cs{eled@sectioning@out} is the output file, to dump the pstarts where a sectioning command is used.
16196 % \begin{macrocode}
16197 \newwrite\eled@sectioning@out
16198 % \end{macrocode}
16199 % \end{macro}
16200 % \begin{macro}{\noeledsec}
16201 % \changes{v1.12.6}{2014/08/31}{Add \cs{noeledsec} macro.}
16202 % The \cs{noeledsec} command is deprecated, people should use the \verb+noeledsec+ package option.
16203 % \begin{macrocode}
16204 \newcommand{\noeledsec}{%
16205 \led@war@noeledsecDeprecated%
16206 \global\@noeled@sectrue%
16207 }%
16208 % \end{macrocode}
16209 % \end{macro}
16210 % \begin{macro}{\eledchapter}
16211 % \begin{macro}{\eledsection}
16212 % \begin{macro}{\eledsubsection}
16213 % \begin{macro}{\eledsubsubsection}
16214 % \begin{macro}{\eledchapter*}
16215 % \begin{macro}{\eledsection*}
16216 % \begin{macro}{\eledsubsection*}
16217 % \begin{macro}{\eledsubsubsection*}
16218 % And now, the user sectioning commands, which write to the file, and also add content as a "normal" line.
16219 % \begin{macrocode}
16220 \newcommand{\eledchapter}[2][]{%
16221 #2%
16222 \ifledRcol%
16223 \immediate\write\eled@sectioningR@out{%
16224 \string\eled@chapter{#1}{\unexpanded{#2}}{\the\l@dnumpstartsR}{}{R}
16225 }%
16226 \else%
16227 \immediate\write\eled@sectioning@out{%
16228 \string\eled@chapter{#1}{\unexpanded{#2}}{\the\l@dnumpstartsL}{}{}
16229 }%
16230 \fi%
16231 }
16232
16233 \newcommand{\eledsection}[2][]{%
16234 #2%
16235 \ifledRcol%
16236 \immediate\write\eled@sectioningR@out{%
16237 \string\eled@section{#1}{\unexpanded{#2}}{\the\l@dnumpstartsR}{}{R}
16238 }%
16239 \else%
16240 \immediate\write\eled@sectioning@out{%
16241 \string\eled@section{#1}{\unexpanded{#2}}{\the\l@dnumpstartsL}{}{}
16242 }%
16243 \fi%
16244 }
16245
16246 \newcommand{\eledsubsection}[2][]{%
16247 #2%
16248 \ifledRcol%
16249 \immediate\write\eled@sectioningR@out{%
16250 \string\eled@subsection{#1}{\unexpanded{#2}}{\the\l@dnumpstartsR}{}{R}
16251 }%
16252 \else%
16253 \immediate\write\eled@sectioning@out{%
16254 \string\eled@subsection{#1}{\unexpanded{#2}}{\the\l@dnumpstartsL}{}{}
16255 }%
16256 \fi%
16257 }
16258 \newcommand{\eledsubsubsection}[2][]{%
16259 #2%
16260 \ifledRcol%
16261 \immediate\write\eled@sectioningR@out{%
16262 \string\eled@subsubsection{#1}{\unexpanded{#2}}{\the\l@dnumpstartsR}{}{R}
16263 }%
16264 \else%
16265 \immediate\write\eled@sectioning@out{%
16266 \string\eled@subsubsection{#1}{\unexpanded{#2}}{\the\l@dnumpstartsL}{}{}
16267 }%
16268 \fi%
16269 }
16270
16271
16272 \WithSuffix\newcommand\eledchapter*[2][]{%
16273 #2%
16274 \ifledRcol%
16275 \immediate\write\eled@sectioningR@out{%
16276 \string\eled@chapter{#1}{\unexpanded{#2}}{\the\l@dnumpstartsR}{*}{R}
16277 }%
16278 \else%
16279 \immediate\write\eled@sectioning@out{%
16280 \string\eled@chapter{#1}{\unexpanded{#2}}{\the\l@dnumpstartsL}{*}{}
16281 }%
16282 \fi%
16283 }
16284
16285 \WithSuffix\newcommand\eledsection*[2][]{%
16286 #2%
16287 \ifledRcol%
16288 \immediate\write\eled@sectioningR@out{%
16289 \string\eled@section{#1}{\unexpanded{#2}}{\the\l@dnumpstartsR}{*}{R}
16290 }%
16291 \else%
16292 \immediate\write\eled@sectioning@out{%
16293 \string\eled@section{#1}{\unexpanded{#2}}{\the\l@dnumpstartsL}{*}{}
16294 }%
16295 \fi%
16296 }
16297
16298 \WithSuffix\newcommand\eledsubsection*[2][]{%
16299 #2%
16300 \ifledRcol%
16301 \immediate\write\eled@sectioningR@out{%
16302 \string\eled@subsection{#1}{\unexpanded{#2}}{\the\l@dnumpstartsR}{*}{R}
16303 }%
16304 \else%
16305 \immediate\write\eled@sectioning@out{%
16306 \string\eled@subsection{#1}{\unexpanded{#2}}{\the\l@dnumpstartsL}{*}{}
16307 }%
16308 \fi%
16309 }
16310
16311 \WithSuffix\newcommand\eledsubsubsection*[2][]{%
16312 #2%
16313 \ifledRcol%
16314 \immediate\write\eled@sectioningR@out{%
16315 \string\eled@subsubsection{#1}{\unexpanded{#2}}{\the\l@dnumpstartsR}{*}{R}
16316 }%
16317 \else%
16318 \immediate\write\eled@sectioning@out{%
16319 \string\eled@subsubsection{#1}{\unexpanded{#2}}{\the\l@dnumpstartsL}{*}{}
16320 }%
16321 \fi%
16322 }
16323 % \end{macrocode}
16324 % \end{macro}
16325 % \end{macro}
16326 % \end{macro}
16327 % \end{macro}
16328 % \end{macro}
16329 % \end{macro}
16330 % \end{macro}
16331 % \end{macro}
16332 % \begin{macro}{\eled@chapter}
16333 % \begin{macro}{\eled@section}
16334 % \begin{macro}{\eled@subsection}
16335 % \begin{macro}{\eled@subsubsection}
16336 % The sectioning macros, called in the auxiliary file. They have five arguments:
16337 % \begin{enumerate}
16338 % \item Optional arguments of \LaTeX\ sectioning command.
16339 % \item Mandatory arguments of \LaTeX\ sectioning command.
16340 % \item Pstart number.
16341 % \item Side: \verb+R+ if right, nothing if left.
16342 % \item Starred or not.
16343 % \end{enumerate}
16344 % \begin{macrocode}
16345 \def\eled@chapter#1#2#3#4#5{%
16346 \ifstrempty{#4}%
16347 {%
16348 \ifstrempty{#1}%
16349 {%
16350 \global\csdef{eled@sectioning@#3#5}{\let\edtext=\dummy@edtext@showlemma\chapter{#2}}%
16351 \global\csdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\chaptermark{#2}}%
16352 }%Need for \pairs, because of using parbox.
16353 {%
16354 \global\csdef{eled@sectioning@#3#5}{\let\edtext=\dummy@edtext@showlemma\chapter[#1]{#2}}%
16355 \global\csdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\chaptermark{#2}}%Need for \pairs, because of using parbox.
16356 }%
16357 }%
16358 {%
16359 \ifstrempty{#1}%
16360 {\global\csdef{eled@sectioning@#3#5}{\let\edtext=\dummy@edtext@showlemma\chapter*{#2}}}%
16361 {\global\csdef{eled@sectioning@#3#5}{\let\edtext=\dummy@edtext@showlemma\chapter*[#1]{#2}}}%Bug in LaTeX!
16362 }%
16363 \listcsgadd{eled@sections#5@@}{#3}%
16364 }
16365 \def\eled@section#1#2#3#4#5{%
16366 \ifstrempty{#4}%
16367 {\ifstrempty{#1}%
16368 {%
16369 \global\csdef{eled@sectioning@#3#5}{\section{#2}}%
16370 \global\csdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\sectionmark{#2}}%Need for \pairs, because of using parbox.
16371 }%
16372 {%
16373 \global\csdef{eled@sectioning@#3#5}{\section[#1]{#2}}%
16374 \global\csdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\sectionmark{#1}}%Need for \pairs, because of using parbox.
16375 }%
16376 }%
16377 {\ifstrempty{#1}%
16378 {\global\csdef{eled@sectioning@#3#5}{\section*{#2}}}%
16379 {\global\csdef{eled@sectioning@#3#5}{\section*[#1]{#2}}}%Bug in LaTeX!
16380 }
16381 \listcsgadd{eled@sections#5@@}{#3}%
16382 }
16383 \def\eled@subsection#1#2#3#4#5{%
16384 \ifstrempty{#4}%
16385 {\ifstrempty{#1}%
16386 {%
16387 \global\csdef{eled@sectioning@#3#5}{\subsection{#2}}%
16388 \global\csdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\csuse{subsectionmark}{#2}}%Need for \pairs, because of using parbox. \csuse in case of \subsectionmark is not defined (book)
16389 }%
16390 {%
16391 \global\csdef{eled@sectioning@#3#5}{\subsection[#1]{#2}}%
16392 \global\csdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\csuse{subsectionmark}{#1}}%Need for \pairs, because of using parbox. \csuse in case of \subsectionmark is not defined (book)
16393 }%
16394 }%
16395 {\ifstrempty{#1}%
16396 {\global\csdef{eled@sectioning@#3#5}{\subsection*{#2}}}%
16397 {\global\csdef{eled@sectioning@#3#5}{\subsection*[#1]{#2}}}%Bug in LaTeX!
16398 }
16399 \listcsgadd{eled@sections#5@@}{#3}%
16400 }
16401 \def\eled@subsubsection#1#2#3#4#5{%
16402 \ifstrempty{#4}%
16403 {\ifstrempty{#1}%
16404 {\global\csdef{eled@sectioning@#3#5}{\subsubsection{#2}}}%
16405 {\global\csdef{eled@sectioning@#3#5}{\subsubsection[#1]{#2}}}%
16406 }%
16407 {\ifstrempty{#1}%
16408 {\global\csdef{eled@sectioning@#3#5}{\subsubsection*{#2}}}%
16409 {\global\csdef{eled@sectioning@#3#5}{\subsubsection*[#1]{#2}}}%Bug in LaTeX!
16410 }
16411 \listcsgadd{eled@sections#5@@}{#3}%
16412 }
16413
16414 % \end{macrocode}
16415 % \end{macro}
16416 % \end{macro}
16417 % \end{macro}
16418 % \end{macro}
16419 % End of the conditional test about \verb+noeledsec+ option.
16420 % \begin{macrocode}
16421 }{}
16422 % \end{macrocode}
16423 % \section{Page breaking or no page breaking depending of specific lines}
16424 % By default, page breaks are automatic. However, the user can define lines which will force page breaks, or prevent page breaks around one specific line.
16425 % On the first run, the line-list file records the line number of where the page break is being changed (either forced, or prevented).
16426 % On the next run, page breaks occur either before or after this line, depending on how the user sets the command. The default setting is after the line.
16427 % \begin{macro}{\normal@page@break}
16428 % \cs{normal@page@break} is an etoolbox list which contains the absolute line number of the last line, for each page.
16429 % \begin{macrocode}
16430 \def\normal@page@break{}
16431 % \end{macrocode}
16432 % \end{macro}
16433 % \begin{macro}{\prev@pb}
16434 % \begin{macro}{\prev@nopb}
16435 % The \cs{l@prev@pb} macro is a etoolbox list, which contains the lines in which page breaks occur (before or after).
16436 % The \cs{l@prev@nopb} macro is a etoolbox list, which contains the lines with NO page break before or after.
16437 % \begin{macrocode}
16438 \def\l@prev@pb{}
16439 \def\l@prev@nopb{}
16440 % \end{macrocode}
16441 % \end{macro}
16442 % \end{macro}
16443 % \begin{macro}{\ledpb}
16444 % \begin{macro}{\ledpbnum}
16445 % \begin{macro}{\lednopb}
16446 % \begin{macro}{\lednopbnum}
16447 % The \cs{ledpb} macro writes the call to \cs{led@pb} in line-list file.
16448 % The \cs{ledpbnum} macro writes the call to \cs{led@pbnum} in line-list file.
16449 % The \cs{lednopb} macro writes the call to \cs{led@nopb} in line-list file.
16450 % The \cs{lednopbnum} macro writes the call to \cs{led@nopbnum} in line-list file.
16451 % \begin{macrocode}
16452 \newcommand{\ledpb}{\write\linenum@out{\string\led@pb}}
16453 \newcommand{\ledpbnum}[1]{\write\linenum@out{\string\led@pbnum{#1}}}
16454 \newcommand{\lednopb}{\write\linenum@out{\string\led@nopb}}
16455 \newcommand{\lednopbnum}[1]{\write\linenum@out{\string\led@nopbnum{#1}}}
16456 % \end{macrocode}
16457 % \end{macro}
16458 % \end{macro}
16459 % \end{macro}
16460 % \end{macro}
16461 % \begin{macro}{\led@pb}
16462 % \begin{macro}{\led@pbnum}
16463 % \begin{macro}{\led@nopb}
16464 % \begin{macro}{\led@nopbnum}
16465 % The \cs{led@pb} adds the absolute line number in the \cs{prev@pb} list.
16466 % The \cs{led@pbnum} adds the argument in the \cs{prev@pb} list.
16467 % The \cs{led@nopb} adds the absolute line number in the \cs{prev@nopb} list.
16468 % The \cs{led@nopbnum} adds the argument in the \cs{prev@nopb} list.
16469 % \begin{macrocode}
16470 \newcommand{\led@pb}{\listxadd{\l@prev@pb}{\the\absline@num}}
16471 \newcommand{\led@pbnum}[1]{\listxadd{\l@prev@pb}{#1}}
16472 \newcommand{\led@nopb}{\listxadd{\l@prev@nopb}{\the\absline@num}}
16473 \newcommand{\led@nopbnum}[1]{\listxadd{\l@prev@nopb}{#1}}
16474 % \end{macrocode}
16475 % \end{macro}
16476 % \end{macro}
16477 % \end{macro}
16478 % \end{macro}
16479 % \begin{macro}{\ledpbsetting}
16480 % \begin{macro}{\led@pb@setting}
16481 % The \cs{ledpbsetting} macro only changes the value of \cs{led@pb@macro}, for which the default value is \verb+before+.
16482 % \begin{macrocode}
16483 \def\led@pb@setting{before}
16484 \newcommand{\ledpbsetting}[1]{\gdef\led@pb@setting{#1}}
16485 % \end{macrocode}
16486 % \end{macro}
16487 % \end{macro}
16488 % \begin{macro}{\led@check@pb}
16489 % \begin{macro}{\led@check@nopb}
16490 % The \cs{led@check@pb} and \cs{led@check@nopb} are called before or after each line.
16491 % They check if a page break must occur, depending on the current line and on the content of \cs{l@pb}.
16492 % \begin{macrocode}
16493 \newcommand{\led@check@pb}{\xifinlist{\the\absline@num}{\l@prev@pb}{\pagebreak[4]}{}}
16494 \newcommand{\led@check@nopb}{%
16495 \IfStrEq{\led@pb@setting}{before}{%
16496 \xifinlist{\the\absline@num}{\l@prev@nopb}%
16497 {\numdef{\abs@prevline}{\the\absline@num-1}%
16498 \xifinlist{\abs@prevline}{\normal@page@break}%
16499 {\nopagebreak[4]\enlargethispage{\baselineskip}}%
16500 {}}%
16501 {}}%
16502 {}%
16503 {}%
16504 \IfStrEq{\led@pb@setting}{after}{%
16505 \xifinlist{\the\absline@num}{\l@prev@nopb}{%
16506 \xifinlist{\the\absline@num}{\normal@page@break}%
16507 {\nopagebreak[4]\enlargethispage{\baselineskip}}%
16508 {}%
16509 }%
16510 {}}%
16511 {}%
16512 {}%
16513 }
16514 % \end{macrocode}
16515 % \end{macro}
16516 % \end{macro}
16517 % \section{Long verse: prevents being separated by a page break}
16518 % \begin{macro}{\iflednopbinverse}
16519 % The \cs{lednopbinverse} boolean is set to false by default.
16520 % If set to true, eledmac will automatically prevent page breaks inside verse.
16521 % The declaration is made at the beginning of the file, because it is used as a package option.
16522 % \end{macro}
16523 % \begin{macro}{\check@pb@in@verse}
16524 % The \cs{check@pb@in@verse} checks if a verse is broken in two page.
16525 % If true, it adds:
16526 % \begin{itemize}
16527 % \item The absolute line number of the first line of the verse -1 in the \cs{led@pb} list, if the page break must occur before the verse.
16528 % \item The absolute line number of the first line of the verse -1 in the \cs{led@nopb} list, if the page break must occur after the verse.
16529 % \end{itemize}
16530 % \begin{macrocode}
16531 \newcommand{\check@pb@in@verse}{%
16532 \ifinstanza\iflednopbinverse\ifinserthangingsymbol% Using stanzas and enabling page breaks in verse control, while on a hanging verse.
16533 \ifnum\page@num=\last@page@num\else%If we have change page
16534 \IfStrEq{\led@pb@setting}{before}{%
16535 \numgdef{\abs@line@verse}{\the\absline@num-1}%
16536 \ledpbnum{\abs@line@verse}%
16537 }{}%
16538 \IfStrEq{\led@pb@setting}{after}{%
16539 \numgdef{\abs@line@verse}{\the\absline@num-1}%
16540 \lednopbnum{\abs@line@verse}%
16541 }{}%
16542 \fi%
16543 \fi\fi\fi%
16544 }
16545 % \end{macrocode}
16546 % \end{macro}
16547 % \section{The End}\label{end}
16548 %
16549 %
16550 %</code>
16551 % \newpage
16552 % \appendix
16553 % \let\oldthesection\thesection
16554 % \renewcommand{\thesection}{Appendix \oldthesection}
16555 % \section{Some things to do when changing version}
16556 % \subsection{Migrating from edmac} \label{sec:lastuser}
16557 %
16558 % If you have never used \edmac, ignore this section. If you have used
16559 % \edmac{} and are starting on a completely new document, ignore this section.
16560 % Only read this section if you are converting an original \edmac{}
16561 % document to use \eledmac.
16562 %
16563 % The package still provides the original \cs{text} command, but it is
16564 % (a) deprecated, and
16565 % (b) its name has been changed\footnote{A name like \cs{text} is likely to be defined by
16566 % other \LaTeX\ packages (it certainly is by the AMS packages) and it
16567 % seems sensible to try and avoid clashes with other definitions.}
16568 % to \cs{critext};
16569 % use the \cs{edtext} macro instead. However, if you do
16570 % use \cs{critext} (the new name for \cs{text}), the following is a reminder.
16571 %
16572 %
16573 % \DescribeMacro{\critext}
16574 % Within numbered paragraphs, footnotes and endnotes are generated
16575 % by forms of the \cs{critext} macro:
16576 % \begin{verse}
16577 % \cs{critext}\marg{lemma}\meta{commands}\verb"/"
16578 % \end{verse}
16579 %
16580 %
16581 % The \meta{lemma} argument is the lemma in the main text: \cs{critext}
16582 % both prints this as part of the text, and makes it available to the
16583 % \meta{commands} you specify to generate notes. The \verb"/" at the
16584 % end terminates the command; it is part of the macro's definition so
16585 % that spaces after the macro will be treated as significant.
16586 %
16587 % For example:
16588 % \egstart
16589 % \begin{verbatim}
16590 % I saw my friend \critext{Smith}
16591 % \Afootnote{Jones C, D.}/
16592 % on Tuesday.
16593 % \end{verbatim}
16594 % \egmid
16595 % 1\enspace I saw my friend\\
16596 % 2\enspace Smith on Tuesday.\smallskip
16597 % \hrule width 1.5cm
16598 % \strut {\bf 2} Smith] Jones C, D.
16599 % \egend
16600 %
16601 % The lemma \verb"Smith" is printed as part of this sentence in
16602 % the text, and is also made available to the footnote
16603 % that specifies a variant, \verb"Jones C, D". The footnote macro
16604 % is supplied with the line number at which the lemma appears
16605 % in the main text.
16606 %
16607 % The \meta{lemma} may contain further \cs{critext} commands.
16608 % Nesting makes
16609 % it possible to print an explanatory note on a long passage together with
16610 % notes on variants for individual words within the passage. For
16611 % example:
16612 % \egstart
16613 % \begin{verbatim}
16614 % \critext{I saw my friend
16615 % \critext{Smith}{\Afootnote{Jones
16616 % C, D.}/ on Tuesday.}
16617 % \Bfootnote{The date was
16618 % July 16, 1954.}
16619 % /
16620 % \end{verbatim}
16621 % \egmid
16622 % 1\enspace I saw my friend\\
16623 % 2\enspace Smith on Tuesday.\smallskip
16624 % \hrule width 1.5cm
16625 % \strut {\bf 2} Smith] Jones C, D.\smallskip
16626 % \hrule width 1.5cm
16627 % \strut {\bf 1--2} I saw my friend \\
16628 % Smith on Tuesday.] The\\ date was
16629 % July 16, 1954.
16630 % \egend
16631 %
16632 % However, \cs{critext} cannot handle overlapping but unnested
16633 % notes---for example, one note covering lines 10--15, and another
16634 % covering 12--18; a \cs{critext} that starts in the \meta{lemma}
16635 % argument of another \cs{critext} must end there, too. (The
16636 % \cs{lemma} and \cs{linenum} commands may be used to
16637 % generate overlapping notes if necessary.)
16638 %
16639 % The second argument of the \cs{critext} macro, \meta{commands},
16640 % is the same as the second argument to the \cs{edtext} macro.
16641 %
16642 %
16643 % It is possible to define aliases for \cs{critext}, which
16644 % can be easier to type. You can make a single character substitute
16645 % for \cs{critext} by saying this:
16646 % \begin{verbatim}
16647 % \catcode`\<=\active
16648 % \let<=\critext
16649 % \end{verbatim}
16650 %
16651 % Then you might say \verb"<{Smith}\variant{Jones}/". This of course
16652 % destroys the ability to use \verb"<" in any new macro definitions, so
16653 % long as it remains in effect; hence it should be used with care.
16654 %
16655 % Changing the character at the end of the command requires more work:
16656 % \begin{verbatim}
16657 % \catcode`\<=\active
16658 % \def\xtext#1#2>{\critext{#1}{#2}/}
16659 % \let<=\xtext
16660 % \end{verbatim}
16661 % This allows you to say \verb"<{Smith}\Afootnote{Jones}>".
16662 %
16663 % Aliases for \cs{critext}
16664 % of the first kind shown here also can't be nested---that is,
16665 % you can't use the alias in the text that forms the first argument
16666 % to \cs{critext}. (See section~\ref{text} to find out why.) Aliases of
16667 % the second kind may be nested without any problem.
16668 %
16669 %
16670 % If you really have to use |\critext| in any of the tabular or
16671 % array environments, then |\edtext| must not be used in the same
16672 % environment. If you use |\critext| in one of these environments
16673 % then you have to issue the declaration |\usingcritext| beforehand.
16674 % The declaration |\usingedtext| must be issued to revert to the
16675 % default assumption that |\edtext| will be used.
16676 %
16677 % \subsection{Migration from ledmac to eledmac}\label{migration}
16678 % In eledmac, some changes were made in the code to allow for easy customization.
16679 % This can cause problems for people who have made their own customizations. The next sections explain how to correct this.
16680 %
16681 %
16682 % If you have created your own series using \cs{addfootins} and \cs{addfootinsX}, you should use instead the \cs{newseries} command (see \reff{newseries}). You must remove your \cs{Xfootnote} command.
16683 %
16684 % If you have customized the \cs{XXXXXXfmt} command, you should check if commands for display options (\reff{displayoptions}) and options in \cs{Xfootnote} (\reff{Xfootnoteopt}) cannot do the same thing. If not, you can add a new ticket in Github to request a new function for doing this.\footnote{\url{https://github.com/maieul/ledmac/issues}}
16685 %
16686 % If for some reason you do not want to make the modifications to use eledmac new functions, you can continue using your own \cs{XXXXXfmt} command, but you must replace:
16687 % \begin{verbatim}
16688 % \renewcommand*{XXXXfmt}[3]
16689 % \end{verbatim}
16690 % with
16691 % \begin{verbatim}
16692 % \renewcommandx*{XXXXfmt}[4][4=Z]
16693 % \end{verbatim}
16694 % If you dont' do that, you will see a spurious \verb+[X]+, where X is series letter.
16695 %
16696 % If you used a \cs{protect} command inside a \cs{footnote} command inside a numbered section, you must change the \cs{protect} to \cs{noexpand}. If you don't, the command after the \cs{protect} won't be displayed.
16697 % \subsection{Migration to eledmac 1.5.1}\label{change151}
16698 % The version 1.5.1 corrects a bug with \verb+stanzaindentsrepetition+ (cf. \reff{stanzaindentsrepetition}). This bug had two consequences:
16699 % \begin{enumerate}
16700 % \item \verb+stanzaindentsrepetition+ didn't work when its value was greater than 2.
16701 % \item \verb+stanzaindentsrepetition+ worked wrong when its value was equal to 2.
16702 % \end{enumerate}
16703 %
16704 % So, if you used \verb+stanzaindentsrepetition+ with value equal to 2, you must change your \cs{setstanzaindents}. Explanation:
16705 % \begin{verbatim}
16706 % \setcounter{stanzaindentsrepetition}{2}
16707 % \setstanzaindents{5,1,0}
16708 % \end{verbatim}
16709 % This code, in a version older than 1.5.1, made that the first verse had an indent of 0, the secund verse of 1, the third verse of 0, the fourth verse of 1 etc.
16710 %
16711 % But instead the code should have assigned the reverse: the first verse had an indent of 1, the secund verse of 0, the third verse of 1, the fourth verse of 0 etc.
16712 %
16713 % So version 1.5.1 corrected this bug. If you want to keep the older presentation, you must change:
16714 % \begin{verbatim}
16715 % \setcounter{stanzaindentsrepetition}{2}
16716 % \setstanzaindents{5,1,0}
16717 % \end{verbatim}
16718 % by:
16719 % \begin{verbatim}
16720 % \setcounter{stanzaindentsrepetition}{2}
16721 % \setstanzaindents{5,0,1}
16722 % \end{verbatim}
16723 % \subsection{Migration to eledmac 1.12.0}
16724 % The migration to eledmac 1.12.0 is easy:
16725 % \begin{itemize}
16726 % \item You must delete all the auxiliary files, and so one, make the normal three runs.
16727 % \item If you have modified \cs{l@reg}, which is not advisable, you must rename it to \cs{@nl@reg}.
16728 % \end{itemize}
16729 %
16730 % Anyway, there is another problem. If you have text in brackets just after \cs{pstart} or \cs{pend}, the text will be considered an optional argument of \cs{pstart} or \cs{pend} (see \reff{pstart:optionalarg}).
16731 % In this case, just add a \cs{relax} between \cs{pstart}/\cs{pend} and the brackets.
16732
16733 % The version 1.12.0 adds a new better way to manage section titles inside numbered text. Please read §~\ref{eledsection} (\reff{eledsection}).
16734 % \subsection{Migration to eledmac 17.1}
16735 % The version change the default behavior of \cs{pstartinfootnote}.
16736 % Henceforth, the pstart will be printed if footnote only for the section of text where you have called \cs{numberpstarttrue}.
16737
16738 % We don't see any reason to print it in other section. However, if you want to print the pstart number in all footnote, with or without \cs{numberpstarttrue}, you can use
16739 % \cs{pstartinfootnoteeverytime}.
16740 % \subsection{Migration to eledmac 1.21.0}
16741 % \subsubsection{\cs{Xledsetnormalparstuff} and \cs{ledsetnormalparstuffX}}
16742 % The \cs{ledsetnormalparstuff} has been split in two different commands:
16743 % \begin{itemize}
16744 % \item \cs{Xledsetnormalparstuff} for critical notes;
16745 % \item \cs{ledsetnormalparstuffX} for familiar notes.
16746 % \end{itemize}
16747 % The new commands take an optional argument which is the series letter.
16748 % If you have redefined \cs{ledsetnormalparstuff} or commands which call them, you must make the appropriate change
16749 % \subsubsection{Endnotes}
16750 % In any case, clean the \verb+.end+ file before the next run.
16751 %
16752 % \label{oldprintnpnumspace} The previous version of \Eledmac{} had a bug: there were two spaces between the start page number and the start line number, but only one space between the end page number and the end line number.
16753 %
16754 % Indeed, a spurious space was added after the first \cs{printnpnum}.
16755 % This spurious space has been deleted.
16756 % However, if you want to keep the previous spurious space, just load the package with the \verb+oldprintnpnumspace+ option.
16757 %
16758 % If you have redefined \cs{endprint}, you must:
16759 % \begin{itemize}
16760 % \item Contact us to ask for the feature that required your hack, in order to avoid such a hack in the future.
16761 % \item Use the new fifth argument.
16762 % \item Add \verb+\xdef\@currentseries{#4}+ at the beginning of your own command.
16763 % \end{itemize}
16764 % \subsection{Migration to eledmac 1.22.0}
16765 % The \cs{ledinnote} commands takes now a first optional argument, which is the label for the hyperreference.
16766 % If you have redefined it, change your redefinition, and check if you can
16767 % avoid this redefinition by redefining only \cs{ledinnotemark}.
16768 % \subsection{Migration to eledmac 1.23.0}
16769 % People must delete the numbered auxiliary file before new run after update of eledmac.
16770 % \clearpage
16771 % \bibliographystyle{alpha}
16772 % \phantomsection
16773 % \addcontentsline{toc}{section}{References}
16774 % \begin{thebibliography}{WWW99}
16775 %
16776 % \bibitem[Bre96]{TABMAC}
16777 % Herbert Breger.
16778 % \newblock \tabmac.
16779 % \newblock October 1996.
16780 % \newblock (Available from CTAN in
16781 % \texttt{macros/plain/contrib/tabmac})
16782 %
16783 % \bibitem[Bur01]{POEMSCOLTUG}
16784 % John Burt.
16785 % \newblock `Typesetting critical editions of poetry'.
16786 % \newblock \emph{TUGboat}, \textbf{22}, 4, pp 353--361, December 2001.
16787 % \newblock (Code available from CTAN in
16788 % \texttt{macros/latex/contrib/poemscol})
16789 %
16790 % \bibitem[Eck03]{PARALLEL}
16791 % Matthias Eckermann.
16792 % \newblock \emph{The \Lpack{Parallel}-Package}.
16793 % \newblock April 2003.
16794 % \newblock (Available from CTAN in
16795 % \texttt{macros/latex/contrib/parallel})
16796 %
16797 % \bibitem[Fai03]{FOOTMISC}
16798 % Robin Fairbairns.
16799 % \newblock \emph{\Lpack{footmisc} --- a portmanteau package for
16800 % customising footnotes in \LaTeX}.
16801 % \newblock February 2003.
16802 % \newblock (Available from CTAN in
16803 % \texttt{macros/latex/contrib/footmisc})
16804 %
16805 %
16806 % \bibitem[LW90]{EDMACTUG}
16807 % John Lavagnino and Dominik Wujastyk.
16808 % \newblock `An overview of \edmac: a \textsc{Plain} TeX format for
16809 % critical editions'.
16810 % \newblock \emph{TUGboat}, \textbf{11}, 4, pp. 623--643, November 1990.
16811 % \newblock (Code available from CTAN in
16812 % \texttt{macros/plain/contrib/edmac})
16813 %
16814 % \bibitem[L\"{u}c03]{EDNOTES}
16815 % Uwe L\"{u}ck.
16816 % \newblock `\textsf{ednotes} --- critical edition typesetting with LaTeX'.
16817 % \newblock \emph{TUGboat}, \textbf{24}, 2, pp. 224--236, 2003.
16818 % \newblock (Code available from CTAN in
16819 % \texttt{macros/latex/contrib/ednotes})
16820 %
16821 % \bibitem[Sul92]{EDSTANZA}
16822 % Wayne G.~Sullivan.
16823 % \newblock \emph{The file \texttt{edstanza.doc}}.
16824 % \newblock June 1992.
16825 % \newblock (Available from CTAN in
16826 % \texttt{macros/plain/contrib/edmac})
16827 %
16828 % \bibitem[Wil02]{MEMOIR}
16829 % Peter Wilson.
16830 % \newblock \emph{The \Lpack{memoir} class for configurable typesetting}.
16831 % \newblock November 2002.
16832 % \newblock (Available from CTAN in
16833 % \texttt{macros/latex/contrib/memoir})
16834 %
16835 % \bibitem[Wil04]{ELEDPAR}
16836 % Peter Wilson and Maïeul Rouquette.
16837 % \newblock \emph{Parallel typesetting for critical editions:
16838 % the \Lpack{eledpar} package}.
16839 % \newblock December 2004.
16840 % \newblock (Available from CTAN in
16841 % \texttt{macros/latex/contrib/ledmmac})
16842 %
16843 % \end{thebibliography}
16844 %
16845 % \Finale
16846 % \phantomsection
16847 % \addcontentsline{toc}{section}{Index}
16848 % \PrintIndex
16849 %
16850 % \phantomsection
16851 % \addcontentsline{toc}{section}{Change History}
16852 % \PrintChanges
16853 % \endinput
16854 \endinput
16855
16856 %% \CharacterTable
16857 %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
16858 %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
16859 %% Digits \0\1\2\3\4\5\6\7\8\9
16860 %% Exclamation \! Double quote \" Hash (number) \#
16861 %% Dollar \$ Percent \% Ampersand \&
16862 %% Acute accent \' Left paren \( Right paren \)
16863 %% Asterisk \* Plus \+ Comma \,
16864 %% Minus \- Point \. Solidus \/
16865 %% Colon \: Semicolon \; Less than \<
16866 %% Equals \= Greater than \> Question mark \?
16867 %% Commercial at \@ Left bracket \[ Backslash \\
16868 %% Right bracket \] Circumflex \^ Underscore \_
16869 %% Grave accent \` Left brace \{ Vertical bar \|
16870 %% Right brace \} Tilde \~}
16871 %%