diff options
Diffstat (limited to 'Master')
74 files changed, 34913 insertions, 1 deletions
diff --git a/Master/texmf-dist/doc/latex/reledmac/Makefile b/Master/texmf-dist/doc/latex/reledmac/Makefile new file mode 100644 index 00000000000..73bb87645c1 --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/Makefile @@ -0,0 +1,59 @@ +PACKAGE = *.dtx \ + *.ins \ + reledmac.pdf \ + reledpar.pdf \ + migration.pdf \ + README \ + Makefile \ + latexmkrc \ + + + +.PHONY: all dist clean + + +all: reledmac.sty reledmac.pdf reledpar.sty reledpar.pdf migration.pdf dist + +doc: *.pdf + +migration.pdf: migration.dtx + xelatex $< + xelatex $< + xelatex $< + +README: README.md + pandoc README.md -o README + +%.sty: %.ins %.dtx + rm -f $*.sty $*tex + @pdflatex $*.ins + +%.pdf: %.sty %.dtx + @xelatex $*.dtx + @makeindex -s gind.ist -o $*.ind $*.idx + @makeindex -s gglo.ist -o $*.gls $*.glo + @xelatex $*.dtx + @makeindex -s gind.ist -o $*.ind $*.idx + @makeindex -s gglo.ist -o $*.gls $*.glo + @xelatex $*.dtx + + +dist: $(PACKAGE) examples + rm -rf reledmac + mkdir reledmac + $(MAKE) -C examples all + mkdir reledmac/examples + ln examples/*pdf reledmac/examples + ln examples/*tex reledmac/examples + ln examples/*xdy reledmac/examples + ln examples/makefile reledmac/examples + mkdir reledmac/doc-include + ln doc-include/*dtx reledmac/doc-include + ln $(PACKAGE) reledmac + @$(RM) ../reledmac.zip + zip -r ../reledmac.zip reledmac + + +clean: + $(MAKE) -C examples clean + @$(RM) *.aux *.log *.out *.toc *tex *.pdf reledmac.sty reledpar.sty *ind *ilg *lof *idx *glo *gls ../reledmac.zip diff --git a/Master/texmf-dist/doc/latex/reledmac/README b/Master/texmf-dist/doc/latex/reledmac/README new file mode 100644 index 00000000000..0e221822b56 --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/README @@ -0,0 +1,120 @@ +Overview +======== + +The reledmac package is for typesetting critical editions. The reledpar +package is an extension of reledmac enabling parallel typesetting in +columns or on facing pages. + +Reledmac and reledpar are successors of eledmac and eledpar, which were +successor of ledmac and ledpar. Ledmac was a LaTeX port, and extension, +of the plain TeX EDMAC, TABMAC and EDSTANZA macros. + +The package is available on [CTAN](http://www.ctan.org/pkg/reledmac). + +Copyright and Licence +===================== + +Authors +------- + +- Peter Wilson (Herries Press) herries dot press at earthlink dot net, +- Maïeul Rouquette (new maintainer since june 2011) + +Copyright +--------- + +- Copyright 2003 --- 2005 Peter R. Wilson +- Copyright 2011 --- .. Maïeul Rouquette + +Licence +------- + +This work may be distributed and/or modified under the conditions of the +LaTeX Project Public License, either version 1.3 of this license or (at +your option) any later version. + +The latest version of the license is in +<http://www.latex-project.org/lppl.txt> and version 1.3 or later is part +of all distributions of LaTeX version 2003/06/01 or later. + +This work has the LPPL maintenance status "maintained". + +This work consists of the files: + +- README (this file), +- reledmac.dtx, +- reledmac.ins, +- reledpar.dtx, +- reledpar.ins, + +and the derived files: + +- reledmac.sty, +- reledpar.sty, +- reledmac.pdf, (200+ pages) +- reledpar.pdf, (100+ pages) + +The distribution consists of the following files: + +- README (this file) +- reledmac.dtx +- reledmac.ins +- reledmac.pdf +- reledpar.dtx +- reledpar.ins +- reledpar.pdf +- makefile +- latexmrc +- examples/ + - \*.tex + - \*.pdf + - makefile + +Installation +============ + +- run: `latex reledmac.ins` (which will generate `reledmac.sty`) and + `latex reledpar.ins` (which will generate `reledmac.sty`) +- move `reledmac.sty` and `reledpar.sty` to a location where LaTeX + will find it (for more information on this see the FAQ). + +To generate a second copy of the manual (which is already supplied as a +PDF file): + +- run: `make reledmac.pdf && make reledpar.pdf` + +Help +==== + +- [Users list](http://geekographie.maieul.net/146) +- [StackExchange](https://tex.stackexchange.com/questions/tagged/reledmac), + see also the older tags + (https://tex.stackexchange.com/questions/tagged/rledmac) and + (https://tex.stackexchange.com/questions/tagged/ledmac) + +Debug and feature requests +========================== + +Suggestions and bug reports are welcome. + +Maïeul Rouquette is the only one maintainer. To help him in his work, +please follow these rules: + +- Go to the [issues page](https://github.com/maieul/ledmac/issues). +- Open *one issue for each problem*, even if problems are similar. +- Add a [minimal working + example](http://www.tex.ac.uk/cgi-bin/texfaq2html?label=minxampl). +- If your report is really a bug, Maïeul Rouquette will open a + "branch" to solve your problem. This branch will be called + "issueXXX", where "XXX" is the issue number. +- Once the problem has a possible solution, Maïeul Rouquette will send + you a zip file and ask you to test it: + - Download the zip file of the branch (or, if you know Git, go to + the branch there): + - Go to [the project page](https://github.com/maieul/ledmac/). + - Choose the correct branch in the "branch" menu. + - Click on the cloud, in the right side. + - Run the `.ins` files with pdflatex, to obtain the `.sty` files. + - Put the `.sty` files with your test files (in the same folder). + - Make your report. + diff --git a/Master/texmf-dist/doc/latex/reledmac/doc-include/migrate-mac.dtx b/Master/texmf-dist/doc/latex/reledmac/doc-include/migrate-mac.dtx new file mode 100644 index 00000000000..dbd113e2e54 --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/doc-include/migrate-mac.dtx @@ -0,0 +1,359 @@ +% \subsection{Migrating from \edmac to \ledmac} \label{sec:lastuser} +% +% If you have never used \edmac, ignore this section. If you have used +% \edmac{} and are starting on a completely new document, ignore this section. +% Only read this section if you are converting an original \edmac{} +% document to use \ledmac. +% +% The package still provides the original \cs{text} command, but it is +% (a) deprecated, and +% (b) its name has been changed\footnote{A name like \cs{text} is likely to be defined by +% other \LaTeX\ packages (it certainly is by the AMS packages) and it +% seems sensible to try and avoid clashes with other definitions.} +% to \cs{critext}; +% use the \cs{edtext} macro instead. However, if you do +% use \cs{critext} (the new name for \cs{text}), the following is a reminder. +% +% +% \DescribeMacro{\critext} +% Within numbered paragraphs, footnotes and endnotes are generated +% by forms of the \cs{critext} macro: +% \begin{verse} +% \cs{critext}\marg{lemma}\meta{commands}\verb"/" +% \end{verse} +% +% +% The \meta{lemma} argument is the lemma in the main text: \cs{critext} +% both prints this as part of the text, and makes it available to the +% \meta{commands} you specify to generate notes. The \verb"/" at the +% end terminates the command; it is part of the macro's definition so +% that spaces after the macro will be treated as significant. +% +% For example: +% \egstart +% \begin{verbatim} +% I saw my friend \critext{Smith} +% \Afootnote{Jones C, D.}/ +% on Tuesday. +% \end{verbatim} +% \egmid +% 1\enspace I saw my friend\\ +% 2\enspace Smith on Tuesday.\smallskip +% \hrule width 1.5cm +% \strut {\bf 2} Smith] Jones C, D. +% \egend +% +% The lemma \verb"Smith" is printed as part of this sentence in +% the text, and is also made available to the footnote +% that specifies a variant, \verb"Jones C, D". The footnote macro +% is supplied with the line number at which the lemma appears +% in the main text. +% +% The \meta{lemma} may contain further \cs{critext} commands. +% Nesting makes +% it possible to print an explanatory note on a long passage together with +% notes on variants for individual words within the passage. For +% example: +% \egstart +% \begin{verbatim} +% \critext{I saw my friend +% \critext{Smith}{\Afootnote{Jones +% C, D.}/ on Tuesday.} +% \Bfootnote{The date was +% July 16, 1954.} +% / +% \end{verbatim} +% \egmid +% 1\enspace I saw my friend\\ +% 2\enspace Smith on Tuesday.\smallskip +% \hrule width 1.5cm +% \strut {\bf 2} Smith] Jones C, D.\smallskip +% \hrule width 1.5cm +% \strut {\bf 1--2} I saw my friend \\ +% Smith on Tuesday.] The\\ date was +% July 16, 1954. +% \egend +% +% However, \cs{critext} cannot handle overlapping but unnested +% notes---for example, one note covering lines 10--15, and another +% covering 12--18; a \cs{critext} that starts in the \meta{lemma} +% argument of another \cs{critext} must end there, too. (The +% \cs{lemma} and \cs{linenum} commands may be used to +% generate overlapping notes if necessary.) +% +% The second argument of the \cs{critext} macro, \meta{commands}, +% is the same as the second argument to the \cs{edtext} macro. +% +% +% It is possible to define aliases for \cs{critext}, which +% can be easier to type. You can make a single character substitute +% for \cs{critext} by saying this: +% \begin{verbatim} +% \catcode`\<=\active +% \let<=\critext +% \end{verbatim} +% +% Then you might say \verb"<{Smith}\variant{Jones}/". This of course +% destroys the ability to use \verb"<" in any new macro definitions, so +% long as it remains in effect; hence it should be used with care. +% +% Changing the character at the end of the command requires more work: +% \begin{verbatim} +% \catcode`\<=\active +% \def\xtext#1#2>{\critext{#1}{#2}/} +% \let<=\xtext +% \end{verbatim} +% This allows you to say \verb"<{Smith}\Afootnote{Jones}>". +% +% Aliases for \cs{critext} +% of the first kind shown here also can't be nested---that is, +% you can't use the alias in the text that forms the first argument +% to \cs{critext}. (See \reff{text} to find out why.) Aliases of +% the second kind may be nested without any problem. +% +% +% If you really have to use \cs{critext} in any of the tabular or +% array environments, then \cs{edtext} must not be used in the same +% environment. If you use \cs{critext} in one of these environments +% then you have to issue the declaration \cs{usingcritext} beforehand. +% The declaration \cs{usingedtext} must be issued to revert to the +% default assumption that \cs{edtext} will be used. +% \subsection{Migration from \ledmac to \eledmac}\label{migration} +% In \eledmac, some changes were made in the code to allow easy customization. +% This may cause problems for people who have already made their own. The next sections explain how to handle this. +% +% +% If you have created your own series using \cs{addfootins} and \cs{addfootinsX}, you must use instead the \cs{newseries} command (see \reff{newseries}), and remove any \cs{Xfootnote} command. +% +% If you have customized the \cs{XXXXXXfmt} command, please check whether you can achieve the same by the commands documented for display options (\reff{displayoptions}) or \cs{Xfootnote} options (\reff{Xfootnoteopt}). Otherwise please add a new ticket on Github to request a new function for doing this.\footnote{\url{https://github.com/maieul/ledmac/issues}} +% +% If for some reason you do not want to make the modifications to use the new functions of \eledmac, you can continue using your own \cs{XXXXXfmt} command, but you must replace: +% \begin{verbatim} +% \renewcommand*{XXXXfmt}[3] +% \end{verbatim} +% with +% \begin{verbatim} +% \renewcommandx*{XXXXfmt}[4][4=Z] +% \end{verbatim} +% If you do not make that, you will get a spurious \verb+[X]+, where X is series letter. +% +% If you used a \cs{protect} command inside a \cs{footnote} command inside a numbered section, you must change the \cs{protect} to \cs{noexpand}. Otherwise the command after the \cs{protect} will be discarded. +% \subsection{Migration to eledmac 1.5.1}\label{change151} +% The version 1.5.1 corrects a bug in \verb+stanzaindentsrepetition+ (cf. \reff{stanzaindentsrepetition}). This bug had two consequences: +% \begin{enumerate} +% \item \verb+stanzaindentsrepetition+ did not work when its value was greater than 2. +% \item \verb+stanzaindentsrepetition+ worked wrong when its value was equal to 2. +% \end{enumerate} +% +% So, if you used \verb+stanzaindentsrepetition+ with a value equal to 2, you had to change your \cs{setstanzaindents}. Explanation: +% \begin{verbatim} +% \setcounter{stanzaindentsrepetition}{2} +% \setstanzaindents{5,1,0} +% \end{verbatim} +% This code, in versions prior to 1.5.1, made the first line have an indentation of 0, the second line of 1, the third verse of 0, the fourth verse of 1 and so forth. +% +% But this code should have instead achieved quite the contrary: the first line would have an indentation of 1, the second line of 0, the third line of 1, the fourth line of 0 an so forth. +% +% So version 1.5.1 corrected this bug. If you want to keep the former presentation, you must change: +% \begin{verbatim} +% \setcounter{stanzaindentsrepetition}{2} +% \setstanzaindents{5,1,0} +% \end{verbatim} +% to: +% \begin{verbatim} +% \setcounter{stanzaindentsrepetition}{2} +% \setstanzaindents{5,0,1} +% \end{verbatim} +% \subsection{Migration to eledmac 1.12.0} +% The migration to eledmac 1.12.0 is easy: +% \begin{itemize} +% \item You must first delete all the auxiliary files, then compile your document three times as usual. +% \item If you have modified \cs{l@reg}, which is not advisable, you must rename it to \cs{@nl@reg}. +% \end{itemize} +% +% There is an additional problem. If you have put text into brackets just after \cs{pstart} or \cs{pend}, this text will be considered to be an optional argument of \cs{pstart} or \cs{pend} (see \reff{pstart:optionalarg}). +% If so, add a \cs{relax} between \cs{pstart}/\cs{pend} and the first bracket. + +% The version 1.12.0 also introduce a better way to handle sectional divisions inside numbered text. Please read \reff{eledsection}. +% \subsection{Migration to eledmac 17.1} +% This version changes the default setting of \cs{Xpstart}. +% Henceforth, pstart numbers will be printed in footnotes within the section of text where you have called \cs{numberpstarttrue}. + +% We do not see any reason to print them in the other sections. However, if you want to print the pstart numbers in all of the footnotes, whatever the section, without having to use \cs{numberpstarttrue}, you can use +% \cs{Xpstarteverytime}. +% \subsection{Migration to eledmac 1.21.0} +% \subsubsection{\cs{Xledsetnormalparstuff} and \cs{ledsetnormalparstuffX}} +% The \cs{ledsetnormalparstuff} has been split into two different commands: +% \begin{itemize} +% \item \cs{Xledsetnormalparstuff} for critical notes; +% \item \cs{ledsetnormalparstuffX} for familiar notes. +% \end{itemize} +% Both commands can take an optional argument which is the series letter. +% If you have redefined \cs{ledsetnormalparstuff} or any of the commands which call them, you must change them accordingly. +% \subsubsection{Endnotes} +% In any case, delete the \verb+.end+ file before the next run. +% +% \label{oldprintnpnumspace} The previous version of \Eledmac{} had a bug: there were two spaces between the starting page number and the starting line number, but only one space between the ending page number and the ending line number. +% +% As a matter of fact, a spurious space was added after the first \cs{printnpnum}. +% This spurious space has been deleted. +% However, if you want to keep the previous spurious space, you may load the package with the \verb+oldprintnpnumspace+ option. +% +% If you have redefined \cs{endprint}, you must: +% \begin{itemize} +% \item Contact us and ask for the feature that required your hack, in order to avoid such a hack in the future. +% \item Use the new fifth argument. +% \item Add \verb+\xdef\@currentseries{#4}+ at the beginning of your own command. +% \end{itemize} +% \subsection{Migration to eledmac 1.22.0} +% The \cs{ledinnote} command now takes a first optional argument, which is the label for the hyperreference. +% If you have redefined it, change your redefinition, and check whether you can +% avoid this redefinition by only redefining \cs{ledinnotemark}. +% \subsection{Migration to eledmac 1.23.0} +% You must delete the numbered auxiliary files before compiling with the new version of \eledmac. +% +% \subsection{Migration from \eledmac to \reledmac} +% There are many changes in \reledmac which require the user to make modifications. +% +% +% \subsubsection{Risk of `no room for a new'} +% The risk to obtain a `no room for a new something' error is greater in \reledmac than it is in \eledmac. See \reff{noroom} in order to know how to limit it. +% \subsubsection{Multiple indices with memoir} +% \Eledmac and \ledmac used the specific indexing tools of the \Lclass{memoir} class designed to produce multiple indices. +% However, \eledmac could also use \Lpack{imakeidx} or \Lpack{indextools} tools independently of the \Lclass{memoir} class. +% This system forced to maintain redundant code. +% Since \reledmac, we use only the \Lpack{imakeidx} or \Lpack{indextools} tools. +% +% Consequently: Users of \Lpack{memoir}are invited to use \Lpack{indextool} or \Lpack{imakeidx} to produce multiple indices. + +% \subsubsection{Deprecated commands and options} +%The table of deprecated commands and their alternatives follows. +% Note that the way some commands must be used may have changed. +% Please read the handbook. +% +% \begin{longtable}{p{0.45\textwidth}p{0.45\textwidth}} +% \emph{Deprecated command} & \emph{Replaced with} \\ +% \hline +% \endhead +% \cs{addfootins} & \cs{newseries} \\ +% \cs{addfootinsX} & \cs{newseries} \\ +% \cs{critext} & \cs{edtext} \\ +% \cs{falseverse} & \cs{newverse} \\ +% \cs{interparanoteglue} & \cs{Xafternote} and \cs{afternoteX} \\ +% \cs{ledchapter} & \cs{eledchapter} \\ +% \cs{ledsection} & \cs{eledsection} \\ +% \cs{ledsetnormalparstuff} & \cs{Xledsetnormalparstuff} and \cs{ledsetnormalparstuffX} \\ +% \cs{ledsubsection} & \cs{eledsubsection} \\ +% \cs{ledsubsubsection} & \cs{eledsubsubsection} \\ +% \cs{noeledsec} & Package option \verb+noeledsec+ \\ +% \cs{noendnotes} & Package option \verb+noendnotes+ \\ +% \cs{pageparbreak} & \cs{ledpb} \\ +% \end{longtable} +% +% The \verb+ledsecnolinenumber+ option has been removed, because it was related to deprecated commands. +% +% The \verb+oldprintnpnumspace+ option has been removed too, because it was related to a historical bug. +% The \cs{usingedtext} and \cs{usingcritext} commands are also deprecated. +% +% \subsubsection{\cs{renewcommand} replaced by command} +% Many uses of \cs{renewcommand} have been replaced with uses of specific commands. Please read handbook about specific commands. +% +% \begin{longtable}{p{0.45\textwidth}p{0.45\textwidth}} +% \emph{Deprecated \cs{renewcommand}} & \emph{Replaced with} \\ +% \endhead +% \cs{@led@extranofeet} & \cs{newseries}\\ +% \cs{apprefprefixmore} & \cs{setapprefprefixmore} \\ +% \cs{apprefprefixsingle} & \cs{setapprefprefixsingle} \\ +% \cs{endstanzaextra} & Optional argument of \expandafter\cs\expandafter{\&}\\ +% \cs{hangingsymbol} & \cs{sethangingsymbol}\\ +% \cs{ledfootinsdim} & \cs{Xmaxhnotes} and \cs{maxhnotesX} \\ +% \cs{parafootftmsep} & \cs{Xparafootsep} and \cs{parafootsepX} \\ +% \cs{notenumfont} & \cs{Xnotenumfont}, \cs{Xendnotenumfont} and \cs{notenumfontX} \\ +% \cs{notefontsetup} & \cs{Xnotefontsize}, \cs{Xendnotefontsize} and \cs{notefontsizeX} \\ +% \cs{sidenotesep} & \cs{setsidenotsep} \\ +% \cs{startstanzahook} & Optional argument of \cs{stanza} \\ +% \cs{symplinenum} & \cs{Xsymlinenum}\\ +% \end{longtable} +% \subsubsection{Commands the names of which have been changed} +% \label{eledmac-compat} +% In order to help the migration from \eledmac to \reledmac, you may load \reledmac with \verb+eledmac-compat+ option. +% However, it is advised not to, and to change the command names themselves instead. +% In many cases, you use only a few of them, except the \cs{footparagraph} command. +% +% +% \begin{longtable}{p{0.45\textwidth}p{0.45\textwidth}} +% \emph{Old command} & \emph{New command} \\ +% \hline +% \endhead +%\cs{footparagraph} & \cs{Xarrangement} \\ +% \cs{footnormal} & \cs{Xarrangement} \\ +% \cs{foottwocol} & \cs{Xarrangement} \\ +% \cs{footthreecol} & \cs{Xarrangement} \\ +% \hline +% \cs{footparagraphX} & \cs{arrangementX} \\ +% \cs{footnormalX} & \cs{arrangementX} \\ +% \cs{foottwocolX} & \cs{arrangementX} \\ +% \cs{footthreecolX} & \cs{arrangementX} \\ +% \hline +% \cs{afterlemmaseparator} & \cs{Xafterlemmaseparator}\\ +% \cs{afternote} & \cs{Xafternote} and \cs{afternoteX} \\ +% \cs{afternumberinfootnote} & \cs{Xafternumber} \\ +% \cs{afterXrule} & \cs{Xafterrule} \\ +% \cs{afterXsymlinenum} & \cs{Xaftersymlinenum} \\ +% \cs{beforelemmaseparator} & \cs{Xbeforelemmaseparator} \\ +% \cs{beforenumberinfootnote} & \cs{Xbeforenumber} \\ +% \cs{beforeXnotes} & \cs{Xbeforenotes} \\ +% \cs{beforeXsymlinenum} & \cs{Xbeforesymlinenum} \\ +% \cs{bhookXnote} & \cs{Xbhookendnote}\\ +% \cs{bhookXnote} & \cs{Xbooknote} \\ +% \cs{boxendlinenum} & \cs{Xboxendlinenum}\\ +% \cs{boxlinenum} & \cs{Xboxlinenum} \\ +% \cs{boxlinenumalign} & \cs{Xboxlinenumalign} \\ +% \cs{boxstartlinenum} & \cs{Xboxstartlinenum} \\ +% \cs{boxsymlinenum} & \cs{Xboxsymlinenum} \\ +% \cs{boxXendlinenum} & \cs{Xendboxlinenum} \\ +% \cs{boxXendlinenumalign} & \cs{Xendboxlinenumalign} \\% +% \cs{boxXendstartlinenum} & \cs{boxXendstartlinenum} \\ +% \cs{letboxXendendlinenum} & \cs{Xendletboxendlinenum} \\ +% \cs{hsizetwocol} & \cs{Xhsizetwocol} \\ +% \cs{hsizethreecol} & \cs{Xhsizethreecol} \\ +% \cs{inplaceoflemmaseparator} & \cs{Xinplaceoflemmaseparator} \\ +% \cs{inplaceofnumber} & \cs{Xinplaceofnumber} \\ +% \cs{lemmaseparator} & \cs{Xlemmaseparator} \\ +% \cs{maxhXnotes} & \cs{Xmaxhnotes} \\ +% \cs{morethantwolines} & \cs{Xmorethantwolines} \\ +% \cs{nonumberinfootnote} & \cs{Xnonumber} \\ +% \cs{notesXwidthliketwocolumns} & \cs{noteswidthliketwocolumnsX} \\ +% \cs{noXlemmaseparator} & \cs{Xnolemmaseparator} \\ +% \cs{numberonlyfirstinline} & \cs{Xnumberonlyfirstinline} \\ +% \cs{numberonlyfirstintwolines} & \cs{Xnumberonlyfirstintwolines} \\ +% \cs{nonbreakableafternumber} & \cs{Xnonbreakableafternumber} \\ +% \cs{onlyXpstart} & \cs{Xonlypstart} \\ +% \cs{parafootsep} & \cs{Xparafootsep} and \cs{parafootsepX} \\ +% \cs{pstartinfootnote} & \cs{Xpstart} \\ +% \cs{pstartinfootnoteeverytime} & \cs{Xpstarteverytime} \\ +% \cs{symlinenum} & \cs{Xsymlinenum} \\ +% \cs{twolines} & \cs{Xtwolines} \\ +% \cs{twolinesbutnotmore} & \cs{Xtwolinesbutnotmore} \\ +% \cs{twolinesonlyinsamepage} & \cs{Xtwolinesonlyinsamepage} \\ +% \cs{txtbeforeXnotes} & \cs{Xtxtbeforenotes} \\ +% \cs{XendXafterlemmaseparator} & \cs{Xendafterlemmaseparator} \\ +% \cs{XendXbeforelemmaseparator} & \cs{Xendbeforelemmaseparator} \\ +% \cs{XendXinplaceoflemmaseparator} & \cs{Xendinplaceoflemmaseparator} \\ +% \cs{XendXlemmaseparator} & \cs{Xendlemmaseparator} \\ +% \cs{XendXmorethantwolines} & \cs{Xendmorethantwolines} \\ +% \cs{XendXtwolines} & \cs{Xendtwolines} \\ +% \cs{Xnonumberinfootnote} & \cs{Xnonumber} \\ +% \hline +% \cs{lineref} & \cs{edlineref} \\ +% \end{longtable} +% \subsubsection{Endnotes} +% With \reledmac, there is now one auxiliary file for every endnotes set (.Aend, .Bend, .Cend etc.). If you have overriden \cs{doendnotes} (which you would not have done) you must adapt your code. +% \subsubsection{Z Series} +% The `Z' series of notes has been removed. Only five series are provided now by default: A, B, C, D, E. +% \subsubsection{Internal commands} +% Users who have overriden internal commands, which is wrong, must adapt according to the following. Or better, they should not override any of such commands and use \reledmac options instead. +% \begin{itemize} +% \item If you have modified \cs{Xfootfmt}, note that the fourth argument is now mandatory. +% \item \cs{unvxh} has been replaced with \cs{Xunvxh} and \cs{unvxhX} with two mandatory arguments. +% \end{itemize} diff --git a/Master/texmf-dist/doc/latex/reledmac/doc-include/migrate-par.dtx b/Master/texmf-dist/doc/latex/reledmac/doc-include/migrate-par.dtx new file mode 100644 index 00000000000..ab9fb03a4c0 --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/doc-include/migrate-par.dtx @@ -0,0 +1,58 @@ + +% \subsection{Migration to \eledpar 1.4.3} +% Version 1.4.3 corrects a bug added in version 0.12, which made hanging verse always flush right, despite the value of the first element in the \cs{setstanzaindents} command. +% +% However, if you want to return to automatic flushright margins for verses with hanging indents, you have to redefine the \cs{hangingsymbol} command. +% \begin{verbatim} +% \renewcommand{\hangingsymbol}{\protect\hfill} +% \end{verbatim} +% See the following two examples: +% +% With standard \cs{hangingsymbol}: +% \setstanzaindents{4,0} +% \beginnumbering +% \stanza +% A very long verse should sometimes be hanging. +% The position of the hanging verse is fixed.\& +% \endnumbering +% +% With the modification of the hangingsymbol: +% \sethangingsymbol{\protect\hfill} +% \setstanzaindents{4,0} +% \beginnumbering +% \stanza +% A very long verse should sometimes be hanging. And we can see that a hanging verse is flush right.\& +% \endnumbering +% \subsection{Migration from \eledpar to \reledpar} +% As for migration from \eledmac to \reledmac: +% \begin{itemize} +% \item One option has been removed because it is deprecated. +% \item Some of the customizations previously made by \cs{renewcommand} have been replaced with commands. +% \item Some command names have been changed in order to have a more logical and uniform pattern. +% \end{itemize} +% \subsubsection{Deprecated options} +% +% The \verb+shiftedverses+ option has been removed. +% Use the general \verb+shiftedpstart+ option instead. +% \subsubsection{\cs{renewcommand} replaced with command} +% Many uses of \cs{renewcommand} have been replaced with uses of specific commands. Please read the handbook about these particular commands. +% +% \begin{longtable}{p{0.45\textwidth}p{0.45\textwidth}} +% \emph{Deprecated \cs{renewcommand}} & \emph{Replaced with} \\ +% \endhead +% \cs{goalfraction} & \cs{setgoalfraction} \\ +% \cs{parledgroupnotespacing} & \cs{setparledgroupnotespacing}\\ +% \cs{Rlineflag} & \cs{setRlineflag} \\ +% \end{longtable} +% \subsubsection{Commands the names of which have changed} +% \label{eledmac-compat} +% In order to ease the migration from \eledpar to \reledpar, you may load \reledmac with \verb+eledmac-compat+ option. +% However, it is advised to change the command names. +% +% +% \begin{longtable}{p{0.45\textwidth}p{0.45\textwidth}} +% \emph{Old command} & \emph{New command} \\ +% \hline +% \endhead +% \cs{onlyXside} & \cs{Xonlyside} \\ +% \end{longtable} diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/1-criticalnotes.pdf b/Master/texmf-dist/doc/latex/reledmac/examples/1-criticalnotes.pdf Binary files differnew file mode 100644 index 00000000000..b60baf1f229 --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/1-criticalnotes.pdf diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/1-criticalnotes.tex b/Master/texmf-dist/doc/latex/reledmac/examples/1-criticalnotes.tex new file mode 100644 index 00000000000..7afd1f754cb --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/1-criticalnotes.tex @@ -0,0 +1,55 @@ +\documentclass{article} +\usepackage{polyglossia,fontspec,xunicode} +\usepackage{libertineotf} +\setmainlanguage{latin} +\setotherlanguage{english} + +\usepackage[series={A,B,C,D},noend,noeledsec,nofamiliar,noledgroup]{reledmac} +\Xarrangement[B]{twocol} +\Xarrangement[C]{threecol} +\Xarrangement[D]{paragraph} +\begin{document} + +\begin{english} +\title{Critical notes} +\maketitle +\begin{abstract} +This file provides examples of critical notes with reledmac. +A critical note is associated to a lemma, marked by \verb+\edtext+, and referenced by the line numbers of the lemma. +If a critical notes refers to a long lemma, we can use \verb+lemma+ to obtain an abbreviated form. + +Here we use four series of critical notes. +\begin{itemize} +\item Each note of series A has its own paragraph. +\item Each note of series B has its own paragraph, but there are arranged in two columns. +\item Each note of series C has its own paragraph, but there are arranged in three columns. +\item The notes of series D are arranged in the same paragraph. +\end{itemize} +\end{abstract} +\end{english} + +\beginnumbering +\pstart +\edtext{Lorem}{ + \Afootnote{A critical note} + \Bfootnote{Critical note in series B} + \Cfootnote{Critical note in series C} + \Dfootnote{loram}} +\edtext{ipsum}{ + \Afootnote{An other critical note} + \Bfootnote{Other critical note in series B} + \Cfootnote{Other critical note in series C} + \Dfootnote{ipsam}} + dolor sit amet, consectetur adipiscing elit. + \edtext{Fusce sed dolor libero. Aenean rutrum vestibulum lacus ut pretium. Fusce et auctor lectus. Ut et commodo quam, quis gravida orci. Nullam at risus elementum, suscipit enim a, pellentesque mi} + {\lemma{Fusce\ldots mi} + \Afootnote{A long critical note} + \Bfootnote{Again B} + \Cfootnote{Again C} + \Dfootnote{omit}}. +Morbi commodo, ligula vel consectetur accumsan, massa metus egestas velit, eu fringilla leo ante in turpis. Vivamus ut tellus sollicitudin, facilisis ipsum sit amet, tincidunt odio. Maecenas tincidunt dolor sed ante blandit tincidunt. Etiam vulputate ultricies facilisis. +\pend +\endnumbering + + +\end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/1-sidenotes.pdf b/Master/texmf-dist/doc/latex/reledmac/examples/1-sidenotes.pdf Binary files differnew file mode 100644 index 00000000000..7115c404e5e --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/1-sidenotes.pdf diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/1-sidenotes.tex b/Master/texmf-dist/doc/latex/reledmac/examples/1-sidenotes.tex new file mode 100644 index 00000000000..224832d6e3b --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/1-sidenotes.tex @@ -0,0 +1,41 @@ +\documentclass{article} +\usepackage{polyglossia,fontspec,xunicode} +\usepackage{libertineotf} +\setmainlanguage{latin} +\setotherlanguage{english} + +\usepackage[series={},nocritical,noend,noeledsec,nofamiliar,noledgroup]{reledmac} +\sidenotemargin{outer} +\renewcommand{\ledlsnotefontsetup}{\small\it}% left +\renewcommand{\ledrsnotefontsetup}{\small\it}% right +\leftnoteupfalse +\rightnoteupfalse +\setsidenotesep{ $|$ } + +\begin{document} + +\begin{english} +\title{Side notes} +\maketitle +\begin{abstract} +This file provides examples of side notes with reledmac. +We use : +\begin{itemize} + \item \verb+\ledleftnote+ (left notes); + \item \verb+\ledrightnote+ (right notes); + \item \verb+\ledsidenote+ (configurable notes). +\end{itemize} + +For the \verb+\ledsidenote+, we put them in the outer margin. +Notes are in small size, and italic. If there is more than one note by the line, they are separated$ | $. The notes start at the level of the line they are called, and continue after. +\end{abstract} +\end{english} + +\beginnumbering +\pstart +Lorem\ledrightnote{1-R}\ledleftnote{1-L} \ledsidenote{1-M}\ledsidenote{2-M}ipsum\ledrightnote{2-R} dolor\ledleftnote{2-L} sit amet, consectetur adipiscing elit. Fusce sed dolor libero. Aenean rutrum vestibulum lacus ut pretium. Fusce et auctor lectus. Ut et commodo quam, quis gravida orci. Nullam at risus elementum, suscipit enim a, pellentesque mi. Morbi commodo, ligula vel consectetur accumsan, massa metus egestas velit, eu fringilla leo ante in turpis. Vivamus ut tellus sollicitudin, facilisis ipsum sit amet, tincidunt odio. Maecenas tincidunt dolor sed ante blandit tincidunt. Etiam vulputate ultricies facilisis. +\pend +\endnumbering + + +\end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/1-tabular.pdf b/Master/texmf-dist/doc/latex/reledmac/examples/1-tabular.pdf Binary files differnew file mode 100644 index 00000000000..a8dc197cec1 --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/1-tabular.pdf diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/1-tabular.tex b/Master/texmf-dist/doc/latex/reledmac/examples/1-tabular.tex new file mode 100644 index 00000000000..87fe3e0a77c --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/1-tabular.tex @@ -0,0 +1,62 @@ +\documentclass{article} +\usepackage{fontspec} +\usepackage{libertineotf} +\usepackage{polyglossia} +\setmainlanguage{italian} +\setotherlanguage{english} + +\usepackage[series={A,B},noend,noeledsec,noledgroup]{reledmac} +\firstlinenum{1} +\linenumincrement{1}% + +\begin{document} +\begin{english} +\title{Tabulars with reledmac} +\maketitle +\begin{abstract} +This file provides example of using tabular environments with \emph{reledmac}. + +We use \verb+edtabularl+, \verb+edtabularc+ and \verb+edtabularr+, with marginal, critical and familiar notes. We also use optional arguments of \verb+\pstart+. +\end{abstract} +\end{english} + + +\beginnumbering +\pstart[\section{Left align}] +\begin{edtabularl} +linea prima & linea prima\ledouternote{sidenote l} \\ +linea secunda & linea secunda\footnoteA{familiar footnote A.} \\ +linea tertia & linea \edtext{tertia}{\Afootnote{critical note A}} \\ +linea quarta & linea \edtext{quarta}{\Bfootnote{critical note B}} \\ +linea quinta & linea quinta\footnoteB{familiar footnote B.} \\ +linea sexta & linea sexta +\end{edtabularl} +\pend + +\pstart[\section{Center align}] +\begin{edtabularc} +linea prima & linea prima\ledouternote{sidenote c} \\ +linea secunda & linea secunda\footnoteA{familiar footnote A.} \\ +linea tertia & linea \edtext{tertia}{\Afootnote{critical note A}} \\ +linea quarta & linea \edtext{quarta}{\Bfootnote{critical note B}} \\ +linea quinta & linea quinta\footnoteB{familiar footnote B.} \\ +linea sexta & linea sexta +\end{edtabularc} +\pend + + + +\pstart[\section{Right align}] +\begin{edtabularr} +linea prima & linea prima\ledouternote{sidenote r} \\ +linea secunda & linea secunda\footnoteA{familiar footnote A.} \\ +linea tertia & linea \edtext{tertia}{\Afootnote{critical note A}} \\ +linea quarta & linea \edtext{quarta}{\Bfootnote{critical note B}} \\ +linea quinta & linea quinta\footnoteB{familiar footnote B.} \\ +linea sexta & linea sexta +\end{edtabularr} +\pend + +\endnumbering + +\end{document} diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/1-verses.pdf b/Master/texmf-dist/doc/latex/reledmac/examples/1-verses.pdf Binary files differnew file mode 100644 index 00000000000..e40c7c3caa5 --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/1-verses.pdf diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/1-verses.tex b/Master/texmf-dist/doc/latex/reledmac/examples/1-verses.tex new file mode 100644 index 00000000000..ed7e2516e6e --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/1-verses.tex @@ -0,0 +1,42 @@ +\documentclass{article} +\usepackage{polyglossia,fontspec,xunicode} +\usepackage{libertineotf} +\setmainlanguage{latin} +\setotherlanguage{english} + +\usepackage[series={A,B},noend,noeledsec,noledgroup]{reledmac} +\sethangingsymbol{[\,} + + +\begin{document} +\begin{english} +\date{} +\title{Stanza} +\maketitle + +\begin{abstract} +This file provides an example of verse's typesetting with reledmac. + +The odd verses are not indented, the even are indented. When a verse is too long, the end is printed after a long indentation, and a left bracket is inserted (\verb+\sethangingsymbol+). +Two levels of critical footnotes are used. +\end{abstract} +\end{english} + +\beginnumbering +\setcounter{stanzaindentsrepetition}{2} +\setstanzaindents{8,0,1} +\stanza +Lorem ipsum dolor sit amet, consectetur adipisicing elit,& +sed do eiusmod tempor incididunt ut labore et dolore& +magna aliqua. Ut enim ad minim veniam, quis nostrud& +exercitation ullamco laboris nisi& +\edtext{ut aliquip}{\Afootnote{ut aliliquip}} consequat ut aliquip consequat irure dolor in reprehenderit irure dolor in reprehenderit& +\edtext{Duis aute}{\Bfootnote{Some comments}} irure dolor in reprehenderit& +in voluptate velit esse cillum dolore eu ur. Excepteur sint occaecat& +cupidatat non proident, sunt in culpa qui officia deserunt& +Duis aute irure dolor in reprehenderit& +in voluptate velit esse cillum dolore eu fugiat nulla& +pariatur. Excepteur sint occaecat\& +\endnumbering + +\end{document} diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/2-cross_referencing.pdf b/Master/texmf-dist/doc/latex/reledmac/examples/2-cross_referencing.pdf Binary files differnew file mode 100644 index 00000000000..1d6dafa2ff5 --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/2-cross_referencing.pdf diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/2-cross_referencing.tex b/Master/texmf-dist/doc/latex/reledmac/examples/2-cross_referencing.tex new file mode 100644 index 00000000000..784efac679b --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/2-cross_referencing.tex @@ -0,0 +1,37 @@ +\documentclass{article} +\usepackage{polyglossia,fontspec,xunicode} +\usepackage{libertineotf} +\setmainlanguage{latin} +\setotherlanguage{english} +\usepackage[series={A},noend,noeledsec,nofamiliar,noledgroup]{reledmac} +\usepackage{hyperref} + +\renewcommand{\apprefprefixsingle}{l.~} + +\begin{document} + +\begin{english} +\title{Cross-referencing with reledmac} +\date{} +\maketitle +\begin{abstract} +This file provides a MWE of cross-referencing with reledmac, with reference to line number. +The \verb+\edlabel+, \verb+\edpageref+ and \verb+\lineref+ commands are used. + +We also use \verb+\applabel+, \verb+\appref+ and \verb+\apprefprefixsingle+. + +\end{abstract} +\end{english} + +See p.~\edpageref{ultrices} l.~\edlineref{ultrices}. + +Read the variant in \appref{variant}. + +\beginnumbering + +\pstart +Pellentesque non orci dui. Donec a libero eu nisl sollicitudin lobortis eget nec lacus. Nulla pellentesque, neque ut tincidunt vestibulum, ante mi varius purus, nec cursus neque orci ut orci. \edtext{Donec bibendum ligula bibendum nisl aliquet auctor. Nam luctus lorem mauris, ac venenatis felis posuere non. Quisque ultricies ante magna, facilisis pellentesque nibh placerat at}{\applabel{variant}\Afootnote{omit}}. Aliquam sit amet ante varius, vestibulum augue condimentum, scelerisque turpis. Proin at nibh vulputate, tincidunt tellus vel, vehicula libero. Praesent venenatis, turpis nec feugiat sodales, risus sapien tempus odio, at vehicula ipsum nisl a nisl. Nunc pretium elit tellus, \edlabel{ultrices}ultrices facilisis odio interdum non. Donec et condimentum quam, id ullamcorper nisl. +\pend + +\endnumbering +\end{document} diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/2-footnote_spacing.pdf b/Master/texmf-dist/doc/latex/reledmac/examples/2-footnote_spacing.pdf Binary files differnew file mode 100644 index 00000000000..16bc01759a0 --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/2-footnote_spacing.pdf diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/2-footnote_spacing.tex b/Master/texmf-dist/doc/latex/reledmac/examples/2-footnote_spacing.tex new file mode 100644 index 00000000000..6b2f090575a --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/2-footnote_spacing.tex @@ -0,0 +1,69 @@ +\documentclass{article} +\usepackage{fontspec} +\usepackage{libertineotf} +\usepackage{polyglossia} +\setmainlanguage{latin} +\setotherlanguage{english} +\usepackage{SIunits} + +\usepackage[series={A,B,C},noend,noeledsec,noledgroup]{reledmac} + +% THE APPARATI ARE PARAGRAPHED +\Xarrangement{paragraph} + + +%VERTICAL SPACES BEFORE APPARATUS +\preXnotes{0.5cm} + +% VERTICAL SPACE BEFORE RULES +\newlength{\before} % A length which will contains the space before the rule +\setlength{\before}{3mm} % The space we want to have +\addtolength{\before}{3pt} % A compensation for the space decreased by \footnoterule +\Xbeforenotes{\before} % And so, we configure reledmac. + +% VERTICAL SPACE AFTER RULES +\newlength{\after} % A length which will contains the space before the rule +\setlength{\after}{3mm} % The space we want to have +\addtolength{\after}{-2.6pt} % A compensation for the space added by \footnoterule +\Xafterrule{\after} % And so, we configure reledmac. + +\begin{document} + +\begin{english} +\title{Setting spaces around footnote rules} +\maketitle +\begin{abstract} +This file sets spaces around footnote rules, to have a uniform \unit{3}{\milli\meter} before and after. There are three levels of paragraphed notes. Before the first series of notes, we have \unit{0.5}{\centi\meter}. + +We use \verb+\Xbeforenotes+ and \verb+\Xafterrule+. There is, anyway, a subtlety: the footnote rule of reledmac is the standard \LaTeX footnote rule: \verb+\footnoterule+, which automatically decreases \unit{3}{pt} before and adds \unit{2.6}{pt} after. So we have to compensate, by defining to length: \verb+before+ and \verb+\after+, which are passed to the respective commands. +\end{abstract} +\end{english} + +\beginnumbering +\pstart% +Cum defensionum \edtext{laboribus}{\Cfootnote{first note}} senatoriisque muneribus aut omnino aut magna ex parte essem aliquando liberatus, rettuli me, Brute, te hortante maxime ad ea studia, quae retenta animo, remissa temporibus, longo intervallo intermissa revocavi, et cum omnium artium, quae ad rectam vivendi viam pertinerent, \edtext{ratio}{\Afootnote{second note}} et disciplina studio sapientiae, quae philosophia dicitur, contineretur, hoc mihi Latinis litteris \edtext{inlustrandum}{\Cfootnote{third note}} putavi, non quia \edtext{philosophia}{\Bfootnote{fourth note}} Graecis et litteris et doctoribus percipi non posset, sed meum semper iudicium fuit omnia nostros aut invenisse per se sapientius quam Graecos aut accepta ab illis fecisse meliora, quae quidem digna statuissent, in quibus elaborarent. +\pend + +\pstart% +Cum defensionum \edtext{laboribus}{\Cfootnote{first note}} senatoriisque muneribus aut omnino aut magna ex parte essem aliquando liberatus, rettuli me, Brute, te hortante maxime ad ea studia, quae retenta animo, remissa temporibus, longo intervallo intermissa revocavi, et cum omnium artium, quae ad rectam vivendi viam pertinerent, \edtext{ratio}{\Afootnote{second note}} et disciplina studio sapientiae, quae philosophia dicitur, contineretur, hoc mihi Latinis litteris \edtext{inlustrandum}{\Cfootnote{third note}} putavi, non quia \edtext{philosophia}{\Bfootnote{fourth note}} Graecis et litteris et doctoribus percipi non posset, sed meum semper iudicium fuit omnia nostros aut invenisse per se sapientius quam Graecos aut accepta ab illis fecisse meliora, quae quidem digna statuissent, in quibus elaborarent. +\pend + +\pstart% +Cum defensionum \edtext{laboribus}{\Cfootnote{first note}} senatoriisque muneribus aut omnino aut magna ex parte essem aliquando liberatus, rettuli me, Brute, te hortante maxime ad ea studia, quae retenta animo, remissa temporibus, longo intervallo intermissa revocavi, et cum omnium artium, quae ad rectam vivendi viam pertinerent, \edtext{ratio}{\Afootnote{second note}} et disciplina studio sapientiae, quae philosophia dicitur, contineretur, hoc mihi Latinis litteris \edtext{inlustrandum}{\Cfootnote{third note}} putavi, non quia \edtext{philosophia}{\Bfootnote{fourth note}} Graecis et litteris et doctoribus percipi non posset, sed meum semper iudicium fuit omnia nostros aut invenisse per se sapientius quam Graecos aut accepta ab illis fecisse meliora, quae quidem digna statuissent, in quibus elaborarent. +\pend + +\pstart% +Cum defensionum \edtext{laboribus}{\Cfootnote{first note}} senatoriisque muneribus aut omnino aut magna ex parte essem aliquando liberatus, rettuli me, Brute, te hortante maxime ad ea studia, quae retenta animo, remissa temporibus, longo intervallo intermissa revocavi, et cum omnium artium, quae ad rectam vivendi viam pertinerent, \edtext{ratio}{\Afootnote{second note}} et disciplina studio sapientiae, quae philosophia dicitur, contineretur, hoc mihi Latinis litteris \edtext{inlustrandum}{\Cfootnote{third note}} putavi, non quia \edtext{philosophia}{\Bfootnote{fourth note}} Graecis et litteris et doctoribus percipi non posset, sed meum semper iudicium fuit omnia nostros aut invenisse per se sapientius quam Graecos aut accepta ab illis fecisse meliora, quae quidem digna statuissent, in quibus elaborarent. +\pend + +\pstart% +Cum defensionum \edtext{laboribus}{\Cfootnote{first note}} senatoriisque muneribus aut omnino aut magna ex parte essem aliquando liberatus, rettuli me, Brute, te hortante maxime ad ea studia, quae retenta animo, remissa temporibus, longo intervallo intermissa revocavi, et cum omnium artium, quae ad rectam vivendi viam pertinerent, \edtext{ratio}{\Afootnote{second note}} et disciplina studio sapientiae, quae philosophia dicitur, contineretur, hoc mihi Latinis litteris \edtext{inlustrandum}{\Cfootnote{third note}} putavi, non quia \edtext{philosophia}{\Bfootnote{fourth note}} Graecis et litteris et doctoribus percipi non posset, sed meum semper iudicium fuit omnia nostros aut invenisse per se sapientius quam Graecos aut accepta ab illis fecisse meliora, quae quidem digna statuissent, in quibus elaborarent. +\pend + +\pstart% +Cum defensionum \edtext{laboribus}{\Cfootnote{first note}} senatoriisque muneribus aut omnino aut magna ex parte essem aliquando liberatus, rettuli me, Brute, te hortante maxime ad ea studia, quae retenta animo, remissa temporibus, longo intervallo intermissa revocavi, et cum omnium artium, quae ad rectam vivendi viam pertinerent, \edtext{ratio}{\Afootnote{second note}} et disciplina studio sapientiae, quae philosophia dicitur, contineretur, hoc mihi Latinis litteris \edtext{inlustrandum}{\Cfootnote{third note}} putavi, non quia \edtext{philosophia}{\Bfootnote{fourth note}} Graecis et litteris et doctoribus percipi non posset, sed meum semper iudicium fuit omnia nostros aut invenisse per se sapientius quam Graecos aut accepta ab illis fecisse meliora, quae quidem digna statuissent, in quibus elaborarent. +\pend + +\endnumbering + +\end{document} diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/2-indexing.pdf b/Master/texmf-dist/doc/latex/reledmac/examples/2-indexing.pdf Binary files differnew file mode 100644 index 00000000000..9cc042b84ec --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/2-indexing.pdf diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/2-indexing.tex b/Master/texmf-dist/doc/latex/reledmac/examples/2-indexing.tex new file mode 100644 index 00000000000..fc61b0c83ff --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/2-indexing.tex @@ -0,0 +1,42 @@ +\documentclass{article} +\usepackage{polyglossia,fontspec,xunicode} +\usepackage{libertineotf} +\setmainlanguage{latin} +\setotherlanguage{english} +\usepackage[nonewpage]{indextools} + +\usepackage[series={},nocritical,noend,noeledsec,nofamiliar,noledgroup]{reledmac} +\usepackage{hyperref} +\makeindex +\makeindex[title=Index Nominum,name=name] +\begin{document} + +\begin{english} +\date{} +\title{Indexing with reledmac} +\maketitle + +\begin{abstract} + This file provides a MWE of indexing with reledmac, referencing to line number. + The \verb+\edindex+ command is used. The package indextools is used, to have multiple index. +\end{abstract} +\end{english} + +\beginnumbering +\pstart +Imperator\edindex[name]{Nero} purus, dictum a semper eu, \edindex{long passage|(}fermentum a augue. Nam enim sapien, consequat sit amet fermentum et, convallis non orci. Aliquam erat volutpat. Sed laoreet vitae enim eget posuere. Integer auctor aliquet sagittis. Curabitur odio felis, tempus sit amet porttitor sed, mattis a sapien. Interdum et malesuada fames ac ante ipsum primis in faucibus. Vivamus posuere adipiscing erat, et porta augue semper nec. +\pend +\pstart +Phasellus pretium euismod urna ac congue. Integer interdum\edindex{long passage|)} dapibus aliquet. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vestibulum placerat volutpat est, porta adipiscing lectus commodo vel. Vestibulum libero magna, vulputate eget tellus ornare, posuere lobortis velit. Suspendisse non diam at est auctor luctus in nec elit. Cras sed aliquam tellus. Suspendisse non odio sit amet nunc consequat malesuada. Curabitur eget lacus lectus. Vivamus elementum risus eget nisi venenatis, in volutpat elit placerat. Maecenas congue nunc id est luctus accumsan. Fusce id nisl enim. +\pend +\pstart +Pellentesque non orci dui. Donec a libero\edindex{libero|textbf} eu nisl sollicitudin lobortis eget nec lacus. Nulla pellentesque, neque ut tincidunt vestibulum, ante mi varius purus, nec cursus neque orci ut orci. Donec bibendum ligula bibendum nisl aliquet auctor. Nam luctus lorem mauris, ac venenatis felis posuere non. Quisque ultricies ante magna, facilisis pellentesque nibh placerat at. Aliquam sit amet ante varius, vestibulum augue condimentum, scelerisque turpis. Proin at nibh vulputate, tincidunt tellus vel, vehicula libero. Praesent venenatis, turpis nec feugiat sodales, risus sapien tempus odio, at vehicula ipsum nisl a nisl. Nunc pretium elit tellus, ultrices facilisis odio interdum non. Donec et condimentum quam, id ullamcorper nisl. +\pend +\endnumbering + +\newpage +\printindex + +\printindex[name] + +\end{document} diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/2-lemma_disambigution.pdf b/Master/texmf-dist/doc/latex/reledmac/examples/2-lemma_disambigution.pdf Binary files differnew file mode 100644 index 00000000000..99e9aca685a --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/2-lemma_disambigution.pdf diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/2-lemma_disambigution.tex b/Master/texmf-dist/doc/latex/reledmac/examples/2-lemma_disambigution.tex new file mode 100644 index 00000000000..4eab3e03500 --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/2-lemma_disambigution.tex @@ -0,0 +1,46 @@ +\documentclass{article} +\usepackage{polyglossia,fontspec,xunicode} +\usepackage{libertineotf} +\usepackage[series={A,B},nofamiliar,noend,noeledsec,noledgroup]{reledmac} +\setmainlanguage{latin} +\setotherlanguage{english} +\begin{document} + + +\begin{english} +\date{} +\title{Lemma's disambiguation} +\maketitle + +\firstlinenum{1} +\linenumincrement{1} + +\begin{abstract} +This file provides an example of lemma's disambuigation. + +All word which can potentially be twice (or more) in a same line is marked by an \verb+\sameword+. \emph{reledmac} print the word rank only if the word is effectively printed twice (or more) time in the same line. + +For use with \verb+\lemma+, please read the handbook. + +\end{abstract} +\end{english} + + + + + +\beginnumbering +\pstart +Leo \sameword{aut} ursus \sameword{aut} oryx \sameword{aut} ricinus \sameword{aut} equus \sameword{aut} +lupus \edtext{\sameword{aut}}{\Afootnote{et}\Bfootnote{monotone\ldots}} canis \sameword{aut} felix \sameword{aut} asinus \edtext{\sameword{aut}}{\Afootnote{et}} burricus. + +\pend +\endnumbering + + + + + + + +\end{document} diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/2-line_numbers_in_header.pdf b/Master/texmf-dist/doc/latex/reledmac/examples/2-line_numbers_in_header.pdf Binary files differnew file mode 100644 index 00000000000..2c1efb77b55 --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/2-line_numbers_in_header.pdf diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/2-line_numbers_in_header.tex b/Master/texmf-dist/doc/latex/reledmac/examples/2-line_numbers_in_header.tex new file mode 100644 index 00000000000..08995166062 --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/2-line_numbers_in_header.tex @@ -0,0 +1,72 @@ +\documentclass[]{article} +\usepackage{fontspec} +\usepackage{libertineotf} +\usepackage{polyglossia} +\setmainlanguage{latin} +\setotherlanguage{english} + +% CONFIG FANCYHDR TO SHOW LEFT/RIGHT MARKS IN HEADERS +\usepackage{fancyhdr} +\pagestyle{fancy} +\fancyhead[LE,LO]{\rightmark} +\fancyhead[RO,RE]{\leftmark} + + +% CONFIG reledMAC TO ADD LINE NUMBER AS LEFT/RIGHT MARKS +\usepackage[series={},nocritical,noend,noeledsec,nofamiliar,noledgroup]{reledmac} +\makeatletter +\doinsidelinehook{\markboth{\the\line@num}{\the\line@num}} +\makeatother + +\begin{document} + +\begin{english} +\title{Line numbers in headers} +\maketitle +\begin{abstract} +This file provides examples of code to add line numbers in headers. + +We use the \LaTeX\ mark system and the \emph{fancyhdr} package. +We use the \verb+\doinsidelinehook+ macro, in order to add the line number to the \LaTeX\ marks\footnote{Read the \emph{fancyhdr} handbook to understand how \LaTeX\ marks work, especially §~9.}. As we manipulate commands with \verb+@+, we have to use \verb+\makeatletter+. + +\end{abstract} +\end{english} + + +\beginnumbering +\autopar + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris dapibus scelerisque imperdiet. Aliquam gravida elementum enim facilisis tincidunt. Quisque tempus venenatis velit, ut vestibulum nibh rutrum id. Proin pretium volutpat erat, in faucibus eros tempus sed. Fusce malesuada, sapien et commodo congue, tellus magna interdum purus, a varius arcu odio facilisis lectus. Nullam metus odio, ullamcorper at neque et, consequat interdum sapien. Pellentesque volutpat risus augue, non commodo augue hendrerit eget. Fusce tincidunt tincidunt ultricies. Praesent ut dui non nulla gravida dignissim ac sed velit. Ut porta rutrum diam, eu pellentesque felis tincidunt quis. Donec eget porta dolor. In hac habitasse platea dictumst. Suspendisse mauris lorem, convallis vitae congue at, ultricies nec nulla. Sed in mi mi. + +Nullam vel nisi ut lacus luctus malesuada ut vitae lectus. Donec sed mauris aliquet, congue est sed, tincidunt nulla. Ut malesuada, urna vitae luctus volutpat, nulla mauris tincidunt nibh, nec malesuada justo ipsum tempor justo. Donec a laoreet sem. Mauris ut ligula a ipsum tincidunt scelerisque lobortis et enim. Maecenas bibendum elit ut nulla adipiscing commodo. Integer a bibendum sapien. Cras nec sagittis erat, eget dignissim nulla. Etiam vitae feugiat purus, eu mollis eros. Cras non eros id lorem venenatis elementum sit amet et ipsum. Suspendisse a nibh in massa tincidunt varius et eget urna. Nullam sem arcu, pulvinar sed enim non, vulputate pellentesque sem. Quisque vestibulum iaculis laoreet. Integer lacinia eros eget eros elementum, consequat hendrerit urna viverra. Curabitur sem velit, congue nec mi quis, dictum accumsan nisi. + +Morbi quis interdum velit. Duis pretium velit magna, eu bibendum diam lacinia sit amet. Donec leo lorem, suscipit vitae eros et, tristique viverra orci. Aenean sed pharetra quam, et imperdiet eros. Nullam eget magna ut odio sodales sagittis eget in tortor. Nunc ac molestie quam. Fusce vitae risus ut lectus tempus facilisis vel vel est. Suspendisse lorem urna, tristique at lectus ut, commodo semper orci. Sed aliquet malesuada justo. Mauris condimentum urna semper lacus sagittis, nec cursus leo cursus. Etiam suscipit sem et nulla lacinia ultricies. Sed a magna viverra, varius magna nec, dignissim nibh. Proin faucibus sem sed risus consequat, non dignissim tortor viverra. + +Proin dignissim est et dui venenatis, at tincidunt tortor dignissim. Aenean viverra ante mauris. Praesent interdum nibh vitae purus scelerisque suscipit. Aliquam porta, turpis a rutrum condimentum, nulla libero consectetur ligula, a viverra nisi justo sed tellus. Phasellus adipiscing turpis in varius consequat. Phasellus lorem justo, porttitor sit amet malesuada venenatis, fermentum quis libero. Fusce placerat, tellus viverra sodales suscipit, enim leo semper lorem, vel ullamcorper ipsum est nec massa. Curabitur purus tortor, vehicula at augue id, semper rutrum tortor. Nulla facilisi. Suspendisse nulla ligula, posuere nec commodo a, consectetur in magna. + +Vivamus pellentesque mauris et leo pharetra dignissim eget vel justo. Suspendisse potenti. Nunc consectetur velit in accumsan tempor. Cras feugiat tempor ligula, ut aliquet dui placerat quis. Nullam adipiscing lorem blandit lacus interdum faucibus. Sed blandit augue magna, tincidunt luctus velit elementum eget. Nulla eu faucibus est, sit amet laoreet tellus. Suspendisse aliquam arcu in tortor condimentum, sit amet bibendum eros dictum. Suspendisse at commodo nunc. Nullam elementum dolor non interdum commodo. Phasellus tristique mauris sed orci pulvinar, et faucibus purus mollis. Suspendisse potenti. + +Integer eleifend risus non felis tincidunt lacinia. Suspendisse tortor risus, ullamcorper at justo quis, scelerisque dapibus nunc. Nunc placerat nunc sed enim tempor congue ac ut ipsum. Morbi quis dui id neque scelerisque volutpat eu eu est. Vestibulum mollis aliquet orci, in pellentesque risus varius a. Nullam tempus lectus sit amet orci malesuada, nec facilisis nibh congue. Sed felis nibh, elementum non tempus quis, aliquet at felis. + +Curabitur cursus arcu a quam ornare vehicula. Aenean eleifend auctor velit, id elementum urna pretium quis. Nam facilisis sem lorem, quis dictum urna suscipit eu. Nam malesuada nulla quis eleifend pretium. Curabitur id nisl diam. Ut viverra sit amet massa id lobortis. Pellentesque egestas eros ac mauris faucibus, at condimentum lacus porta. Proin et pulvinar augue. Mauris eu pretium eros. Mauris tempor quam non enim gravida tempor. Cras ultricies condimentum pellentesque. Curabitur nec arcu ac turpis dignissim venenatis tristique nec risus. Morbi magna augue, ultricies ut est ac, scelerisque imperdiet diam. Vivamus ultricies sagittis consectetur. Proin tincidunt diam vitae luctus vestibulum. Aliquam gravida tortor at neque egestas varius. + +Nullam ac porta felis, a vestibulum nunc. Suspendisse nisl leo, tincidunt eu porttitor non, lobortis sed tellus. Mauris consectetur varius hendrerit. Integer dapibus purus non arcu sollicitudin rhoncus ac quis tortor. Suspendisse ullamcorper nec ligula non pulvinar. Nulla tempus aliquam arcu sed molestie. Fusce suscipit, tellus quis ultrices rhoncus, lectus ipsum ullamcorper odio, nec vestibulum nibh nisl vel tortor. + +Pellentesque augue massa, accumsan nec nibh non, semper vehicula magna. Quisque a diam id tortor consequat facilisis. Pellentesque viverra magna at nulla ullamcorper, at porttitor leo laoreet. Suspendisse tincidunt consectetur tristique. Aenean ultrices lectus vel volutpat rhoncus. Integer adipiscing metus sem, eu congue sapien lacinia ac. Nunc dignissim erat sem, ac consectetur augue luctus ac. Nunc non varius tortor, id dignissim leo. Cras eu dapibus risus. In ut ipsum in odio semper eleifend quis quis turpis. Donec dui ipsum, congue at pretium eget, mollis non libero. Integer imperdiet purus eu velit scelerisque, cursus lacinia orci vulputate. In lectus lectus, cursus at placerat a, semper in purus. Duis iaculis dolor turpis, in eleifend ipsum feugiat eget. + +Nam ut nisi sed eros tempus tempor et quis urna. Quisque sed ornare augue. Duis molestie consequat sagittis. Aliquam congue, enim et auctor dignissim, neque libero tincidunt libero, eget sagittis tortor urna vitae ligula. Aliquam erat volutpat. Curabitur nisi nisl, aliquet at massa a, tincidunt interdum justo. Ut ornare volutpat dictum. Donec neque erat, ullamcorper et ligula in, tincidunt consectetur sapien. Vestibulum scelerisque id justo quis porta. Sed non ornare dolor. Integer id tincidunt leo. Nam turpis mi, laoreet non commodo id, mollis id quam. + +Cras augue dolor, rhoncus ullamcorper diam vitae, euismod laoreet felis. Quisque eget elit varius, luctus lacus a, auctor nunc. Nulla non porttitor leo. Nullam tincidunt, justo ac consectetur fringilla, neque metus vehicula purus, sit amet mattis est enim vitae orci. In sit amet metus metus. Etiam commodo interdum porttitor. Nulla nec tempor felis, ac pellentesque arcu. Duis ultrices nunc convallis, malesuada lorem a, interdum tortor. Duis ultricies, lectus a ultricies rhoncus, velit elit porta nunc, et dapibus sapien ante at tortor. Integer odio urna, aliquam nec pharetra et, accumsan id nisl. Ut mattis, velit sagittis semper malesuada, elit lectus vulputate magna, sit amet luctus sem risus vel justo. Pellentesque vitae commodo leo. + +Proin sed ipsum quam. Vestibulum nec iaculis ante. Donec et euismod mi, at tristique magna. Ut quis viverra urna. Cras ultricies, metus id tempor dapibus, libero velit vestibulum leo, a fringilla nibh lectus eu ante. Etiam dapibus mi non dolor feugiat, non congue ipsum commodo. Etiam justo libero, aliquam eu suscipit sit amet, convallis at leo. Phasellus vitae lacus et nulla consequat semper a eu risus. + +Mauris vitae lorem faucibus nibh tincidunt rutrum. Nunc quis luctus augue, eget malesuada metus. Morbi tellus odio, rutrum eget nulla congue, suscipit convallis nunc. Aenean congue non massa id sodales. Curabitur interdum eleifend adipiscing. Nulla suscipit imperdiet diam quis convallis. Curabitur sem lectus, pharetra et sapien nec, tempor interdum orci. Nam eu hendrerit tellus. In iaculis sed turpis nec sagittis. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean faucibus dui non neque facilisis, eget feugiat ante rhoncus. Donec hendrerit tempus neque, eu fringilla magna volutpat accumsan. Vestibulum viverra, metus eu tempor hendrerit, justo enim rutrum risus, sit amet tincidunt odio lectus quis mi. + +Vivamus vitae augue metus. Curabitur lacinia pulvinar lorem, a dictum velit euismod ut. Mauris non posuere ligula. Quisque vitae felis non odio condimentum adipiscing. Integer sed porttitor ligula, a pharetra turpis. Praesent fermentum malesuada lectus vel gravida. Sed convallis sem et posuere iaculis. Integer auctor tortor aliquam, adipiscing ante condimentum, condimentum sapien. Aenean hendrerit elementum convallis. Integer vel elit accumsan, eleifend nisi at, commodo eros. Sed vitae felis at augue sagittis tempus. Sed volutpat erat vitae orci vestibulum convallis a porttitor justo. Cras sem diam, viverra et pulvinar vel, ornare nec lectus. + +Integer id enim vitae purus dignissim iaculis a vitae nulla. Nullam fermentum est a tincidunt tristique. Curabitur luctus arcu quis nisl porta congue. Pellentesque nec ornare justo, eu mattis mi. Sed eget dolor elementum, condimentum massa non, fermentum nulla. Quisque magna justo, pulvinar sed sollicitudin a, hendrerit sed massa. Proin vel pretium augue, vel pharetra enim. Sed ut sapien aliquet, tempor tortor sit amet, fermentum est. Maecenas congue pharetra malesuada. Pellentesque condimentum dolor in aliquet volutpat. Mauris purus lectus, cursus id quam eget, tincidunt ornare sem. Nulla facilisi. Pellentesque placerat in leo vitae tincidunt. Nulla posuere, ligula quis tempus dignissim, enim elit vulputate mauris, nec placerat eros mi eu neque. + +Aenean interdum fringilla nisi. Sed sagittis erat ac sapien imperdiet viverra. Donec ut rhoncus turpis, eget mattis risus. Cras consequat mauris quis ipsum malesuada ullamcorper. Nam viverra lobortis turpis. Nulla eget fermentum lorem. Pellentesque eu libero vitae enim tempus eleifend et id augue. Vestibulum vehicula vitae quam et tristique. + +\endnumbering +\end{document} diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/2-one_series_per_pstart.pdf b/Master/texmf-dist/doc/latex/reledmac/examples/2-one_series_per_pstart.pdf Binary files differnew file mode 100644 index 00000000000..8470bb06d2c --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/2-one_series_per_pstart.pdf diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/2-one_series_per_pstart.tex b/Master/texmf-dist/doc/latex/reledmac/examples/2-one_series_per_pstart.tex new file mode 100644 index 00000000000..522b9183f24 --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/2-one_series_per_pstart.tex @@ -0,0 +1,130 @@ +\documentclass{article} +\usepackage[series={A,B,C,D,E},noend,noeledsec,nofamiliar,noledgroup]{reledmac} +\usepackage{lipsum,polyglossia} +\setmainlanguage{english} +\usepackage{libertine} + + +\newcounter{mynotelevel}%A counter to dump the note level +\renewcommand{\themynotelevel}{\Alph{mynotelevel}}% The counter is seen as a letter +\AtEveryPstart{% + \addtocounter{mynotelevel}{1}%Step counter + \ifnumequal{\value{mynotelevel}}{6}{%No more than 5 + \setcounter{mynotelevel}{1}% + }{}% + \global\letcs{\mynote}{\themynotelevel footnote}%Change the mynote + \seriesatend{\themynotelevel}%And place current series at the end +} +\begin{document} + +\title{One series per \textbackslash pstart with reledmac} +\author{} +\maketitle +\begin{abstract} +This file provides examples of features that allow one series of notes by \verb+\pstart+…\verb+pend+. + +We suppose there is no more than five \verb+\pstart+…\verb+pend+ by page. + +Instead of using \verb+\Afootnote+, \verb+\Bfootnote+ etc., we use \verb+\mynote+, which we set to \verb+\Afootnote+ at the first \verb+pstart+, \verb+\Bfootnote+ at the second \verb+\pstart+, \verb+\Cfootnote+ at the third, \verb+\Dfootnote+ at the fourth, \verb+\Efootnote+ at the fifth. And we restart at \verb+\Afootnote+ at the sixth \verb+\pstart+. + +To do this, we increment the counter \verb+mynotelevel+ at every \verb+pstart+ and reset it to~1 when it becomes equal to~6. + +We use \verb+\seriesatend+ to ensure that a \verb+pstart+ series between two pages will be printed on the first page at the end of the series, but on the second page at the beginning of the series. +\end{abstract} + + \beginnumbering + + \pstart + \edtext{\themynotelevel Here}{\mynote{First footnote in \themynotelevel}} is the + \edtext{\themynotelevel first}{\mynote{Second footnote in \themynotelevel.}} paragraph: + \lipsum[1] + \pend + + \pstart + \edtext{\themynotelevel Here}{\mynote{First footnote in \themynotelevel}} is the + \edtext{\themynotelevel second}{\mynote{Second footnote in \themynotelevel.}} paragraph: + \lipsum[2] + \pend + + \pstart + \edtext{\themynotelevel Here}{\mynote{First footnote in \themynotelevel}} is the + \edtext{\themynotelevel second}{\mynote{Second footnote in \themynotelevel.}} paragraph: + \lipsum[2] + \pend + + \pstart + \edtext{\themynotelevel Here}{\mynote{First footnote in \themynotelevel}} is the + \edtext{\themynotelevel second}{\mynote{Second footnote in \themynotelevel.}} paragraph: + \lipsum[2] + \pend + \pstart + \edtext{\themynotelevel Here}{\mynote{First footnote in \themynotelevel}} is the + \edtext{\themynotelevel second}{\mynote{Second footnote in \themynotelevel.}} paragraph: + \lipsum[2]\edtext{on therpage}{\mynote{on otherpage}} + \pend + + \pstart + \edtext{\themynotelevel Here}{\mynote{First footnote in \themynotelevel}} is the + \edtext{\themynotelevel second}{\mynote{Second footnote in \themynotelevel.}} paragraph: + \lipsum[2] + \pend + + \pstart + \edtext{\themynotelevel Here}{\mynote{First footnote in \themynotelevel}} is the + \edtext{\themynotelevel second}{\mynote{Second footnote in \themynotelevel.}} paragraph: + \lipsum[2] + \pend + + \pstart + \edtext{\themynotelevel Here}{\mynote{First footnote in \themynotelevel}} is the + \edtext{\themynotelevel second}{\mynote{Second footnote in \themynotelevel.}} paragraph: + \lipsum[2] + \pend + + \pstart + \edtext{\themynotelevel Here}{\mynote{First footnote in \themynotelevel}} is the + \edtext{\themynotelevel second}{\mynote{Second footnote in \themynotelevel.}} paragraph: + \lipsum[2] + \pend + + + \pstart + \edtext{\themynotelevel Here}{\mynote{First footnote in \themynotelevel}} is the + \edtext{\themynotelevel second}{\mynote{Second footnote in \themynotelevel.}} paragraph: + \lipsum[2] + \pend + \pstart + \edtext{\themynotelevel Here}{\mynote{First footnote in \themynotelevel}} is the + \edtext{\themynotelevel second}{\mynote{Second footnote in \themynotelevel.}} paragraph: + \lipsum[2] + \pend + + \pstart + \edtext{\themynotelevel Here}{\mynote{First footnote in \themynotelevel}} is the + \edtext{\themynotelevel second}{\mynote{Second footnote in \themynotelevel.}} paragraph: + \lipsum[2] + \pend + + + \pstart + \edtext{\themynotelevel Here}{\mynote{First footnote in \themynotelevel}} is the + \edtext{\themynotelevel second}{\mynote{Second footnote in \themynotelevel.}} paragraph: + \lipsum[2] + \pend + + + \pstart + \edtext{\themynotelevel Here}{\mynote{First footnote in \themynotelevel}} is the + \edtext{\themynotelevel second}{\mynote{Second footnote in \themynotelevel.}} paragraph: + \lipsum[2] + \pend + + + \pstart + \edtext{\themynotelevel Here}{\mynote{First footnote in \themynotelevel}} is the + \edtext{\themynotelevel second}{\mynote{Second footnote in \themynotelevel.}} paragraph: + \lipsum[2] + \pend + \endnumbering + +\end{document} diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/2-performances.pdf b/Master/texmf-dist/doc/latex/reledmac/examples/2-performances.pdf Binary files differnew file mode 100644 index 00000000000..2f6c9502705 --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/2-performances.pdf diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/2-performances.tex b/Master/texmf-dist/doc/latex/reledmac/examples/2-performances.tex new file mode 100644 index 00000000000..b0b9dfbbfaa --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/2-performances.tex @@ -0,0 +1,40 @@ +\documentclass{article} +\usepackage{polyglossia,fontspec,xunicode} +\usepackage{libertineotf} +\setmainlanguage{latin} +\setotherlanguage{english} + +\usepackage[series={},nocritical,noend,nofamiliar,noeledsec,noledgroup]{reledmac} + + +\begin{document} + +\begin{english} +\title{Options to customize performance} +\maketitle +\begin{abstract} +The \emph{reledmac} package provides multiple tools. However, these tools require many \TeX\ resources. If you do not need all these tools, you can disable them in order to optimize performance. + +In this example, we have used all available tools, in order to enable a very minimal use of \emph{reledmac}. + +\begin{itemize} + \item\verb+series={}+ suppress all series of notes. By default, \emph{reledmac} provides six series of notes: A, B, C, D, E, Z. You can choose to use none of them, or only some of them, using for example \verb+series={A,B}+. You can also decide to have more than six series. + \item\verb+nocritical+ for all series, \emph{reledmac} provides critical footnotes, which associate a lemma to a note. If you do not need critical footnotes, you can use \verb+nocritical+. + \item\verb+nofamiliar+ for all series, \emph{reledmac} provides critical endnotes, which associate a lemma to a note. If you do not need critical endnotes, you can use \verb+noend+. + \item\verb+nofamiliar+ for all series, \emph{reledmac} provides familiar footnotes, which associate use. If you do not need familiar footnotes, you can use \verb+nofamiliar+. + \item\verb+noeledsec+, \emph{reledmac} provides \verb+\eledsection+, \verb+\reledsubsection+ and similar commands in order to use sectioning commands inside numbered texts and to associate critical notes to section header. This feature needs writing in new auxiliary files. If you do not need this feature, use \verb+noeledsec+. + \item\verb+noledgroup+ if you do not need the \verb+ledgroup+ feature of \emph{reledmac} and you do not use critical and familiar notes inside minipages, you can use \verb+noledgroup+. +\end{itemize} + + +\end{abstract} +\end{english} + +\beginnumbering +\pstart +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sed dolor libero. Aenean rutrum vestibulum lacus ut pretium. Fusce et auctor lectus. Ut et commodo quam, quis gravida orci. Nullam at risus elementum, suscipit enim a, pellentesque mi. Morbi commodo, ligula vel consectetur accumsan, massa metus egestas velit, eu fringilla leo ante in turpis. Vivamus ut tellus sollicitudin, facilisis ipsum sit amet, tincidunt odio. Maecenas tincidunt dolor sed ante blandit tincidunt. Etiam vulputate ultricies facilisis. +\pend +\endnumbering + + +\end{document} diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/2-titles_in_line_numbering_with_notes.pdf b/Master/texmf-dist/doc/latex/reledmac/examples/2-titles_in_line_numbering_with_notes.pdf Binary files differnew file mode 100644 index 00000000000..45fa6ef2a4b --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/2-titles_in_line_numbering_with_notes.pdf diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/2-titles_in_line_numbering_with_notes.tex b/Master/texmf-dist/doc/latex/reledmac/examples/2-titles_in_line_numbering_with_notes.tex new file mode 100644 index 00000000000..c19ca267f7b --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/2-titles_in_line_numbering_with_notes.tex @@ -0,0 +1,104 @@ +\documentclass[twoside,12pt]{book} +\usepackage{polyglossia,fontspec,xunicode} +\usepackage{libertineotf} +\setmainlanguage{english} + +\usepackage[series={A},noend,nofamiliar,noledgroup]{reledmac} +\linenumincrement{1} +\firstlinenum{1} +\begin{document} +\title{Sectioning commands with critical notes} + +\date{} + +{\let\newpage\relax\maketitle} +{\small +This file provides examples of using sectioning command with reledmac. The section titles are in the line numbering, and have critical and side notes. + +We use the \verb+\reledxxx+ commands, each of them in their own \verb+\pstart…\pend+ group. + +Page breaks are manually added before chapter with \verb+\beforeeledchapter+. +} +\beginnumbering +\beforeeledchapter +\pstart +\eledchapter{\edtext{chapter}{\Afootnote{chapitre}}\ledsidenote{chapter}} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten.. +\pend + +\pstart +\eledsection{section\ledsidenote{section}} +\pend + +\pstart +\eledsubsection{\edtext{subsection}{\Afootnote{sous-section}}\ledsidenote{subsection}} +\pend + +\pstart +\eledsubsubsection{\edtext{subsubsection}{\Afootnote{sous-sous-section}}\ledsidenote{subsubsection}} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten. +\pend + +\pstart +\eledsection{section\ledsidenote{section}} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten. +\pend + + +\beforeeledchapter +\pstart +\eledchapter{\edtext{chapter}{\Afootnote{chapitre}}\ledsidenote{chapter}} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten.. +\pend + +\pstart +\eledsection{section\ledsidenote{section}} +\pend + +\pstart +\eledsubsection{\edtext{subsection}{\Afootnote{sous-section}}\ledsidenote{subsection}} +\pend + +\pstart +\eledsubsubsection{\edtext{subsubsection}{\Afootnote{sous-sous-section}}\ledsidenote{subsubsection}} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten. +\pend + +\pstart +\eledsection{section\ledsidenote{section}} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten. +\pend + +\endnumbering + +\end{document} diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/2-titles_not_in_line_numbering.pdf b/Master/texmf-dist/doc/latex/reledmac/examples/2-titles_not_in_line_numbering.pdf Binary files differnew file mode 100644 index 00000000000..03c551bfecc --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/2-titles_not_in_line_numbering.pdf diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/2-titles_not_in_line_numbering.tex b/Master/texmf-dist/doc/latex/reledmac/examples/2-titles_not_in_line_numbering.tex new file mode 100644 index 00000000000..d30b307bbe0 --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/2-titles_not_in_line_numbering.tex @@ -0,0 +1,54 @@ +\documentclass{article} +\usepackage{polyglossia,fontspec,xunicode} +\usepackage{libertineotf} +\setmainlanguage{latin} +\setotherlanguage{english} + +\usepackage[series={},nocritical,noend,noeledsec,nofamiliar,noledgroup]{reledmac} +\begin{document} + +\begin{english} +\date{} +\title{Sectioning with reledmac (not numbered)} +\maketitle +\begin{abstract} +This file provides examples of use of sectioning commands with reledmac. +The sections are outside of the numbered text. + +The optional argument of \verb+\pstart+ is used. The optional argument of \verb+\pend+ is also used. +\end{abstract} +\end{english} + +\beginnumbering +\pstart[\section{Section title}] +Lorem ipsum dolor sit amet, consectetur adipisicing elit +sed do eiusmod tempor incididunt ut labore et dolore +magna aliqua. Ut enim ad minim veniam, quis nostrud +exercitation ullamco laboris nisi +Une note à la ligne 5 consequat ut aliquip consequat\pend[\vskip 2ex] +\pstart[\subsection{Subsection title}] +Duis aute irure dolor in reprehenderit +in voluptate velit esse cillum dolore eu ur. Excepteur sint occaecat +cupidatat non proident, sunt in culpa qui officia deserunt +Duis aute irure dolor in reprehenderit +in voluptate velit esse cillum dolore eu fugiat nulla +pariatur. Excepteur sint occaecat. +\pend[] +\pstart[\subsection{Subsection title}] +Lorem ipsum dolor sit amet, consectetur adipisicing elit +sed do eiusmod tempor incididunt ut labore et dolore +magna aliqua. Ut enim ad minim veniam, quis nostrud +exercitation ullamco laboris nisi + consequat ut aliquip consequat +\pend[\vskip\baselineskip\noindent\hfill⁂\hfill\hbox{}] +\pstart[\section{Section title}] +Irure dolor in reprehenderit +in voluptate velit esse cillum dolore eu ur. Excepteur sint occaecat +cupidatat non proident, sunt in culpa qui officia deserunt +Duis aute irure dolor in reprehenderit +in voluptate velit esse cillum dolore eu fugiat nulla +pariatur. Excepteur sint occaecat. +\pend +\endnumbering + +\end{document} diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/3-reledpar_columns_different_languages.pdf b/Master/texmf-dist/doc/latex/reledmac/examples/3-reledpar_columns_different_languages.pdf Binary files differnew file mode 100644 index 00000000000..2ddc3cfa12d --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/3-reledpar_columns_different_languages.pdf diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/3-reledpar_columns_different_languages.tex b/Master/texmf-dist/doc/latex/reledmac/examples/3-reledpar_columns_different_languages.tex new file mode 100644 index 00000000000..8d3c46918ec --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/3-reledpar_columns_different_languages.tex @@ -0,0 +1,78 @@ +\documentclass{book} +\usepackage[a4paper]{geometry} +\usepackage{fontspec} +\setmainfont[Ligatures=TeX]{Linux Libertine O} +\usepackage{xunicode,metalogo,hyperref} +\usepackage{polyglossia} + +\usepackage[series={},nocritical,noend,nofamiliar,noledgroup]{reledmac} +\usepackage{reledpar} + +\linenumincrement*{1} +\firstlinenum*{1} +\setlength{\Lcolwidth}{0.48\textwidth} +\setlength{\Rcolwidth}{0.48\textwidth} + +\setmainlanguage{english} +\setotherlanguage{russian} +\setotherlanguage{hebrew} +\newfontfamily\hebrewfont[Script=Hebrew]{Linux Libertine O} +\newfontfamily\russianfont[Script=Cyrillic]{Linux Libertine O} + +\begin{document} + + +\title{Parallel columns in two different languages} + + + +{\let\newpage\relax\maketitle} +{\small +This file provides an example of typesetting parallel columns in two different languages, using reledpar, polyglossia and \XeLaTeX. + +The main language is English. The left column is in Russian, the right column in Hebrew. +We have enlarged \verb+\Lcolwidth+ and \verb+\Rcolwidth+ to avoid problem with hyphenations. + +We also used \verb+\eledchapter+, which implies that chapter titles are printed with accompanying line numbers. + +For an example with \LuaLaTeX, look at \href{./lualatex-parallel-rtl.tex}{lualatex-parallel-rtl.tex}. +} + + + +\begin{pairs} + +\begin{Rightside} +\begin{RTL} +\begin{hebrew} +\beginnumbering +\pstart +\eledchapter{המאמר השני}\ledleftnote{s} +\pend +\pstart +בפנות התוריות, ר״ל שהם יסודות ועמודים אשר בית אלהים נכון עליהם, ובמציאותם יציר מציאות התורה מסדרת ממנו יתברך, ואלו יציר העדר אחת מהם תפל התורה בכללה חלילה. +\pend +\endnumbering +\end{hebrew} +\end{RTL} +\end{Rightside} + + + + +\begin{Leftside} +\begin{russian} +\beginnumbering +\pstart +\eledchapter{Трактат Второй} +\pend +\pstart +О краеугольных [принципах] Торы, имеется ввиду, которые [есть] основы и столпы на которых дом Б-жий опирается/нахон, и с существованием их может быть представлено существование Торы упорядоченной от Него, благословенного, и если бы было представлено отсутствие одного из них — упадет Тора в общем, [Б-же] упаси. +\pend +\endnumbering +\end{russian} +\end{Leftside} + +\end{pairs} +\Columns +\end{document} diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/3-reledpar_mwe.pdf b/Master/texmf-dist/doc/latex/reledmac/examples/3-reledpar_mwe.pdf Binary files differnew file mode 100644 index 00000000000..354ec9b0282 --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/3-reledpar_mwe.pdf diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/3-reledpar_mwe.tex b/Master/texmf-dist/doc/latex/reledmac/examples/3-reledpar_mwe.tex new file mode 100644 index 00000000000..87c0c5bc4d5 --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/3-reledpar_mwe.tex @@ -0,0 +1,74 @@ +\documentclass{article} +\usepackage{polyglossia,fontspec,xunicode} +\usepackage{libertineotf} +\setmainlanguage{english} + + +\usepackage[series={},nocritical,noend,noeledsec,nofamiliar,noledgroup]{reledmac} +\usepackage{reledpar} + + +\begin{document} + +\date{} +\title{Parallel} +\maketitle + +\begin{abstract} +This file provides two minimal examples of typesetting parallel texts with reledmac plus reledpar. + +The first minimal example is parallel typesetting in columns, the second one is parallel typesetting in pages. +\end{abstract} + + +\begin{pairs} + \begin{Leftside} + \beginnumbering + \pstart + Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. + \pend + \pstart + Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. + \pend + \endnumbering + \end{Leftside} + \begin{Rightside} + \beginnumbering + \pstart + Right side paragraph. Right side paragraph. Right side paragraph. Right side paragraph. + \pend + \pstart + Other right side paragraph. Other right side paragraph. Other right side paragraph. Other right side paragraph. Other right side paragraph. Other right side paragraph. Other right side paragraph. + \pend + \endnumbering + \end{Rightside} + +\end{pairs} +\Columns + +\begin{pages} + \begin{Leftside} + \beginnumbering + \pstart + Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. + \pend + \pstart + Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. + \pend + \endnumbering + \end{Leftside} + \begin{Rightside} + \beginnumbering + \pstart + Right side paragraph. Right side paragraph. Right side paragraph. Right side paragraph. + \pend + \pstart + Other right side paragraph. Other right side paragraph. Other right side paragraph. Other right side paragraph. Other right side paragraph. Other right side paragraph. Other right side paragraph. + \pend + \endnumbering + \end{Rightside} + +\end{pages} +\Pages + +\end{document} diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/3-reledpar_pages_different_languages_lualatex.pdf b/Master/texmf-dist/doc/latex/reledmac/examples/3-reledpar_pages_different_languages_lualatex.pdf Binary files differnew file mode 100644 index 00000000000..2a8ea5544b3 --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/3-reledpar_pages_different_languages_lualatex.pdf diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/3-reledpar_pages_different_languages_lualatex.tex b/Master/texmf-dist/doc/latex/reledmac/examples/3-reledpar_pages_different_languages_lualatex.tex new file mode 100644 index 00000000000..440744b629d --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/3-reledpar_pages_different_languages_lualatex.tex @@ -0,0 +1,61 @@ +\documentclass{article} +\usepackage{fontspec} +\usepackage[series={},nocritical,noend,nofamiliar,noledgroup]{reledmac} +\usepackage{reledpar,metalogo,hyperref} +\setlength{\parindent}{0pt} + +\newfontfamily\syriacfont[Script=Syriac,Scale=1.2]{estre.otf} + +\newcommand{\textsyriac}[1] % Syriac inside LTR + {\bgroup\luatextextdir TRT\syriacfont #1\egroup} +\newcommand{\n} [1] % for digits inside Arabic text + {\bgroup\luatextextdir TLT #1\egroup} +\newcommand{\syriacfootnote} [1] % Syriac Footnotes + {\footnote{\textsyriac{#1}}} +\newenvironment{syriac} % Syriac paragraph + {\luatextextdir TRT\luatexpardir TRT\syriacfont}{} + +\begin{document} + +\date{} +\title{Using \LuaLaTeX\ to typeset RTL text with reledpar} +\maketitle +\begin{abstract} +This file provides an example on how to use reledpar and \LuaLaTeX\ to typeset a right to left text with its translation on the facing page\footnote{The text was provided by Latechneuse on \url{http://tex.stackexchange.com/q/227837/7712}.}. + +As you can see, the switch to RTL convention is made \emph{before} the \verb+pstart+. +It must be also called inside \verb+\eledsection+. + +For an example with \XeLaTeX, look at \href{./parallel-column-two-languages.tex}{parallel-column-two-languages.tex} file. +\end{abstract} +\begin{pages} +\begin{Leftside} +\begin{syriac} +\beginnumbering + \pstart + \eledsection*{\textsyriac{ܡܿܟܪܟܝ}} + \pend + + \pstart + 1ܘܟܕ 2ܡܿܟܪܟܝ3ܢܢ ܐܪܟ4ܐܢܐ ܗ̄ 5ܡܘܪܐ6 ܗܿܝ ܩ7ܕܡܝܬܐ + \pend +\endnumbering +\end{syriac} +\end{Leftside} + +\begin{Rightside} +\beginnumbering + \pstart + \eledsection{English headline} + \pend + + \pstart + Some english text. + \pend +\endnumbering +\end{Rightside} + + +\end{pages} +\Pages +\end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/3-reledpar_same_page_number_in_both_side.pdf b/Master/texmf-dist/doc/latex/reledmac/examples/3-reledpar_same_page_number_in_both_side.pdf Binary files differnew file mode 100644 index 00000000000..266662b8159 --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/3-reledpar_same_page_number_in_both_side.pdf diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/3-reledpar_same_page_number_in_both_side.tex b/Master/texmf-dist/doc/latex/reledmac/examples/3-reledpar_same_page_number_in_both_side.tex new file mode 100644 index 00000000000..3289d12a654 --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/3-reledpar_same_page_number_in_both_side.tex @@ -0,0 +1,251 @@ +\documentclass{article} +\usepackage{polyglossia,fontspec,xunicode} +\usepackage{libertineotf} +\usepackage[series={},nocritical,noend,noeledsec,nofamiliar]{reledmac} +\usepackage[sameparallelpagenumber]{reledpar} +\setmainlanguage{english} + +\begin{document} +\author{} +\title{Same page number on left and right sides} + +\maketitle + +\begin{abstract} + This file provides example of use of \verb+sameparallelpagenumber+ option of \emph{eledpar}. + Before \verb+\Pages+, the pages are normally numbered. + When parallel pages are typeset, the number is the same on left and right side. + After that, page number continues in the normal way. + +\end{abstract} +\newpage +A new normal page +\newpage +A new normal page, again + +\begin{pages} + \begin{Leftside} + \beginnumbering + \pstart + Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. + \pend + \pstart + Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. + \pend + + \pstart + Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. + \pend + \pstart + Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. + \pend + + \pstart + Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. + \pend + \pstart + Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. + \pend + + \pstart + Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. + \pend + \pstart + Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. + \pend + + \pstart + Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. + \pend + \pstart + Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. + \pend + + + \pstart + Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. + \pend + \pstart + Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. + \pend + + \pstart + Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. + \pend + \pstart + Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. + \pend + + + \pstart + Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. + \pend + \pstart + Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. + \pend + \pstart + Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. + \pend + \pstart + Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. + \pend \pstart + Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. + \pend + \pstart + Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. + \pend \pstart + Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. + \pend + \pstart + Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. + \pend \pstart + Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. + \pend + \pstart + Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. + \pend \pstart + Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. + \pend + \pstart + Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. + \pend \pstart + Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. + \pend + \pstart + Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. + \pend \pstart + Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. + \pend + \pstart + Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. + \pend \pstart + Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. + \pend + \pstart + Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. + \pend \pstart + Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. + \pend + \pstart + Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. + \pend + \endnumbering + \end{Leftside} + \begin{Rightside} + \beginnumbering + \pstart + Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. + \pend + \pstart + Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. + \pend + + \pstart + Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. + \pend + \pstart + Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. + \pend + + \pstart + Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. + \pend + \pstart + Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. + \pend + + \pstart + Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. + \pend + \pstart + Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. + \pend + + \pstart + Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. + \pend + \pstart + Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. + \pend + + + \pstart + Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. + \pend + \pstart + Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. + \pend + + \pstart + Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. + \pend + \pstart + Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. + \pend + + + \pstart + Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. + \pend + \pstart + Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. + \pend + \pstart + Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. + \pend + \pstart + Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. + \pend \pstart + Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. + \pend + \pstart + Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. + \pend \pstart + Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. + \pend + \pstart + Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. + \pend \pstart + Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. + \pend + \pstart + Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. + \pend \pstart + Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. + \pend + \pstart + Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. + \pend \pstart + Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. + \pend + \pstart + Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. + \pend \pstart + Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. + \pend + \pstart + Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. + \pend \pstart + Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. + \pend + \pstart + Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. + \pend \pstart + Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. Left side paragraph. + \pend + \pstart + \label{toto}Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. Other left side paragraph. + \pend + \endnumbering + \end{Rightside} + +\end{pages} +\Pages + +And now, we continue with normal pages. + +\newpage + +And again a new page. + +\end{document} diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_column_mix_with_not_column.pdf b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_column_mix_with_not_column.pdf Binary files differnew file mode 100644 index 00000000000..3eb5c8c7fcf --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_column_mix_with_not_column.pdf diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_column_mix_with_not_column.tex b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_column_mix_with_not_column.tex new file mode 100644 index 00000000000..607eca1d835 --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_column_mix_with_not_column.tex @@ -0,0 +1,101 @@ +\documentclass[a4paper]{article} +\usepackage{polyglossia,fontspec,xunicode} +\usepackage{libertineotf} +\setmainlanguage{latin} +\setotherlanguage{english} + + +\usepackage[series={A,B},noend,noeledsec,noledgroup]{reledmac} +\usepackage{reledpar} + + +\widthliketwocolumnstrue +\Xnoteswidthliketwocolumns +\Xnoteswidthliketwocolumns +\Xarrangement{paragraph} +\begin{document} + + +\begin{pairs}\sloppy +\begin{Leftside} + \beginnumbering + \pstart +\edtext{Lorem}{\Afootnote{lorim}} ipsum\footnoteA{x}\footnoteB{xb} \edtext{Lorem}{\Afootnote{lorim}} dolor sit amet, consectetur adipiscing elit. Sed \edtext{Lorem}{\Afootnote{lorim}} egestas, dolor sed malesuada ultrices, nulla orci \edtext{Lorem}{\Afootnote{lorim}} suscipit massa, a feugiat neque dolor eu augue. \edtext{Lorem}{\Afootnote{lorim}} Lorem ipsum dolor sit amet, consectetur adipiscing \edtext{Lorem}{\Afootnote{lorim}} elit. Pellentesque bibendum \edtext{Lorem}{\Bfootnote{?}} tellus ornare orci luctus, fermentum auctor lacus vehicula. Nunc ex leo, iaculis in \edtext{Lorem}{\Bfootnote{?}} convallis \edtext{Lorem}{\Bfootnote{?}} luctus, accumsan nec ligula. Praesent molestie, mauris vitae mattis commodo, tellus magna \edtext{Lorem}{\Bfootnote{?}} eleifend nunc, eu tempor purus neque quis neque. Morbi volutpat, tellus ac hendrerit fermentum, purus sem placerat mauris, a tristique nisi dolor et mi. Ut aliquam porttitor diam, ut \edtext{Lorem}{\Bfootnote{?}} feugiat arcu congue ullamcorper. Nam malesuada, ante sed fermentum blandit, nisi magna sollicitudin eros, vel accumsan magna lorem ut leo. Cras fermentum eleifend sapien sed aliquet. Duis ac sapien dolor. Donec sagittis nibh in volutpat tincidunt. Fusce tellus nisi, varius vitae massa a, cursus ultricies sem. Etiam ipsum mi, aliquam suscipit mattis id, pretium iaculis enim. Quisque vestibulum tincidunt sem, a egestas nulla \edtext{Lorem}{\Afootnote{lorim}} luctus eget\footnoteB{xb}. Proin sodales aliquet felis. \edtext{Lorem}{\Afootnote{lorim}} Vestibulum ante ipsum primis in faucibus orci luctus et \edtext{Lorem}{\Bfootnote{?}} ultrices posuere cubilia Curae; + + \pend + + + + \pstart +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed egestas, dolor sed malesuada ultrices, nulla orci suscipit massa, a feugiat neque dolor eu augue. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque bibendum tellus ornare orci luctus, fermentum auctor lacus vehicula. Nunc ex leo, iaculis in convallis luctus, accumsan nec ligula. Praesent molestie, mauris vitae mattis commodo, tellus magna eleifend nunc, eu tempor purus neque quis neque. Morbi volutpat, tellus ac hendrerit fermentum, purus sem placerat mauris, a tristique nisi dolor et mi. Ut aliquam porttitor diam, ut feugiat arcu congue ullamcorper. Nam malesuada, ante sed fermentum blandit, nisi magna sollicitudin eros, vel accumsan magna lorem ut leo. Cras fermentum eleifend sapien sed aliquet. Duis ac sapien dolor. Donec sagittis nibh in volutpat tincidunt. Fusce tellus nisi, varius vitae massa a, cursus ultricies sem. Etiam ipsum mi, aliquam suscipit mattis id, pretium iaculis enim. Quisque vestibulum tincidunt sem, a egestas nulla luctus eget. Proin sodales aliquet felis. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; +\pend + \end{Leftside} + +\begin{Rightside} + \beginnumbering + + \pstart +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed egestas, dolor sed malesuada ultrices, nulla orci suscipit massa, a feugiat neque dolor eu augue. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque bibendum tellus ornare orci luctus, fermentum auctor lacus vehicula. Nunc ex leo, iaculis in convallis luctus, accumsan nec ligula. Praesent molestie, mauris vitae mattis commodo, tellus magna eleifend nunc, eu tempor purus neque quis neque. Morbi volutpat, tellus ac hendrerit fermentum, purus sem placerat mauris, a tristique nisi dolor et mi. Ut aliquam porttitor diam, ut feugiat arcu congue ullamcorper. Nam malesuada, ante sed fermentum blandit, nisi magna sollicitudin eros, vel accumsan magna lorem ut leo. Cras fermentum eleifend sapien sed aliquet. Duis ac sapien dolor. Donec sagittis nibh in volutpat tincidunt. Fusce tellus nisi, varius vitae massa a, cursus ultricies sem. Etiam ipsum mi, aliquam suscipit mattis id, pretium iaculis enim. Quisque vestibulum tincidunt sem, a egestas nulla luctus eget. Proin sodales aliquet felis. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; + + \pend + + + \pstart +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed egestas, dolor sed malesuada ultrices, nulla orci suscipit massa, a feugiat neque dolor eu augue. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque bibendum tellus ornare orci luctus, fermentum auctor lacus vehicula. Nunc ex leo, iaculis in convallis luctus, accumsan nec ligula. Praesent molestie, mauris vitae mattis commodo, tellus magna eleifend nunc, eu tempor purus neque quis neque. Morbi volutpat, tellus ac hendrerit fermentum, purus sem placerat mauris, a tristique nisi dolor et mi. Ut aliquam porttitor diam, ut feugiat arcu congue ullamcorper. Nam malesuada, ante sed fermentum blandit, nisi magna sollicitudin eros, vel accumsan magna lorem ut leo. Cras fermentum eleifend sapien sed aliquet. Duis ac sapien dolor. Donec sagittis nibh in volutpat tincidunt. Fusce tellus nisi, varius vitae massa a, cursus ultricies sem. Etiam ipsum mi, aliquam suscipit mattis id, pretium iaculis enim. Quisque vestibulum tincidunt sem, a egestas nulla luctus eget. Proin sodales aliquet felis. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; + + \pend + +\pausenumbering +\end{Rightside} +\end{pairs} +\Columns + + \resumenumbering + + + + + + \pstart +Lorem \edtext{ipsum}{\Afootnote{Donec sagittis nibh in volutpat tincidunt. Fusce tellus nisi, varius vitae massa a, cursus sem}}\edtext{ipsum}{\Bfootnote{Donec sagittis nibh in volutpat tincidunt. Fusce tellus nisi, varius vitae massa a, cursus ultricies sem}} \edtext{dolor}{\Afootnote{dolar}} \edtext{sit}{\Afootnote{sat}} \edtext{amet}{\Afootnote{amat}}, \edtext{consectetur}{\Afootnote{consectatur}} adipiscing \edtext{elit}{\Afootnote{alit}}. Sed egestas, dolor sed malesuada ultrices, nulla orci suscipit massa, a feugiat neque dolor eu augue. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque bibendum tellus ornare orci luctus, fermentum auctor lacus vehicula. Nunc ex leo, iaculis in convallis luctus, accumsan nec ligula. Praesent molestie, mauris vitae mattis commodo, tellus magna eleifend nunc, eu tempor purus neque quis neque. Morbi volutpat, tellus ac hendrerit fermentum, purus sem placerat mauris, a tristique nisi dolor et mi. Ut aliquam porttitor diam, ut feugiat arcu congue ullamcorper. Nam malesuada, ante sed fermentum blandit, nisi magna sollicitudin eros, vel accumsan magna lorem ut leo. Cras fermentum eleifend sapien sed aliquet. Duis ac sapien dolor. Donec sagittis nibh in volutpat tincidunt. Fusce tellus nisi, varius vitae massa a, cursus ultricies sem. Etiam ipsum mi, aliquam suscipit mattis id, pretium iaculis enim. Quisque vestibulum tincidunt sem, a egestas nulla luctus eget. Proin sodales aliquet felis. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; + + \pend + \pausenumbering + +\begin{pairs}\sloppy +\begin{Leftside} + \resumenumbering + + \pstart +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed egestas, dolor sed malesuada ultrices, nulla orci suscipit massa, a feugiat neque dolor eu augue. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque bibendum tellus ornare orci luctus, fermentum auctor lacus vehicula. Nunc ex leo, iaculis in convallis luctus, accumsan nec ligula. Praesent molestie, mauris vitae mattis commodo, tellus magna eleifend nunc, eu tempor purus neque quis neque. Morbi volutpat, tellus ac hendrerit fermentum, purus sem placerat mauris, a tristique nisi dolor et mi. Ut aliquam porttitor diam, ut feugiat arcu congue ullamcorper. Nam malesuada, ante sed fermentum blandit, nisi magna sollicitudin eros, vel accumsan magna lorem ut leo. Cras fermentum eleifend sapien sed aliquet. Duis ac sapien dolor. Donec sagittis nibh in volutpat tincidunt. Fusce tellus nisi, varius vitae massa a, cursus ultricies sem. Etiam ipsum mi, aliquam suscipit mattis id, pretium iaculis enim. Quisque vestibulum tincidunt sem, a egestas nulla luctus eget. Proin sodales aliquet felis. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; + + \pend + + \endnumbering + +\end{Leftside} + +\begin{Rightside} + \resumenumbering + + + \pstart +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed egestas, dolor sed malesuada ultrices, nulla orci suscipit massa, a feugiat neque dolor eu augue. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque bibendum tellus ornare orci luctus, fermentum auctor lacus vehicula. Nunc ex leo, iaculis in convallis luctus, accumsan nec ligula. Praesent molestie, mauris vitae mattis commodo, tellus magna eleifend nunc, eu tempor purus neque quis neque. Morbi volutpat, tellus ac hendrerit fermentum, purus sem placerat mauris, a tristique nisi dolor et mi. Ut aliquam porttitor diam, ut feugiat arcu congue ullamcorper. Nam malesuada, ante sed fermentum blandit, nisi magna sollicitudin eros, vel accumsan magna lorem ut leo. Cras fermentum eleifend\footnoteB{xb} sapien sed aliquet. Duis ac sapien dolor. Donec sagittis nibh in volutpat tincidunt. Fusce tellus nisi, varius vitae massa a, cursus ultricies sem. Etiam ipsum mi, aliquam suscipit mattis id, pretium iaculis enim. Quisque vestibulum tincidunt sem, a egestas nulla luctus eget. Proin sodales aliquet felis. Vestibulum ante ipsum primis in faucibus\footnoteB{xb} orci\footnoteA{x} luctus et ultrices posuere cubilia Curae; + + \pend + +\endnumbering +\end{Rightside} +\end{pairs} +\Columns +\beginnumbering + + + + + \pstart +Lorem ipsum dolor sit\footnoteA{x} amet, consectetur adipiscing elit. Sed egestas, dolor sed malesuada ultrices, nulla orci suscipit massa, a feugiat neque dolor eu augue. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque bibendum tellus ornare orci luctus, fermentum auctor lacus vehicula. Nunc ex leo, iaculis in convallis luctus, accumsan nec ligula. Praesent molestie, mauris vitae mattis commodo, tellus magna eleifend nunc, eu tempor purus neque quis neque. Morbi volutpat, tellus ac hendrerit fermentum, purus sem placerat mauris, a tristique nisi dolor et mi. Ut aliquam porttitor diam, ut feugiat arcu congue ullamcorper. Nam malesuada, ante sed fermentum blandit, nisi magna sollicitudin eros, vel accumsan magna lorem ut leo. Cras fermentum eleifend sapien sed aliquet. Duis ac sapien dolor. Donec sagittis nibh in volutpat tincidunt. Fusce tellus nisi, varius vitae massa a, cursus ultricies sem. Etiam ipsum mi, aliquam suscipit \edtext{Lorem}{\Afootnote{lorim}}mattis id, pretium iaculis enim. Quisque vestibulum tincidunt sem, a egestas nulla luctus eget. Proin sodales aliquet felis. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; + + \pend + \endnumbering +\end{document} diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_columns_alignment.pdf b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_columns_alignment.pdf Binary files differnew file mode 100644 index 00000000000..27538ca738f --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_columns_alignment.pdf diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_columns_alignment.tex b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_columns_alignment.tex new file mode 100644 index 00000000000..1c5f7dcd06e --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_columns_alignment.tex @@ -0,0 +1,128 @@ +\documentclass{article} +\usepackage{polyglossia,fontspec,xunicode} +\usepackage[showframe]{geometry} +\usepackage{libertineotf} +\setmainlanguage{english} + +\usepackage[series={},nocritical,noend,noeledsec,nofamiliar,noledgroup]{reledmac} +\usepackage{reledpar} + +\linenummargin{left} +\setlength{\Lcolwidth}{.44\textwidth} +\setlength{\Rcolwidth}{.44\textwidth} +\setlength{\columnrulewidth}{0.4pt} + +\begin{document} + + +\title{\texttt{\textbackslash Columns} alignment} +\date{} +\maketitle +\begin{abstract} +This file provides example of setting the alignment of \verb+\Columns+ on the page: right (default), left or center. + +The column are 0.44\verb+\textwidth+, and we use \verb+\columnsposition+. + +We also provide a last example, showing how we can manipulate space between colons, by redefining \verb+\beforecolumnseparator+ and \verb+\aftercolumnseparator+. +\end{abstract} + + +\section{Right (default)} + +\columnsposition{R} +\begin{pairs} + +\begin{Leftside} +\beginnumbering +\pstart +Left side left side left side left side left side left side left side left side left side left side +\pend +\endnumbering +\end{Leftside} + +\begin{Rightside} +\beginnumbering +\pstart +Right side right side right side right side right side right side right side right side right side right side +\pend +\endnumbering +\end{Rightside} +\end{pairs} +\Columns + +\section{Left} +\columnsposition{L} + +\begin{pairs} + +\begin{Leftside} +\beginnumbering +\pstart +Left side left side left side left side left side left side left side left side left side left side +\pend +\endnumbering +\end{Leftside} + +\begin{Rightside} +\beginnumbering +\pstart +Right side right side right side right side right side right side right side right side right side right side +\pend +\endnumbering +\end{Rightside} +\end{pairs} +\Columns + +\section{Center} + +\columnsposition{C} +\begin{pairs} + +\begin{Leftside} +\beginnumbering +\pstart +Left side left side left side left side left side left side left side left side left side left side +\pend +\endnumbering +\end{Leftside} + +\begin{Rightside} +\beginnumbering +\pstart +Right side right side right side right side right side right side right side right side right side right side +\pend +\endnumbering +\end{Rightside} +\end{pairs} +\Columns + +\section{Center, setting space between columns} + +Now, we set the spaces between columns, to have all the line occupied. + +\setlength{\beforecolumnseparator}{0.06\textwidth} +\setlength{\aftercolumnseparator}{0.06\textwidth} + +\vspace{\baselineskip} + +\begin{pairs} + +\begin{Leftside} +\beginnumbering +\pstart +Left side left side left side left side left side left side left side left side left side left side +\pend +\endnumbering +\end{Leftside} + +\begin{Rightside} +\beginnumbering +\pstart +Right side right side right side right side right side right side right side right side right side right side +\pend +\endnumbering +\end{Rightside} +\end{pairs} +\Columns + +\end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_columns_titles_in_line_numbering_with_notes.pdf b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_columns_titles_in_line_numbering_with_notes.pdf Binary files differnew file mode 100644 index 00000000000..f2fcdf18c34 --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_columns_titles_in_line_numbering_with_notes.pdf diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_columns_titles_in_line_numbering_with_notes.tex b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_columns_titles_in_line_numbering_with_notes.tex new file mode 100644 index 00000000000..8515ab064a9 --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_columns_titles_in_line_numbering_with_notes.tex @@ -0,0 +1,228 @@ +\documentclass[oneside,12pt]{book} +\usepackage{polyglossia,fontspec,xunicode} +\usepackage{libertineotf} +\setmainlanguage{english} + +\usepackage[series={A},noend,nofamiliar,noledgroup]{reledmac} +\usepackage{reledpar} +\eledsectnotoc{L} +\eledsectmark{R} +\linenumincrement*{1} +\firstlinenum*{1} + +\begin{document} + +\title{Sectioning commands with critical notes in parallel colums} + + + +{\let\newpage\relax\maketitle} +{\small +This file provides examples of using sectioning commands with reledpar. The section titles are in the line numbering, and have critical notes. + +The left and right sides are put in columns. We use \verb+\eledsectnotoc{L}+ to say we want the right titles be added to the table of contents, and not the left titles. +We also use \verb+\eledsectmark{R}+ to use the right side to add \LaTeX\ marks for headers. + +We use the \verb+\reledxxx+ commands, each of them in their own \verb+\pstart…\pend+ group. + +Page clearings are manually added before chapter with \verb+\beforeeledchapter+. +} + + +\tableofcontents + +\beforeeledchapter + +\begin{pairs} +\begin{Leftside} +\beginnumbering +\pstart +\eledchapter{Left \edtext{chapter}{\Afootnote{chapitre}}} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten.. +\pend + +\pstart +\eledsection{Left section} +\pend + +\pstart +\eledsubsection{Left \edtext{subsection}{\Afootnote{sous-section}}} +\pend + +\pstart +\eledsubsubsection{Left \edtext{subsubsection}{\Afootnote{sous-sous-section}}} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten. +\pend + +\pstart +\eledsection{Left section} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten. +\pend + + + +\endnumbering +\end{Leftside} + +\begin{Rightside} + +\beginnumbering +\pstart +\eledchapter{Right \edtext{chapter}{\Afootnote{chapitre}}} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten.. +\pend + +\pstart +\eledsection{Right section} +\pend + +\pstart +\eledsubsection{Right \edtext{subsection}{\Afootnote{sous-section}}} +\pend + +\pstart +\eledsubsubsection{Right \edtext{subsubsection}{\Afootnote{sous-sous-section}}} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten. +\pend + +\pstart +\eledsection{Right section} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten. +\pend + + +\endnumbering + +\end{Rightside} + +\end{pairs} +\Columns + +\beforeeledchapter + + +\begin{pairs} +\begin{Leftside} +\beginnumbering + +\pstart +\eledchapter{Left \edtext{chapter}{\Afootnote{chapitre}}} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten.. +\pend + +\pstart +\eledsection{Left section} +\pend + +\pstart +\eledsubsection{Left \edtext{subsection}{\Afootnote{sous-section}}} +\pend + +\pstart +\eledsubsubsection{Left \edtext{subsubsection}{\Afootnote{sous-sous-section}}} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten. +\pend + +\pstart +\eledsection{Left section} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten. +\pend + +\endnumbering +\end{Leftside} + +\begin{Rightside} + +\beginnumbering + +\pstart +\eledchapter{Right \edtext{chapter}{\Afootnote{chapitre}}} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten.. +\pend + +\pstart +\eledsection{Right section} +\pend + +\pstart +\eledsubsection{Right \edtext{subsection}{\Afootnote{sous-section}}} +\pend + +\pstart +\eledsubsubsection{Right \edtext{subsubsection}{\Afootnote{sous-sous-section}}} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten. +\pend + +\pstart +\eledsection{Right section} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten. +\pend + +\endnumbering + +\end{Rightside} + +\end{pairs} +\Columns + +\end{document} diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_one_series_per_pstart.pdf b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_one_series_per_pstart.pdf Binary files differnew file mode 100644 index 00000000000..36bca2c23f6 --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_one_series_per_pstart.pdf diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_one_series_per_pstart.tex b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_one_series_per_pstart.tex new file mode 100644 index 00000000000..7856855b5bd --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_one_series_per_pstart.tex @@ -0,0 +1,245 @@ +\documentclass{article} +\usepackage{lipsum} +\usepackage[series={A,B,C,D,E,F,G,H,I,J},noend,nofamiliar,noledgroup,noeledsec]{reledmac}%Declare series to be used +\usepackage{reledpar} +\usepackage{polyglossia} +\setmainlanguage{english} +\usepackage{libertine} + + +% Here is the loop system: +\makeatletter% We need to use command with @ + % Two counters: one for left and one for right + \newcounter{mynotelevel}% + \renewcommand{\themynotelevel}{\Alph{mynotelevel}}% Print the counter as a letter + \newcounter{mynotelevelR}% + \renewcommand{\themynotelevelR}{\Alph{mynotelevelR}}% Print the counter as a letter + \setcounter{mynotelevelR}{5} + + % Following lines are called at each \pstart + \AtEveryPstartCall{% + \ifledRcol%If it's a right pstart + \addtocounter{mynotelevelR}{1}%Step counter + \ifnumequal{\arabic{mynotelevelR}}{11}{%No more than J series (10) + \setcounter{mynotelevelR}{6}% If more than J => restart to F (6) + }{}% + \global\letcs{\mynote}{\themynotelevelR footnote}% And let mynote equal to <X>footnote, where <X> is the current level \letcs is defined by etoolbox which is called by reledmac + \else% If it's a left page + \addtocounter{mynotelevel}{1}%Step counter + \ifnumequal{\arabic{mynotelevel}}{6}{%No more than E series (5) + \setcounter{mynotelevel}{1}%If more than J => restart to A (1) + }{}% + \global\letcs{\mynote}{\themynotelevel footnote}%And let mynote equal to <X>footnote, where <X> is the current level \letcs is defined by etoolbox which called by reledmac + \fi% + } + % This code is called when beginnings of each pstart are printed + \AtEveryPstart{% + \ifodd\c@page%If we are on a left page + \addtocounter{mynotelevelR}{1}%Step counter + \ifnumequal{\arabic{mynotelevelR}}{11}{%No more than J series (10) + \setcounter{mynotelevelR}{6}}{}% If more than J => restart to F (6) + \seriesatend{\themynotelevelR}% The series should be at the end + \else% + \addtocounter{mynotelevel}{1}%Step counter + \ifnumequal{\arabic{mynotelevel}}{6}{%No more than E series (5) + \setcounter{mynotelevel}{1}}{}%% If more than E => restart to A (1) + \seriesatend{\themynotelevel}% The series should be at the end + \fi% + } + +\makeatother +\begin{document} + +\title{One series per \textbackslash pstart with reledmac} +\author{} +\maketitle +\begin{abstract} +This file provides examples of features that allow one series of notes by \verb+\pstart+…\verb+pend+, when typesetting parallel pages. + +We suppose there is no more than five \verb+\pstart+…\verb+pend+ by page. The series A, B, C, D and E are for left pages, while the series F, G, H, I, J are for right notes. + +\subsection*{In the left page} +Instead of using \verb+\Afootnote+, \verb+\Bfootnote+ etc., we use \verb+\mynote+, which we let equal to \verb+\Afootnote+ at the first \verb+pstart+, \verb+\Bfootnote+ at the second \verb+\pstart+, \verb+\Cfootnote+ at the third, \verb+\Dfootnote+ at the fourth, \verb+\Efootnote+ at the fifth, and we restart at \verb+\Afootnote+ at the sixth \verb+\pstart+. + +To do that, we increment the counter \verb+mynotelevel+ at every \verb+pstart+ and reset it to~1 when it becomes equal to~6. + + + +\subsection*{In the right page} + +We do the same thing, but use the \verb+mynotelevelR+ counter, rotating its values between 6 and 10, and, consequently, rotating between F, G, H, I, J series. + +\subsection*{Series position} +We use \verb+\seriesatend+ to ensure that a \verb+pstart+ series between two pages will be printed on the first page at the end of the series, but on the second page at the beginning of the series. +However, we need to do this when the \verb+pstart+s are printed, not when they are called. So we use: +\begin{description} + \item[\textbackslash AtEveryPstartCall] to set the footnote series. + \item[\textbackslash AtEveryPstart] to set the footnote position. +\end{description} +\end{abstract} + + + +\begin{pages} +\begin{Leftside} + \beginnumbering + + + \pstart + \edtext{\themynotelevel Here}{\mynote{First footnote in \themynotelevel}} is the + \edtext{\themynotelevel first}{\mynote{Second footnote in \themynotelevel.}} paragraph: + \lipsum[1] + \pend + + \pstart + \edtext{\themynotelevel Here}{\mynote{First footnote in \themynotelevel}} is the + \edtext{\themynotelevel second}{\mynote{Second footnote in \themynotelevel.}} paragraph: + \lipsum[2] + \pend + + \pstart + \edtext{\themynotelevel Here}{\mynote{First footnote in \themynotelevel}} is the + \edtext{\themynotelevel second}{\mynote{Second footnote in \themynotelevel.}} paragraph: + \lipsum[2] + \pend + + \pstart + \edtext{\themynotelevel Here}{\mynote{First footnote in \themynotelevel}} is the + \edtext{\themynotelevel second}{\mynote{Second footnote in \themynotelevel.}} paragraph: + \lipsum[2] + \pend + \pstart + \edtext{\themynotelevel Here}{\mynote{First footnote in \themynotelevel}} is the + \edtext{\themynotelevel second}{\mynote{Second footnote in \themynotelevel.}} paragraph: + \lipsum[2]\edtext{on therpage}{\mynote{on otherpage}} + \pend + + \pstart + \edtext{\themynotelevel Here}{\mynote{First footnote in \themynotelevel}} is the + \edtext{\themynotelevel second}{\mynote{Second footnote in \themynotelevel.}} paragraph: + \lipsum[2] + \pend + + + \pstart + \edtext{\themynotelevel Here}{\mynote{First footnote in \themynotelevel}} is the + \edtext{\themynotelevel first}{\mynote{Second footnote in \themynotelevel.}} paragraph: + \lipsum[1] + \pend + + \pstart + \edtext{\themynotelevel Here}{\mynote{First footnote in \themynotelevel}} is the + \edtext{\themynotelevel second}{\mynote{Second footnote in \themynotelevel.}} paragraph: + \lipsum[2] + \pend + + \pstart + \edtext{\themynotelevel Here}{\mynote{First footnote in \themynotelevel}} is the + \edtext{\themynotelevel second}{\mynote{Second footnote in \themynotelevel.}} paragraph: + \lipsum[2] + \pend + + \pstart + \edtext{\themynotelevel Here}{\mynote{First footnote in \themynotelevel}} is the + \edtext{\themynotelevel second}{\mynote{Second footnote in \themynotelevel.}} paragraph: + \lipsum[2] + \pend + \pstart + \edtext{\themynotelevel Here}{\mynote{First footnote in \themynotelevel}} is the + \edtext{\themynotelevel second}{\mynote{Second footnote in \themynotelevel.}} paragraph: + \lipsum[2]\edtext{on therpage}{\mynote{on otherpage}} + \pend + + \pstart + \edtext{\themynotelevel Here}{\mynote{First footnote in \themynotelevel}} is the + \edtext{\themynotelevel second}{\mynote{Second footnote in \themynotelevel.}} paragraph: + \lipsum[2] + \pend + % Many more \pstart ... \pend to follow. + + \endnumbering +\end{Leftside} + +\begin{Rightside} + \beginnumbering + + \pstart + \edtext{\themynotelevelR Here}{\mynote{First footnote in \themynotelevelR}} is the + \edtext{\themynotelevelR first}{\mynote{Second footnote in \themynotelevelR.}} paragraph: + \lipsum[1] + \pend + + \pstart + \edtext{\themynotelevelR Here}{\mynote{First footnote in \themynotelevelR}} is the + \edtext{\themynotelevelR second}{\mynote{Second footnote in \themynotelevelR.}} paragraph: + \lipsum[2] + \pend + + \pstart + \edtext{\themynotelevelR Here}{\mynote{First footnote in \themynotelevelR}} is the + \edtext{\themynotelevelR second}{\mynote{Second footnote in \themynotelevelR.}} paragraph: + \lipsum[2] + \pend + + \pstart + \edtext{\themynotelevelR Here}{\mynote{First footnote in \themynotelevelR}} is the + \edtext{\themynotelevelR second}{\mynote{Second footnote in \themynotelevelR.}} paragraph: + \lipsum[2] + \pend + \pstart + \edtext{\themynotelevelR Here}{\mynote{First footnote in \themynotelevelR}} is the + \edtext{\themynotelevelR second}{\mynote{Second footnote in \themynotelevelR.}} paragraph: + \lipsum[2]\edtext{on therpage}{\mynote{on otherpage}} + \pend + + \pstart sss\themynotelevelR + \edtext{\themynotelevelR Here}{\mynote{First footnote in \themynotelevelR}} is the + \edtext{\themynotelevelR second}{\mynote{Second footnote in \themynotelevelR.}} paragraph: + \lipsum[2] + \pend + + \pstart + \edtext{\themynotelevelR Here}{\mynote{First footnote in \themynotelevelR}} is the + \edtext{\themynotelevelR first}{\mynote{Second footnote in \themynotelevelR.}} paragraph: + \lipsum[1] + \pend + + \pstart + \edtext{\themynotelevelR Here}{\mynote{First footnote in \themynotelevelR}} is the + \edtext{\themynotelevelR second}{\mynote{Second footnote in \themynotelevelR.}} paragraph: + \lipsum[2] + \pend + + \pstart + \edtext{\themynotelevelR Here}{\mynote{First footnote in \themynotelevelR}} is the + \edtext{\themynotelevelR second}{\mynote{Second footnote in \themynotelevelR.}} paragraph: + \lipsum[2] + \pend + + \pstart + \edtext{\themynotelevelR Here}{\mynote{First footnote in \themynotelevelR}} is the + \edtext{\themynotelevelR second}{\mynote{Second footnote in \themynotelevelR.}} paragraph: + \lipsum[2] + \pend + \pstart + \edtext{\themynotelevelR Here}{\mynote{First footnote in \themynotelevelR}} is the + \edtext{\themynotelevelR second}{\mynote{Second footnote in \themynotelevelR.}} paragraph: + \lipsum[2]\edtext{on therpage}{\mynote{on otherpage}} + \pend + + \pstart sss\themynotelevelR + \edtext{\themynotelevelR Here}{\mynote{First footnote in \themynotelevelR}} is the + \edtext{\themynotelevelR second}{\mynote{Second footnote in \themynotelevelR.}} paragraph: + \lipsum[2] + \pend + + % Many more \pstart ... \pend to follow. + + \endnumbering +\end{Rightside} +\end{pages} +\setcounter{mynotelevel}{0}%Restart the left counter +\setcounter{mynotelevelR}{5}% And restart the right counter +\Pages + +\end{document} diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_page_titles_in_line_numbering_with_notes.pdf b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_page_titles_in_line_numbering_with_notes.pdf Binary files differnew file mode 100644 index 00000000000..ddd5ec9f192 --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_page_titles_in_line_numbering_with_notes.pdf diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_page_titles_in_line_numbering_with_notes.tex b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_page_titles_in_line_numbering_with_notes.tex new file mode 100644 index 00000000000..1c01a5d2dd6 --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_page_titles_in_line_numbering_with_notes.tex @@ -0,0 +1,359 @@ +\documentclass[twoside,12pt]{book} +\usepackage{polyglossia,fontspec,xunicode} +\usepackage{libertineotf} +\setmainlanguage{english} + +\usepackage[series={A},noend,nofamiliar,noledgroup]{reledmac} +\usepackage{reledpar} +\linenumincrement*{1} +\firstlinenum*{1} +\begin{document} + +\title{Sectioning commands with critical notes in parallel pages} + + + +{\let\newpage\relax\maketitle} +{\small +This file provides examples for using the sectioning command with reledpar. The section titles are in the line numbering, and have critical notes. + +The left and right sides are put in parallel pages. Following the standard behavior of reledpar, only the left titles are put to the table of contents. + +We use the \verb+\reledxxx+ commands, each of them in their own \verb+\pstart…\pend+ group. + +Page breaks are manually added before chapter with \verb+\beforeeledchapter+. +} + + +\tableofcontents + +\beforeeledchapter + + +\begin{pages} +\begin{Leftside} +\beginnumbering +\pstart +\eledchapter{Left \edtext{chapter}{\Afootnote{chapitre}}} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten. +\pend + +\pstart +\eledsection{Left section} +\pend + +\pstart +\eledsubsection{Left \edtext{subsection}{\Afootnote{sous-section}}} +\pend + +\pstart +\eledsubsubsection{Left \edtext{subsubsection}{\Afootnote{sous-sous-section}}} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten. +\pend + +\pstart +\eledsection{Left section} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten. +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten. +\pend + +\pstart +\eledsection{Left section} +\pend + +\pstart +\eledsubsection{Left \edtext{subsection}{\Afootnote{sous-section}}} +\pend + +\pstart +\eledsubsubsection{Left \edtext{subsubsection}{\Afootnote{sous-sous-section}}} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten. +\pend + +\pstart +\eledsection{Left section} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten. +\pend + + +\endnumbering +\end{Leftside} + +\begin{Rightside} + +\beginnumbering +\pstart +\eledchapter{Right \edtext{chapter}{\Afootnote{chapitre}}} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten. +\pend + +\pstart +\eledsection{Right section} +\pend + +\pstart +\eledsubsection{Right \edtext{subsection}{\Afootnote{sous-section}}} +\pend + +\pstart +\eledsubsubsection{Right \edtext{subsubsection}{\Afootnote{sous-sous-section}}} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten. +\pend + +\pstart +\eledsection{Right section} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten. +\pend + + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten. +\pend + +\pstart +\eledsection{Right section} +\pend + +\pstart +\eledsubsection{Right \edtext{subsection}{\Afootnote{sous-section}}} +\pend + +\pstart +\eledsubsubsection{Right \edtext{subsubsection}{\Afootnote{sous-sous-section}}} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten. +\pend + +\pstart +\eledsection{Right section} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten. +\pend + +\endnumbering + +\end{Rightside} + +\end{pages} +\Pages + +\begin{pages} +\begin{Leftside} +\beginnumbering +\pstart +\eledchapter{Left \edtext{chapter}{\Afootnote{chapitre}}} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten. +\pend + +\pstart +\eledsection{Left section} +\pend + +\pstart +\eledsubsection{Left \edtext{subsection}{\Afootnote{sous-section}}} +\pend + +\pstart +\eledsubsubsection{Left \edtext{subsubsection}{\Afootnote{sous-sous-section}}} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten. +\pend + +\pstart +\eledsection{Left section} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten. +\pend + + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten. +\pend + +\pstart +\eledsection{Left section} +\pend + +\pstart +\eledsubsection{Left \edtext{subsection}{\Afootnote{sous-section}}} +\pend + +\pstart +\eledsubsubsection{Left \edtext{subsubsection}{\Afootnote{sous-sous-section}}} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten. +\pend + +\pstart +\eledsection{Left section} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten. +\pend + + +\endnumbering +\end{Leftside} + +\begin{Rightside} + +\beginnumbering +\pstart +\eledchapter{Right \edtext{chapter}{\Afootnote{chapitre}}} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten. +\pend + +\pstart +\eledsection{Right section} +\pend + +\pstart +\eledsubsection{Right \edtext{subsection}{\Afootnote{sous-section}}} +\pend + +\pstart +\eledsubsubsection{Right \edtext{subsubsection}{\Afootnote{sous-sous-section}}} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten. +\pend + +\pstart +\eledsection{Right section} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten. +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten. +\pend + +\pstart +\eledsection{Right section} +\pend + +\pstart +\eledsubsection{Right \edtext{subsection}{\Afootnote{sous-section}}} +\pend + +\pstart +\eledsubsubsection{Right \edtext{subsubsection}{\Afootnote{sous-sous-section}}} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten. +\pend + +\pstart +\eledsection{Right section} +\pend + +\pstart +I use git to manage some packages. +I would like to add a pre-commit hook, to check if I have forgotten +For now, I have a minimal pre-commit, which tests only the blank spaces at ends of lines, but not the forgotten. +\pend + + +\endnumbering + +\end{Rightside} + +\end{pages} +\Pages + + +\end{document} diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_pages_long_notes.pdf b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_pages_long_notes.pdf Binary files differnew file mode 100644 index 00000000000..95bf8bd87c9 --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_pages_long_notes.pdf diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_pages_long_notes.tex b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_pages_long_notes.tex new file mode 100644 index 00000000000..74931b56f08 --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_pages_long_notes.tex @@ -0,0 +1,108 @@ +\documentclass{article} +\usepackage{fontspec,xunicode} +\usepackage{libertineotf} + +\usepackage[series={A,B,C},noend,noeledsec,noledgroup]{reledmac} +\usepackage{reledpar} +\setgoalfraction{0.98} +\Xmaxhnotes{0.25\textheight} + +\usepackage{polyglossia} +\setmainlanguage{latin} +\setotherlanguage{french} +\setotherlanguage{english} + +%http://remacle.org/bloodwolf/historiens/dictys/troie.htm +\newcounter{Atest} +\def\Atest{\stepcounter{Atest}(\textbf{\theAtest\ - A}) } +\newcounter{Btest} +\def\Btest{\stepcounter{Btest}(\textbf{\theBtest\ - B}) } +\newcounter{Ctest} +\def\Ctest{\stepcounter{Ctest}(\textbf{\theCtest\ - C}) } +\Xonlyside[B]{L} +\Xonlyside[C]{R} + + +\begin{document} +\date{} +\begin{english} +\title{Long notes with reledpar in parallel pages} +\maketitle +\begin{abstract} +This file provides example of managing long notes with reledpar when typesetting parallel pages. +With \verb+\maxhXnotes+, we have set the maximum height of critical notes to \verb+0.25\textheight+. With \verb+\Xonlyside+, we have say B notes would print on left pages only, and C notes would print on right pages only . +\end{abstract} + +\end{english} + + + +\begin{pages} +\begin{Leftside} +\begin{french} +\beginnumbering +\autopar + +\edtext{Tous}{\Afootnote{\Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page. \Atest Afootnote is for both left and right page.}} +les +\edtext{rois}{\Bfootnote {\Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. \Btest xxx Bfootnote is only for left side. +}} de la Grèce qui descendaient de Minos, fils de Jupiter, vinrent en Crète pour y recueillir la riche succession de Crétéus. Ce prince, fils de Minos, avait réglé par son testament qu'il serait fait un partage égal de tout ce qu'il possédait d'or, d'argent et de troupeaux, entre les enfants de ses filles ; et il laissait son empire à Idoménée, fils de Deucalion, son frère et à Mérion , fils de Molus, son neveu, qui devaient gouverner chacun sa part avec un pouvoir indépendant. Entre les princes présents au partage, on distinguait Palamède, fils de Clymène et de Nauplius, et Oeax, appelés Crétéides, avec Ménélas, fils d'Aerope et de Plisthène, qu'Anaxibie, sa soeur, épouse de Nestor, et Agamemnon, son frère aîné, avaient chargé de les représenter dans l'assemblée des héritiers. On connaissait moins ces derniers comme fils de Plisthène, mort à la fleur de son âge et sans avoir rien fait de mémorable, que comme petits-fils d'Atrée. Ce prince, en effet, touché de compassion pour la faiblesse de leur âge, les avait recueillis au-près de lui, et s'était chargé de leur donner une éducation conforme à leur naissance. Ils se conduisirent tous dans cette occasion avec la grandeur et la générosité qu'on devait attendre de personnes de leur rang. + +A la nouvelle de leur arrivée, tons les descendants d'Europe, dont le nom était en grande vénération dans l'île, se rendirent auprès d'eux, les saluèrent avec bonté et les conduisirent au temple. Là, après un sacrifice solennel où furent immolées suivant l'usage, nombre de victimes on leur servit un repas splendide, et on les traita avec autant d'abondance que de délicatesse. Les fêtes continuèrent les jours suivants. Les rois reçurent les témoignages de l'affection de leurs amis avec joie et reconnaissance; mais ils furent encore plus frappés de la magnificence du temple d'Europe. Ils ne pouvaient se laisser d'examiner, dans le plus grand détail, les riches présents envoyés de Sidon à cette princesse par son père Phénicie et par ses nobles compagnes, et qui faisaient l'ornement de ce bel édifice. + +Dans le même temps, Alexandre de Phrygie, fils de Priam, accompagné d'Énée et de plusieurs de ses parents, se rendait coupable d'un grand attentat à Sparte et dans le palais de Ménélas, où il avait été reçu comme hôte, et traité tomme ami. Aussitôt après le départ du roi, épris d'amour pour Hélène, qui surpassait en beauté toutes les femmes de la Grèce, il l'enleva, et avec elle tous les trésors qu'il put emporter. Cette princesse fut accompagnée dans sa fuite par Aetra et Clymène, parentes de Ménélas, attachées à son service. La nouvelle du crime commis par Alexandre contre la maison de Ménélas parvint bientôt en Crète; et la renommée, qui se plaît ordinairement à grossir les objets, publia que le palais du roi avait été détruit, son empire renversé, et répandit d'autres bruits aussi funestes. + +Ménélas, à cette nouvelle, quoique vive. meut affecté de l'enlèvement de son épouse, fut encore plus irrité de la connivence perfide qu'il crut apercevoir entre le ravisseur et ses parentes. Palamède, voyant ce prince indigné et furieux sortir du conseil sans proférer un seul mot, fait approcher de terre les vaisseaux et dispose tout pour le départ. Après quelques paroles consolantes adressées au roi, il embarque à la hâte tout ce qui provenait du partage, fait monter Ménélas avec lui sur la flotte, et, secondés d'un vent favorable, ils arrivent en peu de jours à Sparte. Déjà Agamemnon, Nestor , et tous les rois descendants de Pélops, y étaient accourus. A l'arrivée de Ménélas, ils s'assemblent ; et quoique l'atrocité de l'action leur inspiràt une profonde horreur et les portât â une prompte vengeance, cependant, après avoir délibéré mûrement, ils résolurent d'envoyer d'abord à Troie, en qualité de députés, Palamède, Ulysse et Ménélas, avec ordre de se plaindre de l'injure, et de redemander Hélène ainsi que tous les trésors enlevés. + +Les députés arrivèrent bientôt à Troie et n'y trouvèrent point Alexandre. Ce prince qui, dans sa fuite précipitée, avait peu consulté les vents, s'était vu forcé de relâcher en Chypre. De là, après s'être saisi de quelques vaisseaux, il avait abordé sur la côte de Phénicie. Toujours tourmenté par cette même avidité qui l'avait accompagné à Sparte, il égorge de nuit, par trahison, le roi des Sidoniens, qui lui avait fait un accueil favorable. Tout ce que renferme le palais est le prix de son crime; toutes les richesses accumulées dans ce lieu, monuments de la grandeur royale, sont par son ordre injustement enlevées et portées sur ses vaisseaux. Cependant, aux cris lamentables de ceux qui avaient échappé aux ravisseurs, le peuple se soulève, se porte en foule au palais, et, dans le moment où Alexandre, après avoir pris tout ce qui était à sa convenance, se préparait à mettre à la voile, une troupe, armée à la hâte, se présente; le combat s'engage et se poursuit avec acharnement; nombre de combattants tombent de part et d'autre; les uns s'opiniâtrent à venger la mort de leur roi, les autres à conserver leur butin. Enfin les Troyens, après avoir eu deux de leurs vaisseaux brûlés, furent assez heureux pour sauver le reste, et échappèrent ainsi à la vengeance des Sidoniens déjà fatigués du carnage. + +Sur ces entrefaites, Palamède, un des députés qui s'étaient rendus à Troie, prince à qui sa valeur dans les combats et sa sagesse dans les conseils avaient mérité la plus grande confiance, se rend au palais de Priam. Là, devant le conseil assemblé, il se plaint du crime d'Alexandre, représente les droits de l'hospitalité indignement violés par lui, observe qu'une telle action est capable de réveiller la haine entre les deux nations, rappelle le souvenir des discordes qui, pour de semblables causes, divisèrent jadis les maisons d'llus et de Pélops, et d'autres familles encore, discordes qui ont entraîné les peuples dans des guerres désastreuses. Il met sous les yeux de Priam les dangers et l'incertitude des combats, les avantages et les douceurs de la paix, l'assure qu'un forfait aussi odieux ne manquera pas d'exciter l'indignation de toute la terre, de priver ses auteurs de tout secours humain, et de les conduire à une perte inévitable, digne récompense de leur détestable impiété. Il se préparait à continuer lorsque Priam l'interrompant, lui dit: +« Modérez-vous, je vous prie, Palamède; il n'est pas juste d'accuser un absent. Il peut bien arriver que ce grand crime dont on le charge soit suffisamment détruit dans sa réplique lorsqu'il sera présent. » +Sous ce prétexte et d'autres semblables, il ordonne de suspendre l'examen de l'affaire jusqu'à l'arrivée d'Alexandre. Il voyait bien, par l'effet du discours de Palamède sur chacun des conseillers, que l'on condamnait généralement, sans ces pendant oser rien dire, d'action de son fils. En effet, le prince grec avait exposé ses plaintes avec un art admirable; il avait répandu dans son discours un intérêt touchant bien capable de produire l'effet désiré. L'assemblée se sépara ainsi ce jour-là. Ensuite Anténor, homme généreux, et surtout ami de la justice et de la vertu, conduisit dans son palais les députés, qui l'y suivirent avec joie. + +Peu de jours après, le fils de Priam et ses compagnons arrivèrent, amenant avec eux la belle Hélène. Son retour mit la ville en mouvement. Les uns avaient l'action d'Alexandre en horreur ; les autres s'attendrissaient sur Ménélas, qui en était la victime. Tous étaient indignés, et personne ne cherchait à défendre le ravisseur. Priam, inquiet, appelle ses fils auprès de lui, les consulte sur ce qu'il doit faire dans une telle conjoncture : ils sont tous d'avis de ne point rendre Hélène. La vue des richesses qu'on avait enlevées avec elle les éblouissait, et ils n'ignoraient pas qu'il faudrait s'en dessaisir si on la rendait elle-même. Ils ne voyaient pas non plus avec indifférence les belles femmes de la suite d'Hélène, et se proposaient bien d'en faire leur conquête; car ces princes, dont les moeurs étaient aussi barbares que le langage, s'inquiétaient peu de ce qui était juste ou injuste, et ne voyaient dans cette affaire que deux objets qui partageaient également leur affection : le butin premièrement; ensuite le moyen d'assouvir leurs passions déréglées, + +Priam, après cette réponse, les quitte, assemble les anciens, leur fait part de la résolution de ses fils et demande leur avis. Ceux-ci ne l'avaient pas encore donné, que les princes, sans garder aucune mesure, entrent tout-à-coup dans la salle du conseil, en menaçant chacun des assistants de leur vengeance, s'ils osent prendre le moindre arrêté contraitre à leurs intérêts. Cependant le peuple ne poutait retenir son indignation, et réclamait hautement contre l'injustice; il demandait satisfaction pour les députés, et pour lui-même la réparation des torts qu'il éprouvait journellement. Alexandre, toujours aveuglé par sa passion, et craignant tout d'un peuple irrité, sort accompagné de ses frères, les armes à la main, se jette au milieu de la multitude, et en fait un affreux carnage. Ce qui reste est sauvé par l'intervention des grands qui avaient assisté au conseil, et par Anténor, qui s'était mis â leur tête. Ainsi le peuple se retira méprisé, maltraité, et sans avoir rien obtenu. + +Le lendemain, le roi, à la prière d'Hécube, se rend chez Hélène, la salue avec bonté, l'exhorte à prendre courage, et lui fait plusieurs questions sur son état et sur sa naissance. La princesse lui répondit que des liens de parenté l'unissaient â Alexandre, qu'elle appartenait plus à Priam et à Hécube qu'aux fils de Plisthène; et reprenant son origine de plus haut, elle dit que Danaüs et Agénor étaient leurs communs auteurs; que de Pléione, fille de Danaüs et d'Atlas, naquit Électre, qui, enceinte de Jupiter, avait mis au monde Dardanus, duquel sortirent Tros et les autres rois de Troie; que d'un autre côté, Taygète, fille d'Agénor, avait eu de Jupiter Lacédémon, père d'Amiclas ; que celui-ci donna le jour à Argalus, père d'Oebalus, qui engendra Tyndare, dont elle était la fille. Elle allégua aussi les liens qui l'unissaient à Hécube par Agénor, père de Phinée et de Phénice, aïeuls d'Hécube et de Léda, sa mère. Après avoir ainsi établi sa généalogie, elle conjura Priam et Hécube, les larmes aux yeux, de ne la point rendre aux Grecs après l'avoir prise sous leur protection. Elle ajouta que les richesses qui avaient été tirées du palais de Ménélas lui appartenaient, et qu'elle n'avait rien pris au-delà. On ne sait pas au juste si sa réponse lui fut inspirée par son amour pour Alexandre, ou par la crainte d'être punie un jour par son mari à cause de sa désertion. + +Hécube, qui connaissait son désir, et voyait en elle une parente, la tenait serrée contre son sein, et suppliait son époux de ne la point rendre. Cependant Priam et les princes étaient revenus à un meilleur avis ; ils insistaient pour qu'on renvoyât la députation avec une réponse favorable, et craignaient déjà de résister à la volonté du peuple : le seul Deiphobe appuyait Hécube, sans doute parce qu'il était épris de la même passion qu'Alexandre pour la beauté d'Hélène. Hécube, de son côté, s'adressait tantôt à Priam, tantôt à ses fils, et tantôt embrassant la princesse, elle jurait que rien ne pourrait l'en séparer. De cette manière, elle entraîna à son avis tous les assistants, et les caresses d'une mère triomphèrent enfin du bonheur public. Le jour suivant, Ménélas et ses collègues se rendirent à l'assemblée, redemandant Hélène, et avec elle tentes les richesses qui avaient été enlevées. Alors Priam, debout et entouré des princes ses fils, commande le silence; il prie Hélène, qui était présente, de choisir elle-même, et de déclarer si elle voulait retourner à Sparte ou demeurer à Troie. La princesse, dit-on, fit réponse qu'elle ne voulait ni revoir sa patrie, ni rester unie à Ménélas. Ainsi les princes sortent du conseil triomphants et joyeux de posséder Hélène. + +\endnumbering +\end{french} +\end{Leftside} + +\begin{Rightside} +\beginnumbering +\autopar + +\edtext{Cuncti}{\Cfootnote{% +\Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side. \Ctest xxx Cfootnote is only for right side.% +}} reges, qui Minois Jove geniti, pronepotes, Graeciae imperitabant, ad dividendas inter se Cretei opes, Cretam convenere; Creteus namque ex Minoe, postrema sua ordinans, quidquid auri atque argenti, pecorum etiam fuit, nepotibus, quos filiae genuerant, ex aequo dividendum reliquerat, excepto civitatum terrarumque imperio; haec quippe Idomeneus cum Merione, Deucalionis Idomeneus, alter Moli, jussu ejus seorsum habuere. Convenere autem Clymenae et Nauplii Palamedes, et Oeax, dicti Creteidae : item Menelaus, Aeropa et Plisthene genitus, a quo Anaxibia soror, quae eo tempore Nestori denupta erat, et Agamemnon major frater, ut vice sua in divisione uteretur, petiverant. Sed hi non Plisthenis, ut erant, magis quam Atrei dicebantur; ob eam causam, quod quum Plisthenes, admodum parvus ipse agens in primis annis vita functus, nihil dignum ad memoriam nominis reliquisset, Atreus miseratione aetatis secum eos habuerat, neque minus quam regios educaverat. In qua divisione singuli pro nominis celebritate inter se quisque magnifice transegere. + +Ad eos re cognita omnes ex origine Europae, quae in ea insula summa religione colitur, confluunt benigneque salutatos in templum deducunt. Ibi multarum hostiarum immolatione celebrata, exhibitisque epulis, largiter magnificeque eos habuere : itemque insecutis diebus. At reges Graeciae, etsi ea quae exhibebantur cum laetitia accipiebant, tamen multo magis templi ejus magnifica pulchritudine, pretiosaque exstructione operum afficiebantur, inspicientes repetentesque memoria, singula, quae ex Sidone a Phoenice patre ejus, atque nobilibus matronis transmissa magno tum decori erant. + +Per idem tempus Alexander Phrygius, Priami filius, cum Aenea aliisque ex consanguinitate comitibus, Spartae in domum Menelai hospitio receptus, indignissimum facinus perpetraverat. Is namque ubi animadvertit regem abesse, quod erat Helena praeter caeteras Graeciae faeminas miranda specie, amore ejus captus, ipsamque et multas opes domo ejus aufert, Aethram etiam et Clymenam Menelai adfines, quae ob necessitudinem cum Helena agebant. Postquam Cretam nuncius venit, et cuncta quae ab Alexandro adversus domum Menelai commissa erant, aperuit, per omnem insulam, sicut in tali re fieri amat, fama in majus divulgatur: expugnatam quippe domum regis, eversumque regnum, et alia in talem modum singuli disserebant. + + +Quibus cognitis Menelaus, etsi abstractio conjugis animum permoverat, multo amplius tamen ob injuriam adfinium, quas supra memoravimus, consternabatur. At ubi animadvertit Palamedes, regem ira atque indignatione stupefactum, concilio excidisse, ipso naves parat, atque omni instrumento compositas terrae applicat. Dein pro temporo regem breviter consolatus, positis etiam ex divisione, quae in tali negotio tempus patiebatur, navem ascendere facit : atque ita ventis ex sententia flantibus, paucis diebus Spartam pervenere. Eo jam Agamemnon et Nestor, omnesque qui ex origine Pelopis in Graecia regnabant, cognitis rebus confluxerant. Igitur postquam Menelaum advenisse sciunt, in unum coeunt. Et quanquam atrocitas facti ad indignationem, ultumque injurias rapiebat, tamen ex consilii sententia legantur prius ad Troiam Palamedes, Ulysses et Menelaus ; hisque mandatur, ut conquesti iniurias, Helenam, et quae cum ea abrepta erant, repeterent. + +Legati paucis diebus ad Trojiam veniunt, neque tum Alexandrum in loco offendere. Eum namque properatione navigii inconsulte usum venti ad Cyprum appulere. Unde sumptis aliquot navibus, Phoenicem delapsus, Sidoniorum regem, qui eum amice susceperat, noctu per insidias necat : eademque qua apud Lacedaomonam, cupiditate, universam domum ejus in scelus proprium convertit. Ita omnia quae ad ostentationem regiae magnificentiae fuere, indigne rapta, ad naves deferri jubet. Sed ubi ex lamentatione eorum qui casum domini deflentes, reliqui praedae aufugerant, tumultus ortus est, populus omnis ad regiam concurrit. Inde quod jam Alexander, abreptis quae cupiebat, ascensionem properabat, pro tempore armati ad naves veniunt; ortoque inter eos acri proelio, cadunt utrinque plurimi, quum obstinate hi regis necem defenderent, hi ne amitterent partam praedam summis opibus adniterentur. Incensis dein duabus navibus, Trojani reliquas strenue defensas liberant, atque ita fatigatis jam proelio hostibus evadunt. + +Interim apud Trojam, legatorum Palamedes, cujus maxime ea tempestate demi bellique consilium valuit, ad Priamum adit, conductoque concilio, primum de Alexandri injuria conqueritur, exponens conmunis hospitii eversionem. Dein monet, quantas ea res inter duo regna simultates concitatura esset, interjaciens memoriam discordiarum Ili et Pelopis, aliorumque qui ex causis similibus ad internecionem usque gentium pervenissent. Ad postremum belli difficultates, contraque pacis commoda adstruens, « Non se ignorare, ait, quantis mortalibus tam atrox facinus indignationem incuteret ; ex quo auctores injuriae ab omnibus derelictos, impietatis supplicia subituros. » Et quum plura dicere cuperet, Priamus medium ejus interrumpens sermonem, « Parcius, quaeso, Palamedes, inquit ; iniquum enim videtur, insimulari eum qui absit : maxime quum fieri possit, uti quae criminose objecta sunt, praesenti refutatione diluantur. » Haec atque alia hujusmodi inferens, differri querelas ad adventum Alexandri jubet. Videbat enim, ut singuli, qui in eo concilio aderant, Palamedis oratione moverentur; ut taciti vultu tamen admissum facinus condemnarent; quum singula miro genere orationis exponerentur, atque in sermone Graeci regis inesset quaedam permixta miserationi vis. Atque ita eo die consilium dimittitur. Sed legatos Antenor, vir hospitalis, et praeter caeteros boni hunestique sectator, domum ad se volentes deducit. + +Interim paucis post diebus, Alexander cum supradictis comitibus venit, Helenam secum habens. Cujus adventu in tota civitate quum partim exemplum facinoris exsecrarentur, alii injurias in Menelaum admissas dolerent, nullo omnium adprobante, postremo cunctis indignantibus, tumultus ortus est. Queisrebus anxius Priamus filios convocat, eosque quid super tali agendum negotio videretur, consulit : qui una voce, minime reddendam Helenam, respondent. Videbant quippe quantae opes cum ea advectae essent : quae universa, si Helena traderetur, necessario amitterent. Praeterea permoti forma mulierum quae cum Helena venerant, nuptias sibi singularum jam animo destinaverant. Quippe qui lingua moribusque barbari, nihil pensi aut consulti patientes, praeda ac libidine transversi agebantur. + +Igitur Priamus, relictis his, senes conducit, sententiam filiorum aperit. Dein cunctos, quid agendum sit, consulit. Sed priusquam ex more sententiae dicerentur, reguli repente concilium irrumpunt, atque inconditis moribus malum singulis minitantur, si aliter quam ipsis videretur, decernerent. Interim omnis populus indigne admissam injuriam, atque in hunc modum multa alia, cum exsecratione reclamabant. Ob quae Alexander cupidine animi praeceps, veritus ne quid adversum se a popularibus oriretur, stipatus armatis fratribus impetum in multitudinem facit, multosque obtruncat : reliqui interventu procerum, qui in consilio fuerant, duce liberantur Antenore. Ita infectis rebus, populus contemptui habitus, non sine pernicie sua, domum discedit. + +Dein secuta die rex hortatu Hecubae ad Helenam adit, eamque benigne salutans, animum bonum uti gereret hortatur; quae cujusque erset, requirit. Tum illa Alexandri se adfinem respondit, magisque ad Priamum et Hecubam, quam ad Plisthenis filios genere pertinere, repetens originem omnem majorum. Danaum enim atque Agenorem, et sui et Priami generis auctores esse. Namque ex Pleiona, Danai filia et Atlante, Electram natam, quam ex Jove gravidam Dardanum genuisse, ex quo Tros, et deinceps insecuti reges llii. Agenoris porro Taygetam; eam ex Jove habuisse Lacedaemonem, ex quo Amiclam natum, et ex eo Argalum patrem Oebali, quem Tyndari, ex quo ipsa genita videretur, patrem constaret. Repetebat etiam cum Hecuba materni generis adfinitatem. Agenoris quippe Phineum et Phoenicem, et inde patres Hecubae et Ledae consanguinitate originem divisisse. Postquam memoriter cuncta retexuit, ad postremum flens orare, ne se, quae semel in fldem illorum recepta esse, prodendam putarent. Ea secum domo Menelai apportata quae propria fuissent, nihil praeterea ablatum. Sed utrum immodico amore Alexandri, an poenarum metu, quas ob desertam domum a conjuge metuebat, ita sibi consulere maluerit, parum constabat. + +Igitur Hecuba, cognita voluntate, simul ob generis conjunctionem, complexa Helenam, ne proderetur, summis opibus adnitebatur : quum jam Priamus et reliqui reguli non amplius differendos legatos dicerent, neque resistendum popularium voluntati; solo omnium Deiphobo Hecubae assenso : quem non aliter atque Alexandrum, Helenae desiderium a recto consilio praepediebat. Itaque quum obstinate Hecuba nunc Priamum, modo filios deprecaretur, modo complexu ejus nulla rations divelli posset, omnes qui aderant in voluntatem suam transduxit. Ita ad postremum bonum publicum materna gratia corruptum est. Dein postero die Menelaus cum suis in concionem venit, conjugem, et quae cum ea abrepta essent, repetens. Tunc Priamus inter regulos medius adstans, facto silentio, optionem Helenae, quae ob id in conspectu popularium venerat, offert, si ei videretur, dornum ed suos regredi. Quam ferunt dixisse, neque se patriam regredi velle, neque sibi cum Menelai matrimonio convenire. Ita reguli habentes Helenam, non sine exultatione ex concione discedunt. + + +\endnumbering +\end{Rightside} + +\end{pages} +\Pages +\end{document} diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_pages_notes_leftpage.pdf b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_pages_notes_leftpage.pdf Binary files differnew file mode 100644 index 00000000000..823855f4c64 --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_pages_notes_leftpage.pdf diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_pages_notes_leftpage.tex b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_pages_notes_leftpage.tex new file mode 100644 index 00000000000..627200dcda6 --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_pages_notes_leftpage.tex @@ -0,0 +1,70 @@ +\documentclass[a4paper]{article} + +\usepackage{polyglossia,fontspec,xunicode} +\usepackage{libertineotf} +\setmainlanguage{latin} +\setotherlanguage{english} +\usepackage{csquotes} + + +\usepackage[series={A},nocritical,noend,noeledsec,noledgroup]{reledmac} +\usepackage[shiftedpstarts]{reledpar} +\usepackage{setspace} + +\onehalfspacing + + +\begin{document} + +\date{} +\begin{english} +\title{Parallel pages with notes called on the right page but printed on the left page} +\maketitle + +\begin{abstract} +This file provides an example of calling familiar notes in parallel pages typesetting, with footmark on the right side but notes printed on the left side. + +The notes of series \verb+A+ are called on the left side with \verb+footnoteAnomk+ and the footnote mark are inserted on the right page with \verb+footnoteAmk+. +\end{abstract} +\end{english} + +\begin{pages} + + \begin{Leftside} + \beginnumbering + \autopar + + Lorem\footnoteAnomk{A note called in right side, but printed in left side. A note called in right side, but printed in left side. A note called in right side, but printed in left side. A note called in right side, but printed in left side. A note called in right side, but printed in left side. A note called in right side, but printed in left side. A note called in right side, but printed in left side. A note called in right side, but printed in left side. A note called in right side, but printed in left side. A note called in right side, but printed in left side. A note called in right side, but printed in left side.} ipsum dolor sit amet, consectetur adipiscing elit. Vivamus id erat imperdiet, sollicitudin tortor a, rhoncus ipsum. Aliquam at maximus nibh. Ut sed risus porttitor, eleifend tortor non, commodo nisl. Praesent eu ullamcorper est. Phasellus at eros eget ex feugiat scelerisque. + + Vivamus et luctus justo. In aliquet, metus malesuada vestibulum ullamcorper, est sapien facilisis arcu, ac efficitur mi metus ac velit. Sed sagittis laoreet justo at iaculis. + + Aliquam\footnoteAnomk{An other note called in right side, but printed in left side. An other note called in right side, but printed in left side. An other note called in right side, but printed in left side. An other note called in right side, but printed in left side. An other note called in right side, but printed in left side. An other note called in right side, but printed in left side. An other note called in right side, but printed in left side.} eu erat id tellus bibendum semper eu eget nulla. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin nunc arcu, iaculis sit amet laoreet ut, finibus at nibh. + + Curabitur non lacus eget tellus consectetur dignissim. Nullam a tempus enim. Donec ut pulvinar magna, in accumsan velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Donec lacinia scelerisque urna, sagittis fermentum est ultricies semper. + + Aenean condimentum, leo vitae convallis porta, neque felis rhoncus metus, in iaculis nulla ligula vitae quam. Fusce at vehicula purus, id sollicitudin dolor. Maecenas scelerisque non est non luctus. Aliquam erat volutpat. Praesent eu placerat urna. Donec fermentum mauris sit amet nulla semper lacinia. Donec eu ipsum ultricies, placerat odio id, ultrices urna. Cras id sapien ut nisi auctor elementum vel id tellus. + + \endnumbering + \end{Leftside} + + \begin{Rightside} + \beginnumbering + \autopar + Lorem\footnoteAmk ipsum dolor sit amet, consectetur adipiscing elit. Vivamus id erat imperdiet, sollicitudin tortor a, rhoncus ipsum. Aliquam at maximus nibh. Ut sed risus porttitor, eleifend tortor non, commodo nisl. Praesent eu ullamcorper est. Phasellus at eros eget ex feugiat scelerisque. Proin pellentesque lorem eu risus convallis consectetur ac molestie turpis. Maecenas blandit iaculis orci, et mattis dolor luctus vel. Praesent placerat varius tellus, nec convallis purus volutpat at. Vivamus sit amet est interdum, condimentum sem ultricies, posuere sapien. Maecenas vitae sapien diam. Donec et risus non nunc laoreet tincidunt. Pellentesque vehicula pellentesque sagittis. Morbi elementum tempus nunc, eu sodales erat convallis et. Maecenas condimentum pretium faucibus. Nam in ante nunc. Etiam lobortis, arcu a imperdiet interdum, felis erat mattis nunc, id posuere purus nisl a nibh. + + Vivamus et luctus justo. In aliquet, metus malesuada vestibulum ullamcorper, est sapien facilisis arcu, ac efficitur mi metus ac velit. Sed sagittis laoreet justo at iaculis. Morbi scelerisque nec quam eu efficitur. Integer nec massa ut lectus viverra ornare sed id libero. Praesent fermentum suscipit ante ut aliquam. Sed facilisis rutrum sapien vel blandit. Ut eget ex ut massa consequat sodales. Vestibulum venenatis in quam a molestie. + + Aliquam\footnoteAmk eu erat id tellus bibendum semper eu eget nulla. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin nunc arcu, iaculis sit amet laoreet ut, finibus at nibh. Aliquam vel nisl a sem pulvinar efficitur. Quisque dignissim, metus at consectetur ultrices, metus nunc ultrices quam, at ultrices dolor massa vitae urna. Nullam semper nisi dui, vel commodo mi lobortis sit amet. In non mattis orci. Integer aliquam dapibus convallis. Suspendisse sodales tincidunt ante quis laoreet. Etiam sodales mauris nulla, vitae mattis est consequat sit amet. Nam blandit rhoncus nisi. Sed accumsan, nibh non venenatis aliquam, dolor quam sodales turpis, nec aliquam nunc arcu quis urna. + + Curabitur non lacus eget tellus consectetur dignissim. Nullam a tempus enim. Donec ut pulvinar magna, in accumsan velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Donec lacinia scelerisque urna, sagittis fermentum est ultricies semper. Phasellus non augue ligula. Donec aliquet bibendum elit, quis tempor risus pulvinar id. Curabitur a cursus enim. Integer sit amet accumsan urna. Nam viverra at tortor ac gravida. In hac habitasse platea dictumst. Morbi imperdiet eleifend risus id consequat. Proin blandit mi a elit vehicula, a semper quam lacinia. Pellentesque at iaculis diam, quis condimentum justo. Nulla laoreet ut mauris sed tempor. + + Aenean condimentum, leo vitae convallis porta, neque felis rhoncus metus, in iaculis nulla ligula vitae quam. Fusce at vehicula purus, id sollicitudin dolor. Maecenas scelerisque non est non luctus. Aliquam erat volutpat. Praesent eu placerat urna. Donec fermentum mauris sit amet nulla semper lacinia. + + \endnumbering + \end{Rightside} + + +\end{pages} + \Pages + +\end{document} diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_pages_paragraph_separator_between.pdf b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_pages_paragraph_separator_between.pdf Binary files differnew file mode 100644 index 00000000000..1388a46e87a --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_pages_paragraph_separator_between.pdf diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_pages_paragraph_separator_between.tex b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_pages_paragraph_separator_between.tex new file mode 100644 index 00000000000..995eccd40a3 --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_pages_paragraph_separator_between.tex @@ -0,0 +1,54 @@ +\documentclass{article} +\usepackage{polyglossia,fontspec,xunicode} +\usepackage{libertineotf} +\setmainlanguage{latin} +\setotherlanguage{english} + +\usepackage[series={},nocritical,noend,noeledsec,nofamiliar,noledgroup]{reledmac} +\usepackage{reledpar} + +\AtEveryPend{\vskip \baselineskip{\hfill ***\hfill\strut}\vskip \baselineskip} +\begin{document} + +\begin{english} +\title{Separators between paragraphs} +\maketitle +\begin{abstract} +This file provides examples of separators between paragraphs. +To automatically insert them, we use \verb+\AtEveryPend+ command. +The last \verb+\pend+ must not have separator after it. So we define its optional argument as \verb+\relax+. + +\end{abstract} +\end{english} + +\begin{pages} +\begin{Rightside} +\beginnumbering +\pstart +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus eu tellus eu diam dignissim eleifend blandit eget justo. Aliquam nisi justo, interdum ac erat in, tincidunt imperdiet urna. In hac habitasse platea dictumst. Donec consectetur pharetra nibh, a ultrices mauris tincidunt quis. Aenean id cursus magna, non sollicitudin lorem. Nunc feugiat faucibus rutrum. Phasellus ut diam sed enim efficitur porttitor sit amet vel velit. Donec enim nibh, molestie nec convallis in, pretium at odio. Sed eget ipsum quis velit mollis aliquam. Integer aliquam scelerisque finibus. +\pend +\pstart +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus eu tellus eu diam dignissim eleifend blandit eget justo. Aliquam nisi justo, interdum ac erat in, tincidunt imperdiet urna. In hac habitasse platea dictumst. Donec consectetur pharetra nibh, a ultrices mauris tincidunt quis. Aenean id cursus magna, non sollicitudin lorem. Nunc feugiat faucibus rutrum. Phasellus ut diam sed enim efficitur porttitor sit amet vel velit. Donec enim nibh, molestie nec convallis in, pretium at odio. Sed eget ipsum quis velit mollis aliquam. Integer aliquam scelerisque finibus. +\pend +\pstart +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus eu tellus eu diam dignissim eleifend blandit eget justo. Aliquam nisi justo, interdum ac erat in, tincidunt imperdiet urna. In hac habitasse platea dictumst. Donec consectetur pharetra nibh, a ultrices mauris tincidunt quis. Aenean id cursus magna, non sollicitudin lorem. Nunc feugiat faucibus rutrum. Phasellus ut diam sed enim efficitur porttitor sit amet vel velit. Donec enim nibh, molestie nec convallis in, pretium at odio. Sed eget ipsum quis velit mollis aliquam. Integer aliquam scelerisque finibus. +\pend[\relax] +\endnumbering +\end{Rightside} +\begin{Leftside} +\beginnumbering +\pstart +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus eu tellus eu diam dignissim eleifend blandit eget justo. Aliquam nisi justo, interdum ac erat in, tincidunt imperdiet urna. In hac habitasse platea dictumst. Donec consectetur pharetra nibh, a ultrices mauris tincidunt quis. Aenean id cursus magna, non sollicitudin lorem. Nunc feugiat faucibus rutrum. Phasellus ut diam sed enim efficitur porttitor sit amet vel velit. Donec enim nibh, molestie nec convallis in, pretium at odio. Sed eget ipsum quis velit mollis aliquam. Integer aliquam scelerisque finibus. +\pend +\pstart +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus eu tellus eu diam dignissim eleifend blandit eget justo. Aliquam nisi justo, interdum ac erat in, tincidunt imperdiet urna. In hac habitasse platea dictumst. Donec consectetur pharetra nibh, a ultrices mauris tincidunt quis. Aenean id cursus magna, non sollicitudin lorem. Nunc feugiat faucibus rutrum. Phasellus ut diam sed enim efficitur porttitor sit amet vel velit. Donec enim nibh, molestie nec convallis in, pretium at odio. Sed eget ipsum quis velit mollis aliquam. Integer aliquam scelerisque finibus. +\pend +\pstart +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus eu tellus eu diam dignissim eleifend blandit eget justo. Aliquam nisi justo, interdum ac erat in, tincidunt imperdiet urna. In hac habitasse platea dictumst. Donec consectetur pharetra nibh, a ultrices mauris tincidunt quis. Aenean id cursus magna, non sollicitudin lorem. Nunc feugiat faucibus rutrum. Phasellus ut diam sed enim efficitur porttitor sit amet vel velit. Donec enim nibh, molestie nec convallis in, pretium at odio. Sed eget ipsum quis velit mollis aliquam. Integer aliquam scelerisque finibus. +\pend[\relax] +\endnumbering +\end{Leftside} + +\end{pages} +\Pages +\end{document} diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_titles_not_in_line_numbering.pdf b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_titles_not_in_line_numbering.pdf Binary files differnew file mode 100644 index 00000000000..970637a39c1 --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_titles_not_in_line_numbering.pdf diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_titles_not_in_line_numbering.tex b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_titles_not_in_line_numbering.tex new file mode 100644 index 00000000000..ff69c6cdc7c --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_titles_not_in_line_numbering.tex @@ -0,0 +1,246 @@ +\documentclass{article} +\usepackage{fontspec} +\usepackage{libertineotf} +\usepackage{polyglossia} +\setmainlanguage{latin} +\setotherlanguage{english} + +\usepackage[series={},nocritical,noend,noeledsec,nofamiliar,noledgroup]{reledmac} +\usepackage{reledpar} + + +\begin{document} +\begin{english} +\date{} +\title{Titles in parallel, not in numbered line} +\maketitle +\begin{abstract} +This file provides example of section titles set in parallel. The titles are not in numbered line. Following the standard configuration of reledpar, only the left titles are add to the table of contents. + +We use the optional arguments of \verb+\pstart+. +\end{abstract} +\end{english} + +\tableofcontents + + +\begin{pages} + +\begin{Leftside} +\beginnumbering + +\pstart[\section{Left section title}] +Lorem ipsum dolor sit amet, consectetur adipisicing elit +sed do eiusmod tempor incididunt ut labore et dolore +magna aliqua. Ut enim ad minim veniam, quis nostrud +exercitation ullamco laboris nisi +ut aliquip consequat ut aliquip consequat +\pend + +\pstart[\subsection{Left subsection title}] +Duis aute irure dolor in reprehenderit +in voluptate velit esse cillum dolore eu ur. Excepteur sint occaecat +cupidatat non proident, sunt in culpa qui officia deserunt +Duis aute irure dolor in reprehenderit +in voluptate velit esse cillum dolore eu fugiat nulla +pariatur. Excepteur sint occaecat. +\pend + +\pstart[\subsection{Left subsection title}] +Lorem ipsum dolor sit amet, consectetur adipisicing elit +sed do eiusmod tempor incididunt ut labore et dolore +magna aliqua. Ut enim ad minim veniam, quis nostrud +exercitation ullamco laboris nisi +ut aliquip consequat ut aliquip consequat\pend + +\pstart[\section{Left section title}] +Duis aute irure dolor in reprehenderit +in voluptate velit esse cillum dolore eu ur. Excepteur sint occaecat +cupidatat non proident, sunt in culpa qui officia deserunt +Duis aute irure dolor in reprehenderit +in voluptate velit esse cillum dolore eu fugiat nulla +pariatur. Excepteur sint occaecat. +\pend + +\pstart[\subsection{Left subsection title}] +Lorem ipsum dolor sit amet, consectetur adipisicing elit +sed do eiusmod tempor incididunt ut labore et dolore +magna aliqua. Ut enim ad minim veniam, quis nostrud +exercitation ullamco laboris nisi +ut aliquip consequat ut aliquip consequat +\pend + +\pstart[\subsection{Left subsection title}] +Duis aute irure dolor in reprehenderit +in voluptate velit esse cillum dolore eu ur. Excepteur sint occaecat +cupidatat non proident, sunt in culpa qui officia deserunt +Duis aute irure dolor in reprehenderit +in voluptate velit esse cillum dolore eu fugiat nulla +pariatur. Excepteur sint occaecat. +\pend + +\pstart[\section{Left section title}] +Lorem ipsum dolor sit amet, consectetur adipisicing elit +sed do eiusmod tempor incididunt ut labore et dolore +magna aliqua. Ut enim ad minim veniam, quis nostrud +exercitation ullamco laboris nisi +ut aliquip consequat ut aliquip consequat\pend + +\pstart[\subsection{Left subsection title}] +Duis aute irure dolor in reprehenderit +in voluptate velit esse cillum dolore eu ur. Excepteur sint occaecat +cupidatat non proident, sunt in culpa qui officia deserunt +Duis aute irure dolor in reprehenderit +in voluptate velit esse cillum dolore eu fugiat nulla +pariatur. Excepteur sint occaecat. +\pend + +\pstart[\subsection{Left subsection title}] +Lorem ipsum dolor sit amet, consectetur adipisicing elit +sed do eiusmod tempor incididunt ut labore et dolore +magna aliqua. Ut enim ad minim veniam, quis nostrud +exercitation ullamco laboris nisi +ut aliquip consequat ut aliquip consequat +\pend + +\pstart[\section{Left section title}] +Duis aute irure dolor in reprehenderit +in voluptate velit esse cillum dolore eu ur. Excepteur sint occaecat +cupidatat non proident, sunt in culpa qui officia deserunt +Duis aute irure dolor in reprehenderit +in voluptate velit esse cillum dolore eu fugiat nulla +pariatur. Excepteur sint occaecat. +\pend + +\pstart[\subsection{Left subsection title}] +Lorem ipsum dolor sit amet, consectetur adipisicing elit +sed do eiusmod tempor incididunt ut labore et dolore +magna aliqua. Ut enim ad minim veniam, quis nostrud +exercitation ullamco laboris nisi +ut aliquip consequat ut aliquip consequat +\pend + +\pstart[\subsection{Left subsection title}] +Duis aute irure dolor in reprehenderit +in voluptate velit esse cillum dolore eu ur. Excepteur sint occaecat +cupidatat non proident, sunt in culpa qui officia deserunt +Duis aute irure dolor in reprehenderit +in voluptate velit esse cillum dolore eu fugiat nulla +pariatur. Excepteur sint occaecat. +\pend + +\endnumbering +\end{Leftside} + +\begin{Rightside} + +\beginnumbering +\pstart[\section{Right section title}] +Lorem ipsum dolor sit amet, consectetur adipisicing elit +sed do eiusmod tempor incididunt ut labore et dolore +magna aliqua. Ut enim ad minim veniam, quis nostrud +exercitation ullamco laboris nisi +ut aliquip consequat ut aliquip consequat +\pend + +\pstart[\subsection{Right subsection title}] +Duis aute irure dolor in reprehenderit +in voluptate velit esse cillum dolore eu ur. Excepteur sint occaecat +cupidatat non proident, sunt in culpa qui officia deserunt +Duis aute irure dolor in reprehenderit +in voluptate velit esse cillum dolore eu fugiat nulla +pariatur. Excepteur sint occaecat. +\pend + +\pstart[\subsection{Right subsection title}] +Lorem ipsum dolor sit amet, consectetur adipisicing elit +sed do eiusmod tempor incididunt ut labore et dolore +magna aliqua. Ut enim ad minim veniam, quis nostrud +exercitation ullamco laboris nisi +ut aliquip consequat ut aliquip consequat +\pend + +\pstart[\section{Right section title}] +Duis aute irure dolor in reprehenderit +in voluptate velit esse cillum dolore eu ur. Excepteur sint occaecat +cupidatat non proident, sunt in culpa qui officia deserunt +Duis aute irure dolor in reprehenderit +in voluptate velit esse cillum dolore eu fugiat nulla +pariatur. Excepteur sint occaecat. +\pend + +\pstart[\subsection{Right subsection title}] +Lorem ipsum dolor sit amet, consectetur adipisicing elit +sed do eiusmod tempor incididunt ut labore et dolore +magna aliqua. Ut enim ad minim veniam, quis nostrud +exercitation ullamco laboris nisi +ut aliquip consequat ut aliquip consequat +\pend + +\pstart[\subsection{Right subsection title}] +Duis aute irure dolor in reprehenderit +in voluptate velit esse cillum dolore eu ur. Excepteur sint occaecat +cupidatat non proident, sunt in culpa qui officia deserunt +Duis aute irure dolor in reprehenderit +in voluptate velit esse cillum dolore eu fugiat nulla +pariatur. Excepteur sint occaecat. +\pend + +\pstart[\section{Right section title}] +Lorem ipsum dolor sit amet, consectetur adipisicing elit +sed do eiusmod tempor incididunt ut labore et dolore +magna aliqua. Ut enim ad minim veniam, quis nostrud +exercitation ullamco laboris nisi +ut aliquip consequat ut aliquip consequat +\pend + +\pstart[\subsection{Right subsection title}] +Duis aute irure dolor in reprehenderit +in voluptate velit esse cillum dolore eu ur. Excepteur sint occaecat +cupidatat non proident, sunt in culpa qui officia deserunt +Duis aute irure dolor in reprehenderit +in voluptate velit esse cillum dolore eu fugiat nulla +pariatur. Excepteur sint occaecat. +\pend + +\pstart[\subsection{Right subsection title}] +Lorem ipsum dolor sit amet, consectetur adipisicing elit +sed do eiusmod tempor incididunt ut labore et dolore +magna aliqua. Ut enim ad minim veniam, quis nostrud +exercitation ullamco laboris nisi +ut aliquip consequat ut aliquip consequat +\pend + +\pstart[\section{Right section title}] +Duis aute irure dolor in reprehenderit +in voluptate velit esse cillum dolore eu ur. Excepteur sint occaecat +cupidatat non proident, sunt in culpa qui officia deserunt +Duis aute irure dolor in reprehenderit +in voluptate velit esse cillum dolore eu fugiat nulla +pariatur. Excepteur sint occaecat. +\pend + +\pstart[\subsection{Right subsection title}] +Lorem ipsum dolor sit amet, consectetur adipisicing elit +sed do eiusmod tempor incididunt ut labore et dolore +magna aliqua. Ut enim ad minim veniam, quis nostrud +exercitation ullamco laboris nisi +ut aliquip consequat ut aliquip consequat +\pend + +\pstart[\subsection{Right subsection title}] +Duis aute irure dolor in reprehenderit +in voluptate velit esse cillum dolore eu ur. Excepteur sint occaecat +cupidatat non proident, sunt in culpa qui officia deserunt +Duis aute irure dolor in reprehenderit +in voluptate velit esse cillum dolore eu fugiat nulla +pariatur. Excepteur sint occaecat. +\pend + +\endnumbering +\end{Rightside} + + +\end{pages} +\Pages +\end{document} diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_verse_text_between.pdf b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_verse_text_between.pdf Binary files differnew file mode 100644 index 00000000000..ce85b4d927b --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_verse_text_between.pdf diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_verse_text_between.tex b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_verse_text_between.tex new file mode 100644 index 00000000000..afd7b27646e --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/4-reledpar_verse_text_between.tex @@ -0,0 +1,72 @@ +\documentclass{article} +\usepackage{fontspec} +\usepackage{libertineotf} +\usepackage{polyglossia} +\setmainlanguage{latin} +\setotherlanguage{english} + +\usepackage[series={},noeledsec,nocritical,nofamiliar,noend,noledgroup]{reledmac} +\usepackage{reledpar} +\setcounter{stanzaindentsrepetition}{2} +\setstanzaindents{14,0,1} + +\begin{document} +\begin{english} +\date{} +\title{Content between verse, with parallel typesetting} +\maketitle +\begin{abstract} +This file provides examples of adding content between two verses. The parallel typesetting is used. + +The \verb+\newverse+ command is used, with only the first optional arguments. +\end{abstract} +\end{english} + +\begin{pages} + +\begin{Leftside} +\beginnumbering + +\stanza +Ut enim ad minim veniam,& +sed do eiusmod tempor incididunt ut labore et dolore& +magna aliqua. Ut enim ad minim veniam, quis nostrud& +exercitation ullamco laboris nisi& +Uut aliquip consequat ut aliquip consequat +\newverse[\vskip\baselineskip% + ⁂\hfill⁂\hfill⁂% + \vskip\baselineskip]% +% +Duis aute irure dolor in reprehenderit& +in voluptate velit esse cillum dolore eu ur. Excepteur sint occaecat& +cupidatat non proident, sunt in culpa qui officia deserunt& +Duis aute irure dolor in reprehenderit& +in voluptate velit esse cillum dolore eu fugiat nulla& +pariatur. Excepteur sint occaecat\& +\endnumbering +\end{Leftside} + +\begin{Rightside} +\beginnumbering + +\stanza +Lorem ipsum dolor sit amet, consectetur adipisicing elit,& +sed do eiusmod tempor incididunt ut labore et dolore& +magna aliqua. Ut enim ad minim veniam Ut enim ad minim veniam, quis nostrud& +exercitation ullamco laboris nisi& +Ut aliquip consequat ut consequat ut consequat ut consequat ut aliquip consequat\newverse[\vskip\baselineskip% + ⁂\hfill⁂\hfill⁂% + \vskip\baselineskip]% +% +Duis aute irure dolor in reprehenderit& +in voluptate velit esse cillum dolore eu ur. Excepteur sint occaecat& +cupidatat non proident, & +Duis aute irure dolor in reprehenderit& +in voluptate velit esse cillum dolore eu fugiat nulla& +pariatur. Excepteur sint occaecat\& +\endnumbering +\end{Rightside} + +\end{pages} +\Pages +\end{document} diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/makefile b/Master/texmf-dist/doc/latex/reledmac/examples/makefile new file mode 100644 index 00000000000..beda50c95f5 --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/makefile @@ -0,0 +1,16 @@ +.SUFFIXES: .tex + +SRC= $(wildcard *.tex) +OBJ= $(SRC:.tex=.pdf) + +all:$(OBJ) + + +%.pdf: %.tex + latexmk $< + +3-reledpar_pages_different_languages_lualatex.pdf: 3-reledpar_pages_different_languages_lualatex.tex + lualatex $< + +clean: + @$(RM) *pdf *toc *.1* *.2* *.3* *.eledsec* *.log *.fdb_latexmk *.aux *.end *.ilg *.ind *.idx *.out *.synctex.gz *.synctex.gz\(busy\) diff --git a/Master/texmf-dist/doc/latex/reledmac/examples/reledmac.xdy b/Master/texmf-dist/doc/latex/reledmac/examples/reledmac.xdy new file mode 100644 index 00000000000..402c9daa644 --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/examples/reledmac.xdy @@ -0,0 +1,58 @@ +;;;;;;;;;;;;;;;; +;; This file provides an example of xindy configuration file to use with eledmac. +;; To complete the eledmac Handbook, one can read the French online article on +;; http://geekographie.maieul.net/174 +;;;;;;;;;;;;;;;; + +;;;; Mandatory lines for eledmac +;; The following lines are mandatory. +;; they let eledmac understand the references +;; in the form of: +;; pagenumber-linenumber +;; which are provided by \edtext. +(define-location-class "eledmac" + ("arabic-numbers" :sep"-" "arabic-numbers") + :hierdepth 2 +) + +;; The following lines require the file +;; eledmac-markup-attr.xdy which is automatically generated by the +;; xindy option. +;; This file defines some markup attributes that are required +;; for building the index with both footnote and xindy+hyperref options. +(require "eledmac-markup-attr.xdy") + +;; The following lines are to print +;; the line number in parenthesis +;; after the page number, with a comma between line numbers if there is more than +;; one line number. +;; +;; This setting is strongly recommended, in order to make a distinction +;; between page ranges which are marked with a dash and +;; line numbers, which are by default also marked with a dash. +;; +;; Of course, you can use your own settings + + +(markup-locref-list :open " (" :sep ", " :close ")" + :depth 1 :class "eledmac") + + + +;;;; The following lines should be uncommented if you use xindy + hyperref package +;; This group is not directly linked to eledmac, +;; but is required to have internal hyperlinking in the index +;; if you used the hyperindex=false option of hyperref. +;; Generally, this option and these lines are recommended +;; to provide the best possible compatibility between hyperref and xindy. +;; Read http://geekographie.maieul.net/172 for further explanations. +;; The first line of the first group is just to allow |emph markup in indexing, +;; and is not directly related to eledmac nor to hyperref. + +;(define-attributes ("emph")) +;(markup-locref :open "\hyperpage{" :close "}" :attr "default") +;(markup-locref :open "\textbf{\hyperpage{" :close "}}" :attr "textbf") +;(markup-locref :open "\textit{\hyperpage{" :close "}}" :attr "textit") +;(markup-locref :open "\emph{\hyperpage{" :close "}}" :attr "emph") + + diff --git a/Master/texmf-dist/doc/latex/reledmac/latexmkrc b/Master/texmf-dist/doc/latex/reledmac/latexmkrc new file mode 100644 index 00000000000..c734d8b7606 --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/latexmkrc @@ -0,0 +1,2 @@ +$pdflatex = "xelatex --shell-escape %S"; +$pdf_mode = "1";
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/reledmac/migration.pdf b/Master/texmf-dist/doc/latex/reledmac/migration.pdf Binary files differnew file mode 100644 index 00000000000..56700782f80 --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/migration.pdf diff --git a/Master/texmf-dist/doc/latex/reledmac/reledmac.pdf b/Master/texmf-dist/doc/latex/reledmac/reledmac.pdf Binary files differnew file mode 100644 index 00000000000..5354e549cea --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/reledmac.pdf diff --git a/Master/texmf-dist/doc/latex/reledmac/reledpar.pdf b/Master/texmf-dist/doc/latex/reledmac/reledpar.pdf Binary files differnew file mode 100644 index 00000000000..f32a9183c30 --- /dev/null +++ b/Master/texmf-dist/doc/latex/reledmac/reledpar.pdf diff --git a/Master/texmf-dist/source/latex/reledmac/migration.dtx b/Master/texmf-dist/source/latex/reledmac/migration.dtx new file mode 100644 index 00000000000..7d26165e23c --- /dev/null +++ b/Master/texmf-dist/source/latex/reledmac/migration.dtx @@ -0,0 +1,124 @@ +% \iffalse meta-comment +% +% reledmac.dtx +% Author: Peter Wilson (Herries Press) herries dot press at earthlink dot net +% Maintainer:Maïeul Rouquette maieul at maieul dot net +% Copyright 2003 -- 2005 Peter R. Wilson / 2011-.. Maïeul Rouquette +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either +% version 1.3 of this license or (at your option) any +% later version. +% The latest version of the license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of +% LaTeX version 2003/06/01 or later. +% +% This work has the LPPL maintenance status "maintained". +% +% This work consists of the files listed in the README file. +% +% +%<*driver> +\documentclass[twoside]{ltxdoc} +\usepackage{url} +\usepackage{xr-hyper} + \usepackage[draft=false, + plainpages=false, + pdfpagelabels, + bookmarksnumbered, +% hyperindex=true + hyperindex=false + ]{hyperref} +\usepackage[mono=false]{libertine} +\usepackage{reledmac} +\usepackage[english]{babel} +\usepackage{xspace} +\usepackage{graphicx,metalogo} +\renewcommand{\MakeUppercase}[1]{#1} +\pagestyle{headings} +\setcounter{StandardModuleDepth}{1} +\usepackage{longtable} + \newcommand{\Lpack}[1]{\textsf{#1}} + \newcommand{\Lclass}[1]{\textsf{#1}} + \newcommand{\file}[1]{\texttt{#1}} + \newcommand{\edmac}{\Lpack{edmac}\xspace} + \newcommand{\tabmac}{\Lpack{tabmac}\xspace} + \newcommand{\edstanza}{\Lpack{edstanza}\xspace} + + \newcommand{\ledmac}{\Lpack{ledmac}\xspace} + \newcommand{\Ledmac}{\Lpack{Ledmac}\xspace} + \newcommand{\ledpar}{\Lpack{ledpar}\xspace} + \newcommand{\Ledpar}{\Lpack{Ledpar}\xspace} + + + \newcommand{\eledmac}{\Lpack{eledmac}\xspace} + \newcommand{\Eledmac}{\Lpack{Eledmac}\xspace} + \newcommand{\eledpar}{\Lpack{eledpar}\xspace} + \newcommand{\Eledpar}{\Lpack{Eledpar}\xspace} + + \newcommand{\reledmac}{\Lpack{reledmac}\xspace} + \newcommand{\Reledmac}{\Lpack{Reledmac}\xspace} + \newcommand{\reledpar}{\Lpack{reledpar}\xspace} + \newcommand{\Reledpar}{\Lpack{Reledpar}\xspace} + + \let\macpackage\reledmac + \let\parpackage\reledpar + \let\Macpackage\reledmac + \let\Parpackage\reledpar + +\externaldocument[reledmac-]{reledmac} +\externaldocument[reledpar-]{reledpar} +\begin{document} + \raggedbottom + \DocInput{migration.dtx} +\end{document} +%</driver> +% +% \fi +% +% \newcommand{\egstart}{% +% \par +% \begingroup +% \centering +% \begin{minipage}{0.45\textwidth}} +% \newcommand{\egmid}{% +% \end{minipage}\hfill\begin{minipage}{0.45\textwidth}} +% \newcommand{\egend}{% +% \end{minipage}\par\endgroup} +% + +% \title{\Macpackage and \parpackage \\ +% Migration's process} +% +% \author{% +% Ma\"ieul Rouquette} +% +% \date{} +% +% +% \maketitle +% +% +% \begin{abstract} +% +% This file contains the description of migration's process from one version of \macpackage to an other version. +% +% If no description about migration from one version to an other is written, that means user has nothing to do to migrate. +% \end{abstract} +% +% \renewcommand{\numberline}[1]{#1~} +% \tableofcontents +% +% +% +% +% +% +% +% \section{For \macpackage} +% \newcommand{\reff}[1]{\ref{reledmac-#1} p.~\pageref{reledmac-#1}} +% \input{doc-include/migrate-mac.dtx} +% \renewcommand{\reff}[1]{\ref{reledpar-#1} p.~\pageref{reledpar-#1}} +% \section{For \parpackage} +% \input{doc-include/migrate-par.dtx} diff --git a/Master/texmf-dist/source/latex/reledmac/reledmac.dtx b/Master/texmf-dist/source/latex/reledmac/reledmac.dtx new file mode 100644 index 00000000000..a505563df99 --- /dev/null +++ b/Master/texmf-dist/source/latex/reledmac/reledmac.dtx @@ -0,0 +1,16360 @@ +% \iffalse meta-comment +% +% reledmac.dtx +% Author: Peter Wilson (Herries Press) herries dot press at earthlink dot net +% Maintainer:Maïeul Rouquette maieul at maieul dot net +% Copyright 2003 -- 2005 Peter R. Wilson / 2011-.. Maïeul Rouquette +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either +% version 1.3 of this license or (at your option) any +% later version. +% The latest version of the license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of +% LaTeX version 2003/06/01 or later. +% +% This work has the LPPL maintenance status "maintained". +% +% This work consists of the files listed in the README file. +% +% +%<*driver> +\documentclass[twoside]{ltxdoc} +\usepackage{url} + \usepackage[draft=false, + plainpages=false, + pdfpagelabels, + bookmarksnumbered, +% hyperindex=true + hyperindex=false + ]{hyperref} +\usepackage[mono=false]{libertine} +\usepackage[series={A,B},noend,noeledsec,nofamiliar]{reledmac} +\usepackage[english]{babel} +\usepackage{xspace} +\usepackage{graphicx,metalogo} +% Index and Changelog in one column +\makeatletter + \renewenvironment{theglossary}{% + \@restonecoltrue\if@twocolumn\@restonecolfalse\fi + \columnseprule \z@ \columnsep 35\p@ + \glossary@prologue% + \GlossaryParms \let\item\@idxitem \ignorespaces} + {\if@restonecol\onecolumn\else\clearpage\fi} + \def\theindex{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi + \columnseprule \z@ \columnsep 35\p@ + \index@prologue% + \IndexParms \let\item\@idxitem \ignorespaces} + \def\endtheindex{\if@restonecol\onecolumn\else\clearpage\fi} + \@mparswitchfalse +\makeatother +\EnableCrossrefs +\RecordChanges +\CodelineIndex +%%\OnlyDescription +\renewcommand{\MakeUppercase}[1]{#1} +\pagestyle{headings} +\setcounter{StandardModuleDepth}{1} +\usepackage{longtable} +\begin{document} + \raggedbottom + \DocInput{reledmac.dtx} +\end{document} +%</driver> +% +% \fi +% +% \newcommand{\reff}[1]{\ref{#1} p.~\pageref{#1}} +% \CheckSum{11656} +% +% \makeatletter +% \newcommand*{\DescribeIt}{\leavevmode\@bsphack\begingroup\MakePrivateLetters +% \Describe@It} +% \newcommand*{\Describe@It}[1]{\endgroup +% \marginpar{\raggedleft\PrintDescribeEnv{#1}}% +% \SpecialItIndex{#1}\@esphack\ignorespaces} +% \newcommand*{\SpecialItIndex}[1]{\@bsphack +% \index{#1\actualchar{\protect\ttfamily#1}\encapchar usage}\@esphack} +% +% \DoNotIndex{\@,\@@par,\@beginparpenalty,\@empty} +% \DoNotIndex{\@flushglue,\@input} +% \DoNotIndex{\@makefnmark,\@makeother,\@maketitle} +% \DoNotIndex{\@namedef,\@ne,\@spaces,\@tempa} +% \DoNotIndex{\@tempb,\@tempswafalse,\@tempswatrue} +% \DoNotIndex{\@thanks,\@thefnmark,\@topnum} +% \DoNotIndex{\@@,\@elt,\@forloop,\@fortmp,\@gtempa,\@totalleftmargin} +% \DoNotIndex{\",\/,\@ifundefined,\@nil,\@verbatim,\@vobeyspaces} +% \DoNotIndex{\|,\~,\ ,\active,\advance,\aftergroup,\begingroup,\bgroup} +% \DoNotIndex{\mathcal,\csname,\def,\documentstyle,\dospecials,\edef} +% \DoNotIndex{\egroup} +% \DoNotIndex{\else,\endcsname,\endgroup,\endinput,\endtrivlist} +% \DoNotIndex{\expandafter,\fi,\fnsymbol,\futurelet,\gdef,\global} +% \DoNotIndex{\hbox,\hss,\if,\if@inlabel,\if@tempswa,\if@twocolumn} +% \DoNotIndex{\ifcase} +% \DoNotIndex{\ifcat,\iffalse,\ifx,\ignorespaces,\index,\input,\item} +% \DoNotIndex{\jobname,\kern,\leavevmode,\leftskip,\let,\llap,\lower} +% \DoNotIndex{\m@ne,\next,\newpage,\nobreak,\noexpand,\nonfrenchspacing} +% \DoNotIndex{\obeylines,\or,\protect,\raggedleft,\rightskip,\rm,\sc} +% \DoNotIndex{\setbox,\setcounter,\small,\space,\string,\strut} +% \DoNotIndex{\strutbox} +% \DoNotIndex{\thefootnote,\thispagestyle,\topmargin,\trivlist,\tt} +% \DoNotIndex{\twocolumn,\typeout,\vss,\vtop,\xdef,\z@} +% \DoNotIndex{\,,\@bsphack,\@esphack,\@noligs,\@vobeyspaces,\@xverbatim} +% \DoNotIndex{\`,\catcode,\end,\escapechar,\frenchspacing,\glossary} +% \DoNotIndex{\hangindent,\hfil,\hfill,\hskip,\hspace,\ht,\it,\langle} +% \DoNotIndex{\leaders,\long,\makelabel,\marginpar,\markboth,\mathcode} +% \DoNotIndex{\mathsurround,\mbox,\newcount,\newdimen,\newskip} +% \DoNotIndex{\nopagebreak} +% \DoNotIndex{\parfillskip,\parindent,\parskip,\penalty,\raise,\rangle} +% \DoNotIndex{\section,\setlength,\TeX,\topsep,\underline,\unskip,\verb} +% \DoNotIndex{\vskip,\vspace,\widetilde,\\,\%,\@date,\@defpar} +% \DoNotIndex{\[,\{,\},\]} +% \DoNotIndex{\count@,\ifnum,\loop,\today,\uppercase,\uccode} +% \DoNotIndex{\baselineskip,\begin,\tw@} +% \DoNotIndex{\a,\b,\c,\d,\e,\f,\g,\h,\i,\j,\k,\l,\m,\n,\o,\p,\q} +% \DoNotIndex{\r,\s,\t,\u,\v,\w,\x,\y,\z,\A,\B,\C,\D,\E,\F,\G,\H} +% \DoNotIndex{\I,\J,\K,\L,\M,\N,\O,\P,\Q,\R,\S,\T,\U,\V,\W,\X,\Y,\Z} +% \DoNotIndex{\1,\2,\3,\4,\5,\6,\7,\8,\9,\0} +% \DoNotIndex{\!,\#,\$,\&,\',\(,\),\+,\.,\:,\;,\<,\=,\>,\?,\_} +% \DoNotIndex{\discretionary,\immediate,\makeatletter,\makeatother} +% \DoNotIndex{\meaning,\newenvironment,\par,\relax,\renewenvironment} +% \DoNotIndex{\repeat,\scriptsize,\selectfont,\the,\undefined} +% \DoNotIndex{\arabic,\do,\makeindex,\null,\number,\show,\write,\@ehc} +% \DoNotIndex{\@author,\@ehc,\@ifstar,\@sanitize,\@title,\everypar} +% \DoNotIndex{\if@minipage,\if@restonecol,\ifeof,\ifmmode} +% \DoNotIndex{\lccode,\newtoks,\onecolumn,\openin,\p@,\SelfDocumenting} +% \DoNotIndex{\settowidth,\@resetonecoltrue,\@resetonecolfalse,\bf} +% \DoNotIndex{\clearpage,\closein,\lowercase,\@inlabelfalse} +% \DoNotIndex{\selectfont,\mathcode,\newmathalphabet,\rmdefault} +% \DoNotIndex{\bfdefault} +% \DoNotIndex{\newcommand,\renewcommand,\providecommand} +% \DoNotIndex{\ ,\to,\hsize,\multiply,\textit} +% +% \newcommand{\dtxfilename}{\texttt{reledmac.dtx}} +% \GetFileInfo{reledmac.sty} +% ^^A To put the changes in the right order : see http://tex.stackexchange.com/a/74113/7712 +%\makeatletter +% \let\org@changes@\changes@ +% \def\my@changes v#1.#2.#3\@nil{% +% \org@changes@{v#1.\six@digits{#2}.#3=v#1.#2.#3}% +% }% +% \newcommand*{\six@digits}[1]{% +% \ifnum#1<100000 0\fi +% \ifnum#1<10000 0\fi +% \ifnum#1<1000 0\fi +% \ifnum#1<100 0\fi +% \two@digits{#1}% +% }% +% \renewcommand*{\changes@}[1]{% +% \my@changes#1.\@nil +% }% +%\makeatother +% \newcommand{\Lpack}[1]{\textsf{#1}} +% \newcommand{\Lclass}[1]{\textsf{#1}} +% \newcommand{\file}[1]{\texttt{#1}} +% \newcommand{\edmac}{\Lpack{edmac}\xspace} +% \newcommand{\tabmac}{\Lpack{tabmac}\xspace} +% \newcommand{\edstanza}{\Lpack{edstanza}\xspace} + +% \newcommand{\ledmac}{\Lpack{ledmac}\xspace} +% \newcommand{\Ledmac}{\Lpack{Ledmac}\xspace} +% \newcommand{\ledpar}{\Lpack{ledpar}\xspace} +% \newcommand{\Ledpar}{\Lpack{Ledpar}\xspace} + + +% \newcommand{\eledmac}{\Lpack{eledmac}\xspace} +% \newcommand{\Eledmac}{\Lpack{Eledmac}\xspace} +% \newcommand{\eledpar}{\Lpack{eledpar}\xspace} +% \newcommand{\Eledpar}{\Lpack{Eledpar}\xspace} + +% \newcommand{\reledmac}{\Lpack{reledmac}\xspace} +% \newcommand{\Reledmac}{\Lpack{Reledmac}\xspace} +% \newcommand{\reledpar}{\Lpack{reledpar}\xspace} +% \newcommand{\Reledpar}{\Lpack{Reledpar}\xspace} + +% \let\macpackage\reledmac +% \let\parpackage\reledpar +% \let\Macpackage\reledmac +% \let\Parpackage\reledpar +% \newcommand{\texbook}{\textit{TeXbook}} +% \newcommand{\thetexbook}{\textit{The TeXbook}} +% +% \newcommand{\egstart}{% +% \par +% \begingroup +% \centering +% \begin{minipage}{0.45\textwidth}} +% \newcommand{\egmid}{% +% \end{minipage}\hfill\begin{minipage}{0.45\textwidth}} +% \newcommand{\egend}{% +% \end{minipage}\par\endgroup} +% \changes{v0.1.0}{2003/03/25}{First public release} +% \changes{v0.2.0}{2003/08/16}{Added tabmac code, and extended indexing} +% \changes{v0.2.1}{2003/09/13}{Bug fixes and match with mempatch v1.8} +% \changes{v0.2.2}{2003/11/09}{Improved paragraph footnotes} +% \changes{v0.2.2}{2003/11/09}{New Dekker example} +% \changes{v0.3.0}{2004/02/14}{Includes edstanza and more} +% \changes{v0.3.1}{2004/02/18}{Not released. Added remarks about the parallel package} +% \changes{v0.4.0}{2004/02/29}{Added minipage, etc., support} +% \changes{v0.4.1}{2004/03/28}{Not released. Minor editorial improvements and code tweaks} +% \changes{v0.5.0}{2004/04/04}{Added sidenotes, familiar footnotes in numbered text} +% \changes{v0.5.1}{2004/04/10}{Fixed right line numbers killed in v0.5} +% \changes{v0.6.0}{2004/11/16}{Fixed long paragraphs looping} +% \changes{v0.6.0}{2004/11/16}{Prepared for eledpar package} +% \changes{v0.6.0}{2004/12/10}{Fixed minor typos} +% \changes{v0.7.0}{2005/02/18}{Tidying up for eledpar and ledarab packages} +% \changes{v0.7.0}{2005/02/18}{Replaced all \cs{interAfootnotelinepenalty}, etc., +% by just \cs{interfootnotelinepenalty}} +% \changes{v0.7.0}{2005/03/02}{eledmac having been available for 2 years, +% deleted the commented out original edmac texts} +% \changes{v0.7.0}{2011/06/17}{Ma\"ieul Rouquette new maintainer} +% \changes{v0.8.0}{2011/17/06}{Bug on endnotes fixed: in a // text, all endnotes will print and be placed at the ends of columns (!)} +% \changes{v0.8.1}{2011/07/14}{Bug on \cs{edtext} ; \cs{critex} ; \cs{lemma} fixed: we can now us non-switching commands} +% \changes{v0.9.0}{2011/08/03}{No more ledpatch. All patches are now in the main file.} +% \changes{v0.9.1}{2011/08/08}{Fix some bugs linked to integrating ledpatch on the main file.} +% \changes{v0.10.0}{2011/08/22}{Corrections to \cs{section} and other titles in numbered sections} +% \changes{v0.11.0}{2011/09/16}{Makes it possible to add a symbol on each verse's hanging, as in French typography. Redefines the command \cs{hangingsymbol} to define the character.} +% \changes{v0.12.0}{2011/10/01}{Possibility to number the pstart with the commands \cs{numberpstarttrue}.} +% \changes{v0.12.0}{2011/10/01}{For compatibility with eledpar, possibility to use \cs{autopar} on the right side.} +% \changes{v0.12.1}{2011/10/02}{The numbering of \cs{pstarts} restarts on each \cs{beginnumbering}.} +% \changes{v0.12.1}{2011/10/02}{Don't number \cs{pstarts} of stanza.} +% \changes{v0.13.0}{2011/11/08}{New stanzaindentsrepetition counter: to repeat stanza indents every \emph{n} verses.} +% \changes{v0.13.1}{2011/11/18}{\cs{thepstartL} and \cs{thepstartR} use now \cs{bfseries} and not \cs{bf}, which is deprecated and makes conflicts with memoir class.} +% \changes{v0.14.0}{2012/04/04}{Tweaked \cs{edlabel} to get correct line number if the command is first element of a paragraph.} +% \changes{v1.0.0}{2012/09/15}{Some compatibility break with eledmac. Change of name: eledmac.} +% \changes{v1.1.0}{2012/09/25}{New package option: parapparatus.} +% \changes{v1.4.0}{2012/11/16}{Compatibility with LuaTeX of RTL notes.} +% \changes{v1.4.2}{2012/12/12}{Debug with some special classes.} +% \changes{v1.4.3}{2012/12/18}{Spurious space after familiar footnotes.} +% \changes{v1.4.4}{2013/02/18}{Label inside familiar footnotes.} +% \changes{v1.4.5}{2013/03/02}{Bug with komasscript + eledpar + chapter.} +% \changes{v1.4.6}{2013/04/15}{Bug with memoir class introduced by 1.4.5.} +% \changes{v1.4.8}{2013/07/02}{Corrects a bug with parallel texts introduced by 1.1.} +% \changes{v1.6.1}{2013/10/27}{Corrects a false hanging verse when a verse is exactly the length of a line.} +% \changes{v1.4.0}{2012/11/16}{Compatibility with LuaTeX of RTL notes.} +% \changes{v1.8.0}{2013/12/13}{Compatibility with parledgroup option of eledpar package.} +% \changes{v1.8.2}{2014/01/31}{Debug compatibility problem with hebrew option of babel package.} +% \changes{v1.8.3}{2014/02/03}{Fixes spurious spaces added by v1.7.0.} +% \changes{v1.10.0}{2014/02/27}{Add \cs{pstartref} and \cs{xpstartref} to refer to a pstart number (extension of \cs{edlabel}).} +% \changes{v1.10.1}{2014/02/28}{Compatibility with \textsf{cleveref}.} +% \changes{v1.10.2}{2014/03/17}{Compatibility of stanza with v1.8a of babel-greek.} +% \changes{v1.10.3}{2014/04/07}{Debug of cross-referencing.} +% \changes{v1.10.4}{2014/04/09}{Debug of critical notes in edtabular environnment.} +% \changes{v1.10.5}{2014/04/14}{Debug of \cs{xxref}.} +% \changes{v1.10.5}{2014/04/14}{Debug of \cs{pausenumbering}.} +% \changes{v1.10.6}{2014/05/01}{Debug of interaction between \cs{autopar} and\cs{pausenumbering}.} +% \changes{v1.11.1}{2014/05/29}{Correct a bug when a critical note starts with plus or minus.} +% \changes{v1.12.0}{2014/08/05}{Compatibility with \Lpack{musixtex}.} +% \changes{v1.12.0}{2014/08/05}{Debug eledmac sectioning command after using \cs{resumenumbering}.} +% \changes{v1.12.3}{2014/08/15}{Underline lemma in \cs{eledxxx} when using draft mode.} +% \changes{v1.12.3}{2014/08/15}{Correct bug with side and familiar notes in tabular environments.} +% \changes{v1.12.3}{2014/08/15}{Debug left and right notes (bugs added by 1.12.0)} +% \changes{v1.12.3}{2014/08/15}{Debug \cs{eledxxx} with some paper size} +% \changes{v1.12.4}{2014/08/25}{Debug spurious page breaks before \cs{chapter} (bug added in 1.12.0)} +% \changes{v1.13.1}{2014/09/25}{Debug quotation environment inside of a \cs{pstart} preceded by a sectioning command.} +% \changes{v1.13.1}{2014/09/25}{Coming back of page and line breaking penalties's management, deleted by error in v0.17.} +% \changes{v1.13.2}{2014/09/30}{Fix bug with normal footnotes, added by v1.13.0.} +% \changes{v1.13.3}{2014/10/04}{Fix extra spaces with paragraphed footnotes, added by v1.13.0.} +% \changes{v1.13.4}{2014/10/20}{Fix bug with index when memoir class is used without hyperref} +% \changes{v1.15.0}{2015/01/12}{Fix bug with footnotes layout when using some options of the geometry package (bug add by v1.13.0).} +% \changes{v1.16.0}{2015/01/23}{Compatibility of standard footnotes with some biblatex styles.} +% \changes{v1.16.0}{2015/01/23}{New \cs{stanzaindent} command.} +% \changes{v1.18.0}{2015/02/23}{Compatibility with \LuaLaTeX\ RTL languages.} +% \changes{v1.19.0}{2015/03/06}{\cs{Xmaxhnotes} and \cs{maxhnotesX} work now for both two-columns and three-columns setting.} +% \changes{v1.19.0}{2015/03/06}{Compatibility with \Lpack{eledpar} v.1.13.0.} +% \changes{v1.19.1}{2015/03/12}{Call \cs{correct@footinsX@box} and \cs{correct@Xfootins@box} directly in \cs{print@notesX@forpages} and \cs{print@Xnotes@forpages}, that is in \Lpack{eledpar}.} +% \changes{v1.20.0}{2015/03/22}{Correct \cs{Xinplaceofnumber} hook.} +% \changes{v1.20.0}{2015/03/22}{Add series option.} +% \changes{v1.20.0}{2015/03/22}{Fix issues with RTL text in notes when using \LuaLaTeX.} +% \changes{v1.20.0}{2015/03/22}{The \cs{newif}s are not followed by boolean values set to false, because it is the \TeX\ default setting.} +% \changes{v1.20.0}{2015/03/22}{Explicit error message when calling \cs{Xfootnote} outside of \cs{edtext}.} +% \changes{v1.20.0}{2015/03/22}{Fix bug with line number typesetting direction when using \cs{eledsection} and similar commands for RTL texts with \LuaLaTeX.} +% \changes{v1.21.0}{2015/04/13}{\cs{AtEveryPstart} and \cs{AtEveryPend} are now compatible with \cs{autopar}} +% \changes{v1.21.0}{2015/04/13}{Fix bug with space between columns with notes in two columns (bug added in v1.13.0).} +% \changes{v1.21.0}{2015/04/13}{Add nocritical, noend, nofamiliar and noledgroup options.} +% \changes{v1.21.0}{2015/04/13}{Fix bug with \cs{maxhnotesX} when using \cs{foottwocolX} or \cs{footthreecolX}.} +% \changes{v1.21.0}{2015/04/13}{Add \cs{Xtwolinesbutnotmore} and \cs{Xtwolinesonlyinsamepage}.} +% \changes{v1.21.0}{2015/04/13}{Fix bug when a \cs{Xfootnote} follows a \cs{Xendnote} in the second argument of \cs{edtext} (bug added in eledmac 1.0.0 !).} +% \changes{v1.21.0}{2015/04/13}{Add noeledsec package option} +% \changes{v1.21.0}{2015/04/13}{parapparatus option works now with familiar footnotes.} +% \changes{v1.21.0}{2015/04/13}{Add \cs{beforenotesX} and \cs{Xbeforenotes} features for notes set in two and three column.} +% \changes{v1.21.0}{2015/04/13}{Debug \cs{beforenotesX} \cs{maxhnotesX} \cs{noteswidthliketwocolumnsX} and \cs{afterruleX} with footnotes set in two and three columns.} +% \changes{v1.21.0}{2015/04/13}{\cs{Xafterrule} and \cs{afterruleX} features no longer create problems of overflowing at the bottom of the page.} +% \changes{v1.21.0}{2015/04/13}{\cs{preXnotes} and \cs{prenotesX} features no longer create problems of overflowing at the bottom of the page.} +% \changes{v1.21.0}{2015/04/13}{Fix spurious space after first page number in \cs{doendnotes}. oldprintnpnumspace option allows to come back to previous setting} +% \changes{v1.21.0}{2015/04/13}{\cs{chapter} inside optional argument of \cs{pstart} works when typesetting parallel pages} +% \changes{v1.22.0}{2015/04/25}{When using hyperref package, internal links in index or with \cs{edlineref} are now targeted to the top and not longer to the bottom of the lines they refer to.} +% \changes{v1.22.0}{2015/04/25}{Provides support for xindy.} +% \changes{v1.22.0}{2015/04/25}{Adds hyperlink for references to notes in indices.} +% \changes{v1.22.0}{2015/04/25}{Fix conflict between noend package option and edtabularx environments} +% \changes{v1.22.1}{2015/04/29}{Fix bug (added on v1.22.0) with \cs{Xinplaceofnumber} hook.} +% \changes{v1.23.0}{2015/05/18}{Compatibility between nofamiliar/nocriticals option and minipage/ledgroup.} +% \changes{v1.23.0}{2015/05/18}{Fix error of \cs{iftrue} not closed.} +% \changes{v1.23.0}{2015/05/18}{Allow use of \cs{sameword} with inputenc managing of UTF-8.} +% \changes{v1.23.0}{2015/05/18}{Error message when using \cs{beginnumbering}…\cs{endnumbering} without \cs{pstart}.} +% \changes{v1.23.0}{2015/05/18}{New tools to ensure the line-list file uses the right version of commands when upgrading the eledmac version.} +% \changes{v1.23.0}{2015/05/18}{Fix bug with \cs{skipnumbering} called immediately after a \cs{pstart}.} +% \changes{v1.23.0}{2015/05/18}{Fix spurious space with \cs{skipnumbering} (bug added on v1.21.0).} +% \changes{v1.23.1}{2015/05/20}{Fix bug with \cs{lemma} command in the right side.} +% \changes{v1.23.2}{2015/05/29}{Compatibility with \LaTeX's release 2015.} +% \changes{v1.24.0}{2015/06/02}{We can reinitialize \cs{AtEveryPstart} and \cs{AtEveryPend} providing to it an empty argument.} +% \changes{v1.24.1}{2015/06/21}{\cs{lemma} is disabled when using `nocritical` option.} +% \changes{v1.24.2}{2015/06/26}{Fix incompatibility between `nofamiliar` option and `memoir` package.} +% \changes{v1.24.3}{2015/07/07}{Restore marginal numbers and notes with sectioning command (bug introduced in v1.21.0)} +% \changes{v1.24.4}{2015/07/19}{Fix spurious space with \cs{edindex} when using xindy+hyperref option.} +% \changes{v1.24.5}{2015/07/16}{Fix bug of indent, when a added in 1.1.0, when a \cs{beginnumbering} immediately follow a sectioning command.} +% \changes{v2.0.0}{2015/07/19}{Package's name becomes \reledmac.} +% \changes{v2.0.0}{2015/07/19}{In order to have a more consistent name's convention, many names has been changed.} +% \changes{v2.0.0}{2015/07/19}{Many \LaTeX's output macros are now patched and not override.} +% \changes{v2.0.0}{2015/07/19}{Add nonum option for endnotes.} +% \changes{v2.0.0}{2015/07/19}{Add \cs{Xendinplaceofnumber} hook.} +% \changes{v2.0.0}{2015/07/19}{Add \cs{Xendnonumber} hook.} +% \changes{v2.0.0}{2015/07/19}{Fix bug when printing only one series of endnotes, but wanted to keep endnotes for other series.} +% \hyphenation{man-u-script man-u-scripts} +% +% +% +% \title{\Macpackage \\ +% Typeset scholarly editions with \LaTeX\thanks{This file (\dtxfilename) +% has version number \fileversion, last revised \filedate.}} +% +% \author{% +% Ma\"ieul Rouquette\thanks{\texttt{maieul at maieul dot net}} \\ +% {\small based on the original \Lpack{ledmac} by} \\ +% Peter Wilson \\ +% Herries Press \\ +% {\small which was based on the original \edmac, \tabmac{} and \edstanza{} by} \\ +% John Lavagnino, Dominik Wujastyk, Herbert Breger and Wayne Sullivan. +% } +% +% \date{} +% +% \iffalse This is a METACOMMENT +% This METACOMMENT is part of the original EDMAC +% Everything up to the next `\ fi' (without a blank) will +% be ignored. This is necessary because `%' may no longer +% be a comment mark when this file is read in. +% +% The original EDMAC was written by: +% \author{John Lavagnino\thanks{% +% Department of English and American Literature, +% Brandeis University, +% 415 South Street, +% Waltham, MA 02254--9110, USA. +% Internet: {\tt lav@binah.cc.brandeis.edu}, +% Bitnet: {\tt lav@brandeis}.} +% \and Dominik Wujastyk\thanks{% +% Wellcome Institute for the History of Medicine, +% 183 Euston Road, +% London NW1 2BE, UK. +% Internet: {\tt D.Wujastyk@ucl.ac.uk}, +% Bitnet: {\tt dow@harvunxw}.}} +% \date{} +% +% +% Macro file `EDMAC' for use with Plain TeX. +% Copyright (C) 1990, 1991, 1992, 1993, 1994 John Lavagnino and Dominik +% Wujastyk, all rights reserved. +% +% Copying of this file is authorized only if either +% (1) you make absolutely no changes to your copy, including name, or +% (2) if you do make changes, you name it something other than +% edmac.tex or edmac.doc +% This restriction helps to ensure that the macro development is orderly. +% +% \fi +% +% \maketitle +% +% +% \begin{abstract} +% +% The \macpackage provides many tool in order to typesset scholarly edition. +% It is base on the \eledmac package, which was was based on \ledmac package, which was based on \edmac \TeX\ package. +% +% It can be use in combination with \parpackage in order to typeset two texts in parallel, like an original text and its translation in modern language. +% +% +% \Macpackage provides many tools and options. Normally, they are all documented in this file. +% Also provided is a help folder, ``\href{examples/.}{examples}''. The folder contains additional examples (although not for all cases). +% Example starting by ``1-'' are for basic uses, those starting by ``2-'' are for advanced uses. +% +% To report bugs or request a new feature, please go to ledmac GitHub page and click on ``New Issue'': \url{https://github.com/maieul/ledmac/issues/}. You must create an account on github.com to access my page (maieul/ledmac). GitHub accounts are free for open-source users. You can post messages in English or in French (preferred). +% +% You can subscribe to the \macpackage mail list in:\\ \url{http://geekographie.maieul.net/146} +% \end{abstract} +% +% \renewcommand{\numberline}[1]{#1~} +% \tableofcontents +% +% +% +% +% +% +% +% \section{Introduction} +% +% \subsection{Aim of the package} +% +% The \Eledmac{} package, together with LaTeX, provides several +% important facilities for formatting critical editions of texts in +% a traditional manner. Major features include: +% \begin{itemize} +% \item automatic stepped line numbering, by page, section or paragraph; +% \item sub-lineation within the main series of line numbers; +% \item variant readings automatically keyed to line numbers; +% \item caters for both prose and verse; +% \item multiple series of the footnotes and endnotes; +% \item block or columnar formatting of the footnotes; +% \item simple tabular material may be line numbered; +% \item indexing keyed to page and line numbers. +% \end{itemize} +% +% +% \Eledmac{} allows the scholar engaged in preparing a critical +% edition to focus attention wholly on the task of creating the +% critical text and evaluating the variant readings, text-critical +% notes and testimonia. \LaTeX{} and \Eledmac{} will take care of +% the formatting and visual correlation of all the disparate types +% of information. +% +% +% Apart from \macpackage there are some other \LaTeX\ packages for +% critical edition typesetting. +% However, the am of \macpackage is to provide a ``all in one'' and flexible tool in the field of critical edition. +% +% Any suggestion for new features are welcome. +% +% +% This manual contains a general description of how to use \macpackage and +% the complete source code for the package, +% with extensive documentation (in sections~\ref{overview} and following, numbered in Roman numeric) +% It finish by a list of action to do when migrating from some version to other, a historical of the change and an index to the +% source code. + +% We do not suggest that you need to +% read the source code for this package in order to use it; we +% provide this code primarily for reference, and many of our +% comments on it repeat material that is also found in +% the earlier sections. +% +% But no documentation, however +% thorough, can cover every question that comes up, and many can be +% answered quickly by consultation of the code. On a first reading, +% we suggest that you should read only the general documentation in +% sections~\ref{howto}, unless you are particularly interested in the innards of \macpackage. +% +% \subsection{History} +% +% \subsubsection{\edmac} +% +% The original version of \edmac{} was \texttt{TEXTED.TEX}, written +% by John Lavagnino\index{Lavagnino, John} +% in late 1987 and early 1988 for formatting +% critical editions of English plays. +% +% John passed these macros on to Dominik Wujastyk\index{Wujastyk, Dominik} +% who, in +% September--October 1988, added the footnote paragraphing mechanism, +% margin swapping and other changes to suit his own purposes, making the +% style more like that traditionally used for classical texts in Latin and +% Greek (e.g., the Oxford Classical Texts series). He also wrote some +% extra documentation and sent the files out to several people. This +% version of the macros was the first to be called \edmac. +% +% The present version was developed in the summer of 1990, with the +% intent of adding necessary features, streamlining and documenting +% the code, and further generalizing it to make it easily adaptable +% to the needs of editors in different disciplines. John did most +% of the general reworking and documentation, with the financial +% assistance of the Division of the Humanities and Social Sciences, +% California Institute of Technology. Dominik adapted the code to +% the conventions of Frank Mittelbach's\index{Mittelbach, Frank} +% \verb"doc" option, and added some documentation, multiple-column +% footnotes, cross-references, and crop marks.\footnote{This version of +% the macros was used to format the Sanskrit text in volume I of {\em +% Metarules of P\=a\d ninian Grammar\/} by Dominik Wujastyk (Groningen: +% Forsten, 1993).} A description by John and Dominik of this version of +% \edmac{} was published as `An overview of \edmac: a \PlainTeX\ +% format for critical editions', \emph{TUGboat} \textit{11} (1990), +% pp.\,623--643. +% +% From 1991 through 1994, the macros continued +% to evolve, and were tested at a +% number of sites. We are very grateful to all the members of the +% (now defunct) +% \verb"edmac@mailbase.ac.uk" discussion group who helped us with +% smoothing out bugs and infelicities in the macros. +% Ron Whitney\index{Whitney, Ron} and our anonymous reviewer at +% the TUG were both of great help in ironing out last-minute +% wrinkles, while Ron made some important suggestions which may help +% to make future versions of \edmac{} even more efficient. +% Wayne +% Sullivan,\index{Sullivan, Wayne} in particular, provided several +% important fixes and contributions, including adapting the +% Mittelbach\slash +% Sch\"opf\index{Sch\"opf, Rainer}\index{Mittelbach, Frank} `New +% Font Selection Scheme' for use with \PlainTeX\ and \edmac. +% Another project Wayne has worked +% on is a \verb"DVI" post-processor which works with an \edmac{} +% that has been slightly modified to output \cs{special}s. This +% combination enables you to recover to some extent the text of +% each line, as {\sc ascii} code, facilitating the creation of +% concordances, an {\em index verborum}, etc. +% +% At the time of writing (1994), we are pleased to be able to say that \edmac{} is +% being used for real-life book production of several interesting +% editions, such as the Latin texts of Euclid's {\sl +% Elements},\footnote{Gerhard Brey\index{Brey, Gerhard} used \edmac{} in +% the production of Hubert L. L. Busard\index{Busard, Hubert L. L.} and +% Menso Folkerts,\index{Folkerts, Menso} {\em Robert of Chester's +% (?)\index{Chester, Robert of} Redaction of Euclid's\index{Euclid} {\em +% Elements}, the so-called Adelard II\index{Adelard II} Version}, 2 vols., +% (Basel, Boston, Berlin: Birkh\"auser, 1992).} an edition of the letters +% of Nicolaus Copernicus,\footnote{Being prepared at the German Copernicus +% Research Institute, Munich.}\index{Copernicus, Nicolaus} Simon +% Bredon's\index{Bredon, Simon} {\em Arithmetica},\footnote{Being prepared +% by Menso Folkerts {\em et al.}, at the Institut f\"ur Geschichte der +% Naturwissenschaften in Munich.} a Latin translation by Plato of +% Tivoli\index{Plato of Tivoli} of an Arabic astrolabe +% text,\footnote{Richard Lorch,\index{Lorch, Richard} Gerhard +% Brey\index{Brey, Gerhard} {\em et al.}, at the same Institute.} a Latin +% translation of part II of the Arabic {\em Algebra\/} by Ab\=u K\=amil +% Shuj\=a' b. Aslam,\index{Abu Kamil Shuja' b. Aslam}\footnote{Richard +% Lorch, `Ab\=u K\=amil on the Pentagon and Decagon' in {\em Vestigia +% Mathematica}, ed.\ M. Folkerts and J. P. Hogendijk (Amsterdam, Atlanta: +% Rodopi, 1993).} the Latin {\em Rithmachia\/} of Werinher von +% Tegernsee,\footnote{Menso Folkerts, `Die {\em Rithmachia\/} des Werinher +% von Tegernsee', ibid.} a middle-Dutch romance epic on the +% Crusades,\footnote{Geert H. M. Claassens,\index{Claassens, Geert H. M.} +% {\em De Middelnederlandse Kruisvaartromans}, (Amsterdam: Schiphower en +% Brinkman, 1993).} a seventeenth-century Hungarian politico-philosophical +% tract,\footnote{Emil Hargittay, {\em Cs\'aky Istv\'an: Politica +% philosophiai Okoskod\'as-szerint val\'o rendes \'eletnek p\'eld\'aja +% (1664--1674)\/} (Budapest: Argumentum Kiad\'o, 1992).} an anonymous +% Latin compilation from Hungary entitled {\em Sermones Compilati in +% Studio Gererali Quinqeecclesiensi in Regno Ungarie},\footnote{Being +% produced, as was the previous book, by Gyula Mayer\index{Mayer, Gyula} +% in Budapest.} the collected letters and papers of +% Leibniz,\index{Leibniz}\footnote{Leibniz, {\em S\"amtliche Schriften und +% Briefe}, series {\sc I, III, VII,} being edited by Dr.\ H. +% Breger\index{Breger, Herbert}, Dr. N. G\"adeke\index{G\"adeke, Nora} and +% others, +% at the Leibniz-Archiv, Nieders\"achsische Landesbibliothek, Hannover. +% (see \url{http://www.nlb-hannover.de/Leibniz})} +% Theodosius's\index{Theodosius} {\em Spherics}, the German {\em +% Algorismus} of Sacrobosco,\index{Sacrobosco} the Sanskrit text of the +% {\em K\={a}\'{s}ik\={a}\-v\d{r}tti\/} of V\={a}mana\index{Vamana} and +% Jay\={a}ditya\index{Jayaditya},\footnote{Being prepared at Poona and +% Lausanne Universities.} and the English texts of Thomas +% Middleton's\index{Middleton, Thomas} collected works. +% +% \subsubsection{\ledmac} +% +% +% +% Version 1.0 of \tabmac{} was released by +% Herbert Breger\index{Breger, Herbert} in October +% 1996. This added the capability for typesetting tabular material. +% +% Version 0.01 of \edstanza{} was released by +% Wayne Sullivan~\index{Sullivan, Wayne} +% in June 1992, to help a colleague with typesetting Irish verse. +% +% In March 2003 Peter Wilson started an attempt to port \edmac{} +% from TeX to LaTeX. The starting point was \edmac{} version 3.16 +% as documented on 19 July 1994 (available from CTAN). In August 2003 +% the \tabmac{} functions were added; the starting point for these +% being version 1.0 of Ocober 1996. The \edstanza{} (v0.01) functions were +% added in February 2004. Sidenotes and regular footnotes in numbered +% text were added in April 2004. +% +% This port was called \ledmac (\LaTeX\ \edmac). +% +% Since July~2011, ledmac is maintained by Ma\"ieul Rouquette. Is it more and more powerful and flexible, but also more and more divergent from original TeX macro. +% +% \subsubsection{\eledmac} +% Important changes were put in version 1.0, to make \ledmac more easily extensible (see \reff{displayoptions}). +% These changes can trigger small problems with the old customization. +% +% That is why a new name was selected: \eledmac (extended \ledmac). +% +% To migrate from \ledmac to \eledmac, please read Appendix \ref{migration} (p.~\pageref{migration}). +% +% \subsubsection{\reledmac} +% +% \eledmac has facilitated the creation of customized critical edition. +% However, this was made in a non systematic way in method to customize them. +% +% In other side, many deprecated commands were keept, and many technical debt was accumulated, blocking the futur evolution. +% +% For all these reasons, Maïeul Rouquette decided to make a spring cleaning. +% As some commands name were changed, the ascendant compatibility was (a little) broken. +% +% A new name was selected: \reledmac (extended renewed \eledmac). + +% To migrate from \eledmac to \reledmac, please read Appendix \ref{migration:reledmac} (p.~\pageref{migration:reledmac}). + +% \subsection{List of works edited with (r)(e)ledmac} +% A collaborative list of works edited with (r)(e)ledmac is available on \url{https://www.zotero.org/groups/critical_editions_typeset_with_edmac_ledmac_and_eledmac/items}. Please add your own edition made with (r)(e)ledmac. +% +% \section{How the package works}\label{howto} +% +% +% The \macpackage package is a three-pass package like +% \LaTeX\ itself. +% Although your textual apparatus and line +% numbers will be printed even on the first run, it takes two more +% passes through \LaTeX\ to be sure that everything gets to its right +% place. Any changes you make to the input file may similarly +% require three passes to get everything to the right place, if the +% changes alter the number of lines or notes. \Macpackage will tell +% you that you need to make more runs, when it notices, but it does +% not expend the labor to check this thoroughly. If you have +% problems with a line or two misnumbered at the top of a page, try +% running \LaTeX\ once or twice more. +% +% A file may mix \emph{numbered} and \emph{unnumbered} text. +% +% Numbered text is printed with marginal line numbers and can include +% footnotes and endnotes that are referenced to those line numbers: +% this is how you will want to print the text that you are editing. +% +% Unnumbered text is not printed with line numbers, and you can't +% use \macpackage's note commands with it: this is appropriate for +% introductions and other material added by the editor around the +% edited text. +% +% +% \section{Options} +% The package can be loaded with a number of global options which are listed here. +% There are two types of options: options which provide specific features and option which optimize package's performance. +% It is advised to read the relevant parts of the handbook before reading the first type of option, but you can look at the second type in you first reading of handbook. +% \subsection{Specific features} +% \begin{description} +% \item[draft] underlines lemmas in the main text. +% \item[eledmac-compat] help to migrate from \eledmac to \reledmac (see \reff{eledmac-compat}). +% \item[nopbinverse] prevents page break inside verses. +% \item[noquotation] by default, the quotation environment is redefined inside numbered text. You can disable this redefinition with \verb|noquotation| (see \reff{noquotation}). +% \item[parapparatus] by default, the apparatus cannot contain paragraph breaks; this option enables paragraphing inside the apparatus. +% \item[xindy] and \verb|xindy+hyperref| are for selecting \verb+xindy+ as the index processor (\reff{xindy}). +% \item[widthliketwocolumns] set the width of the text disposed on one column to be the same as the width of the text disposed on two parallel columns with \parpackage. This is useful when alternating between normal and parallel typesetting. +% \end{description} +% \subsection{Optimize package's performance}\label{option:performance} +% \begin{description} +% \item[nocritical] disables tools for critical footnotes (\cs{Afootnote}, \cs{Bfootnote} etc.). If you do not need critical footnotes, this option lets \eledmac\ run faster. +% It will also preserve room for other packages. +% \item[noeledsec] disables tools for \cs{eledsection} and related commands (\reff{eledsection}). +% \item[noend] disables tools for endnotes (\cs{Aendnote}, \cs{Bendnote} etc.). If you do not need endnotes, this option lets \eledmac\ run faster. +% It will also preserve room for other packages. +% \item[nofamiliar] disables tools for familiar footnotes (\cs{footnoteA}, \cs{footnoteB} etc.). If you do not need familiar footnotes, this option lets \eledmac\ run faster. +% It will also preserve room for other packages. +% \item[noledgroup] \macpackage allows to use of series of critical notes and new series of normal notes inside minipage and ledgroup environments (see~\reff{ledgroup}). However, such features use up computer memory, at the expense of other processing needs. So if you do not need this feature, use \verb+noledgroup+ option. This should make \macpackage faster. +% \item[series] \Macpackage defines five levels of notes: A, B, C, D, E. +% Using all these levels consumes memory space and processing speed. +% This is why, if your work does not require all of the A-E series, you can narrow down the available number of series. +% For example, if you only need A and B series, call the package with \verb+series={A,B}+ option. +% \end{description} +% \section{Text lines and paragraphs numbering} +% \subsection{Text lines numbering} +% \DescribeMacro{\beginnumbering} +% \DescribeMacro{\endnumbering} +% Each section of numbered text must be preceded by +% \cs{beginnumbering} and followed by \cs{endnumbering}, like this: \\ +% \egstart +% \begin{verbatim} +% \beginnumbering +% text +% \endnumbering +% \end{verbatim} +% \egend +% +% The \cs{beginnumbering} macro resets the line number to zero, +% reads an auxiliary file called \meta{jobname}.\file{nn} (where +% \meta{jobname} is the name of the main input file for this job, +% and \file{nn} is 1 for the first numbered section, 2 for +% the second section, and so on), and then creates a new version of +% this auxiliary file to collect information during this run. The +% first instance of \cs{beginnumbering} also opens a file called +% \meta{jobname}\file{.\meta{series}end} to receive the text of the endnotes. +% \cs{endnumbering} closes the \meta{jobname}.\file{nn} file. +% +% If the line numbering of a text is to be continuous from start to end, +% then the whole text will be typed between one pair of +% \cs{beginnumbering} and \cs{endnumbering} commands. But your text +% will most often contain chapter or other divisions marking sections +% that should be independently numbered, and these will be appropriate +% places to begin new numbered sections. +% +% \Macpackage has to read and store +% in memory +% a certain amount of information about the entire section when it +% encounters a \cs{beginnumbering} command, so it speeds up the +% processing and reduces memory use when a text is divided into a larger +% number of sections (at the expense of multiplying the number of +% external files that are generated). +% +% \subsection{Paragraphs} +% \subsubsection{Basis} +% \DescribeMacro{\pstart} +% \DescribeMacro{\pend} +% Within a numbered section, each paragraph of numbered text must +% be marked using the \cs{pstart} and \cs{pend} commands like this: \\ +% \egstart +% \begin{verbatim} +% \pstart +% Paragraph of text. +% \pend +% \end{verbatim} +% \egend +% +% Text that appears within a numbered section but is not marked with +% \cs{pstart} and \cs{pend} will not be numbered. +% +% The following example shows the proper section and paragraph +% markup, and the kind of output that would typically be generated: +% \egstart +% \begin{verbatim} +% \beginnumbering +% \pstart +% This is a sample paragraph, with +% lines numbered automatically. +% \pend +% +% \pstart +% This paragraph too has its +% lines automatically numbered. +% \pend +% +% The lines of this paragraph are +% not numbered. +% +% \pstart +% And here the numbering begins +% again. +% \pend +% \endnumbering +% \end{verbatim} +% \egend +% +% \subsubsection{Producting automatically \cs{pstart}\ldots{}\cs{pend}} +% \DescribeMacro{\autopar}\label{autopar} +% You can use \cs{autopar} to avoid the nuisance of this paragraph markup +% and still have every paragraph automatically numbered. The scope of the +% \cs{autopar} command needs to be limited by keeping it within a group, as +% follows: +% \egstart +% \begin{verbatim} +% \begingroup +% \beginnumbering +% \autopar +% +% A paragraph of numbered text. +% +% Another paragraph of numbered +% text. +% +% \endnumbering +% \endgroup +% \end{verbatim} +% \egend +% +% \cs{autopar} fails, however, on paragraphs that start with a +% \verb"{" or with any other command that starts a new group before it +% generates any text. Such paragraphs need to be started explicitly, +% before the new group is opened, +% using \cs{indent}, \cs{noindent}, or \cs{leavevmode}, or using +% \cs{pstart} itself.\footnote{For a detailed study of the +% reasons for this restriction, see Barbara Beeton, `Initiation +% rites', \textit{TUGboat} \textbf{12} (1991), +% pp.\,257--258.\protect\index{Beeton, Barbara Ann Neuhaus Friend}} +% +% \subsubsection{Content before specific \cs{pstart} and after specific \cs{pend}}\label{pstart:optionalarg} +% \changes{v1.12.0}{2014/08/05}{Optional arguments for \cs{pstart} and \cs{pend}.} +% \DescribeMacro{\AtEveryPstart} +% \DescribeMacro{\AtEveryPend} +% Both \cs{pstart} and \cs{pend} can take a optional argument, in brackets. +% Its content will be printed before the beginning of \cs{pstart} / after the end of \cs{pend} instead of the argument of \cs{AtEveryPstart} / \cs{AtEveryPend}. +% If you need to start a \cs{pstart} by brackets, or to add brackets after a \cs{pend}, just add a \cs{relax} between \cs{pstart}/\cs{pend} and the brackets. +% +%. This feature is also useful when typesetting verses (see~\reff{verse}) or \Lpack{eledpar} (see~\reff{eledpar}). +% +% A \cs{noindent} is automatically added before this argument. +% \subsubsection{Content before every \cs{pstart} and after every \cs{pend}} +% \changes{v1.15.0}{2015/01/12}{New commands \cs{AtEveryPstart} and \cs{AtEveryPend}.} +% \label{AtEveryPstart} \DescribeMacro{\AtEveryPstart}\DescribeMacro{\AtEveryPend} +% You can use both \cs{AtEveryPstart} and \cs{AtEveryPend}. +% Their arguments will be printed before every \cs{pstart} begins / after every \cs{pend} ends. +% \subsubsection{Numbering paragraphs (\cs{pstart})} +% \changes{v0.12.0}{2011/10/01}{Possibility to number \cs{pstart}.} +% It is possible to insert a number at every \cs{pstart} command. You must use the \DescribeMacro{\numberpstarttrue}\cs{numberpstarttrue} command to have it. You can stop the numbering with \DescribeMacro{\numberpstartfalse}\cs{numberpstartfalse}. +% You can redefine the command \DescribeMacro{\thepstart}\cs{thepstart} to change style. +% You can change the value of the pstart number by using \emph{after} \cs{beginnumbering}: +% \begin{verbatim} +% \setcounter{numberpstart}{value} +% \end{verbatim} +% On each \cs{beginnumbering} the numbering restarts. +% \changes{v0.15.0}{2012/06/11}{Possibility to print \cs{pstart} number inside.} +% +% \DescribeMacro{\sidepstartnumtrue} +% With the \cs{sidepstartnumtrue} command, the number of \cs{pstart} will be printed inside. In this case, the line number will be not printed. +% +% \changes{v1.1.0}{2012/09/25}{Add \cs{labelpstarttrue}.} +% \DescribeMacro{\labelpstarttrue} +% With the \cs{labelpstarttrue} command, a \cs{label} added just after a \cs{pstart} will refer to the number of this pstart. +% \subsubsection{Languages written in Right to Left} +% If you use languages written in right to left, we \LuaLaTeX\ or \XeLaTeX, so +% you must switch text direction \cs{before} the \cs{pstart} command. +% \subsubsection{Memory limits} +% \textbf{This paragraph is kept for history, but problem described below should not appear with recent version of \LaTeX.} +% \label{pause} +% \DescribeMacro{\pausenumbering} +% \DescribeMacro{\resumenumbering} +% \Macpackage stores a lot of information about line numbers and +% footnotes in memory as it goes through a numbered section. But +% at the end of such a section, it empties its memory out, so to +% speak. If your text has a very long numbered section it is +% possible that your \LaTeX\ may reach its memory limit. There are +% two solutions to this. +% The first is to get a larger \LaTeX\ with +% increased memory. +% +% The second solution is to +% split your long section into several smaller ones. The trouble +% with this is that your line numbering will start again at zero +% with each new section. To avoid this problem, we provide +% \cs{pausenumbering} and \cs{resumenumbering} which are just +% like \cs{endnumbering} \ldots\ \cs{beginnumbering}, except that +% they arrange for your line numbering to continue across the break. +% Use \cs{pausenumbering} only between numbered paragraphs: +% \egstart +% \begin{verbatim} +% \beginnumbering +% \pstart +% Paragraph of text. +% \pend +% \pausenumbering +% +% \resumenumbering +% \pstart +% Another paragraph. +% \pend +% \endnumbering +% \end{verbatim} +% \egend + +% +% We have +% defined these commands as two macros, in case you find it necessary +% to insert text between numbered sections without disturbing the +% line numbering. But if you are really just using these macros to +% save memory, you might as well say +% \egstart +% \begin{verbatim} +% \newcommand{\memorybreak}{\pausenumbering\resumenumbering} +% \end{verbatim} +% and say \cs{memorybreak} between the relevant \cs{pend} and +% \cs{pstart}. +% \egend +% +% \subsection{Lineation commands} +% \subsubsection{Disabling lineation} +% \DescribeMacro{\numberlinefalse} \DescribeMacro{\numberlinetrue} +% Line numbering can be disabled with \cs{numberlinefalse}. It can be enabled again with \cs{numberlinetrue}. +% \subsubsection{Setting lineation start and step} +% \DescribeMacro{\firstlinenum} +% \DescribeMacro{\linenumincrement} +% By default, \macpackage numbers every 5th line. There are two counters, +% \verb?firstlinenum? and \verb?linenumincrement?, that control this +% behaviour; they can be changed using \cs{firstlinenum}\marg{num} and +% \cs{linenumincrement}\marg{num}. \cs{firstlinenum} specifies the first +% line that will have a printed number, and \cs{linenumincrement} is +% the difference between succesive +% numbered lines. For example, to start printing numbers at the first line +% and to have every other line numbered: \\ +% \verb?\firstlinenum{1} \linenumincrement{2}? +% +% \DescribeMacro{\firstsublinenum} +% \DescribeMacro{\sublinenumincrement} +% There are similar commands, \cs{firstsublinenum}\marg{num} and +% \cs{sublinenumincrement}\marg{num} for controlling sub-line numbering. +% +% \DescribeMacro{\linenumberlist} +% You can define \cs{linenumberlist} to specify a non-uniform distribution +% of printed line numbers. For example: \\ +% \verb?\def\linenumberlist{1,2,3,5,7,11,13,17,19,23,29}? \\ +% to have numbers printed on prime-numbered lines only. There must be +% no spaces within the definition which consists of comma-separated decimal +% numbers. The numbers can be in any order but it is easier to read if you +% put them in numerical order. Either omitting the definition of +% \cs{linenumberlist} or following the vacuous definition \\ +% \verb?\def\linenumberlist{}? \\ +% the standard numbering sequence is applied. The standard sequence +% is that specified by the combination of the \verb+firstlinenum+, +% \verb+linenumincrement+, \verb+firstsublinenum+ and +% \verb+linenumincrement+ counter values. +% +% \subsubsection{Setting lineation reset} +% \DescribeMacro{\lineation} +% \changes{v1.0.0}{2012/09/15}{Debug in lineation command} +% Lines can be numbered either by page, by pstart or by section; you specify +% this using the \cs{lineation}\marg{arg} +% macro, where \meta{arg} is either +% \texttt{page}, \texttt{pstart} or \texttt{section}. + +% You may only use this command at places +% where numbering is not in effect; you can't change the lineation system +% within a section. You can change it between sections: they don't all +% have to use the same lineation system. +% The package's standard setting is \verb"\lineation{section}". If the lineation is by pstart, the pstart number will be printed before the line number in the notes. +% +% \subsubsection{Setting line number margin} +% \DescribeMacro{\linenummargin} +% The command \cs{linenummargin}\meta{location} specifies the margin +% where the line (or pstart) numbers will be printed. The permissable value +% for \meta{location} is one out of the list \texttt{left}, \texttt{right}, +% \texttt{inner}, or \texttt{outer}, +% for example \verb"\linenummargin{inner}". +% The package's default setting is \\ +% \verb"\linenummargin{left}" \\ +% to typeset the numbers in the left hand margin. +% You can change this whenever you're not in the middle of +% making a paragraph. +% +% More precisely, the value of +% \cs{linenummargin} used is that in effect at the \cs{pend} +% of a numbered paragraph. Apart from an initial setting for +% \cs{linenummargin}, only change it after a \cs{pend}, whereupon +% it will apply to all following numbered paragraphs, until +% changed again (changing it between a \cs{pstart} and \cs{pend} +% pair will apply the change to all the current paragraph). +% +% +% \subsubsection{Other settings} +% +% \DescribeMacro{\leftlinenum} +% \DescribeMacro{\rightlinenum} +% \DescribeMacro{\linenumsep} +% When a marginal line number is to be printed, there are a +% lot of ways to display it. +% You can redefine \cs{leftlinenum} and \cs{rightlinenum} to +% change the way marginal line numbers are printed in the +% left and right margins respectively; the initial +% versions print the number in font \cs{numlabfont} (described +% below) at a distance \cs{linenumsep} (initially set to one pica) +% from the text. +% +% \subsection{Changing the line numbers} +% +% Normally the line numbering starts at 1 for the first line of +% a section and steps up by one for each line thereafter. There +% are various common modifications of this system, however; the +% commands described here allow you to put such modifications +% into effect. +% +% \subsubsection{Sublineation} +% \DescribeMacro{\startsub} +% \DescribeMacro{\endsub} +% You insert the \cs{startsub} and \cs{endsub} commands in your text +% to turn sub-lineation on and off. In plays, for +% example, stage directions are often numbered with sub-line +% numbers: as line $10.1$, $10.2$, +% $10.3$, rather than as $11$, $12$, and $13$. +% Titles and headings are sometimes numbered with sub-line numbers +% as well. +% +% When sub-lineation is in effect, the line number counter is +% frozen and the sub-line counter advances instead. If one of these +% commands appears in the middle of a line, it doesn't take effect +% until the next line; in other words, a line is counted as a line +% or sub-line depending on what it started out as, even if that +% changes in the middle. +% +% \subsubsection{Locking lineation} +% \DescribeMacro{\startlock} +% \DescribeMacro{\endlock} +% The \cs{startlock} command, used in running text, locks the +% line number at its current value, until you say \cs{endlock}. +% It can tell for itself whether you are in a patch of line or +% sub-line numbering. One use for line-number locking is in printing +% poetry: there the line numbers should be those of verse lines +% rather than of printed lines, even when a verse line requires several +% printed lines. +% +% \DescribeMacro{\lockdisp} +% When line-number locking is used, +% several printed lines may have the same line number, and you have to +% specify whether you want the number attached to the first printed +% line or the last, or whether you just want the number printed by +% them all. (This assumes that, on the basis of the settings of +% the previous parameters, it is necessary to display a line number for +% this line.) You specify your preference using \cs{lockdisp}\marg{arg}; its +% argument is a word, either \verb+first+, \verb+last+, or \verb+all+. +% The package initially sets this as \cs{lockdisp}\verb+{first}+. +% +% \subsubsection{Setting and changing line number} +% \DescribeMacro{\setline} +% \DescribeMacro{\advanceline} +% In some cases you may want to modify the line numbers that are +% automatically calculated: if you are printing only fragments +% of a work but want to print line numbers appropriate to a complete +% version, for example. The \cs{setline}\marg{num} and +% \cs{advanceline}\marg{num} commands +% may be used to change the current line's number (or the sub-line +% number, if sub-lineation is currently on). They change both the +% marginal line numbers and the line numbers passed to the notes. +% \cs{setline} takes one argument, the value to which you want +% the line number set; it must be $0$ or greater. \cs{advanceline} +% takes one argument, an amount that should be added to the current +% line number; it may be positive or negative. +% +% \DescribeMacro{\setlinenum} +% The \cs{setline} and \cs{advanceline} macros should only be used +% within a \cs{pstart}\ldots\cs{pend} group. The \cs{setlinenum}\marg{num} +% command can be used outside such a group, for example between +% a \cs{pend} and a \cs{pstart}. It sets the line number +% to \meta{num}. +% It has no effect if used within a \cs{pstart}\ldots\cs{pend} group. +% +% \subsubsection{Line number style} +% \DescribeMacro{\linenumberstyle} +% \DescribeMacro{\sublinenumberstyle} +% Line numbers are normally printed as arabic numbers. You can +% use \cs{linenumberstyle}\marg{style} to change the numbering style. +% \meta{style} must be one of: +% \begin{itemize} +% \item[\texttt{Alph}] Uppercase letters (A\ldots\ Z). +% \item[\texttt{alph}] Lowercase letters (a\ldots\ z). +% \item[\texttt{arabic}] Arabic numerals (1, 2, \ldots) +% \item[\texttt{Roman}] Uppercase Roman numerals (I, II, \ldots) +% \item[\texttt{roman}] Lowercase Roman numerals (i, ii, \ldots) +% \end{itemize} +% Note that with the \texttt{Alph} or \texttt{alph} styles, `numbers' +% must be between 1 and 26 inclusive. +% +% Similarly \cs{sublinenumberstyle}\marg{style} can be used to change +% the numbering style of sub-line numbers, which is normally arabic numerals. +% +% \subsubsection{Skipping and hidding number} +% \DescribeMacro{\skipnumbering} +% When inserted into a numbered line the macro \cs{skipnumbering} causes +% the numbering of that particular line to be skipped; that is, the line +% number is unchanged and no line number will be printed. +% Note that if you use it in \cs{stanza}, you must call it at the beginning of the verse. +% +% \DescribeMacro{\hidenumbering} +% \changes{v1.21.0}{2015/04/13}{Add \cs{hidenumbering}} +% When inserted into a numbered line the macro \cs{hidenumbering} causes +% the number for that particular line to be hidden; namely, no line number will print. +% Note that if you use it in \cs{stanza}, you must call it at the beginning of the verse. +% \subsubsection{Execute code at each line} +% \Macpackage provides to advanced feature for user. +% \DescribeMacro{dolinehook}\DescribeMacro{doinsidelinehook} +% The argument passed to \cs{dolinehook}\marg{arg} will be executed +% before slicing a new line in the paragraph. +% The argument passed to \cs{doinsidelinehook}\marg{arg} will be executed before printing a new line. +% In many case, the second of two is more useful than the first. +% The file \href{examples/2-line_numbers_in_header.tex}{examples/2-line\_numbers\_in\_header.tex} provides an example of use in order to print the first and last line number of a page in the header. +% \section{Apparatus commands} +% \subsection{Terminology} +% We call ``critical notes'' notes which refer to both a lemma, that is a part of text and a line number. +% Critical notes are subdivided in critical footnotes and critical endnotes. +% +% We call ``familiar notes'' notes which refer to a footnote mark in the main text. +% +% \Macpackage manages many series of notes of each category. +% A series of notes is identified by an uppercase letter. +% When the series letter is at the beginning of a command name, it refers to a critical footnote. +% When the series letter is at the end of a command name, it refers to a critical endnote. +% +% So : +% \begin{itemize} +% \item \cs{Afootnote} is a critical footnote of the series A. +% \item \cs{Bendnote} is a critical footnote of the series B. +% \item \cs{footnoteC} is a critical footnote of the series C. +% \end{itemize} +% \subsection{Critical notes} +% \subsubsection{The lemma} +% \DescribeMacro{\edtext} +% Within numbered paragraphs, all footnotes and endnotes are generated +% by the \cs{edtext} macro: +% \begin{verse} +% \cs{edtext}\marg{lemma}\marg{commands} +% \end{verse} +% +% +% The \meta{lemma} argument is the lemma in the main text: \cs{edtext} +% both prints this as part of the text, and makes it available to the +% \meta{commands} you specify to generate notes. +% +% For example: +% \egstart +% \begin{verbatim} +% I am happy : +% I saw my friend \edtext{Smith}{ +% \Afootnote{Jones C, D.}} +% on Tuesday. +% \end{verbatim} +% \egmid +% \beginnumbering +% \firstlinenum{1} +% \linenumincrement{1} +% \pstart +% I am happy : I saw my friend \edtext{Smith}{ +% \Afootnote{Jones C, D.}} +% on Tuesday. +% \pend +% \endnumbering +% \egend +% +% The lemma \verb?Smith? is printed as part of this sentence in +% the text, and is also made available to the footnote +% that specifies a variant, \verb?Jones C, D?. The footnote macro +% is supplied with the line number at which the lemma appears +% in the main text. +% +% The \meta{lemma} may contain further \cs{edtext} commands. +% Nesting makes +% it possible to print an explanatory note on a long passage together with +% notes on variants for individual words within the passage. For +% example: +% \egstart +% \begin{verbatim} +% I am happy : \edtext{I saw my friend +% \edtext{Smith}{\Afootnote{Jones +% C, D.}} on Tuesday.}{ +% \Bfootnote{The date was +% July 16, 1954.} +% } +% \end{verbatim} +% \egmid +% \beginnumbering +% \firstlinenum{1} +% \linenumincrement{1} +% \pstart +% I am happy : \edtext{I saw my friend +% \edtext{Smith}{\Afootnote{Jones +% C, D.}} on Tuesday.}{ +% \Bfootnote{The date was +% July 16, 1954.} +% } +% \pend +% \endnumbering +% \egend +% +% However, \cs{edtext} cannot handle overlapping but unnested +% notes---for example, one note covering lines 10--15, and another +% covering 12--18; a \cs{edtext} that starts in the \meta{lemma} +% argument of another \cs{edtext} must end there, too. (The +% \cs{lemma} and \cs{linenum} commands may be used to +% generate overlapping notes if necessary.) +% +% \subsubsection{Footnotes} +% +% The second argument of the \cs{edtext} macro, \meta{commands}, +% may contain a series of subsidiary commands that generate +% various kinds of notes. +% +% \DescribeMacro{\Afootnote} +% \DescribeMacro{\Bfootnote} +% \DescribeMacro{\Cfootnote} +% \DescribeMacro{\Dfootnote} +% \DescribeMacro{\Efootnote} +% Five separate series of the footnotes are maintained; each macro +% takes one argument like \cs{Afootnote}\marg{text}. +% When all of the six +% are used, the \texttt{A} notes appear in a layer just below the main +% text, followed by the rest in turn, down to the \texttt{E} notes at +% the bottom. +% These are the main macros that you will use to construct +% the critical apparatus of your text. +% +% If you need more series of critical notes, please look at \reff{newseries}. +% +%\changes{v1.0.0}{2012/09/15}{Options nonum and nosep in \cs{Xfootnote}.} +%\changes{v1.20.0}{2015/03/22}{Options fulllines in \cs{Xfootnote}.}\label{Xfootnoteopt} +%An optional argument can be added before the text of the footnote. Its value is a comma separated list of options. +% \label{fulllines}The available options are: +% \begin{itemize} +% \item \verb|fulllines| to disable \cs{Xtwolines} and \cs{Xmorethantwolines} features for this note (cf. \reff{Xtwolines}). +% \item \verb|nonum| to disable line numbering for this note. +% \item \verb|nosep| to disable the lemma separator for this note. +% \end{itemize} +% +% Example: \cs{Afootnote}\verb|[nonum]|\marg{text}. +% +% \subsubsection{Endnotes} +% \DescribeMacro{\Aendnote} +% \DescribeMacro{\Bendnote} +% \DescribeMacro{\Cendnote} +% \DescribeMacro{\Dendnote} +% \DescribeMacro{\Eendnote} +% The package also maintains five separate series of endnotes. +% +% If you do not need the endnotes facility, you should use \verb+noend+ option when loading \Lpack{eledmac}. +% +% The mechanism is similar to the one for footnotes: each macro takes one or more optional arguments and one single argument, like:\\ +% \cs{Aendnote}\oarg{option}\marg{text}. +% +% \verb+[<option>]+ can contain a comma separated list of values. Allowed values are: +% \begin{itemize} +% \item \verb|fulllines| to disable \cs{Xendtwolines} and \cs{Xendmorethantwolines} features for this particular note (cf. \reff{Xtwolines}). +% \item \verb+nonum+ to disable line number for this particular note. +% \item \verb|nosep| to disable the lemma separator for this particular note. +% \end{itemize} +% +% \label{doendnotes} Normally, endnotes are not printed: you must use the +% \cs{doendnotes}\marg{s}, where \meta{s} is the letter of the series to be printed. Put this command where you want the corresponding set of endnotes printed. +% In this case, all the endnotes of the \meta{s} series are printed, for all numbered section. +% \changes{v1.22.0}{2015/04/25}{Add \cs{doendnotesbysection} command.} +% \changes{v1.22.0}{2015/04/25}{Standardize endnotes handbook.} +% +% \DescribeMacro{\doendnotesbysection} However, you may want to print the endnotes of one given series covering the first numbered section, then the endnotes of another given series covering the first numbered section, then the endnotes of the first given series covering the second numbered section, then the endnotes of the second given series covering the second numbered section, and so forth. +% In this case, use \cs{doendnotesbysection}\marg{s}. +% For each value of \meta{s}, the first call of the command will print the notes for the first series, the second call will print the notes for the second series etc. +% For example, do: +% \begin{verbatim} +% \section{Endnotes} +% \subsection{First text} +% \doendnotesbysection{A} +% \doendnotesbysection{B} +% \subsection{Second text} +% \doendnotesbysection{A} +% \doendnotesbysection{B} +% \end{verbatim} +% +% Note that by default inside endnotes no separator is used between the lemma and the content. +% However you can use the \cs{Xendlemmaseparator} macro to define one (\reff{Xendlemmaseparator}). +% +% As endnotes may be printed at any point in the document they always +% start with the page number where they are called. The +% macro \cs{printnpnum}\marg{num} is used to print these numbers. +% Its default definition is: \\ +% \verb?\newcommand*{\printnpnum}[1]{p.#1) }? +% +% +% \subsubsection{Paragraph in critical apparatus} +% By default, no paragraph can be made in the notes of critical apparatus. +% You can allow it by adding the options \verb+parapparatus+ when loading the package : +% \begin{verbatim} +% \usepackage[parapparatus]{eledmac} +% \end{verbatim} +% +% \subsubsection{Change lemma and line number} +% \DescribeMacro{\lemma} +% \changes{v1.0.0}{2012/09/15}{\cs{lemma} can contain commands.} +% If you want to change the lemma that gets passed to the notes, you +% can do this by using \cs{lemma}\marg{alternative} within the +% second argument to \cs{edtext}, before the note commands. +% The most common use of this command is to abbreviate the lemma that's +% printed in the notes. For example: +% \egstart +% \begin{verbatim} +% I am happy : +% \edtext{I saw my friend +% \edtext{Smith}{\Afootnote{Jones +% C, D.}} on Tuesday.} +% {\lemma{I \dots\ Tuesday.} +% \Bfootnote{The date was +% July 16, 1954.} +% } +% \end{verbatim} +% \egmid +% \beginnumbering +% \pstart +% I am happy : +% \edtext{I saw my friend +% \edtext{Smith}{\Afootnote{Jones +% C, D.}} on Tuesday.} +% {\lemma{I \dots\ Tuesday.} +% \Bfootnote{The date was +% July 16, 1954.} +% } +% \pend +% \endnumbering +% \egend +% +% \DescribeMacro{\linenum} +% \label{linenum} +% You can use \cs{linenum}\marg{arg} to change the line numbers passed to +% the notes. The notes are actually given seven parameters: the page, +% line, and sub-line number for the start of the lemma; the same +% three numbers for the end of the lemma; and the font specifier +% for the lemma. As the argument to \cs{linenum}, you specify +% those seven parameters in that order, separated by vertical bars +% (the \verb"|" character). However, you can retain the value +% computed by \macpackage for any number by simply omitting it; and +% you can omit a sequence of vertical bars at the end of the +% argument. For example, \verb"\linenum{|||23}" changes one number, +% the ending page number of the current lemma. +% +% This command does not change the marginal line numbers in any way; +% it just changes the numbers passed to the footnotes. Its use comes in +% situations that \cs{edtext} has trouble dealing with for +% whatever reason. If you need notes for overlapping passages that +% aren't nested, for instance, you can use \cs{lemma} and +% \cs{linenum} to generate such notes despite the limitations of +% \cs{edtext}. If the \meta{lemma} argument to \cs{edtext} is +% extremely long, you may run out of memory; here again you can +% specify a note with an abbreviated lemma using \cs{lemma} and +% \cs{linenum}. The numbers used in \cs{linenum} need not be +% entered manually; you can use the `\texttt{x-}' symbolic cross-referencing +% commands below (\reff{crossref}) to compute them +% automatically. +% +% Similarly, being able to manually change the lemma's font specifier +% in the notes might be important if you were using multiple scripts or +% languages. The form of the font specifier is three +% separate codes separated by \verb"/" characters, giving the family, +% series, and shape codes as defined within NFSS. +% +% \subsubsection{Changing the names of commands for critical apparatus} +% +% The commands for generating the apparatus have been given +% rather bland names, because editors in different fields have +% widely divergent notions of what sort of notes are required, where +% they should be printed, and what they should be called. But this +% does not mean you have to type \cs{Afootnote} when you would rather +% say something you find more meaningful, like \cs{variant}. +% +% We +% recommend that you create a series of such aliases and use them +% instead of the names chosen here; all you have to do is put commands +% of this form at the start of your file:\footnote{We use \cs{newcommand} and \cs{newcommandx} instead of classical \cs{let} command because the edtabular environments have to modify the notes definition, and we need to use the newest definition of notes. Read the handbook of \Lpack{xargs} to know more about \cs{newcommandx}.} +% \begin{verbatim} +% \newcommandx{\variant}[2][1,usedefault]{\Afootnote[#1]{#2}} +% \newcommandx{\explanatory}[2][1,usedefault]{\Bfootnote[#1]{#2}} +% \newcommand{\trivial}[1]{\Aendnote{#1}} +% \newcommandx{\testimonia}[2][1,usedefault]{\Cfootnote[#1]{#2}} +% \end{verbatim} +% +% +% \subsection{Disambiguation of identical words in the apparatus} +% \changes{v1.15.0}{2015/01/12}{New tools to prevent ambiguous references in lemma} +% \changes{v1.23.0}{2015/05/18}{Fix bug with \cs{sameword} when the same lemma is used for multiple notes or for nested \cs{edtext}s.} +% \changes{v1.23.0}{2015/05/18}{Optional argument of \cs{sameword} can be a comma separated list of \cs{edtext} depth.} +% \changes{v1.23.0}{2015/05/18}{Fix bug with \cs{sameword} when the lemma overlaps multiple line.} +% Sometimes, the same word occurs twice (or more) in the same line. +% \Macpackage provides tools to disambiguate references in the critical notes. +% The lemma will be followed by a reference number if a given word occurs more that once in the same line. +% +% \subsubsection{Basic use} +% \DescribeMacro{\sameword} To use this tool, you have to mark every occurrence of the potentially ambiguous term with the \cs{sameword} command: +% \begin{verbatim} +% Lupus \sameword{aut} canis \edtext{\sameword{aut}}{\Afootnote{et}} felix +% \end{verbatim} +% In this example, \verb+aut+ will be followed, in the critical note, by the exponent \verb+2+ if it is printed in the same line as the first \verb+aut+, but it will not if it is printed in a different line. The number is printed only after the second run. +% +% \subsubsection{Notes about input encoding with UTF-8 processor} +% +% If you use UTF-8 processor, like \XeLaTeX\ or \LuaLaTeX, there should not be any glitches. +% However, pay attention to how characters are encoded. Similar-looking characters may be represented differently in unicode numbering. +% +% For instance, in Greek, ``ᾳ'' has two possible unicode numbers: +% \begin{itemize} +% \item GREEK SMALL LETTER ALPHA (U+03B1) + COMBINING GREEK YPOGEGRAMMENI (U+0345) +% \item GREEK SMALL LETTER ALPHA WITH YPOGEGRAMMENI (U+1FB3) +% \end{itemize} +% +% Which unicode number you use depends, many times, on your keyboard configuration (the computer-input system). +% +% Inside \macpackage, the \cs{sameword} command considers these two unicodes options as different characters. If you use only one unicode number consistently, the distinction will probably make no difference to how your text looks, but \cs{sameword} will process the text inaccurately, based on the unicode numbers. To prevent this, do the following: +% \begin{itemize} +% \item If you use \XeLaTeX, add this line in your preamble:\verb+ \XeTeXinputnormalization 1+. +% \item If you use \LuaLaTeX, use the \Lpack{uninormalize} package of Michal Hoftich\footnote{\url{https://github.com/michal-h21/uninormalize}.} with the \verb+buffer+ option set to true. +% \end{itemize} +% +% With these tools, \XeTeX\ / \LuaTeX\ will dynamicaly normalize unicode input when reading the file. +% Consequently, you will have no problems with the \cs{sameword} command. +% \subsubsection{Use with \cs{lemma} command} +% If you use the \cs{lemma} command, \Lpack{eledmac} cannot know to which occurence of \cs{sameword} in the first argument of \cs{edtext} a word marked with \cs{sameword} in \cs{lemma} should refer. +% +% For example in the following example: +% \begin{verbatim} +% some thing +% \edtext{\sameword{sw} +% and other \sameword{sw} +% and again \sameword{sw} +% it is all}% +% }{\lemma{\sameword{sw} \ldots all}\Afootnote{critical note}}.% +% \end{verbatim} +% \Lpack{eledmac} cannot know if the ``sw'' in \cs{lemma} refers to the word after ``thing'', after ``other'', or after ``again''. +% +% Consequently, you have to tell to \Lpack{eledmac} which instance of \cs{sameword} in the first argument of \cs{edtext} you want to reference: +% \begin{itemize} +% \item In the content of \cs{lemma}, use \cs{sameword} with no optional argument. +% \item In the first argument of \cs{edtext}, use \cs{sameword} with the optional argument \oarg{X}. \meta{X} is the depth of the \cs{edtext} where the \cs{lemma} is used. +% So if the \cs{lemma} is called in a \cs{edtext} inside another \cs{edtext}, \meta{X} is equal to \verb+2+. +% If the \cs{lemma} is called in a \cs{edtext} ``of first level'', \meta{X} is equal to \verb|1|. If the lemma is called in both 1 and 2 \cs{edtext} depth, \meta{X} is \verb+1,2+. If that word is referenced in the lemma of every \cs{edtext} depth, \meta{X} can also be set to \verb+inlemma+. +% \end{itemize} +% Note that only words that are actually referenced in a \cs{lemma} need the optional argument. Therefore, the first \cs{sameword} in the example above should have ``1'' as its optional argument, to be referenced correctly in the lemma. +% +% Note also that the \meta{X} does not refer to the level where the \cs{sameword} occurs, but to the level of the \cs{lemma} that refers to that \cs{sameword}. For example: +% \begin{verbatim} +% \edtext{some \edtext{\sameword[1]{word}}{\Afootnote{om. M}} +% and other \sameword{word} +% and again a \sameword{word} +% it is all}% +% }{\lemma{some \sameword{word} \ldots all}\Afootnote{critical note}}.% +% \end{verbatim} +% Here the \cs{sameword} occurs in an \cs{edtext} of level 2, but since it is referenced by \cs{lemma} on level 1, it has ``1'' in the optional argument. + +% In the following schema, each framed box represents an \cs{edtext} level. Each number is an occurrence of \cs{sameword}. After a framed box, the text in superscript represents the content of \cs{lemma} for that \cs{edtext} level. The text in subscript at the right of a number represents the content of the optional argument of \cs{sameword}. +% +%\fbox{% +% \fbox{% +% $1_{inlemma}$ +% \fbox{$2$} +% $3_2$% +% }\textsuperscript{$1$\ldots$3$}% +% 4 +% $5_1$ +% }\textsuperscript{1\ldots5} +% +% The \cs{sameword} number~3 is called in a \cs{lemma} related to an \cs{edtext} of level~2. +% It must be marked by ``2''. +% +% The \cs{sameword} number~5 is called in a \cs{lemma} related to \cs{edtext} of level~1. It must be marked by ``1''. +% +% The \cs{sameword} number is called in two \cs{lemma}s: one related to a \cs{edtext} of level~1, the other related to \cs{edtext} of level~2. +% It must be marked by ``1,2''. +% However, as \cs{lemma} is called only in level~1 and~2, ``1,2'' could replaced by ``inlemma''. +% +% The \cs{sameword} number ``2'' is in the first argument of a \cs{edtext} of level~3, but it has no \cs{lemma}-command, so there is no need to mark it. +% +% +% +% \subsubsection{Customizing} +% \DescribeMacro{\showwordrank}You can redefine the \cs{showwordrank} macro to change the way the number is printed. The default value is +% \begin{verbatim} +%\newcommand{\showwordrank}[2]{% +% #1\textsuperscript{#2}% +%} +% \end{verbatim} +% +% \subsection{Familiar notes} \label{sec:desc:familiar} +% +% +% \subsubsection{Basic use} +% \DescribeMacro{\footnoteA} +% \DescribeMacro{\footnoteB} +% \DescribeMacro{\footnoteC} +% \DescribeMacro{\footnoteD} +% \DescribeMacro{\footnoteE} +% As well as the standard \LaTeX\ footnotes generated via \cs{footnote}, +% the package also provides +% five series of additional footnotes called \cs{footnoteA} through +% \cs{footnoteE}. These have the familiar marker in the text, and +% the marked text at the foot of the page can be formated using +% any of the styles described for the critical footnotes. Note that +% the `regular' footnotes have the series letter at the end of the macro +% name whereas the critical footnotes have the series letter at the start +% of the name. +% +% +% \subsubsection{Customizing mark} +% \DescribeMacro{\thefootnoteA} +% \DescribeMacro{\bodyfootmarkA} +% \DescribeMacro{\footfootmarkA} +% Each series uses a set of macros for +% styling the marks. The mark numbering scheme of series A is defined by the +% \cs{thefootnoteA} macro; the default is: \\ +% \verb?\renewcommand*{\thefootnoteA}{\arabic{footnoteA}}?\\ +% The appearance of the mark in the text is controlled by \cs{bodyfootmarkA} +% which is defined as: \\ +% \verb?\newcommand*{\bodyfootmarkA}{%? \\ +% \verb? \hbox{\textsuperscript{\normalfont\@nameuse{@thefnmarkA}}}}? \\ +% The command \cs{footfootmarkA} controls the appearance of the mark at the +% start of the footnote text. It is defined as: \\ +% \verb?\newcommand*{\footfootmarkA}{\textsuperscript{\@nameuse{@thefnmarkA}}}? +% +% There are similar command triples for the other series. +% \subsubsection{Separator for multiple footnotes} +% The \Lpack{footmisc} package~\cite{FOOTMISC} by Robin +% Fairbairns\index{Fairbairns, Robin} has an option whereby +% sequential footnote +% marks in the text can be separated by +% commas\textsuperscript{3,4} like so. +% As a convenience \Eledmac{} provides this automatically. +% +% \DescribeMacro{\multfootsep} +% \cs{multfootsep} is used as the separator between footnote markers. +% Its default definition is: \\ +% \verb?\providecommand*{\multfootsep}{\textsuperscript{\normalfont,}}? \\ +% and can be changed if necessary. +% +% \subsection{Changing series} +% \subsubsection{Create a new series}\label{newseries} +% +% If you need more than six series of critical footnotes you can +% create extra series, using \cs{newseries} command. For example to create G and H series \cs{newseries}\verb+G,H+. +% +% \subsubsection{Delete series} +% As the number of series which are defined increases, \macpackage gets slower. +% If you do not need all of the six standard series (A, B, C, D, E), +% you can load the package with the \verb+series+ option. +% For example if you need only series~A and~B, use: +% \begin{verbatim} +% \usepackage[series={A,B}]{eledmac} +% \end{verbatim} +% \subsubsection{Series order} +% The default series order is the one called with the \verb+series+ option of the package, or, if this option is not used, A, B, C, D, E. +% Series order determines footnotes order. +% +% \DescribeMacro{seriesatbegin}\DescribeMacro{seriesatend} However in some specific cases, you need to change the series order at some point inside the document. +% You can use \cs{seriesatbegin}\marg{s} to pull up a given series \meta{s} to the beginning, or \cs{seriesatend}\marg{s} to push it down to the end. +% \subsection{Position of critical and familiar footnotes} +% \DescribeMacro{\fnpos}\DescribeMacro{\mpfnpos} +% There is a historical incoherence in \Lpack{(r)(e)ledmac}. The familiar footnotes are +% before the critical footnotes in a normal page, but after in a minipage or in a ledgroup. +% However, it is possible to change the relative position of both types of footnotes. +% If you want to have familiar footnotes after critical footnotes in a normal page, use: +% \begin{verbatim} +% \fnpos{critical-familiar} +% \end{verbatim} +% Or, if you want a minipage or ledgroup to have critical footnotes after familiar footnotes, use: +% \begin{verbatim} +% \mpfnpos{familiar-critical} +% \end{verbatim} +% \section{Critical apparatus appearance} +% \label{displayoptions} +% \changes{v1.0.0}{2012/09/15}{New generic commands to customize footnote display.} +% Some commands can be used to change the display of the footnotes. All can have an optional argument \oarg{s}, which is the letter of the series --- or a list of letters separated by comma --- depending on which option is applied. If the optional argument is omitted or empty, the setting will concern all series. +% +% When a length, noted \meta{l}, is used, it can be stretchable: \verb|a plus b minus c|. The final length |m| is calculated by \LaTeX{} to have: $a-c \leq m \leq a+b$. If you use some relative unity\footnote{Like \verb|em| which is the width of a mg.}, it will be relative to fontsize of the footnote, except for commands concerning the place kept by the notes --- including blank space. +% +% There is also name convention: +% \begin{itemize} +% \item Names prefixed by \verb+X+ are for setting of critical footnotes. +% \item Names prefixed by \verb+Xend+ are for setting of critical endnotes. +% \item Names suffixed by \verb+X+ are for setting of familiar footnotes. +% \end{itemize} +% \subsection{Notes arrangement in a series}\label{arrangement} +% +% \DescribeMacro{\Xarrangement} +% \DescribeMacro{\arrangementX} +% By default, all footnotes are formatted as a series of separate +% paragraphs in one column. Three other formats are also +% available for notes. +% +% Use \cs{Xarrangement}\oarg{s}\marg{a} to change the arrangement of the \meta{s} series of critical footnotes and \cs{arrangementX}\oarg{s}\marg{a} to change the arrangement of the \meta{s} series of familiar footnotes. +% +% The value of \meta{a} can be one of the following +% \begin{itemize} +% \item \verb+paragraph+ formats +% all the footnotes of a series as a single paragraph; +% \item \verb+twocol+ formats them as separate paragraphs, +% but in two columns; +% \item \verb+threecol+, in three columns. +% \item \verb+normal+, restore normal arrangement. +% \end{itemize} +% +% You should set up the page layout parameters, and in particular the +% \cs{baselineskip} of the footnotes, before you call this +% macro because its action depends on these; +% too much or too little space will be allotted for the notes on +% the page if these macros use the wrong +% values.\footnote{\phantomsection\label{nobreaks}There +% is one tiny proviso about using paragraphed notes: you should not +% force any explicit line-breaks inside such notes: do not use +% {\tt \bslash par}, +% {\tt \bslash break}, or {\tt \bslash penalty=-10000}. If +% you must have a line-break for some obscure reason, just suggest +% the break very strongly: {\tt \bslash penalty=-9999} will do +% the trick. \reff{nobreak} explains why this restriction +% is necessary.} +% +% The notes arrangement must be called after having defined the document geometry setting. If you must change geometry setting inside your document, do not forget to call again not arrangement. +% +% \cs{hsize} has been set for the pages that use +% this series of notes; otherwise \TeX\ will try to put too +% many or too few of these notes on each page. If you need to +% change the \cs{hsize} within the document, call +% \cs{footparagraph} again afterwards to take account of the new +% value. +% \subsection{Control line number printing} +% \subsubsection{Print line number only at first time} +% \DescribeMacro{\Xnumberonlyfirstinline} +% \changes{v1.0.1}{2012/09/16}{Correction on \cs{Xnumberonlyfirstinline} with lineation by pstart or by page.} +% By default, the line number is printed in every note. If you want to print it only the first time for a given line number (i.e one time for line 1, one time for line 2 etc.), you can use \cs{Xnumberonlyfirstinline}\oarg{s}. +% +% Use \cs{Xnumberonlyfirstinline}\oarg{s}\verb+[false]+ to disable this (\meta{s} can be empty if you want to disable it for every series). +% +% \DescribeMacro{\Xnumberonlyfirstintwolines} +% \changes{v1.1.0}{2012/09/25}{Add \cs{Xnumberonlyfirstintwolines}} +% Suppose you have a lemma on line~2 and a lemma between line~2 and line~3. +% With \cs{Xnumberonlyfirstinline}, the second lemma is considered to be on the same line as the first lemma. +% But if you use both \cs{Xnumberonlyfirstinline}\oarg{s} and \cs{Xnumberonlyfirstintwolines}\oarg{s}, the distinction is made. +% Use \cs{Xnumberonlyfirstintwolines}\oarg{s}\verb+[false]+ to disable this (\meta{s} can be empty if you want to disable it for every series). +% \DescribeMacro{\Xsymlinenum} +% For setting a particular symbol in place of the line number, you can use \cs{Xsymlinenum}\oarg{s}\marg{symbol} in combination with \cs{Xnumberonlyfirstinline}\oarg{s}. From the second lemma of the same line, the symbol will be used instead of the line number. Note that any command called in \meta{symbol} must be robust. Use \cs{robustify} to robustify a not robust command. +% +% \subsubsection{Abbreviate line range} +% \changes{v1.20.0}{2015/03/22}{Add \cs{Xtwolines} and \cs{Xmorethantwolines} hooks} +% \label{Xtwolines} +% \DescribeMacro{\Xtwolines}\DescribeMacro{\Xmorethantwolines} +% If a lemma is printed on two subsequent lines, \Eledmac\ will print the first and the last line numbers. +% Instead of this, it is also possible to print an abbreviation which stands for ``line 1 and subsequent line(s)''. +% +% To achieve this, use \cs{Xtwolines}\oarg{s}\marg{text} and \cs{Xmorethantwolines}\oarg{s}\marg{text}. +% The \meta{text} argument of \cs{Xtwolines} will be printed if the lemma is on two lines, and the \meta{text} argument of \cs{Xmorethantwolines} will be printed if the lemma is on three or more lines. +% For example: +% \begin{verbatim} +% \Xtwolines{sq.} +% \Xmorethantwolines{sqq.} +% \end{verbatim} +% Will print ``1sq.'' for a lemma which falls on lines 1-2 and ``1sqq.'' for a lemma which falls on lines 1-4. +% +% \DescribeMacro{\Xmorethantwolines} If you use \cs{Xtwolines} without setting \cs{Xmorethantwolines}, the \meta{text} argument of \cs{Xtwolines} will be used for lemmas which fall on three or more lines. +% +% However, if you want to use a short form (when the lemma overlaps two lines, but not more than two), use \cs{Xtwolinesbutnotmore}\oarg{series}. +% +% It is possible to disable \cs{Xtwolinesbutnotmore}\oarg{series} with \cs{Xtwolinesbutnotmore}\oarg{series}\verb+[false]+. +% +% When you use lineation by page, the final page number, if different from the initial page number, +% will not be printed, because the final page number is included in the \cs{Xendtwolines} symbol. +% +% \DescribeMacro{\Xtwolinesonlyinsamepage} +% However, you can force print the final page number with\\ +% \cs{Xtwolinesonlyinsamepage}\oarg{series}. +% +% Use \cs{Xtwolinesonlyinsamepage}\oarg{series}\verb+[false]+ to disable this. +% +% You can disable \cs{Xtwolines} and related for a specific note by using the `[fulllines]` argument in the note macro cf.~\reff{fulllines}. +% +% \label{Xendtwolines}\changes{v1.21.0}{2015/04/13}{Add \cs{Xendtwolines}, \cs{Xendmorethantwolines}, \cs{Xendtwolinesbutnotmore} and \cs{Xendtwolinesonlyinsamepage}.} +% \DescribeMacro{\Xendtwolines}\DescribeMacro{\Xendmorethantwolines}\DescribeMacro{\Xendtwolinesbutnotmore} +% For endnotes, use \cs{Xendtwolines}; \cs{Xendmorethantwolines}; \cs{Xendtwolinesbutnotmore}; \cs{Xendtwolinesonlyinsamepage} instead of \cs{Xtwolines}; \cs{Xmorethantwolines}; \cs{Xtwolinesbutnotmore}; \cs{Xtwolinesonlyinsamepage}. +% +% + +% \subsubsection{Disable line number} +% \DescribeMacro{\Xnonumber} +% You can use \cs{Xnonumber}\oarg{s} if you do not want to have the line number in a footnote. To cancel it, use \cs{Xnonumber}\oarg{s}\verb+[false]+. +% \DescribeMacro{\Xendnonumber} \cs{Xendnonumber}\oarg{s} is the same for endnote. +% \subsubsection{Printing pstart number} +% \changes{v1.1.0}{2012/09/25}{Add \cs{Xpstart} and \cs{Xonlypstart}} +% \changes{v1.18.0}{2015/02/23}{Add \cs{Xpstarteverytime}} +% \changes{v1.18.0}{2015/02/23}{Debug \cs{Xonlypstart} when using \cs{Xnumberonlyfirstinline} and the current line number differs from the previous.} +% \DescribeMacro{\Xpstart} +% You can use \cs{Xpstart}\oarg{s} if you want to print the pstart number in the footnote, before the line and subline number. +% Use \cs{Xpstart}\oarg{s}\verb+[false]+ to disable this (\meta{s} can be empty if you want to disable it for every series). +% Note that when you change the lineation system, the option is automatically switched : +% \begin{itemize} +% \item If you use lineation by pstart, the option is enabled. +% \item If you use lineation by section or by page, the option is disabled. +% \end{itemize} +% +% \DescribeMacro{\Xpstarteverytime} +% By default, the pstart number is printed only in the part of text where you have called \cs{numberpstarttrue}. +% We don't know why you would like to print the pstart number in the notes and not in the main text. +% However, if you want to do it, you can call \cs{Xpstarteverytime}\oarg{s}. +% In this case, the pstart number will be printed every time in footnote. +% +% \DescribeMacro{\Xonlypstart} +% In combination with \cs{Xpstart}, you can use \cs{Xonlypstart}\oarg{s} if you want to print only the pstart number in the footnote, and not the line and subline number. +% Use \cs{Xonlypstart}\oarg{s}\verb+[false]+ disable this it (\meta{s} can be empty if you want to disable it for every series). +% \subsubsection{Space around number} +% \DescribeMacro{\Xbeforenumber} +% With \cs{Xbeforenumber}\oarg{s}\marg{l}, you can add some space before the line number in a footnote. If the line number is not printed, the space is not either. The default value is 0~pt. +% +% \DescribeMacro{\Xafternumber} +% With \cs{Xafternumber}\oarg{s}\marg{l} you can add some space after the line number in a footnote. If the line number is not printed, the space is not either. The default value is 0.5~em. +% +%\changes{v1.4.3}{2012/12/18}{Add \cs{Xnonbreakableafternumber}.} +%\DescribeMacro{\Xnonbreakableafternumber} +% By default, the space defined by \cs{Xafternumber} is breakable. With \cs{Xnonbreakableafternumber}\oarg{s} it becomes nonbreakable. Use \cs{Xnonbreakableafternumber}\oarg{s}\verb+[false]+ to disable this (\meta{s} can be empty if you want to disable it for every series). +% +% \subsubsection{Space around line symbol} +% \DescribeMacro{\Xbeforesymlinenum} +% With \cs{Xbeforesymlinenum}\oarg{s}\marg{l} you can add some space before the line symbol in a footnote. The default value is value set by \cs{Xbeforenumber}. +% +% \DescribeMacro{\Xaftersymlinenum} +% With \cs{Xaftersymlinenum}\oarg{s}\marg{l} you can add some space after the line symbol in a footnote. The default value is value set by \cs{Xafternumber}. +% +% \subsubsection{Space in place of number} +% \DescribeMacro{\Xinplaceofnumber} +% If no number or symbolic line number is printed, you can add a space, with \cs{Xinplaceofnumber}\oarg{s}\marg{l}. The default value is 1~em. +% +% \DescribeMacro{Xendinplaceofnumber}. \cs{Xendinplaceofnumber}\oarg{s}\marg{l} is the same, for critical endnotes. +% \subsubsection{Boxing line number and line symbol} +% \DescribeMacro{\Xboxlinenum} +% It could be useful to put the line number inside a fixed box: the content of the note will be printed after this box. +% You can use \cs{Xboxlinenum}\oarg{s}\marg{l} to do that. +% To subsequently disable this feature, use \cs{Xboxlinenum} with length equal to 0~pt. +% One use of this feature is to print line number in a column, and the note in an other column: +% \begin{verbatim} +%\Xhangindent{1em} +%\Xafternumber{0em} +%\Xboxlinenum{1em} +% \end{verbatim} +% +% \DescribeMacro{\Xboxsymlinenum} +% \cs{Xboxsymlinenum}\oarg{s}\marg{l} is the same as \cs{Xboxlinenum} but for the line number symbol. +% +% \changes{v1.23.0}{2015/05/18}{Add \cs{Xboxlinenumalign} and \cs{Xendboxlinenumalign}.} +% \DescribeMacro{Xboxlinenumalign} +% If you put line number in box, it will be aligned left inside the box. +% However, you can change it using \cs{Xboxlinenumalign}\oarg{s}\marg{text} where \meta{text} can be the following: +% \begin{description} +% \item[L] to align left (default value); +% \item[R] to align right; +% \item[C] to center. +% \end{description} +% +% \changes{v1.23.0}{2015/05/18}{Add \cs{Xboxstartlinenum}, \cs{Xendboxstartlinenum}, \cs{Xboxendlinenum}, \cs{Xendboxendlinenum}.} +% When using \cs{Xboxlinenum}, \macpackage put all the line number description in the same box. That is, the same box will contain: the start line number, the dash, and either the end line number or the range symbol (like \verb+ff.+). +% However, it is possible to box them in two different boxes. +% \begin{itemize} +% \item \cs{Xboxstartlinenum}\oarg{s}\marg{l} will box the start line number in a box of length \meta{l}. The content will be put at the right of the box. +% \item \cs{Xboxendlinenum}\oarg{s}\marg{l} will box the dash plus the end line number or the range symbol in a box of length \meta{l}. The content will be put at the left of the box. +% \end{itemize} +% +% With these two commands, it is possible to horizontaly align the dash of line number when using critical notes, to obtain something like: +% \begin{verbatim} +% 1 +% 12-23 +% 24ff. +% \end{verbatim} +% \DescribeMacro{\Xendboxlinenum} +% \DescribeMacro{\Xendboxlinenumalign} +% \DescribeMacro{\Xendboxstartlinenumalign} +% \DescribeMacro{\Xendboxendlinenumalign} +% \changes{v1.20.0}{2015/03/22}{Add \cs{Xendboxlinenum}} +% \cs{Xendboxlinenum}\oarg{s}\marg{l}, \cs{Xendboxlinenumalign}\oarg{s}\marg{text}, \cs{Xendboxstartlinenum}\oarg{s}\marg{l}, \cs{Xendboxendlinenum}\oarg{s}\marg{l} are the same as, respectively, \cs{Xboxlinenum} and \cs{Xboxlinenumalign}, \cs{Xboxstartlinenum}, \cs{Xboxendlinenum} except in endnotes. +% +% +%\subsection{Separator between the lemma and the note} +% \subsubsection{For footnotes} +% \DescribeMacro{\Xlemmaseparator} +% By default, in a footnote, the separator between the lemma and the note is a right bracket (\cs{rbracket}). You can use \cs{Xlemmaseparator}\oarg{s}\marg{Xlemmaseparator} to change it. The optional argument can be used to specify the series in which it is used. Note that there is a non-breakable space between the lemma and the separator, but a \textbf{breakable} space between the separator and the lemma. +% +% \DescribeMacro{\Xbeforelemmaseparator} +% Using \cs{Xbeforelemmaseparator}\oarg{s}\marg{l} you can add some space between lemma and separator. If your lemma separator is empty, this space won't be printed. The default value is 0~em. +% +% \DescribeMacro{\Xafterlemmaseparator} +% Using \cs{Xafterlemmaseparator}\oarg{s}\marg{l} you can add some space between separator and note. If your lemma separator is empty, this space will not be printed. The default value is 0.5~em. +% +% \DescribeMacro{\Xnolemmaseparator} +% You can suppress the lemma separator, using \cs{Xnolemmaseparator}\oarg{s}, which is simply a alias of \cs{Xlemmaseparator}\oarg{s}\verb|{}|. +% +% \DescribeMacro{\Xinplaceoflemmaseparator} +% With \cs{Xinplaceoflemmaseparator}\oarg{s}\marg{l} you can add a space if no lemma separator is printed. The default value is 1~em. +% +% +% \subsubsection{For endnotes}\label{Xendlemmaseparator} +% \changes{v1.22.0}{2015/04/25}{Add option for lemma separator inside endnotes} +% \DescribeMacro{\Xendlemmaseparator} +% By default, there is no separator inside endnotes between the lemma and the content of the note. You can use \cs{Xendlemmaseparator}\oarg{s}\marg{Xendlemmaseparator} to change this. The optional argument can be used to specify the series in which it is used. +% An common value of \verb+<Xendlemmaseparator>+ is \verb+\rbracket+. +% +% Note that there is a non-breakable space between the lemma and the separator, but a \textbf{breakable} space between the separator and the lemma. +% +% \DescribeMacro{\Xendbeforelemmaseparator} +% Using \cs{Xendbeforelemmaseparator}\oarg{s}\marg{l} you can add some space between the lemma and the separator. If your lemma separator is empty, this space won't be printed. The default value is 0~em. +% +% \DescribeMacro{\Xendafterlemmaseparator} +% Using \cs{Xendafterlemmaseparator}\oarg{s}\marg{l} you can add some space between the separator and the content of the note. If your lemma separator is empty, this space won't be printed. The default value is 0.5~em. +% +% +% \DescribeMacro{\Xendinplaceoflemmaseparator} +% With \cs{Xendinplaceoflemmaseparator}\oarg{s}\marg{l} you can add some space if you chose to remove the lemma separator. The default value is 0.5~em. +% +% +% \subsection{Font style} +% \subsubsection{For line number} +% \DescribeMacro{\Xnotenumfont} +% \cs{Xnotenumfont}\oarg{s}\marg{command} is used to change the font style for line numbers in critical footnotes ; +% \meta{command} must be one (or more) switching command, like \cs{bfseries}. +% +% \DescribeMacro{\Xendnotenumfont} +% \cs{Xendnotenumfont}\oarg{s}\marg{command} is used to change the font style for line numbers in critical footnotes. +% \meta{command} must be one (or more) switching command, like \cs{bfseries}. +% +% \DescribeMacro{\notenumfontX} +% \cs{notenumfontX}\oarg{s}\marg{command} is used to change the font style for note numbers in familiar footnotes. +% \meta{command} must be one (or more) switching command, like \cs{bfseries}. +% +% \DescribeMacro{\Xnotefontsize} +% \cs{Xnotefontsize}\oarg{s}\marg{command} is used to define the font size of critical footnotes of the series. The default value is \cs{footnotesize}. +% The \meta{command} must not be a size in pt, but a standard \LaTeX\ size, like \cs{small}. +% +% \DescribeMacro{\notefontsizeX} +% \cs{notefontsizeX}\oarg{s}\marg{command} is used to define the font size of critical footnotes of the series. The default value is \cs{footnotesize}. +% The \meta{command} must not be a size in pt, but a standard \LaTeX\ size, like \cs{small}. +% +% \DescribeMacro{\Xendnotefontsize} +% \cs{Xendnotefontsize}\oarg{s}\marg{l} is used to define the font size of end critical footnotes of the series. The default value is \cs{footnotesize}. +% The \meta{command} must not be a size in pt, but a standard \LaTeX\ size, like \cs{small}. +% \subsubsection{For the lemma} +% \changes{v1.11.0}{2014/05/09}{Add hooks to disable the font selection for lemma in footnote.} +% \DescribeMacro{\Xlemmadisablefontselection} +% By default, font of the lemma in footnote is the same as font of the lemma in the main text. For example, if the lemma is in italic in the main text, it is also in italic in note. The \cs{Xlemmadisablefontselection}\oarg{s} command allows to disable it for a specific series. +% +% \DescribeMacro{\Xendlemmadisablefontselection} +% By default, font of the lemma in endnote is the same as font of the lemma in the main text. For example, if the lemma is in italic in the main text, it is also in italic in note. The command allows \cs{Xendlemmadisablefontselection}\oarg{s} to disable it for a specific series. +% +% +% \subsection{Styles of notes content} +% \changes{v1.21.0}{2015/04/13}{Add \cs{Xparindent} and \cs{hangindentX}} +% \DescribeMacro{\Xparindent} +% By default, \macpackage does not add indentation before the paragraphs inside critical footnotes. +% Use \cs{Xparindent}\oarg{series} to enable indentation. +% +% \DescribeMacro{\parindentX} +% By default, \macpackage does not add indentation before the paragraphs inside familiar footnotes. +% Use \cs{parindentX}\oarg{series} to enable indentation. +% +% \DescribeMacro{\Xhangindent} +% For critical notes NOT paragraphed you can define an indent with \cs{Xhangindent}\oarg{s}\marg{l}, which will be applied in the second line of notes. It can help to make distinction between a new note and a break in a note. The default value is 0~pt. +% +% \DescribeMacro{\hangindentX} +% For familiar notes NOT paragraphed you can define an indentation with \cs{Xhangindent}\oarg{s}\marg{l}, which will be applied in the second line of notes. It can help to make a distinction between a new note and a break in a note. +% +% \subsection{Arbitrary code at the beginning of notes} +% \changes{v1.1.0}{2012/09/25}{New hook to add arbitrary code at the beginning of the notes} +% The three next commands add an arbitrary code at the beginning of notes. +% As the name's space is local to the notes, you can use it to redefine some style inside the notes. +% For example, if you don't want the pstart number to be in bold, use : +% \begin{verbatim} +% \Xbhooknote{\renewcommand{\thepstart}{\arabic{pstart}.}} +% \end{verbatim} +% +% \DescribeMacro{\Xbhooknote} +% \cs{Xbhooknote}\oarg{series}\marg{code} is to be used at the beginning of the critical footnotes. +% +% +% \DescribeMacro{\bhooknoteX} +% \cs{bhooknoteX}\oarg{series}\marg{code} is to be used at the beginning of the familiar footnotes. +% +% +% \DescribeMacro{\Xendbhooknote} +% \cs{Xendbhooknote}\oarg{series}\marg{code} is to be used at the beginning of the endnotes. +% +% \subsection{Options for footnotes in columns} +% \subsubsection{Alignment} +% \changes{v1.21.0}{2015/04/13}{Add \cs{Xcolalign} and \cs{colalignX} hooks} +% By default, texts in footnotes in two or three columns are flushed left without hyphenation. +% However, you can change this with \cs{Xcolalign}\oarg{s}\marg{code}, for critical footnotes, and \cs{colalignX}\oarg{s}\marg{code}, for familiar footnotes. +% +% \verb+<code>+ must be one of the following command: +% \begin{description} +% \item[\cs{justifying}] to have text justified, as usual with \LaTeX. You can also let \verb+<code>+ empty. +% \item[\cs{raggedright}] to have text left aligned, but \emph{without hyphenation}. That is the default \Lpack{eledmac} setting. +% \item[\cs{RaggedRight}] to have text left aligned \emph{with hyphenation}. +% \item[\cs{raggedleft}] to have text right aligned, but \emph{without hyphenation}. +% \item[\cs{RaggedLeft}] to have text right aligned \emph{with hyphenation}. +% \item[\cs{centering}] to have text centered, but \emph{without hyphenation}. +% \item[\cs{Centering}] to have text centered \emph{with hyphenation}. +% \end{description} +% +% \subsubsection{Size of the columns} +% For the following four macros, be careful that the columns are made from right to left. +% +% \DescribeMacro{\Xhsizetwocol} +% \cs{Xhsizetwocol}\oarg{s}\marg{l} is used to change width of a column when critical notes are displaying in two columns. Defaut value is \verb+.45 \hsize+. +% +% \DescribeMacro{\Xhsizethreecol} +% \cs{Xhsizethreecol}\oarg{s}\marg{l} is used to change width of a column when critical notes are displaying in three columns. Defaut value is \verb+.3 \hsize+. +% +% \DescribeMacro{\hsizetwocolX} +% \cs{hsizetwocol}\oarg{s}\marg{l} is used to change width of a column when familiar notes are displaying in two columns. Defaut value is \verb+.45 \hsize+. +% +% \DescribeMacro{\hsizethreecolX} +% \cs{hsizethreecolX}\oarg{s}\marg{l} is used to change width of a column when familiar notes are displaying in three columns. Defaut value is \verb+.3 \hsize+. +% +% \subsection{Options for paragraphed footnotes} +% \subsubsection{Mark separation of notes} +% \DescribeMacro{\Xafternote} \DescribeMacro{\afternoteX} +% You can add some space after a note by using \cs{Xafternote}\oarg{s}\marg{l} (for critical footnotes) or \cs{afternoteX}\oarg{s}\marg{l} (for familiar footnotes). The default value is \verb|1em plus.4em minus.4em|. +% +% \DescribeMacro{\Xparafootsep}\DescribeMacro{\parafootsepX} +% For paragraphed footnotes (see below), you can choose the separator between each note by using \cs{Xparafootsep}\oarg{s}\marg{text} for critical notes and \cs{parafootsepX} for familiar notes. +% A common separator is the double pipe ($\parallel$), which you can set by using \cs{parafootsep}\verb+{$\parallel$}+. +% +% Note that if the symbol defined by \cs{Xsymlinenum} must be used at the beginning of a note, the \cs{Xparafootsep} / \cs{parafootsepX} is not used before this note. +% +% \subsubsection{Ragging} +% \changes{v1.12.0}{2014/08/05}{New options for ragged-paragraph notes} +% \DescribeMacro{\Xragged} +% Text in paragraphed critical notes is justified, but you can use \cs{Xragged}\oarg{s}+{L}+ if you want it to be ragged left, or \cs{Xragged}\oarg{s}+{R} if you want it to be ragged right. + +% \DescribeMacro{\raggedX} +% Text in paragraphed footnotes is justified, but you can use \cs{raggedX}\oarg{s}+{L}+ if you want it to be ragged left, or \cs{raggedX}\oarg{s}+{R} if you want it to be ragged right. +% +% \subsection{Options for block of notes} +% \subsubsection{Text before notes} +% \changes{v1.1.0}{2012/09/12}{New options for block of notes.} +% \DescribeMacro{\Xtxtbeforenotes} +% You can add some text before critical notes with \cs{Xtxtbeforenotes}\oarg{s}\marg{text}. +% +% \subsubsection{Spacing} +% \DescribeMacro{\Xbeforenotes} +% You can change the vertical space printed before the rule of the critical notes with \cs{Xbeforenotes}\oarg{s}\marg{l}. +% The default value is \verb|1.2em plus .6em minus .6em|. +% +% \textbf{Be careful, the standard \LaTeX\ footnote rule, which is used by \Lpack{eledmac}, decreases by 3pt. This 3pt decrease is not changed by this command..} +% \DescribeMacro{\beforenotesX} +% +% You can change the vertical space printed before the rule of the familiar notes with \cs{beforenotesX}\oarg{s}\marg{l}. +% The default value is \verb|1.2em plus .6em minus .6em|. +% +% \textbf{Be careful, the standard \LaTeX\ footnote rule, which is used by \Lpack{eledmac}, decreases 3pt. These 3pt are not changed by this command.} +% +% \DescribeMacro{\preXnotes} +% You can set the space before the first series of critical notes printed on each page +% and set a different amount of space for subsequent the series on the page. +% You can do it with \cs{preXnotes}\marg{l}. Default value is \verb+0pt+. +% You can disable this feature by setting the length to 0pt. +% +% +% +% \DescribeMacro{\prenotesX} +% You can want the space before the first printed (in a page) series of familiar notes not to be the same as before other series. Default value is \verb+0pt+. +% You can do it with \cs{prenotesX}\marg{l}. +% You can disable this feature by setting the length to 0~pt. +% +% \DescribeMacro{\preXnotes} +% You can set the space before the first series of critical notes printed on each page +% and set a different amount of space for subsequent the series on the page. +% You can do it with \cs{preXnotes}\marg{l}. Default value is \verb+0pt+. +% You can disable this feature by setting the length to 0pt. +% +% +% +% \DescribeMacro{\prenotesX} +% You can want the space before the first printed (in a page) series of familiar notes not to be the same as before other series. Default value is \verb+0pt+. +% You can do it with \cs{prenotesX}\marg{l}. +% You can disable this feature by setting the length to 0~pt. +% +% +% \subsubsection{Rule} +% \changes{v1.12.0}{2014/08/05}{New hooks: \cs{Xafterrule} and \cs{afterruleX}} +% \DescribeMacro{\Xafterrule} +% You can change the vertical space printed after the rule of the critical notes with \cs{Xafterrule}\oarg{s}\marg{l}. +% The default value is \verb|0pt|. +% +% \textbf{Be careful, the standard \LaTeX\ footnote rule, which is used by \Lpack{eledmac}, adds 2.6pt. These 2.6pt are not changed by this command.} +% +% +% \DescribeMacro{\afterruleX} +% You can change the vertical space printed after the rule of the familiar notes with \cs{beforenotesX}\oarg{s}\marg{l}. +% % The default value is \verb|0pt|. +% +% \textbf{Be careful, the standard \LaTeX\ footnote rule, which is used by \Lpack{eledmac}, adds 2.6pt. These 2.6pt are not changed by this command.} +% +% +% \subsubsection{Maximum height} +% \DescribeMacro{\Xmaxhnotes}\label{Xmaxhnotes} +% By default, one series of critical notes can take 80\% of the page size, before being broken to the next page. +% If you want to change the size use \cs{Xmaxhnotes}\oarg{s}\marg{l}. +% Be careful : the length can't be flexible, and is relative to the the current font. +% For example, if you want the note to take, at most, 33% of the text height, do \verb|\Xmaxhnotes{.33\textheight}|. +% +% \DescribeMacro{\maxhnotesX} +% \cs{maxhnotesX}\oarg{s}\marg{l} is the same as previous, but for familiar footnotes. +% +% Be careful with the two previous commands. +% Actually, for technical purposes, one paragraphed note is considered as one block. +% Consequently, it ca not be broken between two pages, even if you used these commands. +% The debug is in the todolist. +% \subsection{Footnotes and the \parpackage columns} +% \changes{v1.13.0}{2014/09/16}{Add \cs{Xnoteswidthliketwocolumns} and \cs{noteswidthliketwocolumnsX}} +% \DescribeMacro{Xnoteswidthliketwocolumns}\DescribeMacro{noteswidthliketwocolumnsX} +% If you use \Lpack{eledpar} \cs{columns} macro, you can call : +% \begin{itemize} +% \item \cs{Xnoteswidthliketwocolumns}\oarg{s} to create critical notes with a two-column size width. Use \cs{Xnoteswidthliketwocolumns}\oarg{s}\verb+[false]+ to disable it. +% \item \cs{noteswidthliketwocolumnsX}\oarg{s} to create familiar notes with a two-column size width. Use \cs{noteswidthliketwocolumnsX}\oarg{s}\verb+[false]+ to disable it. +% \end{itemize} +% \subsection{Endnotes in one paragraph} +% \changes{v1.12.0}{2015/04/25}{Add \cs{Xendparagraph} and related settings.} +% \DescribeMacro{\Xendparagraph} +% By default, any new endnote starts a new paragraph. +% Use \cs{Xendparagraph}\oarg{series} to have all end notes of one given series set in one paragraph. +% +% \DescribeMacro{\Xendafternote} +% You can add some space after a endnote series by using \cs{Xendafternote}\oarg{s}\marg{l}. The default value is \verb|1em plus.4em minus.4em|. +% +% \DescribeMacro{\Xendsep} +% You can choose the separator between each note by \cs{Xendsep}\oarg{s}\marg{text}. A common separator is the double pipe (\verb+$||$+), which you can set by using \cs{Xendsep}\verb+{$\parallel$}+. +% +% \section{Fonts}\label{fonts} +% One of the most important features of the appearance of the notes, +% and indeed of your whole document, will be the fonts used. We will +% first describe the commands that give you control over the +% use of fonts in the different structural elements of the document, +% especially within the notes, and then in +% subsequent sections specify how these commands are used. +% +% For those who are setting up for a large job, here is +% a list of the complete set of \macpackage macros relating to fonts that +% are intended for manipulation by the user: +% \cs{endashchar}, +% \cs{fullstop}, +% \cs{numlabfont}, and +% \cs{rbracket}. +% +% +% \DescribeMacro{\numlabfont} +% Line numbers for the main text +% are usually printed in a smaller font in the margin. +% The \cs{numlabfont} macro is provided as a standard name for +% that font: it is initially defined as \\ +% \verb"\newcommand{\numlabfont}{\normalfont\scriptsize}" \\ +% You might wish to use a different font if, for example, +% you preferred to have these line numbers printed using +% old-style numerals. +% +% +% +% \DescribeMacro{\endashchar} +% \DescribeMacro{\fullstop} +% \DescribeMacro{\rbracket} +% \font\teni=cmmi10 +% A relatively trivial matter relates to punctuation. In your +% footnotes, there will sometimes be spans of line numbers like +% this: 12--34, or lines with sub-line numbers like this: 55.6. The +% en-dash and the full stop are taken from the same font as the +% numbers, and it all works nicely. But what if you wanted to use +% old-style numbers, like {\teni12} and {\teni34}? These look nice +% in an edition, but when you use the fonts provided by \PlainTeX\ +% they are taken from a math font which does not +% have the en-dash or full stop in the same places as a text font. +% If you (or your macros) just typed \verb"$\oldstyle 12--34$" or +% \verb"$\oldstyle 55.6$" you would get `{\teni12--34}'and +% `{\teni55.6}'. So we define \cs{endashchar} and +% \cs{fullstop}, which produce an en-dash and a full stop +% respectively from the normal document font, whatever font you are using +% for the numbers. These two macros are used in the +% macros which format the line numbers in the margins and +% footnotes, instead of explicit punctuation. +% We also define an \cs{rbracket} macro for the +% right square bracket printed at the end of the lemma in many +% styles of textual notes (including \macpackage's standard style). +% For \Lpack{polyglossia}, when the lemma is RTL, the bracket automatically switches to a left bracket. +% +% +% +% \DescribeMacro{\select@lemmafont} +% We will briefly discuss \cs{select@lemmafont} +% here because it is important to know about +% it now, although it is not one of the macros you would expect to +% change in the course of a simple job. Hence it is `protected' +% by having the @-sign in its name. +% +% When you use the \cs{edtext} macro to mark a word in your text +% as a lemma, that word will normally be printed again in your +% apparatus. If the word in the text happens to be in a font such +% as italic or bold you would probably expect it to appear in the +% apparatus in the same font. This becomes an absolute necessity +% if the font is actually a different script, such as Arabic or +% Cyrillic. \cs{select@lemmafont} does the work of +% decoding \macpackage's data about the fonts used to print the lemma in +% the main text and calling up those fonts for printing the lemma in +% the note. +% +% \cs{select@lemmafont} is a macro that takes one long +% argument---the cluster of line numbers passed to the note +% commands. This cluster ends with a code indicating what +% fonts were in use at the start of the lemma. +% \cs{select@lemmafont} selects the appropriate font for the +% note using that font specifier. +% +% \Macpackage uses \cs{select@lemmafont} in a standard footnote +% format macro called \cs{normalfootfmt}. The footnote formats +% for each of the layers \texttt{A} to \texttt{E} are \cs{let} equal +% to \cs{normalfootfmt}. So all the layers of the footnotes are +% formatted in the same way. +% +% +% \section{Verse}\label{verse} +% +% \subsection{Basic} +% +% \DescribeMacro{\stanza} +% \DescribeMacro{\&} +% Use \verb?\stanza? at the start of a stanza. Each line in a stanza +% is ended by an ampersand (\&), and the stanza itself is ended +% by putting \verb?\&? at the end of the last line. +% +% +% \subsection{Define stanza indents} +% \DescribeMacro{\stanzaindentbase} +% Lines within a stanza may be indented. The indents are integer multiples +% of the length \verb?\stanzaindentbase?, whose default value is 20pt. +% +% \DescribeMacro{\setstanzaindents} +% In order to use the stanza macros, \textbf{one must set the indentation values}. +% First the value of \verb+\stanzaindentbase+ should be set, +% unless the default value 20pt is desired. +% Every stanza line indentation is a multiple of this. +% +% To specify these +% multiples one invokes, for example \\ +% \verb+\setstanzaindents{3,1,2,1,2}+. \\ +% +% The numerical entries must be whole numbers, 0 or greater, separated by +% commas without embedded spaces. The first entry +% gives the hanging indentation to be used if the stanza line requires more +% than one print line. +% +% If it is known that each stanza line will fit on more than one print line, +% then this first entry should be 0; \TeX\ does less +% work in this case, but no harm ensues if the hanging indentation is not +% 0 but is never used. +% +% If you want the hanging verse to be flush right, +% you can use \cs{sethanginsymbol}: see p.~\reff{hfillhanging}. +% +% Enumeration is by stanza lines, not by print lines. +% In the above example the lines are indented one unit, two units, one unit, +% two units, with 3 units of hanging indentation in case a stanza line is too +% long to fit on one print line. +% +% \subsection{Repeating stanza indents} +%\changes{v0.13.0}{2011/11/08}{New stanzaindentsrepetition counter to repeat stanza indents every \emph{n} verses.} +% \label{stanzaindentsrepetition}Since version 0.13, if the indentation is repeated every \emph{n} verses of the stanza, you can define only the \emph{n} first indentations, and say they are repeated, defining the value of the \verb+stanzaindentsrepetition+ counter at \emph{n}. For example: +%\begin{verbatim} +%\setstanzaindents{5,1,0} +%\setcounter{stanzaindentsrepetition}{2} +% \end{verbatim} +% +% is like +%\begin{verbatim} +%\setstanzaindents{0,1,0,1,0,1,0,1,0,1,0} +% \end{verbatim} +% +% \textbf{Be careful: the feature is changed in eledmac 1.5.1. See \reff{change151}.} +% +%If you don't use the \verb+stanzaindentsrepetition+ counter, make sure you have at least one more numerical +% entry in \verb+\setstanzavalues+ than the number of lines in the stanza. +% +% If you want to disable this feature again, just put the counter to 0: +% \begin{verbatim} +% \setcounter{stanzaindentsrepetition}{0} +% \end{verbatim} +% The macros make no restriction on the number of lines in a stanza. +% Stanza indentation values (and penalty values) obey \TeX's grouping +% conventions, so if one stanza among several has a different structure, +% its indentations (penalties) may be set within a group; the prior values +% will be restored when the group ends. +% +% \subsection{Manual stanza indent} +% \DescribeMacro{\stanzaindent} +% \DescribeMacro{\stanzaindent*} +% You can set the indent of some specific verse by calling \cs{stanzaindent}\marg{value} at the beginning of the verse, before any other character. In this case, the indent defined by \cs{setstanzaindents} for this verse is skipped, and \marg{value} is used instead. +% +% If you use the mechanism of indent repetition, the next verse will be printed as it should be even if the current verse would have its normal indent value. +% In other words, using \cs{stanzaindent} in a verse does not shift the indent repetition. +% +% However, if you want to shift the indent repetition, so the next verse has the indent normally used for the current verse, use \cs{stanzaindent*} instead of \cs{stanzaindent}. +% \subsection{Stanza breaking} +% \DescribeMacro{\setstanzapenalties} +% When the stanzas run over several pages, it is often +% desirable that page breaks should arise between certain lines in the +% stanza, so a facility for including penalties after stanza lines is +% provided. If you are satisfied with the page breaks, you need not set the +% penalty values. +% +% The command \\ +% \verb+\setstanzapenalties{1,5000,10100,5000,0}+ \\ +% results in a penalty of +% 5000 being placed after the first and third lines of the stanza, and a +% penalty of ${-100}$ after the second. +% +% The first entry ``1'' is a control +% value. If it is zero, then no penalties are passed on to \TeX, +% which is the default. Values between 0 and 10000 are penalty +% values; values between 10001 and 20000 have 10000 subtracted and the result +% is given as a negative penalty. The mechanism used for indentations and +% penalties requires unsigned values less than 32768. No penalty is placed +% after the last line, so the final \verb+,0+ in then example above could +% be omitted. A penalty of 10000 will prevent a page break; such a +% penalty is included automatically where there is stanza hanging indentation. +% A penalty of ${-10000}$ (corresponding to the entry value 20000 in this +% context) forces a page break. Values in between act as suggestions as to the +% desirability of a page break at a given line. There is a subtle interaction +% between penalties and \emph{glue}, so it may take some adjustment of skips +% and penalties to achieve the best results. +% \subsection{Hanging symbol} +% It is possible to insert a symbol in each line of hanging verse, as in French typography for `['. To insert it in \macpackage, use macro \DescribeMacro{\sethangingsymbol}\cs{hangingsymbol}\meta{h} with this code. +% In the example of French typography, do +% \begin{verbatim} +% \sethangingsymbol{[\,} +% \end{verbatim} +% \label{hfillhanging} You can also use it to force hanging verse to be flush right: +% \begin{verbatim} +% \sethangingsymbol{\protect\hfill} +% \end{verbatim} +% \subsection{Long verse and page break} +% If you want to prevent page breaks inside long verses, use the option \verb+nopbinverse+ when loading package, or use \cs{lednopbinversetrue}. +% Read \reff{lednopbinversetrue} for further details. +% \subsection{Hanging symbol} +% It is possible to insert a symbol on each line of hanging verse, as in French typography for `['. To insert in \macpackage, use macro \DescribeMacro{\sethangingsymbol}\cs{sethangingsymbol}\marg{symbol}. Fro exemple: +% \begin{verbatim} +% \hangingsymbol}{[\,} +% \end{verbatim} +% \subsection{Content before/after verses} +% It is possible to add content, like a subtitle or a spacing, before or after verse: +% \begin{itemize} +% \item \cs{stanza} command can take a optional argument (in brackets). Its content will be printed before the stanza. +% \item \verb+&+ can be replaced by \cs{newverse} with two optional arguments (in brackets). The first will be printed after the current verse, the second before the next verse. +% \item \verb+\&+ can take a optional argument (in brackets). Its content will be printed after the stanza. +% \end{itemize} +% \subsection{Various tools} +% \DescribeMacro{\ampersand} +% If you need to print an \& symbol in a stanza, use the \verb?\ampersand? +% macro, not \verb?\&? which will end the stanza. +% +% +% \DescribeMacro{\flagstanza} +% Putting \cs{flagstanza}\oarg{len}\marg{text} at the start of a line +% in a stanza (or elsewhere) will typeset \meta{text} at a +% distance \meta{len} before +% the line. The default \meta{len} is \verb?\stanzaindentbase?. +% +% For example, to put a verse number before the first line of a stanza +% you could proceed along the lines: +% \begin{verbatim} +% \newcounter{stanzanum} +% \setcounter{stanzanum}{0} + \newcommand{\numberit}{% + \refstepcounter{stanzanum}% + \flagstanza{\thestanzanum}% + } +% ... +% \stanza[\numberit] +% \numberit First line...& +% rest of stanza\& +% +% \stanza[\numberit] +% First line, second stanza... +% \end{verbatim} +% \section{Grouping} +% In a \verb?minipage? environment \LaTeX\ changes \verb?\footnote? numbering from +% arabic to alphabetic and puts the footnotes at the end of the minipage. +% +% \DescribeEnv{minipage} +% You can put numbered text with critical footnotes in a minipage and +% the footnotes are set at the end of the minipage. +% +% You can also put familiar footnotes (see section~\ref{sec:desc:familiar}) +% in a minipage but unlike with \verb?\footnote? the numbering scheme is +% unaltered. +% +% \DescribeEnv{ledgroup}\label{ledgroup} +% Minipages, of course, are not broken across pages. Footnotes in a \verb?ledgroup? +% environment are typeset at the end of the environment, as with minipages, +% but the environment includes normal page breaks. The environment makes no +% change to the textwidth so it appears as normal text; it just might be that +% footnotes appear in the middle of a page, with text above and below. +% +% \DescribeEnv{ledgroupsized} +% The \verb?ledgroupsized? environment is similar to \verb?ledroup? except that +% you must specify a width for the environment, as with a minipage. \\ +% \verb?\begin{ledgroupsized}?\oarg{pos}\marg{width}. +% +% The required \meta{width} argument is the text width for the environment. The +% optional \meta{pos} argument is for positioning numbered text within +% the normal textwidth. It may be one of the characters: +% \begin{itemize} +% \item[l] (left) numbered text is flush left with respect to the normal +% textwidth. This is the default. +% \item[c] (center) numbered text is in the center of the textwidth. +% \item[r] (right) numbered text is flush right with respect to the +% normal textwidth. +% \end{itemize} +% Note that normal text, footnotes, and so forth are all flush left. +% +% \verb?\begin{ledgroupsized}{\textwidth}? is effectively the same as +% \verb?\begin{ledgroup}? +% +% +% +% +% +% \section{Cross referencing} +% \changes{v1.12.0}{2014/08/05}{Add hyperlink to crossref (needs \Lpack{hyperref} package).} +% \label{crossref}\relax +% The package provides a simple cross-referencing facility that allows +% you to mark places in the text with labels, and generate page and +% line number references to those places elsewhere +% using those labels. +% +% \subsection{Basic use} +% +% \DescribeMacro{\edlabel} +% First you place a label in the text using the command +% \cs{edlabel}\marg{lab}. \meta{lab} can be almost anything you like, including +% letters, numbers, punctuation, or a combination---anything but spaces; +% you might say \cs{edlabel}\verb+{toves-3}+, for example.\footnote{More precisely, +% you should stick to characters in the \TeX\ categories of ``letter'' +% and ``other''.} +% +% \DescribeMacro{\edpageref} +% \DescribeMacro{\edlineref} +% \DescribeMacro{\sublineref} +% \DescribeMacro{\pstartref} +% Elsewhere in the text, either before or after the \cs{edlabel}, +% you can refer to its location via \cs{edpageref}\marg{lab}, or +% \cs{edlineref}\marg{lab}% +% will produce, respectively, the page, line, sub-line and pstart on which +% the \cs{edlabel}\marg{lab} command occurred. +% +% +% An \cs{edlabel} command may appear in the main text, or in the +% first argument of \cs{edtext}, but not in the apparatus itself. But +% \cs{edpageref}, \cs{edlineref}, \cs{sublineref}, \cs{pstartref} commands can also be used in +% the apparatus to refer to \cs{edlabel}s in the text. +% +% The \cs{edlabel} command works by writing macros to \LaTeX +% \file{.aux} file. You will need to process +% your document through \LaTeX\ twice in order for the references to +% be resolved. +% +% You will be warned if you say \verb"\edlabel{foo}" and \verb"foo" +% has been used as a label before. The \verb"ref" commands will +% return references to the last place in the file marked with this +% label. You will also be warned if a reference is made to an +% undefined label. (This will also happen the first time you +% process a document after adding a new \cs{edlabel} command: the +% auxiliary file will not have been updated yet.) +% +% \subsection{Refer to a critical notes} +% If you want to refer to a word inside an +% \cs{edtext}\marg{lemma}\marg{app} command, the \cs{edlabel} should be defined inside +% the first argument, e.g., +% \begin{verbatim} +% The \edtext{creature\edlabel{elephant} was quite +% unafraid}{\Afootnote{Of the mouse, that is.}} +% \end{verbatim} +% +% If you add the \cs{edlabel} inside some \cs{Xfootnote} command, +% it will refer to that note, and a suffix \emph{n} will be added to the reference. +% You can redefine this suffix by redefining the command \cs{ledinnotemark}. +% Its actual definition is: +% \begin{verbatim} +% \newcommand{\ledinnotemark}[1]{#1\emph{n}} +% \end{verbatim} +% +% \subsection{Cross-referencing which return a number in any case} +% Where \verb+#1+ stands for the reference. +% \DescribeMacro{\xpageref} +% \DescribeMacro{\xlineref} +% \DescribeMacro{\xsublineref} +% \DescribeMacro{\xpstartref} +% +% However, there are situations in which you will want \macpackage to +% return a number without displaying any +% warning messages about undefined labels or the like: if you want to +% use the reference in a context where \LaTeX{} is looking for a +% number, such a warning will lead to a complaint that the number +% is missing. +% This is the case for references used within the +% argument to \cs{linenum}, for example (see \reff{linenum}). +% +%For this situation, +% four variants of the reference commands, with the \verb"x" +% prefix, are supplied: \cs{xpageref}, \cs{xlineref}, \cs{xsublineref} and \cs{xpstartref}. +% They have these limitations: +% \begin{itemize} +% \item They will not tell you if the label is undefined. +% \item They must +% be preceded in the file by at least one of the four other +% cross-reference commands---e.g., a \verb"\edlabel{foo}" command, +% even if you never refer to that label---since those commands can all +% do the necessary processing of the \file{.aux} file, and the \cs{x...} +% ones cannot. +% \item When \Lpack{hyperref} is loaded, the hyperref link will not be added. (Indeed, +% it is not a limitation, but a feature.) +% \end{itemize} +% +% \subsubsection{Cross-referencing in order to define line number of a critical note} +% \DescribeMacro{\xxref} +% The macros \cs{xxref} and +% \cs{edmakelabel} let you manipulate numbers +% and labels in ways which you may find helpful in tricky +% situations. +% +% The \cs{xxref}\marg{lab1}\marg{lab2} command generates a reference to a sequence of +% lines, for use in the second argument of \cs{edtext}. +% It takes two arguments, both of which are +% labels: e.g., \verb"\xxref{mouse}{elephant}". It calls \cs{linenum} +% (q.v., \reff{linenum} above) and sets the beginning page, +% line and subline numbers to those of the place where +% \verb"\edlabel{mouse}" was placed, and the ending numbers to those where +% \verb"\edlabel{elephant}" occurs. +% +% \subsection{Not automatic cross-referencing} +% \DescribeMacro{\edmakelabel} +% Sometimes the \cs{edlabel} command cannot be used to specify exactly +% the page and line desired---for example, if you want to refer to a +% page and line number in another volume of your edition. In such +% cases, you can use the \cs{edmakelabel}\marg{lab}\marg{numbers} +% macro so that you can `roll your own' label. +% +% For example, if you say `\verb"\edmakelabel{elephant}{10|25|0}"' +% you will create a new +% label, and a later call to \verb"\edpageref{elephant}" would print +% `10' and \verb"\lineref{elephant}" would print `25'. The sub-line +% number here is zero. It is usually best to collect your +% \cs{edmakelabel} statements near the top of your document, so that +% you can see them at a glance. +% \subsection{Normal \LaTeX\ cross-referencing} +% \DescribeMacro{\label} +% \DescribeMacro{\ref} +% \DescribeMacro{\pageref} +% \changes{v0.2.1}{2003/08/25}{Added text about normal labeling} +% The normal \cs{label}, \cs{ref} and \cs{pageref} macros may be used +% within numbered text, and operate in the familiar fashion. +% \subsection{References to lines commented in the apparatus} +% \changes{v1.21.0}{2015/03/09}{Add \cs{applabel} and related} +% You may want to make a cross-reference to a passage that is referred to by \cs{edtext}. +% \Macpackage provides specific tools for this scenario. +% +% \DescribeMacro{\applabel} +% If you use \cs{applabel}\marg{label} inside the second argument of a \cs{edtext}, +% \Macpackage will add a \cs{edlabel} at the beginning and end of the marked passage. +% The label at the beginning of the passage will have the title \meta{label}\verb+:start+, while the label at the end will have the title \meta{label}\verb+:end+. +% +% If you use \cs{linenum} (\reff{linenum}) to +% refer to these labels, \macpackage will use your line settings to refer +% to the passage. +% +% \DescribeMacro{\appref}\DescribeMacro{\apprefwithpage} +% You can also use \cs{appref}\marg{label} and +% \cs{apprefwithpage}\marg{label} to refer to these lines. +% The first one will print the lines as they are printed in the critical footnotes, +% while the second will print the lines as they are printed in endnotes. +% +% \DescribeMacro{\setapprefprefixsingle}\DescribeMacro{\setapprefprefixmore} +% If you use \cs{setapprefprefixsingle}\marg{prefix}, \meta{prefix} will be printed +% before the line numbers of a \cs{appref}-reference. +% If you use \cs{setapprefprefixmore}\marg{prefix}, \meta{prefix} will be printed +% before the line numbers, if you refer to more than one line. +% +% For example, you may use: +% \begin{verbatim} +% \setapprefprefixsingle{line~} +% \setapprefprefixmore{lines~} +% \end{verbatim} +% +% Note that if you have not used \cs{setapprefprefixmore} is empty, argument of \cs{setapprefprefixsingle} will used in any case. +% +% \DescribeMacro{\Xtwolinesappref} +% \DescribeMacro{\Xmorethantwolinesappref} +% \DescribeMacro{\Xtwolinesbutnotmoreappref} +% \DescribeMacro{\Xtwolinesonlyinsamepage} +% If you use \cs{Xtwolines}, \cs{Xmorethantwolines}, \cs{Xtwolinesbutnotmore} and/or \cs{Xtwolinesonlyinsamepage} +% (\reff{Xtwolines}) \emph{without the optional +% series argument}, the setting will also be available for \cs{appref}. +% +% The commands \cs{Xtwolinesappref}\marg{text}, +% \cs{Xmorethantwolinesappref}\marg{text}, \cs{Xtwolinesbutnotmoreappref} \cs{Xtwolinesonlyinsamepageappref} can also be used, if you +% only want to change the reference style of \cs{appref}. +% +% It is possible to disable this setting for a specific \cs{appref} command by +% using \cs{appref}\verb+[fulllines]+\marg{label}. +% +% +% \DescribeMacro{\Xendtwolinesapprefwithpage} +% \DescribeMacro{\Xendmorethantwolinesapprefwithpage} +% \DescribeMacro{\Xendtwolinesbutnotmoreapprefwithpage} +% \DescribeMacro{\Xendtwolinesonlyinsamepageapprefwithpage} +% If you use one of \cs{Xendtwolines}, \cs{Xendmorethantwolines}, \cs{Xendtwolinesbutnotmore}, +% \cs{Xendtwolinesonlyinsamepage}) +% (\reff{Xendtwolines}) \emph{without the optional +% series argument}, the setting will also be available for \cs{apprefwithpage}. +% +% The commands \cs{Xendtwolinesappref}\marg{text}, +% \cs{Xendmorethantwolinesappref}\marg{text}, \cs{Xendtwolinesbutnotmoreappref}, \cs{Xendtwolinesonlyinsamepageappref} can also be used, if you +% only want to change the reference style of \cs{apprefwithpage}. +% +% It is possible to disable this setting for a specific \cs{apprefwithpage} command by +% using \cs{apprefwithpage}\verb+[fulllines]+\marg{label}. +% +% \section{Side notes} +% +% \subsection{Basis} +% The \cs{marginpar} command does not work in numbered text. Instead +% the package provides for non-floating sidenotes in either margin. +% +% \DescribeMacro{\ledinnernote} +% \DescribeMacro{\ledouternote} +% \cs{ledinnernote}\marg{text} will put \meta{text} into the inner margin level +% with where the command was issued. Similarly, \cs{ledouternote}\marg{text} +% puts \meta{text} in the outer margin. +% +% \changes{v1.12.0}{2014/08/05}{Add \cs{ledinnernote} and \cs{ledouternote} commands.} +% \changes{v1.12.3}{2014/08/15}{Debug \cs{ledinnernote} and \cs{ledouternote} commands in the top of pages.} +% \DescribeMacro{\ledleftnote} +% \DescribeMacro{\ledrightnote} +% \changes{v1.0.0}{2012/09/15}{Possibility to have commands in sidenotes.} +% \DescribeMacro{\ledsidenote} +% \DescribeMacro{\sidenotemargin} +% \cs{ledsidenote}\marg{text} will put \meta{text} into the margin specified +% by the current setting of \cs{sidenotemargin}\marg{location}. The +% permissible value for \meta{location} is one out of the list +% \texttt{left}, \texttt{right}, \texttt{inner}, or \texttt{outer}, for +% example \verb?\sidenotemargin{outer}?. The package's default setting +% is \\ +% \verb?\sidenotemargin{right}? \\ +% to typeset \cs{ledsidenote}s in the right hand margin. +% This is the opposite +% to the default margin for line numbers. The style for a \cs{ledsidenote} +% follows that for a \cs{ledleftnote} or a \cs{ledrightnote} depending +% on the margin it is put in. +% +% If two, say, \cs{ledleftnote}, commands are called in the same line the +% second \meta{text} will obliterate the first. There is no problem though with +% having both a left and a right sidenote on the same line. +% \subsection{Setting} +% \subsubsection{Width} +% \DescribeMacro{\ledlsnotewidth} +% \DescribeMacro{\ledrsnotewidth} +% The left sidenote text is put into a box of width \cs{ledlsnotewidth} +% and the right text into a box of width \cs{ledrsnotewidth}. These +% are initially set to the value of \cs{marginparwidth}. +% +% \subsubsection{Vertical position} +% \DescribeMacro{\rightnoteupfalse} +% \DescribeMacro{\leftnoteupfalse} +% By default, sidenotes are placed to align with the last line of the note to which it refers. +% If you want they to be placed to align with the first line of the note to which it refers, use \cs{leftnoteupfalse} (for left note) and/or \cs{rightnoteupfalse} (for right note). +% +% \subsubsection{Distance to the main text } +% \DescribeMacro{\ledlsnotesep} +% \DescribeMacro{\ledrsnotesep} +% The texts are put a distance \cs{ledlsnotesep} (or \cs{ledrsnotesep}) +% into the left (or right) margin. These lengths are initially set to +% the value of \cs{linenumsep}. +% +% \DescribeMacro{\ledlsnotefontsetup} +% \DescribeMacro{\ledrsnotefontsetup} +% These macros specify how the sidenote texts are to be typeset. The +% initial definitions are: +% \begin{verbatim} +% \newcommand*{\ledlsnotefontsetup}{\raggedleft\footnotesize}% left +% \newcommand*{\ledrsnotefontsetup}{\raggedright\footnotesize}% right +% \end{verbatim} +% These can of course be changed to suit. +% +% \subsubsection{Separator between notes} +% \DescribeMacro{\setsidenotesep} +% If you have two or more sidenotes for the same line, they are separated by a comma. +% But if you want to change this separator, you can use \cs{setsidenotesep}\marg{sep}. +% \section{Indexing} +% \subsection{Basis} +% \DescribeMacro{\edindex} +% \LaTeX\ provides the |\index|\marg{item} command for specifying that \meta{item} +% and the current page number should be added to the raw index (\file{idx}) file. +% The |\edindex|\marg{item} macro can be used in numbered text to specify +% that \meta{item} and the current page \& linenumber should be added to +% the raw index file. +% +% Note that the file \verb+.idx+ will contain the right reference only after the third run, because of the internal indexing mechanism of \Lpack{eledmac}. +% That means you must first run three times (Xe/Lua)\LaTeX, then run \verb+makeindex+ and finally run again (Xe/Lua)\LaTeX to get an index with the right page numbers. +% +% If the \Lpack{imakeidx} or \Lpack{indextools} package is used then the macro takes an optional +% argument, which is the name of a raw index file. For example +% |\edindex[line]{item}| will use |line.idx| as the raw file instead of +% |\jobname.idx|. +% +% The minimal version of \Lpack{imakeidx} package to be used is the version 1.3a uploaded on CTAN on 2013/07/11. +% +% Be careful with the order of package loading and index declaration. You must use this order: +% \begin{enumerate} +% \item Load \Lpack{imakeidx} or \Lpack{indextools} . +% \item Load \Lpack{eledmac}. +% \item Declare the index with the macro \cs{makeindex} of \Lpack{imakeidx}/\Lpack{indextools}. +% \end{enumerate} +% \subsection{Separator between page and line numbers} +% \DescribeMacro{\pagelinesep} +% The page \& linenumber combination is written as |page\pagelinesep line|, +% where the default definition is |\newcommand{\pagelinesep}{-}| so that +% an item on page 3, line 5 will be noted as being at |3-5|. You can +% renew |\pagelinesep| to get a different separator. +% +% |-| is the default +% separator used by the \textsc{MakeIndex} program. +% +% Consequently, if you want to use an other \cs{pagelinesep}, you have to configure your \verb+.ist+ index style file. For example if you use \verb+:+ as separator\footnote{For further detail, you can read \url{http://tex.stackexchange.com/a/32783/7712}.}. +% \begin{verbatim} +% page_compositor ":" +% delim_r ": +% \end{verbatim} +% +% Read the \textsc{MakeIndex} program's handbook about the \verb+.ist+ file. +% \subsection{Using xindy}\label{xindy} +% Should you decide to use \verb+xindy+ instead of \verb+makeindex+ +% to transform your \verb+.idx+ files into \verb+.ind+ files, +% you must use some specific configuration file (\verb+.xdy+) so that +% \verb+xindy+ can understand \Lpack{eledmac} reference syntax of which the scheme is:\\ +% \verb+pagenumber-linenumber+ +% +% An example of such a file is provided in the ``\href{examples/.}{examples}'' folder. +% Read the xindy handbook to learn how to use it.\footnote{Or, for people +% who read French, read \url{http://geekographie.maieul.net/174}.} +% +% This file also provides, with an explanation, the settings that are needed to put +% \macpackage lines numbers in parenthesis, in order +% to make a better distinction between line numbers and page ranges. +% +% In any case, you must load \macpackage with the \verb+xindy+ option, +% in order to generate a \verb|.xdy| file which is specific to your document. +% This file is needed by the \verb+.xdy+ example file which is in the ``\href{examples/.}{examples}'' folder. +% Its default name is \verb+reledmac-markup-attr.xdy+, +% but you can change it by using your own as an argument of the \verb|xindy+hyperref| option. +% +% If you chose to use both \verb+xindy+ and the \verb+hyperref+ package, +% you must do three more things: +% \begin{enumerate} +% \item Use \verb|xindy+hyperref| option when loading the \macpackage package. +% When you run (Xe/Lua)\LaTeX with this option, a \verb+.xdy+ configuration file will be generated with all the settings needed to allow internal hyperlinking in each index entry which is created by \cs{edindex}. +% \item Use \verb+hyperindex=false+ option when loading hyperref. +% \item Uncomment --- by removing the semicolons at the beginning of the relevant lines --- some lines in the <code>.xdy</code> file provided in the ``\href{examples/.}{examples}'' folder in order to restore internal links in the index to be used by the standard \verb+index+ command.\footnote{These are the recommended lines to provide the best possible compatibility between hyperref and xindy, even without using \macpackage.}. +% \end{enumerate} +% \subsection{Advanced setting} +% \DescribeMacro{\edindexlab} +% The \cs{edindex} process uses a \cs{label}/\cs{ref} mechanism to get +% the correct line number. It automatically generates labels +% of the form \cs{label}\verb|{\edindexlab N}|, where N is a number, and +% the default definition of \cs{edindexlab} is: \\ +% |\newcommand*{\edindexlab}{$&}| \\ +% in the hopes that this will not be used by any other labels +% (\cs{edindex}'s labels are like \cs{label}\verb|{$&27}|). +% You can change \cs{edindexlab} to something else if you need to. +% +% \section{Tabular material} +% +% \LaTeX's normal |tabular| and |array| environments cannot be used where +% line numbering is being done; more precisely, they can be used but with +% odd results, so don't use them. However, \macpackage provides some simple +% tabulation environments that can be line numbered. The environments +% can also be used in normal unnumbered text. +% +% \DescribeEnv{edarrayl} +% \DescribeEnv{edarrayc} +% \DescribeEnv{edarrayr} +% \DescribeEnv{edtabularl} +% \DescribeEnv{edtabularc} +% \DescribeEnv{edtabularr} +% There are six environments; the |edarray*| environments are for math +% and |edtabular*| for text entries. The final |l|, |c|, or |r| +% in the environment names indicate that the entries will be flushleft (|l|), +% centered (|c|) or flushright (|r|). There is no means of specifying +% different formats for each column, nor for specifying a fixed width for +% a column. The environments are centered with respect to the surrounding text. +% +% \egstart +% \begin{verbatim} +% \begin{edtabularc} +% 1 & 2 & 3 \\ +% a & bb & ccc \\ +% AAA & BB & C +% \end{edtabularc} +% \end{verbatim} +% \egmid +% \centering +% \begin{tabular}{ccc} +% 1 & 2 & 3 \\ +% a & bb & ccc \\ +% AAA & BB & C +% \end{tabular}\par +% \egend +% +% Entries in the environments are the same as for the normal +% |array| and |tabular| environments but there must be no ending +% \verb?\\? at the end of the last row. +% \emph{There must be the same number of column designators (the \&) +% in each row.} There is no equivalent +% to any line drawing commands (such as \cs{hline}). +% However, unlike the normal environments, the |ed...| environments +% can cross page breaks. +% +% Macros like \cs{edtext} can be used as part of an entry. +% +% For example: +% \begin{verbatim} +% \beginnumbering +% \pstart +% \begin{edtabularl} +% \textbf{\Large I} & wish I was a little bug\edindex{bug} & +% \textbf{\Large I} & eat my peas with honey\edindex{honey} \\ +% & With whiskers \edtext{round}{\Afootnote{around}} my tummy & +% & I've done it all my life. \\ +% & I'd climb into a honey\edindex{honey} pot & +% & It makes the peas taste funny \\ +% & And get my tummy gummy.\edindex{gummy} & +% & But it keeps them on the knife. +% \end{edtabularr} +% \pend +% \endnumbering +% \end{verbatim} +% produces the following parallel pair of verses. +% +% \begin{center} +% \setlength{\tabcolsep}{2pt} +% \begin{tabular}{p{4em}rlrl} +% {\footnotesize 1} & \textbf{\Large I} & wish I was a little bug & +% \textbf{\Large I} & eat my peas with honey \\ +% {\footnotesize 2} & & With whiskers round my tummy & +% & I've done it all my life. \\ +% {\footnotesize 3} & & I'd climb into a honey pot & +% & It makes the peas taste funny \\ +% {\footnotesize 4} & & And get my tummy gummy. & +% & But it keeps them on the knife. +% \end{tabular} +% \end{center} +% +% +% +% +% +% \DescribeMacro{\edtabcolsep} +% The distance between the columns is controlled by the length |\edtabcolsep|. +% +% \DescribeMacro{\spreadmath} +% \DescribeMacro{\spreadtext} +% |\spreadmath|\marg{math} typesets \marg{math} but the \marg{math} has +% no effect on the calculation of column widths. +% |\spreadtext|\marg{text} is the analagous command for use in |edtabular| +% environments. +% +% \egstart +% \begin{verbatim} +% \begin{edarrayl} +% 1 & 2 & 3 & 4 \\ +% & \spreadmath{F+G+C} & & \\ +% a & bb & ccc & dddd +% \end{edarrayl} +% \end{verbatim} +% \egmid +% \begin{displaymath} +% \begin{array}{llll} +% 1 & 2 & 3 & 4 \\ +% & \multicolumn{3}{l}{F+G+C} \\ +% a & bb & ccc & dddd +% \end{array} +% \end{displaymath} +% \egend +% +% \DescribeMacro{\edrowfill} +% The macro |\edrowfill|\marg{start}\marg{end}\marg{fill} +% fills columns number \meta{start} to \meta{end} inclusive with +% \meta{fill}. The \meta{fill} argument can be any horizontal `fill'. +% For example |\hrulefill| or |\upbracefill|. +% +% Note that every row must have the same number of columns, even if +% some would not appear to be necessary. +% +% The |\edrowfill| macro can be used in both tabular and array environments. +% The typeset appearance of the following code is shown below. +% \begin{verbatim} +% \begin{edtabularr} +% 1 & 2 & 3 & 4 & 5 \\ +% Q & & fd & h & qwertziohg \\ +% v & wptz & x & y & vb \\ +% g & nnn & \edrowfill{3}{5}{\upbracefill} & & \\ +% \edrowfill{1}{3}{\downbracefill} & & & pq & dgh \\ +% k & & l & co & ghweropjklmnbvcxys \\ +% 1 & 2 & 3 & \edrowfill{4}{5}{\hrulefill} & +% \end{tabularr} +% \end{verbatim} +% +% \begin{center} +% \begin{tabular}{rrrrr} +% 1 & 2 & 3 & 4 & 5 \\ +% Q & & fd & h & qwertziohg \\ +% v & wptz & x & y & vb \\ +% g & nnn & \multicolumn{3}{c}{\upbracefill} \\ +% \multicolumn{3}{c}{\downbracefill} & pq & dgh \\ +% k & & l & co & ghweropjklmnbvcxys \\ +% 1 & 2 & 3 & \multicolumn{2}{c}{\hrulefill} +% \end{tabular} +% \end{center} +% +% You can also define your own `fill'. For example: +% \begin{verbatim} +% \newcommand*{\upbracketfill}{% +% \vrule height 4pt depth 0pt\hrulefill\vrule height 4pt depth 0pt} +% \end{verbatim} +% is a fill like |\upbracefill| except it has the appearance of a +% (horizontal) bracket instead of a brace. It can be used like +% this: +% +% \newcommand*{\upbracketfill}{% +% \vrule height 4pt depth 0pt\hrulefill\vrule height 4pt depth 0pt} +% +% \begin{verbatim} +% \begin{edarrayc} +% 1 & 2 & 3 & 4 \\ +% a & \edrowfill{2}{3}{\upbracketfill} & & d \\ +% A & B & C & D +% \end{edarrayc} +% \end{verbatim} +% +% \begin{displaymath} +% \begin{array}{cccc} +% 1 & 2 & 3 & 4 \\ +% a & \multicolumn{2}{c}{\upbracketfill} & d \\ +% A & B & C & D +% \end{array} +% \end{displaymath} +% +% +% +% \DescribeMacro{\edatleft} +% \DescribeMacro{\edatright} +% \cs{edatleft}\oarg{math}\marg{symbol}\marg{halfheight} typesets the math +% \meta{symbol} as \cs{left}\marg{symbol} +% with the optional \meta{math} centered before it. The \meta{symbol} is +% twice \meta{halfheight} tall. The \cs{edatright} macro is similar +% and it typesets \cs{right}\marg{symbol} with \meta{math} centered after it. +% +% \begin{verbatim} +% \begin{edarrayc} +% & 1 & 2 & 3 & \\ +% & 4 & 5 & 6 & \\ +% \edatleft[left =]{\{}{1.5\baselineskip} +% & 7 & 8 & 9 & +% \edatright[= right]{)}{1.5\baselineskip} +% \end{edarrayc} +% \end{verbatim} +% +% \begin{displaymath} +% left = \left\{ +% \begin{array}{ccc} +% 1 & 2 & 3 \\ +% 4 & 5 & 6 \\ +% 7 & 8 & 9 +% \end{array} +% \right) = right +% \end{displaymath} +% +% +% +% \DescribeMacro{\edbeforetab} +% \DescribeMacro{\edaftertab} +% \cs{edbeforetab}\marg{text}\marg{entry}, where \meta{entry} is an entry in the +% leftmost column, typesets \meta{text} left justified before the \meta{entry}. +% Similarly \cs{edaftertab}\marg{entry}\marg{text}, where \meta{entry} is an entry +% in the rightmost column, typesets \meta{text} right justified after the +% \meta{entry}. +% +% For example: +% \begin{verbatim} +% \begin{edarrayl} +% A & 1 & 2 & 3 \\ +% \edbeforetab{Before}{B} & 1 & 3 & 6 \\ +% C & 1 & 4 & \edaftertab{8}{After} \\ +% D & 1 & 5 & 0 +% \end{edarrayl} +% \end{verbatim} +% +% +% \begin{displaymath} +% \begin{array}{p{0.4\textwidth}llp{0.4\textwidth}} +% \mbox{} \hfill $A$ & 1 & 2 & $3$ \\ +% Before \hfill $B$ & 1 & 3 & $6$ \\ +% \mbox{} \hfill $C$ & 1 & 4 & $8$ \hfill After \\ +% \mbox{} \hfill $D$ & 1 & 5 & $0$ +% \end{array} +% \end{displaymath} +% +% \DescribeMacro{\edvertline} +% \DescribeMacro{\edvertdots} +% The macro \cs{edvertline}\marg{height} draws a vertical line \meta{height} high +% (contrast this with \cs{edatright} where the size argument is half the desired +% height). +% \begin{verbatim} +% \begin{edarrayr} +% a & b & C & d & \\ +% v & w & x & y & \\ +% m & n & o & p & \\ +% k & & L & cvb & \edvertline{4pc} +% \end{edarrayr} +% \end{verbatim} +% +% \DeleteShortVerb{\|} +% \begin{displaymath} +% \left. +% \begin{array}{rrrr} +% a & b & C & d \\ +% v & w & x & y \\ +% m & n & o & p \\ +% k & & L & cvb +% \end{array} +% \right| +% \end{displaymath} +% \MakeShortVerb{\|} +% +% The \cs{edvertdots} macro is similar to \cs{edvertline} except that it +% produces a vertical dotted instead of a solid line. +% +% +% \section{Sectioning commands} +% \changes{v1.1.0}{2012/09/25}{Sectioning commands.} +% \changes{v1.12.0}{2014/08/05}{New sectioning commands.} +% \subsection{Sectioning commands without line numbers or critical notes} +% The standard sectioning commands (\cs{chapter}, \cs{section} etc.) can be used inside numbered text. +% In this case, you must call them as an optional argument of \cs{pstart} (\reff{pstart:optionalarg}): +% \begin{verbatim} +% \pstart[\section{section}] +% Pstart content. +% \pend +% \end{verbatim} +% The line which contains them will not been numbered, and you can not add critical notes inside. +% \subsection{Sectioning commands with line numbering and critical notes} +% \label{eledsection} +% You have to use the following commands: +% \begin{itemize} +% \item \cs{eledchapter}\oarg{text}\marg{critical text} +% \item \cs{eledchapter*} +% \item \cs{eledsection}\oarg{text}\marg{critical text} +% \item \cs{eledsection*} +% \item \cs{eledsubsection}\oarg{text}\marg{critical text} +% \item \cs{eledsubsection*} +% \item \cs{eledsubsubsection}\oarg{text}\marg{critical text} +% \item \cs{eledsubsubsection*} +% \end{itemize} +% Which are equivalent to the \LaTeX\ commands. +% Each individual command must be called alone in a \cs{pstart}\ldots\cs{pend}: +% \begin{verbatim} +%\pstart +%\eledsection*{xxxx\ledsidenote{section}} +%\pend +%\pstart +%\eledsubsection*{xxxx\ledsidenote{sub}} +%\pend +%\pstart +%normal text +%\pend +% \end{verbatim} +% At the first run, you will see only the text. It is normal. +% At the second run, you will see the formating. +% And consequently, at the third run, you will see the table of contents. +% +% For technical reasons, the page break before \cs{elechapter} ca not be added automatically. You have to insert it manually via \cs{beforeeledchapter}, which must be called outside of a numbered section. +% +% \subsection{Optimization} +% \DescribeMacro{\noeledsec} +% If you are not going to have any \cs{eledxxx} commands, then load \macpackage with \cs{noeledsec} option. +% That will suppress the generation of unneeded \file{.eledsec} file, keep memory and make \macpackage faster. +% \section{Quotation environments} +% The \verb+quotation+ and \verb+quote+ environment can be used so that same definition/note appears both inside and outside a numbered section. +% The typographical consequences will resemble the outside numbered sections, based on the styles of the \emph{book} class. +% However, if you use a package that redefines these environments, these redefinitions won't be available inside the numbered section. +% You must open any quotation environments inside a \cs{start}-\cs{pend} block, not outside. +% A quotation environment MUST not be opened immediately after a \cs{pstart} +% and MUST not be closed immediately before a \cs{pend}. +% +% \label{noquotation} In some cases, you do not want these environments to be redefined in numbered sections. +% You can load the package with the option \verb+noquotation+ to prevent this redefinition. +% \section{Page breaks} +% \subsection{Control page breaking} +% \changes{v1.7.0}{2013/11/08}{New features for managing page breaks.} +% \Macpackage and \parpackage break pages automatically. +% However, you may sometimes want to either force page breaks or prevent them. +% \DescribeMacro{\ledpb} \DescribeMacro{\lednopb} The packages provide two macros: +% \begin{itemize} +% \item \cs{ledpb} adds a page break. +% \item \cs{lednopb} prevents a page break, by adding one line to the current page if needed. +% \end{itemize} +% \textbf{These commands have effect only at the second run}. +% +% These two commands take effect at the beginning of line in which they are called. For example, if you call \cs{ledpb} at l.~444, the l.~443 will be at the p.~$n$, and the l.~444 at the p.~$n+1$. +% \DescribeMacro{\ledpbsetting} However you can change the behavior, and decide they will have effect after the end of the line, adding \verb+\ledpbsetting{after}+ at the beginning of your file (better: in your preamble). With the previous example, the l.~444 will be at the p.~$n$ and the l.~445 will be at the p.~$n+1$. +% +% If you are using \parpackage to typeset parallel pages you must use \cs{lednopb} on +% both sides in the two corresponding lines. This is especially important when you are using +% stanzas; otherwise the pages will run out of sync. +% +% \subsection{Prevent page break in a long verses} +%\label{lednopbinversetrue}\DescribeMacro{\lednopbinversetrue} You can also decide to prevent page breaks between two lines of a long verse. To do this, use \verb+nopbinverse+ when loading package, or add \cs{lednopbinversetrue} in the beginning of your file (better: in your preamble). +% +%This feature works only with verse of 2 lines, not more. It works at the third run, or at fourth run with \eledpar. +% By default, when a long verse runs normally between two pages, a page break will be placed at the beginning of the verse. However, if you have added\verb+ledpbsetting{after}+, the page break will be placed at the end of the long verse, and the page containing the long verse will have one extra line. +% \section{Miscellaneous} +% +% +% \DescribeMacro{\extensionchars} +% When the package assembles the name of the auxiliary file for a +% section, it prefixes \cs{extensionchars} to the section number. +% This is initially defined to be empty, but you can add some characters to +% help distinguish these files if you like; what you use is likely +% to be system-dependent. If, for example, you said +% \verb"\renewcommand{\extensionchars}{!}", then you would get temporary +% files called \file{jobname.!1}, \file{jobname.!2}, etc. +% +% \DescribeMacro{\ifledfinal} +% The package can take options. The option `final', which is the default +% is for final typesetting; this sets \verb?\ifledfinal? to TRUE. The other +% option, `draft', may be useful during earlier stages and sets +% \verb?\ifledfinal? to FALSE. +% +% \DescribeMacro{\showlemma} +% The lemma within the text is printed via \verb?\showlemma{lemma}?. +% Normally, or with the `final' option, the definition of \verb?\showlemma? +% is: \\ +% \verb?\newcommand*{\showlemma}[1]{#1}? \\ +% so it just produces its argument. +% With the `draft' option it is defined as \\ +% \verb?\newcommand*{\showlemma}[1]{\textit{#1}}? \\ +% so that its argument is typeset in an italic font, which may make it +% easier to check that all lemmas have been treated. +% +% If you would prefer some other style, you could put something like this +% in the preamble: +% \begin{verbatim} +% \ifledfinal\else +% \renewcommand{\showlemma}[1]{\textbf{#1}}% or simply ...[1]{#1} +% \fi +% \end{verbatim} +% +% +% \subsection{Known and suspected limitations} +% \subsection{`No room for a new'}\label{noroom} +% Sometime, especially when using \macpackage with other packages, you could obtain warning message such 'no room for a new count' or 'no room for a new write'. +% +% The first thing in order to prevent such problem is to use the options to optimize \macpackage. +% For example, if you need only two series of notes, use \verb+series={A,B}+ option. +% Read \reff{optimize} in order to know which are there options. +% +% However, if with these options you still have such message, here are some tricks. +% \begin{description} +% \item['no room for a new count'] is often caused by a conjunction with \Lpack{biblatex}. +% Load \macpackage (and \parpackage) \emph{before} \Lpack{biblatex}. +% \item['no room for a new write'] can be caused by with multiple indexes. +% In this case, use \Lpack{indextools} of \Lpack{imakeidx} with the \verb+splitindex+ option, in order to obtain only one \verb+.idx+ file. +% If that does not solve your problem, you can use \Lpack{morewrites} package. +% That should solve the problem, but \LaTeX\ will be slower. +% +% \end{description} +% +% If after reading and applying these advices you have still problem, contact us with a minimal working example. +% +% \subsubsection{Marginal notes} +% In general, \macpackage's system for adding marginal line numbers +% breaks anything that makes direct use of the \LaTeX\ insert system, +% which includes marginpars, footnotes and floats. +% +% However, you can use both \cs{footnote} and the familiar footnote +% series notes in numbered text. A \cs{marginpar} in numbered text +% will throw away its contents and send a warning message to the terminal +% and log file, but will do no harm. +% +% \subsubsection{Paragraph shape} +% \cs{parshape} cannot be used within numbered text, except in a +% very restricted way. +% +% \DescribeMacro{\ballast} +% \LaTeX\ is a three-pass system, but even after a document has +% been processed three times, there are some tricky situations in +% which the page breaks decided by \TeX\ never settle down. At +% each successive run, \macpackage may oscillate between two +% different sets of page decisions. To stop this happening, should +% it arise, Wayne Sullivan\index{Sullivan, Wayne} suggested the +% inclusion of the quantity \cs{ballast}. The amount of \cs{ballast} +% will be subtracted from the penalties which apply to the page +% breaks calculated on the \emph{previous} run through \TeX, thus +% reinforcing these breaks. So if you find your page breaks +% oscillating, say \\ +% \verb"\setcounter{ballast}{100}" \\ +% or some such figure, and with any +% luck the page breaks will settle down. Luckily, this problem +% does not crop up at all often. +% \subsubsection{Paragraphed footnotes} +% The restriction on explicit line-breaking in paragraphed footnotes, +% mentioned in a footnote \reff{nobreaks}, and +% described in more detail on \reff{nobreaks-detail}, really is a +% nuisance if that is something you need to do. There are some possible +% solutions, described by Michael Downes\index{Downes, Michael}, +% but this area remains unsatisfactory. +% +% +% +% \DescribeMacro{\footfudgefiddle} +% For paragraphed footnotes \TeX{} has to estimate the amount of space +% required. If it underestimates this then the notes may get too long and +% run off the bottom of the text block. \cs{footfudgefiddle} can be increased +% from its default 64 (say to 68) to increase the estimate. You have to use +% \cs{renewcommand} for this, like: \\ +% \verb?\renewcommand{\footfudgefiddle}{68}? +% +% \subsubsection{Use with other packages} +% +% +% Because of \macpackage's complexity it may not play well with other +% packages. In particular \macpackage is sensitive to commands in the +% arguments to the \cs{edtext} and \cs{*footnote} macros (this is +% discussed in more detail in section~\ref{text}, and in particular +% the discussion about \cs{no@expands} and \cs{morenoexpands}). You +% will have to see what works or doesn't work in your particular case. +% +% \DescribeMacro{\morenoexpands} +% You can define the macro \cs{morenoexpands} to modify macros that you +% call within \cs{edtext}. Because of the way \macpackage{} numbers the lines +% the arguments to \cs{edtext} can be processed more than once and in some +% cases a macro should only be processed once. One example is the \cs{colorbox} +% macro from the \Lpack{color} package, which you might use like this: +% \begin{verbatim} +% ... \edtext{\colorbox{mycolor}{lemma}}{\Afootnote{...\colorbox...}} +% \end{verbatim} +% If you actually try +% this\footnote{Reported by Dirk-Jan Dekker\index{Dekker, Dirk-Jan} +% in the CTT thread `Incompatibility +% of ``color'' package' on 2003/08/28.} +% you will find \LaTeX\ whinging +% `\texttt{Missing \{ inserted}', and then things start to fall apart. +% The trick in this case is to specify either: +% \begin{verbatim} +% \newcommand{\morenoexpands}{\let\colorbox=0} +% \end{verbatim} +% or +% \begin{verbatim} +% \makeatletter +% \newcommand{\morenoexpands}{\let\colorbox\@secondoftwo} +% \makeatother +% \end{verbatim} +% (\cs{@secondoftwo} is an internal \LaTeX\ macro that takes two arguments and +% thows away the first one.) +% The first incantation lets color show in both the main text and footnotes +% whereas the second one shows color in the main text but kills it +% in the lemma and footnotes. On the other hand if you use +% \cs{textcolor} instead, like +% \begin{verbatim} +% ... \edtext{\textcolor{mycolor}{lemma}}{\Afootnote{...\textcolor...}} +% \end{verbatim} +% there is no need to fiddle with \cs{morenoexpands} as the color will +% naturally be displayed in both the text and footnotes. To kill the color +% in the lemma and footnotes, though, you can do: +% \begin{verbatim} +% \makeatletter +% \newcommand{\morenoexpands}{\let\textcolor\@secondoftwo} +% \makeatother +% \end{verbatim} +% It took Peter Wilson a little while to discover all this. If you run into this sort +% of problem you may have to spend some time experimenting before hitting +% on a solution. +% +%% +% +% If you want to use the option \emph{bottom} of the \Lpack{footmisc} package, +% you must load this package \emph{before} the \macpackage package. +% + +% \subsection{Parallel typesetting}\label{eledpar} +% +% +% Peter Wilson has developed the \ledpar package +% as an extension to \ledmac specifically for parallel typesetting +% of critical texts. This also cooperates with the \Lpack{babel} / \Lpack{polyglossia} +% packages for typesetting in multiple languages. +% \Parpackage is the successor of the primitive \ledpar package. +% +% +% Peter Wilson also developed +% the \Lpack{ledarab} package for +% handling parallel Arabic text in critical editions. +% However, this package is not maintened by Maïeul Rouquette. +% You should use the capabilities of a modern TeX processor, like Xe(La)TeX +% +% +% +% +% \StopEventually{} +% +% \clearpage +% \renewcommand{\thesection}{\Roman{section}} +% \setcounter{section}{0} +% +% \section{Implementation overview}\label{overview} +% +% +% We present the \macpackage code in roughly the order in which it is used +% during a run of \TeX. The order is \emph{exactly} that in which +% it is read when you load The \Eledmac{} package, because the same file +% is used to generate this manual and to generate the \LaTeX\ package file. +% +% Most of what follows consists of macro definitions, but there +% are some commands that are executed immediately---especially +% at the start of the code. The documentation generally describes the +% code from the point of view of what happens when the macros are +% executed, though. As each macro is introduced, its name is printed +% in the margin. +% +% After package options, we begin with the commands you use to start and +% stop line numbering in a section of text (Section~\ref{preliminaries}). +% Next comes the machinery for writing and reading the auxiliary file for +% each section that helps us count lines, and for creating list macros +% encoding the information from that file (Section~\ref{lineation}); this +% auxiliary file will be read at the start of each section, to create +% those list macros, and a new version of the file will be started to +% collect information from the body of the section. +% +% Next are commands for marking sections of +% the text for footnotes (Section~\ref{text}), followed by the macros +% that take each paragraph apart, attach the line numbers and insertions, +% and send the result to the vertical list (Section~\ref{paragraph}). The +% footnote commands (Section~\ref{footnotes}) and output routine +% (Section~\ref{output}) finish the main part of the processing; +% cross-referencing (Section~\ref{xref}) and endnotes +% (Section~\ref{endnotes}) complete the story. +% +% In what follows, macros with an @ in their name are more internal +% to the workings of \macpackage than those made up just of +% ordinary letters, just as in \PlainTeX\ (see \thetexbook, +% p.\,344). You are meant to be able to make free with +% ordinary macros, but the `@' ones should be treated with more +% respect, and changed only if you are pretty sure of what you are +% doing. +% +% +% \section{Preliminaries} +% \label{preliminaries}\relax +% \subsection{Links with original \edmac} +% Generally, these are the modifications to the original. +% \edmac{} code: +% \begin{itemize} +% \item Replace as many \cs{def}'s by \cs{newcommand}'s as possible +% to avoid overwriting \LaTeX\ macros. +% +% \item Replace user-level \TeX\ counts by \LaTeX\ counters. +% +% \item Use the \LaTeX\ font handling mechanisms. +% +% \item Use \LaTeX\ messaging and file facilities. +% +% \end{itemize} +% +% +% \subsection{Package declaration} +% Announce the name and version of the package, which is +% targetted for LaTeX2e. +% +% \begin{macrocode} +%<*code> +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{reledmac}[2015/07/19 v2.0.0 typesset critical edition]% +% \end{macrocode} +% +% \subsection{Package options} +% \changes{v0.4.0}{2004/02/29}{Added final/draft options} +% \changes{v1.13.0}{2014/09/16}{Added widthliketwocolumns option} +% \begin{macro}{\ifledfinal} +% \begin{macro}{\ifnocritical@} +% \begin{macro}{\if@noeled@sec} +% \begin{macro}{\ifnoend@} +% \begin{macro}{\ifnofamiliar@} +% \begin{macro}{\ifnoledgroup@} +% \begin{macro}{\ifparapparatus@} +% \begin{macro}{\ifnoquotation@} +% \begin{macro}{\iflednopbinverse} +% \begin{macro}{\ifparledgroup} +% \begin{macro}{\ifwidthliketwocolumns} +% \begin{macro}{\ifxindy@} +% \begin{macro}{\ifxindyhyperref@} +% \begin{macro}{\ifeledmaccompat@} +% Use this to remember which option is used, set and execute the options +% with final as the default. +% We use \Lpack{xkeyval} in order to manage options with argument. +% \begin{macrocode} +\RequirePackage{xkeyval} +% \end{macrocode} +% The \verb+parledgroup+ option is for \parpackage. +% However, it has consequence on \macpackage internal command. +% So we need to define the boolean now. +% \begin{macrocode} +\newif\ifparledgroup +% \end{macrocode} +% And now, the options of \macpackage. +% \begin{macrocode} +\DeclareOptionX{series}[A,B,C,D,E]{\xdef\default@series{#1}} +\ExecuteOptionsX{series}% + +\newif\if@noeled@sec% +\DeclareOptionX{noeledsec}{\@noeled@sectrue} + +\newif\ifnocritical@% +\DeclareOptionX{nocritical}{\nocritical@true}% + +\newif\ifnofamiliar@% +\DeclareOptionX{nofamiliar}{\nofamiliar@true}% + +\newif\ifnoledgroup@% +\DeclareOptionX{noledgroup}{\noledgroup@true}% + +\newif\ifnoend@% +\DeclareOptionX{noend}{% + \let\l@dend@open\@gobble% + \let\l@dend@close\relax% + \global\let\l@dend@stuff=\relax% + \noend@true% +}% + +\newif\ifnoquotation@ +\DeclareOptionX{noquotation}{\noquotation@true} + + +\newif\ifledfinal +\DeclareOptionX{final}{\ledfinaltrue} +\DeclareOptionX{draft}{\ledfinalfalse} +\ExecuteOptionsX{final} + +\newif\ifparapparatus@ +\DeclareOptionX{parapparatus}{\parapparatus@true} + +\newif\iflednopbinverse +\DeclareOptionX{nopbinverse}{\lednopbinversetrue} + +\newif\ifwidthliketwocolumns% +\DeclareOptionX{widthliketwocolumns}{\widthliketwocolumnstrue}% + +\newif\ifxindy@ +\DeclareOptionX{xindy}[eledmac-markup-attr.xdy]{% + \AtBeginDocument{\immediate\openout\eledmac@xindy@out=#1}% + \newwrite\eledmac@xindy@out% + \xindy@true% + \gdef\eledmacmarkuplocrefdepth{:depth 1}% + \AtEndDocument{\immediate\closeout\eledmac@xindy@out}% +}% + +\newif\ifxindyhyperref@ +\DeclareOptionX{xindy+hyperref}{% + \xindyhyperref@true% +}% + +\newif\ifeledmaccompat@% +\DeclareOptionX{eledmac-compat}{% + \eledmaccompat@true% +}% +% \end{macrocode} +% We use the starred form of \cs{ProcessOptionsX} which executes options in +% the order listed in the source file: class options, then listed package +% options, so a package option can override a class option with the same name. +% This was suggested by Dan Luecking\index{Luecking, Dan} in the \texttt{ctt} +% thread \textit{Class/package option processing}, on 27 February 2004. +% \begin{macrocode} +\ProcessOptionsX*\relax + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \subsection{Loading packages} +% Loading package \Lpack{xargs} to declare commands with optional arguments. +% \Lpack{Etoolbox} is also used to make code clearer - for example, in dynamic command names (which can replace \cs{csname} etc.). +% Use \Lpack{suffix} to declare commands with a starred version, \Lpack{xstring} to work with strings, \Lpack{ifluatex} and \Lpack{ifxetex} to test if \LuaTeX\ or \XeTeX\ is running, and \Lpack{ragged2e} to manage ragged for paragraphed notes. +% \begin{macrocode} +\RequirePackage{xargs} +\RequirePackage{etoolbox} +\RequirePackage{etex} +\reserveinserts{32} +\RequirePackage{suffix} +\RequirePackage{xstring} +\RequirePackage{ifluatex} +\RequirePackage{ragged2e} +\RequirePackage{ragged2e} +\RequirePackage{ifxetex}% +% \end{macrocode} +% +% \subsection{Boolean flags} +% \begin{macro}{\ifl@dmemoir} +% Define a flag for if the \Lpack{memoir} class has been used. +% \changes{v0.2.0}{2003/07/25}{Added \cs{ifl@dmemoir} for memoir class having been used} +% \begin{macrocode} +\newif\ifl@dmemoir +\@ifclassloaded{memoir}{\l@dmemoirtrue}{\l@dmemoirfalse} + +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\ifl@imakeidx} +% Define a flag for if the \Lpack{imakeidx} package has been used. +% \begin{macrocode} +\newif\ifl@imakeidx +\@ifpackageloaded{imakeidx}{\l@imakeidxtrue}{}%False is the default value +% \end{macrocode} +% \end{macro} +% \begin{macro}{\ifl@indextools} +% Define a flag for if the \Lpack{indextools} package has been used. +% \begin{macrocode} +\newif\ifl@indextools% +\@ifpackageloaded{indextools}{% + \l@indextoolstrue% + \l@imakeidxtrue% + \let\imki@wrindexentry\indtl@wrindexentry% + }{}% +% \end{macrocode} +%False is the default value. We consider \Lpack{indextools} as a variant of \Lpack{imakeidx}. That is why we set \cs{ifl@imakeidx} to true. We also let \cs{imki@wrindexentry} to \cs{indtl@wrindexentry}. +% \end{macro} +% \begin{macro}{\if@RTL} +% The \cs{if@RTL} is defined by the bidi package, which is sometimes loaded by \emph{polyglossia}. +% But we define it as well if the \Lpack{bidi} package is not loaded. +% \begin{macrocode} +\ifdef{\if@RTL}{}{\newif\if@RTL} +% \end{macrocode} +% \end{macro} +% \subsection{Messages} +% +% All the messages are grouped here as macros. This saves \TeX's memory +% when the same message is repeated and also lets them be edited easily. +% \changes{v0.7.0}{2005/02/21}{Made macros of all messages} +% \changes{v1.12.3}{2012/08/15}{Add macros for new messages since v0.7} +% +% \begin{macro}{\reledmac@warning} +% Write a warning message. +% \begin{macrocode} +\newcommand{\reledmac@warning}[1]{\PackageWarning{reledmac}{#1}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\reledmac@error} +% Write an error message. +% \changes{v0.2.0}{2003/07/25}{Added \cs{eledmac@error} and replaced error messages} +% \changes{v1.12.3}{2014/08/15}{Replaced error messages} +% \begin{macrocode} +\newcommand{\reledmac@error}[2]{\PackageError{reledmac}{#1}{#2}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\led@err@NumberingStarted} +% \begin{macro}{\led@err@NumberingNotStarted} +% \begin{macro}{\led@err@NumberingShouldHaveStarted} +% \begin{macrocode} +\newcommand*{\led@err@NumberingStarted}{% + \reledmac@error{Numbering has already been started}{\@ehc}} +\newcommand*{\led@err@NumberingNotStarted}{% + \reledmac@error{Numbering was not started}{\@ehc}} +\newcommand*{\led@err@NumberingShouldHaveStarted}{% + \reledmac@error{Numbering should already have been started}{\@ehc}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\led@err@edtextoutsidepstart} +% \begin{macrocode} +\newcommand*{\led@err@edtextoutsidepstart}{% + \reledmac@error{\string\edtext\space outside numbered paragraph (\pstart\ldots\pend)}{\@ehc}}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\led@mess@NotesChanged} +% \begin{macrocode} +\newcommand*{\led@mess@NotesChanged}{% + \typeout{reledmac reminder: }% + \typeout{ The number of the footnotes in this section + has changed since the last run.}% + \typeout{ You will need to run LaTeX two more times + before the footnote placement}% + \typeout{ and line numbering in this section are + correct.}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\led@mess@SectionContinued} +% \begin{macrocode} +\newcommand*{\led@mess@SectionContinued}[1]{% + \message{Section #1 (continuing the previous section)}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\led@err@LineationInNumbered} +% \begin{macrocode} +\newcommand*{\led@err@LineationInNumbered}{% + \reledmac@error{You can't use \string\lineation\space within + a numbered section}{\@ehc}} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\led@warn@BadLineation} +% \begin{macro}{\led@warn@BadLinenummargin} +% \begin{macro}{\led@warn@BadLockdisp} +% \begin{macro}{\led@warn@BadSublockdisp} +% \begin{macrocode} +\newcommand*{\led@warn@BadLineation}{% + \reledmac@warning{Bad \string\lineation\space argument}} +\newcommand*{\led@warn@BadLinenummargin}{% + \reledmac@warning{Bad \string\linenummargin\space argument}} +\newcommand*{\led@warn@BadLockdisp}{% + \reledmac@warning{Bad \string\lockdisp\space argument}} +\newcommand*{\led@warn@BadSublockdisp}{% + \reledmac@warning{Bad \string\sublockdisp\space argument}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\led@warn@NoLineFile} +% \begin{macrocode} +\newcommand*{\led@warn@NoLineFile}[1]{% + \reledmac@warning{Can't find line-list file #1}} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\led@warn@LineFileObsolete} +% \begin{macrocode} +\newcommand*{\led@warn@Obsolete}[1]{% + \reledmac@warning{Line-list file #1 was obsolete. We have not read it. Please run LaTeX again.}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\led@warn@BadAdvancelineSubline} +% \begin{macro}{\led@warn@BadAdvancelineLine} +% \begin{macrocode} +\newcommand*{\led@warn@BadAdvancelineSubline}{% + \reledmac@warning{\string\advanceline\space produced a sub-line + number less than zero.}} +\newcommand*{\led@warn@BadAdvancelineLine}{% + \reledmac@warning{\string\advanceline\space produced a line + number less than zero.}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\led@warn@BadSetline} +% \begin{macro}{\led@warn@BadSetlinenum} +% \begin{macrocode} +\newcommand*{\led@warn@BadSetline}{% + \reledmac@warning{Bad \string\setline\space argument}} +\newcommand*{\led@warn@BadSetlinenum}{% + \reledmac@warning{Bad \string\setlinenum\space argument}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\led@err@PstartNotNumbered} +% \begin{macro}{\led@err@PstartInPstart} +% \begin{macro}{\led@err@PendNotNumbered} +% \begin{macro}{\led@err@PendNoPstart} +% \begin{macro}{\led@err@AutoparNotNumbered} +% \begin{macro}{\led@err@NumberingWithoutPstart} +% \begin{macrocode} +\newcommand*{\led@err@PstartNotNumbered}{% + \reledmac@error{\string\pstart\space must be used within a + numbered section}{\@ehc}} +\newcommand*{\led@err@PstartInPstart}{% + \reledmac@error{\string\pstart\space encountered while another + \string\pstart\space was in effect}{\@ehc}} +\newcommand*{\led@err@PendNotNumbered}{% + \reledmac@error{\string\pend\space must be used within a + numbered section}{\@ehc}} +\newcommand*{\led@err@PendNoPstart}{% + \reledmac@error{\string\pend\space must follow a \string\pstart}{\@ehc}} +\newcommand*{\led@err@AutoparNotNumbered}{% + \reledmac@error{\string\autopar\space must be used within a + numbered section}{\@ehc}} +\newcommand*{\led@err@NumberingWithoutPstart}{% + \reledmac@error{\string\beginnumbering...\string\endnumbering\space without \string\pstart}{\@ehc}}% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\led@warn@BadAction} +% \begin{macrocode} +\newcommand*{\led@warn@BadAction}{% + \reledmac@warning{Bad action code, value \next@action.}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\led@warn@DuplicateLabel} +% \begin{macro}{\led@warn@AppLabelOutEdtext} +% \begin{macro}{\led@warn@RefUndefined} +% \begin{macrocode} +\newcommand*{\led@warn@DuplicateLabel}[1]{% + \reledmac@warning{Duplicate definition of label `#1' on page \the\pageno.}} +\newcommand*{\led@warn@AppLabelOutEdtext}[1]{% + \reledmac@warning{\string\applabel\space outside of \string\edtext\space `#1' on page \the\pageno.}}% +\newcommand*{\led@warn@RefUndefined}[1]{% + \reledmac@warning{Reference `#1' on page \the\pageno\space undefined. + Using `000'.}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\led@warn@NoMarginpars} +% \begin{macrocode} +\newcommand*{\led@warn@NoMarginpars}{% + \reledmac@warning{You can't use \string\marginpar\space in numbered text}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\led@warn@BadSidenotemargin} +% \begin{macrocode} +\newcommand*{\led@warn@BadSidenotemargin}{% + \reledmac@warning{Bad \string\sidenotemmargin\space argument}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\led@warn@NoIndexFile} +% \begin{macrocode} +\newcommand*{\led@warn@NoIndexFile}[1]{% + \reledmac@warning{Undefined index file #1}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\led@warn@SeriesStillExist} +% \begin{macrocode} +\newcommand{\led@warn@SeriesStillExist}[1]{% + \reledmac@warning{Series #1 is still existing !}% +}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\led@err@ManySidenotes} +% \begin{macro}{\led@err@ManyLeftnotes} +% \begin{macro}{\led@err@ManyRightnotes} +% \begin{macrocode} +\newcommand{\led@err@ManySidenotes}{% + \ifledRcol@% + \reledmac@warning{\itemcount@\space sidenotes on line \the\line@numR\space p. \the\page@numR}% + \else% + \reledmac@warning{\itemcount@\space sidenotes on line \the\line@num\space p. \the\page@num}% + \fi% +}% +\newcommand{\led@err@ManyLeftnotes}{% + \ifledRcol@% + \reledmac@warning{\itemcount@\space leftnotes on line \the\line@numR\space p. \the\page@numR}% + \else% + \reledmac@warning{\itemcount@\space leftnotes on line \the\line@num\space p. \the\page@num}% + \fi% +}% +\newcommand{\led@err@ManyRightnotes}{% + \ifledRcol@% + \reledmac@warning{\itemcount@\space rightnotes on line \the\line@numR\space p. \the\page@numR}% + \else% + \reledmac@warning{\itemcount@\space rightnotes on line \the\line@num\space p. \the\page@num}% + \fi% +}% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \begin{macro}{\led@err@TooManyColumns} +% \begin{macro}{\led@err@UnequalColumns} +% \begin{macro}{\led@err@LowStartColumn} +% \begin{macro}{\led@err@HighEndColumn} +% \begin{macro}{\led@err@ReverseColumns} +% \begin{macrocode} +\newcommand*{\led@err@TooManyColumns}{% + \reledmac@error{Too many columns}{\@ehc}} +\newcommand*{\led@err@UnequalColumns}{% + \reledmac@error{Number of columns is not equal to the number + in the previous row (or \protect\\ \space forgotten?)}{\@ehc}} +\newcommand*{\led@err@LowStartColumn}{% + \reledmac@error{Start column is too low}{\@ehc}} +\newcommand*{\led@err@HighEndColumn}{% + \reledmac@error{End column is too high}{\@ehc}} +\newcommand*{\led@err@ReverseColumns}{% + \reledmac@error{Start column is greater than end column}{\@ehc}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\led@err@EdtextWithoutFootnote} +% \begin{macrocode} +\newcommand{\led@err@EdtextWithoutFootnote}{% + \reledmac@error{edtext without Xfootnote. Check syntaxis.}{\@ehc}% +}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\led@err@FootnoteWithoutEdtext} +% \begin{macrocode} +\newcommand{\led@err@FootnoteWithoutEdtext}{% + \reledmac@error{Xfootnote without edtext. Check syntax.}{\@ehc}% +}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\led@error@ImakeidxAfterEledmac} +% \begin{macrocode} +\newcommand{\led@error@ImakeidxAfterEledmac}{% + \reledmac@error{Imakeidx must be loaded before eledmac.}{\@ehc}% +}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\led@error@IndextoolsAfterEledmac} +% \begin{macrocode} +\newcommand{\led@error@IndextoolsAfterEledmac}{% + \reledmac@error{Indextools must be loaded before eledmac.}{\@ehc}% +}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\led@error@fail@patch@@makecol} +% \begin{macrocode} +\newcommand{\led@error@fail@patch@@makecol}{% + \reledmac@error{Fail to patch \string\@makecol\space command.}{\@ehc}% +}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\led@error@fail@patch@@reinserts} +% \begin{macrocode} +\newcommand{\led@error@fail@patch@@reinserts}{% + \reledmac@error{Fail to patch \string\@reinserts\space command.}{\@ehc}% +}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\led@error@fail@patch@@doclearpage} +% \begin{macrocode} +\newcommand{\led@error@fail@patch@@doclearpage}{% + \reledmac@error{Fail to patch \string\@doclearpage\space command.}{\@ehc}% +}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\led@error@fail@patch@@iiiminipage} +% \begin{macrocode} +\newcommand{\led@error@fail@patch@@iiiminipage}{% + \reledmac@error{Fail to patch \string\@iiiminipage\space command.}{\@ehc}% +}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\led@error@fail@patch@endminipage} +% \begin{macrocode} +\newcommand{\led@error@fail@patch@endminipage}{% + \reledmac@error{Fail to patch \string\endminipage\space command.}{\@ehc}% +}% +% \end{macrocode} +% \end{macro} +% \subsection{Gobbling} +% \changes{v1.14.0}{2014/10/27}{Provide \cs{@gobblefour}} +% \changes{v1.14.0}{2014/10/27}{Move gobbling command} +% \changes{v1.21.0}{2015/04/13}{Provide \cs{@gobblefive}} +% \changes{v0.2.2}{2003/11/05}{Used \cs{providecommand} for \cs{@gobblethree} +% to avoid clash with the amsfonts package} +% Here, we define some commands which gobble their arguments. +% \begin{macro}{\@gobblethree} +% \begin{macro}{\@gobblefour} +% \begin{macro}{\@gobblefive} +% \begin{macrocode} +\providecommand*{\@gobblethree}[3]{} +\providecommand*{\@gobblefour}[4]{} +\providecommand*{\@gobblefive}[5]{} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \subsection{Miscellaneous commands} +% \begin{macro}{\showlemma} +% \verb?\showlemma?\marg{lemma} typesets the lemma text in the body. +% It depends on the option. +% \changes{v0.4.0}{2004/02/29}{Added \cs{showlemma}} +% \begin{macrocode} +\ifledfinal + \newcommand*{\showlemma}[1]{#1} +\else + \newcommand*{\showlemma}[1]{\underline{#1}} +\fi + +% \end{macrocode} +% \end{macro} +% \begin{macro}{\linenumberlist} +% The code for the \cs{linenumberlist} mechanism was given to Peter Wilson by Wayne +% Sullivan\index{Sullivan, Wayne} on 2004/02/11. +% +% Initialize it as \cs{empty}. +% +% \changes{v0.3.0}{2004/02/14}{Added \cs{linenumberlist} mechanism} +% \begin{macrocode} +\let\linenumberlist=\empty + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@l@dtempcnta} +% \begin{macro}{\@l@dtempcntb} +% In imitation of \LaTeX, we create a couple of scratch counters. +% +% \LaTeX\ already defines \cs{@tempcnta} and \cs{@tempcntb} but Peter Wilson +% found in the past that it can be dangerous to use these (for example +% one of the AMS packages did something nasty to the \Lpack{ccaption} +% package's use of one of these). +% \begin{macrocode} +\newcount\@l@dtempcnta \newcount\@l@dtempcntb +% \end{macrocode} +% \end{macro} +% \end{macro} +% \subsection{Prepare \parpackage} +% \begin{macro}{\ifnumberingR} +% \begin{macro}{\ifl@dpairing} +% \begin{macro}{\ifl@dpaging} +% \begin{macro}{\l@dpagingtrue} +% \begin{macro}{\l@dpagingfalse} +% \begin{macro}{\ifl@dprintingpages} +% \begin{macro}{\l@dprintingpagestrue} +% \begin{macro}{\l@dprintingpagesfalse} +% \begin{macro}{\ifl@dprintingcolumns} +% \begin{macro}{\l@dprintingcolumnstrue} +% \begin{macro}{\l@dprintingcolumnsfalse} +% \begin{macro}{\l@dpairingtrue} +% \begin{macro}{\l@dpairingfalse} +% \begin{macro}{\ifpst@rtedL} +% \begin{macro}{\pst@rtedLtrue} +% \begin{macro}{\pst@rtedLfalse} +% \begin{macro}{\l@dnumpstartsL} +% \begin{macro}{\ifledRcol} +% \begin{macro}{\ifledRcol@} +% In preparation for the \parpackage package, these are related to +% the `right' text of parallel texts (when \cs{ifl@dpairing} is TRUE). +% They are explained in the \Lpack{eledpar} +% manual. +% \changes{v0.7.0}{2005/02/24}{Added \cs{l@dnumpstartsL}, \cs{ifl@dpairing} +% and \cs{ifpst@rted} for/from eledpar} +% \changes{v0.12.0}{2005/10/01}{Added \cs{ifledRcol} and \cs{ifnumberingR} for/from \Lpack{eledpar}} +% \changes{v1.12.0}{2014/08/05}{Add \cs{ifledRcol@} for \Lpack{eledpar}} +% \changes{v1.13.2}{2014/09/31}{Add \cs{ifl@dpaging} for \Lpack{eledpar}} +% \changes{v1.18.0}{2015/02/23}{Add \cs{ifl@dprintingpages} and \cs{@dprintingcolumns} for \Lpack{eledpar}} +% \begin{macrocode} +\newif\ifl@dpairing +\newif\ifl@dpaging% +\newif\ifl@dprintingpages% +\newif\ifl@dprintingcolumns% +\newif\ifpst@rtedL +\newcount\l@dnumpstartsL +% \end{macrocode} +% \cs{ifledRcol} is set to true in the \verb+Rightside+ environnement. It must be not confused with \cs{ifledRcol@} which is set to true when a right line is processed, in \cs{Pages} or \cs{Columns}. +% \begin{macrocode} +\newif\ifledRcol +\newif\ifledRcol@ +% \end{macrocode} +% The \cs{ifnumberingR} flag is +% set to \verb"true" if we're within a right text numbered section. +% \begin{macrocode} +\newif\ifnumberingR +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +%\section{Sectioning commands} +% +% \begin{macro}{\section@num} +% You use \cs{beginnumbering} and \cs{endnumbering} to begin +% and end a line-numbered section of the text; the pair of commands may +% be used as many times as you like within one document to start +% and end multiple, separately line-numbered sections. \LaTeX\ will +% maintain and display +% a `section number' as a count named +% \cs{section@num} that counts how many +% \cs{beginnumbering} and \cs{resumenumbering} +% commands have appeared; it need not be +% related to the logical divisions of your text. +% +% \begin{macro}{\extensionchars} +% Each section will read and write an associated `line-list +% file', containing information used to do the numbering; the file +% will be called \meta{jobname}\file{.nn}, where \file{nn} is the +% section number. However, you may direct that +% an extra string be added before the +% \file{nn} in that filename, in order to distinguish these +% temporary files from others: that string is called +% \cs{extensionchars}. Initially it's empty, since different +% operating systems have greatly varying ideas about what +% characters are permitted in file names. So +% \verb"\renewcommand{\extensionchars}{-}" gives temporary files called +% \file{jobname.-1}, \file{jobname.-2}, etc. +% \begin{macrocode} +\newcount\section@num +\section@num=0 +\let\extensionchars=\empty +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\ifnumbering} +% \begin{macro}{\numberingtrue} +% \begin{macro}{\numberingfalse} +% The \cs{ifnumbering} flag is +% set to \verb"true" if we are within a numbered section (that is, between +% \cs{beginnumbering} and \cs{endnumbering}). You can use \cs{ifnumbering} +% in your own code to check whether you are in a numbered section, but +% do not change the flag's value. +% \begin{macrocode} +\newif\ifnumbering +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\beginnumbering} +% \begin{macro}{\initnumbering@reg} +% \cs{beginnumbering} begins a section of numbered text. +% When it is executed we increment the section number, +% initialize our counters, send a message to your terminal, and +% call macros to start the lineation machinery and endnote files. +% +% The initializations here are trickier than they look. +% \cs{line@list@stuff} will use all of the counters +% that are zeroed here when it assembles +% the line-list and other lists of information about the lineation. +% But it will do all of this locally and +% within a group, and when it is done the +% lists will remain but the counters will return to zero. Those same +% counters will then be used as we process the text of this section, +% but the assignments will be made globally. These initializations +% actually apply to both uses, though in all other respects there +% should be no direct interaction between the use of these counters +% and variables in the two processing steps. +% \changes{v0.7.0}{2005/02/24}{Added \cs{initnumbering@reg}} +% \changes{v1.12.0}{2014/08/05}{\cs{beginnumbering} is defined only on \Lpack{eledmac}, not on \Lpack{eledpar}.} +% For parallel processing : +%\begin{itemize} +% \item zero \cs{l@dnumpstartsL} --- the number of chunks to be processed. +% \item set \cs{ifpst@rtedL} to FALSE. +% \end{itemize} +% \begin{macrocode} +\newcommand*{\beginnumbering}{% + \ifnumbering + \led@err@NumberingStarted + \endnumbering + \fi + \global\numberingtrue + \global\advance\section@num \@ne + \initnumbering@reg + \message{Section \the\section@num }% + \line@list@stuff{\jobname.\extensionchars\the\section@num}% + \l@dend@stuff + \setcounter{pstart}{1} + \ifl@dpairing + \global\l@dnumpstartsL \z@ + \global\pst@rtedLfalse +% \end{macrocode} +% The tools for section's title commands are called: +% \begin{itemize} +% \item Define an empty list of pstart number where sectioning commands are called. +% \item Input auxiliary file with the description of section titles. +% \item Open the same auxiliary file to write in. +% \end{itemize} +% \begin{macrocode} + \else + \begingroup + \global\@afterindenttrue%In order to retablish normal feature if the \begingroup was not here + \initnumbering@quote + \ifwidthliketwocolumns% + \csuse{setwidthliketwocolumns@\columns@position}% + \csuse{setpositionliketwocolumns@\columns@position}% + \fi% + \fi + \gdef\eled@sections@@{}% + \if@noeled@sec\else% + \makeatletter\InputIfFileExists{\jobname.eledsec\the\section@num}{}{}\makeatother% + \immediate\openout\eled@sectioning@out=\jobname.eledsec\the\section@num\relax% + \fi% +} +\newcommand*{\initnumbering@reg}{% + \global\pst@rtedLfalse + \global\l@dnumpstartsL \z@ + \global\absline@num \z@ + \gdef\normal@page@break{} + \gdef\l@prev@pb{} + \gdef\l@prev@nopb{} + \global\line@num \z@ + \global\subline@num \z@ + \global\@lock \z@ + \global\sub@lock \z@ + \global\sublines@false + \global\let\next@page@num=\relax + \global\let\sub@change=\relax + \resetprevline@ + \resetprevpage@num + } + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\endnumbering} +% \cs{endnumbering} must follow the last text for a numbered section. +% It takes care of notifying you when changes have been noted in the +% input that require running the file through again to move everything +% to the right place. +% \changes{v0.7.0}{2005/02/24}{Changed \cs{endnumbering} for eledpar} +% \changes{v1.12.5}{2014/08/31}{Allow to mix parallel columns and normal text when using \cs{pausenumbering}} +% \begin{macrocode} +\def\endnumbering{% + \ifnumbering + \global\numberingfalse + \normal@pars + \ifnum\l@dnumpstartsL=0% + \led@err@NumberingWithoutPstart% + \fi% + \ifl@dpairing + \global\pst@rtedLfalse + \else + \ifx\insertlines@list\empty\else + \global\noteschanged@true + \fi + \ifx\line@list\empty\else + \global\noteschanged@true + \fi + \fi + \ifnoteschanged@ + \led@mess@NotesChanged + \fi + \else + \led@err@NumberingNotStarted + \fi + \autoparfalse + \if@noeled@sec\else% + \immediate\closeout\eled@sectioning@out% + \fi% + \ifl@dpairing\else + \global\l@dnumpstartsL=\z@% + \endgroup + \fi +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pausenumbering} +% \begin{macro}{\resumenumbering} +% The \cs{pausenumbering} macro is just the same as +% \cs{endnumbering}, but with the \cs{ifnumbering} flag set to \verb"true", to +% show that numbering continues across the gap.\footnote{Peter Wilson's thanks +% to Wayne Sullivan,\index{Sullivan, Wayne} who suggested the idea +% behind these macros.} +% \begin{macrocode} +\newcommand{\pausenumbering}{% + \ifautopar\global\autopar@pausetrue\fi% + \endnumbering\global\numberingtrue} +% \end{macrocode} +% The \cs{resumenumbering} macro is a bit more involved, but not much. +% It does most of the same things as \cs{beginnumbering}, but +% without resetting the various counters. Note that no check is made +% by \cs{resumenumbering} to ensure that \cs{pausenumbering} was actually +% invoked. +% \changes{v0.7.0}{2005/02/24}{Changed \cs{resumenumbering} for eledpar} +% \changes{v1.12.5}{2014/08/31}{Debug \cs{resumenumbering}} +% \begin{macrocode} +\newcommand*{\resumenumbering}{% + \ifnumbering + \ifautopar@pause\autopar\fi + \global\pst@rtedLtrue + \global\advance\section@num \@ne + \led@mess@SectionContinued{\the\section@num}% + \line@list@stuff{\jobname.\extensionchars\the\section@num}% + \l@dend@stuff + \ifl@dpairing\else% + \begingroup% + \initnumbering@quote% + \ifwidthliketwocolumns% + \csuse{setwidthliketwocolumns@\columns@position}% + \csuse{setpositionliketwocolumns@\columns@position}% + \fi% + \fi% + \else + \led@err@NumberingShouldHaveStarted + \endnumbering + \beginnumbering + \fi} + + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \section{List macros} +% +% +% We will make heavy use of lists of information, which will be built +% up and taken apart by the following macros; they are +% adapted from \thetexbook, pp.\,378--379, which discusses +% their use in more detail. +% +% These macros consume a large amount of the run-time of this code. +% We intend to replace them in a future version, and in anticipation +% of doing so have defined their interface in such a way that it is +% not sensitive to details of the underlying code. +% +% The historical list tools of \ledmac are keept, because in many cause there are more useful than \Lpack{etoolbox}'s lists. +% They allows to get and delete the first element of a list in one operation. They also expands the items add to the list. +% +% However, \Lpack{etoolbox}'s lists are more useful to loop on them. +% Consequently, depending of what we need, we use one or either. +% +% It could be nice to unify them to the \LaTeX3 list, however such migration would take quite time with some risk of error, for a gain which will be minor. +% +% \begin{macro}{\list@create} +% The \cs{list@create} macro creates a new list. +% This macro does not do anything beyond initializing an empty +% list macro. +% +% \begin{macrocode} +\newcommand*{\list@create}[1]{% + \global\let#1=\empty% +}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\list@clear} +% The \cs{list@clear} macro just initializes a list to the empty list; +% it is no different from +% \cs{list@create} in its effect, but it is in its semantic . +% \begin{macrocode} +\newcommand*{\list@clear}[1]{% + \global\let#1=\empty% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\xright@appenditem} +% \begin{macro}{\led@toksa} +% \begin{macro}{\led@toksb} +% \cs{xright@appenditem} expands an item and appends it to the right +% end of a list macro. We want the expansion because we will often +% be using this to store the current value of a counter. +% \cs{xright@appenditem} creates global control sequences, like \cs{xdef}, and uses two +% temporary token-list registers, \cs{@toksa} and \cs{@toksb}. +% \begin{macrocode} +\newtoks\led@toksa \newtoks\led@toksb +\global\led@toksa={\\} +\long\def\xright@appenditem#1\to#2{% + \global\led@toksb=\expandafter{#2}% + \xdef#2{\the\led@toksb\the\led@toksa\expandafter{#1}}% + \global\led@toksb={}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\xleft@appenditem} +% \cs{xleft@appenditem} expands an item and appends it to the left +% end of a list macro; it is otherwise identical to +% \cs{xright@appenditem}. +% \begin{macrocode} +\long\def\xleft@appenditem#1\to#2{% + \global\led@toksb=\expandafter{#2}% + \xdef#2{\the\led@toksa\expandafter{#1}\the\led@toksb}% + \global\led@toksb={}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\gl@p} +% The \cs{gl@p} macro removes the leftmost +% item from a list and places it in a +% control sequence. You say \verb"\gl@p\l\to\z" +% (where \verb"\l" is the list macro, and +% \verb"\z" receives the left item). \verb"\l" is assumed nonempty:use +% \verb"\ifx\l\empty" to test for an empty \verb"\l". The control +% sequences created by \cs{gl@p} are all global. +% \begin{macrocode} +\def\gl@p#1\to#2{\expandafter\gl@poff#1\gl@poff#1#2} +\long\def\gl@poff\\#1#2\gl@poff#3#4{\gdef#4{#1}\gdef#3{#2}} + +% \end{macrocode} +% \end{macro} +% +% \section{Line counting} +% \label{lineation}\relax +% +% \subsection{Choosing the system of lineation} +% \changes{v0.15.0}{2012/06/11}{Line numbering can be reset at each pstart.} +% Line number can be reset at each section (default) ; at each page ; at each pstart. +% Here we define +% internal codes for these systems and the macros. +% +% +% \begin{macro}{\ifbypstart@} +% \begin{macro}{\bypstart@true} +% \begin{macro}{\bypstart@false} +% \begin{macro}{\ifbypage@} +% \begin{macro}{\bypage@true} +% \begin{macro}{\bypage@false} +% The \cs{ifbypage@} and \cs{ifbypstart@} flag specifie the current lineation +% system: \begin{itemize} +% \item line-of-page: \verb|bypstart@ = false| and \verb|bypage@ = true|. +% \item line-of-pstart: \verb|bypstart@ = true| and \verb|bypage@ = false|. +% \end{itemize} +% \Macpackage will use the line-of-section system unless instructed otherwise. +% \begin{macrocode} +\newif\ifbypage@ +\newif\ifbypstart@ +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% The \cs{ifbypage@R} and \cs{ifbypstart@R} flag specifie the current lineation for right side in case of using \parpackage. They are now defined because they are used in some specific code. +% \Parpackage will use the line-of-section system unless instructed otherwise. +% \begin{macro}{\ifbypage@R} +% \begin{macro}{\ifbypstart@R} +% \begin{macrocode} +\newif\ifbypage@R +\newif\ifbypstart@R +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\lineation} +% \cs{lineation}\marg{word} is the macro you use to select the +% lineation system. +% Its argument is a string: either \verb+page+, \verb+section+ or \verb+pstart+. +% \begin{macrocode} +\newcommand*{\lineation}[1]{{ +% \end{macrocode} +% We can't change the lineation system inside numbering section. +% \begin{macrocode} + \ifnumbering + \led@err@LineationInNumbered + \else +% \end{macrocode} +% If the argument is \verb+page+. +% \begin{macrocode} + \def\@tempa{#1}\def\@tempb{page}% + \ifx\@tempa\@tempb + \global\bypage@true + \global\bypstart@false + \unless\ifnocritical@% + \Xpstart[][false]% + \fi% +% \end{macrocode} +% If the argument is \verb+pstart+. +% \begin{macrocode} + \else + \def\@tempb{pstart}% + \ifx\@tempa\@tempb + \global\bypage@false + \global\bypstart@true + \unless\ifnocritical@% + \Xpstart% + \fi% +% \end{macrocode} +% And finally, if the argument is \verb+section+ (default). +% \begin{macrocode} + \else + \def\@tempb{section} + \ifx\@tempa\@tempb + \global\bypage@false + \global\bypstart@false + \unless\ifnocritical@% + \Xpstart[][false]% + \fi% +% \end{macrocode} +% In other case, it is an error. +% \begin{macrocode} + \else + \led@warn@BadLineation + \fi + \fi + \fi + \fi}} +% \end{macrocode} +% \end{macro} +% \subsection{Line number margin} +% \begin{macro}{\linenummargin} +% \begin{macro}{\line@margin} +% \begin{macro}{\l@dgetline@margin} +% \cs{linenummargin}\marg{word} specify which margin +% line numbers are in; it takes one argument, a string, which value can be +% \verb+left+ ; \verb+right+; \verb+inner+ or +% \verb+outer+. +% +% The selection is recorded in the count \cs{line@margin}: +% $0$ for left, $1$ for right, $2$ for outer, and $3$ for inner. +% \changes{v0.7.0}{2005/02/23}{Added \cs{l@dgetline@margin}} +% \begin{macrocode} +\newcount\line@margin + +\newcommand*{\linenummargin}[1]{{% + \l@dgetline@margin{#1}% + \ifnum\@l@dtempcntb>\m@ne + \ifledRcol + \global\line@marginR=\@l@dtempcntb + \else + \global\line@margin=\@l@dtempcntb + \fi + \fi}} + +\newcommand*{\l@dgetline@margin}[1]{% + \def\@tempa{#1}\def\@tempb{left}% + \ifx\@tempa\@tempb + \@l@dtempcntb \z@ + \else + \def\@tempb{right}% + \ifx\@tempa\@tempb + \@l@dtempcntb \@ne + \else + \def\@tempb{outer}% + \ifx\@tempa\@tempb + \@l@dtempcntb \tw@ + \else + \def\@tempb{inner}% + \ifx\@tempa\@tempb + \@l@dtempcntb \thr@@ + \else + \led@warn@BadLinenummargin + \@l@dtempcntb \m@ne + \fi + \fi + \fi + \fi} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \subsection{Line number initialization and increment} +% \begin{macro}{\c@firstlinenum} +% \begin{macro}{\c@linenumincrement} +% The following counters tell \macpackage which lines should be +% printed with line numbers. \verb+firstlinenum+ is the number of the +% first line in each section that gets a number; +% \verb+linenumincrement+ +% is the difference between successive numbered lines. The initial +% values of these counters produce labels on lines $5$, $10$, $15$, etc. +% \verb+linenumincrement+ must be at least $1$. +% +% \begin{macrocode} +\newcounter{firstlinenum} + \setcounter{firstlinenum}{5} +\newcounter{linenumincrement} + \setcounter{linenumincrement}{5} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\c@firstsublinenum} +% \begin{macro}{\c@sublinenumincrement} +% The following parameters are just like \verb+firstlinenum+ and +% \verb+linenumincrement+, but for sub-line numbers. +% \verb+sublinenumincrement+ must be at least $1$. +% +% \begin{macrocode} +\newcounter{firstsublinenum} + \setcounter{firstsublinenum}{5} +\newcounter{sublinenumincrement} + \setcounter{sublinenumincrement}{5} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\firstlinenum} +% \begin{macro}{\linenumincrement} +% \begin{macro}{\firstsublinenum} +% \begin{macro}{\sublinenumincrement} +% These macros can be used to set the corresponding counters. +% \changes{v0.7.0}{2005/02/18}{Added \cs{firstlinenum}, \cs{linenumincrement}, +% \cs{firstsublinenum} and \cs{linenumincrement}} +% \begin{macrocode} + +\newcommand*{\firstlinenum}[1]{% + \ifledRcol% + \setcounter{firstlinenumR}{#1}% + \else% + \setcounter{firstlinenum}{#1}% + \fi% +} +\newcommand*{\linenumincrement}[1]{% + \ifledRcol% + \setcounter{linenumincrementR}{#1}% + \else% + \setcounter{linenumincrement}{#1}% + \fi% +} +\newcommand*{\firstsublinenum}[1]{% + \ifledRcol% + \setcounter{firstsublinenumR}{#1}% + \else% + \setcounter{firstsublinenum}{#1}% + \fi% +} +\newcommand*{\sublinenumincrement}[1]{% + \ifledRcol% + \setcounter{sublinenumincrementR}{#1}% + \else% + \setcounter{sublinenumincrement}{#1}% + \fi% +} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsection{Line number locking} +% \begin{macro}{\lockdisp} +% \begin{macro}{\lock@disp} +% \begin{macro}{\l@dgetlock@disp} +% When line locking is being used, the \cs{lockdisp}\marg{word} macro +% specifies whether a line number---if one is due to +% appear---should be printed on the first printed line or on the +% last, or by all of them. +% Its argument is a word, either +% \verb+first+, \verb+last+, or \verb+all+. +% Initially, it is set to \verb+first+. +% +% \cs{lock@disp} encodes the selection: $0$ for first, $1$ for last, +% $2$ for all. +% \changes{v0.7.0}{2005/02/23}{Added \cs{l@dgetlock@disp}} +% \begin{macrocode} +\newcount\lock@disp +\newcommand{\lockdisp}[1]{{% + \l@dgetlock@disp{#1}% + \ifnum\@l@dtempcntb>\m@ne + \global\lock@disp=\@l@dtempcntb + \else + \led@warn@BadLockdisp + \fi}} +\newcommand*{\l@dgetlock@disp}[1]{ + \def\@tempa{#1}\def\@tempb{first}% + \ifx\@tempa\@tempb + \@l@dtempcntb \z@ + \else + \def\@tempb{last}% + \ifx\@tempa\@tempb + \@l@dtempcntb \@ne + \else + \def\@tempb{all}% + \ifx\@tempa\@tempb + \@l@dtempcntb \tw@ + \else + \@l@dtempcntb \m@ne + \fi + \fi + \fi} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\sublockdisp} +% \begin{macro}{\sublock@disp} +% The same questions about where to print the line number apply to +% sub-lines, and these are the analogous macros for dealing with +% the problem. +% \begin{macrocode} +\newcount\sublock@disp +\newcommand{\sublockdisp}[1]{{% + \l@dgetlock@disp{#1}% + \ifnum\@l@dtempcntb>\m@ne + \global\sublock@disp=\@l@dtempcntb + \else + \led@warn@BadSublockdisp + \fi}} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \subsection{Line number style} +% \begin{macro}{\linenumberstyle} +% \begin{macro}{\linenumrep} +% \begin{macro}{\linenumr@p} +% \begin{macro}{\sublinenumberstyle} +% \begin{macro}{\sublinenumrep} +% \begin{macro}{\sublinenumr@p} +% We provide a mechanism for using different representations of the +% line numbers, not just the normal arabic. +% +% NOTE: In v0.7 \cs{linenumrep} and \cs{sublinenumrep} replaced +% the internal \cs{linenumr@p} and \cs{sublinenumr@p}. +% +% \cs{linenumberstyle} and \cs{sublinenumberstyle} are user level +% macros for setting the number representation (\cs{linenumrep} +% and \cs{sublinenumrep}) for line and sub-line numbers. +% \changes{v0.3.0}{2004/02/14}{Added \cs{linenumberstyle} and \cs{sublinenumberstyle}} +% \changes{v0.7.0}{2005/02/18}{Using \cs{linenumrep} instead of \cs{linenumr@p}} +% \changes{v0.7.0}{2005/02/18}{Using \cs{sublinenumrep} instead of \cs{sublinenumr@p}} +% \begin{macrocode} +\newcommand*{\linenumberstyle}[1]{% + \def\linenumrep##1{\@nameuse{@#1}{##1}}} +\newcommand*{\sublinenumberstyle}[1]{% + \def\sublinenumrep##1{\@nameuse{@#1}{##1}}} +% \end{macrocode} +% Initialise the number styles to arabic. +% \begin{macrocode} +\linenumberstyle{arabic} + \let\linenumr@p\linenumrep +\sublinenumberstyle{arabic} + \let\sublinenumr@p\sublinenumrep + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \subsection{Line number printing} +% \begin{macro}{\leftlinenum} +% \begin{macro}{\rightlinenum} +% \begin{macro}{\linenumsep} +% \begin{macro}{\numlabfont} +% \begin{macro}{\ledlinenum} +% \cs{leftlinenum} and \cs{rightlinenum} are the macros that are +% called to print marginal line numbers on +% a page, for left- and right-hand margins respectively. +% They are made easy to access and change, since you may +% want to change the styling in some way. +% These standard versions +% illustrate the general sort of thing that will be needed; they are +% based on the \cs{leftheadline} macro in \thetexbook, p.\,416. +% +% Whatever these macros output gets printed in a box that will be +% put into the appropriate margin without any space between it and the +% line of text. +% You will generally want a kern between a line number and +% the text, and \cs{linenumsep} is provided as a standard way of +% storing its size. Line numbers are usually printed in a smaller +% font, and \cs{numlabfont} is provided as a standard name for that +% font. When called, these macros +% will be executed within a group, so font changes and the like will +% remain local. +% +% \cs{ledlinenum} typesets the line (and subline) number. +% +% The original \cs{numlabfont} specification is equivalent to +% the \LaTeX\ \cs{scriptsize} for a 10pt document. +% \changes{v0.3.0}{2004/02/14}{Added \cs{linenumr@p} and \cs{sublinenum@rep} +% to \cs{leftlinenum} and \cs{rightlinenum}} +% \changes{v0.7.0}{2005/02/18}{Added \cs{ledlinenum} for use by +% \cs{leftlinenum} and \cs{rightlinenum}} +% \begin{macrocode} +\newlength{\linenumsep} + \setlength{\linenumsep}{1pc} +\newcommand*{\numlabfont}{\normalfont\scriptsize} +\newcommand*{\ledlinenum}{% + \bgroup% + \ifluatex% + \luatextextdir TLT% + \fi% + \numlabfont\linenumrep{\line@num}% + \ifsublines@ + \ifnum\subline@num>0\relax + \unskip\fullstop\sublinenumrep{\subline@num}% + \fi + \fi% + \egroup% +}% + +\newcommand*{\leftlinenum}{% + \ledlinenum + \kern\linenumsep} +\newcommand*{\rightlinenum}{% + \kern\linenumsep + \ledlinenum} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsection{Line number counters and lists} +% +% Footnote references using line numbers rather than symbols can't be +% generated in one pass, because we do not know the line numbers till we +% ship out the pages. It would be possible if footnotes were never keyed +% to more than one line; but some footnotes gloss passages that may run +% for several lines, and they must be tied to the first line of the +% passage glossed. And even one-line passages require two passes if we +% want line-per-page numbering rather than line-per-section numbering. +% +% So we run \LaTeX\ over the text several times, and each time save +% information about page and line numbers in a `line-list file' to +% be used during the next pass. At the start of each section---whenever +% \cs{beginnumbering} is executed---the line-list file +% for that section +% is read, and the information from it is encoded into a few list +% macros. +% +% We need first to define the different line numbers that are involved +% in these macros, and the associated counters. +% +% \begin{macro}{\line@num} +% The count \cs{line@num} stores the line number that is used in +% marginal line numbering and in notes: counting either by section, page or pstart, depending on your +% choice for this section. This may be qualified by \cs{subline@num}. +% \begin{macrocode} +\newcount\line@num +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\subline@num} +% The count \cs{subline@num} stores +% a sub-line number that qualifies \cs{line@num}. For example, +% line $10$ might have sub-line numbers $1$, $2$ and $3$, which might be +% printed as lines $10.1$, $10.2$, $10.3$. +% \begin{macrocode} +\newcount\subline@num +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ifsublines@} +% \begin{macro}{\sublines@true} +% \begin{macro}{\sublines@false} +% We maintain an associated flag, \cs{ifsublines@}, +% to tell us whether we're within +% a sub-line range or not. +% +% You may wonder why we do not just use the value of \cs{subline@num} +% to determine this---treating anything greater than $0$ as an +% indication that sub-lineation is on. We need a separate flag because +% sub-lineation can be used together with line-number locking in odd +% ways: several pieces of a logical line might be interrupted by +% pieces of sub-lineated text, and those sub-line numbers should not +% return to zero until the next change in the major line number. This +% is common in the typesetting of English Renaissance verse +% drama\index{Middleton, Thomas}, in which stage directions are +% given sub-line numbers: a single line of verse may be +% interrupted by several stage directions. +% \begin{macrocode} +\newif\ifsublines@ +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\absline@num} +% The count \cs{absline@num} stores the +% absolute number of lines since the start +% of the section: that is, the number we have actually printed, no matter +% what numbers we attached to them. +% This value is never printed on an output page, though +% \cs{line@num} will often be equal to it. It is used internally to +% keep track of where notes are to appear and where new +% pages start: using this value rather than \cs{line@num} is a lot +% simpler, because it does not depend on the lineation system in use. +% \begin{macrocode} +\newcount\absline@num +% \end{macrocode} +% \end{macro} +% +% We will call \cs{absline@num} numbers ``absolute'' numbers, and +% \cs{line@num} and \cs{subline@num} numbers ``visible'' numbers. +% +% \subsection{Line number locking counter} +% \begin{macro}{\@lock} +% \begin{macro}{\sub@lock} +% The counts \cs{@lock} and \cs{sub@lock} +% tell us the state of line-number +% and sub-line-number locking. $0$ means we are not within a locked set of +% lines; $1$ means we are at the first line in the set; $2$, at some +% intermediate line; and $3$, at the last line. +% \begin{macrocode} +\newcount\@lock +\newcount\sub@lock +% \end{macrocode} +% \end{macro} +% \end{macro} +% \subsection{Line number associated to lemma} +% \begin{macro}{\line@list} +% \begin{macro}{\insertlines@list} +% \begin{macro}{\actionlines@list} +% \begin{macro}{\actions@list} +% Now we can define the list macros that will be created from the +% line-list file. We will maintain the following lists: +% \begin{itemize}\addtolength{\itemsep}{-1ex} +% \item \cs{line@list}: the page and line numbers for every +% lemma marked by \cs{edtext}. +% There are seven pieces of information, separated by vertical bars: +% \label{linenumbers} +% \begin{enumerate}\addtolength{\itemsep}{-1ex} +% \item the starting page, +% \item line, and +% \item sub-line numbers, followed by the +% \item ending page, +% \item line, and +% \item sub-line numbers, and then the +% \item font specifier for the lemma. +% \end{enumerate} +% +% +% These line numbers are all visible numbers. +% The font specifier is a set of four codes for font encoding, +% family, series, and shape, separated by \verb"/" characters. +% Thus a lemma that +% started on page $23$, line $35$ and +% went on until page $24$, line $3$ +% (with no sub-line numbering), and was typeset in a normal roman font +% would have a line list entry like this: \\ +% \verb"23|35|0|24|3|0|OT1/cmr/m/n". +% +% There is one item in this list for every lemma marked by +% \cs{edtext}, even if there are several notes to that lemma, or no +% notes at all. \cs{edtext} reads the data in this list, making it +% available for use in the text of notes. +% +% \item \cs{insertlines@list}: the line numbers of lines that have +% footnotes or other insertions. +% These are the absolute numbers where the corresponding +% lemmas begin. This list contains one entry for every footnote in the +% section; one lemma may contribute no footnotes or many footnotes. +% This list is used by \cs{add@inserts} within \cs{do@line}, to tell +% it where to insert notes. +% +% \item \cs{actionlines@list}: a list of absolute line numbers at +% which we are to perform special +% actions; these actions are specified by the \cs{actions@list} list +% defined below. +% +% \item \cs{actions@list}: action codes corresponding to the line +% numbers in \cs{actionlines@list}. These codes tell \macpackage what action +% it is supposed to take at each of these lines. One action, the +% page-start action, is generated behind the scenes by \macpackage{} itself; +% the others, for specifying sub-lineation, line-number locking, and +% line-number alteration, are generated only by explicit commands in +% your input file. The page-start and line-number-alteration actions +% require arguments, to specify the new values for the page or line +% numbers; instead of storing those arguments in another list, we have +% chosen the action-code values so that they can encode both the action +% and the argument in these cases. Action codes greater than $-1000$ +% are page-start actions, and the code value is the page number; action +% codes less than $-5000$ specify line numbers, and the code value is +% a transformed version of the line number; action codes between these +% two values specify other actions which require no argument. +% +% Here is the full list of action codes and their meanings: +% +% Any number greater than $-1000$ is a page-start action: the line number +% associated with it is the first line on a page, and the action number is +% the page number. (The cutoff of $-1000$ is chosen because negative +% page-number values are used by some macro packages; we assume that +% page-number values less than $-1000$ are not common.) +% Page-start action codes are added to the list by +% the \cs{page@action} macro, which is (indirectly) triggered by the +% workings of the \cs{page@start} macro; that macro should always be +% called in the output routine, just before the page contents are +% assembled. \Eledmac{} calls it in \cs{pagecontents}. +% +% The action code $-1001$ specifies the start of sub-lineation: meaning +% that, starting with the next line, we should be advancing +% \cs{subline@num} at each start-of-line command, rather than +% \cs{line@num}. +% +% The action code $-1002$ specifies the end of sub-lineation. At the +% next start-of-line, we should clear the sub-line counter and start +% advancing the line number. The action codes for starting and ending +% sub-lineation are added to the list by the \cs{sub@action} macro, as +% called to implement the \cs{startsub} and \cs{endsub} macros. +% +% The action code $-1003$ specifies the start of line number locking. +% After the number for the current line is computed, it will remain +% at that value through the next line that has an action code to end +% locking. +% +% The action code $-1004$ specifies the end of line number locking. +% +% The action code $-1005$ specifies the start of sub-line number locking. +% After the number for the current sub-line is computed, it will remain +% at that value through the next sub-line that has an action code to end +% locking. +% +% The action code $-1006$ specifies the end of sub-line number locking. +% +% The four action codes for line and sub-line number locking are added +% to the list by the \cs{do@lockon} and \cs{do@lockoff} macros, as called +% to implement the \cs{startlock} and \cs{endlock} macros. +% +% An action code of $-5000$ or less sets the current visible line +% number (either the line number or the sub-line number, whichever is +% currently being advanced) to a specific positive value. The value of +% the code is $-(5000+n)$, where $n$ is the value (always $\ge 0$) +% assigned to the current line number. Action codes of this type are +% added to the list by the \cs{set@line@action} macro, as called to +% implement the \cs{advanceline} and \cs{setline} macros: this action only +% occurs when the user has specified some change to the line numbers +% using those macros. Normally \macpackage{} computes the visible line numbers +% from the absolute line numbers with reference to the other +% action codes and the settings they invoke; it does not require an +% entry in the action-code list for every line. +% +% Here are the commands to create these lists: +% +% \begin{macrocode} +\list@create{\line@list} +\list@create{\insertlines@list} +\list@create{\actionlines@list} +\list@create{\actions@list} + +% \end{macrocode} +% +% \end{itemize} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\page@num} +% \begin{macro}{\endpage@num} +% \begin{macro}{\endline@num} +% \begin{macro}{\endsubline@num} +% We will need some counts while we read the line-list, +% for the page number and the ending page, line, and sub-line numbers. +% Some of these will be used again later on, when we are acting on the +% data in our list macros. +% \begin{macrocode} +\newcount\page@num +\newcount\endpage@num +\newcount\endline@num +\newcount\endsubline@num +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\ifnoteschanged@} +% \begin{macro}{\noteschanged@true} +% \begin{macro}{\noteschanged@false} +% If the number of the footnotes in a section is different from what it was +% during the last run, or if this is the very first time you've run +% \LaTeX, +% on this file, the information from the line-list used to place the +% notes will be wrong, and some notes will probably be misplaced. +% When this happens, we prefer +% to give a single error message for the whole section rather than +% messages at every point where we notice the problem, because +% we do not really know where in the section notes were added or removed, +% and the solution in any case is simply to run \LaTeX\ two more times; +% there is no fix needed to the document. The +% \cs{ifnoteschanged@} flag is set if such +% a change in the number of notes is discovered at any point. +% \begin{macrocode} +\newif\ifnoteschanged@ +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \DescribeMacro{\resetprevline@} +% Inside the apparatus, at each note, the line number is stored in a macro called \cs{prevlineX}, +% where X is the letter of the current series. +% This macro is called when using \cs{Xnumberonlyfirstinline}. +% This macro must be reset at the same time as the line number. +% The \cs{resetprevline@} does this resetting for every series. +% \begin{macro}{\resetprevline@} +% \begin{macrocode} +\newcommand*{\resetprevline@}{% + \def\do##1{\global\csundef{prevline##1}}% + \dolistloop{\@series}% +} +% \end{macrocode} +% \end{macro} +% +% \DescribeMacro{\resetprevpage@num} +% Inside the apparatus, at each note, the page number is stored in a macro called \cs{prevpageX@num}, +% where X is the letter of the current series. +% This macro is called when using \cs{Xparafootsep} or \cs{parafootsepX}. +% This macro must be reset at the beginning of each numbered section +% The \cs{resetprevpage@} command resets this macro for every series. +% \begin{macro}{\resetprevpage@} +% \begin{macrocode} +\newcommand*{\resetprevpage@num}{% + \def\do##1{\ifcsdef{prevpage##1@num}{\global\csname prevpage##1@num\endcsname=0}{}}% + \dolistloop{\@series}% +} +% \end{macrocode} +% \end{macro} +% \subsection{Reading the line-list file} +% +% +% \begin{macro}{\read@linelist} +% \cs{read@linelist}\marg{file} is the control sequence +% that is called by \cs{beginnumbering} +% (via \cs{line@list@stuff}) to open and process a +% line-list file; its argument is the name of the file. +% \label{readlinelist}. +% First, it clear all previous line's list. +% \begin{macrocode} +\newread\@inputcheck +\newcommand*{\read@linelist}[1]{% + \ifledRcol% + \list@clearing@regR% + \else% + \list@clearing@reg% + \fi% +% \end{macrocode} +% +% When using \parpackage, make sure that the \cs{maxlinesinpar@list} is empty (otherwise things +% will be thrown out of kilter if there is any old stuff still hanging +% in there). +% \begin{macrocode} + \list@clear{\maxlinesinpar@list} +% \end{macrocode} +% Now get the file and interpret it. +% When the file is there we start a new group and make some special +% definitions we will need to process it. +% It is a sequence of \TeX\ +% commands, but they require a few special settings. +% We make [ and +% ] become grouping characters: they are used that way in the +% line-list file, because we need to write them out one at a time +% rather than in balanced pairs, and it is easier to just use +% something other than real braces. @ must become a letter, since +% this is run in the ordinary \LaTeX\ context. We ignore carriage +% returns, since if we are in horizontal mode they can get +% interpreted as spaces to be printed. +% +% +% Our line, page, and line-locking counters were already zeroed +% by \cs{line@list@stuff} if this is being called from within +% \cs{beginnumbering}; sub-lineation will be turned off as well +% in that case. On the other hand, +% if this is being called from \cs{resumenumbering}, those things +% should still have the values they had when \cs{pausenumbering} +% was executed. +% +% If the file is not there, we print an informative message. +% +% Now, after these preliminaries, we start interpreting the file. +% +% +% \begin{macrocode} + \get@linelistfile{#1}% + \endgroup +% \end{macrocode} +% +% When the reading is done, we are all through with the +% line-list file. All the information we needed +% from it will now be encoded in our list macros. +% +% Finally, we +% initialize the \cs{next@actionline} and \cs{next@action} macros, +% which specify where and what the next action to be taken is. +% \begin{macrocode} + \ifledRcol + \global\page@numR=\m@ne + \ifx\actionlines@listR\empty + \gdef\next@actionlineR{1000000}% + \else + \gl@p\actionlines@listR\to\next@actionlineR + \gl@p\actions@listR\to\next@actionR + \fi + \else + \global\page@num=\m@ne + \ifx\actionlines@list\empty + \gdef\next@actionline{1000000}% + \else + \gl@p\actionlines@list\to\next@actionline + \gl@p\actions@list\to\next@action + \fi + \fi +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\list@clearing@reg} +% Clears the lists for \cs{read@linelist} +% \changes{v0.7.0}{2005/02/22}{Added \cs{list@clearing@reg}} +% \begin{macrocode} +\newcommand*{\list@clearing@reg}{% + \list@clear{\line@list}% + \list@clear{\insertlines@list}% + \list@clear{\actionlines@list}% + \list@clear{\actions@list}% + \list@clear{\linesinpar@listL}% + \list@clear{\linesonpage@listL}% + }% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\get@linelistfile} +% \Macpackage{} can take advantage of the \LaTeX\ `safe file input' macros +% to get the line-list file. +% \changes{v0.7.0}{2005/02/22}{Added \cs{get@linelistfile}} +% \begin{macrocode} +\newcommand*{\get@linelistfile}[1]{% + \InputIfFileExists{#1}{% + \global\noteschanged@false + \begingroup + \catcode`\[=1 \catcode`\]=2 + \makeatletter \catcode`\^^M=9}{% + \led@warn@NoLineFile{#1}% + \global\noteschanged@true + \begingroup}% +} + +% \end{macrocode} +% \end{macro} +% +% This version of \cs{read@linelist} creates list macros +% containing data for the entire section, so they could get rather +% large. It would be no more difficult to read the line-list file +% incrementally rather than all at once: we could read, at the +% start of each paragraph, only the commands relating to that +% paragraph. But this would require that we +% have two line-lists open at once, one for reading, one for +% writing, and on systems without version numbers we would have to do +% some file renaming outside of \LaTeX\ for that to work. We have +% retained this slower approach to avoid that sort of hacking +% about, but have provided the \cs{pausenumbering} and +% \cs{resumenumbering} macros to help you if you run into +% macro memory limitations (see \reff{pause} above). +% +% \subsection{Commands within the line-list file} +% +% This section defines the commands that can appear within a +% line-list file. They all have very short names because we are +% likely to be writing very large numbers of them out. One macro, +% \cs{@nl}, is especially short, since it will be written to the +% line-list file once for every line of text in a numbered section. +% (Another of these commands, \cs{@lab}, will be introduced in a +% later section, among the cross-referencing commands it is +% associated with.) +% +% When these commands modify the various page and line counters, +% they deliberately do not say \cs{global}. This is because we +% want them to affect only the counter values within the current +% group when nested calls of \cs{@ref} occur. (The code assumes +% throughout that the value of \cs{globaldefs} is zero.) +% +% The macros with \verb"action" in their names contain all the code +% that modifies the action-code list: again, this is so that they +% can be turned off easily for nested calls of \cs{@ref}. +% +% \begin{macro}{\line@list@version} +% The \cs{line@list@version} check if the line-list file does not refers to the older commands of \macpackage. +% In this case, we stop reading the line-list file. +% Consequently, \cs{line@list@version} must be the first line of a line-number file. +% \begin{macrocode} +\newcommand{\line@list@version}[1]{% + \IfStrEq{#1}{\this@line@list@version}% + {}% + {\ifledRcol% + \led@warn@Obsolete{\jobname.\extensionchars\the\section@num}% + \else% + \led@warn@Obsolete{\jobname.\extensionchars\the\section@num}% + \fi% + \endinput% + }% +}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\@nl} +% \begin{macro}{\@nl@reg} +% \changes{v1.12.0}{2014/08/05}{To ensure compatibility with \cs{musixtex}, \cs{@l} becomes \cs{@l}. Consequently, \cs{@l@reg} becomes \cs{@nl@reg}.} +% \cs{@nl} does everything related to the start of a +% new line of numbered text. +% +% In order to get the \cs{setlinenum} to work Peter Wilson had to slip in some new +% code at the start of the macro, to get the timing of the actions +% correct. The problem was that his original naive implementation +% of \cs{setlinenum} had a unfortunate tendency to change the +% number of the last line of the \emph{preceding} paragraph. +% The new code is sort of based on the page number handling and +% \cs{setline}. +% It seems +% that a lot of fiddling with the line number internals is required. +% +% In November 2004 in order to accurately determine page numbers Peter Wilson added +% these to the macro. It is now: \\ +% \cs{@nl}\marg{page counter number}\marg{printed page number} \\ +% We do not (yet) use the printed number (i.e., the \cs{thepage}) but +% it may come in handy later. The macro \cs{fix@page} checks if a new +% page has started. +% +% Exactly what \cs{@nl} does depends +% on whether right text is being processed. That's why many code is defined in \cs{@nl@reg} or \cs{nl@regR}. +% +% +% \changes{v0.3.0}{2004/02/14}{Added a bunch of code to \cs{@nl} for handling +% \cs{setlinenum}} +% \changes{v0.6.0}{2004/11/16}{Extended \cs{@nl} to include the page number} +% \changes{v0.6.0}{2004/11/16}{Added \cs{fix@page} to \cs{@nl}} +% \changes{v0.7.0}{2005/02/22}{Added \cs{@nl@reg}} +% \begin{macrocode} + +\newcommand*{\@nl}[2]{% + \fix@page{#1}% + \ifledRcol% + \@nl@regR% + \else% + \@nl@reg% + \fi% +} +\newcommand*{\@nl@reg}{% + \ifx\l@dchset@num\relax \else + \advance\absline@num \@ne + \set@line@action + \let\l@dchset@num=\relax + \advance\absline@num \m@ne + \advance\line@num \m@ne + \fi +% \end{macrocode} +% +% First increment the absolute line-number, and perform +% deferred actions relating to page starts and sub-lines. +% \begin{macrocode} + \advance\absline@num \@ne + \ifx\next@page@num\relax \else + \page@action + \let\next@page@num=\relax + \fi + \ifx\sub@change\relax \else + \ifnum\sub@change>\z@ + \sublines@true + \else + \sublines@false + \fi + \sub@action + \let\sub@change=\relax + \fi +% \end{macrocode} +% +% Fix the lock counters, if necessary. A value of $1$ is advanced to +% $2$; $3$ advances to $0$; other values are unchanged. +% \begin{macrocode} + \ifcase\@lock + \or + \@lock \tw@ + \or \or + \@lock \z@ + \fi + \ifcase\sub@lock + \or + \sub@lock \tw@ + \or \or + \sub@lock \z@ + \fi +% \end{macrocode} +% +% Now advance the visible line number, unless it has been locked. +% \begin{macrocode} + \ifsublines@ + \ifnum\sub@lock<\tw@ + \advance\subline@num \@ne + \fi + \else + \ifnum\@lock<\tw@ + \advance\line@num \@ne \subline@num \z@ + \fi + \fi} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\last@page@num} +% \begin{macro}{\fix@page} +% \cs{fix@page} basically replaces \cs{@page}. It determines whether or not +% a new page has been started, based on the page values held by \cs{@nl}. +% \changes{v0.6.0}{2004/11/16}{Added \cs{last@page@num} and \cs{fix@page}} +% \begin{macrocode} +\newcount\last@page@num + \last@page@num=-10000 + +\newcommand*{\fix@page}[1]{% + \ifledRcol + \ifnum #1=\last@page@numR + \else + \ifbypage@R + \line@numR \z@ \subline@numR \z@ + \fi + \page@numR=#1\relax + \last@page@numR=#1\relax + \def\next@page@numR{#1}% + \fi + \else + \ifnum #1=\last@page@num + \else + \ifbypage@ + \line@num \z@ \subline@num \z@ + \fi + \page@num=#1\relax + \last@page@num=#1\relax + \def\next@page@num{#1}% + \listxadd{\normal@page@break}{\the\absline@num} + \fi + \fi} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@pend} +% \begin{macro}{\@pendR} +% \begin{macro}{\@lopL} +% \begin{macro}{\@lopR} +% These do not do anything at this point, but will have been added to the +% auxiliary file(s) if the \parpackage package has been used. They +% are just here to stop \macpackage from moaning if the \parpackage +% is used for one run and then not for the following one. +% \changes{v0.6.0}{2004/11/16}{Added \cs{@pend},\cs{@pendR}, \cs{@lopL} and +% \cs{@lopR} in anticipation of parallel processing} +% \begin{macrocode} +\newcommand*{\@pend}[1]{} +\newcommand*{\@pendR}[1]{} +\newcommand*{\@lopL}[1]{} +\newcommand*{\@lopR}[1]{} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\sub@on} +% \begin{macro}{\sub@off} +% The \cs{sub@on} and \cs{sub@off} macros +% turn sub-lineation on and off\/: but not directly, since such changes +% do not really take effect until the next line of text. Instead +% they set a flag that notifies \cs{@nl} of the necessary action. +% \begin{macrocode} +\newcommand*{\sub@on}{\ifsublines@ + \let\sub@change=\relax + \else + \def\sub@change{1}% + \fi} +\newcommand*{\sub@off}{\ifsublines@ + \def\sub@change{-1}% + \else + \let\sub@change=\relax + \fi} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@adv} +% The \cs{@adv}\marg{num} macro advances +% the current visible line number by the amount specified as +% its argument. This is used to implement \cs{advanceline}. +% \begin{macrocode} + +\newcommand*{\@adv}[1]{% + \ifsublines@ + \ifledRcol + \advance\subline@numR by #1\relax + \ifnum\subline@numR<\z@ + \led@warn@BadAdvancelineSubline + \subline@numR \z@ + \fi + \else + \advance\subline@num by #1\relax + \ifnum\subline@num<\z@ + \led@warn@BadAdvancelineSubline + \subline@num \z@ + \fi + \fi + \else + \ifledRcol + \advance\line@numR by #1\relax + \ifnum\line@numR<\z@ + \led@warn@BadAdvancelineLine + \line@numR \z@ + \fi + \else + \advance\line@num by #1\relax + \ifnum\line@num<\z@ + \led@warn@BadAdvancelineLine + \line@num \z@ + \fi + \fi + \fi + \set@line@action} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@set} +% The \cs{@set}\marg{num} macro sets +% the current visible line number to the value specified as +% its argument. This is used to implement \cs{setline}. +% \begin{macrocode} + +\newcommand*{\@set}[1]{% + \ifledRcol + \ifsublines@ + \subline@numR=#1\relax + \else + \line@numR=#1\relax + \fi + \set@line@action + \else + \ifsublines@ + \subline@num=#1\relax + \else + \line@num=#1\relax + \fi + \set@line@action + \fi} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\l@d@set} +% \begin{macro}{\l@dchset@num} +% The \cs{l@d@set}\marg{num} macro sets +% the line number for the next \cs{pstart} to the value specified as +% its argument. This is used to implement \cs{setlinenum}. +% +% \cs{l@dchset@num} is a flag to the \cs{@nl}? macro. If it is not +% \cs{relax} then a linenumber change is to be done. +% \begin{macrocode} + +\newcommand*{\l@d@set}[1]{% + \ifledRcol + \line@numR=#1\relax + \advance\line@numR \@ne + \def\l@dchset@num{#1} + \else + \line@num=#1\relax + \advance\line@num \@ne + \def\l@dchset@num{#1} + \fi} +\let\l@dchset@num\relax + +% \end{macrocode} +% \end{macro} +% \end{macro} + +% +% \begin{macro}{\page@action} +% \cs{page@action} +% adds an entry to the action-code list to change the page number. +% \begin{macrocode} + +\newcommand*{\page@action}{% + \ifledRcol + \xright@appenditem{\the\absline@numR}\to\actionlines@listR + \xright@appenditem{\next@page@numR}\to\actions@listR + \else + \xright@appenditem{\the\absline@num}\to\actionlines@list + \xright@appenditem{\next@page@num}\to\actions@list + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\set@line@action} +% \cs{set@line@action} adds an entry to the action-code +% list to change the visible line number. +% \begin{macrocode} + +\newcommand*{\set@line@action}{% + \ifledRcol + \xright@appenditem{\the\absline@numR}\to\actionlines@listR + \ifsublines@ + \@l@dtempcnta=-\subline@numR + \else + \@l@dtempcnta=-\line@numR + \fi + \advance\@l@dtempcnta by -5000\relax + \xright@appenditem{\the\@l@dtempcnta}\to\actions@listR + \else + \xright@appenditem{\the\absline@num}\to\actionlines@list + \ifsublines@ + \@l@dtempcnta=-\subline@num + \else + \@l@dtempcnta=-\line@num + \fi + \advance\@l@dtempcnta by -5000\relax + \xright@appenditem{\the\@l@dtempcnta}\to\actions@list + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\sub@action} +% \cs{sub@action} +% adds an entry to the action-code list to turn sub-lineation on or +% off, according to the current value of the \cs{ifsublines@} flag. +% \begin{macrocode} + +\newcommand*{\sub@action}{% + \ifledRcol + \xright@appenditem{\the\absline@numR}\to\actionlines@listR + \ifsublines@ + \xright@appenditem{-1001}\to\actions@listR + \else + \xright@appenditem{-1002}\to\actions@listR + \fi + \else + \xright@appenditem{\the\absline@num}\to\actionlines@list + \ifsublines@ + \xright@appenditem{-1001}\to\actions@list + \else + \xright@appenditem{-1002}\to\actions@list + \fi + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\lock@on} +% \begin{macro}{\do@lockon} +% \begin{macro}{\do@lockonL} +% \cs{lock@on} +% adds an entry to the action-code list to turn line number +% locking on. The current setting of the sub-lineation flag tells us +% whether this applies to line numbers or sub-line numbers. +% +% Adding commands to the action list is slow, and it is very often the +% case that a lock-on command is immediately followed by a lock-off +% command in the line-list file, and therefore really does nothing. +% We use a look-ahead scheme here to detect such pairs, and add nothing +% to the line-list in those cases. +% \begin{macrocode} +\newcommand*{\lock@on}{\futurelet\next\do@lockon} + +\newcommand*{\do@lockon}{% + \ifx\next\lock@off + \global\let\lock@off=\skip@lockoff + \else + \ifledRcol + \do@lockonR + \else + \do@lockonL + \fi + \fi} + + +\newcommand*{\do@lockonL}{% + \xright@appenditem{\the\absline@num}\to\actionlines@list + \ifsublines@ + \xright@appenditem{-1005}\to\actions@list + \ifnum\sub@lock=\z@ + \sub@lock \@ne + \else + \ifnum\sub@lock=\thr@@ + \sub@lock \@ne + \fi + \fi + \else + \xright@appenditem{-1003}\to\actions@list + \ifnum\@lock=\z@ + \@lock \@ne + \else + \ifnum\@lock=\thr@@ + \@lock \@ne + \fi + \fi + \fi} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\lock@off} +% \begin{macro}{\do@lockoff} +% \begin{macro}{\do@lockoffL} +% \begin{macro}{\skip@lockoff} +% \cs{lock@off} adds an entry to the action-code list +% to turn line number locking off. +% \begin{macrocode} +\newcommand*{\do@lockoffL}{% + \xright@appenditem{\the\absline@num}\to\actionlines@list + \ifsublines@ + \xright@appenditem{-1006}\to\actions@list + \ifnum\sub@lock=\tw@ + \sub@lock \thr@@ + \else + \sub@lock \z@ + \fi + \else + \xright@appenditem{-1004}\to\actions@list + \ifnum\@lock=\tw@ + \@lock \thr@@ + \else + \@lock \z@ + \fi + \fi} + +\newcommand*{\do@lockoff}{% + \ifledRcol + \do@lockoffR + \else + \do@lockoffL + \fi} +\newcommand*{\skip@lockoff}{\global\let\lock@off=\do@lockoff} +\global\let\lock@off=\do@lockoff + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\n@num} +% These macros implement the \cs{skipnumbering} command. +% They use action code 1007. +% \changes{v0.7.0}{2005/02/22}{Added \cs{n@num}} +% \changes{v1.21.0}{2015/04/13}{\cs{n@num} defined only one time for both \Eledmac{} and \Eledpar{}} +% \changes{v1.21.0}{2015/04/13}{\cs{n@num@ref} deleted} +% \begin{macrocode} +\newcommand*{\n@num}{% + \ifledRcol% + \xright@appenditem{\the\absline@numR}\to\actionlines@listR + \xright@appenditem{-1007}\to\actions@listR + \else% + \xright@appenditem{\the\absline@num}\to\actionlines@list% + \xright@appenditem{-1007}\to\actions@list% + \fi% +}% + +% \end{macrocode} +% \end{macro} +% \begin{macro}{\n@num@stanza} +% This macro implements the \cs{skipnumbering} for stanza command. +% It uses action code 1008. +% \begin{macrocode} +\newcommand*{\n@num@stanza}{% + \ifledRcol% + \xright@appenditem{\the\absline@numR}\to\actionlines@listR% + \xright@appenditem{-1008}\to\actions@listR% + \else% + \xright@appenditem{\the\absline@num}\to\actionlines@list%% + \xright@appenditem{-1008}\to\actions@list% + \fi% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\ifl@dhidenumber} +% \begin{macro}{\hidenumbering} +% \cs{hidenumbering} hides number in margin. +% It uses action code 1009. +% \begin{macro}{\h@num} +% \begin{macrocode} +\newif\ifl@dhidenumber +\newcommand*{\hidenumbering}{ + \ifledRcol% + \write\linenum@outR{\string\hide@num}% + \else% + \write\linenum@out{\string\hide@num}% + \fi% +}% +\newcommand*{\hide@num}{% + \ifledRcol% + \xright@appenditem{\the\absline@numR}\to\actionlines@listR% + \xright@appenditem{-1009}\to\actions@listR% + \else% + \xright@appenditem{\the\absline@num}\to\actionlines@list%% + \xright@appenditem{-1009}\to\actions@list% + \fi% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \begin{macro}{\@ref} +% \begin{macro}{\insert@count} +% \cs{@ref} +% marks the start of a passage, for creation of a footnote reference. +% It takes two arguments: +% \begin{itemize} +% \item \verb"#1", the number of entries to add to \cs{insertlines@list} +% for this reference. \SpecialMainIndex{\insert@count} +% This value, here and within \cs{edtext}, +% which computes it and writes it to the line-list file, +% will be stored in the count \cs{insert@count}. +% \begin{macrocode} +\newcount\insert@count +% \end{macrocode} +% +% \item \verb"#2", a sequence of other line-list-file commands, executed to +% determine the ending line-number. (This may also include other +% \cs{@ref} commands, corresponding to uses of \cs{edtext} +% within the first argument of another instance of \cs{edtext}.) +% \end{itemize} +% +% \begin{macro}{\dummy@ref} +% When nesting of \cs{@ref} commands does occur, it is necessary to +% temporarily redefine \cs{@ref} within \cs{@ref}, so that we are only +% doing one of these at a time. +% \begin{macrocode} +\newcommand*{\dummy@ref}[2]{#2} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@ref@reg} +% The first thing \cs{@ref} (i.e. \cs{@ref@reg}) itself does is to add +% the specified number +% of items to the \cs{insertlines@list} list. +% \changes{v0.7.0}{2005/02/22}{Added \cs{@ref@reg}} +% \begin{macrocode} +\newcommand*{\@ref}[2]{% + \ifledRcol% + \@ref@regR{#1}{#2}% + \else% + \@ref@reg{#1}{#2}% + \fi% +}% +\newcommand*{\@ref@reg}[2]{% + \global\insert@count=#1\relax + \global\advance\@edtext@level by 1% + \loop\ifnum\insert@count>\z@ + \xright@appenditem{\the\absline@num}\to\insertlines@list + \global\advance\insert@count \m@ne + \repeat +% \end{macrocode} +% +% Next, process the second argument to determine the page +% and line numbers for the end of this lemma. +% We temporarily equate \cs{@ref} to a different macro that just executes +% its argument, so that nested \cs{@ref} commands are just skipped +% this time. Some other macros need to be temporarily redefined to +% suppress their action. +% \begin{macrocode} + \begingroup + \let\@ref=\dummy@ref + \let\@lopL\@gobble + \let\page@action=\relax + \let\sub@action=\relax + \let\set@line@action=\relax + \let\@lab=\relax + \let\@lemma=\relax% + \let\@sw\@gobblethree% + #2 + \global\endpage@num=\page@num + \global\endline@num=\line@num + \global\endsubline@num=\subline@num + \endgroup +% \end{macrocode} +% +% Now store all the information about the location of the lemma's +% start and end in \cs{line@list}. +% \begin{macrocode} + \xright@appenditem% + {\the\page@num|\the\line@num|% + \ifsublines@ \the\subline@num \else 0\fi|% + \the\endpage@num|\the\endline@num|% + \ifsublines@ \the\endsubline@num \else 0\fi}\to\line@list +% \end{macrocode} +% Create a list which stores every second argument of each \cs{@sw} +% in this lemma, at this level. +% Also set the boolean about the use of lemma in this edtext level to false. +% \begin{macrocode} + \expandafter\list@create\expandafter{\csname sw@list@edtext@tmp@\the\@edtext@level\endcsname}% + \providebool{lemmacommand@\the\@edtext@level}% + \boolfalse{lemmacommand@\the\@edtext@level}% +% \end{macrocode} +% Execute the second argument of \cs{@ref} again, +% to perform for real all the commands within it. +% \begin{macrocode} + #2% +% \end{macrocode} +% Now, we store the list of \cs{@sw} of this current \cs{edtext} as an element of +% the global list of list of \cs{@sw} for a \cs{edtext} depth. +% \begin{macrocode} + \ifnum\@edtext@level>0% + \def\create@this@edtext@level{\expandafter\list@create\expandafter{\csname sw@list@edtext@\the\@edtext@level\endcsname}}% + \ifcsundef{sw@list@edtext@\the\@edtext@level}{\create@this@edtext@level}{}% + \letcs{\@tmp}{sw@list@edtext@\the\@edtext@level}% + \letcs{\@tmpp}{sw@list@edtext@tmp@\the\@edtext@level} + \xright@appenditem{\expandonce\@tmpp}\to\@tmp% + \global\cslet{sw@list@edtext@\the\@edtext@level}{\@tmp}% + \fi% +% \end{macrocode} +% Decrease edtext level counter. +% \begin{macrocode} + \global\advance\@edtext@level by -1% +% \end{macrocode} +% \begin{macrocode} +} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsection{Writing to the line-list file} +% +% We have now defined all the counters, lists, and commands involved in +% reading the line-list file at the start of a section. Now we will +% cover the commands that \macpackage uses within the text of a +% section to write commands out to the line-list. +% +% \begin{macro}{\linenum@out} +% The file will be opened on output stream \cs{linenum@out}. +% \begin{macrocode} +\newwrite\linenum@out +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\iffirst@linenum@out@} +% \begin{macro}{\first@linenum@out@true} +% \begin{macro}{\first@linenum@out@false} +% Once any file is opened on this stream, we keep it open forever, or +% else switch to another file that we keep open. The reason is that +% we want the output routine to write the page number for every page +% to this file; otherwise we would have to write it at the start of +% every line. +% But it is not very easy for the output routine to tell whether an +% output stream is open or not. There is no way to test the status of +% a particular output stream directly, and +% the asynchronous nature of output routines makes the +% status hard to determine by other means. +% +% We can manage pretty well by means of the \cs{iffirst@linenum@out@} +% flag; its inelegant name suggests the nature of the problem that +% made its creation necessary. It is set +% to be \verb"true" before any \cs{linenum@out} file is opened. When such a file +% is opened for the first time, it is done using \cs{immediate}, so that +% it will at once be safe for the output routine to write to it; we then +% set this flag to \verb"false". +% \begin{macrocode} +\newif\iffirst@linenum@out@ + \first@linenum@out@true +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\this@line@list@version} +% The commands allowed in the line-list file and their arguments +% can change between two version of \macpackage. +% The \cs{this@line@list@version} command is upgraded when it happens. +% It is written in the file list. +% If we process a line-list file which used a older version, that means the commands used inside are deprecated, and we can't use them. +% \begin{macrocode} +\newcommand{\this@line@list@version}{2}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\line@list@stuff} +% The \cs{line@list@stuff}\marg{file} macro, which +% is called by \cs{beginnumbering}, performs +% all the line-list operations needed at the start of a section. +% Its argument is the name of the line-list file. +% \begin{macrocode} +\newcommand*{\line@list@stuff}[1]{% +% \end{macrocode} +% +% First, use the commands of the previous section to interpret the +% line-list file from the last run. +% \begin{macrocode} + \read@linelist{#1}% +% \end{macrocode} +% +% Now close the current output line-list file, if any, and open a new one. +% The first time we open a line-list file for output, we do it using +% \cs{immediate}, and clear the \cs{iffirst@linenum@out@} flag. +% \changes{v0.2.2}{2003/11/09}{Added initial write of page number in +% \cs{line@list@stuff}} +% \changes{v0.7.0}{2005/02/25}{Deleted \cs{page@start} from \cs{line@list@stuff}} +% \changes{v1.15.1}{2015/01/16}{Revert modification of 1.5.2 which makes bug with numbering. Leave vertical mode to solve spurious space before minipage.} +% \begin{macrocode} + \iffirst@linenum@out@ + \immediate\closeout\linenum@out% + \global\first@linenum@out@false% + \immediate\openout\linenum@out=#1\relax% + \immediate\write\linenum@out{\string\line@list@version{\this@line@list@version}}% + \else +% \end{macrocode} +% If we get here, then this is +% not the first line-list we have seen, so we +% do not open or close the files immediately. +% \begin{macrocode} + \if@minipage% + \leavevmode% + \fi% + \closeout\linenum@out% + \openout\linenum@out=#1\relax% + \fi} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\new@line} +% The \cs{new@line} macro sends the \cs{@nl} command to the line-list +% file, to mark the start of a new text line, and its page number. +% \changes{v0.6.0}{2004/11/16}{Extended \cs{new@line} to output page numbers} +% \begin{macrocode} +\newcommand*{\new@line}{% + \IfStrEq{\led@pb@setting}{after}% + {\xifinlist{\the\absline@num}{\l@prev@nopb}% + {\xifinlist{\the\absline@num}{\normal@page@break}% + {\numgdef{\@next@page}{\c@page+1}% + \write\linenum@out{\string\@nl[\@next@page][\@next@page]}% + }% + {\write\linenum@out{\string\@nl[\the\c@page][\thepage]}}% + }% + {\write\linenum@out{\string\@nl[\the\c@page][\thepage]}}}% + {}% + \IfStrEq{\led@pb@setting}{before}% + {\numdef{\next@absline}{\the\absline@num+1}% + \xifinlist{\next@absline}{\l@prev@nopb}% + {\xifinlist{\the\absline@num}{\normal@page@break}% + {\numgdef{\nc@page}{\c@page+1}% + \write\linenum@out{\string\@nl[\nc@page][\nc@page]}% + }% + {\write\linenum@out{\string\n@l[\the\c@page][\thepage]}}% + }% + {\write\linenum@out{\string\@nl[\the\c@page][\thepage]}}% + }% + {}% + \IfStrEqCase{\led@pb@setting}{{before}{\relax}{after}{\relax}}[\write\linenum@out{\string\@nl[\the\c@page][\thepage]}]% +} + +% \end{macrocode} +% \end{macro} +% \begin{macro}{\if@noneed@Footnote} +% \cs{if@noneed@Footnote} is a boolean to check if we have to print a error message when a \cs{edtext} is called without any critical notes. +% +% \begin{macro}{\flag@start} +% \begin{macro}{\flag@end} +% \changes{v1.12.3}{2014/08/15}{\cs{flag@start} and \cs{flag@end} are now defined only one time for eledmac and eledpar} +% \changes{v1.12.3}{2014/08/15}{\cs{flag@start} send a error message when a \cs{edtext} is done without insert (note)} +% \changes{v1.12.8}{2014/09/12}{\cs{flag@start} do not send a error message when a \cs{edtext} is done without insert (note) but have a endnote} +% We enclose a lemma marked by \cs{edtext} in +% \cs{flag@start} and \cs{flag@end}: these send the \cs{@ref} +% command to the line-list file. \cs{edtext} is responsible for +% setting the value of \cs{insert@count} appropriately; it +% actually gets done by the various footnote macros. +% \begin{macrocode} +\newif\if@noneed@Footnote% + +\newcommand*{\flag@start}{% + \ifledRcol% + \edef\next{\write\linenum@outR{% + \string\@ref[\the\insert@countR][}}% + \next% + \ifnum\insert@countR<1% + \if@noneed@Footnote\else% + \led@err@EdtextWithoutFootnote% + \fi% + \fi% + \else% + \edef\next{\write\linenum@out{% + \string\@ref[\the\insert@count][}}% + \next% + \ifnum\insert@count<1% + \if@noneed@Footnote\else% + \led@err@EdtextWithoutFootnote% + \fi% + \fi% + \fi}% + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\startsub} +% \begin{macro}{\endsub} +% \changes{v1.15.0}{2015/01/12}{Restore subline feature (disabled by mistake in v1.8.0).} +% \cs{startsub} and \cs{endsub} +% turn sub-lineation on and off, by writing +% appropriate instructions to the line-list file. When +% sub-lineation is in effect, the line number counter is frozen and +% the sub-line counter advances instead. If one of these commands +% appears in the middle of a line, it does not take effect until the +% next line; in other words, a line is counted as a line or +% sub-line depending on what it started out as, even if that +% changes in the middle. +% +% We tinker with \cs{lastskip} because a command of either sort +% really needs to be attached to the last word preceding the change, not +% the first word that follows the change. This is because sub-lineation +% will often turn on and off in mid-line---stage directions, for example, +% often are mixed with dialogue in that way---and when a line is mixed +% we want to label it using the system that was in effect at its start. +% But when sub-lineation begins at the very start of a line we have a +% problem, if we don't put in this code. +% \begin{macrocode} + + +\newcommand*{\startsub}{\dimen0\lastskip + \ifdim\dimen0>0pt \unskip \fi + \ifledRcol \write\linenum@outR{\string\sub@on}% + \else \write\linenum@out{\string\sub@on}% + \fi + \ifdim\dimen0>0pt \hskip\dimen0 \fi} +\def\endsub{\dimen0\lastskip + \ifdim\dimen0>0pt \unskip \fi + \ifledRcol \write\linenum@outR{\string\sub@off}% + \else \write\linenum@out{\string\sub@off}% + \fi + \ifdim\dimen0>0pt \hskip\dimen0 \fi} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\advanceline} +% You can use \cs{advanceline}\marg{num} +% in running text to advance the current visible +% line-number by a specified value, positive or negative. +% \begin{macrocode} +\newcommand*{\advanceline}[1]{% + \ifledRcol \write\linenum@outR{\string\@adv[#1]}% + \else \write\linenum@out{\string\@adv[#1]}% + \fi% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\setline} +% You can use \cs{setline}\marg{num} +% in running text (i.e., within \cs{pstart}...\cs{pend}) to set the +% current visible +% line-number to a specified positive value. +% \begin{macrocode} + +\newcommand*{\setline}[1]{% + \ifnum#1<\z@ + \led@warn@BadSetline + \else + \ifledRcol \write\linenum@outR{\string\@set[#1]}% + \else \write\linenum@out{\string\@set[#1]}% + \fi + \fi} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\setlinenum} +% You can use \cs{setlinenum}\marg{num} +% before a \cs{pstart} to set the visible line-number to a specified +% positive value. It writes a \cs{l@d@set} command to the line-list file. +% \begin{macrocode} + +\newcommand*{\setlinenum}[1]{% + \ifnum#1<\z@ + \led@warn@BadSetlinenum + \else + \ifledRcol \write\linenum@outR{\string\l@d@set[#1]} + \else \write\linenum@out{\string\l@d@set[#1]} \fi + \fi} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\startlock} +% \begin{macro}{\endlock} +% You can use \cs{startlock} or \cs{endlock} +% in running text to start or end line number locking at +% the current line. They decide whether line numbers or sub-line numbers +% are affected, depending on the current state of the sub-lineation flags. +% \begin{macrocode} + +\newcommand*{\startlock}{% + \ifledRcol \write\linenum@outR{\string\lock@on}% + \else \write\linenum@out{\string\lock@on}% + \fi} +\def\endlock{% + \ifledRcol \write\linenum@outR{\string\lock@off}% + \else \write\linenum@out{\string\lock@off}% + \fi} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\ifl@dskipnumber} +% \begin{macro}{\ifl@dskipversenumber} +% \begin{macro}{\l@dskipnumbertrue} +% \begin{macro}{\l@dskipnumberfalse} +% \begin{macro}{\skipnumbering} +% In numbered text \cs{skipnumbering} will suspend the numbering +% for that particular line. +% \changes{v0.7.0}{2005/02/22}{Added \cs{skipnumbering} and supports} +% \changes{v1.21.0}{2015/04/13}{\cs{skipnumbering} defined only one time for both \Eledmac{} and \Eledpar{}.} +% \changes{v1.21.0}{2015/04/13}{Correct \cs{skipnumbering} for stanza.} +% \changes{v1.21.0}{2015/04/13}{Delete \cs{skipnumbering@reg}.} +% \begin{macrocode} +\newif\ifl@dskipnumber +\newif\ifl@dskipversenumber% +\newcommand*{\skipnumbering}{% + \leavevmode% + \ifledRcol% + \ifinstanza% + \write\linenum@outR{\string\n@num@stanza}% + \else% + \write\linenum@outR{\string\n@num}% + \fi% + \advanceline{-1}% + \else% + \ifinstanza% + \write\linenum@out{\string\n@num@stanza}% + \else% + \write\linenum@out{\string\n@num}% + \fi% + \advanceline{-1}% + \fi% +}% + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \section{Marking text for notes} +% \label{text}\relax +% +% The \cs{edtext} macro is used to create all +% footnotes and endnotes, +% as well as to print the portion of the main text to which a given note +% or notes is keyed. The idea is to have that lemma appear only once in +% the \file{.tex} file: all instances of it in the main text and in the +% notes are copied from that one appearance. +% +% The \cs{edtext} macro takes two arguments. +% \begin{verbatim} +% \edtext{#1}{#2} +% \end{verbatim} +% +% \begin{itemize}\addtolength{\itemsep}{-1ex} +% \item \verb"#1" is the piece of the main text being glossed; +% it gets added to the +% main text, and is also used as a lemma for notes to it. +% +% \item \verb"#2" is a series of subsidiary macros that generate +% various kinds of notes. +% \end{itemize} +% +% The \cs{edtext} macro may be used (somewhat) recursively; that +% is, \cs{edtext} may be used within its own first argument. The +% code would be much simpler without this feature, but nested notes +% will commonly be necessary: it is quite likely that we will have an +% explanatory note for a long passage and notes on variants for +% individual words within that passage. The situation we can't +% handle is overlapping notes that are not nested: for example, one +% note covering lines 10--15, and another covering 12--18. +% You can +% handle such cases by using the \cs{lemma} and \cs{linenum} +% macros within \verb"#2": they alter the copy of the lemma and the +% line numbers that are passed to the notes, and hence allow you to +% overcome any limitations of this system, albeit with extra +% effort. +% +% The recursive operation of \cs{edtext} will fail if you try to use a copy +% that is called something other than \cs{edtext}. In order to handle +% recursion, \cs{edtext} needs to redefine its own definition temporarily +% at one point, and that does not work if the macro you are calling is +% not actually named \cs{edtext}. There is no problem as long as \cs{edtext} +% is not invoked in the first argument. If you want to call \cs{edtext} +% something else, it is best to create instead a macro that expands +% to an invocation of \cs{edtext}, rather than copying \cs{edtext} and giving +% it a new name; otherwise you will need to add an appropriate +% definition for your new macro to \cs{morenoexpands}. +% +% Side effects of our line-numbering code make it impossible to use +% the usual footnote macros directly within a paragraph whose lines are +% numbered (see comments to +% \cs{do@line}, \reff{doline}). +% Instead, the appropriate note-generating command +% is appended to the list macro \cs{inserts@list}, and when \cs{pend} +% completes the paragraph it inserts all the notes at the proper places. +% +% +% Note that we do not provide previous-note information, although it is +% often wanted; your own macros must handle that. We ca not do it +% correctly without keeping track of what kind of notes have gone past: +% it is not just a matter of remembering the line numbers associated with +% the previous invocation of \cs{edtext}, because that might have been for +% a different kind of note. It is preferable for your footnote macros +% to store and recall this kind of information if they need it. +% +% +% \subsection{\cs{edtext} +% itself} +% +% The various note-generating macros might want to request that +% commands be executed not at once, but in close connection with the +% start or end of the lemma. For example, footnote numbers in the text +% should be connected to the end of the lemma; or, instead of a single +% macro to create a note listing variants, you might want to use +% several macros in series to create individual variants, which would +% each add information to a private macro or token register, which in +% turn would be formatted and output when all of \verb"#2" for the lemma +% has been read. +% +% \begin{macro}{\end@lemmas} +% To accomodate this, we provide a list macro +% to which macros may add commands that should subsequently +% be executed at the end of the lemma when that lemma is added +% to the text of the paragraph. A macro should add its contribution to +% \cs{end@lemmas} by using \cs{xleft@appenditem}. +% (Anything that needs to be done at +% the \emph{start} of the lemma may be handled using \cs{aftergroup}, since +% the commands specified within \cs{edtext}'s second argument are +% executed within a group that ends just before the lemma is added to +% the main text.) +% +% \cs{end@lemmas} is intended for the few things that need to be +% associated with the end of the lemma, like footnote numbers. Such +% numbers are not implemented in the current version, and indeed +% no use is currently made of \cs{end@lemmas} or of the \cs{aftergroup} +% trick. The general +% approach would be to define a macro to be used within the second +% argument of \cs{edtext} that would add the appropriate command to +% \cs{end@lemmas}. +% +% Commands that are added to this list should always take care +% not to do anything that adds possible line-breaks to the output; +% otherwise line numbering could be thrown off. +% \begin{macrocode} +\list@create{\end@lemmas} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\dummy@edtext} +% We now need to define a number of macros that allow us to weed out +% nested instances of \cs{edtext}, and other problematic macros, from +% our lemma. This is similar to what we did in reading the line-list +% file using \cs{dummy@ref} and various redefinitions---and that is +% because nested \cs{edtext}s macros create nested \cs{@ref} entries +% in the line-list file. +% +% +% \begin{macrocode} +\newcommand{\dummy@edtext}[2]{#1} +% \end{macrocode} +% +% \end{macro} +% \begin{macro}{\dummy@edtext@showlemma} +% Some time, we want to obtain only the first argument of \cs{edtext}, while also wrapping it in \cs{showlemma}. For example, when printing a \cs{eledsection}. +% \begin{macrocode} +\newcommand{\dummy@edtext@showlemma}[2]{\showlemma{#1}}% +% \end{macrocode} +% \end{macro} +% +% We are going to need another macro that takes one argument and ignores +% it entirely. This is supplied by the \LaTeX\ \cs{@gobble}\marg{arg}. +% +% \begin{macro}{\no@expands} +% \begin{macro}{\morenoexpands} +% We need to turn off macro expansion for certain sorts of macros we are +% likely to see within the lemma and within the notes. +% +% The first class is font-changing macros. We suppress expansion for +% them by letting them become equal to zero.\footnote{Since `control +% sequences equivalent to characters are not expandable'---\thetexbook, +% answer to Exercise 20.14.} This is done because we want to +% pass into our notes the generic commands to change to roman or +% whatever, and not their expansions that will ask for a particular style at +% a specified size. The notes may well be in a smaller font, so the +% command should be expanded later, when the note's environment is in +% effect. +% +% A second sort to turn off includes a few of the accent macros. +% Most are not a problem: an accent that is expanded to an \cs{accent} +% command may be harder to read but it works just the same. The +% ones that cause problems are: those that use alignments---\TeX\ +% seems to get confused about the difference between alignment +% parameters and macro parameters; those that use temporary control +% sequences; and those that look carefully at what the current font +% is. +% +% (The \cs{copyright} macro defined in \PlainTeX\ has this sort of +% problem as well, but is not used enough to bother with. That macro, +% and any other that causes trouble, will get by all right if you put +% a \cs{protect} in front of it in your file.) +% +% We also need to eliminate all \macpackage macros like \cs{edlabel} and +% \cs{setline} that write things to auxiliary files: that writing +% should be done only once. And we make +% \cs{edtext} itself, if it appears within its own +% argument, do nothing but copy its first argument. +% +% Finally, we execute \cs{morenoexpands}. The version of +% \cs{morenoexpands} defined here does nothing; but you may define +% a version of your own when you need to add more expansion +% suppressions as needed with your macros. That makes it possible +% to make such additions without needing to copy or modify the +% standard \macpackage code. If you define your own +% \cs{morenoexpands}, you must be very careful about spaces: if the +% macro adds any spaces to the text when it runs, extra space +% will appear in the main text when \cs{edtext} is used. +% +% (A related problem, not addressed by these two macros, +% is that of characters whose category code is changed by any +% the macros used in the arguments to \cs{edtext}. Since the +% category codes are set when the arguments are scanned, macros +% that depend on changing them will not work. We have most often +% encountered this with characters that are made `active' within +% text in some, but not all, of the languages used within the document. +% One way around the problem, if it takes this form, +% is to ensure that those characters are \emph{always} active; within +% languages that make no special use of them, their associated +% control sequences should simply return the proper character. A simpler solution is to avoid active character, using \LuaTeX\ or \XeLaTeX.) +% \changes{v0.2.0}{2003/07/25}{Added \cs{l@dtabnoexpands} to \cs{no@expands}} +% \changes{v0.2.1}{203/08/25}{Removed some \cs{let}s from \cs{no@expands}. +% These were in \edmac{} but Peter Wilson feels that they should not have been as they +% disabled page/line refs in a footnotes} +% \changes{v1.0.0}{2012/09/15}{Change to be compatible with new features} +% \begin{macrocode} +\newcommand*{\no@expands}{% + \let\select@@lemmafont=0% + \let\startsub=\relax \let\endsub=\relax + \let\startlock=\relax \let\endlock=\relax + \let\edlabel=\@gobble + \let\setline=\@gobble \let\advanceline=\@gobble + \let\sameword\sameword@inedtext% + \let\edtext=\dummy@edtext + \l@dtabnoexpands + \morenoexpands} +\let\morenoexpands=\relax + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@tag} +% Now, we define an empty \cs{@tag} command. It will be redefine by \cs{edtext}: its value is the first argument. It will be used by the \cs{Xfootnote} commands. +% \begin{macrocode} +\newcommand{\@tag}{} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\@edtext@level} +% \changes{v1.15.0}{2015/01/12}{New boolean \cs{if@edtext@}.} +% \changes{v1.23.0}{2015/05/18}{The boolean \cs{if@edtext@} becomes the counter \cs{edtext@level}.} +% This counter is increased by 1 at each level of \cs{edtext}. +% That is useful for some commands which can have a different behavior if called inside or outside of the \marg{lemma} argument. +% \begin{macrocode} +\newcount\@edtext@level% +\@edtext@level=0% +% \end{macrocode} +% \end{macro} +% \changes{v1.16.0}{2014/01/23}{\cs{edtext} is now defined only in \eledmac, not in \eledpar. Debug wrong numbering when using \cs{sameword} + \Lpack{eledpar} + \cs{tag} command.} +% +% +% \begin{macro}{\edtext} +% \changes{v0.4.0}{2004/02/29}{Added \cs{showlemma} to \cs{edtext}} +% \changes{v1.4.0}{2012/11/16}{Compatibility of \cs{edtext} with the right-to-left direction (with Polyglossia).} +% \changes{v1.17.0}{2015/02/09}{Error message when calling \cs{edtext} outside of a numbered paragraph.} +% When executed, \cs{edtext} first ensures that we are in +% horizontal mode. +% \begin{macrocode} +\newcommand{\edtext}[2]{\leavevmode% +% \end{macrocode} +% Then, check if we are in a numbered paragraph (\cs{pstart}\ldots\cs{pend}).. +% \begin{macrocode} + \ifnumberedpar@% +% \end{macrocode} +% We increase the \cs{@edtext@} counter to know in which level of \cs{edtext} we are. +% \begin{macrocode} + \global\advance\@edtext@level by 1% +% \end{macrocode} +% By default, we do not use \cs{lemma} +% \begin{macrocode} + \global\@lemmacommand@false% +% \end{macrocode} +% \begin{macrocode} + \begingroup% +% \end{macrocode} +% We get the next series of samewords data in the list of samewords data for the current edtext level. We push them inside \cs{sw@inthisedtext}. +% \begin{macrocode} + \ifledRcol% + \ifcsundef{sw@list@edtextR@\the\@edtext@level}% + {\global\let\sw@inthisedtext\empty}% + {\ifcsempty{sw@list@edtextR@\the\@edtext@level}% + {\global\let\sw@inthisedtext\empty}% + {\expandafter\gl@p\csname sw@list@edtextR@\the\@edtext@level\endcsname\to\sw@inthisedtext}% + }% + \else% + \ifcsundef{sw@list@edtext@\the\@edtext@level}% + {\global\let\sw@inthisedtext\empty}% + {\ifcsempty{sw@list@edtext@\the\@edtext@level}% + {\global\let\sw@inthisedtext\empty}% + {\expandafter\gl@p\csname sw@list@edtext@\the\@edtext@level\endcsname\to\sw@inthisedtext}% + }% + \fi% +% \end{macrocode} +% \begin{macro}{\@tag} +% \label{@tag}Our normal lemma is just argument \verb"#1"; but that argument could have +% further invocations of \cs{edtext} within it. We get a copy of the +% lemma without any \cs{edtext} macros within it by temporarily redefining +% \cs{edtext} to just copy its first argument and ignore the other, +% and then expand \verb"#1" into \cs{@tag}, our lemma. +% +% This is done within a group that starts here, in order to get the +% original \cs{edtext} restored; within this group we have also turned +% off the expansion of those control sequences commonly found within text +% that can cause trouble for us. +% +% \begin{macrocode} + \global\renewcommand{\@tag}{% + \no@expands #1% + }% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\l@d@nums} +% \phantomsection\label{nums} +% Prepare more data for the benefit of note-generating macros: the line +% references and font specifier for this lemma go to \cs{l@d@nums}. +% \begin{macrocode} + \set@line% +% \end{macrocode} +% \end{macro} +% \cs{insert@count} will be altered by the note-generating macros: +% it counts the number of deferred footnotes or other insertions +% generated by this instance of \cs{edtext}. +% If we are in a right column (\parpackage), we use \cs{insert@countR} +% instead of \cs{insert@count}. +% \begin{macrocode} + \ifledRcol \global\insert@countR \z@% + \else \global\insert@count \z@ \fi% +% \end{macrocode} +% Now process the note-generating macros in argument \verb"#2" +% (i.e., \cs{Afootnote}, \cs{lemma}, etc.). \cs{ignorespaces} is here to +% skip over any spaces that might appear at the start of \verb"#2"; +% otherwise they wind up in the main text. Footnote and other +% macros that are used within \verb"#2" should all end with +% \cs{ignorespaces} as well, to skip any spaces between macros when +% several are used in series. +% \begin{macrocode} + \ignorespaces #2\relax% +% \end{macrocode} +% With \Lpack{polyglossia}, you must track whether the language reads left to right (English) or right to left (Arabic). +% \begin{macrocode} + \@ifundefined{xpg@main@language}{%if not polyglossia + \flag@start}% + {\if@RTL\flag@end\else\flag@start\fi% + }% +% \end{macrocode} +% We write in the numbered file wether the current \cs{edtext} has a \cs{lemma} in the the second argument. +% \begin{macrocode} + \if@lemmacommand@% + \ifledRcol% + \write\linenum@outR{\string\@lemma}% + \else% + \write\linenum@out{\string\@lemma}% + \fi% + \fi% +% \end{macrocode} +% Finally, we are ready to admit the first argument into the current +% paragraph. +% +% It is important that we generate and output all the notes for this +% chunk of text \emph{before} putting the text into the paragraph: notes +% that are referenced by line number should generally be tied to the +% start of the passage they gloss, not the end. That should all be done +% within the expansion of \verb"#2" above, or in \cs{aftergroup} +% commands within that expansion. +% \begin{macrocode} + \endgroup% + \showlemma{#1}% +% \end{macrocode} +% +% Finally, we add any insertions that are +% associated with the \emph{end} of +% the lemma. Footnotes that are identified by symbols rather than by +% where the lemma begins in the main text need to be done here, and +% not above. +% +% \begin{macrocode} + \ifx\end@lemmas\empty \else% + \gl@p\end@lemmas\to\x@lemma% + \x@lemma% + \global\let\x@lemma=\relax% + \fi% + \@ifundefined{xpg@main@language}{%if not polyglossia + \flag@end}% + {\if@RTL\flag@start\else\flag@end\fi% With polyglossia, you must track whether the language reads left to right (English) or right to left (Arabic). + }% +% \end{macrocode} +% We switch to false some flags. +% \begin{itemize} +% \item The one that checks having footnotes inside a \cs{edtext}. +% \item The one that says we are inside a \cs{edtext}. In fact, it is not a flag, but a counter which is increased to 1 in each leavel of \cs{edtext}. +% \item The one that says we are inside à \cs{@lemma}. +% \end{itemize} +% \begin{macrocode} + \global\@noneed@Footnotefalse% + \global\advance\@edtext@level by -1% + \global\@lemmacommand@false% +% \end{macrocode} +% If we are outside of a numbered paragraph, +% we send error message and print the first argument. +% \begin{macrocode} + \else% + \showlemma{#1} (\textbf{\textsc{Edtext outside numbered paragraph}})\led@err@edtextoutsidepstart% + \fi% +}% + +\newcommand*{\flag@end}{% + \ifledRcol% + \write\linenum@outR{]}% + \else% + \write\linenum@out{]}% + \fi}% + +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\ifnumberline} +% The \cs{ifnumberline} option can be set to FALSE to disable line numbering. +% \begin{macrocode} +\newif\ifnumberline +\numberlinetrue +% \end{macrocode} +% \end{macro} +% \begin{macro}{\set@line} +% The \cs{set@line} macro +% is called by \cs{edtext} to put the line-reference field and +% font specifier for the current block of text into \cs{l@d@nums}. +% +% One instance of \cs{edtext} may generate several notes, or it +% may generate none --- it is legitimate for argument \verb"#2" to \cs{edtext} to +% be empty. But \cs{flag@start} and \cs{flag@end} induce the generation of +% a single entry in \cs{line@list} during the next run, and it is vital +% to also remove one and only one \cs{line@list} entry here. +% +% If no more lines are listed in \cs{line@list}, something is +% wrong --- probably just some change in the input. We set all the numbers +% to zeros, following an old publishing convention for numerical +% references that have not yet been resolved. +% \begin{macrocode} +\newcommand*{\set@line}{% + \ifledRcol + \ifx\line@listR\empty + \global\noteschanged@true + \xdef\l@d@nums{000|000|000|000|000|000|\edfont@info}% + \else + \gl@p\line@listR\to\@tempb + \xdef\l@d@nums{\@tempb|\edfont@info}% + \global\let\@tempb=\undefined + \fi + \else + \ifx\line@list\empty + \global\noteschanged@true + \xdef\l@d@nums{000|000|000|000|000|000|\edfont@info}% + \else + \gl@p\line@list\to\@tempb + \xdef\l@d@nums{\@tempb|\edfont@info}% + \global\let\@tempb=\undefined + \fi + \fi} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\edfont@info} +% The macro \cs{edfont@info} returns coded information about the +% current font. +% +% \begin{macrocode} +\newcommand*{\edfont@info}{\f@encoding/\f@family/\f@series/\f@shape} + +% \end{macrocode} +% \end{macro} +% +% \subsection{Substitute lemma} +% +% \begin{macro}{\lemma} +% \changes{v1.23.0}{2015/05/18}{Fix spurious space after \cs{lemma} command} +% The \cs{lemma}\marg{text} macro allows you to change the lemma +% that is passed on to the notes. +% Read about \cs{@tag} in normal \cs{edtext} macro for more details about \cs{sw@list@inedtext} and \cs{no@expands} (\reff{@tag}). +% \begin{macrocode} +\unless\ifnocritical@ +\newcommand*{\lemma}[1]{% + \global\@lemmacommand@true% + \global\renewcommand{\@tag}{% + \no@expands #1% + }% + \ignorespaces% +}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@lemma} +% The \cs{@lemma} is written in the numbered file to set which \cs{edtext} has an +% \cs{lemma} as second argument. +% \begin{macrocode} +\newcommand{\@lemma}{% + \booltrue{lemmacommand@\the\@edtext@level}% +}% +\fi +% \end{macrocode} +% \end{macro} +% \begin{macro}{\if@lemmacommand@} +% \changes{v1.15.0}{2015/01/12}{New boolean \cs{iflemmacommand@}.} +% This boolean is set to TRUE inside a \cs{edtext} (or \cs{critext}) when a \cs{lemma} command is called. +% That is useful for some commands which can have a different behavior if the lemma in the note is different from the lemma in the main text. +% \begin{macrocode} +\newif\if@lemmacommand@% +% \end{macrocode} +% \end{macro} +% \subsection{Substitute line numbers} +% +% \begin{macro}{\linenum} +% \label{linenumdef} +% The \cs{linenum} macro can change any or all of +% the page and line numbers that are +% passed on to the notes. +% +% As argument \cs{linenum} takes a set of seven parameters +% separated by vertical bars, in the format used internally for +% \cs{l@d@nums} (see \reff{linenumbers}): the starting page, +% line, and sub-line numbers, followed by the ending page, line, and +% sub-line numbers, and then the font specifier for the lemma. +% However, you can omit any parameters you do not want to change, and +% you can omit a string of vertical bars at the end of the +% argument. Hence \verb"\linenum{18|4|0|18|7|1|0}" is an invocation +% that changes all the parameters, but \verb"\linenum{|3}" only +% changes the starting line number, and leaves the rest unaltered. +% +% We use \verb"\\" as an internal separator for the macro parameters. +% \begin{macrocode} +\newcommand*{\linenum}[1]{% + \xdef\@tempa{#1|||||||\noexpand\\\l@d@nums}% + \global\let\l@d@nums=\empty + \expandafter\line@set\@tempa|\\\ignorespaces} +% \end{macrocode} +% +% \begin{macro}{\line@set} +% \cs{linenum} calls \cs{line@set} to do the actual work; it +% looks at the first number in the argument to \cs{linenum}, +% sets the corresponding value in \cs{l@d@nums}, and then calls +% itself to process the next number in the \cs{linenum} +% argument, if there are more numbers in \cs{l@d@nums} to process. +% \begin{macrocode} +\def\line@set#1|#2\\#3|#4\\{% + \gdef\@tempb{#1}% + \ifx\@tempb\empty + \l@d@add{#3}% + \else + \l@d@add{#1}% + \fi + \gdef\@tempb{#4}% + \ifx\@tempb\empty\else + \l@d@add{|}\line@set#2\\#4\\% + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\l@d@add} +% \cs{line@set} uses \cs{l@d@add} to tack numbers or vertical bars +% onto the right hand end of \cs{l@d@nums}. +% \begin{macrocode} +\newcommand{\l@d@add}[1]{\xdef\l@d@nums{\l@d@nums#1}} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsection{Lemma disambiguation} +% The mechanism which counts the occurrence of a same word in a same line is quite complex, because, when \LaTeX\ reads a command between a \cs{pstart} and a \cs{pend}, it does not know yet which are the line numbers. +% +% The general mechanism is the following: +% \begin{itemize} +% \item \textbf{At the first run}, each \cs{sameword} command increments an \Lpack{etoolbox} counter the name of which contains the argument of the \cs{sameword} commands. +% \item Then this counter, associated with the argument of \cs{sameword} is stored, with the \cs{@sw} command, in the auxiliary file of the current \Lpack{eledmac} section (the \verb+.1+, \verb+.2+… file). +% \item \textbf{When this auxiliary file is read at the second run}, different operations are achieved: +% \begin{enumerate} +% \item Get the rank of each \cs{sameword} in a line (relative rank) from the rank of each \cs{sameword} in all the numbered section (absolute rank): +% \begin{itemize} +% \item For each paired \cs{sameword} argument and absolute line number, a counter is defined. Its value corresponds to the number of times \cs{sameword}\marg{argument}+ is called from the beginning of the lineation to the end of the current line. We also store the same data for the preceding absolute line number, if it does not have \cs{sameword}\marg{argument}. +% \item For each \cs{sameword} having the same argument, we subtract from its absolute rank the number stored for the paired \cs{sameword} argument and previous absolute line number. Consequently, we obtain the relative rank. +% \item See the following example which explain how for same \cs{sameword} absolute ranks are transformed to relative rank. +% \begin{verbatim} +% At line 1: +% absolute rank 1 becomes relative rank 1-0 = 1 +% 1 is stored for this \sameword and the line 1 +% At line 2: +% absolute rank 2 becomes relative rank 2-1 = 1 +% absolute rank 3 becomes relative rank 3-2 = 2 +% 3 is stored for this \sameword and the line 2 +% At line 3: +% no \sameword for this line. +% 3 is stored for this \sameword and the line 3 +% At line 4: +% absolute rank 4 becomes relative rank 4-3 = 1 +% 3 is stored for this \sameword and the line 4 +% \end{verbatim} +% \end{itemize} +% \item Create lists of lists of \cs{sameword} by depth of \cs{edtext}. +% That is: create a list for \cs{edtext} of level~1, a list for \cs{edtext} of level~2, a list for \cs{edtext} of level~3 etc. +% For each \cs{edtext} in these list, we store all the relative rank of \cs{saweword} which are called as lemma information, that is 1) or called in the first argument of \cs{sameword} 2) or called in the \cs{lemma} macro of the second argument of \cs{sameword} AND marked by the optional argument of \cs{saweword} in first argument of \cs{edtext}. +% +% For example, suppose a line with nested \cs{edtext}s which contains some +% word marked by \cs{sameword} and having the following relative rank:\\ +% +% +%\let\up\textsuperscript +%bar\up{1} \fbox{% +% \fbox{foo\up{1} foo\up{2} bar\up{2} foo\up{3}} (A)(B) +% foo\up{4} bar\up{3}% +% } (C) +% \fbox{% +% \fbox{foo\up{5}} (D) +% bar\up{4} +% } (E) +% +% In this example, all lemma information for \cs{edtext} is framed. The text in parenthesis is the content of critical notes associated to the preceding frame. +% As you can see, we have two level of \cs{edtext}. +% +%The list for \cs{edtext}s of level~1 is $\{\{1,2,2,3,4,3\},\{5,4\}\}$. +% +%The list for \cs{edtext}s of level~2 is $\{\{1,2,2,3\},\{5\}\}$. +% +% As you can see, the mandatory argument of \cs{sameword} does not matter: we store the rank informations for every word potentially ambiguous. +% \end{enumerate} +% \item At the second run, when a critical notes is called, we associate it to the next item of the list associated to is \cs{edtext} level. So, in the previous example: +% \begin{itemize} +% \item Critical notes (A) and (B) are associated with $\{1,2,2,3\}$. +% \item Critical note (C) is associated with $\{1,2,2,3,4,3\}$. +% \item Critical note (D) is associated with $\{5\}$. +% \item Critical note (E) is associated with $\{5,4\}$. +% \end{itemize} +% \item At the second run, when a critical note is printed: +% \begin{itemize} +% \item The \cs{sameword} command is let \cs{sameword@inedtext}. +% \item At each call of this \cs{sameword@inedtext}, we step to the next element of the list associated to the note. Let it be $r$. +% \item For the word marked by \cs{sameword}, we calculate how many time it is called in its line. To do it: +% \begin{itemize} +% \item We get the absolute line number of the current \cs{sameword}. This absolute line number was stored with list of relative rank for the current \cs{edtext}. That means, in the previous example, that, if the absolute line number of \cs{edtext} was 1, that critical notes (A) and (B) were not associated with $\{1,2,2,3\}$ but with $\{(1,1),(2,1),(2,1),(3,1)\}$. Such method to know the absolute line number associated to a \cs{sameword} is required because a \cs{edtext} can be overlap many lines, but \cs{sameword} can't get it. +% \item We get the value associated, when reading the auxiliary file, to the pair compose by the current marked word and the current absolute line number. Let this value be $n$. +% \end{itemize} +% \item If $n >1 $, that mean the current word appears more than once time in its line. In this case, we call \cs{showwordrank} with the word as first argument and $r$ as second argument. If the word is called only once, we just print it. +% \end{itemize} +% \end{itemize} +% After theory, implementation. +% \begin{macro}{\get@sw@txt} +% As the argument of \cs{sameword} can contain active character if we +% use \Lpack{inputenc} with \verb+utf8+ option instead of native UTF-8 engine, +% we store its detokenized content in a macro in order to allow dynamic name of macro with \cs{csname}.\footnote{See \url{http://tex.stackexchange.com/q/244538/7712}.} +% +% Because there is a bug with \cs{detokenize} and \XeTeX\ when using non BMP characters\footnote{\url{http://sourceforge.net/p/xetex/bugs/108/}}, +% we detokenize only for not \XeTeX engines. In any case, in \XeTeX, a \cs{csname} construction can contain UTF-8 characters without a problem, as UTF-8 characters are not managed with category code, but instead read directly as UTF-8 characters. +% \begin{macrocode} +\newcommand{\get@sw@txt}[1]{% + \ifxetex% + \xdef\sw@txt{#1}% + \else% + \expandafter\xdef\expandafter\sw@txt\expandafter{\detokenize{#1}}% + \fi% +}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\sameword} +% \changes{v1.23.0}{2015/05/18}{In order to allow use of \cs{sameword} with inputenc, we detokenize its mandatory argument before using it in control sequence names.} +% The hight level macro \cs{sameword}, used by the editor. +% \begin{macrocode} +\newcommandx{\sameword}[2][1,usedefault]{% + \leavevmode% + \get@sw@txt{#2}% +% \end{macrocode} +% Now, the real code. First, increment the counter corresponding to the argument. +% \begin{macrocode} + \unless\ifledRcol% + \csnumgdef{sw@\sw@txt}{\csuse{sw@\sw@txt}+1}% +% \end{macrocode} +% Then, write its value to the numbered file. +% \begin{macrocode} + \protected@write\linenum@out{}{\string\@sw{\sw@txt}{\csuse{sw@\sw@txt}}{#1}}% +% \end{macrocode} +% Do the same thing if we are in the right columns. +% \begin{macrocode} + \else% + \csnumgdef{sw@\sw@txt@R}{\csuse{sw@\sw@txt@R}+1}% + \protected@write\linenum@outR{}{\string\@sw{\sw@txt}{\csuse{sw@\sw@txt@R}}{#1}}% + \fi% +% \end{macrocode} +% And print the word. +% \begin{macrocode} + #2% +}% +% \end{macrocode} +% \end{macro} +% A flag set to true if a \cs{@sw} relative rank must be added to the list of ranks for a specific \cs{edtext}. +% \begin{macro}{\if@addsw} +% \begin{macrocode} +\newif\if@addsw% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\@sw} +% The command printed in the auxiliary files. +% \begin{macrocode} +\newcommand{\@sw}[3]{% + \get@sw@txt{#1}% + \unless\ifledRcol% +% \end{macrocode} +% First, define a counter which store the second argument as value for a each paired absolute line number/first argument +% \begin{macrocode} + \csxdef{sw@\sw@txt @\the\absline@num @\the\section@num}{#2}% +% \end{macrocode} +% If such argument was not defined for the preceding line, define it. +% \begin{macrocode} + \numdef{\prev@line}{\the\absline@num-1}% + \ifcsundef{sw@\sw@txt @\prev@line @\the\section@num}{% + \csnumgdef{sw@\sw@txt @\prev@line @\the\section@num}{#2-1}% + }{}% +% \end{macrocode} +% Then, calculate the position of the word in the line. +% \begin{macrocode} + \numdef{\the@sw}{#2-\csuse{sw@\sw@txt @\prev@line @\the\section@num}}% +% \end{macrocode} +% And do the same thing for the right side. +% \begin{macrocode} + \else% + \csxdef{sw@\sw@txt @\the\absline@numR @\the\section@numR @R}{#2}% + \numdef{\prev@line}{\the\absline@numR-1}% + \ifcsundef{sw@\sw@txt @\prev@line @\the\section@numR @R}{% + \csnumgdef{sw@\sw@txt @\prev@line @\the\section@numR @R}{#2-1}% + }{}% + \numdef{\the@sw}{#2-\csuse{sw@\sw@txt @\prev@line @\the\section@numR @R}}% + \fi% +% \end{macrocode} +% And now, add it to the list of \cs{@sw} for the current edtext, in all depth. +% \begin{macrocode} + \@tempcnta=\@edtext@level + \@whilenum{\@tempcnta>0}\do{% + \ifcsdef{sw@list@edtext@tmp@\the\@tempcnta}% + {% + \@addswfalse% + \notbool{lemmacommand@\the\@tempcnta}% + {\@addswtrue}% + {\IfStrEq{#3}{inlemma}% + {\@addswtrue}% + {% + \def\do##1{% + \ifnumequal{##1}{\the\@tempcnta}% + {\@addswtrue\listbreak}% + {}% + }% + \docsvlist{#3}% + }% + }% + \if@addsw% + \letcs{\@tmp}{sw@list@edtext@tmp@\the\@tempcnta}% + \ifledRcol% + \xright@appenditem{{\the@sw}{\the\absline@numR}}\to\@tmp% + \else% + \xright@appenditem{{\the@sw}{\the\absline@num}}\to\@tmp% + \fi% + \cslet{sw@list@edtext@tmp@\the\@tempcnta}{\@tmp}% + \fi% + }% + {}% + \advance\@tempcnta by -1% + }% +}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\sameword@inedtext} +% The command called when \cs{sameword} is called in a \cs{edtext}. +% \begin{macrocode} +\newcommandx{\sameword@inedtext}[2][1,usedefault]{% + \get@sw@txt{#2}% + \unless\ifledRcol@% +% \end{macrocode} +% Just a precaution. +% \begin{macrocode} + \ifx\sw@list@inedtext\empty% + \def\the@sw{999}% + \def\this@absline{-99}% + \else% +% \end{macrocode} +% But in many cases, at this step, we should have some content in the list \cs{sw@list@inedtext}, which contains the reference for \cs{edtext}. +% \begin{macrocode} + \gl@p\sw@list@inedtext\to\@tmp% + \edef\the@sw{\expandafter\@firstoftwo\@tmp}% + \edef\this@absline{\expandafter\@secondoftwo\@tmp}% + \fi% +% \end{macrocode} +% First, calculate the number of occurrences of the word in the current line +% \begin{macrocode} + \ifcsdef{sw@\sw@txt @\this@absline @\the\section@num}{% + \numdef{\prev@line}{\this@absline-1}% + \numdef{\sw@atthisline}{\csuse{sw@\sw@txt @\this@absline @\the\section@num}-\csuse{sw@\sw@txt @\prev@line @\the\section@num}}% + }% + {\numdef{\sw@atthisline}{0}}% +% \end{macrocode} +% Finally, print the rank, but only if there is more than one occurrence of the word in the current line. +% \begin{macrocode} + \ifnumgreater{\sw@atthisline}{1}% + {\showwordrank{#2}{\the@sw}}% + {#2}% +% \end{macrocode} +% And the same for right side. +% \begin{macrocode} + \else% + \ifx\sw@list@inedtext\empty% + \def\the@sw{999}% + \def\this@absline{-99}% + \else% + \gl@p\sw@list@inedtext\to\@tmp% + \edef\the@sw{\expandafter\@firstoftwo\@tmp}% + \edef\this@absline{\expandafter\@secondoftwo\@tmp}% + \fi% + \ifcsdef{sw@\sw@txt @\this@absline @\the\section@numR @R}{% + \numdef{\prev@line}{\this@absline-1}% + \numdef{\sw@atthisline}{\csuse{sw@\sw@txt @\this@absline @\the\section@numR @R}-\csuse{sw@\sw@txt @\prev@line @\the\section@numR @R}}% + }% + {\numdef{\sw@atthisline}{0}}% + \ifnumgreater{\sw@atthisline}{1}% + {\showwordrank{#2}{\the@sw}}% + {#2}% + \fi% +}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\showwordrank} +% \begin{macrocode} +% Finally, the way the rank will be printed. +\newcommand{\showwordrank}[2]{% + #1\textsuperscript{#2}% +}% +% \end{macrocode} +% \end{macro} + +% \section{Paragraph decomposition and reassembly} +% \label{paragraph}\relax +% +% In order to be able to count the lines of text and affix line +% numbers, we add an extra stage of processing for each paragraph. +% We send the paragraph into a box +% register, rather than straight onto the vertical list, and when +% the paragraph ends we +% slice the paragraph into its component lines; to each line we +% add any notes or line numbers, add a command to write to the +% line-list, and then at last send the line to the vertical list. +% This section contains all the code for this processing. +% +% \subsection{Boxes, counters, \cs{pstart} +% and \cs{pend}} +% +% \begin{macro}{\raw@text} +% \begin{macro}{\ifnumberedpar@} +% \begin{macro}{\numberedpar@true} +% \begin{macro}{\numberedpar@false} +% \begin{macro}{\num@lines} +% \begin{macro}{\one@line} +% \begin{macro}{\par@line} +% Here are numbers and flags that are used internally in the course +% of the paragraph decomposition. +% +% When we first form the paragraph, it goes into a box register, +% \cs{raw@text}, instead of onto the current vertical list. +% The \cs{ifnumberedpar@} flag will be \verb"true" while a paragraph is +% being processed in that way. +% \cs{num@lines} will store the number of lines in the paragraph +% when it is complete. When we chop it up into lines, each line +% in turn goes into the +% \cs{one@line} register, and \cs{par@line} will be the number +% of that line within the paragraph. +% \begin{macrocode} +\newbox\raw@text +\newif\ifnumberedpar@ +\newcount\num@lines +\newbox\one@line +\newcount\par@line +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\pstart} +% \begin{macro}{\AtEveryPstart} +% \changes{v1.6.1}{2013/10/27}{Spurious space in \cs{pstart}.} +% \changes{v1.12.0}{2014/08/05}{New optional argument for \cs{pstart}, to execute code before it.} +% \begin{macro}{\numberpstarttrue} +% \begin{macro}{\numberpstartfalse} +% \begin{macro}{\labelpstarttrue} +% \begin{macro}{\labelpstartfalse} +% \begin{macro}{\thepstart} +% \cs{pstart} starts the paragraph by +% clearing the \cs{inserts@list} list and other +% relevant variables, and then arranges for the +% subsequent text to go into the +% \cs{raw@text} box. \cs{pstart} needs to appear at the start of +% every paragraph that is to be numbered; the \cs{autopar} command below +% may be used to insert these commands automatically. +% +% Beware: everything that occurs between \cs{pstart} and \cs{pend} +% is happening within a group; definitions must be global if you want +% them to survive past the end of the paragraph. +% \changes{v1.13.1}{2014/09/25}{Add \cs{l@dzeropenalties} in \cs{pstart}} +% \begin{macrocode} + +\newcommand{\AtEveryPstart}[1]{% + \ifstrempty{#1}% + {\xdef\at@every@pstart{}}% + {\gdef\at@every@pstart{\noindent#1}}% +}% +\xdef\at@every@pstart{}% + +\newcounter{pstart} +\renewcommand{\thepstart}{{\bfseries\@arabic\c@pstart}. } +\newif\ifnumberpstart +\numberpstartfalse +\newif\iflabelpstart +\labelpstartfalse +\newcommandx*{\pstart}[1][1]{% + \normal@pars% + \ifstrempty{#1}{\at@every@pstart}{\noindent#1}% + \ifautopar% + \autopar% + \fi% + \ifluatex% + \edef\l@luatextextdir@L{\the\luatextextdir}% + \fi% + \if@nobreak% + \let\@oldnobreak\@nobreaktrue% + \else% + \let\@oldnobreak\@nobreakfalse% + \fi% + \@nobreaktrue% + \ifnumbering \else% + \led@err@PstartNotNumbered% + \beginnumbering% + \fi% + \ifnumberedpar@% + \led@err@PstartInPstart% + \pend% + \fi% + \list@clear{\inserts@list}% + \global\let\next@insert=\empty% + \begingroup\normal@pars% + \global\advance \l@dnumpstartsL\@ne + \global\setbox\raw@text=\vbox\bgroup% + \ifautopar\else% + \ifnumberpstart% + \ifinstanza\else% + \ifsidepstartnum\else% + \thepstart% + \fi% + \fi% + \fi% + \fi% + \numberedpar@true% + \iflabelpstart\protected@edef\@currentlabel% + {\p@pstart\thepstart} + \fi% + \l@dzeropenalties% + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \begin{macro}{\pend} +% \changes{v1.12.0}{2014/08/05}{New optional argument for \cs{pend}, to execute code after it.} +% \changes{v1.6.1}{2013/10/27}{Spurious space in \cs{pend}.} +% \cs{pend} must be used to end a numbered paragraph. +% +% \begin{macrocode} +\newcommandx*{\pend}[1][1]{\ifnumbering \else% + \led@err@PendNotNumbered% + \fi% + \global\l@dskipversenumberfalse% + \ifnumberedpar@ \else% + \led@err@PendNoPstart% + \fi% +% \end{macrocode} +% We set all the usual interline penalties to zero and then immediately +% call \cs{endgraf} to end the paragraph; this ensures that there will +% be no large interline penalties to prevent us from slicing the +% paragraph into pieces. These penalties revert to the values +% that you set when the group for the \cs{vbox} ends. Then we call +% \cs{do@line} to slice a line off the top of the +% paragraph, add a line number and footnotes, and restore it to the page; +% we keep doing this until there are not any more lines left. +% \begin{macrocode} + \l@dzeropenalties% + \endgraf\global\num@lines=\prevgraf\egroup% + \global\par@line=0% +% \end{macrocode} +% We check if lineation is by pstart: in this case, we reset line number, but only in the second line of the pstart. +% We can't reset line number at the beginning of \cs{pstart}, as \cs{setline} is parsed at the end of previous \cs{pend}, and so, we must do it at the end of first line of pstart. +% \begin{macrocode} + \csnumdef{pstartline}{0}% + \loop\ifvbox\raw@text% + \csnumdef{pstartline}{\pstartline+1}% + \do@line% + \ifbypstart@% + \ifnumequal{\pstartline}{1}{\setline{1}\resetprevline@}{}% + \fi% + \repeat% +% \end{macrocode} +% Deal with any leftover notes, and then end the group that was begun +% in the \cs{pstart}. +% \begin{macrocode} + \flush@notes% + \endgroup% + \ignorespaces% +% \end{macrocode} +% Increase pstart counter. +% \begin{macrocode} + \ifnumberpstart% + \pstartnumtrue% + \fi% + \addtocounter{pstart}{1}% +% \end{macrocode} +% Restore paragraph, nobreak setting and autopar setting. +% \begin{macrocode} + \normal@pars% + \@oldnobreak% + \ifautopar% + \autopar% + \fi% +% \end{macrocode} +% Print the optional argument of \cs{pend} or the content printed after every \cs{pend} +% \begin{macrocode} + \ifstrempty{#1}{\at@every@pend}{\noindent#1}% +} + +% \end{macrocode} +% \end{macro} +% Here, two macros to insert content after every \cs{pend}, between numbered line. +% \cs{AtEveryPend} is the user macro, \cs{at@every@pend} is macro set by it. +% +% \begin{macro}{\AtEveryPend} +% \begin{macro}{\at@every@pend} +% \begin{macrocode} + +\newcommand{\AtEveryPend}[1]{% + \ifstrempty{#1}% + {\xdef\at@every@pend{}}% + {\gdef\at@every@pend{\noindent#1}}% +}% +\xdef\at@every@pend{}% + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\l@dzeropenalties} +% A macro to zero penalties for \cs{pend} or \cs{pstart}. +% \changes{v0.7.0}{2005/02/22}{Added \cs{l@dzeropenalties}} +% \begin{macrocode} +\newcommand*{\l@dzeropenalties}{% + \brokenpenalty \z@ \clubpenalty \z@ + \displaywidowpenalty \z@ \interlinepenalty \z@ \predisplaypenalty \z@ + \postdisplaypenalty \z@ \widowpenalty \z@} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\autopar} +% In most cases it is only an annoyance to have to label the paragraphs +% to be numbered with \cs{pstart} and \cs{pend}. \cs{autopar} will +% do that automatically, allowing you to start a paragraph with its +% first word and no other preliminaries, and to end it with a blank line +% or a \cs{par} command. The command should be issued within a +% group, after \cs{beginnumbering} has been used to start the +% numbering; all paragraphs within the group will be affected. +% +% A few situations can cause problems. One is a paragraph that begins with +% a begin-group character or command: \cs{pstart} will not get invoked +% until after such a group beginning is processed; as a result the +% character that ends the group will be mistaken for the end of the +% \cs{vbox} that \cs{pstart} creates, and the rest of the paragraph +% will not be numbered. Such paragraphs need to be started explicitly +% using \cs{indent}, \cs{noindent}, or \cs{leavevmode} --- or \cs{pstart}, since +% you can still include your own \cs{pstart} and \cs{pend} +% commands even with \cs{autopar} on. +% +% Prematurely ending the group within which \cs{autopar} is in +% effect will cause a similar problem. You must either leave a +% blank line or use \cs{par} to end the last paragraph before +% you end the group. +% +% The functioning of this macro is more tricky than the usual +% \cs{everypar}: we do not want anything to go onto the vertical +% list at all, so we have to end the paragraph, erase any evidence +% that it ever existed, and start it again using \cs{pstart}. +% We remove the paragraph-indentation box using \cs{lastbox} and +% save the width, and then skip backwards over the \cs{parskip} +% that has been added for this paragraph. Then we start again with +% \cs{pstart}, restoring the indentation that we saved, and +% locally change \cs{par} so that it will do our \cs{pend} for us. +% \begin{macrocode} +\newif\ifautopar +\autoparfalse +\newcommand*{\autopar}{ + \ifledRcol + \ifnumberingR \else + \led@err@AutoparNotNumbered + \beginnumberingR + \fi + \else + \ifnumbering \else + \led@err@AutoparNotNumbered + \beginnumbering + \fi + \fi + \autopartrue + \everypar{\setbox0=\lastbox + \endgraf \vskip-\parskip + \pstart \noindent \kern\wd0 \ifnumberpstart\ifinstanza\else\thepstart\fi\fi + \let\par=\pend}% + \ignorespaces} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\normal@pars} +% We also define a macro which we can rely on to turn off the +% \cs{autopar} definitions at various important places, if they +% are in force. We will want to do this within a footnotes, for +% example. +% \begin{macrocode} +\newcommand*{\normal@pars}{\everypar{}\let\par\endgraf} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ifautopar@pause} +% We define a boolean test switched to true at the beginning +% of the \cs{pausenumbering} command if the autopar is enabled. +% This boolean will be tested at the beginning of \cs{resumenumbering} +% to continue the autopar if neeeded. +% \begin{macrocode} +\newif\ifautopar@pause +% \end{macrocode} +% \end{macro} +% \subsection{Processing one line} +% +% \subsubsection{General process} +% \begin{macro}{\do@line}\label{doline} +% \begin{macro}{\l@dunhbox@line} +% The \cs{do@line} macro is called by \cs{pend} to +% do all the processing for a single line of text. +% \changes{v1.6.1}{2013/10/27}{Move the call to \cs{inserthangingsymbol} to allow use \cs{hfill} inside.} +% \changes{v1.12.2}{2014/08/07}{Fix a bug with critical notes at the tops of pages (added by v12.0.0)} +% \begin{macrocode} + \newcommand*{\l@dunhbox@line}[1]{\unhbox #1} + \newcommand*{\do@line}{% + {\vbadness=10000 + \splittopskip=\z@ + \do@linehook +\l@demptyd@ta + \global\setbox\one@line=\vsplit\raw@text to\baselineskip}% + \unvbox\one@line \global\setbox\one@line=\lastbox + \getline@num + \IfStrEq{\led@pb@setting}{before}{\led@check@pb\led@check@nopb}{} + \ifnum\@lock>\@ne + \inserthangingsymboltrue + \else + \inserthangingsymbolfalse + \fi + \check@pb@in@verse + \ifl@dhidenumber% + \global\l@dhidenumberfalse% + \f@x@l@cks% + \else% + \affixline@num% + \fi% +% \end{macrocode} +% \changes{v1.12.0}{2014/08/05}{\cs{do@line} is split in more little commands.} +% Depending weither a sectioning command is called at this pstart or not +% we print sectioning command or normal line, +% \begin{macrocode} + \xifinlist{\the\l@dnumpstartsL}{\eled@sections@@}% + {\print@eledsection}% + {\print@line}% + \IfStrEq{\led@pb@setting}{after}{\led@check@pb\led@check@nopb}{} + }% +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsubsection{Process for ``normal'' line} +% \begin{macro}{\print@line} +% \changes{v1.13.1}{2014/09/25}{Coming back of add@penalties, mistakenly deleted in version 0.17!} +% \changes{v1.18.0}{2015/02/23}{Compatibility with \LuaLaTeX\ RTL languages.} +% \cs{print@line} is for normal line, i. e line without sectioning command. +% \begin{macrocode} +\def\print@line{ +% \end{macrocode} +% Insert the pstart number in side, if we are in the first line of a pstart. +% \begin{macrocode} + \affixpstart@num% +% \end{macrocode} +% The line will be boxed, to have the good width. +% \begin{macrocode} + \hb@xt@ \linewidth{% +% \end{macrocode} +% User hook. +% \begin{macrocode} + \do@insidelinehook% +% \end{macrocode} +% Left line number +% \begin{macrocode} + \l@dld@ta% +% \end{macrocode} +% Restore marginal and footnotes. +% \begin{macrocode} + \add@inserts\affixside@note% +% \end{macrocode} +% Print left notes. +% \begin{macrocode} + \l@dlsn@te +% \end{macrocode} +% Boxes the line, writes information about new line in the numbered file. +% \begin{macrocode} + {\ledllfill\hb@xt@ \wd\one@line{\new@line% +% \end{macrocode} +% If we use \LuaLaTeX\, then restore the direction. +% \begin{macrocode} + \ifluatex% + \luatextextdir\l@luatextextdir@L% + \fi% +% \end{macrocode} +% Insert, if needed, the hanging symbol. +% \begin{macrocode} + \inserthangingsymbol %Space keept for backward compatibility +% \end{macrocode} +% And so, print the line. +% \begin{macrocode} + \l@dunhbox@line{\one@line}}% +% \end{macrocode} +% Right line number +% \begin{macrocode} + \ledrlfill\l@drd@ta% +% \end{macrocode} +% Print right notes. +% \begin{macrocode} + \l@drsn@te + }}% +% \end{macrocode} +% And reinsert penalties (for page breaking)... +% \begin{macrocode} + \add@penalties% +} +% \end{macrocode} +% \end{macro} +% \subsubsection{Process for line containing \cs{eledsection} command} +% \begin{macro}{\print@eledsection} +% \cs{print@eledsection} to print sectioning command with line number. +% It sets the correct spacing, depending whether a sectioning command was called at previous \cs{pstart}, calls the sectioning command, prints the normal line outside of the paper, to be able to have critical footnotes. +% Because of how this prints, a vertical spacing correction is added. +% \begin{macrocode} +\def\print@eledsection{% + \add@inserts\affixside@note% + \numdef{\temp@}{\l@dnumpstartsL-1}% + \xifinlist{\temp@}{\eled@sections@@}{\@nobreaktrue}{\@nobreakfalse}% + \@eled@sectioningtrue% + \csuse{eled@sectioning@\the\l@dnumpstartsL}% + \@eled@sectioningfalse% + \global\csundef{eled@sectioning@\the\l@dnumpstartsL}% + \if@RTL% + \hspace{-3\paperwidth}% + {\hbox{\l@dunhbox@line{\one@line}} \new@line}% + \else% + \hspace{3\paperwidth}% + {\new@line \hbox{\l@dunhbox@line{\one@line}}}% + \fi% + \vskip-\baselineskip% +} +% \end{macrocode} +% \end{macro} +% \subsubsection{Hooks} +% \begin{macro}{\do@linehook} +% \begin{macro}{\do@insidelinehook} +% Two hooks into \cs{do@line}. The first is called at the beginning of \cs{do@line}, the second is called in the line box. +% The second can, for example, have a \cs{markboth} command inside, the first ca not. +% \changes{v0.7.0}{2005/02/18}{Added \cs{do@linehook} for use in \cs{do@line}} +% \changes{v1.5.0}{2013/07/11}{Added \cs{do@insidelinehook} for use in \cs{do@line}} +% \begin{macrocode} +\newcommand*{\do@linehook}{} +\newcommand*{\do@insidelinehook}{} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\dolinehook} +% \begin{macro}{\doinsidelinehook} +% These hight level commands just redefine the low level commands. +% They have to be used be user, without \cs{makeatletter}. +% \changes{v1.12.5}{2014/08/31}{Added \cs{dolinehook} and \cs{doinsidelinehook}} +% \begin{macrocode} +\newcommand*{\dolinehook}[1]{\gdef\do@linehook{#1}}% +\newcommand*{\doinsidelinehook}[1]{\gdef\do@insidelinehook{#1}}% + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \subsubsection{Sidenotes and marginal line number initialization} +% \begin{macro}{\l@demptyd@ta} +% \begin{macro}{\l@dld@ta} +% \begin{macro}{\l@drd@ta} +% \begin{macro}{\l@dcsnotetext} +% \begin{macro}{\l@dcsnotetext@l} +% \begin{macro}{\l@dcsnotetext@r} +% Nulls the \cs{...d@ta}, which may later hold line numbers. +% Similarly for \cs{l@dcsnotetext}, \cs{l@dcsnotetext@l}, \cs{l@dcsnotetext@r} for the texts of the sidenotes, left and right notes. +% \changes{v0.7.0}{2005/02/18}{Added \cs{l@demptyd@ta}} +% \begin{macrocode} +\newcommand*{\l@demptyd@ta}{% + \gdef\l@dld@ta{}% + \gdef\l@drd@ta{}% + \gdef\l@dcsnotetext@l{}% + \gdef\l@dcsnotetext@r{}% + \gdef\l@dcsnotetext{}} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\l@dlsn@te} +% \begin{macro}{\l@drsn@te} +% Zero width boxes of the left and right side notes, together with their kerns. +% \changes{v0.7.0}{2005/02/18}{Added \cs{l@dlsn@te} and \cs{l@drsn@te} +% for use in \cs{do@line}} +% \begin{macrocode} +\newcommand{\l@dlsn@te}{% + \hb@xt@ \z@{\hss\box\l@dlp@rbox\kern\ledlsnotesep}} +\newcommand{\l@drsn@te}{% + \hb@xt@ \z@{\kern\ledrsnotesep\box\l@drp@rbox\hss}} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\ledllfill} +% \begin{macro}{\ledrlfill} +% These macros are called at the left (\cs{ledllfill}) and the right +% (\cs{ledllfill}) of each numbered line. The initial definitions +% correspond to the original code for \cs{do@line}. +% \begin{macrocode} +\newcommand*{\ledllfill}{\hfil} +\newcommand*{\ledrlfill}{} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \section{Line and page number computation} +% +% \begin{macro}{\getline@num} +% The \cs{getline@num} macro +% determines the page and line numbers for the line we are about to +% send to the vertical list. +% \begin{macrocode} +\newcommand*{\getline@num}{% + \global\advance\absline@num \@ne% + \do@actions + \do@ballast + \ifnumberline + \ifsublines@ + \ifnum\sub@lock<\tw@ + \global\advance\subline@num \@ne + \fi + \else + \ifnum\@lock<\tw@ + \global\advance\line@num \@ne + \global\subline@num \z@ + \fi + \fi + \fi +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\do@ballast} +% \phantomsection\label{do@ballast}\relax +% The real work in the macro above is done in \cs{do@actions}, but +% before we plunge into that, let's get \cs{do@ballast} out of the +% way. This macro looks to see if there is an action to be +% performed on the \emph{next} line, and if it is going to be a +% page break action, \cs{do@ballast} decreases the count \cs{ballast@count} +% counter +% by the amount of \verb"ballast". This means, in practice, that when +% \cs{add@penalties} assigns penalties at this point, \TeX\ will be +% given extra encouragement to break the page here (see +% \reff{add@penalties}). +% +% \begin{macro}{\ballast@count} +% \begin{macro}{\c@ballast} +% First we set up the required counters; they are initially +% set to zero, and will remain so unless you say +% \verb"\setcounter{ballast}"\marg{some figure} in your document. +% \begin{macrocode} +\newcount\ballast@count +\newcounter{ballast} + \setcounter{ballast}{0} +% \end{macrocode} +% \end{macro} +% \end{macro} +% And here is \cs{do@ballast} itself. It advances \cs{absline@num} +% within the protection of a group to make its check for what +% happens on the next line. +% \begin{macrocode} +\newcommand*{\do@ballast}{\global\ballast@count \z@ + \begingroup + \advance\absline@num \@ne + \ifnum\next@actionline=\absline@num + \ifnum\next@action>-1001\relax + \global\advance\ballast@count by -\c@ballast + \fi + \fi + \endgroup} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\do@actions} +% \begin{macro}{\do@actions@next} +% +% The \cs{do@actions} macro +% looks at the list of actions to take at particular absolute line +% numbers, and does everything that is specified for the current line. +% +% It may call itself recursively, and to do this efficiently (using +% \TeX's optimization for tail recursion), we define a control-sequence +% called \cs{do@actions@next} that is always the last thing that +% \cs{do@actions} does. If there could be more actions to process for +% this line, \cs{do@actions@next} is set equal to \cs{do@actions}; +% otherwise it is just \cs{relax}. +% \changes{v0.7.0}{2005/02/22}{Added number skipping to \cs{do@actions}} +% \begin{macrocode} +\newcommand*{\do@actions}{% + \global\let\do@actions@next=\relax + \ifnum\absline@num<\next@actionline\else +% \end{macrocode} +% +% First, page number changes, which will generally be the most common +% actions. If we are restarting lineation on each page, this is where it +% happens. +% \begin{macrocode} + \ifnum\next@action>-1001 + \global\page@num=\next@action + \ifbypage@ + \global\line@num=\z@ \global\subline@num=\z@ + \resetprevline@ + \fi +% \end{macrocode} +% +% Next, we handle +% commands that change the line-number values. (We subtract $5001$ rather +% than $5000$ here because the line number is going to be incremented +% automatically in \cs{getline@num}.) +% \begin{macrocode} + \else + \ifnum\next@action<-4999 + \@l@dtempcnta=-\next@action + \advance\@l@dtempcnta by -5001 + \ifsublines@ + \global\subline@num=\@l@dtempcnta + \else + \global\line@num=\@l@dtempcnta + \fi +% \end{macrocode} +% +% We rescale the value in +% \cs{@l@dtempcnta} so that we can use a case statement. +% \begin{macrocode} + \else + \@l@dtempcnta=-\next@action + \advance\@l@dtempcnta by -1000 + \do@actions@fixedcode + \fi + \fi +% \end{macrocode} +% +% Now we get information about the next action off the list, +% and then set \cs{do@actions@next} so that we will +% call ourself recursively: the next action might also be for this +% line. +% +% There is no warning if we find \cs{actionlines@list} empty, +% since that will always happen near the end of the section. +% +% \begin{macrocode} + \ifx\actionlines@list\empty + \gdef\next@actionline{1000000}% + \else + \gl@p\actionlines@list\to\next@actionline + \gl@p\actions@list\to\next@action + \global\let\do@actions@next=\do@actions + \fi + \fi +% \end{macrocode} +% +% Make the recursive call, if necessary. +% +% \begin{macrocode} +\do@actions@next} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\do@actions@fixedcode} +% This macro handles the fixed codes for \cs{do@actions}. It is +% one big case statement. +% \changes{v0.7.0}{2005/02/24}{Added \cs{do@actions@fixedcode}} +% \begin{macrocode} +\newcommand*{\do@actions@fixedcode}{% + \ifcase\@l@dtempcnta + \or% % 1001 + \global\sublines@true + \or% % 1002 + \global\sublines@false + \or% % 1003 + \global\@lock=\@ne + \or% % 1004 + \ifnum\@lock=\tw@ + \global\@lock=\thr@@ + \else + \global\@lock=\z@ + \fi + \or% % 1005 + \global\sub@lock=\@ne + \or% % 1006 + \ifnum\sub@lock=\tw@ + \global\sub@lock=\thr@@ + \else + \global\sub@lock=\z@ + \fi + \or% % 1007 + \l@dskipnumbertrue + \or% % 1008 + \l@dskipversenumbertrue% + \or% % 1009 + \l@dhidenumbertrue + \else + \led@warn@BadAction + \fi} + + +% \end{macrocode} +% \end{macro} +% \section{Line number printing} +% +% \begin{macro}{\affixline@num} +% \cs{affixline@num} just puts a left line number into \cs{l@dld@ta} +% or a right line number into \cs{l@drd@ta} if required. +% +% To determine whether we need to affix a line number to this line, +% we compute the following: +% \begin{tabbing} +% \quad $m$ \= \kill +% $n$ \> $= \mbox{\it int\/} ( ( \mbox{\it linenum\/} - +% \mbox{\it firstlinenum\/} ) / +% \mbox{\it linenumincrement\/} )$ \\ +% $m$ \> $= \mbox{\it firstlinenum\/} + +% ( n \times \mbox{\it linenumincrement\/})$ +% \end{tabbing} +% (where \emph{int} truncates a real number to an integer). +% $m$ will be equal to \emph{linenum} only +% if we are to paste a number on here. +% However, the formula breaks down for the first line to number (and any +% before that), so we check that case separately: if \cs{line@num} $\le$ +% \cs{firstlinenum}, we compare the two directly instead of making these +% calculations. +% +% We compute, in the scratch counter \cs{@l@dtempcnta}, the number +% of the next line that should be printed with a number ($m$ in the +% above discussion), and move the current line number into the +% counter \cs{@l@dtempcntb} for comparison. +% +% +% First, the case when we are within a sub-line range. +% \changes{v0.5.1}{2004/04/10}{Changed \cs{affixline@num} to cater for sidenotes} +% \changes{v0.7.0}{2005/02/22}{Added skipnumering to \cs{affixline@num}} +% \begin{macrocode} +\newcommand*{\affixline@num}{% +% \end{macrocode} +% No number is attached if \cs{ifl@dskipnumber} is TRUE (and then it +% is set to its normal FALSE value). +% No number is attached if \cs{ifnumberline} is FALSE (the normal value is TRUE). +% \changes{v0.15.0}{2012/06/11}{Line numbering can be disabled.} +% \begin{macrocode} + \ifledgroupnotesL@\else + \ifnumberline + \ifl@dskipnumber + \global\l@dskipnumberfalse + \else + \ifsublines@ + \@l@dtempcntb=\subline@num + \ifnum\subline@num>\c@firstsublinenum + \@l@dtempcnta=\subline@num + \advance\@l@dtempcnta by-\c@firstsublinenum + \divide\@l@dtempcnta by\c@sublinenumincrement + \multiply\@l@dtempcnta by\c@sublinenumincrement + \advance\@l@dtempcnta by\c@firstsublinenum + \else + \@l@dtempcnta=\c@firstsublinenum + \fi +% \end{macrocode} +% +% That takes care of computing the values for comparison, but if line +% number locking is in effect we have to make a further check. If this +% check fails, then we disable the line-number display by setting the +% counters to arbitrary but unequal values. +% \begin{macrocode} + \ch@cksub@l@ck +% \end{macrocode} +% +% Now the line number case, which works the same way. +% \begin{macrocode} + \else + \@l@dtempcntb=\line@num +% \end{macrocode} +% Check on the \cs{linenumberlist} +% If it is \cs{empty} use the standard +% algorithm. +% \begin{macrocode} + \ifx\linenumberlist\empty + \ifnum\line@num>\c@firstlinenum + \@l@dtempcnta=\line@num + \advance\@l@dtempcnta by-\c@firstlinenum + \divide\@l@dtempcnta by\c@linenumincrement + \multiply\@l@dtempcnta by\c@linenumincrement + \advance\@l@dtempcnta by\c@firstlinenum + \else + \@l@dtempcnta=\c@firstlinenum + \fi + \else +% \end{macrocode} +% The \cs{linenumberlist} was not \cs{empty}, so here is Wayne's +% numbering mechanism. This takes place in \TeX's mouth. +% \begin{macrocode} + \@l@dtempcnta=\line@num + \edef\rem@inder{,\linenumberlist,\number\line@num,}% + \edef\sc@n@list{\def\noexpand\sc@n@list + ####1,\number\@l@dtempcnta,####2|{\def\noexpand\rem@inder{####2}}}% + \sc@n@list\expandafter\sc@n@list\rem@inder|% + \ifx\rem@inder\empty% + \advance\@l@dtempcnta\@ne + \fi + \fi +% \end{macrocode} +% +% +% A locking check for lines, just like the version for sub-line +% numbers above. +% \begin{macrocode} + \ch@ck@l@ck + \fi +% \end{macrocode} +% +% The following tests are true if we need to print a line number. +% \begin{macrocode} + \ifnum\@l@dtempcnta=\@l@dtempcntb + \ifl@dskipversenumber\else +% \end{macrocode} +% +% If we got here, +% we are going to print a line number; so now we need to +% calculate a number that will tell us which side of the page will get +% the line number. We start from \cs{line@margin}, which asks for +% one side always if it is less than $2$; and then if the side does +% depend on the page number, we simply add the page number to this +% side code---because the values of \cs{line@margin} have been devised so +% that this produces a number that is even for left-margin numbers and +% odd for right-margin numbers. +% +% For \LaTeX\ we have to consider two column documents as well. In this case +% Peter Wilson thought we need to put the numbers at the outside of the column --- +% the left of the first column and the right of the second. Do the twocolumn +% stuff before going on with the original code. +% \begin{macro}{\l@dld@ta} +% \begin{macro}{\l@drd@ta} +% A left line number is stored in \cs{l@dld@ta} and a right one in +% \cs{l@drd@ta}. +% +% \begin{macrocode} + \if@twocolumn + \if@firstcolumn + \gdef\l@dld@ta{\llap{{\leftlinenum}}}% + \else + \gdef\l@drd@ta{\rlap{{\rightlinenum}}}% + \fi + \else + \@l@dtempcntb=\line@margin + \ifnum\@l@dtempcntb>\@ne + \advance\@l@dtempcntb \page@num + \fi + \ifodd\@l@dtempcntb + \gdef\l@drd@ta{\rlap{{\rightlinenum}}}% + \else + \gdef\l@dld@ta{\llap{{\leftlinenum}}}% + \fi + \fi + \fi + \fi +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% Now fix the lock counters, if necessary. +% A value of $1$ is advanced to +% $2$; $3$ advances to $0$; other values are unchanged. +% \begin{macrocode} + \f@x@l@cks + \fi + \fi + \fi +} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ch@cksub@l@ck} +% \begin{macro}{\ch@ck@l@ck} +% \begin{macro}{\f@x@l@cks} +% These macros handle line number locking for \cs{affixline@num}. +% \changes{v0.7.0}{2005/02/24}{Added \cs{ch@cksub@l@ck}, \cs{ch@ck@l@ck} +% and \cs{f@x@l@cks}} +% \cs{ch@cksub@l@ck} checks subline locking. If it fails, then we disable +% the line-number display by setting the counters to arbitrary but unequal +% values. +% \begin{macrocode} +\newcommand*{\ch@cksub@l@ck}{% + \ifcase\sub@lock + \or + \ifnum\sublock@disp=\@ne + \@l@dtempcntb=\z@ \@l@dtempcnta=\@ne + \fi + \or + \ifnum\sublock@disp=\tw@ \else + \@l@dtempcntb=\z@ \@l@dtempcnta=\@ne + \fi + \or + \ifnum\sublock@disp=\z@ + \@l@dtempcntb=\z@ \@l@dtempcnta=\@ne + \fi + \fi} +% \end{macrocode} +% Similarly for line numbers. +% \begin{macrocode} +\newcommand*{\ch@ck@l@ck}{% + \ifcase\@lock + \or + \ifnum\lock@disp=\@ne + \@l@dtempcntb=\z@ \@l@dtempcnta=\@ne + \fi + \or + \ifnum\lock@disp=\tw@ \else + \@l@dtempcntb=\z@ \@l@dtempcnta=\@ne + \fi + \or + \ifnum\lock@disp=\z@ + \@l@dtempcntb=\z@ \@l@dtempcnta=\@ne + \fi + \fi} +% \end{macrocode} +% Fix the lock counters. +% A value of $1$ is advanced to +% $2$; $3$ advances to $0$; other values are unchanged. +% \begin{macrocode} +\newcommand*{\f@x@l@cks}{% + \ifcase\@lock + \or + \global\@lock=\tw@ + \or \or + \global\@lock=\z@ + \fi + \ifcase\sub@lock + \or + \global\sub@lock=\tw@ + \or \or + \global\sub@lock=\z@ + \fi} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% +% +% \section{Pstart number printing in side} +% In side, the printing of pstart number is running like the printing of line number. There is only some differences: +% \begin{macro}{\affixpstart@num} +% \begin{macro}{\pstartnum} +% \begin{itemize} +% \item The pstarts counter is upgrade in the \cs{pend} command. Consequently, the \cs{affixpstart@num} command has not to upgrade it, unlike the \cs{affixline@num} which upgrades the lines counter. +% \item To print the pstart number only at the beginning of a pstart, and not in every line, a boolean test is made. The \cs{pstartnum} boolean is set to TRUE at every \cs{pend}. It is tried in the \cs{leftpstartnum} and \cs{rightstartnum} commands. After the try, it is set to FALSE. +% \end{itemize} +% \begin{macro}{\leftpstartnum} +% \begin{macro}{\rightstartnum} +% \begin{macro}{\ifsidepstartnum} +% \begin{macrocode} + +\newif\ifsidepstartnum +\newcommand*{\affixpstart@num}{% + \ifsidepstartnum + \if@twocolumn + \if@firstcolumn + \gdef\l@dld@ta{\llap{{\leftpstartnum}}}% + \else + \gdef\l@drd@ta{\rlap{{\rightpstartnum}}}% + \fi + \else + \@l@dtempcntb=\line@margin + \ifnum\@l@dtempcntb>\@ne + \advance\@l@dtempcntb \page@num + \fi + \ifodd\@l@dtempcntb + \gdef\l@drd@ta{\rlap{{\rightpstartnum}}}% + \else + \gdef\l@dld@ta{\llap{{\leftpstartnum}}}% + \fi + \fi + \fi + +} +% + +\newif\ifpstartnum +\pstartnumtrue +\newcommand*{\leftpstartnum}{ + \ifpstartnum\thepstart + \kern\linenumsep\fi + \global\pstartnumfalse +} +\newcommand*{\rightpstartnum}{ + \ifpstartnum + \kern\linenumsep + \thepstart + \fi + \global\pstartnumfalse +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \section{Restoring footnotes and penalties} +% Because of the paragraph decomposition process in order to number line, \macpackage must hack the standard way \TeX\ works in order to manage insertion of footnotes, both critical and familiar. +% +% We need to call the \cs{insert} commands not when the content of \cs{pstart}\ldots\cs{pend} is read by \TeX\, by when each individual line is typeset. +% +% Consequently, when reading the content of \cs{pstart}\ldots\cs{pend}, we store the insertion (footnotes) in an specific \macpackage's list, and we restore them to the vertical list when printing each individual line. +% +% \subsection{Add insertions to the vertical list} +% +% \begin{macro}{\inserts@list} +% \cs{inserts@list} is the list macro that contains the inserts that +% we save up for one paragraph. +% +% \begin{macrocode} +\list@create{\inserts@list} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\add@inserts} +% \begin{macro}{\add@inserts@next} +% \cs{add@inserts} +% is the penultimate macro used by \cs{do@line}; it takes +% insertions saved in a list macro and sends them onto the vertical list. +% +% It may call itself recursively, and to do this efficiently (using +% \TeX's optimization for tail recursion), we define a control-sequence +% called \cs{add@inserts@next} that is always the last thing that +% \cs{add@inserts} does. If there could be more inserts to process for +% this line, \cs{add@inserts@next} is set equal to \cs{add@inserts}; +% otherwise it is just \cs{relax}. +% +% \begin{macrocode} +\newcommand*{\add@inserts}{% + \global\let\add@inserts@next=\relax +% \end{macrocode} +% +% If \cs{inserts@list} is empty, there are not any more notes or insertions +% for this paragraph, and we need not waste our time. +% \begin{macrocode} + \ifx\inserts@list\empty \else +% \end{macrocode} +% +% The \cs{next@insert} macro records the number of the line that +% receives the next footnote or other insert; it is empty when we start +% out, and just after we have affixed a note or insert. +% \begin{macrocode} + \ifx\next@insert\empty + \ifx\insertlines@list\empty + \global\noteschanged@true + \gdef\next@insert{100000}% + \else + \gl@p\insertlines@list\to\next@insert + \fi + \fi +% \end{macrocode} +% +% If the next insert's for this line, tack it on (and then erase the +% contents of the insert macro, as it could be quite large). +% In that case, we also set \cs{add@inserts@next} so that we will +% call ourself recursively: there might be another insert for this same +% line. +% +% \begin{macrocode} + \ifnum\next@insert=\absline@num + \gl@p\inserts@list\to\@insert + \@insert + \global\let\@insert=\undefined + \global\let\next@insert=\empty + \global\let\add@inserts@next=\add@inserts + \fi +\fi +% \end{macrocode} +% +% Make the recursive call, if necessary. +% +% \begin{macrocode} +\add@inserts@next} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsection{Penalties} +% +% \begin{macro}{\add@penalties} +% \cs{add@penalties} is +% the last macro used by \cs{do@line}. It adds up the club, +% widow, and interline penalties, and puts a single penalty +% of the appropriate size +% back into the paragraph; these penalties get +% removed by the \cs{vsplit} operation. \cs{displaywidowpenalty} and +% \cs{brokenpenalty} are not restored, since we have no easy way to +% find out where we should insert them. +% +% \label{add@penalties} +% In this code, \cs{num@lines} is the number of lines in the whole +% paragraph, and \cs{par@line} is the line we are working on at the +% moment. The count \cs{@l@dtempcnta} is used to calculate and +% accumulate the penalty; it is initially set to the value of +% \cs{ballast@count}, which has been worked out in \cs{do@ballast} +% above (\reff{do@ballast}). Finally, the penalty is +% checked to see that it does not go below $-10000$. +% \begin{macrocode} +\newcommand*{\add@penalties}{\@l@dtempcnta=\ballast@count + \ifnum\num@lines>\@ne + \global\advance\par@line \@ne + \ifnum\par@line=\@ne + \advance\@l@dtempcnta \clubpenalty + \fi + \@l@dtempcntb=\par@line \advance\@l@dtempcntb \@ne + \ifnum\@l@dtempcntb=\num@lines + \advance\@l@dtempcnta \widowpenalty + \fi + \ifnum\par@line<\num@lines + \advance\@l@dtempcnta \interlinepenalty + \fi + \fi + \ifnum\@l@dtempcnta=\z@ + \relax + \else + \ifnum\@l@dtempcnta>-10000 + \penalty\@l@dtempcnta + \else + \penalty -10000 + \fi + \fi} + +% \end{macrocode} +% \end{macro} +% +% \subsection{Printing leftover notes} +% +% \begin{macro}{\flush@notes} +% The \cs{flush@notes} +% macro is called after the entire paragraph has been sliced up +% and sent on to the vertical list. +% If the number of notes to this paragraph has increased since the previous +% run of \TeX, then there can be leftover notes that have not yet been +% printed. An appropriate error message will be printed elsewhere; but +% it is best to go ahead and +% print these notes somewhere, even if it is not in quite the +% right place. What we do is dump them all out here, so that they should +% be printed on the same page as the last line +% of the paragraph. We can hope that is not +% too far from the proper location, to which they will move on the next +% run. +% \begin{macrocode} +\newcommand*{\flush@notes}{% + \@xloop + \ifx\inserts@list\empty \else + \gl@p\inserts@list\to\@insert + \@insert + \global\let\@insert=\undefined + \repeat} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@xloop} +% \cs{@xloop} is +% a variant of the \PlainTeX\ \cs{loop} macro, useful when it's +% hard to construct a positive test using the \TeX\ \verb"\if" commands---as +% in \cs{flush@notes} above. One says \cs{@xloop} \verb"..." \verb"\if" \verb"..." \verb"\else" +% \verb"..." \verb"\repeat", and the action following \verb"\else" is repeated as long +% as the \verb"\if" test fails. (This macro will work wherever the \PlainTeX\ +% \cs{loop} is used, too, so we could just call it \cs{loop}; +% but it seems preferable not to change the definitions of any of +% the standard macros.) +% +% This variant of \cs{loop} was introduced by +% Alois Kabelschacht\index{Kabelschacht, Alois} in +% \textit{TUGboat} \textbf{8} (1987), pp.\,184--5. +% +% \begin{macrocode} +\def\@xloop#1\repeat{% + \def\body{#1\expandafter\body\fi}% + \body} + +% \end{macrocode} +% \end{macro} +% +% \section{Critical footnotes} +% \label{footnotes} +% +% The footnote macros are adapted from those in \PlainTeX, but they +% differ in these respects: the outer-level commands must add other +% commands to a list macro rather than doing insertions immediately; +% there are many separate levels of the footnotes, not just one; and there +% are options to reformat footnotes into paragraphs or into multiple +% columns. +% +% \subsection{Fonts} +% \label{fontcode}\relax +% Before getting into the details of formatting the notes, we set +% up some font macros. It is the notes that present the greatest +% challenge for our font-handling mechanism, because we need to be +% able to take fragments of our main text and print them in +% different forms: it is common to reduce the size, +% for example, without otherwise changing the fonts used. +% +% +% \begin{macro}{\select@lemmafont}\label{notefonts} +% \begin{macro}{\select@@lemmafont} +% \cs{select@lemmafont} is provided to set the right font for +% the lemma in a note. This macro extracts the font specifier +% from the line and page number cluster, and issues the associated +% font-changing command, so that the lemma is printed in its +% original font. +% \begin{macrocode} + \def\select@lemmafont#1|#2|#3|#4|#5|#6|#7|{\select@@lemmafont#7|} + \def\select@@lemmafont#1/#2/#3/#4|% + {\fontencoding{#1}\fontfamily{#2}\fontseries{#3}\fontshape{#4}% + \selectfont} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \subsection{Individual note options} +% \changes{v1.0.0}{2012/09/15}{Options of \cs{Xfootnote}s.} +% \begin{macro}{\footnoteoptions@} +% The \cs{footnoteoption@}\oarg{side}\marg{options}\marg{value} changes the value of on options of Xfootnote, to switch between true and false. +% \begin{macrocode} +\newcommandx*{\footnoteoptions@}[3][1=L,usedefault]{% + \def\do##1{% + \ifstrequal{#1}{L}{% In Leftside + \xright@appenditem{\global\noexpand\settoggle{##1@}{#3}}\to\inserts@list% Switch toogle, in all case + \global\advance\insert@count \@ne% Increment the left insert counter. + }% + {% + \xright@appenditem{\global\noexpand\settoggle{##1@}{#3}}\to\inserts@listR% Switch toogle, in all case + \global\advance\insert@countR \@ne% Increment the right insert counter insert. + }% + }% + \notblank{#2}{\docsvlist{#2}}{}% Parsing all options +} +% \end{macrocode} +% \end{macro} +% +% \subsection{Notes language} +% \begin{macro}{\footnotelang@lua} +% \cs{footnotelang@lua} is called to remember the information about the direction of a lemma when \LuaLaTeX\ is used. +% \begin{macrocode} +\newcommandx*{\footnotelang@lua}[1][1=L,usedefault]{% + \ifstrequal{#1}{L}{% + \xright@appenditem{{\csxdef{footnote@luatextextdir}{\the\luatextextdir}}}\to\inserts@list%Know the dir of lemma + \global\advance\insert@count \@ne% + \xright@appenditem{{\csxdef{footnote@luatexpardir}{\the\luatexpardir}}}\to\inserts@list%Know the dir of lemma + \global\advance\insert@count \@ne% + }% + {% + \xright@appenditem{{\csxdef{footnote@luatextextdir}{\the\luatextextdir}}}\to\inserts@listR%Know the dir of lemma + \global\advance\insert@countR \@ne% + \xright@appenditem{{\csxdef{footnote@luatexpardir}{\the\luatexpardir}}}\to\inserts@listR%Know the dir of lemma + \global\advance\insert@countR \@ne% + }% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\footnotelang@poly} +% \cs{footnotelang@poly} is called to remember the information about the language of a lemma when \Lpack{polyglossia} is used. +% \begin{macrocode} +\newcommandx*{\footnotelang@poly}[1][1=L,usedefault]{% + \ifstrequal{#1}{L}{% + \if@RTL% + \xright@appenditem{{\csxdef{footnote@dir}{@RTLtrue}}}\to\inserts@list%Know the language used in the lemma + \global\advance\insert@count \@ne% + \else + \xright@appenditem{{\csxdef{footnote@dir}{@RTLfalse}}}\to\inserts@list%Know the language of lemma + \global\advance\insert@count \@ne% + \fi% + \xright@appenditem{{\csxdef{footnote@lang}{\expandonce\languagename}}}\to\inserts@list%Know the language of lemma + \global\advance\insert@count \@ne% + }% + {% + \if@RTL + \xright@appenditem{{\csxdef{footnote@dir}{@RTLtrue}}}\to\inserts@listR%Know the language of lemma + \global\advance\insert@countR \@ne% + \else + \xright@appenditem{{\csxdef{footnote@dir}{@RTLfalse}}}\to\inserts@listR%Know the language of lemma + \global\advance\insert@countR \@ne% + \fi + \xright@appenditem{{\csxdef{footnote@lang}{\expandonce\languagename}}}\to\inserts@listR%Know the language of lemma + \global\advance\insert@countR \@ne% + }% +} +% \end{macrocode} +% \end{macro} +% \subsection{General survey of the way we manage notes} +% +% The processing of each note is done +% by four principal macros: the \cs{vfootnote} macro takes the text +% of the footnote and does the \cs{insert}; it calls on the +% \cs{footfmt} macro to select the right fonts, print the line +% number and lemma, and do any other formatting needed for that individual +% note. Within the output routine, the two other macros, \cs{footstart} +% and \cs{footgroup}, are called; the first prints extra vertical +% space and a footnote rule, if desired; the second does any reformatting +% of the whole set of the footnotes in this series for this page---such +% as paragraphing or division into columns---and then sends them to the +% page. +% +% These four macros, and the other macros and parameters shown +% here, are distinguished by the `series letter' +% that indicates which set of the footnotes +% we are dealing with---\texttt{A}, \texttt{B}, \texttt{C}, \texttt{D}, or \texttt{E}. +% The series letter always precedes the string \verb"foot" in macro +% and parameter names. Hence, for the \texttt{A} series, the four macros +% are called \cs{vAfootnote}, \cs{Afootfmt}, \cs{Afootstart}, +% and \cs{Afootgroup}. +% +% These macros are changed depending of the footnotes arrangement: ``normal'', ``paragraphed'', ``two columns'' or ``three columns''. +% \subsection{General setup} +% \begin{macro}{\footsplitskips} +% Some setup code that is common for a variety of the footnotes. +% The setup is for: +% \begin{itemize} +% \item \cs{interlinepenalty}. +% \item \cs{splittopskip} (skip before last part of notes that flow from one page to another). +% \item \cs{splitmaxdepth}. +% \item \cs{floatingpenalty}, that is penalty values being added when a long note flows from one page to another. +% Here, we let it to 0 when we are processing parallel pages in \Lpack{eledpar}, in order to allow notes to flow from left to right pages and \emph{vice-versa}. +% Otherwise, we let it to \cs{@MM}, which is the standard \LaTeX\ \cs{floatingpenalty}. +% \end{itemize} +% \changes{v0.7.0}{2005/02/18}{Added \cs{footsplitskips} for use in many +% footnote styles} +% \changes{v1.19.0}{2015/03/06}{\cs{footsplitskips} doesn't set \cs{floatingpenalty} to \cs{@MM} when processing parallel pages.} +% \begin{macrocode} +\newcommand*{\footsplitskips}{% + \interlinepenalty=\interfootnotelinepenalty + \unless\ifl@dprintingpages% + \floatingpenalty=\@MM% + \fi% + \splittopskip=\ht\strutbox \splitmaxdepth=\dp\strutbox + \leftskip=\z@skip \rightskip=\z@skip} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\normalfootnoterule} +% \cs{normalfootnoterule} is +% a standard footnote-rule macro, for use by a \verb"footstart" +% macro: just the same as the \PlainTeX\ footnote rule. +% \begin{macrocode} +\let\normalfootnoterule=\footnoterule +% \end{macrocode} +% \end{macro} +% \subsection{Footnotes arrangement} +% +% \subsubsection{User level macro} +% \begin{macro}{\Xarrangement} +% \cs{Xarrangement}\oarg{s}\marg{arrangement} +% The command calls, for each series, a specific command which set many counters and commands in order to define specific arrangement. +% +% \begin{macrocode} +\newcommandx{\Xarrangement}[2][1,usedefault]{% + \def\do##1{% + \csname Xarrangement@#2\endcsname{##1}% + }% + \ifstrempty{#1}% + {% + \dolistloop{\@series}% + }% + { + \docsvlist{#1}% + }% +}% +% \end{macrocode} +% \end{macro} +% \subsubsection{Normal footnote} +% +% \begin{macro}{\Xarrangement@normal} +% We can now define all the parameters for the series of +% footnotes; initially they use the ``normal'' footnote formatting. +% +% What we want to do here is to say something like the following +% for each footnote series. (This is an example, not part of the +% actual \macpackage{} code.) +% \begin{verbatim} +% \skip\Afootins=12pt plus5pt minus5pt +% \count\Afootins=1000 +% \dimen\Afootins=0.8\vsize +% \let\vAfootnote=\normalvfootnote \let\Afootfmt=\normalfootfmt +% \let\Afootstart=\normalfootstart \let\Afootgroup=\normalfootgroup +% \let\Afootnoterule=\normalfootnoterule +% \end{verbatim} +% (Read \thetexbook\ in order to understand what are the counter, skip and dimen associated to an insertion.) +% +% Instead of repeating ourselves, we define a \cs{Xarrangement@normal} +% macro that makes all these assignments for us, for any given +% series letter. +% This command is called when people use \cs{Xarrangement}\oarg{series}\verb+{normal}+ + +% +% Now we set up the \cs{Xarrangement@normal} macro itself. It takes +% one argument: the footnote series letter. +% \begin{macrocode} +\newcommand*{\Xarrangement@normal}[1]{% + \csgdef{series@display#1}{normal} + \expandafter\let\csname #1footstart\endcsname=\normalfootstart + \expandafter\let\csname v#1footnote\endcsname=\normalvfootnote + \expandafter\let\csname #1footfmt\endcsname=\normalfootfmt + \expandafter\let\csname #1footgroup\endcsname=\normalfootgroup + \expandafter\let\csname #1footnoterule\endcsname=% + \normalfootnoterule + \count\csname #1footins\endcsname=1000 + \dimen\csname #1footins\endcsname=\csuse{Xmaxhnotes@#1} + \skip\csname #1footins\endcsname=\csuse{Xbeforenotes@#1}% + \advance\skip\csname #1footins\endcsname by\csuse{Xafterrule@#1}% +% \end{macrocode} +% The \parpackage provides tools in order to confine notes to one side. +% The mechanism is explained in the \parpackage's handbook. +% For now, just retain we need to store default value of the counter associated to the notes \TeX's inserts. + +% \begin{macrocode} + \csxdef{default@#1footins}{1000}%Use this to confine the notes to one side only +% \end{macrocode} +% Now do the setup for minipage footnotes. We use as much as possible of the +% normal setup as we can (so the notes will have a similar layout). +% \changes{v0.4.0}{2004/02/29}{Added minpage footnote setup to \cs{footnormal}} +% \begin{macrocode} + \ifnoledgroup@\else% + \expandafter\let\csname mpv#1footnote\endcsname=\mpnormalvfootnote + \expandafter\let\csname mp#1footgroup\endcsname=\mpnormalfootgroup + \count\csname mp#1footins\endcsname=1000 + \dimen\csname mp#1footins\endcsname=\csuse{Xmaxhnotes@#1} + \skip\csname mp#1footins\endcsname=\csuse{Xbeforenotes@#1}% + \advance\skip\csname mp#1footins\endcsname by\csuse{Xafterrule@#1}% + \fi +} + +% \end{macrocode} +% \end{macro} +% +% +% +% +% \begin{macro}{\normalvfootnote} +% We now begin a series of commands that do `normal' footnote +% formatting: a format much like that implemented +% in \PlainTeX{}, in which each footnote +% is a separate paragraph. +% +% \cs{normalvfootnote} takes the series letter as \verb"#1", +% and the entire text of the footnote is \verb"#2". It does the +% \cs{insert} for this note, calling on the \cs{footfmt} macro for +% this note series to format the text of the note. +% \begin{macrocode} +\notbool{parapparatus@}{\newcommand*}{\newcommand}{\normalvfootnote}[2]{% + \insert\csname #1footins\endcsname\bgroup + \csuse{Xbhooknote@#1} + \csuse{Xnotefontsize@#1} + \footsplitskips + \ifl@dpairing\ifl@dpaging\else% + \setXnoteswidthliketwocolumns@{#1}% + \fi\fi% + \setXnotespositionliketwocolumns@{#1}% + \spaceskip=\z@skip \xspaceskip=\z@skip + \csname #1footfmt\endcsname #2{#1}\egroup} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\mpnormalvfootnote} +% And a somewhat different version for minipages. +% \changes{v0.4.0}{2004/02/29}{Added \cs{mpnormalvfootnote}} +% \begin{macrocode} +\notbool{parapparatus@}{\newcommand*}{\newcommand}{\mpnormalvfootnote}[2]{% + \global\setbox\@nameuse{mp#1footins}\vbox{% + \unvbox\@nameuse{mp#1footins} + \csuse{Xbhooknote@#1} + \csuse{Xnotefontsize@#1} + \hsize\columnwidth + \@parboxrestore + \color@begingroup + \csname #1footfmt\endcsname #2{#1}\color@endgroup}} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\normalfootfmt} +% \label{normalfootfmt} +% \cs{normalfootfmt} is a `normal' macro +% to take the footnote line and page +% number information (see \reff{linenumbers}), and the +% desired text, and output what's to be printed. +% Argument \verb"#1" contains the line and page number information +% and lemma font specifier; +% \verb"#2" is the lemma; +% \verb"#3" is the note's text. This version is very +% rudimentary---it uses \cs{printlines} +% to print just the range of line numbers, +% followed by a square bracket, the lemma, and the note text. +% +% \begin{macrocode} + + +\notbool{parapparatus@}{\newcommand*}{\newcommand}{\normalfootfmt}[4]{% + \Xledsetnormalparstuff{#4}% + \hangindent=\csuse{Xhangindent@#4} + \strut{\printlinefootnote{#1}{#4}}% + {\nottoggle{Xlemmadisablefontselection@#4}{\select@lemmafont#1|#2}{#2}}% + \iftoggle{nosep@}{\hskip\csuse{Xinplaceoflemmaseparator@#4}}{\ifcsempty{Xlemmaseparator@#4}% + {\hskip\csuse{Xinplaceoflemmaseparator@#4}}% + {\nobreak\hskip\csuse{Xbeforelemmaseparator@#4}\csuse{Xlemmaseparator@#4}\hskip\csuse{Xafterlemmaseparator@#4}\relax% + }}% + #3\strut\par} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\normalfootstart}\label{normalvalues} +% \phantomsection\relax +% \cs{normalfootstart} +% is a standard footnote-starting macro, called in the output +% routine whenever there are footnotes of this series to be +% printed: it skips a bit and then draws a rule. +% +% Any \cs{footstart} macro must put onto the page something that +% takes up space exactly equal to the \cs{skip}\cs{Xfootins} value for +% the associated series of notes. \TeX\ makes page computations based +% on that \cs{skip} value, and the output pages will suffer from +% spacing problems if what you add takes up a different amount of +% space. +% +% But if the skip \cs{preXnotes@} is greater than 0~pt, +% it is used instead of \cs{skip}\cs{footins} for the first printed series in one page. +% +% The \cs{leftskip} and \cs{rightskip} values +% are both zeroed here. +% \label{footskips} +% Similarly, these skips are cancelled in the \cs{vfootnote} macros +% for the various types of notes. Strictly speaking, +% this is necessary only +% if you are using paragraphed footnotes, but we have put it here +% and in the other \cs{vfootnote} macros too so that the behavior of +% \macpackage{} in this respect is general across all footnote types. +% What this means is that any \cs{leftskip} +% and \cs{rightskip} you specify applies to the main text, but not +% the footnotes. The footnotes continue to be of width \cs{hsize}. +% \begin{macrocode} +\newcommand*{\normalfootstart}[1]{% +% \end{macrocode} +% The first series of notes printed in a page can have a specific skip before it. +% In order to insert this specific skip without overlap the bottom margin of the page, Maïeul Rouquette have defined an algorithm explained in \reff{skipfirstseries}. +% Here is part of this algorithm, when the block of notes are ready to be printed. +% \begin{macrocode} + \ifdimequal{0pt}{\preXnotes@}{}% + {% + \iftoggle{preXnotes@}{% + \togglefalse{preXnotes@}% + \skip\csname #1footins\endcsname=% + \dimexpr\csuse{preXnotes@}+\csuse{Xafterrule@#1}\relax% + }% + {}% + }% + \vskip\skip\csname #1footins\endcsname% +% \end{macrocode} +% And now, the problem of left and right skip for notes. +% Especially when using one feature of \parpackage which allows to have the footnotes horizontal size as the size of columns printed by \cs{Columns}. +% Read \reff{width2columns} for the general description of the problem. +% \begin{macrocode} + \leftskip0pt \rightskip0pt + \ifl@dpairing\else% + \hsize=\old@hsize% + \fi% + \setXnoteswidthliketwocolumns@{#1}% + \setXnotespositionliketwocolumns@{#1}% +% \end{macrocode} +% And now, print the footnote's rule to finish the footnote's introduction. +% \begin{macrocode} + \print@Xfootnoterule{#1}% + \noindent\leavevmode} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\normalfootgroup} +% \cs{normalfootgroup} is +% a standard footnote-grouping macro: it sends the +% contents of the footnote-insert box to the output page without +% alteration. +% \begin{macrocode} +\newcommand*{\normalfootgroup}[1]{% + {\csuse{Xnotefontsize@#1}\noindent\csuse{Xtxtbeforenotes@#1}}% + \unvbox\csname #1footins\endcsname% + \hsize=\old@hsize% + }% + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\mpnormalfootgroup} +% A somewhat different version for minipages. +% Notes that, in this case, we don not make distinction between \cs{Xfootgroup} and \cs{Xfootstarts} macro. +% \changes{v0.4.0}{2004/02/29}{Added \cs{mpnormalfootgroup}} +% \begin{macrocode} +\unless\ifnoledgroup@ +\newcommand*{\mpnormalfootgroup}[1]{{ + \vskip\skip\@nameuse{mp#1footins} + \ifl@dpairing\ifparledgroup% + \leavevmode\marks\parledgroup@{begin}% + \marks\parledgroup@series{#1}% + \marks\parledgroup@type{Xfootnote}% + \fi\fi\normalcolor% + \ifparledgroup% + \ifl@dpairing% + \else% + \setXnoteswidthliketwocolumns@{#1}% + \setXnotespositionliketwocolumns@{#1}% + \print@Xfootnoterule{#1}%% + \fi% + \else% + \setXnoteswidthliketwocolumns@{#1}% + \setXnotespositionliketwocolumns@{#1}% + \print@Xfootnoterule{#1}%% + \fi% + \setlength{\parindent}{0pt} + {\csuse{Xnotefontsize@#1}\csuse{Xtxtbeforenotes@#1}} + \unvbox\csname mp#1footins\endcsname}} +\fi +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Paragraphed footnotes} +% +% The paragraphed-footnote option +% reformats all the footnotes of one series for a page into +% a single paragraph; this is especially appropriate when the notes are +% numerous and brief. The code is based +% on \thetexbook, pp.\,398--400, with +% alterations for our environment. This algorithm uses a considerable +% amount of save-stack space: a \TeX\ of ordinary size may not be able +% to handle more than about $100$ notes of this kind on a page. +% +% \begin{macro}{\Xarrangement@paragraph} +% The \cs{Xarrangement@paragraph} macro +% sets up everything for one series of the footnotes so that +% they will be paragraphed; it takes the series letter as argument. +% We include the setting of \verb"\count\footins" to $1000$ for the +% footnote series just in case user is switching to paragraphed +% footnotes after having columnar ones, since they change this +% value (see below). +% +% The argument of \cs{Xarrangement@footparagraph} is the letter +% denoting the series of notes to be paragraphed. +% \begin{macrocode} +\newcommand*{\Xarrangement@paragraph}[1]{% + \csgdef{series@display#1}{paragraph} + \expandafter\newcount\csname #1prevpage@num\endcsname + \expandafter\let\csname #1footstart\endcsname=\parafootstart + \expandafter\let\csname v#1footnote\endcsname=\paravfootnote + \expandafter\let\csname #1footfmt\endcsname=\parafootfmt + \expandafter\let\csname #1footgroup\endcsname=\parafootgroup + \count\csname #1footins\endcsname=1000 + \csxdef{default@#1footins}{1000}%Use this to confine the notes to one side only + \dimen\csname #1footins\endcsname=\csuse{Xmaxhnotes@#1} + \skip\csname #1footins\endcsname=\csuse{Xbeforenotes@#1}% + \advance\skip\csname #1footins\endcsname by\csuse{Xafterrule@#1}% + \para@footsetup{#1} +% \end{macrocode} +% And the extra setup for minipages. +% \begin{macrocode} + \ifnoledgroup@\else + \expandafter\let\csname mpv#1footnote\endcsname=\mpparavfootnote + \expandafter\let\csname mp#1footgroup\endcsname=\mpparafootgroup + \count\csname mp#1footins\endcsname=1000 + \dimen\csname mp#1footins\endcsname=\csuse{Xmaxhnotes@#1} + \skip\csname mp#1footins\endcsname=\csuse{Xbeforenotes@#1}% + \advance\skip\csname mp#1footins\endcsname by\csuse{Xafterrule@#1}% + \fi +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\footfudgefiddle} +% For paragraphed footnotes \TeX{} has to estimate the amount of space +% required. If it underestimates this then the notes may get too long and +% run off the bottom of the text block. \cs{footfudgefiddle} can be increased +% from its default 64 (say to 70) to increase the estimate. +% \changes{v0.2.2}{2003/11/04}{Added \cs{footfudgefiddle}} +% \begin{macrocode} +\providecommand{\footfudgefiddle}{64} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\para@footsetup} +% \cs{footparagraph} calls the +% \cs{para@footsetup} macro to calculate a special +% fudge factor, which is the ratio of the \cs{baselineskip} +% to the \cs{hsize}. We assume that the proper value of +% \cs{baselineskip} for the footnotes (normally 9\,pt) has been set +% already. The argument of the macro is +% again the note series letter. +% +% Peter Wilson thinks that \cs{columnwidth} should be used here for \LaTeX\, not \cs{hsize}. +% Peter Wilson have also included \cs{footfudgefiddle}. +% \changes{v0.2.2}{2003/11/04}{Added \cs{footfudgefiddle} to \cs{para@footsetup}} +% \begin{macrocode} +\newcommand*{\para@footsetup}[1]{{\csuse{Xnotefontsize@#1} + \setXnoteswidthliketwocolumns@{#1}% + \dimen0=\baselineskip + \multiply\dimen0 by 1024 + \divide \dimen0 by \columnwidth \multiply\dimen0 by \footfudgefiddle\relax + \csxdef{#1footfudgefactor}{% + \expandafter\strip@pt\dimen0 }}} + +% \end{macrocode} +% \end{macro} +% +% \cs{strip@pt} strip the characters \verb"pt" from a dimen value. +% +% \begin{macro}{\parafootstart} +% \cs{parafootstart} is the same as \cs{normalfootstart}, but we give it +% again to ensure that \cs{rightskip} and \cs{leftskip} are +% zeroed (this needs to be done before \cs{para@footgroup} in the +% output routine). The size of +% paragraphed notes is calculated using a fudge factor which in +% turn is based on \cs{hsize}. So the paragraph of notes needs to be +% that wide. +% +% The argument of the macro is again the note series letter. +% \begin{macrocode} +\newcommand*{\parafootstart}[1]{% + \rightskip=0pt \leftskip=0pt \parindent=0pt + \ifdimequal{0pt}{\preXnotes@}{}% + {% + \iftoggle{preXnotes@}{% + \togglefalse{preXnotes@}% + \skip\csname #1footins\endcsname=% + \dimexpr\csuse{preXnotes@}+\csuse{Xafterrule@#1}\relax% + }% + {}% + }% + \vskip\skip\csname #1footins\endcsname% + \setXnoteswidthliketwocolumns@{#1}% + \setXnotespositionliketwocolumns@{#1}% + \print@Xfootnoterule{#1}%% + \noindent\leavevmode} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\paravfootnote} +% \cs{paravfootnote} +% is a version of the \cs{vfootnote} command that is used for +% paragraphed notes. It gets appended to the \cs{inserts@list} list +% by an outer-level footnote command like \cs{Afootnote}. The first +% argument is the note series letter; the second is the full text +% of the printed note itself, including line numbers, lemmata, and +% footnote text. +% +% The initial model for this insertion is, of course, the +% \verb"\insert\footins" definition in \thetexbook, p.\,398. +% There, the footnotes are first collected up in hboxes, and these +% hboxes are later unpacked and stuck together into a paragraph. +% +% However, Michael Downes\index{Downes, Michael} has pointed out +% that because text in hboxes gets typeset in restricted horizontal +% mode, there are some undesirable side-effects if you later want +% to break such text across lines. In restricted horizontal mode, +% where \TeX\ does not expect to have to break lines, it does not +% insert certain items like \cs{discretionary}s. If you later unbox +% these hboxes and stick them together, as the \texbook{} +% macros do to make these footnotes, you lose the ability to +% hyphenate after an explicit hyphen. This can lead to overfull +% \cs{hbox}es when you would not expect to find them, and to the +% uninitiated it might be very hard to see why the problem had +% arisen.\footnote{Michael Downes, `Line Breaking in \cs{unhbox}ed +% Text', \textit{TUGboat} \textbf{11} (1990), pp.\,605--612.} +% +% Wayne Sullivan\index{Sullivan, Wayne} pointed out to us another +% subtle problem that arises from the same cause: \TeX\ also leaves +% the \cs{language} whatsit nodes out of the horizontal +% list.\footnote{See \thetexbook, p.\,455 (editions after +% January 1990).} So changes from one language to another will not +% invoke the proper hyphenation rules in such footnotes. Since +% critical editions often do deal with several languages, +% especially in a footnotes, we really ought to get this bit of code +% right. +% +% To get around these problems, Wayne suggested emendations to the +% \texbook{} versions of these macros which are broadly the +% same as those described by Michael: the central idea (also +% suggested by Donald Knuth in a letter to Michael) is to avoid collecting +% the text in an \cs{hbox} in the first place, but instead to collect +% it in a \cs{vbox} whose width is (virtually) +% infinite.\label{hboxproblem} The text is therefore typeset in +% unrestricted horizontal mode, as a paragraph consisting of a +% single long line. Later, there is an extra level of unboxing to +% be done: we have to unpack the \cs{vbox}, as well as the hboxes +% inside it, but that is not too hard. For details, we refer you to +% Michael's article, where the issues are clearly +% explained.\footnote{Wayne supplied his own macros to do this, but +% since they were almost identical to Michael's, Peter Wilson have used the +% latter's \cs{Xunvxh} macro since it is publicly +% documented.} Michael's unboxing macro is called \cs{Xunvxh}: unvbox, +% extract the last line, and unhbox it. +% +% Doing things this way has an important +% consequence:\label{nobreaks-detail} as Michael +% pointed out, you really can't put an explicit line-break into a +% note built in a \cs{vbox} the way we are doing.\footnote{`Line +% Breaking', p.\,610.} In other words, be very careful not to say +% \cs{break}, or \verb"\penalty-10000", or any equivalent inside your +% para-footnote.\label{nobreak} If you do, most of the note will +% probably disappear. You \emph{are} allowed to make strong +% suggestions; in fact \verb"\penalty-9999" will be quite okay. Just +% do not make the break mandatory. We have not applied any of +% Michael's solutions here, since we feel that the problem is +% exiguous, and \macpackage{} is quite baroque enough already. If +% you think you are having this problem, look up Michael's +% solutions. +% +% One more thing; we set \cs{leftskip} and \cs{rightskip} to zero. +% This has the effect of neutralizing any such skips which may +% apply to the main text (cf.~\reff{footskips} above). +% We need to do this, since \cs{footfudgefactor} is calculated on +% the assumption that the notes are \cs{hsize} wide. +% +% So, finally, here is the modified foot-paragraph code, which +% sets the footnote in vertical mode so that language and +% discretionary nodes are included. +% +% \begin{macrocode} +\newcommand*{\paravfootnote}[2]{% + \insert\csname #1footins\endcsname + \bgroup + \csuse{Xbhooknote@#1} + \csuse{Xnotefontsize@#1} + \footsplitskips + \setbox0=\vbox{\hsize=\maxdimen + \noindent\csname #1footfmt\endcsname #2{#1}}% + \setbox0=\hbox{\Xunvxh{0}{#1}}% + \dp0=0pt + \ht0=\csname #1footfudgefactor\endcsname\wd0 +% \end{macrocode} +% Here we produce the contents of the footnote from box $0$, and +% add a penalty of $0$ between boxes in this insert. +% \begin{macrocode} + \if@RTL\noindent \leavevmode\fi\box0% + \penalty0 + \egroup} + +% \end{macrocode} +% The final penalty of $0$ +% was added here at Wayne's\index{Sullivan, Wayne} +% suggestion to avoid a weird page-breaking problem, which occurs on +% those occasions when \TeX\ attempts to split foot paragraphs. +% After trying out such a split (see \thetexbook, p.\,124), +% \TeX\ inserts a penalty of $-10000$ here, which +% nearly always forces the break at the end of the whole footnote +% paragraph (since individual notes can't be split) even when this +% leads to an overfull vbox. The change above results in a penalty +% of $0$ instead which allows, but does not force, such breaks. This +% penalty of $0$ is later removed, after page breaks have been +% decided, by the \cs{unpenalty} macro in \cs{makehboxofhboxes}. So it +% does not affect how the footnote paragraphs are typeset (the +% notes still have a penalty of $-10$ between them, which is added +% by \cs{parafootfmt}). +% \end{macro} +% +% \begin{macro}{\mpparavfootnote} +% This version is for minipages. +% \begin{macrocode} +\newcommand*{\mpparavfootnote}[2]{% + \global\setbox\@nameuse{mp#1footins}\vbox{% + \unvbox\@nameuse{mp#1footins}% + \csuse{Xbhooknote@#1} + \csuse{Xnotefontsize@#1} + \footsplitskips + \setbox0=\vbox{\hsize=\maxdimen + \noindent\color@begingroup\csname #1footfmt\endcsname #2{#1}\color@endgroup}% + \setbox0=\hbox{\Xunvxh{0}{#1}}% + \dp0=\z@ + \ht0=\csname #1footfudgefactor\endcsname\wd0 + \box0 + \penalty0 +}} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Xunvxh} +% Here is (modified) Michael's\index{Downes, Michael} definition of \cs{unvxh}, +% used above. Michael's macro also takes care to remove some +% unwanted penalties and glue that \TeX\ automatically attaches to +% the end of paragraphs. When \TeX\ finishes a paragraph, it +% throws away any remaining glue, and then tacks on the following +% items: a \cs{penalty} of $10000$, a \cs{parfillskip} and a +% \cs{rightskip} (\thetexbook, pp.\,99--100). \cs{unvxh} +% cancels these unwanted paragraph-final items using \cs{unskip} and +% \cs{unpenalty}. +% \begin{macrocode} +\newcommand*{\Xunvxh}[2]{% + \setbox0=\vbox{\unvbox#1% + \global\setbox1=\lastbox}% + \unhbox1 + \unskip % remove \rightskip, + \unskip % remove \parfillskip, + \unpenalty % remove \penalty of 10000, + \hskip\csuse{Xafternote@#2}} % but add the glue to go between the notes + +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\parafootfmt} +% \cs{parafootfmt} is +% \cs{normalfootfmt} adapted to do the special stuff +% needed for paragraphed notes---leaving out the \cs{endgraf} at the +% end, sticking in special penalties and kern, and leaving out the +% \cs{footstrut}. The first argument is the line and page +% number information, the second is the lemma, the third is the +% text of the footnote, and the fourth is the series (optional, for backward compatibility). +% \begin{macrocode} +\newcommand*{\parafootfmt}[4]{% + \Xinsertparafootsep{#4}% + \Xledsetnormalparstuff{#4}% + \printlinefootnote{#1}{#4}% + {\nottoggle{Xlemmadisablefontselection@#4}{\select@lemmafont#1|#2}{#2}}% + \iftoggle{nosep@}{\hskip\csuse{Xinplaceoflemmaseparator@#4}}{\ifcsempty{Xlemmaseparator@#4}% + {\hskip\csuse{Xinplaceoflemmaseparator@#4}}% + {\nobreak\hskip\csuse{Xbeforelemmaseparator@#4}\csuse{Xlemmaseparator@#4}\hskip\csuse{Xafterlemmaseparator@#4}% + }}% + #3\penalty-10 } +% \end{macrocode} +% Note that in the above definition, the penalty of $-10$ +% encourages a line break between notes, so that notes have a +% slight tendency to begin on new lines. +% The \cs{Xinsertparafootsep} command is used to insert the \cs{Xparafootsep@series} between each note in the \emph{same} page. +% \end{macro} +% +% \begin{macro}{\parafootgroup} +% This \verb"footgroup" code is modelled on the macros in +% \thetexbook, p.\,399. The only difference is the \cs{unpenalty} +% in \cs{makehboxofhboxes}, which is there to remove the penalty of +% $0$ which was added to the end of each footnote by +% \cs{para@vfootnote}. +% +% The call to \cs{Xnotefontsize@\meta{s}} is to ensure that the correct +% \cs{baselineskip} for the footnotes is used. The argument is the +% note series letter. +% \begin{macrocode} +\newcommand*{\parafootgroup}[1]{% + \unvbox\csname #1footins\endcsname + \ifcsstring{Xragged@#1}{L}{\RaggedLeft}{}% + \ifcsstring{Xragged@#1}{R}{\RaggedRight}{}% + \makehboxofhboxes + \setbox0=\hbox{{\csuse{Xnotefontsize@#1}\csuse{Xtxtbeforenotes@#1}}\unhbox0 \removehboxes}% + \csuse{Xnotefontsize@#1} + \noindent\unhbox0\par% + \global\hsize=\old@hsize% + }% + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\mpparafootgroup} +% The minipage version. +% \begin{macrocode} +\newcommand*{\mpparafootgroup}[1]{{% + \setXnoteswidthliketwocolumns@{#1}% + \vskip\skip\@nameuse{mp#1footins} + \ifl@dpairing\ifparledgroup% + \leavevmode\marks\parledgroup@{begin}% + \marks\parledgroup@series{#1}% + \marks\parledgroup@type{Xfootnote}% + \fi\fi\normalcolor + \ifparledgroup% + \ifl@dpairing% + \else% + \setXnoteswidthliketwocolumns@{#1}% + \setXnotespositionliketwocolumns@{#1}% + \print@Xfootnoterule{#1}%% + \fi% + \else% + \setXnoteswidthliketwocolumns@{#1}% + \setXnotespositionliketwocolumns@{#1}% + \print@Xfootnoterule{#1}% + \fi% + \unvbox\csname mp#1footins\endcsname + \ifcsstring{Xragged@#1}{L}{\RaggedLeft}{}% + \ifcsstring{Xragged@#1}{R}{\RaggedRight}{}% + \makehboxofhboxes + \setbox0=\hbox{{\csuse{Xnotefontsize@#1}\csuse{Xtxtbeforenotes@#1}}\unhbox0 \removehboxes}% + \csuse{Xnotefontsize@#1} + \noindent\unhbox0\par}} + +% \end{macrocode} +% \end{macro} +% +% And finally, the two macros which are required to transform the long horizontal box stored in the insert' box to a printable text. +% +% \begin{macro}{\makehboxofhboxes} +% \begin{macro}{\removehboxes} +% \begin{macrocode} +\newcommand*{\makehboxofhboxes}{\setbox0=\hbox{}% + \loop + \unpenalty + \setbox2=\lastbox + \ifhbox2 + \setbox0=\hbox{\box2\unhbox0}% + \repeat} + +\newcommand*{\removehboxes}{\setbox0=\lastbox + \ifhbox0{\removehboxes}\unhbox0 \fi} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \paragraph{Insertion of the footnotes separator} +%The command \cs{Xinsertparafootsep}\marg{series} must be called at the beginning of \cs{parafootftm}. +% \begin{macro}{\prevpage@num} +% \changes{v1.8.0}{2013/12/13}{Correct \cs{parafootsep} when using with ledgroup.} +% \changes{v1.22.1}{2015/04/29}{Correct double symbol when using both \cs{parafootsep} and \cs{Xsymlinenum}.} +% \begin{macro}{\Xinsertparafootsep} +% \begin{macrocode} +\newcommand{\Xinsertparafootsep}[1]{% + \ifnumequal{\csuse{#1prevpage@num}}{\page@num}% + {\ifcsdef{prevline#1}% Be sur \prevline#1 exists. + {\ifnumequal{\csuse{prevline#1}}{\line@num}% + {\ifcsempty{Xsymlinenum@#1}{\csuse{Xparafootsep@#1}}{}}% + {\csuse{Xparafootsep@#1}}% + }% + {\csuse{Xparafootsep@#1}}% + }% + {}% + \global\csname #1prevpage@num\endcsname=\page@num% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \subsubsection{Columnar footnotes} +% +% \paragraph{Common tools} +% \begin{macro}{\rigidbalance} +% \begin{macro}{\dosplits} +% \begin{macro}{\splitoff} +% \begin{macro}{\@h} +% \begin{macro}{\@k} +% We will now define macros for three-column notes and two-column +% notes. Both sets of macros will use \cs{rigidbalance}, which splits a +% box (\verb"#1") into into a number (\verb"#2") of columns, each +% with a space (\verb"#3") between the top baseline and the top of +% the \cs{vbox}. The \cs{rigidbalance} macro is taken from +% \thetexbook, p.\,397, with a slight change to the syntax of +% the arguments so that they do not depend on white space. Note also +% the extra unboxing in \cs{splitoff}, which allows the new \cs{vbox} to +% have its natural height as it goes into the alignment. +% +% The \LaTeX\ \cs{line} macro has no relationship to the +% TeX \cs{line}. The \LaTeX\ equivalent is \cs{@@line}. +% \begin{macrocode} +\newcount\@k \newdimen\@h +\newcommand*{\rigidbalance}[3]{\setbox0=\box#1 \@k=#2 \@h=#3 + \@@line{\splittopskip=\@h \vbadness=\@M \hfilneg + \valign{##\vfil\cr\dosplits}}} + +\newcommand*{\dosplits}{\ifnum\@k>0 \noalign{\hfil}\splitoff + \global\advance\@k-1\cr\dosplits\fi} + +\newcommand*{\splitoff}{\dimen0=\ht0 + \divide\dimen0 by\@k \advance\dimen0 by\@h + \setbox2 \vsplit0 to \dimen0 + \unvbox2 } + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \paragraph{Three columns} +% +% \begin{macro}{\Xarrangement@threecol} +% \begin{macrocode} +\newcommand*{\Xarrangement@threecol}[1]{% + \csgdef{series@display#1}{threecol} + \expandafter\let\csname v#1footnote\endcsname=\threecolvfootnote + \expandafter\let\csname #1footfmt\endcsname=\threecolfootfmt + \expandafter\let\csname #1footgroup\endcsname=\threecolfootgroup + \dimen\csname #1footins\endcsname=\csuse{Xmaxhnotes@#1}% + \skip\csname #1footins\endcsname=\csuse{Xbeforenotes@#1}% + \advance\skip\csname #1footins\endcsname by\csuse{Xafterrule@#1}% + \threecolfootsetup{#1} +% \end{macrocode} +% The additional setup for minipages. +% \begin{macrocode} + \ifnoledgroup@\else + \expandafter\let\csname mpv#1footnote\endcsname=\mpnormalvfootnote + \expandafter\let\csname mp#1footgroup\endcsname=\mpthreecolfootgroup + \skip\csname mp#1footins\endcsname=\csuse{Xbeforenotes@#1}% + \advance\skip\csname mp#1footins\endcsname by\csuse{Xafterrule@#1}% + \mpthreecolfootsetup{#1} + \fi +} + +% \end{macrocode} +% The \cs{footstart} and \cs{footnoterule} macros for these notes assume +% the normal values (\reff{normalvalues} above). +% \end{macro} +% +% \begin{macro}{\threecolfootsetup} +% The \cs{threecolfootsetup} macro calculates and sets some numbers +% for three-column footnotes. +% +% We set the \cs{count} of the foot insert to $333$. +% Each footnote can be thought of as contributing only one third of +% its height to the page, since the footnote insertion has been +% made as a long narrow column, which then gets trisected by the +% \cs{rigidbalance} routine (inside \cs{threecolfootgroup}). +% These new, shorter columns are saved in a box, and then that box +% is \emph{put back} into the footnote insert, replacing the +% original collection of the footnotes. This new box is, therefore, +% only about a third of the height of the original one. +% +% The \cs{dimen} value for this note series has to change in the +% inverse way: it needs to be three times +% the actual limit on the amount of space these notes are allowed to +% fill on the page, because when \TeX\ is +% accumulating material for the page +% and checking that limit, it does not apply the \cs{count} scaling. +% \begin{macrocode} +\newcommand*{\threecolfootsetup}[1]{% + \count\csname #1footins\endcsname 333 + \csxdef{default@#1footins}{333}%Use this to confine the notes to one side only + \multiply\dimen\csname #1footins\endcsname \thr@@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\mpthreecolfootsetup} +% The setup for minipages. +% \begin{macrocode} +\newcommand*{\mpthreecolfootsetup}[1]{% + \count\csname mp#1footins\endcsname 333 + \multiply\dimen\csname mp#1footins\endcsname \thr@@} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\threecolvfootnote} +% \cs{threecolvfootnote} +% is the \cs{vfootnote} command for three-column notes. The +% call to \cs{Xnotefontsize@\meta{s}} ensures that the +% \cs{splittopskip} and \cs{splitmaxdepth} take their values +% from the right \cs{strutbox}: the one used in a footnotes. +% Note especially the importance of temporarily reducing the +% \cs{hsize} to $0.3$ of its normal value. This determines the +% widths of the individual columns. So if the normal \cs{hsize} +% is, say, 10\,cm, then each column will be $0.3\times10=3$\,cm +% wide, leaving a gap of 1\,cm spread equally between columns +% (i.e., .5\,cm between each). +% +% The arguments are \verb+#1+~the note series letter and \verb+#1+~the full text +% of the note (including numbers, lemma and text). +% \begin{macrocode} +\notbool{parapparatus@}{\newcommand*}{\newcommand}{\threecolvfootnote}[2]{% + \insert\csname #1footins\endcsname\bgroup + \csuse{Xnotefontsize@#1} + \footsplitskips + \csname #1footfmt\endcsname #2{#1}\egroup} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\threecolfootfmt} +% \cs{threecolfootfmt} +% is the command that formats one note. +% The arguments are \verb+#1+~the line numbers, \verb+#2+~the lemma and \verb+#4+~the +% text of the \verb"-footnote" command \verb+#4+ optional (for backward compatibility): the series. +% +% \begin{macrocode} +\notbool{parapparatus@}{\newcommand*}{\newcommand}{\threecolfootfmt}[4]{% + \normal@pars + \hsize \csuse{Xhsizethreecol@#4} + \nottoggle{Xparindent@#4}{\parindent=\z@}{} + \tolerance=5000 + \hangindent=\csuse{Xhangindent@#4} + \leavevmode + \csuse{Xcolalign@#4}% + \strut{\printlinefootnote{#1}{#4}}% + {\nottoggle{Xlemmadisablefontselection@#4}{\select@lemmafont#1|#2}{#2}}% + \iftoggle{nosep@}{\hskip\csuse{Xinplaceoflemmaseparator@#4}}{\ifcsempty{Xlemmaseparator@#4}% + {\hskip\csuse{Xinplaceoflemmaseparator@#4}}% + {\nobreak\hskip\csuse{Xbeforelemmaseparator@#4}\csuse{Xlemmaseparator@#4}\hskip\csuse{Xafterlemmaseparator@#4}% + }}% + #3\strut\par\allowbreak} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\threecolfootgroup} +% And here is the \verb"footgroup" macro that is called within the +% output routine to regroup the notes into three columns. Once +% again, the call to \cs{Xnotefontsize@\meta{s}} is there to ensure that +% it is the right \cs{splittopskip}---the one used in +% footnotes---which is used to provide the third argument for +% \cs{rigidbalance}. This third argument (\cs{@h}) is the +% \verb"topskip" for the box containing the text of the +% footnotes, and does the job of making sure the top lines of the +% columns line up horizontally. In \thetexbook, p.\,398, +% Donald Knuth suggests retrieving the ouput of \cs{rigidbalance}, +% putting it back into the insertion box, and then printing the +% box. Here, we just print the \cs{line} which comes out of +% \cs{rigidbalance} directly, without any re-boxing. +% \begin{macrocode} +\newcommand*{\threecolfootgroup}[1]{{\csuse{Xnotefontsize@#1}% + \noindent\csuse{Xtxtbeforenotes@#1}\par% + \splittopskip=\ht\strutbox + \expandafter + \rigidbalance\csname #1footins\endcsname \thr@@ \splittopskip}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\mpthreecolfootgroup} +% The setup for minipages. +% \begin{macrocode} +\newcommand*{\mpthreecolfootgroup}[1]{{% + \vskip\skip\@nameuse{mp#1footins} + \ifl@dpairing\ifparledgroup% + \leavevmode\marks\parledgroup@{begin}% + \marks\parledgroup@series{#1}% + \marks\parledgroup@type{Xfootnote}% + \fi\fi\normalcolor + \ifparledgroup% + \ifl@dpairing% + \else% + \setXnoteswidthliketwocolumns@{#1}% + \setXnotespositionliketwocolumns@{#1}% + \print@Xfootnoterule{#1}% + \fi% + \else% + \setXnoteswidthliketwocolumns@{#1}% + \setXnotespositionliketwocolumns@{#1}% + \print@Xfootnoterule{#1}% + \fi% + {\csuse{Xnotefontsize@#1}\noindent\csuse{Xtxtbeforenotes@#1}}\par + \splittopskip=\ht\strutbox + \expandafter + \rigidbalance\csname mp#1footins\endcsname \thr@@ \splittopskip}} + +% \end{macrocode} +% \end{macro} +% \paragraph{Two columns} +% +% \begin{macro}{\Xarrangement@twocol} +% \begin{macrocode} +\newcommand*{\Xarrangement@twocol}[1]{% + \csgdef{series@display#1}{twocol} + \expandafter\let\csname v#1footnote\endcsname=\twocolvfootnote + \expandafter\let\csname #1footfmt\endcsname=\twocolfootfmt + \expandafter\let\csname #1footgroup\endcsname=\twocolfootgroup + \dimen\csname #1footins\endcsname=\csuse{Xmaxhnotes@#1}% + \skip\csname #1footins\endcsname=\csuse{Xbeforenotes@#1}% + \advance\skip\csname #1footins\endcsname by\csuse{Xafterrule@#1}% + \twocolfootsetup{#1} +% \end{macrocode} +% The additional setup for minipages. +% \begin{macrocode} + \ifnoledgroup@\else + \expandafter\let\csname mpv#1footnote\endcsname=\mpnormalvfootnote + \expandafter\let\csname mp#1footgroup\endcsname=\mptwocolfootgroup + \skip\csname mp#1footins\endcsname=\csuse{Xbeforenotes@#1}% + \advance\skip\csname mp#1footins\endcsname by\csuse{Xafterrule@#1}% + \mptwocolfootsetup{#1} + \fi +} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\twocolfootsetup} +% \begin{macro}{\twocolvfootnote} +% \begin{macro}{\twocolfootfmt} +% \begin{macro}{\twocolfootgroup} +% Here is a series of macros which are very similar to their +% three-column counterparts. In this case, +% each note is assumed to contribute only a half a line of text. +% And the notes are set in columns +% giving a gap between them of one tenth +% of the \cs{hsize}. +% \begin{macrocode} +\newcommand*{\twocolfootsetup}[1]{% + \count\csname #1footins\endcsname 500 + \csxdef{default@#1footins}{500}%Use this to confine the notes to one side only + \multiply\dimen\csname #1footins\endcsname \tw@} +% \end{macrocode} +% \begin{macrocode} +\notbool{parapparatus@}{\newcommand*}{\newcommand}{\twocolvfootnote}[2]{\insert\csname #1footins\endcsname\bgroup + \csuse{Xnotefontsize@#1} + \footsplitskips + \csname #1footfmt\endcsname #2{#1}\egroup} +% \end{macrocode} +% \begin{macrocode} +\notbool{parapparatus@}{\newcommand*}{\newcommand}{\twocolfootfmt}[4]{% 4th arg is optional, for backward compatibility + \normal@pars + \hsize \csuse{Xhsizetwocol@#4} + \nottoggle{Xparindent@#4}{\parindent=\z@}{} + \tolerance=5000 + \hangindent=\csuse{Xhangindent@#4} + \leavevmode + \csuse{Xcolalign@#4}% + \strut{\printlinefootnote{#1}{#4}}% + {\nottoggle{Xlemmadisablefontselection@#4}{\select@lemmafont#1|#2}{#2}}% + \iftoggle{nosep@}{\hskip\csuse{Xinplaceoflemmaseparator@#4}}{\ifcsempty{Xlemmaseparator@#4}% + {\hskip\csuse{Xinplaceoflemmaseparator@#4}}% + {\nobreak\hskip\csuse{Xbeforelemmaseparator@#4}\csuse{Xlemmaseparator@#4}\hskip\csuse{Xafterlemmaseparator@#4}% + }}% + #3\strut\par\allowbreak} +% \end{macrocode} +% \begin{macrocode} +\newcommand*{\twocolfootgroup}[1]{{\csuse{Xnotefontsize@#1} + \noindent\csuse{Xtxtbeforenotes@#1}\par% + \splittopskip=\ht\strutbox + \expandafter + \rigidbalance\csname #1footins\endcsname \tw@ \splittopskip}} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\mptwocolfootsetup} +% \begin{macro}{\mptwocolfootgroup} +% The versions for minipages. +% \begin{macrocode} +\newcommand*{\mptwocolfootsetup}[1]{% + \count\csname mp#1footins\endcsname 500 + \multiply\dimen\csname mp#1footins\endcsname \tw@} +% \end{macrocode} +% \begin{macrocode} +\newcommand*{\mptwocolfootgroup}[1]{{% + \vskip\skip\@nameuse{mp#1footins} + \ifl@dpairing\ifparledgroup% + \leavevmode\marks\parledgroup@{begin}% + \marks\parledgroup@series{#1}% + \marks\parledgroup@type{Xfootnote}% + \fi\fi\normalcolor + \ifparledgroup% + \ifl@dpairing% + \else% + \setXnoteswidthliketwocolumns@{#1}% + \setXnotespositionliketwocolumns@{#1}% + \print@Xfootnoterule{#1}% + \fi% + \else% + \setXnoteswidthliketwocolumns@{#1}% + \setXnotespositionliketwocolumns@{#1}% + \print@Xfootnoterule{#1}% + \fi% + {\csuse{Xnotefontsize@#1}\noindent\csuse{Xtxtbeforenotes@#1}}\par + \splittopskip=\ht\strutbox + \expandafter + \rigidbalance\csname mp#1footins\endcsname \tw@ \splittopskip}} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \subsection{Critical notes presentation} +% Here, we define some commons macro which are used in order to print a critical notes, that is a note with 1) line number 2) lemma 3) lemma separator 4) text associated to the lemma. + +% \subsubsection{Font tools} +% \begin{macro}{\endashchar} +% \begin{macro}{\fullstop} +% \begin{macro}{\rbracket} +% The fonts that are used for printing notes might not have the +% character mapping we expect: for example, the Computer Modern font +% that contains old-style numerals does not contain an en-dash or +% square brackets, and its period and comma are in odd locations. +% To allow use of the standard footnote macros with such fonts, we use +% the following macros for certain characters. +% +% The \cs{endashchar} macro is simply an en-dash from the +% normal font and is immune to changes in the surrounding +% font. The same goes for the full stop. These two are used in +% \cs{printlines}. The right bracket macro is the same again; +% it crops up in \cs{normalfootfmt} and the other footnote +% macros for controlling the format of the footnotes. +% +% With \Lpack{polyglossia}, each critical note has a \cs{footnote@lang} which shows the language of the lemma, +% and which can be used to switch the bracket from right to left. +% \changes{v1.4.0}{2012/11/16}{Switch the right bracket to a left bracket when the lemma is RTL (needs polyglossia or LuaTeX).} +% \begin{macrocode} +\def\endashchar{\textnormal{--}} +\newcommand*{\fullstop}{\textnormal{.}} +\newcommand*{\rbracket}{\textnormal{% + \csuse{text\csuse{footnote@lang}}{% + \ifluatex% + \ifdefstring{\footnote@luatextextdir}{TRT}{\thinspace[}{\thinspace]}% + \else% + \thinspace]% + \fi}% + }% +} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsubsection{Pstart number in footnote} +% \begin{macro}{\printpstart} +% The \cs{printpstart} macro prints the pstart number for a note. +% \changes{v1.18.0}{2015/02/23}{Debug \cs{Xpstart} with parallel pages and columns (eledpar)} +% \begin{macrocode} +\newcommand{\printpstart}[0]{% + \ifboolexpr{bool{l@dpairing} or bool{l@dprintingpages} or bool{l@dprintingcolumns}}{% + \ifledRcol% + \thepstartR% + \else% + \thepstartL% + \fi% + }{% + \thepstart% + }% +} +% \end{macrocode} +% +% \end{macro} +% \subsubsection{Line number printing} +% \begin{macro}{\printlinefootnote} +% The \cs{printlinefootnote} macro is called in each \cs{<type>footfmt} command. +% It controls whether the line number is printed or not, according to the series options. Its first argument is the information about lines; its second is the series of the footnote. +% The printing of the line number is shared in +% \cs{printlinefootnotenumbers}. +% \changes{v1.18.0}{2015/02/23}{Code refactoring in \cs{printlinefootnote}: the printing of the numbers are factorized in \cs{printlinefootnotearea}} +% \begin{macrocode} +\newcommand{\printlinefootnote}[2]{% + \def\extractline@##1|##2|##3|##4|##5|##6|##7|{##2}% + \def\extractsubline@##1|##2|##3|##4|##5|##6|##7|{##3}% + \def\extractendline@##1|##2|##3|##4|##5|##6|##7|{##5}% + \def\extractendsubline@##1|##2|##3|##4|##5|##6|##7|{##6}% + \iftoggle{Xnumberonlyfirstintwolines@#2}{% + \edef\lineinfo@{\extractline@ #1| - \extractsubline@ #1| - \extractendline@ #1| - \extractendsubline@ #1|}% + }% + {% + \edef\lineinfo@{\extractline@ #1| - \extractsubline@ #1|}% + }% + \iftoggle{nonum@}{%Try if the line number must printed for this specific not (by default, yes) + \hspace{\csuse{Xinplaceofnumber@#2}}% + }% + {% + {% + \iftoggle{Xnonumber@#2}%Try if the line number must printed (by default, yes) + {% + \hspace{\csuse{Xinplaceofnumber@#2}}% + }% + {% + {\iftoggle{Xnumberonlyfirstinline@#2}% If for this series the line number must be printed only in the first time. + {% + \ifcsdef{prevline#2}% + {%Be sure the \prevline exists. + \ifcsequal{prevline#2}{lineinfo@}%Try it + {% + \ifcsempty{Xsymlinenum@#2}% + {% + \hspace{\csuse{Xinplaceofnumber@#2}}% + }% + {\hspace{\csuse{Xbeforesymlinenum@#2}}\csuse{Xnotenumfont@#2}% + \ifdimequal{\csuse{Xboxsymlinenum@#2}}{0pt}% + {\csuse{Xsymlinenum@#2}}% + {\hbox to \csuse{Xboxsymlinenum@#2}{\csuse{Xsymlinenum@#2}\hfill}}% + \hspace{\csuse{Xaftersymlinenum@#2}}}% + }% + {% + \printlinefootnotearea{#1}{#2}% + }% + }% + {% + \printlinefootnotearea{#1}{#2}% + }% + }% + {% + \printlinefootnotearea{#1}{#2}% + }% + \csxdef{prevline#2}{\lineinfo@}% + }% + }% + }% + }% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\printlinefootnotearea} +% This macro prints the space before the line number, changes the font, then prints the line number and the space after it. +% It is called by \cs{printlinefootnote} +% depending of the options about repeating line numbers. +% The first argument is line information, the second is the notes series (A, B, C, etc.) +% \begin{macrocode} +\newcommand{\printlinefootnotearea}[2]{% + \printXbeforenumber{#2}% + \csuse{Xnotenumfont@#2}% + \boxfootnotenumbers{#1}{#2}% + \printXafternumber{#2}% +}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\boxfootnotenumbers} +% Depending on the user settings, this macro will box line numbers (or not). +% The first argument is line information, the second is the notes series (A, B, C, etc.) +% The previous \cs{printlinefootnotearea} calls it. +% \begin{macrocode} +\newcommand{\boxfootnotenumbers}[2]{% + \ifdimequal{\csuse{Xboxlinenum@#2}}{0pt}{% + \printlinefootnotenumbers{#1}{#2}% + }% + {% + \hbox to \csuse{Xboxlinenum@#2}% + {% + \IfSubStr{RC}{\csuse{Xboxlinenumalign@#2}}{\hfill}{}% + \printlinefootnotenumbers{#1}{#2}% + \IfSubStr{LC}{\csuse{Xboxlinenumalign@#2}}{\hfill}{}% + }% + }% +}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\printlinefootnotenumbers} +% This macro prints, if needed, the pstart number and the line number. +% The first argument is line information, the second is the notes series (A, B, C, etc.) +% The previous \cs{boxlinefootnote} calls it. +% \begin{macrocode} +\newcommand{\printlinefootnotenumbers}[2]{% + \xdef\@currentseries{#2}% + \ifboolexpr{% + (togl{Xpstart@#2} and bool{numberpstart})% + or togl{Xpstarteverytime@#2}}% + {\printpstart}{}% + \iftoggle{Xonlypstart@#2}{}{\printlines#1|}% +}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\printXbeforenumber} +% This macro prints a space (before the line number) in footnote. +% It is called by \cs{printlinefootnotearea}. +% Its only argument is the note series (A, B, C, etc.) +% \begin{macrocode} +\newcommand{\printXbeforenumber}[1]{% + \hspace{\csuse{Xbeforenumber@#1}}% +}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\printXafternumber} +% This macro prints the space, adding eventually a \cs{nobreak}, after the line number, in footnote. +% It is called by \cs{printlinefootnotearea}. +% Its only argument is the series +% \begin{macrocode} +\newcommand{\printXafternumber}[1]{% + \iftoggle{Xnonbreakableafternumber@#1}{\nobreak}{}% + \hspace{\csuse{Xafternumber@#1}}% +}% +% \end{macrocode} +% \end{macro} +% +% If we have decided to print the line number in a specific notes, the \cs{printlines} macro prints the line +% numbers for a note---which, in the +% general case, is a rather complicated task. +% The seven parameters of the +% argument are the line numbers as stored in \cs{l@d@nums}, in the +% form described on \reff{linenumbers}: the starting +% page, line, and sub-line numbers, followed by the ending page, +% line, and sub-line numbers, and then the font specifier for +% the lemma. +% +% \edmac' creator have defined six boolean in order to know which component of line number description we have to print: +% \begin{itemize} +% \item \cs{ifl@d@pnum} for page numbers; +% \item \cs{ifl@d@ssub} for starting sub-line; +% \item \cs{ifl@d@elin} for ending line; +% \item \cs{ifl@d@esl} for ending sub-line; and +% \item \cs{ifl@d@dash} for the dash between the starting and ending groups. +% \end{itemize} +% There is no boolean for the line number because it is always printed. +% +% Maïeul Rouquette has added \cs{ifl@d@Xtwolines} and \cs{ifl@d@Xmorethantwolines} +% to print a symbol which stands for ``and subsequent`` when there are two, three or more lines. +% \begin{macro}{\ifl@d@pnum} +% \begin{macro}{\ifl@d@ssub} +% \begin{macro}{\ifl@d@elin} +% \begin{macro}{\ifl@d@esl} +% \begin{macro}{\ifl@d@dash} +% \begin{macro}{\ifl@d@Xtwolines} +% \begin{macro}{\ifl@d@Xmorethantwolines} +% \begin{macrocode} +\newif\ifl@d@pnum +\newif\ifl@d@ssub +\newif\ifl@d@elin +\newif\ifl@d@esl +\newif\ifl@d@dash +\newif\ifl@d@Xtwolines% +\newif\ifl@d@Xmorethantwolines% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\l@dparsefootspec} +% \begin{macro}{\l@dp@rsefootspec} +% \begin{macro}{\l@dparsedstartpage} +% \begin{macro}{\l@dparsedstartline} +% \begin{macro}{\l@dparsedstartsub} +% \begin{macro}{\l@dparsedendpage} +% \begin{macro}{\l@dparsedendline} +% \begin{macro}{\l@dparsedendsub} +% \cs{l@dparsefootspec}\marg{spec}\marg{lemma}\marg{text} parses a footnote +% specification. \meta{lemma} and \meta{text} are the lemma and text +% respectively. \meta{spec} is the line and page number and lemma font +% specifier in \cs{l@d@nums} style format. The real work is done +% by \cs{l@dp@rsefootspec} which defines macros holding the numeric values. +% Just a reminder of the arguments: \\ +% \verb?\printlines #1 | #2 | #3 | #4 | #5 | #6 | #7? \\ +% \verb?\printlines start-page | line | subline | end-page | line | subline | font ? +% \begin{macrocode} +\newcommand*{\l@dparsefootspec}[3]{\l@dp@rsefootspec#1|} +\def\l@dp@rsefootspec#1|#2|#3|#4|#5|#6|#7|{% + \gdef\l@dparsedstartpage{#1}% + \gdef\l@dparsedstartline{#2}% + \gdef\l@dparsedstartsub{#3}% + \gdef\l@dparsedendpage{#4}% + \gdef\l@dparsedendline{#5}% + \gdef\l@dparsedendsub{#6}% +} +% \end{macrocode} +% Initialise the several number value macros. +% \begin{macrocode} +\def\l@dparsedstartpage{0}% +\def\l@dparsedstartline{0}% +\def\l@dparsedstartsub{0}% +\def\l@dparsedendpage{0}% +\def\l@dparsedendline{0}% +\def\l@dparsedendsub{0}% + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% +% \begin{macro}{\setprintlines} +% +% The macro \cs{setprintlines} does the work of deciding what numbers should +% be printed. Its arguments are the same as the first 6 of \cs{printlines}. +% \changes{v0.7.0}{2005/02/18}{Added \cs{setprintlines} for use by \cs{printlines}} +% \begin{macrocode} +\newcommand*{\setprintlines}[6]{% + \l@d@pnumfalse \l@d@dashfalse +% \end{macrocode} +% We print the page numbers only if\/: 1)~we are doing +% the lineation by page, and 2)~the ending page number is different +% from the starting page number.\label{printlines}a +% \begin{macrocode} + \ifbypage@ + \ifnum#4=#1 \else + \l@d@pnumtrue + \l@d@dashtrue + \fi + \fi +% \end{macrocode} +% +% We print the ending line number if\/: (1)~we are printing the ending +% page number, or (2)~it is different from the starting line number. +% \begin{macrocode} + \ifl@d@pnum \l@d@elintrue \else \l@d@elinfalse \fi + \ifnum#2=#5 \else + \l@d@elintrue + \l@d@dashtrue + \fi +% \end{macrocode} +% +% We print the starting sub-line if it is nonzero. +% \begin{macrocode} + \l@d@ssubfalse + \ifnum#3=0 \else + \l@d@ssubtrue + \fi +% \end{macrocode} +% +% We print the ending sub-line if it is nonzero and: (1)~it is different +% from the starting sub-line number, or (2)~the ending line number is +% being printed. +% \begin{macrocode} + \l@d@eslfalse + \ifnum#6=0 \else + \ifnum#6=#3 + \ifl@d@elin \l@d@esltrue \else \l@d@eslfalse \fi + \else + \l@d@esltrue + \l@d@dashtrue + \fi + \fi% +% \end{macrocode} +% However, if the \cs{Xtwolines} is set for the current series, we do not print the last line number. +% \begin{macrocode} + \ifl@d@dash% + \ifboolexpr{togl{fulllines@} or test{\ifcsempty{Xtwolines@\@currentseries}}}% + {}% + {% + \setistwofollowinglines{#1}{#2}{#4}{#5}% + \ifboolexpr{% + (% + togl {Xtwolinesbutnotmore@\@currentseries}% + and not% + (% + bool {istwofollowinglines@}% + )% + )% + or% + (% + (not test{\ifnumequal{#1}{#4}})% + and togl{Xtwolinesonlyinsamepage@\@currentseries}% + )% + }% + {}% + {% + \l@d@dashfalse% + \l@d@Xtwolinestrue% + \l@d@elinfalse% + \l@d@eslfalse% + \ifcsempty{Xmorethantwolines@\@currentseries}% + {}% + {\ifistwofollowinglines@\else% + \l@d@Xmorethantwolinestrue% + \fi% + }% + }% + }% + \fi% +% \end{macrocode} +% End of \cs{setprintlines}. +% \begin{macrocode} +}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\setistwofollowinglines} +% The \cs{ifistwofollowinglines} boolean, used by the \cs{Xtwolines} and related setting, is set to true by \cs{setistwofollowinglines}. +% This command takes the following arguments: +% \begin{itemize} +% \item \verb+#1+ First page number. +% \item \verb+#2+ First line number. +% \item \verb+#3+ Last page number. +% \item \verb+#4+ Last line number. +% \end{itemize} +% If \verb+#3+-\verb+#2+ = 1, then that means the two lines are subsequent, and consequently \cs{ifistwofollowinglines} is set to true. +% However, if we use lineation by page, two given lines can be subsequent if: +% \begin{itemize} +% \item The first line number is equal to the last line number of the first page. +% \item The last line number is equal to 1. +% \item \verb+#3+-\verb+#1+ is equal to 1. +% \end{itemize} +% \begin{macrocode} +\newif\ifistwofollowinglines@% +\newcommand{\setistwofollowinglines}[4]{% + \ifcsdef{lastlinenumberon@#1}% + {\numdef{\tmp}{\csuse{lastlinenumberon@#1}}}% + {\numdef{\tmp}{0}}% + \istwofollowinglines@false% + \ifnumequal{#4-#2}{1}% + {\istwofollowinglines@true}% + {\ifbypage@% + \ifnumequal{#3-#1}{1}% + {% + \ifnumequal{#2}{\tmp}% + {\ifnumequal{#4}{1}{\istwofollowinglines@true}{}}% + {}% + }% + {}% + \fi% + }% +}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\printlines} +% So, we have decided which part of line number sets will be printed depending of these value. +% Now we are ready to print them. +% If the lineation is by pstart, we print the pstart. +% \changes{v0.15.0}{2012/06/11}{Line numbering can be reset at each pstart.} +% \begin{macrocode} +\def\printlines#1|#2|#3|#4|#5|#6|#7|{% + \begingroup% +% \end{macrocode} +% If we use \LuaTeX, ensure we use good text's direction. +% \begin{macrocode} + \ifluatex% + \luatextextdir TLT% + \fi% +% \end{macrocode} +% Decide which part of line number components we will print. +% \begin{macrocode} + \setprintlines{#1}{#2}{#3}{#4}{#5}{#6}% +% \end{macrocode} +% One subtlety left here is when to print a period between +% numbers. But the only instance in which this is tricky is for the +% ending sub-line number: it could come after the starting +% sub-line number (in which case we want only the dash) or after an +% ending line number (in which case we need to insert a period). +% So, first, print the start line number. +% \begin{macrocode} + \ifdimequal{\csuse{Xboxstartlinenum@\@currentseries}}{0pt}% + {\bgroup}% + {\leavevmode\hbox to \csuse{Xboxstartlinenum@\@currentseries}\bgroup\hfill}% + \ifl@d@pnum #1\fullstop\fi + \linenumrep{#2} + \ifl@d@ssub \fullstop \sublinenumrep{#3}\fi + \egroup% +% \end{macrocode} +% Then print the dash + end line number, or the range symbol. +% \changes{v0.3.0}{2004/02/14}{Added \cs{linenumr@p} and \cs{sublinenumr@p} +% to \cs{printlines}} +% \changes{v1.20.0}{2015/03/22}{Added \cs{ifl@d@Xmorethantwolines} and \cs{ifl@d@Xmorethantwolines} to \cs{printlines}} +% \begin{macrocode} + \ifdimequal{\csuse{Xboxendlinenum@\@currentseries}}{0pt}% + {\bgroup}% + {\hbox to \csuse{Xboxendlinenum@\@currentseries}\bgroup}% + \ifl@d@Xtwolines% + \ifl@d@Xmorethantwolines% + \csuse{Xmorethantwolines@\@currentseries}% + \else% + \csuse{Xtwolines@\@currentseries}% + \fi% + \else% + \ifl@d@dash \endashchar\fi% + \ifl@d@pnum #4\fullstop\fi% + \ifl@d@elin \linenumrep{#5}\fi% + \ifl@d@esl \ifl@d@elin \fullstop\fi \sublinenumrep{#6}\fi% + \fi% + \ifdimequal{\csuse{Xboxendlinenum@\@currentseries}}{0pt}% + {}% + {\hfill}%Prevent underfull hbox + \egroup% + \endgroup% +}% +% \end{macrocode} +% \end{macro} +% \section{Familiar footnotes} +% +% \subsection{Adjacent footnotes} +% The original \edmac{} provided users with five series of critical footnotes (\cs{Afootnote} \cs{Bfootnote} \cs{Cfootnote} \cs{Dfootnote} \cs{Efootnote}), +% and \LaTeX\ provides a single numbered footnote. The \macpackage{} package +% uses the \edmac{} mechanism to provide six series of numbered footnotes. +% +% First, though, the \Lpack{footmisc} package has an option whereby +% two or more consecutive \cs{footnote}s have their marks separated +% by commas. This seemed to Peter Wilson such a useful ability that it was provided +% automatically by \eledmac. +% +% Maïeul Rouquette has maintened this feature in \macpackage, despite he thought that is not directly in relationship with the aim of \macpackage. +% +% +% \begin{macro}{\multiplefootnotemarker} +% \begin{macro}{\multfootsep} +% These macros may have been defined by the \Lclass{memoir} class, +% are provided by the \Lpack{footmisc} package and perhaps +% by other footnote packages. +% That is why we use \cs{providecommand} and not \cs{newcommand}. +% \begin{macrocode} +\providecommand*{\multiplefootnotemarker}{3sp} +\providecommand*{\multfootsep}{\textsuperscript{\normalfont,}} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\m@mmf@prepare} +% A pair of self-cancelling kerns. This may have been defined in the +% \Lclass{memoir} class. +% \begin{macrocode} +\providecommand*{\m@mmf@prepare}{% + \kern-\multiplefootnotemarker + \kern\multiplefootnotemarker\relax} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\m@mmf@check} +% This may have been defined in the \Lclass{memoir} class. If it recognises +% the last kern as \cs{multiplefootnotemarker} it typesets \cs{multfootsep}. +% \begin{macrocode} +\providecommand*{\m@mmf@check}{% + \ifdim\lastkern=\multiplefootnotemarker\relax + \edef\@x@sf{\the\spacefactor}% + \unkern + \multfootsep + \spacefactor\@x@sf\relax + \fi} + +% \end{macrocode} +% \end{macro} +% +% We have to modify \cs{@footnotetext} and \cs{@footnotemark}. However, +% if \Lclass{memoir} is used the modifications have already been made. +% \changes{v0.4.1}{2004/03/25}{Only change \cs{@footnotetext} and +% \cs{@footnotemark} if memoir not used} +% \begin{macrocode} +\@ifclassloaded{memoir}{}{% +% \end{macrocode} +% \begin{macro}{\@footnotetext} +% Add \cs{m@mmf@prepare} at the end of \cs{@footnotetext}. +% \begin{macrocode} +\apptocmd{\@footnotetext}{\m@mmf@prepare}{}{} +% \end{macrocode} +% \end{macro} +% +% \changes{v2.0.0}{2015/07/19}{Patch \cs{@footnotemark} instead of redefine it} +% \begin{macro}{\@footnotemark} +% Modify \cs{@footnotemark} to cater for adjacent \cs{footnote}s. +% \begin{macrocode} + +\patchcmd{\@footnotemark} + {\nobreak} + {\m@mmf@check + \nobreak + } + {}{} +\patchcmd{\@footnotemark} + {\@makefnmark} + {\@makefnmark + \m@mmf@prepare + } + {}{} +% \end{macrocode} +% \end{macro} +% Finished the modifications for the non-memoir case. +% \begin{macrocode} +} + +% \end{macrocode} +% +% \subsection{Regular footnotes for numbered texts} +% \begin{macro}{\l@doldold@footnotetext} +% \begin{macro}{\@footnotetext} +% In order to enable the regular \cs{footnote}s in numbered text +% we have to play around with its \cs{@footnotetext}, using +% different forms for when in numbered or regular text. +% \changes{v0.5.0}{2004/04/03}{Enabled regular \cs{footnote} in numbered text} +% \begin{macrocode} +\pretocmd{\@footnotetext}{% + \ifnumberedpar@ + \edtext{}{\l@dbfnote{#1}}% + \else + }{}{} +\apptocmd{\@footnotetext}{\fi}{}{}% +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\l@dbfnote} +% \begin{macro}{\vl@dbfnote} +% \cs{l@dbfnote} adds the footnote to the insert list, and +% \cs{vl@dbfnote} calls the original \cs{@footnotetext}. +% \changes{v0.6.0}{2004/11/23}{Changed \cs{l@dbfnote} and \cs{vl@dbfnote} as +% originals could give incorrect markers in the footnotes} +% \changes{v1.4.1}{2012/11/16}{Compatibility of standard footnotes with \eledmac when these footnotes contain any commands.} +% \begin{macrocode} + +\newcommand{\l@dbfnote}[1]{% + \ifnumberedpar@ + \gdef\@tag{#1\relax}% + \ifledRcol% + \xright@appenditem{\noexpand\vl@dbfnote{{\expandonce\@tag}}{\@thefnmark}}% + \to\inserts@listR + \global\advance\insert@countR \@ne% + \else% + \xright@appenditem{\noexpand\vl@dbfnote{{\expandonce\@tag}}{\@thefnmark}}% + \to\inserts@list + \global\advance\insert@count \@ne% + \fi + \fi\ignorespaces} + +\newcommand{\vl@dbfnote}[2]{% + \def\@thefnmark{#2}% + \@footnotetext{#1}% + }% +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsection{Footnote formats} +% +% Some of the code for the various formats is remarkably similar to that +% in section~\ref{sec:nfootformat}. +% +% The following macros generally set things up for the `standard' footnote +% format. +% +% \begin{macro}{\prebodyfootmark} +% \begin{macro}{\postbodyfootmark} +% Two convenience macros for use by \cs{...@footnotemark...} macros. +% \begin{macrocode} +\newcommand*{\prebodyfootmark}{% + \leavevmode + \ifhmode + \edef\@x@sf{\the\spacefactor}% + \m@mmf@check + \nobreak + \fi} +\newcommand{\postbodyfootmark}{% + \m@mmf@prepare + \ifhmode\spacefactor\@x@sf\fi\relax} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsection{Footnote arrangement} +% +% \subsubsection{User level macro} +% \begin{macro}{\arrangementX} +% \cs{arrangementX}\oarg{s}\marg{arrangement} +% command calls, for each series, a specific command which set many counters and commands in order to define specific arrangement. +% +% \begin{macrocode} +\newcommandx{\arrangementX}[2][1,usedefault]{% + \def\do##1{% + \csname arrangementX@#2\endcsname{##1}% + }% + \ifstrempty{#1}% + {% + \dolistloop{\@series}% + }% + { + \docsvlist{#1}% + }% +}% +% \end{macrocode} +% \end{macro} +% \subsubsection{Normal footnotes} +% \begin{macro}{\normal@footnotemarkX} +% \cs{normal@footnotemarkX}\marg{series} sets up the typesetting of the +% marker at the point where the footnote is called for. +% \begin{macrocode} +\newcommand*{\normal@footnotemarkX}[1]{% + \prebodyfootmark + \@nameuse{bodyfootmark#1}% + \postbodyfootmark} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\normalbodyfootmarkX} +% The \cs{normalbodyfootmarkX}\marg{series} \emph{really} typesets the +% in-text marker. The style is the normal superscript. +% \begin{macrocode} +\newcommand*{\normalbodyfootmarkX}[1]{% + \hbox{\textsuperscript{\normalfont\@nameuse{@thefnmark#1}}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\normalvfootnoteX} +% \changes{v1.5.1}{2013/08/16}{Fix bug with normal familiar footnotes when mixing RTL and LTR text.} +% \cs{normalvfootnoteX}\marg{series}\marg{text} does the \cs{insert} for +% the \meta{series} and calls the series' \cs{footfmt...} to format the +% \meta{text}. +% \begin{macrocode} +\notbool{parapparatus@}{\newcommand*}{\newcommand}{\normalvfootnoteX}[2]{% + \insert\@nameuse{footins#1}\bgroup + \csuse{bhooknoteX@#1} + \csuse{notefontsizeX@#1} + \footsplitskips + \ifl@dpairing\ifl@dpaging\else% + \setnoteswidthliketwocolumnsX@{#1}% + \fi\fi% + \setnotesXpositionliketwocolumns@{#1}% + \spaceskip=\z@skip \xspaceskip=\z@skip + \csuse{\csuse{footnote@dir}}\@nameuse{footfmt#1}{#1}{#2}\egroup} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\mpnormalvfootnoteX} +% The minipage version. +% \begin{macrocode} +\newcommand*{\mpnormalvfootnoteX}[2]{% + \global\setbox\@nameuse{mpfootins#1}\vbox{% + \unvbox\@nameuse{mpfootins#1} + \csuse{bhooknoteX@#1} + \csuse{notefontsizeX@#1} + \hsize\columnwidth + \@parboxrestore + \color@begingroup + \@nameuse{footfmt#1}{#1}{#2}\color@endgroup}} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\normalfootfmtX} +% \cs{normalfootfmtX}\marg{series}\marg{text} typesets the footnote text, +% prepended by the marker. +% \begin{macrocode} +\notbool{parapparatus@}{\newcommand*}{\newcommand}{\normalfootfmtX}[2]{% + \ifluatex% + \luatextextdir\footnote@luatextextdir% + \luatexpardir\footnote@luatexpardir% + \par% + \fi% + \protected@edef\@currentlabel{% + \@nameuse{@thefnmark#1}% + }% + \ledsetnormalparstuffX{#1}% + \hangindent=\csuse{hangindentX@#1}% + {{\csuse{notenumfontX@#1}\@nameuse{footfootmark#1}}\strut% + #2\strut\par}} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\normalfootfootmarkX} +% \cs{normalfootfootmarkX}\marg{series} is called by \cs{normalfootfmtX} +% to typeset the footnote marker in the footer before the footnote text. +% \begin{macrocode} +\newcommand*{\normalfootfootmarkX}[1]{% + \textsuperscript{\@nameuse{@thefnmark#1}}} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\normalfootstartX} +% \cs{normalfootstartX}\marg{series} is the \meta{series} footnote +% starting macro used in the output routine. +% \begin{macrocode} +\newcommand*{\normalfootstartX}[1]{% + \ifdimequal{0pt}{\prenotesX@}{}% + {% + \iftoggle{prenotesX@}{% + \togglefalse{prenotesX@}% + \skip\csname footins#1\endcsname=% + \dimexpr\csuse{prenotesX@}+\csuse{afterruleX@#1}\relax% + }% + {}% + }% + \vskip\skip\csname footins#1\endcsname% + \leftskip=\z@ + \rightskip=\z@ + \ifl@dpairing\else% + \hsize=\old@hsize% + \fi% + \setnoteswidthliketwocolumnsX@{#1}% + \setnotesXpositionliketwocolumns@{#1}% + \print@footnoteXrule{#1}% +}% + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\normalfootnoteruleX} +% The rule drawn before the footnote series group. +% \begin{macrocode} +\let\normalfootnoteruleX=\footnoterule + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\normalfootgroupX} +% \cs{normalfootgroupX}\marg{series} sends the contents of the \meta{series} +% insert box to the output page without alteration. +% \begin{macrocode} +\newcommand*{\normalfootgroupX}[1]{% + \unvbox\@nameuse{footins#1}% + \hsize=\old@hsize% + }% + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\mpnormalfootgroupX} +% The minipage version. +% \begin{macrocode} +\newcommand*{\mpnormalfootgroupX}[1]{% + \vskip\skip\@nameuse{mpfootins#1} + \ifl@dpairing\ifparledgroup% + \leavevmode\marks\parledgroup@{begin}% + \marks\parledgroup@series{#1}% + \marks\parledgroup@type{footnoteX}% + \fi\fi\normalcolor + \ifparledgroup% + \ifl@dpairing% + \else% + \setnoteswidthliketwocolumnsX@{#1}% + \setnotesXpositionliketwocolumns@{#1}% + \print@footnoteXrule{#1}% + \fi% + \else% + \setnoteswidthliketwocolumnsX@{#1}% + \setnotesXpositionliketwocolumns@{#1}% + \print@footnoteXrule{#1}% + \fi% + \unvbox\@nameuse{mpfootins#1}} + +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\normalbfnoteX} +% \changes{v0.7.0}{2005/02/18}{Removed extraneous space from \cs{normalbfnoteX}} +% \changes{v1.4.9}{2013/07/10}{Allow to redefine \cs{thefootnoteX} with \c{alph} when some packages are loaded.} +% \begin{macrocode} + +\newcommand{\normalbfnoteX}[2]{% + \ifnumberedpar@ + \ifledRcol% + \ifluatex + \footnotelang@lua[R]% + \fi + \@ifundefined{xpg@main@language}%if polyglossia + {}% + {\footnotelang@poly[R]}% + \protected@xdef\thisfootnote{\csuse{thefootnote#1}}% + \xright@appenditem{\noexpand\vbfnoteX{#1}{#2}{\expandonce\thisfootnote}}% + \to\inserts@listR + \global\advance\insert@countR \@ne% + \else% + \ifluatex + \footnotelang@lua% + \fi + \@ifundefined{xpg@main@language}%if polyglossia + {}% + {\footnotelang@poly}% + \protected@xdef\thisfootnote{\csuse{thefootnote#1}}% + \xright@appenditem{\noexpand\vbfnoteX{#1}{#2}{\expandonce\thisfootnote}}% + \to\inserts@list + \global\advance\insert@count \@ne% + \fi + \fi\ignorespaces} + +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\vbfnoteX} +% \begin{macrocode} +\newcommand{\vbfnoteX}[3]{% + \@namedef{@thefnmark#1}{#3}% + \@nameuse{regvfootnote#1}{#1}{#2}} + +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\vnumfootnoteX} +% \changes{v0.7.0}{2005/02/18}{Removed extraneous space from \cs{vnumfootnoteX}} +% \begin{macrocode} +\newcommand{\vnumfootnoteX}[2]{% + \ifnumberedpar@ + \edtext{}{\normalbfnoteX{#1}{#2}}% + \else + \@nameuse{regvfootnote#1}{#1}{#2}% + \fi} + +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{arrangementX@normal} +% \cs{arrangementX@normal}\marg{series} initialises the settings for +% the \meta{series} footnotes. This should always be called for +% each series. +% \begin{macrocode} +\newcommand*{\arrangementX@normal}[1]{% + \csgdef{series@displayX#1}{normal} + \expandafter\let\csname footstart#1\endcsname=\normalfootstartX + \expandafter\newcount\csname prevpage#1@num\endcsname + \@namedef{@footnotemark#1}{\normal@footnotemarkX{#1}} + \@namedef{bodyfootmark#1}{\normalbodyfootmarkX{#1}} + \expandafter\let\csname regvfootnote#1\endcsname=\normalvfootnoteX + \expandafter\let\csname vfootnote#1\endcsname=\vnumfootnoteX + \expandafter\let\csname footfmt#1\endcsname=\normalfootfmtX + \@namedef{footfootmark#1}{\normalfootfootmarkX{#1}} + \expandafter\let\csname footgroup#1\endcsname=\normalfootgroupX + \expandafter\let\csname footnoterule#1\endcsname=\normalfootnoteruleX + \count\csname footins#1\endcsname=1000 + \csxdef{default@footins#1}{1000}%Use to have note only for one side + \dimen\csname footins#1\endcsname=\csuse{maxhnotesX@#1} + \skip\csname footins#1\endcsname=\csuse{beforenotesX@#1}% + \advance\skip\csname footins#1\endcsname by\csuse{afterruleX@#1}% +% \end{macrocode} +% Additions for minipages. +% \begin{macrocode} + \ifnoledgroup@\else% + \expandafter\let\csname mpvfootnote#1\endcsname=\mpnormalvfootnoteX + \expandafter\let\csname mpfootgroup#1\endcsname=\mpnormalfootgroupX + \count\csname mpfootins#1\endcsname=1000 + \dimen\csname mpfootins#1\endcsname=\csuse{maxhnotesX@#1} + \skip\csname mpfootins#1\endcsname=\csuse{beforenotesX@#1}% + \advance\skip\csname mpfootins#1\endcsname by\csuse{afterruleX@#1}% + \fi +} + +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Two columns footnotes} +% +% The following macros set footnotes in two columns. It is assumed +% that the length of each footnote is less than the column width. +% +% \begin{macro}{\arrangementX@twocol} +% \begin{macrocode} +\newcommand*{\arrangementX@twocol}[1]{% + \csgdef{series@displayX#1}{twocol} + \expandafter\let\csname regvfootnote#1\endcsname=\twocolvfootnoteX + \expandafter\let\csname footfmt#1\endcsname=\twocolfootfmtX + \expandafter\let\csname footgroup#1\endcsname=\twocolfootgroupX + \dimen\csname footins#1\endcsname=\csuse{maxhnotesX@#1}% + \skip\csname footins#1\endcsname=\csuse{beforenotesX@#1}% + \advance\skip\csname footins#1\endcsname by \csuse{afterruleX@#1}\relax% + \twocolfootsetupX{#1} + \ifnoledgroup@\else% + \expandafter\let\csname mpvfootnote#1\endcsname=\mpnormalvfootnoteX + \expandafter\let\csname mpfootgroup#1\endcsname=\mptwocolfootgroupX + \skip\csname mpfootins#1\endcsname=\csuse{beforenotesX@#1}% + \advance\skip\csname mpfootins#1\endcsname by\csuse{afterruleX@#1} + \mptwocolfootsetupX{#1} + \fi% +} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\twocolfootsetupX} +% \begin{macro}{\mptwocolfootsetupX} +% \cs{twocolfootsetupX}\marg{series} +% \begin{macrocode} +\newcommand*{\twocolfootsetupX}[1]{% + \count\csname footins#1\endcsname 500 + \csxdef{default@footins#1}{500}%Use this to confine the notes to one side only + \multiply\dimen\csname footins#1\endcsname by \tw@} +\newcommand*{\mptwocolfootsetupX}[1]{% + \count\csname mpfootins#1\endcsname 500 + \multiply\dimen\csname mpfootins#1\endcsname by \tw@} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\twocolvfootnoteX} +% \cs{twocolvfootnoteX}\marg{series} +% \begin{macrocode} +\notbool{parapparatus@}{\newcommand*}{\newcommand}{\twocolvfootnoteX}[2]{% + \insert\csname footins#1\endcsname\bgroup + \csuse{notefontsizeX@#1} + \footsplitskips + \spaceskip=\z@skip \xspaceskip=\z@skip + \@nameuse{footfmt#1}{#1}{#2}\egroup} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\twocolfootfmtX} +% \cs{twocolfootfmtX}\marg{series} +% \begin{macrocode} +\notbool{parapparatus@}{\newcommand*}{\newcommand}{\twocolfootfmtX}[2]{% + \protected@edef\@currentlabel{% + \@nameuse{@thefnmark#1}% + }% + \normal@pars + \hangindent=\csuse{hangindentX@#1}% + \hsize \csuse{hsizetwocolX@#1} + \nottoggle{parindentX@#1}{\parindent=\z@}{} + \tolerance=5000\relax + \leavevmode + \csuse{colalignX@#1}% + {\csuse{notenumfontX@#1}\@nameuse{footfootmark#1}\strut% + #2\strut\par}\allowbreak} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\twocolfootgroupX} +% \begin{macro}{\mptwocolfootgroupX} +% \cs{twocolfootgroupX}\marg{series} +% \begin{macrocode} +\newcommand*{\twocolfootgroupX}[1]{{\csuse{notefontsizeX@#1} + \splittopskip=\ht\strutbox + \expandafter + \rigidbalance\csname footins#1\endcsname \tw@ \splittopskip}} +\newcommand*{\mptwocolfootgroupX}[1]{{% + \vskip\skip\@nameuse{mpfootins#1} + \ifl@dpairing\ifparledgroup% + \leavevmode\marks\parledgroup@{begin}% + \marks\parledgroup@series{#1}% + \marks\parledgroup@type{footnoteX}% + \fi\fi\normalcolor + \ifparledgroup% + \ifl@dpairing% + \else% + \setnoteswidthliketwocolumnsX@{#1}% + \setnotesXpositionliketwocolumns@{#1}% + \print@footnoteXrule{#1}% + \fi% + \else% + \setnoteswidthliketwocolumnsX@{#1}% + \setnotesXpositionliketwocolumns@{#1}% + \print@footnoteXrule{#1}% + \fi% + \splittopskip=\ht\strutbox + \expandafter + \rigidbalance\csname mpfootins#1\endcsname \tw@ \splittopskip}} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsubsection{Three columns footnotes} +% +% The following macros set footnotes in three columns. It is assumed +% that the length of each footnote is less than the column width. +% +% +% \begin{macro}{\arrangementX@threecol} +% \begin{macrocode} +\newcommand*{\arrangementX@threecol}[1]{% + \csgdef{series@displayX#1}{threecol} + \expandafter\let\csname regvfootnote#1\endcsname=\threecolvfootnoteX + \expandafter\let\csname footfmt#1\endcsname=\threecolfootfmtX + \expandafter\let\csname footgroup#1\endcsname=\threecolfootgroupX + \dimen\csname footins#1\endcsname=\csuse{maxhnotesX@#1}% + \skip\csname footins#1\endcsname=\csuse{beforenotesX@#1}% + \advance\skip\csname footins#1\endcsname by \csuse{afterruleX@#1}\relax% + \threecolfootsetupX{#1} + \ifnoledgroup@\else% + \expandafter\let\csname mpvfootnote#1\endcsname=\mpnormalvfootnoteX + \expandafter\let\csname mpfootgroup#1\endcsname=\mpthreecolfootgroupX + \skip\csname mpfootins#1\endcsname=\csuse{beforenotesX@#1}% + \advance\skip\csname mpfootins#1\endcsname by\csuse{afterruleX@#1} + \mpthreecolfootsetupX{#1} + \fi% +} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\threecolfootsetupX} +% \begin{macro}{\mpthreecolfootsetupX} +% \cs{threecolfootsetupX}\marg{series} +% \begin{macrocode} +\newcommand*{\threecolfootsetupX}[1]{% + \count\csname footins#1\endcsname 333 + \csxdef{default@footins#1}{333}%Use this to confine the notes to one side only + \multiply\dimen\csname footins#1\endcsname by \thr@@} +\newcommand*{\mpthreecolfootsetupX}[1]{% + \count\csname mpfootins#1\endcsname 333 + \multiply\dimen\csname mpfootins#1\endcsname by \thr@@} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\threecolvfootnoteX} +% \cs{threecolvfootnoteX}\marg{series}\marg{text} +% \begin{macrocode} +\notbool{parapparatus@}{\newcommand*}{\newcommand}{\threecolvfootnoteX}[2]{% + \insert\csname footins#1\endcsname\bgroup + \csuse{notefontsizeX@#1} + \footsplitskips + \@nameuse{footfmt#1}{#1}{#2}\egroup} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\threecolfootfmtX} +% \cs{threecolfootfmtX}\marg{series} +% \begin{macrocode} +\notbool{parapparatus@}{\newcommand*}{\newcommand}{\threecolfootfmtX}[2]{% + \protected@edef\@currentlabel{% + \@nameuse{@thefnmark#1}% + }% + \hangindent=\csuse{hangindentX@#1}% + \normal@pars + \hsize \csuse{hsizethreecolX@#1} + \nottoggle{parindentX@#1}{\parindent=\z@}{} % + \tolerance=5000\relax + \leavevmode + \csuse{colalignX@#1}% + {\csuse{notenumfontX@#1}\@nameuse{footfootmark#1}\strut% + #2\strut\par}\allowbreak} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\threecolfootgroupX} +% \begin{macro}{\mpthreecolfootgroupX} +% \cs{threecolfootgroupX}\marg{series} +% \begin{macrocode} +\newcommand*{\threecolfootgroupX}[1]{{\csuse{notefontsizeX@#1} + \splittopskip=\ht\strutbox + \expandafter + \rigidbalance\csname footins#1\endcsname \thr@@ \splittopskip}} +\newcommand*{\mpthreecolfootgroupX}[1]{{% + \vskip\skip\@nameuse{mpfootins#1} + \ifl@dpairing\ifparledgroup + \leavevmode\marks\parledgroup@{begin}% + \marks\parledgroup@series{#1}% + \marks\parledgroup@type{footnoteX}% + \fi\fi\normalcolor + \ifparledgroup% + \ifl@dpairing% + \else% + \setnoteswidthliketwocolumnsX@{#1}% + \setnotesXpositionliketwocolumns@{#1}% + \print@footnoteXrule{#1}% + \fi% + \else% + \setnoteswidthliketwocolumnsX@{#1}% + \setnotesXpositionliketwocolumns@{#1}% + \print@footnoteXrule{#1}% + \fi% + \splittopskip=\ht\strutbox + \expandafter + \rigidbalance\csname mpfootins#1\endcsname \thr@@ \splittopskip}} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsubsection{Paragraphed footnotes} +% +% The following macros set footnotes as one paragraph. +% +% \begin{macro}{\arrangementX@threecol} +% \changes{v1.15.0}{2015/01/12}{Correct bug with paragraphed familiar footnotes setting.} +% \cs{footparagraphX}\marg{series} +% \begin{macrocode} +\newcommand*{\arrangementX@paragraph}[1]{% + \csgdef{series@displayX#1}{paragraph}% + \expandafter\newcount\csname #1prevpage@num\endcsname + \expandafter\let\csname footstart#1\endcsname=\parafootstartX + \expandafter\let\csname regvfootnote#1\endcsname=\para@vfootnoteX + \expandafter\let\csname footfmt#1\endcsname=\parafootfmtX + \expandafter\let\csname footgroup#1\endcsname=\para@footgroupX + \expandafter\let\csname footnoterule#1\endcsname=\normalfootnoteruleX + \count\csname footins#1\endcsname=1000 + \csxdef{default@footins#1}{1000}%Use this to confine the notes to one side only + \dimen\csname footins#1\endcsname=\csuse{maxhnotesX@#1} + \skip\csname footins#1\endcsname=\csuse{beforenotesX@#1}% + \advance\skip\csname footins#1\endcsname by\csuse{afterruleX@#1}% + \para@footsetupX{#1} + \ifnoledgroup@\else + \expandafter\let\csname mpvfootnote#1\endcsname=\mppara@vfootnoteX + \expandafter\let\csname mpfootgroup#1\endcsname=\mppara@footgroupX + \count\csname mpfootins#1\endcsname=1000 + \dimen\csname mpfootins#1\endcsname=\csuse{maxhnotesX@#1} + \skip\csname mpfootins#1\endcsname=\csuse{beforenotesX@#1}% + \advance\skip\csname mpfootins#1\endcsname by\csuse{afterruleX@#1}% + \fi + } + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\para@footsetupX} +% \cs{para@footsetupX}\marg{series} +% \changes{v0.2.2}{2003/11/04}{Added \cs{footfudgefiddle} to \cs{para@footsetupX}} +% \changes{v1.13.0}{2014/09/16}{In \cs{para@footsetupX}, use \cs{columnwidth} instead of \cs{hsize}} +% \begin{macrocode} +\newcommand*{\para@footsetupX}[1]{{\csuse{notefontsizeX@#1} + \setnoteswidthliketwocolumnsX@{#1}% + \dimen0=\baselineskip + \multiply\dimen0 by 1024 + \divide\dimen0 by \columnwidth \multiply\dimen0 by \footfudgefiddle\relax% + \expandafter + \xdef\csname footfudgefactor#1\endcsname{% + \expandafter\strip@pt\dimen0 }}} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\parafootstartX} +% \cs{parafootstartX}\marg{series} +% \begin{macrocode} +\newcommand*{\parafootstartX}[1]{% + \ifdimequal{0pt}{\prenotesX@}{}% + {% + \iftoggle{prenotesX@}{% + \togglefalse{prenotesX@}% + \skip\csname footins#1\endcsname=% + \dimexpr\csuse{prenotesX@}+\csuse{afterruleX@#1}\relax% + }% + {}% + }% + \vskip\skip\csname footins#1\endcsname% + \leftskip=\z@ + \rightskip=\z@ + \parindent=\z@ + \vskip\skip\@nameuse{footins#1}% + \setnoteswidthliketwocolumnsX@{#1}% + \setnotesXpositionliketwocolumns@{#1}% + \print@footnoteXrule{#1}% + } + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\para@vfootnoteX} +% \begin{macro}{\mppara@vfootnoteX} +% \cs{para@vfootnoteX}\marg{series}\marg{text} +% \begin{macrocode} +\newcommand*{\para@vfootnoteX}[2]{% + \insert\csname footins#1\endcsname + \bgroup + \csuse{bhooknoteX@#1} + \csuse{notefontsizeX@#1} + \footsplitskips + \setbox0=\vbox{\hsize=\maxdimen + \noindent\@nameuse{footfmt#1}{#1}{#2}}% + \setbox0=\hbox{\unvxhX{0}{#1}}% + \dp0=\z@ + \ht0=\csname footfudgefactor#1\endcsname\wd0 + \box0 + \penalty0 + \egroup} +\newcommand*{\mppara@vfootnoteX}[2]{% + \global\setbox\@nameuse{mpfootins#1}\vbox{% + \unvbox\@nameuse{mpfootins#1} + \csuse{bhooknoteX@#1} + \csuse{notefontsizeX@#1} + \footsplitskips + \setbox0=\vbox{\hsize=\maxdimen + \noindent\color@begingroup\@nameuse{footfmt#1}{#1}{#2}\color@endgroup}% + \setbox0=\hbox{\unvxhX{0}{#1}}% + \dp0=\z@ + \ht0=\csname footfudgefactor#1\endcsname\wd0 + \box0 + \penalty0}} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\unvxhX} +% \begin{macrocode} +\newcommand*{\unvxhX}[2]{% 2th is optional for retro-compatibility + \setbox0=\vbox{\unvbox#1% + \global\setbox1=\lastbox}% + \unhbox1 + \unskip % remove \rightskip, + \unskip % remove \parfillskip, + \unpenalty % remove \penalty of 10000, + \hskip\csuse{afternoteX@#2}} % but add the glue to go between the notes + +% \end{macrocode} +% \end{macro} +% \begin{macro}{\parafootfmtX} +% \cs{parafootfmtX}\marg{series} +% \begin{macrocode} +\newcommand*{\parafootfmtX}[2]{% + \protected@edef\@currentlabel{% + \@nameuse{@thefnmark#1}% + }% + \insertparafootsepX{#1}% + \ledsetnormalparstuffX{#1}% + {\csuse{notenumfontX@#1}% + \csuse{notenumfontX@#1}% + \@nameuse{footfootmark#1}% + \strut% + #2\penalty-10}} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\para@footgroupX} +% \begin{macro}{\mppara@footgroupX} +% \cs{para@footgroupX}\marg{series} +% \begin{macrocode} +\newcommand*{\para@footgroupX}[1]{% + \unvbox\csname footins#1\endcsname + \ifcsstring{raggedX@#1}{L}{\RaggedLeft}{}% + \ifcsstring{raggedX@#1}{R}{\RaggedRight}{}% + \makehboxofhboxes + \setbox0=\hbox{\unhbox0 \removehboxes}% + \csuse{notefontsizeX@#1} + \noindent\unhbox0\par} +\newcommand*{\mppara@footgroupX}[1]{{% + \setnoteswidthliketwocolumnsX@{#1}% + \vskip\skip\@nameuse{mpfootins#1} + \ifl@dpairing\ifparledgroup + \leavevmode% + \leavevmode\marks\parledgroup@{begin}% + \marks\parledgroup@series{#1}% + \marks\parledgroup@type{footnoteX}% + \fi\fi\normalcolor + \ifparledgroup% + \ifl@dpairing% + \else% + \setnoteswidthliketwocolumnsX@{#1}% + \setnotesXpositionliketwocolumns@{#1}% + \print@footnoteXrule{#1}% + \fi% + \else% + \setnoteswidthliketwocolumnsX@{#1}% + \setnotesXpositionliketwocolumns@{#1}% + \print@footnoteXrule{#1}% + \fi% + \unvbox\csname mpfootins#1\endcsname + \ifcsstring{raggedX@#1}{L}{\RaggedLeft}{}% + \ifcsstring{raggedX@#1}{R}{\RaggedRight}{}% + \makehboxofhboxes + \setbox0=\hbox{\unhbox0 \removehboxes}% + \csuse{notefontsizeX@#1} + \noindent\unhbox0\par}} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \paragraph{Insertion of the footnotes separator} +% The command \cs{insertparafootsepX}\marg{series} must be called at the beginning of \cs{parafootftmX}. +% \begin{macro}{\prevpage@num} +% \begin{macro}{\Xinsertparafootsep} +% \begin{macrocode} +\newcommand{\insertparafootsepX}[1]{% + \ifnumequal{\csuse{prevpage#1@num}}{\page@num}% + {\csuse{parafootsepX@#1}}% + {}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \section{Code common to both critical and familiar footnote in normal arrangement} +% \cs{par} should always be redefined to \cs{endgraf} within +% the format macro (this is what \cs{normal@pars} does), +% to override tricky material in the main text +% to get the lines numbered automatically (as set up by +% \cs{autopar}, for example). +% +% In the case of footnote arranged in a ``normal'' way, we also must set some setting for paragraph indent and text direction when using \LuaLaTeX. +% +% That why we have defined \cs{ledsetnormalparstuff@common} in order to make this setting for both familiar and critical notes. +% This command is called by command to make specific setting to critical or familiar footnote. +% +% \begin{macro}{\ledsetnormalparstuff@common} +% \begin{macro}{\Xledsetnormalparstuff} +% \begin{macro}{\ledsetnormalparstuffX} +% +% \changes{v1.4.0}{2012/11/16}{Direction of footnotes with polyglossia.} +% \changes{v1.21.0}{2015/04/13}{\cs{ledsetnormalparstuff} is deprecated and becomes \cs{ledsetnormalparstuffX} and \cs{Xledsetnormalparstuff}.} +% \begin{macrocode} +\newcommand*{\ledsetnormalparstuff@common}{% + \ifluatex% + \luatextextdir\footnote@luatextextdir% + \luatexpardir\footnote@luatexpardir% + \fi% + \csuse{\csuse{footnote@dir}}% + \normal@pars% + \parfillskip \z@ \@plus 1fil}% + +\newcommand*{\Xledsetnormalparstuff}[1]{% + \ledsetnormalparstuff@common% + \nottoggle{Xparindent@#1}{\noindent}{}%\noindent and and not \parindent=0pt to avoid to break the (bad) change made when moving from ledmac to eledmac +}% + +\newcommand*{\ledsetnormalparstuffX}[1]{% + \ledsetnormalparstuff@common% + \nottoggle{parindentX@#1}{\noindent}{}%\noindent and and not \parindent=0pt to avoid to break the (bad) change made when moving from ledmac to eledmac +}% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \section{Footnotes' width for two columns}\label{width2columns} +% We define here some commands which make sense only with \parpackage, but must be called when defining notes parameters. +% These commands change the width of block notes to allow them to have the same size than two parallel columns. +% \begin{macro}{\old@hsize} +% \begin{macro}{\setXnoteswidthliketwocolumns@} +% \begin{macro}{\setnoteswidthliketwocolumnsX@} +% These two commands are called at the beginning of critical or familiar notes groups. +% They set, if the option is enabled, the \cs{hsize}. They are also called at the on the setup for paragraphed notes. +% \begin{macrocode} + +\newdimen\old@hsize% +\AtBeginDocument{\old@hsize=\hsize}% + +\newcommand{\setXnoteswidthliketwocolumns@}[1]{% + \global\let\hsize@fornote=\hsize% + \global\old@hsize=\hsize% + \iftoggle{Xnoteswidthliketwocolumns@#1}% + {% + \csuse{setwidthliketwocolumns@\columns@position}% + \global\let\hsize@fornote=\hsize% + }% + {}% + \let\hsize=\hsize@fornote% + \let\columnwidth=\hsize@fornote% +}% + +\newcommand{\setnoteswidthliketwocolumnsX@}[1]{% + \global\let\hsize@fornote=\hsize% + \global\old@hsize=\hsize% + \iftoggle{noteswidthliketwocolumnsX@#1}% + {% + \csuse{setwidthliketwocolumns@\columns@position}% + \global\let\hsize@fornote=\hsize% + }% + {}% + \let\hsize=\hsize@fornote% + \let\columnwidth=\hsize@fornote% +}% + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \begin{macro}{\setXnotespositionliketwocolumns@} +% \begin{macro}{\setnotesXpositionliketwocolumns@} +% These two commands set the position of the critical / familiar +% footnotes, depending on the hooks +% \verb+Xnoteswidthliketwocolumns+ and \verb+noteswidthliketwocolumnsX+. +% They call commands which are defined only in \parpackage, because this feature has no sens without \parpackage. +% \begin{macrocode} +\newcommand{\setXnotespositionliketwocolumns@}[1]{% + \iftoggle{Xnoteswidthliketwocolumns@#1}{% + \csuse{setnotespositionliketwocolumns@\columns@position}% + }{}% +}% + +\newcommand{\setnotesXpositionliketwocolumns@}[1]{% + \iftoggle{noteswidthliketwocolumnsX@#1}{% + \csuse{setnotespositionliketwocolumns@\columns@position}% + }{}% +}% + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \section{Footnotes' order} +% \begin{macro}{\fnpos} +% \begin{macro}{\mpfnpos} +% \begin{macro}{\@fnpos} +% \begin{macro}{\@mpfnpos} +% The \cs{fnpos} and \cs{mpfnpos} simply place their arguments in \cs{@fnpos} and \cs{@mpfnpos}, which will be used later in the output routine. +% \begin{macrocode} +\def\@fnpos{familiar-critical} +\def\@mpfnpos{critical-familiar} +\newcommand{\fnpos}[1]{\xdef\@fnpos{#1}} +\newcommand{\mpfnpos}[1]{\xdef\@mpfnpos{#1}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \section{Footnotes' rule} +% Because the footnotes' rules can be shifted to the right when footnotes are set like two columns, we do not print them directly, but we put them in a \cs{vbox}. +% +% \begin{macro}{\print@Xfootnoterule} +% \begin{macro}{\print@footnoteXrule} +% \changes{v1.21.0}{2015/04/13}{Code refactoring: the spaces after the footnote rules are directly managed in \cs{print@Xfootnoterule} and \cs{print@footnoteXrule}} +% \begin{macrocode} +\newcommand{\print@Xfootnoterule}[1]{% + \vskip-\csuse{Xafterrule@#1}%Because count in \dimen\csuse{#1footins} + \nointerlineskip% + \moveleft-\leftskip\vbox{\csuse{#1footnoterule}}% + \nointerlineskip% + \vskip\csuse{Xafterrule@#1}% +}% + +\newcommand{\print@footnoteXrule}[1]{% + \vskip-\csuse{afterruleX@#1}%Because count in \dimen\csuse{footins#1} + \nointerlineskip% + \moveleft-\leftskip\vbox{\csuse{footnoterule#1}}% + \nointerlineskip% + \vskip\csuse{afterruleX@#1}% +}% + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \section{Specific skip for first series of footnotes}\label{skipfirstseries} +% \subsubsection{Overview} +% \cs{Xbeforenotes} inserts a specific skip for the first series of notes in a page. +% As we can't know in advance which series will be the first, we call \cs{prepare@preXnotes} before inserting any critical notes, in order to prevent page number overlapping. +% \begin{enumerate} +% \item If it is the first note of the current page, it changes the footnote skip for the series to the value specified to \cs{Xbeforenotes}. It also keeps the series of the note as the first one of the current page. +% \item If it is not the first note of the current page: +% \begin{itemize} +% \item If the current series is printed after the series kept as the first of the current page, then nothing happens. +% \item If the current series is printed before the series kept as the first of the current page, then it changes the footnote skip of the current series to the value normally used by the series which was marked as the first of the page. It also keeps the current series as the new first one of the current page. +% \end{itemize} +% \end{enumerate} +% +% +% For example, suppose the series order is A,B. We call first a \cs{Bfootnote} and a \cs{Afootnote}. The only skips used are, finally, the skip specific to the first series of the page, and the skip for the B series. If we have not called \cs{Afootnote}, the only skip used is the skip specific to the first series of the page. +% +% That is perfect. +% +% +% The series skip and the first series of the current page are reset before the footnotes are printed. Then, the footstart macros manage the problem of the first series of the page. +% +% After the rule, the space which is defined by \cs{Xafterrule} does not depend on whether the series is the first one of the page or not. So we use its normal value for each series. +% +% And now, implementation ! +% \subsubsection{User level command} +% \begin{macro}{\preXnotes@} +% \begin{macro}{\preXnotes} +% \changes{v1.1.0}{2012/09/25}{New skip \cs{preXnotes@}} +% \changes{v1.2.0}{2012/10/08}{Debug in familiar footnotes (bug introduced by v1.1).} +% If user redefines \cs{preXnotes@}, via \cs{preXnotes} to a value greater than 0~pt, +% this skip will be added before first series notes +% instead of the notes skip. +% \begin{macrocode} +\newtoggle{preXnotes@} +\toggletrue{preXnotes@} +\newcommand{\preXnotes@}{0pt} +\newcommand*{\preXnotes}[1]{\renewcommand{\preXnotes@}{#1}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% The same, but for familiar footnotes. +% \begin{macro}{\preXnotes} +% \begin{macro}{\preXnotes@} +% \begin{macrocode} +\newtoggle{prenotesX@} +\toggletrue{prenotesX@} +\newcommand{\prenotesX@}{0pt} +\newcommand*{\prenotesX}[1]{\renewcommand{\prenotesX@}{#1}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsubsection{Internal commands} +% \begin{macro}{firstXseries@} +% \begin{macro}{prepare@preXnotes} +% \begin{macrocode} +\gdef\firstXseries@{} +\newcommand{\prepare@preXnotes}[1]{% + \ifdimequal{0pt}{\preXnotes@}% + {}% + {% + \IfStrEq{\firstXseries@}{}{% + \global\skip\csuse{#1footins}=\preXnotes@% + \global\advance\skip\csname #1footins\endcsname by\csuse{Xafterrule@#1}% + \gdef\firstXseries@{#1}% + }% + {% + \ifseriesbefore{#1}{\firstXseries@}% + {% + \global\skip\csuse{#1footins}=\csuse{Xbeforenotes@\firstXseries@}% + \global\advance\skip\csname #1footins\endcsname by\csuse{Xafterrule@#1}% + \gdef\firstXseries@{#1}% + }% + {}% + }% + }% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% The same thing is required for familiar notes and \cs{prenotesX}. +% \begin{macro}{firstseriesX@} +% \begin{macro}{prepare@prenotesX} +% \begin{macrocode} +\gdef\firstseriesX@{} +\newcommand{\prepare@prenotesX}[1]{% + \ifdimequal{0pt}{\prenotesX@}% + {}% + {% + \IfStrEq{\firstseriesX@}{}{% + \global\skip\csuse{footins#1}=\prenotesX@% + \global\advance\skip\csname footins#1\endcsname by\csuse{afterruleX@#1}% + \gdef\firstseriesX@{#1}% + }% + {% + \ifseriesbefore{#1}{\firstseriesX@}% + {% + \global\skip\csuse{footins#1}=\csuse{beforenotesX@\firstseriesX@}% + \global\advance\skip\csname footins#1\endcsname by\csuse{afterruleX@#1}% + \gdef\firstXseries@{#1}% + }% + {}% + }% + }% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \section{Endnotes} +% \changes{v1.8.1}{2013/12/15}{Debug endnotes when more than one series is used (change the position where tools for endnotes are defined).} +% \changes{v1.14.0}{2014/10/20}{Debug spurious characters before endnotes.} +% \label{endnotes}\relax +% +% First, check the noend option. +% \begin{macrocode} +\ifbool{noend@}{}{%Used instead of \ifnoend@ to prevent expansion problem +% \end{macrocode} +% +% \begin{macro}{\l@dend@open} +% \begin{macro}{\l@dend@close} +% \cs{l@dend@open} and \cs{l@dend@close} are the +% macros that are used to open and close the endnote file. Note that +% all our writing to this file is \cs{immediate}: all page and +% line numbers for the endnotes are generated by the same mechanism +% we use for the footnotes, so that there is no need to defer any +% writing to catch information from the output routine. +% The argument of these two command is the series letter. +% \begin{macrocode} +\newcommand{\l@dend@open}[1]{% + \global\booltrue{l@dend@#1}% + \expandafter\immediate% + \expandafter\openout% + \csname l@d@#1end\endcsname% + =\jobname.#1end\relax% +}% +\newcommand{\l@dend@close}[1]{% + \global\boolfalse{l@dend@#1}% + \expandafter\immediate% + \expandafter\closeout\csname l@d@#1end\endcsname% +}% + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\l@dend@stuff} +% \cs{l@dend@stuff} is used by \cs{beginnumbering} to +% do everything that is necessary for the endnotes at the +% start of each section: it opens the \cs{l@d@end} file, if necessary, +% and writes the section number to the endnote file. +% \begin{macrocode} +\newcommand{\l@dend@stuff}{% + \def\do##1{% + \ifbool{l@dend@##1}{}% + {\l@dend@open{##1}}% + \expandafter\immediate\expandafter\write\csname l@d@##1end\endcsname{\string\l@d@section{\the\section@num}}% + }% + \dolistloop{\@series}% +}% + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\endprint} +% \begin{macro}{\l@d@section} +% The \cs{endprint} here is nearly identical in its +% functioning to \cs{normalfootfmt}. +% +% The endnote file also contains \cs{l@d@section} commands, which +% supply the section numbers from the main text; standard \macpackage{} does +% nothing with this information, but it is there if you want to write +% custom macros to do something with it. +% \changes{v1.18.0}{2015/02/23}{Option parapparatus works for endnotes.} +% \changes{v1.21.0}{2015/04/13}{\cs{endnotes} take five arguments.} +% Arguments are: +% \begin{itemize} +% \item \verb+#1+ Line numbers and font selection. +% \item \verb+#2+ Lemma. +% \item \verb+#3+ Note content. +% \item \verb+#4+ Series. +% \item \verb+#5+ Optional argument of \cs{Xendnote}. +% \end{itemize} +% \begin{macrocode} +\global\notbool{parapparatus@}{}{\long}\def\endprint#1#2#3#4#5{{% + \ifXendinsertsep@% + \hskip\csuse{Xendafternote@#4}% + \csuse{Xendsep@#4}% + \else% + \iftoggle{Xendparagraph@#4}% + {\global\Xendinsertsep@true}% + {}% + \fi% + \xdef\@currentseries{#4}% + \def\do##1{% + \toggletrue{##1@}% + }% + \notblank{#5}{\docsvlist{#5}}{}% + \csuse{Xendbhooknote@#4}% + \csuse{Xendnotefontsize@#4}% + \ifboolexpr{% + togl {nonum@}% + or togl {Xendnonumber@#4}% + }% + {\hspace{\csuse{Xendinplaceofnumber@#4}}}% + {\printlineendnotearea{#1}{#4}}% + \nottoggle{Xendlemmadisablefontselection@#4}% + {\select@lemmafont#1|#2}% + {#2}% + \ifboolexpr{% + togl {nosep@}% + or test{\ifcsempty{Xendlemmaseparator@#4}}% + }% + {\hskip\csuse{Xendinplaceoflemmaseparator@#4}}% + {\nobreak% + \hskip\csuse{Xendbeforelemmaseparator@#4}% + \csuse{Xendlemmaseparator@#4}% + \hskip\csuse{Xendafterlemmaseparator@#4}% + }% + #3% + \nottoggle{Xendparagraph@#4}{\par}{}% + \def\do##1{% + \togglefalse{##1@}% + }% + \notblank{#5}{\docsvlist{#5}}{}% +}}% + +\let\l@d@section=\@gobble + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\printlineendnotearea} +% +% This macro prints the space before the line number, changes the font, then prints the line number and the space after it. +% It is called by \cs{endprint} +% depending of the options about repeating line numbers. +% The first argument is line information, the second is the notes series (A, B, C, etc.) +% \begin{macrocode} +\newcommand{\printlineendnotearea}[2]{% + \bgroup% + \csuse{Xendnotenumfont@#2}% + \ifdimequal{\csuse{Xendboxlinenum@#2}}{0pt}% + {\printendlines#1|}% + {\leavevmode% + \hbox to \csuse{Xendboxlinenum@#2}% + {% + \IfSubStr{RC}{\csuse{Xendboxlinenumalign@#2}}{\hfill}{}% + \printendlines#1|% + \IfSubStr{LC}{\csuse{Xendboxlinenumalign@#2}}{\hfill}{}% + }}% + \egroup% + \enspace% +}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\setprintendlines} +% The \cs{printendlines} macro is similar to \cs{printlines} but is +% for printing endnotes rather than footnotes. +% +% The principal difference between foot- and endnotes is that footnotes +% are printed on the page where they are specified but endnotes +% are printed at a different point in the document. We need an indication +% of the source of an endnote; \cs{setprintendlines} provides this +% by always printing the page number. The coding is slightly simpler than +% \cs{setprintlines}. +% +% First of all, we print the second page number only if +% the ending page number is different +% from the starting page number.\label{printendlines} +% \changes{v0.7.0}{2005/02/18}{Added \cs{setprintendlines} for use by +% \cs{printendlines}} +% \begin{macrocode} +\newcommand*{\setprintendlines}[6]{% + \l@d@pnumfalse \l@d@dashfalse + \ifnum#4=#1 \else + \l@d@pnumtrue + \l@d@dashtrue + \fi +% \end{macrocode} +% +% We print the ending line number if\/: (1)~we are printing the ending +% page number, or (2)~it is different from the starting line number. +% \begin{macrocode} + \ifl@d@pnum \l@d@elintrue \else \l@d@elinfalse \fi + \ifnum#2=#5 \else + \l@d@elintrue + \l@d@dashtrue + \fi +% \end{macrocode} +% +% We print the starting sub-line if it is nonzero. +% \begin{macrocode} + \l@d@ssubfalse + \ifnum#3=0 \else + \l@d@ssubtrue + \fi +% \end{macrocode} +% +% We print the ending sub-line if it is nonzero and: (1)~it is different +% from the starting sub-line number, or (2)~the ending line number is +% being printed. +% \begin{macrocode} + \l@d@eslfalse + \ifnum#6=0 \else + \ifnum#6=#3 + \ifl@d@elin \l@d@esltrue \else \l@d@eslfalse \fi + \else + \l@d@esltrue + \l@d@dashtrue + \fi + \fi% +% \end{macrocode} +% \begin{macrocode} + \ifl@d@dash% + \ifboolexpr{togl{fulllines@} or test{\ifcsempty{Xendtwolines@\@currentseries}}}% + {}% + {% + \setistwofollowinglines{#1}{#2}{#4}{#5}% + \ifboolexpr{% + (% + togl {Xendtwolinesbutnotmore@\@currentseries}% + and not% + (% + bool {istwofollowinglines@}% + )% + )% + or% + (% + (not test{\ifnumequal{#1}{#4}})% + and togl{Xendtwolinesonlyinsamepage@\@currentseries}% + )% + }% + {}% + {% + \l@d@dashfalse% + \l@d@Xtwolinestrue% + \l@d@elinfalse% + \l@d@eslfalse% + \ifcsempty{Xendmorethantwolines@\@currentseries}% + {}% + {\ifistwofollowinglines@\else% + \l@d@Xmorethantwolinestrue% + \fi% + }% + }% + }% + \fi% +% \end{macrocode} +% End of \cs{setprintendlines}. +% \begin{macrocode} +}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\printendlines} +% Now we are ready to print it all. +% \changes{v0.3.0}{2004/02/14}{Added \cs{linenumr@p} and \cs{sublinenumr@p} +% to \cs{printendlines}} +% \begin{macrocode} +\def\printendlines#1|#2|#3|#4|#5|#6|#7|{\begingroup + \setprintendlines{#1}{#2}{#3}{#4}{#5}{#6}% +% \end{macrocode} +% The only subtlety left here is when to print a period between +% numbers. But the only instance in which this is tricky is for the +% ending sub-line number: it could be coming after the starting +% sub-line number (in which case we want only the dash) or after an +% ending line number (in which case we need to insert a period). +% +% So, first, print the start lines. +% \begin{macrocode} + \ifdimequal{\csuse{Xendboxstartlinenum@\@currentseries}}{0pt}% + {\bgroup}% + {\leavevmode\hbox to \csuse{Xendboxstartlinenum@\@currentseries}\bgroup\hfill}% + \printnpnum{#1}% + \linenumrep{#2}% + \ifl@d@ssub \fullstop \sublinenumrep{#3}\fi + \egroup% +% \end{macrocode} +% And now, print the dash + the end line number, or the line number range symbol. +% \begin{macrocode} + \ifdimequal{\csuse{Xendboxendlinenum@\@currentseries}}{0pt}% + {\bgroup}% + {\hbox to \csuse{Xendboxendlinenum@\@currentseries}\bgroup}% + \ifl@d@Xtwolines% + \ifl@d@Xmorethantwolines% + \csuse{Xendmorethantwolines@\@currentseries}% + \else% + \csuse{Xendtwolines@\@currentseries}% + \fi% + \else% + \ifl@d@dash \endashchar\fi% + \ifl@d@pnum \printnpnum{#4}\fi% + \ifl@d@elin \linenumrep{#5}\fi% + \ifl@d@esl \ifl@d@elin \fullstop\fi \sublinenumrep{#6}\fi% + \fi% + \ifdimequal{\csuse{Xendboxendlinenum@\@currentseries}}{0pt}% + {}% + {\hfill}%Prevent underfull hbox + \egroup% + \endgroup% +}% + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\printnpnum} +% A macro to print a page number in an endnote. +% \begin{macrocode} +\newcommand*{\printnpnum}[1]{p.#1) } + +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\doendnotes} +% \begin{macro}{\ifXendinsertsep@} +% \cs{doendnotes} is +% the command you use to print one series of endnotes; it +% takes one argument: the series letter of the note series you want +% to print. +% \cs{Xendinsertsep@} is set to true at the first note of the series, and to false at the last one. +% \begin{macrocode} +\newif\ifXendinsertsep@% +\newcommand*{\doendnotes}[1]{% + \l@dend@close{#1}% + \begingroup + \makeatletter + \expandafter\let\csname #1end\endcsname=\endprint + \input\jobname.#1end% + \global\Xendinsertsep@false% + \endgroup} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\doendnotesbysection} +% \cs{doendnotesbysection} is a variant of the previous macro. +% While \cs{doendnotes} print endnotes for all of numbered sections +% \cs{doendnotesbysection} print the endnotes for the first numbered section at its first call for a series, then for the second section at its second call for the same series, then for the third section at its third call for the same series, and so on. +% \begin{macrocode} +\newcommand*{\doendnotesbysection}[1]{% + \l@dend@close{#1}% + \global\expandafter\advance\csname #1end@bysection\endcsname by 1% + \begingroup% + \makeatletter% + \def\l@d@section##1{% + \ifnumequal{##1}{\csname #1end@bysection\endcsname}% + {\cslet{#1end}{\endprint}}% + {\cslet{#1end}{\@gobblefive}}% + }% + \input\jobname.#1end% + \global\Xendinsertsep@false% + \endgroup% +}% +% \end{macrocode} +% \end{macro} +% End of section for end notes +% \begin{macrocode} +}% +% \end{macrocode} +% \section{Generate series of notes}% +% In this section, X means the name of the series (A, B etc.) +% \begin{macro}{\series} +% \cs{series}\cs{series} creates one more new series. It is a public command, which just loops on the private command \cs{newseries@}. +% \begin{macrocode} +\newcommand{\newseries}[1]{% + \def\do##1{\newseries@{##1}}% + \docsvlist{#1} +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\@series} +% The \cs{series@} macro is an \Lpack{etoolbox} list, which contains the name of all series. +% \begin{macrocode} +\newcommand{\@series}{} +% \end{macrocode} +% \end{macro} +% The command \cs{newseries@}\cs{series} creates a new series of the footnote. +% \begin{macro}{\newseries@} +% \begin{macrocode} +\newcommand{\newseries@}[1]{ +% \end{macrocode} +% \subsection{Test if series is still existing} +% \begin{macrocode} + \xifinlist{#1}{\@series}{\led@warn@SeriesStillExist{#1}}% + {% +% \end{macrocode} +% \subsection{Init specific to \parpackage} +% When calling \cs{newseries@} after having loaded \parpackage, we need to load specific setting. +% \begin{macrocode} + \ifdefined\newseries@par% + \newseries@par{#1}% + \fi% +% \end{macrocode} +% \subsection{For critical footnotes} +% Critical footnotes are those which start with letters. +% We look for the \cs{nocritical} option of \macpackage. +% \begin{macrocode} + \unless\ifnocritical@ +% \end{macrocode} +% \subsubsection{Options} +% \begin{macrocode} + \newtoggle{Xparindent@#1} + \newtoggle{Xlemmadisablefontselection@#1} + \csgdef{Xhangindent@#1}{0pt}% + \csgdef{Xragged@#1}{}% + \csgdef{Xhsizetwocol@#1}{0.45 \hsize}% + \csgdef{Xhsizethreecol@#1}{.3 \hsize}% + \csgdef{Xcolalign@#1}{\raggedright}% + \csgdef{Xnotenumfont@#1}{\normalfont}% + \csgdef{Xnotefontsize@#1}{\footnotesize}% + \csgdef{Xbhooknote@#1}{}% + + \csgdef{Xboxlinenum@#1}{0pt}% + \csgdef{Xboxlinenumalign@#1}{L}% + + \csgdef{Xboxstartlinenum@#1}{0pt}% + \csgdef{Xboxendlinenum@#1}{0pt}% + + \csgdef{Xboxsymlinenum@#1}{0pt}% + \newtoggle{Xnumberonlyfirstinline@#1}% + \newtoggle{Xnumberonlyfirstintwolines@#1}% + \csgdef{Xtwolines@#1}{}% + \csgdef{Xmorethantwolines@#1}{}% + \newtoggle{Xtwolinesbutnotmore@#1}% + \newtoggle{Xtwolinesonlyinsamepage@#1}% + \newtoggle{Xonlypstart@#1}% + \newtoggle{Xpstarteverytime@#1}% + \newtoggle{Xpstart@#1}% + \csgdef{Xsymlinenum@#1}{}% + \newtoggle{Xnonumber@#1}% + \csgdef{Xbeforenumber@#1}{0pt}% + \csgdef{Xafternumber@#1}{0.5em}% + \newtoggle{Xnonbreakableafternumber@#1}% + \csgdef{Xbeforesymlinenum@#1}{\csuse{Xbeforenumber@#1}}% + \csgdef{Xaftersymlinenum@#1}{\csuse{Xafternumber@#1}}% + \csgdef{Xinplaceofnumber@#1}{1em}% + \global\cslet{Xlemmaseparator@#1}{\rbracket}% + \csgdef{Xbeforelemmaseparator@#1}{0em}% + \csgdef{Xafterlemmaseparator@#1}{0.5em}% + \csgdef{Xinplaceoflemmaseparator@#1}{1em}% + \csgdef{Xbeforenotes@#1}{1.2em \@plus .6em \@minus .6em} + \csgdef{Xafterrule@#1}{0pt} + \csgdef{Xtxtbeforenotes@#1}{} + \csgdef{Xmaxhnotes@#1}{0.8\vsize} + \newtoggle{Xnoteswidthliketwocolumns@#1}% + \csgdef{Xparafootsep@#1}{}% + \csgdef{Xafternote@#1}{1em plus.4em minus.4em} +% \end{macrocode} +% \subsubsection{Create inserts, needed to add notes in foot} +% As regards inserts, see chapter 15 of \thetexbook by D. Knuth. +% \begin{macrocode} + \expandafter\newinsert\csname #1footins\endcsname% + \unless\ifnoledgroup@% + \expandafter\newinsert\csname mp#1footins\endcsname% + \fi% +% \end{macrocode} +% \subsubsection{Create commands for critical apparatus, \cs{Afootnote}, \cs{Bfootnote} etc.} +% Note the double \# in command: it is because command it is made inside another command. +% \changes{v1.4.0}{2012/11/16}{Remembers the language of the lemma, in order to create a correct direction for the footnote separator.} +% \changes{v1.23.0}{2015/04/29}{Prevent spurious spaces when \cs{Afootnote} and similar commands are followed by spaces (bug added on 1.0.0!).} +% \begin{macrocode} + \global\notbool{parapparatus@}{\expandafter\newcommand\expandafter *}{\expandafter\newcommand}\csname #1footnote\endcsname[2][]{% + \ifnum\@edtext@level>0% + \begingroup% + \newcommand{\content}{##2}% + \ifnumberedpar@% + \ifledRcol% + \ifluatex% + \footnotelang@lua[R]% + \fi% + \@ifundefined{xpg@main@language}%if polyglossia + {}% + {\footnotelang@poly[R]}% + \footnoteoptions@[R]{##1}{true}% + \xright@appenditem{% + \noexpand\prepare@preXnotes{#1}% + \noexpand\prepare@edindex@fornote{\l@d@nums}% + \unexpanded{\def\sw@list@inedtext}{\expandafter\unexpanded\expandafter{\sw@inthisedtext}}%The value of the \sw@inthisedtext of current \edtext will be pushed to \sw@list@inedtext when the notes are expanded. + \noexpand\csuse{v#1footnote}{#1}% + {{\l@d@nums}{\expandonce\@tag}{\expandonce\content}}% + }\to\inserts@listR + \footnoteoptions@[R]{##1}{false}% + \global\advance\insert@countR \@ne% + \else% + \ifluatex% + \footnotelang@lua% + \fi% + \@ifundefined{xpg@main@language}%if polyglossia + {}% + {\footnotelang@poly}% + \footnoteoptions@{##1}{true}% + \xright@appenditem{% + \noexpand\prepare@preXnotes{#1}% + \noexpand\prepare@edindex@fornote{\l@d@nums}% + \unexpanded{\def\sw@list@inedtext}{\expandafter\unexpanded\expandafter{\sw@inthisedtext}}%The value of the \sw@inthisedtext of current edtext will be pushed to \sw@list@inedtext when the notes are expanded. + \noexpand\csuse{v#1footnote}{#1}% + {{\l@d@nums}{\expandonce\@tag}{\expandonce\content}}% + }\to\inserts@list + \global\advance\insert@count \@ne% + \footnoteoptions@{##1}{false}% + \fi + \else + \csuse{v#1footnote}{#1}{{0|0|0|0|0|0|0}{}{##1}}% + \fi% + \endgroup% + \else% + \led@err@FootnoteWithoutEdtext% + \fi% + \ignorespaces% + } +% \end{macrocode} +% We need to be able to modify \macpackage's footnote macros and restore their +% \begin{macrocode} + \global\csletcs{#1@@footnote}{#1footnote} +% \end{macrocode} +% \subsubsection{Set standard display} +% \begin{macrocode} + \Xarrangement@normal{#1}% +% \end{macrocode} +% End of for critical footnotes. +% \begin{macrocode} + \fi +% \end{macrocode} +% \subsection{For familiar footnotes} +% Familiar footnotes are those which end with letters. +% We look for the \verb+nofamiliar+ option of \macpackage. +% \begin{macrocode} + \unless\ifnofamiliar@ +% \end{macrocode} +% \subsubsection{Options} +% \begin{macrocode} + \newtoggle{parindentX@#1} + \csgdef{hangindentX@#1}{0pt}% + \csgdef{raggedX@#1}{}% + \csgdef{hsizetwocolX@#1}{0.45 \hsize}% + \csgdef{hsizethreecolX@#1}{.3 \hsize}% + \csgdef{colalignX@#1}{\raggedright}% + \csgdef{notenumfontX@#1}{\normalfont}% + \csgdef{notefontsizeX@#1}{\footnotesize}% + \csgdef{bhooknoteX@#1}{}% + \csgdef{afterruleX@#1}{0pt} + \csgdef{beforenotesX@#1}{1.2em \@plus .6em \@minus .6em} + \csgdef{maxhnotesX@#1}{0.8\vsize}% + \newtoggle{noteswidthliketwocolumnsX@#1}% + \csgdef{parafootsepX@#1}{}% + \csgdef{afternoteX@#1}{1em plus.4em minus.4em} +% End of for familiar footnotes. +% \subsubsection{Create inserts, needed to add notes in foot} +% As regards inserts, see chapter 15 of the TeXBook by D. Knuth. +% \begin{macrocode} + \expandafter\newinsert\csname footins#1\endcsname% + \unless\ifnoledgroup@% + \expandafter\newinsert\csname mpfootins#1\endcsname% + \fi% +% \end{macrocode} +%\subsubsection{Create tools for familiar footnotes (\cs{footnoteX})} +% First, create the \cs{footnoteX} command. +% Note the double \# in command: it is because a command is called inside another command. +% \begin{macrocode} + + \global\expandafter\newcommand\csname footnote#1\endcsname[1]{% + \begingroup% + \prepare@prenotesX{#1}% + \newcommand{\content}{##1}% + \stepcounter{footnote#1}% + \protected@csxdef{@thefnmark#1}{\csuse{thefootnote#1}}% + \nottoggle{nomk@}%Nomk is set to true when using \footnoteXnomk with \parpackage + {\csuse{@footnotemark#1}}% + {}% + \ifluatex% + \xdef\footnote@luatextextdir{\the\luatextextdir}% + \xdef\footnote@luatexpardir{\the\luatexpardir}% + \fi% + \csuse{vfootnote#1}{#1}{\expandonce\content}\m@mmf@prepare% + \endgroup% + } +% \end{macrocode} +% Then define the counters. +% \begin{macrocode} + \newcounter{footnote#1} + \global\expandafter\renewcommand\csname thefootnote#1\endcsname{\arabic{footnote#1}} +% \end{macrocode} +% Do not forget to initialize series +% \begin{macrocode} + \arrangementX@normal{#1}% + \fi +% \end{macrocode} +% \subsection{The endnotes} +% \changes{v2.0.0}{2015/07/19}{One endnotes file by series.} +% Endnotes are commands like \cs{Xendnote}, where X is a series letter. +% First, we check for the \verb+noend+ options. +% \begin{macrocode} + \unless\ifnoend@ +% \end{macrocode} +% \subsubsection{The auxiliary file} +% \begin{macro}{\l@d@Xend} +% \begin{macro}{\ifl@dend@X} +% \begin{macro}{\l@dend@Xtrue} +% \begin{macro}{\l@dend@Xfalse} +% Endnotes of all varieties are saved up in a file, one by series, typically named +% \meta{jobname}\file{.Xend}. +% \cs{l@d@end} is the output stream number for +% this file, and \cs{ifl@dend@X} is a flag that is \verb"true" when the file is open. +% +% +% \begin{macrocode} + \expandafter\newwrite\csname l@d@#1end\endcsname% + \expandafter\newif\csname ifl@dend@#1\endcsname% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \subsubsection{The main macro} +% The \cs{Xendnote} macro functions to +% write one endnote to the \file{.Xend} file. We change +% \cs{newlinechar} so that in the file every space becomes the +% start of a new line; this generally ensures that a long note does not +% exceed restrictions on the length of lines in files. +% \begin{macrocode} + + \global\expandafter\newcommandx\csname #1endnote\endcsname[2][1,usedefault]{% + \bgroup% + \newlinechar='40% + \global\@noneed@Footnotetrue% + \newcommand{\content}{##2}% + \expandafter\immediate\expandafter\write\csname l@d@#1end\endcsname{% + \expandafter\string\csname #1end\endcsname% + {\ifnumberedpar@\l@d@nums\fi}% + {\ifnumberedpar@\expandonce\@tag\fi}% + {\expandonce\content}% + {#1}% + {##1}% + \@percentchar% + }% + \egroup% + \ignorespaces% + }% +% \end{macrocode} +% \cs{Xendnote} commands called \cs{Xend} commands on to the endnote file; these are analogous to the various +% \verb"footfmt" commands above, and they take the same arguments. +% When we process this file, we want to pick out the notes of one +% series and ignore all the rest. To do that, we equate the \verb"end" +% command for the series we want to \cs{endprint}, and leave the +% rest equated to \cs{@gobblefive}, which just skips over its five +% arguments. +% \begin{macrocode} + + \global\cslet{#1end}{\@gobblefive} +% \end{macrocode} +% We need to store the number of times \cs{doendnotesbysection} is called for one series. +% \begin{macrocode} + \global\expandafter\newcount\csname #1end@bysection\endcsname% +% \end{macrocode} +% \subsubsection{The options} +% \begin{macrocode} + \csgdef{Xendtwolines@#1}{}% + \csgdef{Xendmorethantwolines@#1}{}% + \newtoggle{Xendtwolinesbutnotmore@#1}{}% + \newtoggle{Xendtwolinesonlyinsamepage@#1}{}% + \newtoggle{Xendlemmadisablefontselection@#1}% + \csgdef{Xendnotenumfont@#1}{\normalfont}% + \csgdef{Xendnotefontsize@#1}{\footnotesize}% + \csgdef{Xendbhooknote@#1}{}% + + \csgdef{Xendboxlinenum@#1}{0pt}% + \csgdef{Xendboxlinenumalign@#1}{L}% + + \csgdef{Xendboxstartlinenum@#1}{0pt}% + \csgdef{Xendboxendlinenum@#1}{0pt}% + + \csgdef{Xendlemmaseparator@#1}{}% + \csgdef{Xendbeforelemmaseparator@#1}{0em}% + \csgdef{Xendafterlemmaseparator@#1}{0.5em}% + \csgdef{Xendinplaceoflemmaseparator@#1}{0.5em}% + + \newtoggle{Xendparagraph@#1}% + \csgdef{Xendafternote@#1}{1em plus.4em minus.4em}% + \csgdef{Xendsep@#1}{}% + + \csgdef{Xendinplaceofnumber@#1}{0pt}% + \newtoggle{Xendnonumber@#1}% +% \end{macrocode} +% End of endnotes declaration +% \begin{macrocode} + \fi% +% \end{macrocode} +% Dump series in \cs{@series} +% \begin{macrocode} + \listxadd{\@series}{#1} + } +}% End of \newseries +% \end{macrocode} +% \end{macro} +% \subsection{Init standards series (A,B,C,D,E)} +% \begin{macrocode} +\expandafter\newseries\expandafter{\default@series} +% \end{macrocode} +% \section{Setting series display} +% \subsection{Change series order} +% \changes{v1.1.0}{2012/09/25}{New tools to change order of series} +% \changes{v1.21.0}{2015/04/13}{\cs{seriesatbegin} and \cs{seriesatbegin} more efficient} +% \begin{macro}{\seriesatbegin} +% \cs{seriesatbegin}\marg{s} changes the order of series, to put the series \meta{s} at the beginning of the list. +% The series can be the result of a command. +% \begin{macrocode} +\newcommand{\seriesatbegin}[1]{% + \StrDel{\@series}{#1}[\@series]% + \edef\@new{}% + \listeadd{\@new}{#1}% + \listeadd{\@new}{\@series}% + \xdef\@series{\@new}% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\seriesatend} +% \changes{v1.21.0}{2015/04/13}{Fix spurious space in \cs{seriesatend}} +% And \cs{seriesatend} moves the series to the end of the list. +% \begin{macrocode} +\newcommand{\seriesatend}[1]{% + \StrDel{\@series}{#1}[\@series]% + \edef\@new{}% + \listeadd{\@new}{\@series}% + \listeadd{\@new}{#1}% + \xdef\@series{\@new}% +} +% \end{macrocode} +% \end{macro} +% \subsection{Test series order} +% \begin{macro}{\ifseriesbefore} +% \cs{ifseriesbefore}\marg{seriesA}\marg{seriesB}\marg{true}\marg{false} expands \meta{true} if \meta{seriesA} is printed before \meta{seriesB}, expands \meta{false} otherwise. +% \begin{macrocode} +\newcommand{\ifseriesbefore}[4]{% + \StrPosition{\@series}{#1}[\@first]% + \StrPosition{\@series}{#2}[\@second]% + \ifnumgreater{\@second}{\@first}{#3}{#4}% +} +% \end{macrocode} +% \end{macro} +% \subsubsection{Get the first series} +% In some specific case, we need to know the first series of the list of series. +% \begin{macro}{\@getfirstseries} +% \begin{macrocode} +\newcommand{\@getfirstseries}{% + \ifdefempty{\@series}% + {\xdef\@firstseries{}}% + {\StrChar{\@series}{1}[\@firstseries]}% +}% +% \end{macrocode} +% \end{macro} +% \changes{v1.0.0}{2012/09/15}{New generic commands to customize footnote display.} +% \subsection{Series setting} +% \subsubsection{General way of working} +% The setting's command (like \cs{numberonlyfirstinline}), also called ``hooks'' can be divided in two categories: those which require a string values and those which require a boolean value. +% The first category includes those which require a length value, because we store the length's expression send by user and we evaluate it only in the commands which requires to know the setting. +% The second category require boolean value only when it is set to FALSE. +% Otherwise, we understand the insinuated value is TRUE. +% +% For each ``hook'' command, we store the value in commands (first category) or a \Lpack{etoolbox}'s toggle (second category) which names are in the form \cs{<hook>@<series>}. +% For example when calling \cs{twolines}\marg{sq.}, we store \verb+sq.+ in commands \cs{twolines@A}, \cs{twolines@B}, \cs{twolines@C}\ldots for each series defined for use with \macpackage, or, if the \oarg{series} optional argument was send, for each series of this argument. +% +% These values are tested in some specific places, scattered in all the code, depending of their effects. +% The default values are defined by the \cs{newseries@} command. +% +% +% In order to prevent code duplication, we have created some generic commands. +% Some of them change the value of any hook send as argument. +% Some other, getting a hook name, generate the user level commands. +% +% +% +% \subsubsection{Tools to set options} +% \begin{macro}{\settoggle@series} +% \changes{v1.1.0}{2012/09/25}{\cs{settoggle@series} switch the global value of the toggle, not only the local value.} +% \changes{v1.13.0}{2014/09/16}{\cs{settoggle@series} can take an optional arguments to reload series setup.} +% \cs{settoggle@series}\marg{series}\marg{toggle}\marg{value} is a generic command to switch toggles for some series. +% The arguments are: +% \begin{itemize} +% \item \verb+#1+ (mandatory): the series for which the hooks should be set. If empty, all the series will be affected. +% \item \verb+#2+ (mandatory): the name of the hook. +% \item \verb+#3+ (mandatory): the new value of toggle (true or false). +% \item \verb+#4+ (optional): if equal to \verb+reload+, reload the footnote setting (call again \cs{Xarrangement} or \cs{arrangementX} or \ldots\ depending of the footnote display). +% \item \verb+#5+ (optional): if not empty, and if \verb+#1+ is empty, change the hook setting for pseudo-series, as \verb+appref+. +% \end{itemize} +% \begin{macrocode} +\newcommandx{\settoggle@series}[5][4,5,usedefault]{% + \def\do##1{% + \global\settoggle{#2@##1}{#3}% + \ifstrequal{#4}{reload}% + {% + \csuse{Xarrangement@\csuse{series@display##1}}{##1}% + \csuse{arrangementX@\csuse{series@displayX##1}}{##1}% + }% + {}% + }% + \ifstrempty{#1}{% + \dolistloop{\@series}% + \ifstrempty{#5}{}{% + \docsvlist{#5}% + } + }% + {% + \docsvlist{#1}% + }% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\setcommand@series} +% \cs{setcommand@series}\marg{series}\marg{command}\marg{value} is a generic command to store hook's value into commands specific to some series. +% The arguments are: +% \begin{itemize} +% \item \verb+#1+ (mandatory): the series for which the hooks should be set. If empty, all the series will be affected. +% \item \verb+#2+ (mandatory): the name of the hook. +% \item \verb+#3+ (mandatory): the new value of the hook/command. +% \item \verb+#4+ (optional): if equal to \verb+reload+, reload the footnote setting (call \cs{footnormal} or \cs{footparagraph} or \ldots\ depending of the footnote display). +% \item \verb+#5+ (optional): if not empty, and if \verb+#1+ is empty, change the hook setting for pseudo-series, as \verb+appref+. +% \end{itemize} +% \begin{macrocode} +\newcommandx{\setcommand@series}[5][4,5,usedefault]{% + \def\do##1{ + \csgdef{#2@##1}{#3} + \ifstrequal{#4}{reload}{ + \csuse{Xarrangement@\csuse{series@display##1}}{##1}% + \csuse{arrangementX@\csuse{series@displayX##1}}{##1}% + }{}} + \ifstrempty{#1}{% + \dolistloop{\@series}% + \ifstrempty{#5}{}{% + \docsvlist{#5} + } + }% + {% + \docsvlist{#1}% + }% +}% +% \end{macrocode} +% \end{macro} +% \subsubsection{Tools to generate options commands} +% \begin{macro}{\newhookcommand@series} +% \cs{newhookcommand@series}\cs{command names} is a generic command to add new commands for hooks, like \cs{Xhsizetwocol}. +% The first argument is the name of the hook, the second a comma separated list of pseudo-series where the hook can be used, like \verb+appref+ in the case of \cs{Xtwolines}. +% The second argument is also used to create commands named \cs{<hookname><pseudoseries>}, +% like \cs{Xtwolinesappref}. +% \changes{v1.21.0}{2015/04/13}{\cs{newhookcommand@series} can take an optional argument.} +% \begin{macrocode} +\newcommandx{\newhookcommand@series}[2][2,usedefault]{% + \global\expandafter\newcommand\expandafter*\csname #1\endcsname[2][]{% + \setcommand@series{##1}{#1}{##2}[][#2]% + }% + \ifstrempty{#2}{}{% + \def\do##1{% + \global\expandafter\newcommand\expandafter*\csname #1##1\endcsname[1]{% + \csuse{#1}[##1]{####1}% + }% + }% + \docsvlist{#2}% + }% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\newhooktoggle@series} +%\cs{newhooktoggle@series}\cs{command names} is a generic command to add new commands for a new toggle hook, like \cs{Xnumberonlyfirstinline}. +% The second argument is also used to create commands named \cs{<hookname><pseudoseries>}, +% like \cs{Xtwolinesbutnotmoreappref}. +% \changes{v1.21.0}{2015/04/13}{\cs{newhooktoggle@series} can take an optional argument.} +% \begin{macrocode} +\newcommandx{\newhooktoggle@series}[2][2,usedefault]{% + \global\expandafter\newcommandx\expandafter*\csname #1\endcsname[2][1,2={true},usedefault]{% + \settoggle@series{##1}{#1}{##2}[][#2]% + }% + \ifstrempty{#2}{}{% + \def\do##1{% + \global\expandafter\newcommand\expandafter*\csname #1##1\endcsname{% + \csuse{#1}[##1]% + }% + }% + \docsvlist{#2}% + }% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\newhooktoggle@series@reload} +% \changes{v1.13.0}{2014/09/16}{Add \cs{newhookcommand@toggle@reload}} +% \cs{newhookcommand@toggle@reload} does the same thing as \cs{newhooktoggle@series} +% but the commands created by this macro also reload the series arrangement. +% \begin{macrocode} +\newcommand{\newhooktoggle@series@reload}[1]{% + \global\expandafter\newcommandx\expandafter*\csname #1\endcsname[2][1,2={true},usedefault]{% + \settoggle@series{##1}{#1}{##2}[reload]% + }% +}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\newhookcommand@series@reload} +% \changes{v1.8.0}{2013/11/24}{Debug \cs{beforenotesX} and \cs{maxhnotesX} which did not work.} +% \changes{v1.12.0}{2014/08/05}{Debug \cs{beforenotesX} and \cs{maxhnotesX} which did not work when called after \cs{footparagraphX}.} +% \changes{v1.12.0}{2014/08/05}{Debug \cs{Xbeforenotes} and \cs{Xmaxhnotes} which did not work when called after \cs{footparagraph}.} +% \cs{newhookcommand@series@reload} does the same thing as \cs{newhookcommand@series} +% but the commands created by this macro also reload the series' arrangement. +% +% \begin{macrocode} +\newcommand{\newhookcommand@series@reload}[1]{% + \global\expandafter\newcommand\expandafter*\csname #1\endcsname[2][]{% + \setcommand@series{##1}{#1}{##2}[reload]% + }% +} +% \end{macrocode} +% \end{macro} +% \subsubsection{Options for critical notes} +% Before generating the commands that are used to set the critical notes, such as \cs{Xnumberonlyfirstinline}, \cs{Xlemmaseparator} and the like, we check the \verb+nocritical+ option. +% \begin{macrocode} +\unless\ifnocritical@ + \newhooktoggle@series{Xparindent} + \newhookcommand@series{Xtwolines}[appref] + \newhookcommand@series{Xmorethantwolines}[appref] + \newhooktoggle@series{Xtwolinesbutnotmore}[appref] + \newhooktoggle@series{Xtwolinesonlyinsamepage}[appref] + \newhookcommand@series{Xhangindent} + \newhookcommand@series{Xragged} + \newhookcommand@series{Xhsizetwocol} + \newhookcommand@series{Xhsizethreecol} + \newhookcommand@series{Xcolalign}% + \newhookcommand@series{Xnotenumfont} + \newhookcommand@series{Xbhooknote} + \newhookcommand@series{Xboxsymlinenum}% + \newhookcommand@series{Xsymlinenum} + \newhookcommand@series{Xbeforenumber} + \newhookcommand@series{Xafternumber} + \newhookcommand@series{Xbeforesymlinenum} + \newhookcommand@series{Xaftersymlinenum} + \newhookcommand@series{Xinplaceofnumber} + \newhookcommand@series{Xlemmaseparator} + \newhookcommand@series{Xbeforelemmaseparator} + \newhookcommand@series{Xafterlemmaseparator} + \newhookcommand@series{Xinplaceoflemmaseparator} + \newhookcommand@series{Xtxtbeforenotes} + \newhookcommand@series@reload{Xafterrule} + \newhooktoggle@series{Xnumberonlyfirstinline} + \newhooktoggle@series{Xnumberonlyfirstintwolines} + \newhooktoggle@series{Xnonumber} + \newhooktoggle@series{Xpstart} + \newhooktoggle@series{Xpstarteverytime}% + \newhooktoggle@series{Xonlypstart} + \newhooktoggle@series{Xnonbreakableafternumber} + \newhooktoggle@series{Xlemmadisablefontselection} + \newhookcommand@series@reload{Xmaxhnotes} + \newhookcommand@series@reload{Xbeforenotes} + \newhooktoggle@series@reload{Xnoteswidthliketwocolumns}% + \newhookcommand@series{Xnotefontsize} + + \newhookcommand@series{Xboxlinenum}% + \newhookcommand@series{Xboxlinenumalign}% + + \newhookcommand@series{Xboxstartlinenum}% + \newhookcommand@series{Xboxendlinenum}% + + \newhookcommand@series{Xafternote}% + \newhookcommand@series{Xparafootsep} + +\fi +% \end{macrocode} +% \subsubsection{Options for familiar notes} +% Before generating the optional commands for familiar notes, we check the \cs{nofamiliar} option. +% \begin{macrocode} +\unless\ifnofamiliar@ + \newhooktoggle@series{parindentX} + \newhookcommand@series{hangindentX} + \newhookcommand@series{raggedX} + \newhookcommand@series{hsizetwocolX} + \newhookcommand@series{hsizethreecolX} + \newhookcommand@series{colalignX}% + \newhookcommand@series{notenumfontX} + \newhookcommand@series{bhooknoteX} + \newhookcommand@series@reload{beforenotesX} + \newhookcommand@series@reload{maxhnotesX} + \newhooktoggle@series@reload{noteswidthliketwocolumnsX}% + \newhookcommand@series@reload{afterruleX} + \newhookcommand@series{notefontsizeX} + \newhookcommand@series{afternoteX} + \newhookcommand@series{parafootsepX} +\fi +% \end{macrocode} +% \subsubsection{Options for endnotes} +% Before generating the commands that are used to set the endnotes, such as \cs{Xnumberonlyfirstinline}, \cs{Xlemmaseparator}+ and the like, we check the \verb+noend+ option. +% \begin{macrocode} +\unless\ifnoend@ + \newhookcommand@series{Xendtwolines}[apprefwithpage] + \newhookcommand@series{Xendmorethantwolines}[apprefwithpage] + \newhooktoggle@series{Xendtwolinesbutnotmore}[apprefwithpage] + \newhooktoggle@series{Xendtwolinesonlyinsamepage}[apprefwithpage] + \newhookcommand@series{Xendnotenumfont} + \newhookcommand@series{Xendbhooknote} + + \newhookcommand@series{Xendboxlinenum}% + \newhookcommand@series{Xendboxlinenumalign}% + + \newhookcommand@series{Xendboxstartlinenum}% + \newhookcommand@series{Xendboxendlinenum}% + + \newhookcommand@series{Xendnotefontsize} + \newhooktoggle@series{Xendlemmadisablefontselection} + \newhookcommand@series{Xendlemmaseparator} + \newhookcommand@series{Xendbeforelemmaseparator} + \newhookcommand@series{Xendafterlemmaseparator} + \newhookcommand@series{Xendinplaceoflemmaseparator} + + \newhooktoggle@series{Xendparagraph} + \newhookcommand@series{Xendafternote} + \newhookcommand@series{Xendsep} + + \newhookcommand@series{Xendinplaceofnumber}% + \newhooktoggle@series{Xendnonumber}% +\fi +% \end{macrocode} +% \subsection{Hooks for a particular footnote} +% \begin{macro}{\fulllines@} +%\cs{fulllines@} toggle is used to print the full lines references, and not the abbreviated form defined by \cs{Xtwolines} and \cs{Xmorethantwolines}. +% \begin{macrocode} +\newtoggle{fulllines@}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\nonum@} +%\cs{nonum@} toggle is used to disable line number printing in a particular footnote. +% \begin{macrocode} +\newtoggle{nonum@} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\nosep@} +%\cs{nonum@} toggle is used to disable the lemma separator in a particular footnote. +% \begin{macrocode} +\newtoggle{nosep@} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\nomk@} +%\cs{nomk@} toggle is used by \parpackage{} to remove the footnote mark in the text when using \cs{footnoteXmk}. Read \parpackage handbook. +% \begin{macrocode} +\newtoggle{nomk@}% +% \end{macrocode} +% \end{macro} +% \subsection{Alias} +% \begin{macro}{\Xnolemmaseparator} +%\cs{Xnolemmaseparator}\oarg{series} is just an alias for \cs{Xlemmaseparator}\oarg{series}\verb|{}|. +% \begin{macrocode} +\newcommandx*{\Xnolemmaseparator}[1][1]{\Xlemmaseparator[#1]{}} +% \end{macrocode} +% \end{macro} +% +% +% \section{Output routine} +% +% +% Now we begin the output routine and associated things. +% +% +% \subsubsection{Page number management} +% \begin{macro}{\pageno} +% \begin{macro}{\advancepageno} +% \cs{pageno} is a page number, starting at 1, and \cs{advancepageno} +% increments the number. +% \begin{macrocode} +\countdef\pageno=0 \pageno=1 +\newcommand*{\advancepageno}{\ifnum\pageno<\z@ \global\advance\pageno\m@ne + \else\global\advance\pageno\@ne\fi} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \subsubsection{Extra footnotes output} +% +% With luck we might only have to change \cs{@makecol} and +% \cs{@reinserts} of the \LaTeX's kernel. +% Since \reledmac, we use \Lpack{etoolbox}'s patching commands instead of overriding. +% It should provides better compatibility with other package which modify these commands + +% +% \begin{macro}{\doxtrafeet} +% \cs{doxtrafeet} is the code extending \cs{@makecol} to cater for +% the extra \macpackage feet. We have two categories of extra footnotes. +% By default, we order the footnote inserts so that the regular footnotes of \LaTeX\ are first, +% then familiar familiar footnotes and finally +% the critical footnotes. +% \changes{v0.2.1}{2003/09/13}{Renamed \cs{doxtrafeet} to \cs{l@ddoxtrafeet}} +% \changes{v1.9.0}{2014/02/05}{Add \cs{fnpos} to choice the order of footnotes.} +% \begin{macrocode} +\newcommand*{\l@ddoxtrafeet}{% + \IfStrEq{familiar-critical}{\@fnpos} + {\do@feetX\Xdo@feet}% + {% + \IfStrEq{critical-familiar}{\@fnpos}% + {\Xdo@feet\do@feetX}% + {\do@feetX\Xdo@feet}% + }% +}% + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Xdo@feet} +% \cs{Xdo@feet} is the code extending \cs{@makecol} to cater for +% the extra critical feet. +% \changes{v0.4.1}{2004/03/06}{Changed \cs{Xdo@feet} code for easier extensions} +% \begin{macrocode} +\newcommand*{\Xdo@feet}{% + \setbox\@outputbox \vbox{% + \unvbox\@outputbox + \@opXfeet}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@opXfeet} +% \begin{macro}{\print@Xnotes} +% The extra critical feet to be added to the output. +% \changes{v0.4.1}{2004/03/06}{Added \cs{@opXfeet}} +% The normal way to add one series, +% \cs{print@Xnotes}, is replaced by \parpackage when using \cs{Pages}. +% \begin{macrocode} +\newcommand\print@Xnotes[1]{% + \csuse{#1footstart}{#1}% + \csuse{#1footgroup}{#1}%% +}% +% \end{macrocode} +% We print all series of notes by looping on them. +% We check before printing them that they are not voided. +% \begin{macrocode} +\newcommand*{\@opXfeet}{% + \unless\ifnocritical@% + \gdef\firstXseries@{}% + \def\do##1{% + \ifvoid\csuse{##1footins}\else% + \global\skip\csuse{##1footins}=\csuse{Xbeforenotes@##1}% + \global\advance\skip\csuse{##1footins} by\csuse{Xafterrule@##1}% + \print@Xnotes{##1}% + \fi% + }% + \dolistloop{\@series}% + \fi% +}% +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\l@ddodoreinxtrafeet} +% \cs{l@ddodoreinxtrafeet} is the code for catering for the extra footnotes +% within \cs{@reinserts}. +% We use the same category and ordering as in \cs{l@ddoxtrafeet}. +% \changes{v0.2.1}{203/09/13}{Renamed \cs{dodoreinxtrafeet} to \cs{l@ddodoreinxtrafeet}} +% \begin{macrocode} +\newcommand*{\l@ddodoreinxtrafeet}{% + \IfStrEq{familiar-critical}{\@fnpos} + {\@doreinfeetX\X@doreinfeet}% + {% + \IfStrEq{critical-familiar}{\@fnpos}% + {\X@doreinfeet\@doreinfeetX}% + {\@doreinfeetX\X@doreinfeet}% + }% +} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\X@doreinfeet} +% \cs{X@doreinfeet} is the code for catering for the +% extra critical footnotes +% within \cs{@reinserts}. +% \begin{macrocode} +\newcommand*{\X@doreinfeet}{% + \unless\ifnocritical@% + \def\do##1{% + \ifvoid\csuse{##1footins}\else% + \insert\csuse{##1footins}{\unvbox\csuse{##1footins}}% + \fi}% + \dolistloop{\@series} + \fi% +} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\print@notesX} +% \begin{macro}{\do@feetX} +% \begin{macro}{\@doreinfeetX} +% We have to add all the new kinds of familiar footnotes to the output +% routine. +% The normal way to add one series. +% \cs{print@Xnotes} is replaced by \parpackage when using \cs{Pages}. +% \begin{macrocode} +\newcommand\print@notesX[1]{% + \csuse{footstart#1}{#1}% + \csuse{footgroup#1}{#1}% +}% +% \end{macrocode} +% We print all the series of notes by looping on them. +% We check before printing them that they are not voided. +% \begin{macrocode} +\newcommand*{\do@feetX}{% + \unless\ifnofamiliar@% + \gdef\firstseriesX@{}% + \setbox\@outputbox \vbox{% + \unvbox\@outputbox% + \def\do##1{% + \ifvoid\csuse{footins##1}\else% + \global\skip\csuse{footins##1}=\csuse{beforenotesX@##1}% + \global\advance\skip\csuse{footins##1} by\csuse{afterruleX@##1}% + \print@notesX{##1}% + \fi% + }% + \dolistloop{\@series}}% + \fi% +}% + +\newcommand{\@doreinfeetX}{% + \unless\ifnofamiliar@% + \def\do##1{% + \ifvoid\csuse{footins##1}\else + \insert% + \csuse{footins##1} + {\unvbox\csuse{footins##1}}% + \fi% + }% + \dolistloop{\@series}% + \fi% +}% + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsubsection{Standard output's commands patching} +% The \Lclass{memoir} class does not use the `standard' versions of +% \cs{@makecol} and \cs{@reinserts}, due to its sidebar insert. +% We had better add that code if \Lclass{memoir} is used. (It can +% be awkward dealing with |\if| code within |\if| code, so don't use +% |\ifl@dmemoir| here.) +% \changes{v0.2.1}{2003/09/13}{Major changes to insert code when memoir is loaded} +% \changes{v2.0.0}{2015/07/19}{\cs{@makecol}, \cs{@reinserts} and \cs{@doclearpage} are patched instead of begin redefined} +% \changes{v2.0.0}{2015/07/19}{\cs{doxtrafeeti} becomes \cs{do@feetX}; +% \cs{doxtrafeetii} becomes \cs{Xdo@feet}; +% \cs{@opxtrafeeti} becomes \cs{@opfeetX}; +% \cs{doreinxtrafeetii} becomes \cs{X@doreinfeet}; +% \cs{doreinxtrafeeti} becomes \cs{@doreinfeetX}.} +% \begin{macrocode} +\@ifclassloaded{memoir}{% +% \end{macrocode} +% \Lclass{memoir} is loaded so we use \Lclass{memoir}'s built in hooks. +% \begin{macrocode} + \g@addto@macro{\m@mdoextrafeet}{\l@ddoxtrafeet}% + \g@addto@macro{\m@mdodoreinextrafeet}{\l@ddodoreinxtrafeet}% + }{% +% \end{macrocode} +% \Lclass{memoir} has not been loaded, so patch \cs{@makecol} and +% \cs{@reinserts}. +% \begin{macrocode} + \@ifpackageloaded{fancyhdr}{% + \patchcmd% + {\latex@makecol}% + {\xdef\@freelist{\@freelist\@midlist}}% + {\xdef\@freelist{\@freelist\@midlist}\l@ddoxtrafeet}% + {}% + {\led@error@fail@patch@@makecol}% + }{% + \patchcmd% + {\@makecol}% + {\xdef\@freelist{\@freelist\@midlist}}% + {\xdef\@freelist{\@freelist\@midlist}\l@ddoxtrafeet}% + {}% + {\led@error@fail@patch@@makecol}% + }% + + \patchcmd% + {\@reinserts}% + {\ifvbox}% + {\l@ddodoreinxtrafeet\ifvbox}% + {}% + {\led@error@fail@patch@@reinserts}% +} + +% \end{macrocode} +% +% + +% It turns out that \cs{@doclearpage} also needs modifying. +% \changes{v0.4.1}{2004/03/25}{Added code for changing \cs{@doclearpage}} +% \begin{macro}{\if@led@nofoot} +% We have to check if there are any leftover feet. +% \begin{macrocode} +\newif\if@led@nofoot + +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\@ifclassloaded{memoir}{% +% \end{macrocode} +% If the \Lclass{memoir} class is loaded we hook into its modified +% \verb?\@doclearpage?. +% \begin{macro}{\@mem@extranofeet} +% \begin{macrocode} +\g@addto@macro{\@mem@extranofeet}{%% + \def\do#1{% + \unless\ifnocritical@% + \ifvoid\csuse{#1footins}\else\@mem@nofootfalse\fi% + \fi% + \unless\ifnofamiliar@% + \ifvoid\csuse{footins#1}\else\@mem@nofootfalse\fi% + \fi% + } + \dolistloop{\@series}% + }% +}{% +% \end{macrocode} +% \end{macro} +% As \Lclass{memoir} is not loaded we have patch \cs{@doclearpage}. +% \begin{macro}{\@led@testifnofoot} +% \begin{macro}{\@doclearpage} +% \begin{macrocode} +\newcommand*{\@led@testifnofoot}{% + \@led@nofoottrue% + \ifvoid\footins\else% + \@led@nofootfalse% + \fi% + \def\do##1{% + \unless\ifnocritical@% + \ifvoid\csuse{##1footins}\else% + \@led@nofootfalse% + \fi% + \fi% + \unless\ifnofamiliar@% + \ifvoid\csuse{footins##1}\else% + \@led@nofootfalse% + \fi% + \fi% + }% + \dolistloop{\@series}% +}% + +\pretocmd% + {\@doclearpage}% + {\@led@testifnofoot}% + {}% + {\led@error@fail@patch@@doclearpage}% + +\patchcmd% + {\@doclearpage}% + {\ifvoid\footins}% + {\if@led@nofoot}% + {}% + {\led@error@fail@patch@@doclearpage}% + +} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \section{Cross referencing} +% \label{xref}\relax +% +% +% +% You can mark a place in the text using a command of the form +% \cs{edlabel}\marg{foo}, and later refer to it using the label +% \meta{foo} by saying \cs{edpageref}\marg{foo}, or \cs{lineref}\marg{foo} or +% \cs{sublineref}\marg{foo} or \cs{pstartref}. These reference commands will produce, +% respectively, the page, line sub-line and pstart on which the +% \cs{edlabel}\marg{foo} command occurred. +% +% The reference macros warn you if a reference is made to an +% undefined label. +% If \marg{foo} has been used as a label before, +% the \cs{edlabel}\marg{foo} command will issue a complaint; subsequent +% \cs{edpageref} and \cs{edlineref} commands will refer to the +% latest occurrence of \cs{edlabel}\marg{foo}. +% +% \begin{macro}{\labelref@list} +% Set up a new list, \cs{labelref@list}, to hold the page, line and +% sub-line numbers for each label. +% \begin{macrocode} +\list@create{\labelref@list} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\zz@@@} +% A convenience macro to zero two labeling counters in one go. +% \changes{v0.2.1}{2003/08/26}{Minor change to \cs{zz@@@}} +% \begin{macrocode} +\newcommand*{\zz@@@}{000|000} % set two counters to zero in one go + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\edlabel} +% The \cs{edlabel} command first writes a \cs{@lab} macro to +% the \cs{linenum@out} file. It then checks to see that the +% \cs{labelref@list} actually has something in it (if not, it +% creates a dummy entry), and pops the next value for the current +% label, storing it in \cs{label@refs}. Finally it defines the +% label to be \cs{empty} so that any future check will turn up +% the fact that it has been used.\footnote{The remaining macros +% in this section were kindly revised by Wayne +% Sullivan,\index{Sullivan, Wayne} who +% substantially improved their efficiency and flexibility.} +% +% This version of the original \edmac{} \cs{label} uses \cs{@bsphack} +% and \cs{@esphack} to eliminate extra space problems and also use the \LaTeX\ +% write methods for the \file{.aux} file. +% +% Jesse Billett\footnote{(\url{jdb43@cam.ac.uk}) via the \texttt{ctt} +% thread `ledmac cross referencing', 25 August 2003.} +% found that the original code could be off by several pages. This version, +% hopefully cures that, and also allows for non-arabic page numbering. +% +% \changes{v0.2.1}{2003/08/26}{Tweaked \cs{edlabel} to get correct page numbers} +% \changes{v0.14.0}{2012/04/04}{Tweaked \cs{edlabel} to get correct line number if the command is first element of a paragraph.} +% \changes{v1.18.0}{2015/02/23}{\cs{edlabel} is now defined only one time for both \eledmac and \eledpar} + +% \begin{macrocode} +\newcommand*{\edlabel}[1]{% + \ifl@dpairing\ifautopar% + \strut% + \fi\fi% + \@bsphack% + \ifledRcol% + \write\linenum@outR{\string\@lab}% + \ifx\labelref@listR\empty% + \xdef\label@refs{\zz@@@}% + \else% + \gl@p\labelref@listR\to\label@refs% + \fi% + \ifvmode% + \advancelabel@refs% + \fi% +% \end{macrocode} +% Use code from the kernel \cs{label} command to write the correct +% page number. +% Also define an hypertarget if \Lpack{hyperref} package is loaded. +% \begin{macrocode} + \protected@write\@auxout{}% + {\string\l@dmake@labelsR\space\thepage|\label@refs|\the\c@pstartR|{#1}}% + \ifdef{\hypertarget}{\Hy@raisedlink{\hypertarget{#1}{}}}{}% + \else% + \write\linenum@out{\string\@lab}% + \ifx\labelref@list\empty% + \xdef\label@refs{\zz@@@}% + \else% + \gl@p\labelref@list\to\label@refs% + \fi% + \ifvmode% + \advancelabel@refs% + \fi% + \protected@write\@auxout{}% + {\string\l@dmake@labels\space\thepage|\label@refs|\the\c@pstart|{#1}}% + \ifdef{\hypertarget}{\Hy@raisedlink{\hypertarget{#1}{}}}{}% + \fi% +\@esphack}% + +% \end{macrocode} +% \end{macro} +% +% +%\begin{macro}{\advancelabel@refs} +%\begin{macro}{\labelrefsparseline} +%\begin{macro}{\labelrefsparsesubline} +% \changes{v1.4.1}{2012/11/16}{Fix bug with \cs{edlabel}.} +%In cases where \cs{edlabel} is the first element in a paragraph, we have a problem with line counts, because line counts change only at the first horizontal box of the paragraph. +%Hence, we need to test \cs{edlabel} if it occurs at the start of a paragraph. To do so, we use \cs{ifvmode}. If the test is true, we must advance by one unit the amount of text we write into the \verb].aux] file. +% We do so using \cs{advancelabel@refs} command. +% \begin{macrocode} +\newcounter{line}% +\newcounter{subline}% +\newcommand{\advancelabel@refs}{% + \setcounter{line}{\expandafter\labelrefsparseline\label@refs}% + \stepcounter{line}% + \ifsublines@% + \setcounter{subline}{\expandafter\labelrefsparsesubline\label@refs}% + \stepcounter{subline}{1}% + \def\label@refs{\theline|\thesubline}% + \else% + \def\label@refs{\theline|0}% + \fi% +} +\def\labelrefsparseline#1|#2{#1} +\def\labelrefsparsesubline#1|#2{#2} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \begin{macro}{\l@dmake@labels} +% The \cs{l@dmake@labels} macro gets executed when the labels file is +% read. For each label it defines a macro, whose name is made up +% partly from the label you supplied, that contains the page, line +% and sub-line numbers. But first it checks to see whether the +% label has already been used (and complains if it has). +% +% The initial use of \cs{newcommand} is to catch if \cs{l@dmake@labels} +% has been previously defined (by a class or package). +% +% \verb+#1+ page number, \verb+#2+ line number, \verb-#3- sub-line number, \verb+#4+ pstart number, \verb+#5+ label. +% +% \begin{macrocode} +\newcommand*{\l@dmake@labels}{} +\def\l@dmake@labels#1|#2|#3|#4|#5{% + \expandafter\ifx\csname the@label#5\endcsname \relax\else + \led@warn@DuplicateLabel{#5}% + \fi + \expandafter\gdef\csname the@label#5\endcsname{#1|#2|#3|#4}% + \ignorespaces} + +% \end{macrocode} +% \end{macro} +% +% \LaTeX\ reads the \verb+aux+ file at both the beginning and end of +% the document, so we have to switch off duplicate label checking +% after the first time the file is read. +% +% \begin{macrocode} +\AtBeginDocument{% + \def\l@dmake@labels#1|#2|#3|#4|#5{}% +} + +% \end{macrocode} +% +% \begin{macro}{\@lab} +% The \cs{@lab} command, which appears in the \cs{linenum@out} file, +% appends the current values of page, line and sub-line to the +% \cs{labelref@list}. These values are defined by the earlier +% \cs{@page}, \cs{@nl}, and the \cs{sub@on} and \cs{sub@off} commands +% appearing in the \cs{linenum@out} file. +% +% \LaTeX\ uses the \texttt{page} counter for page numbers. However, +% it appears that this is not the right place to grab the page number. +% That task is now done in the \cs{edlabel} macro. This version +% of \cs{@lab} appends just the current line and sub-line numbers +% to \cs{labelref@list}. +% \changes{v0.2.1}{2003/08/26}{Removed page setting from \cs{@lab}} +% \changes{v0.3.0}{2004/02/14}{Replaced \cs{the}\cs{line@num} by +% \cs{linenumr@p}\cs{line@num} in +% \cs{@lab}, and similar for sub-lines} +% \begin{macrocode} + +\newcommand*{\@lab}{% + \ifledRcol + \xright@appenditem{\linenumr@p{\line@numR}|% + \ifsublines@ \sublinenumr@p{\subline@numR}\else 0\fi}% + \to\labelref@listR + \else + \xright@appenditem{\linenumr@p{\line@num}|% + \ifsublines@ \sublinenumr@p{\subline@num}\else 0\fi}% + \to\labelref@list + \fi} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\applabel} +% \cs{applabel}, if called in \cs{edtext} will insert automatically both a start and an end label for the current edtext lines. +% \begin{macrocode} +\newcommand*{\applabel}[1]{% + \ifnum\@edtext@level>0% +% \end{macrocode} +% Label should not be already defined. +% \begin{macrocode} + \ifcsundef{the@label#1}{% + \csdef{the@label#1}{applabel}% + }% + {% + \led@warn@DuplicateLabel{#1 (applabel)}% + }% +% \end{macrocode} +% Parse the \cs{edtext} line numbers. +% \begin{macrocode} + \expandafter\l@dp@rsefootspec\l@d@nums|% +% \end{macrocode} +% Use the \LaTeX\ standard hack for label. +% \begin{macrocode} + \@bsphack% +% \end{macrocode} +% And now, write the data in the auxiliary file. +% \begin{macrocode} + \ifledRcol% + \protected@write\@auxout{}% + {\string\l@dmake@labelsR\space\l@dparsedstartpage|\l@dparsedstartline|\l@dparsedstartsub|\the\c@pstartR|{#1:start}}% + \ifdef{\hypertarget}{\Hy@raisedlink{\hypertarget{#1:start}{}}}{}% + \protected@write\@auxout{}% + {\string\l@dmake@labelsR\space\l@dparsedendpage|\l@dparsedendline|\l@dparsedendsub|\the\c@pstartR|{#1:end}}% + \else% + \protected@write\@auxout{}% + {\string\l@dmake@labels\space\l@dparsedstartpage|\l@dparsedstartline|\l@dparsedstartsub|\the\c@pstart|{#1:start}}% + \ifdef{\hypertarget}{\Hy@raisedlink{\hypertarget{#1:start}{}}}{}% + \protected@write\@auxout{}% + {\string\l@dmake@labels\space\l@dparsedendpage|\l@dparsedendline|\l@dparsedendsub|\the\c@pstart|{#1:end}}% + \fi% +% \end{macrocode} +% Use the \LaTeX\ standard hack for label. +% \begin{macrocode} + \@esphack% +% \end{macrocode} +% Warning if \cs{applabel} is called outside of \cs{edtext}. +% \begin{macrocode} + \else% + \led@warn@AppLabelOutEdtext{#1}% + \fi% +% \end{macrocode} +% End of \cs{applabel} +% \begin{macrocode} +}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\wrap@edcrossref} +% \changes{v1.12.1}{2014/08/06}{Fix spurious spaces.} +% \changes{v1.12.7}{2014/09/07}{\cs{wrap@edcrossref} is now robust} +% \cs{wrap@edcrossref} is called around all \macpackage crossref commands, except those which start with x. +% It adds the hyperlink. +% \begin{macrocode} +\newrobustcmd{\wrap@edcrossref}[2]{% + \ifdef{\hyperlink}% + {\hyperlink{#1}{#2}}% + {#2}% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\edpageref} +% \begin{macro}{\xpageref} +% If the specified label exists, \cs{edpageref} gives its page number. +% +% For this reference command, as for the other two, a special +% version with prefix \verb"x" is provided for use in places where the +% command is to be scanned as a number, as in \cs{linenum}. These +% special versions have two limitations: they do not print error +% messages if the reference is unknown, and they can't appear as +% the first label or reference command in the file; you must ensure +% that a \cs{edlabel} or a normal reference command appears first, or +% these x-commands will always return zeros. +% +% \LaTeX\ already defines a \cs{pageref}, so changing the name +% to \cs{edpageref}. +% \begin{macrocode} +\newcommand*{\edpageref}[1]{\l@dref@undefined{#1}\wrap@edcrossref{#1}{\l@dgetref@num{1}{#1}}} +\newcommand*{\xpageref}[1]{\l@dgetref@num{1}{#1}} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\edlineref} +% \changes{v1.16.1}{2015/02/05}{\cs{lineref} is not defined if defined by some other package, like lineno. +% \Eledmac provides \cs{edlineref} instead.} +% \begin{macro}{\xlineref} +% If the specified label exists, \cs{lineref} gives its line number. +% \begin{macrocode} +\newcommand*{\edlineref}[1]{\l@dref@undefined{#1}\wrap@edcrossref{#1}{\l@dgetref@num{2}{#1}}}% +\newcommand*{\xlineref}[1]{\l@dgetref@num{2}{#1}}% + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\sublineref} +% \begin{macro}{\xsublineref} +% If the specified label exists, \cs{sublineref} gives its sub-line number. +% \begin{macrocode} +\newcommand*{\sublineref}[1]{\l@dref@undefined{#1}\wrap@edcrossref{#1}{\l@dgetref@num{3}{#1}}} +\newcommand*{\xsublineref}[1]{\l@dgetref@num{3}{#1}} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\pstarteref} +% \begin{macro}{\xpstartref} +% If the specified label exists, \cs{pstartref} gives its pstart number. +% \begin{macrocode} +\newcommand*{\pstartref}[1]{\l@dref@undefined{#1}\wrap@edcrossref{#1}{\l@dgetref@num{4}{#1}}} +\newcommand*{\xpstartref}[1]{\l@dgetref@num{4}{#1}} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% The next three macros are used by the referencing commands above, +% and do the job of extracting the right numbers from the label +% macro that contains the page, line, and sub-line number. +% +% \begin{macro}{\l@dref@undefined} +% The \cs{l@dref@undefined} macro is called when you refer to a label with +% the normal referencing macros. Its argument is a label, and it +% just checks that the label has been defined. +% +% \begin{macrocode} +\newcommand*{\l@dref@undefined}[1]{% + \expandafter\ifx\csname the@label#1\endcsname\relax + \led@warn@RefUndefined{#1}% + \fi} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\l@dgetref@num} +% Next, \cs{l@dgetref@num} fetches the number we want. It has two +% arguments: the first is simply a digit, specifying whether to +% fetch a page (1), line (2), sub-line (3) or (4) pstart number. (This +% switching is done by calling \cs{l@dlabel@parse}.) The second argument +% is the label-macro, which because of the \cs{@lab} macro above is +% defined to be a string of the type \verb"123|456|789". +% \begin{macrocode} +\newcommand*{\l@dgetref@num}[2]{% + \expandafter + \ifx\csname the@label#2\endcsname \relax + 000% + \else + \expandafter\expandafter\expandafter + \l@dlabel@parse\csname the@label#2\endcsname|#1% + \fi} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\l@dlabel@parse} +% Notice that we slipped another \verb"|" delimiter into the +% penultimate line of \cs{l@dgetref@num}, to +% keep the `switch-number' separate from the reference numbers. This +% \verb"|" is used as another parameter delimiter by \cs{l@dlabel@parse}, +% which extracts the appropriate number from its first arguments. +% The \verb"|"-delimited arguments consist of the expanded label-macro +% (three reference numbers), followed by the switch-number (1, +% 2, 3 or 4) which defines which of the earlier three numbers to +% pick out. (It was earlier given as the first argument of +% \cs{l@dgetref@num}.) +% \begin{macrocode} +\newcommand*{\l@dlabel@parse}{} +\def\l@dlabel@parse#1|#2|#3|#4|#5{% + \ifcase #5% + \or #1% + \or #2% + \or #3% + \or #4% + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\xxref} +% \changes{v1.19.0}{2015/03/06}{\cs{xxref} works also with right side numbers, when \cs{@Rlineflag} is not empty.} +% \changes{v1.20.0}{2015/03/22}{Debug \cs{xxref} when not loading \eledpar (fix bug added in 1.19.0).} +% The \cs{xxref} command takes two arguments, both of which are +% labels, e.g., \cs{xxref}\verb+{mouse}{elephant}+. It first does some +% checking to make sure that the labels do exist (if one does not, +% those numbers are set to zero). Then it calls \cs{linenum} and sets +% the beginning page, line, and sub-line numbers to those of the +% place where \cs{label}\verb+{mouse}+ was placed, and the ending +% numbers to those at \verb+{elephant}+. The point of this is +% to be able to manufacture footnote line references to passages +% which can not be specified in the normal way as the first argument +% to \cs{edtext} for one reason or another. Using \cs{xxref} in the +% second argument of \cs{edtext} lets you set things up at least +% semi-automatically. +% \begin{macrocode} +\newcommand*{\xxref}[2]{% + {% + \expandafter\ifx\csname the@label#1\endcsname \relax% + \expandafter\let\csname the@@label#1\endcsname\zz@@@% + \else% + \expandafter\def\csname the@@label#1\endcsname{\l@dgetref@num{1}{#1}|\l@dgetref@num{2}{#1}|\l@dgetref@num{3}{#1}}% + \fi% + \expandafter\ifx\csname the@label#2\endcsname \relax% + \expandafter\let\csname the@@label#2\endcsname\zz@@@% + \else% + \expandafter\def\csname the@@label#2\endcsname{\l@dgetref@num{1}{#2}|\l@dgetref@num{2}{#2}|\l@dgetref@num{3}{#2}}% + \fi% + \ifdefined\@Rlineflag% + \StrDel{\csuse{the@@label#1}}{\@Rlineflag}[\@tempa]% + \StrDel{\csuse{the@@label#2}}{\@Rlineflag}[\@tempb]% + \else% + \letcs{\@tempa}{the@@label#1}% + \letcs{\@tempb}{the@@label#2}% + \fi% + \linenum{\@tempa|% + \@tempb}}}% + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\appref} +% \begin{macro}{\apprefwithpage} +% \begin{macro}{\@apprefprefixsingle} +% \begin{macro}{\@apprefprefixmore} +% \begin{macro}{\setapprefprefixsingle} +% \begin{macro}{\setapprefprefixmore} +% \cs{appref} prints a crossref to some lines of the apparatus defined by \cs{applabel}. +% It prints the lines as they should be printed in the apparatus. +% +% If \cs{@apprefprefixsingle} is not empty, it prints it before the line number. +% If \cs{@apprefprefixmore} is not empty, it prints it before the line numbers when the first line is not the same as the last line. +% \cs{apprefwithpage} prints a crossref to some lines of the apparatus defined by \cs{applabel}. +% It always prints the page number, as it should be printed in the end notes. +% The \cs{Xtwolinesappref} and \cs{Xmorethantwolinesappref} are similar to the footnote +% hooks and \cs{Xtwolines} \cs{Xmorethantwolines}. +% +% So, first declare the default value of the hooks for the pseudo-series appref. +% Also declare the internal toggle which are switch by \macpackage{}. +% \begin{macrocode} +\xdef\Xtwolines@appref{}% +\xdef\Xmorethantwolines@appref{}% +\newtoggle{Xtwolinesbutnotmore@appref}% +\newtoggle{Xtwolinesonlyinsamepage@appref}% + +\xdef\Xendtwolines@apprefwithpage{}% +\xdef\Xendmorethantwolines@apprefwithpage{}% +\newtoggle{Xendtwolinesbutnotmore@apprefwithpage}% +\newtoggle{Xendtwolinesonlyinsamepage@apprefwithpage}% + +% \end{macrocode} +% Note that some of these hooks are declared but no user command can change their values. Such hooks are not pertinent for \verb+appref+ and \verb+apprefwithpage+ pseudo-series, but their values are nonetheless tested in some macros. +% \begin{macrocode} + +\xdef\Xboxstartlinenum@appref{0pt} +\xdef\Xboxendlinenum@appref{0pt} + +\xdef\Xendboxstartlinenum@apprefwithpage{0pt} +\xdef\Xendboxendlinenum@apprefwithpage{0pt} + +% \end{macrocode} +% Now, declare the default value of \cs{@apprefprefixsingle} and \cs{@apprefprefixmore}, and the commands which defines them +% \begin{macrocode} +\newcommand\@apprefprefixsingle{}% +\newcommand\@apprefprefixmore{}% + +\newcommand{\apprefprefixsingle}[1]{% + \gdef\@apprefprefixsingle{#1}% +} + +\newcommand{\setapprefprefixmore}[1]{% + \gdef\@apprefprefixmore{#1}% +} + +% \end{macrocode} +% And now, the main commands: \cs{appref} and \cs{apprefwithpage}. +% These commands call \cs{printlines} and \cs{printendlines}. That is why we have previously declared all hooks values tested inside these last commands. +% \begin{macrocode} +\newcommandx{\appref}[2][1,usedefault]{% + \IfStrEq{#1}{fulllines}% + {\toggletrue{fulllines@}}% + {}% + \xdef\@currentseries{appref}% + \ifdefempty{\@apprefprefixmore}% + {\@apprefprefixsingle}% + {% + \IfEq{\xlineref{#2:start}}{\xlineref{#2:end}}% + {\@apprefprefixsingle}% + {\@apprefprefixmore}% + }% + \printlines\xpageref{#2:start}|\xlineref{#2:start}|\xsublineref{#2:start}|\xpageref{#2:end}|\xlineref{#2:end}|\xsublineref{#2:end}||% + \togglefalse{fulllines@}% +}% + +% \changes{v1.23.0}{2015/05/18}{Debug \cs{Xendtwolines}, \cs{Xendmorethantwolines}, \cs{Xendtwolinesbutnotmore} and \cs{Xendtwolinesonlyinsamepage} when using \cs{apprefwithpage}.} +\newcommandx{\apprefwithpage}[2][1,usedefault]{% + \IfStrEq{#1}{fulllines}% + {\toggletrue{fulllines@}}% + {}% + \xdef\@currentseries{apprefwithpage}% + \printendlines\xpageref{#2:start}|\xlineref{#2:start}|\xsublineref{#2:start}|\xpageref{#2:end}|\xlineref{#2:end}|\xsublineref{#2:end}||% + \togglefalse{fulllines@}% +}% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \begin{macro}{\edmakelabel} +% Sometimes the \cs{edlabel} command cannot be used to specify +% exactly the page and line desired; you can use the \cs{edmakelabel} macro +% make your own label. For example, if you say +% \cs{edmakelabel}\verb+{elephant}{10|25|0}+ you will have created a +% new label, and a later call to \cs{edpageref}\verb+{elephant}+ would +% print `10' and \cs{lineref}\verb+{elephant}+ would print `25'. +% The sub-line number here is zero. +% \cs{edmakelabel} takes a label, followed by a page and a line number(s) +% as arguments. +% \LaTeX\ defines a \cs{makelabel} macro which is used in lists. +% Peter Wilson has changed the name to \cs{edmakelabel}. +% \begin{macrocode} +\newcommand*{\edmakelabel}[2]{\expandafter\xdef\csname the@label#1\endcsname{#2}} + +% \end{macrocode} +% (If you are only going to refer to such a label using +% \cs{xxref}, then you can omit entries in the same way as with +% \cs{linenum} (see \reff{linenumdef} and +% \reff{linenumbers}), since \cs{xxref} makes a call to +% \cs{linenum} in order to do its work.) +% \end{macro} +% +% +% +% \section{Side notes} +% +% Regular \cs{marginpar}s do not work inside numbered text --- they +% do not produce any note but do put an extra unnumbered blank line into +% the text. +% +% \begin{macro}{\@xympar} +% Changing \cs{@xympar} a little at least ensures that \cs{marginpar}s +% in numbered text do not disturb the flow. +% \changes{v0.5.0}{2004/04/01}{Eliminated \cs{marginpar} disturbance} +% \changes{v2.0.0}{2104/06/28}{Patching \cs{@xympar} instead of redefining it} +% +% \begin{macrocode} +\pretocmd{\@xympar}% + {\ifnumberedpar@ + \led@warn@NoMarginpars + \@esphack + \else}% + {}% + {}% + +\apptocmd{\@xympar}% + {\fi}% + {} + {} + +% \end{macrocode} +% \end{macro} +% +% We provide side notes as replacement for \cs{marginpar} in numbered text. +% \changes{v0.5.0}{2004/04/03}{Added left and right side notes} +% \changes{v0.5.1}{2004/04/10}{Added moveable side note} +% +% \begin{macro}{\sidenote@margin} +% \begin{macro}{\sidenotemargin} +% \begin{macro}{\l@dgetsidenote@margin} +% These are the sidenote equivalents to \cs{line@margin} and \cs{linenummargin} +% for specifying which margin. The default is the right margin (opposite to +% the default for line numbers). +% \cs{l@dgetsidenote@margin} returns the number associated to side note margin: +% \begin{description} +% \item[left]: 0 +% \item[right]: 1 +% \item[outer]: 2 +% \item[inner]: 3 +% \end{description} +% \changes{v0.5.1}{2004/04/10}{Added \cs{sidenotemargin} and \cs{sidenote@margin}} +% \changes{v0.7.0}{2005/02/23}{Added \cs{l@dgetsidenote@margin}} +% \changes{v1.12.0}{2014/08/05}{\cs{sidenotemargin} is now directly defined in \Lpack{eledmac} to be able to manage \Lpack{eledpar}.} +% \begin{macrocode} +\newcount\sidenote@margin +\newcommand*{\sidenotemargin}[1]{{% + \l@dgetsidenote@margin{#1}% + \ifnum\@l@dtempcntb>\m@ne + \ifledRcol + \global\sidenote@marginR=\@l@dtempcntb + \else + \global\sidenote@margin=\@l@dtempcntb + \fi + \fi}} +\newcommand*{\l@dgetsidenote@margin}[1]{% + \def\@tempa{#1}\def\@tempb{left}% + \ifx\@tempa\@tempb + \@l@dtempcntb \z@ + \else + \def\@tempb{right}% + \ifx\@tempa\@tempb + \@l@dtempcntb \@ne + \else + \def\@tempb{outer}% + \ifx\@tempa\@tempb + \@l@dtempcntb \tw@ + \else + \def\@tempb{inner}% + \ifx\@tempa\@tempb + \@l@dtempcntb \thr@@ + \else + \led@warn@BadSidenotemargin + \@l@dtempcntb \m@ne + \fi + \fi + \fi + \fi} +\sidenotemargin{right} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\l@dlp@rbox} +% \begin{macro}{\l@drp@rbox} +% We need two boxes to store sidenote texts. +% \begin{macrocode} +\newbox\l@dlp@rbox +\newbox\l@drp@rbox + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\ledlsnotewidth} +% \begin{macro}{\ledrsnotewidth} +% \begin{macro}{\ledlsnotesep} +% \begin{macro}{\ledrsnotesep} +% \begin{macro}{\ledlsnotefontsetup} +% \begin{macro}{\ledrsnotefontsetup} +% These specify the width of the left/right boxes (initialised to +% \cs{marginparwidth}), their distance from +% the text (initialised to \cs{linenumsep}), and the fonts used. +% \begin{macrocode} +\newdimen\ledlsnotewidth \ledlsnotewidth=\marginparwidth +\newdimen\ledrsnotewidth \ledrsnotewidth=\marginparwidth +\newdimen\ledlsnotesep \ledlsnotesep=\linenumsep +\newdimen\ledrsnotesep \ledrsnotesep=\linenumsep +\newcommand*{\ledlsnotefontsetup}{\raggedleft\footnotesize} +\newcommand*{\ledrsnotefontsetup}{\raggedright\footnotesize} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\ledleftnote} +% \begin{macro}{\ledrightnote} +% \begin{macro}{\ledinnernote} +% \begin{macro}{\ledouterote} +% \begin{macro}{\ledsidenote} +% \cs{ledleftnote}, \cs{ledrightnote}, \cs{ledinnernote}, \cs{ledouternote} are the +% user commands for left, right, inner and outer sidenotes. +% The two last one are just alias for the two first one, depending of the page number. +% \cs{ledsidenote}\marg{text} is the command for a moveable sidenote. +% \begin{macrocode} +\newcommand*{\ledleftnote}[1]{\edtext{}{\l@dlsnote{#1}}} +\newcommand*{\ledrightnote}[1]{\edtext{}{\l@drsnote{#1}}} + +\newcommand*{\ledinnernote}[1]{% + \ifodd\c@page% Do not use \page@num, because it is not yet calculated when command is called + \ledleftnote{#1}% + \else% + \ledrightnote{#1}% + \fi% +} + +\newcommand*{\ledouternote}[1]{% + \ifodd\c@page% Do not use \page@num, because it is not yet calculated when command is called + \ledrightnote{#1}% + \else% + \ledleftnote{#1}% + \fi% +} + +\newcommand*{\ledsidenote}[1]{\edtext{}{\l@dcsnote{#1}}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\l@dlsnote} +% \begin{macro}{\l@drsnote} +% \begin{macro}{\l@dcsnote} +% \changes{v1.12.0}{2014/08/05}{\cs{l@dlsnote},\cs{l@drsnote} and \cs{l@dcsnote} defined only one time, in \eledmac, including needs for eledpar case.}. +% The `footnotes' for left, right, and moveable sidenotes. The whole +% scheme is reminiscent of the critical footnotes code. +% \begin{macrocode} +\newif\ifrightnoteup + \rightnoteuptrue + +\newcommand*{\l@dlsnote}[1]{% + \begingroup% + \newcommand{\content}{#1}% + \ifnumberedpar@ + \ifledRcol% + \xright@appenditem{\noexpand\vl@dlsnote{\expandonce\content}}% + \to\inserts@listR + \global\advance\insert@countR \@ne% + \else% + \xright@appenditem{\noexpand\vl@dlsnote{\expandonce\content}}% + \to\inserts@list + \global\advance\insert@count \@ne% + \fi + \fi\ignorespaces\endgroup} + +\newcommand*{\l@drsnote}[1]{% + \begingroup% + \newcommand{\content}{#1}% + \ifnumberedpar@ + \ifledRcol% + \xright@appenditem{\noexpand\vl@drsnote{\expandonce\content}}% + \to\inserts@listR + \global\advance\insert@countR \@ne% + \else% + \xright@appenditem{\noexpand\vl@drsnote{\expandonce\content}}% + \to\inserts@list + \global\advance\insert@count \@ne% + \fi + \fi\ignorespaces\endgroup} + +\newcommand*{\l@dcsnote}[1]{% + \begingroup% + \newcommand{\content}{#1}% + \ifnumberedpar@ + \ifledRcol% + \xright@appenditem{\noexpand\vl@dcsnote{\expandonce\content}}% + \to\inserts@listR + \global\advance\insert@countR \@ne% + \else% + \xright@appenditem{\noexpand\vl@dcsnote{\expandonce\content}}% + \to\inserts@list + \global\advance\insert@count \@ne% + \fi + \fi\ignorespaces\endgroup} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\vl@dlsnote} +% \begin{macro}{\vl@drsnote} +% \begin{macro}{\vl@dcsnote} +% Put the left/right text into boxes, but just save the moveable text. +% \cs{l@dcsnotetext}, \cs{l@dcsnotetext@l} and \cs{l@dcsnotetext@r} are \Lpack{etoolbox}'s lists which will store the content of side notes. +% We store the content in lists, because we need to loop later on them, in case many sidenote co-exist for the same line. +% That is there some special test to do, in order to: +% \begin{itemize} +% \item Store the content of \cs{ledsidenote} to \cs{l@dcsnotetext} in any cases. +% \item Store the content of \cs{rightsidenote} to: +% \begin{itemize} +% \item \cs{l@dcsnotetext} if \cs{ledsidenote} is to be put on right. +% \item \cs{l@dcsnotetext@r} if \cs{ledsidenote} is to be put on left. +% \end{itemize} +% \item Store the content of \cs{leftsidenote} to: +% \begin{itemize} +% \item \cs{l@dcsnotetext} if \cs{ledsidenote} is to be put on left. +% \item \cs{l@dcsnotetext@l} if \cs{ledsidenote} is to be put on right. +% \end{itemize} +% \end{itemize} +% \begin{macrocode} +\newcommand*{\vl@dlsnote}[1]{% + \ifledRcol@% + \@l@dtempcntb=\sidenote@marginR% + \ifnum\@l@dtempcntb>\@ne% + \advance\@l@dtempcntb by\page@numR% + \fi% + \else% + \@l@dtempcntb=\sidenote@margin% + \ifnum\@l@dtempcntb>\@ne% + \advance\@l@dtempcntb by\page@num% + \fi% + \fi% + \ifodd\@l@dtempcntb% + \listgadd{\l@dcsnotetext@l}{#1}% + \else% + \listgadd{\l@dcsnotetext}{#1}% + \fi +} +\newcommand*{\vl@drsnote}[1]{% + \ifledRcol@% + \@l@dtempcntb=\sidenote@marginR% + \ifnum\@l@dtempcntb>\@ne% + \advance\@l@dtempcntb by\page@numR% + \fi% + \else% + \@l@dtempcntb=\sidenote@margin% + \ifnum\@l@dtempcntb>\@ne% + \advance\@l@dtempcntb by\page@num% + \fi% + \fi% + \ifodd\@l@dtempcntb% + \listgadd{\l@dcsnotetext}{#1}% + \else% + \listgadd{\l@dcsnotetext@r}{#1}% + \fi% +} +\newcommand*{\vl@dcsnote}[1]{\listgadd{\l@dcsnotetext}{#1}} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\setl@dlp@rbox} +% \begin{macro}{\setl@drpr@box} +% \cs{setl@dlprbox}\marg{lednums}\marg{tag}\marg{text} puts \meta{text} +% into the \cs{l@dlp@rbox} box. And similarly for the right side box. +% It is these boxes that finally +% get displayed in the margins. +% \begin{macrocode} +\newcommand*{\setl@dlp@rbox}[1]{% + {\parindent\z@\hsize=\ledlsnotewidth\ledlsnotefontsetup + \global\setbox\l@dlp@rbox + \ifleftnoteup + =\vbox to\z@{\vss #1}% + \else + =\vbox to 0.70\baselineskip{\strut#1\vss}% + \fi}} +\newcommand*{\setl@drp@rbox}[1]{% + {\parindent\z@\hsize=\ledrsnotewidth\ledrsnotefontsetup + \global\setbox\l@drp@rbox + \ifrightnoteup + =\vbox to\z@{\vss#1}% + \else + =\vbox to0.7\baselineskip{\strut#1\vss}% + \fi}} +\newif\ifleftnoteup + \leftnoteuptrue +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@sidenotesep} +% This macro is used to separate sidenotes of the same line. +% \begin{macrocode} +\newcommand{\setsidenotesep}[1]{\gdef\@sidenotesep{#1}} +\newcommand{\@sidenotesep}{, } +% \end{macrocode} +% \end{macro} +% \begin{macro}{\affixside@note} +% This macro puts any moveable sidenote text into the left or right sidenote +% box, depending on which margin it is meant to go in. It's a very much +% stripped down version of \cs{affixlin@num}. +% +% Before do it, we concatenate all moveable sidenotes of the line, using \cs{@sidenotesep} as separator. +% It is the result that we put on the sidenote. +% \changes{v1.4.1}{2012/11/16}{Remove spurious spaces.} +% \begin{macrocode} +\newcommand*{\affixside@note}{% + \def\sidenotecontent@{}% + \numgdef{\itemcount@}{0}% + \def\do##1{% + \ifnumequal{\itemcount@}{0}% + {% + \appto\sidenotecontent@{##1}}% Not print not separator before the 1st note + {\appto\sidenotecontent@{\@sidenotesep ##1}% + }% + \numgdef{\itemcount@}{\itemcount@+1}% + }% + \dolistloop{\l@dcsnotetext}% + \ifnumgreater{\itemcount@}{1}{\led@err@ManySidenotes}{}% +% \end{macrocode} +% And we do the same for left and right notes (not movable). +% \begin{macrocode} + \gdef\@templ@d{}% + \gdef\@templ@n{\l@dcsnotetext\l@dcsnotetext@l\l@dcsnotetext@r}% + \ifx\@templ@d\@templ@n \else% + \if@twocolumn% + \if@firstcolumn% + \setl@dlp@rbox{##1}{\sidenotecontent@}% + \else% + \setl@drp@rbox{\sidenotecontent@}% + \fi% + \else% + \@l@dtempcntb=\sidenote@margin% + \ifnum\@l@dtempcntb>\@ne% + \advance\@l@dtempcntb by\page@num% + \fi% + \ifodd\@l@dtempcntb% + \setl@drp@rbox{\sidenotecontent@}% + \gdef\sidenotecontent@{}% + \numgdef{\itemcount@}{0}% + \dolistloop{\l@dcsnotetext@l}% + \ifnumgreater{\itemcount@}{1}{\led@err@ManyLeftnotes}{}% + \setl@dlp@rbox{\sidenotecontent@}% + \else% + \setl@dlp@rbox{\sidenotecontent@}% + \gdef\sidenotecontent@{}% + \numgdef{\itemcount@}{0}% + \dolistloop{\l@dcsnotetext@r}% + \ifnumgreater{\itemcount@}{1}{\led@err@ManyRightnotes}{}% + \setl@drp@rbox{\sidenotecontent@}% + \fi% + \fi% + \fi% +} +% \end{macrocode} +% \end{macro}% +% +% +% +% +% \section{Minipages and such} +% +% We can put footnotes into minipages. The preparatory code has +% been set up earlier, all that remains is to ensure that it is available +% inside a minipage box. This requires some alteration to the kernel code, +% specifically the \cs{@iiiminipage} and \cs{endminipage} macros. +% We will arrange this so that additional series can be easily added. +% +% \begin{macro}{\l@dfeetbeginmini} +% \begin{macro}{\l@dfeetendmini} +% \changes{v1.9.0}{2014/02/05}{Add \cs{mpfnpos} to choice the order of footnotes in minipage / ledgroup.} +% These will be the hooks in \cs{@iiiminpage} and \cs{endminipage}. +% +% They can be extended to handle other things if necessary. +% \changes{v0.4.0}{2004/02/29}{Added \cs{l@dfeetbeginmini}, \cs{l@dfeetendmini} +% and all their supporting code} +% \begin{macrocode} +\ifnoledgroup@\else% +\newcommand*{\l@dfeetbeginmini}{\l@dedbeginmini\l@dfambeginmini} +\newcommand*{\l@dfeetendmini}{% + \IfStrEq{critical-familiar}{\@mpfnpos}% + {\l@dedendmini\l@dfamendmini}% + {% + \IfStrEq{familiar-critical}{\@mpfnpos}% + {\l@dfamendmini\l@dedendmini}% + {\l@dedendmini\l@dfamendmini}% + }% + }% +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\l@dedbeginmini} +% \begin{macro}{\l@dedendmini} +% These handle the initiation and closure of critical footnotes in a +% minipage environment. +% \begin{macrocode} +\newcommand*{\l@dedbeginmini}{% + \unless\ifnocritical@% + \def\do##1{\csletcs{v##1footnote}{mpv##1footnote}}% + \dolistloop{\@series}% + \fi% + } +\newcommand*{\l@dedendmini}{% + \unless\ifnocritical@% + \ifl@dpairing% + \ifledRcol% + \flush@notesR% + \else% + \flush@notes% + \fi% + \fi + \def\do##1{% + \ifvoid\csuse{mp##1footins}\else% + \ifl@dpairing\ifparledgroup% + \ifledRcol% + \dimgdef{\parledgroup@beforenotesR}{\parledgroup@beforenotesR+\skip\@nameuse{mp##1footins}}% + \else% + \dimgdef{\parledgroup@beforenotesL}{\parledgroup@beforenotesL+\skip\@nameuse{mp##1footins}}% + \fi% + \fi\fi% + \csuse{mp##1footgroup}{##1}% + \fi}% + \dolistloop{\@series}% + \fi% +}% + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\l@dfambeginmini} +% \begin{macro}{\l@dfamendmini} +% These handle the initiation and closure of familiar footnotes in a +% minipage environment. +% \begin{macrocode} +\newcommand*{\l@dfambeginmini}{% + \unless\ifnofamiliar@% + \def\do##1{\csletcs{vfootnote##1}{mpvfootnote##1}}% + \dolistloop{\@series}% + \fi% +}% + +\newcommand*{\l@dfamendmini}{% + \unless\ifnofamiliar@% + \def\do##1{% + \ifvoid\csuse{mpfootins##1}\else% + \csuse{mpfootgroup##1}{##1}% + \fi}% + \dolistloop{\@series}% + \fi% +}% +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@iiiminipage} +% This is our extended form of the kernel \cs{@iiiminipage} defined in +% \file{ltboxes.dtx}. +% \changes{v0.4.0}{2004/02/29}{Modified kernel \cs{@iiiminipage} and +% \cs{endminipage} to cater for critical footnotes} +% \changes{v2.0.0}{2015/07/19}{Patch \cs{@iiiminipage} instead of redefining it.} +% \begin{macrocode} +\patchcmd% + {\@iiiminipage}% + {\let\@footnotetext\@mpfootnotetext}% + {\let\@footnotetext\@mpfootnotetext\l@dfeetbeginmini}% + {}% + {\led@error@fail@patch@@iiiminipage}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\endminipage} +% This is our extended form of the kernel \cs{endminipage} defined in +% \file{ltboxes.dtx}. +% \changes{v2.0.0}{2015/07/19}{Patch \cs{endminipage} instead of redefining it.} +% \begin{macrocode} +\patchcmd% + {\endminipage}% + {\footnoterule}% + {\footnoterule\l@advance@parledgroup@beforenormalnotes}% + {}% + {\led@error@fail@patch@endminipage} + +\patchcmd% + {\endminipage}% + {\@minipagefalse}% + {\l@dfeetendmini\@minipagefalse}% + {}% + {\led@error@fail@patch@endminipage} + +% \end{macrocode} +% \end{macro} +% \begin{macro}{\l@dunboxmpfoot}% +% \begin{macro}{\l@advance@parledgroup@beforenormalnotes}% +% \changes{v0.7.0}{2005/02/18}{Added \cs{l@dunboxmpfoot} containing +% some common code} +% \changes{v2.0.0}{2015/07/19}{Some conde of \cs{l@dumboxmpfoot} moved to \cs{l@advance@parledegroup@beforenormalnotes}} +% \cs{@ldunboxmpfoot} insert normal footnotes for ledgroup. +% \begin{macrocode} +\newcommand*{\l@dunboxmpfoot}{% + \vskip\skip\@mpfootins + \normalcolor + \footnoterule + \l@advance@parledgroup@beforenormalnotes + \unvbox\@mpfootins% +} +% \end{macrocode} +% When using parallel ledgroup, we need to store the vertical space added before footnote, in order to compensate them between left and right pages. +% \begin{macrocode} +\newcommand{\l@advance@parledgroup@beforenormalnotes}{% + \ifparledgroup + \ifl@dpairing + \ifledRcol + \dimgdef{\parledgroup@beforenotesR}{\parledgroup@beforenotesR+\skip\@mpfootins} + \else + \dimgdef{\parledgroup@beforenotesL}{\parledgroup@beforenotesL+\skip\@mpfootins} + \fi + \fi + \fi +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{environment}{ledgroup} +% This environment puts footnotes at the end, even if that happens to +% be in the middle of a page, or crossing a page boundary. It is a sort +% of unboxed, fixed width minipage. +% \changes{v0.4.0}{2004/02/29}{Added ledgroup environment} +% \begin{macrocode} +\newenvironment{ledgroup}{% + \resetprevpage@num% + \def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c@mpfootnote\z@% + \let\@footnotetext\@mpfootnotetext + \l@dfeetbeginmini% +}{% + \par + \unskip + \ifvoid\@mpfootins\else + \l@dunboxmpfoot + \fi + \l@dfeetendmini% +} + +% \end{macrocode} +% \end{environment} +% +% \begin{environment}{ledgroupsized} +% \verb?\begin{ledgroupsized}?\oarg{pos}\marg{width} \\ +% This environment puts footnotes at the end, even if that happens to +% be in the middle of a page, or crossing a page boundary. It is a sort +% of unboxed, variable \meta{width} minipage. The optional \meta{pos} +% controls the sideways position of numbered text. +% \changes{v0.4.0}{2004/02/29}{Added ledgroupsized environment} +% \changes{v0.5.1}{2004/04/10}{Only change \cs{hsize} in ledgroupsized +% environment otherwise page number can be in wrong place} +% \begin{macrocode} +\newenvironment{ledgroupsized}[2][l]{% +% \end{macrocode} +% Set the various text measures. +% \begin{macrocode} + \hsize #2\relax +%% \textwidth #2\relax +%% \columnwidth #2\relax +% \end{macrocode} +% Initialize fills for centering. +% \begin{macrocode} + \let\ledllfill\hfil + \let\ledrlfill\hfil + \def\@tempa{#1}\def\@tempb{l}% +% \end{macrocode} +% Left adjusted numbered lines +% \begin{macrocode} + \ifx\@tempa\@tempb + \let\ledllfill\relax + \else + \def\@tempb{r}% + \ifx\@tempa\@tempb +% \end{macrocode} +% Right adjusted numbered lines +% \begin{macrocode} + \let\ledrlfill\relax + \fi + \fi +% \end{macrocode} +% Set up the footnoting. +% \begin{macrocode} + \def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c@mpfootnote\z@ + \let\@footnotetext\@mpfootnotetext + \l@dfeetbeginmini% +}{% + \par + \unskip + \ifvoid\@mpfootins\else + \l@dunboxmpfoot + \fi + \l@dfeetendmini% +} + +% \end{macrocode} +% \end{environment} +% +% Close the \cs{ifnoledgroup@}\cs{else}. +% \begin{macrocode} +\fi% +% \end{macrocode} +% \begin{macro}{\ifledgroupnotesL@} +% \begin{macro}{\ifledgroupnotesR@} +% These boolean tests check if we are in the notes of a ledgroup. +% If we are, we do not number the lines. +% It could be useful for parallel ledgroup of \parpackage. +% +% \begin{macrocode} +\newif\ifledgroupnotesL@ +\newif\ifledgroupnotesR@ +% \end{macrocode} +% \end{macro} +% \end{macro} +% \section{Indexing} +% \changes{v1.5.0}{2013/07/11}{Correct indexing when the call is made in critical notes.} +% \changes{v1.8.0}{2014/07/21}{If \Lpack{imakeidx} and \Lpack{hyperref} are loaded, adds hyperref in the index.} +% \changes{v1.8.5}{2014/08/28}{Debug indexing in right column, with eledpar.} +% Here is some code for indexing using page and line numbers. +% +% First, ensure that \Lpack{imakeidx} or \Lpack{indextools} is loaded \emph{before} \Lpack{eledmac}. +% \changes{v1.12.0}{2014/08/05}{Ensure that \Lpack{imakeidx} is loaded \emph{before} \Lpack{eledmac}} +% \begin{macrocode} +\AtBeginDocument{% + \unless\ifl@imakeidx% + \@ifpackageloaded{imakeidx}{\led@error@ImakeidxAfterEledmac}{}% + \fi% + \unless\ifl@indextools% + \@ifpackageloaded{indextools}{\led@error@indextoolsAfterEledmac}{}% + \fi% +} +% \end{macrocode} +% \begin{macro}{\pagelinesep} +% \begin{macro}{\edindexlab} +% \begin{macro}{\c@labidx} +% In order to get a correct line number we have to use the label/ref +% mechanism. These macros are for that. +% \begin{macrocode} +\newcommand{\pagelinesep}{-} +\newcommand{\edindexlab}{$&} +\newcounter{labidx} +\setcounter{labidx}{0} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\doedindexlabel} +% This macro sets an \cs{edlabel}. +% \begin{macrocode} +\newcommand{\doedindexlabel}{% + \stepcounter{labidx}% + \edlabel{\edindexlab\thelabidx}% +} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\thepageline} +% This macro makes up the page/line number combo from the label/ref. +% \begin{macrocode} +\newcommand{\thepageline}{% + \thepage% + \pagelinesep% + \xlineref{\edindexlab\thelabidx}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\thestartpageline} +% \begin{macro}{\theendpageline} +% These macros make up the page/line start/end number when the \cs{edindex} command is called in critical notes. +% \begin{macrocode} +\newcommand{\thestartpageline}{% + \l@dparsedstartpage% + \pagelinesep% + \l@dparsedstartline% +} +\newcommand{\theendpageline}{% + \l@dparsedendpage% + \pagelinesep% + \l@dparsedendline% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\if@edindex@fornote@true} +% This boolean test is switching at the beginning of each critical note, +% to allow index referring to this note. +% \begin{macrocode} +\newif\if@edindex@fornote@ +% \end{macrocode} +% \end{macro} +% \begin{macro}{\prepare@edindex@fornote} +% This macro is called at the beginning of each critical note. +% It switches some parameters, +% to allow index referring to this note, with reference to page and line number. +% It also defines \cs{@ledinnote@command} which will be printed as an encapsulating command after the \verb+|+. +% \begin{macrocode} +\newcommand{\prepare@edindex@fornote}[1]{% + \l@dp@rsefootspec#1|% + \@edindex@fornote@true% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\get@edindex@ledinnote@command} +% The \cs{get@edindex@ledinnote@command} macro defines +% a \cs{@ledinnote@command} command which is added as an attribute (text inserted after \verb+|+) of the next index entry. +% +% Consequently, we write the definition of the location reference attribute in the \verb+.xdy+ file. +% \begin{macrocode} +\newcommand{\get@edindex@ledinnote@command}{% + \ifxindy@% + \gdef\@ledinnote@command{% + ledinnote\thelabidx% + }% + \ifxindyhyperref@% + \immediate\write\eledmac@xindy@out{% + (define-attributes ("ledinnote\thelabidx"))^^J + \space\space(markup-locref^^J + \eledmacmarkuplocrefdepth^^J + :open "\string\ledinnote[\edindexlab\thelabidx]{\@index@command}{"^^J + :close "}"^^J + :attr "ledinnote\thelabidx"^^J + ) + }% + \else% + \immediate\write\eledmac@xindy@out{% + (define-attributes ("ledinnote\thelabidx"))^^J + \space\space(markup-locref^^J + \eledmacmarkuplocrefdepth^^J + :open "\string\ledinnote{\@index@command}{"^^J + :close "}"^^J + :attr "ledinnote\thelabidx"^^J + ) + }% + \fi% +% \end{macrocode} +% If we do not use \verb+xindy+ option, \cs{@ledinnote@command} will produce +% something like \verb+ledinnote{formatingcommand}+. +% \begin{macrocode} + \else% + \gdef\@ledinnote@command{% + ledinnote[\edindexlab\thelabidx]{\@index@command}% + }% + \fi% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\get@index@command} +% This macro is used to analyse if a text to be indexed has a command after a \verb+|+. +% \changes{v1.8.0}{2014/07/21}{Debug \cs{get@index@command} and compatibility with \Lpack{hyperref} package.} +% \begin{macrocode} +\def\get@index@command#1|#2+{% + \gdef\@index@txt{#1}% + \gdef\@index@command{#2}% + \xdef\@index@parenthesis{}% + \IfBeginWith{\@index@command}{(}{% + \StrGobbleLeft{\@index@command}{1}[\@index@command@]% + \global\let\@index@command\@index@command@% + \xdef\@index@parenthesis{(}% + }{}% + \IfBeginWith{\@index@command}{)}{% + \StrGobbleLeft{\@index@command}{1}[\@index@command@]% + \global\let\@index@command\@index@command@% + \xdef\@index@parenthesis{)}% + }{}% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\ledinnote} +% \changes{v1.22.0}{2015/04/25}{\cs{ledinnote} takes a first optional argument, which is the label for hyperlinks.} +% \begin{macro}{\ledinnotehyperpage} +% \begin{macro}{\ledinnotemark} +% \changes{v1.21.0}{2015/04/13}{Add \cs{ledinnotemark}.} +% These macros are used to specify that an index reference points to a note. +% Arguments of \cs{ledinnote} are: \verb+#1+ (optional): the label for the hyperlink, \verb+#2+: command applied to the number, \verb+#3+: the number itself. +% \begin{macrocode} +\newcommandx{\ledinnote}[3][1,usedefault]{% + \ifboolexpr{% + test{\ifdefequal{\iftrue}{\ifHy@hyperindex}}% + or% + bool {xindyhyperref@}% + }% + {% + \csuse{#2}{\hyperlink{#1}{\ledinnotemark{#3}}}% + }% + {% + \csuse{#2}{\ledinnotemark{#3}}% + }% +}% +\newcommand{\ledinnotehyperpage}[2]{\csuse{#1}{\ledinnotemark{\hyperpage{#2}}}}% +\newcommand{\ledinnotemark}[1]{#1\emph{n}}% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \changes{v2.0.0}{2015/07/19}{Suppress indexing command specific to \Lclass{memoir}.} +% \Eledmac and \ledmac were using the specific indexing tools of the \Lclass{memoir} in order to allow multiple index. +% However, \eledmac used \Lpack{imakeidx} or \Lpack{indextools} tools when one these two package was loaded. +% This system forced to maintained a double code, which was not very useful. +% Since \reledmac, we use only the \Lpack{imakeidx} or \Lpack{indextools} tools. +% +% The \Lpack{memoir} class provides more flexible indexing than the +% standard classes. We need different code if the \Lpack{memoir} +% class is being used, except if \Lpack{imakeidx} or \Lpack{indextools} is used. +% \begin{macro}{\edindex} +% \changes{v0.4.1}{2003/03/29}{Let eledmac take advantage of memoir's indexing} +% \changes{v1.5.0}{2013/07/11}{Compatibility with \Lpack{imakeidx} package, and possibility to use multiple index with \cs{edindex}.} +% \changes{v1.12.0}{2014/08/05}{Use correctly default index when \Lpack{imakeidx} is loaded.} +% \changes{v1.14.0}{2014/10/27}{Let eledmac take advantage of imakeidx even when memoir class is used} +% \begin{macro}{\@wredindex} +% Write the index information to the \file{idx} file. +% \begin{macrocode} +\newcommandx{\@wredindex}[2][1=\expandonce\jobname,usedefault]{%#1 = the index name, #2 = the text + \global\let\old@Rlineflag\@Rlineflag% + \gdef\@Rlineflag{}% + \ifl@imakeidx% + \if@edindex@fornote@% + \IfSubStr[1]{#2}{|}{\get@index@command#2+}{\get@index@command#2|+}% + \get@edindex@ledinnote@command% + \expandafter\imki@wrindexentry{#1}{\@index@txt|(\@ledinnote@command}{\thestartpageline}% + \expandafter\imki@wrindexentry{#1}{\@index@txt|)\@ledinnote@command}{\theendpageline}% + \else% + \get@edindex@hyperref{#2}% + \imki@wrindexentry{#1}{\@index@txt\@edindex@hyperref}{\thepageline}% + \fi% + \else% + \if@edindex@fornote@% + \IfSubStr[1]{#2}{|}{\get@index@command#2+}{\get@index@command#2|+}% + \get@edindex@ledinnote@command% + \expandafter\protected@write\@indexfile{}% + {\string\indexentry{\@index@txt|(\@ledinnote@command}{\thestartpageline} + }% + \expandafter\protected@write\@indexfile{}% + {\string\indexentry{\@index@txt|)\@ledinnote@command}{\theendpageline} + }% + \else% + \protected@write\@indexfile{}% + {\string\indexentry{#2}{\thepageline} + }% + \fi% + \fi% + \endgroup + \global\let\@Rlineflag\old@Rlineflag% + \@esphack% +} +% \end{macrocode} +% Need to add the definition of \cs{edindex} to \cs{makeindex}, and initialise +% \cs{edindex} to do nothing. +% \begin{macrocode} +\pretocmd{\makeindex}{% + \def\edindex{\@bsphack + \doedindexlabel + \begingroup + \@sanitize + \@wredindex}}{}{} +\newcommand{\edindex}[1]{\@bsphack\@esphack} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\hyperlinkformat} +% \cs{hyperlinkformat} command is to be used to have both a internal hyperlink and a format, when indexing. +% \begin{macrocode} +\newcommand{\hyperlinkformat}[3]{% + \ifstrempty{#1}% + {\hyperlink{#2}{#3}}% + {\csuse{#1}{\hyperlink{#2}{#3}}% + }} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\hyperlinkR} +% \cs{hyperlinkR} command is to be used to create a internal hyperlink and \cs{ledRflag}, when indexing. +% \begin{macrocode} +\newcommand{\hyperlinkR}[2]{% + \hyperlink{#1}{#2\@Rlineflag}% +}% + +% \end{macrocode} +% \end{macro} +% \begin{macro}{\hyperlinkformatR} +% \cs{hyperlinkformatR} command is to be used to create a internal hyperlink, a format and a \cs{@Rlineflag}, when indexing. +% \begin{macrocode} +\newcommand{\hyperlinkformatR}[3]{% + \hyperlinkformat{#1}{#2}{#3\@Rlineflag}% +}% + +% \end{macrocode} +% \end{macro} +% \begin{macro}{\get@edindex@hyperref} +% \begin{macro}{\@edindex@hyperref} +% \changes{v1.12.5}{2014/08/28}{Debug \cs{edindex} when \Lpack{hyperref} is not loaded} +% \cs{get@edindex@hyperref} is to be used to define the \cs{@edindex@hyperref} macro, which, in index, links to the point where the index was called (with \Lpack{hyperref}. +% \changes{v1.18.0}{2014/08/21}{Fix spurious space with \cs{edindex} when using \Lpack{imakeidx}/\Lpack{indextools} + hyperref.} +% \changes{v1.21.0}{2015/0}{Look at the hyperindex option of hyperref before inserting hyperref} +% \begin{macrocode} +\newcommand{\get@edindex@hyperref}[1]{% +% \end{macrocode} +% We have to disable temporary spaces to work through a \Lpack{xstring} bug (or feature?) +% \begin{macrocode} + \edef\temp@{% + \catcode`\ =9 %space need for catcode + #1% + \catcode`\ =10 % space need for catcode + }% +% \end{macrocode} +% Now, we define \cs{@edindex@hyperref} if the \verb+hyperindex+ of \Lpack{hyperref} is enabled. +% \begin{macrocode} + \ifdefequal{\iftrue}{\ifHy@hyperindex}{% + \IfSubStr{\temp@}{|}% + {\get@index@command#1+% + \ifledRcol% + \gdef\@edindex@hyperref{|\@index@parenthesis %space kept + hyperlinkformatR{\@index@command}% + {\edindexlab\thelabidx}}% + \else% + \gdef\@edindex@hyperref{|\@index@parenthesis %space kept + hyperlinkformat{\@index@command}% + {\edindexlab\thelabidx}}% + \fi% + }% + {\get@index@command#1|+% + \ifledRcol% + \gdef\@edindex@hyperref{|hyperlinkR{\edindexlab\thelabidx}}% + \else% + \gdef\@edindex@hyperref{|hyperlink{\edindexlab\thelabidx}}% + \fi% + }% + }% +% \end{macrocode} +% \begin{macrocode} +% If we use both xindy and hyperref, first get the \cs{index@command} command. +% Then define \cs{@edindex@hyperref} in the form \verb+eledmacXXX+ +% \begin{macrocode} + {\ifxindyhyperref@% + \IfSubStr{\temp@}{|}% + {\get@index@command#1+}% + {\get@index@command#1|+}% + \gdef\@edindex@hyperref{|eledmac\thelabidx}% +% \end{macrocode} +% If we start a reference range by a opening parenthesis, +% store the \cs{thelabidx} for the current \cs{edindex}, then define \cs{@edindex@hyperref} in the form \verb+|(eledmac\thelabidx+. +% \begin{macrocode} + \IfStrEq{\@index@parenthesis}{(}% + {% + \csxdef{xindyparenthesis@\@index@txt}{\thelabidx}% + \gdef\@edindex@hyperref{|(eledmac\thelabidx}% + }% + {}% +% \end{macrocode} +% This \cs{thelabidx} will be called back at the closing parenthesis, to have the same number in +% \cs{@edindex@hyperref} command that we had at the opening parenthesis. +% \cs{@edindex@hyperref} start by a closing parenthesis, then followed by \verb+eledmacXXX+ where \verb+XXX+ is the \cs{thelabidx} of the opening \cs{edindex}. +% \begin{macrocode} + \IfStrEq{\@index@parenthesis}{)}% + {% + \xdef\@edindex@hyperref{|)eledmac\csuse{xindyparenthesis@\@index@txt}}% + \global\csundef{xindyparenthesis@\@index@txt}% + }% +% \end{macrocode} +% Write in the .xdy file the attributes of the location. +% \begin{macrocode} + {% + \immediate\write\eledmac@xindy@out{% + (define-attributes ("eledmac\thelabidx"))^^J + \space\space(markup-locref^^J + \eledmacmarkuplocrefdepth^^J + :open "\string\hyperlink% + \ifledRcol R\fi% + {\edindexlab\thelabidx}% + {\ifdefempty{\@index@command}% + {}% + {\@backslashchar\@index@command}% + {"^^J + :close "}}"^^J + :attr "eledmac\thelabidx"^^J + ) + }% + }% +% \end{macrocode} +% And now, in any other case. +% \begin{macrocode} + \else% + \gdef\@index@txt{#1}% + \gdef\@edindex@hyperref{}% + \fi% + }% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \changes{v1.14.0}{2014/10/27}{Delete previous override of \cs{l@d@@wrindexhyp} at the beginning of a document when hyperref is not loaded.} +% +% +% \section{Verse} +% +% The original code is principally Wayne Sullivan's\index{Sullivan, Wayne} +% code from \edstanza. +% However, the code has been many time modified by Maïeul Rouquette in order to obtain new features and improved compatibility with \parpackage. +% +% \subsection{Hanging symbol management} +% +% \begin{macro}{\@hangingsymbol} +% \begin{macro}{\sethangingsymbol} +% \begin{macro}{\ifinstanza} +% The macro \cs{@hangingsymbol} is used to insert a symbol on each hanging of verses. It is set by user level macro \cs{sethangingsymbol}. +% +% For example, in french typographie the symbol is `['. We obtain it by the next code: +%\begin{verbatim} +%\sethangingsymbol{[\,} +%\end{verbatim} +% The \cs{ifinstanza} boolean is used to be sure that we are in a stanza part. +% \begin{macrocode} +\def\@hangingsymbol{} +\newcommand*{\sethangingsymbol}[1]{% + \gdef\@hanginsymbol{#1}% +}% +\newif\ifinstanza +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \begin{macro}{\inserthangingymbol} +% \begin{macro}{\ifinserthangingsymbol} +% The boolean \cs{ifinserthangingsymbol} is set to TRUE when \cs{@lock} is greater than 1, i.e. when we are not in the first line of a verse. The switch of \cs{ifinserthangingsymbol} is made in \cs{do@line} before the printing of line but after the line number calculation. +%\changes{v0.15.0}{2012/06/11}{New management of hangingsymbol insertion, preventing undesirable insertions.} +%\changes{v0.17.0}{2012/08/03}{New new management of hangingsymbol insertion, preventing undesirable insertions.} +% \changes{v1.6.1}{2013/10/27}{Hang verse is now not automatically flush right.} +% \begin{macrocode} +\newif\ifinserthangingsymbol +\newcommand{\inserthangingsymbol}{% +\ifinserthangingsymbol% + \ifinstanza% + \@hangingsymbol% + \fi% +\fi% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \subsection{Using \& character} +% \begin{macro}{\ampersand} +% Within a stanza the \verb?\&? macro is going to be usurped. +% We need an +% alias in case an \& needs to be typeset in a stanza. Define it rather +% than letting it in case some other package has already defined it. +% \begin{macrocode} +\newcommand*{\ampersand}{\char`\&} + +% \end{macrocode} +% \end{macro} +% +% \subsection{Code category setting} +% \begin{macro}{\stanza@count} +% \begin{macro}{\stanzaindentbase} +% Before we can define the main macros we need to save and reset +% some category codes. To save the current values we use +% \cs{next} and \cs{body} from the \cs{loop} macro. +% \begin{macrocode} + \chardef\body=\catcode`\@ + \catcode`\@=11 + \chardef\next=\catcode`\& + \catcode`\&=\active + +% \end{macrocode} +% \subsection{Stanza count and indent} +% A count register is allocated for counting lines in a stanza; also allocated +% is a dimension register which is used to specify the base value for +% line indentation; all stanza indentations are multiples of this +% value. The default value of \cs{stanzaindentbase} is 20pt. +% \begin{macrocode} + \newcount\stanza@count + \newlength{\stanzaindentbase} + \setlength{\stanzaindentbase}{20pt} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\strip@szacnt} +% \begin{macro}{\setstanzavalues} +% The indentations of stanza lines are non-negative integer multiples of the +% unit called +% \cs{stanzaindentbase}. To make it easier for the user to specify these +% numbers, some list macros are defined. These take numerical values +% in a list separated by commas and assign the values to special control +% sequences using \cs{mathchardef}. Though this does limit the range +% from 0 to 32767, it should suffice for most applications, +% including \emph{penalties}, which will be discussed below. +% \begin{macrocode} +\def\strip@szacnt#1,#2|{\def\@tempb{#1}\def\@tempa{#2|}} +\newcommand*{\setstanzavalues}[2]{\def\@tempa{#2,,|}% + \stanza@count\z@ + \def\next{\expandafter\strip@szacnt\@tempa + \ifx\@tempb\empty\let\next\relax\else + \expandafter\mathchardef\csname #1@\number\stanza@count + @\endcsname\@tempb\relax + \advance\stanza@count\@ne\fi\next}% + \next} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\setstanzaindents} +% \begin{macro}{\setstanzapenalties} +% In the original \edmac, \cs{setstanzavalues}\verb+{sza}+\marg{...} had to be called to +% set the indents, and similarly \cs{setstanzavalues}\verb+{szp}+\marg{...}. +% to set the penalties. +% \cs{setstanzaindents} and \cs{setstanzapenalties} macros are a convenience to give +% the user one less thing to worry about (misspelling the first argument). +% +% \begin{macrocode} +\newcommand*{\setstanzaindents}[1]{\setstanzavalues{sza}{#1}} +\newcommand*{\setstanzapenalties}[1]{\setstanzavalues{szp}{#1}} +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\managestanza@modulo} +% Since version 0.13, the \verb+stanzaindentsrepetition+ counter can be used when the indentation is repeated every n verses. +% The \cs{managestanza@modulo} is a command which modifies the counter stanza@modulo. The command adds 1 to stanza@modulo, but if stanza@modulo is equal to the stanzaindentsrepetition counter, the command restarts it. +%\changes{v0.13.0}{2011/11/08}{New stanzaindentsrepetition counter to repeat stanza indents every \emph{n} verses.} +% % \changes{v1.5.1}{2013/08/16}{Correct stanzaindentsrepetition counter} +% \begin{macrocode} +\newcounter{stanzaindentsrepetition} +\newcount\stanza@modulo + +\newcommand*{\managestanza@modulo}[0]{ + \advance\stanza@modulo\@ne + \ifnum\stanza@modulo>\value{stanzaindentsrepetition} + \stanza@modulo\@ne + \fi +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\stanzaindent} +% \begin{macro}{\stanzaindent*} +% The macro \cs{stanzaindent}, when called at the beginning of a verse, changes the indentation normally defined for this verse by \cs{setstanzaindent}. +% The starred version skips the current verse for the repetition of stanza indent. +% \begin{macrocode} +\newcommand{\stanzaindent}[1]{% + \hspace{\dimexpr#1\stanzaindentbase-\parindent\relax}% + \ignorespaces% +}% +\WithSuffix\newcommand\stanzaindent*[1]{% + \stanzaindent{#1}% + \global\advance\stanza@modulo-\@ne% + \ifnum\stanza@modulo=0% + \global\stanza@modulo=\value{stanzaindentsrepetition}% + \fi% + \ignorespaces% +}% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \subsection{Main work} +% \begin{macro}{\stanza@line} +% \begin{macro}{\stanza@hang} +% \begin{macro}{\sza@penalty} +% Now we arrive at the main works. \cs{stanza@line} sets the +% indentation for the line and starts a numbered paragraph---each +% line is treated as a paragraph. \cs{stanza@hang} sets the +% hanging indentation to be used if the stanza line requires +% more than one print line. + +%If it is known that each stanza line +% will fit on one print line, it is advisable to set the +% hanging indentation to zero. \cs{sza@penalty} places the +% specified penalty following each stanza line. +% By default, this +% facility is turned off so that no penalty is included. However, +% the user may initiate these penalties to indicate good and bad +% places in the stanza for page breaking. +% \begin{macrocode} +\newcommandx{\stanza@line}[1][1]{ + \ifnum\value{stanzaindentsrepetition}=0 + \parindent=\csname sza@\number\stanza@count + @\endcsname\stanzaindentbase + \else + \parindent=\csname sza@\number\stanza@modulo + @\endcsname\stanzaindentbase + \managestanza@modulo + \fi + \pstart[#1]\stanza@hang\ignorespaces} +\xdef\stanza@hang{\noexpand\leavevmode\noexpand\startlock + \hangindent\expandafter + \noexpand\csname sza@0@\endcsname\stanzaindentbase + \hangafter\@ne} +\def\sza@penalty{\count@\csname szp@\number\stanza@count @\endcsname + \ifnum\count@>\@M\advance\count@-\@M\penalty-\else + \penalty\fi\count@} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@startstanza} +% \begin{macro}{\stanza} +% \changes{v1.12.0}{2014/08/05}{Add \cs{newverse} macro, \cs{falseverse} deprecated.} +% \changes{v1.12.0}{2014/08/05}{\cs{Stanza} can have an optional argument: content to be printed before.} +% \changes{v1.12.0}{2014/08/05}{\ampersand can have an optional argument: content to be printed after.} +% \changes{v1.20.0}{2015/03/22}{\ampersand\ and \textbackslash\ampersand\ can be preceded by spaces.} +% \begin{macro}{\@stopstanza} +% \begin{macro}{\newverse} +% \changes{v1.6.0}{2013/10/09}{Add \cs{falseverse} macro.} +% Now we have the components of the \cs{stanza} macro, +% which appears at the start of a group of lines. This macro +% initializes the count and checks to see if hanging indentation +% and penalties are to be included. Hanging indentation suspends +% the line count, so that the enumeration is by verse line +% rather than by print line. If the print line count is desired, +% invoke \cs{let}\cs{startlock}\cs{relax} and do the same for +% \cs{endlock}. Here and above we have used \cs{xdef} to +% make the stored macros take up a bit less space, but it also +% makes them more obscure to the reader. Lines of the stanza are +% delimited by ampersands \&. +% The last line of the stanza must +% end with \verb+\&+. +% +% +% +% \begin{macrocode} +\xdef\@startstanza[#1]{% + \noexpand\instanzatrue\expandafter + \begingroup% + \catcode`\noexpand\&\active% + \global\stanza@count\@ne\stanza@modulo\@ne + \noexpand\ifnum\expandafter\noexpand + \csname sza@0@\endcsname=\z@\let\noexpand\stanza@hang\relax + \let\noexpand\endlock\relax\noexpand\else\interlinepenalty + \@M\rightskip\z@ plus 1fil\relax\noexpand\fi\noexpand\ifnum + \expandafter\noexpand\csname szp@0@\endcsname=\z@ + \let\noexpand\sza@penalty\relax\noexpand\fi% + \def\noexpand&{% + \noexpand\newverse[][]}% + \def\noexpand\&{\noexpand\@stopstanza}% + \noexpand\stanza@line[#1]} + +\newcommandx{\stanza}[1][1,usedefault]{\@startstanza[#1]} + +\newcommandx{\@stopstanza}[1][1,usedefault]{% + \unskip% + \endlock% + \pend[#1]% + \endgroup% + \instanzafalse% +} + +\newcommandx*{\newverse}[2][1,2,usedefault]{% + \unskip% + \endlock\pend[#1]\sza@penalty\global% + \advance\stanza@count\@ne\stanza@line[#2]% + } + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \begin{macro}{\flagstanza} +% Use \verb?\flagstanza[len]{text}? at the start of a line to put \texttt{text} +% a distance \texttt{len} before the start of the line. The default for +% \texttt{len} is \verb?\stanzaindentbase?. +% \begin{macrocode} +\newcommand*{\flagstanza}[2][\stanzaindentbase]{% + \hskip -#1\llap{#2}\hskip #1\ignorespaces} + +% \end{macrocode} +% \end{macro} +% +% \subsection{Restore catcode and penalties} +% The ampersand \& is used to mark the end of each stanza line, except the +% last, which is marked with \verb+\&+. This means that \verb+\halign+ may +% not be used directly within a stanza line. This does not affect macros +% involving alignments defined outside \verb+\stanza \&+. Since these +% macros usurp the control sequence \verb+\&+, the replacement +% \verb+\ampersand+ is defined to be used if this symbol is needed in a +% stanza. Also we reset the modified category codes and initialize the +% penalty default. +% \begin{macrocode} + \catcode`\&=\next + \catcode`\@=\body + \setstanzavalues{szp}{0} + +% \end{macrocode} +% +% +% +% +% \section{Arrays and tables} +% \subsection{Preamble: macro as environment} +% +% +% The following is borrowed, and renamed, from the \Lpack{amsmath} +% package. See also the CTT thread `eeq and amstex', 1995/08/31, started +% by Keith Reckdahl and ended definitively by David M. Jones. +% +% +% Several of the [math] macros scan their body twice. This means we must +% collect all text in the body of an environment form before calling +% the macro. +% +% \begin{macro}{\@emptytoks} +% This is actually defined in the \Lpack{amsgen} package. +% \begin{macrocode} +\newtoks\@emptytoks + +% \end{macrocode} +% \end{macro} +% +% The rest is from \Lpack{amsmath}. +% +% \begin{macro}{\l@denvbody} +% A token register to contain the body. +% \begin{macrocode} +\newtoks\l@denvbody + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\addtol@denvbody} +% |\addtol@denvdody{arg}| adds |arg| to the token register |\l@denvbody|. +% \begin{macrocode} +\newcommand{\addtol@denvbody}[1]{% + \global\l@denvbody\expandafter{\the\l@denvbody#1}} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\l@dcollect@body} +% The macro \cs{l@dcollect@body} starts the scan for the \cs{end}\marg{env} command +% of the current environment. It takes a macro name as argument. This macro +% is supposed to take the whole body of the environment as its argument. +% For example, given |cenv#1{...}| as a macro that processes |#1|, then +% the environment form, |\begin{env}| would call |\l@dcollect@body\cenv|. +% +% \begin{macrocode} +\newcommand{\l@dcollect@body}[1]{% + \l@denvbody{\expandafter#1\expandafter{\the\l@denvbody}}% + \edef\processl@denvbody{\the\l@denvbody\noexpand\end{\@currenvir}}% + \l@denvbody\@emptytoks \def\l@dbegin@stack{b}% + \begingroup + \expandafter\let\csname\@currenvir\endcsname\l@dcollect@@body + \edef\processl@denvbody{\expandafter\noexpand\csname\@currenvir\endcsname}% + \processl@denvbody% + }% + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\l@dpush@begins} +% When adding a piece of the current environment's contents to \cs{l@denvbody}, +% we scan it to check for additional \cs{begin} tokens, and add a `b' to the +% stack for any that we find. +% \begin{macrocode} +\def\l@dpush@begins#1\begin#2{% + \ifx\end#2\else b\expandafter\l@dpush@begins\fi} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\l@dcollect@@body} +% \cs{l@dcollect@@body} takes two arguments: the first will consist of all text +% up to the next |\end| command, and the second will be the \cs{end} command's +% argument. If there are any extra \cs{begin} commands in the body text, +% a marker is pushed onto a stack by the \cs{l@dpush@begins} function. +% Empty state for this stack means we have reached the \cs{end} that matches +% our original \cs{begin}. Otherwise we need to include the \cs{end} and its +% argument in the material we are adding to the environment body accumulator. +% \begin{macrocode} +\def\l@dcollect@@body#1\end#2{% + \edef\l@dbegin@stack{\l@dpush@begins#1\begin\end + \expandafter\@gobble\l@dbegin@stack}% + \ifx\@empty\l@dbegin@stack + \endgroup + \@checkend{#2}% + \addtol@denvbody{#1}% + \else + \addtol@denvbody{#1\end{#2}}% + \fi + \processl@denvbody % A little tricky! Note the grouping +} + +% \end{macrocode} +% \end{macro} +% +% There was a question on CTT about how to use \cs{collect@body} for a macro +% taking an argument. The following is part of that thread. +% \begin{verbatim} +% From: Heiko Oberdiek <oberdiek@uni-freiburg.de> +% Newsgroups: comp.text.tex +% Subject: Re: Using \collect@body with commands that take >1 argument +% Date: Fri, 08 Aug 2003 09:03:20 +0200 +% +% eed132@psu.edu (Evan) wrote: +% > I'm trying to make a new Latex environment that acts like the> +% \colorbox command that is part of the color package. I looked through +% > the FAQ and ran across this bit about using the \collect@body command +% > that is part of AMSLaTeX: +% > http://www.tex.ac.uk/cgi-bin/texfaq2html?label=cmdasenv +% > +% > It almost works. If I do something like the following: +% > \newcommand{\redbox}[1]{\colorbox{red}{#1}} +% > +% > \makeatletter +% > \newenvironment{redbox}{\collect@body \redbox}{} +% +% You will get an error message: Command \redbox already defined. +% Thus you must rename either the command \redbox or the environment +% name. +% +% > \begin{coloredbox}{blue} +% > Yadda yadda yadda... this is on a blue background... +% > \end{coloredbox} +% > and can't figure out how to make the \collect@body take this. +% +% > \collect@body \colorbox{red} +% > \collect@body {\colorbox{red}} +% +% The argument of \collect@body has to be one token exactly. +% +% \documentclass{article} +% \usepackage{color} +% \usepackage{amsmath} +% +% \newcommand{\redbox}[1]{\colorbox{red}{#1}} +% \makeatletter +% \newenvironment{coloredbox}[1]{% +% \def\next@{\colorbox{#1}}% +% \collect@body\next@ +% }{} +% +% % ignore spaces at begin and end of environment +% \newenvironment{coloredboxII}[1]{% +% \def\next@{\mycoloredbox{#1}}% +% \collect@body\next@ +% }{} +% \newcommand{\mycoloredbox}[2]{% +% \colorbox{#1}{\ignorespaces#2\unskip}% +% } +% +% % support of optional color model argument +% \newcommand\coloredboxIII\endcsname{} +% \def\coloredboxIII#1#{% +% \@coloredboxIII{#1}% +% } +% \def\@coloredboxIII#1#2{% +% \def\next@{\mycoloredboxIII{#1}{#2}}% +% \collect@body\next@ +% } +% \newcommand{\mycoloredboxIII}[3]{% +% \colorbox#1{#2}{\ignorespaces#3\unskip}% +% } +% +% \makeatother +% +% \begin{document} +% Black text before +% \begin{coloredbox}{blue} +% Hello World +% \end{coloredbox} +% Black text after +% +% Black text before +% \begin{coloredboxII}{blue} +% Hello World +% \end{coloredboxII} +% Black text after +% +% Black text before +% \begin{coloredboxIII}[rgb]{0,0,1} +% Hello World +% \end{coloredboxIII} +% Black text after +% +% \end{document} +% +% Yours sincerely +% Heiko <oberdiek@uni-freiburg.de> +% \end{verbatim} +% +% +% \subsection{Tabular environments} +% This is based on the work by Herbert Breger\index{Breger, Herbert} +% in developing \file{tabmac.tex}. +% +% The original \file{tabmac.tex} file was void of comments or any explanatory +% text other than the above notice. The algorithm is Breger's. Peter Wilson have made +% some cosmetic changes to the original code and reimplemented some things +% so they are more LaTeX-like. All the commentary are from Peter Wilson, as are any mistake +% or errors. +% +% However, Maïeul Rouquette has modified code in order to add new features of \eledmac and \reledmac. +% \subsubsection{Disabling and restoring commands} +% \begin{macro}{\l@dtabnoexpands} +% More no expansion for critical and familiar footnotes in tabular environment. +% +% \begin{macrocode} +\newcommand*{\l@dtabnoexpands}{% + \let\rtab=0% + \let\ctab=0% + \let\ltab=0% + \let\rtabtext=0% + \let\ltabtext=0% + \let\ctabtext=0% + \let\edbeforetab=0% + \let\edaftertab=0% + \let\edatleft=0% + \let\edatright=0% + \let\edvertline=0% + \let\edvertdots=0% + \let\edrowfill=0% +} + +% \end{macrocode} +% \end{macro} +% \begin{macro}{\disable@familiarnotes} +% \begin{macro}{\restore@familiarnotes} +% Macros to disable and restore familiar notes, to prevent them from printing multiple times in edtabularx and edarrayx environments. +% \begin{macrocode} +\newcommand{\disable@familiarnotes}{% + \unless\ifnofamiliar@% + \def\do##1{% + \csletcs{footnote@@##1}{footnote##1}% + \expandafter\renewcommand \csname footnote##1\endcsname[1]{% + \protected@csxdef{@thefnmark##1}{\csuse{thefootnote##1}}% + \csuse{@footnotemark##1}% + }% + }% + \dolistloop{\@series}% + \fi% +}% +\newcommand{\restore@familiarnotes}{% + \unless\ifnofamiliar@% + \def\do##1{% + \csletcs{footnote##1}{footnote@@##1}% + }% + \dolistloop{\@series}% + \fi% +}% + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\disable@sidenotes} +% \begin{macro}{\restore@sidenotes} +% The sames, for side notes. +% \begin{macrocode} +\newcommand{\disable@sidenotes}{% + \let\@@ledrightnote\ledrightnote% + \let\@@ledleftnote\ledleftnote% + \let\@@ledsidenote\ledsidenote% + \let\ledrightnote\@gobble% + \let\ledleftnote\@gobble% + \let\ledsidenote\@gobble% +}% +\newcommand{\restore@sidenotes}{% + \let\ledrightnote\@@ledrightnote% + \let\ledleftnote\@@ledleftnote% + \let\ledsidenote\@@ledsidenote% +}% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\disable@notes} +% \begin{macro}{\restore@notes} +% Disable/restore side and familiar notes. +% \begin{macrocode} +\newcommand{\disable@notes}{% + \disable@sidenotes% + \disable@familiarnotes% +}% +\newcommand{\restore@notes}{% + \restore@sidenotes% + \restore@familiarnotes% +}% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\EDTEXT} +% \begin{macro}{\xedtext} +% We need to be able to modify the \cs{edtext} macros +% and also restore their original definitions. +% \begin{macrocode} +\let\EDTEXT=\edtext +\newcommand{\xedtext}[2]{\EDTEXT{#1}{#2}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\EDLABEL} +% \begin{macro}{\xedlabel} +% We need to be able to modify and restore the \cs{edlabel} macro. +% \begin{macrocode} +\let\EDLABEL=\edlabel +\newcommand*{\xedlabel}[1]{\EDLABEL{#1}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\EDINDEX} +% \begin{macro}{\xedindex} +% \begin{macro}{\nulledindex} +% Macros supporting modification and restoration of \cs{edindex}. +% \begin{macrocode} +\let\EDINDEX=\edindex +\newcommand{\xedindex}{\@bsphack% + \@ifnextchar [{\l@d@index}{\l@d@index[\jobname]}} +\newcommand{\nulledindex}[2][\jobname]{\@bsphack\@esphack} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\@line@@num} +% Macro supporting restoration of |\linenum|. +% \begin{macrocode} +\let\@line@@num=\linenum +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\l@dgobblearg} +% \cs{l@dgobbleoptarg}\oarg{arg}\marg{arg} replaces these two arguments (first is optional) by \cs{relax}. +% \changes{v1.12.5}{2014/08/28}{\cs{l@dgobblearg} becomes \cs{l@dgobbeloptarg}} +% \begin{macrocode} +\newcommand*{\l@dgobbleoptarg}[2][]{\relax}% + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Relax} +% \begin{macro}{\NEXT} +% \begin{macrocode} +\let\Relax=\relax +\let\NEXT=\next + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\l@dmodforedtext} +% \begin{macro}{\l@drestoreforedtext} +% Modify and restore various macros for when |\edtext| is used. +% \changes{v1.12.5}{2014/08/28}{Debug optional arguments of \cs{Xfootnote} in tabular context} +% \begin{macrocode} +\newcommand{\l@dmodforedtext}{% + \let\edtext\relax + \def\do##1{\global\csletcs{##1footnote}{l@dgobbleoptarg}}% + \dolistloop{\@series}% + \let\edindex\nulledindex + \let\linenum\@gobble} +\newcommand{\l@drestoreforedtext}{% + \def\do##1{\global\csletcs{##1footnote}{##1@@footnote}} + \dolistloop{\@series}% + \let\edindex\xedindex} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\l@dnullfills} +% \begin{macro}{\l@drestorefills} +% Nullify and restore some column fillers, etc. +% \begin{macrocode} +\newcommand{\l@dnullfills}{% + \def\edlabel##1{}% + \def\edrowfill##1##2##3{}% +} +\newcommand{\l@drestorefills}{% + \def\edrowfill##1##2##3{\@EDROWFILL@{##1}{##2}{##3}}% +} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\letsforverteilen} +% Gathers some lets and other code that is common to the |*verteilen*| macros. +% \begin{macrocode} +\newcommand{\letsforverteilen}{% + \let\edtext\xedtext + \let\edindex\xedindex + \def\do##1{\global\csletcs{##1footnote}{##1@@footnote}} + \dolistloop{\@series}% + \let\linenum\@line@@num + \hilfsskip=\l@dcolwidth% + \advance\hilfsskip by -\wd\hilfsbox + \def\edlabel##1{\xedlabel{##1}}} + +% \end{macrocode} +% \end{macro} +% \begin{macro}{\disablel@dtabfeet} +% \begin{macro}{\enablel@dtabfeet} +% Declarations for using or using \cs{edtext} inside +% tabulars. +% The default at this point is for \cs{edtext}. +% \begin{macrocode} +\newcommand\disablel@dtabfeet{\l@dmodforedtext}% +\newcommand\enablel@dtabfeet{\l@drestoreforedtext}% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \subsubsection{Counters, boxes and lengths} +% \begin{macro}{\l@dampcount} +% \begin{macro}{\l@dcolcount} +% \cs{l@dampcount} is a counter for the \& column dividers and +% \cs{l@dcolcount} is a counter for the columns. +% \begin{macrocode} +\newcount\l@dampcount + \l@dampcount=1\relax +\newcount\l@dcolcount + \l@dcolcount=0\relax + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\hilfsbox} +% \begin{macro}{\hilfsskip} +% \begin{macro}{\Hilfsbox} +% \begin{macro}{\hilfscount} +% Some (temporary) helper items. +% \begin{macrocode} +\newbox\hilfsbox +\newskip\hilfsskip +\newbox\Hilfsbox +\newcount\hilfscount + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% 30 columns should be adequate (compared to the original 60). +% These are the column widths. (Originally these were German spelled numbers +% e.g., |\eins|, |\zwei|, etc). +% \begin{macrocode} +\newdimen\dcoli +\newdimen\dcolii +\newdimen\dcoliii +\newdimen\dcoliv +\newdimen\dcolv +\newdimen\dcolvi +\newdimen\dcolvii +\newdimen\dcolviii +\newdimen\dcolix +\newdimen\dcolx +\newdimen\dcolxi +\newdimen\dcolxii +\newdimen\dcolxiii +\newdimen\dcolxiv +\newdimen\dcolxv +\newdimen\dcolxvi +\newdimen\dcolxvii +\newdimen\dcolxviii +\newdimen\dcolxix +\newdimen\dcolxx +\newdimen\dcolxxi +\newdimen\dcolxxii +\newdimen\dcolxxiii +\newdimen\dcolxxiv +\newdimen\dcolxxv +\newdimen\dcolxxvi +\newdimen\dcolxxvii +\newdimen\dcolxxviii +\newdimen\dcolxxix +\newdimen\dcolxxx +\newdimen\dcolerr % added for error handling + +% \end{macrocode} +% +% \begin{macro}{\l@dcolwidth} +% This is a cunning way of storing the columnwidths indexed by +% the column number \cs{l@dcolcount}, like an array. (was |\Dimenzuordnung|) +% \begin{macrocode} +\newcommand{\l@dcolwidth}{\ifcase \the\l@dcolcount \dcoli %??? + \or \dcoli \or \dcolii \or \dcoliii + \or \dcoliv \or \dcolv \or \dcolvi + \or \dcolvii \or \dcolviii \or \dcolix \or \dcolx + \or \dcolxi \or \dcolxii \or \dcolxiii + \or \dcolxiv \or \dcolxv \or \dcolxvi + \or \dcolxvii \or \dcolxviii \or \dcolxix \or \dcolxx + \or \dcolxxi \or \dcolxxii \or \dcolxxiii + \or \dcolxxiv \or \dcolxxv \or \dcolxxvi + \or \dcolxxvii \or \dcolxxviii \or \dcolxxix \or \dcolxxx + \else \dcolerr \fi} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\stepl@dcolcount} +% This increments the column counter, and issues an error message +% if it is too large. +% \begin{macrocode} +\newcommand*{\stepl@dcolcount}{\advance\l@dcolcount\@ne + \ifnum\l@dcolcount>30\relax + \led@err@TooManyColumns + \fi} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\l@dsetmaxcolwidth} +% Sets the column width to the maximum value seen so far. +% \begin{macrocode} +\newcommand{\l@dsetmaxcolwidth}{% + \ifdim\l@dcolwidth < \wd\hilfsbox + \l@dcolwidth = \wd\hilfsbox + \else \relax \fi} + +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\measuremcell} +% Measure (recursively) the width required for a math cell. +% \begin{macrocode} +\def\measuremcell #1&{% + \ifx #1\\ \ifnum\l@dcolcount=0\let\NEXT\relax% + \else\l@dcheckcols% + \l@dcolcount=0% + \let\NEXT\measuremcell% + \fi% + \else\setbox\hilfsbox=\hbox{$\displaystyle{#1}$}% + \stepl@dcolcount% + \l@dsetmaxcolwidth% + \let\NEXT\measuremcell% + \fi\NEXT} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\measuretcell} +% Measure (recursively) the width required for a text cell. +% \begin{macrocode} +\def\measuretcell #1&{% + \ifx #1\\ \ifnum\l@dcolcount=0\let\NEXT\relax% + \else\l@dcheckcols% + \l@dcolcount=0% + \let\NEXT\measuretcell% + \fi% + \else\setbox\hilfsbox=\hbox{#1}% + \stepl@dcolcount% + \l@dsetmaxcolwidth% + \let\NEXT\measuretcell% + \fi\NEXT} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\measuremrow} +% Measure (recursively) the width required for a math row. +% \begin{macrocode} +\def\measuremrow #1\\{% + \ifx #1&\let\NEXT\relax% + \else\measuremcell #1&\\&\\&% + \let\NEXT\measuremrow% + \fi\NEXT} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\measuretrow} +% Measure (recursively) the width required for a text row. +% \begin{macrocode} +\def\measuretrow #1\\{% + \ifx #1&\let\NEXT\relax% + \else\measuretcell #1&\\&\\&% + \let\NEXT\measuretrow% + \fi\NEXT} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\edtabcolsep} +% The length \cs{edtabcolsep} controls the distance between columns. +% \begin{macrocode} +\newskip\edtabcolsep +\global\edtabcolsep=10pt + +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\variab} +% \begin{macrocode} +\newcommand{\variab}{\relax} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\l@dcheckcols} +% Check that the number of columns is consistent. +% \begin{macrocode} +\newcommand*{\l@dcheckcols}{% + \ifnum\l@dcolcount=1\relax + \else + \ifnum\l@dampcount=1\relax + \else + \ifnum\l@dcolcount=\l@dampcount\relax + \else + \l@d@err@UnequalColumns + \fi + \fi + \l@dampcount=\l@dcolcount + \fi} + +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\edfilldimen} +% A length. +% \begin{macrocode} +\newdimen\edfilldimen +\edfilldimen=0pt + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\c@addcolcount} +% \begin{macro}{\theaddcolcount} +% A counter to hold the number of a column. We use a roman number so +% that we can grab the column dimension from \cs{dcol}. +% \begin{macrocode} +\newcounter{addcolcount} + \renewcommand{\theaddcolcount}{\roman{addcolcount}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \subsubsection{Tabular typesetting} +% \begin{macro}{\setmcellright} +% Typeset (recursively) cells of display math right justified. +% \begin{macrocode} +\def\setmcellright #1&{\def\edlabel##1{}% + \let\edindex\nulledindex + \ifx #1\\ \ifnum\l@dcolcount=0%\removelastskip + \let\Next\relax% + \else\l@dcolcount=0% + \let\Next=\setmcellright% + \fi% + \else% + \disablel@dtabfeet% + \stepl@dcolcount% + \disable@notes% + \setbox\hilfsbox=\hbox{$\displaystyle{#1}$}% + \restore@notes% + \letsforverteilen% + \hskip\hilfsskip$\displaystyle{#1}$% + \hskip\edtabcolsep% + \let\Next=\setmcellright% + \fi\Next} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\settcellright} +% Typeset (recursively) cells of text right justified. +% \begin{macrocode} +\def\settcellright #1&{\def\edlabel##1{}% + \let\edindex\nulledindex + \ifx #1\\ \ifnum\l@dcolcount=0%\removelastskip + \let\Next\relax% + \else\l@dcolcount=0% + \let\Next=\settcellright% + \fi% + \else% + \disablel@dtabfeet% + \stepl@dcolcount% + \disable@notes% + \setbox\hilfsbox=\hbox{#1}% + \restore@notes% + \letsforverteilen% + \hskip\hilfsskip#1% + \hskip\edtabcolsep% + \let\Next=\settcellright% + \fi\Next} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\setmcellleft} +% Typeset (recursively) cells of display math left justified. +% \begin{macrocode} +\def\setmcellleft #1&{\def\edlabel##1{}% + \let\edindex\nulledindex + \ifx #1\\ \ifnum\l@dcolcount=0 \let\Next\relax% + \else\l@dcolcount=0% + \let\Next=\setmcellleft% + \fi% + \else \disablel@dtabfeet% + \stepl@dcolcount% + \disable@notes% + \setbox\hilfsbox=\hbox{$\displaystyle{#1}$}% + \restore@notes% + \letsforverteilen% + $\displaystyle{#1}$\hskip\hilfsskip\hskip\edtabcolsep% + \let\Next=\setmcellleft% + \fi\Next} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\settcellleft} +% Typeset (recursively) cells of text left justified. +% \begin{macrocode} +\def\settcellleft #1&{\def\edlabel##1{}% + \let\edindex\nulledindex + \ifx #1\\ \ifnum\l@dcolcount=0 \let\Next\relax% + \else\l@dcolcount=0% + \let\Next=\settcellleft% + \fi% + \else \disablel@dtabfeet% + \stepl@dcolcount% + \disable@notes% + \setbox\hilfsbox=\hbox{#1}% + \restore@notes% + \letsforverteilen% + #1\hskip\hilfsskip\hskip\edtabcolsep% + \let\Next=\settcellleft% + \fi\Next} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\setmcellcenter} +% Typeset (recursively) cells of display math centered. +% \begin{macrocode} +\def\setmcellcenter #1&{\def\edlabel##1{}% + \let\edindex\nulledindex + \ifx #1\\ \ifnum\l@dcolcount=0\let\Next\relax% + \else\l@dcolcount=0% + \let\Next=\setmcellcenter% + \fi% + \else \disablel@dtabfeet% + \stepl@dcolcount% + \disable@notes% + \setbox\hilfsbox=\hbox{$\displaystyle{#1}$}% + \restore@notes% + \letsforverteilen% + \hskip 0.5\hilfsskip$\displaystyle{#1}$\hskip0.5\hilfsskip% + \hskip\edtabcolsep% + \let\Next=\setmcellcenter% + \fi\Next} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\settcellcenter} +% Typeset (recursively) cells of text centered. +% \begin{macrocode} +\def\settcellcenter #1&{\def\edlabel##1{}% + \let\edindex\nulledindex + \ifx #1\\ \ifnum\l@dcolcount=0 \let\Next\relax% + \else\l@dcolcount=0% + \let\Next=\settcellcenter% + \fi% + \else \disablel@dtabfeet% + \stepl@dcolcount% + \disable@notes% + \setbox\hilfsbox=\hbox{#1}% + \restore@notes% + \letsforverteilen% + \hskip 0.5\hilfsskip #1\hskip 0.5\hilfsskip% + \hskip\edtabcolsep% + \let\Next=\settcellcenter% + \fi\Next} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NEXT} +% \begin{macrocode} +\let\NEXT=\relax + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\setmrowright} +% Typeset (recursively) rows of right justified math. +% \begin{macrocode} +\def\setmrowright #1\\{% + \ifx #1& \let\NEXT\relax + \else \centerline{\setmcellright #1&\\&\\&} + \let\NEXT=\setmrowright + \fi\NEXT} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\settrowright} +% Typeset (recursively) rows of right justified text. +% \begin{macrocode} +\def\settrowright #1\\{% + \ifx #1& \let\NEXT\relax + \else \centerline{\settcellright #1&\\&\\&} + \let\NEXT=\settrowright + \fi\NEXT} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\setmrowleft} +% Typeset (recursively) rows of left justified math. +% \begin{macrocode} +\def\setmrowleft #1\\{% + \ifx #1&\let\NEXT\relax + \else \centerline{\setmcellleft #1&\\&\\&} + \let\NEXT=\setmrowleft + \fi\NEXT} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\settrowleft} +% Typeset (recursively) rows of left justified text. +% \begin{macrocode} +\def\settrowleft #1\\{% + \ifx #1& \let\NEXT\relax + \else \centerline{\settcellleft #1&\\&\\&} + \let\NEXT=\settrowleft + \fi\NEXT} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\setmrowcenter} +% Typeset (recursively) rows of centered math. +% \begin{macrocode} +\def\setmrowcenter #1\\{% + \ifx #1& \let\NEXT\relax% + \else \centerline{\setmcellcenter #1&\\&\\&} + \let\NEXT=\setmrowcenter + \fi\NEXT} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\settrowcenter} +% Typeset (recursively) rows of centered text. +% \begin{macrocode} +\def\settrowcenter #1\\{% + \ifx #1& \let\NEXT\relax + \else \centerline{\settcellcenter #1&\\&\\&} + \let\NEXT=\settrowcenter + \fi\NEXT} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\nullsetzen} +% +% \begin{macrocode} +\newcommand{\nullsetzen}{% + \stepl@dcolcount% + \l@dcolwidth=0pt% + \ifnum\l@dcolcount=30\let\NEXT\relax% + \l@dcolcount=0\relax + \else\let\NEXT\nullsetzen% + \fi\NEXT} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\edatleft} +% \cs{edatleft}\oarg{math}\marg{symbol}\marg{len}. +% Left \meta{symbol}, 2\meta{len} high with prepended \meta{math} vertically centered. +% \begin{macrocode} +\newcommand{\edatleft}[3][\@empty]{% + \ifx#1\@empty + \vbox to 10pt{\vss\hbox{$\left#2\vrule width0pt height #3 + depth 0pt \right. $\hss}\vfil} + \else + \vbox to 4pt{\vss\hbox{$#1\left#2\vrule width0pt height #3 + depth 0pt \right. $}\vfil} + \fi} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\edatright} +% \cs{edatright}\oarg{math}\marg{symbol}\marg{len}. +% Right \meta{symbol}, 2\meta{len} high with appended \meta{math} vertically centered. +% \begin{macrocode} +\newcommand{\edatright}[3][\@empty]{% + \ifx#1\@empty + \vbox to 10pt{\vss\hbox{$\left.\vrule width0pt height #3 + depth 0pt \right#2 $\hss}\vfil} + \else + \vbox to 4pt{\vss\hbox{$\left.\vrule width0pt height #3 + depth 0pt \right#2 #1 $}\vfil} + \fi} + +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\edvertline} +% \cs{edvertline}\marg{len} vertical line \meta{len} high. +% \begin{macrocode} +\newcommand{\edvertline}[1]{\vbox to 8pt{\vss\hbox{\vrule height #1}\vfil}} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\edvertdots} +% \cs{edvertdots}\marg{len} vertical dotted line \meta{len} high. +% \begin{macrocode} +\newcommand{\edvertdots}[1]{\vbox to 1pt{\vss\vbox to #1% + {\cleaders\hbox{$\m@th\hbox{.}\vbox to 0.5em{ }$}\vfil}}} + +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\l@dtabaddcols} +% \cs{l@dtabaddcols}\marg{startcol}\marg{endcol} adds the widths of +% the columns \meta{startcol} through \meta{endcol} to \cs{edfilldimen}. +% It is a \LaTeX\ style +% reimplementation of the original \cs{@add@}. +% \begin{macrocode} +\newcommand{\l@dtabaddcols}[2]{% + \l@dcheckstartend{#1}{#2}% + \ifl@dstartendok + \setcounter{addcolcount}{#1}% + \@whilenum \value{addcolcount}<#2\relax \do + {\advance\edfilldimen by \the \csname dcol\theaddcolcount\endcsname + \advance\edfilldimen by \edtabcolsep + \stepcounter{addcolcount}}% + \advance\edfilldimen by \the \csname dcol\theaddcolcount\endcsname + \fi +} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ifl@dstartendok} +% \begin{macro}{\l@dcheckstartend} +% \cs{l@dcheckstartend}\marg{startcol}\marg{endcol} checks that the values +% of \meta{startcol} and \meta{endcol} are sensible. If they are then +% \cs{ifl@dstartendok} is set TRUE, otherwise it is set FALSE. +% \begin{macrocode} +\newif\ifl@dstartendok +\newcommand{\l@dcheckstartend}[2]{% + \l@dstartendoktrue + \ifnum #1<\@ne + \l@dstartendokfalse + \led@err@LowStartColumn + \fi + \ifnum #2>30\relax + \l@dstartendokfalse + \led@err@HighEndColumn + \fi + \ifnum #1>#2\relax + \l@dstartendokfalse + \led@err@ReverseColumns + \fi +} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\edrowfill} +% \begin{macro}{\@edrowfill@} +% \begin{macro}{\@EDROWFILL@} +% \cs{edrowfill}\marg{startcol}\marg{endcol}{fill} +% fills columns \meta{startcol} to \meta{endcol} inclusive with +% \meta{fill} (e.g. \cs{hrulefill}, \cs{upbracefill}). +% This is a \LaTeX\ style reimplementation and generalization of the +% original \cs{waklam}, \cs{Waklam}, \cs{waklamec}, \cs{wastricht} +% and \cs{wapunktel} macros. +% \begin{macrocode} +\newcommand*{\edrowfill}[3]{% + \l@dtabaddcols{#1}{#2}% + \hb@xt@ \the\l@dcolwidth{\hb@xt@ \the\edfilldimen{#3}\hss}} +\let\@edrowfill@=\edrowfill +\def\@EDROWFILL@#1#2#3{\@edrowfill@{#1}{#2}{#3}} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \DescribeMacro{\edbeforetab} +% \DescribeMacro{\edaftertab} +% The macro \cs{edbeforetab}\marg{text}\marg{math} puts \meta{text} at +% the left margin before array cell entry \meta{math}. Conversely, +% the macro \cs{edaftertab}\marg{math}\marg{text} puts \meta{text} +% at the right margin after array cell entry \meta{math}. +% \cs{edbeforetab} should be in the first column and \cs{edaftertab} in the +% last column. +% The following macros support these. +% +% \begin{macro}{\leftltab} +% \cs{leftltab}\marg{text} for \cs{edbeforetab} in \cs{ltab}. +% \begin{macrocode} +\newcommand{\leftltab}[1]{% + \hb@xt@\z@{\vbox{\edtabindent% + \moveleft\Hilfsskip\hbox{\ #1}}\hss}} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\leftrtab} +% \cs{leftrtab}\marg{text}\marg{math} for \cs{edbeforetab} in \cs{rtab}. +% \begin{macrocode} +\newcommand{\leftrtab}[2]{% + #2\hb@xt@\z@{\vbox{\edtabindent% + \advance\Hilfsskip by\dcoli% + \moveleft\Hilfsskip\hbox{\ #1}}\hss}} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\leftctab} +% \cs{leftctab}\marg{text}\marg{math} for \cs{edbeforetab} in \cs{ctab}. +% \begin{macrocode} +\newcommand{\leftctab}[2]{% + \hb@xt@\z@{\vbox{\edtabindent\l@dcolcount=\l@dampcount% + \advance\Hilfsskip by 0.5\dcoli% + \setbox\hilfsbox=\hbox{\def\edlabel##1{}% + \disablel@dtabfeet$\displaystyle{#2}$}% + \advance\Hilfsskip by -0.5\wd\hilfsbox% + \moveleft\Hilfsskip\hbox{\ #1}}\hss}% + #2} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\rightctab} +% \cs{rightctab}\marg{math}\marg{text} for \cs{edaftertab} in \cs{ctab}. +% \begin{macrocode} +\newcommand{\rightctab}[2]{% + \setbox\hilfsbox=\hbox{\def\edlabel##1{}% + \disablel@dtabfeet#2}\l@dampcount=\l@dcolcount% + #1\hb@xt@\z@{\vbox{\edtabindent\l@dcolcount=\l@dampcount% + \advance\Hilfsskip by 0.5\l@dcolwidth% + \advance\Hilfsskip by -\wd\hilfsbox% + \setbox\hilfsbox=\hbox{\def\edlabel##1{}% + \disablel@dtabfeet$\displaystyle{#1}$}% + \advance\Hilfsskip by -0.5\wd\hilfsbox% + \advance\Hilfsskip by \edtabcolsep% + \moveright\Hilfsskip\hbox{ #2}}\hss}% + } + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\rightltab} +% \cs{rightltab}\marg{math}\marg{text} for \cs{edaftertab} in \cs{ltab}. +% \begin{macrocode} +\newcommand{\rightltab}[2]{% + \setbox\hilfsbox=\hbox{\def\edlabel##1{}% + \disablel@dtabfeet#2}\l@dampcount=\l@dcolcount% + #1\hb@xt@\z@{\vbox{\edtabindent\l@dcolcount=\l@dampcount% + \advance\Hilfsskip by\l@dcolwidth% + \advance\Hilfsskip by-\wd\hilfsbox% + \setbox\hilfsbox=\hbox{\def\edlabel##1{}% + \disablel@dtabfeet$\displaystyle{#1}$}% + \advance\Hilfsskip by-\wd\hilfsbox% + \advance\Hilfsskip by\edtabcolsep% + \moveright\Hilfsskip\hbox{ #2}}\hss}% + } + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\rightrtab} +% \cs{rightrtab}\marg{math}\marg{text} for \cs{edaftertab} in \cs{rtab}. +% \begin{macrocode} +\newcommand{\rightrtab}[2]{% + \setbox\hilfsbox=\hbox{\def\edlabel##1{}% + \disablel@dtabfeet#2}% + #1\hb@xt@\z@{\vbox{\edtabindent% + \advance\Hilfsskip by-\wd\hilfsbox% + \advance\Hilfsskip by\edtabcolsep% + \moveright\Hilfsskip\hbox{ #2}}\hss}% + } + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\rtab} +% \begin{macro}{\edbeforetab} +% \begin{macro}{\edaftertab} +% \cs{rtab}\marg{body} typesets \meta{body} as an array with the +% entries right justified. +% +% +% The process is first to measure the \meta{body} to get the column +% widths, and then in a second pass to typeset the body. +% \begin{macrocode} +\newcommand{\rtab}[1]{% + \l@dnullfills + \def\edbeforetab##1##2{\leftrtab{##1}{##2}}% + \def\edaftertab##1##2{\rightrtab{##1}{##2}}% + \measurembody{#1}% + \l@drestorefills + \variab + \setmrowright #1\\&\\% + \enablel@dtabfeet} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\measurembody} +% \cs{measurembody}\marg{body} measures the array \meta{body}. +% \begin{macrocode} +\newcommand{\measurembody}[1]{% + \disablel@dtabfeet% + \l@dcolcount=0% + \nullsetzen% + \l@dcolcount=0 + \measuremrow #1\\&\\% + \global\l@dampcount=1} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\rtabtext} +% \cs{rtabtext}\marg{body} typesets \meta{body} as a tabular with the +% entries right justified. +% \begin{macrocode} +\newcommand{\rtabtext}[1]{% + \l@dnullfills + \measuretbody{#1}% + \l@drestorefills + \variab + \settrowright #1\\&\\% + \enablel@dtabfeet} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\measuretbody} +% \cs{measuretbody}\marg{body} measures the tabular \meta{body}. +% \begin{macrocode} +\newcommand{\measuretbody}[1]{% + \disable@notes% + \disablel@dtabfeet% + \l@dcolcount=0% + \nullsetzen% + \l@dcolcount=0 + \measuretrow #1\\&\\% + \restore@notes% + \global\l@dampcount=1} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ltab} +% \begin{macro}{\edbeforetab} +% \begin{macro}{\edaftertab} +% Array with entries left justified. +% \begin{macrocode} +\newcommand{\ltab}[1]{% + \l@dnullfills + \def\edbeforetab##1##2{\leftltab{##1}{##2}}% + \def\edaftertab##1##2{\rightltab{##1}{##2}}% + \measurembody{#1}% + \l@drestorefills + \variab + \setmrowleft #1\\&\\% + \enablel@dtabfeet} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\ltabtext} +% Tabular with entries left justified. +% \begin{macrocode} +\newcommand{\ltabtext}[1]{% + \l@dnullfills + \measuretbody{#1}% + \l@drestorefills + \variab + \settrowleft #1\\&\\% + \enablel@dtabfeet} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ctab} +% \begin{macro}{\edbeforetab} +% \begin{macro}{\edaftertab} +% Array with centered entries. +% \begin{macrocode} +\newcommand{\ctab}[1]{% + \l@dnullfills + \def\edbeforetab##1##2{\leftctab{##1}{##2}}% + \def\edaftertab##1##2{\rightctab{##1}{##2}}% + \measurembody{#1}% + \l@drestorefills + \variab + \setmrowcenter #1\\&\\% + \enablel@dtabfeet} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\ctabtext} +% Tabular with entries centered. +% \begin{macrocode} +\newcommand{\ctabtext}[1]{% + \l@dnullfills + \measuretbody{#1}% + \l@drestorefills + \variab + \settrowcenter #1\\&\\% + \enablel@dtabfeet} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\spreadtext} +% +% \begin{macrocode} +\newcommand{\spreadtext}[1]{%\l@dcolcount=\l@dampcount% + \hb@xt@ \the\l@dcolwidth{\hbox{#1}\hss}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\spreadmath} +% +% \begin{macrocode} +\newcommand{\spreadmath}[1]{% + \hb@xt@ \the\l@dcolwidth{\hbox{$\displaystyle{#1}$}\hss}} + +% \end{macrocode} +% \end{macro} +% +% +% +% +% \begin{macro}{\HILFSskip} +% \begin{macro}{\Hilfsskip} +% More helpers. +% \begin{macrocode} +\newskip\HILFSskip +\newskip\Hilfsskip + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\EDTABINDENT} +% +% \begin{macrocode} +\newcommand{\EDTABINDENT}{% + \ifnum\l@dcolcount=30\let\NEXT\relax\l@dcolcount=0% + \else\stepl@dcolcount% + \advance\Hilfsskip by\l@dcolwidth% + \ifdim\l@dcolwidth=0pt\advance\hilfscount\@ne + \else\advance\Hilfsskip by \the\hilfscount\edtabcolsep% + \hilfscount=1\fi% + \let\NEXT=\EDTABINDENT% + \fi\NEXT}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\edtabindent} +% (was |\tabindent|) +% \begin{macrocode} +\newcommand{\edtabindent}{% + \l@dcolcount=0\relax + \Hilfsskip=0pt% + \hilfscount=1\relax + \EDTABINDENT% + \hilfsskip=\hsize% + \advance\hilfsskip -\Hilfsskip% + \Hilfsskip=0.5\hilfsskip% + }% + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\EDTAB} +% (was |\TAB|) +% \begin{macrocode} +\def\EDTAB #1|#2|{% + \setbox\tabhilfbox=\hbox{$\displaystyle{#1}$}% + \setbox\tabHilfbox=\hbox{$\displaystyle{#2}$}% + \advance\tabelskip -\wd\tabhilfbox% + \advance\tabelskip -\wd\tabHilfbox% + \unhbox\tabhilfbox\hskip\tabelskip% + \unhbox\tabHilfbox}% + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\EDTABtext} +% (was |\TABtext|) +% \begin{macrocode} +\def\EDTABtext #1|#2|{% + \setbox\tabhilfbox=\hbox{#1}% + \setbox\tabHilfbox=\hbox{#2}% + \advance\tabelskip -\wd\tabhilfbox% + \advance\tabelskip -\wd\tabHilfbox% + \unhbox\tabhilfbox\hskip\tabelskip% + \unhbox\tabHilfbox}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\tabhilfbox} +% \begin{macro}{\tabHilfbox} +% Further helpers. +% \begin{macrocode} +\newbox\tabhilfbox +\newbox\tabHilfbox + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \subsubsection{Environments} +% \begin{environment}{edarrayl} +% \begin{environment}{edarrayc} +% \begin{environment}{edarrayr} +% The `environment' forms for \cs{ltab}, \cs{ctab} and \cs{rtab}. +% \begin{macrocode} +\newenvironment{edarrayl}{\l@dcollect@body\ltab}{} +\newenvironment{edarrayc}{\l@dcollect@body\ctab}{} +\newenvironment{edarrayr}{\l@dcollect@body\rtab}{} + +% \end{macrocode} +% \end{environment} +% \end{environment} +% \end{environment} +% +% \begin{environment}{edtabularl} +% \begin{environment}{edtabularc} +% \begin{environment}{edtabularr} +% The `environment' forms for \cs{ltabtext}, \cs{ctabtext} and \cs{rtabtext}. +% \begin{macrocode} +\newenvironment{edtabularl}{\l@dcollect@body\ltabtext}{} +\newenvironment{edtabularc}{\l@dcollect@body\ctabtext}{} +\newenvironment{edtabularr}{\l@dcollect@body\rtabtext}{} + +% \end{macrocode} +% \end{environment} +% \end{environment} +% \end{environment} +% +% +% \section{Quotation's commands} +% \begin{macro}{\initnumbering@quote} +% This macro, called at the begin of any numbered section, redefine locally the \verb+quotation+ and \verb+quote+ environment, in order to allow to use it inside numbered section. +% \changes{v2.0.0}{2015/07/19}{\cs{initnumbering@sectcmd} becomes \cs{initnumbering@quote}} +% \begin{macro}{\quotation} +% \begin{macro}{\endquotation} +% \begin{macro}{\quote} +% \begin{macro}{\endquote} +% \changes{v1.12.0}{2014/08/05}{\cs{ledxxx} sectioning commands are deprecated and replaced by \cs{eledxxx} commands.} +% \changes{v1.2.0}{2012/10/08}{Compatibility of \cs{ledchapter} with the \emph{memoir} class.} +% \changes{v1.3.0}{2012/11/01}{\emph{Quotation} and {quote} environment inside numbered sections.} +% \changes{v1.4.1}{2012/11/16}{New option \emph{noquotation}.} +% \changes{v1.4.7}{2012/06/07}{Compatibility of sectioning commands with \cs{autopar}.} +% \changes{v1.8.0}{2013/12/13}{Correction of sectioning commands in parallel texts.} +% \changes{v1.10.0}{2014/02/27}{Correction of sectioning commands in parallel texts.} +% \cs{initnumbering@quote} defines quotation environment. +% \begin{macrocode} +\newcommand{\initnumbering@quote}{ + \ifnoquotation@\else + \renewcommand{\quotation}{\par\leavevmode% + \parindent=1.5em% + \skipnumbering% + \ifautopar% + \vskip-\parskip% + \else% + \vskip\topsep% + \fi% + \global\leftskip=\leftmargin% + \global\rightskip=\leftmargin% + } + \renewcommand{\endquotation}{\par% + \global\leftskip=0pt% + \global\rightskip=0pt% + \leavevmode% + \skipnumbering% + \ifautopar% + \vskip-\parskip% + \else% + \vskip\topsep% + \fi% + } + \renewcommand{\quote}{\par\leavevmode% + \parindent=0pt% + \skipnumbering% + \ifautopar% + \vskip-\parskip% + \else% + \vskip\topsep% + \fi% + \global\leftskip=\leftmargin% + \global\rightskip=\leftmargin% + } + \renewcommand{\endquote}{\par% + \global\leftskip=0pt% + \global\rightskip=0pt% + \leavevmode% + \skipnumbering% + \ifautopar% + \vskip-\parskip% + \else% + \vskip\topsep% + \fi% + } + \fi +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \section{Section's title commands} +% \subsection{Commands to disable some feature} +% \begin{macro}{\ledsectnotoc} +% The \cs{ledsectnotoc} only disables the \cs{addcontentsline} macro. +% \begin{macrocode} +\newcommand{\ledsectnotoc}{\let\addcontentsline\@gobblethree} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\ledsectnomark} +% The \cs{ledsectnomark} only disables the \cs{chaptermark}, \cs{sectionmark} and \cs{subsectionmark} macros. +% \begin{macrocode} +\newcommand{\ledsectnomark}{% + \let\chaptermark\@gobble% + \let\sectionmark\@gobble% + \let\subsectionmark\@gobble% +} +% \end{macrocode} +% \end{macro} +% \subsection{General overview} +% The system of \cs{eledxxxx} commands to section text work like this: +% \begin{enumerate} +% \item When one of these commands is called, \macpackage writes to an auxiliary files: +% \begin{itemize} +% \item The section level. +% \item The section title. +% \item The side (when \Lpack{eledpar} is used). +% \item The pstart where the command is called. +% \item If we have starred version or not. +% \end{itemize} +% \item \macpackage adds the title of the section to pstart, as normal content. This is to enable critical notes. +% \item When \LaTeX\ is run a other time, this file is read. That: +% \begin{itemize} +% \item Adds the pstart number to a list of pstarts where a sectioning command is used. +% \item Defines a command, the name of which contains the pstart number, and which calls the normal \LaTeX\ sectioning command. +% \end{itemize} +% \item This last command is called when the pstart is effectively printed. +% \end{enumerate} +% \subsection{\cs{beforeeledchapter} command} +% We do not define commands for \cs{eledsection} and related if the \verb+noeledsec+ option is loaded. +% We use \Lpack{etoolbox} tests and not the \cs{ifxxx}\ldots\cs{else}\ldots\cs{fi} structure to prevent problem of expansions with command after the \cs{ifxxx} which contains \cs{fi}. +% As we patch command inside this test, we need to change the category code of \# character \emph{before} \cs{notbool} statement, because the second argument is read with the standard catcode (read \thetexbook to understand when the catcode's change has effect). +% \begin{macrocode} +\catcode`\#=12 +\notbool{@noeled@sec}{% +% \end{macrocode} +% \begin{macro}{\beforeeledchapter} +% For technical reasons, not yet solved, page-breaking before chapters can't be made automatically by eledmac. Users have to use \cs{beforeeledchapter}. +% \begin{macrocode} +\ifl@dmemoir + \newcommand\beforeeledchapter{% + \clearforchapter% +} +\else + \newcommand\beforeeledchapter{% + \if@openright% + \cleardoublepage% + \else% + \clearpage% + \fi% +} +\fi +% \end{macrocode} +% \end{macro} +% \subsection{Auxiliary commands} +% \begin{macro}{\if@eled@sectioning} +% The boolean \cs{if@eled@sectioning} is set to true when a sectioning command is called by a \cs{eledxxx} command, and set to false after. It is used to enable/disable line number printing. +% \begin{macrocode} +\newif\if@eled@sectioning +% \end{macrocode} +% \end{macro} +% \begin{macro}{\print@leftmargin@eledsection} +% \begin{macro}{\print@rightmargin@eledsection} +% \cs{print@leftmargin@eledsection} and \cs{print@rightmargin@eledsection} are added by \macpackage inside the code of sectioning command, in order to affix lines numbers. +% They include tests for RTL languages. +% \begin{macrocode} +\def\print@rightmargin@eledsection{% + \if@eled@sectioning% + \begingroup% + \if@RTL% + \let\llap\rlap% + \let\leftlinenum\rightlinenum% + \let\leftlinenumR\rightlinenumR% + \let\l@drd@ta\l@dld@ta% + \let\l@drsn@te\l@dlsn@te% + \fi% + \hfill\l@drd@ta \csuse{LR}{\l@drsn@te}% + \endgroup% + \fi% +}% + +\def\print@leftmargin@eledsection{% + \if@eled@sectioning% + \leavevmode% + \begingroup% + \if@RTL% + \let\rlap\llap% + \let\rightlinenum\leftlinenum% + \let\rightlinenumR\leftlinenumR% + \let\l@dld@ta\l@drd@ta% + \let\l@dlsn@te\l@drsn@te% + \fi% + \l@dld@ta\csuse{LR}{\l@dlsn@te}% + \endgroup% + \fi% +}% + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \subsection{Patching standard commands} +% \begin{macro}{\chapter} +% \begin{macro}{\M@sect} +% \begin{macro}{\@mem@old@ssect} +% \begin{macro}{\@makechapterhead} +% \begin{macro}{\@makechapterhead} +% \begin{macro}{\@makeschapterhead} +% \begin{macro}{\@sect} +% \begin{macro}{\@ssect} +% \changes{v1.12.5}{2014/08/28}{Debug \cs{eledchapter} in parallel with \Lpack{memoir}} +% \changes{v1.14.2}{2014/12/17}{Debug \cs{edtext} after starred sectioning commands when using \Lclass{memoir} class.} +% We have to patch \LaTeX, \Lclass{book} and \Lclass{memoir} sectioning commands in order to: +% \begin{itemize} +% \item Disable \cs{edtext} inside. +% \item Disable page breaking (for \cs{chapter}). +% \item Add line numbers and sidenotes. +% \end{itemize} +% Unfortunately, Maïeul Rouquette was not able to try if \Lclass{memoir} is loaded. That is why \Lpack{eledmac} tries to define for both standard class and \Lclass{memoir} class. +% +% +% \begin{macrocode} +\AtBeginDocument{% +\patchcmd{\chapter}{\clearforchapter}{% + \if@eled@sectioning\else% + \ifl@dprintingpages\else% + \clearforchapter% + \fi% + \fi% + } + {} + {} + +\pretocmd{\M@sect} + {\let\old@edtext=\edtext% + \let\edtext=\dummy@edtext@showlemma% + } + {} + {} + +\apptocmd{\M@sect} + {\let\edtext=\old@edtext} + {} + {} + +\patchcmd{\M@sect} + { #9} + { #9% + \print@rightmargin@eledsection% + } + {} + {} + +\patchcmd{\M@sect} + {\hskip #3\relax} + {\hskip #3\relax% + \print@leftmargin@eledsection% + } + {} + {} + +\patchcmd{\@mem@old@ssect} + {#5} + {#5% + \print@leftmargin@eledsection% + } + {} + {} + +\patchcmd{\@mem@old@ssect} + {\hskip #1} + {\hskip #1% + \print@rightmargin@eledsection% + } + {} + {} + +\patchcmd{\chapter}{\if@openright\cleardoublepage\else\clearpage\fi}{% + \if@eled@sectioning\else% + \ifl@dprintingpages\else% + \if@openright\cleardoublepage\else\clearpage\fi%No clearpage inside a \eledsection: will keep critical notes from printing on the title page. + \fi% + \fi% + }% + {}% + {}% + +\patchcmd{\@makechapterhead} + {#1} + {\print@leftmargin@eledsection% + #1% + \print@rightmargin@eledsection% + } + {} + {} + +\patchcmd{\@makechapterhead}% For BIDI + {\if@RTL\raggedleft\else\raggedright\fi}% + {\if@eled@sectioning\else% + \if@RTL\raggedleft\else\raggedright\fi% + \fi% + }% + {}% + {}% + +\patchcmd{\@makeschapterhead} + {#1} + {\print@leftmargin@eledsection% + #1% + \print@rightmargin@eledsection% + } + {} + {} + +\pretocmd{\@sect} + {\let\old@edtext=\edtext + \let\edtext=\dummy@edtext@showlemma% + } + {} + {} + +\apptocmd{\@sect} + {\let\edtext=\old@edtext} + {} + {} + +\pretocmd{\@ssect} + {\let\old@edtext=\edtext% + \let\edtext=\dummy@edtext@showlemma% + } + {} + {} + +\apptocmd{\@ssect} + {\let\edtext=\old@edtext} + {} + {} + +% \end{macrocode} +% \changes{v1.14.1}{2014/12/15}{Debug sectioning commands when using both \Lpack{handout} and \Lpack{hyperref} package.} +% \Lpack{hyperref} also redefines \cs{@sect}. That is why, when manipulating arguments, we patch \cs{@sect} and the same only if \Lpack{hyperref} is not used. If it is, we patch the \cs{NR} commands. +% \begin{macrocode} +\@ifpackageloaded{nameref}{ + + \patchcmd{\NR@sect} + {#8} + {#8% + \print@rightmargin@eledsection% + } + {} + {} + + \patchcmd{\NR@sect} + {\hskip #3\relax} + {\hskip #3\relax% + \print@leftmargin@eledsection% + } + {} + {} + + \patchcmd{\NR@ssect} + {#5} + {#5% + \print@rightmargin@eledsection% + } + {} + {} + + \patchcmd{\NR@ssect} + {\hskip #1} + {\hskip #1% + \print@leftmargin@eledsection% + } + {} + {} + }% + { + \patchcmd{\@sect} + {#8} + {#8% + \print@rightmargin@eledsection% + } + {} + {} + + \patchcmd{\@sect} + {\hskip #3\relax} + {\hskip #3\relax% + \print@leftmargin@eledsection% + } + {} + {} + + \patchcmd{\@ssect} + {#5} + {#5% + \print@rightmargin@eledsection% + } + {} + {} + + \patchcmd{\@ssect} + {\hskip #1} + {\hskip #1% + \print@leftmargin@eledsection% + } + {} + {} + }% +} +% \end{macrocode} +% Now, we have finished to patch the commands, using \# with a catcode equals to 12. We close the \verb+\notbool{@noeled@sec}+ statement, restore the normal catcode for \# and reopen a new \verb+\notbool{@noeled@sec}+ statement. +% \begin{macrocode} +{}}% +\protect\catcode`\#=6 %Space NEEDS by \catcode +\notbool{@noeled@sec}{% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \subsection{Main code of \cs{eledxxx} commands} +% \begin{macro}{\eled@sectioning@out} +% \cs{eled@sectioning@out} is the output file, to dump the pstarts where a sectioning command is used. +% \begin{macrocode} +\newwrite\eled@sectioning@out +% \end{macrocode} +% \end{macro} +% \begin{macro}{\eledchapter} +% \begin{macro}{\eledsection} +% \begin{macro}{\eledsubsection} +% \begin{macro}{\eledsubsubsection} +% \begin{macro}{\eledchapter*} +% \begin{macro}{\eledsection*} +% \begin{macro}{\eledsubsection*} +% \begin{macro}{\eledsubsubsection*} +% And now, the user sectioning commands, which write to the file, and also add content as a ``normal'' line. +% \begin{macrocode} +\newcommand{\eledchapter}[2][]{% + #2% + \ifledRcol% + \immediate\write\eled@sectioningR@out{% + \string\eled@chapter{#1}{\unexpanded{#2}}{\the\l@dnumpstartsR}{}{R} + }% + \else% + \immediate\write\eled@sectioning@out{% + \string\eled@chapter{#1}{\unexpanded{#2}}{\the\l@dnumpstartsL}{}{} + }% + \fi% +} + +\newcommand{\eledsection}[2][]{% + #2% + \ifledRcol% + \immediate\write\eled@sectioningR@out{% + \string\eled@section{#1}{\unexpanded{#2}}{\the\l@dnumpstartsR}{}{R} + }% + \else% + \immediate\write\eled@sectioning@out{% + \string\eled@section{#1}{\unexpanded{#2}}{\the\l@dnumpstartsL}{}{} + }% + \fi% +} + +\newcommand{\eledsubsection}[2][]{% + #2% + \ifledRcol% + \immediate\write\eled@sectioningR@out{% + \string\eled@subsection{#1}{\unexpanded{#2}}{\the\l@dnumpstartsR}{}{R} + }% + \else% + \immediate\write\eled@sectioning@out{% + \string\eled@subsection{#1}{\unexpanded{#2}}{\the\l@dnumpstartsL}{}{} + }% + \fi% +} +\newcommand{\eledsubsubsection}[2][]{% + #2% + \ifledRcol% + \immediate\write\eled@sectioningR@out{% + \string\eled@subsubsection{#1}{\unexpanded{#2}}{\the\l@dnumpstartsR}{}{R} + }% + \else% + \immediate\write\eled@sectioning@out{% + \string\eled@subsubsection{#1}{\unexpanded{#2}}{\the\l@dnumpstartsL}{}{} + }% + \fi% +} + + +\WithSuffix\newcommand\eledchapter*[2][]{% + #2% + \ifledRcol% + \immediate\write\eled@sectioningR@out{% + \string\eled@chapter{#1}{\unexpanded{#2}}{\the\l@dnumpstartsR}{*}{R} + }% + \else% + \immediate\write\eled@sectioning@out{% + \string\eled@chapter{#1}{\unexpanded{#2}}{\the\l@dnumpstartsL}{*}{} + }% + \fi% +} + +\WithSuffix\newcommand\eledsection*[2][]{% + #2% + \ifledRcol% + \immediate\write\eled@sectioningR@out{% + \string\eled@section{#1}{\unexpanded{#2}}{\the\l@dnumpstartsR}{*}{R} + }% + \else% + \immediate\write\eled@sectioning@out{% + \string\eled@section{#1}{\unexpanded{#2}}{\the\l@dnumpstartsL}{*}{} + }% + \fi% +} + +\WithSuffix\newcommand\eledsubsection*[2][]{% + #2% + \ifledRcol% + \immediate\write\eled@sectioningR@out{% + \string\eled@subsection{#1}{\unexpanded{#2}}{\the\l@dnumpstartsR}{*}{R} + }% + \else% + \immediate\write\eled@sectioning@out{% + \string\eled@subsection{#1}{\unexpanded{#2}}{\the\l@dnumpstartsL}{*}{} + }% + \fi% +} + +\WithSuffix\newcommand\eledsubsubsection*[2][]{% + #2% + \ifledRcol% + \immediate\write\eled@sectioningR@out{% + \string\eled@subsubsection{#1}{\unexpanded{#2}}{\the\l@dnumpstartsR}{*}{R} + }% + \else% + \immediate\write\eled@sectioning@out{% + \string\eled@subsubsection{#1}{\unexpanded{#2}}{\the\l@dnumpstartsL}{*}{} + }% + \fi% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \subsection{Macros written in the auxiliary file} +% \begin{macro}{\eled@chapter} +% \begin{macro}{\eled@section} +% \begin{macro}{\eled@subsection} +% \begin{macro}{\eled@subsubsection} +% The sectioning macros, called in the auxiliary file. They have five arguments: +% \begin{enumerate} +% \item Optional arguments of \LaTeX\ sectioning command. +% \item Mandatory arguments of \LaTeX\ sectioning command. +% \item Pstart number. +% \item Side: \verb+R+ if right, nothing if left. +% \item Starred or not. +% \end{enumerate} +% \begin{macrocode} +\def\eled@chapter#1#2#3#4#5{% + \ifstrempty{#4}% + {% + \ifstrempty{#1}% + {% + \global\csdef{eled@sectioning@#3#5}{\let\edtext=\dummy@edtext@showlemma\chapter{#2}}% + \global\csdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\chaptermark{#2}}% + }%Need for \pairs, because of using parbox. + {% + \global\csdef{eled@sectioning@#3#5}{\let\edtext=\dummy@edtext@showlemma\chapter[#1]{#2}}% + \global\csdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\chaptermark{#2}}%Need for \pairs, because of using parbox. + }% + }% + {% + \ifstrempty{#1}% + {\global\csdef{eled@sectioning@#3#5}{\let\edtext=\dummy@edtext@showlemma\chapter*{#2}}}% + {\global\csdef{eled@sectioning@#3#5}{\let\edtext=\dummy@edtext@showlemma\chapter*[#1]{#2}}}%Bug in LaTeX! + }% + \listcsgadd{eled@sections#5@@}{#3}% + } +\def\eled@section#1#2#3#4#5{% + \ifstrempty{#4}% + {\ifstrempty{#1}% + {% + \global\csdef{eled@sectioning@#3#5}{\section{#2}}% + \global\csdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\sectionmark{#2}}%Need for \pairs, because of using parbox. + }% + {% + \global\csdef{eled@sectioning@#3#5}{\section[#1]{#2}}% + \global\csdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\sectionmark{#1}}%Need for \pairs, because of using parbox. + }% + }% + {\ifstrempty{#1}% + {\global\csdef{eled@sectioning@#3#5}{\section*{#2}}}% + {\global\csdef{eled@sectioning@#3#5}{\section*[#1]{#2}}}%Bug in LaTeX! + } + \listcsgadd{eled@sections#5@@}{#3}% + } +\def\eled@subsection#1#2#3#4#5{% + \ifstrempty{#4}% + {\ifstrempty{#1}% + {% + \global\csdef{eled@sectioning@#3#5}{\subsection{#2}}% + \global\csdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\csuse{subsectionmark}{#2}}%Need for \pairs, because of using parbox. \csuse in case of \subsectionmark is not defined (book) + }% + {% + \global\csdef{eled@sectioning@#3#5}{\subsection[#1]{#2}}% + \global\csdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\csuse{subsectionmark}{#1}}%Need for \pairs, because of using parbox. \csuse in case of \subsectionmark is not defined (book) + }% + }% + {\ifstrempty{#1}% + {\global\csdef{eled@sectioning@#3#5}{\subsection*{#2}}}% + {\global\csdef{eled@sectioning@#3#5}{\subsection*[#1]{#2}}}%Bug in LaTeX! + } + \listcsgadd{eled@sections#5@@}{#3}% + } +\def\eled@subsubsection#1#2#3#4#5{% + \ifstrempty{#4}% + {\ifstrempty{#1}% + {\global\csdef{eled@sectioning@#3#5}{\subsubsection{#2}}}% + {\global\csdef{eled@sectioning@#3#5}{\subsubsection[#1]{#2}}}% + }% + {\ifstrempty{#1}% + {\global\csdef{eled@sectioning@#3#5}{\subsubsection*{#2}}}% + {\global\csdef{eled@sectioning@#3#5}{\subsubsection*[#1]{#2}}}%Bug in LaTeX! + } + \listcsgadd{eled@sections#5@@}{#3}% + } + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% End of the conditional test about \verb+noeledsec+ option. +% \begin{macrocode} +}{} +% \end{macrocode} +% \section{Page breaking or no page breaking depending of specific lines} +% By default, page breaks are automatic. However, the user can define lines which will force page breaks, or prevent page breaks around one specific line. +% On the first run, the line-list file records the line number of where the page break is being changed (either forced, or prevented). +% On the next run, page breaks occur either before or after this line, depending on how the user sets the command. The default setting is after the line. +% \begin{macro}{\normal@page@break} +% \cs{normal@page@break} is an \Lpack{etoolbox} list which contains the absolute line number of the last line, for each page. +% \begin{macrocode} +\def\normal@page@break{} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\prev@pb} +% \begin{macro}{\prev@nopb} +% The \cs{l@prev@pb} macro is a \Lpack{etoolbox} list, which contains the lines in which page breaks occur (before or after). +% The \cs{l@prev@nopb} macro is a \Lpack{etoolbox} list, which contains the lines with NO page break before or after. +% \begin{macrocode} +\def\l@prev@pb{} +\def\l@prev@nopb{} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\ledpb} +% \begin{macro}{\ledpbnum} +% \begin{macro}{\lednopb} +% \begin{macro}{\lednopbnum} +% The \cs{ledpb} macro writes the call to \cs{led@pb} in line-list file. +% The \cs{ledpbnum} macro writes the call to \cs{led@pbnum} in line-list file. +% The \cs{lednopb} macro writes the call to \cs{led@nopb} in line-list file. +% The \cs{lednopbnum} macro writes the call to \cs{led@nopbnum} in line-list file. +% \begin{macrocode} +\newcommand{\ledpb}{\write\linenum@out{\string\led@pb}} +\newcommand{\ledpbnum}[1]{\write\linenum@out{\string\led@pbnum{#1}}} +\newcommand{\lednopb}{\write\linenum@out{\string\led@nopb}} +\newcommand{\lednopbnum}[1]{\write\linenum@out{\string\led@nopbnum{#1}}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \begin{macro}{\led@pb} +% \begin{macro}{\led@pbnum} +% \begin{macro}{\led@nopb} +% \begin{macro}{\led@nopbnum} +% The \cs{led@pb} adds the absolute line number in the \cs{prev@pb} list. +% The \cs{led@pbnum} adds the argument in the \cs{prev@pb} list. +% The \cs{led@nopb} adds the absolute line number in the \cs{prev@nopb} list. +% The \cs{led@nopbnum} adds the argument in the \cs{prev@nopb} list. +% \begin{macrocode} +\newcommand{\led@pb}{\listxadd{\l@prev@pb}{\the\absline@num}} +\newcommand{\led@pbnum}[1]{\listxadd{\l@prev@pb}{#1}} +\newcommand{\led@nopb}{\listxadd{\l@prev@nopb}{\the\absline@num}} +\newcommand{\led@nopbnum}[1]{\listxadd{\l@prev@nopb}{#1}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \begin{macro}{\ledpbsetting} +% \begin{macro}{\led@pb@setting} +% The \cs{ledpbsetting} macro only changes the value of \cs{led@pb@macro}, for which the default value is \verb+before+. +% \begin{macrocode} +\def\led@pb@setting{before} +\newcommand{\ledpbsetting}[1]{\gdef\led@pb@setting{#1}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\led@check@pb} +% \begin{macro}{\led@check@nopb} +% The \cs{led@check@pb} and \cs{led@check@nopb} are called before or after each line. +% They check if a page break must occur, depending on the current line and on the content of \cs{l@pb}. +% \begin{macrocode} +\newcommand{\led@check@pb}{\xifinlist{\the\absline@num}{\l@prev@pb}{\pagebreak[4]}{}} +\newcommand{\led@check@nopb}{% + \IfStrEq{\led@pb@setting}{before}{% + \xifinlist{\the\absline@num}{\l@prev@nopb}% + {\numdef{\abs@prevline}{\the\absline@num-1}% + \xifinlist{\abs@prevline}{\normal@page@break}% + {\nopagebreak[4]\enlargethispage{\baselineskip}}% + {}}% + {}}% + {}% + {}% + \IfStrEq{\led@pb@setting}{after}{% + \xifinlist{\the\absline@num}{\l@prev@nopb}{% + \xifinlist{\the\absline@num}{\normal@page@break}% + {\nopagebreak[4]\enlargethispage{\baselineskip}}% + {}% +}% + {}}% + {}% + {}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \section{Long verse: prevents being separated by a page break} +% \begin{macro}{\iflednopbinverse} +% The \cs{lednopbinverse} boolean is set to false by default. +% If set to true, \macpackage will automatically prevent page breaks inside verse. +% The declaration is made at the beginning of the file, because it is used as a package option. +% \end{macro} +% \begin{macro}{\check@pb@in@verse} +% The \cs{check@pb@in@verse} checks if a verse is broken in two page. +% If true, it adds: +% \begin{itemize} +% \item The absolute line number of the first line of the verse -1 in the \cs{led@pb} list, if the page break must occur before the verse. +% \item The absolute line number of the first line of the verse -1 in the \cs{led@nopb} list, if the page break must occur after the verse. +% \end{itemize} +% \begin{macrocode} +\newcommand{\check@pb@in@verse}{% + \ifinstanza\iflednopbinverse\ifinserthangingsymbol% Using stanzas and enabling page breaks in verse control, while on a hanging verse. + \ifnum\page@num=\last@page@num\else%If we have change page + \IfStrEq{\led@pb@setting}{before}{% + \numgdef{\abs@line@verse}{\the\absline@num-1}% + \ledpbnum{\abs@line@verse}% + }{}% + \IfStrEq{\led@pb@setting}{after}{% + \numgdef{\abs@line@verse}{\the\absline@num-1}% + \lednopbnum{\abs@line@verse}% + }{}% + \fi% + \fi\fi\fi% +} +% \end{macrocode} +% \end{macro} +% \section{Compatibility with \eledmac} +% +% Here, we define some command for the \verb+eledmac-compat+ option. +% +% \begin{macrocode} +\ifeledmaccompat@% + +\newcommand{\footnormalX}[1]{\arrangementX[#1]{normal}}% +\newcommand{\footparagraphX}[1]{\arrangementX[#1]{paragraph}}% +\newcommand{\foottwocolX}[1]{\arrangementX[#1]{twocol}}% +\newcommand{\footthreecolX}[1]{\XarrangementX[#1]{threecol}}% + +\unless\ifnocritical@ + \newcommand{\footnormal}[1]{\Xarrangement[#1]{normal}}% + \newcommand{\footparagraph}[1]{\Xarrangement[#1]{paragraph}}% + \newcommand{\foottwocol}[1]{\Xarrangement[#1]{twocol}}% + \newcommand{\footthreecol}[1]{\Xarrangement[#1]{threecol}}% + \let\hsizetwocol\Xhsizetwocol + \let\hsizethreecol\Xhsizethreecol + \let\bhookXnote\Xbhooknote + \let\boxsymlinenum\Xboxsymlinenum + \let\symlinenum\Xsymlinenum + \let\beforenumberinfootnote\Xbeforenumber + \let\afternumberinfootnote\Xafternumber + \let\beforeXsymlinenum\Xbeforesymlinenum + \let\afterXsymlinenum\Xaftersymlinenum + \let\inplaceofnumber\Xinplaceofnumber + \let\Xlemmaseparator\lemmaseparator + \let\afterlemmaseparator\Xafterlemmaseparator + \let\beforelemmaseparator\Xbeforelemmaseparator + \let\inplaceoflemmaseparator\Xinplaceoflemmaseparator + \let\txtbeforeXnotes\Xtxtbeforenotes + \let\afterXrule\Xafterrule + \let\numberonlyfirstinline\Xnumberonlyfirstinline + \let\numberonlyfirstintwolines\Xnumberonlyfirstintwolines + \let\nonumberinfootnote\Xnonumberinfootnote + \let\pstartinfootnote\Xpstart + \let\pstartinfootnoteeverytime\Xpstarteverytime + \let\onlyXpstart\Xonlypstart + \let\Xnonumberinfootnote\Xnonumber + \let\nonbreakableafternumber\Xnonbreakableafternumber + \let\maxhXnotes\Xmaxhnotes + \let\beforeXnotes\Xbeforenotes + \let\boxlinenum\Xboxlinenum + \let\boxlinenumalign\Xboxlinenumaligm + \let\boxstartlinenum\Xboxstartlinenum + \let\boxendlinenum\Xboxendlinenum + \let\twolines\Xtwolines + \let\morethantwolines\Xmorethantwolines + \let\twolinesbutnotmore\Xtwolinesbutnotmore + \let\twolinesonlyinsamepage\Xtwolinesonlyinsamepage + \fi + + \unless\ifnofamiliar@ + \let\notesXwidthliketwocolumns\noteswidthliketwocolumnsX + \fi + \newcommandx[2][1,usedefault]{\parafootsep}{% + \Xparafootsep[#1]{#2}% + \parafootsepX[#1]{#2} + }% + + \newcommandx[2][1,usedefault]{\afternote}{% + \Xafternote[#1]{#2}% + \afternoteX[#1]{#2}% + }% + + \unless\ifnoend@ + \let\XendXtwolines\Xendtwolines + \let\XendXmorethantwolines\Xendmorethantwolines + \let\bhookXendnote\Xendbhooknote + \let\boxXendlinenum\Xendboxlinenum% + \let\boxXendlinenumalign\Xendboxlinenumalign% + \let\boxXendstartlinenum\Xendboxstartlinenum% + \let\boxXendendlinenum\Xendboxendlinenum% + \let\XendXlemmaseparator\Xendlemmaseparator + \let\XendXbeforelemmaseparator\Xendbeforelemmaseparator + \let\XendXafterlemmaseparator\Xendafterlemmaseparator + \let\XendXinplaceoflemmaseparator\Xendinplaceoflemmaseparator + \fi + + \AtBeginDocument{% + \ifdef\lineref{}{\let\lineref\edlineref}% + }% + + + \fi% +% \end{macrocode} +% +%</code> +% \newpage +% \appendix +% \let\oldthesection\thesection +% \renewcommand{\thesection}{Appendix \oldthesection} +% \section{Some things to do when changing version} +% \input{doc-include/migrate-mac.dtx} +% \clearpage +% \bibliographystyle{alpha} +% \phantomsection +% \addcontentsline{toc}{section}{References} +% \begin{thebibliography}{WWW99} +% +% \bibitem[Bre96]{TABMAC} +% Herbert Breger. +% \newblock \tabmac. +% \newblock October 1996. +% \newblock (Available from CTAN in +% \texttt{macros/plain/contrib/tabmac}) +% +% \bibitem[Bur01]{POEMSCOLTUG} +% John Burt. +% \newblock `Typesetting critical editions of poetry'. +% \newblock \emph{TUGboat}, \textbf{22}, 4, pp 353--361, December 2001. +% \newblock (Code available from CTAN in +% \texttt{macros/latex/contrib/poemscol}) +% +% \bibitem[Eck03]{PARALLEL} +% Matthias Eckermann. +% \newblock \emph{The \Lpack{Parallel}-Package}. +% \newblock April 2003. +% \newblock (Available from CTAN in +% \texttt{macros/latex/contrib/parallel}) +% +% \bibitem[Fai03]{FOOTMISC} +% Robin Fairbairns. +% \newblock \emph{\Lpack{footmisc} --- a portmanteau package for +% customising footnotes in \LaTeX}. +% \newblock February 2003. +% \newblock (Available from CTAN in +% \texttt{macros/latex/contrib/footmisc}) +% +% +% \bibitem[LW90]{EDMACTUG} +% John Lavagnino and Dominik Wujastyk. +% \newblock `An overview of \edmac: a \textsc{Plain} TeX format for +% critical editions'. +% \newblock \emph{TUGboat}, \textbf{11}, 4, pp. 623--643, November 1990. +% \newblock (Code available from CTAN in +% \texttt{macros/plain/contrib/edmac}) +% +% \bibitem[L\"{u}c03]{EDNOTES} +% Uwe L\"{u}ck. +% \newblock `\textsf{ednotes} --- critical edition typesetting with LaTeX'. +% \newblock \emph{TUGboat}, \textbf{24}, 2, pp. 224--236, 2003. +% \newblock (Code available from CTAN in +% \texttt{macros/latex/contrib/ednotes}) +% +% \bibitem[Sul92]{EDSTANZA} +% Wayne G.~Sullivan. +% \newblock \emph{The file \texttt{edstanza.doc}}. +% \newblock June 1992. +% \newblock (Available from CTAN in +% \texttt{macros/plain/contrib/edmac}) +% +% \bibitem[Wil02]{MEMOIR} +% Peter Wilson. +% \newblock \emph{The \Lpack{memoir} class for configurable typesetting}. +% \newblock November 2002. +% \newblock (Available from CTAN in +% \texttt{macros/latex/contrib/memoir}) +% +% \bibitem[Wil04]{ELEDPAR} +% Peter Wilson and Maïeul Rouquette. +% \newblock \emph{Parallel typesetting for critical editions: +% the \Lpack{eledpar} package}. +% \newblock December 2004. +% \newblock (Available from CTAN in +% \texttt{macros/latex/contrib/ledmmac}) +% +% \end{thebibliography} +% +% \Finale +% \phantomsection +% \addcontentsline{toc}{section}{Index} +% \PrintIndex +% +% \phantomsection +% \addcontentsline{toc}{section}{Change History} +% \PrintChanges +% \endinput +\endinput + +% \CharacterTable +% {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 +% 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 +% Digits \0\1\2\3\4\5\6\7\8\9 +% Exclamation \! Double quote \" Hash (number) \# +% Dollar \$ Percent \% Ampersand \& +% Acute accent \' Left paren \( Right paren \) +% Asterisk \* Plus \+ Comma \, +% Minus \- Point \. Solidus \/ +% Colon \: Semicolon \; Less than \< +% Equals \= Greater than \> Question mark \? +% Commercial at \@ Left bracket \[ Backslash \\ +% Right bracket \] Circumflex \^ Underscore \_ +% Grave accent \` Left brace \{ Vertical bar \| +% Right brace \} Tilde \~} +% diff --git a/Master/texmf-dist/source/latex/reledmac/reledmac.ins b/Master/texmf-dist/source/latex/reledmac/reledmac.ins new file mode 100644 index 00000000000..1e3e9e767ed --- /dev/null +++ b/Master/texmf-dist/source/latex/reledmac/reledmac.ins @@ -0,0 +1,78 @@ +%% reledmac.ins +%% Author: Peter Wilson (Herries Press) herries dot press at earthlink dot net +%% Maintainer:Maïeul Rouquette maieul at maieul dot net +%% Copyright 2004, 2005 Peter R. Wilson +%% Copyright 2011- Maïeul Rouquette +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3 of this license or (at your option) any +%% later version. +%% The latest version of the license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2003/06/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% This work consists of the files listed in the README file. +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this work when run through +%% LaTeX. +%% +%% +%% --------------- start of docstrip commands ------------------ +%% +\def\batchfile{reledmac.ins} +\input docstrip.tex +\preamble + + Author: Author: Peter Wilson ; Herries Press herries dot press at earthlink dot net ; Maïeul Rouquette maieul at maieul dot net + Copyright 2004, 2005 Peter R. Wilson + 2011- Maïeul Rouquette + This work may be distributed and/or modified under the + conditions of the LaTeX Project Public License, either + version 1.3 of this license or (at your option) any + later version. + The latest version of the license is in + http://www.latex-project.org/lppl.txt + and version 1.3 or later is part of all distributions of + LaTeX version 2003/06/01 or later. + + This work has the LPPL maintenance status "maintained". + + This work consists of the files listed in the README file. +\endpreamble + +\keepsilent + + + +\Msg{*** Generating the LaTeX2e package files ***} + +\generateFile{reledmac.sty}{t}{\from{reledmac.dtx}{code}} + +\Msg{*** Generating the LaTeX2e example files ***} + + + +\Msg{***********************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* file(s) into a directory searched by LaTeX. See the FAQ on} +\Msg{* CTAN at /help/uk-tex-faq for more on this.} +\Msg{*} +\Msg{* \space\space reledmac.sty} +\Msg{*} +\Msg{*} +\Msg{* To produce the documentation run the files ending with} +\Msg{* `.dtx' through LaTeX.} +\Msg{* For an index, process any name.idx file by:} +\Msg{* \space\space\space\space makeindex -s gind.ist name} +\Msg{* For a list of changes, process any name.glo file by:} +\Msg{* \space\space\space\space makeindex -s gglo.ist -o name.gls name.glo} +\Msg{*} +\Msg{* Happy TeXing} +\Msg{***********************************************************} + +\endinput diff --git a/Master/texmf-dist/source/latex/reledmac/reledpar.dtx b/Master/texmf-dist/source/latex/reledmac/reledpar.dtx new file mode 100644 index 00000000000..722f038f9a3 --- /dev/null +++ b/Master/texmf-dist/source/latex/reledmac/reledpar.dtx @@ -0,0 +1,5973 @@ +% \iffalse meta-comment +% +% reledpar.dtx +% Author: Peter Wilson (Herries Press) herries dot press at earthlink dot net +% Maintainer:Maïeul Rouquette maieul at maieul dot net +% Copyright 2004, 2005 Peter R. Wilson / 2011-.. Maïeul Rouquette +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either +% version 1.3 of this license or (at your option) any +% later version. +% The latest version of the license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of +% LaTeX version 2003/06/01 or later. +% +% This work has the LPPL maintenance status "maintained". +% +% This work consists of the files listed in the README file. +% +% +%<*driver> +\documentclass[twoside]{ltxdoc} +\usepackage{url} +\usepackage{xr-hyper} + \usepackage[draft=false, + plainpages=false, + pdfpagelabels, + bookmarksnumbered, +% hyperindex=true + hyperindex=false + ]{hyperref} +\usepackage{libertineotf} +\usepackage[series={A,B},noend,noeledsec,nofamiliar]{reledmac} +\usepackage{reledpar} +\usepackage[english]{babel} +\usepackage{graphicx,metalogo,longtable} +\makeatletter + \renewenvironment{theglossary}{% + \@restonecoltrue\if@twocolumn\@restonecolfalse\fi + \columnseprule \z@ \columnsep 35\p@ + \glossary@prologue% + \GlossaryParms \let\item\@idxitem \ignorespaces} + {\if@restonecol\onecolumn\else\clearpage\fi} + \def\theindex{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi + \columnseprule \z@ \columnsep 35\p@ + \index@prologue% + \IndexParms \let\item\@idxitem \ignorespaces} + \def\endtheindex{\if@restonecol\onecolumn\else\clearpage\fi} + \@mparswitchfalse +\makeatother +\EnableCrossrefs +\CodelineIndex +\RecordChanges +\renewcommand{\MakeUppercase}[1]{#1} + \newcommand{\Lpack}[1]{\textsf{#1}} + \newcommand{\Lclass}[1]{\textsf{#1}} + \newcommand{\file}[1]{\texttt{#1}} + \newcommand{\edmac}{\Lpack{edmac}\xspace} + \newcommand{\tabmac}{\Lpack{tabmac}\xspace} + \newcommand{\edstanza}{\Lpack{edstanza}\xspace} + + \newcommand{\ledmac}{\Lpack{ledmac}\xspace} + \newcommand{\Ledmac}{\Lpack{Ledmac}\xspace} + \newcommand{\ledpar}{\Lpack{ledpar}\xspace} + \newcommand{\Ledpar}{\Lpack{Ledpar}\xspace} + + + \newcommand{\eledmac}{\Lpack{eledmac}\xspace} + \newcommand{\Eledmac}{\Lpack{Eledmac}\xspace} + \newcommand{\eledpar}{\Lpack{eledpar}\xspace} + \newcommand{\Eledpar}{\Lpack{Eledpar}\xspace} + + \newcommand{\reledmac}{\Lpack{reledmac}\xspace} + \newcommand{\Reledmac}{\Lpack{Reledmac}\xspace} + \newcommand{\reledpar}{\Lpack{reledpar}\xspace} + \newcommand{\Reledpar}{\Lpack{Reledpar}\xspace} + + \let\macpackage\reledmac + \let\parpackage\reledpar + \let\Macpackage\reledmac + \let\Parpackage\reledpar + + \newcommand{\texbook}{\textit{TeXbook}} + \newcommand{\thetexbook}{\textit{The TeXbook}} +\pagestyle{headings} +\setcounter{StandardModuleDepth}{1} +% Some commands are defined here, and not in the commented part, because \externaldocument require them. +\externaldocument[reledmac-]{reledmac} +\begin{document} + \raggedbottom + \DocInput{reledpar.dtx} +\end{document} +%</driver> +% +% \fi +% \newcommand{\reff}[1]{\ref{#1} p.~\pageref{#1}} +% \CheckSum{4545} +% +% \makeatletter +% \newcommand*{\DescribeIt}{\leavevmode\@bsphack\begingroup\MakePrivateLetters +% \Describe@It} +% \newcommand*{\Describe@It}[1]{\endgroup +% \marginpar{\raggedleft\PrintDescribeEnv{#1}}% +% \SpecialItIndex{#1}\@esphack\ignorespaces} +% \newcommand*{\SpecialItIndex}[1]{\@bsphack +% \index{#1\actualchar{\protect\ttfamily#1}\encapchar usage}\@esphack} +% \DoNotIndex{\@,\@@par,\@beginparpenalty,\@empty} +% \DoNotIndex{\@flushglue,\@input} +% \DoNotIndex{\@makefnmark,\@makeother,\@maketitle} +% \DoNotIndex{\@namedef,\@ne,\@spaces,\@tempa} +% \DoNotIndex{\@tempb,\@tempswafalse,\@tempswatrue} +% \DoNotIndex{\@thanks,\@thefnmark,\@topnum} +% \DoNotIndex{\@@,\@elt,\@forloop,\@fortmp,\@gtempa,\@totalleftmargin} +% \DoNotIndex{\",\/,\@ifundefined,\@nil,\@verbatim,\@vobeyspaces} +% \DoNotIndex{\|,\~,\ ,\active,\advance,\aftergroup,\begingroup,\bgroup} +% \DoNotIndex{\mathcal,\csname,\def,\documentstyle,\dospecials,\edef} +% \DoNotIndex{\egroup} +% \DoNotIndex{\else,\endcsname,\endgroup,\endinput,\endtrivlist} +% \DoNotIndex{\expandafter,\fi,\fnsymbol,\futurelet,\gdef,\global} +% \DoNotIndex{\hbox,\hss,\if,\if@inlabel,\if@tempswa,\if@twocolumn} +% \DoNotIndex{\ifcase} +% \DoNotIndex{\ifcat,\iffalse,\ifx,\ignorespaces,\index,\input,\item} +% \DoNotIndex{\jobname,\kern,\leavevmode,\leftskip,\let,\llap,\lower} +% \DoNotIndex{\m@ne,\next,\newpage,\nobreak,\noexpand,\nonfrenchspacing} +% \DoNotIndex{\obeylines,\or,\protect,\raggedleft,\rightskip,\rm,\sc} +% \DoNotIndex{\setbox,\setcounter,\small,\space,\string,\strut} +% \DoNotIndex{\strutbox} +% \DoNotIndex{\thefootnote,\thispagestyle,\topmargin,\trivlist,\tt} +% \DoNotIndex{\twocolumn,\typeout,\vss,\vtop,\xdef,\z@} +% \DoNotIndex{\,,\@bsphack,\@esphack,\@noligs,\@vobeyspaces,\@xverbatim} +% \DoNotIndex{\`,\catcode,\end,\escapechar,\frenchspacing,\glossary} +% \DoNotIndex{\hangindent,\hfil,\hfill,\hskip,\hspace,\ht,\it,\langle} +% \DoNotIndex{\leaders,\long,\makelabel,\marginpar,\markboth,\mathcode} +% \DoNotIndex{\mathsurround,\mbox,\newcount,\newdimen,\newskip} +% \DoNotIndex{\nopagebreak} +% \DoNotIndex{\parfillskip,\parindent,\parskip,\penalty,\raise,\rangle} +% \DoNotIndex{\section,\setlength,\TeX,\topsep,\underline,\unskip,\verb} +% \DoNotIndex{\vskip,\vspace,\widetilde,\\,\%,\@date,\@defpar} +% \DoNotIndex{\[,\{,\},\]} +% \DoNotIndex{\count@,\ifnum,\loop,\today,\uppercase,\uccode} +% \DoNotIndex{\baselineskip,\begin,\tw@} +% \DoNotIndex{\a,\b,\c,\d,\e,\f,\g,\h,\i,\j,\k,\l,\m,\n,\o,\p,\q} +% \DoNotIndex{\r,\s,\t,\u,\v,\w,\x,\y,\z,\A,\B,\C,\D,\E,\F,\G,\H} +% \DoNotIndex{\I,\J,\K,\L,\M,\N,\O,\P,\Q,\R,\S,\T,\U,\V,\W,\X,\Y,\Z} +% \DoNotIndex{\1,\2,\3,\4,\5,\6,\7,\8,\9,\0} +% \DoNotIndex{\!,\#,\$,\&,\',\(,\),\+,\.,\:,\;,\<,\=,\>,\?,\_} +% \DoNotIndex{\discretionary,\immediate,\makeatletter,\makeatother} +% \DoNotIndex{\meaning,\newenvironment,\par,\relax,\renewenvironment} +% \DoNotIndex{\repeat,\scriptsize,\selectfont,\the,\undefined} +% \DoNotIndex{\arabic,\do,\makeindex,\null,\number,\show,\write,\@ehc} +% \DoNotIndex{\@author,\@ehc,\@ifstar,\@sanitize,\@title,\everypar} +% \DoNotIndex{\if@minipage,\if@restonecol,\ifeof,\ifmmode} +% \DoNotIndex{\lccode,\newtoks,\onecolumn,\openin,\p@,\SelfDocumenting} +% \DoNotIndex{\settowidth,\@resetonecoltrue,\@resetonecolfalse,\bf} +% \DoNotIndex{\clearpage,\closein,\lowercase,\@inlabelfalse} +% \DoNotIndex{\selectfont,\mathcode,\newmathalphabet,\rmdefault} +% \DoNotIndex{\bfdefault} +% \DoNotIndex{\newcommand,\renewcommand,\providecommand} +% \DoNotIndex{\ ,\to} +% +% \newcommand{\dtxfilename}{\texttt{reledpar.dtx}} +% \GetFileInfo{reledpar.sty} +% ^^A Put changes in the right order : see http://tex.stackexchange.com/a/74113/7712 +% \let\org@changes@\changes@ +% \def\my@changes v#1.#2.#3\@nil{% +% \org@changes@{v#1.\six@digits{#2}.#3=v#1.#2.#3}% +% }% +% \newcommand*{\six@digits}[1]{% +% \ifnum#1<100000 0\fi +% \ifnum#1<10000 0\fi +% \ifnum#1<1000 0\fi +% \ifnum#1<100 0\fi +% \two@digits{#1}% +% }% +% \renewcommand*{\changes@}[1]{% +% \my@changes#1.\@nil +% }% +%\makeatother +% +% \changes{v0.1.0}{2004/12/10}{First public release} +% \changes{v0.2.0}{2005/01/01}{Fix babel problems} +% \changes{v0.3.0}{2005/03/24}{Reorganize for ledarab} +% \changes{v0.3.a}{2005/03/30}{Minor \cs{linenummargin} fix} +% \changes{v0.3.b}{2005/04/08}{Improved parallel page balancing} +% \changes{v0.3.c}{2011/06/16}{Compatibilty with Polyglossia} +% \changes{v0.4.0}{2011/08/03}{No more ledparpatch. All patches are now in the main file.} +% \changes{v0.5.0}{2011/08/21}{Corrections about \cs{section} and other titles in numbered sections} +% \changes{v0.6.0}{2011/08/22}{Be able to us \cs{chapter} in parallel pages.} +% \changes{v0.7.0}{2011/08/31}{Option `shiftedverses' which make there is no blank between two parallel verses with inequal length.} +% \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.} +% \changes{v0.9.0}{2011/10/01}{Possibilty to number the pstart with the commands \cs{numberpstarttrue}.} +% \changes{v0.9.1}{2011/10/02}{The numbering of the pstarts restarts on each \cs{beginnumbering}.} +% \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.} +% \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.} +% \changes{v0.10.0}{2012/04/04}{\cs{edlabel} commands which start a paragraph are now put in the right place.} +% \changes{v0.10.0}{2012/04/04}{\cs{edlabel} commands on the right side are now correctly indicated.} +% \changes{v1.0.0}{2012/09/14}{Compatibility with eledmac. Change name to eledpar.} +% \changes{v1.0.1}{2012/09/16}{Correction on \cs{numberonlyfirstinline} with lineation by pstart or by page.} +% \changes{v1.1.0}{2012/09/25}{Shiftedverses becomes shiftedpstarts.} +% \changes{v1.2.0}{2012/10/15}{Support for \cs{led}\meta{section} commands in parallel texts.} +% \changes{v1.3.2}{2012/12/11}{Debug with some classes.} +% \changes{v1.4.3}{2013/10/27}{Corrects a false hanging verse when a verse is exactly the length of a line.} +% \changes{v1.5.0}{2013/11/08}{Add, as in eledmac, features to manage page breaks.} +% \changes{v1.7.0}{2014/04/14}{Add, as in eledmac, features to make crossrefs with pstart numbers.} +% \changes{v1.8.0}{2014/08/05}{Debug eledmac sectioning command after using \cs{resumenumbering}.} +% \changes{v1.8.0}{2014/08/05}{Compatibility with \Lpack{musixtex}.} +% \changes{v1.8.0}{2014/08/05}{Add, as in eledmac, option to insert something after \cs{pend}s / verses.} +% \changes{v1.8.0}{2014/08/05}{Add, as in eledmac, option to insert something between \cs{pstart}s / verse.} +% \changes{v1.8.0}{2014/08/05}{Add, as in eledmac, new system of sectioning commands.} +% \changes{v1.8.2}{2014/08/15}{Debug left and side note (bugs added by 1.8.0)} +% \changes{v1.8.2}{2014/08/15}{Debug \cs{eledxxx} with some paper sizes} +% \changes{v1.8.3}{2014/08/31}{Add \cs{noeledxxx}, as in eledmac} +% \changes{v1.9.0}{2014/09/16}{Compatibility with \cs{Xnoteswidthliketwocolumns} and \cs{notesXwidthliketwocolumns}} +% \changes{v1.10.0}{2015/01/12}{Restore critical notes in \cs{eledsection} in parallel columns (this bug was added in 1.8.2).} +% \changes{v1.10.0}{2015/01/12}{Compatibility with \cs{AtEveryPstart} and \cs{AtEveryPend}} +% \changes{v1.11.0}{2015/01/23}{Compatibility of standard footnotes with some biblatex styles.} +% \changes{v1.12.0}{2015/02/23}{Compatibility with \LuaLaTeX\ RTL languages.} +% \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.} +% \changes{v1.13.0}{2015/03/06}{Fix bug in shiftedpstarts when size difference between pstarts is very important.} +% \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.} +% \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.} +% \changes{v1.15.0}{2015/04/13}{Add \cs{AtEveryPstartCall}.} +% \changes{v1.15.0}{2015/04/13}{Fix vertical spurious space before right \cs{eledchapter} (bug added in v1.13.0).} +% \changes{v1.15.0}{2015/04/13}{Prevent vertical space when using \cs{AtEveryPstart} or \cs{AtEveryPend} with a command which prints nothing} +% \changes{v1.16.0}{2015/05/18}{Fix bug with nofamiliar / nocritical option of eledmac.} +% \changes{v1.16.0}{2015/05/18}{Error message when using \cs{beginnumbering}…\cs{endnumbering} without \cs{pstart}.} +% \changes{v1.16.0}{2015/05/18}{Error message when starting a Leftside/a Rightside while the previous one has not been yet typeset.} +% \changes{v1.16.0}{2015/05/18}{Error message when calling \cs{Pages} inside `pages' environment and \cs{Columns} inside `pairs' environment.} +% \changes{v1.16.0}{2015/05/18}{New package option sameparallelpagenumber to have the same page number for both left and right side.} +% \changes{v1.16.1}{2015/05/20}{Write information about line-list file version in the correct file.} +% \changes{v1.16.2}{2015/05/29}{Fix bug when adding empty lines before a \cs{pend} in combination with some specific penalties setting.} +% \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.} +% \changes{v2.0.0}{2015/07/19}{Many code refactored and moved to \reledmac.} +% \changes{v2.0.0}{2015/07/19}{Package's name becomes \reledpar.} +% \changes{v2.0.0}{2015/07/19}{Fix some bugs with `sameparallelpagenumber' option.} +% \changes{v2.0.0}{2015/07/19}{Totally new implementation of `sameparallelpagenumber' option.} +% \hyphenation{man-u-script man-u-scripts} +% +% +% ^^A PW added following as the definitions are at some unknown elsewhere +% +% \newcommand{\egstart}{% +% \par +% \begingroup +% \centering +% \begin{minipage}{0.45\textwidth}} +% \newcommand{\egmid}{% +% \end{minipage}\hfill\begin{minipage}{0.45\textwidth}} +% \newcommand{\egend}{% +% \end{minipage}\par\endgroup} +% +% \title{Parallel typesetting for critical editions: \\ +% the \parpackage package\thanks{This file (\dtxfilename) +% has version number \fileversion, last revised \filedate.}} +% \author{% +% Ma\"ieul Rouquette\thanks{\texttt{maieul at maieul dot net}} +% {\small based on the original \ledpar by} +% Peter Wilson \\ +% Herries Press\thanks{\texttt{herries dot press at earthlink dot net}}\\ +% } +% +% \date{} +% +% +% \maketitle +% +% +% \begin{abstract} +% The \macpackage package has been used for some time for typesetting critical +% editions. The \parpackage package is an extension to \macpackage +% which enables texts and their critical apparatus to be typeset in +% parallel, either in two columns or on pairs of facing pages. +% +% +% \Parpackage provides many tools and options. Normally, they are all documented in this file. +% Also provided is a help folder, ``\href{examples/.}{examples}''. The folder contains additional examples (although not for all cases). +% Examples starting by ``3-'' are for basic uses, those starting by ``4-'' are for advanced uses. +% +% 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). +% +% You can subscribe to the \macpackage email list in:\\ \url{http://geekographie.maieul.net/146} +% \end{abstract} +% \renewcommand{\numberline}[1]{#1~} +% \tableofcontents +% +% +% +% \section{Introduction} +% +% +% \subsection{Aim of this package} +% +% Some critical editions contain texts in more than one form, such as +% a set of verses in one language and their translations in another. In +% such cases there is a desire to be able to typeset the two texts, together +% with any critical apparatus, in parallel. The \parpackage package +% is an extension to \macpackage that enables two texts and their +% apparatus to be set in parallel, either in two columns or on pairs of +% facing pages. +% +% The package has to try and coerce \TeX{} into paths it was not designed +% for. Use of the package, therefore, may produce some surprising results. +% In this case, please reports them to the author via github's issues: \url{https://github.com/maieul/ledmac/issues/}. + +% This manual contains a general description of how to use +% \parpackage starting in section~\ref{howto}; +% the complete source code for the package, +% with extensive documentation (in sections~\ref{overview} +% through \ref{end}); +% and an Index to the source code. As \parpackage is an adjunct to \macpackage +% we assume that you have read the \macpackage manual. Also \parpackage requires +% \macpackage to be used, in the version distributed with version. +% +% You do not need to read the source code for this package in order to +% use it but doing so may help to answer any questions you might have. The documentation's sections are numbered in roman numeral. +% +% On a first reading, +% We suggest that you should skip anything after the general documentation in +% first sections until~\ref{overview}, +% unless you are particularly interested in the innards of \parpackage. +% +% \subsection{Historical overview} +% Many of the code of this package is based on the \eledpar package, which was based on the \ledpar, created as an extension of the \ledmac package. +% +% Names of the package related to parallel typesetting have moved in parallel of names of the package related to critical edition. +% +% Please read \macpackage's handbook in order to understand this evolution. +% \section{General}\label{howto} +% +% A file may mix \emph{numbered} and \emph{unnumbered} text. +% Numbered text is printed with marginal line numbers and can include +% footnotes and endnotes that are referenced to those line numbers: +% this is how you will want to print the text that you are editing. +% Unnumbered text is not printed with line numbers, and you can't +% use \macpackage's note commands with it: this is appropriate for +% introductions and other material added by the editor around the +% edited text. +% +% The \parpackage package lets you typeset two \emph{numbered} texts in +% parallel\footnote{You can use, anyway, \cs{numberlinefalse} to disable printing of line numbers.}. +% This can be done either as setting the `Leftside' and `Rightside' +% texts in two columns or on facing pages. +% In the paired pages case footnotes are placed at the bottom of the page +% on which they are called out --- that is, footnotes belonging to the left +% are set at the foot of a left (even numbered) page, and those for right +% texts are at the bottom of the relevant right (odd numbered) page. However, +% in the columnar case, all footnotes are set at the bottom left of the +% page on which they are called out --- they are not set below the +% relevant column. +% The line numbering schemes need not be the same for the two texts. +% +% +% \Macpackage essentially puts each chunk of numbered text +% (the text within a \cs{pstart} \ldots \cs{pend}) into a box and then +% following the \cs{pend} extracts the text line by line from the box +% to number and print it. More precisely, the text is first put into the +% the box as though it was being typeset as normal onto a page and +% any notes are stored without being typeset. Then each typeset line +% is extracted from the box and any notes for that line are recalled. +% The line, with any notes, is then output for printing, possibly with +% a line number attached. Effectively, all the text is typeset and then +% afterwards all the notes are typeset. +% +% +% \Parpackage similarly puts the left and right chunks into boxes but can't +% immediately output the text after a \cs{pend} --- it has to wait until +% after both the left and right texts have been collected before it can +% start processing. This means that several boxes are required and possibly +% \TeX\ has to store a lot of text in its memory; both the number of potential +% boxes and memory are limited. If \TeX's memory is overfilled the recourse is +% to reduce the amount of text stored before printing. +% +% \DescribeMacro{\maxchunks} +% It is possible to have multiple chunks in the left and right texts before +% printing them. The macro \cs{maxchunks}\marg{num} specifies the maximum +% number of chunks within the left or right texts. This is initially set as: \\ +% \verb?\maxchunks{5120}? \\ +% meaning that there can be up to 5120 chunks in the left text and up to +% 5120 chunks in +% the right text, requiring a total of 10240 boxes. If you need more chunks +% then you can increase \cs{maxchunks}. The \cs{maxchunks} must be called in the preamble. +% +% If you \cs{maxchunks} is too little +%you can get a \parpackage{} error message along the +% lines: ``Too many \cs{pstart} without printing. Some text will be lost.'' +% then you will have to either increase \cs{maxchunks} or use the +% parallel printing commands (\cs{Columns} or \cs{Pages}) more frequently. +% +% When typesetting verse using \cs{stanza}, each line is treated as a chunk, +% so be warned that if you are setting parallel verses you might have to +% increase \cs{maxchunks} much more than it appears at first sight. +% +% In general, \macpackage is a \TeX\ resource hog, and \parpackage{} only +% makes things worse in this respect. +% +% \section{Parallel columns}\label{columns} +% \subsection{Basic use} +% \DescribeEnv{pairs} +% Numbered text that is to be set in columns must be within a \verb?pairs? +% environment. Within the environment the text for the lefthand and righthand +% columns is placed within the \verb?Leftside? and \verb?Rightside? +% environments, respectively; these are described in more detail below +% in section~\ref{leftright}. +% +% \DescribeMacro{\Columns} +% The command \cs{Columns} typesets the texts in the previous pair of +% \verb?Leftside? and \verb?Rightside? environments. +% The general scheme for parallel columns looks like this: +% \begin{verbatim} +% \begin{pairs} +% \begin{Leftside} ... \end{Leftside} +% \begin{Rightside} ... \end{Rightside} +% \end{pairs} +% \Columns +% \begin{pairs} +% \begin{Leftside} ... \end{Leftside} +% ... +% \end{pairs} +% \Columns +% \end{verbatim} +% +% +% Keep in mind that the \cs{Columns} \textbf{must be} outside of the \verb+pairs+ environment. +% \DescribeMacro{\AtBeginPairs} +% \changes{v1.9.0}{2014/09/16}{Add \cs{AtBeginPairs} macro.} +% You can use the macro \cs{AtBeginPairs} to insert a code at the beginning of each \verb+pairs+ environments. +% That could be useful to add the \cs{sloppy} macro to prevent overfull hboxes in two columns. +% \begin{verbatim} +% \AtBeginPairs{\sloppy} +% \end{verbatim} +% There is no required pagebreak before or after the columns. +% \subsection{Setting} +% \subsubsection{Column's width} +% \DescribeMacro{\Lcolwidth} +% \DescribeMacro{\Rcolwidth} +% The lengths \cs{Lcolwidth} and \cs{Rcolwidth} are the widths of the left +% and right columns, respectively. By default, these are: \\ +% \verb?\setlength{\Lcolwidth}{0.45\textwidth}? \\ +% \verb?\setlength{\Rcolwidth}{0.45\textwidth}? \\ +% They may be adjusted if one text tends to be `bulkier' than the other. +% \subsubsection{Column's separator} +% \DescribeMacro{\columnrulewidth} +% \DescribeMacro{\columnseparator} +% The macro \cs{columnseparator} is called between each left/right pair +% of lines. By default it inserts a vertical rule of width +% \cs{columnrulewidth}. As this is initially defined to be 0pt the rule +% is invisible. For a visible rule between the columns you could try: \\ +% \verb?\setlength{\columnrulewidth}{0.4pt}? \\ +% You can also modify \cs{columnseparator} if you want more control. +% \subsubsection{Column's positions} +% \DescribeMacro{\columnsposition} +% \changes{v1.8.0}{2014/08/05}{Add \cs{columnsposition}.} +% By default, columns are positioned to the right of the page. +% However, you can use \cs{columnsposition}\verb+{L}+ to align them to the left, +% or \cs{columnsposition}\verb+{C}+ to center them. +% +% 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. +% +% +% \DescribeMacro{\beforecolumnseparator}\DescribeMacro{\aftercolumnseparator} +% \changes{v1.8.0}{2014/08/05}{Add \cs{beforecolumnseparator} and \cs{aftercolumnseparator}.} +% By default, the spaces around column separator are the same as the space: +% \begin{itemize} +% \item On the left of columns, if columns are aligned right. +% \item On the right of columns, if columns are aligned left. +% \item On both the left and right columns, if columns are centered. +% \end{itemize} +% You can redefine \cs{beforecolumnseparator} and \cs{aftercolumnseparator} length to define spaces before or after the column separator, instead of letting \parpackage calculate them automatically. +% \begin{verbatim} +% \setlength{\beforecolumseparator}{length} +% \setlength{\aftercolumseparator}{length} +% \end{verbatim} +% If you want to revert to the previous behavior, just set with a negative value. +% \subsubsection{Mixing two columns and one column texts} +% \DescribeMacro{\widthliketwocolumns} +% 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}. +% You can also call \cs{widthliketwocolumns} as a global option when loading \macpackage or \parpackage. + +% +% \DescribeMacro{\Xnoteswidthliketwocolumns} +% \DescribeMacro{\notesXwidthliketwocolumns} +% 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. +% See \macpackage's handbook for more details. +% \section{Facing pages}\label{pages} +% \subsection{Basic usage} +% \DescribeEnv{pages} +% Numbered text that is to be set on facing pages must be within a \verb?pages? +% environment. Within the environment the text for the lefthand and righthand +% pages is placed within the \verb?Leftside? and \verb?Rightside? +% environments, respectively. +% +% \DescribeMacro{\Pages} +% The command \cs{Pages} typesets the texts in the previous pair of +% \verb?Leftside? and \verb?Rightside? environments. +% The general scheme for parallel pages looks like this: +% \begin{verbatim} +% \begin{pages} +% \begin{Leftside} ... \end{Leftside} +% \begin{Rightside} ... \end{Rightside} +% \begin{Leftside} ... \end{Leftside} +% ... +% \end{pages} +% \Pages +% \end{verbatim} +% The \verb?Leftside? text is set on lefthand (even numbered) pages and +% the \verb?Rightside? text is set on righthand (odd numbered) pages. +% Each \cs{Pages} command starts a new even numbered page. After parallel +% typesetting is finished, a new page is started. +% Note that the \cs{Pages} \textbf{must be} outside of the \verb+pages+ environment. +% \subsection{Setting} +% \subsubsection{Text width} +% \DescribeMacro{\Lcolwidth} +% \DescribeMacro{\Rcolwidth} +% Within the \verb?pages? environment the lengths \cs{Lcolwidth} and +% \cs{Rcolwidth} are the widths of the left +% and right pages, respectively. By default, these are set to the normal +% textwidth for the document, but can be changed within the environment if +% necessary. +% \subsubsection{Page number} +% \changes{v1.15.0}{2015/05/18}{Add sameparallelpagenumber option.} +% By default, \cs{Pages} use the standard \LaTeX\ page number scheme. +% 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. +% +% \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. +% In this case, this setting will apply only for pages typeset by \cs{Pages}, not for ``normal'' pages. +% +% You can also switch the two system using \cs{sameparallelpagenumbertrue} and \cs{sameparallelpagenumberfalse}. +% +% \subsubsection{Page breaking} +% \DescribeMacro{\setgoalfraction} +% When doing parallel pages \parpackage{} has to guess where \TeX\ is going to +% put pagebreaks and hopefully get there first in order to put the pair of +% texts on their proper pages. When it thinks that the fraction +% \cs{@goalfraction} of a page has been filled, it finishes that page and +% starts on the other side's text. The standard value is 0.9. +% +% +% If you think you can get more on a page, increase this. On the other hand, +% if some left text overflows onto an odd numbered page or some right text +% onto an even page, try reducing it. +% You can change it using \cs{setgoalfraction}\marg{newvalue}. +% \subsection{Critical and familiar footnotes} +% Of course, in ``Facing pages'', the \macpackage's both critical and familiar footnotes can be used. +% However, some specific points must be taken into consideration. +% \subsubsection{Notes height setting} +% Since \Lpack{eledpar} v1.13.0, long notes in facing pages can flow from left to right pages, and \emph{vice-versa}. +% +% However, the \macpackage default setting for the maximum alloted size to notes is greater than \cs{textheight}. That makes impossible for long notes to flow across pages. +% \footnote{The same applies to \LaTeX\ normal notes. Read \url{http://tex.stackexchange.com/a/228283/7712} for technical informations.} +% We have not changed this default setting, because we do not want to break compatibility with older version of \macpackage and we want to be as close as possible to default \LaTeX's feature. +% +% So, you MUST change the default setting via \cs{Xmaxnotes} (for critical notes) and \cs{maxhnotesX} (for familiar notes). +% Both commands are explained in \macpackage handbook (\reff{reledmac-xmaxhnotes}). +% As an advisable setting: +% \begin{verbatim} +% \maxhXnotes{0.6\textheight} +% \maxhnotesX{0.6\textheight} +% \end{verbatim} +% \subsubsection{Notes for one side only} +% \DescribeMacro{\Xonlyside} +% \DescribeMacro{\onlysideX} +% You may want to typeset notes on one side only (either left or right). +% Use \cs{Xonlyside}\oarg{s}\marg{p} to set critical notes, and \cs{onlysideX}\oarg{s}\marg{p} to set familiar notes. +% \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. +% \subsubsection{Familiar notes called in the right side, but to be printed in the left side} +% \DescribeMacro{\footnoteXnomk} +% \DescribeMacro{\footnoteXmk} +% As often happens, the left side has less room for text. +% 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. +% +% 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. +% +% 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. +% For example: +% \begin{verbatim} +% \begin{Leftside} +% \beginnumbering +% \pstart +% A little cat\footnoteAnomk{A note.}. And so one ... +% \pend +% \endnumbering +% \end{Leftside} +% \begin{Rightside} +% \beginnumbering +% \pstart +% Un petit chat\footnotemk. And so one ... +% \pend +% \endnumbering +% \end{Rightside} +% \end{verbatim} +% \section{Left and right texts}\label{leftright} +% \subsection{Environments} +% Parallel texts are divided into Leftside and Rightside. The form of the +% contents of these two are independent of whether they will be set +% in columns or pages. +% +% \DescribeEnv{Leftside} +% \DescribeEnv{Rightside} +% The left text is put within the \verb?Leftside? environment and the +% right text likewise in the \verb?Rightside? environment. The number of +% \verb?Leftside? and \verb?Rightside? environments must be the same. +% \subsection{Numbering text lines and paragraphs} +% +% \DescribeMacro{\beginnumbering} +% \DescribeMacro{\endnumbering} +% Each section of numbered text must be preceded by +% \cs{beginnumbering} and followed by \cs{endnumbering}, like: \\ +% \cs{beginnumbering} \\ +% \meta{text} \\ +% \cs{endnumbering} \\ +% These have to be separately specified within \verb?Leftside? and +% \verb?Rightside? environments. +% +% The \cs{beginnumbering} macro resets the line number to zero, +% reads an auxiliary file called \meta{jobname}.\file{nn} (where +% \meta{jobname} is the name of the main input file for this job, +% and \file{nn} is 1 for the first numbered section, 2 for +% the second section, and so on), and then creates a new version of +% this auxiliary file to collect information during this run. +% Separate auxiliary files are maintained for right hand texts and +% these are named \meta{jobname}.\file{nnR}, using the `R' to distinguish +% them from the left hand and serial (non-parallel) texts. +% +% \DescribeMacro{\memorydump} +% The command \cs{memorydump} effectively performs an \cs{endumbering} +% immediately followed by a \cs{beginnumbering} while not restarting the +% numbering sequence. This has the effect of clearing \TeX's memory of previous +% texts and any associated notes, allowing +% longer apparent streams of parallel texts. The command should be applied +% to both left and right texts, and after making sure that all previous +% notes have been output. For example, along the lines of: +% \begin{verbatim} +% \begin{pages} +% \begin{Leftside} +% \beginnumbering +% ... +% \end{Leftside} +% \begin{Rightside} +% \beginnumbering +% ... +% \end{Rightside} +% \end{pages} +% \Pages +% \begin{pages} +% \begin{Leftside} +% \memorydump +% ... +% \end{Leftside} +% \begin{Rightside} +% \memorydump +% ... +% \end{pages} +% \end{verbatim} +% +% +%\changes{v0.9.0}{2011/10/01}{Possibility to number \cs{pstart}.} +% It is possible to insert a number at every \cs{pstart} command. +% You must use the \DescribeMacro{\numberpstarttrue}\cs{numberpstarttrue} command to have it. +% You can stop the numbering with \DescribeMacro{\numberpstartfalse}\cs{numberpstartfalse}. +% You can redefine the commands \DescribeMacro{\thepstartL}\cs{thepstartL} and \DescribeMacro{\thepstartR}\cs{thepstartR} to change style. +% The numbering restarts on each \cs{beginnumbering}. +% +% \DescribeMacro{\skipnumbering} +% The command \cs{skipnumbering} when inserted in a line of parallel text +% causes the numbering of that particular line to be skipped. This can +% useful if you are putting some kind of marker (even if it is only a +% blank line) between stanzas. Remember, parallel texts must be numbered +% and this provides a way to slip in an ``unnumbered'' line. +% \subsection{Line numbering scheme} +% Within these environments you can designate the line numbering scheme(s) +% to be used. +% \subsection{Lineation system} +% \DescribeMacro{\firstlinenum} +% \DescribeMacro{\linenumincrement} +% \DescribeMacro{\firstsublinenum} +% \DescribeMacro{\sublinenumincrement} +% \DescribeMacro{\firstlinenum*} +% \DescribeMacro{\linenumincrement*} +% \DescribeMacro{\firstsublinenum*} +% \DescribeMacro{\sublinenumincrement*} +% Following +% \cs{firstlinenum}\marg{num} the first line number will be \meta{num}, and +% following \cs{linenumincrement}\marg{num} only every \meta{num}th +% line will have a printed number. Using these macros inside the +% \verb?Leftside? and \verb?Rightside? environments gives you independent +% control over the left and right numbering schemes. The \cs{firstsublinenum} +% and \cs{sublinenumincrement} macros correspondingly set the numbering +% scheme for sublines. +% The starred versions change both left and right numbering schemes. +% +% Generally speaking, controls like \cs{firstlinenum} or \cs{linenummargin} +% apply to sequential and left texts. +% To effect right texts only, they have +% to be within a \verb?Rightside? environment. + +% \DescribeMacro{\lineationR} +% \cs{lineationR} macro is the equivalent of \macpackage \cs{lineation} macro for the right side. +% \DescribeMacro{\lineation*} + +% \cs{lineation*} macro is the equivalent of \macpackage \cs{lineation} macro for both sides. +% +% \DescribeMacro{\setRlineflag} +% A ``R'' is appended to the line numbers of the +% right texts. +% This may be useful for parallel columns but for parallel pages it might +% be more appropriate to redefine it using \cs{setRlineflag}\marg{flag}. +% Use \verb?\setRlineflag{}? to empty it. +% +% \subsection{Chunks} +% \DescribeMacro{\pstart} +% \DescribeMacro{\pend} +% In a serial (non-parallel) mode, each numbered paragraph, or chunk, +% is contained +% between the \cs{pstart} and \cs{pend} macros, and the paragraph is output +% when the \cs{pend} macro occurs. The situation is somewhat different +% with parallel typesetting as the left text (contained within \cs{pstart} +% and \cs{pend} groups within the \verb?Leftside? environment) has to be +% set in parallel with the right text (contained within its own \cs{pstart} +% and \cs{pend} groups within the corresponding \verb?Rightside? environment) +% the \cs{pend} macros cannot immediately initiate any typesetting --- +% this has to be controlled by the \cs{Columns} or \cs{Pages} macros. +% Several chunks may be specified within a \verb?Leftside? or +% \verb?Rightside? environment. +% A multi-chunk text then looks like: +% \begin{verbatim} +% \begin{...side} +% % \beginnumbering +% \pstart first chunk \pend +% \pstart second chunk \pend +% ... +% \pstart last chunk \pend +% % \endnumbering +% \end{...side} +% \end{verbatim} +% Numbering, via \cs{beginnumbering} and \cs{endnumbering}, may extend +% across several \verb?Leftside? or \verb?Rightside? environments. +% Remember, though, +% that the left/right sides are effectively independent of each other. +% +% \DescribeMacro{\autopar} +% The \cs{autopar} macro can be used, instead of manually inserting \cs{pstart}\ldots\cs{pends}. Please read \macpackage's handbook (\reff{reledmac-autopar}). + + +% \subsection{\cs{AtEveryPstart} and \cs{AtEveryPstartCall}} +% In general, remember that the moment where a \cs{pstart} is called is different +% from the moment when the \cs{pstart}\ldots\cs{pend} content is printed, which is when \cs{Pages} or \cs{Columns} is processed. +% +% Consequently: +% \begin{itemize} +% \item The argument of \cs{AtEveryPstart} (see \reff{reledmac-AtEveryPstart}) is called before every chunk is printed, except if you used an optional argument for the \cs{pstart}. +% \item The argument of \cs{AtEveryPstartCall} is called before every \cs{pstart}. +% \end{itemize} +% \subsection{Language setting} +% If you are using the +% \Lpack{babel} package or the \Lpack{polyglossia} package ,with different languages +% (via, say, \cs{selectlanguage}) for the left and right texts it is +% particularly important to select the appropriate language within the +% \verb?Leftside? and \verb?Rightside? environments. The initial language +% selected for the right text is the \Lpack{babel} package's default. Also, +% it is the \emph{last} language setting in a side that controls the +% language used in any notes for that side when they get printed. If +% you are using multilingual notes then it is probably safest to explicitly +% specify the language(s) for each note rather than relying on the language +% selection for the side. The right side language is also +% applied to the right side line numbers. +% +% \subsection{Shifting} +% Corresponding left and right sides must have the same number of +% paragraph chunks --- if there are four on the left there must be four +% on the right, even if some are empty. The start of each pair of left and +% right chunks are aligned horizontally on the page. The ends may +% come at different positions --- if one chunk is shorter than the other +% then blank lines are output on the shorter side until the end of the longer +% chunk is reached. +% +% However, sometime if the left pstarts are much greater than right pstarts, +% or \emph{vice-versa}, +% you can decide to shift the pstarts on the left and right side. +% That means the start of pstarts are not aligned horizontally on the page, +% the shift is offset at the end of each double pages. +% To enable this function, load \parpackage with the option \verb+shiftedpstarts+. +% \section{Verse} +% +% If you are typesetting verse with \macpackage you can use the \cs{stanza} +% construct, and you can also use this in right or left parallel texts. +% In this case each verse line is a chunk which has two implications. +% (1) you can unexpectedly exceed the \cs{maxchunks} limit or the overall +% limit on the number of boxes, and (2) left and right verse lines are +% matched, which may not be desirable if one side requires more print lines +% for verse lines than the other does. +% +% \DescribeEnv{astanza} +% \Parpackage provides an \verb?astanza? environment which you can use instead +% of \cs{stanza}. +% To use it, imply replace \verb?\stanza? by \verb?\begin{astanza}? and +% add \verb?\end{astanza}? after the ending \verb?\&?. Within the +% \verb?astanza? environment each verse line is treated as a paragraph, +% so there must be no blank lines in the environment otherwise there will +% be some extraneous vertical spacing. +% +% If you get an error message along the lines of `Missing number, +% treated as zero \cs{sza@0@}' it is because you have forgotten to use +% \cs{setstanzaindents} to set the stanza indents. +% +% +% +% \DescribeMacro{\sethangingsymbol}Like in \macpackage, you could use the \cs{sethangingsymbol} command to insert a character in each hanging line. If you use it, you must run \LaTeX\ two time. Example for the French typography +%\begin{verbatim} +%\sethangingsymbol{[\,} +%\end{verbatim} +% You can also use it to force hanging verse to be flush right: +% \begin{verbatim} +% \sethangingsymbol{\protect\hfill} +% \end{verbatim} +% +% +% When you use \cs{lednopb} make sure to use it on both sides in the corresponding +% verses to keep the pages in sync. +% \section{Side notes} +% As in \macpackage, you must use one of the following commands to add side notes: \cs{ledsidenote}, \cs{ledleftnote}, \cs{ledrightnote}, \cs{ledouterote}, \cs{ledinnerrote}. +% +% The \cs{sidenotemargin} defines the margin of the sidenote for either left or right side, depending on the current environment. +% You can use \cs{sidenotemargin*} to define it for both sides. +% \section{Parallel ledgroups} +% \subsection{General} +% \changes{v1.6.0}{2013/12/13}{Add tool and documentation for parallel ledgroups} +% You can also make parallel ledgroups (see the documentation of \macpackage about ledgroups, \reff{reledmac-ledgroup}). +% To do it you have: +% \begin{itemize} +% \item To load \parpackage package with the \verb+parledgroup+ option, or to add \cs{parledgrouptrue}. +% \item To push each ledgroup between \cs{pstart}\ldots\cs{pend} command. +% \end{itemize} +% See the following example: +% \begin{verbatim} +% \begin{pages} +% \begin{Leftside} +% \beginnumbering +% \pstart +% \begin{ledgroup} +% ledgroup content +% \end{ledgroup} +% \pend +% \pstart +% \begin{ledgroup} +% ledgroup content +% \end{ledgroup} +% \pend +% \endnumbering +% \end{Leftside} +% \begin{Rightside} +% \beginnumbering +% \pstart +% \begin{ledgroup} +% ledgroup content +% \end{ledgroup} +% \pend +% \pstart +% \begin{ledgroup} +% ledgroup content +% \end{ledgroup} +% \pend +% \endnumbering +% \end{Rightside} +% \end{pages} +% \Pages +% \end{verbatim} +% \subsection{Parallel ledgroups and \Lpack{setspace} package} +% 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: +% \begin{verbatim} +% \setparledgroupnotespacing{\singlespacing} +% \end{verbatim} +% \emph{In effect, to have correct spacing, do not change the font size of your notes}. +% +% \section{Sectioning commands} +% \changes{v1.8.0}{2014/08/05}{New sectioning commands, as in eledmac.} +% The standard sectioning commands of \macpackage are available, and provide parallel sectioning, for both two-column and two-page layout. +% +% \DescribeMacro{\eledsectnotoc} +% By default, the section commands of the right side are not added to the table of contents. +% 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). +% +% \DescribeMacro{\eledsectmark} +% 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). +% \StopEventually{} +% \clearpage +% \renewcommand{\thesection}{\Roman{section}} +% \setcounter{section}{0} +% \section{Implementation overview}\label{overview} +% +% \TeX\ is designed to process a single stream of text, which may include +% footnotes, tables, and so on. It just keeps converting its input into +% a stream typeset pages. It was not designed for typesetting two texts +% in parallel, where it has to alternate from one to the other. Further, +% \TeX essentially processes its input one paragraph at a time --- it is +% very difficult to get at the `internals' of a paragraph such as the +% individual lines in case you want to number them or put some mark at the +% start or end of the lines. +% +% \Macpackage solves the problem of line numbering by putting the paragraph +% in typeset form into a box, and then extracting the lines one by one +% from the box for \TeX\ to put them onto the page with the appropriate page +% breaks. Most of the \macpackage code is concerned with handling this box +% and its contents. +% +% \Parpackage's solution to the problem of parallel texts is to put the two +% texts into separate boxes, and then appropriately extract the pairs of +% lines from the boxes. This involves duplicating +% much of the original box code for an extra right text box. The other, +% smaller, +% part of the code is concerned with coordinating the line extractions from +% the boxes. +% +% +% \section{Preliminaries} +% \label{preliminaries}\relax +% \subsection{Package's meta-data} +% Announce the name and version of the package, which is +% targeted for \LaTeX 2e. The package also requires the \macpackage +% package, however we do not load it automatically, because we prefer users to know it. +% +% \begin{macrocode} +%<*code> +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{reledpar}[2015/07/19 v2.0.0 reledmac extension for parallel texts]% + +% \end{macrocode} +% \subsection{Package's requirement} +% Few commands use \cs{xspace} command. +% \begin{macrocode} +\RequirePackage{xspace}% +% \end{macrocode} +% \subsection{Package's options} +% With the option `shiftedpstarts' a long pstart one the left side (or in the right side) does not 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. +% \begin{macro}{\ifshiftedpstarts} +% \begin{macrocode} +\newif\ifshiftedpstarts +\DeclareOption{shiftedpstarts}{\shiftedpstartstrue} +% \end{macrocode} +% \end{macro} +% The \verb+parledgroup+ can be called either on \macpackage or \parpackage. +% \begin{macrocode} +\DeclareOption{parledgroup}{\parledgrouptrue} +% \end{macrocode} +% \begin{macro}{\ifwidthliketwocolumns} +% The \cs{widthliketwocolumns} option can be called either on \macpackage or \parpackage. +% \changes{v1.9.0}{2014/09/16}{Added widthliketwocolumns option} +% \begin{macrocode} +\DeclareOption{widthliketwocolumns}{\widthliketwocolumnstrue}% +% \end{macrocode} +% \end{macro} +% The \verb+sameparallelpagenumber+ enable to have the same page number in left and right side. +% \begin{macro}{\ifsameparallelpagenumber} +% \begin{macrocode} +\newif\ifsameparallelpagenumber% +\DeclareOption{sameparallelpagenumber}{\sameparallelpagenumbertrue}% +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +\ProcessOptions% +% \end{macrocode} +% \subsection{Determining side and category of parallel processing} +% As noted above, much of the code is a duplication of the original +% \macpackage{} code to handle the extra box(es) for the right hand side text, +% and sometimes for the left hand side as well. In order to distinguish +% we use `R' or `L' in the names of macros for the right and left code. +% The specifics of `L' and `R' are normally hidden from the user by +% letting the \verb?Leftside? and \verb?Rightside? environments set things +% up appropriately. +% +% \begin{macro}{\ifl@dpairing} +% \begin{macro}{\ifl@dpaging} +% \begin{macro}{\ifledRcol} +% \cs{ifl@dpairing} is set TRUE if we are processing parallel texts and +% \cs{ifl@dpaging} is also set TRUE if we are doing parallel pages. +% \cs{ifledRcol} is set TRUE if we are doing the right hand text. +% They are defined in \macpackage. +% \changes{v0.3.0}{2005/02/24}{Moved \cs{ifl@dpairing} to eledmac} +% \changes{v0.9.0}{2005/10/01}{Moved \cs{iflledRcol} and \cs{ifnumberingR} to eledmac} +% \changes{v1.9.1}{2014/09/30}{Moved \cs{ifl@dpaging} to eledmac} +% \changes{v1.13.0}{2015/03/06}{Remove false boolean settings which are not needed.} +% \end{macro} +% \end{macro} +% \end{macro} +% \subsection{Text's width} +% \begin{macro}{\Lcolwidth} +% \begin{macro}{\Rcolwidth} +% The widths of the left and right parallel columns (or pages). +% \begin{macrocode} +\newdimen\Lcolwidth + \Lcolwidth=0.45\textwidth +\newdimen\Rcolwidth + \Rcolwidth=0.45\textwidth +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsection{Messages} +% +% All the error and warning messages are collected here as macros. +% +% \begin{macro}{\eledpar@error} +% \changes{v1.8.2}{2014/08/15}{Errors specific to eledpar send to eledpar handbook} +% \begin{macrocode} +\newcommand{\reledpar@error}[2]{\PackageError{reledpar}{#1}{#2}} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\led@err@TooManyPstarts} +% \begin{macrocode} +\newcommand*{\led@err@TooManyPstarts}{% + \reledpar@error{Too many \string\pstart\space without printing. + Some text will be lost}{\@ehc}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\led@err@BadLeftRightPstarts} +% \begin{macrocode} +\newcommand*{\led@err@BadLeftRightPstarts}[2]{% + \reledpar@error{The numbers of left (#1) and right (#2) + \string\pstart s do not match}{\@ehc}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\led@err@LeftOnRightPage} +% \begin{macro}{\led@err@RightOnLeftPage} +% \begin{macrocode} +\newcommand*{\led@err@LeftOnRightPage}{% + \reledpar@error{The left page has ended on a right page}{\@ehc}} +\newcommand*{\led@err@RightOnLeftPage}{% + \reledpar@error{The right page has ended on a left page}{\@ehc}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\led@err@Leftside@PreviousNotPrinted} +% \begin{macro}{\led@err@Rightside@PreviousNotPrinted} +% \begin{macrocode} +\newcommand*{\led@err@Leftside@PreviousNotPrinted}{% + \reledpar@error{You call a new Leftside environment while the previous one has not been typeset by \string\Pages\space or \string\Columns}{\@ehc}} +\newcommand*{\led@err@Rightside@PreviousNotPrinted}{% + \reledpar@error{You call a new Rightside environment while the previous one has not been typeset by \string\Pages\space or \string\Columns}{\@ehc}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\led@err@Pages@InsideEnv} +% \begin{macro}{\led@err@Columns@InsideEnv} +% \begin{macrocode} +\newcommand*{\led@err@Pages@InsideEnv}{% + \reledpar@error{\string\Pages\space must be called *outside* of the `pages` environment}{\@ehc}} +\newcommand*{\led@err@Columns@InsideEnv}{% + \reledpar@error{\string\Columns\space must be called *outside* of the `pairs` environment}{\@ehc}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\led@error@fail@patch@thepage} +% \begin{macrocode} +\newcommand{\led@error@fail@patch@thepage}{% + \reledpar@error{Fail to patch \string\@thepage\space command.}{\@ehc}% +}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\led@error@fail@patch@pagenumbering} +% \begin{macrocode} +\newcommand{\led@error@fail@patch@pagenumbering}{% + \reledpar@error{Fail to patch \string\pagenumbering\space command.}{\@ehc}% +}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\led@error@fail@patch@@outputpage} +% \begin{macrocode} +\newcommand{\led@error@fail@patch@@outputpage}{% + \reledpar@error{Fail to patch \string\@outputpage\space command.}{\@ehc}% +}% +% \end{macrocode} +% \end{macro} +% \section{Sectioning commands} +% +% \begin{macro}{\section@numR} +% This is the right side equivalent of \cs{section@num}. +% +% Each section will read and write an associated `line-list +% file', containing information used to do the numbering. Normally +% the file will be called \meta{jobname}\file{.nn}, where \file{nn} is the +% section number. However, for right side texts the file is called +% \meta{jobname}\file{.nnR}. The \cs{extensionchars} applies to the +% right side files just as it does to the normal files. +% \begin{macrocode} +\newcount\section@numR + \section@numR=\z@ +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\ifpst@rtedL} +% \begin{macro}{\ifpst@rtedR} +% \cs{ifpst@rtedL} is set FALSE at the start of left side numbering, and +% similarly for \cs{ifpst@rtedR}. +% \cs{ifpst@rtedL} is defined in \macpackage. +% \changes{v0.3.0}{2005/02/24}{Moved \cs{ifpst@rtedL} to eledmac} +% \begin{macrocode} + \pst@rtedLfalse +\newif\ifpst@rtedR + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \changes{v1.8.0}{2014/07/24}{\cs{beginnumbering} is defined only on \Lpack{eledmac}, not on \Lpack{eledpar}.} +% +% \begin{macro}{\beginnumberingR} +% This is the right text equivalent of \cs{beginnumbering}, and begins +% a section of numbered text. +% \begin{macrocode} +\newcommand*{\beginnumberingR}{% + \ifnumberingR + \led@err@NumberingStarted + \endnumberingR + \fi + \global\l@dnumpstartsR \z@ + \global\pst@rtedRfalse + \global\numberingRtrue + \global\advance\section@numR \@ne + \global\absline@numR \z@ + \gdef\normal@page@breakR{} + \gdef\l@prev@pbR{} + \gdef\l@prev@nopbR{} + \global\line@numR \z@ + \global\@lockR \z@ + \global\sub@lockR \z@ + \global\sublines@false + \global\let\next@page@numR\relax + \global\let\sub@change\relax + \message{Section \the\section@numR R }% + \line@list@stuffR{\jobname.\extensionchars\the\section@numR R}% + \l@dend@stuff + \setcounter{pstartR}{1} + \begingroup + \initnumbering@sectcountR + \gdef\eled@sectionsR@@{}% + \if@noeled@sec\else% + \makeatletter\InputIfFileExists{\jobname.eledsec\the\section@numR R}{}{}\makeatother% + \immediate\openout\eled@sectioningR@out=\jobname.eledsec\the\section@numR R\relax% + \fi% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\endnumbering} +% This is the left text version of the regular \cs{endnumbering} and must +% follow the last text for a left text numbered section. +% It sets \cs{ifpst@rtedL} to FALSE. It is fully defined in \macpackage. +% \end{macro} +% +% \begin{macro}{\endnumberingR} +% This is the right text equivalent of \cs{endnumbering} and must follow the +% last text for a right text numbered section. +% \begin{macrocode} +\def\endnumberingR{% + \ifnumberingR + \global\numberingRfalse + \normal@pars + \ifnum\l@dnumpstartsR=0% + \led@err@NumberingWithoutPstart% + \fi% + \ifl@dpairing + \global\pst@rtedRfalse + \else + \ifx\insertlines@listR\empty\else + \global\noteschanged@true + \fi + \ifx\line@listR\empty\else + \global\noteschanged@true + \fi + \fi + \ifnoteschanged@ + \led@mess@NotesChanged + \fi + \else + \led@err@NumberingNotStarted + \fi + \endgroup + \if@noeled@sec\else% + \immediate\closeout\eled@sectioningR@out% + \fi% + } + +% \end{macrocode} +% \end{macro} +% \begin{macro}{\initnumbering@sectcountR} +% \changes{v1.2.1}{2012/11/01}{For the right section, the counter is defined only once.} +% We do not want the numbering of the right-side section commands to be continuous with the numbering of the left side, +% we switch the \LaTeX\ counter in \cs{numberingR}. +% \begin{macrocode} +\newcounter{chapterR} +\newcounter{sectionR} +\newcounter{subsectionR} +\newcounter{subsubsectionR} +\newcommand{\initnumbering@sectcountR}{ + \let\c@chapter\c@chapterR + \let\c@section\c@sectionR + \let\c@subsection\c@subsectionR + \let\c@subsubsection\c@subsubsectionR +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pausenumberingR} +% \begin{macro}{\resumenumberingR} +% These are the right text equivalents of \cs{pausenumbering} and +% \cs{resumenumbering}. +% \changes{v1.8.3}{2014/08/31}{Debug \cs{resumenumberingR}} +% \begin{macrocode} +\newcommand*{\pausenumberingR}{% + \endnumberingR\global\numberingRtrue} +\newcommand*{\resumenumberingR}{% + \ifnumberingR + \global\pst@rtedRtrue + \global\advance\section@numR \@ne + \led@mess@SectionContinued{\the\section@numR R}% + \line@list@stuffR{\jobname.\extensionchars\the\section@numR R}% + \l@dend@stuff + \begingroup% + \initnumbering@sectcountR% + \else + \led@err@numberingShouldHaveStarted + \endnumberingR + \beginnumberingR + \fi} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\memorydumpL} +% \begin{macro}{\memorydumpR} +% \cs{memorydump} is a shorthand for \cs{pausenumbering}\cs{resumenumbering}. +% This will clear the memorised stuff for the previous chunks while +% keeping the numbering going. +% \begin{macrocode} +\newcommand*{\memorydumpL}{% + \endnumbering + \numberingtrue + \global\pst@rtedLtrue + \global\advance\section@num \@ne + \led@mess@SectionContinued{\the\section@num}% + \line@list@stuff{\jobname.\extensionchars\the\section@num}% + \l@dend@stuff} + +\newcommand*{\memorydumpR}{% + \endnumberingR + \numberingRtrue + \global\pst@rtedRtrue + \global\advance\section@numR \@ne + \led@mess@SectionContinued{\the\section@numR R}% + \line@list@stuffR{\jobname.\extensionchars\the\section@numR R}% + \l@dend@stuff} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% +% \section{Line counting} +% \label{lineation} +% + +% \subsection{Setting lineation reset} +% \changes{v0.11.0}{2012/06/11}{Lineation can be by pstart (like in eledmac 0.15).} +% \changes{v1.0.0}{2012/09/14}{Debug in lineation by pstart} +% Sometimes you want line numbers that start at $1$ at the top of each +% 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 +% of each section and increase regardless of page breaks. +% \Parpackage lets you choose different schemes for the left and right texts. +% \changes{v2.0.0}{2015/07/19}{\cs{ifbypage@} and \cs{ifbypstart@R} defined in \eledmac.} + +% +% \begin{macro}{\lineationR} +% \cs{lineationR}\marg{word} is the macro used to select the +% lineation system for right texts. +% Its argument is a string: either \verb+page+, \verb+pstart+ or \verb+section+. +% \changes{v1.15.0}{2015/04/13}{As \cs{lineation}, \cs{lineationR} automatically set the \cs{pstartinfootnote}.} +% \begin{macrocode} +\newcommand*{\lineationR}[1]{{% + \ifnumbering + \led@err@LineationInNumbered + \else + \def\@tempa{#1}\def\@tempb{page}% + \ifx\@tempa\@tempb + \global\bypage@Rtrue + \global\bypstart@Rfalse + \unless\ifnocritical@% + \Xpstart[][false]% + \fi% + \else + \def\@tempb{pstart}% + \ifx\@tempa\@tempb + \global\bypage@Rfalse + \global\bypstart@Rtrue + \unless\ifnocritical@% + \Xpstart% + \fi% + \else + \def@tempb{section} + \ifx\@tempa\@tempb + \global\bypage@Rfalse% + \global\bypstart@Rfalse% + \unless\ifnocritical@% + \Xpstart[][false]% + \fi% + \else + \led@warn@BadLineation + \fi% + \fi + \fi + \fi}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\lineation*} +% \changes{v1.8.2}{2014/08/15}{Add \cs{lineation*}} +% \cs{lineation*} change the lineation system for both sides. +% \begin{macrocode} +\WithSuffix\newcommand\lineation*[1]{% + \lineation{#1}% + \lineationR{#1}% +}% +% \end{macrocode} +% \end{macro} + +% \subsection{Setting line number margin} +% \begin{macro}{\linenummargin} +% \begin{macro}{\line@marginR} +% You call \cs{linenummargin}\marg{word} to specify which margin you want your +% right text's line numbers in; it takes one argument, a string. +% You can put the line numbers in the same margin on every page using +% \verb+left+ or \verb+right+; or you can use \verb+inner+ or +% \verb+outer+ to get them in the inner or outer margins. +% You can change this within a numbered section, but the +% change may not take effect just when you would like; if it is done between +% paragraphs nothing surprising should happen. +% +% For right texts the selection is recorded in the count \cs{line@marginR}, +% otherwise in the count \cs{line@margin}: +% $0$ for left, $1$ for right, $2$ for outer, and $3$ for inner. +% +% It is defined only once time, in \reledmac. +% +% \changes{v0.3.a}{2005/03/30}{Do not just set \cs{line@marginR} in \cs{linenummargin}} +% \changes{v2.0.0}{2015/07/19}{\cs{linenummargin} now defined only once time in \reledmac.} +% \begin{macrocode} +\newcount\line@marginR +% \end{macrocode} +% By default put right text numbers at the right. +% \begin{macrocode} +\line@marginR=\@ne + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \subsection{Setting lineation start and step} +% \begin{macro}{\c@firstlinenumR} +% \begin{macro}{\c@linenumincrementR} +% The following counters tell \macpackage which right text lines should be +% printed with line numbers. \verb+firstlinenumR+ is the number of the +% first line in each section that gets a number; +% \verb+linenumincrementR+ +% is the difference between successive numbered lines. The initial +% values of these counters produce labels on lines $5$, $10$, $15$, etc. +% \verb+linenumincrementR+ must be at least $1$. +% +% \begin{macrocode} +\newcounter{firstlinenumR} + \setcounter{firstlinenumR}{5} +\newcounter{linenumincrementR} + \setcounter{linenumincrementR}{5} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\c@firstsublinenumR} +% \begin{macro}{\c@sublinenumincrementR} +% The following parameters are just like \verb+firstlinenumR+ and +% \verb+linenumincrementR+, but for sub-line numbers. +% \verb+sublinenumincrementR+ must be at least $1$. +% +% \begin{macrocode} +\newcounter{firstsublinenumR} + \setcounter{firstsublinenumR}{5} +\newcounter{sublinenumincrementR} + \setcounter{sublinenumincrementR}{5} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\firstlinenum} +% \begin{macro}{\linenumincrement} +% \begin{macro}{\firstsublinenum} +% \begin{macro}{\sublinenumincrement} +% \begin{macro}{\firstlinenum*} +% \begin{macro}{\linenumincrement*} +% \begin{macro}{\firstsublinenum*} +% \begin{macro}{\sublinenumincrement*} +% \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.} +% These are the user's macros for changing (sub) line numbers. They are +% defined in \macpackage. +% The starred versions are specific to \Lpack{eledpar}. +% \changes{v2.0.0}{2015/07/19}{\cs{firstlinenum}, \cs{linenumincrement}, \cs{firstsublinenum}, \cs{sublinenumincrement} are now defined only in \macpackage.} +% \begin{macrocode} +\WithSuffix\newcommand\firstlinenum*[1]{% + \setcounter{firstlinenumR}{#1}% + \setcounter{firstlinenum}{#1}% +} +\WithSuffix\newcommand\linenumincrement*[1]{% + \setcounter{linenumincrementR}{#1}% + \setcounter{linenumincrement}{#1}% +} +\WithSuffix\newcommand\firstsublinenum*[1]{% + \setcounter{subfirstlinenumR}{#1}% + \setcounter{subfirstlinenum}{#1}% +} +\WithSuffix\newcommand\sublinenumincrement*[1]{% + \setcounter{sublinenumincrementR}{#1}% + \setcounter{sublinenumincrement}{#1}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsection{Setting line flag} +% \begin{macro}{\Rlineflag} +% This is appended to the line numbers of right text. +% \begin{macrocode} +\newcommand{\setRlineflag}[1]{% + \gdef\@Rlineflag{#1}% +} +\setRlineflag{R} +% \end{macrocode} +% \end{macro} +% \subsection{Setting line number style} +% \begin{macro}{\linenumrepR} +% \begin{macro}{\sublinenumrepR} +% \cs{linenumrepR}\marg{ctr} typesets the right line number \meta{ctr}, and +% similarly \cs{sublinenumrepR} for subline numbers. +% \changes{v0.3.0}{2005/02/10}{Added \cs{linenumrepR} and \cs{sublinenumrepR}} +% \begin{macrocode} +\newcommand*{\linenumrepR}[1]{\@arabic{#1}} +\newcommand*{\sublinenumrepR}[1]{\@arabic{#1}} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \subsection{Print marginal line number} +% \begin{macro}{\leftlinenumR} +% \begin{macro}{\rightlinenumR} +% \begin{macro}{\l@dlinenumR} +% \cs{leftlinenumR} and \cs{rightlinenumR} are the macros that are +% called to print the right text's marginal line numbers. +% Much of the +% code for these is common and is maintained in \cs{l@dlinenumR}. +% \changes{v0.3.0}{2005/02/10}{Simplified \cs{leftlinenumR} and +% \cs{rightlinenumR} by introducing \cs{l@dlinenumR}} +% \begin{macrocode} +\newcommand*{\leftlinenumR}{% + \l@dlinenumR + \kern\linenumsep} +\newcommand*{\rightlinenumR}{% + \kern\linenumsep + \l@dlinenumR} +\newcommand*{\l@dlinenumR}{% + \numlabfont\linenumrepR{\line@numR}\@Rlineflag% + \ifsublines@ + \ifnum\subline@num>\z@ + \unskip\fullstop\sublinenumrepR{\subline@numR}% + \fi + \fi} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \subsection{Line-number counters and lists} +% \subsubsection{Correspond to those in \macpackage for regular or left text} +% We need another set of counters and lists for the right text, +% corresponding to those in \parpackage for regular or left text. +% +% \begin{macro}{\line@numR} +% \begin{macro}{\subline@numR} +% \begin{macro}{\absline@numR} +% The count \cs{line@numR} stores the line number that is used in +% the right text's marginal line numbering and in notes. +% The count \cs{subline@numR} stores +% a sub-line number that qualifies \cs{line@numR}. +% The count \cs{absline@numR} stores the +% absolute number of lines since the start +% of the right text section: that is, the number we have actually printed, +% no matter what numbers we attached to them. +% +% \begin{macrocode} +\newcount\line@numR +\newcount\subline@numR +\newcount\absline@numR + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\line@listR} +% \begin{macro}{\insertlines@listR} +% \begin{macro}{\actionlines@listR} +% \begin{macro}{\actions@listR} +% Now we can define the list macros that will be created from the +% line-list file. They are directly analogous to the left text ones. +% The full list of action codes and their meanings is given in the \macpackage +% manual. +% +% Here are the commands to create these lists: +% +% \begin{macrocode} +\list@create{\line@listR} +\list@create{\insertlines@listR} +\list@create{\actionlines@listR} +\list@create{\actions@listR} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\page@numR} +% The right text page number. +% \begin{macrocode} +\newcount\page@numR + +% \end{macrocode} +% \end{macro} +% \subsubsection{Specific to \parpackage} +% \begin{macro}{\linesinpar@listL} +% \begin{macro}{\linesinpar@listR} +% \begin{macro}{\maxlinesinpar@list} +% In order to synchronise left and right chunks in parallel processing +% we need to know how many lines are in each left and right text chunk, +% and the maximum of these for each pair of chunks. +% \begin{macrocode} +\list@create{\linesinpar@listL} +\list@create{\linesinpar@listR} +\list@create{\maxlinesinpar@list} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% +% \subsection{Reading the line-list file} +% +% +% \begin{macro}{\list@clearing@regR} +% \cs{Clear the right lines for \cs{read@linelist}} +% \begin{macrocode} +\newcommand{\list@clearing@regR}{% + \list@clear{\line@listR}% + \list@clear{\insertlines@listR}% + \list@clear{\actionlines@listR}% + \list@clear{\actions@listR}% + \list@clear{\linesinpar@listR}% + \list@clear{\linesonpage@listR} +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\read@linelist} +% \cs{read@linelist}\marg{file} is the control sequence +% that is called by \cs{beginnumbering} +% (via \cs{line@list@stuff}) to open and process a +% line-list file; its argument is the name of the file. +% \label{readlinelist}. +% It is defined only once time in \reledmac. +% \changes{v2.0.0}{2015/07/19}{\cs{read@linelist} is defined only once time in \cs{reledmac}.} +% +% \end{macro} +% \subsection{Commands within the line-list file} +% +% This section defines the commands that can appear within a +% line-list file, except for \cs{@lab} which is in a +% later section among the cross-referencing commands it is +% associated with. +% +% The macros with \verb"action" in their names contain all the code +% that modifies the action-code list. +% \changes{v2.0.0}{2015/07/19}{\cs{@nl} is now defined only in \reledmac.} +% \begin{macro}{\@nl@regR} +% \begin{macro}{\@nl} +% \cs{@nl@regR} is called by \cs{@nl} if we are on a right side. +% It does everything related to the start of a +% new line of numbered text on a right side. +% +% \begin{macrocode} +\newcommand{\@nl@regR}{% + \ifx\l@dchset@num\relax \else + \advance\absline@numR \@ne + \set@line@action + \let\l@dchset@num\relax + \advance\absline@numR \m@ne + \advance\line@numR \m@ne% % do we need this? + \fi + \advance\absline@numR \@ne + \ifx\next@page@numR\relax \else + \page@action + \let\next@page@numR\relax + \fi + \ifx\sub@change\relax \else + \ifnum\sub@change>\z@ + \sublines@true + \else + \sublines@false + \fi + \sub@action + \let\sub@change\relax + \fi + \ifcase\@lockR + \or + \@lockR \tw@ + \or\or + \@lockR \z@ + \fi + \ifcase\sub@lockR + \or + \sub@lockR \tw@ + \or\or + \sub@lockR \z@ + \fi + \ifsublines@ + \ifnum\sub@lockR<\tw@ + \advance\subline@numR \@ne + \fi + \else + \ifnum\@lockR<\tw@ + \advance\line@numR \@ne \subline@numR \z@ + \fi + \fi} + + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\last@page@numR} +% \begin{macro}{\fix@page} +% \cs{last@page@numR} store the page number of the last right page. +% It is modified by \cs{fix@page}, defined by \reledmac. +% \changes{v2.0.0}{2105/06/28}{\cs{fix@page} is defined only once in \reledmac} +% +% \begin{macrocode} +\newcount\last@page@numR + \last@page@numR=-10000 + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\@adv} +% The \cs{@adv}\marg{num} macro advances +% the current visible line number by the amount specified as +% its argument. This is used to implement \cs{advanceline}. +% It is defined in \macpackage. +% \changes{v2.0.0}{2015/07/19}{\cs{@adv} defined only in \reledmac.} +% \end{macro} +% +% \begin{macro}{\@set} +% The \cs{@set}\marg{num} macro sets +% the current visible line number to the value specified as +% its argument. This is used to implement \cs{setline}. +% It is defined in \macpackage. +% +% \changes{v2.0.0}{2015/07/19}{\cs{@set} defined only in \reledmac.} +% \end{macro} +% +% \begin{macro}{\l@d@set} +% The \cs{l@d@set}\marg{num} macro sets +% the line number for the next \verb?\pstart...? to the value specified as +% its argument. This is used to implement \cs{setlinenum}. +% It is defined in \macpackage. +% \changes{v2.0.0}{2015/07/19}{\cs{l@d@set} defined only in \reledmac.} + +% \end{macro} +% +% \begin{macro}{\page@action} +% \cs{page@action} +% adds an entry to the action-code list to change the page number. +% It is defined in \macpackage. + +% \changes{v2.0.0}{2015/07/19}{\cs{page@action} defined only in \reledmac.} +% \end{macro} +% +% \begin{macro}{\set@line@action} +% \cs{set@line@action} adds an entry to the action-code +% list to change the visible line number. +% It is defined in \macpackage. +% \changes{v2.0.0}{2015/07/19}{\cs{set@line@action} defined only in \reledmac.} +% \end{macro} +% +% \begin{macro}{\sub@action} +% \cs{sub@action} +% adds an entry to the action-code list to turn sub-lineation on or +% off, according to the current value of the \cs{ifsublines@} flag. +% It is defined in \macpackage. +% +% \changes{v2.0.0}{2015/07/19}{\cs{sub@action} defined only in \reledmac.} +% \end{macro} +% +% \begin{macro}{\do@lockon} +% \begin{macro}{\do@lockonR} +% \cs{lock@on} +% adds an entry to the action-code list to turn line number +% locking on. The current setting of the sub-lineation flag tells us +% whether this applies to line numbers or sub-line numbers. +% It is defined in \macpackage, however the code specific to right side is defined here, in \cs{do@lockonR}. + +% \changes{v2.0.0}{2015/07/19}{\cs{do@lockon} defined only in \reledmac.} +% \begin{macrocode} +\newcount\@lockR +\newcount\sub@lockR + +\newcommand*{\do@lockonR}{% + \xright@appenditem{\the\absline@numR}\to\actionlines@listR + \ifsublines@ + \xright@appenditem{-1005}\to\actions@listR + \ifnum\sub@lockR=\z@ + \sub@lockR \@ne + \else + \ifnum\sub@lockR=\thr@@ + \sub@lockR \@ne + \fi + \fi + \else + \xright@appenditem{-1003}\to\actions@listR + \ifnum\@lockR=\z@ + \@lockR \@ne + \else + \ifnum\@lockR=\thr@@ + \@lockR \@ne + \fi + \fi + \fi} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\lock@off} +% \begin{macro}{\do@lockoff} +% \begin{macro}{\do@lockoffR} +% \begin{macro}{\skip@lockoff} +% \cs{lock@off} adds an entry to the action-code list +% to turn line number locking off. +% It is defined in \macpackage, however the code specific to right side is defined here, in \cs{do@lockoffR}. +% \changes{v2.0.0}{2015/07/19}{\cs{do@lockoff} defined only in \reledmac.} +% \begin{macrocode} + + +\newcommand{\do@lockoffR}{% + \xright@appenditem{\the\absline@numR}\to\actionlines@listR + \ifsublines@ + \xright@appenditem{-1006}\to\actions@listR + \ifnum\sub@lockR=\tw@ + \sub@lockR \thr@@ + \else + \sub@lockR \z@ + \fi + \else + \xright@appenditem{-1004}\to\actions@listR + \ifnum\@lockR=\tw@ + \@lockR \thr@@ + \else + \@lockR \z@ + \fi + \fi} + + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\n@num} +% \changes{v1.15.0}{2015/04/13}{\cs{n@num} defined only one time for both \Eledmac{} and \Eledpar{}.} +% \end{macro} +% +% \begin{macro}{\@ref} +% \begin{macro}{\@ref@regR} +% \changes{v2.0.0}{2015/07/19}{\cs{@ref} defined only in \reledmac, code specific to right side moved in \cs{ref@regR}.} +% \begin{macro}{\insert@countR} +% \cs{@ref} +% marks the start of a passage, for creation of a footnote reference. +% It takes two arguments: +% \begin{itemize} +% \item \verb"#1", the number of entries to add to \cs{insertlines@list} +% for this reference. +% This value for right text, here and within \cs{edtext}, +% which computes it and writes it to the line-list file, +% will be stored in the count \cs{insert@countR}. +% \begin{macrocode} +\newcount\insert@countR +% \end{macrocode} +% +% \item \verb"#2", a sequence of other line-list-file commands, executed to +% determine the ending line-number. This may also include other +% \cs{@ref} commands, corresponding to uses of \cs{edtext} +% within the first argument of another instance of \cs{edtext}. +% \end{itemize} +% +% \cs{@ref} itself is defined in \macpackage. +% It calls \cs{ref@reg} or \cs{ref@regR}, depending weither we are in left or right side. +% Here, we define only \cs{ref@regR}, \cs{ref@reg} is already defined in \macpackage. +% +% The first thing \cs{@ref@regR} itself does is to add the specified number +% of items to the \cs{insertlines@listR} list. +% \begin{macrocode} +\newcommand*{\@ref@regR}[2]{% + \global\advance\@edtext@level by 1% + \global\insert@countR=#1\relax + \loop\ifnum\insert@countR>\z@ + \xright@appenditem{\the\absline@numR}\to\insertlines@listR + \global\advance\insert@countR \m@ne + \repeat +% \end{macrocode} +% +% Next, process the second argument to determine the page +% and line numbers for the end of this lemma. +% We temporarily equate \cs{@ref} to a different macro that just executes +% its argument, so that nested \cs{@ref} commands are just skipped +% this time. Some other macros need to be temporarily redefined to +% suppress their action. +% \begin{macrocode} + \begingroup + \let\@ref=\dummy@ref + \let\@lopR\@gobble + \let\page@action=\relax + \let\sub@action=\relax + \let\set@line@action=\relax + \let\@lab=\relax + \let\@lemma=\relax + \let\@sw\@gobblethree% + #2 + \global\endpage@num=\page@numR + \global\endline@num=\line@numR + \global\endsubline@num=\subline@numR + \endgroup +% \end{macrocode} +% +% Now store all the information about the location of the lemma's +% start and end in \cs{line@list@R}. +% \begin{macrocode} + \xright@appenditem% + {\the\page@numR|\the\line@numR|% + \ifsublines@ \the\subline@numR \else 0\fi|% + \the\endpage@num|\the\endline@num|% + \ifsublines@ \the\endsubline@num \else 0\fi}\to\line@listR +% \end{macrocode} +% Create a list which will store all the second argument of each \cs{@sw} +% in this lemma, at this level. +% \begin{macrocode} + \expandafter\list@create\expandafter{\csname sw@list@edtext@tmp@\the\@edtext@level\endcsname}% +% \end{macrocode} +% Declare and init boolean for lemma in this level. +% \begin{macrocode} + \providebool{lemmacommand@\the\@edtext@level}% + \boolfalse{lemmacommand@\the\@edtext@level}% +% \end{macrocode} +% Execute the second argument of \cs{@ref} again, +% to perform for real all the commands within it. +% \begin{macrocode} + #2 +% Now, we store the list of \cs{@sw} of this current \cs{edtext} as an element of +% the global list of list of \cs{@sw} for a \cs{edtext} depth. +% \begin{macrocode} + \ifnum\@edtext@level>0% + \def\create@this@edtext@level{\expandafter\list@create\expandafter{\csname sw@list@edtextR@\the\@edtext@level\endcsname}}% + \ifcsundef{sw@list@edtextR@\the\@edtext@level}{\create@this@edtext@level}{}% + \letcs{\@tmp}{sw@list@edtextR@\the\@edtext@level}% + \letcs{\@tmpp}{sw@list@edtext@tmp@\the\@edtext@level}% + \xright@appenditem{\expandonce\@tmpp}\to\@tmp% + \global\cslet{sw@list@edtextR@\the\@edtext@level}{\@tmp}% + \fi% +% \end{macrocode} +% Decrease edtext level counter. +% \begin{macrocode} + \global\advance\@edtext@level by -1% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \begin{macro}{\@pend} +% \begin{macro}{\@pendR} +% \cs{@pend}\marg{num} adds its argument to the \cs{linesinpar@listL} +% list, and analagously for \cs{@pendR}. If needed, it resets line number. +% Both are defined in \macpackage, but they are empty. +% They are really defined only in \parpackage. +% +% +% \begin{macrocode} +\renewcommand*{\@pend}[1]{% + \ifbypstart@\global\line@num=0\fi% + \xright@appenditem{#1}\to\linesinpar@listL} +\renewcommand*{\@pendR}[1]{% + \ifbypstart@R\global\line@numR=0\fi + \xright@appenditem{#1}\to\linesinpar@listR} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@lopL} +% \begin{macro}{\@lopR} +% \cs{@lopL}\marg{num} adds its argument to the \cs{linesonpage@listL} +% list, and analagously for \cs{@lopR}. +% Both are defined in \macpackage, but they are empty. +% They are really defined only in \parpackage. +% \begin{macrocode} +\renewcommand*{\@lopL}[1]{% + \xright@appenditem{#1}\to\linesonpage@listL} +\renewcommand*{\@lopR}[1]{% + \xright@appenditem{#1}\to\linesonpage@listR} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsection{Writing to the line-list file} +% +% We have now defined all the counters, lists, and commands involved in +% reading the line-list file at the start of a section. Now we will +% cover the commands that \macpackage{} uses within the text of a +% section to write commands out to the line-list. +% +% \begin{macro}{\linenum@outR} +% The file for right texts will be opened on output stream \cs{linenum@outR}. +% \begin{macrocode} +\newwrite\linenum@outR +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\iffirst@linenum@out@R} +% \begin{macro}{\first@linenum@out@Rtrue} +% \begin{macro}{\first@linenum@out@Rfalse} +% Once any file is opened on this stream, we keep it open forever, or +% else switch to another file that we keep open. +% \begin{macrocode} +\newif\iffirst@linenum@out@R + \first@linenum@out@Rtrue +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\line@list@stuffR} +% This is the right text version of the \cs{line@list@stuff}\marg{file} +% macro. It is called by \cs{beginnumberingR} and performs +% all the line-list operations needed at the start of a section. +% Its argument is the name of the line-list file. +% \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.} +% \begin{macrocode} +\newcommand*{\line@list@stuffR}[1]{% + \read@linelist{#1}% + \iffirst@linenum@out@R + \immediate\closeout\linenum@outR + \global\first@linenum@out@Rfalse + \immediate\openout\linenum@outR=#1 + \immediate\write\linenum@outR{\string\line@list@version{\this@line@list@version}}% + \else + \if@minipage% + \leavevmode% + \fi% + \closeout\linenum@outR% + \openout\linenum@outR=#1% + \fi} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\new@lineL} +% The \cs{new@lineL} macro sends the \cs{@nl} command to the left text +% line-list file, to mark the start of a new text line. +% \begin{macrocode} +\newcommand*{\new@lineL}{% + \write\linenum@out{\string\@nl[\the\c@page][\thepage]}} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\new@lineR} +% The \cs{new@lineR} macro sends the \cs{@nl} command to the right text +% line-list file, to mark the start of a new text line. +% \begin{macrocode} +\newcommand*{\new@lineR}{% + \write\linenum@outR{\string\@nl[\the\c@page][\thepage]}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\flag@start} +% \begin{macro}{\flag@end} +% We enclose a lemma marked by \cs{edtext} in +% \cs{flag@start} and \cs{flag@end}: these send the \cs{@ref} +% command to the line-list file. +% \changes{v0.3.0}{2005/02/04}{Removed extraneous spaces from\cs{flag@end}} +% \changes{v1.8.2}{2014/08/15}{\cs{flag@start} and \cs{flag@end} are now defined only one time for eledmac and eledpar} +% They are both defined in \macpackage. +% +% \end{macro} +% \end{macro} +% +% \begin{macro}{\startsub} +% \begin{macro}{\endsub} +% \cs{startsub} and \cs{endsub} +% turn sub-lineation on and off, by writing +% appropriate instructions to the line-list file. +% There are both defined in \macpackage. +% \changes{v2.0.0}{2015/07/19}{\cs{startsub} and \cs{endsub} defined only in \reledmac.} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\advanceline} +% You can use \cs{advanceline}\marg{num} +% in running text to advance the current visible +% line-number by a specified value, positive or negative. +% It is defined in \macpackage. +% \changes{v2.0.0}{2015/07/19}{\cs{advanceline} defined only in \reledmac.} +% \end{macro} +% +% \begin{macro}{\setline} +% You can use \cs{setline}\marg{num} +% in running text (i.e., within \verb?\pstart...\pend?) to set the +% current visible +% line-number to a specified positive value. +% It is defined in \macpackage. +% \changes{v2.0.0}{2015/07/19}{\cs{setline} defined only in \reledmac.} +% +% \end{macro} +% +% \begin{macro}{\setlinenum} +% You can use \cs{setlinenum}\marg{num} +% before a \cs{pstart} to set the visible line-number to a specified +% positive value. It writes a \cs{\l@d@set} command to the line-list file. +% It is defined in \macpackage. +% +% \changes{v2.0.0}{2015/07/19}{\cs{setlinenum} defined only in \reledmac.} +% \end{macro} +% +% \begin{macro}{\startlock} +% \begin{macro}{\endlock} +% You can use \cs{startlock} or \cs{endlock} +% in running text to start or end line number locking at +% the current line. They decide whether line numbers or sub-line numbers +% are affected, depending on the current state of the sub-lineation flags. +% They are defined in \macpackage. + +% \changes{v2.0.0}{2015/07/19}{\cs{startlock} and \cs{endlock} defined only in \reledmac.} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\skipnumbering} +% \changes{v1.15.0}{2015/04/13}{\cs{skipnumbering} defined only one time for both \Eledmac{} and \Eledpar{}} +% \end{macro} +% +% +% \section{Marking text for notes} +% \label{text} +% +% The \cs{edtext} macro is used to create all +% footnotes and endnotes, +% as well as to print the portion of the main text to which a given note +% or notes is keyed. The idea is to have that lemma appear only once in +% the \file{.tex} file: all instances of it in the main text and in the +% notes are copied from that one appearance. +% +% \begin{macro}{\critext} +% \begin{macro}{\edtext} +% \changes{v1.3.0}{2012/11/16}{Manage RTL language.} +% \changes{v1.11.0}{2014/01/22}{\cs{critext} and \cs{edtext} are now defined only in eledmac.} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\set@line} +% The \cs{set@line} macro +% is called by \cs{edtext} to put the line-reference field and +% font specifier for the current block of text into \cs{l@d@nums}. +% It is defined in \macpackage. +% +% \changes{v2.0.0}{2015/07/19}{\cs{set@line} defined only in \reledmac.} +% \end{macro} +% \subsection{Specific hooks and commands for notes} +% The \macpackage \cs{newseries@} initializes commands which are linked to notes series. +% However, to keep \macpackage as light as possible, it does not define commands which are specific to \parpackage. +% This is what does \cs{newseries@par}. The specific hooks are also defined here. +% \begin{macro}{\newseries@par} +% \begin{macrocode} +\newcommand{\newseries@par}[1]{% +% \end{macrocode} +% \subsubsection{Notes to be printed on one side only} +% \Parpackage allows notes to be printed on one side only. +% We need to declare these options. +% We also need boolean flags, and to set them to true when a note series is not printed on one side. +% We check the \verb+nofamiliar+ and \verb+nocritical+ \Eledmac{} options. +% \changes{v1.16.0}{2015/05/18}{Fix bug with \cs{onlysideX}.} +% \begin{macrocode} + \unless\ifnofamiliar@% + \csgdef{onlysideX@#1}{}% + \global\newbool{keepforsideX@#1}% + \fi% + \unless\ifnocritical@% + \global\newbool{keepforXside@#1}% + \csgdef{Xonlyside@#1}{}% + \fi% +% \end{macrocode} +% \subsubsection{Familiar footnotes without marks} +% The \cs{footnoteXnomk} commands are for notes which are printed on the left side, while they are called in the right side. +% Basically, they set first toggle \cs{nomark@} to true, then call the \cs{footnoteX}. +% and finally add the footnote counter in the footnote counter list. +% +% First, check the \verb+nofamiliar+ option of \macpackage. +% +% \begin{macrocode} + \unless\ifnofamiliar@% +% So declare the list. +% \begin{macrocode} + \expandafter\list@create\csname footnote#1@mk\endcsname% +% \end{macrocode} +% Then, declare the \cs{footnoteXnomk} command. +% \begin{macrocode} + \expandafter\newcommand\csname footnote#1nomk\endcsname[1]{% +% \end{macrocode} +% First step: just call the normal \cs{footnoteX}, saying that we do not want to print the mark. +% \begin{macrocode} + \toggletrue{nomk@}% + \csuse{footnote#1}{##1}% + \togglefalse{nomk@}% +% \end{macrocode} +% Second, and last, step: store the footnote counter in the footnote counters list. +% We use some \cs{let}, because \cs{xright@appenditem} is difficult to use with \cs{expandafter}. +% \begin{macrocode} + \letcs{\@tmp}{footnote#1@mk}% + \numdef\@tmpa{\csuse{c@footnote#1}}% + \global\xright@appenditem{\@tmpa}\to\@tmp% + \global\cslet{footnote#1@mk}{\@tmp}% + }% +% \end{macrocode} +% Then, declare the command which inserts the footnotemark in the right side. +% \begin{macrocode} + \expandafter\newcommand\csname footnote#1mk\endcsname{% +% \end{macrocode} +% Get the first element of the footnote mark list. +% As \cs{gl@p} is difficult to use with dynamic name macro, we use \cs{let} commands. +% \begin{macrocode} + \letcs{\@tmp}{footnote#1@mk}% + \gl@p\@tmp\to\@tmpa% + \global\cslet{footnote#1@mk}{\@tmp}% +% \end{macrocode} +% Set the footnotecounter with it. +% For the sake of security, we make a backup of the previous value. +% \begin{macrocode} + \letcs{\old@footnote}{c@footnote#1}% + \setcounter{footnote#1}{\@tmpa}% +% \end{macrocode} +% Define the footnote mark and print it +% \begin{macrocode} + \protected@csxdef{@thefnmark#1}{\csuse{thefootnote#1}}% + \csuse{@footnotemark#1}% +% \end{macrocode} +% Restore previous footnote counter and finally add space. +% \begin{macrocode} + \setcounter{footnote#1}{\old@footnote}% + \xspace% + }% +% \end{macrocode} +% End of tools for familiar notes without marks +% \begin{macrocode} + \fi +% \end{macrocode} +% End of \cs{newseries@par}. +% \begin{macrocode} +}% +% \end{macrocode} +% \end{macro} +% \subsubsection{Create hooks} +% Read the \macpackage code handbook about \cs{newhookcommand@series}. +% Here, we create hooks which are specific to \parpackage. +% \begin{macrocode} +\unless\ifnocritical@% + \newhookcommand@series{Xonlyside}% +\fi% +\unless\ifnofamiliar@% + \newhookcommand@series{onlysideX}% +\fi + + +% \end{macrocode} +% \subsubsection{Init standards series (A,B,C,D,E,Z)} +% \begin{macro}{\init@series@par} +% \cs{newseries@par} is called by \cs{newseries}. +% However, this last command is called before \parpackage is loaded. +% Thus, we need to initiate a specific series hook for \parpackage. +% \begin{macrocode} +\newcommand{\init@series@par}{% + \def\do##1{\newseries@par{##1}}% + \dolistloop{\@series}% +}% +\init@series@par% +% \end{macrocode} +% \end{macro} +% \section{Pstart numbers dumping and restoration} +% While in \macpackage the footnotes are inserted in the same time as the \cs{pstart}\ldots\cs{pend} are read, in \parpackage they are inserted when the \cs{Columns} or \cs{Pages} commands are called. +% Consequently, if we do nothing, the value of the \verb+PstartL+ and \verb+PstartR+ counters are not the same in the main text and in the notes. +% 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}. +% We also dump and restore the value of the boolean \cs{ifnumberpstart}. + +% So, first step, creating the lists. +% Here, ``pc'' means ``public counters''. +% \begin{macro}{\list@pstartL@pc} +% \begin{macro}{\list@pstartR@pc} +% \begin{macrocode} +\list@create{\list@pstartL@pc}% +\list@create{\list@pstartR@pc}% +% \end{macrocode} +% \end{macro} +% \end{macro} +% Two commands to dump current pstarts. +% We prefer two commands to one with argument indicating the side, +% because the commands are short, and so we save one test (or a \cs{csname} construction). +% \begin{macro}{\dump@pstartL@pc} +% \begin{macro}{\dump@pstartR@pc} +% \begin{macrocode} +\def\dump@pstartL@pc{% + \xright@appenditem{\the\c@pstartL}\to\list@pstartL@pc% + \global\cslet{numberpstart@L\the\l@dnumpstartsL}{\ifnumberpstart}% +}% + +\def\dump@pstartR@pc{% + \xright@appenditem{\the\c@pstartR}\to\list@pstartR@pc% + \global\cslet{numberpstart@R\the\l@dnumpstartsR}{\ifnumberpstart}% +}% + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\restore@pstartL@pc} +% \begin{macro}{\restore@pstartR@pc} +% And so, the commands to restore them. +% \begin{macrocode} +\def\restore@pstartL@pc{% + \ifx\list@pstartL@pc\empty\else% + \gl@p\list@pstartL@pc\to\@temp% + \global\c@pstartL=\@temp% + \fi% +}% +\def\restore@pstartR@pc{% + \ifx\list@pstartR@pc\empty\else% + \gl@p\list@pstartR@pc\to\@temp% + \global\c@pstartR=\@temp% + \fi% +}% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \section{Parallel environments} +% +% The initial set up for parallel processing is deceptively simple. +% +% +% \begin{environment}{pairs} +% \begin{environment}{pages} +% \begin{macro}{chapterinpages} +% The \verb?pairs? environment is for parallel columns and the \verb?pages? +% environment for parallel pages. +% \begin{macrocode} +\newenvironment{pairs}{%} + \l@dpairingtrue + \l@dpagingfalse + \initnumbering@quote + \at@begin@pairs% +}{% + \l@dpairingfalse +} + +% \end{macrocode} +% \begin{macro}{\AtBeginPairs} +% The \cs{AtBeginPairs} macro just define a \cs{at@begin@pairs} macro, called at the beginning of each \verb+pairs+ environments. +% \begin{macrocode} +\newcommand{\AtBeginPairs}[1]{\xdef\at@begin@pairs{#1}}% +\def\at@begin@pairs{}% + +% \end{macrocode} +% \end{macro} +% \changes{v2.0.0}{2015/07/19}{Deleting the old system of managing parallel chapter, keep only the new one with \cs{patchcmd}.} +% The \verb?pages? environment additionally sets the `column' widths to the +% \cs{textwidth} (as known at the time the package is called). In this environment, there are two text in parallel on 2 pages. +% \begin{macrocode} +\newenvironment{pages}{% + \l@dpairingtrue + \l@dpagingtrue + \initnumbering@quote + \setlength{\Lcolwidth}{\textwidth}% + \setlength{\Rcolwidth}{\textwidth}% +}{% + \l@dpairingfalse + \l@dpagingfalse +} + +% \end{macrocode} +% \end{macro} +% \end{environment} +% \end{environment} +% +% +% \begin{macro}{ifinstanzaL} +% \begin{macro}{ifinstanzaR} +% These boolean tests are switched by the \cs{stanza} command, using either the left or right side. +% \begin{macrocode} + \newif\ifinstanzaL + \newif\ifinstanzaR +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{environment}{Leftside} +% Within the \verb?pairs? and \verb?pages? environments the left and +% right hand texts are within \verb?Leftside? and \verb?Rightside? +% environments, respectively. The \verb?Leftside? environment is simple, +% indicating that right text is not within its purview and using some +% particular macros. +% \changes{v0.3.0}{2005/02/10}{Added hooks into Leftside environment} +% \begin{macrocode} +\newenvironment{Leftside}{% + \expandafter\ifvoid\csname l@dLcolrawbox1\endcsname\else% + \led@err@Leftside@PreviousNotPrinted% + \fi% + \ledRcolfalse + \setcounter{pstartL}{1} + \let\pstart\pstartL + \let\thepstart\thepstartL + \let\pend\pendL + \let\memorydump\memorydumpL + \Leftsidehook + \let\old@startstanza\@startstanza + \def\@startstanza[##1]{\global\instanzaLtrue\old@startstanza[##1]} +}{ + \Leftsidehookend} +% \end{macrocode} +% \end{environment} +% +% \begin{macro}{\Leftsidehook} +% \begin{macro}{\Leftsidehookend} +% \begin{macro}{\Rightsidehook} +% \begin{macro}{\Rightsidehookend} +% Hooks into the start and end of the {Leftside} and {Rightside} +% environments. These are initially empty. +% \changes{v0.3.0}{2005/02/10}{Added \cs{Leftsidehook}, \cs{Leftsidehookend}, +% \cs{Rightsidehook} and \cs{Rightsidehookend}} +% \begin{macrocode} +\newcommand*{\Leftsidehook}{} +\newcommand*{\Leftsidehookend}{} +\newcommand*{\Rightsidehook}{} +\newcommand*{\Rightsidehookend}{} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{environment}{Rightside} +% The \verb?Rightside? environment is only slightly more complicated +% than the \verb?Leftside?. +% Apart from indicating that right text is being provided it +% ensures that the right right text code will be used. +% \begin{macrocode} +\newenvironment{Rightside}{% + \expandafter\ifvoid\csname l@dRcolrawbox1\endcsname\else% + \led@err@Rightside@PreviousNotPrinted% + \fi% + \ledRcoltrue + \let\beginnumbering\beginnumberingR + \let\endnumbering\endnumberingR + \let\pausenumbering\pausenumberingR + \let\resumenumbering\resumenumberingR + \let\memorydump\memorydumpR + \let\thepstart\thepstartR + \let\pstart\pstartR + \let\pend\pendR + \let\ledpb\ledpbR + \let\lednopb\lednopbR + \let\lineation\lineationR + \Rightsidehook + \let\old@startstanza\@startstanza + \def\@startstanza[##1]{\global\instanzaRtrue\old@startstanza[##1]} +}{% + \ledRcolfalse + \Rightsidehookend +} + +% \end{macrocode} +% \end{environment} +% +% +% +% \section{Paragraph decomposition and reassembly} +% \label{paragraph}\relax +% +% In order to be able to count the lines of text and affix line +% numbers, we add an extra stage of processing for each paragraph. +% We send the paragraph into a box +% register, rather than straight onto the vertical list, and when +% the paragraph ends we +% slice the paragraph into its component lines; to each line we +% add any notes or line numbers, add a command to write to the +% line-list, and then at last send the line to the vertical list. +% This section contains all the code for this processing. +% +% \subsection{Boxes, counters, \cs{pstart} +% and \cs{pend}} +% +% \begin{macro}{\num@linesR} +% \begin{macro}{\one@lineR} +% \begin{macro}{\par@lineR} +% Here are numbers and flags that are used internally in the course +% of the paragraph decomposition. +% +% When we first form the paragraph, it goes into a box register, +% \cs{l@dLcolrawbox} or \cs{l@dRcolrawbox} for right text, instead of onto the +% current vertical list. +% The \cs{ifnumberedpar@} flag will be \verb"true" while a paragraph is +% being processed in that way. +% \cs{num@lines(R)} will store the number of lines in the paragraph +% when it is complete. When we chop it up into lines, each line +% in turn goes into the +% \cs{one@line} or \cs{one@lineR} register, and \cs{par@line(R)} +% will be the number +% of that line within the paragraph. +% \begin{macrocode} +\newcount\num@linesR +\newbox\one@lineR +\newcount\par@lineR +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\pstartL} +% \begin{macro}{\pstartR} +% \changes{v1.1.0}{2012/09/25}{Add \cs{labelpstarttrue} (from eledmac).} +% \changes{v1.1.1}{2012/10/01}{Correct \cs{pstartR} bug introduced by 1.1.} +% \changes{v1.4.3}{2013/10/27}{Spurious spaces in \cs{pstartL} and \cs{pstartR}.} +% \changes{v1.8.0}{2014/08/05}{As in \Lpack{eledmac}, \cs{pendL} and \cs{pendR} can have an optional argument.} +% \cs{pstart} starts the paragraph by +% clearing the \cs{inserts@list} list and other +% relevant variables, and then arranges for the +% subsequent text to go into the appropriate box. +% \cs{pstart} needs to appear at the start of +% every paragraph that is to be numbered. +% +% Beware: everything that occurs between \cs{pstart} and \cs{pend} +% is happening within a group; definitions must be global if you want +% them to survive past the end of the paragraph. +% +% We have to have specific left and right \cs{pstart} when parallel processing; +% among other things because of potential changes in the linewidth. +% +% \begin{macrocode} + +\newcounter{pstartL} +\renewcommand{\thepstartL}{{\bfseries\@arabic\c@pstartL}. } +\newcounter{pstartR} +\renewcommand{\thepstartR}{{\bfseries\@arabic\c@pstartR}. } + +\newcommandx*{\pstartL}[1][1]{% + \if@nobreak% + \let\@oldnobreak\@nobreaktrue% + \else% + \let\@oldnobreak\@nobreakfalse% + \fi% + \@nobreaktrue% + \ifluatex% + \xdef\l@luatextextdir@L{\the\luatextextdir}% + \xdef\l@luatexpardir@L{\the\luatexpardir}% + \xdef\l@luatexbodydir@L{\the\luatexbodydir}% + \fi% + \ifnumbering \else% + \led@err@PstartNotNumbered% + \beginnumbering% + \fi% + \ifnumberedpar@% + \led@err@PstartInPstart% + \pend% + \fi% +% \end{macrocode} +% If this is the first \cs{pstart} in a numbered section, clear any inserts +% and set \cs{ifpst@rtedL} to FALSE. +% \begin{macrocode} + \ifpst@rtedL\else% + \list@clear{\inserts@list}% + \global\let\next@insert=\empty% + \global\pst@rtedLtrue% + \fi% + \begingroup\normal@pars% +% \end{macrocode} +% When parallel processing we check that we have not exceeded +% the maximum number of chunks. In any event we grab a box for the +% forthcoming text. +% \begin{macrocode} + \global\advance\l@dnumpstartsL \@ne% + \ifnum\l@dnumpstartsL>\l@dc@maxchunks% + \led@err@TooManyPstarts% + \global\l@dnumpstartsL=\l@dc@maxchunks% + \fi% + \global\setnamebox{l@dLcolrawbox\the\l@dnumpstartsL}=\vbox\bgroup% +% \end{macrocode} +% We set all the usual interline penalties to zero; this ensures that there will +% be no large interline penalties to prevent us from slicing the +% paragraph into pieces. These penalties revert to the values +% that you set when the group for the \cs{vbox} ends. +% \begin{macrocode} + \l@dzeropenalties% + \ifautopar\else% + \ifnumberpstart% + \ifsidepstartnum% + \else% + \thepstartL% + \fi% + \fi% + \fi% + \hsize=\Lcolwidth% + \numberedpar@true% + \iflabelpstart\protected@edef\@currentlabel% + {\p@pstartL\thepstartL}\fi% +% \end{macrocode} +% Dump the optional arguments +% \begin{macrocode} + \ifstrempty{#1}% + {\csgdef{before@pstartL@\the\l@dnumpstartsL}{\at@every@pstart}}% + {\csgdef{before@pstartL@\the\l@dnumpstartsL}{\noindent#1}}% + \at@every@pstart@call% + } +% \end{macrocode} +% The same for right side. +% +% \begin{macrocode} +\newcommandx*{\pstartR}[1][1]{% + \if@nobreak% + \let\@oldnobreak\@nobreaktrue% + \else% + \let\@oldnobreak\@nobreakfalse% + \fi% + \@nobreaktrue% + \ifluatex% + \xdef\l@luatextextdir@R{\the\luatextextdir}% + \xdef\l@luatexpardir@R{\the\luatexpardir}% + \xdef\l@luatexbodydir@R{\the\luatexbodydir}% + \fi% + \ifnumberingR \else% + \led@err@PstartNotNumbered% + \beginnumberingR% + \fi% + \ifnumberedpar@% + \led@err@PstartInPstart% + \pendR% + \fi% + \ifpst@rtedR\else% + \list@clear{\inserts@listR}% + \global\let\next@insertR=\empty% + \global\pst@rtedRtrue% + \fi% + \begingroup\normal@pars% + \global\advance\l@dnumpstartsR \@ne% + \ifnum\l@dnumpstartsR>\l@dc@maxchunks% + \led@err@TooManyPstarts% + \global\l@dnumpstartsR=\l@dc@maxchunks% + \fi% + \global\setnamebox{l@dRcolrawbox\the\l@dnumpstartsR}=\vbox\bgroup% + \l@dzeropenalties% + \ifautopar\else% + \ifnumberpstart% + \ifsidepstartnum\else% + \thepstartR% + \fi% + \fi% + \fi% + \hsize=\Rcolwidth% + \numberedpar@true% + \iflabelpstart\protected@edef\@currentlabel% + {\p@pstartR\thepstartR}\fi% + \ifstrempty{#1}% + {\csgdef{before@pstartR@\the\l@dnumpstartsR}{\at@every@pstart}}% + {\csgdef{before@pstartR@\the\l@dnumpstartsR}{\noindent#1}}% + \at@every@pstart@call% + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\pendL} +% \changes{v1.4.3}{2013/10/27}{Spurious spaces in \cs{pendL}.} +% \changes{v1.8.0}{2014/08/05}{As in \Lpack{eledmac}, \cs{pendL} can have an optional argument.} +% \cs{pend} must be used to end a numbered paragraph. Again we need +% a version +% that knows about left parallel texts. +% +% \begin{macrocode} +\newcommandx*{\pendL}[1][1]{% + \ifnumbering \else% + \led@err@PendNotNumbered% + \fi% + \ifnumberedpar@ \else% + \led@err@PendNoPstart% + \fi% +% \end{macrocode} +% We immediately +% call \cs{endgraf} to end the paragraph; this ensures that there will +% be no large interline penalties to prevent us from slicing the +% paragraph into pieces. +% \begin{macrocode} + \endgraf\global\num@lines=\prevgraf\egroup% + \global\par@line=0% +% \end{macrocode} +% End the group that was begun in the \cs{pstart}. +% \begin{macrocode} + \endgroup% + \ignorespaces% + \@oldnobreak% + \dump@pstartL@pc% + \ifnumberpstart% + \addtocounter{pstartL}{1}% + \fi + \parledgroup@beforenotes@save{L}% +% \end{macrocode} +% Dump content of the optional argument. +% \begin{macrocode} + \ifstrempty{#1}% + {\csgdef{after@pendL@\the\l@dnumpstartsL}{\at@every@pend}}% + {\csgdef{after@pendL@\the\l@dnumpstartsL}{\noindent#1}}% + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pendR} +% \changes{v1.4.3}{2013/10/27}{Spurious spaces in \cs{pstartR}.} +% \changes{v1.8.0}{2014/08/05}{As in \Lpack{eledmac}, \cs{pendR} can have an optional argument.} +% The version of \cs{pend} needed for right texts. +% +% \begin{macrocode} +\newcommandx*{\pendR}[1][1]{% + \ifnumberingR \else% + \led@err@PendNotNumbered% + \fi% + \ifnumberedpar@ \else% + \led@err@PendNoPstart% + \fi% + \endgraf\global\num@linesR=\prevgraf\egroup% + \global\par@lineR=0% + \endgroup% + \ignorespaces% + \@oldnobreak% + \dump@pstartR@pc% + \ifnumberpstart% + \addtocounter{pstartR}{1}% + \fi% + \parledgroup@beforenotes@save{R}% + \ifstrempty{#1}% + {\csgdef{after@pendR@\the\l@dnumpstartsR}{\at@every@pend}}% + {\csgdef{after@pendR@\the\l@dnumpstartsR}{\noindent#1}}% +} + +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\AtEveryPstartCall} +% The \cs{AtEveryPstartCall} argument is called when the \cs{pstartL} or \cs{pstartR} is called. +% That is different of \cs{AtEveryPstart} the argument of which is called when the \cs{pstart}s are printed. +% \begin{macrocode} +\newcommand{\AtEveryPstartCall}[1]{\gdef\at@every@pstart@call{#1}}% +\gdef\at@every@pstart@call{}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\ifprint@last@after@pendL} +% \begin{macro}{\ifprint@last@after@pendR} +% Two booleans set to true, when the time is to print the last optional argument of a \cs{pend}. +% \begin{macrocode} +\newif\ifprint@last@after@pendL% +\newif\ifprint@last@after@pendR% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \subsection{Processing one line} +% +% For parallel texts we have to be able to process left and right lines +% independently. For sequential text we happily use the +% original \cs{do@line}. Otherwise \ldots +% +% \begin{macro}{\l@dleftbox} +% \begin{macro}{\l@drightbox} +% A line of left text will be put in the box \cs{l@dleftbox}, and analogously +% for a line of right text. +% \begin{macrocode} +\newbox\l@dleftbox +\newbox\l@drightbox + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\countLline} +% \begin{macro}{\countRline} +% We need to know the number of lines processed. +% \begin{macrocode} +\newcount\countLline + \countLline \z@ +\newcount\countRline + \countRline \z@ + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@donereallinesL} +% \begin{macro}{\@donetotallinesL} +% \begin{macro}{\@donereallinesR} +% \begin{macro}{\@donetotallinesR} +% We need to know the number of `real' lines output (i.e., those that +% have been input by the user), and the total lines output (which includes +% any blank lines output for synchronisation). +% \begin{macrocode} +\newcount\@donereallinesL +\newcount\@donetotallinesL +\newcount\@donereallinesR +\newcount\@donetotallinesR + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \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).} +% \changes{v1.8.0}{2014/08/05}{Change \cs{do@lineR} and \cs{do@lineR} to allow new sectioning commands.} +% \begin{macro}{\do@lineL} +% \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) (?).} +% The \cs{do@lineL} macro is called to +% do all the processing for a single line of left text. +% \changes{v0.3.0}{2005/02/10}{Added \cs{do@lineLhook} to \cs{do@lineL}} +% \changes{v0.3.0}{2005/02/10}{Simplified \cs{do@lineL} by using macros for +% some common code} +% \begin{macrocode} +\newcommand*{\do@lineL}{% + \letcs{\ifnumberpstart}{numberpstart@L\the\l@dpscL}% + \advance\countLline \@ne% + \ifvbox\namebox{l@dLcolrawbox\the\l@dpscL}% + {\vbadness=10000% + \splittopskip=\z@% + \do@lineLhook% + \l@demptyd@ta% + \global\setbox\one@line=\vsplit\namebox{l@dLcolrawbox\the\l@dpscL}% + to\baselineskip}% + \IfStrEq{\splitfirstmarks\parledgroup@}{begin}{\parledgroup@notes@startL}{}% + \unvbox\one@line \global\setbox\one@line=\lastbox% + \getline@numL% + \ifnum\@lock>\@ne% + \inserthangingsymboltrue% + \else% + \inserthangingsymbolfalse% + \fi% + \setbox\l@dleftbox% + \hb@xt@ \Lcolwidth{% + \ifl@dhidenumber% + \global\l@dhidenumberfalse% + \f@x@l@cks% + \else% + \affixline@num% + \fi% + \xifinlist{\the\l@dpscL}{\eled@sections@@}% + {\add@inserts\affixside@note}% + {\print@lineL}}% + \add@penaltiesL% + \global\advance\@donereallinesL\@ne% + \global\advance\@donetotallinesL\@ne% +\else% + \setbox\l@dleftbox \hb@xt@ \Lcolwidth{\hspace*{\Lcolwidth}}% + \global\advance\@donetotallinesL\@ne% +\fi} + + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\print@lineL} +% \cs{print@lineL} is for lines without a sectioning command. See \macpackage definition of \cs{print@line} for handbook. +% \changes{v1.12.0}{2015/02/23}{Compatibility with \LuaLaTeX\ RTL languages.} +% \begin{macrocode} +\def\print@lineL{% + \affixpstart@numL% + \l@dld@ta %space kept for backward compatibility + \add@inserts\affixside@note% + \l@dlsn@te %space kept for backward compatibility + {\ledllfill\hb@xt@ \Lcolwidth{% + \do@insidelineLhook% + \ifluatex% + \luatextextdir\l@luatextextdir@L% + \fi% + \new@lineL% + \inserthangingsymbolL% + \l@dunhbox@line{\one@line}}\ledrlfill\l@drd@ta% + \l@drsn@te}} + +% \end{macrocode} +% \end{macro} +% \begin{macro}{\print@eledsectionL} +% \changes{v1.12.0}{2015/02/23}{Compatibility with \LuaLaTeX\ RTL languages.} +% \changes{v1.12.1}{2015/02/27}{Fixes bug with \LuaLaTeX\ RTL \cs{eledsection}.} +% \cs{print@eledsectionL} is for line with macro code. +% \begin{macrocode} +\def\print@eledsectionL{%% + \addtocounter{pstartL}{-1}% + \ifdefstring{\@eledsectnotoc}{L}{\ledsectnotoc}{} + \ifdefstring{\@eledsectmark}{L}{}{\ledsectnomark} + \numdef{\temp@}{\l@dpscL-1}% + \xifinlist{\temp@}{\eled@sections@@}{\@nobreaktrue}{\@nobreakfalse}% + \@eled@sectioningtrue% + \bgroup% + \ifluatex% + \luatextextdir\l@luatextextdir@L% + \luatexpardir\l@luatexpardir@L% + \luatexbodydir\l@luatexbodydir@L% + \ifdefstring{\l@luatextextdir@L}{TRT}{\@RTLtrue}{}% + \fi% + \csuse{eled@sectioning@\the\l@dpscL}% + \egroup% + \@eled@sectioningfalse% + \global\csundef{eled@sectioning@\the\l@dpscL}% + \if@RTL% + \hspace{-3\paperwidth}% + {\hbox{\l@dunhbox@line{\one@line}} \new@line}% + \else% + \hspace{3\paperwidth}% + {\new@line \hbox{\l@dunhbox@line{\one@line}}}% + \fi% + \vskip\eledsection@correcting@skip% +} + +% \end{macrocode} +% \end{macro} +% \begin{macro}{\dolineLhook} +% \begin{macro}{\dolineRhook} +% \begin{macro}{\doinsidelineLhook} +% \begin{macro}{\doinsidelineRhook} +% \changes{v1.8.3}{2014/08/31}{Added \cs{dolineLhook}, \cs{dolineRhook}, \cs{doinsidelineLhook} and \cs{doinsidelineRhook}} +% These high-level commands just redefine the low-level commands. +% They have to be used be user, without \cs{makeatletter}. +% \begin{macrocode} +\newcommand*{\dolineLhook}[1]{\gdef\do@lineLhook{#1}}% +\newcommand*{\dolineRhook}[1]{\gdef\do@lineRhook{#1}}% +\newcommand*{\doinsidelineLhook}[1]{\gdef\do@insidelineLhook{#1}}% +\newcommand*{\doinsidelineRhook}[1]{\gdef\do@insidelineRhook{#1}}% + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \changes{v0.3.0}{2005/02/10}{Added \cs{do@lineLhook} and \cs{do@lineRhook}} +% \changes{v1.4.0}{2013/07/11}{Added \cs{do@insidelineLhook} and \cs{do@insidelineRhook}} +% \begin{macro}{\do@lineLhook} +% \begin{macro}{\do@lineRhook} +% \begin{macro}{\do@insidelineLhook} +% \begin{macro}{\do@insidelineRhook} +% Hooks, initially empty, into the respective \cs{do@line(L/R)} macros. +% \begin{macrocode} +\newcommand*{\do@lineLhook}{} +\newcommand*{\do@lineRhook}{} +\newcommand*{\do@insidelineLhook}{} +\newcommand*{\do@insidelineRhook}{} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \begin{macro}{\do@lineR} +% The \cs{do@lineR} macro is called to +% do all the processing for a single line of right text. +% \changes{v0.3.0}{2005/02/10}{Changed \cs{do@lineR} similarly to \cs{do@lineL}} +% \changes{v1.8.1}{2014/08/07}{Fix a bug with critical notes a the begining of a page, added by v1.8.0 (?).} +% \begin{macrocode} +\newcommand*{\do@lineR}{% + \letcs{\ifnumberpstart}{numberpstart@R\the\l@dpscR}% + \ledRcol@true% + \advance\countRline \@ne% + \ifvbox\namebox{l@dRcolrawbox\the\l@dpscR}% + {\vbadness=10000% + \splittopskip=\z@% + \do@lineRhook% + \l@demptyd@ta% + \global\setbox\one@lineR=\vsplit\namebox{l@dRcolrawbox\the\l@dpscR}% + to\baselineskip}% + \IfStrEq{\splitfirstmarks\parledgroup@}{begin}{\parledgroup@notes@startR}{}% + \unvbox\one@lineR \global\setbox\one@lineR=\lastbox% + \getline@numR% + \ifnum\@lockR>\@ne% + \inserthangingsymbolRtrue% + \else% + \inserthangingsymbolRfalse% + \fi% + \setbox\l@drightbox% + \hb@xt@ \Rcolwidth{% + \ifl@dhidenumber% + \global\l@dhidenumberfalse% + \f@x@l@cksR% + \else% + \affixline@numR% + \fi% + \xifinlist{\the\l@dpscR}{\eled@sectionsR@@}% + {\add@insertsR\affixside@noteR}% + {\print@lineR}% + }% + \add@penaltiesR% + \global\advance\@donereallinesR\@ne% + \global\advance\@donetotallinesR\@ne% +\else% + \setbox\l@drightbox \hb@xt@ \Rcolwidth{\hspace*{\Rcolwidth}}% + \global\advance\@donetotallinesR\@ne% +\fi% +\ledRcol@false% +} + + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\print@lineR}{} +% \begin{macro}{\print@eledsectionR}{} +% \changes{v1.12.0}{2015/02/23}{Compatibility with \LuaLaTeX\ RTL languages.} +\def\print@lineR{% + \affixpstart@numR% + \l@dld@ta %space kept for backward compatibility + \add@insertsR\affixside@noteR% + \l@dlsn@te %space kept for backward compatibility + \ledllfill\hb@xt@ \Rcolwidth{% + \do@insidelineRhook% + \new@lineR% + \inserthangingsymbolR% + \ifluatex% + \luatextextdir\l@luatextextdir@R% + \fi% + \l@dunhbox@line{\one@lineR}}\ledrlfill\l@drd@ta% + \l@drsn@te% + } + +\def\print@eledsectionR{% + \addtocounter{pstartR}{-1}% + \initnumbering@sectcountR% + \ifdefstring{\@eledsectnotoc}{R}{\ledsectnotoc}{}% + \ifdefstring{\@eledsectmark}{R}{}{\ledsectnomark}% + \numdef{\temp@}{\l@dpscR-1}% + \xifinlist{\temp@}{\eled@sectionsR@@}{\@nobreaktrue}{\@nobreakfalse}% + \@eled@sectioningtrue% + \bgroup% + \ifluatex% + \luatextextdir\l@luatextextdir@R% + \luatexpardir\l@luatexpardir@R% + \luatexbodydir\l@luatexbodydir@R% + \ifdefstring{\l@luatextextdir@L}{TRT}{\@RTLtrue}{}% + \fi% + \csuse{eled@sectioning@\the\l@dpscR R}% + \egroup% + \@eled@sectioningfalse% + \global\csundef{eled@sectioning@\the\l@dpscR R}% + \if@RTL% + \hspace{-\paperwidth}% + {\hbox{\l@dunhbox@line{\one@lineR}} \new@lineR}% + \else% + \hspace{\paperwidth}% + {\new@lineR \hbox{\l@dunhbox@line{\one@lineR}}}% + \fi% + \vskip\eledsection@correcting@skip +} +% \end{macro} +% \end{macro} +% +% \subsection{Line and page number computation} +% +% \begin{macro}{\getline@numR} +% The \cs{getline@numR} macro +% determines the page and line numbers for the right text line we are about to +% send to the vertical list. The \cs{getline@numL} is the same for left text. +% +% \begin{macrocode} +\newcommand*{\getline@numR}{% + \global\advance\absline@numR \@ne + \do@actionsR + \do@ballastR + \ifledgroupnotesR@\else + \ifnumberline + \ifsublines@ + \ifnum\sub@lockR<\tw@ + \global\advance\subline@numR \@ne + \fi + \else + \ifnum\@lockR<\tw@ + \global\advance\line@numR \@ne + \global\subline@numR \z@ + \fi + \fi + \fi + \fi +} +\newcommand*{\getline@numL}{% + \global\advance\absline@num \@ne + \do@actions + \do@ballast + \ifledgroupnotesL@\else + \ifnumberline + \ifsublines@ + \ifnum\sub@lock<\tw@ + \global\advance\subline@num \@ne + \fi + \else + \ifnum\@lock<\tw@ + \global\advance\line@num \@ne + \global\subline@num \z@ + \fi + \fi + \fi + \fi +} + + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\do@ballastR} +% \relax +% The real work in the line macros above is done in \cs{do@actions}, but +% before we plunge into that, let is get \cs{do@ballastR} out of the +% way. +% \begin{macrocode} +\newcommand*{\do@ballastR}{\global\ballast@count=\z@ + \begingroup + \advance\absline@numR \@ne + \ifnum\next@actionlineR=\absline@numR + \ifnum\next@actionR>-1001 + \global\advance\ballast@count by -\c@ballast + \fi + \fi + \endgroup} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\l@dskipversenumberR} +% \begin{macro}{\do@actionsR} +% \begin{macro}{\do@actions@fixedcodeR} +% \begin{macro}{\do@actions@nextR} +% +% The \cs{do@actionsR} macro +% looks at the list of actions to take at particular right text absolute line +% numbers, and does everything that is specified for the current line. +% +% It may call itself recursively and we use tail recursion, via +% \cs{do@actions@nextR} for this. +% \changes{v0.3.0}{2005/02/24}{Used \cs{do@actions@fixedcode} in \cs{do@actionsR}} +% \changes{v1.15.0}{2015/04/13}{Add action 1008 and 1009} +% \begin{macrocode} + +\newif\ifl@dskipversenumberR +\newcommand*{\do@actions@fixedcodeR}{% + \ifcase\@l@dtempcnta% + \or% % 1001 + \global\sublines@true + \or% % 1002 + \global\sublines@false + \or% % 1003 + \global\@lockR=\@ne + \or% % 1004% + \ifnum\@lockR=\tw@ + \global\@lockR=\thr@@ + \else + \global\@lockR=\z@ + \fi + \or% % 1005 + \global\sub@lockR=\@ne + \or% % 1006 + \ifnum\sub@lockR=\tw@ + \global\sub@lockR=\thr@@ + \else + \global\sub@lockR=\z@ + \fi + \or% % 1007 + \l@dskipnumbertrue + \or% % 1008 + \l@dskipversenumberRtrue% + \or% % 1009 + \l@dhidenumbertrue% + \else% + \led@warn@BadAction + \fi% +} + + +\newcommand*{\do@actionsR}{% + \global\let\do@actions@nextR=\relax + \@l@dtempcntb=\absline@numR + \ifnum\@l@dtempcntb<\next@actionlineR\else + \ifnum\next@actionR>-1001\relax + \global\page@numR=\next@actionR + \ifbypage@R + \global\line@numR \z@ \global\subline@numR \z@ + \fi + \else + \ifnum\next@actionR<-4999\relax % 9/05 added relax here + \@l@dtempcnta=-\next@actionR + \advance\@l@dtempcnta by -5001\relax + \ifsublines@ + \global\subline@numR=\@l@dtempcnta + \else + \global\line@numR=\@l@dtempcnta + \fi + \else + \@l@dtempcnta=-\next@actionR + \advance\@l@dtempcnta by -1000\relax + \do@actions@fixedcodeR + \fi + \fi + \ifx\actionlines@listR\empty + \gdef\next@actionlineR{1000000}% + \else + \gl@p\actionlines@listR\to\next@actionlineR + \gl@p\actions@listR\to\next@actionR + \global\let\do@actions@nextR=\do@actionsR + \fi + \fi + \do@actions@nextR} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsection{Line number printing} +% +% \begin{macro}{\l@dcalcnum} +% \begin{macro}{\ch@cksub@l@ckR} +% \begin{macro}{\ch@ck@l@ckR} +% \begin{macro}{\f@x@l@cksR} +% \begin{macro}{\affixline@numR} +% \cs{affixline@numR} is the right text version of the +% \cs{affixline@num} macro. +% \changes{v0.3.0}{2005/02/24}{Changed \cs{affixline@numR} to match new eledmac} +% \changes{v0.11.0}{2012/06/11}{Changed \cs{affixline@numR} to allow to disable line numbering (like in eledmac 0.15).} +% \begin{macrocode} + +\newcommand*{\l@dcalcnum}[3]{% + \ifnum #1 > #2\relax + \@l@dtempcnta = #1\relax + \advance\@l@dtempcnta by -#2\relax + \divide\@l@dtempcnta by #3\relax + \multiply\@l@dtempcnta by #3\relax + \advance\@l@dtempcnta by #2\relax + \else + \@l@dtempcnta=#2\relax + \fi} + +\newcommand*{\ch@cksub@l@ckR}{% + \ifcase\sub@lockR + \or + \ifnum\sublock@disp=\@ne + \@l@dtempcntb \z@ \@l@dtempcnta \@ne + \fi + \or + \ifnum\sublock@disp=\tw@ + \else + \@l@dtempcntb \z@ \@l@dtempcnta \@ne + \fi + \or + \ifnum\sublock@disp=\z@ + \@l@dtempcntb \z@ \@l@dtempcnta \@ne + \fi + \fi} + +\newcommand*{\ch@ck@l@ckR}{% + \ifcase\@lockR + \or + \ifnum\lock@disp=\@ne + \@l@dtempcntb \z@ \@l@dtempcnta \@ne + \fi + \or + \ifnum\lock@disp=\tw@ + \else + \@l@dtempcntb \z@ \@l@dtempcnta \@ne + \fi + \or + \ifnum\lock@disp=\z@ + \@l@dtempcntb \z@ \@l@dtempcnta \@ne + \fi + \fi} + +\newcommand*{\f@x@l@cksR}{% + \ifcase\@lockR + \or + \global\@lockR \tw@ + \or \or + \global\@lockR \z@ + \fi + \ifcase\sub@lockR + \or + \global\sub@lockR \tw@ + \or \or + \global\sub@lockR \z@ + \fi} + + +\newcommand*{\affixline@numR}{% +\ifledgroupnotesR@\else\ifnumberline +\ifl@dskipnumber + \global\l@dskipnumberfalse +\else + \ifsublines@ + \@l@dtempcntb=\subline@numR + \l@dcalcnum{\subline@numR}{\c@firstsublinenumR}{\c@sublinenumincrementR}% + \ch@cksub@lockR + \else + \@l@dtempcntb=\line@numR + \ifx\linenumberlist\empty + \l@dcalcnum{\line@numR}{\c@firstlinenumR}{\c@linenumincrementR}% + \else + \@l@dtempcnta=\line@numR + \edef\rem@inder{,\linenumberlist,\number\line@numR,}% + \edef\sc@n@list{\def\noexpand\sc@n@list + ####1,\number\@l@dtempcnta,####2|{\def\noexpand\rem@inder{####2}}}% + \sc@n@list\expandafter\sc@n@list\rem@inder|% + \ifx\rem@inder\empty\advance\@l@dtempcnta\@ne\fi + \fi + \ch@ck@l@ckR + \fi + \ifnum\@l@dtempcnta=\@l@dtempcntb + \ifl@dskipversenumberR\else + \if@twocolumn + \if@firstcolumn + \gdef\l@dld@ta{\llap{{\leftlinenumR}}}% + \else + \gdef\l@drd@ta{\rlap{{\rightlinenumR}}}% + \fi + \else + \@l@dtempcntb=\line@marginR + \ifnum\@l@dtempcntb>\@ne + \advance\@l@dtempcntb by\page@numR + \fi + \ifodd\@l@dtempcntb + \gdef\l@drd@ta{\rlap{{\rightlinenumR}}}% + \else + \gdef\l@dld@ta{\llap{{\leftlinenumR}}}% + \fi + \fi + \fi + \fi + \f@x@l@cksR +\fi +\fi +\fi} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \subsection{Pstart number printing in side} +% The printing of the pstart number is like in \macpackage, with two differences : +%\begin{itemize} +%\item Some commands have versions suffixed by R or L. +%\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 beginning of this command. +%\end{itemize} +% \begin{macro}{\affixpstart@numL} +% \begin{macro}{\affixpstart@numR} +% \begin{macro}{\leftpstartnumR} +% \begin{macro}{\rightpstartnumR} +% \begin{macro}{\leftpstartnumL} +% \begin{macro}{\rightpstartnumL} +% \begin{macro}{\ifpstartnumR} +% \begin{macrocode} + +\newcommand*{\affixpstart@numL}{% +\ifsidepstartnum +\if@twocolumn + \if@firstcolumn + \gdef\l@dld@ta{\llap{{\leftpstartnumL}}}% + \else + \gdef\l@drd@ta{\rlap{{\rightpstartnumL}}}% + \fi + \else + \@l@dtempcntb=\line@margin + \ifnum\@l@dtempcntb>\@ne + \advance\@l@dtempcntb \page@num + \fi + \ifodd\@l@dtempcntb + \gdef\l@drd@ta{\rlap{{\rightpstartnumL}}}% + \else + \gdef\l@dld@ta{\llap{{\leftpstartnumL}}}% + \fi + \fi +\fi +} +\newcommand*{\affixpstart@numR}{% +\ifsidepstartnum +\if@twocolumn + \if@firstcolumn + \gdef\l@dld@ta{\llap{{\leftpstartnumR}}}% + \else + \gdef\l@drd@ta{\rlap{{\rightpstartnumR}}}% + \fi + \else + \@l@dtempcntb=\line@marginR + \ifnum\@l@dtempcntb>\@ne + \advance\@l@dtempcntb \page@numR + \fi + \ifodd\@l@dtempcntb + \gdef\l@drd@ta{\rlap{{\rightpstartnumR}}}% + \else + \gdef\l@dld@ta{\llap{{\leftpstartnumR}}}% + \fi + \fi +\fi +} + +\newcommand*{\leftpstartnumL}{ +\ifpstartnum +\thepstartL +\kern\linenumsep\global\pstartnumfalse\fi +} +\newcommand*{\rightpstartnumL}{ +\ifpstartnum\kern\linenumsep +\thepstartL +\global\pstartnumfalse\fi +} +\newif\ifpstartnumR +\pstartnumRtrue +\newcommand*{\leftpstartnumR}{ +\ifpstartnumR +\thepstartR +\kern\linenumsep\global\pstartnumRfalse\fi +} +\newcommand*{\rightpstartnumR}{ +\ifpstartnumR\kern\linenumsep +\thepstartR +\global\pstartnumRfalse\fi +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \subsection{Add insertions to the vertical list} +% +% \begin{macro}{\inserts@listR} +% \cs{inserts@listR} is the list macro that contains the inserts that +% we save up for one right text paragraph. +% +% \begin{macrocode} +\list@create{\inserts@listR} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\add@insertsR} +% \begin{macro}{\add@inserts@nextR} +% The right text version. +% \begin{macrocode} +\newcommand*{\add@insertsR}{% + \global\let\add@inserts@nextR=\relax + \ifx\inserts@listR\empty \else + \ifx\next@insertR\empty + \ifx\insertlines@listR\empty + \global\noteschanged@true + \gdef\next@insertR{100000}% + \else + \gl@p\insertlines@listR\to\next@insertR + \fi + \fi + \ifnum\next@insertR=\absline@numR + \gl@p\inserts@listR\to\@insertR + \@insertR + \global\let\@insertR=\undefined + \global\let\next@insertR=\empty + \global\let\add@inserts@nextR=\add@insertsR + \fi + \fi + \add@inserts@nextR} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsection{Penalties} +% +% \begin{macro}{\add@penaltiesL} +% \begin{macro}{\add@penaltiesR} +% \cs{add@penaltiesL} is +% the last macro used by \cs{do@lineL}. It adds up the club, +% widow, and interline penalties, and puts a single penalty +% of the appropriate size +% back into the paragraph; these penalties get +% removed by the \cs{vsplit} operation. \cs{displaywidowpenalty} and +% \cs{brokenpenalty} are not restored, since we have no easy way to +% find out where we should insert them. +% +% \label{add@penalties} +% In the code below, which is a virtual copy of the original +% \cs{add@penalties}, \cs{num@lines} is the number of lines in the whole +% paragraph, and \cs{par@line} is the line we are working on at the +% moment. The count \cs{@l@dtempcnta} is used to calculate and +% accumulate the penalty; it is initially set to the value of +% \cs{ballast@count}, which has been worked out in \cs{do@ballast}. +% Finally, the penalty is +% checked to see that it does not go below $-10000$. +% \begin{verbatim} +% \newcommand*{\add@penaltiesR}{\@l@dtempcnta=\ballast@count +% \ifnum\num@linesR>\@ne +% \global\advance\par@lineR \@ne +% \ifnum\par@lineR=\@ne +% \advance\@l@dtempcnta by \clubpenalty +% \fi +% \@l@dtempcntb=\par@lineR \advance\@l@dtempcntb \@ne +% \ifnum\@l@dtempcntb=\num@linesR +% \advance\@l@dtempcnta by \widowpenalty +% \fi +% \ifnum\par@lineR<\num@linesR +% \advance\@l@dtempcnta by \interlinepenalty +% \fi +% \fi +% \ifnum\@l@dtempcnta=\z@ +% \relax +% \else +% \ifnum\@l@dtempcnta>-10000 +% \penalty\@l@dtempcnta +% \else +% \penalty -10000 +% \fi +% \fi} +% \end{verbatim} +% This is for a single chunk. However, as we are probably dealing +% with several chunks at a time, the above is nor really relevant. Peter Wilson thinks +% that it is likely with parallel text that there is no real need to add +% back any penalties; even if there was, they would have to match across the +% left and right lines. So, Peter Wilson ends up with the following. +% +% \begin{macrocode} +\newcommand*{\add@penaltiesL}{} +\newcommand*{\add@penaltiesR}{} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsection{Printing leftover notes} +% +% \begin{macro}{\flush@notesR} +% The \cs{flush@notesR} +% macro is called after the entire right text has been sliced up +% and sent on to the vertical list. +% \begin{macrocode} +\newcommand*{\flush@notesR}{% + \@xloop + \ifx\inserts@listR\empty \else + \gl@p\inserts@listR\to\@insertR + \@insertR + \global\let\@insertR=\undefined + \repeat} + +% \end{macrocode} +% \end{macro} +% +% +% \section{Footnotes} +% \label{footnotes} +% +% \subsection{Line number printing} \label{sec:nfootformat} +% +% The \cs{printlinesR} macro prints the line +% numbers for a note---which, in the +% general case, is a rather complicated task. +% The seven parameters of the +% argument are the line numbers as stored in \cs{l@d@nums}, in the +% form described on \reff{reledmac-linenumbers} of \Eledmac{}' handbook: the starting +% page, line, and sub-line numbers, followed by the ending page, +% line, and sub-line numbers, and then the font specifier for +% the lemma. +% +% +% \begin{macro}{\printlinesR} +% This is the right text version of \cs{printlines} and takes account +% of \cs{@Rlineflag}. +% Just a reminder of the arguments: \\ +% \verb?\printlinesR #1 | #2 | #3 | #4 | #5 | #6 | #7? \\ +% \verb?\printlinesR start-page | line | subline | end-page | line | subline | font ? +% \changes{v0.3.0}{2005/02/10}{Simplified \cs{printlinesR} by using +% \cs{setprintlines}} +% \begin{macrocode} +\def\printlinesR#1|#2|#3|#4|#5|#6|#7|{\begingroup + \setprintlines{#1}{#2}{#3}{#4}{#5}{#6}% + \ifl@d@pnum #1\fullstop\fi + \ifledplinenum \linenumr@p{#2}\@Rlineflag\else \symplinenum\fi + \ifl@d@ssub \fullstop \sublinenumr@p{#3}\fi + \ifl@d@dash \endashchar\fi + \ifl@d@pnum #4\fullstop\fi + \ifl@d@elin \linenumr@p{#5}\@Rlineflag\fi + \ifl@d@esl \ifl@d@elin \fullstop\fi \sublinenumr@p{#6}\fi +\endgroup} + + +% \end{macrocode} +% \end{macro} +% +% \subsection{Footnotes output specific to \cs{Pages}} +% \begin{macro}{\print@Xnotes@forpages} +% \begin{macro}{\correct@Xfootins@box} +% \begin{macro}{\print@notesX@forpages} +% \begin{macro}{\correct@footinsX@box} +% \changes{v1.13.1}{2015/03/12}{Correct \cs{correct@footinsX@box} and \cs{correct@Xfootins@box}} +% \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}.} +% The \cs{Xonlyside} and \cs{onlysideX} hooks for \cs{Pages} +% allow notes to be printed either in left or right pages only. +% The implementation of such features is delegated to \cs{print@Xnotes@forpages}, +% which replaces \cs{print@Xnotes} inside \cs{Pages}. +% Here is how we proceed\footnote{See \url{http://tex.stackexchange.com/a/230332/7712}.}: +% \begin{itemize} +% \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. +% \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. +% \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 do not want to print them. +% 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. +% \item To solve this problem, we change the magnification factor associated with notes before going to the next page. +% 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 \thetexbook\ p.~122-125). +% \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. +% 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. +% +% On p.~2, the first 10 lines of the notes are printed. +% On p.~3, the box associated to the notes contains 10 lines. However, as we are in a right page, we do not 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. +% 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. +% +% To fix this double issue: +% \begin{itemize} +% \item For the pages where notes must be NOT printed, we allow to every note box one line less than it ought to be. +% In our example, that means that we allow \TeX\ to add only $10-1=9$ line in the note box on p.~3. +% 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. +% \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 split box, adding some skip between them. That is achieved by \cs{correct@Xfootins@box} (or \cs{correct@footinsX@box} for familiar notes). +% \end{itemize} +% \end{itemize} +% The code to print critical notes, when processing \cs{Pages}. +% \begin{macrocode} +\newcommand\print@Xnotes@forpages[1]{% +% \end{macrocode} +% First case: notes are for both sides. Just print the note start and the note group +% \begin{macrocode} + \ifcsempty{Xonlyside@#1}{% + \csuse{#1footstart}{#1}% + \csuse{#1footgroup}{#1}% + }% +% \end{macrocode} +% Second case: notes are for one side only. +% First test if we are in a page where they must be printed. +% \begin{macrocode} + {% + \ifboolexpr{% + ((test {\ifcsstring{Xonlyside@#1}{L}} and not test{\ifnumodd{\c@page}})% + or% + (test {\ifcsstring{Xonlyside@#1}{R}} and test{\ifnumodd{\c@page}}))% + }% +% \end{macrocode} +% If we are in a page where notes must be printed, print the notes, after having made the corrections which are needed for boxes. +% \begin{macrocode} + {% + \correct@Xfootins@box{#1}% + \csuse{#1footstart}{#1}% + \csuse{#1footgroup}{#1}% +% \end{macrocode} +% Then, say not to keep room for notes in the next page. +% \begin{macrocode} + \global\count\csuse{#1footins}=0% + \global\skip\csuse{#1footins}=0pt% +% \end{macrocode} +% And also, allow one line less for notes in the next page. +% \begin{macrocode} + \csuse{Xnotefontsize@#1}% + \global\advance\dimen\csuse{#1footins} by -\baselineskip% +% \end{macrocode} +% Now we have printed the notes. So we put aside this fact. +% \begin{macrocode} + \global\boolfalse{keepforXside@#1}% + }% +% \end{macrocode} +% In case we are on a page where notes must NOT be printed. +% First, memorize that we have not printed the notes, despite having some to print. +% \begin{macrocode} + {% + \global\booltrue{keepforXside@#1}% +% \end{macrocode} +% Then restore expected rooms for notes on the next page. +% \begin{macrocode} + \global\count\csuse{#1footins}=\csuse{default@#1footins}% + \global\skip\csuse{#1footins}=\csuse{Xbeforenotes@#1}% +% \end{macrocode} +% Last but not least, restore the normal line number allowed to notes for the following page. +% \begin{macrocode} + \bgroup% + \csuse{Xnotefontsize@#1}% + \global\advance\dimen\csuse{#1footins} by \baselineskip% + \egroup% +% \end{macrocode} +% \begin{macrocode} +% End of \cs{print@Xnotes@forpages}. + }% + }% +}% +% \end{macrocode} +% Now, \cs{correct@Xfootins@box}, to fix problem of last line being glued to the previous one. +% \begin{macrocode} +\newcommand{\correct@Xfootins@box}[1]{% +% \end{macrocode} +% We need to make correction only in case we have not printed any note in the previous page, +% although there was to be ``normally'' printed. +% \begin{macrocode} + \ifbool{keepforXside@#1}{% +% \end{macrocode} +% Some setting needed to do the right splitting. +% \begin{macrocode} + \csuse{Xnotefontsize@#1}% + \splittopskip=0pt% +% \end{macrocode} +% And now, split the last line, and push in the right place. +% \begin{macrocode} + \global\setbox\csuse{#1footins}=\vbox{% + \vsplit\csuse{#1footins} to \dimexpr\ht\csuse{#1footins}-1pt\relax% + \vskip \dimexpr-0.5\baselineskip-0.5\lineskip-0.5pt\relax% + \unvbox\csuse{#1footins}% + }% +% \end{macrocode} +% End of the macro. +% \begin{macrocode} + }{}% +}% +% \end{macrocode} +% And now, the same for familiar footnotes. +% \begin{macrocode} +\newcommand\print@notesX@forpages[1]{% + \ifcsempty{onlysideX@#1}{% + \csuse{footstart#1}{#1}% + \csuse{footgroup#1}{#1}% + }% + {% + \ifboolexpr{% + ((test {\ifcsstring{onlysideX@#1}{L}} and not test{\ifnumodd{\c@page}})% + or% + (test {\ifcsstring{onlysideX@#1}{R}} and test{\ifnumodd{\c@page}}))% + }% + {% + \correct@footinsX@box{#1}% + \csuse{footstart#1}{#1}% + \csuse{footgroup#1}{#1}% + \global\count\csuse{footins#1}=0% + \global\skip\csuse{footins#1}=0pt% + \csuse{notefontsizeX@#1}% + \global\advance\dimen\csuse{footins#1} by -\baselineskip% + \global\boolfalse{keepforsideX@#1}% + }% + {% + \global\booltrue{keepforsideX@#1}% + \global\count\csuse{footins#1}=\csuse{default@footins#1}% + \global\skip\csuse{footins#1}=\csuse{beforenotesX@#1}% + \bgroup% + \csuse{notefontsizeX@#1}% + \global\advance\dimen\csuse{footins#1} by \baselineskip% + \egroup% + }% + }% +}% +\newcommand{\correct@footinsX@box}[1]{% + \ifbool{keepforsideX@#1}{% + \csuse{notefontsizeX@#1}% + \splittopskip=0pt% + \global\setbox\csuse{footins#1}=\vbox{% + \vsplit\csuse{footins#1} to \dimexpr\ht\csuse{footins#1}-1pt\relax% + \vskip \dimexpr-0.5\baselineskip-0.5\lineskip-0.5pt\relax% + \unvbox\csuse{footins#1}% + }% + }{}% +}% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \section{Cross referencing} +% \label{xref} +% +% +% \begin{macro}{\labelref@listR} +% Set up a new list, \cs{labelref@listR}, to hold the page, line and +% sub-line numbers for each label in right text. +% \begin{macrocode} +\list@create{\labelref@listR} + +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\edlabel} +% This command is defined only one time in \macpackage, including features for \parpackage. +% \changes{v1.12.0}{2015/02/23}{\cs{edlabel} is now defined only one time for both eledmac and eledpar} +% \changes{v1.12.0}{2015/02/23}{\cs{edlabel} and \cs{edindex} works now with hyperref when using \Lpack{eledpar}.} +% \end{macro} +% +% \begin{macro}{\l@dmake@labelsR} +% This is the right text version of \cs{l@dmake@labels}, taking account +% of \cs{@Rlineflag}. +% +% \begin{macrocode} +\def\l@dmake@labelsR#1|#2|#3|#4|#5{% + \expandafter\ifx\csname the@label#5\endcsname \relax\else + \led@warn@DuplicateLabel{#4}% + \fi + \expandafter\gdef\csname the@label#5\endcsname{#1|#2\@Rlineflag|#3|#4}% + \ignorespaces} +\AtBeginDocument{% + \def\l@dmake@labelsR#1|#2|#3|#4|#5{}% +} + +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@lab} +% The \cs{@lab} command, which appears in the \cs{linenum@out} file, +% appends the current values of page, line and sub-line to the +% \cs{labelref@list}. These values are defined by the earlier +% \cs{@page}, \cs{@nl}, and the \cs{sub@on} and \cs{sub@off} commands +% appearing in the \cs{linenum@out} file. +% +% It is defined on \macpackage. +% \changes{v2.0.0}{2015/28/06}{\cs{@lab} defined only in \eledmac.} +% \end{macro} +% +% +% \section{Side notes} +% +% Regular \verb?\marginpar?s do not work inside numbered text --- they +% do not produce any note but do put an extra unnumbered blank line into +% the text. +% \begin{macro}{\sidenote@marginR} +% \begin{macro}{\sidenotemargin*} +% \changes{v1.8.0}{2014/08/05}{\cs{sidenotemargin} is now directly defined in \Lpack{eledmac} to be able to manage \Lpack{eledpar}.} +% \changes{v1.8.0}{2014/08/05}{Add \cs{sidenotemargin*}} +% Specifies which margin sidenotes can be in. +% \begin{macrocode} +\WithSuffix\newcommand\sidenotemargin*[1]{% + \l@dgetsidenote@margin{#1} + \global\sidenote@marginR=\@l@dtempcntb + \global\sidenote@margin=\@l@dtempcntb +} +\newcount\sidenote@marginR +\global\sidenote@margin=\@ne + +% \end{macrocode} +% \end{macro} +% \end{macro} +% + +% \changes{v1.3.3}{2012/12/19}{Debugging the left notes of the right column.} +% \changes{v1.3.4}{2013/07/03}{Allow use of commands in sidenotes, as introduced by eledmac 1.0.} +% \changes{v1.8.0}{2014/08/05}{\cs{l@dlsnote},\cs{l@drsnote} and \cs{l@dcsnote} defined only one time, in \Lpack{eledmac}. } +% \begin{macro}{\affixside@noteR} +% The right text version of \cs{affixside@note}. +% \changes{v1.1.2}{2012/10/06}{Remove spurious space between line number and line content} +% \begin{macrocode} +\newcommand*{\affixside@noteR}{% + \def\sidenotecontent@{}% + \numgdef{\itemcount@}{0}% + \def\do##1{% + \ifnumequal{\itemcount@}{0}% + {% + \appto\sidenotecontent@{##1}}% Not print not separator before the 1st note + {\appto\sidenotecontent@{\sidenotesep ##1}% + }% + \numgdef{\itemcount@}{\itemcount@+1}% + }% + \dolistloop{\l@dcsnotetext}% + \ifnumgreater{\itemcount@}{1}{\led@err@ManySidenotes}{}% + \gdef\@templ@d{}% + \gdef\@templ@n{\l@dcsnotetext\l@dcsnotetext@l\l@dcsnotetext@r}% + \ifx\@templ@d\@templ@n \else% + \if@twocolumn% + \if@firstcolumn% + \setl@dlp@rbox{##1}{\sidenotecontent@}% + \else% + \setl@drp@rbox{\sidenotecontent@}% + \fi% + \else% + \@l@dtempcntb=\sidenote@marginR% + \ifnum\@l@dtempcntb>\@ne% + \advance\@l@dtempcntb by\page@numR% + \fi% + \ifodd\@l@dtempcntb% + \setl@drp@rbox{\sidenotecontent@}% + \gdef\sidenotecontent@{}% + \numdef{\itemcount@}{0}% + \dolistloop{\l@dcsnotetext@l}% + \ifnumgreater{\itemcount@}{1}{\led@err@ManyLeftnotes}{}% + \setl@dlp@rbox{\sidenotecontent@}% + \else% + \setl@dlp@rbox{\sidenotecontent@}% + \gdef\sidenotecontent@{}% + \numdef{\itemcount@}{0}% + \dolistloop{\l@dcsnotetext@r}% + \ifnumgreater{\itemcount@}{1}{\led@err@ManyRightnotes}{}% + \setl@drp@rbox{\sidenotecontent@}% + \fi% + \fi% + \fi% +} + +% \end{macrocode} +% \end{macro} +% +% +% \section{Familiar footnotes} +% +% +% \begin{macro}{\l@dbfnote} +% \cs{l@dbfnote} adds the footnote to the insert list, and +% \cs{vl@dbfnote} calls the original \cs{@footnotetext}. +% \changes{v1.3.1}{2012/11/16}{Compatibility of standard footnotes with eledmac when theses footnotes contain any commands.} +% \changes{v1.3.3}{2012/11/19}{Spurious space with footnote in right column.} +% There are both defined in \macpackage. +% \changes{v2.0.0}{2015/07/19}{\cs{l@dbfnote} defined only in \reledmac.} +% \end{macro} +% +% +% \begin{macro}{\normalbfnoteX} +% \changes{v0.3.0}{2005/02/04}{Removed extraneous spaces from \cs{normalbfnoteX}} +% \changes{v1.3.5}{2013/07/10}{Allows one to redefine \cs{thefootnoteX} with \c{alph} when some packages are loaded.} +% \changes{v1.4.1}{2013/08/16}{Fix bug with normal familiar footnotes when mixing RTL and LTR text.} +% \changes{v2.0.0}{2015/07/19}{\cs{normalbfnoteX} defined only in \reledmac.} +% \end{macro} +% +% + +% \section{Verse} +%\changes{v0.11.0}{2012/06/11}{New management of hangingsymbol insertion, preventing undesirable insertions.} +%\changes{v0.12.0}{2012/08/03}{New management of hangingsymbol insertion, preventing undesirable insertions.} +% Like in \macpackage, the insertion of hangingsymbol is base on \cs{ifinserthangingsymbol}, and, for the right side, on \cs{ifinserthangingsymbolR}. +% 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. +% \begin{macro}{\inserthangingsymbolL} +% \begin{macro}{\inserthangingsymbolR} +% \changes{v0.11.0}{2012/06/11}{Prevent the column separator for hanging verse from shifting} +% \changes{v1.4.3}{2013/10/27}{Hanging verse is no longer automatically flush right.} +% \changes{v1.15.0}{2015/04/13}{Prevent more efficiently the column separator from shifting when a verse is hanging} +% \begin{macrocode} +\newif\ifinserthangingsymbolR +\newcommand{\inserthangingsymbolL}{% + \ifinserthangingsymbol% + \ifinstanzaL% + \hskip \@ifundefined{sza@0@}{0}{\expandafter% + \noexpand\csname sza@0@\endcsname}\stanzaindentbase% + \@hangingsymbol% + \fi% + \fi% +}% +\newcommand{\inserthangingsymbolR}{% + \ifinserthangingsymbolR% + \ifinstanzaR% + \hskip \@ifundefined{sza@0@}{0}{\expandafter% + \noexpand\csname sza@0@\endcsname}\stanzaindentbase% + \@hangingsymbol% + \fi% + \fi% +}% +% \end{macrocode} +% \end{macro} +% \end{macro} + +% Before we can define the main stanza macros we need to be able to save +% and reset +% the category code for \&. To save the current value we use +% \verb+\next+ from the \verb+\loop+ macro. +% \begin{macrocode} + \chardef\next=\catcode`\& + \catcode`\&=\active + +% \end{macrocode} +% +% +% +% \begin{environment}{astanza} +% \changes{v1.4.1}{2013/08/16}{Enable the use of stanzaindentsrepetition within astanza environment.} +% \changes{v1.13.0}{2015/03/06}{Enable the use of optional argument of \& in astanza environment.} +% This is roughly an environmental form of \cs{stanza}, which treats +% its stanza-like contents as a single chunk. +% +% \begin{macrocode} +\newenvironment{astanza}{% + \catcode`\&\active + \global\stanza@count\@ne\stanza@modulo\@ne + \ifnum\usenamecount{sza@0@}=\z@ + \let\stanza@hang\relax + \let\endlock\relax + \else + \rightskip\z@ plus 1fil\relax + \fi + \ifnum\usenamecount{szp@0@}=\z@ + \let\sza@penalty\relax + \fi + \def&{% + \endlock\mbox{}% + \sza@penalty + \global\advance\stanza@count\@ne + \@astanza@line}% + \def\&{\@stopastanza}% + \pstart + \@astanza@line +}{} + +% \end{macrocode} +% \end{environment} +% +% \begin{macro}{\@stopastanza} +% This command is called by \verb+\&+ in astanza environment. +% It allows optional arguments. +% \begin{macrocode} +\newcommandx{\@stopastanza}[1][1,usedefault]{% + \endlock\mbox{}% + \pend[#1]% +}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\@astanza@line} +% This gets put at the start of each line in the environment. It sets up +% the paragraph style --- each line is treated as a paragraph. +% \begin{macrocode} +\newcommand*{\@astanza@line}{% + \ifnum\value{stanzaindentsrepetition}=0 + \parindent=\csname sza@\number\stanza@count + @\endcsname\stanzaindentbase + \else + \parindent=\csname sza@\number\stanza@modulo + @\endcsname\stanzaindentbase + \managestanza@modulo + \fi + \par + \stanza@hang%\mbox{}% + \ignorespaces} + +% \end{macrocode} +% \end{macro} +% +% Lastly reset the modified category codes. +% \begin{macrocode} + \catcode`\&=\next + +% \end{macrocode} +% +% \section{Naming macros} +% +% The \LaTeX\ kernel provides \cs{@namedef} and \cs{@namuse} for defining +% and using macros that may have non-letters in their names. We need +% something similar here as we are going to need and use some numbered +% boxes and counters. +% +% \begin{macro}{\newnamebox} +% \begin{macro}{\setnamebox} +% \begin{macro}{\unhnamebox} +% \begin{macro}{\unvnamebox} +% \begin{macro}{\namebox} +% A set of macros for creating and using `named' boxes; the macros are called +% after the regular box macros, but including the string `name'. +% \begin{macrocode} +\providecommand*{\newnamebox}[1]{% + \expandafter\newbox\csname #1\endcsname} +\providecommand*{\setnamebox}[1]{% + \expandafter\setbox\csname #1\endcsname} +\providecommand*{\unhnamebox}[1]{% + \expandafter\unhbox\csname #1\endcsname} +\providecommand*{\unvnamebox}[1]{% + \expandafter\unvbox\csname #1\endcsname} +\providecommand*{\namebox}[1]{% + \csname #1\endcsname} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\newnamecount} +% \begin{macro}{\usenamecount} +% Macros for creating and using `named' counts. +% \begin{macrocode} +\providecommand*{\newnamecount}[1]{% + \expandafter\newcount\csname #1\endcsname} +\providecommand*{\usenamecount}[1]{% + \csname #1\endcsname} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \section{Fixing babel and polyglossia} +% +% With parallel texts there is the possibility that the two sides +% might use different languages via \Lpack{babel}. On the other hand, +% nor \Lpack{babel} nor \Lpack{polyglossia} might not be called at all (even though it might be already +% built into the format). +% \changes{v0.2.0}{2004/12/20}{Added section of babel related code} +% +% With the normal sequential text each line is initially typeset +% in the current language environment, and then it is output at which +% time its attachments are typeset (in the same language environment. +% In the parallel case lines are typeset in their current language but +% an attachment might be typeset outside the language environment +% of its line if the left and right side languages are different. +% To counter this, we have to make sure that the correct language is +% used at the proper times. +% +% \begin{macro}{\ifl@dusedbabel} +% \begin{macro}{\l@dusedbabelfalse} +% \begin{macro}{\l@dusedbabeltrue} +% A flag for checking if \verb?babel? has been used as a package. +% \begin{macrocode} +\newif\ifl@dusedbabel +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \changes{v1.8.0}{2014/08/05}{Suppress \cs{ifl@dsamelang} which did not work and was not logical, because both columns could have the same language but not the main language of the document.} +% +% \begin{macro}{\l@dchecklang} +% \changes{v1.8.0}{2014/08/05}{Suppress \cs{l@dchecklang} which did not work and was not logical, because both columns could have the same language but not the main language of the document.} +% \end{macro} +% \begin{macro}{\bbl@set@language} +% In \Lpack{babel} the macro \cs{bbl@set@language}\marg{lang} does the work when +% the language \meta{lang} is changed via \cs{selectlanguage}. +% Unfortunately for us, if it is given +% an argument in the form of a control sequence it strips off the \verb?\? +% character rather than expanding the command. We need a version that accepts +% an argument in the form \cs{lang} without it stripping the \verb?\?. +% \changes{v2.0.0}{2015/07/19}{Patch \cs{bbl@set@language} instead of redefining it} +% \begin{macrocode} +\patchcmd{\bbl@set@language}% + {\select@language{\languagename}}% + {\edef\languagename{#1}\select@language{\languagename}}% + {}% + {}% + +% \end{macrocode} +% \end{macro} +% +% The rest of the setup has to be postponed until the end of the preamble +% when we know if \Lpack{babel} or \Lpack{polyglossia} have been used or not. However, for now assume +% that it has not been used. +% +% \begin{macro}{\selectlanguage} +% \begin{macro}{\l@duselanguage} +% \begin{macro}{\theledlanguageL} +% \begin{macro}{\theledlanguageR} +% \cs{selectlanguage} is a \verb?babel? command. \cs{theledlanguageL} and +% \cs{theledlanguageR} are the names of the languages of the left and right +% texts. \cs{l@duselanguage} is similar to \cs{selectlanguage}. +% \begin{macrocode} +\newcommand*{\l@duselanguage}[1]{} +\gdef\theledlanguageL{} +\gdef\theledlanguageR{} + +% \end{macrocode} +% +% Now do the \Lpack{babel} or \Lpack{polyglossia} fix or, if necessary. +% \begin{macrocode} +\AtBeginDocument{% + \@ifundefined{xpg@main@language}{% + \@ifundefined{bbl@main@language}{% +% \end{macrocode} +% Either \Lpack{babel} has not been used or it has been used with no +% specified language. +% \begin{macrocode} + \l@dusedbabelfalse + }{% +% \end{macrocode} +% Here we deal with the case where babel has been used. \cs{selectlanguage} +% has to be redefined to use our version of \cs{bbl@set@language} and to +% store the left or right language. +% \begin{macrocode} + \l@dusedbabeltrue + \let\l@doldselectlanguage\selectlanguage + \let\l@doldbbl@set@language\bbl@set@language + \renewcommand{\selectlanguage}[1]{% + \l@doldselectlanguage{#1}% + \ifledRcol \gdef\theledlanguageR{#1}% + \else \gdef\theledlanguageL{#1}% + \fi} +% \end{macrocode} +% \cs{l@duselanguage} simply calls the original \cs{selectlanguage} so +% that \cs{theledlanguageL} and \cs{theledlanguageR} are unaltered. +% \begin{macrocode} + \renewcommand*{\l@duselanguage}[1]{% + \l@doldselectlanguage{#1}} +% \end{macrocode} +% Lastly, initialise the left and right languages to the current \Lpack{babel} +% one. +% \begin{macrocode} + \gdef\theledlanguageL{\bbl@main@language}% + \gdef\theledlanguageR{\bbl@main@language}% + }% + } +% \end{macrocode} +% If use \Lpack{polyglossia} +% \changes{v1.8.0}{2014/08/05}{Correct left/right language setting with polyglossia.} +% \changes{v1.9.0}{2014/09/16}{Debug left/right language switching with polyglossia. Do not write in .aux file when setting left/right lines.} +% \changes{v2.0.0}{2015/07/19}{Patch \cs{otherlanguage} instead of redefining it.} +% \begin{macrocode} + { \let\old@otherlanguage\otherlanguage% + \renewcommand{\otherlanguage}[2][]{% + \selectlanguage[#1]{#2}% + \ifledRcol \gdef\theledlanguageR{#2}% + \else \gdef\theledlanguageL{#2}% + \fi}% + \let\l@duselanguage\select@language% + \gdef\theledlanguageL{\xpg@main@language}% + \gdef\theledlanguageR{\xpg@main@language}% +% \end{macrocode} +% That is it. +% \begin{macrocode} +}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \section{Counts and boxes for parallel texts} +% +% In sequential text, each chunk (that enclosed by \cs{pstart} \ldots +% \cs{pend}) is put into a box called \cs{raw@text} and then immediately +% printed, resulting in the box being emptied and ready for the next chunk. +% For parallel processing multiple boxes are needed as printing is delayed. +% We also need extra counters for various things. +% +% \begin{macro}{\maxchunks} +% \begin{macro}{\l@dc@maxchunks} +% The maximum number of chunk pairs before printing has to be called for. +% The default is 5120 chunk pairs. +% \begin{macrocode} +\newcount\l@dc@maxchunks +\newcommand{\maxchunks}[1]{\l@dc@maxchunks=#1} + \maxchunks{5120} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\l@dnumpstartsL} +% \begin{macro}{\l@dnumpstartsR} +% The numbers of left and right chunks. \cs{l@dnumpstartsL} is defined +% in \Lpack{eledmac}. +% \changes{v0.3.0}{2005/02/24}{Moved \cs{l@dnumpstartsL} to eledmac} +% \begin{macrocode} +\newcount\l@dnumpstartsR + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\l@pscL} +% \begin{macro}{\l@pscR} +% A couple of scratch counts for use in left and right texts, respectively. +% \begin{macrocode} +\newcount\l@dpscL +\newcount\l@dpscR + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\l@dsetuprawboxes} +% This macro creates \cs{maxchunks} pairs of boxes for left and right +% chunks. The boxes are called \cs{l@dLcolrawbox1}, \cs{l@dLcolrawbox2}, etc. +% \begin{macrocode} +\newcommand*{\l@dsetuprawboxes}{% + \@l@dtempcntb=\l@dc@maxchunks + \loop\ifnum\@l@dtempcntb>\z@ + \newnamebox{l@dLcolrawbox\the\@l@dtempcntb} + \newnamebox{l@dRcolrawbox\the\@l@dtempcntb} + \advance\@l@dtempcntb \m@ne + \repeat} + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\l@dsetupmaxlinecounts} +% \begin{macro}{\l@dzeromaxlinecounts} +% To be able to synchronise left and right texts we need +% to know the maximum number of text lines there are in each pair of chunks. +% \cs{l@dsetupmaxlinecounts} creates \cs{maxchunks} new counts +% called \cs{l@dmaxlinesinpar1}, etc., and +% \cs{l@dzeromaxlinecounts} zeroes all of them. +% \begin{macrocode} +\newcommand*{\l@dsetupmaxlinecounts}{% + \@l@dtempcntb=\l@dc@maxchunks + \loop\ifnum\@l@dtempcntb>\z@ + \newnamecount{l@dmaxlinesinpar\the\@l@dtempcntb} + \advance\@l@dtempcntb \m@ne + \repeat} +\newcommand*{\l@dzeromaxlinecounts}{% + \begingroup + \@l@dtempcntb=\l@dc@maxchunks + \loop\ifnum\@l@dtempcntb>\z@ + \global\usenamecount{l@dmaxlinesinpar\the\@l@dtempcntb}=\z@ + \advance\@l@dtempcntb \m@ne + \repeat + \endgroup} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% Make sure that all these are set up. This has to be done after the +% user has had an opportunity to change \cs{maxchunks}. +% \begin{macrocode} +\AtBeginDocument{% + \l@dsetuprawboxes + \l@dsetupmaxlinecounts + \l@dzeromaxlinecounts + \l@dnumpstartsL=\z@ + \l@dnumpstartsR=\z@ + \l@dpscL=\z@ + \l@dpscR=\z@} + +% \end{macrocode} +% \section{Checking text to be processed} +% \begin{macro}{\if@pstarts} +% \begin{macro}{\@pstartstrue} +% \begin{macro}{\@pstartsfalse} +% \begin{macro}{\check@pstarts} +% \cs{check@pstarts} returns \cs{@pstartstrue} if there are any unprocessed +% chunks. +% \begin{macrocode} +\newif\if@pstarts +\newcommand*{\check@pstarts}{% + \@pstartsfalse + \ifnum\l@dnumpstartsL>\l@dpscL + \@pstartstrue + \else + \ifnum\l@dnumpstartsR>\l@dpscR + \@pstartstrue + \fi + \fi +} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\ifaraw@text} +% \begin{macro}{\araw@texttrue} +% \begin{macro}{\araw@textfalse} +% \begin{macro}{\checkraw@text} +% \cs{checkraw@text} checks whether the current Left or Right box is +% void or not. If one or other is not void it sets \cs{araw@texttrue}, +% otherwise both are void and it sets \cs{araw@textfalse}. +% \begin{macrocode} +\newif\ifaraw@text +\newcommand*{\checkraw@text}{% + \araw@textfalse + \ifvbox\namebox{l@dLcolrawbox\the\l@dpscL} + \araw@texttrue + \else + \ifvbox\namebox{l@dRcolrawbox\the\l@dpscR} + \araw@texttrue + \fi + \fi +} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\@writelinesinparL} +% \begin{macro}{\@writelinesinparR} +% These write the number of text lines in a chunk to the section files, +% and then afterwards zero the counter. +% \begin{macrocode} +\newcommand*{\@writelinesinparL}{% + \edef\next{% + \write\linenum@out{\string\@pend[\the\@donereallinesL]}}% + \next + \global\@donereallinesL \z@} +\newcommand*{\@writelinesinparR}{% + \edef\next{% + \write\linenum@outR{\string\@pendR[\the\@donereallinesR]}}% + \next + \global\@donereallinesR \z@} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \section{Parallel columns} +% +% \begin{macro}{\@eledsectionL} +% \begin{macro}{\@eledsectionR} +% The parbox \cs{@eledsectionL} and \cs{@eledsectionR} will keep the sections' title. +% \begin{macrocode} +\newsavebox{\@eledsectionL}% +\newsavebox{\@eledsectionR}% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\Columns} +% \changes{v1.8.0}{2014/07/28}{Modify \cs{Columns} to enable to add section's title.} +% The \cs{Columns} command results in the previous Left and +% Right texts being typeset in matching columns. There should +% be equal numbers of chunks in the left and right texts. +% +% \changes{v1.12.0}{2015/02/23}{Add \cs{l@dprintingcolumnstrue}} +% \begin{macrocode} +\newcommand*{\Columns}{% + \ifl@dpairing% + \led@err@Columns@InsideEnv% + \fi% + \l@dprintingcolumnstrue% + \eledsection@correcting@skip=-\baselineskip% Correction for sections' titles + \ifnum\l@dnumpstartsL=\l@dnumpstartsR\else + \led@err@BadLeftRightPstarts{\the\l@dnumpstartsL}{\the\l@dnumpstartsR}% + \fi +% \end{macrocode} +% Start a group and zero counters, etc. +% \begin{macrocode} + \begingroup + \l@dzeropenalties + \endgraf\global\num@lines=\prevgraf + \global\num@linesR=\prevgraf + \global\par@line=\z@ + \global\par@lineR=\z@ + \global\l@dpscL=\z@ + \global\l@dpscR=\z@ +% \end{macrocode} +% Check if there are chunks to be processed, and process them +% two by two (left and right pairs). +% \begin{macrocode} + \check@pstarts + \loop\if@pstarts + \global\pstartnumtrue + \global\pstartnumRtrue +% \end{macrocode} +% Increment \cs{l@dpscL} and \cs{l@dpscR} which here count +% the numbers of left and right chunks. +% Also restore the value of the public pstart counters. +% \begin{macrocode} + \global\advance\l@dpscL \@ne + \global\advance\l@dpscR \@ne + \restore@pstartL@pc% + \restore@pstartR@pc% +% \end{macrocode} +% We print the optional argument of \cs{pstart} or the argument of \cs{AtEveryPstart}. +% \begin{macrocode} + \Columns@print@before@pstart% +% \end{macrocode} +% Check if there is text yet to be processed in at least one of +% the two current chunks, and also whether the left and right languages +% are the same +% \changes{v0.2.0}{2004/12/20}{Added \cs{l@dchecklang} and \cs{l@duselanguage} +% to \cs{Columns}} +% \changes{v1.8.0}{2014/08/05}{Suppress \cs{l@dchecklang} from \cs{Columns}.} +% \begin{macrocode} + \checkraw@text +{ \loop\ifaraw@text +% \end{macrocode} +% Grab the next pair of left and right text lines and output them, swapping +% languages if they differ, adding section title if needed. +% \begin{macrocode} + \l@duselanguage{\theledlanguageL}% + \do@lineL + \xifinlist{\the\l@dpscL}{\eled@sections@@} + {% + \ifdefstring{\@eledsectmark}{L}% + {\csuse{eled@sectmark@\the\l@dpscL}% + }{}% + \global\csundef{eled@sectmark@\the\l@dpscL}% + \savebox{\@eledsectionL}{\parbox[t][][t]{\Lcolwidth}{\vbox{}\print@eledsectionL}}%\vbox{}-> prevent alignment troubles with RTL language + }% + {}% + \l@duselanguage{\theledlanguageR}% + \do@lineR + \xifinlist{\the\l@dpscR}{\eled@sectionsR@@} + {% + \ifdefstring{\@eledsectmark}{R}% + {\csuse{eled@sectmark@\the\l@dpscR R}% + }{}% + \global\csundef{eled@sectmark@\the\l@dpscR R}% + \savebox{\@eledsectionR}{\parbox[t][][t]{\Rcolwidth}{\vbox{}\print@eledsectionR}}}%\vbox{}-> prevent alignment troubles with RTL language + {}% + \hb@xt@ \hsize{% + \ifdefstring{\columns@position}{L}{}{\hfill }% + \unhbox\l@dleftbox% + \ifhbox\@eledsectionL% + \usebox{\@eledsectionL}% + \fi% + \print@columnseparator% + \unhbox\l@drightbox% + \ifhbox\@eledsectionR% + \usebox{\@eledsectionR}% + \fi% + \ifdefstring{\columns@position}{R}{}{\hfill}% + }% + \checkraw@text + \checkverseL + \checkverseR + \checkpb@columns + \repeat} +% \end{macrocode} +% Having completed a pair of chunks, write the number of lines +% in each chunk to the respective section files. +% Increment pstart counters and reset line numbering if it is by pstart. +% \changes{v0.11.0}{2012/06/11}{Line numbering by pstart.} +% \begin{macrocode} + \@writelinesinparL + \@writelinesinparR + \check@pstarts + \ifbypstart@% + \write\linenum@out{\string\@set[1]} + \resetprevline@ + \fi + \ifbypstart@R + \write\linenum@outR{\string\@set[1]} + \resetprevline@ + \fi + \Columns@print@after@pend% + \repeat +% \end{macrocode} +% Having output all chunks, make sure all notes have been output, +% then zero counts ready for the next set of texts. The boolean tests for stanza are switched to false. +% \begin{macrocode} + \flush@notes + \flush@notesR + \endgroup +% \end{macrocode} +% \begin{macrocode} + \global\l@dpscL=\z@ + \global\l@dpscR=\z@ + \global\l@dnumpstartsL=\z@ + \global\l@dnumpstartsR=\z@ + \l@dprintingcolumnsfalse% + \ignorespaces + \global\instanzaLfalse + \global\instanzaRfalse} + +% \end{macrocode} +% \end{macro} +% \begin{macro}{\print@columnseparator} +% \changes{v1.8.0}{2014/08/05}{Move some code of \cs{Columns} to \cs{print@columnseparator}.} +% \cs{print@columnseparator} prints the column separator, with surrounding spaces (as the user has set them). +% We use the \TeX\ \cs{ifdim} instead of \Lpack{etoolbox} +% to avoid having \cs{hfill} in a \verb+{}+, which deletes some space (but not much). +% \begin{macrocode} +\def\print@columnseparator{% + \ifdim\beforecolumnseparator<0pt% + \hfill% + \else% + \hspace{\beforecolumnseparator}% + \fi% + \columnseparator% + \ifdim\aftercolumnseparator<0pt% + \hfill% + \else% + \hspace{\beforecolumnseparator}% + \fi% +}% +%\end{macrocode} +% \end{macro} +% \begin{macro}{\checkpb@columns} +% \cs{checkpb@columns} prevent or make pagebreaking in columns, depending of the use of \cs{ledpb} or \cs{lednopb}. +% \begin{macrocode} + +\newcommand{\checkpb@columns}{% + \newif\if@pb + \newif\if@nopb + \IfStrEq{\led@pb@setting}{before}{ + \numdef{\next@absline}{\the\absline@num+1}% + \numdef{\next@abslineR}{\the\absline@numR+1}% + \xifinlistcs{\next@absline}{l@prev@pb}{\@pbtrue}{}% + \xifinlistcs{\next@abslineR}{l@prev@pbR}{\@pbtrue}{} + \xifinlistcs{\next@absline}{l@prev@nopb}{\@nopbtrue}{}% + \xifinlistcs{\next@abslineR}{l@prev@nopbR}{\@nopbtrue}{} + }{} + \IfStrEq{\led@pb@setting}{after}{ + \xifinlistcs{\the\absline@num}{l@prev@pb}{\@pbtrue}{}% + \xifinlistcs{\the\absline@numR}{l@prev@pbR}{\@pbtrue}{} + \xifinlistcs{\the\absline@num}{l@prev@nopb}{\@nopbtrue}{}% + \xifinlistcs{\the\absline@numR}{l@prev@nopbR}{\@nopbtrue}{} + }{} +\if@nopb\nopagebreak[4]\enlargethispage{\baselineskip}\fi +\if@pb\pagebreak[4]\fi +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\columnseparator} +% \begin{macro}{\columnrulewidth} +% The separator between line pairs in parallel columns is in the form +% of a vertical rule extending a little below the baseline and with a height +% slightly greater than the \cs{baselineskip}. The width of the rule +% is \cs{columnrulewidth} (initially 0pt so the rule is invisible). +% \begin{macrocode} +\newcommand*{\columnseparator}{% + \smash{\rule[-0.2\baselineskip]{\columnrulewidth}{1.05\baselineskip}}} +\newdimen\columnrulewidth + \columnrulewidth=\z@ + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\columnsposition} +% \begin{macro}{\columns@position} +% The position of the \cs{Columns} in a page. Default value is R. +% Stored in \cs{columns@position}. +% \begin{macrocode} +\newcommand*{\columnsposition}[1]{% + \xdef\columns@position{#1}% + }% +\xdef\columns@position{R}% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\beforecolumnseparator} +% \begin{macro}{\aftercolumnseparator} +% \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}. +% \begin{macrocode} +\newlength{\beforecolumnseparator}% +\setlength{\beforecolumnseparator}{-2pt}% + +\newlength{\aftercolumnseparator}% +\setlength{\aftercolumnseparator}{-2pt}% + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{setwidthliketwocolumns@L} +% \begin{macro}{setpositionliketwocolumns@L} +% \begin{macro}{setnotepositionliketwocolumns@L} +% \begin{macro}{setwidthliketwocolumns@C} +% \begin{macro}{setpositionliketwocolumns@C} +% \begin{macro}{setnotepositionliketwocolumns@C} +% \begin{macro}{setwidthliketwocolumns@R} +% \begin{macro}{setpositionliketwocolumns@R} +% \begin{macro}{setnotepositionliketwocolumns@R} +% The \cs{setwidth…} macros are called in \cs{beginnumbering} in a \textbf{non-parallel} +% 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. +% The \cs{setposition…} macros are called in \cs{beginnumbering} in a \textbf{non- parallel} typesetting context to fix the position of the lines. +% The \cs{setnoteposition…} macros are called in \cs{xxxfootstart} in a \textbf{non- parallel} typesetting context to fix the position of notes block. +% \begin{macrocode} +\newcommand{\setwidthliketwocolumns@L}{% +% Temporary dimension, initially equal to the standard hsize, i.e. text width +% \begin{macrocode} + \newdimen\temp% + \temp=\hsize% +% \end{macrocode} +% Hsize : Left + Right width +% \begin{macrocode} + \hsize=\Lcolwidth% + \advance\hsize\Rcolwidth% +% \end{macrocode} +% Now, calculating the remaining space +% \begin{macrocode} + \advance\temp-\hsize% +% \end{macrocode} +% And multiply the hsize by 2/3 of this space +% \begin{macrocode} + \multiply\temp by 2% + \divide\temp by 3% + \advance\hsize\temp% +}% + +\newcommand{\setpositionliketwocolumns@L}{% + \renewcommand{\ledrlfill}{\hfill}% +}% + +\newcommand{\setnotespositionliketwocolumns@L}{% +}% + + +% \end{macrocode} +% \begin{macrocode} +\newcommand{\setwidthliketwocolumns@C}{% +% Temporary dimension, initially equal to the standard hsize, i.e. text width +% \end{macrocode} +% \begin{macrocode} + \newdimen\temp% + \temp=\hsize% +% Hsize : Left + Right width +% \end{macrocode} +% \begin{macrocode} + \hsize=\Lcolwidth% + \advance\hsize\Rcolwidth% +% Now, calculating the remaining space +% \end{macrocode} +% \begin{macrocode} + \advance\temp-\hsize% +% \end{macrocode} +% And multiply the hsize by 1/2 of this space +% \begin{macrocode} + \divide\temp by 2% + \advance\hsize\temp% +}% + +\newcommand{\setpositionliketwocolumns@C}{% + \doinsidelinehook{\hfill}% + \renewcommand{\ledrlfill}{\hfill}% +}% + +\newcommand{\setnotespositionliketwocolumns@C}{% + \newdimen\temp% + \newdimen\tempa% + \temp=\hsize% + \tempa=\Lcolwidth% + \advance\tempa\Rcolwidth% + \advance\temp-\tempa% + \divide\temp by 2% + \leftskip=\temp% + \rightskip=-\temp% +}% + +\newcommand{\setwidthliketwocolumns@R}{% +% \end{macrocode} +% Temporary dimension, initially equal to the standard hsize, i.e. text width +% \begin{macrocode} + \newdimen\temp% + \temp=\hsize% +% \end{macrocode} +% Hsize : Left + Right width +% \begin{macrocode} + \hsize=\Lcolwidth% + \advance\hsize\Rcolwidth% +% \end{macrocode} +% Now, calculating the remaining space +% \begin{macrocode} + \advance\temp-\hsize% +% \end{macrocode} +% And multiply the hsize by 2/3 of this space +% \begin{macrocode} + \multiply\temp by 2% + \divide\temp by 3% + \advance\hsize\temp% +}% + +\newcommand{\setpositionliketwocolumns@R}{% + \doinsidelinehook{\hfill}% +}% + +\newcommand{\setnotespositionliketwocolumns@R}{% + \newdimen\temp% + \newdimen\tempa% + \temp=\hsize% + \tempa=\Lcolwidth% + \advance\tempa\Rcolwidth% + \advance\temp-\tempa% + \divide\temp by 2% + \leftskip=\temp% + \rightskip=-\temp% +}% + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\Columns@print@before@pstart} +% \begin{macro}{\Columns@print@after@pend} +% 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. +% \begin{macrocode} +\newcommand{\Columns@print@before@pstart}{% + \ifboolexpr{% + test{\ifcsstring{before@pstartL@\the\l@dpscL}{\at@every@pstart}}% + and test {\ifcsstring{before@pstartR@\the\l@dpscR}{\at@every@pstart}}% + and test {\ifdefempty{\at@every@pstart}}}% + {}% + {% + \hb@xt@ \hsize{% + \ifdefstring{\columns@position}{L}{}{\hfill }% + \par\parbox[t][][t]{\Lcolwidth}{% + \csuse{before@pstartL@\the\l@dpscL}% + }% + \print@columnseparator% + \parbox[t][][t]{\Rcolwidth}{% + \csuse{before@pstartR@\the\l@dpscR}% + }% + \ifdefstring{\columns@position}{R}{}{\hfill}% + }% + }% + \global\csundef{before@pstartL@\the\l@dpscL}% + \global\csundef{before@pstartR@\the\l@dpscR}% +}% +\newcommand{\Columns@print@after@pend}{% + \ifboolexpr{% + test{\ifcsstring{after@pendL@\the\l@dpscL}{\at@every@pend}}% + and test {\ifcsstring{after@pendR@\the\l@dpscR}{\at@every@pend}}% + and test {\ifdefempty{\at@every@pend}}}% + {}% + {% + \hb@xt@ \hsize{% + \ifdefstring{\columns@position}{L}{}{\hfill }% + \parbox[t][][t]{\Lcolwidth}{% + \csuse{after@pendL@\the\l@dpscL}% + }% + \print@columnseparator% + \parbox[t][][t]{\Rcolwidth}{% + \csuse{after@pendR@\the\l@dpscR}% + }% + \ifdefstring{\columns@position}{R}{}{\hfill}% + }% + }% + \global\csundef{after@pendL@\the\l@dpscL}% + \global\csundef{after@pendR@\the\l@dpscR}% +}% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \section{Parallel pages} +% +% This is considerably more complicated than parallel columns. +% +% \subsection{Specific counters} +% \begin{macro}{\numpagelinesL} +% \begin{macro}{\numpagelinesR} +% \begin{macro}{\l@dminpagelines} +% Counts for the number of lines on a left or right page, and the smaller +% of the number of lines on a pair of facing pages. +% \begin{macrocode} +\newcount\numpagelinesL +\newcount\numpagelinesR +\newcount\l@dminpagelines + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \subsection{Main macro} +% \begin{macro}{\Pages} +% \changes{v1.8.0}{2014/07/28}{Modify \cs{Pages} to enable to add section's title.} +% \changes{v1.8.3}{2014/08/31}{Debug blank pages when using optional argument in the last \cs{pend}.} +% \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).} +% \changes{v1.10.0}{2015/01/12}{Debug wrong parallel pages synchronization when an \cs{edtext} falls across two pages.} +% \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.} +% \changes{v1.13.1}{2015/03/12}{Prevent false empty page after \cs{Pages} (bug added in 1.13.0)} +% The \cs{Pages} command results in the previous Left and +% Right texts being typeset on matching facing pages. There should +% be equal numbers of chunks in the left and right texts. +% +% \changes{v1.12.0}{2015/02/23}{Add \cs{l@dprintingpagestrue}} +% \begin{macrocode} +\newcommand*{\Pages}{% + \ifl@dpairing% + \led@err@Pages@InsideEnv% + \fi% + \eledsection@correcting@skip=-2\baselineskip% line correcting for section titles. + \parledgroup@notespacing@set@correction% + \typeout{}% + \typeout{*************************** PAGES ***************************}% + \ifnum\l@dnumpstartsL=\l@dnumpstartsR\else% + \led@err@BadLeftRightPstarts{\the\l@dnumpstartsL}{\the\l@dnumpstartsR}% + \fi% +% \end{macrocode} +% \changes{v1.13.0}{2015/03/06xx}{Prevent false overfull hboxes when using \cs{Pages} outside of pages environment.} +% 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. +% \begin{macrocode} + \setlength{\Lcolwidth}{\textwidth}% + \setlength{\Rcolwidth}{\textwidth}% +% \end{macrocode} +% Get onto an empty even (left) page, then initialise counters, etc. +% \begin{macrocode} + \cleartol@devenpage% + \l@dprintingpagestrue% + \begingroup% + \l@dzeropenalties% + \endgraf\global\num@lines=\prevgraf% + \global\num@linesR=\prevgraf% + \global\par@line=\z@% + \global\par@lineR=\z@% + \global\l@dpscL=\z@% + \global\l@dpscR=\z@% + \writtenlinesLfalse% + \writtenlinesRfalse% +% \end{macrocode} +% The footnotes are printed in a different way from expected in \macpackage, as we may want to print the notes on one side only. +% \begin{macrocode} + \let\print@Xnotes\print@Xnotes@forpages% + \let\print@notesX\print@notesX@forpages% +% \end{macrocode} +% Check if there are chunks to be processed. +% \begin{macrocode} + \check@pstarts% + \loop\if@pstarts% +% \end{macrocode} +% Loop over the number of chunks, incrementing the chunk counts +% (\cs{l@dpscL} +% and \cs{l@dpscR} are chunk (box) counts.) +% \begin{macrocode} + \global\advance\l@dpscL \@ne% + \global\advance\l@dpscR \@ne% +% \end{macrocode} +% Calculate the maximum number of real text lines in the chunk pair, +% storing the result in the relevant \cs{l@dmaxlinesinpar}. +% \begin{macrocode} + \getlinesfromparlistL% + \getlinesfromparlistR% + \l@dcalc@maxoftwo{\@cs@linesinparL}{\@cs@linesinparR}% + {\usenamecount{l@dmaxlinesinpar\the\l@dpscL}}% + \check@pstarts% + \repeat% +% \end{macrocode} +% Zero the counts again, ready for the next bit. +% \begin{macrocode} + \global\l@dpscL=\z@% + \global\l@dpscR=\z@% +% \end{macrocode} +% Get the number of lines on the first pair of pages and store +% the minimum in \cs{l@dminpagelines}. +% \begin{macrocode} + \getlinesfrompagelistL% + \getlinesfrompagelistR% + \l@dcalc@minoftwo{\@cs@linesonpageL}{\@cs@linesonpageR}% + {\l@dminpagelines}% +% \end{macrocode} +% Now we start processing the left and right chunks (\cs{l@dpscL} and +% \cs{l@dpscR} count the left and right chunks), starting with the first pair. +% \begin{macrocode} + \check@pstarts% + \if@pstarts% +% \end{macrocode} +% Increment the chunk counts to get the first pair. +% Restore also the value of public pstart counters. +% \begin{macrocode} + \global\advance\l@dpscL \@ne% + \global\advance\l@dpscR \@ne% + \restore@pstartL@pc% + \restore@pstartR@pc% +% \end{macrocode} +% We have not processed any lines from these chunks yet, so zero the +% respective line counts. +% \begin{macrocode} + \global\@donereallinesL=\z@% + \global\@donetotallinesL=\z@% + \global\@donereallinesR=\z@% + \global\@donetotallinesR=\z@% +% \end{macrocode} +% Start a loop over the boxes (chunks). +% \begin{macrocode} + \checkraw@text% +% \end{macrocode} +% \begin{macrocode} +% \begingroup +{ \loop\ifaraw@text% +% \end{macrocode} +% See if there is more that can be done for the left page and set up the +% left language. +% \changes{v0.2.0}{2004/12/20}{Added \cs{l@duselanguage} to \cs{Pages}} +% \begin{macrocode} + \checkpageL% + \l@duselanguage{\theledlanguageL}% +{ \loop\ifl@dsamepage% +% \end{macrocode} +% Process the next (left) text line, adding it to the page. +% Eventually, adds the optional argument of pstart. +% \changes{v0.3.0}{2005/02/10}{Added \cs{ledstrutL} to \cs{Pages}} +% \begin{macrocode} + \ifdefstring{\@eledsectnotoc}{L}{\ledsectnotoc}{}% + \csuse{before@pstartL@\the\l@dpscL}% + \global\csundef{before@pstartL@\the\l@dpscL}% + \do@lineL% + \xifinlist{\the\l@dpscL}{\eled@sections@@} + {\print@eledsectionL}% + {}% + \advance\numpagelinesL \@ne% +% \end{macrocode} +% When using shiftedpstarts option, a \cs{l@dleftbox} with a null height is not printed. +% That means we do not insert blank lines at the end of a left chunk lower than the corresponding right chunk. +% However, a \cs{l@dleftbox} with a null height will advance the \cs{pagetotal} in any case. +% Because if we do not do this, the \cs{checkpageL} could let \cs{ifl@pagefull} to false, +% and consequently a \cs{@lopL} equal to 1000 could be written in the numbered file, +% even if all the lines actually needed for the current page have been printed. +% \l@dleftbox +% \begin{macrocode} + \ifshiftedpstarts% + \ifdim\ht\l@dleftbox>0pt\hb@xt@% + \hsize{\ledstrutL\unhbox\l@dleftbox}% + \else% + \dimen0=\pagetotal% + \advance\dimen0 by \baselineskip% + \global\pagetotal=\dimen0% + \fi% + \else% + \parledgroup@correction@notespacing{L} + \hb@xt@ \hsize{\ledstrutL\unhbox\l@dleftbox}% + \fi% +% \end{macrocode} +% Perhaps we have to move to the next (left) box. Check if we have got all +% we can onto the page. If not, repeat for the next line. +% Check if we have to print the optional argument of the last pend. +% Check if the page is full. +% Check if the verse is split in two subsequent pages. +% Check there is any forced page breaks. +% Reset the verse skipnumber boolean +% \begin{macrocode} + \get@nextboxL% + \global\l@dskipversenumberfalse% + \ifprint@last@after@pendL% + \csuse{after@pendL@\the\l@dpscL}% + \global\csundef{after@pendL@\the\l@dpscL}% + \fi% + \checkpageL% + \checkverseL% + \checkpbL% + \repeat% +% \end{macrocode} +% That (left) page has been filled. Output the number of real lines +% on the page --- if the page break is because the page has been +% filled with lines, use the actual number, otherwise the page has been +% ended early in order to synchronise with the facing page so use an +% impossibly large number. +% \begin{macrocode} + \ifl@dpagefull% + \@writelinesonpageL{\the\numpagelinesL}% + \else% + \@writelinesonpageL{1000}% + \fi% +% \end{macrocode} +% Reset to zero the left-page line count, clear the page to get onto the facing +% (odd, right) page, and reinitialize the accumulated dimension of interline correction for notes in parallel ledgroup. +% \begin{macrocode} + \numpagelinesL \z@% + \parledgroup@correction@notespacing@init% + \clearl@dleftpage }% +% \end{macrocode} +% Now do the same for the right text. +% \changes{v0.3.0}{2005/02/10}{Added \cs{ledstrutR} to \cs{Pages}} +% \begin{macrocode} + \checkpageR% + \l@duselanguage{\theledlanguageR}% +{ \loop\ifl@dsamepage% + \initnumbering@sectcountR% + \ifdefstring{\@eledsectnotoc}{R}{\ledsectnotoc}{}% + \csuse{before@pstartR@\the\l@dpscR}% + \global\csundef{before@pstartR@\the\l@dpscR}% + \do@lineR% + \xifinlist{\the\l@dpscR}{\eled@sectionsR@@}% + {\print@eledsectionR}% + {}% + \advance\numpagelinesR \@ne% + \ifshiftedpstarts% + \ifdim\ht\l@drightbox>0pt\hb@xt@% + \hsize{\ledstrutR\unhbox\l@drightbox}% + \else% + \dimen0=\pagetotal% + \advance\dimen0 by \baselineskip% + \global\pagetotal=\dimen0% + \fi% + \else% + \parledgroup@correction@notespacing{R}% + \hb@xt@ \hsize{\ledstrutR\unhbox\l@drightbox}% + \fi% + \get@nextboxR% + \global\l@dskipversenumberRfalse% + \ifprint@last@after@pendR% + \csuse{after@pendR@\the\l@dpscR}% + \global\csundef{after@pendR@\the\l@dpscR}% + \fi% + \checkpageR% + \checkverseR% + \checkpbR% + \repeat% + \ifl@dpagefull% + \@writelinesonpageR{\the\numpagelinesR}% + \else% + \@writelinesonpageR{1000}% + \fi% + \numpagelinesR=\z@% + \parledgroup@correction@notespacing@init% +% \end{macrocode} +% The page is full, so move onto the next (left, odd) page and repeat left +% text processing. +% \begin{macrocode} + \clearl@drightpage}% +% \end{macrocode} +% More to do? If there is we have to get the number of lines for the next +% pair of pages before starting to output them. +% \changes{v0.3.b}{2005/04/08}{Added \cs{l@dminpagelines} calculation +% for succeeding page pairs} +% \begin{macrocode} + \checkraw@text% + \ifaraw@text% + \getlinesfrompagelistL% + \getlinesfrompagelistR% + \l@dcalc@minoftwo{\@cs@linesonpageL}{\@cs@linesonpageR}% + {\l@dminpagelines}% + \fi% + \repeat}% +% \end{macrocode} +% We have now output the text from all the chunks. +% \begin{macrocode} + \fi% +% \end{macrocode} +% Make sure that there are no inserts hanging around. +% \begin{macrocode} + \flush@notes% + \flush@notesR% + \endgroup% +% \end{macrocode} +% Zero counts ready for the next set of left/right text chunks. The boolean tests for stanza are switched to false. +% \begin{macrocode} + \global\l@dpscL=\z@% + \global\l@dpscR=\z@% + \global\l@dnumpstartsL=\z@% + \global\l@dnumpstartsR=\z@% + \global\instanzaLfalse% + \global\instanzaRfalse% + \l@dprintingpagesfalse% + \finish@Pages@notes%Needed to prevent final notes overlap line number + \ignorespaces} + + +% \end{macrocode} +% \end{macro} +% +% \subsection{Ensure all notes be printed at the end of parallel pages} +% \begin{macro}{\finish@Pages@notes} +% This macro ensures that all long notes are printed at the end of \cs{Pages} typesetting, and that there is no more long notes left for the next pages. +% \begin{macrocode} +\newcommand{\finish@Pages@notes}{% + \def\do##1{% +% \end{macrocode} +% First, declare footnote box if there was no previous declared. +% E.g. if familiar or critical notes were disabled by \macpackage's options. +% \begin{macrocode} + \ifnocritical@% + \global\newnamebox{##1footins} + \fi + \ifnofamiliar@% + \global\newnamebox{footins##1} + \fi +% \end{macrocode} +% And now, add a \cs{newpage} if there is no more footnote to print. +% \begin{macrocode} + \ifvoid\csuse{##1footins}% + \ifvoid\csuse{footins##1}\else% + \newpage\null% + \listbreak% + \fi% + \else% + \newpage\null% + \listbreak% + \fi% + }% + \dolistloop{\@series}% +}% +% \end{macrocode} +% \end{macro} +% \subsection{Struts} +% \begin{macro}{\ledstrutL} +% \begin{macro}{\ledstrutR} +% Struts inserted into leftand right text lines. +% \changes{v0.3.0}{2005/02/10}{Added \cs{ledtrutL} and \cs{ledstrutR}} +% \begin{macrocode} +\newcommand*{\ledstrutL}{\strut} +\newcommand*{\ledstrutR}{\strut} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \subsection{Page clearing} +% \begin{macro}{\cleartoevenpage} +% \begin{macro}{\cleartol@devenpage} +% \cs{cleartoevenpage}, which is defined in the memoir class, +% is like \cs{clear(double)page} except that we +% end up on an even page. +% \cs{cleartol@devenpage} is similar except that it first checks to see +% if it is already on an empty page. +% \begin{macrocode} +\providecommand{\cleartoevenpage}[1][\@empty]{% + \clearpage + \ifodd\c@page\hbox{}#1\clearpage\fi} +\newcommand*{\cleartol@devenpage}{% + \ifdim\pagetotal<\topskip% on an empty page + \else + \clearpage + \fi + \ifodd\c@page\hbox{}\clearpage\fi% +}% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\clearl@dleftpage} +% \begin{macro}{\clearl@drightpage} +% \cs{clearl@dleftpage} and \cs{clearl@drightpage} get us onto +% an odd and even page, respectively, checking that we end up on +% the subsquent page. +% Both commands use \cs{newpage} and not \cs{clearpage}. +% Because \cs{clearpage} prints all footnotes before the next page, even if it has to add new empty pages, while \cs{newpage} does not. +% 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} +% +% \changes{v1.13.0}{2015/03/06x}{Use \cs{newpage} instead of \cs{clearpage}.} +% \begin{macrocode} +\newcommand*{\clearl@dleftpage}{% + \ifdim\pagetotal=0pt\hbox{}\fi% + \newpage% + \ifodd\c@page\else + \led@err@LeftOnRightPage + \hbox{}% + \cleardoublepage + \fi} + +\newcommand*{\clearl@drightpage}{% + \ifdim\pagetotal=0pt\hbox{}\fi% + \newpage% + \ifodd\c@page + \led@err@RightOnLeftPage + \hbox{}% + \cleartoevenpage + \fi} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsection{Lines managing} +% \begin{macro}{\getlinesfromparlistL} +% \begin{macro}{\@cs@linesinparL} +% \begin{macro}{\getlinesfromparlistR} +% \begin{macro}{\@cs@linesinparR} +% \cs{getlinesfromparlistL} gets the next entry from the +% \cs{linesinpar@listL} and puts it into \cs{@cs@linesinparL}; if the +% list is empty, it sets \cs{@cs@linesinparL} to 0. Similarly +% for \cs{getlinesfromparlistR}. +% \begin{macrocode} +\newcommand*{\getlinesfromparlistL}{% + \ifx\linesinpar@listL\empty + \gdef\@cs@linesinparL{0}% + \else + \gl@p\linesinpar@listL\to\@cs@linesinparL + \fi} +\newcommand*{\getlinesfromparlistR}{% + \ifx\linesinpar@listR\empty + \gdef\@cs@linesinparR{0}% + \else + \gl@p\linesinpar@listR\to\@cs@linesinparR + \fi} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\getlinesfrompagelistL} +% \begin{macro}{\@cs@linesonpageL} +% \begin{macro}{\getlinesfrompagelistR} +% \begin{macro}{\@cs@linesonpageR} +% \cs{getlinesfrompagelistL} gets the next entry from the +% \cs{linesonpage@listL} and puts it into \cs{@cs@linesonpageL}; if the +% list is empty, it sets \cs{@cs@linesonpageL} to 1000. Similarly +% for \cs{getlinesfrompagelistR}. +% \begin{macrocode} +\newcommand*{\getlinesfrompagelistL}{% + \ifx\linesonpage@listL\empty + \gdef\@cs@linesonpageL{1000}% + \else + \gl@p\linesonpage@listL\to\@cs@linesonpageL + \fi} +\newcommand*{\getlinesfrompagelistR}{% + \ifx\linesonpage@listR\empty + \gdef\@cs@linesonpageR{1000}% + \else + \gl@p\linesonpage@listR\to\@cs@linesonpageR + \fi} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@writelinesonpageL} +% \begin{macro}{\@writelinesonpageR} +% These macros output the number of lines on a page to the section file +% in the form of \cs{@lopL} or \cs{@lopR} macros. +% \begin{macrocode} +\newcommand*{\@writelinesonpageL}[1]{% + \edef\next{\write\linenum@out{\string\@lopL{#1}}}% + \next} +\newcommand*{\@writelinesonpageR}[1]{% + \edef\next{\write\linenum@outR{\string\@lopR{#1}}}% + \next} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\l@dcalc@maxoftwo} +% \begin{macro}{\l@dcalc@minoftwo} +% \cs{l@dcalc@maxoftwo}\marg{num}\marg{num}\marg{count} sets \meta{count} +% to the maximum of the two \meta{num}. +% +% Similarly +% \cs{l@dcalc@minoftwo}\marg{num}\marg{num}\marg{count} sets \meta{count} +% to the minimum of the two \meta{num}. +% +% \begin{macrocode} +\newcommand*{\l@dcalc@maxoftwo}[3]{% + \ifnum #2>#1\relax + #3=#2\relax + \else + #3=#1\relax + \fi} +\newcommand*{\l@dcalc@minoftwo}[3]{% + \ifnum #2<#1\relax + #3=#2\relax + \else + #3=#1\relax + \fi} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsection{Page break managing} +% \begin{macro}{\ifl@dsamepage} +% \begin{macro}{\l@dsamepagetrue} +% \begin{macro}{\l@dsamepagefalse} +% \begin{macro}{\ifl@dpagefull} +% \begin{macro}{\l@dpagefulltrue} +% \begin{macro}{\l@dpagefullfalse} +% \begin{macro}{\checkpageL} +% \begin{macro}{\checkpageR} +% \cs{checkpageL} tests if the space and lines already taken on the page by +% text and footnotes is less than the constraints. If so, then +% \cs{ifl@dpagefull} is set FALSE and \cs{ifl@dsamepage} is set TRUE. +% If the page is spatially full +% then \cs{ifl@dpagefull} is set TRUE and \cs{ifl@dsamepage} is set FALSE. +% If it is not spatially full but the maximum number of lines have been +% output then both \cs{ifl@dpagefull} and \cs{ifl@dsamepage} +% are set FALSE. +% +% \begin{macrocode} +\newif\ifl@dsamepage + \l@dsamepagetrue +\newif\ifl@dpagefull + +\newcommand*{\checkpageL}{% + \l@dpagefulltrue + \l@dsamepagetrue + \check@goal + \ifdim\pagetotal<\ledthegoal + \ifnum\numpagelinesL<\l@dminpagelines + \else + \l@dsamepagefalse + \l@dpagefullfalse + \fi + \else + \l@dsamepagefalse + \l@dpagefulltrue + \fi% + \ifprint@last@after@pendL% + \l@dpagefullfalse% + \l@dsamepagefalse% + \print@last@after@pendLfalse% + \fi% + }% + +\newcommand*{\checkpageR}{% + \l@dpagefulltrue + \l@dsamepagetrue + \check@goal + \ifdim\pagetotal<\ledthegoal + \ifnum\numpagelinesR<\l@dminpagelines + \else + \l@dsamepagefalse + \l@dpagefullfalse + \fi + \else + \l@dsamepagefalse + \l@dpagefulltrue + \fi% + \ifprint@last@after@pendR% + \l@dpagefullfalse% + \l@dsamepagefalse% + \print@last@after@pendRfalse% + \fi% + }% + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \begin{macro}{\checkpbL} +% \begin{macro}{\checkpbR} +% \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}. +% \begin{macrocode} +\newcommand{\checkpbL}{ + \IfStrEq{\led@pb@setting}{after}{ + \xifinlistcs{\the\absline@num}{l@prev@pb}{\l@dpagefulltrue\l@dsamepagefalse}{} + \xifinlistcs{\the\absline@num}{l@prev@nopb}{\l@dpagefullfalse\l@dsamepagetrue}{} + }{} + \IfStrEq{\led@pb@setting}{before}{ + \numdef{\next@absline}{\the\absline@num+1} + \xifinlistcs{\next@absline}{l@prev@pb}{\l@dpagefulltrue\l@dsamepagefalse}{} + \xifinlistcs{\next@absline}{l@prev@nopb}{\l@dpagefullfalse\l@dsamepagetrue}{} + }{} +} + +\newcommand{\checkpbR}{ + \IfStrEq{\led@pb@setting}{after}{ + \xifinlistcs{\the\absline@numR}{l@prev@pbR}{\l@dpagefulltrue\l@dsamepagefalse}{} + \xifinlistcs{\the\absline@numR}{l@prev@nopbR}{\l@dpagefullfalse\l@dsamepagetrue}{} + }{} + \IfStrEq{\led@pb@setting}{before}{ + \numdef{\next@abslineR}{\the\absline@numR+1} + \xifinlistcs{\next@abslineR}{l@prev@pbR}{\l@dpagefulltrue\l@dsamepagefalse}{} + \xifinlistcs{\next@abslineR}{l@prev@nopbR}{\l@dpagefullfalse\l@dsamepagetrue}{} + }{} +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\checkverseL} +% \begin{macro}{\checkverseR} +% \cs{checkverseL} and \cs{checkverseR} are called after each line is printed. +% They prevent page break inside line of verse. +% \begin{macrocode} +\newcommand{\checkverseL}{ +\ifinstanzaL + \iflednopbinverse + \ifinserthangingsymbol + \numgdef{\prev@abslineverse}{\the\absline@num-1} + \IfStrEq{\led@pb@setting}{after}{\lednopbnum{\prev@abslineverse}}{} + \IfStrEq{\led@pb@setting}{before}{\ifnum\numpagelinesL<3\ledpbnum{\prev@abslineverse}\fi}{} + \fi + \fi +\fi +} +\newcommand{\checkverseR}{ +\ifinstanzaR + \iflednopbinverse + \ifinserthangingsymbolR + \numgdef{\prev@abslineverse}{\the\absline@numR-1} + \IfStrEq{\led@pb@setting}{after}{\lednopbnumR{\prev@abslineverse}}{} + \IfStrEq{\led@pb@setting}{before}{\ifnum\numpagelinesR<3\ledpbnumR{\prev@abslineverse}\fi}{} + \fi + \fi +\fi +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\setgoalfraction} +% \begin{macro}{\ledthegoal} +% \begin{macro}{\goalfraction} +% \begin{macro}{\check@goal} +% \cs{ledthegoal} is the amount of space allowed to taken by text and +% footnotes on a page before a forced pagebreak. This can be controlled via +% \cs{@goalfraction}. \cs{ledthegoal} is calculated via \cs{check@goal}. +% \begin{macrocode} +\newdimen\ledthegoal +\ifshiftedpstarts + \newcommand*{\@goalfraction}{0.95} +\else + \newcommand*{\@goalfraction}{0.9} +\fi + +\newcommand*{\check@goal}{% + \ledthegoal=\@goalfraction\pagegoal} +\newcommand{\setgoalfraction}[1]{% + \xdef\@goalfraction{#1}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\ifwrittenlinesL} +% \begin{macro}{\ifwrittenlinesL} +% Booleans for whether line data has been written to the section file. +% \begin{macrocode} +\newif\ifwrittenlinesL +\newif\ifwrittenlinesR + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsection{Getting boxes content} +% \begin{macro}{\get@nextboxL} +% \begin{macro}{\get@nextboxR} +% \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).} +% If the current box is not empty (i.e., still contains some lines) +% nothing is done. Otherwise if and only if a synchronisation point is +% reached the next box is started. +% +% \begin{macrocode} +\newcommand*{\get@nextboxL}{% + \ifvbox\namebox{l@dLcolrawbox\the\l@dpscL}% box is not empty +% \end{macrocode} +% The current box is not empty; do nothing. +% \begin{macrocode} + \else% box is empty +% \end{macrocode} +% The box is empty. +% Check if enough lines (real and blank) have been +% output. +% \begin{macrocode} + \ifnum\usenamecount{l@dmaxlinesinpar\the\l@dpscL}>\@donetotallinesL + \parledgroup@notes@endL + \else +% \end{macrocode} +% Sufficient lines have been output. +% \begin{macrocode} + \ifnum\usenamecount{l@dmaxlinesinpar\the\l@dpscL}=\@donetotallinesL + \parledgroup@notes@endL + \fi + \ifwrittenlinesL\else +% \end{macrocode} +% Write out the number of lines done, and set the boolean so this is only +% done once. +% \begin{macrocode} + \@writelinesinparL + \writtenlinesLtrue + \fi + \ifnum\l@dnumpstartsL>\l@dpscL +% \end{macrocode} +% \changes{v0.11.0}{2012/06/11}{Pstart number can be printed in side} +% There are still unprocessed boxes. Recalculate the maximum number of +% lines needed, and move onto the next box (by incrementing \cs{l@dpscL}). If needed, restart the line numbering. +% \begin{macrocode} + \writtenlinesLfalse + \ifbypstart@ + \global\line@num=0% + \resetprevline@% + \fi +% Add the content of the optional argument of the previous \cs{pend}. +% \begin{macrocode} + \csuse{after@pendL@\the\l@dpscL}% + \global\csundef{after@pendL@\the\l@dpscL}% +% \end{macrocode} +% Check the number of lines +% \begin{macrocode} + \l@dcalc@maxoftwo{\the\usenamecount{l@dmaxlinesinpar\the\l@dpscL}}% + {\the\@donetotallinesL}% + {\usenamecount{l@dmaxlinesinpar\the\l@dpscL}}% + \global\@donetotallinesL \z@ +% \end{macrocode} +% Go to the next pstart +% \begin{macrocode} + \global\advance\l@dpscL \@ne + \global\pstartnumtrue% + \restore@pstartL@pc% +% \end{macrocode} +% Add notes of parallel ledgroup. +% \begin{macrocode} + \parledgroup@notes@endL + \parledgroup@correction@notespacing@final{L} + \else +% \end{macrocode} +% \begin{macrocode} + \fi + \fi + \fi} +% \end{macrocode} +% +% \begin{macrocode} +\newcommand*{\get@nextboxR}{% + \ifvbox\namebox{l@dRcolrawbox\the\l@dpscR}% box is not empty + \else% box is empty + \ifnum\usenamecount{l@dmaxlinesinpar\the\l@dpscR}>\@donetotallinesR + \parledgroup@notes@endR + \else + \ifnum\usenamecount{l@dmaxlinesinpar\the\l@dpscR}=\@donetotallinesR + \parledgroup@notes@endR + \fi + \ifwrittenlinesR\else + \@writelinesinparR + \writtenlinesRtrue + \fi + \ifnum\l@dnumpstartsR>\l@dpscR + \writtenlinesRfalse + \ifbypstart@R + \global\line@numR=0% + \resetprevline@% + \fi + \csuse{after@pendR@\the\l@dpscR}% + \global\csundef{after@pendR@\the\l@dpscR}% + \l@dcalc@maxoftwo{\the\usenamecount{l@dmaxlinesinpar\the\l@dpscR}}% + {\the\@donetotallinesR}% + {\usenamecount{l@dmaxlinesinpar\the\l@dpscR}}% + \global\@donetotallinesR \z@ + \global\advance\l@dpscR \@ne + \global\pstartnumRtrue% + \restore@pstartR@pc% + \parledgroup@notes@endR + \parledgroup@correction@notespacing@final{R} + \else + \print@last@after@pendRtrue% + \fi + \fi + \fi} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsection{Same page number in both side} +% The \verb+sameparallelpagenumber+ allow to have the same page number for the left and the right side +% We can not do it by changing the value of the \verb|page| counter, since its value is used by many \LaTeX's features to determine whether a page is left or right: left page are even, right page are odd. +% Consequently, we have to do it by patching \cs{thepage}, in order to use the value of the \verb+sameparallelpage@number+ counter instead of value of \verb+page+ counter. +% +% This counter will be increased in a patched version of the \LaTeX's \cs{@outputpage} macro, as is the \verb+page+ counter in this macro. However, \cs{sameparallelpage@number} will be increased only one page on two when processing \cs{Pages}. +% + +% + +% \begin{macro}{\par@patch@thepage} + +% \cs{par@patch@thepage} patches \cs{thepage} in order to use the value of \verb+sameparallelpage@number+ counter and not the value of \verb+sameparallelpage@number+. It must be called after any redefinition of \cs{thepage}. That why we insert it at the end of the \LaTeX macro \cs{pagenumbering}, which is called by some \cs{xxxmatter} commands. We also call it at the begin of the document. +% \begin{macrocode} +\newcommand{\par@patch@thepage}{% + \ifsameparallelpagenumber% + \patchcmd{\thepage}% + {page}{sameparallelpage@number}% + {}% + {\led@error@fail@patch@thepage}% + \fi% +}% +\apptocmd{\pagenumbering}{% + \par@patch@thepage% + }% + {}% + {\led@error@fail@patch@pagenumbering}% + +\AtBeginDocument{\par@patch@thepage}% + +% \end{macrocode} +% \end{macro} +% \begin{macro}{\@outputpage} +% As its names said, \cs{@outputpage} is a \LaTeX's macro called in the output routine. That is this macro which increase the \verb+page+ counter. +% We patch it in order to increase, conditionally, the \verb+sameparallelpage@number+ counter. +% \begin{macrocode} +\AtBeginDocument{% + \apptocmd{\@outputpage}{% + \ifsameparallelpagenumber% + \ifl@dprintingpages% + \ifodd\c@page\else% + \stepcounter{sameparallelpage@number}% + \fi% + \else% + \stepcounter{sameparallelpage@number}% + \fi% + \else% + \stepcounter{sameparallelpage@number}% + \fi% + }% + {}% + {\led@error@fail@patch@@outputpage}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\thesameparallelpage@number} +% And now, initialize \verb+sameparallelpage@number+ counter. +% \begin{macrocode} +\newcounter{sameparallelpage@number}% +\setcounter{sameparallelpage@number}{1}% +% \end{macrocode} +% \end{macro} +% \section{Sections' titles' commands} +% As switching from left to right pages does not clear the page since v1.13.0, +% but only creates new pages, no \verb+\vbox{}+ is inserted, and consequently parallel chapters are mis-aligned. +% +% So we patch the \cs{chapter} command in order to prevent this problem. +% \begin{macro}{\chapter} +% \begin{macrocode} +\pretocmd{\chapter}{% + \ifl@dprintingpages% + \vbox{}% + \fi% + }% + {}% + {}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\eledsectnotoc} +% \cs{eledsectnotoc} just saves its content \cs{@eledsectnotoc}, which will be tested where sectioning commands will be printed. +% \begin{macrocode} +\newcommand{\eledsectnotoc}[1]{\xdef\@eledsectnotoc{#1}} +\eledsectnotoc{R} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\eledsectmark} +% \cs{eledsectmark} just saves its content \cs{@eledsectmark}, which will be tested where sectioning commands will be printed. +% \begin{macrocode} +\newcommand{\eledsectmark}[1]{\xdef\@eledsectmark{#1}} +\eledsectmark{L} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\eledsection@correcting@skip} +% 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}. +% \begin{macrocode} +\newskip\eledsection@correcting@skip +% \end{macrocode} +% \end{macro} +% \begin{macro}{\eled@sectioningR@out} +% We save the sectioning commands of the right side in the \cs{eled@sectioningR@out} file. +% \begin{macrocode} +\newwrite\eled@sectioningR@out +% \end{macrocode} +% \end{macro} +% \section{Page break/no page break, depending on the specific line} +% We need to adapt the macro of the homonym section of eledmac to eledpar. +% \begin{macro}{\prev@pbR} +% \begin{macro}{\prev@nopbR} +% The \cs{l@prev@pbR} macro is a \Lpack{etoolbox}'s list, which contains the lines in which page breaks occur (before or after). +% The \cs{l@prev@nopbR} macro is a \Lpack{etoolbox} list, which contains the lines in which NO page breaks occur (before or after). +% \begin{macrocode} +\def\l@prev@pbR{} +\def\l@prev@nopbR{} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\ledpbR} +% \begin{macro}{\ledpbnumR} +% \begin{macro}{\lednopbnum} +% \begin{macro}{\lednopbnumR} +% The \cs{ledpbR} macro writes the call to \cs{led@pbR} in line-list file. +% The \cs{ledpbnumR} macro writes the call to \cs{led@pbnumR} in line-list file. +% The \cs{lednopbR} macro writes the call to \cs{led@nopbR} in line-list file. +% The \cs{lednopbnumR} macro writes the call to \cs{led@nopbnumR} in line-list file. +% \begin{macrocode} +\newcommand{\ledpbR}{\write\linenum@outR{\string\led@pbR}} +\newcommand{\ledpbnumR}[1]{\write\linenum@outR{\string\led@pbnumR{#1}}} +\newcommand{\lednopbR}{\write\linenum@outR{\string\led@nopbR}} +\newcommand{\lednopbnumR}[1]{\write\linenum@outR{\string\led@nopbnumR{#1}}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \begin{macro}{\led@pbR} +% \begin{macro}{\led@pbnumR} +% \begin{macro}{\led@nopbR} +% \begin{macro}{\led@nopbnumR} +% The \cs{led@pbR} add the absolute line number in the \cs{prev@pbR} list. +% The \cs{led@pbnumR} add the argument in the \cs{prev@pbR} list. +% The \cs{led@nopbR} add the absolute line number in the \cs{prev@nopbR} list. +% The \cs{led@nopbnumR} add the argument in the \cs{prev@nopbR} list. +% \begin{macrocode} +\newcommand{\led@pbR}{\listxadd{\l@prev@pbR}{\the\absline@numR}} +\newcommand{\led@pbnumR}[1]{\listxadd{\l@prev@pbR}{#1}} +\newcommand{\led@nopbR}{\listxadd{\l@prev@nopbR}{\the\absline@numR}} +\newcommand{\led@nopbnumR}[1]{\listxadd{\l@prev@nopbR}{#1}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \section{Parallel ledgroup} +% \begin{macro}{\parledgroup@} +% \begin{macro}{\parledgroupseries@} +% \begin{macro}{\parledgrouptype@} +% The marks \cs{parledgroup@} contains information about the beginnings and endings of notes in a parallel ledgroup. +% \cs{parledgroup@series} contains the footnote series. +% \cs{parledgroup@type} contains the type of the footnote: critical (Xfootnote) or familiar (footnoteX). +% \begin{macrocode} +\newmarks\parledgroup@ +\newmarks\parledgroup@series +\newmarks\parledgroup@type +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \begin{macro}{\parledgroup@notes@startL} +% \begin{macro}{\parledgroup@notes@startR} +% \cs{parledgroup@notes@startL} and \cs{parledgroup@notes@startR} are used to mark the beginning of a note series in a parallel ledgroup. +% \begin{macrocode} +\newcommand{\parledgroup@notes@startL}{% + \ifnum\usenamecount{l@dmaxlinesinpar\the\l@dpscL}>0% + \IfStrEq{\splitfirstmarks\parledgroup@type}{footnoteX}{\csuse{bhooknoteX@\splitfirstmarks\parledgroup@series}}{}% + \IfStrEq{\splitfirstmarks\parledgroup@type}{Xfootnote}{\csuse{bhookXnote@\splitfirstmarks\parledgroup@series}}{}% + \fi% + \global\ledgroupnotesL@true% + \insert@noterule@ledgroup{L}% +} +\newcommand{\parledgroup@notes@startR}{% + \ifnum\usenamecount{l@dmaxlinesinpar\the\l@dpscR}>0% + \IfStrEq{\splitfirstmarks\parledgroup@type}{footnoteX}{\csuse{bhooknoteX@\splitfirstmarks\parledgroup@series}}{}% + \IfStrEq{\splitfirstmarks\parledgroup@type}{Xfootnote}{\csuse{bhookXnote@\splitfirstmarks\parledgroup@series}}{}% + \fi% + \global\ledgroupnotesR@true% + \insert@noterule@ledgroup{R}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\parledgroup@notes@startL} +% \begin{macro}{\parledgroup@notes@startR} +% \cs{parledgroup@notes@endL} and \cs{parledgroup@notes@endR} are used to mark the end of a note series in a parallel ledgroup. +% \begin{macrocode} +\newcommand{\parledgroup@notes@endL}{% + \global\ledgroupnotesL@false% +} +\newcommand{\parledgroup@notes@endR}{% + \global\ledgroupnotesR@false% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\insert@noterule@ledgroup} +% A \cs{vskip} is not used when the boxes are constructed. So we insert it before ledgroup note series when parallel lines are constructed. +% This is the goal of \cs{insert@noterule@ledgroup} +% \begin{macrocode} +\newcommand{\insert@noterule@ledgroup}[1]{ + \IfStrEq{\splitbotmarks\parledgroup@}{begin}{% + \IfStrEq{\splitbotmarks\parledgroup@type}{Xfootnote}{ + \csuse{ifledgroupnotes#1@} + \vskip\skip\csuse{mp\splitbotmarks\parledgroup@series footins} + \csuse{\splitbotmarks\parledgroup@series footnoterule} + \fi + } + {} + \IfStrEq{\splitbotmarks\parledgroup@type}{footnoteX}{ + \csuse{ifledgroupnotes#1@} + \vskip\skip\csuse{mpfootins\splitbotmarks\parledgroup@series} + \csuse{footnoterule\splitbotmarks\parledgroup@series} + \fi + }{} + } + {} +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@parledgroupnotespacing} +% \cs{@parledgroupnotespacing} can be redefined by the user to change the interline spacing of ledgroup notes. +% \begin{macrocode} +\newcommand{\setparledgroupnotespacing}[1]{\gdef\@parledgroupnotespacing{#1}} +\newcommand{\@parledgroupnotespacing}{} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\parledgroup@notespacing@correction} +% \begin{macro}{\parledgroup@notespacing@set@correction} +% \cs{parledgroup@notespacing@correction} is the difference between a normal line skip and a line skip in a note. It is set by \cs{parledgroup@notespacing@set@correction}, called at the beginning of \cs{Pages}. +% \begin{macrocode} +\dimdef{\parledgroup@notespacing@correction}{0pt} +\newcommand{\parledgroup@notespacing@set@correction}{% + {\@getfirstseries\csuse{Xnotefontsize@\@firstseries}%We suppose all the series has the same footnote size setup + \@parledgroupnotespacing\dimgdef{\temp@spacing}{\baselineskip}}% + \dimgdef{\parledgroup@notespacing@correction}{\baselineskip-\temp@spacing}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\parledgroup@correction@notespacing@init} +% \cs{parledgroup@correction@notespacing@init} sets the value of accumulated corrections of note spacing to 0~pt. +% It is called at the beginning of each pages AND at the end of each ledgroup. +% \begin{macrocode} +\newcommand{\parledgroup@correction@notespacing@init}{ + \dimdef{\parledgroup@notespacing@correction@accumulated}{0pt} + \dimdef{\parledgroup@notespacing@correction@modulo}{0pt} +} +\parledgroup@correction@notespacing@init +% \end{macrocode} +% \end{macro} +% \begin{macro}{\parledgroup@correction@notespacing@final} +% \cs{parledgroup@correction@notespacing@final} adds the total space deleted because of correction for notes, in a parallel ledgroup. +% It also adds the space needed by the other side spaces between note rules and notes. It is called after the print of each pstart/pend. +% \begin{macrocode} +\newcommand{\parledgroup@correction@notespacing@final}[1]{ + \ifparledgroup + \vspace{\parledgroup@notespacing@correction@accumulated} + \parledgroup@correction@notespacing@init% + \ifstrequal{#1}{L}{ + \numdef{\@checking}{\the\l@dpscL-1} + }{ + \numdef{\@checking}{\the\l@dpscR-1} + } + \dimdef{\@beforenotes@current@diff}{\csuse{@parledgroup@beforenotes@\@checking L}-\csuse{@parledgroup@beforenotes@\@checking R}}% + \ifstrequal{#1}{L}% + {% Left + \ifdimgreater{\@beforenotes@current@diff}{0pt}{}{\vspace{-\@beforenotes@current@diff}}% + }% + {% Right + \ifdimgreater{\@beforenotes@current@diff}{0pt}{\vspace{\@beforenotes@current@diff}}{} + }% + \fi +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\parledgroup@correction@notespacing} +% \cs{parledgroup@correction@notespacing} is used before each printed line. +% If it is a line of notes in parallel ledgroup, the space \cs{parledgroup@notespacing@correction} is decreased, to make interline space correct. +% The decreased space is added to \cs{parledgroup@notespacing@correction@accumulated} and \cs{parledgroup@notespacing@correction@modulo}. +% If \cs{parledgroup@notespacing@correction@modulo} is equal or greater than \cs{baselineskip}: +% \begin{itemize} +% \item It is decreased by \cs{baselineskip}. +% \item The total of line number in the current page is decreased by one. +% \end{itemize} +% For example, suppose an normal interline of 24~pt and interline for note of 12~pt. +% 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. +% \begin{macrocode}{} +\newcommand{\parledgroup@correction@notespacing}[1]{% + \csuse{ifledgroupnotes#1@}% + \vspace{-\parledgroup@notespacing@correction}% + \dimdef{\parledgroup@notespacing@correction@accumulated}{\parledgroup@notespacing@correction@accumulated+\parledgroup@notespacing@correction}% + \dimdef{\parledgroup@notespacing@correction@modulo}{\parledgroup@notespacing@correction@modulo+\parledgroup@notespacing@correction}% + \ifdimless{\parledgroup@notespacing@correction@modulo}{\baselineskip}{}{\advance\numpagelinesL -\@ne% + \dimdef{\parledgroup@notespacing@correction@modulo}{\parledgroup@notespacing@correction@modulo-\baselineskip}% + }% mean greater than equal + \fi% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\parledgroup@beforenotesL} +% \begin{macro}{\parledgroup@beforenotesR} +% \cs{parledgroup@beforenotesL} and \cs{parledgroup@beforenotesR} store the total of space before notes in the current parallel ledgroup. +% \begin{macrocode} +\dimdef\parledgroup@beforenotesL{0pt} +\dimdef\parledgroup@beforenotesR{0pt} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\parledgroup@beforenotes@save} +% The macro \cs{parledgroup@beforenotes@save} dumps the space before notes of the current parallel ledgroup in a macro named with the current pstart number. +% \begin{macrocode} +\newcommand{\parledgroup@beforenotes@save}[1]{ + \ifparledgroup + \csdimgdef{@parledgroup@beforenotes@\the\csuse{l@dnumpstarts#1}#1}{\csuse{parledgroup@beforenotes#1}} + \csdimgdef{parledgroup@beforenotes#1}{0pt} + \fi +} +% \end{macrocode} +% \end{macro} + + +% \section{Compatibility with \eledmac} +% +% Here, we define some command for the \verb+eledmac-compat+ option. +% +% \begin{macrocode} +\ifeledmaccompat@% + + + \unless\ifnocritical@ + \let\onlyXside\Xonlyside + \fi +\fi +% \end{macrocode} +% \section{The End}\label{end} +% +% +%</code> +% +% \newpage +% \appendix +% \clearpage +% +% \let\oldthesection\thesection +% \renewcommand{\thesection}{Appendix \oldthesection} +% \section{Some things to do when changing version} +% \input{doc-include/migrate-par.dtx} +% \bibliographystyle{alpha} +% \begin{thebibliography}{WWW99} +% \addcontentsline{toc}{section}{References} +% \bibitem[LW90]{EDMACTUG} +% John Lavagnino and Dominik Wujastyk. +% \newblock `An overview of \edmac: a \textsc{Plain} TeX format for +% critical editions'. +% \newblock \emph{TUGboat}, \textbf{11}, 4, pp. 623--643, November 1990. +% \newblock (Code available from CTAN in +% \texttt{macros/plain/contrib/edmac}) +% +% +% \bibitem[Wil02]{MEMOIR} +% Peter Wilson. +% \newblock \emph{The \Lpack{memoir} class for configurable typesetting}. +% \newblock November 2002. +% \newblock (Available from CTAN in +% \texttt{macros/latex/contrib/memoir}) +% +% \bibitem[Wil04]{ELEDMAC} +% Peter Wilson and Maïeul Rouquette. +% \newblock \emph{\Lpack{eledmac} A presumptuous attempt to port +% \Lpack{EDMAC},\Lpack{TABMAC} and \Lpack{EDSTANZA} to +% LaTeX}. +% \newblock December 2004. +% \newblock (Available from CTAN in +% \texttt{macros/latex/contrib/eledmac}) +% +% \end{thebibliography} +% +% \Finale +% \phantomsection +% \addcontentsline{toc}{section}{Index} +% \PrintIndex +% +% \phantomsection +% \addcontentsline{toc}{section}{Change History} +% \PrintChanges +% \endinput +\endinput + +%% \CharacterTabl +%% 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 +%% 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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +%% diff --git a/Master/texmf-dist/source/latex/reledmac/reledpar.ins b/Master/texmf-dist/source/latex/reledmac/reledpar.ins new file mode 100644 index 00000000000..f280f1ec0e4 --- /dev/null +++ b/Master/texmf-dist/source/latex/reledmac/reledpar.ins @@ -0,0 +1,75 @@ +%% reledpar.ins +%% Author: Peter Wilson (Herries Press) herries dot press at earthlink dot net +%% Maintainer:Maïeul Rouquette maieul at maieul dot net +%% Copyright 2004, 2005 Peter R. Wilson +%% Copyright 2011- Maïeul Rouquette +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3 of this license or (at your option) any +%% later version. +%% The latest version of the license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2003/06/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% This work consists of the files listed in the README file. +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this work when run through +%% LaTeX. +%% +%% +%% --------------- start of docstrip commands ------------------ +%% +\def\batchfile{reledpar.ins} +\input docstrip.tex +\preamble + + Author: Author: Peter Wilson ; Herries Press herries dot press at earthlink dot net ; Maïeul Rouquette maieul at maieul dot net + Copyright 2004, 2005 Peter R. Wilson + 2011- Maïeul Rouquette + This work may be distributed and/or modified under the + conditions of the LaTeX Project Public License, either + version 1.3 of this license or (at your option) any + later version. + The latest version of the license is in + http://www.latex-project.org/lppl.txt + and version 1.3 or later is part of all distributions of + LaTeX version 2003/06/01 or later. + + This work has the LPPL maintenance status "maintained". + + This work consists of the files listed in the README file. + +\endpreamble + +\keepsilent + + +\Msg{*** Generating the LaTeX2e package files ***} + +\generateFile{reledpar.sty}{t}{\from{reledpar.dtx}{code}} + + +\Msg{***********************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* file(s) into a directory searched by LaTeX. See the FAQ on} +\Msg{* CTAN at /help/uk-tex-faq for more on this.} +\Msg{*} +\Msg{* \space\space reledpar.sty} +\Msg{*} +\Msg{*} +\Msg{* To produce the documentation run the files ending with} +\Msg{* `.dtx' through LaTeX.} +\Msg{* For an index, process any name.idx file by:} +\Msg{* \space\space\space\space makeindex -s gind.ist name} +\Msg{* For a list of changes, process any name.glo file by:} +\Msg{* \space\space\space\space makeindex -s gglo.ist -o name.gls name.glo} +\Msg{*} +\Msg{* Happy TeXing} +\Msg{***********************************************************} + +\endinput diff --git a/Master/texmf-dist/tex/latex/reledmac/reledmac.sty b/Master/texmf-dist/tex/latex/reledmac/reledmac.sty new file mode 100644 index 00000000000..8e879a1b9cf --- /dev/null +++ b/Master/texmf-dist/tex/latex/reledmac/reledmac.sty @@ -0,0 +1,6269 @@ +%% +%% This is file `reledmac.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% reledmac.dtx (with options: `code') +%% +%% Author: Author: Peter Wilson ; Herries Press herries dot press at earthlink dot net ; Maïeul Rouquette maieul at maieul dot net +%% Copyright 2004, 2005 Peter R. Wilson +%% 2011- Maïeul Rouquette +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3 of this license or (at your option) any +%% later version. +%% The latest version of the license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2003/06/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% This work consists of the files listed in the README file. + + + + + + + + + + + + + \newcommand{\numberit}{% + \refstepcounter{stanzanum}% + \flagstanza{\thestanzanum}% + } +%% + +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{reledmac}[2015/07/19 v2.0.0 typesset critical edition]% +\RequirePackage{xkeyval} +\newif\ifparledgroup +\DeclareOptionX{series}[A,B,C,D,E]{\xdef\default@series{#1}} +\ExecuteOptionsX{series}% + +\newif\if@noeled@sec% +\DeclareOptionX{noeledsec}{\@noeled@sectrue} + +\newif\ifnocritical@% +\DeclareOptionX{nocritical}{\nocritical@true}% + +\newif\ifnofamiliar@% +\DeclareOptionX{nofamiliar}{\nofamiliar@true}% + +\newif\ifnoledgroup@% +\DeclareOptionX{noledgroup}{\noledgroup@true}% + +\newif\ifnoend@% +\DeclareOptionX{noend}{% + \let\l@dend@open\@gobble% + \let\l@dend@close\relax% + \global\let\l@dend@stuff=\relax% + \noend@true% +}% + +\newif\ifnoquotation@ +\DeclareOptionX{noquotation}{\noquotation@true} + +\newif\ifledfinal +\DeclareOptionX{final}{\ledfinaltrue} +\DeclareOptionX{draft}{\ledfinalfalse} +\ExecuteOptionsX{final} + +\newif\ifparapparatus@ +\DeclareOptionX{parapparatus}{\parapparatus@true} + +\newif\iflednopbinverse +\DeclareOptionX{nopbinverse}{\lednopbinversetrue} + +\newif\ifwidthliketwocolumns% +\DeclareOptionX{widthliketwocolumns}{\widthliketwocolumnstrue}% + +\newif\ifxindy@ +\DeclareOptionX{xindy}[eledmac-markup-attr.xdy]{% + \AtBeginDocument{\immediate\openout\eledmac@xindy@out=#1}% + \newwrite\eledmac@xindy@out% + \xindy@true% + \gdef\eledmacmarkuplocrefdepth{:depth 1}% + \AtEndDocument{\immediate\closeout\eledmac@xindy@out}% +}% + +\newif\ifxindyhyperref@ +\DeclareOptionX{xindy+hyperref}{% + \xindyhyperref@true% +}% + +\newif\ifeledmaccompat@% +\DeclareOptionX{eledmac-compat}{% + \eledmaccompat@true% +}% +\ProcessOptionsX*\relax + +\RequirePackage{xargs} +\RequirePackage{etoolbox} +\RequirePackage{etex} +\reserveinserts{32} +\RequirePackage{suffix} +\RequirePackage{xstring} +\RequirePackage{ifluatex} +\RequirePackage{ragged2e} +\RequirePackage{ragged2e} +\RequirePackage{ifxetex}% +\newif\ifl@dmemoir +\@ifclassloaded{memoir}{\l@dmemoirtrue}{\l@dmemoirfalse} + +\newif\ifl@imakeidx +\@ifpackageloaded{imakeidx}{\l@imakeidxtrue}{}%False is the default value +\newif\ifl@indextools% +\@ifpackageloaded{indextools}{% + \l@indextoolstrue% + \l@imakeidxtrue% + \let\imki@wrindexentry\indtl@wrindexentry% + }{}% +\ifdef{\if@RTL}{}{\newif\if@RTL} +\newcommand{\reledmac@warning}[1]{\PackageWarning{reledmac}{#1}} +\newcommand{\reledmac@error}[2]{\PackageError{reledmac}{#1}{#2}} +\newcommand*{\led@err@NumberingStarted}{% + \reledmac@error{Numbering has already been started}{\@ehc}} +\newcommand*{\led@err@NumberingNotStarted}{% + \reledmac@error{Numbering was not started}{\@ehc}} +\newcommand*{\led@err@NumberingShouldHaveStarted}{% + \reledmac@error{Numbering should already have been started}{\@ehc}} +\newcommand*{\led@err@edtextoutsidepstart}{% + \reledmac@error{\string\edtext\space outside numbered paragraph (\pstart\ldots\pend)}{\@ehc}}% +\newcommand*{\led@mess@NotesChanged}{% + \typeout{reledmac reminder: }% + \typeout{ The number of the footnotes in this section + has changed since the last run.}% + \typeout{ You will need to run LaTeX two more times + before the footnote placement}% + \typeout{ and line numbering in this section are + correct.}} +\newcommand*{\led@mess@SectionContinued}[1]{% + \message{Section #1 (continuing the previous section)}} +\newcommand*{\led@err@LineationInNumbered}{% + \reledmac@error{You can't use \string\lineation\space within + a numbered section}{\@ehc}} +\newcommand*{\led@warn@BadLineation}{% + \reledmac@warning{Bad \string\lineation\space argument}} +\newcommand*{\led@warn@BadLinenummargin}{% + \reledmac@warning{Bad \string\linenummargin\space argument}} +\newcommand*{\led@warn@BadLockdisp}{% + \reledmac@warning{Bad \string\lockdisp\space argument}} +\newcommand*{\led@warn@BadSublockdisp}{% + \reledmac@warning{Bad \string\sublockdisp\space argument}} +\newcommand*{\led@warn@NoLineFile}[1]{% + \reledmac@warning{Can't find line-list file #1}} +\newcommand*{\led@warn@Obsolete}[1]{% + \reledmac@warning{Line-list file #1 was obsolete. We have not read it. Please run LaTeX again.}} +\newcommand*{\led@warn@BadAdvancelineSubline}{% + \reledmac@warning{\string\advanceline\space produced a sub-line + number less than zero.}} +\newcommand*{\led@warn@BadAdvancelineLine}{% + \reledmac@warning{\string\advanceline\space produced a line + number less than zero.}} +\newcommand*{\led@warn@BadSetline}{% + \reledmac@warning{Bad \string\setline\space argument}} +\newcommand*{\led@warn@BadSetlinenum}{% + \reledmac@warning{Bad \string\setlinenum\space argument}} +\newcommand*{\led@err@PstartNotNumbered}{% + \reledmac@error{\string\pstart\space must be used within a + numbered section}{\@ehc}} +\newcommand*{\led@err@PstartInPstart}{% + \reledmac@error{\string\pstart\space encountered while another + \string\pstart\space was in effect}{\@ehc}} +\newcommand*{\led@err@PendNotNumbered}{% + \reledmac@error{\string\pend\space must be used within a + numbered section}{\@ehc}} +\newcommand*{\led@err@PendNoPstart}{% + \reledmac@error{\string\pend\space must follow a \string\pstart}{\@ehc}} +\newcommand*{\led@err@AutoparNotNumbered}{% + \reledmac@error{\string\autopar\space must be used within a + numbered section}{\@ehc}} +\newcommand*{\led@err@NumberingWithoutPstart}{% + \reledmac@error{\string\beginnumbering...\string\endnumbering\space without \string\pstart}{\@ehc}}% +\newcommand*{\led@warn@BadAction}{% + \reledmac@warning{Bad action code, value \next@action.}} +\newcommand*{\led@warn@DuplicateLabel}[1]{% + \reledmac@warning{Duplicate definition of label `#1' on page \the\pageno.}} +\newcommand*{\led@warn@AppLabelOutEdtext}[1]{% + \reledmac@warning{\string\applabel\space outside of \string\edtext\space `#1' on page \the\pageno.}}% +\newcommand*{\led@warn@RefUndefined}[1]{% + \reledmac@warning{Reference `#1' on page \the\pageno\space undefined. + Using `000'.}} +\newcommand*{\led@warn@NoMarginpars}{% + \reledmac@warning{You can't use \string\marginpar\space in numbered text}} +\newcommand*{\led@warn@BadSidenotemargin}{% + \reledmac@warning{Bad \string\sidenotemmargin\space argument}} +\newcommand*{\led@warn@NoIndexFile}[1]{% + \reledmac@warning{Undefined index file #1}} +\newcommand{\led@warn@SeriesStillExist}[1]{% + \reledmac@warning{Series #1 is still existing !}% +}% +\newcommand{\led@err@ManySidenotes}{% + \ifledRcol@% + \reledmac@warning{\itemcount@\space sidenotes on line \the\line@numR\space p. \the\page@numR}% + \else% + \reledmac@warning{\itemcount@\space sidenotes on line \the\line@num\space p. \the\page@num}% + \fi% +}% +\newcommand{\led@err@ManyLeftnotes}{% + \ifledRcol@% + \reledmac@warning{\itemcount@\space leftnotes on line \the\line@numR\space p. \the\page@numR}% + \else% + \reledmac@warning{\itemcount@\space leftnotes on line \the\line@num\space p. \the\page@num}% + \fi% +}% +\newcommand{\led@err@ManyRightnotes}{% + \ifledRcol@% + \reledmac@warning{\itemcount@\space rightnotes on line \the\line@numR\space p. \the\page@numR}% + \else% + \reledmac@warning{\itemcount@\space rightnotes on line \the\line@num\space p. \the\page@num}% + \fi% +}% +\newcommand*{\led@err@TooManyColumns}{% + \reledmac@error{Too many columns}{\@ehc}} +\newcommand*{\led@err@UnequalColumns}{% + \reledmac@error{Number of columns is not equal to the number + in the previous row (or \protect\\ \space forgotten?)}{\@ehc}} +\newcommand*{\led@err@LowStartColumn}{% + \reledmac@error{Start column is too low}{\@ehc}} +\newcommand*{\led@err@HighEndColumn}{% + \reledmac@error{End column is too high}{\@ehc}} +\newcommand*{\led@err@ReverseColumns}{% + \reledmac@error{Start column is greater than end column}{\@ehc}} +\newcommand{\led@err@EdtextWithoutFootnote}{% + \reledmac@error{edtext without Xfootnote. Check syntaxis.}{\@ehc}% +}% +\newcommand{\led@err@FootnoteWithoutEdtext}{% + \reledmac@error{Xfootnote without edtext. Check syntax.}{\@ehc}% +}% +\newcommand{\led@error@ImakeidxAfterEledmac}{% + \reledmac@error{Imakeidx must be loaded before eledmac.}{\@ehc}% +}% +\newcommand{\led@error@IndextoolsAfterEledmac}{% + \reledmac@error{Indextools must be loaded before eledmac.}{\@ehc}% +}% +\newcommand{\led@error@fail@patch@@makecol}{% + \reledmac@error{Fail to patch \string\@makecol\space command.}{\@ehc}% +}% +\newcommand{\led@error@fail@patch@@reinserts}{% + \reledmac@error{Fail to patch \string\@reinserts\space command.}{\@ehc}% +}% +\newcommand{\led@error@fail@patch@@doclearpage}{% + \reledmac@error{Fail to patch \string\@doclearpage\space command.}{\@ehc}% +}% +\newcommand{\led@error@fail@patch@@iiiminipage}{% + \reledmac@error{Fail to patch \string\@iiiminipage\space command.}{\@ehc}% +}% +\newcommand{\led@error@fail@patch@endminipage}{% + \reledmac@error{Fail to patch \string\endminipage\space command.}{\@ehc}% +}% +\providecommand*{\@gobblethree}[3]{} +\providecommand*{\@gobblefour}[4]{} +\providecommand*{\@gobblefive}[5]{} +\ifledfinal + \newcommand*{\showlemma}[1]{#1} +\else + \newcommand*{\showlemma}[1]{\underline{#1}} +\fi + +\let\linenumberlist=\empty + +\newcount\@l@dtempcnta \newcount\@l@dtempcntb +\newif\ifl@dpairing +\newif\ifl@dpaging% +\newif\ifl@dprintingpages% +\newif\ifl@dprintingcolumns% +\newif\ifpst@rtedL +\newcount\l@dnumpstartsL +\newif\ifledRcol +\newif\ifledRcol@ +\newif\ifnumberingR +\newcount\section@num +\section@num=0 +\let\extensionchars=\empty +\newif\ifnumbering +\newcommand*{\beginnumbering}{% + \ifnumbering + \led@err@NumberingStarted + \endnumbering + \fi + \global\numberingtrue + \global\advance\section@num \@ne + \initnumbering@reg + \message{Section \the\section@num }% + \line@list@stuff{\jobname.\extensionchars\the\section@num}% + \l@dend@stuff + \setcounter{pstart}{1} + \ifl@dpairing + \global\l@dnumpstartsL \z@ + \global\pst@rtedLfalse + \else + \begingroup + \global\@afterindenttrue%In order to retablish normal feature if the \begingroup was not here + \initnumbering@quote + \ifwidthliketwocolumns% + \csuse{setwidthliketwocolumns@\columns@position}% + \csuse{setpositionliketwocolumns@\columns@position}% + \fi% + \fi + \gdef\eled@sections@@{}% + \if@noeled@sec\else% + \makeatletter\InputIfFileExists{\jobname.eledsec\the\section@num}{}{}\makeatother% + \immediate\openout\eled@sectioning@out=\jobname.eledsec\the\section@num\relax% + \fi% +} +\newcommand*{\initnumbering@reg}{% + \global\pst@rtedLfalse + \global\l@dnumpstartsL \z@ + \global\absline@num \z@ + \gdef\normal@page@break{} + \gdef\l@prev@pb{} + \gdef\l@prev@nopb{} + \global\line@num \z@ + \global\subline@num \z@ + \global\@lock \z@ + \global\sub@lock \z@ + \global\sublines@false + \global\let\next@page@num=\relax + \global\let\sub@change=\relax + \resetprevline@ + \resetprevpage@num + } + +\def\endnumbering{% + \ifnumbering + \global\numberingfalse + \normal@pars + \ifnum\l@dnumpstartsL=0% + \led@err@NumberingWithoutPstart% + \fi% + \ifl@dpairing + \global\pst@rtedLfalse + \else + \ifx\insertlines@list\empty\else + \global\noteschanged@true + \fi + \ifx\line@list\empty\else + \global\noteschanged@true + \fi + \fi + \ifnoteschanged@ + \led@mess@NotesChanged + \fi + \else + \led@err@NumberingNotStarted + \fi + \autoparfalse + \if@noeled@sec\else% + \immediate\closeout\eled@sectioning@out% + \fi% + \ifl@dpairing\else + \global\l@dnumpstartsL=\z@% + \endgroup + \fi +} +\newcommand{\pausenumbering}{% + \ifautopar\global\autopar@pausetrue\fi% + \endnumbering\global\numberingtrue} +\newcommand*{\resumenumbering}{% + \ifnumbering + \ifautopar@pause\autopar\fi + \global\pst@rtedLtrue + \global\advance\section@num \@ne + \led@mess@SectionContinued{\the\section@num}% + \line@list@stuff{\jobname.\extensionchars\the\section@num}% + \l@dend@stuff + \ifl@dpairing\else% + \begingroup% + \initnumbering@quote% + \ifwidthliketwocolumns% + \csuse{setwidthliketwocolumns@\columns@position}% + \csuse{setpositionliketwocolumns@\columns@position}% + \fi% + \fi% + \else + \led@err@NumberingShouldHaveStarted + \endnumbering + \beginnumbering + \fi} + +\newcommand*{\list@create}[1]{% + \global\let#1=\empty% +}% +\newcommand*{\list@clear}[1]{% + \global\let#1=\empty% +} +\newtoks\led@toksa \newtoks\led@toksb +\global\led@toksa={\\} +\long\def\xright@appenditem#1\to#2{% + \global\led@toksb=\expandafter{#2}% + \xdef#2{\the\led@toksb\the\led@toksa\expandafter{#1}}% + \global\led@toksb={}} +\long\def\xleft@appenditem#1\to#2{% + \global\led@toksb=\expandafter{#2}% + \xdef#2{\the\led@toksa\expandafter{#1}\the\led@toksb}% + \global\led@toksb={}} +\def\gl@p#1\to#2{\expandafter\gl@poff#1\gl@poff#1#2} +\long\def\gl@poff\\#1#2\gl@poff#3#4{\gdef#4{#1}\gdef#3{#2}} + +\newif\ifbypage@ +\newif\ifbypstart@ +\newif\ifbypage@R +\newif\ifbypstart@R +\newcommand*{\lineation}[1]{{ + \ifnumbering + \led@err@LineationInNumbered + \else + \def\@tempa{#1}\def\@tempb{page}% + \ifx\@tempa\@tempb + \global\bypage@true + \global\bypstart@false + \unless\ifnocritical@% + \Xpstart[][false]% + \fi% + \else + \def\@tempb{pstart}% + \ifx\@tempa\@tempb + \global\bypage@false + \global\bypstart@true + \unless\ifnocritical@% + \Xpstart% + \fi% + \else + \def\@tempb{section} + \ifx\@tempa\@tempb + \global\bypage@false + \global\bypstart@false + \unless\ifnocritical@% + \Xpstart[][false]% + \fi% + \else + \led@warn@BadLineation + \fi + \fi + \fi + \fi}} +\newcount\line@margin + +\newcommand*{\linenummargin}[1]{{% + \l@dgetline@margin{#1}% + \ifnum\@l@dtempcntb>\m@ne + \ifledRcol + \global\line@marginR=\@l@dtempcntb + \else + \global\line@margin=\@l@dtempcntb + \fi + \fi}} + +\newcommand*{\l@dgetline@margin}[1]{% + \def\@tempa{#1}\def\@tempb{left}% + \ifx\@tempa\@tempb + \@l@dtempcntb \z@ + \else + \def\@tempb{right}% + \ifx\@tempa\@tempb + \@l@dtempcntb \@ne + \else + \def\@tempb{outer}% + \ifx\@tempa\@tempb + \@l@dtempcntb \tw@ + \else + \def\@tempb{inner}% + \ifx\@tempa\@tempb + \@l@dtempcntb \thr@@ + \else + \led@warn@BadLinenummargin + \@l@dtempcntb \m@ne + \fi + \fi + \fi + \fi} + +\newcounter{firstlinenum} + \setcounter{firstlinenum}{5} +\newcounter{linenumincrement} + \setcounter{linenumincrement}{5} +\newcounter{firstsublinenum} + \setcounter{firstsublinenum}{5} +\newcounter{sublinenumincrement} + \setcounter{sublinenumincrement}{5} + + +\newcommand*{\firstlinenum}[1]{% + \ifledRcol% + \setcounter{firstlinenumR}{#1}% + \else% + \setcounter{firstlinenum}{#1}% + \fi% +} +\newcommand*{\linenumincrement}[1]{% + \ifledRcol% + \setcounter{linenumincrementR}{#1}% + \else% + \setcounter{linenumincrement}{#1}% + \fi% +} +\newcommand*{\firstsublinenum}[1]{% + \ifledRcol% + \setcounter{firstsublinenumR}{#1}% + \else% + \setcounter{firstsublinenum}{#1}% + \fi% +} +\newcommand*{\sublinenumincrement}[1]{% + \ifledRcol% + \setcounter{sublinenumincrementR}{#1}% + \else% + \setcounter{sublinenumincrement}{#1}% + \fi% +} + +\newcount\lock@disp +\newcommand{\lockdisp}[1]{{% + \l@dgetlock@disp{#1}% + \ifnum\@l@dtempcntb>\m@ne + \global\lock@disp=\@l@dtempcntb + \else + \led@warn@BadLockdisp + \fi}} +\newcommand*{\l@dgetlock@disp}[1]{ + \def\@tempa{#1}\def\@tempb{first}% + \ifx\@tempa\@tempb + \@l@dtempcntb \z@ + \else + \def\@tempb{last}% + \ifx\@tempa\@tempb + \@l@dtempcntb \@ne + \else + \def\@tempb{all}% + \ifx\@tempa\@tempb + \@l@dtempcntb \tw@ + \else + \@l@dtempcntb \m@ne + \fi + \fi + \fi} + +\newcount\sublock@disp +\newcommand{\sublockdisp}[1]{{% + \l@dgetlock@disp{#1}% + \ifnum\@l@dtempcntb>\m@ne + \global\sublock@disp=\@l@dtempcntb + \else + \led@warn@BadSublockdisp + \fi}} + +\newcommand*{\linenumberstyle}[1]{% + \def\linenumrep##1{\@nameuse{@#1}{##1}}} +\newcommand*{\sublinenumberstyle}[1]{% + \def\sublinenumrep##1{\@nameuse{@#1}{##1}}} +\linenumberstyle{arabic} + \let\linenumr@p\linenumrep +\sublinenumberstyle{arabic} + \let\sublinenumr@p\sublinenumrep + +\newlength{\linenumsep} + \setlength{\linenumsep}{1pc} +\newcommand*{\numlabfont}{\normalfont\scriptsize} +\newcommand*{\ledlinenum}{% + \bgroup% + \ifluatex% + \luatextextdir TLT% + \fi% + \numlabfont\linenumrep{\line@num}% + \ifsublines@ + \ifnum\subline@num>0\relax + \unskip\fullstop\sublinenumrep{\subline@num}% + \fi + \fi% + \egroup% +}% + +\newcommand*{\leftlinenum}{% + \ledlinenum + \kern\linenumsep} +\newcommand*{\rightlinenum}{% + \kern\linenumsep + \ledlinenum} + +\newcount\line@num +\newcount\subline@num +\newif\ifsublines@ +\newcount\absline@num +\newcount\@lock +\newcount\sub@lock +\list@create{\line@list} +\list@create{\insertlines@list} +\list@create{\actionlines@list} +\list@create{\actions@list} + +\newcount\page@num +\newcount\endpage@num +\newcount\endline@num +\newcount\endsubline@num +\newif\ifnoteschanged@ +\newcommand*{\resetprevline@}{% + \def\do##1{\global\csundef{prevline##1}}% + \dolistloop{\@series}% +} +\newcommand*{\resetprevpage@num}{% + \def\do##1{\ifcsdef{prevpage##1@num}{\global\csname prevpage##1@num\endcsname=0}{}}% + \dolistloop{\@series}% +} +\newread\@inputcheck +\newcommand*{\read@linelist}[1]{% + \ifledRcol% + \list@clearing@regR% + \else% + \list@clearing@reg% + \fi% + \list@clear{\maxlinesinpar@list} + \get@linelistfile{#1}% + \endgroup + \ifledRcol + \global\page@numR=\m@ne + \ifx\actionlines@listR\empty + \gdef\next@actionlineR{1000000}% + \else + \gl@p\actionlines@listR\to\next@actionlineR + \gl@p\actions@listR\to\next@actionR + \fi + \else + \global\page@num=\m@ne + \ifx\actionlines@list\empty + \gdef\next@actionline{1000000}% + \else + \gl@p\actionlines@list\to\next@actionline + \gl@p\actions@list\to\next@action + \fi + \fi +} +\newcommand*{\list@clearing@reg}{% + \list@clear{\line@list}% + \list@clear{\insertlines@list}% + \list@clear{\actionlines@list}% + \list@clear{\actions@list}% + \list@clear{\linesinpar@listL}% + \list@clear{\linesonpage@listL}% + }% +\newcommand*{\get@linelistfile}[1]{% + \InputIfFileExists{#1}{% + \global\noteschanged@false + \begingroup + \catcode`\[=1 \catcode`\]=2 + \makeatletter \catcode`\^^M=9}{% + \led@warn@NoLineFile{#1}% + \global\noteschanged@true + \begingroup}% +} + +\newcommand{\line@list@version}[1]{% + \IfStrEq{#1}{\this@line@list@version}% + {}% + {\ifledRcol% + \led@warn@Obsolete{\jobname.\extensionchars\the\section@num}% + \else% + \led@warn@Obsolete{\jobname.\extensionchars\the\section@num}% + \fi% + \endinput% + }% +}% + +\newcommand*{\@nl}[2]{% + \fix@page{#1}% + \ifledRcol% + \@nl@regR% + \else% + \@nl@reg% + \fi% +} +\newcommand*{\@nl@reg}{% + \ifx\l@dchset@num\relax \else + \advance\absline@num \@ne + \set@line@action + \let\l@dchset@num=\relax + \advance\absline@num \m@ne + \advance\line@num \m@ne + \fi + \advance\absline@num \@ne + \ifx\next@page@num\relax \else + \page@action + \let\next@page@num=\relax + \fi + \ifx\sub@change\relax \else + \ifnum\sub@change>\z@ + \sublines@true + \else + \sublines@false + \fi + \sub@action + \let\sub@change=\relax + \fi + \ifcase\@lock + \or + \@lock \tw@ + \or \or + \@lock \z@ + \fi + \ifcase\sub@lock + \or + \sub@lock \tw@ + \or \or + \sub@lock \z@ + \fi + \ifsublines@ + \ifnum\sub@lock<\tw@ + \advance\subline@num \@ne + \fi + \else + \ifnum\@lock<\tw@ + \advance\line@num \@ne \subline@num \z@ + \fi + \fi} + +\newcount\last@page@num + \last@page@num=-10000 + +\newcommand*{\fix@page}[1]{% + \ifledRcol + \ifnum #1=\last@page@numR + \else + \ifbypage@R + \line@numR \z@ \subline@numR \z@ + \fi + \page@numR=#1\relax + \last@page@numR=#1\relax + \def\next@page@numR{#1}% + \fi + \else + \ifnum #1=\last@page@num + \else + \ifbypage@ + \line@num \z@ \subline@num \z@ + \fi + \page@num=#1\relax + \last@page@num=#1\relax + \def\next@page@num{#1}% + \listxadd{\normal@page@break}{\the\absline@num} + \fi + \fi} +\newcommand*{\@pend}[1]{} +\newcommand*{\@pendR}[1]{} +\newcommand*{\@lopL}[1]{} +\newcommand*{\@lopR}[1]{} + +\newcommand*{\sub@on}{\ifsublines@ + \let\sub@change=\relax + \else + \def\sub@change{1}% + \fi} +\newcommand*{\sub@off}{\ifsublines@ + \def\sub@change{-1}% + \else + \let\sub@change=\relax + \fi} + + +\newcommand*{\@adv}[1]{% + \ifsublines@ + \ifledRcol + \advance\subline@numR by #1\relax + \ifnum\subline@numR<\z@ + \led@warn@BadAdvancelineSubline + \subline@numR \z@ + \fi + \else + \advance\subline@num by #1\relax + \ifnum\subline@num<\z@ + \led@warn@BadAdvancelineSubline + \subline@num \z@ + \fi + \fi + \else + \ifledRcol + \advance\line@numR by #1\relax + \ifnum\line@numR<\z@ + \led@warn@BadAdvancelineLine + \line@numR \z@ + \fi + \else + \advance\line@num by #1\relax + \ifnum\line@num<\z@ + \led@warn@BadAdvancelineLine + \line@num \z@ + \fi + \fi + \fi + \set@line@action} + + +\newcommand*{\@set}[1]{% + \ifledRcol + \ifsublines@ + \subline@numR=#1\relax + \else + \line@numR=#1\relax + \fi + \set@line@action + \else + \ifsublines@ + \subline@num=#1\relax + \else + \line@num=#1\relax + \fi + \set@line@action + \fi} + + +\newcommand*{\l@d@set}[1]{% + \ifledRcol + \line@numR=#1\relax + \advance\line@numR \@ne + \def\l@dchset@num{#1} + \else + \line@num=#1\relax + \advance\line@num \@ne + \def\l@dchset@num{#1} + \fi} +\let\l@dchset@num\relax + + + +\newcommand*{\page@action}{% + \ifledRcol + \xright@appenditem{\the\absline@numR}\to\actionlines@listR + \xright@appenditem{\next@page@numR}\to\actions@listR + \else + \xright@appenditem{\the\absline@num}\to\actionlines@list + \xright@appenditem{\next@page@num}\to\actions@list + \fi} + +\newcommand*{\set@line@action}{% + \ifledRcol + \xright@appenditem{\the\absline@numR}\to\actionlines@listR + \ifsublines@ + \@l@dtempcnta=-\subline@numR + \else + \@l@dtempcnta=-\line@numR + \fi + \advance\@l@dtempcnta by -5000\relax + \xright@appenditem{\the\@l@dtempcnta}\to\actions@listR + \else + \xright@appenditem{\the\absline@num}\to\actionlines@list + \ifsublines@ + \@l@dtempcnta=-\subline@num + \else + \@l@dtempcnta=-\line@num + \fi + \advance\@l@dtempcnta by -5000\relax + \xright@appenditem{\the\@l@dtempcnta}\to\actions@list + \fi} + +\newcommand*{\sub@action}{% + \ifledRcol + \xright@appenditem{\the\absline@numR}\to\actionlines@listR + \ifsublines@ + \xright@appenditem{-1001}\to\actions@listR + \else + \xright@appenditem{-1002}\to\actions@listR + \fi + \else + \xright@appenditem{\the\absline@num}\to\actionlines@list + \ifsublines@ + \xright@appenditem{-1001}\to\actions@list + \else + \xright@appenditem{-1002}\to\actions@list + \fi + \fi} +\newcommand*{\lock@on}{\futurelet\next\do@lockon} + +\newcommand*{\do@lockon}{% + \ifx\next\lock@off + \global\let\lock@off=\skip@lockoff + \else + \ifledRcol + \do@lockonR + \else + \do@lockonL + \fi + \fi} + +\newcommand*{\do@lockonL}{% + \xright@appenditem{\the\absline@num}\to\actionlines@list + \ifsublines@ + \xright@appenditem{-1005}\to\actions@list + \ifnum\sub@lock=\z@ + \sub@lock \@ne + \else + \ifnum\sub@lock=\thr@@ + \sub@lock \@ne + \fi + \fi + \else + \xright@appenditem{-1003}\to\actions@list + \ifnum\@lock=\z@ + \@lock \@ne + \else + \ifnum\@lock=\thr@@ + \@lock \@ne + \fi + \fi + \fi} + +\newcommand*{\do@lockoffL}{% + \xright@appenditem{\the\absline@num}\to\actionlines@list + \ifsublines@ + \xright@appenditem{-1006}\to\actions@list + \ifnum\sub@lock=\tw@ + \sub@lock \thr@@ + \else + \sub@lock \z@ + \fi + \else + \xright@appenditem{-1004}\to\actions@list + \ifnum\@lock=\tw@ + \@lock \thr@@ + \else + \@lock \z@ + \fi + \fi} + +\newcommand*{\do@lockoff}{% + \ifledRcol + \do@lockoffR + \else + \do@lockoffL + \fi} +\newcommand*{\skip@lockoff}{\global\let\lock@off=\do@lockoff} +\global\let\lock@off=\do@lockoff + +\newcommand*{\n@num}{% + \ifledRcol% + \xright@appenditem{\the\absline@numR}\to\actionlines@listR + \xright@appenditem{-1007}\to\actions@listR + \else% + \xright@appenditem{\the\absline@num}\to\actionlines@list% + \xright@appenditem{-1007}\to\actions@list% + \fi% +}% + +\newcommand*{\n@num@stanza}{% + \ifledRcol% + \xright@appenditem{\the\absline@numR}\to\actionlines@listR% + \xright@appenditem{-1008}\to\actions@listR% + \else% + \xright@appenditem{\the\absline@num}\to\actionlines@list%% + \xright@appenditem{-1008}\to\actions@list% + \fi% +} +\newif\ifl@dhidenumber +\newcommand*{\hidenumbering}{ + \ifledRcol% + \write\linenum@outR{\string\hide@num}% + \else% + \write\linenum@out{\string\hide@num}% + \fi% +}% +\newcommand*{\hide@num}{% + \ifledRcol% + \xright@appenditem{\the\absline@numR}\to\actionlines@listR% + \xright@appenditem{-1009}\to\actions@listR% + \else% + \xright@appenditem{\the\absline@num}\to\actionlines@list%% + \xright@appenditem{-1009}\to\actions@list% + \fi% +} +\newcount\insert@count +\newcommand*{\dummy@ref}[2]{#2} +\newcommand*{\@ref}[2]{% + \ifledRcol% + \@ref@regR{#1}{#2}% + \else% + \@ref@reg{#1}{#2}% + \fi% +}% +\newcommand*{\@ref@reg}[2]{% + \global\insert@count=#1\relax + \global\advance\@edtext@level by 1% + \loop\ifnum\insert@count>\z@ + \xright@appenditem{\the\absline@num}\to\insertlines@list + \global\advance\insert@count \m@ne + \repeat + \begingroup + \let\@ref=\dummy@ref + \let\@lopL\@gobble + \let\page@action=\relax + \let\sub@action=\relax + \let\set@line@action=\relax + \let\@lab=\relax + \let\@lemma=\relax% + \let\@sw\@gobblethree% + #2 + \global\endpage@num=\page@num + \global\endline@num=\line@num + \global\endsubline@num=\subline@num + \endgroup + \xright@appenditem% + {\the\page@num|\the\line@num|% + \ifsublines@ \the\subline@num \else 0\fi|% + \the\endpage@num|\the\endline@num|% + \ifsublines@ \the\endsubline@num \else 0\fi}\to\line@list + \expandafter\list@create\expandafter{\csname sw@list@edtext@tmp@\the\@edtext@level\endcsname}% + \providebool{lemmacommand@\the\@edtext@level}% + \boolfalse{lemmacommand@\the\@edtext@level}% + #2% + \ifnum\@edtext@level>0% + \def\create@this@edtext@level{\expandafter\list@create\expandafter{\csname sw@list@edtext@\the\@edtext@level\endcsname}}% + \ifcsundef{sw@list@edtext@\the\@edtext@level}{\create@this@edtext@level}{}% + \letcs{\@tmp}{sw@list@edtext@\the\@edtext@level}% + \letcs{\@tmpp}{sw@list@edtext@tmp@\the\@edtext@level} + \xright@appenditem{\expandonce\@tmpp}\to\@tmp% + \global\cslet{sw@list@edtext@\the\@edtext@level}{\@tmp}% + \fi% + \global\advance\@edtext@level by -1% +} + +\newwrite\linenum@out +\newif\iffirst@linenum@out@ + \first@linenum@out@true +\newcommand{\this@line@list@version}{2}% +\newcommand*{\line@list@stuff}[1]{% + \read@linelist{#1}% + \iffirst@linenum@out@ + \immediate\closeout\linenum@out% + \global\first@linenum@out@false% + \immediate\openout\linenum@out=#1\relax% + \immediate\write\linenum@out{\string\line@list@version{\this@line@list@version}}% + \else + \if@minipage% + \leavevmode% + \fi% + \closeout\linenum@out% + \openout\linenum@out=#1\relax% + \fi} + +\newcommand*{\new@line}{% + \IfStrEq{\led@pb@setting}{after}% + {\xifinlist{\the\absline@num}{\l@prev@nopb}% + {\xifinlist{\the\absline@num}{\normal@page@break}% + {\numgdef{\@next@page}{\c@page+1}% + \write\linenum@out{\string\@nl[\@next@page][\@next@page]}% + }% + {\write\linenum@out{\string\@nl[\the\c@page][\thepage]}}% + }% + {\write\linenum@out{\string\@nl[\the\c@page][\thepage]}}}% + {}% + \IfStrEq{\led@pb@setting}{before}% + {\numdef{\next@absline}{\the\absline@num+1}% + \xifinlist{\next@absline}{\l@prev@nopb}% + {\xifinlist{\the\absline@num}{\normal@page@break}% + {\numgdef{\nc@page}{\c@page+1}% + \write\linenum@out{\string\@nl[\nc@page][\nc@page]}% + }% + {\write\linenum@out{\string\n@l[\the\c@page][\thepage]}}% + }% + {\write\linenum@out{\string\@nl[\the\c@page][\thepage]}}% + }% + {}% + \IfStrEqCase{\led@pb@setting}{{before}{\relax}{after}{\relax}}[\write\linenum@out{\string\@nl[\the\c@page][\thepage]}]% +} + +\newif\if@noneed@Footnote% + +\newcommand*{\flag@start}{% + \ifledRcol% + \edef\next{\write\linenum@outR{% + \string\@ref[\the\insert@countR][}}% + \next% + \ifnum\insert@countR<1% + \if@noneed@Footnote\else% + \led@err@EdtextWithoutFootnote% + \fi% + \fi% + \else% + \edef\next{\write\linenum@out{% + \string\@ref[\the\insert@count][}}% + \next% + \ifnum\insert@count<1% + \if@noneed@Footnote\else% + \led@err@EdtextWithoutFootnote% + \fi% + \fi% + \fi}% + + +\newcommand*{\startsub}{\dimen0\lastskip + \ifdim\dimen0>0pt \unskip \fi + \ifledRcol \write\linenum@outR{\string\sub@on}% + \else \write\linenum@out{\string\sub@on}% + \fi + \ifdim\dimen0>0pt \hskip\dimen0 \fi} +\def\endsub{\dimen0\lastskip + \ifdim\dimen0>0pt \unskip \fi + \ifledRcol \write\linenum@outR{\string\sub@off}% + \else \write\linenum@out{\string\sub@off}% + \fi + \ifdim\dimen0>0pt \hskip\dimen0 \fi} + +\newcommand*{\advanceline}[1]{% + \ifledRcol \write\linenum@outR{\string\@adv[#1]}% + \else \write\linenum@out{\string\@adv[#1]}% + \fi% +} + +\newcommand*{\setline}[1]{% + \ifnum#1<\z@ + \led@warn@BadSetline + \else + \ifledRcol \write\linenum@outR{\string\@set[#1]}% + \else \write\linenum@out{\string\@set[#1]}% + \fi + \fi} + + +\newcommand*{\setlinenum}[1]{% + \ifnum#1<\z@ + \led@warn@BadSetlinenum + \else + \ifledRcol \write\linenum@outR{\string\l@d@set[#1]} + \else \write\linenum@out{\string\l@d@set[#1]} \fi + \fi} + + +\newcommand*{\startlock}{% + \ifledRcol \write\linenum@outR{\string\lock@on}% + \else \write\linenum@out{\string\lock@on}% + \fi} +\def\endlock{% + \ifledRcol \write\linenum@outR{\string\lock@off}% + \else \write\linenum@out{\string\lock@off}% + \fi} +\newif\ifl@dskipnumber +\newif\ifl@dskipversenumber% +\newcommand*{\skipnumbering}{% + \leavevmode% + \ifledRcol% + \ifinstanza% + \write\linenum@outR{\string\n@num@stanza}% + \else% + \write\linenum@outR{\string\n@num}% + \fi% + \advanceline{-1}% + \else% + \ifinstanza% + \write\linenum@out{\string\n@num@stanza}% + \else% + \write\linenum@out{\string\n@num}% + \fi% + \advanceline{-1}% + \fi% +}% + +\list@create{\end@lemmas} +\newcommand{\dummy@edtext}[2]{#1} +\newcommand{\dummy@edtext@showlemma}[2]{\showlemma{#1}}% +\newcommand*{\no@expands}{% + \let\select@@lemmafont=0% + \let\startsub=\relax \let\endsub=\relax + \let\startlock=\relax \let\endlock=\relax + \let\edlabel=\@gobble + \let\setline=\@gobble \let\advanceline=\@gobble + \let\sameword\sameword@inedtext% + \let\edtext=\dummy@edtext + \l@dtabnoexpands + \morenoexpands} +\let\morenoexpands=\relax + +\newcommand{\@tag}{} +\newcount\@edtext@level% +\@edtext@level=0% +\newcommand{\edtext}[2]{\leavevmode% + \ifnumberedpar@% + \global\advance\@edtext@level by 1% + \global\@lemmacommand@false% + \begingroup% + \ifledRcol% + \ifcsundef{sw@list@edtextR@\the\@edtext@level}% + {\global\let\sw@inthisedtext\empty}% + {\ifcsempty{sw@list@edtextR@\the\@edtext@level}% +{\global\let\sw@inthisedtext\empty}% +{\expandafter\gl@p\csname sw@list@edtextR@\the\@edtext@level\endcsname\to\sw@inthisedtext}% + }% + \else% + \ifcsundef{sw@list@edtext@\the\@edtext@level}% + {\global\let\sw@inthisedtext\empty}% + {\ifcsempty{sw@list@edtext@\the\@edtext@level}% +{\global\let\sw@inthisedtext\empty}% +{\expandafter\gl@p\csname sw@list@edtext@\the\@edtext@level\endcsname\to\sw@inthisedtext}% + }% + \fi% + \global\renewcommand{\@tag}{% + \no@expands #1% + }% + \set@line% + \ifledRcol \global\insert@countR \z@% + \else \global\insert@count \z@ \fi% + \ignorespaces #2\relax% + \@ifundefined{xpg@main@language}{%if not polyglossia + \flag@start}% + {\if@RTL\flag@end\else\flag@start\fi% + }% + \if@lemmacommand@% + \ifledRcol% + \write\linenum@outR{\string\@lemma}% + \else% + \write\linenum@out{\string\@lemma}% + \fi% + \fi% + \endgroup% + \showlemma{#1}% + \ifx\end@lemmas\empty \else% + \gl@p\end@lemmas\to\x@lemma% + \x@lemma% + \global\let\x@lemma=\relax% + \fi% + \@ifundefined{xpg@main@language}{%if not polyglossia + \flag@end}% + {\if@RTL\flag@start\else\flag@end\fi% With polyglossia, you must track whether the language reads left to right (English) or right to left (Arabic). + }% + \global\@noneed@Footnotefalse% + \global\advance\@edtext@level by -1% + \global\@lemmacommand@false% + \else% + \showlemma{#1} (\textbf{\textsc{Edtext outside numbered paragraph}})\led@err@edtextoutsidepstart% + \fi% +}% + +\newcommand*{\flag@end}{% + \ifledRcol% + \write\linenum@outR{]}% + \else% + \write\linenum@out{]}% + \fi}% + +\newif\ifnumberline +\numberlinetrue +\newcommand*{\set@line}{% + \ifledRcol + \ifx\line@listR\empty + \global\noteschanged@true + \xdef\l@d@nums{000|000|000|000|000|000|\edfont@info}% + \else + \gl@p\line@listR\to\@tempb + \xdef\l@d@nums{\@tempb|\edfont@info}% + \global\let\@tempb=\undefined + \fi + \else + \ifx\line@list\empty + \global\noteschanged@true + \xdef\l@d@nums{000|000|000|000|000|000|\edfont@info}% + \else + \gl@p\line@list\to\@tempb + \xdef\l@d@nums{\@tempb|\edfont@info}% + \global\let\@tempb=\undefined + \fi + \fi} + +\newcommand*{\edfont@info}{\f@encoding/\f@family/\f@series/\f@shape} + +\unless\ifnocritical@ +\newcommand*{\lemma}[1]{% + \global\@lemmacommand@true% + \global\renewcommand{\@tag}{% + \no@expands #1% + }% + \ignorespaces% +}% +\newcommand{\@lemma}{% + \booltrue{lemmacommand@\the\@edtext@level}% +}% +\fi +\newif\if@lemmacommand@% +\newcommand*{\linenum}[1]{% + \xdef\@tempa{#1|||||||\noexpand\\\l@d@nums}% + \global\let\l@d@nums=\empty + \expandafter\line@set\@tempa|\\\ignorespaces} +\def\line@set#1|#2\\#3|#4\\{% + \gdef\@tempb{#1}% + \ifx\@tempb\empty + \l@d@add{#3}% + \else + \l@d@add{#1}% + \fi + \gdef\@tempb{#4}% + \ifx\@tempb\empty\else + \l@d@add{|}\line@set#2\\#4\\% + \fi} +\newcommand{\l@d@add}[1]{\xdef\l@d@nums{\l@d@nums#1}} + +\newcommand{\get@sw@txt}[1]{% + \ifxetex% + \xdef\sw@txt{#1}% + \else% + \expandafter\xdef\expandafter\sw@txt\expandafter{\detokenize{#1}}% + \fi% +}% +\newcommandx{\sameword}[2][1,usedefault]{% + \leavevmode% + \get@sw@txt{#2}% + \unless\ifledRcol% + \csnumgdef{sw@\sw@txt}{\csuse{sw@\sw@txt}+1}% + \protected@write\linenum@out{}{\string\@sw{\sw@txt}{\csuse{sw@\sw@txt}}{#1}}% + \else% + \csnumgdef{sw@\sw@txt@R}{\csuse{sw@\sw@txt@R}+1}% + \protected@write\linenum@outR{}{\string\@sw{\sw@txt}{\csuse{sw@\sw@txt@R}}{#1}}% + \fi% + #2% +}% +\newif\if@addsw% +\newcommand{\@sw}[3]{% + \get@sw@txt{#1}% + \unless\ifledRcol% + \csxdef{sw@\sw@txt @\the\absline@num @\the\section@num}{#2}% + \numdef{\prev@line}{\the\absline@num-1}% + \ifcsundef{sw@\sw@txt @\prev@line @\the\section@num}{% + \csnumgdef{sw@\sw@txt @\prev@line @\the\section@num}{#2-1}% + }{}% + \numdef{\the@sw}{#2-\csuse{sw@\sw@txt @\prev@line @\the\section@num}}% + \else% + \csxdef{sw@\sw@txt @\the\absline@numR @\the\section@numR @R}{#2}% + \numdef{\prev@line}{\the\absline@numR-1}% + \ifcsundef{sw@\sw@txt @\prev@line @\the\section@numR @R}{% + \csnumgdef{sw@\sw@txt @\prev@line @\the\section@numR @R}{#2-1}% + }{}% + \numdef{\the@sw}{#2-\csuse{sw@\sw@txt @\prev@line @\the\section@numR @R}}% + \fi% + \@tempcnta=\@edtext@level + \@whilenum{\@tempcnta>0}\do{% + \ifcsdef{sw@list@edtext@tmp@\the\@tempcnta}% + {% + \@addswfalse% + \notbool{lemmacommand@\the\@tempcnta}% + {\@addswtrue}% + {\IfStrEq{#3}{inlemma}% + {\@addswtrue}% + {% + \def\do##1{% + \ifnumequal{##1}{\the\@tempcnta}% + {\@addswtrue\listbreak}% + {}% + }% + \docsvlist{#3}% + }% + }% + \if@addsw% + \letcs{\@tmp}{sw@list@edtext@tmp@\the\@tempcnta}% + \ifledRcol% + \xright@appenditem{{\the@sw}{\the\absline@numR}}\to\@tmp% + \else% + \xright@appenditem{{\the@sw}{\the\absline@num}}\to\@tmp% + \fi% + \cslet{sw@list@edtext@tmp@\the\@tempcnta}{\@tmp}% + \fi% + }% + {}% + \advance\@tempcnta by -1% + }% +}% +\newcommandx{\sameword@inedtext}[2][1,usedefault]{% + \get@sw@txt{#2}% + \unless\ifledRcol@% + \ifx\sw@list@inedtext\empty% + \def\the@sw{999}% + \def\this@absline{-99}% + \else% + \gl@p\sw@list@inedtext\to\@tmp% + \edef\the@sw{\expandafter\@firstoftwo\@tmp}% + \edef\this@absline{\expandafter\@secondoftwo\@tmp}% + \fi% + \ifcsdef{sw@\sw@txt @\this@absline @\the\section@num}{% + \numdef{\prev@line}{\this@absline-1}% + \numdef{\sw@atthisline}{\csuse{sw@\sw@txt @\this@absline @\the\section@num}-\csuse{sw@\sw@txt @\prev@line @\the\section@num}}% + }% + {\numdef{\sw@atthisline}{0}}% + \ifnumgreater{\sw@atthisline}{1}% + {\showwordrank{#2}{\the@sw}}% + {#2}% + \else% + \ifx\sw@list@inedtext\empty% + \def\the@sw{999}% + \def\this@absline{-99}% + \else% + \gl@p\sw@list@inedtext\to\@tmp% + \edef\the@sw{\expandafter\@firstoftwo\@tmp}% + \edef\this@absline{\expandafter\@secondoftwo\@tmp}% + \fi% + \ifcsdef{sw@\sw@txt @\this@absline @\the\section@numR @R}{% + \numdef{\prev@line}{\this@absline-1}% + \numdef{\sw@atthisline}{\csuse{sw@\sw@txt @\this@absline @\the\section@numR @R}-\csuse{sw@\sw@txt @\prev@line @\the\section@numR @R}}% + }% + {\numdef{\sw@atthisline}{0}}% + \ifnumgreater{\sw@atthisline}{1}% + {\showwordrank{#2}{\the@sw}}% + {#2}% + \fi% +}% +\newcommand{\showwordrank}[2]{% + #1\textsuperscript{#2}% +}% + +\newbox\raw@text +\newif\ifnumberedpar@ +\newcount\num@lines +\newbox\one@line +\newcount\par@line + +\newcommand{\AtEveryPstart}[1]{% + \ifstrempty{#1}% + {\xdef\at@every@pstart{}}% + {\gdef\at@every@pstart{\noindent#1}}% +}% +\xdef\at@every@pstart{}% + +\newcounter{pstart} +\renewcommand{\thepstart}{{\bfseries\@arabic\c@pstart}. } +\newif\ifnumberpstart +\numberpstartfalse +\newif\iflabelpstart +\labelpstartfalse +\newcommandx*{\pstart}[1][1]{% + \normal@pars% + \ifstrempty{#1}{\at@every@pstart}{\noindent#1}% + \ifautopar% + \autopar% + \fi% + \ifluatex% + \edef\l@luatextextdir@L{\the\luatextextdir}% + \fi% + \if@nobreak% + \let\@oldnobreak\@nobreaktrue% + \else% + \let\@oldnobreak\@nobreakfalse% + \fi% + \@nobreaktrue% + \ifnumbering \else% + \led@err@PstartNotNumbered% + \beginnumbering% + \fi% + \ifnumberedpar@% + \led@err@PstartInPstart% + \pend% + \fi% + \list@clear{\inserts@list}% + \global\let\next@insert=\empty% + \begingroup\normal@pars% + \global\advance \l@dnumpstartsL\@ne + \global\setbox\raw@text=\vbox\bgroup% + \ifautopar\else% + \ifnumberpstart% + \ifinstanza\else% + \ifsidepstartnum\else% + \thepstart% + \fi% + \fi% + \fi% + \fi% + \numberedpar@true% + \iflabelpstart\protected@edef\@currentlabel% + {\p@pstart\thepstart} + \fi% + \l@dzeropenalties% + } +\newcommandx*{\pend}[1][1]{\ifnumbering \else% + \led@err@PendNotNumbered% + \fi% + \global\l@dskipversenumberfalse% + \ifnumberedpar@ \else% + \led@err@PendNoPstart% + \fi% + \l@dzeropenalties% + \endgraf\global\num@lines=\prevgraf\egroup% + \global\par@line=0% + \csnumdef{pstartline}{0}% + \loop\ifvbox\raw@text% + \csnumdef{pstartline}{\pstartline+1}% + \do@line% + \ifbypstart@% + \ifnumequal{\pstartline}{1}{\setline{1}\resetprevline@}{}% + \fi% + \repeat% + \flush@notes% + \endgroup% + \ignorespaces% + \ifnumberpstart% + \pstartnumtrue% + \fi% + \addtocounter{pstart}{1}% + \normal@pars% + \@oldnobreak% + \ifautopar% + \autopar% + \fi% + \ifstrempty{#1}{\at@every@pend}{\noindent#1}% +} + + +\newcommand{\AtEveryPend}[1]{% + \ifstrempty{#1}% + {\xdef\at@every@pend{}}% + {\gdef\at@every@pend{\noindent#1}}% +}% +\xdef\at@every@pend{}% + +\newcommand*{\l@dzeropenalties}{% + \brokenpenalty \z@ \clubpenalty \z@ + \displaywidowpenalty \z@ \interlinepenalty \z@ \predisplaypenalty \z@ + \postdisplaypenalty \z@ \widowpenalty \z@} + +\newif\ifautopar +\autoparfalse +\newcommand*{\autopar}{ + \ifledRcol + \ifnumberingR \else + \led@err@AutoparNotNumbered + \beginnumberingR + \fi + \else + \ifnumbering \else + \led@err@AutoparNotNumbered + \beginnumbering + \fi + \fi + \autopartrue + \everypar{\setbox0=\lastbox + \endgraf \vskip-\parskip + \pstart \noindent \kern\wd0 \ifnumberpstart\ifinstanza\else\thepstart\fi\fi + \let\par=\pend}% + \ignorespaces} +\newcommand*{\normal@pars}{\everypar{}\let\par\endgraf} + +\newif\ifautopar@pause + \newcommand*{\l@dunhbox@line}[1]{\unhbox #1} + \newcommand*{\do@line}{% + {\vbadness=10000 + \splittopskip=\z@ + \do@linehook +\l@demptyd@ta + \global\setbox\one@line=\vsplit\raw@text to\baselineskip}% + \unvbox\one@line \global\setbox\one@line=\lastbox + \getline@num + \IfStrEq{\led@pb@setting}{before}{\led@check@pb\led@check@nopb}{} + \ifnum\@lock>\@ne + \inserthangingsymboltrue + \else + \inserthangingsymbolfalse + \fi + \check@pb@in@verse + \ifl@dhidenumber% + \global\l@dhidenumberfalse% + \f@x@l@cks% + \else% + \affixline@num% + \fi% + \xifinlist{\the\l@dnumpstartsL}{\eled@sections@@}% + {\print@eledsection}% + {\print@line}% + \IfStrEq{\led@pb@setting}{after}{\led@check@pb\led@check@nopb}{} + }% +\def\print@line{ + \affixpstart@num% + \hb@xt@ \linewidth{% + \do@insidelinehook% + \l@dld@ta% + \add@inserts\affixside@note% + \l@dlsn@te + {\ledllfill\hb@xt@ \wd\one@line{\new@line% + \ifluatex% + \luatextextdir\l@luatextextdir@L% + \fi% + \inserthangingsymbol %Space keept for backward compatibility + \l@dunhbox@line{\one@line}}% + \ledrlfill\l@drd@ta% + \l@drsn@te + }}% + \add@penalties% +} +\def\print@eledsection{% + \add@inserts\affixside@note% + \numdef{\temp@}{\l@dnumpstartsL-1}% + \xifinlist{\temp@}{\eled@sections@@}{\@nobreaktrue}{\@nobreakfalse}% + \@eled@sectioningtrue% + \csuse{eled@sectioning@\the\l@dnumpstartsL}% + \@eled@sectioningfalse% + \global\csundef{eled@sectioning@\the\l@dnumpstartsL}% + \if@RTL% + \hspace{-3\paperwidth}% + {\hbox{\l@dunhbox@line{\one@line}} \new@line}% + \else% + \hspace{3\paperwidth}% + {\new@line \hbox{\l@dunhbox@line{\one@line}}}% + \fi% + \vskip-\baselineskip% +} +\newcommand*{\do@linehook}{} +\newcommand*{\do@insidelinehook}{} +\newcommand*{\dolinehook}[1]{\gdef\do@linehook{#1}}% +\newcommand*{\doinsidelinehook}[1]{\gdef\do@insidelinehook{#1}}% + +\newcommand*{\l@demptyd@ta}{% + \gdef\l@dld@ta{}% + \gdef\l@drd@ta{}% + \gdef\l@dcsnotetext@l{}% + \gdef\l@dcsnotetext@r{}% + \gdef\l@dcsnotetext{}} + +\newcommand{\l@dlsn@te}{% + \hb@xt@ \z@{\hss\box\l@dlp@rbox\kern\ledlsnotesep}} +\newcommand{\l@drsn@te}{% + \hb@xt@ \z@{\kern\ledrsnotesep\box\l@drp@rbox\hss}} + +\newcommand*{\ledllfill}{\hfil} +\newcommand*{\ledrlfill}{} + +\newcommand*{\getline@num}{% + \global\advance\absline@num \@ne% + \do@actions + \do@ballast + \ifnumberline + \ifsublines@ + \ifnum\sub@lock<\tw@ + \global\advance\subline@num \@ne + \fi + \else + \ifnum\@lock<\tw@ + \global\advance\line@num \@ne + \global\subline@num \z@ + \fi + \fi + \fi +} +\newcount\ballast@count +\newcounter{ballast} + \setcounter{ballast}{0} +\newcommand*{\do@ballast}{\global\ballast@count \z@ + \begingroup + \advance\absline@num \@ne + \ifnum\next@actionline=\absline@num + \ifnum\next@action>-1001\relax + \global\advance\ballast@count by -\c@ballast + \fi + \fi + \endgroup} +\newcommand*{\do@actions}{% + \global\let\do@actions@next=\relax + \ifnum\absline@num<\next@actionline\else + \ifnum\next@action>-1001 + \global\page@num=\next@action + \ifbypage@ + \global\line@num=\z@ \global\subline@num=\z@ + \resetprevline@ + \fi + \else + \ifnum\next@action<-4999 + \@l@dtempcnta=-\next@action + \advance\@l@dtempcnta by -5001 + \ifsublines@ + \global\subline@num=\@l@dtempcnta + \else + \global\line@num=\@l@dtempcnta + \fi + \else + \@l@dtempcnta=-\next@action + \advance\@l@dtempcnta by -1000 + \do@actions@fixedcode + \fi + \fi + \ifx\actionlines@list\empty + \gdef\next@actionline{1000000}% + \else + \gl@p\actionlines@list\to\next@actionline + \gl@p\actions@list\to\next@action + \global\let\do@actions@next=\do@actions + \fi + \fi +\do@actions@next} + +\newcommand*{\do@actions@fixedcode}{% + \ifcase\@l@dtempcnta + \or% % 1001 + \global\sublines@true + \or% % 1002 + \global\sublines@false + \or% % 1003 + \global\@lock=\@ne + \or% % 1004 + \ifnum\@lock=\tw@ + \global\@lock=\thr@@ + \else + \global\@lock=\z@ + \fi + \or% % 1005 + \global\sub@lock=\@ne + \or% % 1006 + \ifnum\sub@lock=\tw@ + \global\sub@lock=\thr@@ + \else + \global\sub@lock=\z@ + \fi + \or% % 1007 + \l@dskipnumbertrue + \or% % 1008 + \l@dskipversenumbertrue% + \or% % 1009 + \l@dhidenumbertrue + \else + \led@warn@BadAction + \fi} + +\newcommand*{\affixline@num}{% + \ifledgroupnotesL@\else + \ifnumberline + \ifl@dskipnumber + \global\l@dskipnumberfalse + \else + \ifsublines@ + \@l@dtempcntb=\subline@num + \ifnum\subline@num>\c@firstsublinenum + \@l@dtempcnta=\subline@num + \advance\@l@dtempcnta by-\c@firstsublinenum + \divide\@l@dtempcnta by\c@sublinenumincrement + \multiply\@l@dtempcnta by\c@sublinenumincrement + \advance\@l@dtempcnta by\c@firstsublinenum + \else + \@l@dtempcnta=\c@firstsublinenum + \fi + \ch@cksub@l@ck + \else + \@l@dtempcntb=\line@num + \ifx\linenumberlist\empty + \ifnum\line@num>\c@firstlinenum + \@l@dtempcnta=\line@num + \advance\@l@dtempcnta by-\c@firstlinenum + \divide\@l@dtempcnta by\c@linenumincrement + \multiply\@l@dtempcnta by\c@linenumincrement + \advance\@l@dtempcnta by\c@firstlinenum + \else + \@l@dtempcnta=\c@firstlinenum + \fi + \else + \@l@dtempcnta=\line@num + \edef\rem@inder{,\linenumberlist,\number\line@num,}% + \edef\sc@n@list{\def\noexpand\sc@n@list + ####1,\number\@l@dtempcnta,####2|{\def\noexpand\rem@inder{####2}}}% + \sc@n@list\expandafter\sc@n@list\rem@inder|% + \ifx\rem@inder\empty% + \advance\@l@dtempcnta\@ne + \fi + \fi + \ch@ck@l@ck + \fi + \ifnum\@l@dtempcnta=\@l@dtempcntb + \ifl@dskipversenumber\else + \if@twocolumn + \if@firstcolumn + \gdef\l@dld@ta{\llap{{\leftlinenum}}}% + \else + \gdef\l@drd@ta{\rlap{{\rightlinenum}}}% + \fi + \else + \@l@dtempcntb=\line@margin + \ifnum\@l@dtempcntb>\@ne + \advance\@l@dtempcntb \page@num + \fi + \ifodd\@l@dtempcntb + \gdef\l@drd@ta{\rlap{{\rightlinenum}}}% + \else + \gdef\l@dld@ta{\llap{{\leftlinenum}}}% + \fi + \fi + \fi + \fi + \f@x@l@cks + \fi + \fi + \fi +} + +\newcommand*{\ch@cksub@l@ck}{% + \ifcase\sub@lock + \or + \ifnum\sublock@disp=\@ne + \@l@dtempcntb=\z@ \@l@dtempcnta=\@ne + \fi + \or + \ifnum\sublock@disp=\tw@ \else + \@l@dtempcntb=\z@ \@l@dtempcnta=\@ne + \fi + \or + \ifnum\sublock@disp=\z@ + \@l@dtempcntb=\z@ \@l@dtempcnta=\@ne + \fi + \fi} +\newcommand*{\ch@ck@l@ck}{% + \ifcase\@lock + \or + \ifnum\lock@disp=\@ne + \@l@dtempcntb=\z@ \@l@dtempcnta=\@ne + \fi + \or + \ifnum\lock@disp=\tw@ \else + \@l@dtempcntb=\z@ \@l@dtempcnta=\@ne + \fi + \or + \ifnum\lock@disp=\z@ + \@l@dtempcntb=\z@ \@l@dtempcnta=\@ne + \fi + \fi} +\newcommand*{\f@x@l@cks}{% + \ifcase\@lock + \or + \global\@lock=\tw@ + \or \or + \global\@lock=\z@ + \fi + \ifcase\sub@lock + \or + \global\sub@lock=\tw@ + \or \or + \global\sub@lock=\z@ + \fi} + + +\newif\ifsidepstartnum +\newcommand*{\affixpstart@num}{% + \ifsidepstartnum + \if@twocolumn + \if@firstcolumn + \gdef\l@dld@ta{\llap{{\leftpstartnum}}}% + \else + \gdef\l@drd@ta{\rlap{{\rightpstartnum}}}% + \fi + \else + \@l@dtempcntb=\line@margin + \ifnum\@l@dtempcntb>\@ne + \advance\@l@dtempcntb \page@num + \fi + \ifodd\@l@dtempcntb + \gdef\l@drd@ta{\rlap{{\rightpstartnum}}}% + \else + \gdef\l@dld@ta{\llap{{\leftpstartnum}}}% + \fi + \fi + \fi + +} + +\newif\ifpstartnum +\pstartnumtrue +\newcommand*{\leftpstartnum}{ + \ifpstartnum\thepstart + \kern\linenumsep\fi + \global\pstartnumfalse +} +\newcommand*{\rightpstartnum}{ + \ifpstartnum + \kern\linenumsep + \thepstart + \fi + \global\pstartnumfalse +} +\list@create{\inserts@list} +\newcommand*{\add@inserts}{% + \global\let\add@inserts@next=\relax + \ifx\inserts@list\empty \else + \ifx\next@insert\empty + \ifx\insertlines@list\empty + \global\noteschanged@true + \gdef\next@insert{100000}% + \else + \gl@p\insertlines@list\to\next@insert + \fi + \fi + \ifnum\next@insert=\absline@num + \gl@p\inserts@list\to\@insert + \@insert + \global\let\@insert=\undefined + \global\let\next@insert=\empty + \global\let\add@inserts@next=\add@inserts + \fi +\fi +\add@inserts@next} + +\newcommand*{\add@penalties}{\@l@dtempcnta=\ballast@count + \ifnum\num@lines>\@ne + \global\advance\par@line \@ne + \ifnum\par@line=\@ne + \advance\@l@dtempcnta \clubpenalty + \fi + \@l@dtempcntb=\par@line \advance\@l@dtempcntb \@ne + \ifnum\@l@dtempcntb=\num@lines + \advance\@l@dtempcnta \widowpenalty + \fi + \ifnum\par@line<\num@lines + \advance\@l@dtempcnta \interlinepenalty + \fi + \fi + \ifnum\@l@dtempcnta=\z@ + \relax + \else + \ifnum\@l@dtempcnta>-10000 + \penalty\@l@dtempcnta + \else + \penalty -10000 + \fi + \fi} + +\newcommand*{\flush@notes}{% + \@xloop + \ifx\inserts@list\empty \else + \gl@p\inserts@list\to\@insert + \@insert + \global\let\@insert=\undefined + \repeat} + +\def\@xloop#1\repeat{% + \def\body{#1\expandafter\body\fi}% + \body} + + \def\select@lemmafont#1|#2|#3|#4|#5|#6|#7|{\select@@lemmafont#7|} + \def\select@@lemmafont#1/#2/#3/#4|% + {\fontencoding{#1}\fontfamily{#2}\fontseries{#3}\fontshape{#4}% + \selectfont} + +\newcommandx*{\footnoteoptions@}[3][1=L,usedefault]{% + \def\do##1{% + \ifstrequal{#1}{L}{% In Leftside + \xright@appenditem{\global\noexpand\settoggle{##1@}{#3}}\to\inserts@list% Switch toogle, in all case + \global\advance\insert@count \@ne% Increment the left insert counter. + }% + {% + \xright@appenditem{\global\noexpand\settoggle{##1@}{#3}}\to\inserts@listR% Switch toogle, in all case + \global\advance\insert@countR \@ne% Increment the right insert counter insert. + }% + }% + \notblank{#2}{\docsvlist{#2}}{}% Parsing all options +} +\newcommandx*{\footnotelang@lua}[1][1=L,usedefault]{% + \ifstrequal{#1}{L}{% + \xright@appenditem{{\csxdef{footnote@luatextextdir}{\the\luatextextdir}}}\to\inserts@list%Know the dir of lemma + \global\advance\insert@count \@ne% + \xright@appenditem{{\csxdef{footnote@luatexpardir}{\the\luatexpardir}}}\to\inserts@list%Know the dir of lemma + \global\advance\insert@count \@ne% + }% + {% + \xright@appenditem{{\csxdef{footnote@luatextextdir}{\the\luatextextdir}}}\to\inserts@listR%Know the dir of lemma + \global\advance\insert@countR \@ne% + \xright@appenditem{{\csxdef{footnote@luatexpardir}{\the\luatexpardir}}}\to\inserts@listR%Know the dir of lemma + \global\advance\insert@countR \@ne% + }% +} +\newcommandx*{\footnotelang@poly}[1][1=L,usedefault]{% + \ifstrequal{#1}{L}{% + \if@RTL% + \xright@appenditem{{\csxdef{footnote@dir}{@RTLtrue}}}\to\inserts@list%Know the language used in the lemma + \global\advance\insert@count \@ne% + \else + \xright@appenditem{{\csxdef{footnote@dir}{@RTLfalse}}}\to\inserts@list%Know the language of lemma + \global\advance\insert@count \@ne% + \fi% + \xright@appenditem{{\csxdef{footnote@lang}{\expandonce\languagename}}}\to\inserts@list%Know the language of lemma + \global\advance\insert@count \@ne% + }% + {% + \if@RTL + \xright@appenditem{{\csxdef{footnote@dir}{@RTLtrue}}}\to\inserts@listR%Know the language of lemma + \global\advance\insert@countR \@ne% + \else + \xright@appenditem{{\csxdef{footnote@dir}{@RTLfalse}}}\to\inserts@listR%Know the language of lemma + \global\advance\insert@countR \@ne% + \fi + \xright@appenditem{{\csxdef{footnote@lang}{\expandonce\languagename}}}\to\inserts@listR%Know the language of lemma + \global\advance\insert@countR \@ne% + }% +} +\newcommand*{\footsplitskips}{% + \interlinepenalty=\interfootnotelinepenalty + \unless\ifl@dprintingpages% + \floatingpenalty=\@MM% + \fi% + \splittopskip=\ht\strutbox \splitmaxdepth=\dp\strutbox + \leftskip=\z@skip \rightskip=\z@skip} + +\let\normalfootnoterule=\footnoterule +\newcommandx{\Xarrangement}[2][1,usedefault]{% + \def\do##1{% + \csname Xarrangement@#2\endcsname{##1}% + }% + \ifstrempty{#1}% + {% + \dolistloop{\@series}% + }% + { + \docsvlist{#1}% + }% +}% + +\newcommand*{\Xarrangement@normal}[1]{% + \csgdef{series@display#1}{normal} + \expandafter\let\csname #1footstart\endcsname=\normalfootstart + \expandafter\let\csname v#1footnote\endcsname=\normalvfootnote + \expandafter\let\csname #1footfmt\endcsname=\normalfootfmt + \expandafter\let\csname #1footgroup\endcsname=\normalfootgroup + \expandafter\let\csname #1footnoterule\endcsname=% + \normalfootnoterule + \count\csname #1footins\endcsname=1000 + \dimen\csname #1footins\endcsname=\csuse{Xmaxhnotes@#1} + \skip\csname #1footins\endcsname=\csuse{Xbeforenotes@#1}% + \advance\skip\csname #1footins\endcsname by\csuse{Xafterrule@#1}% + + \csxdef{default@#1footins}{1000}%Use this to confine the notes to one side only + \ifnoledgroup@\else% + \expandafter\let\csname mpv#1footnote\endcsname=\mpnormalvfootnote + \expandafter\let\csname mp#1footgroup\endcsname=\mpnormalfootgroup + \count\csname mp#1footins\endcsname=1000 + \dimen\csname mp#1footins\endcsname=\csuse{Xmaxhnotes@#1} + \skip\csname mp#1footins\endcsname=\csuse{Xbeforenotes@#1}% + \advance\skip\csname mp#1footins\endcsname by\csuse{Xafterrule@#1}% + \fi +} + +\notbool{parapparatus@}{\newcommand*}{\newcommand}{\normalvfootnote}[2]{% + \insert\csname #1footins\endcsname\bgroup + \csuse{Xbhooknote@#1} + \csuse{Xnotefontsize@#1} + \footsplitskips + \ifl@dpairing\ifl@dpaging\else% + \setXnoteswidthliketwocolumns@{#1}% + \fi\fi% + \setXnotespositionliketwocolumns@{#1}% + \spaceskip=\z@skip \xspaceskip=\z@skip + \csname #1footfmt\endcsname #2{#1}\egroup} +\notbool{parapparatus@}{\newcommand*}{\newcommand}{\mpnormalvfootnote}[2]{% + \global\setbox\@nameuse{mp#1footins}\vbox{% + \unvbox\@nameuse{mp#1footins} + \csuse{Xbhooknote@#1} + \csuse{Xnotefontsize@#1} + \hsize\columnwidth + \@parboxrestore + \color@begingroup + \csname #1footfmt\endcsname #2{#1}\color@endgroup}} + + +\notbool{parapparatus@}{\newcommand*}{\newcommand}{\normalfootfmt}[4]{% + \Xledsetnormalparstuff{#4}% + \hangindent=\csuse{Xhangindent@#4} + \strut{\printlinefootnote{#1}{#4}}% + {\nottoggle{Xlemmadisablefontselection@#4}{\select@lemmafont#1|#2}{#2}}% + \iftoggle{nosep@}{\hskip\csuse{Xinplaceoflemmaseparator@#4}}{\ifcsempty{Xlemmaseparator@#4}% + {\hskip\csuse{Xinplaceoflemmaseparator@#4}}% + {\nobreak\hskip\csuse{Xbeforelemmaseparator@#4}\csuse{Xlemmaseparator@#4}\hskip\csuse{Xafterlemmaseparator@#4}\relax% + }}% + #3\strut\par} +\newcommand*{\normalfootstart}[1]{% + \ifdimequal{0pt}{\preXnotes@}{}% + {% + \iftoggle{preXnotes@}{% + \togglefalse{preXnotes@}% + \skip\csname #1footins\endcsname=% + \dimexpr\csuse{preXnotes@}+\csuse{Xafterrule@#1}\relax% + }% + {}% + }% + \vskip\skip\csname #1footins\endcsname% + \leftskip0pt \rightskip0pt + \ifl@dpairing\else% + \hsize=\old@hsize% + \fi% + \setXnoteswidthliketwocolumns@{#1}% + \setXnotespositionliketwocolumns@{#1}% + \print@Xfootnoterule{#1}% + \noindent\leavevmode} +\newcommand*{\normalfootgroup}[1]{% + {\csuse{Xnotefontsize@#1}\noindent\csuse{Xtxtbeforenotes@#1}}% + \unvbox\csname #1footins\endcsname% + \hsize=\old@hsize% + }% + +\unless\ifnoledgroup@ +\newcommand*{\mpnormalfootgroup}[1]{{ + \vskip\skip\@nameuse{mp#1footins} + \ifl@dpairing\ifparledgroup% + \leavevmode\marks\parledgroup@{begin}% + \marks\parledgroup@series{#1}% + \marks\parledgroup@type{Xfootnote}% + \fi\fi\normalcolor% + \ifparledgroup% + \ifl@dpairing% + \else% + \setXnoteswidthliketwocolumns@{#1}% + \setXnotespositionliketwocolumns@{#1}% + \print@Xfootnoterule{#1}%% + \fi% + \else% + \setXnoteswidthliketwocolumns@{#1}% + \setXnotespositionliketwocolumns@{#1}% + \print@Xfootnoterule{#1}%% + \fi% + \setlength{\parindent}{0pt} + {\csuse{Xnotefontsize@#1}\csuse{Xtxtbeforenotes@#1}} + \unvbox\csname mp#1footins\endcsname}} +\fi +\newcommand*{\Xarrangement@paragraph}[1]{% + \csgdef{series@display#1}{paragraph} + \expandafter\newcount\csname #1prevpage@num\endcsname + \expandafter\let\csname #1footstart\endcsname=\parafootstart + \expandafter\let\csname v#1footnote\endcsname=\paravfootnote + \expandafter\let\csname #1footfmt\endcsname=\parafootfmt + \expandafter\let\csname #1footgroup\endcsname=\parafootgroup + \count\csname #1footins\endcsname=1000 + \csxdef{default@#1footins}{1000}%Use this to confine the notes to one side only + \dimen\csname #1footins\endcsname=\csuse{Xmaxhnotes@#1} + \skip\csname #1footins\endcsname=\csuse{Xbeforenotes@#1}% + \advance\skip\csname #1footins\endcsname by\csuse{Xafterrule@#1}% + \para@footsetup{#1} + \ifnoledgroup@\else + \expandafter\let\csname mpv#1footnote\endcsname=\mpparavfootnote + \expandafter\let\csname mp#1footgroup\endcsname=\mpparafootgroup + \count\csname mp#1footins\endcsname=1000 + \dimen\csname mp#1footins\endcsname=\csuse{Xmaxhnotes@#1} + \skip\csname mp#1footins\endcsname=\csuse{Xbeforenotes@#1}% + \advance\skip\csname mp#1footins\endcsname by\csuse{Xafterrule@#1}% + \fi +} +\providecommand{\footfudgefiddle}{64} +\newcommand*{\para@footsetup}[1]{{\csuse{Xnotefontsize@#1} + \setXnoteswidthliketwocolumns@{#1}% + \dimen0=\baselineskip + \multiply\dimen0 by 1024 + \divide \dimen0 by \columnwidth \multiply\dimen0 by \footfudgefiddle\relax + \csxdef{#1footfudgefactor}{% + \expandafter\strip@pt\dimen0 }}} + +\newcommand*{\parafootstart}[1]{% + \rightskip=0pt \leftskip=0pt \parindent=0pt + \ifdimequal{0pt}{\preXnotes@}{}% + {% + \iftoggle{preXnotes@}{% + \togglefalse{preXnotes@}% + \skip\csname #1footins\endcsname=% + \dimexpr\csuse{preXnotes@}+\csuse{Xafterrule@#1}\relax% + }% + {}% + }% + \vskip\skip\csname #1footins\endcsname% + \setXnoteswidthliketwocolumns@{#1}% + \setXnotespositionliketwocolumns@{#1}% + \print@Xfootnoterule{#1}%% + \noindent\leavevmode} +\newcommand*{\paravfootnote}[2]{% + \insert\csname #1footins\endcsname + \bgroup + \csuse{Xbhooknote@#1} + \csuse{Xnotefontsize@#1} + \footsplitskips + \setbox0=\vbox{\hsize=\maxdimen + \noindent\csname #1footfmt\endcsname #2{#1}}% + \setbox0=\hbox{\Xunvxh{0}{#1}}% + \dp0=0pt + \ht0=\csname #1footfudgefactor\endcsname\wd0 + \if@RTL\noindent \leavevmode\fi\box0% + \penalty0 + \egroup} + +\newcommand*{\mpparavfootnote}[2]{% + \global\setbox\@nameuse{mp#1footins}\vbox{% + \unvbox\@nameuse{mp#1footins}% + \csuse{Xbhooknote@#1} + \csuse{Xnotefontsize@#1} + \footsplitskips + \setbox0=\vbox{\hsize=\maxdimen + \noindent\color@begingroup\csname #1footfmt\endcsname #2{#1}\color@endgroup}% + \setbox0=\hbox{\Xunvxh{0}{#1}}% + \dp0=\z@ + \ht0=\csname #1footfudgefactor\endcsname\wd0 + \box0 + \penalty0 +}} + +\newcommand*{\Xunvxh}[2]{% + \setbox0=\vbox{\unvbox#1% + \global\setbox1=\lastbox}% + \unhbox1 + \unskip % remove \rightskip, + \unskip % remove \parfillskip, + \unpenalty % remove \penalty of 10000, + \hskip\csuse{Xafternote@#2}} % but add the glue to go between the notes + +\newcommand*{\parafootfmt}[4]{% + \Xinsertparafootsep{#4}% + \Xledsetnormalparstuff{#4}% + \printlinefootnote{#1}{#4}% + {\nottoggle{Xlemmadisablefontselection@#4}{\select@lemmafont#1|#2}{#2}}% + \iftoggle{nosep@}{\hskip\csuse{Xinplaceoflemmaseparator@#4}}{\ifcsempty{Xlemmaseparator@#4}% + {\hskip\csuse{Xinplaceoflemmaseparator@#4}}% + {\nobreak\hskip\csuse{Xbeforelemmaseparator@#4}\csuse{Xlemmaseparator@#4}\hskip\csuse{Xafterlemmaseparator@#4}% + }}% + #3\penalty-10 } +\newcommand*{\parafootgroup}[1]{% + \unvbox\csname #1footins\endcsname + \ifcsstring{Xragged@#1}{L}{\RaggedLeft}{}% + \ifcsstring{Xragged@#1}{R}{\RaggedRight}{}% + \makehboxofhboxes + \setbox0=\hbox{{\csuse{Xnotefontsize@#1}\csuse{Xtxtbeforenotes@#1}}\unhbox0 \removehboxes}% + \csuse{Xnotefontsize@#1} + \noindent\unhbox0\par% + \global\hsize=\old@hsize% + }% + +\newcommand*{\mpparafootgroup}[1]{{% + \setXnoteswidthliketwocolumns@{#1}% + \vskip\skip\@nameuse{mp#1footins} + \ifl@dpairing\ifparledgroup% + \leavevmode\marks\parledgroup@{begin}% + \marks\parledgroup@series{#1}% + \marks\parledgroup@type{Xfootnote}% + \fi\fi\normalcolor + \ifparledgroup% + \ifl@dpairing% + \else% + \setXnoteswidthliketwocolumns@{#1}% + \setXnotespositionliketwocolumns@{#1}% + \print@Xfootnoterule{#1}%% + \fi% + \else% + \setXnoteswidthliketwocolumns@{#1}% + \setXnotespositionliketwocolumns@{#1}% + \print@Xfootnoterule{#1}% + \fi% + \unvbox\csname mp#1footins\endcsname + \ifcsstring{Xragged@#1}{L}{\RaggedLeft}{}% + \ifcsstring{Xragged@#1}{R}{\RaggedRight}{}% + \makehboxofhboxes + \setbox0=\hbox{{\csuse{Xnotefontsize@#1}\csuse{Xtxtbeforenotes@#1}}\unhbox0 \removehboxes}% + \csuse{Xnotefontsize@#1} + \noindent\unhbox0\par}} + +\newcommand*{\makehboxofhboxes}{\setbox0=\hbox{}% + \loop + \unpenalty + \setbox2=\lastbox + \ifhbox2 + \setbox0=\hbox{\box2\unhbox0}% + \repeat} + +\newcommand*{\removehboxes}{\setbox0=\lastbox + \ifhbox0{\removehboxes}\unhbox0 \fi} + +\newcommand{\Xinsertparafootsep}[1]{% + \ifnumequal{\csuse{#1prevpage@num}}{\page@num}% + {\ifcsdef{prevline#1}% Be sur \prevline#1 exists. + {\ifnumequal{\csuse{prevline#1}}{\line@num}% + {\ifcsempty{Xsymlinenum@#1}{\csuse{Xparafootsep@#1}}{}}% + {\csuse{Xparafootsep@#1}}% + }% + {\csuse{Xparafootsep@#1}}% + }% + {}% + \global\csname #1prevpage@num\endcsname=\page@num% +} +\newcount\@k \newdimen\@h +\newcommand*{\rigidbalance}[3]{\setbox0=\box#1 \@k=#2 \@h=#3 + \@@line{\splittopskip=\@h \vbadness=\@M \hfilneg + \valign{##\vfil\cr\dosplits}}} + +\newcommand*{\dosplits}{\ifnum\@k>0 \noalign{\hfil}\splitoff + \global\advance\@k-1\cr\dosplits\fi} + +\newcommand*{\splitoff}{\dimen0=\ht0 + \divide\dimen0 by\@k \advance\dimen0 by\@h + \setbox2 \vsplit0 to \dimen0 + \unvbox2 } + +\newcommand*{\Xarrangement@threecol}[1]{% + \csgdef{series@display#1}{threecol} + \expandafter\let\csname v#1footnote\endcsname=\threecolvfootnote + \expandafter\let\csname #1footfmt\endcsname=\threecolfootfmt + \expandafter\let\csname #1footgroup\endcsname=\threecolfootgroup + \dimen\csname #1footins\endcsname=\csuse{Xmaxhnotes@#1}% + \skip\csname #1footins\endcsname=\csuse{Xbeforenotes@#1}% + \advance\skip\csname #1footins\endcsname by\csuse{Xafterrule@#1}% + \threecolfootsetup{#1} + \ifnoledgroup@\else + \expandafter\let\csname mpv#1footnote\endcsname=\mpnormalvfootnote + \expandafter\let\csname mp#1footgroup\endcsname=\mpthreecolfootgroup + \skip\csname mp#1footins\endcsname=\csuse{Xbeforenotes@#1}% + \advance\skip\csname mp#1footins\endcsname by\csuse{Xafterrule@#1}% + \mpthreecolfootsetup{#1} + \fi +} + +\newcommand*{\threecolfootsetup}[1]{% + \count\csname #1footins\endcsname 333 + \csxdef{default@#1footins}{333}%Use this to confine the notes to one side only + \multiply\dimen\csname #1footins\endcsname \thr@@} +\newcommand*{\mpthreecolfootsetup}[1]{% + \count\csname mp#1footins\endcsname 333 + \multiply\dimen\csname mp#1footins\endcsname \thr@@} + +\notbool{parapparatus@}{\newcommand*}{\newcommand}{\threecolvfootnote}[2]{% + \insert\csname #1footins\endcsname\bgroup + \csuse{Xnotefontsize@#1} + \footsplitskips + \csname #1footfmt\endcsname #2{#1}\egroup} +\notbool{parapparatus@}{\newcommand*}{\newcommand}{\threecolfootfmt}[4]{% + \normal@pars + \hsize \csuse{Xhsizethreecol@#4} + \nottoggle{Xparindent@#4}{\parindent=\z@}{} + \tolerance=5000 + \hangindent=\csuse{Xhangindent@#4} + \leavevmode + \csuse{Xcolalign@#4}% + \strut{\printlinefootnote{#1}{#4}}% + {\nottoggle{Xlemmadisablefontselection@#4}{\select@lemmafont#1|#2}{#2}}% + \iftoggle{nosep@}{\hskip\csuse{Xinplaceoflemmaseparator@#4}}{\ifcsempty{Xlemmaseparator@#4}% + {\hskip\csuse{Xinplaceoflemmaseparator@#4}}% + {\nobreak\hskip\csuse{Xbeforelemmaseparator@#4}\csuse{Xlemmaseparator@#4}\hskip\csuse{Xafterlemmaseparator@#4}% + }}% + #3\strut\par\allowbreak} +\newcommand*{\threecolfootgroup}[1]{{\csuse{Xnotefontsize@#1}% + \noindent\csuse{Xtxtbeforenotes@#1}\par% + \splittopskip=\ht\strutbox + \expandafter + \rigidbalance\csname #1footins\endcsname \thr@@ \splittopskip}} +\newcommand*{\mpthreecolfootgroup}[1]{{% + \vskip\skip\@nameuse{mp#1footins} + \ifl@dpairing\ifparledgroup% + \leavevmode\marks\parledgroup@{begin}% + \marks\parledgroup@series{#1}% + \marks\parledgroup@type{Xfootnote}% + \fi\fi\normalcolor + \ifparledgroup% + \ifl@dpairing% + \else% + \setXnoteswidthliketwocolumns@{#1}% + \setXnotespositionliketwocolumns@{#1}% + \print@Xfootnoterule{#1}% + \fi% + \else% + \setXnoteswidthliketwocolumns@{#1}% + \setXnotespositionliketwocolumns@{#1}% + \print@Xfootnoterule{#1}% + \fi% + {\csuse{Xnotefontsize@#1}\noindent\csuse{Xtxtbeforenotes@#1}}\par + \splittopskip=\ht\strutbox + \expandafter + \rigidbalance\csname mp#1footins\endcsname \thr@@ \splittopskip}} + +\newcommand*{\Xarrangement@twocol}[1]{% + \csgdef{series@display#1}{twocol} + \expandafter\let\csname v#1footnote\endcsname=\twocolvfootnote + \expandafter\let\csname #1footfmt\endcsname=\twocolfootfmt + \expandafter\let\csname #1footgroup\endcsname=\twocolfootgroup + \dimen\csname #1footins\endcsname=\csuse{Xmaxhnotes@#1}% + \skip\csname #1footins\endcsname=\csuse{Xbeforenotes@#1}% + \advance\skip\csname #1footins\endcsname by\csuse{Xafterrule@#1}% + \twocolfootsetup{#1} + \ifnoledgroup@\else + \expandafter\let\csname mpv#1footnote\endcsname=\mpnormalvfootnote + \expandafter\let\csname mp#1footgroup\endcsname=\mptwocolfootgroup + \skip\csname mp#1footins\endcsname=\csuse{Xbeforenotes@#1}% + \advance\skip\csname mp#1footins\endcsname by\csuse{Xafterrule@#1}% + \mptwocolfootsetup{#1} + \fi +} + +\newcommand*{\twocolfootsetup}[1]{% + \count\csname #1footins\endcsname 500 + \csxdef{default@#1footins}{500}%Use this to confine the notes to one side only + \multiply\dimen\csname #1footins\endcsname \tw@} +\notbool{parapparatus@}{\newcommand*}{\newcommand}{\twocolvfootnote}[2]{\insert\csname #1footins\endcsname\bgroup + \csuse{Xnotefontsize@#1} + \footsplitskips + \csname #1footfmt\endcsname #2{#1}\egroup} +\notbool{parapparatus@}{\newcommand*}{\newcommand}{\twocolfootfmt}[4]{% 4th arg is optional, for backward compatibility + \normal@pars + \hsize \csuse{Xhsizetwocol@#4} + \nottoggle{Xparindent@#4}{\parindent=\z@}{} + \tolerance=5000 + \hangindent=\csuse{Xhangindent@#4} + \leavevmode + \csuse{Xcolalign@#4}% + \strut{\printlinefootnote{#1}{#4}}% + {\nottoggle{Xlemmadisablefontselection@#4}{\select@lemmafont#1|#2}{#2}}% + \iftoggle{nosep@}{\hskip\csuse{Xinplaceoflemmaseparator@#4}}{\ifcsempty{Xlemmaseparator@#4}% + {\hskip\csuse{Xinplaceoflemmaseparator@#4}}% + {\nobreak\hskip\csuse{Xbeforelemmaseparator@#4}\csuse{Xlemmaseparator@#4}\hskip\csuse{Xafterlemmaseparator@#4}% + }}% + #3\strut\par\allowbreak} +\newcommand*{\twocolfootgroup}[1]{{\csuse{Xnotefontsize@#1} + \noindent\csuse{Xtxtbeforenotes@#1}\par% + \splittopskip=\ht\strutbox + \expandafter + \rigidbalance\csname #1footins\endcsname \tw@ \splittopskip}} + +\newcommand*{\mptwocolfootsetup}[1]{% + \count\csname mp#1footins\endcsname 500 + \multiply\dimen\csname mp#1footins\endcsname \tw@} +\newcommand*{\mptwocolfootgroup}[1]{{% + \vskip\skip\@nameuse{mp#1footins} + \ifl@dpairing\ifparledgroup% + \leavevmode\marks\parledgroup@{begin}% + \marks\parledgroup@series{#1}% + \marks\parledgroup@type{Xfootnote}% + \fi\fi\normalcolor + \ifparledgroup% + \ifl@dpairing% + \else% + \setXnoteswidthliketwocolumns@{#1}% + \setXnotespositionliketwocolumns@{#1}% + \print@Xfootnoterule{#1}% + \fi% + \else% + \setXnoteswidthliketwocolumns@{#1}% + \setXnotespositionliketwocolumns@{#1}% + \print@Xfootnoterule{#1}% + \fi% + {\csuse{Xnotefontsize@#1}\noindent\csuse{Xtxtbeforenotes@#1}}\par + \splittopskip=\ht\strutbox + \expandafter + \rigidbalance\csname mp#1footins\endcsname \tw@ \splittopskip}} + + +\def\endashchar{\textnormal{--}} +\newcommand*{\fullstop}{\textnormal{.}} +\newcommand*{\rbracket}{\textnormal{% + \csuse{text\csuse{footnote@lang}}{% + \ifluatex% + \ifdefstring{\footnote@luatextextdir}{TRT}{\thinspace[}{\thinspace]}% + \else% + \thinspace]% + \fi}% + }% +} + +\newcommand{\printpstart}[0]{% + \ifboolexpr{bool{l@dpairing} or bool{l@dprintingpages} or bool{l@dprintingcolumns}}{% + \ifledRcol% + \thepstartR% + \else% + \thepstartL% + \fi% + }{% + \thepstart% + }% +} +\newcommand{\printlinefootnote}[2]{% + \def\extractline@##1|##2|##3|##4|##5|##6|##7|{##2}% + \def\extractsubline@##1|##2|##3|##4|##5|##6|##7|{##3}% + \def\extractendline@##1|##2|##3|##4|##5|##6|##7|{##5}% + \def\extractendsubline@##1|##2|##3|##4|##5|##6|##7|{##6}% + \iftoggle{Xnumberonlyfirstintwolines@#2}{% + \edef\lineinfo@{\extractline@ #1| - \extractsubline@ #1| - \extractendline@ #1| - \extractendsubline@ #1|}% + }% + {% + \edef\lineinfo@{\extractline@ #1| - \extractsubline@ #1|}% + }% + \iftoggle{nonum@}{%Try if the line number must printed for this specific not (by default, yes) + \hspace{\csuse{Xinplaceofnumber@#2}}% + }% + {% + {% + \iftoggle{Xnonumber@#2}%Try if the line number must printed (by default, yes) + {% + \hspace{\csuse{Xinplaceofnumber@#2}}% + }% + {% + {\iftoggle{Xnumberonlyfirstinline@#2}% If for this series the line number must be printed only in the first time. + {% + \ifcsdef{prevline#2}% + {%Be sure the \prevline exists. + \ifcsequal{prevline#2}{lineinfo@}%Try it + {% + \ifcsempty{Xsymlinenum@#2}% + {% + \hspace{\csuse{Xinplaceofnumber@#2}}% + }% + {\hspace{\csuse{Xbeforesymlinenum@#2}}\csuse{Xnotenumfont@#2}% + \ifdimequal{\csuse{Xboxsymlinenum@#2}}{0pt}% + {\csuse{Xsymlinenum@#2}}% + {\hbox to \csuse{Xboxsymlinenum@#2}{\csuse{Xsymlinenum@#2}\hfill}}% + \hspace{\csuse{Xaftersymlinenum@#2}}}% + }% + {% + \printlinefootnotearea{#1}{#2}% + }% + }% + {% + \printlinefootnotearea{#1}{#2}% + }% + }% + {% + \printlinefootnotearea{#1}{#2}% + }% + \csxdef{prevline#2}{\lineinfo@}% + }% + }% + }% + }% +} +\newcommand{\printlinefootnotearea}[2]{% + \printXbeforenumber{#2}% + \csuse{Xnotenumfont@#2}% + \boxfootnotenumbers{#1}{#2}% + \printXafternumber{#2}% +}% +\newcommand{\boxfootnotenumbers}[2]{% + \ifdimequal{\csuse{Xboxlinenum@#2}}{0pt}{% + \printlinefootnotenumbers{#1}{#2}% + }% + {% + \hbox to \csuse{Xboxlinenum@#2}% + {% + \IfSubStr{RC}{\csuse{Xboxlinenumalign@#2}}{\hfill}{}% + \printlinefootnotenumbers{#1}{#2}% + \IfSubStr{LC}{\csuse{Xboxlinenumalign@#2}}{\hfill}{}% + }% + }% +}% +\newcommand{\printlinefootnotenumbers}[2]{% + \xdef\@currentseries{#2}% + \ifboolexpr{% + (togl{Xpstart@#2} and bool{numberpstart})% + or togl{Xpstarteverytime@#2}}% + {\printpstart}{}% + \iftoggle{Xonlypstart@#2}{}{\printlines#1|}% +}% +\newcommand{\printXbeforenumber}[1]{% + \hspace{\csuse{Xbeforenumber@#1}}% +}% +\newcommand{\printXafternumber}[1]{% + \iftoggle{Xnonbreakableafternumber@#1}{\nobreak}{}% + \hspace{\csuse{Xafternumber@#1}}% +}% +\newif\ifl@d@pnum +\newif\ifl@d@ssub +\newif\ifl@d@elin +\newif\ifl@d@esl +\newif\ifl@d@dash +\newif\ifl@d@Xtwolines% +\newif\ifl@d@Xmorethantwolines% +\newcommand*{\l@dparsefootspec}[3]{\l@dp@rsefootspec#1|} +\def\l@dp@rsefootspec#1|#2|#3|#4|#5|#6|#7|{% + \gdef\l@dparsedstartpage{#1}% + \gdef\l@dparsedstartline{#2}% + \gdef\l@dparsedstartsub{#3}% + \gdef\l@dparsedendpage{#4}% + \gdef\l@dparsedendline{#5}% + \gdef\l@dparsedendsub{#6}% +} +\def\l@dparsedstartpage{0}% +\def\l@dparsedstartline{0}% +\def\l@dparsedstartsub{0}% +\def\l@dparsedendpage{0}% +\def\l@dparsedendline{0}% +\def\l@dparsedendsub{0}% + +\newcommand*{\setprintlines}[6]{% + \l@d@pnumfalse \l@d@dashfalse + \ifbypage@ + \ifnum#4=#1 \else + \l@d@pnumtrue + \l@d@dashtrue + \fi + \fi + \ifl@d@pnum \l@d@elintrue \else \l@d@elinfalse \fi + \ifnum#2=#5 \else + \l@d@elintrue + \l@d@dashtrue + \fi + \l@d@ssubfalse + \ifnum#3=0 \else + \l@d@ssubtrue + \fi + \l@d@eslfalse + \ifnum#6=0 \else + \ifnum#6=#3 + \ifl@d@elin \l@d@esltrue \else \l@d@eslfalse \fi + \else + \l@d@esltrue + \l@d@dashtrue + \fi + \fi% + \ifl@d@dash% + \ifboolexpr{togl{fulllines@} or test{\ifcsempty{Xtwolines@\@currentseries}}}% + {}% + {% + \setistwofollowinglines{#1}{#2}{#4}{#5}% + \ifboolexpr{% + (% + togl {Xtwolinesbutnotmore@\@currentseries}% + and not% + (% + bool {istwofollowinglines@}% + )% + )% + or% + (% + (not test{\ifnumequal{#1}{#4}})% + and togl{Xtwolinesonlyinsamepage@\@currentseries}% + )% + }% + {}% + {% + \l@d@dashfalse% + \l@d@Xtwolinestrue% + \l@d@elinfalse% + \l@d@eslfalse% + \ifcsempty{Xmorethantwolines@\@currentseries}% + {}% + {\ifistwofollowinglines@\else% + \l@d@Xmorethantwolinestrue% + \fi% + }% + }% + }% + \fi% +}% +\newif\ifistwofollowinglines@% +\newcommand{\setistwofollowinglines}[4]{% + \ifcsdef{lastlinenumberon@#1}% + {\numdef{\tmp}{\csuse{lastlinenumberon@#1}}}% + {\numdef{\tmp}{0}}% + \istwofollowinglines@false% + \ifnumequal{#4-#2}{1}% + {\istwofollowinglines@true}% + {\ifbypage@% + \ifnumequal{#3-#1}{1}% + {% + \ifnumequal{#2}{\tmp}% + {\ifnumequal{#4}{1}{\istwofollowinglines@true}{}}% + {}% + }% + {}% + \fi% + }% +}% +\def\printlines#1|#2|#3|#4|#5|#6|#7|{% + \begingroup% + \ifluatex% + \luatextextdir TLT% + \fi% + \setprintlines{#1}{#2}{#3}{#4}{#5}{#6}% + \ifdimequal{\csuse{Xboxstartlinenum@\@currentseries}}{0pt}% + {\bgroup}% + {\leavevmode\hbox to \csuse{Xboxstartlinenum@\@currentseries}\bgroup\hfill}% + \ifl@d@pnum #1\fullstop\fi + \linenumrep{#2} + \ifl@d@ssub \fullstop \sublinenumrep{#3}\fi + \egroup% + \ifdimequal{\csuse{Xboxendlinenum@\@currentseries}}{0pt}% + {\bgroup}% + {\hbox to \csuse{Xboxendlinenum@\@currentseries}\bgroup}% + \ifl@d@Xtwolines% + \ifl@d@Xmorethantwolines% + \csuse{Xmorethantwolines@\@currentseries}% + \else% + \csuse{Xtwolines@\@currentseries}% + \fi% + \else% + \ifl@d@dash \endashchar\fi% + \ifl@d@pnum #4\fullstop\fi% + \ifl@d@elin \linenumrep{#5}\fi% + \ifl@d@esl \ifl@d@elin \fullstop\fi \sublinenumrep{#6}\fi% + \fi% + \ifdimequal{\csuse{Xboxendlinenum@\@currentseries}}{0pt}% + {}% + {\hfill}%Prevent underfull hbox + \egroup% + \endgroup% +}% +\providecommand*{\multiplefootnotemarker}{3sp} +\providecommand*{\multfootsep}{\textsuperscript{\normalfont,}} + +\providecommand*{\m@mmf@prepare}{% + \kern-\multiplefootnotemarker + \kern\multiplefootnotemarker\relax} +\providecommand*{\m@mmf@check}{% + \ifdim\lastkern=\multiplefootnotemarker\relax + \edef\@x@sf{\the\spacefactor}% + \unkern + \multfootsep + \spacefactor\@x@sf\relax + \fi} + +\@ifclassloaded{memoir}{}{% +\apptocmd{\@footnotetext}{\m@mmf@prepare}{}{} + +\patchcmd{\@footnotemark} + {\nobreak} + {\m@mmf@check + \nobreak + } + {}{} +\patchcmd{\@footnotemark} + {\@makefnmark} + {\@makefnmark + \m@mmf@prepare + } + {}{} +} + +\pretocmd{\@footnotetext}{% + \ifnumberedpar@ + \edtext{}{\l@dbfnote{#1}}% + \else + }{}{} +\apptocmd{\@footnotetext}{\fi}{}{}% + +\newcommand{\l@dbfnote}[1]{% + \ifnumberedpar@ + \gdef\@tag{#1\relax}% + \ifledRcol% + \xright@appenditem{\noexpand\vl@dbfnote{{\expandonce\@tag}}{\@thefnmark}}% + \to\inserts@listR + \global\advance\insert@countR \@ne% + \else% + \xright@appenditem{\noexpand\vl@dbfnote{{\expandonce\@tag}}{\@thefnmark}}% + \to\inserts@list + \global\advance\insert@count \@ne% + \fi + \fi\ignorespaces} + +\newcommand{\vl@dbfnote}[2]{% + \def\@thefnmark{#2}% + \@footnotetext{#1}% + }% +\newcommand*{\prebodyfootmark}{% + \leavevmode + \ifhmode + \edef\@x@sf{\the\spacefactor}% + \m@mmf@check + \nobreak + \fi} +\newcommand{\postbodyfootmark}{% + \m@mmf@prepare + \ifhmode\spacefactor\@x@sf\fi\relax} + +\newcommandx{\arrangementX}[2][1,usedefault]{% + \def\do##1{% + \csname arrangementX@#2\endcsname{##1}% + }% + \ifstrempty{#1}% + {% + \dolistloop{\@series}% + }% + { + \docsvlist{#1}% + }% +}% +\newcommand*{\normal@footnotemarkX}[1]{% + \prebodyfootmark + \@nameuse{bodyfootmark#1}% + \postbodyfootmark} + +\newcommand*{\normalbodyfootmarkX}[1]{% + \hbox{\textsuperscript{\normalfont\@nameuse{@thefnmark#1}}}} +\notbool{parapparatus@}{\newcommand*}{\newcommand}{\normalvfootnoteX}[2]{% + \insert\@nameuse{footins#1}\bgroup + \csuse{bhooknoteX@#1} + \csuse{notefontsizeX@#1} + \footsplitskips + \ifl@dpairing\ifl@dpaging\else% + \setnoteswidthliketwocolumnsX@{#1}% + \fi\fi% + \setnotesXpositionliketwocolumns@{#1}% + \spaceskip=\z@skip \xspaceskip=\z@skip + \csuse{\csuse{footnote@dir}}\@nameuse{footfmt#1}{#1}{#2}\egroup} + +\newcommand*{\mpnormalvfootnoteX}[2]{% + \global\setbox\@nameuse{mpfootins#1}\vbox{% + \unvbox\@nameuse{mpfootins#1} + \csuse{bhooknoteX@#1} + \csuse{notefontsizeX@#1} + \hsize\columnwidth + \@parboxrestore + \color@begingroup + \@nameuse{footfmt#1}{#1}{#2}\color@endgroup}} + +\notbool{parapparatus@}{\newcommand*}{\newcommand}{\normalfootfmtX}[2]{% + \ifluatex% + \luatextextdir\footnote@luatextextdir% + \luatexpardir\footnote@luatexpardir% + \par% + \fi% + \protected@edef\@currentlabel{% + \@nameuse{@thefnmark#1}% + }% + \ledsetnormalparstuffX{#1}% + \hangindent=\csuse{hangindentX@#1}% + {{\csuse{notenumfontX@#1}\@nameuse{footfootmark#1}}\strut% + #2\strut\par}} + +\newcommand*{\normalfootfootmarkX}[1]{% + \textsuperscript{\@nameuse{@thefnmark#1}}} + +\newcommand*{\normalfootstartX}[1]{% + \ifdimequal{0pt}{\prenotesX@}{}% + {% + \iftoggle{prenotesX@}{% + \togglefalse{prenotesX@}% + \skip\csname footins#1\endcsname=% + \dimexpr\csuse{prenotesX@}+\csuse{afterruleX@#1}\relax% + }% + {}% + }% + \vskip\skip\csname footins#1\endcsname% + \leftskip=\z@ + \rightskip=\z@ + \ifl@dpairing\else% + \hsize=\old@hsize% + \fi% + \setnoteswidthliketwocolumnsX@{#1}% + \setnotesXpositionliketwocolumns@{#1}% + \print@footnoteXrule{#1}% +}% + +\let\normalfootnoteruleX=\footnoterule + +\newcommand*{\normalfootgroupX}[1]{% + \unvbox\@nameuse{footins#1}% + \hsize=\old@hsize% + }% + +\newcommand*{\mpnormalfootgroupX}[1]{% + \vskip\skip\@nameuse{mpfootins#1} + \ifl@dpairing\ifparledgroup% + \leavevmode\marks\parledgroup@{begin}% + \marks\parledgroup@series{#1}% + \marks\parledgroup@type{footnoteX}% + \fi\fi\normalcolor + \ifparledgroup% + \ifl@dpairing% + \else% + \setnoteswidthliketwocolumnsX@{#1}% + \setnotesXpositionliketwocolumns@{#1}% + \print@footnoteXrule{#1}% + \fi% + \else% + \setnoteswidthliketwocolumnsX@{#1}% + \setnotesXpositionliketwocolumns@{#1}% + \print@footnoteXrule{#1}% + \fi% + \unvbox\@nameuse{mpfootins#1}} + + +\newcommand{\normalbfnoteX}[2]{% + \ifnumberedpar@ + \ifledRcol% + \ifluatex + \footnotelang@lua[R]% + \fi + \@ifundefined{xpg@main@language}%if polyglossia + {}% + {\footnotelang@poly[R]}% + \protected@xdef\thisfootnote{\csuse{thefootnote#1}}% + \xright@appenditem{\noexpand\vbfnoteX{#1}{#2}{\expandonce\thisfootnote}}% + \to\inserts@listR + \global\advance\insert@countR \@ne% + \else% + \ifluatex + \footnotelang@lua% + \fi + \@ifundefined{xpg@main@language}%if polyglossia + {}% + {\footnotelang@poly}% + \protected@xdef\thisfootnote{\csuse{thefootnote#1}}% + \xright@appenditem{\noexpand\vbfnoteX{#1}{#2}{\expandonce\thisfootnote}}% + \to\inserts@list + \global\advance\insert@count \@ne% + \fi + \fi\ignorespaces} + +\newcommand{\vbfnoteX}[3]{% + \@namedef{@thefnmark#1}{#3}% + \@nameuse{regvfootnote#1}{#1}{#2}} + +\newcommand{\vnumfootnoteX}[2]{% + \ifnumberedpar@ + \edtext{}{\normalbfnoteX{#1}{#2}}% + \else + \@nameuse{regvfootnote#1}{#1}{#2}% + \fi} + +\newcommand*{\arrangementX@normal}[1]{% + \csgdef{series@displayX#1}{normal} + \expandafter\let\csname footstart#1\endcsname=\normalfootstartX + \expandafter\newcount\csname prevpage#1@num\endcsname + \@namedef{@footnotemark#1}{\normal@footnotemarkX{#1}} + \@namedef{bodyfootmark#1}{\normalbodyfootmarkX{#1}} + \expandafter\let\csname regvfootnote#1\endcsname=\normalvfootnoteX + \expandafter\let\csname vfootnote#1\endcsname=\vnumfootnoteX + \expandafter\let\csname footfmt#1\endcsname=\normalfootfmtX + \@namedef{footfootmark#1}{\normalfootfootmarkX{#1}} + \expandafter\let\csname footgroup#1\endcsname=\normalfootgroupX + \expandafter\let\csname footnoterule#1\endcsname=\normalfootnoteruleX + \count\csname footins#1\endcsname=1000 + \csxdef{default@footins#1}{1000}%Use to have note only for one side + \dimen\csname footins#1\endcsname=\csuse{maxhnotesX@#1} + \skip\csname footins#1\endcsname=\csuse{beforenotesX@#1}% + \advance\skip\csname footins#1\endcsname by\csuse{afterruleX@#1}% + \ifnoledgroup@\else% + \expandafter\let\csname mpvfootnote#1\endcsname=\mpnormalvfootnoteX + \expandafter\let\csname mpfootgroup#1\endcsname=\mpnormalfootgroupX + \count\csname mpfootins#1\endcsname=1000 + \dimen\csname mpfootins#1\endcsname=\csuse{maxhnotesX@#1} + \skip\csname mpfootins#1\endcsname=\csuse{beforenotesX@#1}% + \advance\skip\csname mpfootins#1\endcsname by\csuse{afterruleX@#1}% + \fi +} + +\newcommand*{\arrangementX@twocol}[1]{% + \csgdef{series@displayX#1}{twocol} + \expandafter\let\csname regvfootnote#1\endcsname=\twocolvfootnoteX + \expandafter\let\csname footfmt#1\endcsname=\twocolfootfmtX + \expandafter\let\csname footgroup#1\endcsname=\twocolfootgroupX + \dimen\csname footins#1\endcsname=\csuse{maxhnotesX@#1}% + \skip\csname footins#1\endcsname=\csuse{beforenotesX@#1}% + \advance\skip\csname footins#1\endcsname by \csuse{afterruleX@#1}\relax% + \twocolfootsetupX{#1} + \ifnoledgroup@\else% + \expandafter\let\csname mpvfootnote#1\endcsname=\mpnormalvfootnoteX + \expandafter\let\csname mpfootgroup#1\endcsname=\mptwocolfootgroupX + \skip\csname mpfootins#1\endcsname=\csuse{beforenotesX@#1}% + \advance\skip\csname mpfootins#1\endcsname by\csuse{afterruleX@#1} + \mptwocolfootsetupX{#1} + \fi% +} + +\newcommand*{\twocolfootsetupX}[1]{% + \count\csname footins#1\endcsname 500 + \csxdef{default@footins#1}{500}%Use this to confine the notes to one side only + \multiply\dimen\csname footins#1\endcsname by \tw@} +\newcommand*{\mptwocolfootsetupX}[1]{% + \count\csname mpfootins#1\endcsname 500 + \multiply\dimen\csname mpfootins#1\endcsname by \tw@} + +\notbool{parapparatus@}{\newcommand*}{\newcommand}{\twocolvfootnoteX}[2]{% + \insert\csname footins#1\endcsname\bgroup + \csuse{notefontsizeX@#1} + \footsplitskips + \spaceskip=\z@skip \xspaceskip=\z@skip + \@nameuse{footfmt#1}{#1}{#2}\egroup} + +\notbool{parapparatus@}{\newcommand*}{\newcommand}{\twocolfootfmtX}[2]{% + \protected@edef\@currentlabel{% + \@nameuse{@thefnmark#1}% + }% + \normal@pars + \hangindent=\csuse{hangindentX@#1}% + \hsize \csuse{hsizetwocolX@#1} + \nottoggle{parindentX@#1}{\parindent=\z@}{} + \tolerance=5000\relax + \leavevmode + \csuse{colalignX@#1}% + {\csuse{notenumfontX@#1}\@nameuse{footfootmark#1}\strut% + #2\strut\par}\allowbreak} + +\newcommand*{\twocolfootgroupX}[1]{{\csuse{notefontsizeX@#1} + \splittopskip=\ht\strutbox + \expandafter + \rigidbalance\csname footins#1\endcsname \tw@ \splittopskip}} +\newcommand*{\mptwocolfootgroupX}[1]{{% + \vskip\skip\@nameuse{mpfootins#1} + \ifl@dpairing\ifparledgroup% + \leavevmode\marks\parledgroup@{begin}% + \marks\parledgroup@series{#1}% + \marks\parledgroup@type{footnoteX}% + \fi\fi\normalcolor + \ifparledgroup% + \ifl@dpairing% + \else% + \setnoteswidthliketwocolumnsX@{#1}% + \setnotesXpositionliketwocolumns@{#1}% + \print@footnoteXrule{#1}% + \fi% + \else% + \setnoteswidthliketwocolumnsX@{#1}% + \setnotesXpositionliketwocolumns@{#1}% + \print@footnoteXrule{#1}% + \fi% + \splittopskip=\ht\strutbox + \expandafter + \rigidbalance\csname mpfootins#1\endcsname \tw@ \splittopskip}} + +\newcommand*{\arrangementX@threecol}[1]{% + \csgdef{series@displayX#1}{threecol} + \expandafter\let\csname regvfootnote#1\endcsname=\threecolvfootnoteX + \expandafter\let\csname footfmt#1\endcsname=\threecolfootfmtX + \expandafter\let\csname footgroup#1\endcsname=\threecolfootgroupX + \dimen\csname footins#1\endcsname=\csuse{maxhnotesX@#1}% + \skip\csname footins#1\endcsname=\csuse{beforenotesX@#1}% + \advance\skip\csname footins#1\endcsname by \csuse{afterruleX@#1}\relax% + \threecolfootsetupX{#1} + \ifnoledgroup@\else% + \expandafter\let\csname mpvfootnote#1\endcsname=\mpnormalvfootnoteX + \expandafter\let\csname mpfootgroup#1\endcsname=\mpthreecolfootgroupX + \skip\csname mpfootins#1\endcsname=\csuse{beforenotesX@#1}% + \advance\skip\csname mpfootins#1\endcsname by\csuse{afterruleX@#1} + \mpthreecolfootsetupX{#1} + \fi% +} + +\newcommand*{\threecolfootsetupX}[1]{% + \count\csname footins#1\endcsname 333 + \csxdef{default@footins#1}{333}%Use this to confine the notes to one side only + \multiply\dimen\csname footins#1\endcsname by \thr@@} +\newcommand*{\mpthreecolfootsetupX}[1]{% + \count\csname mpfootins#1\endcsname 333 + \multiply\dimen\csname mpfootins#1\endcsname by \thr@@} + +\notbool{parapparatus@}{\newcommand*}{\newcommand}{\threecolvfootnoteX}[2]{% + \insert\csname footins#1\endcsname\bgroup + \csuse{notefontsizeX@#1} + \footsplitskips + \@nameuse{footfmt#1}{#1}{#2}\egroup} + +\notbool{parapparatus@}{\newcommand*}{\newcommand}{\threecolfootfmtX}[2]{% + \protected@edef\@currentlabel{% + \@nameuse{@thefnmark#1}% + }% + \hangindent=\csuse{hangindentX@#1}% + \normal@pars + \hsize \csuse{hsizethreecolX@#1} + \nottoggle{parindentX@#1}{\parindent=\z@}{} % + \tolerance=5000\relax + \leavevmode + \csuse{colalignX@#1}% + {\csuse{notenumfontX@#1}\@nameuse{footfootmark#1}\strut% + #2\strut\par}\allowbreak} + +\newcommand*{\threecolfootgroupX}[1]{{\csuse{notefontsizeX@#1} + \splittopskip=\ht\strutbox + \expandafter + \rigidbalance\csname footins#1\endcsname \thr@@ \splittopskip}} +\newcommand*{\mpthreecolfootgroupX}[1]{{% + \vskip\skip\@nameuse{mpfootins#1} + \ifl@dpairing\ifparledgroup + \leavevmode\marks\parledgroup@{begin}% + \marks\parledgroup@series{#1}% + \marks\parledgroup@type{footnoteX}% + \fi\fi\normalcolor + \ifparledgroup% + \ifl@dpairing% + \else% + \setnoteswidthliketwocolumnsX@{#1}% + \setnotesXpositionliketwocolumns@{#1}% + \print@footnoteXrule{#1}% + \fi% + \else% + \setnoteswidthliketwocolumnsX@{#1}% + \setnotesXpositionliketwocolumns@{#1}% + \print@footnoteXrule{#1}% + \fi% + \splittopskip=\ht\strutbox + \expandafter + \rigidbalance\csname mpfootins#1\endcsname \thr@@ \splittopskip}} + +\newcommand*{\arrangementX@paragraph}[1]{% + \csgdef{series@displayX#1}{paragraph}% + \expandafter\newcount\csname #1prevpage@num\endcsname + \expandafter\let\csname footstart#1\endcsname=\parafootstartX + \expandafter\let\csname regvfootnote#1\endcsname=\para@vfootnoteX + \expandafter\let\csname footfmt#1\endcsname=\parafootfmtX + \expandafter\let\csname footgroup#1\endcsname=\para@footgroupX + \expandafter\let\csname footnoterule#1\endcsname=\normalfootnoteruleX + \count\csname footins#1\endcsname=1000 + \csxdef{default@footins#1}{1000}%Use this to confine the notes to one side only + \dimen\csname footins#1\endcsname=\csuse{maxhnotesX@#1} + \skip\csname footins#1\endcsname=\csuse{beforenotesX@#1}% + \advance\skip\csname footins#1\endcsname by\csuse{afterruleX@#1}% + \para@footsetupX{#1} + \ifnoledgroup@\else + \expandafter\let\csname mpvfootnote#1\endcsname=\mppara@vfootnoteX + \expandafter\let\csname mpfootgroup#1\endcsname=\mppara@footgroupX + \count\csname mpfootins#1\endcsname=1000 + \dimen\csname mpfootins#1\endcsname=\csuse{maxhnotesX@#1} + \skip\csname mpfootins#1\endcsname=\csuse{beforenotesX@#1}% + \advance\skip\csname mpfootins#1\endcsname by\csuse{afterruleX@#1}% + \fi + } + +\newcommand*{\para@footsetupX}[1]{{\csuse{notefontsizeX@#1} + \setnoteswidthliketwocolumnsX@{#1}% + \dimen0=\baselineskip + \multiply\dimen0 by 1024 + \divide\dimen0 by \columnwidth \multiply\dimen0 by \footfudgefiddle\relax% + \expandafter + \xdef\csname footfudgefactor#1\endcsname{% + \expandafter\strip@pt\dimen0 }}} + +\newcommand*{\parafootstartX}[1]{% + \ifdimequal{0pt}{\prenotesX@}{}% + {% + \iftoggle{prenotesX@}{% + \togglefalse{prenotesX@}% + \skip\csname footins#1\endcsname=% + \dimexpr\csuse{prenotesX@}+\csuse{afterruleX@#1}\relax% + }% + {}% + }% + \vskip\skip\csname footins#1\endcsname% + \leftskip=\z@ + \rightskip=\z@ + \parindent=\z@ + \vskip\skip\@nameuse{footins#1}% + \setnoteswidthliketwocolumnsX@{#1}% + \setnotesXpositionliketwocolumns@{#1}% + \print@footnoteXrule{#1}% + } + +\newcommand*{\para@vfootnoteX}[2]{% + \insert\csname footins#1\endcsname + \bgroup + \csuse{bhooknoteX@#1} + \csuse{notefontsizeX@#1} + \footsplitskips + \setbox0=\vbox{\hsize=\maxdimen + \noindent\@nameuse{footfmt#1}{#1}{#2}}% + \setbox0=\hbox{\unvxhX{0}{#1}}% + \dp0=\z@ + \ht0=\csname footfudgefactor#1\endcsname\wd0 + \box0 + \penalty0 + \egroup} +\newcommand*{\mppara@vfootnoteX}[2]{% + \global\setbox\@nameuse{mpfootins#1}\vbox{% + \unvbox\@nameuse{mpfootins#1} + \csuse{bhooknoteX@#1} + \csuse{notefontsizeX@#1} + \footsplitskips + \setbox0=\vbox{\hsize=\maxdimen + \noindent\color@begingroup\@nameuse{footfmt#1}{#1}{#2}\color@endgroup}% + \setbox0=\hbox{\unvxhX{0}{#1}}% + \dp0=\z@ + \ht0=\csname footfudgefactor#1\endcsname\wd0 + \box0 + \penalty0}} + +\newcommand*{\unvxhX}[2]{% 2th is optional for retro-compatibility + \setbox0=\vbox{\unvbox#1% + \global\setbox1=\lastbox}% + \unhbox1 + \unskip % remove \rightskip, + \unskip % remove \parfillskip, + \unpenalty % remove \penalty of 10000, + \hskip\csuse{afternoteX@#2}} % but add the glue to go between the notes + +\newcommand*{\parafootfmtX}[2]{% + \protected@edef\@currentlabel{% + \@nameuse{@thefnmark#1}% + }% + \insertparafootsepX{#1}% + \ledsetnormalparstuffX{#1}% + {\csuse{notenumfontX@#1}% + \csuse{notenumfontX@#1}% + \@nameuse{footfootmark#1}% + \strut% + #2\penalty-10}} + +\newcommand*{\para@footgroupX}[1]{% + \unvbox\csname footins#1\endcsname + \ifcsstring{raggedX@#1}{L}{\RaggedLeft}{}% + \ifcsstring{raggedX@#1}{R}{\RaggedRight}{}% + \makehboxofhboxes + \setbox0=\hbox{\unhbox0 \removehboxes}% + \csuse{notefontsizeX@#1} + \noindent\unhbox0\par} +\newcommand*{\mppara@footgroupX}[1]{{% + \setnoteswidthliketwocolumnsX@{#1}% + \vskip\skip\@nameuse{mpfootins#1} + \ifl@dpairing\ifparledgroup + \leavevmode% + \leavevmode\marks\parledgroup@{begin}% + \marks\parledgroup@series{#1}% + \marks\parledgroup@type{footnoteX}% + \fi\fi\normalcolor + \ifparledgroup% + \ifl@dpairing% + \else% + \setnoteswidthliketwocolumnsX@{#1}% + \setnotesXpositionliketwocolumns@{#1}% + \print@footnoteXrule{#1}% + \fi% + \else% + \setnoteswidthliketwocolumnsX@{#1}% + \setnotesXpositionliketwocolumns@{#1}% + \print@footnoteXrule{#1}% + \fi% + \unvbox\csname mpfootins#1\endcsname + \ifcsstring{raggedX@#1}{L}{\RaggedLeft}{}% + \ifcsstring{raggedX@#1}{R}{\RaggedRight}{}% + \makehboxofhboxes + \setbox0=\hbox{\unhbox0 \removehboxes}% + \csuse{notefontsizeX@#1} + \noindent\unhbox0\par}} + +\newcommand{\insertparafootsepX}[1]{% + \ifnumequal{\csuse{prevpage#1@num}}{\page@num}% + {\csuse{parafootsepX@#1}}% + {}% +} +\newcommand*{\ledsetnormalparstuff@common}{% + \ifluatex% + \luatextextdir\footnote@luatextextdir% + \luatexpardir\footnote@luatexpardir% + \fi% + \csuse{\csuse{footnote@dir}}% + \normal@pars% + \parfillskip \z@ \@plus 1fil}% + +\newcommand*{\Xledsetnormalparstuff}[1]{% + \ledsetnormalparstuff@common% + \nottoggle{Xparindent@#1}{\noindent}{}%\noindent and and not \parindent=0pt to avoid to break the (bad) change made when moving from ledmac to eledmac +}% + +\newcommand*{\ledsetnormalparstuffX}[1]{% + \ledsetnormalparstuff@common% + \nottoggle{parindentX@#1}{\noindent}{}%\noindent and and not \parindent=0pt to avoid to break the (bad) change made when moving from ledmac to eledmac +}% + +\newdimen\old@hsize% +\AtBeginDocument{\old@hsize=\hsize}% + +\newcommand{\setXnoteswidthliketwocolumns@}[1]{% + \global\let\hsize@fornote=\hsize% + \global\old@hsize=\hsize% + \iftoggle{Xnoteswidthliketwocolumns@#1}% + {% + \csuse{setwidthliketwocolumns@\columns@position}% + \global\let\hsize@fornote=\hsize% + }% + {}% + \let\hsize=\hsize@fornote% + \let\columnwidth=\hsize@fornote% +}% + +\newcommand{\setnoteswidthliketwocolumnsX@}[1]{% + \global\let\hsize@fornote=\hsize% + \global\old@hsize=\hsize% + \iftoggle{noteswidthliketwocolumnsX@#1}% + {% + \csuse{setwidthliketwocolumns@\columns@position}% + \global\let\hsize@fornote=\hsize% + }% + {}% + \let\hsize=\hsize@fornote% + \let\columnwidth=\hsize@fornote% +}% + +\newcommand{\setXnotespositionliketwocolumns@}[1]{% + \iftoggle{Xnoteswidthliketwocolumns@#1}{% + \csuse{setnotespositionliketwocolumns@\columns@position}% + }{}% +}% + +\newcommand{\setnotesXpositionliketwocolumns@}[1]{% + \iftoggle{noteswidthliketwocolumnsX@#1}{% + \csuse{setnotespositionliketwocolumns@\columns@position}% + }{}% +}% + +\def\@fnpos{familiar-critical} +\def\@mpfnpos{critical-familiar} +\newcommand{\fnpos}[1]{\xdef\@fnpos{#1}} +\newcommand{\mpfnpos}[1]{\xdef\@mpfnpos{#1}} +\newcommand{\print@Xfootnoterule}[1]{% + \vskip-\csuse{Xafterrule@#1}%Because count in \dimen\csuse{#1footins} + \nointerlineskip% + \moveleft-\leftskip\vbox{\csuse{#1footnoterule}}% + \nointerlineskip% + \vskip\csuse{Xafterrule@#1}% +}% + +\newcommand{\print@footnoteXrule}[1]{% + \vskip-\csuse{afterruleX@#1}%Because count in \dimen\csuse{footins#1} + \nointerlineskip% + \moveleft-\leftskip\vbox{\csuse{footnoterule#1}}% + \nointerlineskip% + \vskip\csuse{afterruleX@#1}% +}% + +\newtoggle{preXnotes@} +\toggletrue{preXnotes@} +\newcommand{\preXnotes@}{0pt} +\newcommand*{\preXnotes}[1]{\renewcommand{\preXnotes@}{#1}} +\newtoggle{prenotesX@} +\toggletrue{prenotesX@} +\newcommand{\prenotesX@}{0pt} +\newcommand*{\prenotesX}[1]{\renewcommand{\prenotesX@}{#1}} +\gdef\firstXseries@{} +\newcommand{\prepare@preXnotes}[1]{% + \ifdimequal{0pt}{\preXnotes@}% + {}% + {% + \IfStrEq{\firstXseries@}{}{% + \global\skip\csuse{#1footins}=\preXnotes@% + \global\advance\skip\csname #1footins\endcsname by\csuse{Xafterrule@#1}% + \gdef\firstXseries@{#1}% + }% + {% + \ifseriesbefore{#1}{\firstXseries@}% + {% + \global\skip\csuse{#1footins}=\csuse{Xbeforenotes@\firstXseries@}% + \global\advance\skip\csname #1footins\endcsname by\csuse{Xafterrule@#1}% + \gdef\firstXseries@{#1}% + }% + {}% + }% + }% +} +\gdef\firstseriesX@{} +\newcommand{\prepare@prenotesX}[1]{% + \ifdimequal{0pt}{\prenotesX@}% + {}% + {% + \IfStrEq{\firstseriesX@}{}{% + \global\skip\csuse{footins#1}=\prenotesX@% + \global\advance\skip\csname footins#1\endcsname by\csuse{afterruleX@#1}% + \gdef\firstseriesX@{#1}% + }% + {% + \ifseriesbefore{#1}{\firstseriesX@}% + {% + \global\skip\csuse{footins#1}=\csuse{beforenotesX@\firstseriesX@}% + \global\advance\skip\csname footins#1\endcsname by\csuse{afterruleX@#1}% + \gdef\firstXseries@{#1}% + }% + {}% + }% + }% +} +\ifbool{noend@}{}{%Used instead of \ifnoend@ to prevent expansion problem +\newcommand{\l@dend@open}[1]{% + \global\booltrue{l@dend@#1}% + \expandafter\immediate% + \expandafter\openout% + \csname l@d@#1end\endcsname% + =\jobname.#1end\relax% +}% +\newcommand{\l@dend@close}[1]{% + \global\boolfalse{l@dend@#1}% + \expandafter\immediate% + \expandafter\closeout\csname l@d@#1end\endcsname% +}% + +\newcommand{\l@dend@stuff}{% + \def\do##1{% + \ifbool{l@dend@##1}{}% + {\l@dend@open{##1}}% + \expandafter\immediate\expandafter\write\csname l@d@##1end\endcsname{\string\l@d@section{\the\section@num}}% + }% + \dolistloop{\@series}% +}% + +\global\notbool{parapparatus@}{}{\long}\def\endprint#1#2#3#4#5{{% + \ifXendinsertsep@% + \hskip\csuse{Xendafternote@#4}% + \csuse{Xendsep@#4}% + \else% + \iftoggle{Xendparagraph@#4}% + {\global\Xendinsertsep@true}% + {}% + \fi% + \xdef\@currentseries{#4}% + \def\do##1{% + \toggletrue{##1@}% + }% + \notblank{#5}{\docsvlist{#5}}{}% + \csuse{Xendbhooknote@#4}% + \csuse{Xendnotefontsize@#4}% + \ifboolexpr{% + togl {nonum@}% + or togl {Xendnonumber@#4}% + }% + {\hspace{\csuse{Xendinplaceofnumber@#4}}}% + {\printlineendnotearea{#1}{#4}}% + \nottoggle{Xendlemmadisablefontselection@#4}% + {\select@lemmafont#1|#2}% + {#2}% + \ifboolexpr{% + togl {nosep@}% + or test{\ifcsempty{Xendlemmaseparator@#4}}% + }% + {\hskip\csuse{Xendinplaceoflemmaseparator@#4}}% + {\nobreak% + \hskip\csuse{Xendbeforelemmaseparator@#4}% + \csuse{Xendlemmaseparator@#4}% + \hskip\csuse{Xendafterlemmaseparator@#4}% + }% + #3% + \nottoggle{Xendparagraph@#4}{\par}{}% + \def\do##1{% + \togglefalse{##1@}% + }% + \notblank{#5}{\docsvlist{#5}}{}% +}}% + +\let\l@d@section=\@gobble + +\newcommand{\printlineendnotearea}[2]{% + \bgroup% + \csuse{Xendnotenumfont@#2}% + \ifdimequal{\csuse{Xendboxlinenum@#2}}{0pt}% + {\printendlines#1|}% + {\leavevmode% + \hbox to \csuse{Xendboxlinenum@#2}% + {% + \IfSubStr{RC}{\csuse{Xendboxlinenumalign@#2}}{\hfill}{}% + \printendlines#1|% + \IfSubStr{LC}{\csuse{Xendboxlinenumalign@#2}}{\hfill}{}% + }}% + \egroup% + \enspace% +}% +\newcommand*{\setprintendlines}[6]{% + \l@d@pnumfalse \l@d@dashfalse + \ifnum#4=#1 \else + \l@d@pnumtrue + \l@d@dashtrue + \fi + \ifl@d@pnum \l@d@elintrue \else \l@d@elinfalse \fi + \ifnum#2=#5 \else + \l@d@elintrue + \l@d@dashtrue + \fi + \l@d@ssubfalse + \ifnum#3=0 \else + \l@d@ssubtrue + \fi + \l@d@eslfalse + \ifnum#6=0 \else + \ifnum#6=#3 + \ifl@d@elin \l@d@esltrue \else \l@d@eslfalse \fi + \else + \l@d@esltrue + \l@d@dashtrue + \fi + \fi% + \ifl@d@dash% + \ifboolexpr{togl{fulllines@} or test{\ifcsempty{Xendtwolines@\@currentseries}}}% + {}% + {% + \setistwofollowinglines{#1}{#2}{#4}{#5}% + \ifboolexpr{% + (% + togl {Xendtwolinesbutnotmore@\@currentseries}% + and not% + (% + bool {istwofollowinglines@}% + )% + )% + or% + (% + (not test{\ifnumequal{#1}{#4}})% + and togl{Xendtwolinesonlyinsamepage@\@currentseries}% + )% + }% + {}% + {% + \l@d@dashfalse% + \l@d@Xtwolinestrue% + \l@d@elinfalse% + \l@d@eslfalse% + \ifcsempty{Xendmorethantwolines@\@currentseries}% + {}% + {\ifistwofollowinglines@\else% + \l@d@Xmorethantwolinestrue% + \fi% + }% + }% + }% + \fi% +}% +\def\printendlines#1|#2|#3|#4|#5|#6|#7|{\begingroup + \setprintendlines{#1}{#2}{#3}{#4}{#5}{#6}% + \ifdimequal{\csuse{Xendboxstartlinenum@\@currentseries}}{0pt}% + {\bgroup}% + {\leavevmode\hbox to \csuse{Xendboxstartlinenum@\@currentseries}\bgroup\hfill}% + \printnpnum{#1}% + \linenumrep{#2}% + \ifl@d@ssub \fullstop \sublinenumrep{#3}\fi + \egroup% + \ifdimequal{\csuse{Xendboxendlinenum@\@currentseries}}{0pt}% + {\bgroup}% + {\hbox to \csuse{Xendboxendlinenum@\@currentseries}\bgroup}% + \ifl@d@Xtwolines% + \ifl@d@Xmorethantwolines% + \csuse{Xendmorethantwolines@\@currentseries}% + \else% + \csuse{Xendtwolines@\@currentseries}% + \fi% + \else% + \ifl@d@dash \endashchar\fi% + \ifl@d@pnum \printnpnum{#4}\fi% + \ifl@d@elin \linenumrep{#5}\fi% + \ifl@d@esl \ifl@d@elin \fullstop\fi \sublinenumrep{#6}\fi% + \fi% + \ifdimequal{\csuse{Xendboxendlinenum@\@currentseries}}{0pt}% + {}% + {\hfill}%Prevent underfull hbox + \egroup% + \endgroup% +}% + +\newcommand*{\printnpnum}[1]{p.#1) } + +\newif\ifXendinsertsep@% +\newcommand*{\doendnotes}[1]{% + \l@dend@close{#1}% + \begingroup + \makeatletter + \expandafter\let\csname #1end\endcsname=\endprint + \input\jobname.#1end% + \global\Xendinsertsep@false% + \endgroup} +\newcommand*{\doendnotesbysection}[1]{% + \l@dend@close{#1}% + \global\expandafter\advance\csname #1end@bysection\endcsname by 1% + \begingroup% + \makeatletter% + \def\l@d@section##1{% + \ifnumequal{##1}{\csname #1end@bysection\endcsname}% + {\cslet{#1end}{\endprint}}% + {\cslet{#1end}{\@gobblefive}}% + }% + \input\jobname.#1end% + \global\Xendinsertsep@false% + \endgroup% +}% +}% +\newcommand{\newseries}[1]{% + \def\do##1{\newseries@{##1}}% + \docsvlist{#1} +} +\newcommand{\@series}{} +\newcommand{\newseries@}[1]{ + \xifinlist{#1}{\@series}{\led@warn@SeriesStillExist{#1}}% + {% + \ifdefined\newseries@par% + \newseries@par{#1}% + \fi% + \unless\ifnocritical@ + \newtoggle{Xparindent@#1} + \newtoggle{Xlemmadisablefontselection@#1} + \csgdef{Xhangindent@#1}{0pt}% + \csgdef{Xragged@#1}{}% + \csgdef{Xhsizetwocol@#1}{0.45 \hsize}% + \csgdef{Xhsizethreecol@#1}{.3 \hsize}% + \csgdef{Xcolalign@#1}{\raggedright}% + \csgdef{Xnotenumfont@#1}{\normalfont}% + \csgdef{Xnotefontsize@#1}{\footnotesize}% + \csgdef{Xbhooknote@#1}{}% + + \csgdef{Xboxlinenum@#1}{0pt}% + \csgdef{Xboxlinenumalign@#1}{L}% + + \csgdef{Xboxstartlinenum@#1}{0pt}% + \csgdef{Xboxendlinenum@#1}{0pt}% + + \csgdef{Xboxsymlinenum@#1}{0pt}% + \newtoggle{Xnumberonlyfirstinline@#1}% + \newtoggle{Xnumberonlyfirstintwolines@#1}% + \csgdef{Xtwolines@#1}{}% + \csgdef{Xmorethantwolines@#1}{}% + \newtoggle{Xtwolinesbutnotmore@#1}% + \newtoggle{Xtwolinesonlyinsamepage@#1}% + \newtoggle{Xonlypstart@#1}% + \newtoggle{Xpstarteverytime@#1}% + \newtoggle{Xpstart@#1}% + \csgdef{Xsymlinenum@#1}{}% + \newtoggle{Xnonumber@#1}% + \csgdef{Xbeforenumber@#1}{0pt}% + \csgdef{Xafternumber@#1}{0.5em}% + \newtoggle{Xnonbreakableafternumber@#1}% + \csgdef{Xbeforesymlinenum@#1}{\csuse{Xbeforenumber@#1}}% + \csgdef{Xaftersymlinenum@#1}{\csuse{Xafternumber@#1}}% + \csgdef{Xinplaceofnumber@#1}{1em}% + \global\cslet{Xlemmaseparator@#1}{\rbracket}% + \csgdef{Xbeforelemmaseparator@#1}{0em}% + \csgdef{Xafterlemmaseparator@#1}{0.5em}% + \csgdef{Xinplaceoflemmaseparator@#1}{1em}% + \csgdef{Xbeforenotes@#1}{1.2em \@plus .6em \@minus .6em} + \csgdef{Xafterrule@#1}{0pt} + \csgdef{Xtxtbeforenotes@#1}{} + \csgdef{Xmaxhnotes@#1}{0.8\vsize} + \newtoggle{Xnoteswidthliketwocolumns@#1}% + \csgdef{Xparafootsep@#1}{}% + \csgdef{Xafternote@#1}{1em plus.4em minus.4em} + \expandafter\newinsert\csname #1footins\endcsname% + \unless\ifnoledgroup@% + \expandafter\newinsert\csname mp#1footins\endcsname% + \fi% + \global\notbool{parapparatus@}{\expandafter\newcommand\expandafter *}{\expandafter\newcommand}\csname #1footnote\endcsname[2][]{% + \ifnum\@edtext@level>0% + \begingroup% + \newcommand{\content}{##2}% + \ifnumberedpar@% + \ifledRcol% + \ifluatex% + \footnotelang@lua[R]% + \fi% + \@ifundefined{xpg@main@language}%if polyglossia + {}% + {\footnotelang@poly[R]}% + \footnoteoptions@[R]{##1}{true}% + \xright@appenditem{% + \noexpand\prepare@preXnotes{#1}% + \noexpand\prepare@edindex@fornote{\l@d@nums}% + \unexpanded{\def\sw@list@inedtext}{\expandafter\unexpanded\expandafter{\sw@inthisedtext}}%The value of the \sw@inthisedtext of current \edtext will be pushed to \sw@list@inedtext when the notes are expanded. + \noexpand\csuse{v#1footnote}{#1}% + {{\l@d@nums}{\expandonce\@tag}{\expandonce\content}}% + }\to\inserts@listR + \footnoteoptions@[R]{##1}{false}% + \global\advance\insert@countR \@ne% + \else% + \ifluatex% + \footnotelang@lua% + \fi% + \@ifundefined{xpg@main@language}%if polyglossia + {}% + {\footnotelang@poly}% + \footnoteoptions@{##1}{true}% + \xright@appenditem{% + \noexpand\prepare@preXnotes{#1}% + \noexpand\prepare@edindex@fornote{\l@d@nums}% + \unexpanded{\def\sw@list@inedtext}{\expandafter\unexpanded\expandafter{\sw@inthisedtext}}%The value of the \sw@inthisedtext of current edtext will be pushed to \sw@list@inedtext when the notes are expanded. + \noexpand\csuse{v#1footnote}{#1}% + {{\l@d@nums}{\expandonce\@tag}{\expandonce\content}}% + }\to\inserts@list + \global\advance\insert@count \@ne% + \footnoteoptions@{##1}{false}% + \fi + \else + \csuse{v#1footnote}{#1}{{0|0|0|0|0|0|0}{}{##1}}% + \fi% + \endgroup% + \else% + \led@err@FootnoteWithoutEdtext% + \fi% + \ignorespaces% + } + \global\csletcs{#1@@footnote}{#1footnote} + \Xarrangement@normal{#1}% + \fi + \unless\ifnofamiliar@ + \newtoggle{parindentX@#1} + \csgdef{hangindentX@#1}{0pt}% + \csgdef{raggedX@#1}{}% + \csgdef{hsizetwocolX@#1}{0.45 \hsize}% + \csgdef{hsizethreecolX@#1}{.3 \hsize}% + \csgdef{colalignX@#1}{\raggedright}% + \csgdef{notenumfontX@#1}{\normalfont}% + \csgdef{notefontsizeX@#1}{\footnotesize}% + \csgdef{bhooknoteX@#1}{}% + \csgdef{afterruleX@#1}{0pt} + \csgdef{beforenotesX@#1}{1.2em \@plus .6em \@minus .6em} + \csgdef{maxhnotesX@#1}{0.8\vsize}% + \newtoggle{noteswidthliketwocolumnsX@#1}% + \csgdef{parafootsepX@#1}{}% + \csgdef{afternoteX@#1}{1em plus.4em minus.4em} + \expandafter\newinsert\csname footins#1\endcsname% + \unless\ifnoledgroup@% + \expandafter\newinsert\csname mpfootins#1\endcsname% + \fi% + + \global\expandafter\newcommand\csname footnote#1\endcsname[1]{% + \begingroup% + \prepare@prenotesX{#1}% + \newcommand{\content}{##1}% + \stepcounter{footnote#1}% + \protected@csxdef{@thefnmark#1}{\csuse{thefootnote#1}}% + \nottoggle{nomk@}%Nomk is set to true when using \footnoteXnomk with \parpackage + {\csuse{@footnotemark#1}}% + {}% + \ifluatex% + \xdef\footnote@luatextextdir{\the\luatextextdir}% + \xdef\footnote@luatexpardir{\the\luatexpardir}% + \fi% + \csuse{vfootnote#1}{#1}{\expandonce\content}\m@mmf@prepare% + \endgroup% + } + \newcounter{footnote#1} + \global\expandafter\renewcommand\csname thefootnote#1\endcsname{\arabic{footnote#1}} +\arrangementX@normal{#1}% + \fi + \unless\ifnoend@ + \expandafter\newwrite\csname l@d@#1end\endcsname% + \expandafter\newif\csname ifl@dend@#1\endcsname% + + \global\expandafter\newcommandx\csname #1endnote\endcsname[2][1,usedefault]{% + \bgroup% + \newlinechar='40% + \global\@noneed@Footnotetrue% + \newcommand{\content}{##2}% + \expandafter\immediate\expandafter\write\csname l@d@#1end\endcsname{% + \expandafter\string\csname #1end\endcsname% + {\ifnumberedpar@\l@d@nums\fi}% + {\ifnumberedpar@\expandonce\@tag\fi}% + {\expandonce\content}% + {#1}% + {##1}% + \@percentchar% + }% + \egroup% + \ignorespaces% + }% + + \global\cslet{#1end}{\@gobblefive} + \global\expandafter\newcount\csname #1end@bysection\endcsname% + \csgdef{Xendtwolines@#1}{}% + \csgdef{Xendmorethantwolines@#1}{}% + \newtoggle{Xendtwolinesbutnotmore@#1}{}% + \newtoggle{Xendtwolinesonlyinsamepage@#1}{}% + \newtoggle{Xendlemmadisablefontselection@#1}% + \csgdef{Xendnotenumfont@#1}{\normalfont}% + \csgdef{Xendnotefontsize@#1}{\footnotesize}% + \csgdef{Xendbhooknote@#1}{}% + + \csgdef{Xendboxlinenum@#1}{0pt}% + \csgdef{Xendboxlinenumalign@#1}{L}% + + \csgdef{Xendboxstartlinenum@#1}{0pt}% + \csgdef{Xendboxendlinenum@#1}{0pt}% + + \csgdef{Xendlemmaseparator@#1}{}% + \csgdef{Xendbeforelemmaseparator@#1}{0em}% + \csgdef{Xendafterlemmaseparator@#1}{0.5em}% + \csgdef{Xendinplaceoflemmaseparator@#1}{0.5em}% + + \newtoggle{Xendparagraph@#1}% + \csgdef{Xendafternote@#1}{1em plus.4em minus.4em}% + \csgdef{Xendsep@#1}{}% + + \csgdef{Xendinplaceofnumber@#1}{0pt}% + \newtoggle{Xendnonumber@#1}% + \fi% + \listxadd{\@series}{#1} + } +}% End of \newseries +\expandafter\newseries\expandafter{\default@series} +\newcommand{\seriesatbegin}[1]{% + \StrDel{\@series}{#1}[\@series]% + \edef\@new{}% + \listeadd{\@new}{#1}% + \listeadd{\@new}{\@series}% + \xdef\@series{\@new}% +} +\newcommand{\seriesatend}[1]{% + \StrDel{\@series}{#1}[\@series]% + \edef\@new{}% + \listeadd{\@new}{\@series}% + \listeadd{\@new}{#1}% + \xdef\@series{\@new}% +} +\newcommand{\ifseriesbefore}[4]{% + \StrPosition{\@series}{#1}[\@first]% + \StrPosition{\@series}{#2}[\@second]% + \ifnumgreater{\@second}{\@first}{#3}{#4}% +} +\newcommand{\@getfirstseries}{% + \ifdefempty{\@series}% + {\xdef\@firstseries{}}% + {\StrChar{\@series}{1}[\@firstseries]}% +}% +\newcommandx{\settoggle@series}[5][4,5,usedefault]{% + \def\do##1{% + \global\settoggle{#2@##1}{#3}% + \ifstrequal{#4}{reload}% + {% + \csuse{Xarrangement@\csuse{series@display##1}}{##1}% + \csuse{arrangementX@\csuse{series@displayX##1}}{##1}% + }% + {}% + }% + \ifstrempty{#1}{% + \dolistloop{\@series}% + \ifstrempty{#5}{}{% + \docsvlist{#5}% + } + }% + {% + \docsvlist{#1}% + }% +} +\newcommandx{\setcommand@series}[5][4,5,usedefault]{% + \def\do##1{ + \csgdef{#2@##1}{#3} + \ifstrequal{#4}{reload}{ + \csuse{Xarrangement@\csuse{series@display##1}}{##1}% + \csuse{arrangementX@\csuse{series@displayX##1}}{##1}% + }{}} + \ifstrempty{#1}{% + \dolistloop{\@series}% + \ifstrempty{#5}{}{% + \docsvlist{#5} + } + }% + {% + \docsvlist{#1}% + }% +}% +\newcommandx{\newhookcommand@series}[2][2,usedefault]{% + \global\expandafter\newcommand\expandafter*\csname #1\endcsname[2][]{% + \setcommand@series{##1}{#1}{##2}[][#2]% + }% + \ifstrempty{#2}{}{% + \def\do##1{% + \global\expandafter\newcommand\expandafter*\csname #1##1\endcsname[1]{% + \csuse{#1}[##1]{####1}% + }% + }% + \docsvlist{#2}% + }% +} +\newcommandx{\newhooktoggle@series}[2][2,usedefault]{% + \global\expandafter\newcommandx\expandafter*\csname #1\endcsname[2][1,2={true},usedefault]{% + \settoggle@series{##1}{#1}{##2}[][#2]% + }% + \ifstrempty{#2}{}{% + \def\do##1{% + \global\expandafter\newcommand\expandafter*\csname #1##1\endcsname{% + \csuse{#1}[##1]% + }% + }% + \docsvlist{#2}% + }% +} +\newcommand{\newhooktoggle@series@reload}[1]{% + \global\expandafter\newcommandx\expandafter*\csname #1\endcsname[2][1,2={true},usedefault]{% + \settoggle@series{##1}{#1}{##2}[reload]% + }% +}% +\newcommand{\newhookcommand@series@reload}[1]{% + \global\expandafter\newcommand\expandafter*\csname #1\endcsname[2][]{% + \setcommand@series{##1}{#1}{##2}[reload]% + }% +} +\unless\ifnocritical@ + \newhooktoggle@series{Xparindent} + \newhookcommand@series{Xtwolines}[appref] + \newhookcommand@series{Xmorethantwolines}[appref] + \newhooktoggle@series{Xtwolinesbutnotmore}[appref] + \newhooktoggle@series{Xtwolinesonlyinsamepage}[appref] + \newhookcommand@series{Xhangindent} + \newhookcommand@series{Xragged} + \newhookcommand@series{Xhsizetwocol} + \newhookcommand@series{Xhsizethreecol} + \newhookcommand@series{Xcolalign}% + \newhookcommand@series{Xnotenumfont} + \newhookcommand@series{Xbhooknote} + \newhookcommand@series{Xboxsymlinenum}% + \newhookcommand@series{Xsymlinenum} + \newhookcommand@series{Xbeforenumber} + \newhookcommand@series{Xafternumber} + \newhookcommand@series{Xbeforesymlinenum} + \newhookcommand@series{Xaftersymlinenum} + \newhookcommand@series{Xinplaceofnumber} + \newhookcommand@series{Xlemmaseparator} + \newhookcommand@series{Xbeforelemmaseparator} + \newhookcommand@series{Xafterlemmaseparator} + \newhookcommand@series{Xinplaceoflemmaseparator} + \newhookcommand@series{Xtxtbeforenotes} + \newhookcommand@series@reload{Xafterrule} + \newhooktoggle@series{Xnumberonlyfirstinline} + \newhooktoggle@series{Xnumberonlyfirstintwolines} + \newhooktoggle@series{Xnonumber} + \newhooktoggle@series{Xpstart} + \newhooktoggle@series{Xpstarteverytime}% + \newhooktoggle@series{Xonlypstart} + \newhooktoggle@series{Xnonbreakableafternumber} + \newhooktoggle@series{Xlemmadisablefontselection} + \newhookcommand@series@reload{Xmaxhnotes} + \newhookcommand@series@reload{Xbeforenotes} + \newhooktoggle@series@reload{Xnoteswidthliketwocolumns}% + \newhookcommand@series{Xnotefontsize} + + \newhookcommand@series{Xboxlinenum}% + \newhookcommand@series{Xboxlinenumalign}% + + \newhookcommand@series{Xboxstartlinenum}% + \newhookcommand@series{Xboxendlinenum}% + + \newhookcommand@series{Xafternote}% + \newhookcommand@series{Xparafootsep} + +\fi +\unless\ifnofamiliar@ + \newhooktoggle@series{parindentX} + \newhookcommand@series{hangindentX} + \newhookcommand@series{raggedX} + \newhookcommand@series{hsizetwocolX} + \newhookcommand@series{hsizethreecolX} + \newhookcommand@series{colalignX}% + \newhookcommand@series{notenumfontX} + \newhookcommand@series{bhooknoteX} + \newhookcommand@series@reload{beforenotesX} + \newhookcommand@series@reload{maxhnotesX} + \newhooktoggle@series@reload{noteswidthliketwocolumnsX}% + \newhookcommand@series@reload{afterruleX} + \newhookcommand@series{notefontsizeX} + \newhookcommand@series{afternoteX} + \newhookcommand@series{parafootsepX} +\fi +\unless\ifnoend@ + \newhookcommand@series{Xendtwolines}[apprefwithpage] + \newhookcommand@series{Xendmorethantwolines}[apprefwithpage] + \newhooktoggle@series{Xendtwolinesbutnotmore}[apprefwithpage] + \newhooktoggle@series{Xendtwolinesonlyinsamepage}[apprefwithpage] + \newhookcommand@series{Xendnotenumfont} + \newhookcommand@series{Xendbhooknote} + + \newhookcommand@series{Xendboxlinenum}% + \newhookcommand@series{Xendboxlinenumalign}% + + \newhookcommand@series{Xendboxstartlinenum}% + \newhookcommand@series{Xendboxendlinenum}% + + \newhookcommand@series{Xendnotefontsize} + \newhooktoggle@series{Xendlemmadisablefontselection} + \newhookcommand@series{Xendlemmaseparator} + \newhookcommand@series{Xendbeforelemmaseparator} + \newhookcommand@series{Xendafterlemmaseparator} + \newhookcommand@series{Xendinplaceoflemmaseparator} + + \newhooktoggle@series{Xendparagraph} + \newhookcommand@series{Xendafternote} + \newhookcommand@series{Xendsep} + + \newhookcommand@series{Xendinplaceofnumber}% + \newhooktoggle@series{Xendnonumber}% +\fi +\newtoggle{fulllines@}% +\newtoggle{nonum@} +\newtoggle{nosep@} +\newtoggle{nomk@}% +\newcommandx*{\Xnolemmaseparator}[1][1]{\Xlemmaseparator[#1]{}} +\countdef\pageno=0 \pageno=1 +\newcommand*{\advancepageno}{\ifnum\pageno<\z@ \global\advance\pageno\m@ne + \else\global\advance\pageno\@ne\fi} + + +\newcommand*{\l@ddoxtrafeet}{% + \IfStrEq{familiar-critical}{\@fnpos} + {\do@feetX\Xdo@feet}% + {% + \IfStrEq{critical-familiar}{\@fnpos}% + {\Xdo@feet\do@feetX}% + {\do@feetX\Xdo@feet}% + }% +}% + +\newcommand*{\Xdo@feet}{% + \setbox\@outputbox \vbox{% + \unvbox\@outputbox + \@opXfeet}} +\newcommand\print@Xnotes[1]{% + \csuse{#1footstart}{#1}% + \csuse{#1footgroup}{#1}%% +}% +\newcommand*{\@opXfeet}{% + \unless\ifnocritical@% + \gdef\firstXseries@{}% + \def\do##1{% + \ifvoid\csuse{##1footins}\else% + \global\skip\csuse{##1footins}=\csuse{Xbeforenotes@##1}% + \global\advance\skip\csuse{##1footins} by\csuse{Xafterrule@##1}% + \print@Xnotes{##1}% + \fi% + }% + \dolistloop{\@series}% + \fi% +}% +\newcommand*{\l@ddodoreinxtrafeet}{% + \IfStrEq{familiar-critical}{\@fnpos} + {\@doreinfeetX\X@doreinfeet}% + {% + \IfStrEq{critical-familiar}{\@fnpos}% + {\X@doreinfeet\@doreinfeetX}% + {\@doreinfeetX\X@doreinfeet}% + }% +} + +\newcommand*{\X@doreinfeet}{% + \unless\ifnocritical@% + \def\do##1{% + \ifvoid\csuse{##1footins}\else% + \insert\csuse{##1footins}{\unvbox\csuse{##1footins}}% + \fi}% + \dolistloop{\@series} + \fi% +} + +\newcommand\print@notesX[1]{% + \csuse{footstart#1}{#1}% + \csuse{footgroup#1}{#1}% +}% +\newcommand*{\do@feetX}{% + \unless\ifnofamiliar@% + \gdef\firstseriesX@{}% + \setbox\@outputbox \vbox{% + \unvbox\@outputbox% + \def\do##1{% + \ifvoid\csuse{footins##1}\else% + \global\skip\csuse{footins##1}=\csuse{beforenotesX@##1}% + \global\advance\skip\csuse{footins##1} by\csuse{afterruleX@##1}% + \print@notesX{##1}% + \fi% + }% + \dolistloop{\@series}}% + \fi% +}% + +\newcommand{\@doreinfeetX}{% + \unless\ifnofamiliar@% + \def\do##1{% + \ifvoid\csuse{footins##1}\else + \insert% + \csuse{footins##1} + {\unvbox\csuse{footins##1}}% + \fi% + }% + \dolistloop{\@series}% + \fi% +}% + +\@ifclassloaded{memoir}{% + \g@addto@macro{\m@mdoextrafeet}{\l@ddoxtrafeet}% + \g@addto@macro{\m@mdodoreinextrafeet}{\l@ddodoreinxtrafeet}% + }{% + \@ifpackageloaded{fancyhdr}{% + \patchcmd% + {\latex@makecol}% + {\xdef\@freelist{\@freelist\@midlist}}% + {\xdef\@freelist{\@freelist\@midlist}\l@ddoxtrafeet}% + {}% + {\led@error@fail@patch@@makecol}% + }{% + \patchcmd% + {\@makecol}% + {\xdef\@freelist{\@freelist\@midlist}}% + {\xdef\@freelist{\@freelist\@midlist}\l@ddoxtrafeet}% + {}% + {\led@error@fail@patch@@makecol}% + }% + + \patchcmd% + {\@reinserts}% + {\ifvbox}% + {\l@ddodoreinxtrafeet\ifvbox}% + {}% + {\led@error@fail@patch@@reinserts}% +} + + +\newif\if@led@nofoot + +\@ifclassloaded{memoir}{% +\g@addto@macro{\@mem@extranofeet}{%% + \def\do#1{% + \unless\ifnocritical@% + \ifvoid\csuse{#1footins}\else\@mem@nofootfalse\fi% + \fi% + \unless\ifnofamiliar@% + \ifvoid\csuse{footins#1}\else\@mem@nofootfalse\fi% + \fi% + } + \dolistloop{\@series}% + }% +}{% +\newcommand*{\@led@testifnofoot}{% + \@led@nofoottrue% + \ifvoid\footins\else% + \@led@nofootfalse% + \fi% + \def\do##1{% + \unless\ifnocritical@% + \ifvoid\csuse{##1footins}\else% + \@led@nofootfalse% + \fi% + \fi% + \unless\ifnofamiliar@% + \ifvoid\csuse{footins##1}\else% + \@led@nofootfalse% + \fi% + \fi% + }% + \dolistloop{\@series}% +}% + +\pretocmd% + {\@doclearpage}% + {\@led@testifnofoot}% + {}% + {\led@error@fail@patch@@doclearpage}% + +\patchcmd% + {\@doclearpage}% + {\ifvoid\footins}% + {\if@led@nofoot}% + {}% + {\led@error@fail@patch@@doclearpage}% + +} + +\list@create{\labelref@list} +\newcommand*{\zz@@@}{000|000} % set two counters to zero in one go + + +\newcommand*{\edlabel}[1]{% + \ifl@dpairing\ifautopar% + \strut% + \fi\fi% + \@bsphack% + \ifledRcol% + \write\linenum@outR{\string\@lab}% + \ifx\labelref@listR\empty% + \xdef\label@refs{\zz@@@}% + \else% + \gl@p\labelref@listR\to\label@refs% + \fi% + \ifvmode% + \advancelabel@refs% + \fi% + \protected@write\@auxout{}% + {\string\l@dmake@labelsR\space\thepage|\label@refs|\the\c@pstartR|{#1}}% + \ifdef{\hypertarget}{\Hy@raisedlink{\hypertarget{#1}{}}}{}% + \else% + \write\linenum@out{\string\@lab}% + \ifx\labelref@list\empty% + \xdef\label@refs{\zz@@@}% + \else% + \gl@p\labelref@list\to\label@refs% + \fi% + \ifvmode% + \advancelabel@refs% + \fi% + \protected@write\@auxout{}% + {\string\l@dmake@labels\space\thepage|\label@refs|\the\c@pstart|{#1}}% + \ifdef{\hypertarget}{\Hy@raisedlink{\hypertarget{#1}{}}}{}% + \fi% +\@esphack}% + +\newcounter{line}% +\newcounter{subline}% +\newcommand{\advancelabel@refs}{% + \setcounter{line}{\expandafter\labelrefsparseline\label@refs}% + \stepcounter{line}% + \ifsublines@% + \setcounter{subline}{\expandafter\labelrefsparsesubline\label@refs}% + \stepcounter{subline}{1}% + \def\label@refs{\theline|\thesubline}% + \else% + \def\label@refs{\theline|0}% + \fi% +} +\def\labelrefsparseline#1|#2{#1} +\def\labelrefsparsesubline#1|#2{#2} +\newcommand*{\l@dmake@labels}{} +\def\l@dmake@labels#1|#2|#3|#4|#5{% + \expandafter\ifx\csname the@label#5\endcsname \relax\else + \led@warn@DuplicateLabel{#5}% + \fi + \expandafter\gdef\csname the@label#5\endcsname{#1|#2|#3|#4}% + \ignorespaces} + +\AtBeginDocument{% + \def\l@dmake@labels#1|#2|#3|#4|#5{}% +} + + +\newcommand*{\@lab}{% + \ifledRcol + \xright@appenditem{\linenumr@p{\line@numR}|% + \ifsublines@ \sublinenumr@p{\subline@numR}\else 0\fi}% + \to\labelref@listR + \else + \xright@appenditem{\linenumr@p{\line@num}|% + \ifsublines@ \sublinenumr@p{\subline@num}\else 0\fi}% + \to\labelref@list + \fi} +\newcommand*{\applabel}[1]{% + \ifnum\@edtext@level>0% + \ifcsundef{the@label#1}{% + \csdef{the@label#1}{applabel}% + }% + {% + \led@warn@DuplicateLabel{#1 (applabel)}% + }% + \expandafter\l@dp@rsefootspec\l@d@nums|% + \@bsphack% + \ifledRcol% + \protected@write\@auxout{}% + {\string\l@dmake@labelsR\space\l@dparsedstartpage|\l@dparsedstartline|\l@dparsedstartsub|\the\c@pstartR|{#1:start}}% + \ifdef{\hypertarget}{\Hy@raisedlink{\hypertarget{#1:start}{}}}{}% + \protected@write\@auxout{}% + {\string\l@dmake@labelsR\space\l@dparsedendpage|\l@dparsedendline|\l@dparsedendsub|\the\c@pstartR|{#1:end}}% + \else% + \protected@write\@auxout{}% + {\string\l@dmake@labels\space\l@dparsedstartpage|\l@dparsedstartline|\l@dparsedstartsub|\the\c@pstart|{#1:start}}% + \ifdef{\hypertarget}{\Hy@raisedlink{\hypertarget{#1:start}{}}}{}% + \protected@write\@auxout{}% + {\string\l@dmake@labels\space\l@dparsedendpage|\l@dparsedendline|\l@dparsedendsub|\the\c@pstart|{#1:end}}% + \fi% + \@esphack% + \else% + \led@warn@AppLabelOutEdtext{#1}% + \fi% +}% +\newrobustcmd{\wrap@edcrossref}[2]{% + \ifdef{\hyperlink}% + {\hyperlink{#1}{#2}}% + {#2}% +} +\newcommand*{\edpageref}[1]{\l@dref@undefined{#1}\wrap@edcrossref{#1}{\l@dgetref@num{1}{#1}}} +\newcommand*{\xpageref}[1]{\l@dgetref@num{1}{#1}} + +\newcommand*{\edlineref}[1]{\l@dref@undefined{#1}\wrap@edcrossref{#1}{\l@dgetref@num{2}{#1}}}% +\newcommand*{\xlineref}[1]{\l@dgetref@num{2}{#1}}% + +\newcommand*{\sublineref}[1]{\l@dref@undefined{#1}\wrap@edcrossref{#1}{\l@dgetref@num{3}{#1}}} +\newcommand*{\xsublineref}[1]{\l@dgetref@num{3}{#1}} + +\newcommand*{\pstartref}[1]{\l@dref@undefined{#1}\wrap@edcrossref{#1}{\l@dgetref@num{4}{#1}}} +\newcommand*{\xpstartref}[1]{\l@dgetref@num{4}{#1}} + +\newcommand*{\l@dref@undefined}[1]{% + \expandafter\ifx\csname the@label#1\endcsname\relax + \led@warn@RefUndefined{#1}% + \fi} + +\newcommand*{\l@dgetref@num}[2]{% + \expandafter + \ifx\csname the@label#2\endcsname \relax + 000% + \else + \expandafter\expandafter\expandafter + \l@dlabel@parse\csname the@label#2\endcsname|#1% + \fi} + +\newcommand*{\l@dlabel@parse}{} +\def\l@dlabel@parse#1|#2|#3|#4|#5{% + \ifcase #5% + \or #1% + \or #2% + \or #3% + \or #4% + \fi} +\newcommand*{\xxref}[2]{% + {% + \expandafter\ifx\csname the@label#1\endcsname \relax% + \expandafter\let\csname the@@label#1\endcsname\zz@@@% + \else% + \expandafter\def\csname the@@label#1\endcsname{\l@dgetref@num{1}{#1}|\l@dgetref@num{2}{#1}|\l@dgetref@num{3}{#1}}% + \fi% + \expandafter\ifx\csname the@label#2\endcsname \relax% + \expandafter\let\csname the@@label#2\endcsname\zz@@@% + \else% + \expandafter\def\csname the@@label#2\endcsname{\l@dgetref@num{1}{#2}|\l@dgetref@num{2}{#2}|\l@dgetref@num{3}{#2}}% + \fi% + \ifdefined\@Rlineflag% + \StrDel{\csuse{the@@label#1}}{\@Rlineflag}[\@tempa]% + \StrDel{\csuse{the@@label#2}}{\@Rlineflag}[\@tempb]% + \else% + \letcs{\@tempa}{the@@label#1}% + \letcs{\@tempb}{the@@label#2}% + \fi% + \linenum{\@tempa|% + \@tempb}}}% + +\xdef\Xtwolines@appref{}% +\xdef\Xmorethantwolines@appref{}% +\newtoggle{Xtwolinesbutnotmore@appref}% +\newtoggle{Xtwolinesonlyinsamepage@appref}% + +\xdef\Xendtwolines@apprefwithpage{}% +\xdef\Xendmorethantwolines@apprefwithpage{}% +\newtoggle{Xendtwolinesbutnotmore@apprefwithpage}% +\newtoggle{Xendtwolinesonlyinsamepage@apprefwithpage}% + + +\xdef\Xboxstartlinenum@appref{0pt} +\xdef\Xboxendlinenum@appref{0pt} + +\xdef\Xendboxstartlinenum@apprefwithpage{0pt} +\xdef\Xendboxendlinenum@apprefwithpage{0pt} + +\newcommand\@apprefprefixsingle{}% +\newcommand\@apprefprefixmore{}% + +\newcommand{\apprefprefixsingle}[1]{% + \gdef\@apprefprefixsingle{#1}% +} + +\newcommand{\setapprefprefixmore}[1]{% + \gdef\@apprefprefixmore{#1}% +} + +\newcommandx{\appref}[2][1,usedefault]{% + \IfStrEq{#1}{fulllines}% + {\toggletrue{fulllines@}}% + {}% + \xdef\@currentseries{appref}% + \ifdefempty{\@apprefprefixmore}% + {\@apprefprefixsingle}% + {% + \IfEq{\xlineref{#2:start}}{\xlineref{#2:end}}% + {\@apprefprefixsingle}% + {\@apprefprefixmore}% + }% + \printlines\xpageref{#2:start}|\xlineref{#2:start}|\xsublineref{#2:start}|\xpageref{#2:end}|\xlineref{#2:end}|\xsublineref{#2:end}||% + \togglefalse{fulllines@}% +}% + +\newcommandx{\apprefwithpage}[2][1,usedefault]{% + \IfStrEq{#1}{fulllines}% + {\toggletrue{fulllines@}}% + {}% + \xdef\@currentseries{apprefwithpage}% + \printendlines\xpageref{#2:start}|\xlineref{#2:start}|\xsublineref{#2:start}|\xpageref{#2:end}|\xlineref{#2:end}|\xsublineref{#2:end}||% + \togglefalse{fulllines@}% +}% +\newcommand*{\edmakelabel}[2]{\expandafter\xdef\csname the@label#1\endcsname{#2}} + +\pretocmd{\@xympar}% + {\ifnumberedpar@ + \led@warn@NoMarginpars + \@esphack + \else}% + {}% + {}% + +\apptocmd{\@xympar}% + {\fi}% + {} + {} + +\newcount\sidenote@margin +\newcommand*{\sidenotemargin}[1]{{% + \l@dgetsidenote@margin{#1}% + \ifnum\@l@dtempcntb>\m@ne + \ifledRcol + \global\sidenote@marginR=\@l@dtempcntb + \else + \global\sidenote@margin=\@l@dtempcntb + \fi + \fi}} +\newcommand*{\l@dgetsidenote@margin}[1]{% + \def\@tempa{#1}\def\@tempb{left}% + \ifx\@tempa\@tempb + \@l@dtempcntb \z@ + \else + \def\@tempb{right}% + \ifx\@tempa\@tempb + \@l@dtempcntb \@ne + \else + \def\@tempb{outer}% + \ifx\@tempa\@tempb + \@l@dtempcntb \tw@ + \else + \def\@tempb{inner}% + \ifx\@tempa\@tempb + \@l@dtempcntb \thr@@ + \else + \led@warn@BadSidenotemargin + \@l@dtempcntb \m@ne + \fi + \fi + \fi + \fi} +\sidenotemargin{right} + +\newbox\l@dlp@rbox +\newbox\l@drp@rbox + +\newdimen\ledlsnotewidth \ledlsnotewidth=\marginparwidth +\newdimen\ledrsnotewidth \ledrsnotewidth=\marginparwidth +\newdimen\ledlsnotesep \ledlsnotesep=\linenumsep +\newdimen\ledrsnotesep \ledrsnotesep=\linenumsep +\newcommand*{\ledlsnotefontsetup}{\raggedleft\footnotesize} +\newcommand*{\ledrsnotefontsetup}{\raggedright\footnotesize} + +\newcommand*{\ledleftnote}[1]{\edtext{}{\l@dlsnote{#1}}} +\newcommand*{\ledrightnote}[1]{\edtext{}{\l@drsnote{#1}}} + +\newcommand*{\ledinnernote}[1]{% + \ifodd\c@page% Do not use \page@num, because it is not yet calculated when command is called + \ledleftnote{#1}% + \else% + \ledrightnote{#1}% + \fi% +} + +\newcommand*{\ledouternote}[1]{% + \ifodd\c@page% Do not use \page@num, because it is not yet calculated when command is called + \ledrightnote{#1}% + \else% + \ledleftnote{#1}% + \fi% +} + +\newcommand*{\ledsidenote}[1]{\edtext{}{\l@dcsnote{#1}}} +\newif\ifrightnoteup + \rightnoteuptrue + +\newcommand*{\l@dlsnote}[1]{% + \begingroup% + \newcommand{\content}{#1}% + \ifnumberedpar@ + \ifledRcol% + \xright@appenditem{\noexpand\vl@dlsnote{\expandonce\content}}% + \to\inserts@listR + \global\advance\insert@countR \@ne% + \else% + \xright@appenditem{\noexpand\vl@dlsnote{\expandonce\content}}% + \to\inserts@list + \global\advance\insert@count \@ne% + \fi + \fi\ignorespaces\endgroup} + +\newcommand*{\l@drsnote}[1]{% + \begingroup% + \newcommand{\content}{#1}% + \ifnumberedpar@ + \ifledRcol% + \xright@appenditem{\noexpand\vl@drsnote{\expandonce\content}}% + \to\inserts@listR + \global\advance\insert@countR \@ne% + \else% + \xright@appenditem{\noexpand\vl@drsnote{\expandonce\content}}% + \to\inserts@list + \global\advance\insert@count \@ne% + \fi + \fi\ignorespaces\endgroup} + +\newcommand*{\l@dcsnote}[1]{% + \begingroup% + \newcommand{\content}{#1}% + \ifnumberedpar@ + \ifledRcol% + \xright@appenditem{\noexpand\vl@dcsnote{\expandonce\content}}% + \to\inserts@listR + \global\advance\insert@countR \@ne% + \else% + \xright@appenditem{\noexpand\vl@dcsnote{\expandonce\content}}% + \to\inserts@list + \global\advance\insert@count \@ne% + \fi + \fi\ignorespaces\endgroup} + +\newcommand*{\vl@dlsnote}[1]{% + \ifledRcol@% + \@l@dtempcntb=\sidenote@marginR% + \ifnum\@l@dtempcntb>\@ne% + \advance\@l@dtempcntb by\page@numR% + \fi% + \else% + \@l@dtempcntb=\sidenote@margin% + \ifnum\@l@dtempcntb>\@ne% + \advance\@l@dtempcntb by\page@num% + \fi% + \fi% + \ifodd\@l@dtempcntb% + \listgadd{\l@dcsnotetext@l}{#1}% + \else% + \listgadd{\l@dcsnotetext}{#1}% + \fi +} +\newcommand*{\vl@drsnote}[1]{% + \ifledRcol@% + \@l@dtempcntb=\sidenote@marginR% + \ifnum\@l@dtempcntb>\@ne% + \advance\@l@dtempcntb by\page@numR% + \fi% + \else% + \@l@dtempcntb=\sidenote@margin% + \ifnum\@l@dtempcntb>\@ne% + \advance\@l@dtempcntb by\page@num% + \fi% + \fi% + \ifodd\@l@dtempcntb% + \listgadd{\l@dcsnotetext}{#1}% + \else% + \listgadd{\l@dcsnotetext@r}{#1}% + \fi% +} +\newcommand*{\vl@dcsnote}[1]{\listgadd{\l@dcsnotetext}{#1}} + +\newcommand*{\setl@dlp@rbox}[1]{% + {\parindent\z@\hsize=\ledlsnotewidth\ledlsnotefontsetup + \global\setbox\l@dlp@rbox + \ifleftnoteup + =\vbox to\z@{\vss #1}% + \else + =\vbox to 0.70\baselineskip{\strut#1\vss}% + \fi}} +\newcommand*{\setl@drp@rbox}[1]{% + {\parindent\z@\hsize=\ledrsnotewidth\ledrsnotefontsetup + \global\setbox\l@drp@rbox + \ifrightnoteup + =\vbox to\z@{\vss#1}% + \else + =\vbox to0.7\baselineskip{\strut#1\vss}% + \fi}} +\newif\ifleftnoteup + \leftnoteuptrue +\newcommand{\setsidenotesep}[1]{\gdef\@sidenotesep{#1}} +\newcommand{\@sidenotesep}{, } +\newcommand*{\affixside@note}{% + \def\sidenotecontent@{}% + \numgdef{\itemcount@}{0}% + \def\do##1{% + \ifnumequal{\itemcount@}{0}% + {% + \appto\sidenotecontent@{##1}}% Not print not separator before the 1st note + {\appto\sidenotecontent@{\@sidenotesep ##1}% + }% + \numgdef{\itemcount@}{\itemcount@+1}% + }% + \dolistloop{\l@dcsnotetext}% + \ifnumgreater{\itemcount@}{1}{\led@err@ManySidenotes}{}% + \gdef\@templ@d{}% + \gdef\@templ@n{\l@dcsnotetext\l@dcsnotetext@l\l@dcsnotetext@r}% + \ifx\@templ@d\@templ@n \else% + \if@twocolumn% + \if@firstcolumn% + \setl@dlp@rbox{##1}{\sidenotecontent@}% + \else% + \setl@drp@rbox{\sidenotecontent@}% + \fi% + \else% + \@l@dtempcntb=\sidenote@margin% + \ifnum\@l@dtempcntb>\@ne% + \advance\@l@dtempcntb by\page@num% + \fi% + \ifodd\@l@dtempcntb% + \setl@drp@rbox{\sidenotecontent@}% + \gdef\sidenotecontent@{}% + \numgdef{\itemcount@}{0}% + \dolistloop{\l@dcsnotetext@l}% + \ifnumgreater{\itemcount@}{1}{\led@err@ManyLeftnotes}{}% + \setl@dlp@rbox{\sidenotecontent@}% + \else% + \setl@dlp@rbox{\sidenotecontent@}% + \gdef\sidenotecontent@{}% + \numgdef{\itemcount@}{0}% + \dolistloop{\l@dcsnotetext@r}% + \ifnumgreater{\itemcount@}{1}{\led@err@ManyRightnotes}{}% + \setl@drp@rbox{\sidenotecontent@}% + \fi% + \fi% + \fi% +} +\ifnoledgroup@\else% +\newcommand*{\l@dfeetbeginmini}{\l@dedbeginmini\l@dfambeginmini} +\newcommand*{\l@dfeetendmini}{% + \IfStrEq{critical-familiar}{\@mpfnpos}% + {\l@dedendmini\l@dfamendmini}% + {% + \IfStrEq{familiar-critical}{\@mpfnpos}% + {\l@dfamendmini\l@dedendmini}% + {\l@dedendmini\l@dfamendmini}% + }% + }% +\newcommand*{\l@dedbeginmini}{% + \unless\ifnocritical@% + \def\do##1{\csletcs{v##1footnote}{mpv##1footnote}}% + \dolistloop{\@series}% + \fi% + } +\newcommand*{\l@dedendmini}{% + \unless\ifnocritical@% + \ifl@dpairing% + \ifledRcol% + \flush@notesR% + \else% + \flush@notes% + \fi% + \fi + \def\do##1{% + \ifvoid\csuse{mp##1footins}\else% + \ifl@dpairing\ifparledgroup% + \ifledRcol% + \dimgdef{\parledgroup@beforenotesR}{\parledgroup@beforenotesR+\skip\@nameuse{mp##1footins}}% + \else% + \dimgdef{\parledgroup@beforenotesL}{\parledgroup@beforenotesL+\skip\@nameuse{mp##1footins}}% + \fi% + \fi\fi% + \csuse{mp##1footgroup}{##1}% + \fi}% + \dolistloop{\@series}% + \fi% +}% + +\newcommand*{\l@dfambeginmini}{% + \unless\ifnofamiliar@% + \def\do##1{\csletcs{vfootnote##1}{mpvfootnote##1}}% + \dolistloop{\@series}% + \fi% +}% + +\newcommand*{\l@dfamendmini}{% + \unless\ifnofamiliar@% + \def\do##1{% + \ifvoid\csuse{mpfootins##1}\else% + \csuse{mpfootgroup##1}{##1}% + \fi}% + \dolistloop{\@series}% + \fi% +}% +\patchcmd% + {\@iiiminipage}% + {\let\@footnotetext\@mpfootnotetext}% + {\let\@footnotetext\@mpfootnotetext\l@dfeetbeginmini}% + {}% + {\led@error@fail@patch@@iiiminipage}% +\patchcmd% + {\endminipage}% + {\footnoterule}% + {\footnoterule\l@advance@parledgroup@beforenormalnotes}% + {}% + {\led@error@fail@patch@endminipage} + +\patchcmd% + {\endminipage}% + {\@minipagefalse}% + {\l@dfeetendmini\@minipagefalse}% + {}% + {\led@error@fail@patch@endminipage} + +\newcommand*{\l@dunboxmpfoot}{% + \vskip\skip\@mpfootins + \normalcolor + \footnoterule + \l@advance@parledgroup@beforenormalnotes + \unvbox\@mpfootins% +} +\newcommand{\l@advance@parledgroup@beforenormalnotes}{% + \ifparledgroup + \ifl@dpairing + \ifledRcol + \dimgdef{\parledgroup@beforenotesR}{\parledgroup@beforenotesR+\skip\@mpfootins} + \else + \dimgdef{\parledgroup@beforenotesL}{\parledgroup@beforenotesL+\skip\@mpfootins} + \fi + \fi + \fi +} +\newenvironment{ledgroup}{% + \resetprevpage@num% + \def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c@mpfootnote\z@% + \let\@footnotetext\@mpfootnotetext + \l@dfeetbeginmini% +}{% + \par + \unskip + \ifvoid\@mpfootins\else + \l@dunboxmpfoot + \fi + \l@dfeetendmini% +} + +\newenvironment{ledgroupsized}[2][l]{% + \hsize #2\relax +%% \textwidth #2\relax +%% \columnwidth #2\relax + \let\ledllfill\hfil + \let\ledrlfill\hfil + \def\@tempa{#1}\def\@tempb{l}% + \ifx\@tempa\@tempb + \let\ledllfill\relax + \else + \def\@tempb{r}% + \ifx\@tempa\@tempb + \let\ledrlfill\relax + \fi + \fi + \def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c@mpfootnote\z@ + \let\@footnotetext\@mpfootnotetext + \l@dfeetbeginmini% +}{% + \par + \unskip + \ifvoid\@mpfootins\else + \l@dunboxmpfoot + \fi + \l@dfeetendmini% +} + +\fi% +\newif\ifledgroupnotesL@ +\newif\ifledgroupnotesR@ +\AtBeginDocument{% + \unless\ifl@imakeidx% + \@ifpackageloaded{imakeidx}{\led@error@ImakeidxAfterEledmac}{}% + \fi% + \unless\ifl@indextools% + \@ifpackageloaded{indextools}{\led@error@indextoolsAfterEledmac}{}% + \fi% +} +\newcommand{\pagelinesep}{-} +\newcommand{\edindexlab}{$&} +\newcounter{labidx} +\setcounter{labidx}{0} + +\newcommand{\doedindexlabel}{% + \stepcounter{labidx}% + \edlabel{\edindexlab\thelabidx}% +} + +\newcommand{\thepageline}{% + \thepage% + \pagelinesep% + \xlineref{\edindexlab\thelabidx}% +} +\newcommand{\thestartpageline}{% + \l@dparsedstartpage% + \pagelinesep% + \l@dparsedstartline% +} +\newcommand{\theendpageline}{% + \l@dparsedendpage% + \pagelinesep% + \l@dparsedendline% +} +\newif\if@edindex@fornote@ +\newcommand{\prepare@edindex@fornote}[1]{% + \l@dp@rsefootspec#1|% + \@edindex@fornote@true% +} +\newcommand{\get@edindex@ledinnote@command}{% + \ifxindy@% + \gdef\@ledinnote@command{% + ledinnote\thelabidx% + }% + \ifxindyhyperref@% + \immediate\write\eledmac@xindy@out{% + (define-attributes ("ledinnote\thelabidx"))^^J + \space\space(markup-locref^^J + \eledmacmarkuplocrefdepth^^J + :open "\string\ledinnote[\edindexlab\thelabidx]{\@index@command}{"^^J + :close "}"^^J + :attr "ledinnote\thelabidx"^^J + ) + }% + \else% + \immediate\write\eledmac@xindy@out{% + (define-attributes ("ledinnote\thelabidx"))^^J + \space\space(markup-locref^^J + \eledmacmarkuplocrefdepth^^J + :open "\string\ledinnote{\@index@command}{"^^J + :close "}"^^J + :attr "ledinnote\thelabidx"^^J + ) + }% + \fi% + \else% + \gdef\@ledinnote@command{% + ledinnote[\edindexlab\thelabidx]{\@index@command}% + }% + \fi% +} +\def\get@index@command#1|#2+{% + \gdef\@index@txt{#1}% + \gdef\@index@command{#2}% + \xdef\@index@parenthesis{}% + \IfBeginWith{\@index@command}{(}{% + \StrGobbleLeft{\@index@command}{1}[\@index@command@]% + \global\let\@index@command\@index@command@% + \xdef\@index@parenthesis{(}% + }{}% + \IfBeginWith{\@index@command}{)}{% + \StrGobbleLeft{\@index@command}{1}[\@index@command@]% + \global\let\@index@command\@index@command@% + \xdef\@index@parenthesis{)}% + }{}% +} +\newcommandx{\ledinnote}[3][1,usedefault]{% + \ifboolexpr{% + test{\ifdefequal{\iftrue}{\ifHy@hyperindex}}% + or% + bool {xindyhyperref@}% + }% + {% + \csuse{#2}{\hyperlink{#1}{\ledinnotemark{#3}}}% + }% + {% + \csuse{#2}{\ledinnotemark{#3}}% + }% +}% +\newcommand{\ledinnotehyperpage}[2]{\csuse{#1}{\ledinnotemark{\hyperpage{#2}}}}% +\newcommand{\ledinnotemark}[1]{#1\emph{n}}% +\newcommandx{\@wredindex}[2][1=\expandonce\jobname,usedefault]{%#1 = the index name, #2 = the text + \global\let\old@Rlineflag\@Rlineflag% + \gdef\@Rlineflag{}% + \ifl@imakeidx% + \if@edindex@fornote@% + \IfSubStr[1]{#2}{|}{\get@index@command#2+}{\get@index@command#2|+}% + \get@edindex@ledinnote@command% + \expandafter\imki@wrindexentry{#1}{\@index@txt|(\@ledinnote@command}{\thestartpageline}% + \expandafter\imki@wrindexentry{#1}{\@index@txt|)\@ledinnote@command}{\theendpageline}% + \else% + \get@edindex@hyperref{#2}% + \imki@wrindexentry{#1}{\@index@txt\@edindex@hyperref}{\thepageline}% + \fi% + \else% + \if@edindex@fornote@% + \IfSubStr[1]{#2}{|}{\get@index@command#2+}{\get@index@command#2|+}% + \get@edindex@ledinnote@command% + \expandafter\protected@write\@indexfile{}% +{\string\indexentry{\@index@txt|(\@ledinnote@command}{\thestartpageline} +}% + \expandafter\protected@write\@indexfile{}% +{\string\indexentry{\@index@txt|)\@ledinnote@command}{\theendpageline} + }% + \else% + \protected@write\@indexfile{}% +{\string\indexentry{#2}{\thepageline} +}% + \fi% + \fi% + \endgroup + \global\let\@Rlineflag\old@Rlineflag% + \@esphack% +} +\pretocmd{\makeindex}{% + \def\edindex{\@bsphack + \doedindexlabel + \begingroup + \@sanitize + \@wredindex}}{}{} +\newcommand{\edindex}[1]{\@bsphack\@esphack} +\newcommand{\hyperlinkformat}[3]{% + \ifstrempty{#1}% + {\hyperlink{#2}{#3}}% + {\csuse{#1}{\hyperlink{#2}{#3}}% + }} +\newcommand{\hyperlinkR}[2]{% + \hyperlink{#1}{#2\@Rlineflag}% +}% + +\newcommand{\hyperlinkformatR}[3]{% + \hyperlinkformat{#1}{#2}{#3\@Rlineflag}% +}% + +\newcommand{\get@edindex@hyperref}[1]{% + \edef\temp@{% + \catcode`\ =9 %space need for catcode + #1% + \catcode`\ =10 % space need for catcode + }% + \ifdefequal{\iftrue}{\ifHy@hyperindex}{% + \IfSubStr{\temp@}{|}% + {\get@index@command#1+% + \ifledRcol% + \gdef\@edindex@hyperref{|\@index@parenthesis %space kept + hyperlinkformatR{\@index@command}% + {\edindexlab\thelabidx}}% + \else% + \gdef\@edindex@hyperref{|\@index@parenthesis %space kept + hyperlinkformat{\@index@command}% + {\edindexlab\thelabidx}}% + \fi% + }% + {\get@index@command#1|+% + \ifledRcol% + \gdef\@edindex@hyperref{|hyperlinkR{\edindexlab\thelabidx}}% + \else% + \gdef\@edindex@hyperref{|hyperlink{\edindexlab\thelabidx}}% + \fi% + }% + }% + {\ifxindyhyperref@% + \IfSubStr{\temp@}{|}% + {\get@index@command#1+}% + {\get@index@command#1|+}% + \gdef\@edindex@hyperref{|eledmac\thelabidx}% + \IfStrEq{\@index@parenthesis}{(}% + {% + \csxdef{xindyparenthesis@\@index@txt}{\thelabidx}% + \gdef\@edindex@hyperref{|(eledmac\thelabidx}% + }% + {}% + \IfStrEq{\@index@parenthesis}{)}% + {% + \xdef\@edindex@hyperref{|)eledmac\csuse{xindyparenthesis@\@index@txt}}% + \global\csundef{xindyparenthesis@\@index@txt}% + }% + {% + \immediate\write\eledmac@xindy@out{% + (define-attributes ("eledmac\thelabidx"))^^J + \space\space(markup-locref^^J + \eledmacmarkuplocrefdepth^^J + :open "\string\hyperlink% + \ifledRcol R\fi% + {\edindexlab\thelabidx}% + {\ifdefempty{\@index@command}% + {}% + {\@backslashchar\@index@command}% + {"^^J + :close "}}"^^J + :attr "eledmac\thelabidx"^^J + ) + }% + }% + \else% + \gdef\@index@txt{#1}% + \gdef\@edindex@hyperref{}% + \fi% + }% +} +\def\@hangingsymbol{} +\newcommand*{\sethangingsymbol}[1]{% + \gdef\@hanginsymbol{#1}% +}% +\newif\ifinstanza +\newif\ifinserthangingsymbol +\newcommand{\inserthangingsymbol}{% +\ifinserthangingsymbol% + \ifinstanza% + \@hangingsymbol% + \fi% +\fi% +} +\newcommand*{\ampersand}{\char`\&} + + \chardef\body=\catcode`\@ + \catcode`\@=11 + \chardef\next=\catcode`\& + \catcode`\&=\active + + \newcount\stanza@count + \newlength{\stanzaindentbase} + \setlength{\stanzaindentbase}{20pt} + +\def\strip@szacnt#1,#2|{\def\@tempb{#1}\def\@tempa{#2|}} +\newcommand*{\setstanzavalues}[2]{\def\@tempa{#2,,|}% + \stanza@count\z@ + \def\next{\expandafter\strip@szacnt\@tempa + \ifx\@tempb\empty\let\next\relax\else + \expandafter\mathchardef\csname #1@\number\stanza@count + @\endcsname\@tempb\relax + \advance\stanza@count\@ne\fi\next}% + \next} + +\newcommand*{\setstanzaindents}[1]{\setstanzavalues{sza}{#1}} +\newcommand*{\setstanzapenalties}[1]{\setstanzavalues{szp}{#1}} +\newcounter{stanzaindentsrepetition} +\newcount\stanza@modulo + +\newcommand*{\managestanza@modulo}[0]{ + \advance\stanza@modulo\@ne + \ifnum\stanza@modulo>\value{stanzaindentsrepetition} + \stanza@modulo\@ne + \fi +} +\newcommand{\stanzaindent}[1]{% + \hspace{\dimexpr#1\stanzaindentbase-\parindent\relax}% + \ignorespaces% +}% +\WithSuffix\newcommand\stanzaindent*[1]{% + \stanzaindent{#1}% + \global\advance\stanza@modulo-\@ne% + \ifnum\stanza@modulo=0% + \global\stanza@modulo=\value{stanzaindentsrepetition}% + \fi% + \ignorespaces% +}% + +\newcommandx{\stanza@line}[1][1]{ + \ifnum\value{stanzaindentsrepetition}=0 + \parindent=\csname sza@\number\stanza@count + @\endcsname\stanzaindentbase + \else + \parindent=\csname sza@\number\stanza@modulo + @\endcsname\stanzaindentbase + \managestanza@modulo + \fi + \pstart[#1]\stanza@hang\ignorespaces} +\xdef\stanza@hang{\noexpand\leavevmode\noexpand\startlock + \hangindent\expandafter + \noexpand\csname sza@0@\endcsname\stanzaindentbase + \hangafter\@ne} +\def\sza@penalty{\count@\csname szp@\number\stanza@count @\endcsname + \ifnum\count@>\@M\advance\count@-\@M\penalty-\else + \penalty\fi\count@} +\xdef\@startstanza[#1]{% + \noexpand\instanzatrue\expandafter + \begingroup% + \catcode`\noexpand\&\active% + \global\stanza@count\@ne\stanza@modulo\@ne + \noexpand\ifnum\expandafter\noexpand + \csname sza@0@\endcsname=\z@\let\noexpand\stanza@hang\relax + \let\noexpand\endlock\relax\noexpand\else\interlinepenalty + \@M\rightskip\z@ plus 1fil\relax\noexpand\fi\noexpand\ifnum + \expandafter\noexpand\csname szp@0@\endcsname=\z@ + \let\noexpand\sza@penalty\relax\noexpand\fi% + \def\noexpand&{% + \noexpand\newverse[][]}% + \def\noexpand\&{\noexpand\@stopstanza}% + \noexpand\stanza@line[#1]} + +\newcommandx{\stanza}[1][1,usedefault]{\@startstanza[#1]} + +\newcommandx{\@stopstanza}[1][1,usedefault]{% + \unskip% + \endlock% + \pend[#1]% + \endgroup% + \instanzafalse% +} + +\newcommandx*{\newverse}[2][1,2,usedefault]{% + \unskip% + \endlock\pend[#1]\sza@penalty\global% + \advance\stanza@count\@ne\stanza@line[#2]% + } + +\newcommand*{\flagstanza}[2][\stanzaindentbase]{% + \hskip -#1\llap{#2}\hskip #1\ignorespaces} + + \catcode`\&=\next + \catcode`\@=\body + \setstanzavalues{szp}{0} + +\newtoks\@emptytoks + +\newtoks\l@denvbody + +\newcommand{\addtol@denvbody}[1]{% + \global\l@denvbody\expandafter{\the\l@denvbody#1}} + +\newcommand{\l@dcollect@body}[1]{% + \l@denvbody{\expandafter#1\expandafter{\the\l@denvbody}}% + \edef\processl@denvbody{\the\l@denvbody\noexpand\end{\@currenvir}}% + \l@denvbody\@emptytoks \def\l@dbegin@stack{b}% + \begingroup + \expandafter\let\csname\@currenvir\endcsname\l@dcollect@@body + \edef\processl@denvbody{\expandafter\noexpand\csname\@currenvir\endcsname}% + \processl@denvbody% + }% + +\def\l@dpush@begins#1\begin#2{% + \ifx\end#2\else b\expandafter\l@dpush@begins\fi} + +\def\l@dcollect@@body#1\end#2{% + \edef\l@dbegin@stack{\l@dpush@begins#1\begin\end + \expandafter\@gobble\l@dbegin@stack}% + \ifx\@empty\l@dbegin@stack + \endgroup + \@checkend{#2}% + \addtol@denvbody{#1}% + \else + \addtol@denvbody{#1\end{#2}}% + \fi + \processl@denvbody % A little tricky! Note the grouping +} + +\newcommand*{\l@dtabnoexpands}{% + \let\rtab=0% + \let\ctab=0% + \let\ltab=0% + \let\rtabtext=0% + \let\ltabtext=0% + \let\ctabtext=0% + \let\edbeforetab=0% + \let\edaftertab=0% + \let\edatleft=0% + \let\edatright=0% + \let\edvertline=0% + \let\edvertdots=0% + \let\edrowfill=0% +} + +\newcommand{\disable@familiarnotes}{% + \unless\ifnofamiliar@% + \def\do##1{% + \csletcs{footnote@@##1}{footnote##1}% + \expandafter\renewcommand \csname footnote##1\endcsname[1]{% + \protected@csxdef{@thefnmark##1}{\csuse{thefootnote##1}}% + \csuse{@footnotemark##1}% + }% + }% + \dolistloop{\@series}% + \fi% +}% +\newcommand{\restore@familiarnotes}{% + \unless\ifnofamiliar@% + \def\do##1{% + \csletcs{footnote##1}{footnote@@##1}% + }% + \dolistloop{\@series}% + \fi% +}% + +\newcommand{\disable@sidenotes}{% + \let\@@ledrightnote\ledrightnote% + \let\@@ledleftnote\ledleftnote% + \let\@@ledsidenote\ledsidenote% + \let\ledrightnote\@gobble% + \let\ledleftnote\@gobble% + \let\ledsidenote\@gobble% +}% +\newcommand{\restore@sidenotes}{% + \let\ledrightnote\@@ledrightnote% + \let\ledleftnote\@@ledleftnote% + \let\ledsidenote\@@ledsidenote% +}% +\newcommand{\disable@notes}{% + \disable@sidenotes% + \disable@familiarnotes% +}% +\newcommand{\restore@notes}{% + \restore@sidenotes% + \restore@familiarnotes% +}% +\let\EDTEXT=\edtext +\newcommand{\xedtext}[2]{\EDTEXT{#1}{#2}} +\let\EDLABEL=\edlabel +\newcommand*{\xedlabel}[1]{\EDLABEL{#1}} +\let\EDINDEX=\edindex +\newcommand{\xedindex}{\@bsphack% + \@ifnextchar [{\l@d@index}{\l@d@index[\jobname]}} +\newcommand{\nulledindex}[2][\jobname]{\@bsphack\@esphack} + +\let\@line@@num=\linenum +\newcommand*{\l@dgobbleoptarg}[2][]{\relax}% + +\let\Relax=\relax +\let\NEXT=\next + +\newcommand{\l@dmodforedtext}{% + \let\edtext\relax + \def\do##1{\global\csletcs{##1footnote}{l@dgobbleoptarg}}% + \dolistloop{\@series}% + \let\edindex\nulledindex + \let\linenum\@gobble} +\newcommand{\l@drestoreforedtext}{% + \def\do##1{\global\csletcs{##1footnote}{##1@@footnote}} + \dolistloop{\@series}% + \let\edindex\xedindex} +\newcommand{\l@dnullfills}{% + \def\edlabel##1{}% + \def\edrowfill##1##2##3{}% +} +\newcommand{\l@drestorefills}{% + \def\edrowfill##1##2##3{\@EDROWFILL@{##1}{##2}{##3}}% +} + +\newcommand{\letsforverteilen}{% + \let\edtext\xedtext + \let\edindex\xedindex + \def\do##1{\global\csletcs{##1footnote}{##1@@footnote}} + \dolistloop{\@series}% + \let\linenum\@line@@num + \hilfsskip=\l@dcolwidth% + \advance\hilfsskip by -\wd\hilfsbox + \def\edlabel##1{\xedlabel{##1}}} + +\newcommand\disablel@dtabfeet{\l@dmodforedtext}% +\newcommand\enablel@dtabfeet{\l@drestoreforedtext}% +\newcount\l@dampcount + \l@dampcount=1\relax +\newcount\l@dcolcount + \l@dcolcount=0\relax + +\newbox\hilfsbox +\newskip\hilfsskip +\newbox\Hilfsbox +\newcount\hilfscount + +\newdimen\dcoli +\newdimen\dcolii +\newdimen\dcoliii +\newdimen\dcoliv +\newdimen\dcolv +\newdimen\dcolvi +\newdimen\dcolvii +\newdimen\dcolviii +\newdimen\dcolix +\newdimen\dcolx +\newdimen\dcolxi +\newdimen\dcolxii +\newdimen\dcolxiii +\newdimen\dcolxiv +\newdimen\dcolxv +\newdimen\dcolxvi +\newdimen\dcolxvii +\newdimen\dcolxviii +\newdimen\dcolxix +\newdimen\dcolxx +\newdimen\dcolxxi +\newdimen\dcolxxii +\newdimen\dcolxxiii +\newdimen\dcolxxiv +\newdimen\dcolxxv +\newdimen\dcolxxvi +\newdimen\dcolxxvii +\newdimen\dcolxxviii +\newdimen\dcolxxix +\newdimen\dcolxxx +\newdimen\dcolerr % added for error handling + +\newcommand{\l@dcolwidth}{\ifcase \the\l@dcolcount \dcoli %??? + \or \dcoli \or \dcolii \or \dcoliii + \or \dcoliv \or \dcolv \or \dcolvi + \or \dcolvii \or \dcolviii \or \dcolix \or \dcolx + \or \dcolxi \or \dcolxii \or \dcolxiii + \or \dcolxiv \or \dcolxv \or \dcolxvi + \or \dcolxvii \or \dcolxviii \or \dcolxix \or \dcolxx + \or \dcolxxi \or \dcolxxii \or \dcolxxiii + \or \dcolxxiv \or \dcolxxv \or \dcolxxvi + \or \dcolxxvii \or \dcolxxviii \or \dcolxxix \or \dcolxxx + \else \dcolerr \fi} + +\newcommand*{\stepl@dcolcount}{\advance\l@dcolcount\@ne + \ifnum\l@dcolcount>30\relax + \led@err@TooManyColumns + \fi} + +\newcommand{\l@dsetmaxcolwidth}{% + \ifdim\l@dcolwidth < \wd\hilfsbox + \l@dcolwidth = \wd\hilfsbox + \else \relax \fi} + +\def\measuremcell #1&{% + \ifx #1\\ \ifnum\l@dcolcount=0\let\NEXT\relax% + \else\l@dcheckcols% + \l@dcolcount=0% + \let\NEXT\measuremcell% + \fi% + \else\setbox\hilfsbox=\hbox{$\displaystyle{#1}$}% + \stepl@dcolcount% + \l@dsetmaxcolwidth% + \let\NEXT\measuremcell% + \fi\NEXT} + +\def\measuretcell #1&{% + \ifx #1\\ \ifnum\l@dcolcount=0\let\NEXT\relax% + \else\l@dcheckcols% + \l@dcolcount=0% + \let\NEXT\measuretcell% + \fi% + \else\setbox\hilfsbox=\hbox{#1}% + \stepl@dcolcount% + \l@dsetmaxcolwidth% + \let\NEXT\measuretcell% + \fi\NEXT} + +\def\measuremrow #1\\{% + \ifx #1&\let\NEXT\relax% + \else\measuremcell #1&\\&\\&% + \let\NEXT\measuremrow% + \fi\NEXT} +\def\measuretrow #1\\{% + \ifx #1&\let\NEXT\relax% + \else\measuretcell #1&\\&\\&% + \let\NEXT\measuretrow% + \fi\NEXT} + +\newskip\edtabcolsep +\global\edtabcolsep=10pt + +\newcommand{\variab}{\relax} + +\newcommand*{\l@dcheckcols}{% + \ifnum\l@dcolcount=1\relax + \else + \ifnum\l@dampcount=1\relax + \else + \ifnum\l@dcolcount=\l@dampcount\relax + \else + \l@d@err@UnequalColumns + \fi + \fi + \l@dampcount=\l@dcolcount + \fi} + +\newdimen\edfilldimen +\edfilldimen=0pt + +\newcounter{addcolcount} + \renewcommand{\theaddcolcount}{\roman{addcolcount}} +\def\setmcellright #1&{\def\edlabel##1{}% + \let\edindex\nulledindex + \ifx #1\\ \ifnum\l@dcolcount=0%\removelastskip + \let\Next\relax% + \else\l@dcolcount=0% + \let\Next=\setmcellright% + \fi% + \else% + \disablel@dtabfeet% + \stepl@dcolcount% + \disable@notes% + \setbox\hilfsbox=\hbox{$\displaystyle{#1}$}% + \restore@notes% + \letsforverteilen% + \hskip\hilfsskip$\displaystyle{#1}$% + \hskip\edtabcolsep% + \let\Next=\setmcellright% + \fi\Next} + +\def\settcellright #1&{\def\edlabel##1{}% + \let\edindex\nulledindex + \ifx #1\\ \ifnum\l@dcolcount=0%\removelastskip + \let\Next\relax% + \else\l@dcolcount=0% + \let\Next=\settcellright% + \fi% + \else% + \disablel@dtabfeet% + \stepl@dcolcount% + \disable@notes% + \setbox\hilfsbox=\hbox{#1}% + \restore@notes% + \letsforverteilen% + \hskip\hilfsskip#1% + \hskip\edtabcolsep% + \let\Next=\settcellright% + \fi\Next} +\def\setmcellleft #1&{\def\edlabel##1{}% + \let\edindex\nulledindex + \ifx #1\\ \ifnum\l@dcolcount=0 \let\Next\relax% + \else\l@dcolcount=0% + \let\Next=\setmcellleft% + \fi% + \else \disablel@dtabfeet% + \stepl@dcolcount% + \disable@notes% + \setbox\hilfsbox=\hbox{$\displaystyle{#1}$}% + \restore@notes% + \letsforverteilen% + $\displaystyle{#1}$\hskip\hilfsskip\hskip\edtabcolsep% + \let\Next=\setmcellleft% + \fi\Next} + +\def\settcellleft #1&{\def\edlabel##1{}% + \let\edindex\nulledindex + \ifx #1\\ \ifnum\l@dcolcount=0 \let\Next\relax% + \else\l@dcolcount=0% + \let\Next=\settcellleft% + \fi% + \else \disablel@dtabfeet% + \stepl@dcolcount% + \disable@notes% + \setbox\hilfsbox=\hbox{#1}% + \restore@notes% + \letsforverteilen% + #1\hskip\hilfsskip\hskip\edtabcolsep% + \let\Next=\settcellleft% + \fi\Next} +\def\setmcellcenter #1&{\def\edlabel##1{}% + \let\edindex\nulledindex + \ifx #1\\ \ifnum\l@dcolcount=0\let\Next\relax% + \else\l@dcolcount=0% + \let\Next=\setmcellcenter% + \fi% + \else \disablel@dtabfeet% + \stepl@dcolcount% + \disable@notes% + \setbox\hilfsbox=\hbox{$\displaystyle{#1}$}% + \restore@notes% + \letsforverteilen% + \hskip 0.5\hilfsskip$\displaystyle{#1}$\hskip0.5\hilfsskip% + \hskip\edtabcolsep% + \let\Next=\setmcellcenter% + \fi\Next} + +\def\settcellcenter #1&{\def\edlabel##1{}% + \let\edindex\nulledindex + \ifx #1\\ \ifnum\l@dcolcount=0 \let\Next\relax% + \else\l@dcolcount=0% + \let\Next=\settcellcenter% + \fi% + \else \disablel@dtabfeet% + \stepl@dcolcount% + \disable@notes% + \setbox\hilfsbox=\hbox{#1}% + \restore@notes% + \letsforverteilen% + \hskip 0.5\hilfsskip #1\hskip 0.5\hilfsskip% + \hskip\edtabcolsep% + \let\Next=\settcellcenter% + \fi\Next} + +\let\NEXT=\relax + +\def\setmrowright #1\\{% + \ifx #1& \let\NEXT\relax + \else \centerline{\setmcellright #1&\\&\\&} + \let\NEXT=\setmrowright + \fi\NEXT} +\def\settrowright #1\\{% + \ifx #1& \let\NEXT\relax + \else \centerline{\settcellright #1&\\&\\&} + \let\NEXT=\settrowright + \fi\NEXT} + +\def\setmrowleft #1\\{% + \ifx #1&\let\NEXT\relax + \else \centerline{\setmcellleft #1&\\&\\&} + \let\NEXT=\setmrowleft + \fi\NEXT} +\def\settrowleft #1\\{% + \ifx #1& \let\NEXT\relax + \else \centerline{\settcellleft #1&\\&\\&} + \let\NEXT=\settrowleft + \fi\NEXT} + +\def\setmrowcenter #1\\{% + \ifx #1& \let\NEXT\relax% + \else \centerline{\setmcellcenter #1&\\&\\&} + \let\NEXT=\setmrowcenter + \fi\NEXT} +\def\settrowcenter #1\\{% + \ifx #1& \let\NEXT\relax + \else \centerline{\settcellcenter #1&\\&\\&} + \let\NEXT=\settrowcenter + \fi\NEXT} + +\newcommand{\nullsetzen}{% + \stepl@dcolcount% + \l@dcolwidth=0pt% + \ifnum\l@dcolcount=30\let\NEXT\relax% + \l@dcolcount=0\relax + \else\let\NEXT\nullsetzen% + \fi\NEXT} + +\newcommand{\edatleft}[3][\@empty]{% + \ifx#1\@empty + \vbox to 10pt{\vss\hbox{$\left#2\vrule width0pt height #3 + depth 0pt \right. $\hss}\vfil} + \else + \vbox to 4pt{\vss\hbox{$#1\left#2\vrule width0pt height #3 + depth 0pt \right. $}\vfil} + \fi} +\newcommand{\edatright}[3][\@empty]{% + \ifx#1\@empty + \vbox to 10pt{\vss\hbox{$\left.\vrule width0pt height #3 + depth 0pt \right#2 $\hss}\vfil} + \else + \vbox to 4pt{\vss\hbox{$\left.\vrule width0pt height #3 + depth 0pt \right#2 #1 $}\vfil} + \fi} + +\newcommand{\edvertline}[1]{\vbox to 8pt{\vss\hbox{\vrule height #1}\vfil}} + +\newcommand{\edvertdots}[1]{\vbox to 1pt{\vss\vbox to #1% + {\cleaders\hbox{$\m@th\hbox{.}\vbox to 0.5em{ }$}\vfil}}} + +\newcommand{\l@dtabaddcols}[2]{% + \l@dcheckstartend{#1}{#2}% + \ifl@dstartendok + \setcounter{addcolcount}{#1}% + \@whilenum \value{addcolcount}<#2\relax \do + {\advance\edfilldimen by \the \csname dcol\theaddcolcount\endcsname + \advance\edfilldimen by \edtabcolsep + \stepcounter{addcolcount}}% + \advance\edfilldimen by \the \csname dcol\theaddcolcount\endcsname + \fi +} + +\newif\ifl@dstartendok +\newcommand{\l@dcheckstartend}[2]{% + \l@dstartendoktrue + \ifnum #1<\@ne + \l@dstartendokfalse + \led@err@LowStartColumn + \fi + \ifnum #2>30\relax + \l@dstartendokfalse + \led@err@HighEndColumn + \fi + \ifnum #1>#2\relax + \l@dstartendokfalse + \led@err@ReverseColumns + \fi +} + +\newcommand*{\edrowfill}[3]{% + \l@dtabaddcols{#1}{#2}% + \hb@xt@ \the\l@dcolwidth{\hb@xt@ \the\edfilldimen{#3}\hss}} +\let\@edrowfill@=\edrowfill +\def\@EDROWFILL@#1#2#3{\@edrowfill@{#1}{#2}{#3}} + +\newcommand{\leftltab}[1]{% + \hb@xt@\z@{\vbox{\edtabindent% + \moveleft\Hilfsskip\hbox{\ #1}}\hss}} + +\newcommand{\leftrtab}[2]{% + #2\hb@xt@\z@{\vbox{\edtabindent% + \advance\Hilfsskip by\dcoli% + \moveleft\Hilfsskip\hbox{\ #1}}\hss}} + +\newcommand{\leftctab}[2]{% + \hb@xt@\z@{\vbox{\edtabindent\l@dcolcount=\l@dampcount% + \advance\Hilfsskip by 0.5\dcoli% + \setbox\hilfsbox=\hbox{\def\edlabel##1{}% + \disablel@dtabfeet$\displaystyle{#2}$}% + \advance\Hilfsskip by -0.5\wd\hilfsbox% + \moveleft\Hilfsskip\hbox{\ #1}}\hss}% + #2} + +\newcommand{\rightctab}[2]{% + \setbox\hilfsbox=\hbox{\def\edlabel##1{}% + \disablel@dtabfeet#2}\l@dampcount=\l@dcolcount% + #1\hb@xt@\z@{\vbox{\edtabindent\l@dcolcount=\l@dampcount% + \advance\Hilfsskip by 0.5\l@dcolwidth% + \advance\Hilfsskip by -\wd\hilfsbox% + \setbox\hilfsbox=\hbox{\def\edlabel##1{}% + \disablel@dtabfeet$\displaystyle{#1}$}% + \advance\Hilfsskip by -0.5\wd\hilfsbox% + \advance\Hilfsskip by \edtabcolsep% + \moveright\Hilfsskip\hbox{ #2}}\hss}% + } + +\newcommand{\rightltab}[2]{% + \setbox\hilfsbox=\hbox{\def\edlabel##1{}% + \disablel@dtabfeet#2}\l@dampcount=\l@dcolcount% + #1\hb@xt@\z@{\vbox{\edtabindent\l@dcolcount=\l@dampcount% + \advance\Hilfsskip by\l@dcolwidth% + \advance\Hilfsskip by-\wd\hilfsbox% + \setbox\hilfsbox=\hbox{\def\edlabel##1{}% + \disablel@dtabfeet$\displaystyle{#1}$}% + \advance\Hilfsskip by-\wd\hilfsbox% + \advance\Hilfsskip by\edtabcolsep% + \moveright\Hilfsskip\hbox{ #2}}\hss}% + } + +\newcommand{\rightrtab}[2]{% + \setbox\hilfsbox=\hbox{\def\edlabel##1{}% + \disablel@dtabfeet#2}% + #1\hb@xt@\z@{\vbox{\edtabindent% + \advance\Hilfsskip by-\wd\hilfsbox% + \advance\Hilfsskip by\edtabcolsep% + \moveright\Hilfsskip\hbox{ #2}}\hss}% + } + +\newcommand{\rtab}[1]{% + \l@dnullfills + \def\edbeforetab##1##2{\leftrtab{##1}{##2}}% + \def\edaftertab##1##2{\rightrtab{##1}{##2}}% + \measurembody{#1}% + \l@drestorefills + \variab + \setmrowright #1\\&\\% + \enablel@dtabfeet} + +\newcommand{\measurembody}[1]{% + \disablel@dtabfeet% + \l@dcolcount=0% + \nullsetzen% + \l@dcolcount=0 + \measuremrow #1\\&\\% + \global\l@dampcount=1} + +\newcommand{\rtabtext}[1]{% + \l@dnullfills + \measuretbody{#1}% + \l@drestorefills + \variab + \settrowright #1\\&\\% + \enablel@dtabfeet} + +\newcommand{\measuretbody}[1]{% + \disable@notes% + \disablel@dtabfeet% + \l@dcolcount=0% + \nullsetzen% + \l@dcolcount=0 + \measuretrow #1\\&\\% + \restore@notes% + \global\l@dampcount=1} + +\newcommand{\ltab}[1]{% + \l@dnullfills + \def\edbeforetab##1##2{\leftltab{##1}{##2}}% + \def\edaftertab##1##2{\rightltab{##1}{##2}}% + \measurembody{#1}% + \l@drestorefills + \variab + \setmrowleft #1\\&\\% + \enablel@dtabfeet} + +\newcommand{\ltabtext}[1]{% + \l@dnullfills + \measuretbody{#1}% + \l@drestorefills + \variab + \settrowleft #1\\&\\% + \enablel@dtabfeet} + +\newcommand{\ctab}[1]{% + \l@dnullfills + \def\edbeforetab##1##2{\leftctab{##1}{##2}}% + \def\edaftertab##1##2{\rightctab{##1}{##2}}% + \measurembody{#1}% + \l@drestorefills + \variab + \setmrowcenter #1\\&\\% + \enablel@dtabfeet} + +\newcommand{\ctabtext}[1]{% + \l@dnullfills + \measuretbody{#1}% + \l@drestorefills + \variab + \settrowcenter #1\\&\\% + \enablel@dtabfeet} + +\newcommand{\spreadtext}[1]{%\l@dcolcount=\l@dampcount% + \hb@xt@ \the\l@dcolwidth{\hbox{#1}\hss}} +\newcommand{\spreadmath}[1]{% + \hb@xt@ \the\l@dcolwidth{\hbox{$\displaystyle{#1}$}\hss}} + +\newskip\HILFSskip +\newskip\Hilfsskip + +\newcommand{\EDTABINDENT}{% + \ifnum\l@dcolcount=30\let\NEXT\relax\l@dcolcount=0% + \else\stepl@dcolcount% + \advance\Hilfsskip by\l@dcolwidth% + \ifdim\l@dcolwidth=0pt\advance\hilfscount\@ne + \else\advance\Hilfsskip by \the\hilfscount\edtabcolsep% + \hilfscount=1\fi% + \let\NEXT=\EDTABINDENT% + \fi\NEXT}% +\newcommand{\edtabindent}{% + \l@dcolcount=0\relax + \Hilfsskip=0pt% + \hilfscount=1\relax + \EDTABINDENT% + \hilfsskip=\hsize% + \advance\hilfsskip -\Hilfsskip% + \Hilfsskip=0.5\hilfsskip% + }% + +\def\EDTAB #1|#2|{% + \setbox\tabhilfbox=\hbox{$\displaystyle{#1}$}% + \setbox\tabHilfbox=\hbox{$\displaystyle{#2}$}% + \advance\tabelskip -\wd\tabhilfbox% + \advance\tabelskip -\wd\tabHilfbox% + \unhbox\tabhilfbox\hskip\tabelskip% + \unhbox\tabHilfbox}% + +\def\EDTABtext #1|#2|{% + \setbox\tabhilfbox=\hbox{#1}% + \setbox\tabHilfbox=\hbox{#2}% + \advance\tabelskip -\wd\tabhilfbox% + \advance\tabelskip -\wd\tabHilfbox% + \unhbox\tabhilfbox\hskip\tabelskip% + \unhbox\tabHilfbox}% +\newbox\tabhilfbox +\newbox\tabHilfbox + +\newenvironment{edarrayl}{\l@dcollect@body\ltab}{} +\newenvironment{edarrayc}{\l@dcollect@body\ctab}{} +\newenvironment{edarrayr}{\l@dcollect@body\rtab}{} + +\newenvironment{edtabularl}{\l@dcollect@body\ltabtext}{} +\newenvironment{edtabularc}{\l@dcollect@body\ctabtext}{} +\newenvironment{edtabularr}{\l@dcollect@body\rtabtext}{} + +\newcommand{\initnumbering@quote}{ + \ifnoquotation@\else + \renewcommand{\quotation}{\par\leavevmode% + \parindent=1.5em% + \skipnumbering% + \ifautopar% + \vskip-\parskip% + \else% + \vskip\topsep% + \fi% + \global\leftskip=\leftmargin% + \global\rightskip=\leftmargin% + } + \renewcommand{\endquotation}{\par% + \global\leftskip=0pt% + \global\rightskip=0pt% + \leavevmode% + \skipnumbering% + \ifautopar% + \vskip-\parskip% + \else% + \vskip\topsep% + \fi% + } + \renewcommand{\quote}{\par\leavevmode% + \parindent=0pt% + \skipnumbering% + \ifautopar% + \vskip-\parskip% + \else% + \vskip\topsep% + \fi% + \global\leftskip=\leftmargin% + \global\rightskip=\leftmargin% + } + \renewcommand{\endquote}{\par% + \global\leftskip=0pt% + \global\rightskip=0pt% + \leavevmode% + \skipnumbering% + \ifautopar% + \vskip-\parskip% + \else% + \vskip\topsep% + \fi% + } + \fi +} +\newcommand{\ledsectnotoc}{\let\addcontentsline\@gobblethree} +\newcommand{\ledsectnomark}{% + \let\chaptermark\@gobble% + \let\sectionmark\@gobble% + \let\subsectionmark\@gobble% +} +\catcode`\#=12 +\notbool{@noeled@sec}{% +\ifl@dmemoir + \newcommand\beforeeledchapter{% + \clearforchapter% +} +\else + \newcommand\beforeeledchapter{% + \if@openright% + \cleardoublepage% + \else% + \clearpage% + \fi% +} +\fi +\newif\if@eled@sectioning +\def\print@rightmargin@eledsection{% + \if@eled@sectioning% + \begingroup% + \if@RTL% + \let\llap\rlap% + \let\leftlinenum\rightlinenum% + \let\leftlinenumR\rightlinenumR% + \let\l@drd@ta\l@dld@ta% + \let\l@drsn@te\l@dlsn@te% + \fi% + \hfill\l@drd@ta \csuse{LR}{\l@drsn@te}% + \endgroup% + \fi% +}% + +\def\print@leftmargin@eledsection{% + \if@eled@sectioning% + \leavevmode% + \begingroup% + \if@RTL% + \let\rlap\llap% + \let\rightlinenum\leftlinenum% + \let\rightlinenumR\leftlinenumR% + \let\l@dld@ta\l@drd@ta% + \let\l@dlsn@te\l@drsn@te% + \fi% + \l@dld@ta\csuse{LR}{\l@dlsn@te}% + \endgroup% + \fi% +}% + +\AtBeginDocument{% +\patchcmd{\chapter}{\clearforchapter}{% + \if@eled@sectioning\else% + \ifl@dprintingpages\else% + \clearforchapter% + \fi% + \fi% + } + {} + {} + +\pretocmd{\M@sect} + {\let\old@edtext=\edtext% + \let\edtext=\dummy@edtext@showlemma% + } + {} + {} + +\apptocmd{\M@sect} + {\let\edtext=\old@edtext} + {} + {} + +\patchcmd{\M@sect} + { #9} + { #9% + \print@rightmargin@eledsection% + } + {} + {} + +\patchcmd{\M@sect} + {\hskip #3\relax} + {\hskip #3\relax% + \print@leftmargin@eledsection% + } + {} + {} + +\patchcmd{\@mem@old@ssect} + {#5} + {#5% + \print@leftmargin@eledsection% + } + {} + {} + +\patchcmd{\@mem@old@ssect} + {\hskip #1} + {\hskip #1% + \print@rightmargin@eledsection% + } + {} + {} + +\patchcmd{\chapter}{\if@openright\cleardoublepage\else\clearpage\fi}{% + \if@eled@sectioning\else% + \ifl@dprintingpages\else% + \if@openright\cleardoublepage\else\clearpage\fi%No clearpage inside a \eledsection: will keep critical notes from printing on the title page. + \fi% + \fi% + }% + {}% + {}% + +\patchcmd{\@makechapterhead} + {#1} + {\print@leftmargin@eledsection% + #1% + \print@rightmargin@eledsection% + } + {} + {} + +\patchcmd{\@makechapterhead}% For BIDI + {\if@RTL\raggedleft\else\raggedright\fi}% + {\if@eled@sectioning\else% + \if@RTL\raggedleft\else\raggedright\fi% + \fi% + }% + {}% + {}% + +\patchcmd{\@makeschapterhead} + {#1} + {\print@leftmargin@eledsection% + #1% + \print@rightmargin@eledsection% + } + {} + {} + +\pretocmd{\@sect} + {\let\old@edtext=\edtext + \let\edtext=\dummy@edtext@showlemma% + } + {} + {} + +\apptocmd{\@sect} + {\let\edtext=\old@edtext} + {} + {} + +\pretocmd{\@ssect} + {\let\old@edtext=\edtext% + \let\edtext=\dummy@edtext@showlemma% + } + {} + {} + +\apptocmd{\@ssect} + {\let\edtext=\old@edtext} + {} + {} + +\@ifpackageloaded{nameref}{ + + \patchcmd{\NR@sect} + {#8} + {#8% + \print@rightmargin@eledsection% + } + {} + {} + + \patchcmd{\NR@sect} + {\hskip #3\relax} + {\hskip #3\relax% + \print@leftmargin@eledsection% + } + {} + {} + + \patchcmd{\NR@ssect} + {#5} + {#5% + \print@rightmargin@eledsection% + } + {} + {} + + \patchcmd{\NR@ssect} + {\hskip #1} + {\hskip #1% + \print@leftmargin@eledsection% + } + {} + {} + }% + { + \patchcmd{\@sect} + {#8} + {#8% + \print@rightmargin@eledsection% + } + {} + {} + + \patchcmd{\@sect} + {\hskip #3\relax} + {\hskip #3\relax% + \print@leftmargin@eledsection% + } + {} + {} + + \patchcmd{\@ssect} + {#5} + {#5% + \print@rightmargin@eledsection% + } + {} + {} + + \patchcmd{\@ssect} + {\hskip #1} + {\hskip #1% + \print@leftmargin@eledsection% + } + {} + {} + }% +} +{}}% +\protect\catcode`\#=6 %Space NEEDS by \catcode +\notbool{@noeled@sec}{% +\newwrite\eled@sectioning@out +\newcommand{\eledchapter}[2][]{% + #2% + \ifledRcol% + \immediate\write\eled@sectioningR@out{% + \string\eled@chapter{#1}{\unexpanded{#2}}{\the\l@dnumpstartsR}{}{R} + }% + \else% + \immediate\write\eled@sectioning@out{% + \string\eled@chapter{#1}{\unexpanded{#2}}{\the\l@dnumpstartsL}{}{} + }% + \fi% +} + +\newcommand{\eledsection}[2][]{% + #2% + \ifledRcol% + \immediate\write\eled@sectioningR@out{% + \string\eled@section{#1}{\unexpanded{#2}}{\the\l@dnumpstartsR}{}{R} + }% + \else% + \immediate\write\eled@sectioning@out{% + \string\eled@section{#1}{\unexpanded{#2}}{\the\l@dnumpstartsL}{}{} + }% + \fi% +} + +\newcommand{\eledsubsection}[2][]{% + #2% + \ifledRcol% + \immediate\write\eled@sectioningR@out{% + \string\eled@subsection{#1}{\unexpanded{#2}}{\the\l@dnumpstartsR}{}{R} + }% + \else% + \immediate\write\eled@sectioning@out{% + \string\eled@subsection{#1}{\unexpanded{#2}}{\the\l@dnumpstartsL}{}{} + }% + \fi% +} +\newcommand{\eledsubsubsection}[2][]{% + #2% + \ifledRcol% + \immediate\write\eled@sectioningR@out{% + \string\eled@subsubsection{#1}{\unexpanded{#2}}{\the\l@dnumpstartsR}{}{R} + }% + \else% + \immediate\write\eled@sectioning@out{% + \string\eled@subsubsection{#1}{\unexpanded{#2}}{\the\l@dnumpstartsL}{}{} + }% + \fi% +} + +\WithSuffix\newcommand\eledchapter*[2][]{% + #2% + \ifledRcol% + \immediate\write\eled@sectioningR@out{% + \string\eled@chapter{#1}{\unexpanded{#2}}{\the\l@dnumpstartsR}{*}{R} + }% + \else% + \immediate\write\eled@sectioning@out{% + \string\eled@chapter{#1}{\unexpanded{#2}}{\the\l@dnumpstartsL}{*}{} + }% + \fi% +} + +\WithSuffix\newcommand\eledsection*[2][]{% + #2% + \ifledRcol% + \immediate\write\eled@sectioningR@out{% + \string\eled@section{#1}{\unexpanded{#2}}{\the\l@dnumpstartsR}{*}{R} + }% + \else% + \immediate\write\eled@sectioning@out{% + \string\eled@section{#1}{\unexpanded{#2}}{\the\l@dnumpstartsL}{*}{} + }% + \fi% +} + +\WithSuffix\newcommand\eledsubsection*[2][]{% + #2% + \ifledRcol% + \immediate\write\eled@sectioningR@out{% + \string\eled@subsection{#1}{\unexpanded{#2}}{\the\l@dnumpstartsR}{*}{R} + }% + \else% + \immediate\write\eled@sectioning@out{% + \string\eled@subsection{#1}{\unexpanded{#2}}{\the\l@dnumpstartsL}{*}{} + }% + \fi% +} + +\WithSuffix\newcommand\eledsubsubsection*[2][]{% + #2% + \ifledRcol% + \immediate\write\eled@sectioningR@out{% + \string\eled@subsubsection{#1}{\unexpanded{#2}}{\the\l@dnumpstartsR}{*}{R} + }% + \else% + \immediate\write\eled@sectioning@out{% + \string\eled@subsubsection{#1}{\unexpanded{#2}}{\the\l@dnumpstartsL}{*}{} + }% + \fi% +} +\def\eled@chapter#1#2#3#4#5{% + \ifstrempty{#4}% + {% + \ifstrempty{#1}% + {% + \global\csdef{eled@sectioning@#3#5}{\let\edtext=\dummy@edtext@showlemma\chapter{#2}}% + \global\csdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\chaptermark{#2}}% + }%Need for \pairs, because of using parbox. + {% + \global\csdef{eled@sectioning@#3#5}{\let\edtext=\dummy@edtext@showlemma\chapter[#1]{#2}}% + \global\csdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\chaptermark{#2}}%Need for \pairs, because of using parbox. + }% + }% + {% + \ifstrempty{#1}% + {\global\csdef{eled@sectioning@#3#5}{\let\edtext=\dummy@edtext@showlemma\chapter*{#2}}}% + {\global\csdef{eled@sectioning@#3#5}{\let\edtext=\dummy@edtext@showlemma\chapter*[#1]{#2}}}%Bug in LaTeX! + }% + \listcsgadd{eled@sections#5@@}{#3}% + } +\def\eled@section#1#2#3#4#5{% + \ifstrempty{#4}% + {\ifstrempty{#1}% + {% + \global\csdef{eled@sectioning@#3#5}{\section{#2}}% + \global\csdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\sectionmark{#2}}%Need for \pairs, because of using parbox. + }% + {% + \global\csdef{eled@sectioning@#3#5}{\section[#1]{#2}}% + \global\csdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\sectionmark{#1}}%Need for \pairs, because of using parbox. + }% + }% + {\ifstrempty{#1}% + {\global\csdef{eled@sectioning@#3#5}{\section*{#2}}}% + {\global\csdef{eled@sectioning@#3#5}{\section*[#1]{#2}}}%Bug in LaTeX! + } + \listcsgadd{eled@sections#5@@}{#3}% + } +\def\eled@subsection#1#2#3#4#5{% + \ifstrempty{#4}% + {\ifstrempty{#1}% + {% + \global\csdef{eled@sectioning@#3#5}{\subsection{#2}}% + \global\csdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\csuse{subsectionmark}{#2}}%Need for \pairs, because of using parbox. \csuse in case of \subsectionmark is not defined (book) + }% + {% + \global\csdef{eled@sectioning@#3#5}{\subsection[#1]{#2}}% + \global\csdef{eled@sectmark@#3#5}{\let\edtext=\dummy@edtext{}\csuse{subsectionmark}{#1}}%Need for \pairs, because of using parbox. \csuse in case of \subsectionmark is not defined (book) + }% + }% + {\ifstrempty{#1}% + {\global\csdef{eled@sectioning@#3#5}{\subsection*{#2}}}% + {\global\csdef{eled@sectioning@#3#5}{\subsection*[#1]{#2}}}%Bug in LaTeX! + } + \listcsgadd{eled@sections#5@@}{#3}% + } +\def\eled@subsubsection#1#2#3#4#5{% + \ifstrempty{#4}% + {\ifstrempty{#1}% + {\global\csdef{eled@sectioning@#3#5}{\subsubsection{#2}}}% + {\global\csdef{eled@sectioning@#3#5}{\subsubsection[#1]{#2}}}% + }% + {\ifstrempty{#1}% + {\global\csdef{eled@sectioning@#3#5}{\subsubsection*{#2}}}% + {\global\csdef{eled@sectioning@#3#5}{\subsubsection*[#1]{#2}}}%Bug in LaTeX! + } + \listcsgadd{eled@sections#5@@}{#3}% + } + +}{} +\def\normal@page@break{} +\def\l@prev@pb{} +\def\l@prev@nopb{} +\newcommand{\ledpb}{\write\linenum@out{\string\led@pb}} +\newcommand{\ledpbnum}[1]{\write\linenum@out{\string\led@pbnum{#1}}} +\newcommand{\lednopb}{\write\linenum@out{\string\led@nopb}} +\newcommand{\lednopbnum}[1]{\write\linenum@out{\string\led@nopbnum{#1}}} +\newcommand{\led@pb}{\listxadd{\l@prev@pb}{\the\absline@num}} +\newcommand{\led@pbnum}[1]{\listxadd{\l@prev@pb}{#1}} +\newcommand{\led@nopb}{\listxadd{\l@prev@nopb}{\the\absline@num}} +\newcommand{\led@nopbnum}[1]{\listxadd{\l@prev@nopb}{#1}} +\def\led@pb@setting{before} +\newcommand{\ledpbsetting}[1]{\gdef\led@pb@setting{#1}} +\newcommand{\led@check@pb}{\xifinlist{\the\absline@num}{\l@prev@pb}{\pagebreak[4]}{}} +\newcommand{\led@check@nopb}{% + \IfStrEq{\led@pb@setting}{before}{% + \xifinlist{\the\absline@num}{\l@prev@nopb}% + {\numdef{\abs@prevline}{\the\absline@num-1}% + \xifinlist{\abs@prevline}{\normal@page@break}% + {\nopagebreak[4]\enlargethispage{\baselineskip}}% + {}}% + {}}% + {}% + {}% + \IfStrEq{\led@pb@setting}{after}{% + \xifinlist{\the\absline@num}{\l@prev@nopb}{% + \xifinlist{\the\absline@num}{\normal@page@break}% + {\nopagebreak[4]\enlargethispage{\baselineskip}}% + {}% +}% + {}}% + {}% + {}% +} +\newcommand{\check@pb@in@verse}{% + \ifinstanza\iflednopbinverse\ifinserthangingsymbol% Using stanzas and enabling page breaks in verse control, while on a hanging verse. + \ifnum\page@num=\last@page@num\else%If we have change page + \IfStrEq{\led@pb@setting}{before}{% + \numgdef{\abs@line@verse}{\the\absline@num-1}% + \ledpbnum{\abs@line@verse}% + }{}% + \IfStrEq{\led@pb@setting}{after}{% + \numgdef{\abs@line@verse}{\the\absline@num-1}% + \lednopbnum{\abs@line@verse}% + }{}% + \fi% + \fi\fi\fi% +} +\ifeledmaccompat@% + +\newcommand{\footnormalX}[1]{\arrangementX[#1]{normal}}% +\newcommand{\footparagraphX}[1]{\arrangementX[#1]{paragraph}}% +\newcommand{\foottwocolX}[1]{\arrangementX[#1]{twocol}}% +\newcommand{\footthreecolX}[1]{\XarrangementX[#1]{threecol}}% + +\unless\ifnocritical@ + \newcommand{\footnormal}[1]{\Xarrangement[#1]{normal}}% + \newcommand{\footparagraph}[1]{\Xarrangement[#1]{paragraph}}% + \newcommand{\foottwocol}[1]{\Xarrangement[#1]{twocol}}% + \newcommand{\footthreecol}[1]{\Xarrangement[#1]{threecol}}% + \let\hsizetwocol\Xhsizetwocol + \let\hsizethreecol\Xhsizethreecol + \let\bhookXnote\Xbhooknote + \let\boxsymlinenum\Xboxsymlinenum + \let\symlinenum\Xsymlinenum + \let\beforenumberinfootnote\Xbeforenumber + \let\afternumberinfootnote\Xafternumber + \let\beforeXsymlinenum\Xbeforesymlinenum + \let\afterXsymlinenum\Xaftersymlinenum + \let\inplaceofnumber\Xinplaceofnumber + \let\Xlemmaseparator\lemmaseparator + \let\afterlemmaseparator\Xafterlemmaseparator + \let\beforelemmaseparator\Xbeforelemmaseparator + \let\inplaceoflemmaseparator\Xinplaceoflemmaseparator + \let\txtbeforeXnotes\Xtxtbeforenotes + \let\afterXrule\Xafterrule + \let\numberonlyfirstinline\Xnumberonlyfirstinline + \let\numberonlyfirstintwolines\Xnumberonlyfirstintwolines + \let\nonumberinfootnote\Xnonumberinfootnote + \let\pstartinfootnote\Xpstart + \let\pstartinfootnoteeverytime\Xpstarteverytime + \let\onlyXpstart\Xonlypstart + \let\Xnonumberinfootnote\Xnonumber + \let\nonbreakableafternumber\Xnonbreakableafternumber + \let\maxhXnotes\Xmaxhnotes + \let\beforeXnotes\Xbeforenotes + \let\boxlinenum\Xboxlinenum + \let\boxlinenumalign\Xboxlinenumaligm + \let\boxstartlinenum\Xboxstartlinenum + \let\boxendlinenum\Xboxendlinenum + \let\twolines\Xtwolines + \let\morethantwolines\Xmorethantwolines + \let\twolinesbutnotmore\Xtwolinesbutnotmore + \let\twolinesonlyinsamepage\Xtwolinesonlyinsamepage + \fi + + \unless\ifnofamiliar@ + \let\notesXwidthliketwocolumns\noteswidthliketwocolumnsX + \fi + \newcommandx[2][1,usedefault]{\parafootsep}{% + \Xparafootsep[#1]{#2}% + \parafootsepX[#1]{#2} + }% + + \newcommandx[2][1,usedefault]{\afternote}{% + \Xafternote[#1]{#2}% + \afternoteX[#1]{#2}% + }% + + \unless\ifnoend@ + \let\XendXtwolines\Xendtwolines + \let\XendXmorethantwolines\Xendmorethantwolines + \let\bhookXendnote\Xendbhooknote + \let\boxXendlinenum\Xendboxlinenum% + \let\boxXendlinenumalign\Xendboxlinenumalign% + \let\boxXendstartlinenum\Xendboxstartlinenum% + \let\boxXendendlinenum\Xendboxendlinenum% + \let\XendXlemmaseparator\Xendlemmaseparator + \let\XendXbeforelemmaseparator\Xendbeforelemmaseparator + \let\XendXafterlemmaseparator\Xendafterlemmaseparator + \let\XendXinplaceoflemmaseparator\Xendinplaceoflemmaseparator + \fi + + \AtBeginDocument{% + \ifdef\lineref{}{\let\lineref\edlineref}% + }% + + \fi% +\endinput +%% +%% End of file `reledmac.sty'. diff --git a/Master/texmf-dist/tex/latex/reledmac/reledpar.sty b/Master/texmf-dist/tex/latex/reledmac/reledpar.sty new file mode 100644 index 00000000000..c117a68534c --- /dev/null +++ b/Master/texmf-dist/tex/latex/reledmac/reledpar.sty @@ -0,0 +1,2491 @@ +%% +%% This is file `reledpar.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% reledpar.dtx (with options: `code') +%% +%% Author: Author: Peter Wilson ; Herries Press herries dot press at earthlink dot net ; Maïeul Rouquette maieul at maieul dot net +%% Copyright 2004, 2005 Peter R. Wilson +%% 2011- Maïeul Rouquette +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3 of this license or (at your option) any +%% later version. +%% The latest version of the license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2003/06/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% This work consists of the files listed in the README file. +%% + + + + + +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{reledpar}[2015/07/19 v2.0.0 reledmac extension for parallel texts]% + +\RequirePackage{xspace}% +\newif\ifshiftedpstarts +\DeclareOption{shiftedpstarts}{\shiftedpstartstrue} +\DeclareOption{parledgroup}{\parledgrouptrue} +\DeclareOption{widthliketwocolumns}{\widthliketwocolumnstrue}% +\newif\ifsameparallelpagenumber% +\DeclareOption{sameparallelpagenumber}{\sameparallelpagenumbertrue}% +\ProcessOptions% +\newdimen\Lcolwidth + \Lcolwidth=0.45\textwidth +\newdimen\Rcolwidth + \Rcolwidth=0.45\textwidth +\newcommand{\reledpar@error}[2]{\PackageError{reledpar}{#1}{#2}} +\newcommand*{\led@err@TooManyPstarts}{% + \reledpar@error{Too many \string\pstart\space without printing. + Some text will be lost}{\@ehc}} +\newcommand*{\led@err@BadLeftRightPstarts}[2]{% + \reledpar@error{The numbers of left (#1) and right (#2) + \string\pstart s do not match}{\@ehc}} +\newcommand*{\led@err@LeftOnRightPage}{% + \reledpar@error{The left page has ended on a right page}{\@ehc}} +\newcommand*{\led@err@RightOnLeftPage}{% + \reledpar@error{The right page has ended on a left page}{\@ehc}} +\newcommand*{\led@err@Leftside@PreviousNotPrinted}{% + \reledpar@error{You call a new Leftside environment while the previous one has not been typeset by \string\Pages\space or \string\Columns}{\@ehc}} +\newcommand*{\led@err@Rightside@PreviousNotPrinted}{% + \reledpar@error{You call a new Rightside environment while the previous one has not been typeset by \string\Pages\space or \string\Columns}{\@ehc}} +\newcommand*{\led@err@Pages@InsideEnv}{% + \reledpar@error{\string\Pages\space must be called *outside* of the `pages` environment}{\@ehc}} +\newcommand*{\led@err@Columns@InsideEnv}{% + \reledpar@error{\string\Columns\space must be called *outside* of the `pairs` environment}{\@ehc}} +\newcommand{\led@error@fail@patch@thepage}{% + \reledpar@error{Fail to patch \string\@thepage\space command.}{\@ehc}% +}% +\newcommand{\led@error@fail@patch@pagenumbering}{% + \reledpar@error{Fail to patch \string\pagenumbering\space command.}{\@ehc}% +}% +\newcommand{\led@error@fail@patch@@outputpage}{% + \reledpar@error{Fail to patch \string\@outputpage\space command.}{\@ehc}% +}% +\newcount\section@numR + \section@numR=\z@ + \pst@rtedLfalse +\newif\ifpst@rtedR + +\newcommand*{\beginnumberingR}{% + \ifnumberingR + \led@err@NumberingStarted + \endnumberingR + \fi + \global\l@dnumpstartsR \z@ + \global\pst@rtedRfalse + \global\numberingRtrue + \global\advance\section@numR \@ne + \global\absline@numR \z@ + \gdef\normal@page@breakR{} + \gdef\l@prev@pbR{} + \gdef\l@prev@nopbR{} + \global\line@numR \z@ + \global\@lockR \z@ + \global\sub@lockR \z@ + \global\sublines@false + \global\let\next@page@numR\relax + \global\let\sub@change\relax + \message{Section \the\section@numR R }% + \line@list@stuffR{\jobname.\extensionchars\the\section@numR R}% + \l@dend@stuff + \setcounter{pstartR}{1} + \begingroup + \initnumbering@sectcountR + \gdef\eled@sectionsR@@{}% + \if@noeled@sec\else% + \makeatletter\InputIfFileExists{\jobname.eledsec\the\section@numR R}{}{}\makeatother% + \immediate\openout\eled@sectioningR@out=\jobname.eledsec\the\section@numR R\relax% + \fi% +} +\def\endnumberingR{% + \ifnumberingR + \global\numberingRfalse + \normal@pars + \ifnum\l@dnumpstartsR=0% + \led@err@NumberingWithoutPstart% + \fi% + \ifl@dpairing + \global\pst@rtedRfalse + \else + \ifx\insertlines@listR\empty\else + \global\noteschanged@true + \fi + \ifx\line@listR\empty\else + \global\noteschanged@true + \fi + \fi + \ifnoteschanged@ + \led@mess@NotesChanged + \fi + \else + \led@err@NumberingNotStarted + \fi + \endgroup + \if@noeled@sec\else% + \immediate\closeout\eled@sectioningR@out% + \fi% + } + +\newcounter{chapterR} +\newcounter{sectionR} +\newcounter{subsectionR} +\newcounter{subsubsectionR} +\newcommand{\initnumbering@sectcountR}{ + \let\c@chapter\c@chapterR + \let\c@section\c@sectionR + \let\c@subsection\c@subsectionR + \let\c@subsubsection\c@subsubsectionR +} +\newcommand*{\pausenumberingR}{% + \endnumberingR\global\numberingRtrue} +\newcommand*{\resumenumberingR}{% + \ifnumberingR + \global\pst@rtedRtrue + \global\advance\section@numR \@ne + \led@mess@SectionContinued{\the\section@numR R}% + \line@list@stuffR{\jobname.\extensionchars\the\section@numR R}% + \l@dend@stuff + \begingroup% + \initnumbering@sectcountR% + \else + \led@err@numberingShouldHaveStarted + \endnumberingR + \beginnumberingR + \fi} + +\newcommand*{\memorydumpL}{% + \endnumbering + \numberingtrue + \global\pst@rtedLtrue + \global\advance\section@num \@ne + \led@mess@SectionContinued{\the\section@num}% + \line@list@stuff{\jobname.\extensionchars\the\section@num}% + \l@dend@stuff} + +\newcommand*{\memorydumpR}{% + \endnumberingR + \numberingRtrue + \global\pst@rtedRtrue + \global\advance\section@numR \@ne + \led@mess@SectionContinued{\the\section@numR R}% + \line@list@stuffR{\jobname.\extensionchars\the\section@numR R}% + \l@dend@stuff} + + + +\newcommand*{\lineationR}[1]{{% + \ifnumbering + \led@err@LineationInNumbered + \else + \def\@tempa{#1}\def\@tempb{page}% + \ifx\@tempa\@tempb + \global\bypage@Rtrue + \global\bypstart@Rfalse + \unless\ifnocritical@% + \Xpstart[][false]% + \fi% + \else + \def\@tempb{pstart}% + \ifx\@tempa\@tempb + \global\bypage@Rfalse + \global\bypstart@Rtrue + \unless\ifnocritical@% + \Xpstart% + \fi% + \else + \def@tempb{section} + \ifx\@tempa\@tempb + \global\bypage@Rfalse% + \global\bypstart@Rfalse% + \unless\ifnocritical@% + \Xpstart[][false]% + \fi% + \else + \led@warn@BadLineation + \fi% + \fi + \fi + \fi}} +\WithSuffix\newcommand\lineation*[1]{% + \lineation{#1}% + \lineationR{#1}% +}% + +\newcount\line@marginR +\line@marginR=\@ne + +\newcounter{firstlinenumR} + \setcounter{firstlinenumR}{5} +\newcounter{linenumincrementR} + \setcounter{linenumincrementR}{5} +\newcounter{firstsublinenumR} + \setcounter{firstsublinenumR}{5} +\newcounter{sublinenumincrementR} + \setcounter{sublinenumincrementR}{5} + +\WithSuffix\newcommand\firstlinenum*[1]{% + \setcounter{firstlinenumR}{#1}% + \setcounter{firstlinenum}{#1}% +} +\WithSuffix\newcommand\linenumincrement*[1]{% + \setcounter{linenumincrementR}{#1}% + \setcounter{linenumincrement}{#1}% +} +\WithSuffix\newcommand\firstsublinenum*[1]{% + \setcounter{subfirstlinenumR}{#1}% + \setcounter{subfirstlinenum}{#1}% +} +\WithSuffix\newcommand\sublinenumincrement*[1]{% + \setcounter{sublinenumincrementR}{#1}% + \setcounter{sublinenumincrement}{#1}% +} +\newcommand{\setRlineflag}[1]{% + \gdef\@Rlineflag{#1}% +} +\setRlineflag{R} +\newcommand*{\linenumrepR}[1]{\@arabic{#1}} +\newcommand*{\sublinenumrepR}[1]{\@arabic{#1}} + +\newcommand*{\leftlinenumR}{% + \l@dlinenumR + \kern\linenumsep} +\newcommand*{\rightlinenumR}{% + \kern\linenumsep + \l@dlinenumR} +\newcommand*{\l@dlinenumR}{% + \numlabfont\linenumrepR{\line@numR}\@Rlineflag% + \ifsublines@ + \ifnum\subline@num>\z@ + \unskip\fullstop\sublinenumrepR{\subline@numR}% + \fi + \fi} + +\newcount\line@numR +\newcount\subline@numR +\newcount\absline@numR + +\list@create{\line@listR} +\list@create{\insertlines@listR} +\list@create{\actionlines@listR} +\list@create{\actions@listR} + +\newcount\page@numR + +\list@create{\linesinpar@listL} +\list@create{\linesinpar@listR} +\list@create{\maxlinesinpar@list} + +\newcommand{\list@clearing@regR}{% + \list@clear{\line@listR}% + \list@clear{\insertlines@listR}% + \list@clear{\actionlines@listR}% + \list@clear{\actions@listR}% + \list@clear{\linesinpar@listR}% + \list@clear{\linesonpage@listR} +} +\newcommand{\@nl@regR}{% + \ifx\l@dchset@num\relax \else + \advance\absline@numR \@ne + \set@line@action + \let\l@dchset@num\relax + \advance\absline@numR \m@ne + \advance\line@numR \m@ne% % do we need this? + \fi + \advance\absline@numR \@ne + \ifx\next@page@numR\relax \else + \page@action + \let\next@page@numR\relax + \fi + \ifx\sub@change\relax \else + \ifnum\sub@change>\z@ + \sublines@true + \else + \sublines@false + \fi + \sub@action + \let\sub@change\relax + \fi + \ifcase\@lockR + \or + \@lockR \tw@ + \or\or + \@lockR \z@ + \fi + \ifcase\sub@lockR + \or + \sub@lockR \tw@ + \or\or + \sub@lockR \z@ + \fi + \ifsublines@ + \ifnum\sub@lockR<\tw@ + \advance\subline@numR \@ne + \fi + \else + \ifnum\@lockR<\tw@ + \advance\line@numR \@ne \subline@numR \z@ + \fi + \fi} + +\newcount\last@page@numR + \last@page@numR=-10000 + + + + +\newcount\@lockR +\newcount\sub@lockR + +\newcommand*{\do@lockonR}{% + \xright@appenditem{\the\absline@numR}\to\actionlines@listR + \ifsublines@ + \xright@appenditem{-1005}\to\actions@listR + \ifnum\sub@lockR=\z@ + \sub@lockR \@ne + \else + \ifnum\sub@lockR=\thr@@ + \sub@lockR \@ne + \fi + \fi + \else + \xright@appenditem{-1003}\to\actions@listR + \ifnum\@lockR=\z@ + \@lockR \@ne + \else + \ifnum\@lockR=\thr@@ + \@lockR \@ne + \fi + \fi + \fi} + + +\newcommand{\do@lockoffR}{% + \xright@appenditem{\the\absline@numR}\to\actionlines@listR + \ifsublines@ + \xright@appenditem{-1006}\to\actions@listR + \ifnum\sub@lockR=\tw@ + \sub@lockR \thr@@ + \else + \sub@lockR \z@ + \fi + \else + \xright@appenditem{-1004}\to\actions@listR + \ifnum\@lockR=\tw@ + \@lockR \thr@@ + \else + \@lockR \z@ + \fi + \fi} + +\newcount\insert@countR +\newcommand*{\@ref@regR}[2]{% + \global\advance\@edtext@level by 1% + \global\insert@countR=#1\relax + \loop\ifnum\insert@countR>\z@ + \xright@appenditem{\the\absline@numR}\to\insertlines@listR + \global\advance\insert@countR \m@ne + \repeat + \begingroup + \let\@ref=\dummy@ref + \let\@lopR\@gobble + \let\page@action=\relax + \let\sub@action=\relax + \let\set@line@action=\relax + \let\@lab=\relax + \let\@lemma=\relax + \let\@sw\@gobblethree% + #2 + \global\endpage@num=\page@numR + \global\endline@num=\line@numR + \global\endsubline@num=\subline@numR + \endgroup + \xright@appenditem% + {\the\page@numR|\the\line@numR|% + \ifsublines@ \the\subline@numR \else 0\fi|% + \the\endpage@num|\the\endline@num|% + \ifsublines@ \the\endsubline@num \else 0\fi}\to\line@listR + \expandafter\list@create\expandafter{\csname sw@list@edtext@tmp@\the\@edtext@level\endcsname}% + \providebool{lemmacommand@\the\@edtext@level}% + \boolfalse{lemmacommand@\the\@edtext@level}% + #2 + \ifnum\@edtext@level>0% + \def\create@this@edtext@level{\expandafter\list@create\expandafter{\csname sw@list@edtextR@\the\@edtext@level\endcsname}}% + \ifcsundef{sw@list@edtextR@\the\@edtext@level}{\create@this@edtext@level}{}% + \letcs{\@tmp}{sw@list@edtextR@\the\@edtext@level}% + \letcs{\@tmpp}{sw@list@edtext@tmp@\the\@edtext@level}% + \xright@appenditem{\expandonce\@tmpp}\to\@tmp% + \global\cslet{sw@list@edtextR@\the\@edtext@level}{\@tmp}% + \fi% + \global\advance\@edtext@level by -1% +} +\renewcommand*{\@pend}[1]{% + \ifbypstart@\global\line@num=0\fi% + \xright@appenditem{#1}\to\linesinpar@listL} +\renewcommand*{\@pendR}[1]{% + \ifbypstart@R\global\line@numR=0\fi + \xright@appenditem{#1}\to\linesinpar@listR} + +\renewcommand*{\@lopL}[1]{% + \xright@appenditem{#1}\to\linesonpage@listL} +\renewcommand*{\@lopR}[1]{% + \xright@appenditem{#1}\to\linesonpage@listR} + +\newwrite\linenum@outR +\newif\iffirst@linenum@out@R + \first@linenum@out@Rtrue +\newcommand*{\line@list@stuffR}[1]{% + \read@linelist{#1}% + \iffirst@linenum@out@R + \immediate\closeout\linenum@outR + \global\first@linenum@out@Rfalse + \immediate\openout\linenum@outR=#1 + \immediate\write\linenum@outR{\string\line@list@version{\this@line@list@version}}% + \else + \if@minipage% + \leavevmode% + \fi% + \closeout\linenum@outR% + \openout\linenum@outR=#1% + \fi} + +\newcommand*{\new@lineL}{% + \write\linenum@out{\string\@nl[\the\c@page][\thepage]}} +\newcommand*{\new@lineR}{% + \write\linenum@outR{\string\@nl[\the\c@page][\thepage]}} + +\newcommand{\newseries@par}[1]{% + \unless\ifnofamiliar@% + \csgdef{onlysideX@#1}{}% + \global\newbool{keepforsideX@#1}% + \fi% + \unless\ifnocritical@% + \global\newbool{keepforXside@#1}% + \csgdef{Xonlyside@#1}{}% + \fi% + \unless\ifnofamiliar@% + \expandafter\list@create\csname footnote#1@mk\endcsname% + \expandafter\newcommand\csname footnote#1nomk\endcsname[1]{% + \toggletrue{nomk@}% + \csuse{footnote#1}{##1}% + \togglefalse{nomk@}% + \letcs{\@tmp}{footnote#1@mk}% + \numdef\@tmpa{\csuse{c@footnote#1}}% + \global\xright@appenditem{\@tmpa}\to\@tmp% + \global\cslet{footnote#1@mk}{\@tmp}% + }% + \expandafter\newcommand\csname footnote#1mk\endcsname{% + \letcs{\@tmp}{footnote#1@mk}% + \gl@p\@tmp\to\@tmpa% + \global\cslet{footnote#1@mk}{\@tmp}% + \letcs{\old@footnote}{c@footnote#1}% + \setcounter{footnote#1}{\@tmpa}% + \protected@csxdef{@thefnmark#1}{\csuse{thefootnote#1}}% + \csuse{@footnotemark#1}% + \setcounter{footnote#1}{\old@footnote}% + \xspace% + }% + \fi +}% +\unless\ifnocritical@% + \newhookcommand@series{Xonlyside}% +\fi% +\unless\ifnofamiliar@% + \newhookcommand@series{onlysideX}% +\fi + +\newcommand{\init@series@par}{% + \def\do##1{\newseries@par{##1}}% + \dolistloop{\@series}% +}% +\init@series@par% + +\list@create{\list@pstartL@pc}% +\list@create{\list@pstartR@pc}% +\def\dump@pstartL@pc{% + \xright@appenditem{\the\c@pstartL}\to\list@pstartL@pc% + \global\cslet{numberpstart@L\the\l@dnumpstartsL}{\ifnumberpstart}% +}% + +\def\dump@pstartR@pc{% + \xright@appenditem{\the\c@pstartR}\to\list@pstartR@pc% + \global\cslet{numberpstart@R\the\l@dnumpstartsR}{\ifnumberpstart}% +}% + +\def\restore@pstartL@pc{% + \ifx\list@pstartL@pc\empty\else% + \gl@p\list@pstartL@pc\to\@temp% + \global\c@pstartL=\@temp% + \fi% +}% +\def\restore@pstartR@pc{% + \ifx\list@pstartR@pc\empty\else% + \gl@p\list@pstartR@pc\to\@temp% + \global\c@pstartR=\@temp% + \fi% +}% +\newenvironment{pairs}{%} + \l@dpairingtrue + \l@dpagingfalse + \initnumbering@quote + \at@begin@pairs% +}{% + \l@dpairingfalse +} + +\newcommand{\AtBeginPairs}[1]{\xdef\at@begin@pairs{#1}}% +\def\at@begin@pairs{}% + +\newenvironment{pages}{% + \l@dpairingtrue + \l@dpagingtrue + \initnumbering@quote + \setlength{\Lcolwidth}{\textwidth}% + \setlength{\Rcolwidth}{\textwidth}% +}{% + \l@dpairingfalse + \l@dpagingfalse +} + + \newif\ifinstanzaL + \newif\ifinstanzaR +\newenvironment{Leftside}{% + \expandafter\ifvoid\csname l@dLcolrawbox1\endcsname\else% + \led@err@Leftside@PreviousNotPrinted% + \fi% + \ledRcolfalse + \setcounter{pstartL}{1} + \let\pstart\pstartL + \let\thepstart\thepstartL + \let\pend\pendL + \let\memorydump\memorydumpL + \Leftsidehook + \let\old@startstanza\@startstanza + \def\@startstanza[##1]{\global\instanzaLtrue\old@startstanza[##1]} +}{ + \Leftsidehookend} +\newcommand*{\Leftsidehook}{} +\newcommand*{\Leftsidehookend}{} +\newcommand*{\Rightsidehook}{} +\newcommand*{\Rightsidehookend}{} + +\newenvironment{Rightside}{% + \expandafter\ifvoid\csname l@dRcolrawbox1\endcsname\else% + \led@err@Rightside@PreviousNotPrinted% + \fi% + \ledRcoltrue + \let\beginnumbering\beginnumberingR + \let\endnumbering\endnumberingR + \let\pausenumbering\pausenumberingR + \let\resumenumbering\resumenumberingR + \let\memorydump\memorydumpR + \let\thepstart\thepstartR + \let\pstart\pstartR + \let\pend\pendR + \let\ledpb\ledpbR + \let\lednopb\lednopbR + \let\lineation\lineationR + \Rightsidehook + \let\old@startstanza\@startstanza + \def\@startstanza[##1]{\global\instanzaRtrue\old@startstanza[##1]} +}{% + \ledRcolfalse + \Rightsidehookend +} + +\newcount\num@linesR +\newbox\one@lineR +\newcount\par@lineR + +\newcounter{pstartL} +\renewcommand{\thepstartL}{{\bfseries\@arabic\c@pstartL}. } +\newcounter{pstartR} +\renewcommand{\thepstartR}{{\bfseries\@arabic\c@pstartR}. } + +\newcommandx*{\pstartL}[1][1]{% + \if@nobreak% + \let\@oldnobreak\@nobreaktrue% + \else% + \let\@oldnobreak\@nobreakfalse% + \fi% + \@nobreaktrue% + \ifluatex% + \xdef\l@luatextextdir@L{\the\luatextextdir}% + \xdef\l@luatexpardir@L{\the\luatexpardir}% + \xdef\l@luatexbodydir@L{\the\luatexbodydir}% + \fi% + \ifnumbering \else% + \led@err@PstartNotNumbered% + \beginnumbering% + \fi% + \ifnumberedpar@% + \led@err@PstartInPstart% + \pend% + \fi% + \ifpst@rtedL\else% + \list@clear{\inserts@list}% + \global\let\next@insert=\empty% + \global\pst@rtedLtrue% + \fi% + \begingroup\normal@pars% + \global\advance\l@dnumpstartsL \@ne% + \ifnum\l@dnumpstartsL>\l@dc@maxchunks% + \led@err@TooManyPstarts% + \global\l@dnumpstartsL=\l@dc@maxchunks% + \fi% + \global\setnamebox{l@dLcolrawbox\the\l@dnumpstartsL}=\vbox\bgroup% + \l@dzeropenalties% + \ifautopar\else% + \ifnumberpstart% + \ifsidepstartnum% + \else% + \thepstartL% + \fi% + \fi% + \fi% + \hsize=\Lcolwidth% + \numberedpar@true% + \iflabelpstart\protected@edef\@currentlabel% + {\p@pstartL\thepstartL}\fi% + \ifstrempty{#1}% + {\csgdef{before@pstartL@\the\l@dnumpstartsL}{\at@every@pstart}}% + {\csgdef{before@pstartL@\the\l@dnumpstartsL}{\noindent#1}}% + \at@every@pstart@call% + } +\newcommandx*{\pstartR}[1][1]{% + \if@nobreak% + \let\@oldnobreak\@nobreaktrue% + \else% + \let\@oldnobreak\@nobreakfalse% + \fi% + \@nobreaktrue% + \ifluatex% + \xdef\l@luatextextdir@R{\the\luatextextdir}% + \xdef\l@luatexpardir@R{\the\luatexpardir}% + \xdef\l@luatexbodydir@R{\the\luatexbodydir}% + \fi% + \ifnumberingR \else% + \led@err@PstartNotNumbered% + \beginnumberingR% + \fi% + \ifnumberedpar@% + \led@err@PstartInPstart% + \pendR% + \fi% + \ifpst@rtedR\else% + \list@clear{\inserts@listR}% + \global\let\next@insertR=\empty% + \global\pst@rtedRtrue% + \fi% + \begingroup\normal@pars% + \global\advance\l@dnumpstartsR \@ne% + \ifnum\l@dnumpstartsR>\l@dc@maxchunks% + \led@err@TooManyPstarts% + \global\l@dnumpstartsR=\l@dc@maxchunks% + \fi% + \global\setnamebox{l@dRcolrawbox\the\l@dnumpstartsR}=\vbox\bgroup% + \l@dzeropenalties% + \ifautopar\else% + \ifnumberpstart% + \ifsidepstartnum\else% + \thepstartR% + \fi% + \fi% + \fi% + \hsize=\Rcolwidth% + \numberedpar@true% + \iflabelpstart\protected@edef\@currentlabel% + {\p@pstartR\thepstartR}\fi% + \ifstrempty{#1}% + {\csgdef{before@pstartR@\the\l@dnumpstartsR}{\at@every@pstart}}% + {\csgdef{before@pstartR@\the\l@dnumpstartsR}{\noindent#1}}% + \at@every@pstart@call% + } +\newcommandx*{\pendL}[1][1]{% + \ifnumbering \else% + \led@err@PendNotNumbered% + \fi% + \ifnumberedpar@ \else% + \led@err@PendNoPstart% + \fi% + \endgraf\global\num@lines=\prevgraf\egroup% + \global\par@line=0% + \endgroup% + \ignorespaces% + \@oldnobreak% + \dump@pstartL@pc% + \ifnumberpstart% + \addtocounter{pstartL}{1}% + \fi + \parledgroup@beforenotes@save{L}% + \ifstrempty{#1}% + {\csgdef{after@pendL@\the\l@dnumpstartsL}{\at@every@pend}}% + {\csgdef{after@pendL@\the\l@dnumpstartsL}{\noindent#1}}% + } +\newcommandx*{\pendR}[1][1]{% + \ifnumberingR \else% + \led@err@PendNotNumbered% + \fi% + \ifnumberedpar@ \else% + \led@err@PendNoPstart% + \fi% + \endgraf\global\num@linesR=\prevgraf\egroup% + \global\par@lineR=0% + \endgroup% + \ignorespaces% + \@oldnobreak% + \dump@pstartR@pc% + \ifnumberpstart% + \addtocounter{pstartR}{1}% + \fi% + \parledgroup@beforenotes@save{R}% + \ifstrempty{#1}% + {\csgdef{after@pendR@\the\l@dnumpstartsR}{\at@every@pend}}% + {\csgdef{after@pendR@\the\l@dnumpstartsR}{\noindent#1}}% +} + +\newcommand{\AtEveryPstartCall}[1]{\gdef\at@every@pstart@call{#1}}% +\gdef\at@every@pstart@call{}% +\newif\ifprint@last@after@pendL% +\newif\ifprint@last@after@pendR% +\newbox\l@dleftbox +\newbox\l@drightbox + +\newcount\countLline + \countLline \z@ +\newcount\countRline + \countRline \z@ + +\newcount\@donereallinesL +\newcount\@donetotallinesL +\newcount\@donereallinesR +\newcount\@donetotallinesR + +\newcommand*{\do@lineL}{% + \letcs{\ifnumberpstart}{numberpstart@L\the\l@dpscL}% + \advance\countLline \@ne% + \ifvbox\namebox{l@dLcolrawbox\the\l@dpscL}% + {\vbadness=10000% + \splittopskip=\z@% + \do@lineLhook% + \l@demptyd@ta% + \global\setbox\one@line=\vsplit\namebox{l@dLcolrawbox\the\l@dpscL}% + to\baselineskip}% + \IfStrEq{\splitfirstmarks\parledgroup@}{begin}{\parledgroup@notes@startL}{}% + \unvbox\one@line \global\setbox\one@line=\lastbox% + \getline@numL% + \ifnum\@lock>\@ne% + \inserthangingsymboltrue% + \else% + \inserthangingsymbolfalse% + \fi% + \setbox\l@dleftbox% + \hb@xt@ \Lcolwidth{% + \ifl@dhidenumber% + \global\l@dhidenumberfalse% + \f@x@l@cks% + \else% + \affixline@num% + \fi% + \xifinlist{\the\l@dpscL}{\eled@sections@@}% + {\add@inserts\affixside@note}% + {\print@lineL}}% + \add@penaltiesL% + \global\advance\@donereallinesL\@ne% + \global\advance\@donetotallinesL\@ne% +\else% + \setbox\l@dleftbox \hb@xt@ \Lcolwidth{\hspace*{\Lcolwidth}}% + \global\advance\@donetotallinesL\@ne% +\fi} + +\def\print@lineL{% + \affixpstart@numL% + \l@dld@ta %space kept for backward compatibility + \add@inserts\affixside@note% + \l@dlsn@te %space kept for backward compatibility + {\ledllfill\hb@xt@ \Lcolwidth{% + \do@insidelineLhook% + \ifluatex% + \luatextextdir\l@luatextextdir@L% + \fi% + \new@lineL% + \inserthangingsymbolL% + \l@dunhbox@line{\one@line}}\ledrlfill\l@drd@ta% + \l@drsn@te}} + +\def\print@eledsectionL{%% + \addtocounter{pstartL}{-1}% + \ifdefstring{\@eledsectnotoc}{L}{\ledsectnotoc}{} + \ifdefstring{\@eledsectmark}{L}{}{\ledsectnomark} + \numdef{\temp@}{\l@dpscL-1}% + \xifinlist{\temp@}{\eled@sections@@}{\@nobreaktrue}{\@nobreakfalse}% + \@eled@sectioningtrue% + \bgroup% + \ifluatex% + \luatextextdir\l@luatextextdir@L% + \luatexpardir\l@luatexpardir@L% + \luatexbodydir\l@luatexbodydir@L% + \ifdefstring{\l@luatextextdir@L}{TRT}{\@RTLtrue}{}% + \fi% + \csuse{eled@sectioning@\the\l@dpscL}% + \egroup% + \@eled@sectioningfalse% + \global\csundef{eled@sectioning@\the\l@dpscL}% + \if@RTL% + \hspace{-3\paperwidth}% + {\hbox{\l@dunhbox@line{\one@line}} \new@line}% + \else% + \hspace{3\paperwidth}% + {\new@line \hbox{\l@dunhbox@line{\one@line}}}% + \fi% + \vskip\eledsection@correcting@skip% +} + +\newcommand*{\dolineLhook}[1]{\gdef\do@lineLhook{#1}}% +\newcommand*{\dolineRhook}[1]{\gdef\do@lineRhook{#1}}% +\newcommand*{\doinsidelineLhook}[1]{\gdef\do@insidelineLhook{#1}}% +\newcommand*{\doinsidelineRhook}[1]{\gdef\do@insidelineRhook{#1}}% + +\newcommand*{\do@lineLhook}{} +\newcommand*{\do@lineRhook}{} +\newcommand*{\do@insidelineLhook}{} +\newcommand*{\do@insidelineRhook}{} + +\newcommand*{\do@lineR}{% + \letcs{\ifnumberpstart}{numberpstart@R\the\l@dpscR}% + \ledRcol@true% + \advance\countRline \@ne% + \ifvbox\namebox{l@dRcolrawbox\the\l@dpscR}% + {\vbadness=10000% + \splittopskip=\z@% + \do@lineRhook% + \l@demptyd@ta% + \global\setbox\one@lineR=\vsplit\namebox{l@dRcolrawbox\the\l@dpscR}% + to\baselineskip}% + \IfStrEq{\splitfirstmarks\parledgroup@}{begin}{\parledgroup@notes@startR}{}% + \unvbox\one@lineR \global\setbox\one@lineR=\lastbox% + \getline@numR% + \ifnum\@lockR>\@ne% + \inserthangingsymbolRtrue% + \else% + \inserthangingsymbolRfalse% + \fi% + \setbox\l@drightbox% + \hb@xt@ \Rcolwidth{% + \ifl@dhidenumber% + \global\l@dhidenumberfalse% + \f@x@l@cksR% + \else% + \affixline@numR% + \fi% + \xifinlist{\the\l@dpscR}{\eled@sectionsR@@}% + {\add@insertsR\affixside@noteR}% + {\print@lineR}% + }% + \add@penaltiesR% + \global\advance\@donereallinesR\@ne% + \global\advance\@donetotallinesR\@ne% +\else% + \setbox\l@drightbox \hb@xt@ \Rcolwidth{\hspace*{\Rcolwidth}}% + \global\advance\@donetotallinesR\@ne% +\fi% +\ledRcol@false% +} + +\def\print@lineR{% + \affixpstart@numR% + \l@dld@ta %space kept for backward compatibility + \add@insertsR\affixside@noteR% + \l@dlsn@te %space kept for backward compatibility + \ledllfill\hb@xt@ \Rcolwidth{% + \do@insidelineRhook% + \new@lineR% + \inserthangingsymbolR% + \ifluatex% + \luatextextdir\l@luatextextdir@R% + \fi% + \l@dunhbox@line{\one@lineR}}\ledrlfill\l@drd@ta% + \l@drsn@te% + } + +\def\print@eledsectionR{% + \addtocounter{pstartR}{-1}% + \initnumbering@sectcountR% + \ifdefstring{\@eledsectnotoc}{R}{\ledsectnotoc}{}% + \ifdefstring{\@eledsectmark}{R}{}{\ledsectnomark}% + \numdef{\temp@}{\l@dpscR-1}% + \xifinlist{\temp@}{\eled@sectionsR@@}{\@nobreaktrue}{\@nobreakfalse}% + \@eled@sectioningtrue% + \bgroup% + \ifluatex% + \luatextextdir\l@luatextextdir@R% + \luatexpardir\l@luatexpardir@R% + \luatexbodydir\l@luatexbodydir@R% + \ifdefstring{\l@luatextextdir@L}{TRT}{\@RTLtrue}{}% + \fi% + \csuse{eled@sectioning@\the\l@dpscR R}% + \egroup% + \@eled@sectioningfalse% + \global\csundef{eled@sectioning@\the\l@dpscR R}% + \if@RTL% + \hspace{-\paperwidth}% + {\hbox{\l@dunhbox@line{\one@lineR}} \new@lineR}% + \else% + \hspace{\paperwidth}% + {\new@lineR \hbox{\l@dunhbox@line{\one@lineR}}}% + \fi% + \vskip\eledsection@correcting@skip +} +\newcommand*{\getline@numR}{% + \global\advance\absline@numR \@ne + \do@actionsR + \do@ballastR + \ifledgroupnotesR@\else + \ifnumberline + \ifsublines@ + \ifnum\sub@lockR<\tw@ + \global\advance\subline@numR \@ne + \fi + \else + \ifnum\@lockR<\tw@ + \global\advance\line@numR \@ne + \global\subline@numR \z@ + \fi + \fi + \fi + \fi +} +\newcommand*{\getline@numL}{% + \global\advance\absline@num \@ne + \do@actions + \do@ballast + \ifledgroupnotesL@\else + \ifnumberline + \ifsublines@ + \ifnum\sub@lock<\tw@ + \global\advance\subline@num \@ne + \fi + \else + \ifnum\@lock<\tw@ + \global\advance\line@num \@ne + \global\subline@num \z@ + \fi + \fi + \fi + \fi +} + +\newcommand*{\do@ballastR}{\global\ballast@count=\z@ + \begingroup + \advance\absline@numR \@ne + \ifnum\next@actionlineR=\absline@numR + \ifnum\next@actionR>-1001 + \global\advance\ballast@count by -\c@ballast + \fi + \fi + \endgroup} + +\newif\ifl@dskipversenumberR +\newcommand*{\do@actions@fixedcodeR}{% + \ifcase\@l@dtempcnta% + \or% % 1001 + \global\sublines@true + \or% % 1002 + \global\sublines@false + \or% % 1003 + \global\@lockR=\@ne + \or% % 1004% + \ifnum\@lockR=\tw@ + \global\@lockR=\thr@@ + \else + \global\@lockR=\z@ + \fi + \or% % 1005 + \global\sub@lockR=\@ne + \or% % 1006 + \ifnum\sub@lockR=\tw@ + \global\sub@lockR=\thr@@ + \else + \global\sub@lockR=\z@ + \fi + \or% % 1007 + \l@dskipnumbertrue + \or% % 1008 + \l@dskipversenumberRtrue% + \or% % 1009 + \l@dhidenumbertrue% + \else% + \led@warn@BadAction + \fi% +} + +\newcommand*{\do@actionsR}{% + \global\let\do@actions@nextR=\relax + \@l@dtempcntb=\absline@numR + \ifnum\@l@dtempcntb<\next@actionlineR\else + \ifnum\next@actionR>-1001\relax + \global\page@numR=\next@actionR + \ifbypage@R + \global\line@numR \z@ \global\subline@numR \z@ + \fi + \else + \ifnum\next@actionR<-4999\relax % 9/05 added relax here + \@l@dtempcnta=-\next@actionR + \advance\@l@dtempcnta by -5001\relax + \ifsublines@ + \global\subline@numR=\@l@dtempcnta + \else + \global\line@numR=\@l@dtempcnta + \fi + \else + \@l@dtempcnta=-\next@actionR + \advance\@l@dtempcnta by -1000\relax + \do@actions@fixedcodeR + \fi + \fi + \ifx\actionlines@listR\empty + \gdef\next@actionlineR{1000000}% + \else + \gl@p\actionlines@listR\to\next@actionlineR + \gl@p\actions@listR\to\next@actionR + \global\let\do@actions@nextR=\do@actionsR + \fi + \fi + \do@actions@nextR} + + +\newcommand*{\l@dcalcnum}[3]{% + \ifnum #1 > #2\relax + \@l@dtempcnta = #1\relax + \advance\@l@dtempcnta by -#2\relax + \divide\@l@dtempcnta by #3\relax + \multiply\@l@dtempcnta by #3\relax + \advance\@l@dtempcnta by #2\relax + \else + \@l@dtempcnta=#2\relax + \fi} + +\newcommand*{\ch@cksub@l@ckR}{% + \ifcase\sub@lockR + \or + \ifnum\sublock@disp=\@ne + \@l@dtempcntb \z@ \@l@dtempcnta \@ne + \fi + \or + \ifnum\sublock@disp=\tw@ + \else + \@l@dtempcntb \z@ \@l@dtempcnta \@ne + \fi + \or + \ifnum\sublock@disp=\z@ + \@l@dtempcntb \z@ \@l@dtempcnta \@ne + \fi + \fi} + +\newcommand*{\ch@ck@l@ckR}{% + \ifcase\@lockR + \or + \ifnum\lock@disp=\@ne + \@l@dtempcntb \z@ \@l@dtempcnta \@ne + \fi + \or + \ifnum\lock@disp=\tw@ + \else + \@l@dtempcntb \z@ \@l@dtempcnta \@ne + \fi + \or + \ifnum\lock@disp=\z@ + \@l@dtempcntb \z@ \@l@dtempcnta \@ne + \fi + \fi} + +\newcommand*{\f@x@l@cksR}{% + \ifcase\@lockR + \or + \global\@lockR \tw@ + \or \or + \global\@lockR \z@ + \fi + \ifcase\sub@lockR + \or + \global\sub@lockR \tw@ + \or \or + \global\sub@lockR \z@ + \fi} + +\newcommand*{\affixline@numR}{% +\ifledgroupnotesR@\else\ifnumberline +\ifl@dskipnumber + \global\l@dskipnumberfalse +\else + \ifsublines@ + \@l@dtempcntb=\subline@numR + \l@dcalcnum{\subline@numR}{\c@firstsublinenumR}{\c@sublinenumincrementR}% + \ch@cksub@lockR + \else + \@l@dtempcntb=\line@numR + \ifx\linenumberlist\empty + \l@dcalcnum{\line@numR}{\c@firstlinenumR}{\c@linenumincrementR}% + \else + \@l@dtempcnta=\line@numR + \edef\rem@inder{,\linenumberlist,\number\line@numR,}% + \edef\sc@n@list{\def\noexpand\sc@n@list + ####1,\number\@l@dtempcnta,####2|{\def\noexpand\rem@inder{####2}}}% + \sc@n@list\expandafter\sc@n@list\rem@inder|% + \ifx\rem@inder\empty\advance\@l@dtempcnta\@ne\fi + \fi + \ch@ck@l@ckR + \fi + \ifnum\@l@dtempcnta=\@l@dtempcntb + \ifl@dskipversenumberR\else + \if@twocolumn + \if@firstcolumn + \gdef\l@dld@ta{\llap{{\leftlinenumR}}}% + \else + \gdef\l@drd@ta{\rlap{{\rightlinenumR}}}% + \fi + \else + \@l@dtempcntb=\line@marginR + \ifnum\@l@dtempcntb>\@ne + \advance\@l@dtempcntb by\page@numR + \fi + \ifodd\@l@dtempcntb + \gdef\l@drd@ta{\rlap{{\rightlinenumR}}}% + \else + \gdef\l@dld@ta{\llap{{\leftlinenumR}}}% + \fi + \fi + \fi + \fi + \f@x@l@cksR +\fi +\fi +\fi} + +\newcommand*{\affixpstart@numL}{% +\ifsidepstartnum +\if@twocolumn + \if@firstcolumn + \gdef\l@dld@ta{\llap{{\leftpstartnumL}}}% + \else + \gdef\l@drd@ta{\rlap{{\rightpstartnumL}}}% + \fi + \else + \@l@dtempcntb=\line@margin + \ifnum\@l@dtempcntb>\@ne + \advance\@l@dtempcntb \page@num + \fi + \ifodd\@l@dtempcntb + \gdef\l@drd@ta{\rlap{{\rightpstartnumL}}}% + \else + \gdef\l@dld@ta{\llap{{\leftpstartnumL}}}% + \fi + \fi +\fi +} +\newcommand*{\affixpstart@numR}{% +\ifsidepstartnum +\if@twocolumn + \if@firstcolumn + \gdef\l@dld@ta{\llap{{\leftpstartnumR}}}% + \else + \gdef\l@drd@ta{\rlap{{\rightpstartnumR}}}% + \fi + \else + \@l@dtempcntb=\line@marginR + \ifnum\@l@dtempcntb>\@ne + \advance\@l@dtempcntb \page@numR + \fi + \ifodd\@l@dtempcntb + \gdef\l@drd@ta{\rlap{{\rightpstartnumR}}}% + \else + \gdef\l@dld@ta{\llap{{\leftpstartnumR}}}% + \fi + \fi +\fi +} + +\newcommand*{\leftpstartnumL}{ +\ifpstartnum +\thepstartL +\kern\linenumsep\global\pstartnumfalse\fi +} +\newcommand*{\rightpstartnumL}{ +\ifpstartnum\kern\linenumsep +\thepstartL +\global\pstartnumfalse\fi +} +\newif\ifpstartnumR +\pstartnumRtrue +\newcommand*{\leftpstartnumR}{ +\ifpstartnumR +\thepstartR +\kern\linenumsep\global\pstartnumRfalse\fi +} +\newcommand*{\rightpstartnumR}{ +\ifpstartnumR\kern\linenumsep +\thepstartR +\global\pstartnumRfalse\fi +} +\list@create{\inserts@listR} +\newcommand*{\add@insertsR}{% + \global\let\add@inserts@nextR=\relax + \ifx\inserts@listR\empty \else + \ifx\next@insertR\empty + \ifx\insertlines@listR\empty + \global\noteschanged@true + \gdef\next@insertR{100000}% + \else + \gl@p\insertlines@listR\to\next@insertR + \fi + \fi + \ifnum\next@insertR=\absline@numR + \gl@p\inserts@listR\to\@insertR + \@insertR + \global\let\@insertR=\undefined + \global\let\next@insertR=\empty + \global\let\add@inserts@nextR=\add@insertsR + \fi + \fi + \add@inserts@nextR} + +\newcommand*{\add@penaltiesL}{} +\newcommand*{\add@penaltiesR}{} + +\newcommand*{\flush@notesR}{% + \@xloop + \ifx\inserts@listR\empty \else + \gl@p\inserts@listR\to\@insertR + \@insertR + \global\let\@insertR=\undefined + \repeat} + +\def\printlinesR#1|#2|#3|#4|#5|#6|#7|{\begingroup + \setprintlines{#1}{#2}{#3}{#4}{#5}{#6}% + \ifl@d@pnum #1\fullstop\fi + \ifledplinenum \linenumr@p{#2}\@Rlineflag\else \symplinenum\fi + \ifl@d@ssub \fullstop \sublinenumr@p{#3}\fi + \ifl@d@dash \endashchar\fi + \ifl@d@pnum #4\fullstop\fi + \ifl@d@elin \linenumr@p{#5}\@Rlineflag\fi + \ifl@d@esl \ifl@d@elin \fullstop\fi \sublinenumr@p{#6}\fi +\endgroup} + +\newcommand\print@Xnotes@forpages[1]{% + \ifcsempty{Xonlyside@#1}{% + \csuse{#1footstart}{#1}% + \csuse{#1footgroup}{#1}% + }% + {% + \ifboolexpr{% + ((test {\ifcsstring{Xonlyside@#1}{L}} and not test{\ifnumodd{\c@page}})% + or% + (test {\ifcsstring{Xonlyside@#1}{R}} and test{\ifnumodd{\c@page}}))% + }% + {% + \correct@Xfootins@box{#1}% + \csuse{#1footstart}{#1}% + \csuse{#1footgroup}{#1}% + \global\count\csuse{#1footins}=0% + \global\skip\csuse{#1footins}=0pt% + \csuse{Xnotefontsize@#1}% + \global\advance\dimen\csuse{#1footins} by -\baselineskip% + \global\boolfalse{keepforXside@#1}% + }% + {% + \global\booltrue{keepforXside@#1}% + \global\count\csuse{#1footins}=\csuse{default@#1footins}% + \global\skip\csuse{#1footins}=\csuse{Xbeforenotes@#1}% + \bgroup% + \csuse{Xnotefontsize@#1}% + \global\advance\dimen\csuse{#1footins} by \baselineskip% + \egroup% + }% + }% +}% +\newcommand{\correct@Xfootins@box}[1]{% + \ifbool{keepforXside@#1}{% + \csuse{Xnotefontsize@#1}% + \splittopskip=0pt% + \global\setbox\csuse{#1footins}=\vbox{% + \vsplit\csuse{#1footins} to \dimexpr\ht\csuse{#1footins}-1pt\relax% + \vskip \dimexpr-0.5\baselineskip-0.5\lineskip-0.5pt\relax% + \unvbox\csuse{#1footins}% + }% + }{}% +}% +\newcommand\print@notesX@forpages[1]{% + \ifcsempty{onlysideX@#1}{% + \csuse{footstart#1}{#1}% + \csuse{footgroup#1}{#1}% + }% + {% + \ifboolexpr{% + ((test {\ifcsstring{onlysideX@#1}{L}} and not test{\ifnumodd{\c@page}})% + or% + (test {\ifcsstring{onlysideX@#1}{R}} and test{\ifnumodd{\c@page}}))% + }% + {% + \correct@footinsX@box{#1}% + \csuse{footstart#1}{#1}% + \csuse{footgroup#1}{#1}% + \global\count\csuse{footins#1}=0% + \global\skip\csuse{footins#1}=0pt% + \csuse{notefontsizeX@#1}% + \global\advance\dimen\csuse{footins#1} by -\baselineskip% + \global\boolfalse{keepforsideX@#1}% + }% + {% + \global\booltrue{keepforsideX@#1}% + \global\count\csuse{footins#1}=\csuse{default@footins#1}% + \global\skip\csuse{footins#1}=\csuse{beforenotesX@#1}% + \bgroup% + \csuse{notefontsizeX@#1}% + \global\advance\dimen\csuse{footins#1} by \baselineskip% + \egroup% + }% + }% +}% +\newcommand{\correct@footinsX@box}[1]{% + \ifbool{keepforsideX@#1}{% + \csuse{notefontsizeX@#1}% + \splittopskip=0pt% + \global\setbox\csuse{footins#1}=\vbox{% + \vsplit\csuse{footins#1} to \dimexpr\ht\csuse{footins#1}-1pt\relax% + \vskip \dimexpr-0.5\baselineskip-0.5\lineskip-0.5pt\relax% + \unvbox\csuse{footins#1}% + }% + }{}% +}% +\list@create{\labelref@listR} + +\def\l@dmake@labelsR#1|#2|#3|#4|#5{% + \expandafter\ifx\csname the@label#5\endcsname \relax\else + \led@warn@DuplicateLabel{#4}% + \fi + \expandafter\gdef\csname the@label#5\endcsname{#1|#2\@Rlineflag|#3|#4}% + \ignorespaces} +\AtBeginDocument{% + \def\l@dmake@labelsR#1|#2|#3|#4|#5{}% +} + +\WithSuffix\newcommand\sidenotemargin*[1]{% + \l@dgetsidenote@margin{#1} + \global\sidenote@marginR=\@l@dtempcntb + \global\sidenote@margin=\@l@dtempcntb +} +\newcount\sidenote@marginR +\global\sidenote@margin=\@ne + + +\newcommand*{\affixside@noteR}{% + \def\sidenotecontent@{}% + \numgdef{\itemcount@}{0}% + \def\do##1{% + \ifnumequal{\itemcount@}{0}% + {% + \appto\sidenotecontent@{##1}}% Not print not separator before the 1st note + {\appto\sidenotecontent@{\sidenotesep ##1}% + }% + \numgdef{\itemcount@}{\itemcount@+1}% + }% + \dolistloop{\l@dcsnotetext}% + \ifnumgreater{\itemcount@}{1}{\led@err@ManySidenotes}{}% + \gdef\@templ@d{}% + \gdef\@templ@n{\l@dcsnotetext\l@dcsnotetext@l\l@dcsnotetext@r}% + \ifx\@templ@d\@templ@n \else% + \if@twocolumn% + \if@firstcolumn% + \setl@dlp@rbox{##1}{\sidenotecontent@}% + \else% + \setl@drp@rbox{\sidenotecontent@}% + \fi% + \else% + \@l@dtempcntb=\sidenote@marginR% + \ifnum\@l@dtempcntb>\@ne% + \advance\@l@dtempcntb by\page@numR% + \fi% + \ifodd\@l@dtempcntb% + \setl@drp@rbox{\sidenotecontent@}% + \gdef\sidenotecontent@{}% + \numdef{\itemcount@}{0}% + \dolistloop{\l@dcsnotetext@l}% + \ifnumgreater{\itemcount@}{1}{\led@err@ManyLeftnotes}{}% + \setl@dlp@rbox{\sidenotecontent@}% + \else% + \setl@dlp@rbox{\sidenotecontent@}% + \gdef\sidenotecontent@{}% + \numdef{\itemcount@}{0}% + \dolistloop{\l@dcsnotetext@r}% + \ifnumgreater{\itemcount@}{1}{\led@err@ManyRightnotes}{}% + \setl@drp@rbox{\sidenotecontent@}% + \fi% + \fi% + \fi% +} + + +\newif\ifinserthangingsymbolR +\newcommand{\inserthangingsymbolL}{% + \ifinserthangingsymbol% + \ifinstanzaL% + \hskip \@ifundefined{sza@0@}{0}{\expandafter% + \noexpand\csname sza@0@\endcsname}\stanzaindentbase% + \@hangingsymbol% + \fi% + \fi% +}% +\newcommand{\inserthangingsymbolR}{% + \ifinserthangingsymbolR% + \ifinstanzaR% + \hskip \@ifundefined{sza@0@}{0}{\expandafter% + \noexpand\csname sza@0@\endcsname}\stanzaindentbase% + \@hangingsymbol% + \fi% + \fi% +}% + + \chardef\next=\catcode`\& + \catcode`\&=\active + +\newenvironment{astanza}{% + \catcode`\&\active + \global\stanza@count\@ne\stanza@modulo\@ne + \ifnum\usenamecount{sza@0@}=\z@ + \let\stanza@hang\relax + \let\endlock\relax + \else + \rightskip\z@ plus 1fil\relax + \fi + \ifnum\usenamecount{szp@0@}=\z@ + \let\sza@penalty\relax + \fi + \def&{% + \endlock\mbox{}% + \sza@penalty + \global\advance\stanza@count\@ne + \@astanza@line}% + \def\&{\@stopastanza}% + \pstart + \@astanza@line +}{} + +\newcommandx{\@stopastanza}[1][1,usedefault]{% + \endlock\mbox{}% + \pend[#1]% +}% +\newcommand*{\@astanza@line}{% + \ifnum\value{stanzaindentsrepetition}=0 + \parindent=\csname sza@\number\stanza@count + @\endcsname\stanzaindentbase + \else + \parindent=\csname sza@\number\stanza@modulo + @\endcsname\stanzaindentbase + \managestanza@modulo + \fi + \par + \stanza@hang%\mbox{}% + \ignorespaces} + + \catcode`\&=\next + +\providecommand*{\newnamebox}[1]{% + \expandafter\newbox\csname #1\endcsname} +\providecommand*{\setnamebox}[1]{% + \expandafter\setbox\csname #1\endcsname} +\providecommand*{\unhnamebox}[1]{% + \expandafter\unhbox\csname #1\endcsname} +\providecommand*{\unvnamebox}[1]{% + \expandafter\unvbox\csname #1\endcsname} +\providecommand*{\namebox}[1]{% + \csname #1\endcsname} + +\providecommand*{\newnamecount}[1]{% + \expandafter\newcount\csname #1\endcsname} +\providecommand*{\usenamecount}[1]{% + \csname #1\endcsname} + +\newif\ifl@dusedbabel +\patchcmd{\bbl@set@language}% + {\select@language{\languagename}}% + {\edef\languagename{#1}\select@language{\languagename}}% + {}% + {}% + +\newcommand*{\l@duselanguage}[1]{} +\gdef\theledlanguageL{} +\gdef\theledlanguageR{} + +\AtBeginDocument{% + \@ifundefined{xpg@main@language}{% + \@ifundefined{bbl@main@language}{% + \l@dusedbabelfalse + }{% + \l@dusedbabeltrue + \let\l@doldselectlanguage\selectlanguage + \let\l@doldbbl@set@language\bbl@set@language + \renewcommand{\selectlanguage}[1]{% + \l@doldselectlanguage{#1}% + \ifledRcol \gdef\theledlanguageR{#1}% + \else \gdef\theledlanguageL{#1}% + \fi} + \renewcommand*{\l@duselanguage}[1]{% + \l@doldselectlanguage{#1}} + \gdef\theledlanguageL{\bbl@main@language}% + \gdef\theledlanguageR{\bbl@main@language}% + }% + } + { \let\old@otherlanguage\otherlanguage% + \renewcommand{\otherlanguage}[2][]{% + \selectlanguage[#1]{#2}% + \ifledRcol \gdef\theledlanguageR{#2}% + \else \gdef\theledlanguageL{#2}% + \fi}% + \let\l@duselanguage\select@language% + \gdef\theledlanguageL{\xpg@main@language}% + \gdef\theledlanguageR{\xpg@main@language}% +}} +\newcount\l@dc@maxchunks +\newcommand{\maxchunks}[1]{\l@dc@maxchunks=#1} + \maxchunks{5120} + +\newcount\l@dnumpstartsR + +\newcount\l@dpscL +\newcount\l@dpscR + +\newcommand*{\l@dsetuprawboxes}{% + \@l@dtempcntb=\l@dc@maxchunks + \loop\ifnum\@l@dtempcntb>\z@ + \newnamebox{l@dLcolrawbox\the\@l@dtempcntb} + \newnamebox{l@dRcolrawbox\the\@l@dtempcntb} + \advance\@l@dtempcntb \m@ne + \repeat} + +\newcommand*{\l@dsetupmaxlinecounts}{% + \@l@dtempcntb=\l@dc@maxchunks + \loop\ifnum\@l@dtempcntb>\z@ + \newnamecount{l@dmaxlinesinpar\the\@l@dtempcntb} + \advance\@l@dtempcntb \m@ne + \repeat} +\newcommand*{\l@dzeromaxlinecounts}{% + \begingroup + \@l@dtempcntb=\l@dc@maxchunks + \loop\ifnum\@l@dtempcntb>\z@ + \global\usenamecount{l@dmaxlinesinpar\the\@l@dtempcntb}=\z@ + \advance\@l@dtempcntb \m@ne + \repeat + \endgroup} + +\AtBeginDocument{% + \l@dsetuprawboxes + \l@dsetupmaxlinecounts + \l@dzeromaxlinecounts + \l@dnumpstartsL=\z@ + \l@dnumpstartsR=\z@ + \l@dpscL=\z@ + \l@dpscR=\z@} + +\newif\if@pstarts +\newcommand*{\check@pstarts}{% + \@pstartsfalse + \ifnum\l@dnumpstartsL>\l@dpscL + \@pstartstrue + \else + \ifnum\l@dnumpstartsR>\l@dpscR + \@pstartstrue + \fi + \fi +} + +\newif\ifaraw@text +\newcommand*{\checkraw@text}{% + \araw@textfalse + \ifvbox\namebox{l@dLcolrawbox\the\l@dpscL} + \araw@texttrue + \else + \ifvbox\namebox{l@dRcolrawbox\the\l@dpscR} + \araw@texttrue + \fi + \fi +} + +\newcommand*{\@writelinesinparL}{% + \edef\next{% + \write\linenum@out{\string\@pend[\the\@donereallinesL]}}% + \next + \global\@donereallinesL \z@} +\newcommand*{\@writelinesinparR}{% + \edef\next{% + \write\linenum@outR{\string\@pendR[\the\@donereallinesR]}}% + \next + \global\@donereallinesR \z@} + +\newsavebox{\@eledsectionL}% +\newsavebox{\@eledsectionR}% +\newcommand*{\Columns}{% + \ifl@dpairing% + \led@err@Columns@InsideEnv% + \fi% + \l@dprintingcolumnstrue% + \eledsection@correcting@skip=-\baselineskip% Correction for sections' titles + \ifnum\l@dnumpstartsL=\l@dnumpstartsR\else + \led@err@BadLeftRightPstarts{\the\l@dnumpstartsL}{\the\l@dnumpstartsR}% + \fi + \begingroup + \l@dzeropenalties + \endgraf\global\num@lines=\prevgraf + \global\num@linesR=\prevgraf + \global\par@line=\z@ + \global\par@lineR=\z@ + \global\l@dpscL=\z@ + \global\l@dpscR=\z@ + \check@pstarts + \loop\if@pstarts + \global\pstartnumtrue + \global\pstartnumRtrue + \global\advance\l@dpscL \@ne + \global\advance\l@dpscR \@ne + \restore@pstartL@pc% + \restore@pstartR@pc% + \Columns@print@before@pstart% + \checkraw@text +{ \loop\ifaraw@text + \l@duselanguage{\theledlanguageL}% + \do@lineL + \xifinlist{\the\l@dpscL}{\eled@sections@@} + {% + \ifdefstring{\@eledsectmark}{L}% + {\csuse{eled@sectmark@\the\l@dpscL}% + }{}% + \global\csundef{eled@sectmark@\the\l@dpscL}% + \savebox{\@eledsectionL}{\parbox[t][][t]{\Lcolwidth}{\vbox{}\print@eledsectionL}}%\vbox{}-> prevent alignment troubles with RTL language + }% + {}% + \l@duselanguage{\theledlanguageR}% + \do@lineR + \xifinlist{\the\l@dpscR}{\eled@sectionsR@@} + {% + \ifdefstring{\@eledsectmark}{R}% + {\csuse{eled@sectmark@\the\l@dpscR R}% + }{}% + \global\csundef{eled@sectmark@\the\l@dpscR R}% + \savebox{\@eledsectionR}{\parbox[t][][t]{\Rcolwidth}{\vbox{}\print@eledsectionR}}}%\vbox{}-> prevent alignment troubles with RTL language + {}% + \hb@xt@ \hsize{% + \ifdefstring{\columns@position}{L}{}{\hfill }% + \unhbox\l@dleftbox% + \ifhbox\@eledsectionL% + \usebox{\@eledsectionL}% + \fi% + \print@columnseparator% + \unhbox\l@drightbox% + \ifhbox\@eledsectionR% + \usebox{\@eledsectionR}% + \fi% + \ifdefstring{\columns@position}{R}{}{\hfill}% + }% + \checkraw@text + \checkverseL + \checkverseR + \checkpb@columns + \repeat} + \@writelinesinparL + \@writelinesinparR + \check@pstarts + \ifbypstart@% + \write\linenum@out{\string\@set[1]} + \resetprevline@ + \fi + \ifbypstart@R + \write\linenum@outR{\string\@set[1]} + \resetprevline@ + \fi + \Columns@print@after@pend% + \repeat + \flush@notes + \flush@notesR + \endgroup + \global\l@dpscL=\z@ + \global\l@dpscR=\z@ + \global\l@dnumpstartsL=\z@ + \global\l@dnumpstartsR=\z@ + \l@dprintingcolumnsfalse% + \ignorespaces + \global\instanzaLfalse + \global\instanzaRfalse} + +\def\print@columnseparator{% + \ifdim\beforecolumnseparator<0pt% + \hfill% + \else% + \hspace{\beforecolumnseparator}% + \fi% + \columnseparator% + \ifdim\aftercolumnseparator<0pt% + \hfill% + \else% + \hspace{\beforecolumnseparator}% + \fi% +}% + +\newcommand{\checkpb@columns}{% + \newif\if@pb + \newif\if@nopb + \IfStrEq{\led@pb@setting}{before}{ + \numdef{\next@absline}{\the\absline@num+1}% + \numdef{\next@abslineR}{\the\absline@numR+1}% + \xifinlistcs{\next@absline}{l@prev@pb}{\@pbtrue}{}% + \xifinlistcs{\next@abslineR}{l@prev@pbR}{\@pbtrue}{} + \xifinlistcs{\next@absline}{l@prev@nopb}{\@nopbtrue}{}% + \xifinlistcs{\next@abslineR}{l@prev@nopbR}{\@nopbtrue}{} + }{} + \IfStrEq{\led@pb@setting}{after}{ + \xifinlistcs{\the\absline@num}{l@prev@pb}{\@pbtrue}{}% + \xifinlistcs{\the\absline@numR}{l@prev@pbR}{\@pbtrue}{} + \xifinlistcs{\the\absline@num}{l@prev@nopb}{\@nopbtrue}{}% + \xifinlistcs{\the\absline@numR}{l@prev@nopbR}{\@nopbtrue}{} + }{} +\if@nopb\nopagebreak[4]\enlargethispage{\baselineskip}\fi +\if@pb\pagebreak[4]\fi +} +\newcommand*{\columnseparator}{% + \smash{\rule[-0.2\baselineskip]{\columnrulewidth}{1.05\baselineskip}}} +\newdimen\columnrulewidth + \columnrulewidth=\z@ + +\newcommand*{\columnsposition}[1]{% + \xdef\columns@position{#1}% + }% +\xdef\columns@position{R}% +\newlength{\beforecolumnseparator}% +\setlength{\beforecolumnseparator}{-2pt}% + +\newlength{\aftercolumnseparator}% +\setlength{\aftercolumnseparator}{-2pt}% + +\newcommand{\setwidthliketwocolumns@L}{% + \newdimen\temp% + \temp=\hsize% + \hsize=\Lcolwidth% + \advance\hsize\Rcolwidth% + \advance\temp-\hsize% + \multiply\temp by 2% + \divide\temp by 3% + \advance\hsize\temp% +}% + +\newcommand{\setpositionliketwocolumns@L}{% + \renewcommand{\ledrlfill}{\hfill}% +}% + +\newcommand{\setnotespositionliketwocolumns@L}{% +}% + +\newcommand{\setwidthliketwocolumns@C}{% + \newdimen\temp% + \temp=\hsize% + \hsize=\Lcolwidth% + \advance\hsize\Rcolwidth% + \advance\temp-\hsize% + \divide\temp by 2% + \advance\hsize\temp% +}% + +\newcommand{\setpositionliketwocolumns@C}{% + \doinsidelinehook{\hfill}% + \renewcommand{\ledrlfill}{\hfill}% +}% + +\newcommand{\setnotespositionliketwocolumns@C}{% + \newdimen\temp% + \newdimen\tempa% + \temp=\hsize% + \tempa=\Lcolwidth% + \advance\tempa\Rcolwidth% + \advance\temp-\tempa% + \divide\temp by 2% + \leftskip=\temp% + \rightskip=-\temp% +}% + +\newcommand{\setwidthliketwocolumns@R}{% + \newdimen\temp% + \temp=\hsize% + \hsize=\Lcolwidth% + \advance\hsize\Rcolwidth% + \advance\temp-\hsize% + \multiply\temp by 2% + \divide\temp by 3% + \advance\hsize\temp% +}% + +\newcommand{\setpositionliketwocolumns@R}{% + \doinsidelinehook{\hfill}% +}% + +\newcommand{\setnotespositionliketwocolumns@R}{% + \newdimen\temp% + \newdimen\tempa% + \temp=\hsize% + \tempa=\Lcolwidth% + \advance\tempa\Rcolwidth% + \advance\temp-\tempa% + \divide\temp by 2% + \leftskip=\temp% + \rightskip=-\temp% +}% + +\newcommand{\Columns@print@before@pstart}{% + \ifboolexpr{% + test{\ifcsstring{before@pstartL@\the\l@dpscL}{\at@every@pstart}}% + and test {\ifcsstring{before@pstartR@\the\l@dpscR}{\at@every@pstart}}% + and test {\ifdefempty{\at@every@pstart}}}% + {}% + {% + \hb@xt@ \hsize{% + \ifdefstring{\columns@position}{L}{}{\hfill }% + \par\parbox[t][][t]{\Lcolwidth}{% + \csuse{before@pstartL@\the\l@dpscL}% + }% + \print@columnseparator% + \parbox[t][][t]{\Rcolwidth}{% + \csuse{before@pstartR@\the\l@dpscR}% + }% + \ifdefstring{\columns@position}{R}{}{\hfill}% + }% + }% + \global\csundef{before@pstartL@\the\l@dpscL}% + \global\csundef{before@pstartR@\the\l@dpscR}% +}% +\newcommand{\Columns@print@after@pend}{% + \ifboolexpr{% + test{\ifcsstring{after@pendL@\the\l@dpscL}{\at@every@pend}}% + and test {\ifcsstring{after@pendR@\the\l@dpscR}{\at@every@pend}}% + and test {\ifdefempty{\at@every@pend}}}% + {}% + {% + \hb@xt@ \hsize{% + \ifdefstring{\columns@position}{L}{}{\hfill }% + \parbox[t][][t]{\Lcolwidth}{% + \csuse{after@pendL@\the\l@dpscL}% + }% + \print@columnseparator% + \parbox[t][][t]{\Rcolwidth}{% + \csuse{after@pendR@\the\l@dpscR}% + }% + \ifdefstring{\columns@position}{R}{}{\hfill}% + }% + }% + \global\csundef{after@pendL@\the\l@dpscL}% + \global\csundef{after@pendR@\the\l@dpscR}% +}% +\newcount\numpagelinesL +\newcount\numpagelinesR +\newcount\l@dminpagelines + +\newcommand*{\Pages}{% + \ifl@dpairing% + \led@err@Pages@InsideEnv% + \fi% + \eledsection@correcting@skip=-2\baselineskip% line correcting for section titles. + \parledgroup@notespacing@set@correction% + \typeout{}% + \typeout{*************************** PAGES ***************************}% + \ifnum\l@dnumpstartsL=\l@dnumpstartsR\else% + \led@err@BadLeftRightPstarts{\the\l@dnumpstartsL}{\the\l@dnumpstartsR}% + \fi% + \setlength{\Lcolwidth}{\textwidth}% + \setlength{\Rcolwidth}{\textwidth}% + \cleartol@devenpage% + \l@dprintingpagestrue% + \begingroup% + \l@dzeropenalties% + \endgraf\global\num@lines=\prevgraf% + \global\num@linesR=\prevgraf% + \global\par@line=\z@% + \global\par@lineR=\z@% + \global\l@dpscL=\z@% + \global\l@dpscR=\z@% + \writtenlinesLfalse% + \writtenlinesRfalse% + \let\print@Xnotes\print@Xnotes@forpages% + \let\print@notesX\print@notesX@forpages% + \check@pstarts% + \loop\if@pstarts% + \global\advance\l@dpscL \@ne% + \global\advance\l@dpscR \@ne% + \getlinesfromparlistL% + \getlinesfromparlistR% + \l@dcalc@maxoftwo{\@cs@linesinparL}{\@cs@linesinparR}% + {\usenamecount{l@dmaxlinesinpar\the\l@dpscL}}% + \check@pstarts% + \repeat% + \global\l@dpscL=\z@% + \global\l@dpscR=\z@% + \getlinesfrompagelistL% + \getlinesfrompagelistR% + \l@dcalc@minoftwo{\@cs@linesonpageL}{\@cs@linesonpageR}% + {\l@dminpagelines}% + \check@pstarts% + \if@pstarts% + \global\advance\l@dpscL \@ne% + \global\advance\l@dpscR \@ne% + \restore@pstartL@pc% + \restore@pstartR@pc% + \global\@donereallinesL=\z@% + \global\@donetotallinesL=\z@% + \global\@donereallinesR=\z@% + \global\@donetotallinesR=\z@% + \checkraw@text% +{ \loop\ifaraw@text% + \checkpageL% + \l@duselanguage{\theledlanguageL}% +{ \loop\ifl@dsamepage% + \ifdefstring{\@eledsectnotoc}{L}{\ledsectnotoc}{}% + \csuse{before@pstartL@\the\l@dpscL}% + \global\csundef{before@pstartL@\the\l@dpscL}% + \do@lineL% + \xifinlist{\the\l@dpscL}{\eled@sections@@} + {\print@eledsectionL}% + {}% + \advance\numpagelinesL \@ne% + \ifshiftedpstarts% + \ifdim\ht\l@dleftbox>0pt\hb@xt@% + \hsize{\ledstrutL\unhbox\l@dleftbox}% + \else% + \dimen0=\pagetotal% + \advance\dimen0 by \baselineskip% + \global\pagetotal=\dimen0% + \fi% + \else% + \parledgroup@correction@notespacing{L} + \hb@xt@ \hsize{\ledstrutL\unhbox\l@dleftbox}% + \fi% + \get@nextboxL% + \global\l@dskipversenumberfalse% + \ifprint@last@after@pendL% + \csuse{after@pendL@\the\l@dpscL}% + \global\csundef{after@pendL@\the\l@dpscL}% + \fi% + \checkpageL% + \checkverseL% + \checkpbL% + \repeat% + \ifl@dpagefull% + \@writelinesonpageL{\the\numpagelinesL}% + \else% + \@writelinesonpageL{1000}% + \fi% + \numpagelinesL \z@% + \parledgroup@correction@notespacing@init% + \clearl@dleftpage }% + \checkpageR% + \l@duselanguage{\theledlanguageR}% +{ \loop\ifl@dsamepage% + \initnumbering@sectcountR% + \ifdefstring{\@eledsectnotoc}{R}{\ledsectnotoc}{}% + \csuse{before@pstartR@\the\l@dpscR}% + \global\csundef{before@pstartR@\the\l@dpscR}% + \do@lineR% + \xifinlist{\the\l@dpscR}{\eled@sectionsR@@}% + {\print@eledsectionR}% + {}% + \advance\numpagelinesR \@ne% + \ifshiftedpstarts% + \ifdim\ht\l@drightbox>0pt\hb@xt@% + \hsize{\ledstrutR\unhbox\l@drightbox}% + \else% + \dimen0=\pagetotal% + \advance\dimen0 by \baselineskip% + \global\pagetotal=\dimen0% + \fi% + \else% + \parledgroup@correction@notespacing{R}% + \hb@xt@ \hsize{\ledstrutR\unhbox\l@drightbox}% + \fi% + \get@nextboxR% + \global\l@dskipversenumberRfalse% + \ifprint@last@after@pendR% + \csuse{after@pendR@\the\l@dpscR}% + \global\csundef{after@pendR@\the\l@dpscR}% + \fi% + \checkpageR% + \checkverseR% + \checkpbR% + \repeat% + \ifl@dpagefull% + \@writelinesonpageR{\the\numpagelinesR}% + \else% + \@writelinesonpageR{1000}% + \fi% + \numpagelinesR=\z@% + \parledgroup@correction@notespacing@init% + \clearl@drightpage}% + \checkraw@text% + \ifaraw@text% + \getlinesfrompagelistL% + \getlinesfrompagelistR% + \l@dcalc@minoftwo{\@cs@linesonpageL}{\@cs@linesonpageR}% + {\l@dminpagelines}% + \fi% + \repeat}% + \fi% + \flush@notes% + \flush@notesR% + \endgroup% + \global\l@dpscL=\z@% + \global\l@dpscR=\z@% + \global\l@dnumpstartsL=\z@% + \global\l@dnumpstartsR=\z@% + \global\instanzaLfalse% + \global\instanzaRfalse% + \l@dprintingpagesfalse% + \finish@Pages@notes%Needed to prevent final notes overlap line number + \ignorespaces} + +\newcommand{\finish@Pages@notes}{% + \def\do##1{% + \ifnocritical@% + \global\newnamebox{##1footins} + \fi + \ifnofamiliar@% + \global\newnamebox{footins##1} + \fi + \ifvoid\csuse{##1footins}% + \ifvoid\csuse{footins##1}\else% + \newpage\null% + \listbreak% + \fi% + \else% + \newpage\null% + \listbreak% + \fi% + }% + \dolistloop{\@series}% +}% +\newcommand*{\ledstrutL}{\strut} +\newcommand*{\ledstrutR}{\strut} + +\providecommand{\cleartoevenpage}[1][\@empty]{% + \clearpage + \ifodd\c@page\hbox{}#1\clearpage\fi} +\newcommand*{\cleartol@devenpage}{% + \ifdim\pagetotal<\topskip% on an empty page + \else + \clearpage + \fi + \ifodd\c@page\hbox{}\clearpage\fi% +}% +\newcommand*{\clearl@dleftpage}{% + \ifdim\pagetotal=0pt\hbox{}\fi% + \newpage% + \ifodd\c@page\else + \led@err@LeftOnRightPage + \hbox{}% + \cleardoublepage + \fi} + +\newcommand*{\clearl@drightpage}{% + \ifdim\pagetotal=0pt\hbox{}\fi% + \newpage% + \ifodd\c@page + \led@err@RightOnLeftPage + \hbox{}% + \cleartoevenpage + \fi} + +\newcommand*{\getlinesfromparlistL}{% + \ifx\linesinpar@listL\empty + \gdef\@cs@linesinparL{0}% + \else + \gl@p\linesinpar@listL\to\@cs@linesinparL + \fi} +\newcommand*{\getlinesfromparlistR}{% + \ifx\linesinpar@listR\empty + \gdef\@cs@linesinparR{0}% + \else + \gl@p\linesinpar@listR\to\@cs@linesinparR + \fi} + +\newcommand*{\getlinesfrompagelistL}{% + \ifx\linesonpage@listL\empty + \gdef\@cs@linesonpageL{1000}% + \else + \gl@p\linesonpage@listL\to\@cs@linesonpageL + \fi} +\newcommand*{\getlinesfrompagelistR}{% + \ifx\linesonpage@listR\empty + \gdef\@cs@linesonpageR{1000}% + \else + \gl@p\linesonpage@listR\to\@cs@linesonpageR + \fi} + +\newcommand*{\@writelinesonpageL}[1]{% + \edef\next{\write\linenum@out{\string\@lopL{#1}}}% + \next} +\newcommand*{\@writelinesonpageR}[1]{% + \edef\next{\write\linenum@outR{\string\@lopR{#1}}}% + \next} + +\newcommand*{\l@dcalc@maxoftwo}[3]{% + \ifnum #2>#1\relax + #3=#2\relax + \else + #3=#1\relax + \fi} +\newcommand*{\l@dcalc@minoftwo}[3]{% + \ifnum #2<#1\relax + #3=#2\relax + \else + #3=#1\relax + \fi} + +\newif\ifl@dsamepage + \l@dsamepagetrue +\newif\ifl@dpagefull + +\newcommand*{\checkpageL}{% + \l@dpagefulltrue + \l@dsamepagetrue + \check@goal + \ifdim\pagetotal<\ledthegoal + \ifnum\numpagelinesL<\l@dminpagelines + \else + \l@dsamepagefalse + \l@dpagefullfalse + \fi + \else + \l@dsamepagefalse + \l@dpagefulltrue + \fi% + \ifprint@last@after@pendL% + \l@dpagefullfalse% + \l@dsamepagefalse% + \print@last@after@pendLfalse% + \fi% + }% + +\newcommand*{\checkpageR}{% + \l@dpagefulltrue + \l@dsamepagetrue + \check@goal + \ifdim\pagetotal<\ledthegoal + \ifnum\numpagelinesR<\l@dminpagelines + \else + \l@dsamepagefalse + \l@dpagefullfalse + \fi + \else + \l@dsamepagefalse + \l@dpagefulltrue + \fi% + \ifprint@last@after@pendR% + \l@dpagefullfalse% + \l@dsamepagefalse% + \print@last@after@pendRfalse% + \fi% + }% + +\newcommand{\checkpbL}{ + \IfStrEq{\led@pb@setting}{after}{ + \xifinlistcs{\the\absline@num}{l@prev@pb}{\l@dpagefulltrue\l@dsamepagefalse}{} + \xifinlistcs{\the\absline@num}{l@prev@nopb}{\l@dpagefullfalse\l@dsamepagetrue}{} + }{} + \IfStrEq{\led@pb@setting}{before}{ + \numdef{\next@absline}{\the\absline@num+1} + \xifinlistcs{\next@absline}{l@prev@pb}{\l@dpagefulltrue\l@dsamepagefalse}{} + \xifinlistcs{\next@absline}{l@prev@nopb}{\l@dpagefullfalse\l@dsamepagetrue}{} + }{} +} + +\newcommand{\checkpbR}{ + \IfStrEq{\led@pb@setting}{after}{ + \xifinlistcs{\the\absline@numR}{l@prev@pbR}{\l@dpagefulltrue\l@dsamepagefalse}{} + \xifinlistcs{\the\absline@numR}{l@prev@nopbR}{\l@dpagefullfalse\l@dsamepagetrue}{} + }{} + \IfStrEq{\led@pb@setting}{before}{ + \numdef{\next@abslineR}{\the\absline@numR+1} + \xifinlistcs{\next@abslineR}{l@prev@pbR}{\l@dpagefulltrue\l@dsamepagefalse}{} + \xifinlistcs{\next@abslineR}{l@prev@nopbR}{\l@dpagefullfalse\l@dsamepagetrue}{} + }{} +} +\newcommand{\checkverseL}{ +\ifinstanzaL + \iflednopbinverse + \ifinserthangingsymbol + \numgdef{\prev@abslineverse}{\the\absline@num-1} + \IfStrEq{\led@pb@setting}{after}{\lednopbnum{\prev@abslineverse}}{} + \IfStrEq{\led@pb@setting}{before}{\ifnum\numpagelinesL<3\ledpbnum{\prev@abslineverse}\fi}{} + \fi + \fi +\fi +} +\newcommand{\checkverseR}{ +\ifinstanzaR + \iflednopbinverse + \ifinserthangingsymbolR + \numgdef{\prev@abslineverse}{\the\absline@numR-1} + \IfStrEq{\led@pb@setting}{after}{\lednopbnumR{\prev@abslineverse}}{} + \IfStrEq{\led@pb@setting}{before}{\ifnum\numpagelinesR<3\ledpbnumR{\prev@abslineverse}\fi}{} + \fi + \fi +\fi +} +\newdimen\ledthegoal +\ifshiftedpstarts + \newcommand*{\@goalfraction}{0.95} +\else + \newcommand*{\@goalfraction}{0.9} +\fi + +\newcommand*{\check@goal}{% + \ledthegoal=\@goalfraction\pagegoal} +\newcommand{\setgoalfraction}[1]{% + \xdef\@goalfraction{#1}% +} +\newif\ifwrittenlinesL +\newif\ifwrittenlinesR + +\newcommand*{\get@nextboxL}{% + \ifvbox\namebox{l@dLcolrawbox\the\l@dpscL}% box is not empty + \else% box is empty + \ifnum\usenamecount{l@dmaxlinesinpar\the\l@dpscL}>\@donetotallinesL + \parledgroup@notes@endL + \else + \ifnum\usenamecount{l@dmaxlinesinpar\the\l@dpscL}=\@donetotallinesL + \parledgroup@notes@endL + \fi + \ifwrittenlinesL\else + \@writelinesinparL + \writtenlinesLtrue + \fi + \ifnum\l@dnumpstartsL>\l@dpscL + \writtenlinesLfalse + \ifbypstart@ + \global\line@num=0% + \resetprevline@% + \fi + \csuse{after@pendL@\the\l@dpscL}% + \global\csundef{after@pendL@\the\l@dpscL}% + \l@dcalc@maxoftwo{\the\usenamecount{l@dmaxlinesinpar\the\l@dpscL}}% + {\the\@donetotallinesL}% + {\usenamecount{l@dmaxlinesinpar\the\l@dpscL}}% + \global\@donetotallinesL \z@ + \global\advance\l@dpscL \@ne + \global\pstartnumtrue% + \restore@pstartL@pc% + \parledgroup@notes@endL + \parledgroup@correction@notespacing@final{L} + \else + \fi + \fi + \fi} +\newcommand*{\get@nextboxR}{% + \ifvbox\namebox{l@dRcolrawbox\the\l@dpscR}% box is not empty + \else% box is empty + \ifnum\usenamecount{l@dmaxlinesinpar\the\l@dpscR}>\@donetotallinesR + \parledgroup@notes@endR + \else + \ifnum\usenamecount{l@dmaxlinesinpar\the\l@dpscR}=\@donetotallinesR + \parledgroup@notes@endR + \fi + \ifwrittenlinesR\else + \@writelinesinparR + \writtenlinesRtrue + \fi + \ifnum\l@dnumpstartsR>\l@dpscR + \writtenlinesRfalse + \ifbypstart@R + \global\line@numR=0% + \resetprevline@% + \fi + \csuse{after@pendR@\the\l@dpscR}% + \global\csundef{after@pendR@\the\l@dpscR}% + \l@dcalc@maxoftwo{\the\usenamecount{l@dmaxlinesinpar\the\l@dpscR}}% + {\the\@donetotallinesR}% + {\usenamecount{l@dmaxlinesinpar\the\l@dpscR}}% + \global\@donetotallinesR \z@ + \global\advance\l@dpscR \@ne + \global\pstartnumRtrue% + \restore@pstartR@pc% + \parledgroup@notes@endR + \parledgroup@correction@notespacing@final{R} + \else + \print@last@after@pendRtrue% + \fi + \fi + \fi} + + + + +\newcommand{\par@patch@thepage}{% + \ifsameparallelpagenumber% + \patchcmd{\thepage}% + {page}{sameparallelpage@number}% + {}% + {\led@error@fail@patch@thepage}% + \fi% +}% +\apptocmd{\pagenumbering}{% + \par@patch@thepage% + }% + {}% + {\led@error@fail@patch@pagenumbering}% + +\AtBeginDocument{\par@patch@thepage}% + +\AtBeginDocument{% + \apptocmd{\@outputpage}{% + \ifsameparallelpagenumber% + \ifl@dprintingpages% + \ifodd\c@page\else% + \stepcounter{sameparallelpage@number}% + \fi% + \else% + \stepcounter{sameparallelpage@number}% + \fi% + \else% + \stepcounter{sameparallelpage@number}% + \fi% + }% + {}% + {\led@error@fail@patch@@outputpage}% +} +\newcounter{sameparallelpage@number}% +\setcounter{sameparallelpage@number}{1}% +\pretocmd{\chapter}{% + \ifl@dprintingpages% + \vbox{}% + \fi% + }% + {}% + {}% +\newcommand{\eledsectnotoc}[1]{\xdef\@eledsectnotoc{#1}} +\eledsectnotoc{R} +\newcommand{\eledsectmark}[1]{\xdef\@eledsectmark{#1}} +\eledsectmark{L} +\newskip\eledsection@correcting@skip +\newwrite\eled@sectioningR@out +\def\l@prev@pbR{} +\def\l@prev@nopbR{} +\newcommand{\ledpbR}{\write\linenum@outR{\string\led@pbR}} +\newcommand{\ledpbnumR}[1]{\write\linenum@outR{\string\led@pbnumR{#1}}} +\newcommand{\lednopbR}{\write\linenum@outR{\string\led@nopbR}} +\newcommand{\lednopbnumR}[1]{\write\linenum@outR{\string\led@nopbnumR{#1}}} +\newcommand{\led@pbR}{\listxadd{\l@prev@pbR}{\the\absline@numR}} +\newcommand{\led@pbnumR}[1]{\listxadd{\l@prev@pbR}{#1}} +\newcommand{\led@nopbR}{\listxadd{\l@prev@nopbR}{\the\absline@numR}} +\newcommand{\led@nopbnumR}[1]{\listxadd{\l@prev@nopbR}{#1}} +\newmarks\parledgroup@ +\newmarks\parledgroup@series +\newmarks\parledgroup@type +\newcommand{\parledgroup@notes@startL}{% + \ifnum\usenamecount{l@dmaxlinesinpar\the\l@dpscL}>0% + \IfStrEq{\splitfirstmarks\parledgroup@type}{footnoteX}{\csuse{bhooknoteX@\splitfirstmarks\parledgroup@series}}{}% + \IfStrEq{\splitfirstmarks\parledgroup@type}{Xfootnote}{\csuse{bhookXnote@\splitfirstmarks\parledgroup@series}}{}% + \fi% + \global\ledgroupnotesL@true% + \insert@noterule@ledgroup{L}% +} +\newcommand{\parledgroup@notes@startR}{% + \ifnum\usenamecount{l@dmaxlinesinpar\the\l@dpscR}>0% + \IfStrEq{\splitfirstmarks\parledgroup@type}{footnoteX}{\csuse{bhooknoteX@\splitfirstmarks\parledgroup@series}}{}% + \IfStrEq{\splitfirstmarks\parledgroup@type}{Xfootnote}{\csuse{bhookXnote@\splitfirstmarks\parledgroup@series}}{}% + \fi% + \global\ledgroupnotesR@true% + \insert@noterule@ledgroup{R}% +} +\newcommand{\parledgroup@notes@endL}{% + \global\ledgroupnotesL@false% +} +\newcommand{\parledgroup@notes@endR}{% + \global\ledgroupnotesR@false% +} +\newcommand{\insert@noterule@ledgroup}[1]{ + \IfStrEq{\splitbotmarks\parledgroup@}{begin}{% + \IfStrEq{\splitbotmarks\parledgroup@type}{Xfootnote}{ + \csuse{ifledgroupnotes#1@} + \vskip\skip\csuse{mp\splitbotmarks\parledgroup@series footins} + \csuse{\splitbotmarks\parledgroup@series footnoterule} + \fi + } + {} + \IfStrEq{\splitbotmarks\parledgroup@type}{footnoteX}{ + \csuse{ifledgroupnotes#1@} + \vskip\skip\csuse{mpfootins\splitbotmarks\parledgroup@series} + \csuse{footnoterule\splitbotmarks\parledgroup@series} + \fi + }{} + } + {} +} +\newcommand{\setparledgroupnotespacing}[1]{\gdef\@parledgroupnotespacing{#1}} +\newcommand{\@parledgroupnotespacing}{} +\dimdef{\parledgroup@notespacing@correction}{0pt} +\newcommand{\parledgroup@notespacing@set@correction}{% + {\@getfirstseries\csuse{Xnotefontsize@\@firstseries}%We suppose all the series has the same footnote size setup + \@parledgroupnotespacing\dimgdef{\temp@spacing}{\baselineskip}}% + \dimgdef{\parledgroup@notespacing@correction}{\baselineskip-\temp@spacing}% +} +\newcommand{\parledgroup@correction@notespacing@init}{ + \dimdef{\parledgroup@notespacing@correction@accumulated}{0pt} + \dimdef{\parledgroup@notespacing@correction@modulo}{0pt} +} +\parledgroup@correction@notespacing@init +\newcommand{\parledgroup@correction@notespacing@final}[1]{ + \ifparledgroup + \vspace{\parledgroup@notespacing@correction@accumulated} + \parledgroup@correction@notespacing@init% + \ifstrequal{#1}{L}{ + \numdef{\@checking}{\the\l@dpscL-1} + }{ + \numdef{\@checking}{\the\l@dpscR-1} + } + \dimdef{\@beforenotes@current@diff}{\csuse{@parledgroup@beforenotes@\@checking L}-\csuse{@parledgroup@beforenotes@\@checking R}}% + \ifstrequal{#1}{L}% + {% Left + \ifdimgreater{\@beforenotes@current@diff}{0pt}{}{\vspace{-\@beforenotes@current@diff}}% + }% + {% Right + \ifdimgreater{\@beforenotes@current@diff}{0pt}{\vspace{\@beforenotes@current@diff}}{} + }% + \fi +} +\newcommand{\parledgroup@correction@notespacing}[1]{% + \csuse{ifledgroupnotes#1@}% + \vspace{-\parledgroup@notespacing@correction}% + \dimdef{\parledgroup@notespacing@correction@accumulated}{\parledgroup@notespacing@correction@accumulated+\parledgroup@notespacing@correction}% + \dimdef{\parledgroup@notespacing@correction@modulo}{\parledgroup@notespacing@correction@modulo+\parledgroup@notespacing@correction}% + \ifdimless{\parledgroup@notespacing@correction@modulo}{\baselineskip}{}{\advance\numpagelinesL -\@ne% + \dimdef{\parledgroup@notespacing@correction@modulo}{\parledgroup@notespacing@correction@modulo-\baselineskip}% + }% mean greater than equal + \fi% +} +\dimdef\parledgroup@beforenotesL{0pt} +\dimdef\parledgroup@beforenotesR{0pt} +\newcommand{\parledgroup@beforenotes@save}[1]{ + \ifparledgroup + \csdimgdef{@parledgroup@beforenotes@\the\csuse{l@dnumpstarts#1}#1}{\csuse{parledgroup@beforenotes#1}} + \csdimgdef{parledgroup@beforenotes#1}{0pt} + \fi +} + +\ifeledmaccompat@% + + \unless\ifnocritical@ + \let\onlyXside\Xonlyside + \fi +\fi +\endinput +%% +%% End of file `reledpar.sty'. diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check index 775d6b7aa68..f57b08a2c8c 100755 --- a/Master/tlpkg/bin/tlpkg-ctan-check +++ b/Master/tlpkg/bin/tlpkg-ctan-check @@ -467,7 +467,7 @@ my @TLP_working = qw( recipe recipebook recipecard recycle rectopma refcheck refenums reflectgraphics refman refstyle regcount regexpatch register regstats - relenc relsize reotex repeatindex repere repltext resphilosophica + reledmac relenc relsize reotex repeatindex repere repltext resphilosophica resumecls resumemac reverxii revtex ribbonproofs rjlparshap rlepsf rmathbr rmpage roboto robustcommand robustindex diff --git a/Master/tlpkg/tlpsrc/collection-humanities.tlpsrc b/Master/tlpkg/tlpsrc/collection-humanities.tlpsrc index a7d0c46957d..2c0aabec768 100644 --- a/Master/tlpkg/tlpsrc/collection-humanities.tlpsrc +++ b/Master/tlpkg/tlpsrc/collection-humanities.tlpsrc @@ -40,6 +40,7 @@ depend poemscol depend poetrytex depend qobitree depend qtree +depend reledmac depend rrgtrees depend rtklage depend screenplay diff --git a/Master/tlpkg/tlpsrc/reledmac.tlpsrc b/Master/tlpkg/tlpsrc/reledmac.tlpsrc new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/Master/tlpkg/tlpsrc/reledmac.tlpsrc |