Debian Codegraph @

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

raw
1 % \iffalse meta-comment
2 %
3 % eledpar.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 2004, 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{xr-hyper}
26 \usepackage[draft=false,
27 plainpages=false,
28 pdfpagelabels,
29 bookmarksnumbered,
30 % hyperindex=true
31 hyperindex=false
32 ]{hyperref}
33 \usepackage{fontspec}
34 \usepackage[english]{babel}
35 \usepackage[noreledmac]{eledmac}
36 \usepackage{graphicx,eledpar,metalogo}
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 \CodelineIndex
53 \RecordChanges
54 \renewcommand{\MakeUppercase}[1]{#1}
55 \pagestyle{headings}
56 \setcounter{StandardModuleDepth}{1}
57 % Some commands are defined here, and not in the commented part, because \externaldocument is required
58 \newcommand{\Lpack}[1]{\textsf{#1}}
59 \newcommand{\Lclass}[1]{\textsf{#1}}
60 \newcommand{\file}[1]{\texttt{#1}}
61 \newcommand{\eledpar}{eledpar}
62 \newcommand{\eledmac}{eledmac}
63 \newcommand{\Eledmac}{\Lpack{\eledmac}}
64 \newcommand{\Eledpar}{\Lpack{\eledpar}}
65 \newcommand{\edmac}{\texttt{EDMAC}}
66 \newcommand{\tabmac}{\texttt{TABMAC}}
67 \newcommand{\edstanza}{\texttt{EDSTANZA}}
68 \newcommand{\texbook}{\textit{TeXbook}}
69 \newcommand{\thetexbook}{\textit{The TeXbook}}
70 \externaldocument[eledmac-]{eledmac}
71 \begin{document}
72 \raggedbottom
73 \DocInput{eledpar.dtx}
74 \end{document}
75 %</driver>
76 %
77 % \fi
78 % \newcommand{\reff}[1]{\ref{#1} p.~\pageref{#1}}
79 % \CheckSum{5224}
80 %
81 % \makeatletter
82 % \newcommand*{\DescribeIt}{\leavevmode\@bsphack\begingroup\MakePrivateLetters
83 % \Describe@It}
84 % \newcommand*{\Describe@It}[1]{\endgroup
85 % \marginpar{\raggedleft\PrintDescribeEnv{#1}}%
86 % \SpecialItIndex{#1}\@esphack\ignorespaces}
87 % \newcommand*{\SpecialItIndex}[1]{\@bsphack
88 % \index{#1\actualchar{\protect\ttfamily#1}\encapchar usage}\@esphack}
89 % \DoNotIndex{\@,\@@par,\@beginparpenalty,\@empty}
90 % \DoNotIndex{\@flushglue,\@input}
91 % \DoNotIndex{\@makefnmark,\@makeother,\@maketitle}
92 % \DoNotIndex{\@namedef,\@ne,\@spaces,\@tempa}
93 % \DoNotIndex{\@tempb,\@tempswafalse,\@tempswatrue}
94 % \DoNotIndex{\@thanks,\@thefnmark,\@topnum}
95 % \DoNotIndex{\@@,\@elt,\@forloop,\@fortmp,\@gtempa,\@totalleftmargin}
96 % \DoNotIndex{\",\/,\@ifundefined,\@nil,\@verbatim,\@vobeyspaces}
97 % \DoNotIndex{\|,\~,\ ,\active,\advance,\aftergroup,\begingroup,\bgroup}
98 % \DoNotIndex{\mathcal,\csname,\def,\documentstyle,\dospecials,\edef}
99 % \DoNotIndex{\egroup}
100 % \DoNotIndex{\else,\endcsname,\endgroup,\endinput,\endtrivlist}
101 % \DoNotIndex{\expandafter,\fi,\fnsymbol,\futurelet,\gdef,\global}
102 % \DoNotIndex{\hbox,\hss,\if,\if@inlabel,\if@tempswa,\if@twocolumn}
103 % \DoNotIndex{\ifcase}
104 % \DoNotIndex{\ifcat,\iffalse,\ifx,\ignorespaces,\index,\input,\item}
105 % \DoNotIndex{\jobname,\kern,\leavevmode,\leftskip,\let,\llap,\lower}
106 % \DoNotIndex{\m@ne,\next,\newpage,\nobreak,\noexpand,\nonfrenchspacing}
107 % \DoNotIndex{\obeylines,\or,\protect,\raggedleft,\rightskip,\rm,\sc}
108 % \DoNotIndex{\setbox,\setcounter,\small,\space,\string,\strut}
109 % \DoNotIndex{\strutbox}
110 % \DoNotIndex{\thefootnote,\thispagestyle,\topmargin,\trivlist,\tt}
111 % \DoNotIndex{\twocolumn,\typeout,\vss,\vtop,\xdef,\z@}
112 % \DoNotIndex{\,,\@bsphack,\@esphack,\@noligs,\@vobeyspaces,\@xverbatim}
113 % \DoNotIndex{\`,\catcode,\end,\escapechar,\frenchspacing,\glossary}
114 % \DoNotIndex{\hangindent,\hfil,\hfill,\hskip,\hspace,\ht,\it,\langle}
115 % \DoNotIndex{\leaders,\long,\makelabel,\marginpar,\markboth,\mathcode}
116 % \DoNotIndex{\mathsurround,\mbox,\newcount,\newdimen,\newskip}
117 % \DoNotIndex{\nopagebreak}
118 % \DoNotIndex{\parfillskip,\parindent,\parskip,\penalty,\raise,\rangle}
119 % \DoNotIndex{\section,\setlength,\TeX,\topsep,\underline,\unskip,\verb}
120 % \DoNotIndex{\vskip,\vspace,\widetilde,\\,\%,\@date,\@defpar}
121 % \DoNotIndex{\[,\{,\},\]}
122 % \DoNotIndex{\count@,\ifnum,\loop,\today,\uppercase,\uccode}
123 % \DoNotIndex{\baselineskip,\begin,\tw@}
124 % \DoNotIndex{\a,\b,\c,\d,\e,\f,\g,\h,\i,\j,\k,\l,\m,\n,\o,\p,\q}
125 % \DoNotIndex{\r,\s,\t,\u,\v,\w,\x,\y,\z,\A,\B,\C,\D,\E,\F,\G,\H}
126 % \DoNotIndex{\I,\J,\K,\L,\M,\N,\O,\P,\Q,\R,\S,\T,\U,\V,\W,\X,\Y,\Z}
127 % \DoNotIndex{\1,\2,\3,\4,\5,\6,\7,\8,\9,\0}
128 % \DoNotIndex{\!,\#,\$,\&,\',\(,\),\+,\.,\:,\;,\<,\=,\>,\?,\_}
129 % \DoNotIndex{\discretionary,\immediate,\makeatletter,\makeatother}
130 % \DoNotIndex{\meaning,\newenvironment,\par,\relax,\renewenvironment}
131 % \DoNotIndex{\repeat,\scriptsize,\selectfont,\the,\undefined}
132 % \DoNotIndex{\arabic,\do,\makeindex,\null,\number,\show,\write,\@ehc}
133 % \DoNotIndex{\@author,\@ehc,\@ifstar,\@sanitize,\@title,\everypar}
134 % \DoNotIndex{\if@minipage,\if@restonecol,\ifeof,\ifmmode}
135 % \DoNotIndex{\lccode,\newtoks,\onecolumn,\openin,\p@,\SelfDocumenting}
136 % \DoNotIndex{\settowidth,\@resetonecoltrue,\@resetonecolfalse,\bf}
137 % \DoNotIndex{\clearpage,\closein,\lowercase,\@inlabelfalse}
138 % \DoNotIndex{\selectfont,\mathcode,\newmathalphabet,\rmdefault}
139 % \DoNotIndex{\bfdefault}
140 % \DoNotIndex{\newcommand,\renewcommand,\providecommand}
141 % \DoNotIndex{\ ,\to}
142 %
143 % \newcommand{\dtxfilename}{\texttt{eledpar.dtx}}
144 % \GetFileInfo{eledpar.sty}
145 % ^^A Put changes in the right order : see http://tex.stackexchange.com/a/74113/7712
146 % \let\org@changes@\changes@
147 % \def\my@changes v#1.#2.#3\@nil{%
148 % \org@changes@{v#1.\six@digits{#2}.#3=v#1.#2.#3}%
149 % }%
150 % \newcommand*{\six@digits}[1]{%
151 % \ifnum#1<100000 0\fi
152 % \ifnum#1<10000 0\fi
153 % \ifnum#1<1000 0\fi
154 % \ifnum#1<100 0\fi
155 % \two@digits{#1}%
156 % }%
157 % \renewcommand*{\changes@}[1]{%
158 % \my@changes#1.\@nil
159 % }%
160 %\makeatother
161 %
162 % \changes{v0.1.0}{2004/12/10}{First public release}
163 % \changes{v0.2.0}{2005/01/01}{Fix babel problems}
164 % \changes{v0.3.0}{2005/03/24}{Reorganize for ledarab}
165 % \changes{v0.3.a}{2005/03/30}{Minor \cs{linenummargin} fix}
166 % \changes{v0.3.b}{2005/04/08}{Improved parallel page balancing}
167 % \changes{v0.3.c}{2011/06/16}{Compatibilty with Polyglossia}
168 % \changes{v0.4.0}{2011/08/03}{No more ledparpatch. All patches are now in the main file.}
169 % \changes{v0.5.0}{2011/08/21}{Corrections about \cs{section} and other titles in numbered sections}
170 % \changes{v0.6.0}{2011/08/22}{Be able to us \cs{chapter} in parallel pages.}
171 % \changes{v0.7.0}{2011/08/31}{Option `shiftedverses' which make there is no blank between two parallel verses with inequal length.}
172 % \changes{v0.8.0}{2011/09/16}{Possibility to have a symbol on each hanging of verses, like in the french typography. Redefine the commande \cs{hangingsymbol} to define the character.}
173 % \changes{v0.9.0}{2011/10/01}{Possibilty to number the pstart with the commands \cs{numberpstarttrue}.}
174 % \changes{v0.9.1}{2011/10/02}{The numbering of the pstarts restarts on each \cs{beginnumbering}.}
175 % \changes{v0.9.2}{2011/11/08}{Debug : with \cs{Columns}, the hanging indentation now runs on the left columns and the hanging symbol is shown only when \cs{stanza} is used.}
176 % \changes{v0.9.3}{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.}
177 % \changes{v0.10.0}{2012/04/04}{\cs{edlabel} commands which start a paragraph are now put in the right place.}
178 % \changes{v0.10.0}{2012/04/04}{\cs{edlabel} commands on the right side are now correctly indicated.}
179 % \changes{v1.0.0}{2012/09/14}{Compatibility with eledmac. Change name to eledpar.}
180 % \changes{v1.0.1}{2012/09/16}{Correction on \cs{numberonlyfirstinline} with lineation by pstart or by page.}
181 % \changes{v1.1.0}{2012/09/25}{Shiftedverses becomes shiftedpstarts.}
182 % \changes{v1.2.0}{2012/10/15}{Support for \cs{led}\meta{section} commands in parallel texts.}
183 % \changes{v1.3.2}{2012/12/11}{Debug with some classes.}
184 % \changes{v1.4.3}{2013/10/27}{Corrects a false hanging verse when a verse is exactly the length of a line.}
185 % \changes{v1.5.0}{2013/11/08}{Add, as in eledmac, features to manage page breaks.}
186 % \changes{v1.7.0}{2014/04/14}{Add, as in eledmac, features to make crossrefs with pstart numbers.}
187 % \changes{v1.8.0}{2014/08/05}{Debug eledmac sectioning command after using \cs{resumenumbering}.}
188 % \changes{v1.8.0}{2014/08/05}{Compatibility with \Lpack{musixtex}.}
189 % \changes{v1.8.0}{2014/08/05}{Add, as in eledmac, option to insert something after \cs{pend}s / verses.}
190 % \changes{v1.8.0}{2014/08/05}{Add, as in eledmac, option to insert something between \cs{pstart}s / verse.}
191 % \changes{v1.8.0}{2014/08/05}{Add, as in eledmac, new system of sectioning commands.}
192 % \changes{v1.8.2}{2014/08/15}{Debug left and side note (bugs added by 1.8.0)}
193 % \changes{v1.8.2}{2014/08/15}{Debug \cs{eledxxx} with some paper sizes}
194 % \changes{v1.8.3}{2014/08/31}{Add \cs{noeledxxx}, as in eledmac}
195 % \changes{v1.9.0}{2014/09/16}{Compatibility with \cs{Xnoteswidthliketwocolumns} and \cs{notesXwidthliketwocolumns}}
196 % \changes{v1.10.0}{2015/01/12}{Restore critical notes in \cs{eledsection} in parallel columns (this bug was added in 1.8.2).}
197 % \changes{v1.10.0}{2015/01/12}{Compatibility with \cs{AtEveryPstart} and \cs{AtEveryPend}}
198 % \changes{v1.11.0}{2015/01/23}{Compatibility of standard footnotes with some biblatex styles.}
199 % \changes{v1.12.0}{2015/02/23}{Compatibility with \LuaLaTeX\ RTL languages.}
200 % \changes{v1.13.0}{2015/03/06}{With parallel pages, long notes can now flow from the Left to the right side and from the Right to the left side.}
201 % \changes{v1.13.0}{2015/03/06}{Fix bug in shiftedpstarts when size difference between pstarts is very important.}
202 % \changes{v1.14.0}{2015/03/22}{The \cs{newif}s are not followed by boolean values set to false, because it is the \TeX\ default setting.}
203 % \changes{v1.14.0}{2015/03/22}{Fix bug with line number position when using \cs{eledsection} and similar commands for RTL texts with \LuaLaTeX.}
204 % \changes{v1.15.0}{2015/04/13}{Add \cs{AtEveryPstartCall}.}
205 % \changes{v1.15.0}{2015/04/13}{Fix vertical spurious space before right \cs{eledchapter} (bug added in v1.13.0).}
206 % \changes{v1.15.0}{2015/04/13}{Prevent vertical space when using \cs{AtEveryPstart} or \cs{AtEveryPend} with a command which prints nothing}
207 % \changes{v1.16.0}{2015/05/18}{Fix bug with nofamiliar / nocritical option of eledmac.}
208 % \changes{v1.16.0}{2015/05/18}{Error message when using \cs{beginnumbering}…\cs{endnumbering} without \cs{pstart}.}
209 % \changes{v1.16.0}{2015/05/18}{Error message when starting a Leftside/a Rightside while the previous one has not been yet typeset.}
210 % \changes{v1.16.0}{2015/05/18}{Error message when calling \cs{Pages} inside `pages' environment and \cs{Columns} inside `pairs' environment.}
211 % \changes{v1.16.0}{2015/05/18}{New package option sameparallelpagenumber to have the same page number for both left and right side.}
212 % \changes{v1.16.1}{2015/05/20}{Write information about line-list file version in the correct file.}
213 % \changes{v1.16.2}{2015/05/29}{Fix bug when adding empty lines before a \cs{pend} in combination with some specific penalties setting.}
214 % \changes{v1.17.0}{2015/06/02}{Add compatibility of optional argument of \cs{pstart}/\cs{pend} and \cs{AtEveryPstart}/\cs{AtEveryPend} with two columns mode.}
215 % \changes{v1.17.0a}{2015/07/19}{Eledpar support ends. Migrate to reledpar.}
216 % \changes{v1.17.1}{2015/09/01}{Changes some internal code in order to provide compatibility with \LaTeX\ release of october 2015}
217 % \hyphenation{man-u-script man-u-scripts}
218 %
219 %
220 % ^^A PW added following as the definitions are at some unknown elsewhere
221 % \newcommand{\egstart}{}
222 % \newcommand{\egmid}{}
223 % \newcommand{\egend}{}
224 %
225 % \renewcommand{\egstart}{%
226 % \par
227 % \begingroup
228 % \centering
229 % \begin{minipage}{0.45\textwidth}}
230 % \renewcommand{\egmid}{%
231 % \end{minipage}\hfill\begin{minipage}{0.45\textwidth}}
232 % \renewcommand{\egend}{%
233 % \end{minipage}\par\endgroup}
234 %
235 % \title{Parallel typesetting for critical editions: \\
236 % the \Lpack{\eledpar} package\thanks{This file (\dtxfilename)
237 % has version number \fileversion, last revised \filedate.}}
238 % \author{%
239 % Ma\"ieul Rouquette\thanks{\texttt{maieul at maieul dot net}}
240 % {\small based on the original \Lpack{ledpar} by}
241 % Peter Wilson \\
242 % Herries Press\thanks{\texttt{herries dot press at earthlink dot net}}\\
243 % }
244 %
245 % \date{}
246 %
247 %
248 % \maketitle
249 %
250 % \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.}
251 %
252 % \begin{abstract}
253 % The \Eledmac{} package, which is based on the \PlainTeX\ set of
254 % \edmac\ macros, has been used for some time for typesetting critical
255 % editions. The \Eledpar{} package is an extension to \Eledmac{}
256 % which enables texts and their critical apparatus to be typeset in
257 % parallel, either in two columns or on pairs of facing pages.
258 %
259 % Note that before September 2012, eledpar was called ledpar. The changes from ledmac/ledpar to eledmac/eledpar is explained in ledmac documentation.
260 %
261 % \Lpack{eledpar} provides many tools and options. Normally, they are all documented in this file.
262 % Also provided is a help folder, ``\href{examples/.}{examples}''. The folder contains additional examples (although not for all cases).
263 % Examples starting by ``3-'' are for basic uses, those starting by ``4-'' are for advanced uses.
264 %
265 % To report bugs, please go to ledmac's GitHub page and click ``New Issue'': \url{https://github.com/maieul/ledmac/issues/}. You must open an account with github.com to access my page (maieul/ledmac). GitHub accounts are free for open-source users. You can report bug in English or in French (better).
266 %
267 % You can subscribe to the eledmac email list in:\\ \url{http://geekographie.maieul.net/146}
268 % \end{abstract}
269 % \renewcommand{\numberline}[1]{#1~}
270 % \tableofcontents
271 %
272 %
273 %
274 % \section{Introduction}
275 %
276 % The \edmac{} macros \cite{EDMACTUG} for typesetting critical editions
277 % of texts
278 % have been available for use with TeX for some years. Since \edmac{}
279 % became available there had been a small but constant demand for a
280 % version of \edmac{} that could be used with \LaTeX. The \Eledmac{}
281 % package was introduced in 2003 in an attempt to satisfy that request.
282 %
283 % Some critical editions contain texts in more than one form, such as
284 % a set of verses in one language and their translations in another. In
285 % such cases there is a desire to be able to typeset the two texts, together
286 % with any critical apparatus, in parallel. The \Eledpar{} package
287 % is an extension to \Eledmac{} that enables two texts and their
288 % apparatus to be set in parallel, either in two columns or on pairs of
289 % facing pages.
290 %
291 % The package has to try and coerce \TeX{} into paths it was not designed
292 % for. Use of the package, therefore, may produce some surprising results.
293 %
294 % This manual contains a general description of how to use
295 % \Eledpar{} starting in section~\ref{howto};
296 % the complete source code for the package,
297 % with extensive documentation (in sections~\ref{overview}
298 % through \ref{end});
299 % and an Index to the source code. As \Eledpar{} is an adjunct to \Eledmac{}
300 % I assume that you have read the \Eledmac{} manual. Also \Eledpar{} requires
301 % \Eledmac{} to be used, preferably at least version 0.10 (2011/08/22).
302 % You do not need to read the source code for this package in order to
303 % use it but doing so may help to answer any questions you might have.
304 % On a first reading,
305 % I suggest that you should skip anything after the general documentation in
306 % sections~\ref{howto} until~\ref{overview},
307 % unless you are particularly interested in the innards of \Eledpar.
308 %
309 %
310 % \section{The \Lpack{\eledpar} package}\label{howto}
311 %
312 % A file may mix \emph{numbered} and \emph{unnumbered} text.
313 % Numbered text is printed with marginal line numbers and can include
314 % footnotes and endnotes that are referenced to those line numbers:
315 % this is how you'll want to print the text that you're editing.
316 % Unnumbered text is not printed with line numbers, and you can't
317 % use \Eledmac's note commands with it: this is appropriate for
318 % introductions and other material added by the editor around the
319 % edited text.
320 %
321 % The \Eledpar{} package lets you typeset two \emph{numbered} texts in
322 % parallel. This can be done either as setting the `Leftside' and `Rightside'
323 % texts in two columns or on facing pages.
324 % In the paired pages case footnotes are placed at the bottom of the page
325 % on which they are called out --- that is, footnotes belonging to the left
326 % are set at the foot of a left (even numbered) page, and those for right
327 % texts are at the bottom of the relevant right (odd numbered) page. However,
328 % in the columnar case, all footnotes are set at the bottom left of the
329 % page on which they are called out --- they are not set below the
330 % relevant column.
331 % The line numbering schemes need not be the same for the two texts.
332 %
333 % \subsection{General}
334 %
335 % \Eledmac{} essentially puts each chunk of numbered text
336 % (the text within a \cs{pstart} \ldots \cs{pend}) into a box and then
337 % following the \cs{pend} extracts the text line by line from the box
338 % to number and print it. More precisely, the text is first put into the
339 % the box as though it was being typeset as normal onto a page and
340 % any notes are stored without being typeset. Then each typeset line
341 % is extracted from the box and any notes for that line are recalled.
342 % The line, with any notes, is then output for printing, possibly with
343 % a line number attached. Effectively, all the text is typeset and then
344 % afterwards all the notes are typeset.
345 %
346 %
347 % \Eledpar{} similarly puts the left and right chunks into boxes but can't
348 % immediately output the text after a \cs{pend} --- it has to wait until
349 % after both the left and right texts have been collected before it can
350 % start processing. This means that several boxes are required and possibly
351 % TeX has to store a lot of text in its memory; both the number of potential
352 % boxes and memory are limited. If TeX's memory is overfilled the recourse is
353 % to reduce the amount of text stored before printing.
354 %
355 % \DescribeMacro{\maxchunks}
356 % It is possible to have multiple chunks in the left and right texts before
357 % printing them. The macro \cs{maxchunks}\marg{num} specifies the maximum
358 % number of chunks within the left or right texts. This is initially set as: \\
359 % \verb?\maxchunks{5120}? \\
360 % meaning that there can be up to 5120 chunks in the left text and up to
361 % 5120 chunks in
362 % the right text, requiring a total of 10240 boxes. If you need more chunks
363 % then you can increase \cs{maxchunks}. The \cs{maxchunks} must be called in the preamble.
364 %
365 % If you \cs{maxchunks} is too little
366 %you can get a \Eledmac{} error message along the
367 % lines: `Too many \cs{pstart} without printing. Some text will be lost.'
368 % then you will have to either increase \cs{maxchunks} or use the
369 % parallel printing commands (\cs{Columns} or \cs{Pages}) more frequently.
370 %
371 % When typesetting verse using \cs{syntax}, each line is treated as a chunk,
372 % so be warned that if you are setting parallel verses you might have to
373 % increase \cs{maxchunks} much more than it appears at first sight.
374 %
375 % In general, \Eledmac{} is a TeX resource hog, and \Eledpar{} only
376 % makes things worse in this respect.
377 %
378 % \section{Parallel columns}\label{columns}
379 %
380 % \DescribeEnv{pairs}
381 % Numbered text that is to be set in columns must be within a \verb?pairs?
382 % environment. Within the environment the text for the lefthand and righthand
383 % columns is placed within the \verb?Leftside? and \verb?Rightside?
384 % environments, respectively; these are described in more detail below
385 % in section~\ref{leftright}.
386 %
387 % \DescribeMacro{\Columns}
388 % The command \cs{Columns} typesets the texts in the previous pair of
389 % \verb?Leftside? and \verb?Rightside? environments.
390 % The general scheme for parallel columns looks like this:
391 % \begin{verbatim}
392 % \begin{pairs}
393 % \begin{Leftside} ... \end{Leftside}
394 % \begin{Rightside} ... \end{Rightside}
395 % \end{pairs}
396 % \Columns
397 % \begin{pairs}
398 % \begin{Leftside} ... \end{Leftside}
399 % ...
400 % \end{pairs}
401 % \Columns
402 % \end{verbatim}
403 %
404 %
405 % Keep in mind that the \cs{Columns} \textbf{must be} outside of the \verb+pairs+ environment.
406 % \DescribeMacro{\AtBeginPairs}
407 % \changes{v1.9.0}{2014/09/16}{Add \cs{AtBeginPairs} macro.}
408 % You can use the macro \cs{AtBeginPairs} to insert a code at the begining of each \verb+pairs+ environments.
409 % That could be useful to add the \cs{sloppy} macro to prevent overfull hboxes in two columns.
410 % \begin{verbatim}
411 % \AtBeginPairs{\sloppy}
412 % \end{verbatim}
413 % There is no required pagebreak before or after the columns.
414 %
415 % \DescribeMacro{\Lcolwidth}
416 % \DescribeMacro{\Rcolwidth}
417 % The lengths \cs{Lcolwidth} and \cs{Rcolwidth} are the widths of the left
418 % and right columns, respectively. By default, these are: \\
419 % \verb?\setlength{\Lcolwidth}{0.45\textwidth}? \\
420 % \verb?\setlength{\Rcolwidth}{0.45\textwidth}? \\
421 % They may be adjusted if one text tends to be `bulkier' than the other.
422 %
423 % \DescribeMacro{\columnrulewidth}
424 % \DescribeMacro{\columnseparator}
425 % The macro \cs{columnseparator} is called between each left/right pair
426 % of lines. By default it inserts a vertical rule of width
427 % \cs{columnrulewidth}. As this is initially defined to be 0pt the rule
428 % is invisible. For a visible rule between the columns you could try: \\
429 % \verb?\setlength{\columnrulewidth}{0.4pt}? \\
430 % You can also modify \cs{columnseparator} if you want more control.
431 %
432 % \DescribeMacro{\columnsposition}
433 % \changes{v1.8.0}{2014/08/05}{Add \cs{columnsposition}.}
434 % By default, columns are positioned to the right of the page.
435 % However, you use \cs{columnsposition}\verb+{L}+ to align them to the left,
436 % or \cs{columnsposition}\verb+{C}+ to center them.
437 %
438 % When you use \cs{stanza}, the visible rule may shift when a verse has a hanging indent. To prevent shifting, use \cs{setstanzaindents} outside the \verb|Leftside| or \verb|Rightside| environment.
439 %
440 %
441 % \DescribeMacro{\beforecolumnseparator}\DescribeMacro{\aftercolumnseparator}
442 % \changes{v1.8.0}{2014/08/05}{Add \cs{beforecolumnseparator} and \cs{aftercolumnseparator}.}
443 % By default, the spaces around column separator are the same as the space:
444 % \begin{itemize}
445 % \item On the left of columns, if columns are aligned right.
446 % \item On the right of columns, if columns are aligned left.
447 % \item On both the Left and Right columns, if columns are centered.
448 % \end{itemize}
449 % You can redefine \cs{beforecolumnseparator} and \cs{aftercolumnseparator} length to define spaces before or after the column separator, instead of letting eledpar calculate them automatically.
450 % \begin{verbatim}
451 % \setlength{\beforecolumseparator}{length}
452 % \setlength{\aftercolumseparator}{length}
453 % \end{verbatim}
454 % If you want to revert to the previous behavior, just set with a negative value.
455 % \DescribeMacro{\widthliketwocolumns}
456 % If you want to mix two-column with single-column text, you can align horizontally single-column text to two-column text with \cs{widthliketwocolumnstrue}. To reset this feature, use \cs{widthliketwocolumnsfalse}.
457 % You can also call \cs{widthliketwocolumns} as a global option when loading \Lpack{eledmac} or \Lpack{eledpar}
458 %
459 % \DescribeMacro{\Xnoteswidthliketwocolumns}
460 % \DescribeMacro{\notesXwidthliketwocolumns}
461 % In most cases, you should use \cs{widthliketwocolumns} in combination with \cs{Xnoteswidthliketwocolumns} and \cs{notesXwidthliketwocolumns} to align the critical/familiar footnotes with the two colums.
462 % See \Lpack{eledmac}'s handbook for more details.
463 % \section{Facing pages}\label{pages}
464 % \subsection{Basic usage}
465 % \DescribeEnv{pages}
466 % Numbered text that is to be set on facing pages must be within a \verb?pages?
467 % environment. Within the environment the text for the lefthand and righthand
468 % pages is placed within the \verb?Leftside? and \verb?Rightside?
469 % environments, respectively.
470 %
471 % \DescribeMacro{\Pages}
472 % The command \cs{Pages} typesets the texts in the previous pair of
473 % \verb?Leftside? and \verb?Rightside? environments.
474 % The general scheme for parallel pages looks like this:
475 % \begin{verbatim}
476 % \begin{pages}
477 % \begin{Leftside} ... \end{Leftside}
478 % \begin{Rightside} ... \end{Rightside}
479 % \begin{Leftside} ... \end{Leftside}
480 % ...
481 % \end{pages}
482 % \Pages
483 % \end{verbatim}
484 % The \verb?Leftside? text is set on lefthand (even numbered) pages and
485 % the \verb?Rightside? text is set on righthand (odd numbered) pages.
486 % Each \cs{Pages} command starts a new even numbered page. After parallel
487 % typesetting is finished, a new page is started.
488 % Note that the \cs{Pages} \textbf{must be} outside of the \verb+pages+ environment.
489 % \subsection{Text width}
490 % \DescribeMacro{\Lcolwidth}
491 % \DescribeMacro{\Rcolwidth}
492 % Within the \verb?pages? environment the lengths \cs{Lcolwidth} and
493 % \cs{Rcolwidth} are the widths of the left
494 % and right pages, respectively. By default, these are set to the normal
495 % textwidth for the document, but can be changed within the environment if
496 % necessary.
497 % \subsection{Page number}
498 % \changes{v1.15.0}{2015/05/18}{Add sameparallelpagenumber option.}
499 % By default, \cs{Pages} use the standard \LaTeX\ page number scheme.
500 % This means that pages are numbered continuously following printed-book conventions: from left-hand to right-hand side, left-hand pages having even numbers, right-hand pages having odd numbers.
501 %
502 % \DescribeMacro{\sameparallelpagenumbertrue}\DescribeMacro{\sameparallelpagenumbertrue}However, you can use the package option \verb+sameparallelpagenumber+ to have the same page number for both left and right side.
503 % In this case, this setting will apply only for pages typeset by \cs{Pages}, not for ``normal'' pages.
504 %
505 % You can also switch the two system using \cs{sameparallelpagenumbertrue} and \cs{sameparallelpagenumberfalse}.
506 %
507 % \subsection{Setting the page breaking}
508 % \DescribeMacro{\goalfraction}
509 % When doing parallel pages \Eledpar{} has to guess where TeX is going to
510 % put pagebreaks and hopefully get there first in order to put the pair of
511 % texts on their proper pages. When it thinks that the fraction
512 % \cs{goalfraction} of a page has been filled, it finishes that page and
513 % starts on the other side's text. The definition is: \\
514 % \verb?\newcommand*{\goalfraction}{0.9}? \\
515 % If you think you can get more on a page, increase this. On the other hand,
516 % if some left text overflows onto an odd numbered page or some right text
517 % onto an even page, try reducing it, for instance by: \\
518 % \verb?\renewcommand*{\goalfraction}{0.8}?
519 % \subsection{Critical and familiar footnotes}
520 % Of course, in ``Facing pages'', the \Lpack{eledmac} both critical and familiar footnotes can be used.
521 % However, some specific points must be taken into consideration.
522 % \subsubsection{Note size setting}
523 % Since \Lpack{eledpar} v.1.13.0, long notes in facing pages can flow from left to right pages, and \emph{vice-versa}.
524 % However, the \Lpack{eledmac} default setting for the maximum alloted size to notes is greater than \cs{textheight}. That makes impossible for long notes to flow across pages.
525 % \footnote{The same applies to \LaTeX\ normal notes. Read \url{http://tex.stackexchange.com/a/228283/7712} for technical informations.}
526 % We have not changed this default setting, because we don't want to break compatibility with older version of \Lpack{eledmac}.
527 % So, you MUST change the default setting via \cs{maxhXnotes} (for critical notes)\cs{maxhnotesX} (for familiar notes).
528 % Both commands are explained in \Lpack handbook (\reff{eledmac-maxhXnotes}).
529 % As an advisable setting:
530 % \begin{verbatim}
531 % \maxhXnotes{0.6\textheight}
532 % \maxhnotesX{0.6\textheight}
533 % \end{verbatim}
534 % \subsubsection{Notes for one side only}
535 % \DescribeMacro{\onlyXside}
536 % \DescribeMacro{\onlysideX}
537 % You may want to typeset notes on one side only (either left or right).
538 % Use \cs{onlyXside}\oarg{s}\marg{p} to set critical notes, and \cs{onlysideX}\oarg{s}\marg{p} to set familiar notes.
539 % \marg{p} must be set to \verb+L+ for notes to be confined only on the left side and to \verb+R+ for notes to be confined only on the right side.
540 % \subsubsection{Familiar notes called in the right side, but to be printed in the left side}
541 % \DescribeMacro{\footnoteXnomk}
542 % \DescribeMacro{\footnoteXmk}
543 % As often happens, the left side has less room for text.
544 % We may want to call familiar notes in the right side while using at the same time the available space in the left side to print them.
545 %
546 % To achieve this, we call \cs{footnoteXnomk}\marg{notecontent} in the left side. X is to be replaced by the series letter. We do this call in the left side after the word which matches up to the one in the right side after which we want to insert the actual footnote mark.
547 %
548 % In the right side, we call \cs{footnoteXmk} at the place we want to have the footnote mark. X is to be replaced by the series letter.
549 % For example:
550 % \begin{verbatim}
551 % \begin{Leftside}
552 % \beginnumbering
553 % \pstart
554 % A little cat\footnoteAnomk{A note.}. And so one ...
555 % \pend
556 % \endnumbering
557 % \end{Leftside}
558 % \begin{Rightside}
559 % \beginnumbering
560 % \pstart
561 % Un petit chat\footnotemk. And so one ...
562 % \pend
563 % \endnumbering
564 % \end{Rightside}
565 % \end{verbatim}
566 % \section{Left and right texts}\label{leftright}
567 % \subsection{Environments}
568 % Parallel texts are divided into Leftside and Rightside. The form of the
569 % contents of these two are independent of whether they will be set
570 % in columns or pages.
571 %
572 % \DescribeEnv{Leftside}
573 % \DescribeEnv{Rightside}
574 % The left text is put within the \verb?Leftside? environment and the
575 % right text likewise in the \verb?Rightside? environment. The number of
576 % \verb?Leftside? and \verb?Rightside? environments must be the same.
577 % \subsection{Line numbering scheme}
578 % Within these environments you can designate the line numbering scheme(s)
579 % to be used.
580 % \DescribeMacro{\firstlinenum}
581 % \DescribeMacro{\linenumincrement}
582 % \DescribeMacro{\firstsublinenum}
583 % \DescribeMacro{\sublinenumincrement}
584 % \DescribeMacro{\firstlinenum*}
585 % \DescribeMacro{\linenumincrement*}
586 % \DescribeMacro{\firstsublinenum*}
587 % \DescribeMacro{\sublinenumincrement*}
588 % The \Eledmac{} package originally used counters for specifying the
589 % numbering scheme; now both \Eledmac and
590 % the \Eledpar{} package use macros instead. Following
591 % \cs{firstlinenum}\marg{num} the first line number will be \meta{num}, and
592 % following \cs{linenumincrement}\marg{num} only every \meta{num}th
593 % line will have a printed number. Using these macros inside the
594 % \verb?Leftside? and \verb?Rightside? environments gives you independent
595 % control over the left and right numbering schemes. The \cs{firstsublinenum}
596 % and \cs{sublinenumincrement} macros correspondingly set the numbering
597 % scheme for sublines.
598 % The starred versions change both left and right numbering schemes.
599 %
600 % Generally speaking, controls like \cs{firstlinenum} or \cs{linenummargin}
601 % apply to sequential and left texts.
602 % To effect right texts only, they have
603 % to be within a \verb?Rightside? environment.
604 % \DescribeMacro{\lineationR}
605 % \cs{lineationR} macro is the equivalent of \Lpack{eledmac} \cs{lineation} macro for the right side.
606 % \DescribeMacro{\lineation*}
607 % \cs{lineation*} macro is the equivalent of \Lpack{eledmac} \cs{lineation} macro for both sides.
608 % \subsection{chunk}
609 % \DescribeMacro{\pstart}
610 % \DescribeMacro{\pend}
611 % In a serial (non-parallel) mode, each numbered paragraph, or chunk,
612 % is contained
613 % between the \cs{pstart} and \cs{pend} macros, and the paragraph is output
614 % when the \cs{pend} macro occurs. The situation is somewhat different
615 % with parallel typesetting as the left text (contained within \cs{pstart}
616 % and \cs{pend} groups within the \verb?Leftside? environment) has to be
617 % set in parallel with the right text (contained within its own \cs{pstart}
618 % and \cs{pend} groups within the corresponding \verb?Rightside? environment)
619 % the \cs{pend} macros cannot immediately initiate any typesetting ---
620 % this has to be controlled by the \cs{Columns} or \cs{Pages} macros.
621 % Several chunks may be specified within a \verb?Leftside? or
622 % \verb?Rightside? environment.
623 % A multi-chunk text then looks like:
624 % \begin{verbatim}
625 % \begin{...side}
626 % % \beginnumbering
627 % \pstart first chunk \pend
628 % \pstart second chunk \pend
629 % ...
630 % \pstart last chunk \pend
631 % % \endnumbering
632 % \end{...side}
633 % \end{verbatim}
634 % Numbering, via \cs{beginnumbering} and \cs{endnumbering}, may extend
635 % across several \verb?Leftside? or \verb?Rightside? environments.
636 % Remember, though,
637 % that the left/right sides are effectively independent of each other.
638 %
639 % \subsection{\cs{AtEveryPstart} and \cs{AtEveryPstartCall}}
640 % In general, remember that the moment where a \cs{pstart} is called is different
641 % from the moment when the \cs{pstart}\ldots\cs{pend} content is printed, which is when \cs{Pages} or \cs{Columns} is processed.
642 %
643 % Consequently:
644 % \begin{itemize}
645 % \item The argument of \cs{AtEveryPstart} (see \reff{eledmac-AtEveryPstart}) is called before every chunk is printed, except if you used an optional argument for the \cs{pstart}.
646 % \item The argument of \cs{AtEveryPstartCall} is called before every \cs{pstart}.
647 % \end{itemize}
648 % \subsection{Language setting}
649 % If you are using the
650 % \Lpack{babel} package with different languages
651 % (via, say, \cs{selectlanguage}) for the left and right texts it is
652 % particularly important to select the appropriate language within the
653 % \verb?Leftside? and \verb?Rightside? environments. The initial language
654 % selected for the right text is the \Lpack{babel} package's default. Also,
655 % it is the \emph{last} \cs{selectlanguage} in a side that controls the
656 % language used in any notes for that side when they get printed. If
657 % you are using multilingual notes then it is probably safest to explicitly
658 % specify the language(s) for each note rather than relying on the language
659 % selection for the side. The right side language is also
660 % applied to the right side line numbers.
661 %
662 % \subsection{Shifting}
663 % Corresponding left and right sides must have the same number of
664 % paragraph chunks --- if there are four on the left there must be four
665 % on the right, even if some are empty. The start of each pair of left and
666 % right chunks are aligned horizontally on the page. The ends may
667 % come at different positions --- if one chunk is shorter than the other
668 % then blank lines are output on the shorter side until the end of the longer
669 % chunk is reached.
670 %
671 % However, sometime if the left pstarts are much greater than right pstarts,
672 % or \emph{vice-versa},
673 % you can decide to shift the pstarts on the left and right side.
674 % That means the start of pstarts are not aligned horizontally on the page,
675 % the shift is offset at the end of each double pages.
676 % To enable this function, load eledpar with the option \verb+shiftedpstarts+.
677 % \section{Numbering text lines and paragraphs}
678 %
679 % \DescribeMacro{\beginnumbering}
680 % \DescribeMacro{\endnumbering}
681 % Each section of numbered text must be preceded by
682 % \cs{beginnumbering} and followed by \cs{endnumbering}, like: \\
683 % \cs{beginnumbering} \\
684 % \meta{text} \\
685 % \cs{endnumbering} \\
686 % These have to be separately specified within \verb?Leftside? and
687 % \verb?Rightside? environments.
688 %
689 % The \cs{beginnumbering} macro resets the line number to zero,
690 % reads an auxiliary file called \meta{jobname}.\file{nn} (where
691 % \meta{jobname} is the name of the main input file for this job,
692 % and \file{nn} is 1 for the first numbered section, 2 for
693 % the second section, and so on), and then creates a new version of
694 % this auxiliary file to collect information during this run.
695 % Separate auxiliary files are maintained for right hand texts and
696 % these are named \meta{jobname}.\file{nnR}, using the `R' to distinguish
697 % them from the left hand and serial (non-parallel) texts.
698 %
699 % \DescribeMacro{\memorydump}
700 % The command \cs{memorydump} effectively performs an \cs{endumbering}
701 % immediately followed by a \cs{beginnumbering} while not restarting the
702 % numbering sequence. This has the effect of clearing TeX's memory of previous
703 % texts and any associated notes, allowing
704 % longer apparent streams of parallel texts. The command should be applied
705 % to both left and right texts, and after making sure that all previous
706 % notes have been output. For example, along the lines of:
707 % \begin{verbatim}
708 % \begin{pages}
709 % \begin{Leftside}
710 % \beginnumbering
711 % ...
712 % \end{Leftside}
713 % \begin{Rightside}
714 % \beginnumbering
715 % ...
716 % \end{Rightside}
717 % \end{pages}
718 % \Pages
719 % \begin{pages}
720 % \begin{Leftside}
721 % \memorydump
722 % ...
723 % \end{Leftside}
724 % \begin{Rightside}
725 % \memorydump
726 % ...
727 % \end{pages}
728 % \end{verbatim}
729 % \DescribeMacro{\Rlineflag}
730 % The value of \cs{Rlineflag} is appended to the line numbers of the
731 % right texts. Its default definition is: \\
732 % \verb?\newcommand*{\Rlineflag}{R}? \\
733 % This may be useful for parallel columns but for parallel pages it might
734 % be more appropriate to redefine it as: \\
735 % \verb?\renewcommand*{\Rlineflag}{}?.
736 % \DescribeMacro{\printlinesR}
737 % \DescribeMacro{\ledsavedprintlines}
738 % The \cs{printlines} macro is ordinarily used to print the line number
739 % references for critical footnotes. For footnotes from right side texts
740 % a special version is supplied, called \cs{printlinesR}, which incorporates
741 % \cs{Rlineflag}. (The macro \cs{ledsavedprintlines} is a copy of the original
742 % \cs{printlines}, just in case \ldots). As provided, the package makes no
743 % use of \cs{printlinesR} but you may find it useful. For example, if you only
744 % use the B footnote series in righthand texts then you may wish to flag
745 % any line numbers in those footnotes with the value of \cs{Rlineflag}. You
746 % could do this by putting the following code in your preamble:
747 % \begin{verbatim}
748 % \let\oldBfootfmt\Bfootfmt
749 % \renewcommand{\Bfootfmt}[3]{%
750 % \let\printlines\printlinesR
751 % \oldBfootfmt{#1}{#2}{#3}}
752 % \end{verbatim}
753 %
754 %
755 %
756 %\changes{v0.9.0}{2011/10/01}{Possibility to number \cs{pstart}.}
757 % It's 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 numerotation with \DescribeMacro{\numberpstartfalse}\cs{numberpstartfalse}. You can redefine the commands \DescribeMacro{\thepstartL}\cs{thepstartL} and \DescribeMacro{\thepstartR}\cs{thepstartR} to change style. The numbering restarts on each \cs{beginnumbering}
758 % \section{Verse}
759 %
760 % If you are typesetting verse with \Eledmac{} you can use the \cs{stanza}
761 % construct, and you can also use this in right or left parallel texts.
762 % In this case each verse line is a chunk which has two implications.
763 % (1) you can unexpectedly exceed the \cs{maxchunks} limit or the overall
764 % limit on the number of boxes, and (2) left and right verse lines are
765 % matched, which may not be desirable if one side requires more print lines
766 % for verse lines than the other does.
767 %
768 % \DescribeEnv{astanza}
769 % \Eledpar{} provides an \verb?astanza? environment which you can use instead
770 % of \cs{stanza} (simply replace \verb?\stanza? by \verb?\begin{astanza}? and
771 % add \verb?\end{astanza}? after the ending \verb?\&?). Within the
772 % \verb?astanza? environment each verse line is treated as a paragraph,
773 % so there must be no blank lines in the environment otherwise there will
774 % be some extraneous vertical spacing.
775 %
776 % If you get an error message along the lines of `Missing number,
777 % treated as zero \cs{sza@0@}' it is because you have forgotten to use
778 % \cs{setstanzaindents} to set the stanza indents.
779 %
780 % \DescribeMacro{\skipnumbering}
781 % The command \cs{skipnumbering} when inserted in a line of parallel text
782 % causes the numbering of that particular line to be skipped. This can
783 % useful if you are putting some kind of marker (even if it is only a
784 % blank line) between stanzas. Remember, parallel texts must be numbered
785 % and this provides a way to slip in an `unnumbered' line.
786 %
787 % The \verb?astanza? environment forms a chunk but you may want to
788 % have more than one stanza within the chunk. Here are a couple of ways of
789 % doing that with a blank line between each internal stanza, and with
790 % each stanza numbered. First some preliminary definitions:
791 % \begin{verbatim}
792 % \newcommand*{\stanzanum}[2][\stanzaindentbase]{%
793 % \hskip -#1\llap{\textbf{#2}}\hskip #1\ignorespaces}
794 % \newcommand{\interstanza}{\par\mbox{}\skipnumbering}
795 % \end{verbatim}
796 % And now for two stanzas in one. In this first example the line numbering
797 % repeats for each stanza.
798 % \begin{verbatim}
799 % \setstanzaindents{1,0,1,0,1,0,1,0,1,0,1}
800 % \begin{pairs}
801 % \begin{Leftside}
802 % \firstlinenum{2}
803 % \linenumincrement{1}
804 % \beginnumbering
805 % \begin{astanza}
806 % \stanzanum{1} First in first stanza &
807 % Second in first stanza &
808 % Second in first stanza &
809 % Third in first stanza &
810 % Fourth in first stanza &
811 % \interstanza
812 % \setline{2}\stanzanum{2} First in second stanza &
813 % Second in second stanza &
814 % Second in second stanza &
815 % Third in second stanza &
816 % Fourth in second stanza \&
817 % \end{astanza}
818 % ...
819 % \end{verbatim}
820 % And here is a slightly different way of doing the same thing, but with
821 % the line numbering being continuous.
822 % \begin{verbatim}
823 % \setstanzaindents{1,0,1,0,1,0,0,1,0,1,0,1}
824 % \begin{pairs}
825 % \begin{Leftside}
826 % \firstlinenum{2}
827 % \linenumincrement{1}
828 % \beginnumbering
829 % \begin{astanza}
830 % \stanzanum{1} First in first stanza &
831 % Second in first stanza &
832 % Second in first stanza &
833 % Third in first stanza &
834 % Fourth in first stanza &
835 % \strut &
836 % \stanzanum{2}\advanceline{-1} First in second stanza &
837 % Second in second stanza &
838 % Second in second stanza &
839 % Third in second stanza &
840 % Fourth in second stanza \&
841 % \end{astanza}
842 % ...
843 % \end{verbatim}
844 %
845 %
846 %
847 % \DescribeMacro{\hangingsymbol}Like in eledmac, you could redefine the command \cmd{\hangingsymbol} to insert a character in each hanging line. If you use it, you must run \LaTeX\ two time. Example for the French typography
848 %\begin{verbatim}
849 %\renewcommand{\hangingsymbol}{[\,}
850 %\end{verbatim}
851 % You can also use it to force hanging verse to be flush right:
852 % \begin{verbatim}
853 % \renewcommand{\hangingsymbol}{\protect\hfill}
854 % \end{verbatim}
855 %
856 %
857 % When you use \cs{lednopb} make sure to use it on both sides in the corresponding
858 % verses to keep the pages in sync.
859 % \section{Side notes}
860 % As in \Lpack{eledmac}, you must use one of the following commands to add side notes: \cs{ledsidenote}, \cs{ledleftnote}, \cs{ledrightnote}, \cs{ledouterote}, \cs{ledinnerrote}.
861 %
862 % The \cs{sidenotemargin} defines the margin of the sidenote for either left or right side, depending on the current environment.
863 % You can use \cs{sidenotemargin*} to define it for both sides.
864 % \section{Parallel ledgroups}
865 % \changes{v1.6.0}{2013/12/13}{Add tool and documentation for parallel ledgroups}
866 % You can also make parallel ledgroups (see the documentation of eledmac about ledgroups).
867 % To do it you have:
868 % \begin{itemize}
869 % \item To load \Lpack{eledpar} package with the \verb+parledgroup+ option, or to add \cs{parledgrouptrue}.
870 % \item To push each ledgroup between \cs{pstart}…\cs{pend} command.
871 % \end{itemize}
872 % See the following example:
873 % \begin{verbatim}
874 % \begin{pages}
875 % \begin{Leftside}
876 % \beginnumbering
877 % \pstart
878 % \begin{ledgroup}
879 % ledgroup content
880 % \end{ledgroup}
881 % \pend
882 % \pstart
883 % \begin{ledgroup}
884 % ledgroup content
885 % \end{ledgroup}
886 % \pend
887 % \endnumbering
888 % \end{Leftside}
889 % \begin{Rightside}
890 % \beginnumbering
891 % \pstart
892 % \begin{ledgroup}
893 % ledgroup content
894 % \end{ledgroup}
895 % \pend
896 % \pstart
897 % \begin{ledgroup}
898 % ledgroup content
899 % \end{ledgroup}
900 % \pend
901 % \endnumbering
902 % \end{Rightside}
903 % \end{pages}
904 % \Pages
905 % \end{verbatim}
906 % You can add sectioning a sectioning command, following this scheme:
907 % \begin{verbatim}
908 % \begin{..side}
909 % \beginnumbering
910 % \pstart
911 % \section{First ledgroup title}
912 % \pend
913 % \pstart
914 % \begin{ledgroup}\skipnumbering
915 % ledgroup content
916 % \end{ledgroup}
917 % \pend
918 % \pstart
919 % \section{Second ledgroup title}
920 % \pend
921 % \pstart
922 % \begin{ledgroup}\skipnumbering
923 % ledgroup content
924 % \end{ledgroup}
925 % \pend
926 % \endnumbering
927 % \end{..side}
928 % \end{verbatim}
929 % \subsection{Parallel ledgroups and \Lpack{setspace} package}
930 % If you use the \Lpack{setspace} package and want your notes in parallel ledgroups to be single-spaced (not half-spaced or double-spaced), just add to your preamble:
931 % \begin{verbatim}
932 % \let\parledgroupnotespacing\singlespacing
933 % \end{verbatim}
934 % \emph{In effect, to have correct spacing, don't change the font size of your notes}.
935 % \StopEventually{}
936 %
937 % \section{Sectioning commands}
938 % \changes{v1.8.0}{2014/08/05}{New sectioning commands, as in eledmac.}
939 % The standard sectioning commands of eledmac are available, and provide parallel sectionings, for both two-column and two-page layout.
940 % \DescribeMacro{\eledsectnotoc}
941 % By default, the section commands of the right side are not added to the table of contents.
942 % But you can change it, using \cs{eledsectnotoc}\marg{arg}, where \meta{arg} could be \verb+L+ (for left side) or \verb+R+ (for right side).
943 %
944 % \DescribeMacro{\eledsectmark}
945 % By default, the \LaTeX\ marks for header are token from left side. You can change it, using \cs{eledsectmark}\marg{arg}, where \meta{arg} could be \verb+L+ (for left side) or \verb+R+ (for right side).
946 % \section{Implementation overview}\label{overview}
947 %
948 % TeX is designed to process a single stream of text, which may include
949 % footnotes, tables, and so on. It just keeps converting its input into
950 % a stream typeset pages. It was not designed for typesetting two texts
951 % in parallel, where it has to alternate from one to the other. Further,
952 % TeX essentially processes its input one paragraph at a time --- it is
953 % very difficult to get at the `internals' of a paragraph such as the
954 % individual lines in case you want to number them or put some mark at the
955 % start or end of the lines.
956 %
957 % \Eledmac{} solves the problem of line numbering by putting the paragraph
958 % in typeset form into a box, and then extracting the lines one by one
959 % from the box for TeX to put them onto the page with the appropriate page
960 % breaks. Most of the \Eledmac{} code is concerned with handling this box
961 % and its contents.
962 %
963 % \Eledpar's solution to the problem of parallel texts is to put the two
964 % texts into separate boxes, and then appropriately extract the pairs of
965 % lines from the boxes. This involves duplicating
966 % much of the original box code for an extra right text box. The other,
967 % smaller,
968 % part of the code is concerned with coordinating the line extractions from
969 % the boxes.
970 %
971 % The package code is presented in roughly in the same order as in \Eledmac.
972 %
973 % \section{Preliminaries}
974 % \label{preliminaries}\relax
975 %
976 % Announce the name and version of the package, which is
977 % targetted for LaTeX2e. The package also requires the \Eledmac{}
978 % package.
979 %
980 % \begin{macrocode}
981 %<*code>
982 \NeedsTeXFormat{LaTeX2e}
983 \ProvidesPackage{eledpar}[2015/09/01 v1.17.1 eledmac extension for parallel texts]%
984
985 % \end{macrocode}
986 % Few commands use \cs{xspace} command.
987 % \begin{macrocode}
988 \RequirePackage{xspace}%
989 % \end{macrocode}
990 % With the option `shiftedpstarts' a long pstart one the left side (or in the right side) doesn't make a blank on the corresponding pstart, but the blank is put on the bottom of the page. Consequently, the pstarts on the parallel pages are shifted, but the shift stops at every end of pages.
991 % The \cs{shiftedverses} is kept for backward compatibility.
992 % \begin{macro}{\ifshiftedpstarts}
993 % \begin{macrocode}
994 \newif\ifshiftedpstarts
995 \let\shiftedversestrue\shiftedpstartstrue
996 \let\shiftedversesfalse\shiftedpstartsfalse
997 \DeclareOption{shiftedverses}{\shiftedpstartstrue}
998 \DeclareOption{shiftedpstarts}{\shiftedpstartstrue}
999 % \end{macrocode}
1000 % \end{macro}
1001 % The \verb+parledgroup+ can be called either on \Eledmac or \Eledpar.
1002 % \begin{macrocode}
1003 \DeclareOption{parledgroup}{\parledgrouptrue}
1004 % \end{macrocode}
1005 % \begin{macro}{\ifwidthliketwocolumns}
1006 % The \cs{widthliketwocolumns} option can be called both in eledpar and eledmac.
1007 % \changes{v1.9.0}{2014/09/16}{Added widthliketwocolumns option}
1008 % \begin{macrocode}
1009 \DeclareOption{widthliketwocolumns}{\widthliketwocolumnstrue}%
1010 % \end{macrocode}
1011 % \end{macro}
1012 % \begin{macro}{\ifsameparallelpagenumber}
1013 % \begin{macrocode}
1014 \newif\ifsameparallelpagenumber%
1015 \DeclareOption{sameparallelpagenumber}{\sameparallelpagenumbertrue}%
1016 % \end{macrocode}
1017 % \end{macro}
1018 % \begin{macrocode}
1019 \ProcessOptions%
1020 % \end{macrocode}
1021 % As noted above, much of the code is a duplication of the original
1022 % \Eledmac{} code to handle the extra box(es) for the right hand side text,
1023 % and sometimes for the left hand side as well. In order to distinguish
1024 % we use `R' or `L' in the names of macros for the right and left code.
1025 % The specifics of `L' and `R' are normally hidden from the user by
1026 % letting the \verb?Leftside? and \verb?Rightside? environments set things
1027 % up appropriately.
1028 %
1029 % \begin{macro}{\ifl@dpairing}
1030 % \begin{macro}{\ifl@dpaging}
1031 % \begin{macro}{\ifledRcol}
1032 % \cs{ifl@dpairing} is set TRUE if we are processing parallel texts and
1033 % \cs{ifl@dpaging} is also set TRUE if we are doing parallel pages.
1034 % \cs{ifledRcol} is set TRUE if we are doing the right hand text.
1035 % They are defined in \Lpack{eledmac}.
1036 % \changes{v0.3.0}{2005/02/24}{Moved \cs{ifl@dpairing} to eledmac}
1037 % \changes{v0.9.0}{2005/10/01}{Moved \cs{iflledRcol} and \cs{ifnumberingR} to eledmac}
1038 % \changes{v1.9.1}{2014/09/30}{Moved \cs{ifl@dpaging} to eledmac}
1039 % \changes{v1.13.0}{2015/03/06}{Remove false boolean settings which are not needed.}
1040 % \begin{macrocode}
1041 % \end{macrocode}
1042 % \end{macro}
1043 % \end{macro}
1044 % \end{macro}
1045 %
1046 % \begin{macro}{\Lcolwidth}
1047 % \begin{macro}{\Rcolwidth}
1048 % The widths of the left and right parallel columns (or pages).
1049 % \begin{macrocode}
1050 \newdimen\Lcolwidth
1051 \Lcolwidth=0.45\textwidth
1052 \newdimen\Rcolwidth
1053 \Rcolwidth=0.45\textwidth
1054
1055 % \end{macrocode}
1056 % \end{macro}
1057 % \end{macro}
1058 %
1059 % \subsection{Messages}
1060 %
1061 % All the error and warning messages are collected here as macros.
1062 %
1063 % \begin{macro}{\eledpar@error}
1064 % \changes{v1.8.2}{2014/08/15}{Errors specific to eledpar send to eledpar handbook}
1065 % \begin{macrocode}
1066 \newcommand{\eledpar@error}[2]{\PackageError{eledpar}{#1}{#2}}
1067 % \end{macrocode}
1068 % \end{macro}
1069 % \begin{macro}{\led@err@TooManyPstarts}
1070 % \begin{macrocode}
1071 \newcommand*{\led@err@TooManyPstarts}{%
1072 \eledpar@error{Too many \string\pstart\space without printing.
1073 Some text will be lost}{\@ehc}}
1074 % \end{macrocode}
1075 % \end{macro}
1076 %
1077 % \begin{macro}{\led@err@BadLeftRightPstarts}
1078 % \begin{macrocode}
1079 \newcommand*{\led@err@BadLeftRightPstarts}[2]{%
1080 \eledpar@error{The numbers of left (#1) and right (#2)
1081 \string\pstart s do not match}{\@ehc}}
1082 % \end{macrocode}
1083 % \end{macro}
1084 %
1085 % \begin{macro}{\led@err@LeftOnRightPage}
1086 % \begin{macro}{\led@err@RightOnLeftPage}
1087 % \begin{macrocode}
1088 \newcommand*{\led@err@LeftOnRightPage}{%
1089 \eledpar@error{The left page has ended on a right page}{\@ehc}}
1090 \newcommand*{\led@err@RightOnLeftPage}{%
1091 \eledpar@error{The right page has ended on a left page}{\@ehc}}
1092 % \end{macrocode}
1093 % \end{macro}
1094 % \end{macro}
1095 %
1096 % \begin{macro}{\led@err@Leftside@PreviousNotPrinted}
1097 % \begin{macro}{\led@err@Rightside@PreviousNotPrinted}
1098 % \begin{macrocode}
1099 \newcommand*{\led@err@Leftside@PreviousNotPrinted}{%
1100 \eledpar@error{You call a new Leftside environment while the previous one has not been typeset by \string\Pages\space or \string\Columns}{\@ehc}}
1101 \newcommand*{\led@err@Rightside@PreviousNotPrinted}{%
1102 \eledpar@error{You call a new Rightside environment while the previous one has not been typeset by \string\Pages\space or \string\Columns}{\@ehc}}
1103 % \end{macrocode}
1104 % \end{macro}
1105 % \end{macro}
1106 % \begin{macro}{\led@err@Pages@InsideEnv}
1107 % \begin{macro}{\led@err@Columns@InsideEnv}
1108 % \begin{macrocode}
1109 \newcommand*{\led@err@Pages@InsideEnv}{%
1110 \eledpar@error{\string\Pages\space must be called *outside* of the `pages` environment}{\@ehc}}
1111 \newcommand*{\led@err@Columns@InsideEnv}{%
1112 \eledpar@error{\string\Columns\space must be called *outside* of the `pairs` environment}{\@ehc}}
1113 % \end{macrocode}
1114 % \end{macro}
1115 % \end{macro}
1116 %
1117 % \section{Sectioning commands}
1118 %
1119 % \begin{macro}{\section@numR}
1120 % This is the right side equivalent of \cs{section@num}.
1121 %
1122 % Each section will read and write an associated `line-list
1123 % file', containing information used to do the numbering. Normally
1124 % the file will be called \meta{jobname}\file{.nn}, where \file{nn} is the
1125 % section number. However, for right side texts the file is called
1126 % \meta{jobname}\file{.nnR}. The \cs{extensionchars} applies to the
1127 % right side files just as it does to the normal files.
1128 % \begin{macrocode}
1129 \newcount\section@numR
1130 \section@numR=\z@
1131 % \end{macrocode}
1132 % \end{macro}
1133 %
1134 %
1135 % \begin{macro}{\ifpst@rtedL}
1136 % \begin{macro}{\ifpst@rtedR}
1137 % \cs{ifpst@rtedL} is set FALSE at the start of left side numbering, and
1138 % similarly for \cs{ifpst@rtedR}.
1139 % \cs{ifpst@rtedL} is defined in \Lpack{eledmac}.
1140 % \changes{v0.3.0}{2005/02/24}{Moved \cs{ifpst@rtedL} to eledmac}
1141 % \begin{macrocode}
1142 \pst@rtedLfalse
1143 \newif\ifpst@rtedR
1144
1145 % \end{macrocode}
1146 % \end{macro}
1147 % \end{macro}
1148 %
1149 % \changes{v1.8.0}{2014/07/24}{\cs{beginnumbering} is defined only on \Lpack{eledmac}, not on \Lpack{eledpar}.}
1150 %
1151 % \begin{macro}{\beginnumberingR}
1152 % This is the right text equivalent of \cs{beginnumbering}, and begins
1153 % a section of numbered text.
1154 % \begin{macrocode}
1155 \newcommand*{\beginnumberingR}{%
1156 \ifnumberingR
1157 \led@err@NumberingStarted
1158 \endnumberingR
1159 \fi
1160 \global\l@dnumpstartsR \z@
1161 \global\pst@rtedRfalse
1162 \global\numberingRtrue
1163 \global\advance\section@numR \@ne
1164 \global\absline@numR \z@
1165 \gdef\normal@page@breakR{}
1166 \gdef\l@prev@pbR{}
1167 \gdef\l@prev@nopbR{}
1168 \global\line@numR \z@
1169 \global\@lockR \z@
1170 \global\sub@lockR \z@
1171 \global\sublines@false
1172 \global\let\next@page@numR\relax
1173 \global\let\sub@change\relax
1174 \message{Section \the\section@numR R }%
1175 \line@list@stuffR{\jobname.\extensionchars\the\section@numR R}%
1176 \l@dend@stuff
1177 \setcounter{pstartR}{1}
1178 \begingroup
1179 \initnumbering@sectcountR
1180 \gdef\eled@sectionsR@@{}%
1181 \if@noeled@sec\else%
1182 \makeatletter\InputIfFileExists{\jobname.eledsec\the\section@numR R}{}{}\makeatother%
1183 \immediate\openout\eled@sectioningR@out=\jobname.eledsec\the\section@numR R\relax%
1184 \fi%
1185 }
1186 % \end{macrocode}
1187 % \end{macro}
1188 %
1189 % \begin{macro}{\endnumbering}
1190 % This is the left text version of the regular \cs{endnumbering} and must
1191 % follow the last text for a left text numbered section.
1192 % It sets \cs{ifpst@rtedL} to FALSE. It is fully defined in \Lpack{eledmac}.
1193 % \end{macro}
1194 %
1195 % \begin{macro}{\endnumberingR}
1196 % This is the right text equivalent of \cs{endnumbering} and must follow the
1197 % last text for a right text numbered section.
1198 % \begin{macrocode}
1199 \def\endnumberingR{%
1200 \ifnumberingR
1201 \global\numberingRfalse
1202 \normal@pars
1203 \ifnum\l@dnumpstartsR=0%
1204 \led@err@NumberingWithoutPstart%
1205 \fi%
1206 \ifl@dpairing
1207 \global\pst@rtedRfalse
1208 \else
1209 \ifx\insertlines@listR\empty\else
1210 \global\noteschanged@true
1211 \fi
1212 \ifx\line@listR\empty\else
1213 \global\noteschanged@true
1214 \fi
1215 \fi
1216 \ifnoteschanged@
1217 \led@mess@NotesChanged
1218 \fi
1219 \else
1220 \led@err@NumberingNotStarted
1221 \fi
1222 \endgroup
1223 \if@noeled@sec\else%
1224 \immediate\closeout\eled@sectioningR@out%
1225 \fi%
1226 }
1227
1228 % \end{macrocode}
1229 % \end{macro}
1230 % \begin{macro}{\initnumbering@sectcountR}
1231 % \changes{v1.2.1}{2012/11/01}{For the right section, the counter is defined only once.}
1232 % We don't want the numbering of the right-side section commands to be continuous with the numbering of the left side,
1233 % we switch the \LaTeX\ counter in \cs{numberingR}.
1234 % \begin{macrocode}
1235 \newcounter{chapterR}
1236 \newcounter{sectionR}
1237 \newcounter{subsectionR}
1238 \newcounter{subsubsectionR}
1239 \newcommand{\initnumbering@sectcountR}{
1240 \let\c@chapter\c@chapterR
1241 \let\c@section\c@sectionR
1242 \let\c@subsection\c@subsectionR
1243 \let\c@subsubsection\c@subsubsectionR
1244 }
1245 % \end{macrocode}
1246 % \end{macro}
1247 %
1248 % \begin{macro}{\pausenumberingR}
1249 % \begin{macro}{\resumenumberingR}
1250 % These are the right text equivalents of \cs{pausenumbering} and
1251 % \cs{resumenumbering}.
1252 % \changes{v1.8.3}{2014/08/31}{Debug \cs{resumenumberingR}}
1253 % \begin{macrocode}
1254 \newcommand*{\pausenumberingR}{%
1255 \endnumberingR\global\numberingRtrue}
1256 \newcommand*{\resumenumberingR}{%
1257 \ifnumberingR
1258 \global\pst@rtedRtrue
1259 \global\advance\section@numR \@ne
1260 \led@mess@SectionContinued{\the\section@numR R}%
1261 \line@list@stuffR{\jobname.\extensionchars\the\section@numR R}%
1262 \l@dend@stuff
1263 \begingroup%
1264 \initnumbering@sectcountR%
1265 \else
1266 \led@err@numberingShouldHaveStarted
1267 \endnumberingR
1268 \beginnumberingR
1269 \fi}
1270
1271 % \end{macrocode}
1272 % \end{macro}
1273 % \end{macro}
1274 %
1275 % \begin{macro}{\memorydumpL}
1276 % \begin{macro}{\memorydumpR}
1277 % \cs{memorydump} is a shorthand for \cs{pausenumbering}\cs{resumenumbering}.
1278 % This will clear the memorised stuff for the previous chunks while
1279 % keeping the numbering going.
1280 % \begin{macrocode}
1281 \newcommand*{\memorydumpL}{%
1282 \endnumbering
1283 \numberingtrue
1284 \global\pst@rtedLtrue
1285 \global\advance\section@num \@ne
1286 \led@mess@SectionContinued{\the\section@num}%
1287 \line@list@stuff{\jobname.\extensionchars\the\section@num}%
1288 \l@dend@stuff}
1289 \newcommand*{\memorydumpR}{%
1290 \endnumberingR
1291 \numberingRtrue
1292 \global\pst@rtedRtrue
1293 \global\advance\section@numR \@ne
1294 \led@mess@SectionContinued{\the\section@numR R}%
1295 \line@list@stuffR{\jobname.\extensionchars\the\section@numR R}%
1296 \l@dend@stuff}
1297
1298 % \end{macrocode}
1299 % \end{macro}
1300 % \end{macro}
1301 %
1302 %
1303 %
1304 % \section{Line counting}
1305 % \label{lineation}\relax
1306 %
1307 % \subsection{Choosing the system of lineation}
1308 % \changes{v0.11.0}{2012/06/11}{Lineation can be by pstart (like in eledmac 0.15).}
1309 % \changes{v1.0.0}{2012/09/14}{Debug in lineation by pstart}
1310 % Sometimes you want line numbers that start at $1$ at the top of each
1311 % 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
1312 % of each section and increase regardless of page breaks.
1313 % \Eledpar{} lets you choose different schemes for the left and right texts.
1314 %
1315 % \begin{macro}{\ifbypstart@R}
1316 % \begin{macro}{\bypstart@Rtrue}
1317 % \begin{macro}{\bypstart@Rfalse}
1318 % \begin{macro}{\ifbypage@R}
1319 % \begin{macro}{\bypage@Rtrue}
1320 % \begin{macro}{\bypage@Rfalse}
1321 % The \cs{ifbypage@R} and \cs{ifbypstart@R} flag specifie the current lineation
1322 % system: \begin{itemize}
1323 % \item line-of-page : \verb|bypstart@R = false| and \verb|bypage@R = true|.
1324 % \item line-of-pstart : \verb|bypstart@R = true| and \verb|bypage@R = false|.
1325 % \end{itemize}
1326 % \Eledpar{} will use the line-of-section system unless instructed otherwise.
1327 % \begin{macrocode}
1328 \newif\ifbypage@R
1329 \newif\ifbypstart@R
1330 % \end{macrocode}
1331 % \end{macro}
1332 % \end{macro}
1333 % \end{macro}
1334 % \end{macro}
1335 % \end{macro}
1336 % \end{macro}
1337 %
1338 % \begin{macro}{\lineationR}
1339 % \cs{lineationR}\marg{word} is the macro used to select the
1340 % lineation system for right texts.
1341 % Its argument is a string: either \texttt{page}, \texttt{pstart} or \texttt{section}.
1342 % \changes{v1.15.0}{2015/04/13}{As \cs{lineation}, \cs{lineationR} automatically set the \cs{pstartinfootnote}.}
1343 % \begin{macrocode}
1344 \newcommand*{\lineationR}[1]{{%
1345 \ifnumbering
1346 \led@err@LineationInNumbered
1347 \else
1348 \def\@tempa{#1}\def\@tempb{page}%
1349 \ifx\@tempa\@tempb
1350 \global\bypage@Rtrue
1351 \global\bypstart@Rfalse
1352 \unless\ifnocritical@%
1353 \pstartinfootnote[][false]%
1354 \fi%
1355 \else
1356 \def\@tempb{pstart}%
1357 \ifx\@tempa\@tempb
1358 \global\bypage@Rfalse
1359 \global\bypstart@Rtrue
1360 \unless\ifnocritical@%
1361 \pstartinfootnote%
1362 \fi%
1363 \else
1364 \def@tempb{section}
1365 \ifx\@tempa\@tempb
1366 \global\bypage@Rfalse%
1367 \global\bypstart@Rfalse%
1368 \unless\ifnocritical@%
1369 \pstartinfootnote[][false]%
1370 \fi%
1371 \else
1372 \led@warn@BadLineation
1373 \fi%
1374 \fi
1375 \fi
1376 \fi}}
1377 % \end{macrocode}
1378 % \end{macro}
1379 %
1380 % \begin{macro}{\lineation*}
1381 % \changes{v1.8.2}{2014/08/15}{Add \cs{lineation*}}
1382 % \cs{lineation*} change the lineation system for the side.
1383 % \begin{macrocode}
1384 \WithSuffix\newcommand\lineation*[1]{%
1385 \lineation{#1}%
1386 \lineationR{#1}%
1387 }%
1388 % \end{macrocode}
1389 % \end{macro}
1390 % \begin{macro}{\linenummargin}
1391 % \begin{macro}{\line@marginR}
1392 % You call \cs{linenummargin}\marg{word} to specify which margin you want your
1393 % right text's line numbers in; it takes one argument, a string.
1394 % You can put the line numbers in the same margin on every page using
1395 % \texttt{left} or \texttt{right}; or you can use \texttt{inner} or
1396 % \texttt{outer} to get them in the inner or outer margins.
1397 % You can change this within a numbered section, but the
1398 % change may not take effect just when you'd like; if it's done between
1399 % paragraphs nothing surprising should happen.
1400 %
1401 % For right texts the selection is recorded in the count \cs{line@marginR},
1402 % otherwise in the count \cs{line@margin}:
1403 % $0$ for left, $1$ for right, $2$ for outer, and $3$ for inner.
1404 % \changes{v0.3.a}{2005/03/30}{Don't just set \cs{line@marginR} in \cs{linenummargin}}
1405 % \begin{macrocode}
1406 \newcount\line@marginR
1407 \renewcommand*{\linenummargin}[1]{{%
1408 \l@dgetline@margin{#1}%
1409 \ifnum\@l@dtempcntb>\m@ne
1410 \ifledRcol
1411 \global\line@marginR=\@l@dtempcntb
1412 \else
1413 \global\line@margin=\@l@dtempcntb
1414 \fi
1415 \fi}}
1416 % \end{macrocode}
1417 % By default put right text numbers at the right.
1418 % \begin{macrocode}
1419 \line@marginR=\@ne
1420
1421 % \end{macrocode}
1422 % \end{macro}
1423 % \end{macro}
1424 %
1425 % \begin{macro}{\c@firstlinenumR}
1426 % \begin{macro}{\c@linenumincrementR}
1427 % The following counters tell \Eledmac{} which right text lines should be
1428 % printed with line numbers. \texttt{firstlinenum} is the number of the
1429 % first line in each section that gets a number;
1430 % \texttt{linenumincrement}
1431 % is the difference between successive numbered lines. The initial
1432 % values of these counters produce labels on lines $5$, $10$, $15$, etc.
1433 % \texttt{linenumincrement} must be at least $1$.
1434 %
1435 % \begin{macrocode}
1436 \newcounter{firstlinenumR}
1437 \setcounter{firstlinenumR}{5}
1438 \newcounter{linenumincrementR}
1439 \setcounter{linenumincrementR}{5}
1440 % \end{macrocode}
1441 % \end{macro}
1442 % \end{macro}
1443 %
1444 % \begin{macro}{\c@firstsublinenumR}
1445 % \begin{macro}{\c@sublinenumincrementR}
1446 % The following parameters are just like \texttt{firstlinenumR} and
1447 % \texttt{linenumincrementR}, but for sub-line numbers.
1448 % \texttt{sublinenumincrementR} must be at least $1$.
1449 %
1450 % \begin{macrocode}
1451 \newcounter{firstsublinenumR}
1452 \setcounter{firstsublinenumR}{5}
1453 \newcounter{sublinenumincrementR}
1454 \setcounter{sublinenumincrementR}{5}
1455
1456 % \end{macrocode}
1457 % \end{macro}
1458 % \end{macro}
1459 %
1460 % \begin{macro}{\firstlinenum}
1461 % \begin{macro}{\linenumincrement}
1462 % \begin{macro}{\firstsublinenum}
1463 % \begin{macro}{\sublinenumincrement}
1464 % \begin{macro}{\firstlinenum*}
1465 % \begin{macro}{\linenumincrement*}
1466 % \begin{macro}{\firstsublinenum*}
1467 % \begin{macro}{\sublinenumincrement*}
1468 % \changes{v1.5.0}{2013/11/08}{Add starred version of \cs{firstlinenum}, \cs{linenumincrement}, \cs{firstsublinenum}, \cs{sublinenumincrement} to change both Left and Rightside.}
1469 % These are the user's macros for changing (sub) line numbers. They are
1470 % defined in \Lpack{eledmac} v0.7, but just in case
1471 % I have started by \cs{provide}ing them.
1472 % The starred versions are specifi to \Lpack{eledpar}.
1473 % \begin{macrocode}
1474 \providecommand*{\firstlinenum}{}
1475 \providecommand*{\linenumincrement}{}
1476 \providecommand*{\firstsublinenum}{}
1477 \providecommand*{\sublinenumincrement}{}
1478 \renewcommand*{\firstlinenum}[1]{%
1479 \ifledRcol \setcounter{firstlinenumR}{#1}%
1480 \else \setcounter{firstlinenum}{#1}%
1481 \fi}
1482 \renewcommand*{\linenumincrement}[1]{%
1483 \ifledRcol \setcounter{linenumincrementR}{#1}%
1484 \else \setcounter{linenumincrement}{#1}%
1485 \fi}
1486 \renewcommand*{\firstsublinenum}[1]{%
1487 \ifledRcol \setcounter{firstsublinenumR}{#1}%
1488 \else \setcounter{firstsublinenum}{#1}%
1489 \fi}
1490 \renewcommand*{\sublinenumincrement}[1]{%
1491 \ifledRcol \setcounter{sublinenumincrementR}{#1}%
1492 \else \setcounter{sublinenumincrement}{#1}%
1493 \fi}
1494 \WithSuffix\newcommand\firstlinenum*[1]{\setcounter{firstlinenumR}{#1}\setcounter{firstlinenum}{#1}}
1495 \WithSuffix\newcommand\linenumincrement*[1]{\setcounter{linenumincrementR}{#1}\setcounter{linenumincrement}{#1}}
1496 \WithSuffix\newcommand\firstsublinenum*[1]{\setcounter{subfirstlinenumR}{#1}\setcounter{subfirstlinenum}{#1}}
1497 \WithSuffix\newcommand\sublinenumincrement*[1]{\setcounter{sublinenumincrementR}{#1}\setcounter{sublinenumincrement}{#1}}
1498 % \end{macrocode}
1499 % \end{macro}
1500 % \end{macro}
1501 % \end{macro}
1502 % \end{macro}
1503 % \end{macro}
1504 % \end{macro}
1505 % \end{macro}
1506 % \end{macro}
1507 %
1508 % \begin{macro}{\Rlineflag}
1509 % This is appended to the line numbers of right text.
1510 % \begin{macrocode}
1511 \newcommand*{\Rlineflag}{R}
1512
1513 % \end{macrocode}
1514 % \end{macro}
1515 %
1516 % \begin{macro}{\linenumrepR}
1517 % \begin{macro}{\sublinenumrepR}
1518 % \cs{linenumrepR}\marg{ctr} typesets the right line number \meta{ctr}, and
1519 % similarly \cs{sublinenumrepR} for subline numbers.
1520 % \changes{v0.3.0}{2005/02/10}{Added \cs{linenumrepR} and \cs{sublinenumrepR}}
1521 % \begin{macrocode}
1522 \newcommand*{\linenumrepR}[1]{\@arabic{#1}}
1523 \newcommand*{\sublinenumrepR}[1]{\@arabic{#1}}
1524
1525 % \end{macrocode}
1526 % \end{macro}
1527 % \end{macro}
1528 %
1529 % \begin{macro}{\leftlinenumR}
1530 % \begin{macro}{\rightlinenumR}
1531 % \begin{macro}{\l@dlinenumR}
1532 % \cs{leftlinenumR} and \cs{rightlinenumR} are the macros that are
1533 % called to print the right text's marginal line numbers. Much of the
1534 % code for these is common and is maintained in \cs{l@dlinenumR}.
1535 % \changes{v0.3.0}{2005/02/10}{Simplified \cs{leftlinenumR} and
1536 % \cs{rightlinenumR} by introducing \cs{l@dlinenumR}}
1537 % \begin{macrocode}
1538 \newcommand*{\leftlinenumR}{%
1539 \l@dlinenumR
1540 \kern\linenumsep}
1541 \newcommand*{\rightlinenumR}{%
1542 \kern\linenumsep
1543 \l@dlinenumR}
1544 \newcommand*{\l@dlinenumR}{%
1545 \numlabfont\linenumrepR{\line@numR}\Rlineflag%
1546 \ifsublines@
1547 \ifnum\subline@num>\z@
1548 \unskip\fullstop\sublinenumrepR{\subline@numR}%
1549 \fi
1550 \fi}
1551
1552 % \end{macrocode}
1553 % \end{macro}
1554 % \end{macro}
1555 % \end{macro}
1556 %
1557 %
1558 % \subsection{Line-number counters and lists}
1559 % \subsubsection{Correspond to those in \Lpack{eledmac} for regular or left text}
1560 % We need another set of counters and lists for the right text,
1561 % corresponding to those in \Lpack{eledmac} for regular or left text.
1562 %
1563 % \begin{macro}{\line@numR}
1564 % \begin{macro}{\subline@numR}
1565 % \begin{macro}{\absline@numR}
1566 % The count \cs{line@numR} stores the line number that's used in
1567 % the right text's marginal line numbering and in notes.
1568 % The count \cs{subline@numR} stores
1569 % a sub-line number that qualifies \cs{line@numR}.
1570 % The count \cs{absline@numR} stores the
1571 % absolute number of lines since the start
1572 % of the right text section: that is, the number we've actually printed,
1573 % no matter what numbers we attached to them.
1574 %
1575 % \begin{macrocode}
1576 \newcount\line@numR
1577 \newcount\subline@numR
1578 \newcount\absline@numR
1579
1580 % \end{macrocode}
1581 % \end{macro}
1582 % \end{macro}
1583 % \end{macro}
1584 %
1585 % \begin{macro}{\line@listR}
1586 % \begin{macro}{\insertlines@listR}
1587 % \begin{macro}{\actionlines@listR}
1588 % \begin{macro}{\actions@listR}
1589 % Now we can define the list macros that will be created from the
1590 % line-list file. They are directly analagous to the left text ones.
1591 % The full list of action codes and their meanings is given in the \Eledmac{}
1592 % manual.
1593 %
1594 % Here are the commands to create these lists:
1595 %
1596 % \begin{macrocode}
1597 \list@create{\line@listR}
1598 \list@create{\insertlines@listR}
1599 \list@create{\actionlines@listR}
1600 \list@create{\actions@listR}
1601
1602 % \end{macrocode}
1603 % \end{macro}
1604 % \end{macro}
1605 % \end{macro}
1606 % \end{macro}
1607 %
1608 % \begin{macro}{\page@numR}
1609 % The right text page number.
1610 % \begin{macrocode}
1611 \newcount\page@numR
1612
1613 % \end{macrocode}
1614 % \end{macro}
1615 % \subsubsection{Specific to \Lpack{eledpar}}
1616 % \begin{macro}{\linesinpar@listL}
1617 % \begin{macro}{\linesinpar@listR}
1618 % \begin{macro}{\maxlinesinpar@list}
1619 % In order to synchonise left and right chunks in parallel processing
1620 % we need to know how many lines are in each left and right text chunk,
1621 % and the maximum of these for each pair of chunks.
1622 % \begin{macrocode}
1623 \list@create{\linesinpar@listL}
1624 \list@create{\linesinpar@listR}
1625 \list@create{\maxlinesinpar@list}
1626
1627 % \end{macrocode}
1628 % \end{macro}
1629 % \end{macro}
1630 % \end{macro}
1631 %
1632 %
1633 %
1634 % \subsection{Reading the line-list file}
1635 %
1636 %
1637 % \begin{macro}{\read@linelist}
1638 % \cs{read@linelist}\marg{file} is the control sequence
1639 % that's called by \cs{beginnumbering}
1640 % (via \cs{line@list@stuff}) to open and process a
1641 % line-list file; its argument is the name of the file.
1642 % \phantomsection\label{readlinelist}
1643 % \begin{macrocode}
1644 \renewcommand*{\read@linelist}[1]{%
1645 % \end{macrocode}
1646 % We do do different things depending whether or not we are processing
1647 % right text
1648 % \begin{macrocode}
1649 \ifledRcol
1650 \list@clear{\line@listR}%
1651 \list@clear{\insertlines@listR}%
1652 \list@clear{\actionlines@listR}%
1653 \list@clear{\actions@listR}%
1654 \list@clear{\linesinpar@listR}%
1655 \list@clear{\linesonpage@listR}
1656 \else
1657 \list@clearing@reg
1658 \list@clear{\linesinpar@listL}%
1659 \list@clear{\linesonpage@listL}%
1660 \fi
1661 % \end{macrocode}
1662 %
1663 % Make sure that the \cs{maxlinesinpar@list} is empty (otherwise things
1664 % will be thrown out of kilter if there is any old stuff still hanging
1665 % in there).
1666 % \begin{macrocode}
1667 \list@clear{\maxlinesinpar@list}
1668 % \end{macrocode}
1669 % Now get the file and interpret it.
1670 % \begin{macrocode}
1671 \get@linelistfile{#1}%
1672 \endgroup
1673 % \end{macrocode}
1674 %
1675 % When the reading is done, we're all through with the
1676 % line-list file. All the information we needed
1677 % from it will now be encoded in our list macros.
1678 % Finally, we
1679 % initialize the \cs{next@actionline} and \cs{next@action} macros,
1680 % which specify where and what the next action to be taken is.
1681 % \begin{macrocode}
1682 \ifledRcol
1683 \global\page@numR=\m@ne
1684 \ifx\actionlines@listR\empty
1685 \gdef\next@actionlineR{1000000}%
1686 \else
1687 \gl@p\actionlines@listR\to\next@actionlineR
1688 \gl@p\actions@listR\to\next@actionR
1689 \fi
1690 \else
1691 \global\page@num=\m@ne
1692 \ifx\actionlines@list\empty
1693 \gdef\next@actionline{1000000}%
1694 \else
1695 \gl@p\actionlines@list\to\next@actionline
1696 \gl@p\actions@list\to\next@action
1697 \fi
1698 \fi}
1699
1700 % \end{macrocode}
1701 % \end{macro}
1702 %
1703 % This version of \cs{read@linelist} creates list macros
1704 % containing data for the entire section, so they could get rather
1705 % large. The \cs{memorydump} macro is available if you run into
1706 % macro memory limitations.
1707 %
1708 % \subsection{Commands within the line-list file}
1709 %
1710 % This section defines the commands that can appear within a
1711 % line-list file, except for \cs{@lab} which is in a
1712 % later section among the cross-referencing commands it is
1713 % associated with.
1714 %
1715 % The macros with \verb"action" in their names contain all the code
1716 % that modifies the action-code list.
1717 % \begin{macro}{\@nl@regR}
1718 % \begin{macro}{\@nl}
1719 % \cs{@nl} does everything related to the start of a
1720 % new line of numbered text. Exactly what it does depends
1721 % on whether right text is being processed.
1722 %
1723 % \begin{macrocode}
1724 \newcommand{\@nl@regR}{%
1725 \ifx\l@dchset@num\relax \else
1726 \advance\absline@numR \@ne
1727 \set@line@action
1728 \let\l@dchset@num\relax
1729 \advance\absline@numR \m@ne
1730 \advance\line@numR \m@ne% % do we need this?
1731 \fi
1732 \advance\absline@numR \@ne
1733 \ifx\next@page@numR\relax \else
1734 \page@action
1735 \let\next@page@numR\relax
1736 \fi
1737 \ifx\sub@change\relax \else
1738 \ifnum\sub@change>\z@
1739 \sublines@true
1740 \else
1741 \sublines@false
1742 \fi
1743 \sub@action
1744 \let\sub@change\relax
1745 \fi
1746 \ifcase\@lockR
1747 \or
1748 \@lockR \tw@
1749 \or\or
1750 \@lockR \z@
1751 \fi
1752 \ifcase\sub@lockR
1753 \or
1754 \sub@lockR \tw@
1755 \or\or
1756 \sub@lockR \z@
1757 \fi
1758 \ifsublines@
1759 \ifnum\sub@lockR<\tw@
1760 \advance\subline@numR \@ne
1761 \fi
1762 \else
1763 \ifnum\@lockR<\tw@
1764 \advance\line@numR \@ne \subline@numR \z@
1765 \fi
1766 \fi}
1767
1768 \renewcommand*{\@nl}[2]{%
1769 \fix@page{#1}%
1770 \ifledRcol
1771 \@nl@regR
1772 \else
1773 \@nl@reg
1774 \fi}
1775
1776 % \end{macrocode}
1777 % \end{macro}
1778 % \end{macro}
1779 % \begin{macro}{\last@page@numR}
1780 % \begin{macro}{\fix@page}
1781 % We have to adjust \cs{fix@page} to handle parallel texts.
1782 %
1783 % \begin{macrocode}
1784 \newcount\last@page@numR
1785 \last@page@numR=-10000
1786 \renewcommand*{\fix@page}[1]{%
1787 \ifledRcol
1788 \ifnum #1=\last@page@numR
1789 \else
1790 \ifbypage@R
1791 \line@numR \z@ \subline@numR \z@
1792 \fi
1793 \page@numR=#1\relax
1794 \last@page@numR=#1\relax
1795 \def\next@page@numR{#1}%
1796 \fi
1797 \else
1798 \ifnum #1=\last@page@num
1799 \else
1800 \ifbypage@
1801 \line@num \z@ \subline@num \z@
1802 \fi
1803 \page@num=#1\relax
1804 \last@page@num=#1\relax
1805 \def\next@page@num{#1}%
1806 \listxadd{\normal@page@break}{\the\absline@num}
1807 \fi
1808 \fi}
1809
1810 % \end{macrocode}
1811 % \end{macro}
1812 % \end{macro}
1813 %
1814 %
1815 % \begin{macro}{\@adv}
1816 % The \cs{@adv}\marg{num} macro advances
1817 % the current visible line number by the amount specified as
1818 % its argument. This is used to implement \cs{advanceline}.
1819 % \begin{macrocode}
1820 \renewcommand*{\@adv}[1]{%
1821 \ifsublines@
1822 \ifledRcol
1823 \advance\subline@numR by #1\relax
1824 \ifnum\subline@numR<\z@
1825 \led@warn@BadAdvancelineSubline
1826 \subline@numR \z@
1827 \fi
1828 \else
1829 \advance\subline@num by #1\relax
1830 \ifnum\subline@num<\z@
1831 \led@warn@BadAdvancelineSubline
1832 \subline@num \z@
1833 \fi
1834 \fi
1835 \else
1836 \ifledRcol
1837 \advance\line@numR by #1\relax
1838 \ifnum\line@numR<\z@
1839 \led@warn@BadAdvancelineLine
1840 \line@numR \z@
1841 \fi
1842 \else
1843 \advance\line@num by #1\relax
1844 \ifnum\line@num<\z@
1845 \led@warn@BadAdvancelineLine
1846 \line@num \z@
1847 \fi
1848 \fi
1849 \fi
1850 \set@line@action}
1851
1852 % \end{macrocode}
1853 % \end{macro}
1854 %
1855 % \begin{macro}{\@set}
1856 % The \cs{@set}\marg{num} macro sets
1857 % the current visible line number to the value specified as
1858 % its argument. This is used to implement \cs{setline}.
1859 % \begin{macrocode}
1860 \renewcommand*{\@set}[1]{%
1861 \ifledRcol
1862 \ifsublines@
1863 \subline@numR=#1\relax
1864 \else
1865 \line@numR=#1\relax
1866 \fi
1867 \set@line@action
1868 \else
1869 \ifsublines@
1870 \subline@num=#1\relax
1871 \else
1872 \line@num=#1\relax
1873 \fi
1874 \set@line@action
1875 \fi}
1876
1877 % \end{macrocode}
1878 % \end{macro}
1879 %
1880 % \begin{macro}{\l@d@set}
1881 % \begin{macro}{\l@dchset@num}
1882 % The \cs{l@d@set}\marg{num} macro sets
1883 % the line number for the next \verb?\pstart...? to the value specified as
1884 % its argument. This is used to implement \cs{setlinenum}.
1885 %
1886 % \verb?\l@dchset@num? is a flag to the \verb?\@l? macro. If it is not
1887 % \verb?\relax? then a linenumber change is to be done.
1888 % \begin{macrocode}
1889 \renewcommand*{\l@d@set}[1]{%
1890 \ifledRcol
1891 \line@numR=#1\relax
1892 \advance\line@numR \@ne
1893 \def\l@dchset@num{#1}
1894 \else
1895 \line@num=#1\relax
1896 \advance\line@num \@ne
1897 \def\l@dchset@num{#1}
1898 \fi}
1899 \let\l@dchset@num\relax
1900
1901 % \end{macrocode}
1902 % \end{macro}
1903 % \end{macro}
1904 %
1905 % \begin{macro}{\page@action}
1906 % \cs{page@action}
1907 % adds an entry to the action-code list to change the page number.
1908 % \begin{macrocode}
1909 \renewcommand*{\page@action}{%
1910 \ifledRcol
1911 \xright@appenditem{\the\absline@numR}\to\actionlines@listR
1912 \xright@appenditem{\next@page@numR}\to\actions@listR
1913 \else
1914 \xright@appenditem{\the\absline@num}\to\actionlines@list
1915 \xright@appenditem{\next@page@num}\to\actions@list
1916 \fi}
1917 % \end{macrocode}
1918 % \end{macro}
1919 %
1920 % \begin{macro}{\set@line@action}
1921 % \cs{set@line@action} adds an entry to the action-code
1922 % list to change the visible line number.
1923 % \begin{macrocode}
1924 \renewcommand*{\set@line@action}{%
1925 \ifledRcol
1926 \xright@appenditem{\the\absline@numR}\to\actionlines@listR
1927 \ifsublines@
1928 \@l@dtempcnta=-\subline@numR
1929 \else
1930 \@l@dtempcnta=-\line@numR
1931 \fi
1932 \advance\@l@dtempcnta by -5000\relax
1933 \xright@appenditem{\the\@l@dtempcnta}\to\actions@listR
1934 \else
1935 \xright@appenditem{\the\absline@num}\to\actionlines@list
1936 \ifsublines@
1937 \@l@dtempcnta=-\subline@num
1938 \else
1939 \@l@dtempcnta=-\line@num
1940 \fi
1941 \advance\@l@dtempcnta by -5000\relax
1942 \xright@appenditem{\the\@l@dtempcnta}\to\actions@list
1943 \fi}
1944
1945 % \end{macrocode}
1946 % \end{macro}
1947 %
1948 % \begin{macro}{\sub@action}
1949 % \cs{sub@action}
1950 % adds an entry to the action-code list to turn sub-lineation on or
1951 % off, according to the current value of the \cs{ifsublines@} flag.
1952 % \begin{macrocode}
1953 \renewcommand*{\sub@action}{%
1954 \ifledRcol
1955 \xright@appenditem{\the\absline@numR}\to\actionlines@listR
1956 \ifsublines@
1957 \xright@appenditem{-1001}\to\actions@listR
1958 \else
1959 \xright@appenditem{-1002}\to\actions@listR
1960 \fi
1961 \else
1962 \xright@appenditem{\the\absline@num}\to\actionlines@list
1963 \ifsublines@
1964 \xright@appenditem{-1001}\to\actions@list
1965 \else
1966 \xright@appenditem{-1002}\to\actions@list
1967 \fi
1968 \fi}
1969
1970 % \end{macrocode}
1971 % \end{macro}
1972 %
1973 % \begin{macro}{\do@lockon}
1974 % \begin{macro}{\do@lockonR}
1975 % \cs{lock@on}
1976 % adds an entry to the action-code list to turn line number
1977 % locking on. The current setting of the sub-lineation flag tells us
1978 % whether this applies to line numbers or sub-line numbers.
1979 % \begin{macrocode}
1980 \newcount\@lockR
1981 \newcount\sub@lockR
1982
1983 \newcommand*{\do@lockonR}{%
1984 \xright@appenditem{\the\absline@numR}\to\actionlines@listR
1985 \ifsublines@
1986 \xright@appenditem{-1005}\to\actions@listR
1987 \ifnum\sub@lockR=\z@
1988 \sub@lockR \@ne
1989 \else
1990 \ifnum\sub@lockR=\thr@@
1991 \sub@lockR \@ne
1992 \fi
1993 \fi
1994 \else
1995 \xright@appenditem{-1003}\to\actions@listR
1996 \ifnum\@lockR=\z@
1997 \@lockR \@ne
1998 \else
1999 \ifnum\@lockR=\thr@@
2000 \@lockR \@ne
2001 \fi
2002 \fi
2003 \fi}
2004
2005 \renewcommand*{\do@lockon}{%
2006 \ifx\next\lock@off
2007 \global\let\lock@off=\skip@lockoff
2008 \else
2009 \ifledRcol
2010 \do@lockonR
2011 \else
2012 \do@lockonL
2013 \fi
2014 \fi}
2015 % \end{macrocode}
2016 % \end{macro}
2017 % \end{macro}
2018 %
2019 % \begin{macro}{\lock@off}
2020 % \begin{macro}{\do@lockoff}
2021 % \begin{macro}{\do@lockoffR}
2022 % \begin{macro}{\skip@lockoff}
2023 % \cs{lock@off} adds an entry to the action-code list
2024 % to turn line number locking off.
2025 % \begin{macrocode}
2026
2027
2028 \newcommand{\do@lockoffR}{%
2029 \xright@appenditem{\the\absline@numR}\to\actionlines@listR
2030 \ifsublines@
2031 \xright@appenditem{-1006}\to\actions@listR
2032 \ifnum\sub@lockR=\tw@
2033 \sub@lockR \thr@@
2034 \else
2035 \sub@lockR \z@
2036 \fi
2037 \else
2038 \xright@appenditem{-1004}\to\actions@listR
2039 \ifnum\@lockR=\tw@
2040 \@lockR \thr@@
2041 \else
2042 \@lockR \z@
2043 \fi
2044 \fi}
2045
2046 \renewcommand*{\do@lockoff}{%
2047 \ifledRcol
2048 \do@lockoffR
2049 \else
2050 \do@lockoffL
2051 \fi}
2052 \global\let\lock@off=\do@lockoff
2053
2054 % \end{macrocode}
2055 % \end{macro}
2056 % \end{macro}
2057 % \end{macro}
2058 % \end{macro}
2059 %
2060 % \begin{macro}{\n@num}
2061 % \changes{v1.15.0}{2015/04/13}{\cs{n@num} defined only one time for both \Eledmac{} and \Eledpar{}.}
2062 % \end{macro}
2063 %
2064 % \begin{macro}{\@ref}
2065 % \begin{macro}{\insert@countR}
2066 % \cs{@ref}
2067 % marks the start of a passage, for creation of a footnote reference.
2068 % It takes two arguments:
2069 % \begin{itemize}\addtolength{\itemsep}{-1ex}
2070 % \item \verb"#1", the number of entries to add to \cs{insertlines@list}
2071 % for this reference. \SpecialMainIndex{\insert@count}
2072 % This value for right text, here and within \cs{edtext},
2073 % which computes it and writes it to the line-list file,
2074 % will be stored in the count \cs{insert@countR}.
2075 % \begin{macrocode}
2076 \newcount\insert@countR
2077 % \end{macrocode}
2078 %
2079 % \item \verb"#2", a sequence of other line-list-file commands, executed to
2080 % determine the ending line-number. (This may also include other
2081 % \cs{@ref} commands, corresponding to uses of \cs{edtext}
2082 % within the first argument of another instance of \cs{edtext}.)
2083 % \end{itemize}
2084 %
2085 % The first thing \cs{@ref} itself does is to add the specified number
2086 % of items to the \cs{insertlines@list} list.
2087 % \begin{macrocode}
2088 \renewcommand*{\@ref}[2]{%
2089 \ifledRcol
2090 \global\advance\@edtext@level by 1%
2091 \global\insert@countR=#1\relax
2092 \loop\ifnum\insert@countR>\z@
2093 \xright@appenditem{\the\absline@numR}\to\insertlines@listR
2094 \global\advance\insert@countR \m@ne
2095 \repeat
2096 % \end{macrocode}
2097 %
2098 % Next, process the second argument to determine the page
2099 % and line numbers for the end of this lemma.
2100 % We temporarily equate \cs{@ref} to a different macro that just executes
2101 % its argument, so that nested \cs{@ref} commands are just skipped
2102 % this time. Some other macros need to be temporarily redefined to
2103 % suppress their action.
2104 % \begin{macrocode}
2105 \begingroup
2106 \let\@ref=\dummy@ref
2107 \let\@lopR\@gobble
2108 \let\page@action=\relax
2109 \let\sub@action=\relax
2110 \let\set@line@action=\relax
2111 \let\@lab=\relax
2112 \let\@lemma=\relax
2113 \let\@sw\@gobblethree%
2114 #2
2115 \global\endpage@num=\page@numR
2116 \global\endline@num=\line@numR
2117 \global\endsubline@num=\subline@numR
2118 \endgroup
2119 % \end{macrocode}
2120 %
2121 % Now store all the information about the location of the lemma's
2122 % start and end in \cs{line@list}.
2123 % \begin{macrocode}
2124 \xright@appenditem%
2125 {\the\page@numR|\the\line@numR|%
2126 \ifsublines@ \the\subline@numR \else 0\fi|%
2127 \the\endpage@num|\the\endline@num|%
2128 \ifsublines@ \the\endsubline@num \else 0\fi}\to\line@listR
2129 % \end{macrocode}
2130 % Create a list which will store all the second argument of each \cs{@sw}
2131 % in this lemma, at this level.
2132 % \begin{macrocode}
2133 \expandafter\list@create\expandafter{\csname sw@list@edtext@tmp@\the\@edtext@level\endcsname}%
2134 % \end{macrocode}
2135 % Declare and init boolean for lemma in this level.
2136 % \begin{macrocode}
2137 \providebool{lemmacommand@\the\@edtext@level}%
2138 \boolfalse{lemmacommand@\the\@edtext@level}%
2139 % \end{macrocode}
2140 % Execute the second argument of \cs{@ref} again,
2141 % to perform for real all the commands within it.
2142 % \begin{macrocode}
2143 #2
2144 % Now, we store the list of \cs{@sw} of this current \cs{edtext} as an element of
2145 % the global list of list of \cs{@sw} for a \cs{edtext} depth.
2146 % \begin{macrocode}
2147 \ifnum\@edtext@level>0%
2148 \def\create@this@edtext@level{\expandafter\list@create\expandafter{\csname sw@list@edtextR@\the\@edtext@level\endcsname}}%
2149 \ifcsundef{sw@list@edtextR@\the\@edtext@level}{\create@this@edtext@level}{}%
2150 \letcs{\@tmp}{sw@list@edtextR@\the\@edtext@level}%
2151 \letcs{\@tmpp}{sw@list@edtext@tmp@\the\@edtext@level}%
2152 \xright@appenditem{\expandonce\@tmpp}\to\@tmp%
2153 \global\cslet{sw@list@edtextR@\the\@edtext@level}{\@tmp}%
2154 \fi%
2155 % \end{macrocode}
2156 % Decrease edtext level counter.
2157 % \begin{macrocode}
2158 \global\advance\@edtext@level by -1%
2159 % \end{macrocode}
2160 % \begin{macrocode}
2161 \else
2162 % \end{macrocode}
2163 % And when not in right text
2164 % \begin{macrocode}
2165 \@ref@reg{#1}{#2}%
2166 \fi}
2167 % \end{macrocode}
2168 % \end{macro}
2169 % \end{macro}
2170 %
2171 % \begin{macro}{\@pend}
2172 % \begin{macro}{\@pendR}
2173 % \cs{@pend}\marg{num} adds its argument to the \cs{linesinpar@listL}
2174 % list, and analagously for \cs{@pendR}. If needed, it resets line number. We start off with a
2175 % \cs{providecommand} just in case an older version of \Eledmac{} is being
2176 % used which does not define these macros.
2177 % \begin{macrocode}
2178 \providecommand*{\@pend}[1]{}
2179 \renewcommand*{\@pend}[1]{%
2180 \ifbypstart@\global\line@num=0\fi%
2181 \xright@appenditem{#1}\to\linesinpar@listL}
2182 \providecommand*{\@pendR}[1]{}
2183 \renewcommand*{\@pendR}[1]{%
2184 \ifbypstart@R\global\line@numR=0\fi
2185 \xright@appenditem{#1}\to\linesinpar@listR}
2186
2187 % \end{macrocode}
2188 % \end{macro}
2189 % \end{macro}
2190 %
2191 % \begin{macro}{\@lopL}
2192 % \begin{macro}{\@lopR}
2193 % \cs{@lopL}\marg{num} adds its argument to the \cs{linesonpage@listL}
2194 % list, and analagously for \cs{@lopR}. We start off with a
2195 % \cs{providecommand} just in case an older version of \Eledmac{} is being
2196 % used which does not define these macros.
2197 % \begin{macrocode}
2198 \providecommand*{\@lopL}[1]{}
2199 \renewcommand*{\@lopL}[1]{%
2200 \xright@appenditem{#1}\to\linesonpage@listL}
2201 \providecommand*{\@lopR}[1]{}
2202 \renewcommand*{\@lopR}[1]{%
2203 \xright@appenditem{#1}\to\linesonpage@listR}
2204
2205 % \end{macrocode}
2206 % \end{macro}
2207 % \end{macro}
2208 %
2209 % \subsection{Writing to the line-list file}
2210 %
2211 % We've now defined all the counters, lists, and commands involved in
2212 % reading the line-list file at the start of a section. Now we'll
2213 % cover the commands that \Eledmac{} uses within the text of a
2214 % section to write commands out to the line-list.
2215 %
2216 % \begin{macro}{\linenum@outR}
2217 % The file for right texts will be opened on output stream \cs{linenum@outR}.
2218 % \begin{macrocode}
2219 \newwrite\linenum@outR
2220 % \end{macrocode}
2221 % \end{macro}
2222 %
2223 % \begin{macro}{\iffirst@linenum@out@R}
2224 % \begin{macro}{\first@linenum@out@Rtrue}
2225 % \begin{macro}{\first@linenum@out@Rfalse}
2226 % Once any file is opened on this stream, we keep it open forever, or
2227 % else switch to another file that we keep open.
2228 % \begin{macrocode}
2229 \newif\iffirst@linenum@out@R
2230 \first@linenum@out@Rtrue
2231 % \end{macrocode}
2232 % \end{macro}
2233 % \end{macro}
2234 % \end{macro}
2235 %
2236 % \begin{macro}{\line@list@stuffR}
2237 % This is the right text version of the \cs{line@list@stuff}\marg{file}
2238 % macro. It is called by \cs{beginnumberingR} and performs
2239 % all the line-list operations needed at the start of a section.
2240 % Its argument is the name of the line-list file.
2241 % \changes{v1.10.1}{2015/01/16}{Revert modification of 1.4.2, which makes bugs with numbering. Leave vertical mode to solve spurious space before minipage.}
2242 % \begin{macrocode}
2243 \newcommand*{\line@list@stuffR}[1]{%
2244 \read@linelist{#1}%
2245 \iffirst@linenum@out@R
2246 \immediate\closeout\linenum@outR
2247 \global\first@linenum@out@Rfalse
2248 \immediate\openout\linenum@outR=#1
2249 \immediate\write\linenum@outR{\string\line@list@version{\this@line@list@version}}%
2250 \else
2251 \if@minipage%
2252 \leavevmode%
2253 \fi%
2254 \closeout\linenum@outR%
2255 \openout\linenum@outR=#1%
2256 \fi}
2257
2258 % \end{macrocode}
2259 % \end{macro}
2260 %
2261 % \begin{macro}{\new@lineL}
2262 % The \cs{new@lineL} macro sends the \cs{@nl} command to the left text
2263 % line-list file, to mark the start of a new text line.
2264 % \begin{macrocode}
2265 \newcommand*{\new@lineL}{%
2266 \write\linenum@out{\string\@nl[\the\c@page][\thepage]}}
2267 % \end{macrocode}
2268 % \end{macro}
2269 % \begin{macro}{\new@lineR}
2270 % The \cs{new@lineR} macro sends the \cs{@nl} command to the right text
2271 % line-list file, to mark the start of a new text line.
2272 % \begin{macrocode}
2273 \newcommand*{\new@lineR}{%
2274 \write\linenum@outR{\string\@nl[\the\c@page][\thepage]}}
2275 % \end{macrocode}
2276 % \end{macro}
2277 %
2278 % \begin{macro}{\flag@start}
2279 % \begin{macro}{\flag@end}
2280 % We enclose a lemma marked by \cs{edtext} in
2281 % \cs{flag@start} and \cs{flag@end}: these send the \cs{@ref}
2282 % command to the line-list file.
2283 % \changes{v0.3.0}{2005/02/04}{Removed extraneous spaces from\cs{flag@end}}
2284 % \changes{v1.8.2}{2014/08/15}{\cs{flag@start} and \cs{flag@end} are now defined only one time for eledmac and eledpar}
2285 % \end{macro}
2286 % \end{macro}
2287 %
2288 % \begin{macro}{\startsub}
2289 % \begin{macro}{\endsub}
2290 % \cs{startsub} and \cs{endsub}
2291 % turn sub-lineation on and off, by writing
2292 % appropriate instructions to the line-list file.
2293 % \begin{macrocode}
2294 \renewcommand*{\startsub}{\dimen0\lastskip
2295 \ifdim\dimen0>0pt \unskip \fi
2296 \ifledRcol \write\linenum@outR{\string\sub@on}%
2297 \else \write\linenum@out{\string\sub@on}%
2298 \fi
2299 \ifdim\dimen0>0pt \hskip\dimen0 \fi}
2300 \def\endsub{\dimen0\lastskip
2301 \ifdim\dimen0>0pt \unskip \fi
2302 \ifledRcol \write\linenum@outR{\string\sub@off}%
2303 \else \write\linenum@out{\string\sub@off}%
2304 \fi
2305 \ifdim\dimen0>0pt \hskip\dimen0 \fi}
2306
2307 % \end{macrocode}
2308 % \end{macro}
2309 % \end{macro}
2310 %
2311 % \begin{macro}{\advanceline}
2312 % You can use \cs{advanceline}\marg{num}
2313 % in running text to advance the current visible
2314 % line-number by a specified value, positive or negative.
2315 % \begin{macrocode}
2316 \renewcommand*{\advanceline}[1]{%
2317 \ifledRcol \write\linenum@outR{\string\@adv[#1]}%
2318 \else \write\linenum@out{\string\@adv[#1]}%
2319 \fi}
2320 % \end{macrocode}
2321 % \end{macro}
2322 %
2323 % \begin{macro}{\setline}
2324 % You can use \cs{setline}\marg{num}
2325 % in running text (i.e., within \verb?\pstart...\pend?) to set the
2326 % current visible
2327 % line-number to a specified positive value.
2328 % \begin{macrocode}
2329 \renewcommand*{\setline}[1]{%
2330 \ifnum#1<\z@
2331 \led@warn@BadSetline
2332 \else
2333 \ifledRcol \write\linenum@outR{\string\@set[#1]}%
2334 \else \write\linenum@out{\string\@set[#1]}%
2335 \fi
2336 \fi}
2337 % \end{macrocode}
2338 % \end{macro}
2339 %
2340 % \begin{macro}{\setlinenum}
2341 % You can use \cs{setlinenum}\marg{num}
2342 % before a \verb?\pstart? to set the visible line-number to a specified
2343 % positive value. It writes a \verb?\l@d@set? command to the line-list file.
2344 % \begin{macrocode}
2345 \renewcommand*{\setlinenum}[1]{%
2346 \ifnum#1<\z@
2347 \led@warn@BadSetlinenum
2348 \else
2349 \ifledRcol \write\linenum@outR{\string\l@d@set[#1]}
2350 \else \write\linenum@out{\string\l@d@set[#1]} \fi
2351 \fi}
2352
2353 % \end{macrocode}
2354 % \end{macro}
2355 %
2356 % \begin{macro}{\startlock}
2357 % \begin{macro}{\endlock}
2358 % You can use \cs{startlock} or \cs{endlock}
2359 % in running text to start or end line number locking at
2360 % the current line. They decide whether line numbers or sub-line numbers
2361 % are affected, depending on the current state of the sub-lineation flags.
2362 % \begin{macrocode}
2363 \renewcommand*{\startlock}{%
2364 \ifledRcol \write\linenum@outR{\string\lock@on}%
2365 \else \write\linenum@out{\string\lock@on}%
2366 \fi}
2367 \def\endlock{%
2368 \ifledRcol \write\linenum@outR{\string\lock@off}%
2369 \else \write\linenum@out{\string\lock@off}%
2370 \fi}
2371
2372 % \end{macrocode}
2373 % \end{macro}
2374 % \end{macro}
2375 %
2376 % \begin{macro}{\skipnumbering}
2377 % \changes{v1.15.0}{2015/04/13}{\cs{skipnumbering} defined only one time for both \Eledmac{} and \Eledpar{}}
2378 % \end{macro}
2379 %
2380 %
2381 % \section{Marking text for notes}
2382 % \label{text}\relax
2383 %
2384 % The \cs{edtext} (or \cs{critext}) macro is used to create all
2385 % footnotes and endnotes,
2386 % as well as to print the portion of the main text to which a given note
2387 % or notes is keyed. The idea is to have that lemma appear only once in
2388 % the \file{.tex} file: all instances of it in the main text and in the
2389 % notes are copied from that one appearance.
2390 %
2391 % \cs{critext} requires two arguments. At any point within numbered
2392 % text, you use it by saying:
2393 % \begin{verbatim}
2394 % \critext{#1}#2/
2395 % \end{verbatim}
2396 % Similarly \cs{edtext} requires the same two arguments
2397 % but you use it by saying:
2398 % \begin{verbatim}
2399 % \edtext{#1}{#2}
2400 % \end{verbatim}
2401 %
2402
2403 % \begin{macro}{\critext}
2404 % \begin{macro}{\edtext}
2405 % \changes{v1.3.0}{2012/11/16}{Manage RTL language.}
2406 % \changes{v1.11.0}{2014/01/22}{\cs{critext} and \cs{edtext} are now defined only in eledmac.}
2407 % And similarly for \cs{edtext}.
2408 % \end{macro}
2409 % \end{macro}
2410 %
2411 % \begin{macro}{\set@line}
2412 % The \cs{set@line} macro
2413 % is called by \cs{edtext} to put the line-reference field and
2414 % font specifier for the current block of text into \cs{l@d@nums}.
2415 % \begin{macrocode}
2416 \renewcommand*{\set@line}{%
2417 \ifledRcol
2418 \ifx\line@listR\empty
2419 \global\noteschanged@true
2420 \xdef\l@d@nums{000|000|000|000|000|000|\edfont@info}%
2421 \else
2422 \gl@p\line@listR\to\@tempb
2423 \xdef\l@d@nums{\@tempb|\edfont@info}%
2424 \global\let\@tempb=\undefined
2425 \fi
2426 \else
2427 \ifx\line@list\empty
2428 \global\noteschanged@true
2429 \xdef\l@d@nums{000|000|000|000|000|000|\edfont@info}%
2430 \else
2431 \gl@p\line@list\to\@tempb
2432 \xdef\l@d@nums{\@tempb|\edfont@info}%
2433 \global\let\@tempb=\undefined
2434 \fi
2435 \fi}
2436
2437 % \end{macrocode}
2438 % \end{macro}
2439 % \subsection{Specific hooks and commands for notes}
2440 % The \Lpack{eledmac} \cs{newseries@} initalizes commands which are linked to notes series.
2441 % However, to keep \Lpack{eledmac} as light as possible, it does not define commands which are specific to \Lpack{eledpar}.
2442 % This is what does \cs{newseries@eledpar}. The specific hooks are also defined here.
2443 % \begin{macro}{\newseries@eledpar}
2444 % \begin{macrocode}
2445 \newcommand{\newseries@eledpar}[1]{%
2446 % \end{macrocode}
2447 % \subsubsection{Notes to be printed on one side only}
2448 % \Lpack{eledpar} allows notes to be printed on one side only.
2449 % We need to declare these options.
2450 % We also need boolean flags, and to set them to true when a note series is not printed on one side.
2451 % We check the \verb+nofamiliar+ and \verb+nocritical+ \Eledmac{} options.
2452 % \changes{v1.16.0}{2015/05/18}{Fix bug with \cs{onlysideX}.}
2453 % \begin{macrocode}
2454 \unless\ifnofamiliar@%
2455 \csgdef{onlysideX@#1}{}%
2456 \global\newbool{keepforsideX@#1}%
2457 \fi%
2458 \unless\ifnocritical@%
2459 \global\newbool{keepforXside@#1}%
2460 \csgdef{onlyXside@#1}{}%
2461 \fi%
2462 % \end{macrocode}
2463 % \subsubsection{Familiar footnotes without marks}
2464 % The \cs{footnoteXnomk} commands are for notes which are printed on the left side, while they are called in the right side.
2465 % Basically, they set first toggle \cs{nomark@} to true, then call the \cs{footnoteX}.
2466 % and finally add the footnote counter in the footnote counter list.
2467 %
2468 % First, check the \verb+nofamiliar+ option of \Eledmac{}
2469 % \begin{macrocode}
2470 \unless\ifnofamiliar@%
2471 % So declare the list.
2472 % \begin{macrocode}
2473 \expandafter\list@create\csname footnote#1@mk\endcsname%
2474 % \end{macrocode}
2475 % Then, declare the \cs{footnoteXnomk} command.
2476 % \begin{macrocode}
2477 \expandafter\newcommand\csname footnote#1nomk\endcsname[1]{%
2478 % \end{macrocode}
2479 % First step: just call the normal \cs{footnoteX}, saying that we don't want to print the mark.
2480 % \begin{macrocode}
2481 \toggletrue{nomk@}%
2482 \csuse{footnote#1}{##1}%
2483 \togglefalse{nomk@}%
2484 % \end{macrocode}
2485 % Second, and last, step: store the footnote counter in the footnote counters list.
2486 % We use some \cs{let}, because \cs{xright@appenditem} is difficult to use with \cs{expandafter}.
2487 % \begin{macrocode}
2488 \letcs{\@tmp}{footnote#1@mk}%
2489 \numdef\@tmpa{\csuse{c@footnote#1}}%
2490 \global\xright@appenditem{\@tmpa}\to\@tmp%
2491 \global\cslet{footnote#1@mk}{\@tmp}%
2492 }%
2493 % \end{macrocode}
2494 % Then, declare the command which inserts the footnotemark in the right side.
2495 % \begin{macrocode}
2496 \expandafter\newcommand\csname footnote#1mk\endcsname{%
2497 % \end{macrocode}
2498 % Get the first element of the footnote mark list.
2499 % As \cs{gl@p} is difficult to use with dynamic name macro, we use \cs{let} commands.
2500 % \begin{macrocode}
2501 \letcs{\@tmp}{footnote#1@mk}%
2502 \gl@p\@tmp\to\@tmpa%
2503 \global\cslet{footnote#1@mk}{\@tmp}%
2504 % \end{macrocode}
2505 % Set the footnotecounter with it.
2506 % For the sake of security, we make a backup of the previous value.
2507 % \begin{macrocode}
2508 \letcs{\old@footnote}{c@footnote#1}%
2509 \setcounter{footnote#1}{\@tmpa}%
2510 % \end{macrocode}
2511 % Define the footnote mark and print it
2512 % \begin{macrocode}
2513 \protected@csxdef{@thefnmark#1}{\csuse{thefootnote#1}}%
2514 \csuse{@footnotemark#1}%
2515 % \end{macrocode}
2516 % Restore previous footnote counter and finally add space.
2517 % \begin{macrocode}
2518 \setcounter{footnote#1}{\old@footnote}%
2519 \xspace%
2520 }%
2521 % \end{macrocode}
2522 % End of tools for familiar notes without marks
2523 % \begin{macrocode}
2524 \fi
2525 % \end{macrocode}
2526 % End of \cs{newseries@eledpar}.
2527 % \begin{macrocode}
2528 }%
2529 % \end{macrocode}
2530 % \end{macro}
2531 % \subsubsection{Create hooks}
2532 % Read the eledmac code handbook about \cs{newhookcommand@series}.
2533 % Here, we create hooks which are specific to \Lpack{eledpar}.
2534 % \begin{macrocode}
2535 \unless\ifnocritical@%
2536 \newhookcommand@series{onlyXside}%
2537 \fi%
2538 \unless\ifnofamiliar@%
2539 \newhookcommand@series{onlysideX}%
2540 \fi
2541
2542
2543 % \end{macrocode}
2544 % \subsubsection{Init standards series (A,B,C,D,E,Z)}
2545 % \begin{macro}{\init@series@eledpar}
2546 % \cs{newseries@eledpar} is called by \cs{newseries@}.
2547 % However, this command is called before \Lpack{eledpar} is loaded.
2548 % Thus, we need to initiate a specific series hook for eledpar.
2549 % \begin{macrocode}
2550 \newcommand{\init@series@eledpar}{%
2551 \def\do##1{\newseries@eledpar{##1}}%
2552 \dolistloop{\@series}%
2553 }%
2554 \init@series@eledpar%
2555 % \end{macrocode}
2556 % \end{macro}
2557 % \section{Pstart numbers dumping and restoration}
2558 % While in \Lpack{eledmac} the footnotes are inserted in the same time as the \cs{pstart} …\cs{pend} are read, in \Lpack{eledpar} they are inserted when the \cs{Columns} or \cs{Pages} commands are called.
2559 % Consequently, if we do nothing, the value of the PstartL and PstartR counters are not the same in the main text and in the notes.
2560 % To solve this problem, we dump the values in two list (one by side) when processing \cs{pstart} and restore these at each \cs{pstart} when calling \cs{Columns} or \cs{Pages}.
2561 % We also dump and restore the value of the boolean \cs{ifnumberpstart}.
2562
2563 % So, first step, creating the lists.
2564 % Here, ``pc'' means ``public counters''.
2565 % \begin{macro}{\list@pstartL@pc}
2566 % \begin{macro}{\list@pstartR@pc}
2567 % \begin{macrocode}
2568 \list@create{\list@pstartL@pc}%
2569 \list@create{\list@pstartR@pc}%
2570 % \end{macrocode}
2571 % \end{macro}
2572 % \end{macro}
2573 % Two commands to dump current pstarts.
2574 % We prefer two commands to one with argument indicating the side,
2575 % because the commands are short, and so we save one test (or a \cs{csname} construction).
2576 % \begin{macro}{\dump@pstartL@pc}
2577 % \begin{macro}{\dump@pstartR@pc}
2578 % \begin{macrocode}
2579 \def\dump@pstartL@pc{%
2580 \xright@appenditem{\the\c@pstartL}\to\list@pstartL@pc%
2581 \global\cslet{numberpstart@L\the\l@dnumpstartsL}{\ifnumberpstart}%
2582 }%
2583
2584 \def\dump@pstartR@pc{%
2585 \xright@appenditem{\the\c@pstartR}\to\list@pstartR@pc%
2586 \global\cslet{numberpstart@R\the\l@dnumpstartsR}{\ifnumberpstart}%
2587 }%
2588
2589 % \end{macrocode}
2590 % \end{macro}
2591 % \end{macro}
2592 % \begin{macro}{\restore@pstartL@pc}
2593 % \begin{macro}{\restore@pstartR@pc}
2594 % And so, the commands to restore them
2595 % \begin{macrocode}
2596 \def\restore@pstartL@pc{%
2597 \ifx\list@pstartL@pc\empty\else%
2598 \gl@p\list@pstartL@pc\to\@temp%
2599 \global\c@pstartL=\@temp%
2600 \fi%
2601 }%
2602 \def\restore@pstartR@pc{%
2603 \ifx\list@pstartR@pc\empty\else%
2604 \gl@p\list@pstartR@pc\to\@temp%
2605 \global\c@pstartR=\@temp%
2606 \fi%
2607 }%
2608 % \end{macrocode}
2609 % \end{macro}
2610 % \end{macro}
2611 % \section{Parallel environments}
2612 %
2613 % The initial set up for parallel processing is deceptively simple.
2614 %
2615 %
2616 % \begin{environment}{pairs}
2617 % \begin{environment}{pages}
2618 % \begin{macro}{chapterinpages}
2619 % The \verb?pairs? environment is for parallel columns and the \verb?pages?
2620 % environment for parallel pages.
2621 % \begin{macrocode}
2622 \newenvironment{pairs}{%}
2623 \l@dpairingtrue
2624 \l@dpagingfalse
2625 \initnumbering@sectcmd
2626 \at@begin@pairs%
2627 }{%
2628 \l@dpairingfalse
2629 }
2630
2631 % \end{macrocode}
2632 % \begin{macro}{\AtBeginPairs}
2633 % The \cs{AtBeginPairs} macro just define a \cs{at@begin@pairs} macro, called at the begining of each \verb+pairs+ environments.
2634 % \begin{macrocode}
2635 \newcommand{\AtBeginPairs}[1]{\xdef\at@begin@pairs{#1}}%
2636 \def\at@begin@pairs{}%
2637
2638 % \end{macrocode}
2639 % \end{macro}
2640 % The \verb?pages? environment additionally sets the `column' widths to the
2641 % \cs{textwidth} (as known at the time the package is called). In this environment, there are two text in parallel on 2 pages. To prevent chapters starting on a lefthand page, the \cs{chapter} command is redefined to not clear pages.
2642 % \begin{macrocode}
2643 \newenvironment{pages}{%
2644 \let\oldchapter\chapter
2645 \let\chapter\chapterinpages
2646 \l@dpairingtrue
2647 \l@dpagingtrue
2648 \initnumbering@sectcmd
2649 \setlength{\Lcolwidth}{\textwidth}%
2650 \setlength{\Rcolwidth}{\textwidth}%
2651 }{%
2652 \l@dpairingfalse
2653 \l@dpagingfalse
2654 \let\chapter\oldchapter
2655 }
2656 \newcommand{\chapterinpages}{\thispagestyle{plain}%
2657 \global\@topnum\z@
2658 \@afterindentfalse
2659 \secdef\@chapter\@schapter}
2660
2661 % \end{macrocode}
2662 % \end{macro}
2663 % \end{environment}
2664 % \end{environment}
2665 %
2666 %
2667 % \begin{macro}{ifinstanzaL}
2668 % \begin{macro}{ifinstanzaR}
2669 % These boolean tests are switched by the \cs{stanza} command, using either the left or right side.
2670 % \begin{macrocode}
2671 \newif\ifinstanzaL
2672 \newif\ifinstanzaR
2673 % \end{macrocode}
2674 % \end{macro}
2675 % \end{macro}
2676 % \begin{environment}{Leftside}
2677 % Within the \verb?pairs? and \verb?pages? environments the left and
2678 % right hand texts are within \verb?Leftside? and \verb?Rightside?
2679 % environments, respectively. The \verb?Leftside? environment is simple,
2680 % indicating that right text is not within its purview and using some
2681 % particular macros.
2682 % \changes{v0.3.0}{2005/02/10}{Added hooks into Leftside environment}
2683 % \begin{macrocode}
2684 \newenvironment{Leftside}{%
2685 \expandafter\ifvoid\csname l@dLcolrawbox1\endcsname\else%
2686 \led@err@Leftside@PreviousNotPrinted%
2687 \fi%
2688 \ledRcolfalse
2689 \setcounter{pstartL}{1}
2690 \let\pstart\pstartL
2691 \let\thepstart\thepstartL
2692 \let\pend\pendL
2693 \let\memorydump\memorydumpL
2694 \Leftsidehook
2695 \let\old@startstanza\@startstanza
2696 \def\@startstanza[##1]{\global\instanzaLtrue\old@startstanza[##1]}
2697 }{
2698 \Leftsidehookend}
2699 % \end{macrocode}
2700 % \end{environment}
2701 %
2702 % \begin{macro}{\Leftsidehook}
2703 % \begin{macro}{\Leftsidehookend}
2704 % \begin{macro}{\Rightsidehook}
2705 % \begin{macro}{\Rightsidehookend}
2706 % Hooks into the start and end of the \texttt{Leftside} and \texttt{Rightside}
2707 % environments. These are initially empty.
2708 % \changes{v0.3.0}{2005/02/10}{Added \cs{Leftsidehook}, \cs{Leftsidehookend},
2709 % \cs{Rightsidehook} and \cs{Rightsidehookend}}
2710 % \begin{macrocode}
2711 \newcommand*{\Leftsidehook}{}
2712 \newcommand*{\Leftsidehookend}{}
2713 \newcommand*{\Rightsidehook}{}
2714 \newcommand*{\Rightsidehookend}{}
2715
2716 % \end{macrocode}
2717 % \end{macro}
2718 % \end{macro}
2719 % \end{macro}
2720 % \end{macro}
2721 %
2722 % \begin{environment}{Rightside}
2723 % The \verb?Rightside? environment is only slightly more complicated
2724 % than the \verb?Leftside?.
2725 % Apart from indicating that right text is being provided it
2726 % ensures that the right right text code will be used.
2727 % \begin{macrocode}
2728 \newenvironment{Rightside}{%
2729 \expandafter\ifvoid\csname l@dRcolrawbox1\endcsname\else%
2730 \led@err@Rightside@PreviousNotPrinted%
2731 \fi%
2732 \ledRcoltrue
2733 \let\beginnumbering\beginnumberingR
2734 \let\endnumbering\endnumberingR
2735 \let\pausenumbering\pausenumberingR
2736 \let\resumenumbering\resumenumberingR
2737 \let\memorydump\memorydumpR
2738 \let\thepstart\thepstartR
2739 \let\pstart\pstartR
2740 \let\pend\pendR
2741 \let\ledpb\ledpbR
2742 \let\lednopb\lednopbR
2743 \let\lineation\lineationR
2744 \Rightsidehook
2745 \let\old@startstanza\@startstanza
2746 \def\@startstanza[##1]{\global\instanzaRtrue\old@startstanza[##1]}
2747 }{%
2748 \ledRcolfalse
2749 \Rightsidehookend
2750 }
2751
2752 % \end{macrocode}
2753 % \end{environment}
2754 %
2755 %
2756 %
2757 % \section{Paragraph decomposition and reassembly}
2758 % \label{paragraph}\relax
2759 %
2760 % In order to be able to count the lines of text and affix line
2761 % numbers, we add an extra stage of processing for each paragraph.
2762 % We send the paragraph into a box
2763 % register, rather than straight onto the vertical list, and when
2764 % the paragraph ends we
2765 % slice the paragraph into its component lines; to each line we
2766 % add any notes or line numbers, add a command to write to the
2767 % line-list, and then at last send the line to the vertical list.
2768 % This section contains all the code for this processing.
2769 %
2770 % \subsection{Boxes, counters, {\tt\protect\bslash pstart}
2771 % and {\tt\protect\bslash pend}}
2772 %
2773 % \begin{macro}{\num@linesR}
2774 % \begin{macro}{\one@lineR}
2775 % \begin{macro}{\par@lineR}
2776 % Here are numbers and flags that are used internally in the course
2777 % of the paragraph decomposition.
2778 %
2779 % When we first form the paragraph, it goes into a box register,
2780 % \cs{l@dLcolrawbox} or \cs{l@dRcolrawbox} for right text, instead of onto the
2781 % current vertical list.
2782 % The \cs{ifnumberedpar@} flag will be \verb"true" while a paragraph is
2783 % being processed in that way.
2784 % \cs{num@lines(R)} will store the number of lines in the paragraph
2785 % when it's complete. When we chop it up into lines, each line
2786 % in turn goes into the
2787 % \cs{one@line} or \cs{one@lineR} register, and \cs{par@line(R)}
2788 % will be the number
2789 % of that line within the paragraph.
2790 % \begin{macrocode}
2791 \newcount\num@linesR
2792 \newbox\one@lineR
2793 \newcount\par@lineR
2794 % \end{macrocode}
2795 % \end{macro}
2796 % \end{macro}
2797 % \end{macro}
2798 %
2799 % \begin{macro}{\pstartL}
2800 % \begin{macro}{\pstartR}
2801 % \changes{v1.1.0}{2012/09/25}{Add \cs{labelpstarttrue} (from eledmac).}
2802 % \changes{v1.1.1}{2012/10/01}{Correct \cs{pstartR} bug introduced by 1.1.}
2803 % \changes{v1.4.3}{2013/10/27}{Spurious spaces in \cs{pstartL} and \cs{pstartR}.}
2804 % \changes{v1.8.0}{2014/08/05}{As in \Lpack{eledmac}, \cs{pendL} and \cs{pendR} can have an optional argument.}
2805 % \cs{pstart} starts the paragraph by
2806 % clearing the \cs{inserts@list} list and other
2807 % relevant variables, and then arranges for the
2808 % subsequent text to go into the appropriate box.
2809 % \cs{pstart} needs to appear at the start of
2810 % every paragraph that's to be numbered.
2811 %
2812 % Beware: everything that occurs between \cs{pstart} and \cs{pend}
2813 % is happening within a group; definitions must be global if you want
2814 % them to survive past the end of the paragraph.
2815 %
2816 % We have to have specific left and right \cs{pstart} when parallel processing;
2817 % among other things because of potential changes in the linewidth.
2818 %
2819 % \begin{macrocode}
2820
2821 \newcounter{pstartL}
2822 \renewcommand{\thepstartL}{{\bfseries\@arabic\c@pstartL}. }
2823 \newcounter{pstartR}
2824 \renewcommand{\thepstartR}{{\bfseries\@arabic\c@pstartR}. }
2825
2826 \newcommandx*{\pstartL}[1][1]{%
2827 \if@nobreak%
2828 \let\@oldnobreak\@nobreaktrue%
2829 \else%
2830 \let\@oldnobreak\@nobreakfalse%
2831 \fi%
2832 \@nobreaktrue%
2833 \ifluatex%
2834 \xdef\l@luatextextdir@L{\the\textdir}%
2835 \xdef\l@luatexpardir@L{\the\pardir}%
2836 \xdef\l@luatexbodydir@L{\the\bodydir}%
2837 \fi%
2838 \ifnumbering \else%
2839 \led@err@PstartNotNumbered%
2840 \beginnumbering%
2841 \fi%
2842 \ifnumberedpar@%
2843 \led@err@PstartInPstart%
2844 \pend%
2845 \fi%
2846 % \end{macrocode}
2847 % If this is the first \cs{pstart} in a numbered section, clear any inserts
2848 % and set \cs{ifpst@rtedL} to FALSE.
2849 % \begin{macrocode}
2850 \ifpst@rtedL\else%
2851 \list@clear{\inserts@list}%
2852 \global\let\next@insert=\empty%
2853 \global\pst@rtedLtrue%
2854 \fi%
2855 \begingroup\normal@pars%
2856 % \end{macrocode}
2857 % When parallel processing we check that we haven't exceeded
2858 % the maximum number of chunks. In any event we grab a box for the
2859 % forthcoming text.
2860 % \begin{macrocode}
2861 \global\advance\l@dnumpstartsL \@ne%
2862 \ifnum\l@dnumpstartsL>\l@dc@maxchunks%
2863 \led@err@TooManyPstarts%
2864 \global\l@dnumpstartsL=\l@dc@maxchunks%
2865 \fi%
2866 \global\setnamebox{l@dLcolrawbox\the\l@dnumpstartsL}=\vbox\bgroup%
2867 % \end{macrocode}
2868 % We set all the usual interline penalties to zero; this ensures that there'll
2869 % be no large interline penalties to prevent us from slicing the
2870 % paragraph into pieces. These penalties revert to the values
2871 % that you set when the group for the \cs{vbox} ends.
2872 % \begin{macrocode}
2873 \l@dzeropenalties%
2874 \ifautopar\else%
2875 \ifnumberpstart%
2876 \ifsidepstartnum%
2877 \else%
2878 \thepstartL%
2879 \fi%
2880 \fi%
2881 \fi%
2882 \hsize=\Lcolwidth%
2883 \numberedpar@true%
2884 \iflabelpstart\protected@edef\@currentlabel%
2885 {\p@pstartL\thepstartL}\fi%
2886 % \end{macrocode}
2887 % Dump the optional arguments
2888 % \begin{macrocode}
2889 \ifstrempty{#1}%
2890 {\csgdef{before@pstartL@\the\l@dnumpstartsL}{\at@every@pstart}}%
2891 {\csgdef{before@pstartL@\the\l@dnumpstartsL}{\noindent#1}}%
2892 \at@every@pstart@call%
2893 }
2894 % \end{macrocode}
2895 %
2896 % \begin{macrocode}
2897 \newcommandx*{\pstartR}[1][1]{%
2898 \if@nobreak%
2899 \let\@oldnobreak\@nobreaktrue%
2900 \else%
2901 \let\@oldnobreak\@nobreakfalse%
2902 \fi%
2903 \@nobreaktrue%
2904 \ifluatex%
2905 \xdef\l@luatextextdir@R{\the\textdir}%
2906 \xdef\l@luatexpardir@R{\the\pardir}%
2907 \xdef\l@luatexbodydir@R{\the\bodydir}%
2908 \fi%
2909 \ifnumberingR \else%
2910 \led@err@PstartNotNumbered%
2911 \beginnumberingR%
2912 \fi%
2913 \ifnumberedpar@%
2914 \led@err@PstartInPstart%
2915 \pendR%
2916 \fi%
2917 \ifpst@rtedR\else%
2918 \list@clear{\inserts@listR}%
2919 \global\let\next@insertR=\empty%
2920 \global\pst@rtedRtrue%
2921 \fi%
2922 \begingroup\normal@pars%
2923 \global\advance\l@dnumpstartsR \@ne%
2924 \ifnum\l@dnumpstartsR>\l@dc@maxchunks%
2925 \led@err@TooManyPstarts%
2926 \global\l@dnumpstartsR=\l@dc@maxchunks%
2927 \fi%
2928 \global\setnamebox{l@dRcolrawbox\the\l@dnumpstartsR}=\vbox\bgroup%
2929 \l@dzeropenalties%
2930 \ifautopar\else%
2931 \ifnumberpstart%
2932 \ifsidepstartnum\else%
2933 \thepstartR%
2934 \fi%
2935 \fi%
2936 \fi%
2937 \hsize=\Rcolwidth%
2938 \numberedpar@true%
2939 \iflabelpstart\protected@edef\@currentlabel%
2940 {\p@pstartR\thepstartR}\fi%
2941 \ifstrempty{#1}%
2942 {\csgdef{before@pstartR@\the\l@dnumpstartsR}{\at@every@pstart}}%
2943 {\csgdef{before@pstartR@\the\l@dnumpstartsR}{\noindent#1}}%
2944 \at@every@pstart@call%
2945 }
2946 % \end{macrocode}
2947 % \end{macro}
2948 % \end{macro}
2949 %
2950 %
2951 % \begin{macro}{\pendL}
2952 % \changes{v1.4.3}{2013/10/27}{Spurious spaces in \cs{pendL}.}
2953 % \changes{v1.8.0}{2014/08/05}{As in \Lpack{eledmac}, \cs{pendL} can have an optional argument.}
2954 % \cs{pend} must be used to end a numbered paragraph. Again we need
2955 % a version
2956 % that knows about left parallel texts.
2957 %
2958 % \begin{macrocode}
2959 \newcommandx*{\pendL}[1][1]{%
2960 \ifnumbering \else%
2961 \led@err@PendNotNumbered%
2962 \fi%
2963 \ifnumberedpar@ \else%
2964 \led@err@PendNoPstart%
2965 \fi%
2966 % \end{macrocode}
2967 % We immediately
2968 % call \cs{endgraf} to end the paragraph; this ensures that there'll
2969 % be no large interline penalties to prevent us from slicing the
2970 % paragraph into pieces.
2971 % \begin{macrocode}
2972 \endgraf\global\num@lines=\prevgraf\egroup%
2973 \global\par@line=0%
2974 % \end{macrocode}
2975 % End the group that was begun in the \cs{pstart}.
2976 % \begin{macrocode}
2977 \endgroup%
2978 \ignorespaces%
2979 \@oldnobreak%
2980 \dump@pstartL@pc%
2981 \ifnumberpstart%
2982 \addtocounter{pstartL}{1}%
2983 \fi
2984 \parledgroup@beforenotes@save{L}%
2985 % \end{macrocode}
2986 % Dump content of the optional argument.
2987 % \begin{macrocode}
2988 \ifstrempty{#1}%
2989 {\csgdef{after@pendL@\the\l@dnumpstartsL}{\at@every@pend}}%
2990 {\csgdef{after@pendL@\the\l@dnumpstartsL}{\noindent#1}}%
2991 }
2992 % \end{macrocode}
2993 % \end{macro}
2994 %
2995 % \begin{macro}{\pendR}
2996 % \changes{v1.4.3}{2013/10/27}{Spurious spaces in \cs{pstartR}.}
2997 % \changes{v1.8.0}{2014/08/05}{As in \Lpack{eledmac}, \cs{pendR} can have an optional argument.}
2998 % The version of \cs{pend} needed for right texts.
2999 %
3000 % \begin{macrocode}
3001 \newcommandx*{\pendR}[1][1]{%
3002 \ifnumberingR \else%
3003 \led@err@PendNotNumbered%
3004 \fi%
3005 \ifnumberedpar@ \else%
3006 \led@err@PendNoPstart%
3007 \fi%
3008 \endgraf\global\num@linesR=\prevgraf\egroup%
3009 \global\par@lineR=0%
3010 \endgroup%
3011 \ignorespaces%
3012 \@oldnobreak%
3013 \dump@pstartR@pc%
3014 \ifnumberpstart%
3015 \addtocounter{pstartR}{1}%
3016 \fi%
3017 \parledgroup@beforenotes@save{R}%
3018 \ifstrempty{#1}%
3019 {\csgdef{after@pendR@\the\l@dnumpstartsR}{\at@every@pend}}%
3020 {\csgdef{after@pendR@\the\l@dnumpstartsR}{\noindent#1}}%
3021 }
3022
3023 % \end{macrocode}
3024 % \end{macro}
3025 %
3026 %
3027 % \begin{macro}{\AtEveryPstartCall}
3028 % The \cs{AtEveryPstartCall} argument is called when the \cs{pstartL} or \cs{pstartR} is called.
3029 % That is different of \cs{AtEveryPstart} the argument of which is called when the \cs{pstart}s are printed.
3030 % \begin{macrocode}
3031 \newcommand{\AtEveryPstartCall}[1]{\xdef\at@every@pstart@call{\unexpanded{#1}}}%
3032 \gdef\at@every@pstart@call{}%
3033 % \end{macrocode}
3034 % \end{macro}
3035 % \begin{macro}{\ifprint@last@after@pendL}
3036 % \begin{macro}{\ifprint@last@after@pendR}
3037 % Two booleans set to true, when the time is to print the last optional argument of a \cs{pend}.
3038 % \begin{macrocode}
3039 \newif\ifprint@last@after@pendL%
3040 \newif\ifprint@last@after@pendR%
3041 % \end{macrocode}
3042 % \end{macro}
3043 % \end{macro}
3044 % \subsection{Processing one line}
3045 %
3046 % For parallel texts we have to be able to process left and right lines
3047 % independently. For sequential text we happily use the
3048 % original \cs{do@line}. Otherwise \ldots
3049 %
3050 % \begin{macro}{\l@dleftbox}
3051 % \begin{macro}{\l@drightbox}
3052 % A line of left text will be put in the box \cs{l@dleftbox}, and analagously
3053 % for a line of right text.
3054 % \begin{macrocode}
3055 \newbox\l@dleftbox
3056 \newbox\l@drightbox
3057
3058 % \end{macrocode}
3059 % \end{macro}
3060 % \end{macro}
3061 %
3062 % \begin{macro}{\countLline}
3063 % \begin{macro}{\countRline}
3064 % We need to know the number of lines processed.
3065 % \begin{macrocode}
3066 \newcount\countLline
3067 \countLline \z@
3068 \newcount\countRline
3069 \countRline \z@
3070
3071 % \end{macrocode}
3072 % \end{macro}
3073 % \end{macro}
3074 %
3075 % \begin{macro}{\@donereallinesL}
3076 % \begin{macro}{\@donetotallinesL}
3077 % \begin{macro}{\@donereallinesR}
3078 % \begin{macro}{\@donetotallinesR}
3079 % We need to know the number of `real' lines output (i.e., those that
3080 % have been input by the user), and the total lines output (which includes
3081 % any blank lines output for synchronisation).
3082 % \begin{macrocode}
3083 \newcount\@donereallinesL
3084 \newcount\@donetotallinesL
3085 \newcount\@donereallinesR
3086 \newcount\@donetotallinesR
3087
3088 % \end{macrocode}
3089 % \end{macro}
3090 % \end{macro}
3091 % \end{macro}
3092 % \end{macro}
3093 %
3094 %
3095 % \changes{v0.11.0}{2012/06/11}{Change \cs{do@lineL} and \cs{do@lineR} to allow line numbering by pstart (like in eledmac 0.15).}
3096 % \changes{v1.8.0}{2014/08/05}{Change \cs{do@lineR} and \cs{do@lineR} to allow new sectioning commands.}
3097 % \begin{macro}{\do@lineL}
3098 % \changes{v1.8.1}{2014/08/07}{Fix a bug with critical notes a the begining of a page, (maybe added by v1.8.0) (?).}
3099 % The \cs{do@lineL} macro is called to
3100 % do all the processing for a single line of left text.
3101 % \changes{v0.3.0}{2005/02/10}{Added \cs{do@lineLhook} to \cs{do@lineL}}
3102 % \changes{v0.3.0}{2005/02/10}{Simplified \cs{do@lineL} by using macros for
3103 % some common code}
3104 % \begin{macrocode}
3105 \newcommand*{\do@lineL}{%
3106 \letcs{\ifnumberpstart}{numberpstart@L\the\l@dpscL}%
3107 \advance\countLline \@ne%
3108 \ifvbox\namebox{l@dLcolrawbox\the\l@dpscL}%
3109 {\vbadness=10000%
3110 \splittopskip=\z@%
3111 \do@lineLhook%
3112 \l@demptyd@ta%
3113 \global\setbox\one@line=\vsplit\namebox{l@dLcolrawbox\the\l@dpscL}%
3114 to\baselineskip}%
3115 \IfStrEq{\splitfirstmarks\parledgroup@}{begin}{\parledgroup@notes@startL}{}%
3116 \unvbox\one@line \global\setbox\one@line=\lastbox%
3117 \getline@numL%
3118 \ifnum\@lock>\@ne%
3119 \inserthangingsymboltrue%
3120 \else%
3121 \inserthangingsymbolfalse%
3122 \fi%
3123 \setbox\l@dleftbox%
3124 \hb@xt@ \Lcolwidth{%
3125 \ifl@dhidenumber%
3126 \global\l@dhidenumberfalse%
3127 \f@x@l@cks%
3128 \else%
3129 \affixline@num%
3130 \fi%
3131 \xifinlist{\the\l@dpscL}{\eled@sections@@}%
3132 {\add@inserts\affixside@note}%
3133 {\print@lineL}}%
3134 \add@penaltiesL%
3135 \global\advance\@donereallinesL\@ne%
3136 \global\advance\@donetotallinesL\@ne%
3137 \else%
3138 \setbox\l@dleftbox \hb@xt@ \Lcolwidth{\hspace*{\Lcolwidth}}%
3139 \global\advance\@donetotallinesL\@ne%
3140 \fi}
3141
3142
3143 % \end{macrocode}
3144 % \end{macro}
3145 %
3146 % \begin{macro}{\print@lineL}
3147 % \cs{print@lineL} is for lines without a sectioning command. See \Lpack{eledmac} definition of \cs{print@line} for handbook.
3148 % \changes{v1.12.0}{2015/02/23}{Compatibility with \LuaLaTeX\ RTL languages.}
3149 % \begin{macrocode}
3150 \def\print@lineL{%
3151 \affixpstart@numL%
3152 \l@dld@ta %space kept for backward compatibility
3153 \add@inserts\affixside@note%
3154 \l@dlsn@te %space kept for backward compatibility
3155 {\ledllfill\hb@xt@ \Lcolwidth{%
3156 \do@insidelineLhook%
3157 \ifluatex%
3158 \textdir\l@luatextextdir@L%
3159 \fi%
3160 \new@lineL%
3161 \inserthangingsymbolL%
3162 \l@dunhbox@line{\one@line}}\ledrlfill\l@drd@ta%
3163 \l@drsn@te}}
3164
3165 % \end{macrocode}
3166 % \end{macro}
3167 % \begin{macro}{\print@eledsectionL}
3168 % \changes{v1.12.0}{2015/02/23}{Compatibility with \LuaLaTeX\ RTL languages.}
3169 % \changes{v1.12.1}{2015/02/27}{Fixes bug with \LuaLaTeX\ RTL \cs{eledsection}.}
3170 % \cs{print@eledsectionL} is for line with macro code.
3171 % \begin{macrocode}
3172 \def\print@eledsectionL{%%
3173 \addtocounter{pstartL}{-1}%
3174 \ifdefstring{\@eledsectnotoc}{L}{\ledsectnotoc}{}
3175 \ifdefstring{\@eledsectmark}{L}{}{\ledsectnomark}
3176 \numdef{\temp@}{\l@dpscL-1}%
3177 \xifinlist{\temp@}{\eled@sections@@}{\@nobreaktrue}{\@nobreakfalse}%
3178 \@eled@sectioningtrue%
3179 \bgroup%
3180 \ifluatex%
3181 \textdir\l@luatextextdir@L%
3182 \pardir\l@luatexpardir@L%
3183 \bodydir\l@luatexbodydir@L%
3184 \ifdefstring{\l@luatextextdir@L}{TRT}{\@RTLtrue}{}%
3185 \fi%
3186 \csuse{eled@sectioning@\the\l@dpscL}%
3187 \egroup%
3188 \@eled@sectioningfalse%
3189 \global\csundef{eled@sectioning@\the\l@dpscL}%
3190 \if@RTL%
3191 \hspace{-3\paperwidth}%
3192 {\hbox{\l@dunhbox@line{\one@line}} \new@line}%
3193 \else%
3194 \hspace{3\paperwidth}%
3195 {\new@line \hbox{\l@dunhbox@line{\one@line}}}%
3196 \fi%
3197 \vskip\eledsection@correcting@skip%
3198 }
3199
3200 % \end{macrocode}
3201 % \end{macro}
3202 % \begin{macro}{\dolineLhook}
3203 % \begin{macro}{\dolineRhook}
3204 % \begin{macro}{\doinsidelineLhook}
3205 % \begin{macro}{\doinsidelineRhook}
3206 % \changes{v1.8.3}{2014/08/31}{Added \cs{dolineLhook}, \cs{dolineRhook}, \cs{doinsidelineLhook} and \cs{doinsidelineRhook}}
3207 % These high-level commands just redefine the low-level commands.
3208 % They have to be used be user, without \cs{makeatletter}.
3209 % \begin{macrocode}
3210 \newcommand*{\dolineLhook}[1]{\gdef\do@lineLhook{#1}}%
3211 \newcommand*{\dolineRhook}[1]{\gdef\do@lineRhook{#1}}%
3212 \newcommand*{\doinsidelineLhook}[1]{\gdef\do@insidelineLhook{#1}}%
3213 \newcommand*{\doinsidelineRhook}[1]{\gdef\do@insidelineRhook{#1}}%
3214
3215 % \end{macrocode}
3216 % \end{macro}
3217 % \end{macro}
3218 % \end{macro}
3219 % \end{macro}
3220 % \changes{v0.3.0}{2005/02/10}{Added \cs{do@lineLhook} and \cs{do@lineRhook}}
3221 % \changes{v1.4.0}{2013/07/11}{Added \cs{do@insidelineLhook} and \cs{do@insidelineRhook}}
3222 % \begin{macro}{\do@lineLhook}
3223 % \begin{macro}{\do@lineRhook}
3224 % \begin{macro}{\do@insidelineLhook}
3225 % \begin{macro}{\do@insidelineRhook}
3226 % Hooks, initially empty, into the respective \cs{do@line(L/R)} macros.
3227 % \begin{macrocode}
3228 \newcommand*{\do@lineLhook}{}
3229 \newcommand*{\do@lineRhook}{}
3230 \newcommand*{\do@insidelineLhook}{}
3231 \newcommand*{\do@insidelineRhook}{}
3232
3233 % \end{macrocode}
3234 % \end{macro}
3235 % \end{macro}
3236 % \end{macro}
3237 % \end{macro}
3238 % \begin{macro}{\do@lineR}
3239 % The \cs{do@lineR} macro is called to
3240 % do all the processing for a single line of right text.
3241 % \changes{v0.3.0}{2005/02/10}{Changed \cs{do@lineR} similarly to \cs{do@lineL}}
3242 % \changes{v1.8.1}{2014/08/07}{Fix a bug with critical notes a the begining of a page, added by v1.8.0 (?).}
3243 % \begin{macrocode}
3244 \newcommand*{\do@lineR}{%
3245 \letcs{\ifnumberpstart}{numberpstart@R\the\l@dpscR}%
3246 \ledRcol@true%
3247 \advance\countRline \@ne%
3248 \ifvbox\namebox{l@dRcolrawbox\the\l@dpscR}%
3249 {\vbadness=10000%
3250 \splittopskip=\z@%
3251 \do@lineRhook%
3252 \l@demptyd@ta%
3253 \global\setbox\one@lineR=\vsplit\namebox{l@dRcolrawbox\the\l@dpscR}%
3254 to\baselineskip}%
3255 \IfStrEq{\splitfirstmarks\parledgroup@}{begin}{\parledgroup@notes@startR}{}%
3256 \unvbox\one@lineR \global\setbox\one@lineR=\lastbox%
3257 \getline@numR%
3258 \ifnum\@lockR>\@ne%
3259 \inserthangingsymbolRtrue%
3260 \else%
3261 \inserthangingsymbolRfalse%
3262 \fi%
3263 \setbox\l@drightbox%
3264 \hb@xt@ \Rcolwidth{%
3265 \ifl@dhidenumber%
3266 \global\l@dhidenumberfalse%
3267 \f@x@l@cksR%
3268 \else%
3269 \affixline@numR%
3270 \fi%
3271 \xifinlist{\the\l@dpscR}{\eled@sectionsR@@}%
3272 {\add@insertsR\affixside@noteR}%
3273 {\print@lineR}%
3274 }%
3275 \add@penaltiesR%
3276 \global\advance\@donereallinesR\@ne%
3277 \global\advance\@donetotallinesR\@ne%
3278 \else%
3279 \setbox\l@drightbox \hb@xt@ \Rcolwidth{\hspace*{\Rcolwidth}}%
3280 \global\advance\@donetotallinesR\@ne%
3281 \fi%
3282 \ledRcol@false%
3283 }
3284
3285
3286 % \end{macrocode}
3287 % \end{macro}
3288 %
3289 % \begin{macro}{\print@lineR}{}
3290 % \begin{macro}{\print@eledsectionR}{}
3291 % \changes{v1.12.0}{2015/02/23}{Compatibility with \LuaLaTeX\ RTL languages.}
3292 \def\print@lineR{%
3293 \affixpstart@numR%
3294 \l@dld@ta %space kept for backward compatibility
3295 \add@insertsR\affixside@noteR%
3296 \l@dlsn@te %space kept for backward compatibility
3297 \ledllfill\hb@xt@ \Rcolwidth{%
3298 \do@insidelineRhook%
3299 \new@lineR%
3300 \inserthangingsymbolR%
3301 \ifluatex%
3302 \textdir\l@luatextextdir@R%
3303 \fi%
3304 \l@dunhbox@line{\one@lineR}}\ledrlfill\l@drd@ta%
3305 \l@drsn@te%
3306 }
3307
3308 \def\print@eledsectionR{%
3309 \addtocounter{pstartR}{-1}%
3310 \initnumbering@sectcountR%
3311 \ifdefstring{\@eledsectnotoc}{R}{\ledsectnotoc}{}%
3312 \ifdefstring{\@eledsectmark}{R}{}{\ledsectnomark}%
3313 \numdef{\temp@}{\l@dpscR-1}%
3314 \xifinlist{\temp@}{\eled@sectionsR@@}{\@nobreaktrue}{\@nobreakfalse}%
3315 \@eled@sectioningtrue%
3316 \bgroup%
3317 \ifluatex%
3318 \textdir\l@luatextextdir@R%
3319 \pardir\l@luatexpardir@R%
3320 \bodydir\l@luatexbodydir@R%
3321 \ifdefstring{\l@luatextextdir@L}{TRT}{\@RTLtrue}{}%
3322 \fi%
3323 \csuse{eled@sectioning@\the\l@dpscR R}%
3324 \egroup%
3325 \@eled@sectioningfalse%
3326 \global\csundef{eled@sectioning@\the\l@dpscR R}%
3327 \if@RTL%
3328 \hspace{-\paperwidth}%
3329 {\hbox{\l@dunhbox@line{\one@lineR}} \new@lineR}%
3330 \else%
3331 \hspace{\paperwidth}%
3332 {\new@lineR \hbox{\l@dunhbox@line{\one@lineR}}}%
3333 \fi%
3334 \vskip\eledsection@correcting@skip
3335 }
3336 % \end{macro}
3337 % \end{macro}
3338 %
3339 % \subsection{Line and page number computation}
3340 %
3341 % \begin{macro}{\getline@numR}
3342 % The \cs{getline@numR} macro
3343 % determines the page and line numbers for the right text line we're about to
3344 % send to the vertical list.
3345 % \begin{macrocode}
3346 \newcommand*{\getline@numR}{%
3347 \global\advance\absline@numR \@ne
3348 \do@actionsR
3349 \do@ballastR
3350 \ifledgroupnotesR@\else
3351 \ifnumberline
3352 \ifsublines@
3353 \ifnum\sub@lockR<\tw@
3354 \global\advance\subline@numR \@ne
3355 \fi
3356 \else
3357 \ifnum\@lockR<\tw@
3358 \global\advance\line@numR \@ne
3359 \global\subline@numR \z@
3360 \fi
3361 \fi
3362 \fi
3363 \fi
3364 }
3365 \newcommand*{\getline@numL}{%
3366 \global\advance\absline@num \@ne
3367 \do@actions
3368 \do@ballast
3369 \ifledgroupnotesL@\else
3370 \ifnumberline
3371 \ifsublines@
3372 \ifnum\sub@lock<\tw@
3373 \global\advance\subline@num \@ne
3374 \fi
3375 \else
3376 \ifnum\@lock<\tw@
3377 \global\advance\line@num \@ne
3378 \global\subline@num \z@
3379 \fi
3380 \fi
3381 \fi
3382 \fi
3383 }
3384
3385
3386 % \end{macrocode}
3387 % \end{macro}
3388 %
3389 % \begin{macro}{\do@ballastR}
3390 % \phantomsection\label{do@ballastR}\relax
3391 % The real work in the line macros above is done in \cs{do@actions}, but
3392 % before we plunge into that, let's get \cs{do@ballastR} out of the
3393 % way.
3394 % \begin{macrocode}
3395 \newcommand*{\do@ballastR}{\global\ballast@count=\z@
3396 \begingroup
3397 \advance\absline@numR \@ne
3398 \ifnum\next@actionlineR=\absline@numR
3399 \ifnum\next@actionR>-1001
3400 \global\advance\ballast@count by -\c@ballast
3401 \fi
3402 \fi
3403 \endgroup}
3404 % \end{macrocode}
3405 % \end{macro}
3406 %
3407 %
3408 % \begin{macro}{\l@dskipversenumberR}
3409 % \begin{macro}{\do@actionsR}
3410 % \begin{macro}{\do@actions@fixedcodeR}
3411 % \begin{macro}{\do@actions@nextR}
3412 %
3413 % The \cs{do@actionsR} macro
3414 % looks at the list of actions to take at particular right text absolute line
3415 % numbers, and does everything that's specified for the current line.
3416 %
3417 % It may call itself recursively and we use tail recursion, via
3418 % \cs{do@actions@nextR} for this.
3419 % \changes{v0.3.0}{2005/02/24}{Used \cs{do@actions@fixedcode} in \cs{do@actionsR}}
3420 % \changes{v1.15.0}{2015/04/13}{Add action 1008 and 1009}
3421 % \begin{macrocode}
3422
3423 \newif\ifl@dskipversenumberR
3424 \newcommand*{\do@actions@fixedcodeR}{%
3425 \ifcase\@l@dtempcnta%
3426 \or% % 1001
3427 \global\sublines@true
3428 \or% % 1002
3429 \global\sublines@false
3430 \or% % 1003
3431 \global\@lockR=\@ne
3432 \or% % 1004%
3433 \ifnum\@lockR=\tw@
3434 \global\@lockR=\thr@@
3435 \else
3436 \global\@lockR=\z@
3437 \fi
3438 \or% % 1005
3439 \global\sub@lockR=\@ne
3440 \or% % 1006
3441 \ifnum\sub@lockR=\tw@
3442 \global\sub@lockR=\thr@@
3443 \else
3444 \global\sub@lockR=\z@
3445 \fi
3446 \or% % 1007
3447 \l@dskipnumbertrue
3448 \or% % 1008
3449 \l@dskipversenumberRtrue%
3450 \or% % 1009
3451 \l@dhidenumbertrue%
3452 \else%
3453 \led@warn@BadAction
3454 \fi%
3455 }
3456
3457
3458 \newcommand*{\do@actionsR}{%
3459 \global\let\do@actions@nextR=\relax
3460 \@l@dtempcntb=\absline@numR
3461 \ifnum\@l@dtempcntb<\next@actionlineR\else
3462 \ifnum\next@actionR>-1001\relax
3463 \global\page@numR=\next@actionR
3464 \ifbypage@R
3465 \global\line@numR \z@ \global\subline@numR \z@
3466 \fi
3467 \else
3468 \ifnum\next@actionR<-4999\relax % 9/05 added relax here
3469 \@l@dtempcnta=-\next@actionR
3470 \advance\@l@dtempcnta by -5001\relax
3471 \ifsublines@
3472 \global\subline@numR=\@l@dtempcnta
3473 \else
3474 \global\line@numR=\@l@dtempcnta
3475 \fi
3476 \else
3477 \@l@dtempcnta=-\next@actionR
3478 \advance\@l@dtempcnta by -1000\relax
3479 \do@actions@fixedcodeR
3480 \fi
3481 \fi
3482 \ifx\actionlines@listR\empty
3483 \gdef\next@actionlineR{1000000}%
3484 \else
3485 \gl@p\actionlines@listR\to\next@actionlineR
3486 \gl@p\actions@listR\to\next@actionR
3487 \global\let\do@actions@nextR=\do@actionsR
3488 \fi
3489 \fi
3490 \do@actions@nextR}
3491
3492 % \end{macrocode}
3493 % \end{macro}
3494 % \end{macro}
3495 % \end{macro}
3496 % \end{macro}
3497 %
3498 % \subsection{Line number printing}
3499 %
3500 % \begin{macro}{\l@dcalcnum}
3501 % \begin{macro}{\ch@cksub@l@ckR}
3502 % \begin{macro}{\ch@ck@l@ckR}
3503 % \begin{macro}{\f@x@l@cksR}
3504 % \begin{macro}{\affixline@numR}
3505 % \cs{affixline@numR} is the right text version of the
3506 % \cs{affixline@num} macro.
3507 % \changes{v0.3.0}{2005/02/24}{Changed \cs{affixline@numR} to match new eledmac}
3508 % \changes{v0.11.0}{2012/06/11}{Changed \cs{affixline@numR} to allow to disable line numbering (like in eledmac 0.15).}
3509 % \begin{macrocode}
3510
3511 \providecommand*{\l@dcalcnum}[3]{%
3512 \ifnum #1 > #2\relax
3513 \@l@dtempcnta = #1\relax
3514 \advance\@l@dtempcnta by -#2\relax
3515 \divide\@l@dtempcnta by #3\relax
3516 \multiply\@l@dtempcnta by #3\relax
3517 \advance\@l@dtempcnta by #2\relax
3518 \else
3519 \@l@dtempcnta=#2\relax
3520 \fi}
3521
3522 \newcommand*{\ch@cksub@l@ckR}{%
3523 \ifcase\sub@lockR
3524 \or
3525 \ifnum\sublock@disp=\@ne
3526 \@l@dtempcntb \z@ \@l@dtempcnta \@ne
3527 \fi
3528 \or
3529 \ifnum\sublock@disp=\tw@
3530 \else
3531 \@l@dtempcntb \z@ \@l@dtempcnta \@ne
3532 \fi
3533 \or
3534 \ifnum\sublock@disp=\z@
3535 \@l@dtempcntb \z@ \@l@dtempcnta \@ne
3536 \fi
3537 \fi}
3538
3539 \newcommand*{\ch@ck@l@ckR}{%
3540 \ifcase\@lockR
3541 \or
3542 \ifnum\lock@disp=\@ne
3543 \@l@dtempcntb \z@ \@l@dtempcnta \@ne
3544 \fi
3545 \or
3546 \ifnum\lock@disp=\tw@
3547 \else
3548 \@l@dtempcntb \z@ \@l@dtempcnta \@ne
3549 \fi
3550 \or
3551 \ifnum\lock@disp=\z@
3552 \@l@dtempcntb \z@ \@l@dtempcnta \@ne
3553 \fi
3554 \fi}
3555
3556 \newcommand*{\f@x@l@cksR}{%
3557 \ifcase\@lockR
3558 \or
3559 \global\@lockR \tw@
3560 \or \or
3561 \global\@lockR \z@
3562 \fi
3563 \ifcase\sub@lockR
3564 \or
3565 \global\sub@lockR \tw@
3566 \or \or
3567 \global\sub@lockR \z@
3568 \fi}
3569
3570
3571 \newcommand*{\affixline@numR}{%
3572 \ifledgroupnotesR@\else\ifnumberline
3573 \ifl@dskipnumber
3574 \global\l@dskipnumberfalse
3575 \else
3576 \ifsublines@
3577 \@l@dtempcntb=\subline@numR
3578 \l@dcalcnum{\subline@numR}{\c@firstsublinenumR}{\c@sublinenumincrementR}%
3579 \ch@cksub@lockR
3580 \else
3581 \@l@dtempcntb=\line@numR
3582 \ifx\linenumberlist\empty
3583 \l@dcalcnum{\line@numR}{\c@firstlinenumR}{\c@linenumincrementR}%
3584 \else
3585 \@l@dtempcnta=\line@numR
3586 \edef\rem@inder{,\linenumberlist,\number\line@numR,}%
3587 \edef\sc@n@list{\def\noexpand\sc@n@list
3588 ####1,\number\@l@dtempcnta,####2|{\def\noexpand\rem@inder{####2}}}%
3589 \sc@n@list\expandafter\sc@n@list\rem@inder|%
3590 \ifx\rem@inder\empty\advance\@l@dtempcnta\@ne\fi
3591 \fi
3592 \ch@ck@l@ckR
3593 \fi
3594 \ifnum\@l@dtempcnta=\@l@dtempcntb
3595 \ifl@dskipversenumberR\else
3596 \if@twocolumn
3597 \if@firstcolumn
3598 \gdef\l@dld@ta{\llap{{\leftlinenumR}}}%
3599 \else
3600 \gdef\l@drd@ta{\rlap{{\rightlinenumR}}}%
3601 \fi
3602 \else
3603 \@l@dtempcntb=\line@marginR
3604 \ifnum\@l@dtempcntb>\@ne
3605 \advance\@l@dtempcntb by\page@numR
3606 \fi
3607 \ifodd\@l@dtempcntb
3608 \gdef\l@drd@ta{\rlap{{\rightlinenumR}}}%
3609 \else
3610 \gdef\l@dld@ta{\llap{{\leftlinenumR}}}%
3611 \fi
3612 \fi
3613 \fi
3614 \fi
3615 \f@x@l@cksR
3616 \fi
3617 \fi
3618 \fi}
3619 % \end{macrocode}
3620 % \end{macro}
3621 % \end{macro}
3622 % \end{macro}
3623 % \end{macro}
3624 % \end{macro}
3625 % \subsection{Pstart number printing in side}
3626 % The printing of the pstart number is like in eledmac, with two differences :
3627 %\begin{itemize}
3628 %\item Some commands have versions suffixed by R or L.
3629 %\item The \cs{affixpstart@num} and \cs{affixpstart@numR} commands are called in the \cs{Pages} command. Consequently, the \verb|pstartL| and \verb|pstartR| counters must be reset at the begining of this command.
3630 %\end{itemize}
3631 % \begin{macro}{\affixpstart@numL}
3632 % \begin{macro}{\affixpstart@numR}
3633 % \begin{macro}{\leftpstartnumR}
3634 % \begin{macro}{\rightpstartnumR}
3635 % \begin{macro}{\leftpstartnumL}
3636 % \begin{macro}{\rightpstartnumL}
3637 % \begin{macro}{\ifpstartnumR}
3638 % \begin{macrocode}
3639
3640 \newcommand*{\affixpstart@numL}{%
3641 \ifsidepstartnum
3642 \if@twocolumn
3643 \if@firstcolumn
3644 \gdef\l@dld@ta{\llap{{\leftpstartnumL}}}%
3645 \else
3646 \gdef\l@drd@ta{\rlap{{\rightpstartnumL}}}%
3647 \fi
3648 \else
3649 \@l@dtempcntb=\line@margin
3650 \ifnum\@l@dtempcntb>\@ne
3651 \advance\@l@dtempcntb \page@num
3652 \fi
3653 \ifodd\@l@dtempcntb
3654 \gdef\l@drd@ta{\rlap{{\rightpstartnumL}}}%
3655 \else
3656 \gdef\l@dld@ta{\llap{{\leftpstartnumL}}}%
3657 \fi
3658 \fi
3659 \fi
3660 }
3661 \newcommand*{\affixpstart@numR}{%
3662 \ifsidepstartnum
3663 \if@twocolumn
3664 \if@firstcolumn
3665 \gdef\l@dld@ta{\llap{{\leftpstartnumR}}}%
3666 \else
3667 \gdef\l@drd@ta{\rlap{{\rightpstartnumR}}}%
3668 \fi
3669 \else
3670 \@l@dtempcntb=\line@marginR
3671 \ifnum\@l@dtempcntb>\@ne
3672 \advance\@l@dtempcntb \page@numR
3673 \fi
3674 \ifodd\@l@dtempcntb
3675 \gdef\l@drd@ta{\rlap{{\rightpstartnumR}}}%
3676 \else
3677 \gdef\l@dld@ta{\llap{{\leftpstartnumR}}}%
3678 \fi
3679 \fi
3680 \fi
3681 }
3682
3683 \newcommand*{\leftpstartnumL}{
3684 \ifpstartnum
3685 \thepstartL
3686 \kern\linenumsep\global\pstartnumfalse\fi
3687 }
3688 \newcommand*{\rightpstartnumL}{
3689 \ifpstartnum\kern\linenumsep
3690 \thepstartL
3691 \global\pstartnumfalse\fi
3692 }
3693 \newif\ifpstartnumR
3694 \pstartnumRtrue
3695 \newcommand*{\leftpstartnumR}{
3696 \ifpstartnumR
3697 \thepstartR
3698 \kern\linenumsep\global\pstartnumRfalse\fi
3699 }
3700 \newcommand*{\rightpstartnumR}{
3701 \ifpstartnumR\kern\linenumsep
3702 \thepstartR
3703 \global\pstartnumRfalse\fi
3704 }
3705 % \end{macrocode}
3706 % \end{macro}
3707 % \end{macro}
3708 % \end{macro}
3709 % \end{macro}
3710 % \end{macro}
3711 % \end{macro}
3712 % \end{macro}
3713 % \subsection{Add insertions to the vertical list}
3714 %
3715 % \begin{macro}{\inserts@listR}
3716 % \cs{inserts@listR} is the list macro that contains the inserts that
3717 % we save up for one right text paragraph.
3718 %
3719 % \begin{macrocode}
3720 \list@create{\inserts@listR}
3721 % \end{macrocode}
3722 % \end{macro}
3723 %
3724 %
3725 % \begin{macro}{\add@insertsR}
3726 % \begin{macro}{\add@inserts@nextR}
3727 % The right text version.
3728 % \begin{macrocode}
3729 \newcommand*{\add@insertsR}{%
3730 \global\let\add@inserts@nextR=\relax
3731 \ifx\inserts@listR\empty \else
3732 \ifx\next@insertR\empty
3733 \ifx\insertlines@listR\empty
3734 \global\noteschanged@true
3735 \gdef\next@insertR{100000}%
3736 \else
3737 \gl@p\insertlines@listR\to\next@insertR
3738 \fi
3739 \fi
3740 \ifnum\next@insertR=\absline@numR
3741 \gl@p\inserts@listR\to\@insertR
3742 \@insertR
3743 \global\let\@insertR=\undefined
3744 \global\let\next@insertR=\empty
3745 \global\let\add@inserts@nextR=\add@insertsR
3746 \fi
3747 \fi
3748 \add@inserts@nextR}
3749
3750 % \end{macrocode}
3751 % \end{macro}
3752 % \end{macro}
3753 %
3754 % \subsection{Penalties}
3755 %
3756 % \begin{macro}{\add@penaltiesL}
3757 % \begin{macro}{\add@penaltiesR}
3758 % \cs{add@penaltiesL} is
3759 % the last macro used by \cs{do@lineL}. It adds up the club,
3760 % widow, and interline penalties, and puts a single penalty
3761 % of the appropriate size
3762 % back into the paragraph; these penalties get
3763 % removed by the \cs{vsplit} operation. \cs{displaywidowpenalty} and
3764 % \cs{brokenpenalty} are not restored, since we have no easy way to
3765 % find out where we should insert them.
3766 %
3767 % \phantomsection\label{add@penalties}
3768 % In the code below, which is a virtual copy of the original
3769 % \cs{add@penalties}, \cs{num@lines} is the number of lines in the whole
3770 % paragraph, and \cs{par@line} is the line we're working on at the
3771 % moment. The count \cs{@l@dtempcnta} is used to calculate and
3772 % accumulate the penalty; it is initially set to the value of
3773 % \cs{ballast@count}, which has been worked out in \cs{do@ballast}.
3774 % Finally, the penalty is
3775 % checked to see that it doesn't go below $-10000$.
3776 % \begin{verbatim}
3777 % \newcommand*{\add@penaltiesR}{\@l@dtempcnta=\ballast@count
3778 % \ifnum\num@linesR>\@ne
3779 % \global\advance\par@lineR \@ne
3780 % \ifnum\par@lineR=\@ne
3781 % \advance\@l@dtempcnta by \clubpenalty
3782 % \fi
3783 % \@l@dtempcntb=\par@lineR \advance\@l@dtempcntb \@ne
3784 % \ifnum\@l@dtempcntb=\num@linesR
3785 % \advance\@l@dtempcnta by \widowpenalty
3786 % \fi
3787 % \ifnum\par@lineR<\num@linesR
3788 % \advance\@l@dtempcnta by \interlinepenalty
3789 % \fi
3790 % \fi
3791 % \ifnum\@l@dtempcnta=\z@
3792 % \relax
3793 % \else
3794 % \ifnum\@l@dtempcnta>-10000
3795 % \penalty\@l@dtempcnta
3796 % \else
3797 % \penalty -10000
3798 % \fi
3799 % \fi}
3800 % \end{verbatim}
3801 % This is for a single chunk. However, as we are probably dealing
3802 % with several chunks at a time, the above is nor really relevant. Peter Wilson thinks
3803 % that it is likely with parallel text that there is no real need to add
3804 % back any penalties; even if there was, they would have to match across the
3805 % left and right lines. So, Peter Wilson ends up with the following.
3806 %
3807 % \begin{macrocode}
3808 \newcommand*{\add@penaltiesL}{}
3809 \newcommand*{\add@penaltiesR}{}
3810
3811 % \end{macrocode}
3812 % \end{macro}
3813 % \end{macro}
3814 %
3815 % \subsection{Printing leftover notes}
3816 %
3817 % \begin{macro}{\flush@notesR}
3818 % The \cs{flush@notesR}
3819 % macro is called after the entire right text has been sliced up
3820 % and sent on to the vertical list.
3821 % \begin{macrocode}
3822 \newcommand*{\flush@notesR}{%
3823 \@xloop
3824 \ifx\inserts@listR\empty \else
3825 \gl@p\inserts@listR\to\@insertR
3826 \@insertR
3827 \global\let\@insertR=\undefined
3828 \repeat}
3829
3830 % \end{macrocode}
3831 % \end{macro}
3832 %
3833 %
3834 % \section{Footnotes}
3835 % \label{footnotes}\relax
3836 %
3837 % \subsection{Normal footnote formatting} \label{sec:nfootformat}
3838 %
3839 % The \cs{printlines} macro prints the line
3840 % numbers for a note---which, in the
3841 % general case, is a rather complicated task.
3842 % The seven parameters of the
3843 % argument are the line numbers as stored in \cs{l@d@nums}, in the
3844 % form described on \reff{eledmac-linenumbers} of \Eledmac{}' handbook: the starting
3845 % page, line, and sub-line numbers, followed by the ending page,
3846 % line, and sub-line numbers, and then the font specifier for
3847 % the lemma.
3848 %
3849 %
3850 % \begin{macro}{\printlinesR}
3851 % \begin{macro}{\ledsavedprintlines}
3852 % This is the right text version of \cs{printlines} and takes account
3853 % of \cs{Rlineflag}. Just in case, \cs{ledsavedprintlines} is a copy
3854 % of the original \cs{printlines}.
3855 %
3856 % Just a reminder of the arguments: \\
3857 % \verb?\printlinesR #1 | #2 | #3 | #4 | #5 | #6 | #7? \\
3858 % \verb?\printlinesR start-page | line | subline | end-page | line | subline | font ?
3859 % \changes{v0.3.0}{2005/02/10}{Simplified \cs{printlinesR} by using
3860 % \cs{setprintlines}}
3861 % \begin{macrocode}
3862 \def\printlinesR#1|#2|#3|#4|#5|#6|#7|{\begingroup
3863 \setprintlines{#1}{#2}{#3}{#4}{#5}{#6}%
3864 \ifl@d@pnum #1\fullstop\fi
3865 \ifledplinenum \linenumr@p{#2}\Rlineflag\else \symplinenum\fi
3866 \ifl@d@ssub \fullstop \sublinenumr@p{#3}\fi
3867 \ifl@d@dash \endashchar\fi
3868 \ifl@d@pnum #4\fullstop\fi
3869 \ifl@d@elin \linenumr@p{#5}\Rlineflag\fi
3870 \ifl@d@esl \ifl@d@elin \fullstop\fi \sublinenumr@p{#6}\fi
3871 \endgroup}
3872
3873 \let\ledsavedprintlines\printlines
3874
3875 % \end{macrocode}
3876 % \end{macro}
3877 % \end{macro}
3878 %
3879 % \subsection{Footnotes output specific to \cs{Pages}}
3880 % \begin{macro}{\print@Xnotes@forpages}
3881 % \begin{macro}{\correct@Xfootins@box}
3882 % \begin{macro}{\print@notesX@forpages}
3883 % \begin{macro}{\correct@footinsX@box}
3884 % \changes{v1.13.1}{2015/03/12}{Correct \cs{correct@footinsX@box} and \cs{correct@Xfootins@box}}
3885 % \changes{v1.13.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}.}
3886 % The \cs{onlyXside} and \cs{onlysideX} hooks for \cs{Pages}
3887 % allow notes to be printed either in left or right pages only.
3888 % The implementation of such features is delegated to \cs{print@Xnotes@forpages},
3889 % which replaces \cs{print@Xnotes} inside \cs{Pages}.
3890 % Here is how we proceed\footnote{See \url{http://tex.stackexchange.com/a/230332/7712}.}:
3891 % \begin{itemize}
3892 % \item If notes are to be printed in both sides, we just proceed the usual way: print the foot starts for the series, then the foot group.
3893 % \item If notes are to be printed in the left side, we do these prints only for even pages ; if notes are to be printed in the right side, we do these prints only for odd pages.
3894 % \item However, that is not enough. Because the problem does not only consists in printing notes in any particular page. It is also not to put aside room for notes in the pages where we don't want to print them.
3895 % To take an example: if some note in the left side is too long by 160pt to be printed in full in the left page, we do not want to put aside 160pt a space for it in the following right page.
3896 % \item To solve this problem, we change the magnification factor associated with notes before going to the next page.
3897 % If we start a page where no notes are supposed to be printed, the magnification counter is set to 0. We also set the note skip to 0pt. Before starting a new page where these notes are supposed to be printed, we reset these counter and skip to their default values. (About these counter and skip, read \texbook\ p.~122-125).
3898 % \item There still remains a last problem. This problem is quite complex to understand, so an example will speak for itself. Suppose we allow 10 lines of notes by page.
3899 % Suppose a long note, be it 25 lines, which needs three pages to be printed. Suppose it must be printed only on left pages, namely odd pages.
3900 %
3901 % On p.~2, the first 10 lines of the notes are printed.
3902 % On p.~3, the box associated to the notes contains 10 lines. However, as we are in a right page, we don't void this box. So \TeX\ will keep its content for the pages to come. However, on p.~4 it will also add one line in the footnote box, because in any case, \TeX adds some content in the box when preparing the output routines, even if there is some content left in this box from the previous pages.
3903 % So the lines in the note box at p.~4 will be $10+1=11$. There is one line which should not be there. Furthermore, as the box size is for 10~lines and not for 11~lines, this last line will be glued to the previous one.
3904 %
3905 % To fix this double issue:
3906 % \begin{itemize}
3907 % \item For the pages where notes must be NOT printed, we allow to every note box one line less than it ought to be.
3908 % In our example, that means that we allow \TeX\ to add only $10-1=9$ line in the note box on p.~3.
3909 % Before shifting to the pages where notes must be printed, we allow to every notes the expected number of lines. In our example, that means that we allow \TeX to add 10~lines in the note box on p.~4. As on p.~3 only 9 lines were allowed, that means note box of p.~4 will contain $9+1=10$ lines. So the ``one line too many'' problem is solved.
3910 % \item Still remains the ``glue'' problem. We solve it by recreating a clean note box. We split the one which is created by \TeX\ to get the next line printed. Then, we create the new box, by bringing together the first part and the last part of the splitted box, adding some skip between them. That is achieved by \cs{correct@Xfootins@box} (or \cs{correct@footinsX@box} for familiar notes).
3911 % \end{itemize}
3912 % \end{itemize}
3913 % The code to print critical notes, when processing \cs{Pages}
3914 % \begin{macrocode}
3915 \newcommand\print@Xnotes@forpages[1]{%
3916 % \end{macrocode}
3917 % First case: notes are for both sides. Just print the note start and the note group
3918 % \begin{macrocode}
3919 \ifcsempty{onlyXside@#1}{%
3920 \csuse{#1footstart}{#1}%
3921 \csuse{#1footgroup}{#1}%
3922 }%
3923 % \end{macrocode}
3924 % Second case: notes are for one side only.
3925 % First test if we are in a page where they must be printed.
3926 % \begin{macrocode}
3927 {%
3928 \ifboolexpr{%
3929 ((test {\ifcsstring{onlyXside@#1}{L}} and not test{\ifnumodd{\c@page}})%
3930 or%
3931 (test {\ifcsstring{onlyXside@#1}{R}} and test{\ifnumodd{\c@page}}))%
3932 }%
3933 % \end{macrocode}
3934 % If we are in a page where notes must be printed, print the notes, after having made the corrections which are needed for boxes.
3935 % \begin{macrocode}
3936 {%
3937 \correct@Xfootins@box{#1}%
3938 \csuse{#1footstart}{#1}%
3939 \csuse{#1footgroup}{#1}%
3940 % \end{macrocode}
3941 % Then, say not to keep room for notes in the next page.
3942 % \begin{macrocode}
3943 \global\count\csuse{#1footins}=0%
3944 \global\skip\csuse{#1footins}=0pt%
3945 % \end{macrocode}
3946 % And also, allow one line less for notes in the next page.
3947 % \begin{macrocode}
3948 \csuse{Xnotefontsize@#1}%
3949 \global\advance\dimen\csuse{#1footins} by -\baselineskip%
3950 % \end{macrocode}
3951 % Now we have printed the notes. So we put aside this fact.
3952 % \begin{macrocode}
3953 \global\boolfalse{keepforXside@#1}%
3954 }%
3955 % \end{macrocode}
3956 % In case we are on a page where notes must NOT be printed.
3957 % First, memorize that we have not printed the notes, despite having some to print.
3958 % \begin{macrocode}
3959 {%
3960 \global\booltrue{keepforXside@#1}%
3961 % \end{macrocode}
3962 % Then restore expected rooms for notes on the next page.
3963 % \begin{macrocode}
3964 \global\count\csuse{#1footins}=\csuse{default@#1footins}%
3965 \global\skip\csuse{#1footins}=\csuse{beforeXnotes@#1}%
3966 % \end{macrocode}
3967 % Last but not least, restore the normal line number allowed to notes for the following page.
3968 % \begin{macrocode}
3969 \bgroup%
3970 \csuse{Xnotefontsize@#1}%
3971 \global\advance\dimen\csuse{#1footins} by \baselineskip%
3972 \egroup%
3973 % \end{macrocode}
3974 % \begin{macrocode}
3975 % End of \cs{print@Xnotes@forpages}.
3976 }%
3977 }%
3978 }%
3979 % \end{macrocode}
3980 % Now, \cs{correct@Xfootins@box}, to fix problem of last line being glued to the previous one.
3981 % \begin{macrocode}
3982 \newcommand{\correct@Xfootins@box}[1]{%
3983 % \end{macrocode}
3984 % We need to make correction only in case we have not printed any note in the previous page,
3985 % although there was to be ``normally'' printed.
3986 % \begin{macrocode}
3987 \ifbool{keepforXside@#1}{%
3988 % \end{macrocode}
3989 % Some setting needed to do the right splitting.
3990 % \begin{macrocode}
3991 \csuse{Xnotefontsize@#1}%
3992 \splittopskip=0pt%
3993 % \end{macrocode}
3994 % And now, split the last line, and push in the right place.
3995 % \begin{macrocode}
3996 \global\setbox\csuse{#1footins}=\vbox{%
3997 \vsplit\csuse{#1footins} to \dimexpr\ht\csuse{#1footins}-1pt\relax%
3998 \vskip \dimexpr-0.5\baselineskip-0.5\lineskip-0.5pt\relax%
3999 \unvbox\csuse{#1footins}%
4000 }%
4001 % \end{macrocode}
4002 % End of the macro.
4003 % \begin{macrocode}
4004 }{}%
4005 }%
4006 % \end{macrocode}
4007 % And now, the same for familiar footnotes.
4008 % \begin{macrocode}
4009 \newcommand\print@notesX@forpages[1]{%
4010 \ifcsempty{onlysideX@#1}{%
4011 \csuse{footstart#1}{#1}%
4012 \csuse{footgroup#1}{#1}%
4013 }%
4014 {%
4015 \ifboolexpr{%
4016 ((test {\ifcsstring{onlysideX@#1}{L}} and not test{\ifnumodd{\c@page}})%
4017 or%
4018 (test {\ifcsstring{onlysideX@#1}{R}} and test{\ifnumodd{\c@page}}))%
4019 }%
4020 {%
4021 \correct@footinsX@box{#1}%
4022 \csuse{footstart#1}{#1}%
4023 \csuse{footgroup#1}{#1}%
4024 \global\count\csuse{footins#1}=0%
4025 \global\skip\csuse{footins#1}=0pt%
4026 \csuse{notefontsizeX@#1}%
4027 \global\advance\dimen\csuse{footins#1} by -\baselineskip%
4028 \global\boolfalse{keepforsideX@#1}%
4029 }%
4030 {%
4031 \global\booltrue{keepforsideX@#1}%
4032 \global\count\csuse{footins#1}=\csuse{default@footins#1}%
4033 \global\skip\csuse{footins#1}=\csuse{beforenotesX@#1}%
4034 \bgroup%
4035 \csuse{notefontsizeX@#1}%
4036 \global\advance\dimen\csuse{footins#1} by \baselineskip%
4037 \egroup%
4038 }%
4039 }%
4040 }%
4041 \newcommand{\correct@footinsX@box}[1]{%
4042 \ifbool{keepforsideX@#1}{%
4043 \csuse{notefontsizeX@#1}%
4044 \splittopskip=0pt%
4045 \global\setbox\csuse{footins#1}=\vbox{%
4046 \vsplit\csuse{footins#1} to \dimexpr\ht\csuse{footins#1}-1pt\relax%
4047 \vskip \dimexpr-0.5\baselineskip-0.5\lineskip-0.5pt\relax%
4048 \unvbox\csuse{footins#1}%
4049 }%
4050 }{}%
4051 }%
4052 % \end{macrocode}
4053 % \end{macro}
4054 % \end{macro}
4055 % \end{macro}
4056 % \end{macro}
4057 % \section{Cross referencing}
4058 % \label{xref}\relax
4059 %
4060 %
4061 % \begin{macro}{\labelref@listR}
4062 % Set up a new list, \cs{labelref@listR}, to hold the page, line and
4063 % sub-line numbers for each label in right text.
4064 % \begin{macrocode}
4065 \list@create{\labelref@listR}
4066
4067 % \end{macrocode}
4068 % \end{macro}
4069 %
4070 %
4071 % \begin{macro}{\edlabel}
4072 % Since version 1.18.0, this command is defined only one time in eledmac, including features for eledpar.
4073 % \changes{v1.12.0}{2015/02/23}{\cs{edlabel} is now defined only one time for both eledmac and eledpar}
4074 % \changes{v1.12.0}{2015/02/23}{\cs{edlabel} and \cs{edindex} works now with hyperref when using \Lpack{eledpar}.}
4075 % \end{macro}
4076 %
4077 % \begin{macro}{\l@dmake@labelsR}
4078 % This is the right text version of \cs{l@dmake@labels}, taking account
4079 % of \cs{Rlineflag}.
4080 %
4081 % \begin{macrocode}
4082 \def\l@dmake@labelsR#1|#2|#3|#4|#5{%
4083 \expandafter\ifx\csname the@label#5\endcsname \relax\else
4084 \led@warn@DuplicateLabel{#4}%
4085 \fi
4086 \expandafter\gdef\csname the@label#5\endcsname{#1|#2\Rlineflag|#3|#4}%
4087 \ignorespaces}
4088 \AtBeginDocument{%
4089 \def\l@dmake@labelsR#1|#2|#3|#4|#5{}%
4090 }
4091
4092 % \end{macrocode}
4093 % \end{macro}
4094 %
4095 %
4096 % \begin{macro}{\@lab}
4097 % The \cs{@lab} command, which appears in the \cs{linenum@out} file,
4098 % appends the current values of page, line and sub-line to the
4099 % \cs{labelref@list}. These values are defined by the earlier
4100 % \cs{@page}, \cs{@nl}, and the \cs{sub@on} and \cs{sub@off} commands
4101 % appearing in the \cs{linenum@out} file.
4102 %
4103 % \begin{macrocode}
4104 \renewcommand*{\@lab}{%
4105 \ifledRcol
4106 \xright@appenditem{\linenumr@p{\line@numR}|%
4107 \ifsublines@ \sublinenumr@p{\subline@numR}\else 0\fi}%
4108 \to\labelref@listR
4109 \else
4110 \xright@appenditem{\linenumr@p{\line@num}|%
4111 \ifsublines@ \sublinenumr@p{\subline@num}\else 0\fi}%
4112 \to\labelref@list
4113 \fi}
4114
4115 % \end{macrocode}
4116 % \end{macro}
4117 %
4118 %
4119 % \section{Side notes}
4120 %
4121 % Regular \verb?\marginpar?s do not work inside numbered text --- they
4122 % don't produce any note but do put an extra unnumbered blank line into
4123 % the text.
4124 % \begin{macro}{\sidenote@marginR}
4125 % \begin{macro}{\sidenotemargin*}
4126 % \changes{v1.8.0}{2014/08/05}{\cs{sidenotemargin} is now directly defined in \Lpack{eledmac} to be able to manage \Lpack{eledpar}.}
4127 % \changes{v1.8.0}{2014/08/05}{Add \cs{sidenotemargin*}}
4128 % Specifies which margin sidenotes can be in.
4129 % \begin{macrocode}
4130 \WithSuffix\newcommand\sidenotemargin*[1]{%
4131 \l@dgetsidenote@margin{#1}
4132 \global\sidenote@marginR=\@l@dtempcntb
4133 \global\sidenote@margin=\@l@dtempcntb
4134 }
4135 \newcount\sidenote@marginR
4136 \global\sidenote@margin=\@ne
4137
4138 % \end{macrocode}
4139 % \end{macro}
4140 % \end{macro}
4141 %
4142
4143 % \changes{v1.3.3}{2012/12/19}{Debugging the left notes of the right column.}
4144 % \changes{v1.3.4}{2013/07/03}{Allow use of commands in sidenotes, as introduced by eledmac 1.0.}
4145 % \changes{v1.8.0}{2014/08/05}{\cs{l@dlsnote},\cs{l@drsnote} and \cs{l@dcsnote} defined only one time, in \Lpack{eledmac}. }
4146 % \begin{macro}{\affixside@noteR}
4147 % The right text version of \cs{affixside@note}.
4148 % \changes{v1.1.2}{2012/10/06}{Remove spurious space between line number and line content}
4149 % \begin{macrocode}
4150 \newcommand*{\affixside@noteR}{%
4151 \def\sidenotecontent@{}%
4152 \numgdef{\itemcount@}{0}%
4153 \def\do##1{%
4154 \ifnumequal{\itemcount@}{0}%
4155 {%
4156 \appto\sidenotecontent@{##1}}% Not print not separator before the 1st note
4157 {\appto\sidenotecontent@{\sidenotesep ##1}%
4158 }%
4159 \numgdef{\itemcount@}{\itemcount@+1}%
4160 }%
4161 \dolistloop{\l@dcsnotetext}%
4162 \ifnumgreater{\itemcount@}{1}{\led@err@ManySidenotes}{}%
4163 \gdef\@templ@d{}%
4164 \gdef\@templ@n{\l@dcsnotetext\l@dcsnotetext@l\l@dcsnotetext@r}%
4165 \ifx\@templ@d\@templ@n \else%
4166 \if@twocolumn%
4167 \if@firstcolumn%
4168 \setl@dlp@rbox{##1}{\sidenotecontent@}%
4169 \else%
4170 \setl@drp@rbox{\sidenotecontent@}%
4171 \fi%
4172 \else%
4173 \@l@dtempcntb=\sidenote@marginR%
4174 \ifnum\@l@dtempcntb>\@ne%
4175 \advance\@l@dtempcntb by\page@numR%
4176 \fi%
4177 \ifodd\@l@dtempcntb%
4178 \setl@drp@rbox{\sidenotecontent@}%
4179 \gdef\sidenotecontent@{}%
4180 \numdef{\itemcount@}{0}%
4181 \dolistloop{\l@dcsnotetext@l}%
4182 \ifnumgreater{\itemcount@}{1}{\led@err@ManyLeftnotes}{}%
4183 \setl@dlp@rbox{\sidenotecontent@}%
4184 \else%
4185 \setl@dlp@rbox{\sidenotecontent@}%
4186 \gdef\sidenotecontent@{}%
4187 \numdef{\itemcount@}{0}%
4188 \dolistloop{\l@dcsnotetext@r}%
4189 \ifnumgreater{\itemcount@}{1}{\led@err@ManyRightnotes}{}%
4190 \setl@drp@rbox{\sidenotecontent@}%
4191 \fi%
4192 \fi%
4193 \fi%
4194 }
4195
4196 % \end{macrocode}
4197 % \end{macro}
4198 %
4199 %
4200 % \section{Familiar footnotes}
4201 %
4202 %
4203 % \begin{macro}{\l@dbfnote}
4204 % \verb?\l@dbfnote? adds the footnote to the insert list, and
4205 % \verb?\vl@dbfnote? calls the original \verb?\@footnotetext?.
4206 % \changes{v1.3.1}{2012/11/16}{Compatibility of standard footnotes with eledmac when theses footnotes contain any commands.}
4207 % \changes{v1.3.3}{2012/11/19}{Spurious space with footnote in right column.}
4208 % \begin{macrocode}
4209 \renewcommand{\l@dbfnote}[1]{%
4210 \ifnumberedpar@
4211 \gdef\@tag{#1\relax}%
4212 \ifledRcol%
4213 \xright@appenditem{\noexpand\vl@dbfnote{{\expandonce\@tag}}{\@thefnmark}}%
4214 \to\inserts@listR
4215 \global\advance\insert@countR \@ne%
4216 \else%
4217 \xright@appenditem{\noexpand\vl@dbfnote{{\expandonce\@tag}}{\@thefnmark}}%
4218 \to\inserts@list
4219 \global\advance\insert@count \@ne%
4220 \fi
4221 \fi\ignorespaces}
4222
4223 % \end{macrocode}
4224 % \end{macro}
4225 %
4226 %
4227 % \begin{macro}{\normalbfnoteX}
4228 % \changes{v0.3.0}{2005/02/04}{Removed extraneous spaces from \cs{normalbfnoteX}}
4229 % \changes{v1.3.5}{2013/07/10}{Allows one to redefine \cs{thefootnoteX} with \c{alph} when some packages are loaded.}
4230 % \changes{v1.4.1}{2013/08/16}{Fix bug with normal familiar footnotes when mixing RTL and LTR text.}
4231 % \begin{macrocode}
4232 \renewcommand{\normalbfnoteX}[2]{%
4233 \ifnumberedpar@
4234 \ifledRcol%
4235 \ifluatex
4236 \footnotelang@lua[R]%
4237 \fi
4238 \@ifundefined{xpg@main@language}%if polyglossia
4239 {}%
4240 {\footnotelang@poly[R]}%
4241 \protected@xdef\thisfootnote{\csuse{thefootnote#1}}%
4242 \xright@appenditem{\noexpand\vbfnoteX{#1}{#2}{\expandonce\thisfootnote}}%
4243 \to\inserts@listR
4244 \global\advance\insert@countR \@ne%
4245 \else%
4246 \ifluatex
4247 \footnotelang@lua%
4248 \fi
4249 \@ifundefined{xpg@main@language}%if polyglossia
4250 {}%
4251 {\footnotelang@poly}%
4252 \protected@xdef\thisfootnote{\csuse{thefootnote#1}}%
4253 \xright@appenditem{\noexpand\vbfnoteX{#1}{#2}{\expandonce\thisfootnote}}%
4254 \to\inserts@list
4255 \global\advance\insert@count \@ne%
4256 \fi
4257 \fi\ignorespaces}
4258
4259 % \end{macrocode}
4260 % \end{macro}
4261 %
4262 %
4263
4264 % \section{Verse}
4265 %\changes{v0.11.0}{2012/06/11}{New management of hangingsymbol insertion, preventing undesirable insertions.}
4266 %\changes{v0.12.0}{2012/08/03}{New management of hangingsymbol insertion, preventing undesirable insertions.}
4267 % Like in eledmac, the insertion of hangingsymbol is base on \cs{ifinserthangingsymbol}, and, for the right side, on \cs{ifinserthangingsymbolR}.
4268 % Both commands also include the hanging space, to be sure the \cs{one@line} of hanging lines has the same width that the \cs{one@line} of normal lines and to prevent the column separator from shifting.
4269 % \begin{macro}{\inserthangingsymbolL}
4270 % \begin{macro}{\inserthangingsymbolR}
4271 % \changes{v0.11.0}{2012/06/11}{Prevent the column separator for hanging verse from shifting}
4272 % \changes{v1.4.3}{2013/10/27}{Hanging verse is no longer automatically flush right.}
4273 % \changes{v1.15.0}{2015/04/13}{Prevent more efficiently the column separator from shifting when a verse is hanging}
4274 % \begin{macrocode}
4275 \newif\ifinserthangingsymbolR
4276 \newcommand{\inserthangingsymbolL}{%
4277 \ifinserthangingsymbol%
4278 \ifinstanzaL%
4279 \hskip \@ifundefined{sza@0@}{0}{\expandafter%
4280 \noexpand\csname sza@0@\endcsname}\stanzaindentbase%
4281 \hangingsymbol%
4282 \fi%
4283 \fi%
4284 }%
4285 \newcommand{\inserthangingsymbolR}{%
4286 \ifinserthangingsymbolR%
4287 \ifinstanzaR%
4288 \hskip \@ifundefined{sza@0@}{0}{\expandafter%
4289 \noexpand\csname sza@0@\endcsname}\stanzaindentbase%
4290 \hangingsymbol%
4291 \fi%
4292 \fi%
4293 }%
4294 % \end{macrocode}
4295 % \end{macro}
4296 % \end{macro}
4297
4298 % Before we can define the main stanza macros we need to be able to save
4299 % and reset
4300 % the category code for \&. To save the current value we use
4301 % \verb+\next+ from the \verb+\loop+ macro.
4302 % \begin{macrocode}
4303 \chardef\next=\catcode`\&
4304 \catcode`\&=\active
4305
4306 % \end{macrocode}
4307 %
4308 %
4309 %
4310 % \begin{environment}{astanza}
4311 % \changes{v1.4.1}{2013/08/16}{Enable the use of stanzaindentsrepetition within astanza environment.}
4312 % \changes{v1.13.0}{2015/03/06}{Enable the use of optional argument of \& in astanza environment.}
4313 % This is roughly an environmental form of \cs{stanza}, which treats
4314 % its stanza-like contents as a single chunk.
4315 %
4316 % \begin{macrocode}
4317 \newenvironment{astanza}{%
4318 \startstanzahook
4319 \catcode`\&\active
4320 \global\stanza@count\@ne\stanza@modulo\@ne
4321 \ifnum\usenamecount{sza@0@}=\z@
4322 \let\stanza@hang\relax
4323 \let\endlock\relax
4324 \else
4325 \rightskip\z@ plus 1fil\relax
4326 \fi
4327 \ifnum\usenamecount{szp@0@}=\z@
4328 \let\sza@penalty\relax
4329 \fi
4330 \def&{%
4331 \endlock\mbox{}%
4332 \sza@penalty
4333 \global\advance\stanza@count\@ne
4334 \@astanza@line}%
4335 \def\&{\@stopastanza}%
4336 \pstart
4337 \@astanza@line
4338 }{}
4339
4340 % \end{macrocode}
4341 % \end{environment}
4342 %
4343 % \begin{macro}{\@stopastanza}
4344 % This command is called by \verb+\&+ in astanza environment.
4345 % It allows optional arguments.
4346 % \begin{macrocode}
4347 \newcommandx{\@stopastanza}[1][1,usedefault]{%
4348 \endlock\mbox{}%
4349 \pend[#1]%
4350 \endstanzaextra%
4351 }%
4352 % \end{macrocode}
4353 % \end{macro}
4354 % \begin{macro}{\@astanza@line}
4355 % This gets put at the start of each line in the environment. It sets up
4356 % the paragraph style --- each line is treated as a paragraph.
4357 % \begin{macrocode}
4358 \newcommand*{\@astanza@line}{%
4359 \ifnum\value{stanzaindentsrepetition}=0
4360 \parindent=\csname sza@\number\stanza@count
4361 @\endcsname\stanzaindentbase
4362 \else
4363 \parindent=\csname sza@\number\stanza@modulo
4364 @\endcsname\stanzaindentbase
4365 \managestanza@modulo
4366 \fi
4367 \par
4368 \stanza@hang%\mbox{}%
4369 \ignorespaces}
4370
4371 % \end{macrocode}
4372 % \end{macro}
4373 %
4374 % Lastly reset the modified category codes.
4375 % \begin{macrocode}
4376 \catcode`\&=\next
4377
4378 % \end{macrocode}
4379 %
4380 % \section{Naming macros}
4381 %
4382 % The \LaTeX\ kernel provides \cs{@namedef} and \cs{@namuse} for defining
4383 % and using macros that may have non-letters in their names. We need
4384 % something similar here as we are going to need and use some numbered
4385 % boxes and counters.
4386 %
4387 % \begin{macro}{\newnamebox}
4388 % \begin{macro}{\setnamebox}
4389 % \begin{macro}{\unhnamebox}
4390 % \begin{macro}{\unvnamebox}
4391 % \begin{macro}{\namebox}
4392 % A set of macros for creating and using `named'boxes; the macros are called
4393 % after the regular box macros, but including the string `name'.
4394 % \begin{macrocode}
4395 \providecommand*{\newnamebox}[1]{%
4396 \expandafter\newbox\csname #1\endcsname}
4397 \providecommand*{\setnamebox}[1]{%
4398 \expandafter\setbox\csname #1\endcsname}
4399 \providecommand*{\unhnamebox}[1]{%
4400 \expandafter\unhbox\csname #1\endcsname}
4401 \providecommand*{\unvnamebox}[1]{%
4402 \expandafter\unvbox\csname #1\endcsname}
4403 \providecommand*{\namebox}[1]{%
4404 \csname #1\endcsname}
4405
4406 % \end{macrocode}
4407 % \end{macro}
4408 % \end{macro}
4409 % \end{macro}
4410 % \end{macro}
4411 % \end{macro}
4412 %
4413 % \begin{macro}{\newnamecount}
4414 % \begin{macro}{\usenamecount}
4415 % Macros for creating and using `named' counts.
4416 % \begin{macrocode}
4417 \providecommand*{\newnamecount}[1]{%
4418 \expandafter\newcount\csname #1\endcsname}
4419 \providecommand*{\usenamecount}[1]{%
4420 \csname #1\endcsname}
4421
4422 % \end{macrocode}
4423 % \end{macro}
4424 % \end{macro}
4425 %
4426 % \section{Counts and boxes for parallel texts}
4427 %
4428 % In sequential text, each chunk (that enclosed by \cs{pstart} \ldots
4429 % \cs{pend}) is put into a box called \cs{raw@text} and then immediately
4430 % printed, resulting in the box being emptied and ready for the next chunk.
4431 % For parallel processing multiple boxes are needed as printing is delayed.
4432 % We also need extra counters for various things.
4433 %
4434 % \begin{macro}{\maxchunks}
4435 % \begin{macro}{\l@dc@maxchunks}
4436 % The maximum number of chunk pairs before printing has to be called for.
4437 % The default is 5120 chunk pairs.
4438 % \begin{macrocode}
4439 \newcount\l@dc@maxchunks
4440 \newcommand{\maxchunks}[1]{\l@dc@maxchunks=#1}
4441 \maxchunks{5120}
4442
4443 % \end{macrocode}
4444 % \end{macro}
4445 % \end{macro}
4446 %
4447 % \begin{macro}{\l@dnumpstartsL}
4448 % \begin{macro}{\l@dnumpstartsR}
4449 % The numbers of left and right chunks. \cs{l@dnumpstartsL} is defined
4450 % in \Lpack{eledmac}.
4451 % \changes{v0.3.0}{2005/02/24}{Moved \cs{l@dnumpstartsL} to eledmac}
4452 % \begin{macrocode}
4453 \newcount\l@dnumpstartsR
4454
4455 % \end{macrocode}
4456 % \end{macro}
4457 % \end{macro}
4458 %
4459 % \begin{macro}{\l@pscL}
4460 % \begin{macro}{\l@pscR}
4461 % A couple of scratch counts for use in left and right texts, respectively.
4462 % \begin{macrocode}
4463 \newcount\l@dpscL
4464 \newcount\l@dpscR
4465
4466 % \end{macrocode}
4467 % \end{macro}
4468 % \end{macro}
4469 %
4470 % \begin{macro}{\l@dsetuprawboxes}
4471 % This macro creates \cs{maxchunks} pairs of boxes for left and right
4472 % chunks. The boxes are called \cs{l@dLcolrawbox1}, \cs{l@dLcolrawbox2}, etc.
4473 % \begin{macrocode}
4474 \newcommand*{\l@dsetuprawboxes}{%
4475 \@l@dtempcntb=\l@dc@maxchunks
4476 \loop\ifnum\@l@dtempcntb>\z@
4477 \newnamebox{l@dLcolrawbox\the\@l@dtempcntb}
4478 \newnamebox{l@dRcolrawbox\the\@l@dtempcntb}
4479 \advance\@l@dtempcntb \m@ne
4480 \repeat}
4481
4482 % \end{macrocode}
4483 % \end{macro}
4484 %
4485 % \begin{macro}{\l@dsetupmaxlinecounts}
4486 % \begin{macro}{\l@dzeromaxlinecounts}
4487 % To be able to synchronise left and right texts we need
4488 % to know the maximum number of text lines there are in each pair of chunks.
4489 % \cs{l@dsetupmaxlinecounts} creates \cs{maxchunks} new counts
4490 % called \cs{l@dmaxlinesinpar1}, etc., and
4491 % \cs{l@dzeromaxlinecounts} zeroes all of them.
4492 % \begin{macrocode}
4493 \newcommand*{\l@dsetupmaxlinecounts}{%
4494 \@l@dtempcntb=\l@dc@maxchunks
4495 \loop\ifnum\@l@dtempcntb>\z@
4496 \newnamecount{l@dmaxlinesinpar\the\@l@dtempcntb}
4497 \advance\@l@dtempcntb \m@ne
4498 \repeat}
4499 \newcommand*{\l@dzeromaxlinecounts}{%
4500 \begingroup
4501 \@l@dtempcntb=\l@dc@maxchunks
4502 \loop\ifnum\@l@dtempcntb>\z@
4503 \global\usenamecount{l@dmaxlinesinpar\the\@l@dtempcntb}=\z@
4504 \advance\@l@dtempcntb \m@ne
4505 \repeat
4506 \endgroup}
4507
4508 % \end{macrocode}
4509 % \end{macro}
4510 % \end{macro}
4511 %
4512 % Make sure that all these are set up. This has to be done after the
4513 % user has had an opportunity to change \cs{maxchunks}.
4514 % \begin{macrocode}
4515 \AtBeginDocument{%
4516 \l@dsetuprawboxes
4517 \l@dsetupmaxlinecounts
4518 \l@dzeromaxlinecounts
4519 \l@dnumpstartsL=\z@
4520 \l@dnumpstartsR=\z@
4521 \l@dpscL=\z@
4522 \l@dpscR=\z@}
4523
4524 % \end{macrocode}
4525 %
4526 % \section{Fixing babel}
4527 %
4528 % With parallel texts there is the possibility that the two sides
4529 % might use different languages via \verb?babel?. On the other hand,
4530 % \verb?babel? might not be called at all (even though it might be already
4531 % built into the format).
4532 % \changes{v0.2.0}{2004/12/20}{Added section of babel related code}
4533 %
4534 % With the normal sequential text each line is initially typeset
4535 % in the current language environment, and then it is output at which
4536 % time its attachments are typeset (in the same language environment.
4537 % In the parallel case lines are typeset in their current language but
4538 % an attachment might be typeset outside the language environment
4539 % of its line if the left and right side languages are different.
4540 % To counter this, we have to make sure that the correct language is
4541 % used at the proper times.
4542 %
4543 % \begin{macro}{\ifl@dusedbabel}
4544 % \begin{macro}{\l@dusedbabelfalse}
4545 % \begin{macro}{\l@dusedbabeltrue}
4546 % A flag for checking if \verb?babel? has been used as a package.
4547 % \begin{macrocode}
4548 \newif\ifl@dusedbabel
4549 % \end{macrocode}
4550 % \end{macro}
4551 % \end{macro}
4552 % \end{macro}
4553 %
4554 % \begin{macro}{\ifl@dsamelang}
4555 % Suppress \cs{ifl@dsamelang} which didn't work and was not logical, because both columns could have the same language but not the main language of the document.
4556 % \end{macro}
4557 %
4558 % \begin{macro}{\l@dchecklang}
4559 % \changes{v1.8.0}{2014/08/05}{Suppress \cs{l@dchecklang} which didn't work and was not logical, because both columns could have the same language but not the main language of the document.}
4560 % \end{macro}
4561 % \begin{macro}{\l@dbbl@set@language}
4562 % In \verb?babel? the macro \cs{bbl@set@language}\marg{lang} does the work when
4563 % the language \meta{lang} is changed via \cs{selectlanguage}.
4564 % Unfortunately for me, if it is given
4565 % an argument in the form of a control sequence it strips off the \verb?\?
4566 % character rather than expanding the command. I need a version that accepts
4567 % an argument in the form \cs{lang} without it stripping the \verb?\?.
4568 % \begin{macrocode}
4569 \newcommand*{\l@dbbl@set@language}[1]{%
4570 \edef\languagename{#1}%
4571 \select@language{\languagename}%
4572 \if@filesw
4573 \protected@write\@auxout{}{\string\select@language{\languagename}}%
4574 \addtocontents{toc}{\string\select@language{\languagename}}%
4575 \addtocontents{lof}{\string\select@language{\languagename}}%
4576 \addtocontents{lot}{\string\select@language{\languagename}}%
4577 \fi}
4578
4579 % \end{macrocode}
4580 % \end{macro}
4581 %
4582 % The rest of the setup has to be postponed until the end of the preamble
4583 % when we know if \verb?babel? has been used or not. However, for now assume
4584 % that it has not been used.
4585 %
4586 % \begin{macro}{\selectlanguage}
4587 % \begin{macro}{\l@duselanguage}
4588 % \begin{macro}{\theledlanguageL}
4589 % \begin{macro}{\theledlanguageR}
4590 % \cs{selectlanguage} is a \verb?babel? command. \cs{theledlanguageL} and
4591 % \cs{theledlanguageR} are the names of the languages of the left and right
4592 % texts. \cs{l@duselanguage} is similar to \cs{selectlanguage}.
4593 % \begin{macrocode}
4594 \providecommand{\selectlanguage}[1]{}
4595 \newcommand*{\l@duselanguage}[1]{}
4596 \gdef\theledlanguageL{}
4597 \gdef\theledlanguageR{}
4598
4599 % \end{macrocode}
4600 %
4601 % Now do the \verb?babel? fix or \verb?polyglossia?, if necessary.
4602 % \begin{macrocode}
4603 \AtBeginDocument{%
4604 \@ifundefined{xpg@main@language}{%
4605 \@ifundefined{bbl@main@language}{%
4606 % \end{macrocode}
4607 % Either \verb?babel? has not been used or it has been used with no
4608 % specified language.
4609 % \begin{macrocode}
4610 \l@dusedbabelfalse
4611 \renewcommand*{\selectlanguage}[1]{}}{%
4612 % \end{macrocode}
4613 % Here we deal with the case where babel has been used. \cs{selectlanguage}
4614 % has to be redefined to use our version of \cs{bbl@set@language} and to
4615 % store the left or right language.
4616 % \begin{macrocode}
4617 \l@dusedbabeltrue
4618 \let\l@doldselectlanguage\selectlanguage
4619 \let\l@doldbbl@set@language\bbl@set@language
4620 \let\bbl@set@language\l@dbbl@set@language
4621 \renewcommand{\selectlanguage}[1]{%
4622 \l@doldselectlanguage{#1}%
4623 \ifledRcol \gdef\theledlanguageR{#1}%
4624 \else \gdef\theledlanguageL{#1}%
4625 \fi}
4626 % \end{macrocode}
4627 % \cs{l@duselanguage} simply calls the original \cs{selectlanguage} so
4628 % that \cs{theledlanguageL} and \cs{theledlanguageR} are unaltered.
4629 % \begin{macrocode}
4630 \renewcommand*{\l@duselanguage}[1]{%
4631 \l@doldselectlanguage{#1}}
4632 % \end{macrocode}
4633 % Lastly, initialise the left and right languages to the current \verb?babel?
4634 % one.
4635 % \begin{macrocode}
4636 \gdef\theledlanguageL{\bbl@main@language}%
4637 \gdef\theledlanguageR{\bbl@main@language}%
4638 }%
4639 }
4640 % \end{macrocode}
4641 % If on Polyglossia
4642 % \changes{v1.8.0}{2014/08/05}{Correct left/right language setting with polyglossia.}
4643 % \changes{v1.9.0}{2014/09/16}{Debug left/right language switching with polyglossia. Don't write in .aux file when setting left/right lines.}
4644 % \begin{macrocode}
4645 { \let\old@otherlanguage\otherlanguage%
4646 \renewcommand{\otherlanguage}[2][]{%
4647 \selectlanguage[#1]{#2}%
4648 \ifledRcol \gdef\theledlanguageR{#2}%
4649 \else \gdef\theledlanguageL{#2}%
4650 \fi}%
4651 \let\l@duselanguage\select@language%
4652 \gdef\theledlanguageL{\xpg@main@language}%
4653 \gdef\theledlanguageR{\xpg@main@language}%
4654 % \end{macrocode}
4655 % That's it.
4656 % \begin{macrocode}
4657 }}
4658 % \end{macrocode}
4659 % \end{macro}
4660 % \end{macro}
4661 % \end{macro}
4662 % \end{macro}
4663 %
4664 %
4665 % \begin{macro}{\if@pstarts}
4666 % \begin{macro}{\@pstartstrue}
4667 % \begin{macro}{\@pstartsfalse}
4668 % \begin{macro}{\check@pstarts}
4669 % \cs{check@pstarts} returns \cs{@pstartstrue} if there are any unprocessed
4670 % chunks.
4671 % \begin{macrocode}
4672 \newif\if@pstarts
4673 \newcommand*{\check@pstarts}{%
4674 \@pstartsfalse
4675 \ifnum\l@dnumpstartsL>\l@dpscL
4676 \@pstartstrue
4677 \else
4678 \ifnum\l@dnumpstartsR>\l@dpscR
4679 \@pstartstrue
4680 \fi
4681 \fi
4682 }
4683
4684 % \end{macrocode}
4685 % \end{macro}
4686 % \end{macro}
4687 % \end{macro}
4688 % \end{macro}
4689 %
4690 % \begin{macro}{\ifaraw@text}
4691 % \begin{macro}{\araw@texttrue}
4692 % \begin{macro}{\araw@textfalse}
4693 % \begin{macro}{\checkraw@text}
4694 % \cs{checkraw@text} checks whether the current Left or Right box is
4695 % void or not. If one or other is not void it sets \cs{araw@texttrue},
4696 % otherwise both are void and it sets \cs{araw@textfalse}.
4697 % \begin{macrocode}
4698 \newif\ifaraw@text
4699 \newcommand*{\checkraw@text}{%
4700 \araw@textfalse
4701 \ifvbox\namebox{l@dLcolrawbox\the\l@dpscL}
4702 \araw@texttrue
4703 \else
4704 \ifvbox\namebox{l@dRcolrawbox\the\l@dpscR}
4705 \araw@texttrue
4706 \fi
4707 \fi
4708 }
4709
4710 % \end{macrocode}
4711 % \end{macro}
4712 % \end{macro}
4713 % \end{macro}
4714 % \end{macro}
4715 %
4716 %
4717 % \begin{macro}{\@writelinesinparL}
4718 % \begin{macro}{\@writelinesinparR}
4719 % These write the number of text lines in a chunk to the section files,
4720 % and then afterwards zero the counter.
4721 % \begin{macrocode}
4722 \newcommand*{\@writelinesinparL}{%
4723 \edef\next{%
4724 \write\linenum@out{\string\@pend[\the\@donereallinesL]}}%
4725 \next
4726 \global\@donereallinesL \z@}
4727 \newcommand*{\@writelinesinparR}{%
4728 \edef\next{%
4729 \write\linenum@outR{\string\@pendR[\the\@donereallinesR]}}%
4730 \next
4731 \global\@donereallinesR \z@}
4732
4733 % \end{macrocode}
4734 % \end{macro}
4735 % \end{macro}
4736 %
4737 %
4738 % \section{Parallel columns}
4739 %
4740 % \begin{macro}{\@eledsectionL}
4741 % \begin{macro}{\@eledsectionR}
4742 % The parbox \cs{@eledsectionL} and \cs{@eledsectionR} will keep the sections' title.
4743 % \begin{macrocode}
4744 \newsavebox{\@eledsectionL}%
4745 \newsavebox{\@eledsectionR}%
4746 % \end{macrocode}
4747 % \end{macro}
4748 % \end{macro}
4749 % \begin{macro}{\Columns}
4750 % \changes{v1.8.0}{2014/07/28}{Modify \cs{Columns} to enable to add section's title.}
4751 % The \cs{Columns} command results in the previous Left and
4752 % Right texts being typeset in matching columns. There should
4753 % be equal numbers of chunks in the left and right texts.
4754 %
4755 % \changes{v1.12.0}{2015/02/23}{Add \cs{l@dprintingcolumnstrue}}
4756 % \begin{macrocode}
4757 \newcommand*{\Columns}{%
4758 \ifl@dpairing%
4759 \led@err@Columns@InsideEnv%
4760 \fi%
4761 \l@dprintingcolumnstrue%
4762 \eledsection@correcting@skip=-\baselineskip% Correction for sections' titles
4763 \ifnum\l@dnumpstartsL=\l@dnumpstartsR\else
4764 \led@err@BadLeftRightPstarts{\the\l@dnumpstartsL}{\the\l@dnumpstartsR}%
4765 \fi
4766 % \end{macrocode}
4767 % Start a group and zero counters, etc.
4768 % \begin{macrocode}
4769 \begingroup
4770 \l@dzeropenalties
4771 \endgraf\global\num@lines=\prevgraf
4772 \global\num@linesR=\prevgraf
4773 \global\par@line=\z@
4774 \global\par@lineR=\z@
4775 \global\l@dpscL=\z@
4776 \global\l@dpscR=\z@
4777 % \end{macrocode}
4778 % Check if there are chunks to be processed, and process them
4779 % two by two (left and right pairs).
4780 % \begin{macrocode}
4781 \check@pstarts
4782 \loop\if@pstarts
4783 \global\pstartnumtrue
4784 \global\pstartnumRtrue
4785 % \end{macrocode}
4786 % Increment \cs{l@dpscL} and \cs{l@dpscR} which here count
4787 % the numbers of left and right chunks.
4788 % Also restore the value of the public pstart counters.
4789 % \begin{macrocode}
4790 \global\advance\l@dpscL \@ne
4791 \global\advance\l@dpscR \@ne
4792 \restore@pstartL@pc%
4793 \restore@pstartR@pc%
4794 % \end{macrocode}
4795 % We print the optional argument of \cs{pstart} or the argument of \cs{AtEveryPstart}.
4796 % \begin{macrocode}
4797 \Columns@print@before@pstart%
4798 % \end{macrocode}
4799 % Check if there is text yet to be processed in at least one of
4800 % the two current chunks, and also whether the left and right languages
4801 % are the same
4802 % \changes{v0.2.0}{2004/12/20}{Added \cs{l@dchecklang} and \cs{l@duselanguage}
4803 % to \cs{Columns}}
4804 % \changes{v1.8.0}{2014/08/05}{Suppress \cs{l@dchecklang} from \cs{Columns}.}
4805 % \begin{macrocode}
4806 \checkraw@text
4807 { \loop\ifaraw@text
4808 % \end{macrocode}
4809 % Grab the next pair of left and right text lines and output them, swapping
4810 % languages if they differ, adding section title if needed.
4811 % \begin{macrocode}
4812 \l@duselanguage{\theledlanguageL}%
4813 \do@lineL
4814 \xifinlist{\the\l@dpscL}{\eled@sections@@}
4815 {%
4816 \ifdefstring{\@eledsectmark}{L}%
4817 {\csuse{eled@sectmark@\the\l@dpscL}%
4818 }{}%
4819 \global\csundef{eled@sectmark@\the\l@dpscL}%
4820 \savebox{\@eledsectionL}{\parbox[t][][t]{\Lcolwidth}{\vbox{}\print@eledsectionL}}%\vbox{}-> prevent alignment troubles with RTL language
4821 }%
4822 {}%
4823 \l@duselanguage{\theledlanguageR}%
4824 \do@lineR
4825 \xifinlist{\the\l@dpscR}{\eled@sectionsR@@}
4826 {%
4827 \ifdefstring{\@eledsectmark}{R}%
4828 {\csuse{eled@sectmark@\the\l@dpscR R}%
4829 }{}%
4830 \global\csundef{eled@sectmark@\the\l@dpscR R}%
4831 \savebox{\@eledsectionR}{\parbox[t][][t]{\Rcolwidth}{\vbox{}\print@eledsectionR}}}%\vbox{}-> prevent alignment troubles with RTL language
4832 {}%
4833 \hb@xt@ \hsize{%
4834 \ifdefstring{\columns@position}{L}{}{\hfill }%
4835 \unhbox\l@dleftbox%
4836 \ifhbox\@eledsectionL%
4837 \usebox{\@eledsectionL}%
4838 \fi%
4839 \print@columnseparator%
4840 \unhbox\l@drightbox%
4841 \ifhbox\@eledsectionR%
4842 \usebox{\@eledsectionR}%
4843 \fi%
4844 \ifdefstring{\columns@position}{R}{}{\hfill}%
4845 }%
4846 \checkraw@text
4847 \checkverseL
4848 \checkverseR
4849 \checkpb@columns
4850 \repeat}
4851 % \end{macrocode}
4852 % Having completed a pair of chunks, write the number of lines
4853 % in each chunk to the respective section files. Increment pstart counters and reset line numbering if it's by pstart.
4854 % \changes{v0.11.0}{2012/06/11}{Line numbering by pstart.}
4855 % \begin{macrocode}
4856 \@writelinesinparL
4857 \@writelinesinparR
4858 \check@pstarts
4859 \ifbypstart@%
4860 \write\linenum@out{\string\@set[1]}
4861 \resetprevline@
4862 \fi
4863 \ifbypstart@R
4864 \write\linenum@outR{\string\@set[1]}
4865 \resetprevline@
4866 \fi
4867 \Columns@print@after@pend%
4868 \repeat
4869 % \end{macrocode}
4870 % Having output all chunks, make sure all notes have been output,
4871 % then zero counts ready for the next set of texts. The boolean tests for stanza are switched to false.
4872 % \begin{macrocode}
4873 \flush@notes
4874 \flush@notesR
4875 \endgroup
4876 % \end{macrocode}
4877 % \begin{macrocode}
4878 \global\l@dpscL=\z@
4879 \global\l@dpscR=\z@
4880 \global\l@dnumpstartsL=\z@
4881 \global\l@dnumpstartsR=\z@
4882 \l@dprintingcolumnsfalse%
4883 \ignorespaces
4884 \global\instanzaLfalse
4885 \global\instanzaRfalse}
4886
4887 % \end{macrocode}
4888 % \end{macro}
4889 % \begin{macro}{\print@columnseparator}
4890 % \changes{v1.8.0}{2014/08/05}{Move some code of \cs{Columns} to \cs{print@columnseparator}.}
4891 % \cs{print@columnseparator} prints the column separator, with surrounding spaces (as the user has set them).
4892 % We use the \TeX\ \cs{ifdim} instead of \Lpack{etoolbox}
4893 % to avoid having \cs{hfill} in a \verb+{}+, which deletes some space (but not much).
4894 % \begin{macrocode}
4895 \def\print@columnseparator{%
4896 \ifdim\beforecolumnseparator<0pt%
4897 \hfill%
4898 \else%
4899 \hspace{\beforecolumnseparator}%
4900 \fi%
4901 \columnseparator%
4902 \ifdim\aftercolumnseparator<0pt%
4903 \hfill%
4904 \else%
4905 \hspace{\beforecolumnseparator}%
4906 \fi%
4907 }%
4908 %\end{macrocode}
4909 % \end{macro}
4910 % \begin{macro}{\checkpb@columns}
4911 % \cs{checkpb@columns} prevent or make pagebreaking in columns, depending of the use of \cs{ledpb} or \cs{lednopb}.
4912 % \begin{macrocode}
4913
4914 \newcommand{\checkpb@columns}{%
4915 \newif\if@pb
4916 \newif\if@nopb
4917 \IfStrEq{\led@pb@setting}{before}{
4918 \numdef{\next@absline}{\the\absline@num+1}%
4919 \numdef{\next@abslineR}{\the\absline@numR+1}%
4920 \xifinlistcs{\next@absline}{l@prev@pb}{\@pbtrue}{}%
4921 \xifinlistcs{\next@abslineR}{l@prev@pbR}{\@pbtrue}{}
4922 \xifinlistcs{\next@absline}{l@prev@nopb}{\@nopbtrue}{}%
4923 \xifinlistcs{\next@abslineR}{l@prev@nopbR}{\@nopbtrue}{}
4924 }{}
4925 \IfStrEq{\led@pb@setting}{after}{
4926 \xifinlistcs{\the\absline@num}{l@prev@pb}{\@pbtrue}{}%
4927 \xifinlistcs{\the\absline@numR}{l@prev@pbR}{\@pbtrue}{}
4928 \xifinlistcs{\the\absline@num}{l@prev@nopb}{\@nopbtrue}{}%
4929 \xifinlistcs{\the\absline@numR}{l@prev@nopbR}{\@nopbtrue}{}
4930 }{}
4931 \if@nopb\nopagebreak[4]\enlargethispage{\baselineskip}\fi
4932 \if@pb\pagebreak[4]\fi
4933 }
4934 % \end{macrocode}
4935 % \end{macro}
4936 % \begin{macro}{\columnseparator}
4937 % \begin{macro}{\columnrulewidth}
4938 % The separator between line pairs in parallel columns is in the form
4939 % of a vertical rule extending a little below the baseline and with a height
4940 % slightly greater than the \cs{baselineskip}. The width of the rule
4941 % is \cs{columnrulewidth} (initially 0pt so the rule is invisible).
4942 % \begin{macrocode}
4943 \newcommand*{\columnseparator}{%
4944 \smash{\rule[-0.2\baselineskip]{\columnrulewidth}{1.05\baselineskip}}}
4945 \newdimen\columnrulewidth
4946 \columnrulewidth=\z@
4947
4948 % \end{macrocode}
4949 % \end{macro}
4950 % \end{macro}
4951 % \begin{macro}{\columnsposition}
4952 % \begin{macro}{\columns@position}
4953 % The position of the \cs{Columns} in a page. Default value is R.
4954 % Stored in \cs{columns@position}.
4955 % \begin{macrocode}
4956 \newcommand*{\columnsposition}[1]{%
4957 \xdef\columns@position{#1}%
4958 }%
4959 \xdef\columns@position{R}%
4960 % \end{macrocode}
4961 % \end{macro}
4962 % \end{macro}
4963 % \begin{macro}{\beforecolumnseparator}
4964 % \begin{macro}{\aftercolumnseparator}
4965 % \cs{beforecolumnseparator} and \cs{aftercolumnseparator} lengths are defined to \verb+-1pt+. If user changes them to a positive length, the lengths are used to define blank spaces before / after the column separator, instead of \cs{hfill}.
4966 % \begin{macrocode}
4967 \newlength{\beforecolumnseparator}%
4968 \setlength{\beforecolumnseparator}{-2pt}%
4969
4970 \newlength{\aftercolumnseparator}%
4971 \setlength{\aftercolumnseparator}{-2pt}%
4972
4973 % \end{macrocode}
4974 % \end{macro}
4975 % \end{macro}
4976 %
4977 % \begin{macro}{setwidthliketwocolumns@L}
4978 % \begin{macro}{setpositionliketwocolumns@L}
4979 % \begin{macro}{setnotepositionliketwocolumns@L}
4980 % \begin{macro}{setwidthliketwocolumns@C}
4981 % \begin{macro}{setpositionliketwocolumns@C}
4982 % \begin{macro}{setnotepositionliketwocolumns@C}
4983 % \begin{macro}{setwidthliketwocolumns@R}
4984 % \begin{macro}{setpositionliketwocolumns@R}
4985 % \begin{macro}{setnotepositionliketwocolumns@R}
4986 % The \cs{setwidth…} macros are called in \cs{beginnumbering} in a \textbf{non-parallel}
4987 % typesetting context, to fix the width of the lines to be vertically aligned with parallel columns. They are also called at the beginning of a note's group, if some options are enabled.
4988 % The \cs{setposition…} macros are called in \cs{beginnumbering} in a \textbf{non- parallel} typesetting context to fix the position of the lines.
4989 % The \cs{setnoteposition…} macros are called in \cs{xxxfootstart} in a \textbf{non- parallel} typesetting context to fix the position of notes block.
4990 % \begin{macrocode}
4991 \newcommand{\setwidthliketwocolumns@L}{%
4992 % Temporary dimension, initially equal to the standard hsize, i.e. text width
4993 % \begin{macrocode}
4994 \newdimen\temp%
4995 \temp=\hsize%
4996 % \end{macrocode}
4997 % Hsize : Left + Right width
4998 % \begin{macrocode}
4999 \hsize=\Lcolwidth%
5000 \advance\hsize\Rcolwidth%
5001 % \end{macrocode}
5002 % Now, calculating the remaining space
5003 % \begin{macrocode}
5004 \advance\temp-\hsize%
5005 % \end{macrocode}
5006 % And multiply the hsize by 2/3 of this space
5007 % \begin{macrocode}
5008 \multiply\temp by 2%
5009 \divide\temp by 3%
5010 \advance\hsize\temp%
5011 }%
5012
5013 \newcommand{\setpositionliketwocolumns@L}{%
5014 \renewcommand{\ledrlfill}{\hfill}%
5015 }%
5016
5017 \newcommand{\setnotespositionliketwocolumns@L}{%
5018 }%
5019
5020
5021 % \end{macrocode}
5022 % \begin{macrocode}
5023 \newcommand{\setwidthliketwocolumns@C}{%
5024 % Temporary dimension, initially equal to the standard hsize, i.e. text width
5025 % \end{macrocode}
5026 % \begin{macrocode}
5027 \newdimen\temp%
5028 \temp=\hsize%
5029 % Hsize : Left + Right width
5030 % \end{macrocode}
5031 % \begin{macrocode}
5032 \hsize=\Lcolwidth%
5033 \advance\hsize\Rcolwidth%
5034 % Now, calculating the remaining space
5035 % \end{macrocode}
5036 % \begin{macrocode}
5037 \advance\temp-\hsize%
5038 % \end{macrocode}
5039 % And multiply the hsize by 1/2 of this space
5040 % \begin{macrocode}
5041 \divide\temp by 2%
5042 \advance\hsize\temp%
5043 }%
5044
5045 \newcommand{\setpositionliketwocolumns@C}{%
5046 \doinsidelinehook{\hfill}%
5047 \renewcommand{\ledrlfill}{\hfill}%
5048 }%
5049
5050 \newcommand{\setnotespositionliketwocolumns@C}{%
5051 \newdimen\temp%
5052 \newdimen\tempa%
5053 \temp=\hsize%
5054 \tempa=\Lcolwidth%
5055 \advance\tempa\Rcolwidth%
5056 \advance\temp-\tempa%
5057 \divide\temp by 2%
5058 \leftskip=\temp%
5059 \rightskip=-\temp%
5060 }%
5061
5062 \newcommand{\setwidthliketwocolumns@R}{%
5063 % \end{macrocode}
5064 % Temporary dimension, initially equal to the standard hsize, i.e. text width
5065 % \begin{macrocode}
5066 \newdimen\temp%
5067 \temp=\hsize%
5068 % \end{macrocode}
5069 % Hsize : Left + Right width
5070 % \begin{macrocode}
5071 \hsize=\Lcolwidth%
5072 \advance\hsize\Rcolwidth%
5073 % \end{macrocode}
5074 % Now, calculating the remaining space
5075 % \begin{macrocode}
5076 \advance\temp-\hsize%
5077 % \end{macrocode}
5078 % And multiply the hsize by 2/3 of this space
5079 % \begin{macrocode}
5080 \multiply\temp by 2%
5081 \divide\temp by 3%
5082 \advance\hsize\temp%
5083 }%
5084
5085 \newcommand{\setpositionliketwocolumns@R}{%
5086 \doinsidelinehook{\hfill}%
5087 }%
5088
5089 \newcommand{\setnotespositionliketwocolumns@R}{%
5090 \newdimen\temp%
5091 \newdimen\tempa%
5092 \temp=\hsize%
5093 \tempa=\Lcolwidth%
5094 \advance\tempa\Rcolwidth%
5095 \advance\temp-\tempa%
5096 \divide\temp by 2%
5097 \leftskip=\temp%
5098 \rightskip=-\temp%
5099 }%
5100
5101 % \end{macrocode}
5102 % \end{macro}
5103 % \end{macro}
5104 % \end{macro}
5105 % \end{macro}
5106 % \end{macro}
5107 % \end{macro}
5108 % \end{macro}
5109 % \end{macro}
5110 % \end{macro}
5111 %
5112 % \begin{macro}{\Columns@print@before@pstart}
5113 % \begin{macro}{\Columns@print@after@pend}
5114 % The \cs{Columns@print@before@pstart} and \cs{Columns@print@after@pend} print the content of the optional argument of \cs{pstart} / \cs{pend}. If this content is not empty, it also print the separator.
5115 % \begin{macrocode}
5116 \newcommand{\Columns@print@before@pstart}{%
5117 \ifboolexpr{%
5118 test{\ifcsstring{before@pstartL@\the\l@dpscL}{\at@every@pstart}}%
5119 and test {\ifcsstring{before@pstartR@\the\l@dpscR}{\at@every@pstart}}%
5120 and test {\ifdefempty{\at@every@pstart}}}%
5121 {}%
5122 {%
5123 \hb@xt@ \hsize{%
5124 \ifdefstring{\columns@position}{L}{}{\hfill }%
5125 \par\parbox[t][][t]{\Lcolwidth}{%
5126 \csuse{before@pstartL@\the\l@dpscL}%
5127 }%
5128 \print@columnseparator%
5129 \parbox[t][][t]{\Rcolwidth}{%
5130 \csuse{before@pstartR@\the\l@dpscR}%
5131 }%
5132 \ifdefstring{\columns@position}{R}{}{\hfill}%
5133 }%
5134 }%
5135 \global\csundef{before@pstartL@\the\l@dpscL}%
5136 \global\csundef{before@pstartR@\the\l@dpscR}%
5137 }%
5138 \newcommand{\Columns@print@after@pend}{%
5139 \ifboolexpr{%
5140 test{\ifcsstring{after@pendL@\the\l@dpscL}{\at@every@pend}}%
5141 and test {\ifcsstring{after@pendR@\the\l@dpscR}{\at@every@pend}}%
5142 and test {\ifdefempty{\at@every@pend}}}%
5143 {}%
5144 {%
5145 \hb@xt@ \hsize{%
5146 \ifdefstring{\columns@position}{L}{}{\hfill }%
5147 \parbox[t][][t]{\Lcolwidth}{%
5148 \csuse{after@pendL@\the\l@dpscL}%
5149 }%
5150 \print@columnseparator%
5151 \parbox[t][][t]{\Rcolwidth}{%
5152 \csuse{after@pendR@\the\l@dpscR}%
5153 }%
5154 \ifdefstring{\columns@position}{R}{}{\hfill}%
5155 }%
5156 }%
5157 \global\csundef{after@pendL@\the\l@dpscL}%
5158 \global\csundef{after@pendR@\the\l@dpscR}%
5159 }%
5160 % \end{macrocode}
5161 % \end{macro}
5162 % \end{macro}
5163 % \section{Parallel pages}
5164 %
5165 % This is considerably more complicated than parallel columns.
5166 %
5167 % \subsection{Specific counters}
5168 % \begin{macro}{\numpagelinesL}
5169 % \begin{macro}{\numpagelinesR}
5170 % \begin{macro}{\l@dminpagelines}
5171 % Counts for the number of lines on a left or right page, and the smaller
5172 % of the number of lines on a pair of facing pages.
5173 % \begin{macrocode}
5174 \newcount\numpagelinesL
5175 \newcount\numpagelinesR
5176 \newcount\l@dminpagelines
5177
5178 % \end{macrocode}
5179 % \end{macro}
5180 % \end{macro}
5181 % \end{macro}
5182 % \subsection{Main macro}
5183 % \begin{macro}{\Pages}
5184 % \changes{v1.8.0}{2014/07/28}{Modify \cs{Pages} to enable to add section's title.}
5185 % \changes{v1.8.3}{2014/08/31}{Debug blank pages when using optional argument in the last \cs{pend}.}
5186 % \changes{v1.10.0}{2015/01/12}{Debug wrong pages splitting when no optional argument is used in last \cs{pend} (bug was added in v.1.8.3).}
5187 % \changes{v1.10.0}{2015/01/12}{Debug wrong parallel pages synchronization when an \cs{edtext} falls accross two pages.}
5188 % \changes{v1.13.0}{2015/03/06}{When using shiftedpstarts option, a \cs{l@dleftbox} with a null height will advance the \cs{pagetotal} in any case.}
5189 % \changes{v1.13.1}{2015/03/12}{Prevent false empty page after \cs{Pages} (bug added in 1.13.0)}
5190 % The \cs{Pages} command results in the previous Left and
5191 % Right texts being typeset on matching facing pages. There should
5192 % be equal numbers of chunks in the left and right texts.
5193 %
5194 % \changes{v1.12.0}{2015/02/23}{Add \cs{l@dprintingpagestrue}}
5195 % \begin{macrocode}
5196 \newcommand*{\Pages}{%
5197 \l@dprintingpagestrue%
5198 \ifl@dpairing%
5199 \led@err@Pages@InsideEnv%
5200 \fi%
5201 \eledsection@correcting@skip=-2\baselineskip% line correcting for section titles.
5202 \parledgroup@notespacing@set@correction%
5203 \typeout{}%
5204 \typeout{*************************** PAGES ***************************}%
5205 \ifnum\l@dnumpstartsL=\l@dnumpstartsR\else%
5206 \led@err@BadLeftRightPstarts{\the\l@dnumpstartsL}{\the\l@dnumpstartsR}%
5207 \fi%
5208 % \end{macrocode}
5209 % \changes{v1.13.0}{2015/03/06xx}{Prevent false overfull hboxes when using \cs{Pages} outside of pages environment.}
5210 % As \cs{Pages} must be called outside of the pages environment, we have to redefine the \cs{Lcolwidth} and \cs{Rcolwidth} lengths, to prevent false overfull hboxes.
5211 % \begin{macrocode}
5212 \setlength{\Lcolwidth}{\textwidth}%
5213 \setlength{\Rcolwidth}{\textwidth}%
5214 % \end{macrocode}
5215 % Get onto an empty even (left) page, then initialise counters, etc.
5216 % \begin{macrocode}
5217 \cleartol@devenpage%
5218 \begingroup%
5219 \l@dzeropenalties%
5220 \endgraf\global\num@lines=\prevgraf%
5221 \global\num@linesR=\prevgraf%
5222 \global\par@line=\z@%
5223 \global\par@lineR=\z@%
5224 \global\l@dpscL=\z@%
5225 \global\l@dpscR=\z@%
5226 \writtenlinesLfalse%
5227 \writtenlinesRfalse%
5228 % \end{macrocode}
5229 % Sometimes, people what to have the same page number on both left and right sides. To do this, use the \cs{init@sameparallelpage@number} command.
5230 % \begin{macrocode}
5231 \init@sameparallelpage@number
5232 % \end{macrocode}
5233 % The footnotes are printed in a different way from expected in \Lpack{eledmac}, as we may want to print the notes on one side only.
5234 % \begin{macrocode}
5235 \let\print@Xnotes\print@Xnotes@forpages%
5236 \let\print@notesX\print@notesX@forpages%
5237 % \end{macrocode}
5238 % Check if there are chunks to be processed.
5239 % \begin{macrocode}
5240 \check@pstarts%
5241 \loop\if@pstarts%
5242 % \end{macrocode}
5243 % Loop over the number of chunks, incrementing the chunk counts
5244 % (\cs{l@dpscL}
5245 % and \cs{l@dpscR} are chunk (box) counts.)
5246 % \begin{macrocode}
5247 \global\advance\l@dpscL \@ne%
5248 \global\advance\l@dpscR \@ne%
5249 % \end{macrocode}
5250 % Calculate the maximum number of real text lines in the chunk pair,
5251 % storing the result in the relevant \cs{l@dmaxlinesinpar}.
5252 % \begin{macrocode}
5253 \getlinesfromparlistL%
5254 \getlinesfromparlistR%
5255 \l@dcalc@maxoftwo{\@cs@linesinparL}{\@cs@linesinparR}%
5256 {\usenamecount{l@dmaxlinesinpar\the\l@dpscL}}%
5257 \check@pstarts%
5258 \repeat%
5259 % \end{macrocode}
5260 % Zero the counts again, ready for the next bit.
5261 % \begin{macrocode}
5262 \global\l@dpscL=\z@%
5263 \global\l@dpscR=\z@%
5264 % \end{macrocode}
5265 % Get the number of lines on the first pair of pages and store
5266 % the minumum in \cs{l@dminpagelines}.
5267 % \begin{macrocode}
5268 \getlinesfrompagelistL%
5269 \getlinesfrompagelistR%
5270 \l@dcalc@minoftwo{\@cs@linesonpageL}{\@cs@linesonpageR}%
5271 {\l@dminpagelines}%
5272 % \end{macrocode}
5273 % Now we start processing the left and right chunks (\cs{l@dpscL} and
5274 % \cs{l@dpscR} count the left and right chunks), starting with the first pair.
5275 % \begin{macrocode}
5276 \check@pstarts%
5277 \if@pstarts%
5278 % \end{macrocode}
5279 % Increment the chunk counts to get the first pair.
5280 % Restore also the value of public pstart counters.
5281 % \begin{macrocode}
5282 \global\advance\l@dpscL \@ne%
5283 \global\advance\l@dpscR \@ne%
5284 \restore@pstartL@pc%
5285 \restore@pstartR@pc%
5286 % \end{macrocode}
5287 % We haven't processed any lines from these chunks yet, so zero the
5288 % respective line counts.
5289 % \begin{macrocode}
5290 \global\@donereallinesL=\z@%
5291 \global\@donetotallinesL=\z@%
5292 \global\@donereallinesR=\z@%
5293 \global\@donetotallinesR=\z@%
5294 % \end{macrocode}
5295 % Start a loop over the boxes (chunks).
5296 % \begin{macrocode}
5297 \checkraw@text%
5298 % \end{macrocode}
5299 % \begin{macrocode}
5300 % \begingroup
5301 { \loop\ifaraw@text%
5302 % \end{macrocode}
5303 % See if there is more that can be done for the left page and set up the
5304 % left language.
5305 % \changes{v0.2.0}{2004/12/20}{Added \cs{l@duselanguage} to \cs{Pages}}
5306 % \begin{macrocode}
5307 \checkpageL%
5308 \l@duselanguage{\theledlanguageL}%
5309 { \loop\ifl@dsamepage%
5310 % \end{macrocode}
5311 % Process the next (left) text line, adding it to the page.
5312 % Eventually, adds the optional argument of pstart.
5313 % \changes{v0.3.0}{2005/02/10}{Added \cs{ledstrutL} to \cs{Pages}}
5314 % \begin{macrocode}
5315 \ifdefstring{\@eledsectnotoc}{L}{\ledsectnotoc}{}%
5316 \csuse{before@pstartL@\the\l@dpscL}%
5317 \global\csundef{before@pstartL@\the\l@dpscL}%
5318 \do@lineL%
5319 \xifinlist{\the\l@dpscL}{\eled@sections@@}
5320 {\print@eledsectionL}%
5321 {}%
5322 \advance\numpagelinesL \@ne%
5323 % \end{macrocode}
5324 % When using shiftedpstarts option, a \cs{l@dleftbox} with a null height is not printed.
5325 % That means we do not insert blank lines at the end of a left chunk lower than the corresponding right chunk.
5326 % However, a \cs{l@dleftbox} with a null height will advance the \cs{pagetotal} in any case.
5327 % Because if we do not do this, the \cs{checkpageL} could let \cs{ifl@pagefull} to false,
5328 % and consequently a \cs{@lopL} equal to 1000 could be written in the numbered file,
5329 % even if all the lines actually needed for the current page have been printed.
5330 % \l@dleftbox
5331 % \begin{macrocode}
5332 \ifshiftedpstarts%
5333 \ifdim\ht\l@dleftbox>0pt\hb@xt@%
5334 \hsize{\ledstrutL\unhbox\l@dleftbox}%
5335 \else%
5336 \dimen0=\pagetotal%
5337 \advance\dimen0 by \baselineskip%
5338 \global\pagetotal=\dimen0%
5339 \fi%
5340 \else%
5341 \parledgroup@correction@notespacing{L}
5342 \hb@xt@ \hsize{\ledstrutL\unhbox\l@dleftbox}%
5343 \fi%
5344 % \end{macrocode}
5345 % Perhaps we have to move to the next (left) box. Check if we have got all
5346 % we can onto the page. If not, repeat for the next line.
5347 % Check if we have to print the optional argument of the last pend.
5348 % Check if the page is full.
5349 % Check if the verse is split in two subsequent pages.
5350 % Check there is any forced page breaks.
5351 % Reset the verse skipnumber boolean
5352 % \begin{macrocode}
5353 \get@nextboxL%
5354 \global\l@dskipversenumberfalse%
5355 \ifprint@last@after@pendL%
5356 \csuse{after@pendL@\the\l@dpscL}%
5357 \global\csundef{after@pendL@\the\l@dpscL}%
5358 \fi%
5359 \checkpageL%
5360 \checkverseL%
5361 \checkpbL%
5362 \repeat%
5363 % \end{macrocode}
5364 % That (left) page has been filled. Output the number of real lines
5365 % on the page --- if the page break is because the page has been
5366 % filled with lines, use the actual number, otherwise the page has been
5367 % ended early in order to synchronise with the facing page so use an
5368 % impossibly large number.
5369 % \begin{macrocode}
5370 \ifl@dpagefull%
5371 \@writelinesonpageL{\the\numpagelinesL}%
5372 \else%
5373 \@writelinesonpageL{1000}%
5374 \fi%
5375 % \end{macrocode}
5376 % Reset to zero the left-page line count, clear the page to get onto the facing
5377 % (odd, right) page, and reinitialize the accumulated dimension of interline correction for notes in parallel ledgroup.
5378 % \begin{macrocode}
5379 \numpagelinesL \z@%
5380 \parledgroup@correction@notespacing@init%
5381 \clearl@dleftpage }%
5382 % \end{macrocode}
5383 % Now do the same for the right text.
5384 % \changes{v0.3.0}{2005/02/10}{Added \cs{ledstrutR} to \cs{Pages}}
5385 % \begin{macrocode}
5386 \checkpageR%
5387 \l@duselanguage{\theledlanguageR}%
5388 { \loop\ifl@dsamepage%
5389 \initnumbering@sectcountR%
5390 \ifdefstring{\@eledsectnotoc}{R}{\ledsectnotoc}{}%
5391 \csuse{before@pstartR@\the\l@dpscR}%
5392 \global\csundef{before@pstartR@\the\l@dpscR}%
5393 \do@lineR%
5394 \xifinlist{\the\l@dpscR}{\eled@sectionsR@@}%
5395 {\print@eledsectionR}%
5396 {}%
5397 \advance\numpagelinesR \@ne%
5398 \ifshiftedpstarts%
5399 \ifdim\ht\l@drightbox>0pt\hb@xt@%
5400 \hsize{\ledstrutR\unhbox\l@drightbox}%
5401 \else%
5402 \dimen0=\pagetotal%
5403 \advance\dimen0 by \baselineskip%
5404 \global\pagetotal=\dimen0%
5405 \fi%
5406 \else%
5407 \parledgroup@correction@notespacing{R}%
5408 \hb@xt@ \hsize{\ledstrutR\unhbox\l@drightbox}%
5409 \fi%
5410 \get@nextboxR%
5411 \global\l@dskipversenumberRfalse%
5412 \ifprint@last@after@pendR%
5413 \csuse{after@pendR@\the\l@dpscR}%
5414 \global\csundef{after@pendR@\the\l@dpscR}%
5415 \fi%
5416 \checkpageR%
5417 \checkverseR%
5418 \checkpbR%
5419 \repeat%
5420 \ifl@dpagefull%
5421 \@writelinesonpageR{\the\numpagelinesR}%
5422 \else%
5423 \@writelinesonpageR{1000}%
5424 \fi%
5425 \numpagelinesR=\z@%
5426 \parledgroup@correction@notespacing@init%
5427 % \end{macrocode}
5428 % The page is full, so move onto the next (left, odd) page and repeat left
5429 % text processing.
5430 % \begin{macrocode}
5431 \clearl@drightpage}%
5432 % \end{macrocode}
5433 % More to do? If there is we have to get the number of lines for the next
5434 % pair of pages before starting to output them.
5435 % \changes{v0.3.b}{2005/04/08}{Added \cs{l@dminpagelines} calculation
5436 % for succeeding page pairs}
5437 % \begin{macrocode}
5438 \checkraw@text%
5439 \ifaraw@text%
5440 \getlinesfrompagelistL%
5441 \getlinesfrompagelistR%
5442 \l@dcalc@minoftwo{\@cs@linesonpageL}{\@cs@linesonpageR}%
5443 {\l@dminpagelines}%
5444 \fi%
5445 \repeat}%
5446 % \end{macrocode}
5447 % We have now output the text from all the chunks.
5448 % \begin{macrocode}
5449 \fi%
5450 % \end{macrocode}
5451 % Make sure that there are no inserts hanging around.
5452 % \begin{macrocode}
5453 \flush@notes%
5454 \flush@notesR%
5455 \endgroup%
5456 % \end{macrocode}
5457 % Zero counts ready for the next set of left/right text chunks. The boolean tests for stanza are switched to false.
5458 % \begin{macrocode}
5459 \global\l@dpscL=\z@%
5460 \global\l@dpscR=\z@%
5461 \global\l@dnumpstartsL=\z@%
5462 \global\l@dnumpstartsR=\z@%
5463 \global\instanzaLfalse%
5464 \global\instanzaRfalse%
5465 \l@dprintingpagesfalse%
5466 \finish@sameparallelpage@number%In order to have continuous page number
5467 \finish@Pages@notes%Needed to prevent final notes overlap line number
5468 \ignorespaces}
5469
5470
5471 % \end{macrocode}
5472 % \end{macro}
5473 %
5474 % \subsection{Ensure all notes be printed at the end of parallel pages}
5475 % \begin{macro}{\finish@Pages@notes}
5476 % This macro ensures that all long notes are printed at the end of \cs{Pages} typessetting, and that there is no more long notes left for the next pages.
5477 % \begin{macrocode}
5478 \newcommand{\finish@Pages@notes}{%
5479 \def\do##1{%
5480 % \end{macrocode}
5481 % First, declare footnote box if there was no previous declared.
5482 % E.g. if familiar or critical notes were disabled by \eledmac{} options.
5483 % \begin{macrocode}
5484 \ifnocritical@%
5485 \global\newnamebox{##1footins}
5486 \fi
5487 \ifnofamiliar@%
5488 \global\newnamebox{footins##1}
5489 \fi
5490 % \end{macrocode}
5491 % And now, add a \cs{newpage} if there is no more footnote to print.
5492 % \begin{macrocode}
5493 \ifvoid\csuse{##1footins}%
5494 \ifvoid\csuse{footins##1}\else%
5495 \newpage\null%
5496 \listbreak%
5497 \fi%
5498 \else%
5499 \newpage\null%
5500 \listbreak%
5501 \fi%
5502 }%
5503 \dolistloop{\@series}%
5504 }%
5505 % \end{macrocode}
5506 % \end{macro}
5507 % \subsection{Struts}
5508 % \begin{macro}{\ledstrutL}
5509 % \begin{macro}{\ledstrutR}
5510 % Struts inserted into leftand right text lines.
5511 % \changes{v0.3.0}{2005/02/10}{Added \cs{ledtrutL} and \cs{ledstrutR}}
5512 % \begin{macrocode}
5513 \newcommand*{\ledstrutL}{\strut}
5514 \newcommand*{\ledstrutR}{\strut}
5515
5516 % \end{macrocode}
5517 % \end{macro}
5518 % \end{macro}
5519 %
5520 %
5521 % \subsection{Page clearing}
5522 % \begin{macro}{\cleartoevenpage}
5523 % \begin{macro}{\cleartol@devenpage}
5524 % \cs{cleartoevenpage}, which is defined in the memoir class,
5525 % is like \cs{clear(double)page} except that we
5526 % end up on an even page.
5527 % \cs{cleartol@devenpage} is similar except that it first checks to see
5528 % if it is already on an empty page.
5529 % \begin{macrocode}
5530 \providecommand{\cleartoevenpage}[1][\@empty]{%
5531 \clearpage
5532 \ifodd\c@page\hbox{}#1\clearpage\fi}
5533 \newcommand*{\cleartol@devenpage}{%
5534 \ifdim\pagetotal<\topskip% on an empty page
5535 \else
5536 \clearpage
5537 \fi
5538 \ifodd\c@page\hbox{}\clearpage\fi}
5539 % \end{macrocode}
5540 % \end{macro}
5541 % \end{macro}
5542 % \begin{macro}{\clearl@dleftpage}
5543 % \begin{macro}{\clearl@drightpage}
5544 % \cs{clearl@dleftpage} and \cs{clearl@drightpage} get us onto
5545 % an odd and even page, respectively, checking that we end up on
5546 % the subsquent page.
5547 % Both commands use \cs{newpage} and not \cs{clearpage}.
5548 % Because \cs{clearpage} prints all footnotes before the next page, even if it has to add new empty pages, while \cs{newpage} does not.
5549 % And as we want notes started in the left page continue in the right page and \emph{vice-versa}, we must use \cs{newpage} and not \cs{clearpage}
5550 %
5551 % \changes{v1.13.0}{2015/03/06x}{Use \cs{newpage} instead of \cs{clearpage}.}
5552 % \begin{macrocode}
5553 \newcommand*{\clearl@dleftpage}{%
5554 \ifdim\pagetotal=0pt\hbox{}\fi%
5555 \newpage%
5556 \ifodd\c@page\else
5557 \led@err@LeftOnRightPage
5558 \hbox{}%
5559 \cleardoublepage
5560 \fi}
5561
5562 \newcommand*{\clearl@drightpage}{%
5563 \ifdim\pagetotal=0pt\hbox{}\fi%
5564 \newpage%
5565 \stepcounter{sameparallelpage@number}%
5566 \ifodd\c@page
5567 \led@err@RightOnLeftPage
5568 \hbox{}%
5569 \cleartoevenpage
5570 \fi}
5571
5572 % \end{macrocode}
5573 % \end{macro}
5574 % \end{macro}
5575 %
5576 % \subsection{Lines managing}
5577 % \begin{macro}{\getlinesfromparlistL}
5578 % \begin{macro}{\@cs@linesinparL}
5579 % \begin{macro}{\getlinesfromparlistR}
5580 % \begin{macro}{\@cs@linesinparR}
5581 % \cs{getlinesfromparlistL} gets the next entry from the
5582 % \cs{linesinpar@listL} and puts it into \cs{@cs@linesinparL}; if the
5583 % list is empty, it sets \cs{@cs@linesinparL} to 0. Similarly
5584 % for \cs{getlinesfromparlistR}.
5585 % \begin{macrocode}
5586 \newcommand*{\getlinesfromparlistL}{%
5587 \ifx\linesinpar@listL\empty
5588 \gdef\@cs@linesinparL{0}%
5589 \else
5590 \gl@p\linesinpar@listL\to\@cs@linesinparL
5591 \fi}
5592 \newcommand*{\getlinesfromparlistR}{%
5593 \ifx\linesinpar@listR\empty
5594 \gdef\@cs@linesinparR{0}%
5595 \else
5596 \gl@p\linesinpar@listR\to\@cs@linesinparR
5597 \fi}
5598
5599 % \end{macrocode}
5600 % \end{macro}
5601 % \end{macro}
5602 % \end{macro}
5603 % \end{macro}
5604 %
5605 % \begin{macro}{\getlinesfrompagelistL}
5606 % \begin{macro}{\@cs@linesonpageL}
5607 % \begin{macro}{\getlinesfrompagelistR}
5608 % \begin{macro}{\@cs@linesonpageR}
5609 % \cs{getlinesfrompagelistL} gets the next entry from the
5610 % \cs{linesonpage@listL} and puts it into \cs{@cs@linesonpageL}; if the
5611 % list is empty, it sets \cs{@cs@linesonpageL} to 1000. Similarly
5612 % for \cs{getlinesfrompagelistR}.
5613 % \begin{macrocode}
5614 \newcommand*{\getlinesfrompagelistL}{%
5615 \ifx\linesonpage@listL\empty
5616 \gdef\@cs@linesonpageL{1000}%
5617 \else
5618 \gl@p\linesonpage@listL\to\@cs@linesonpageL
5619 \fi}
5620 \newcommand*{\getlinesfrompagelistR}{%
5621 \ifx\linesonpage@listR\empty
5622 \gdef\@cs@linesonpageR{1000}%
5623 \else
5624 \gl@p\linesonpage@listR\to\@cs@linesonpageR
5625 \fi}
5626
5627 % \end{macrocode}
5628 % \end{macro}
5629 % \end{macro}
5630 % \end{macro}
5631 % \end{macro}
5632 %
5633 % \begin{macro}{\@writelinesonpageL}
5634 % \begin{macro}{\@writelinesonpageR}
5635 % These macros output the number of lines on a page to the section file
5636 % in the form of \cs{@lopL} or \cs{@lopR} macros.
5637 % \begin{macrocode}
5638 \newcommand*{\@writelinesonpageL}[1]{%
5639 \edef\next{\write\linenum@out{\string\@lopL{#1}}}%
5640 \next}
5641 \newcommand*{\@writelinesonpageR}[1]{%
5642 \edef\next{\write\linenum@outR{\string\@lopR{#1}}}%
5643 \next}
5644
5645 % \end{macrocode}
5646 % \end{macro}
5647 % \end{macro}
5648 %
5649 %
5650 % \begin{macro}{\l@dcalc@maxoftwo}
5651 % \begin{macro}{\l@dcalc@minoftwo}
5652 % \cs{l@dcalc@maxoftwo}\marg{num}\marg{num}\marg{count} sets \meta{count}
5653 % to the maximum of the two \meta{num}.
5654 %
5655 % Similarly
5656 % \cs{l@dcalc@minoftwo}\marg{num}\marg{num}\marg{count} sets \meta{count}
5657 % to the minimum of the two \meta{num}.
5658 %
5659 % \begin{macrocode}
5660 \newcommand*{\l@dcalc@maxoftwo}[3]{%
5661 \ifnum #2>#1\relax
5662 #3=#2\relax
5663 \else
5664 #3=#1\relax
5665 \fi}
5666 \newcommand*{\l@dcalc@minoftwo}[3]{%
5667 \ifnum #2<#1\relax
5668 #3=#2\relax
5669 \else
5670 #3=#1\relax
5671 \fi}
5672
5673 % \end{macrocode}
5674 % \end{macro}
5675 % \end{macro}
5676 %
5677 % \subsection{Page break managing}
5678 % \begin{macro}{\ifl@dsamepage}
5679 % \begin{macro}{\l@dsamepagetrue}
5680 % \begin{macro}{\l@dsamepagefalse}
5681 % \begin{macro}{\ifl@dpagefull}
5682 % \begin{macro}{\l@dpagefulltrue}
5683 % \begin{macro}{\l@dpagefullfalse}
5684 % \begin{macro}{\checkpageL}
5685 % \begin{macro}{\checkpageR}
5686 % \cs{checkpageL} tests if the space and lines already taken on the page by
5687 % text and footnotes is less than the constraints. If so, then
5688 % \cs{ifl@dpagefull} is set FALSE and \cs{ifl@dsamepage} is set TRUE.
5689 % If the page is spatially full
5690 % then \cs{ifl@dpagefull} is set TRUE and \cs{ifl@dsamepage} is set FALSE.
5691 % If it is not spatially full but the maximum number of lines have been
5692 % output then both \cs{ifl@dpagefull} and \cs{ifl@dsamepage}
5693 % are set FALSE.
5694 %
5695 % \begin{macrocode}
5696 \newif\ifl@dsamepage
5697 \l@dsamepagetrue
5698 \newif\ifl@dpagefull
5699
5700 \newcommand*{\checkpageL}{%
5701 \l@dpagefulltrue
5702 \l@dsamepagetrue
5703 \check@goal
5704 \ifdim\pagetotal<\ledthegoal
5705 \ifnum\numpagelinesL<\l@dminpagelines
5706 \else
5707 \l@dsamepagefalse
5708 \l@dpagefullfalse
5709 \fi
5710 \else
5711 \l@dsamepagefalse
5712 \l@dpagefulltrue
5713 \fi%
5714 \ifprint@last@after@pendL%
5715 \l@dpagefullfalse%
5716 \l@dsamepagefalse%
5717 \print@last@after@pendLfalse%
5718 \fi%
5719 }%
5720
5721 \newcommand*{\checkpageR}{%
5722 \l@dpagefulltrue
5723 \l@dsamepagetrue
5724 \check@goal
5725 \ifdim\pagetotal<\ledthegoal
5726 \ifnum\numpagelinesR<\l@dminpagelines
5727 \else
5728 \l@dsamepagefalse
5729 \l@dpagefullfalse
5730 \fi
5731 \else
5732 \l@dsamepagefalse
5733 \l@dpagefulltrue
5734 \fi%
5735 \ifprint@last@after@pendR%
5736 \l@dpagefullfalse%
5737 \l@dsamepagefalse%
5738 \print@last@after@pendRfalse%
5739 \fi%
5740 }%
5741
5742 % \end{macrocode}
5743 % \end{macro}
5744 % \end{macro}
5745 % \end{macro}
5746 % \end{macro}
5747 % \end{macro}
5748 % \end{macro}
5749 % \end{macro}
5750 % \end{macro}
5751 % \begin{macro}{\checkpbL}
5752 % \begin{macro}{\checkpbR}
5753 % \cs{checkpbL} and \cs{checkpbR} are called after each line is printed, and after the page is checked. These commands correct page breaks depending on \cs{ledpb} and \cs{lednopb}.
5754 % \begin{macrocode}
5755 \newcommand{\checkpbL}{
5756 \IfStrEq{\led@pb@setting}{after}{
5757 \xifinlistcs{\the\absline@num}{l@prev@pb}{\l@dpagefulltrue\l@dsamepagefalse}{}
5758 \xifinlistcs{\the\absline@num}{l@prev@nopb}{\l@dpagefullfalse\l@dsamepagetrue}{}
5759 }{}
5760 \IfStrEq{\led@pb@setting}{before}{
5761 \numdef{\next@absline}{\the\absline@num+1}
5762 \xifinlistcs{\next@absline}{l@prev@pb}{\l@dpagefulltrue\l@dsamepagefalse}{}
5763 \xifinlistcs{\next@absline}{l@prev@nopb}{\l@dpagefullfalse\l@dsamepagetrue}{}
5764 }{}
5765 }
5766
5767 \newcommand{\checkpbR}{
5768 \IfStrEq{\led@pb@setting}{after}{
5769 \xifinlistcs{\the\absline@numR}{l@prev@pbR}{\l@dpagefulltrue\l@dsamepagefalse}{}
5770 \xifinlistcs{\the\absline@numR}{l@prev@nopbR}{\l@dpagefullfalse\l@dsamepagetrue}{}
5771 }{}
5772 \IfStrEq{\led@pb@setting}{before}{
5773 \numdef{\next@abslineR}{\the\absline@numR+1}
5774 \xifinlistcs{\next@abslineR}{l@prev@pbR}{\l@dpagefulltrue\l@dsamepagefalse}{}
5775 \xifinlistcs{\next@abslineR}{l@prev@nopbR}{\l@dpagefullfalse\l@dsamepagetrue}{}
5776 }{}
5777 }
5778 % \end{macrocode}
5779 % \end{macro}
5780 % \end{macro}
5781 % \begin{macro}{\checkverseL}
5782 % \begin{macro}{\checkverseR}
5783 % \cs{checkverseL} and \cs{checkverseR} are called after each line is printed.
5784 % They prevent page break inside verse.
5785 % \begin{macrocode}
5786 \newcommand{\checkverseL}{
5787 \ifinstanzaL
5788 \iflednopbinverse
5789 \ifinserthangingsymbol
5790 \numgdef{\prev@abslineverse}{\the\absline@num-1}
5791 \IfStrEq{\led@pb@setting}{after}{\lednopbnum{\prev@abslineverse}}{}
5792 \IfStrEq{\led@pb@setting}{before}{\ifnum\numpagelinesL<3\ledpbnum{\prev@abslineverse}\fi}{}
5793 \fi
5794 \fi
5795 \fi
5796 }
5797 \newcommand{\checkverseR}{
5798 \ifinstanzaR
5799 \iflednopbinverse
5800 \ifinserthangingsymbolR
5801 \numgdef{\prev@abslineverse}{\the\absline@numR-1}
5802 \IfStrEq{\led@pb@setting}{after}{\lednopbnumR{\prev@abslineverse}}{}
5803 \IfStrEq{\led@pb@setting}{before}{\ifnum\numpagelinesR<3\ledpbnumR{\prev@abslineverse}\fi}{}
5804 \fi
5805 \fi
5806 \fi
5807 }
5808 % \end{macrocode}
5809 % \end{macro}
5810 % \end{macro}
5811 % \begin{macro}{\ledthegoal}
5812 % \begin{macro}{\goalfraction}
5813 % \begin{macro}{\check@goal}
5814 % \cs{ledthegoal} is the amount of space allowed to taken by text and
5815 % footnotes on a page before a forced pagebreak. This can be controlled via
5816 % \cs{goalfraction}. \cs{ledthegoal} is calculated via \cs{check@goal}.
5817 % \begin{macrocode}
5818 \newdimen\ledthegoal
5819 \ifshiftedpstarts
5820 \newcommand*{\goalfraction}{0.95}
5821 \else
5822 \newcommand*{\goalfraction}{0.9}
5823 \fi
5824
5825 \newcommand*{\check@goal}{%
5826 \ledthegoal=\goalfraction\pagegoal}
5827
5828 % \end{macrocode}
5829 % \end{macro}
5830 % \end{macro}
5831 % \end{macro}
5832 %
5833 %
5834 % \begin{macro}{\ifwrittenlinesL}
5835 % \begin{macro}{\ifwrittenlinesL}
5836 % Booleans for whether line data has been written to the section file.
5837 % \begin{macrocode}
5838 \newif\ifwrittenlinesL
5839 \newif\ifwrittenlinesR
5840
5841 % \end{macrocode}
5842 % \end{macro}
5843 % \end{macro}
5844 %
5845 % \subsection{Getting boxes content}
5846 % \begin{macro}{\get@nextboxL}
5847 % \begin{macro}{\get@nextboxR}
5848 % \changes{v0.11.0}{2012/06/11}{Change \cs{get@nextboxL} and \cs{get@nextboxR} to allow to disable line numbering (like in eledmac 0.15).}
5849 % If the current box is not empty (i.e., still contains some lines)
5850 % nothing is done. Otherwise if and only if a synchronisation point is
5851 % reached the next box is started.
5852 %
5853 % \begin{macrocode}
5854 \newcommand*{\get@nextboxL}{%
5855 \ifvbox\namebox{l@dLcolrawbox\the\l@dpscL}% box is not empty
5856 % \end{macrocode}
5857 % The current box is not empty; do nothing.
5858 % \begin{macrocode}
5859 \else% box is empty
5860 % \end{macrocode}
5861 % The box is empty.
5862 % Check if enough lines (real and blank) have been
5863 % output.
5864 % \begin{macrocode}
5865 \ifnum\usenamecount{l@dmaxlinesinpar\the\l@dpscL}>\@donetotallinesL
5866 \parledgroup@notes@endL
5867 \else
5868 % \end{macrocode}
5869 % Sufficient lines have been output.
5870 % \begin{macrocode}
5871 \ifnum\usenamecount{l@dmaxlinesinpar\the\l@dpscL}=\@donetotallinesL
5872 \parledgroup@notes@endL
5873 \fi
5874 \ifwrittenlinesL\else
5875 % \end{macrocode}
5876 % Write out the number of lines done, and set the boolean so this is only
5877 % done once.
5878 % \begin{macrocode}
5879 \@writelinesinparL
5880 \writtenlinesLtrue
5881 \fi
5882 \ifnum\l@dnumpstartsL>\l@dpscL
5883 % \end{macrocode}
5884 % \changes{v0.11.0}{2012/06/11}{Pstart number can be printed in side}
5885 % There are still unprocessed boxes. Recalculate the maximum number of
5886 % lines needed, and move onto the next box (by incrementing \cs{l@dpscL}). If needed, restart the line numbering.
5887 % \begin{macrocode}
5888 \writtenlinesLfalse
5889 \ifbypstart@
5890 \global\line@num=0%
5891 \resetprevline@%
5892 \fi
5893 % Add the content of the optional argument of the previous \cs{pend}.
5894 % \begin{macrocode}
5895 \csuse{after@pendL@\the\l@dpscL}%
5896 \global\csundef{after@pendL@\the\l@dpscL}%
5897 % \end{macrocode}
5898 % Check the number of lines
5899 % \begin{macrocode}
5900 \l@dcalc@maxoftwo{\the\usenamecount{l@dmaxlinesinpar\the\l@dpscL}}%
5901 {\the\@donetotallinesL}%
5902 {\usenamecount{l@dmaxlinesinpar\the\l@dpscL}}%
5903 \global\@donetotallinesL \z@
5904 % \end{macrocode}
5905 % Go to the next pstart
5906 % \begin{macrocode}
5907 \global\advance\l@dpscL \@ne
5908 \global\pstartnumtrue%
5909 \restore@pstartL@pc%
5910 % \end{macrocode}
5911 % Add notes of parallel ledgroup.
5912 % \begin{macrocode}
5913 \parledgroup@notes@endL
5914 \parledgroup@correction@notespacing@final{L}
5915 \else
5916 % \end{macrocode}
5917 % \begin{macrocode}
5918 \fi
5919 \fi
5920 \fi}
5921 % \end{macrocode}
5922 %
5923 % \begin{macrocode}
5924 \newcommand*{\get@nextboxR}{%
5925 \ifvbox\namebox{l@dRcolrawbox\the\l@dpscR}% box is not empty
5926 \else% box is empty
5927 \ifnum\usenamecount{l@dmaxlinesinpar\the\l@dpscR}>\@donetotallinesR
5928 \parledgroup@notes@endR
5929 \else
5930 \ifnum\usenamecount{l@dmaxlinesinpar\the\l@dpscR}=\@donetotallinesR
5931 \parledgroup@notes@endR
5932 \fi
5933 \ifwrittenlinesR\else
5934 \@writelinesinparR
5935 \writtenlinesRtrue
5936 \fi
5937 \ifnum\l@dnumpstartsR>\l@dpscR
5938 \writtenlinesRfalse
5939 \ifbypstart@R
5940 \global\line@numR=0%
5941 \resetprevline@%
5942 \fi
5943 \csuse{after@pendR@\the\l@dpscR}%
5944 \global\csundef{after@pendR@\the\l@dpscR}%
5945 \l@dcalc@maxoftwo{\the\usenamecount{l@dmaxlinesinpar\the\l@dpscR}}%
5946 {\the\@donetotallinesR}%
5947 {\usenamecount{l@dmaxlinesinpar\the\l@dpscR}}%
5948 \global\@donetotallinesR \z@
5949 \global\advance\l@dpscR \@ne
5950 \global\pstartnumRtrue%
5951 \restore@pstartR@pc%
5952 \parledgroup@notes@endR
5953 \parledgroup@correction@notespacing@final{R}
5954 \else
5955 \print@last@after@pendRtrue%
5956 \fi
5957 \fi
5958 \fi}
5959
5960 % \end{macrocode}
5961 % \end{macro}
5962 % \end{macro}
5963 %
5964 % \subsection{Same page number in both side}
5965 % The \verb+sameparallelpagenumber+ allow to have the same page number for the left and the right side
5966 % We can not do it by changing the value of the \verb|page| counter, since its value is used to determine whether a page is left or right.
5967 % Consequently, we have to do it by patching \cs{thepage} inside a \cs{Pages} macro.
5968 %
5969 %
5970 % \begin{macro}{\init@sameparallelpage@number}
5971 % This macro is called at the beginning of \cs{Pages}.
5972 % It patches the \cs{thepage} macro in order to
5973 % and to use the value of \verb+sameparallelpage@number+ \LaTeX counter instead of those of \verb+page+ \LaTeX counter.
5974 % As we are inside a group, the patch is local, and, consequently, the page printed after the \cs{Pages} will use the normal page number scheme.
5975 %
5976 % The value of \verb+sameparallelpage@number+ is increase by 1 when we change from right page to left page.
5977 % \begin{macrocode}
5978 \newcounter{sameparallelpage@number}
5979 \newcommand{\init@sameparallelpage@number}{%
5980 \setcounter{sameparallelpage@number}{\c@page}%
5981 \ifsameparallelpagenumber%
5982 \patchcmd{\thepage}{page}{sameparallelpage@number}{}{}%
5983 \fi%
5984 }%
5985 % \end{macrocode}
5986 % \end{macro}
5987 % \begin{macro}{\finish@sameparallelpage@number}
5988 % This macro is called at the end of \cs{Pages}.
5989 % If the \verb+sameparallelpage@number+ is enabled,
5990 % it set the page number to the last value of \verb+sameparallelpage@number+ counter, in order to have a continuity of page numbering between pages printed with \cs{Pages} and normal pages.
5991 % \begin{macrocode}
5992 \newcommand{\finish@sameparallelpage@number}{%
5993 \ifsameparallelpagenumber%
5994 \setcounter{page}{\c@sameparallelpage@number}%
5995 \fi%
5996 }%
5997 % \end{macrocode}
5998 % \end{macro}
5999 % \section{Sections' titles' commands}
6000 % As switching from left to right pages does not clear the page since v1.13.0,
6001 % but only creates new pages, no \verb+\vbox{}+ is inserted, and consequently parallel chapters are mis-aligned.
6002 %
6003 % So we patch the \cs{chapter} command in order to prevent this problem.
6004 % \begin{macro}{\chapter}
6005 % \begin{macrocode}
6006 \pretocmd{\chapter}{%
6007 \ifl@dprintingpages%
6008 \vbox{}%
6009 \fi%
6010 }%
6011 {}%
6012 {}%
6013 % \end{macrocode}
6014 % \end{macro}
6015 % \begin{macro}{\eledsectnotoc}
6016 % \cs{eledsectnotoc} just saves its content \cs{@eledsectnotoc}, which will be tested where sectioning commands will be printed.
6017 % \begin{macrocode}
6018 \newcommand{\eledsectnotoc}[1]{\xdef\@eledsectnotoc{#1}}
6019 \eledsectnotoc{R}
6020 % \end{macrocode}
6021 % \end{macro}
6022 % \begin{macro}{\eledsectmark}
6023 % \cs{eledsectmark} just saves its content \cs{@eledsectmark}, which will be tested where sectioning commands will be printed.
6024 % \begin{macrocode}
6025 \newcommand{\eledsectmark}[1]{\xdef\@eledsectmark{#1}}
6026 \eledsectmark{L}
6027 % \end{macrocode}
6028 % \end{macro}
6029 % \begin{macro}{\eledsection@correcting@skip}
6030 % Because the vertical correction needed after inserting a title in parallel depends whether we are in parallel columns or parallel pages, we stock its length in \cs{eledsection@correcting@skip}.
6031 % \begin{macrocode}
6032 \newskip\eledsection@correcting@skip
6033 % \end{macrocode}
6034 % \end{macro}
6035 % \begin{macro}{\eled@sectioningR@out}
6036 % We save the sectioning commands of the right side in the \cs{eled@sectioningR@out} file.
6037 % \begin{macrocode}
6038 \newwrite\eled@sectioningR@out
6039 % \end{macrocode}
6040 % \end{macro}
6041 % \section{Page break/no page break, depending on the specific line}
6042 % We need to adapt the macro of the homonym section of eledmac to eledpar.
6043 % \begin{macro}{\prev@pbR}
6044 % \begin{macro}{\prev@nopbR}
6045 % The \cs{l@prev@pbR} macro is a etoolbox list, which contains the lines in which page breaks occur (before or after).
6046 % The \cs{l@prev@nopbR} macro is a etoolbox list, which contains the lines in which NO page breaks occur (before or after).
6047 % \begin{macrocode}
6048 \def\l@prev@pbR{}
6049 \def\l@prev@nopbR{}
6050 % \end{macrocode}
6051 % \end{macro}
6052 % \end{macro}
6053 % \begin{macro}{\ledpbR}
6054 % \begin{macro}{\ledpbnumR}
6055 % \begin{macro}{\lednopbnum}
6056 % \begin{macro}{\lednopbnumR}
6057 % The \cs{ledpbR} macro writes the call to \cs{led@pbR} in line-list file.
6058 % The \cs{ledpbnumR} macro writes the call to \cs{led@pbnumR} in line-list file.
6059 % The \cs{lednopbR} macro writes the call to \cs{led@nopbR} in line-list file.
6060 % The \cs{lednopbnumR} macro writes the call to \cs{led@nopbnumR} in line-list file.
6061 % \begin{macrocode}
6062 \newcommand{\ledpbR}{\write\linenum@outR{\string\led@pbR}}
6063 \newcommand{\ledpbnumR}[1]{\write\linenum@outR{\string\led@pbnumR{#1}}}
6064 \newcommand{\lednopbR}{\write\linenum@outR{\string\led@nopbR}}
6065 \newcommand{\lednopbnumR}[1]{\write\linenum@outR{\string\led@nopbnumR{#1}}}
6066 % \end{macrocode}
6067 % \end{macro}
6068 % \end{macro}
6069 % \end{macro}
6070 % \end{macro}
6071 % \begin{macro}{\led@pbR}
6072 % \begin{macro}{\led@pbnumR}
6073 % \begin{macro}{\led@nopbR}
6074 % \begin{macro}{\led@nopbnumR}
6075 % The \cs{led@pbR} add the absolute line number in the \cs{prev@pbR} list.
6076 % The \cs{led@pbnumR} add the argument in the \cs{prev@pbR} list.
6077 % The \cs{led@nopbR} add the absolute line number in the \cs{prev@nopbR} list.
6078 % The \cs{led@nopbnumR} add the argument in the \cs{prev@nopbR} list.
6079 % \begin{macrocode}
6080 \newcommand{\led@pbR}{\listxadd{\l@prev@pbR}{\the\absline@numR}}
6081 \newcommand{\led@pbnumR}[1]{\listxadd{\l@prev@pbR}{#1}}
6082 \newcommand{\led@nopbR}{\listxadd{\l@prev@nopbR}{\the\absline@numR}}
6083 \newcommand{\led@nopbnumR}[1]{\listxadd{\l@prev@nopbR}{#1}}
6084 % \end{macrocode}
6085 % \end{macro}
6086 % \end{macro}
6087 % \end{macro}
6088 % \end{macro}
6089 % \section{Parallel ledgroup}
6090 % \begin{macro}{\parledgroup@}
6091 % \begin{macro}{\parledgroupseries@}
6092 % \begin{macro}{\parledgrouptype@}
6093 % The marks \cs{parledgroup} contains information about the beginnings and endings of notes in a parallel ledgroup.
6094 % \cs{parledgroupseries} contains the footnote series.
6095 % \cs{parledgroupseries} contains the type of the footnote: critical (Xfootnote) or familiar (footnoteX).
6096 % \begin{macrocode}
6097 \newmarks\parledgroup@
6098 \newmarks\parledgroup@series
6099 \newmarks\parledgroup@type
6100 % \end{macrocode}
6101 % \end{macro}
6102 % \end{macro}
6103 % \end{macro}
6104 % \begin{macro}{\parledgroup@notes@startL}
6105 % \begin{macro}{\parledgroup@notes@startR}
6106 % \cs{parledgroup@notes@startL} and \cs{parledgroup@notes@startR} are used to mark the begining of a note series in a parallel ledgroup.
6107 % \begin{macrocode}
6108 \newcommand{\parledgroup@notes@startL}{%
6109 \ifnum\usenamecount{l@dmaxlinesinpar\the\l@dpscL}>0%
6110 \IfStrEq{\splitfirstmarks\parledgroup@type}{footnoteX}{\csuse{bhooknoteX@\splitfirstmarks\parledgroup@series}}{}%
6111 \IfStrEq{\splitfirstmarks\parledgroup@type}{Xfootnote}{\csuse{bhookXnote@\splitfirstmarks\parledgroup@series}}{}%
6112 \fi%
6113 \global\ledgroupnotesL@true%
6114 \insert@noterule@ledgroup{L}%
6115 }
6116 \newcommand{\parledgroup@notes@startR}{%
6117 \ifnum\usenamecount{l@dmaxlinesinpar\the\l@dpscR}>0%
6118 \IfStrEq{\splitfirstmarks\parledgroup@type}{footnoteX}{\csuse{bhooknoteX@\splitfirstmarks\parledgroup@series}}{}%
6119 \IfStrEq{\splitfirstmarks\parledgroup@type}{Xfootnote}{\csuse{bhookXnote@\splitfirstmarks\parledgroup@series}}{}%
6120 \fi%
6121 \global\ledgroupnotesR@true%
6122 \insert@noterule@ledgroup{R}%
6123 }
6124 % \end{macrocode}
6125 % \end{macro}
6126 % \end{macro}
6127 % \begin{macro}{\parledgroup@notes@startL}
6128 % \begin{macro}{\parledgroup@notes@startR}
6129 % \cs{parledgroup@notes@endL} and \cs{parledgroup@notes@endR} are used to mark the end of a note series in a parallel ledgroup.
6130 % \begin{macrocode}
6131 \newcommand{\parledgroup@notes@endL}{%
6132 \global\ledgroupnotesL@false%
6133 }
6134 \newcommand{\parledgroup@notes@endR}{%
6135 \global\ledgroupnotesR@false%
6136 }
6137 % \end{macrocode}
6138 % \end{macro}
6139 % \end{macro}
6140 % \begin{macro}{\insert@noterule@ledgroup}
6141 % A \cs{vskip} is not used when the boxes are constructed. So we insert it before ledgroup note series when paralling lines are constructed.
6142 % This is the goal of \cs{insert@noterule@ledgroup}
6143 % \begin{macrocode}
6144 \newcommand{\insert@noterule@ledgroup}[1]{
6145 \IfStrEq{\splitbotmarks\parledgroup@}{begin}{%
6146 \IfStrEq{\splitbotmarks\parledgroup@type}{Xfootnote}{
6147 \csuse{ifledgroupnotes#1@}
6148 \vskip\skip\csuse{mp\splitbotmarks\parledgroup@series footins}
6149 \csuse{\splitbotmarks\parledgroup@series footnoterule}
6150 \fi
6151 }
6152 {}
6153 \IfStrEq{\splitbotmarks\parledgroup@type}{footnoteX}{
6154 \csuse{ifledgroupnotes#1@}
6155 \vskip\skip\csuse{mpfootins\splitbotmarks\parledgroup@series}
6156 \csuse{footnoterule\splitbotmarks\parledgroup@series}
6157 \fi
6158 }{}
6159 }
6160 {}
6161 }
6162 % \end{macrocode}
6163 % \end{macro}
6164 %
6165 % \begin{macro}{\parledgroupnotespacing}
6166 % \cs{parledgroupnotespacing} can be redefined by the user to change the interline spacing of ledgroup notes.
6167 % \begin{macrocode}
6168 \newcommand{\parledgroupnotespacing}{}
6169 % \end{macrocode}
6170 % \end{macro}
6171 % \begin{macro}{\parledgroup@notespacing@correction}
6172 % \begin{macro}{\parledgroup@notespacing@set@correction}
6173 % \cs{parledgroup@notespacing@correction} is the difference between a normal line skip and a line skip in a note. It's set by \cs{parledgroup@notespacing@set@correction}, called at the begining of \cs{Pages}.
6174 % \begin{macrocode}
6175 \dimdef{\parledgroup@notespacing@correction}{0pt}
6176 \newcommand{\parledgroup@notespacing@set@correction}{%
6177 {\notefontsetup\parledgroupnotespacing\dimgdef{\temp@spacing}{\baselineskip}}%
6178 \dimgdef{\parledgroup@notespacing@correction}{\baselineskip-\temp@spacing}%
6179 }
6180 % \end{macrocode}
6181 % \end{macro}
6182 % \end{macro}
6183 % \begin{macro}{\parledgroup@correction@notespacing@init}
6184 % \cs{parledgroup@correction@notespacing@init} sets the value of accumulated corrections of note spacing to 0~pt.
6185 % It's called at the begining of each pages AND at the end of each ledgroup.
6186 % \begin{macrocode}
6187 \newcommand{\parledgroup@correction@notespacing@init}{
6188 \dimdef{\parledgroup@notespacing@correction@accumulated}{0pt}
6189 \dimdef{\parledgroup@notespacing@correction@modulo}{0pt}
6190 }
6191 \parledgroup@correction@notespacing@init
6192 % \end{macrocode}
6193 % \end{macro}
6194 % \begin{macro}{\parledgroup@correction@notespacing@final}
6195 % \cs{parledgroup@correction@notespacing@final} adds the total space deleted because of correction for notes, in a parallel ledgroup.
6196 % It also adds the space needed by the other side spaces between note rules and notes. It's called after the print of each pstart/pend.
6197 % \begin{macrocode}
6198 \newcommand{\parledgroup@correction@notespacing@final}[1]{
6199 \ifparledgroup
6200 \vspace{\parledgroup@notespacing@correction@accumulated}
6201 \parledgroup@correction@notespacing@init%
6202 \ifstrequal{#1}{L}{
6203 \numdef{\@checking}{\the\l@dpscL-1}
6204 }{
6205 \numdef{\@checking}{\the\l@dpscR-1}
6206 }
6207 \dimdef{\@beforenotes@current@diff}{\csuse{@parledgroup@beforenotes@\@checking L}-\csuse{@parledgroup@beforenotes@\@checking R}}%
6208 \ifstrequal{#1}{L}%
6209 {% Left
6210 \ifdimgreater{\@beforenotes@current@diff}{0pt}{}{\vspace{-\@beforenotes@current@diff}}%
6211 }%
6212 {% Right
6213 \ifdimgreater{\@beforenotes@current@diff}{0pt}{\vspace{\@beforenotes@current@diff}}{}
6214 }%
6215 \fi
6216 }
6217 % \end{macrocode}
6218 % \end{macro}
6219 % \begin{macro}{\parledgroup@correction@notespacing}
6220 % \cs{parledgroup@correction@notespacing} is used before each printed line.
6221 % If it's a line of notes in parallel ledgroup, the space \cs{parledgroup@notespacing@correction} is decreased, to make interline space correct.
6222 % The decreased space is added to \cs{parledgroup@notespacing@correction@accumulated} and \cs{parledgroup@notespacing@correction@modulo}.
6223 % If \cs{parledgroup@notespacing@correction@modulo} is equal or greater than \cs{baselineskip}:
6224 % \begin{itemize}
6225 % \item It is decreased by \cs{baselineskip}.
6226 % \item The total of line number in the current page is decreased by one.
6227 % \end{itemize}
6228 % For example, suppose an normal interline of 24~pt and interline for note of 12~pt.
6229 % That means that the two lines of notes take the place of one normal line. For every two lines of notes, the line total for the current place is decreased by one.
6230 % \begin{macrocode}{}
6231 \newcommand{\parledgroup@correction@notespacing}[1]{%
6232 \csuse{ifledgroupnotes#1@}%
6233 \vspace{-\parledgroup@notespacing@correction}%
6234 \dimdef{\parledgroup@notespacing@correction@accumulated}{\parledgroup@notespacing@correction@accumulated+\parledgroup@notespacing@correction}%
6235 \dimdef{\parledgroup@notespacing@correction@modulo}{\parledgroup@notespacing@correction@modulo+\parledgroup@notespacing@correction}%
6236 \ifdimless{\parledgroup@notespacing@correction@modulo}{\baselineskip}{}{\advance\numpagelinesL -\@ne%
6237 \dimdef{\parledgroup@notespacing@correction@modulo}{\parledgroup@notespacing@correction@modulo-\baselineskip}%
6238 }% mean greater than equal
6239 \fi%
6240 }
6241 % \end{macrocode}
6242 % \end{macro}
6243 % \begin{macro}{\parledgroup@beforenotesL}
6244 % \begin{macro}{\parledgroup@beforenotesR}
6245 % \cs{parledgroup@beforenotesL} and \cs{parledgroup@beforenotesR} store the total of space before notes in the current parallel ledgroup.
6246 % \begin{macrocode}
6247 \dimdef\parledgroup@beforenotesL{0pt}
6248 \dimdef\parledgroup@beforenotesR{0pt}
6249 % \end{macrocode}
6250 % \end{macro}
6251 % \end{macro}
6252 % \begin{macro}{\parledgroup@beforenotes@save}
6253 % The macro \cs{parledgroup@beforenotes@save} dumps the space befores notes of the current parallel ledgroup in a macro named with the current pstart number.
6254 % \begin{macrocode}
6255 \newcommand{\parledgroup@beforenotes@save}[1]{
6256 \ifparledgroup
6257 \csdimgdef{@parledgroup@beforenotes@\the\csuse{l@dnumpstarts#1}#1}{\csuse{parledgroup@beforenotes#1}}
6258 \csdimgdef{parledgroup@beforenotes#1}{0pt}
6259 \fi
6260 }
6261 % \end{macrocode}
6262 % \end{macro}
6263
6264
6265 % \section{The End}\label{end}
6266 %
6267 %
6268 %</code>
6269 %
6270 % \newpage
6271 % \appendix
6272 % \clearpage
6273 %
6274 % \let\oldthesection\thesection
6275 % \renewcommand{\thesection}{Appendix \oldthesection}
6276 % \section{Some things to do when changing version}
6277 % \subsection{Migration to eledpar 1.4.3}
6278 % Version 1.4.3 corrects a bug added in version 0.12, which made hanging verse automatically flush right, despite the given value of the first element of the \cs{setstanzaindents} command.
6279 %
6280 % If, however, you want to return to automatic flush-right margins for verses with hanging indents, you have to redefine the \cs{hangingsymbol} command.
6281 % \begin{verbatim}
6282 % \renewcommand{\hangingsymbol}{\protect\hfill}
6283 % \end{verbatim}
6284 % See the two following examples:
6285 %
6286 % With standard \cs{hangingsymbol}:
6287 % \setstanzaindents{4,0}
6288 % \beginnumbering
6289 % \stanza
6290 % A very long verse should be sometime hanged.
6291 % The position of the hanging verse is fixed.\&
6292 % \endnumbering
6293 %
6294 % With the modification of \cs{hangingsymbol}:
6295 % \renewcommand{\hangingsymbol}{\protect\hfill}
6296 % \setstanzaindents{4,0}
6297 % \beginnumbering
6298 % \stanza
6299 % A very long verse should sometimes be hanging. And we can see that an hanging verse is flush right.\&
6300 % \endnumbering
6301 % \bibliographystyle{alpha}
6302 % \begin{thebibliography}{WWW99}
6303 % \addcontentsline{toc}{section}{References}
6304 % \bibitem[LW90]{EDMACTUG}
6305 % John Lavagnino and Dominik Wujastyk.
6306 % \newblock `An overview of \edmac: a \textsc{Plain} TeX format for
6307 % critical editions'.
6308 % \newblock \emph{TUGboat}, \textbf{11}, 4, pp. 623--643, November 1990.
6309 % \newblock (Code available from CTAN in
6310 % \texttt{macros/plain/contrib/edmac})
6311 %
6312 %
6313 % \bibitem[Wil02]{MEMOIR}
6314 % Peter Wilson.
6315 % \newblock \emph{The \Lpack{memoir} class for configurable typesetting}.
6316 % \newblock November 2002.
6317 % \newblock (Available from CTAN in
6318 % \texttt{macros/latex/contrib/memoir})
6319 %
6320 % \bibitem[Wil04]{ELEDMAC}
6321 % Peter Wilson and Maïeul Rouquette.
6322 % \newblock \emph{\Lpack{eledmac} A presumptuous attempt to port
6323 % \Lpack{EDMAC},\Lpack{TABMAC} and \Lpack{EDSTANZA} to
6324 % LaTeX}.
6325 % \newblock December 2004.
6326 % \newblock (Available from CTAN in
6327 % \texttt{macros/latex/contrib/eledmac})
6328 %
6329 % \end{thebibliography}
6330 %
6331 % \Finale
6332 % \phantomsection
6333 % \addcontentsline{toc}{section}{Index}
6334 % \PrintIndex
6335 %
6336 % \phantomsection
6337 % \addcontentsline{toc}{section}{Change History}
6338 % \PrintChanges
6339 % \endinput
6340 \endinput
6341
6342 %% \CharacterTabl
6343 %% 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
6344 %% 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
6345 %% Digits \0\1\2\3\4\5\6\7\8\9
6346 %% Exclamation \! Double quote \" Hash (number) \#
6347 %% Dollar \$ Percent \% Ampersand \&
6348 %% Acute accent \' Left paren \( Right paren \)
6349 %% Asterisk \* Plus \+ Comma \,
6350 %% Minus \- Point \. Solidus \/
6351 %% Colon \: Semicolon \; Less than \<
6352 %% Equals \= Greater than \> Question mark \?
6353 %% Commercial at \@ Left bracket \[ Backslash \\
6354 %% Right bracket \] Circumflex \^ Underscore \_
6355 %% Grave accent \` Left brace \{ Vertical bar \|
6356 %% Right brace \} Tilde \~}
6357 %%