summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/ednotes/ednotes.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-01-12 23:54:35 +0000
committerKarl Berry <karl@freefriends.org>2006-01-12 23:54:35 +0000
commitc75be2f02e012b1a8ccd57e540c78bcfeb0d9a42 (patch)
tree656fb89e34f7306ee91e48c989dc07def29d00c2 /Master/texmf-dist/tex/latex/ednotes/ednotes.sty
parent74afab51373336875080fafee169c9b078efdb2e (diff)
ednotes
git-svn-id: svn://tug.org/texlive/trunk@847 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/ednotes/ednotes.sty')
-rw-r--r--Master/texmf-dist/tex/latex/ednotes/ednotes.sty1267
1 files changed, 1267 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/ednotes/ednotes.sty b/Master/texmf-dist/tex/latex/ednotes/ednotes.sty
new file mode 100644
index 00000000000..087a658fae1
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ednotes/ednotes.sty
@@ -0,0 +1,1267 @@
+%% Macro package `ednotes.sty' for LaTeX2e,
+%% copyright (C) 2002--2005 Uwe L\"uck & Christian Tapp (direction)
+%% http://www.contact-ednotes.sty.de.vu
+%% --author-maintained,
+%% for critical editions
+%% (varying J. Lavagnino's and D. Wujastyk's EDMAC).
+%%
+\def\fileversion{1.2} \def\filedate{2005/10/01} %% TODO
+%
+%% This file can be redistributed and/or modified under
+%% the terms of the LaTeX Project Public License; either
+%% version 1.3a of the License, or any later version.
+%% The latest version of this license is in
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% We did our best to help you, but there is NO WARRANTY.
+%%
+%% Please report bugs, problems, and suggestions via
+%%
+%% http://www.contact-ednotes.sty.de.vu
+%
+%% * USAGE: *
+%
+% *Overview:*
+% This package provides facilities for notes in (critical) editions.
+% `\Anote{LEMMA}{NOTE}' prints NOTE in an extra footnote apparatus,
+% referring to LEMMA by its line numbers (as generated by
+% `lineno.sty') and by repeating LEMMA in the note. By calling the
+% package with extra options, you can add \Bnote etc. and choose
+% whether notes of one apparatus appear in a single paragraph on
+% each page or in separate paragraphs (`manyfoot.sty').
+% In LEMMA, `...\<...\>...' indicates what short version of it is to
+% appear in the note. There are further facilities to customize
+% appearance of notes.
+% Commands \Anotelabel{LABEL}, \donote{LABEL}{NOTE} etc. vary \Anote
+% etc. in admitting overlapping lemmas.
+% ---The package is made for those who need something like EDMAC
+% but who want to employ LaTeX2e at the same time.
+% More detailed description below is divided into
+% `packages required', `user commands', `package options',
+% `customizing', `Note on EDMAC', and `Comparison with LEDMAC'.
+%
+% *Note on "rival" package LEDMAC:* Peter R. Wilson has made a
+% LaTeX package LEDMAC (available on CTAN) for about the same
+% purpose as the present package. See `Note on EDMAC' and
+% `Comparison with LEDMAC' below.
+%
+% *Printed presentation:* An article on `ednotes' with user
+% instructions, examples, and comparisons with `[L]EDMAC'
+% appeared in the TUGboat volume for 2003. A version of it is
+% obtainable from the `ednotes' CTAN folder (`ednotugb.pdf').
+%
+% *Packages required:*
+% This package will not work without the following ones
+% ("visible"--cf. visible.txt in CTAN ednotes folder):
+% o Packages `manyfoot.sty' and `nccfoots.sty' by
+% Alexander I. Rozhenko from the `ncctools' bundle.
+% You needn't know anything about these
+% except perhaps options `para' and `para*'
+% choosing footnote indentation (see `package options' below).
+% o Package `lineno.sty' by Stephan I. B"ottcher.
+% We here suppose that you know and employ some of the
+% line numbering commands from `lineno.sty'.
+% However, please don't load these packages on your own.
+% Instead of calling them with some options, put these options
+% into the brackets of \usepackage[<options>]{ednotes}.
+%
+% *Availability:*
+% o In case you have not received `manyfoot.sty' and `nccfoots.sty',
+% you find them in the CTAN folder
+% `macros/latex/contrib/ncctools/unpacked' .
+% You find PDF documentations in
+% `macros/latex/contrib/ncctools/doc' .
+% o `lineno.sty' is in CTAN folder `macros/latex/contrib/lineno'.
+% In the same folder, there is `lineno.pdf' for documentation.
+%
+% *Optional packages:*
+% o Some package options may need additional package files (for
+% a while). They may be in the `ednotes' or `lineno' CTAN folder.
+% The README files there will name them or tell where they are
+% named. %% TODO
+%
+% *Other useful files:*
+% Look at the README file in CTAN folder
+% `macros/latex/contrib/ednotes' for quick information on what other
+% files in the folder provide. %% TODO: indeed?
+%
+% *User commands:*
+% *Basic:* --------------------------------------------------------
+% \Anote{LEMMA}{NOTE} prints LEMMA where it occurs
+% and sends NOTE into an extra footnote apparatus.
+% The lines where the command occurs must be numbered
+% by using commands from package `lineno.sty'.
+% In the footnote, NOTE is preceded by line numbers of LEMMA,
+% by a version of LEMMA (see below), and by some separating stuff.
+% Separating stuff by default is a properly spaced right bracket
+% according to \lemmafmt (see below).
+% \Anote may be nested in LEMMA.
+% (Overlapping lemmas may be generated by \Anotelabel etc. as
+% described below.)
+% For customizing appearance of notes, see `package options' and
+% `customizing' (\lemmafmt and \lemmaellipsis, e.g.) below.
+% For additional analogous commands \Bnote etc., see
+% `"optional" user commands' below.
+% *Short lemma substitute in note:* -------------------------------
+% (The following describes a comfortable extension of
+% EDMAC's \lemma.)
+% LEMMA argument of \Anote as above may appear as `L1\<L2\>L3', then
+% only L1 and L3 appear in the footnote with some ellipsis symbols
+% between them. By default, these are \textsymmdots according to
+% \lemmaellipsis.
+% (For \textsymmdots vs. ordinary \dots see `miscellaneous' below.)
+% L2, however, may start with `<ELL>', then ELL is used instead of
+% \textsymmdots or whatever else \lemmaellipsis might call.
+% (To be sure, symbols `\<', `<', `>', `\>' work in a special way
+% in LEMMA. `>' might be used inside ELL if inside braces, e.g.,
+% `\<<{$>$}>'. <ELL> works as an optional argument of \< like
+% brackets usually do in LaTeX---we thought you might use `[' here
+% as a symbol to be printed in main text. Care for proper spacing in
+% both versions of the lemma by spaces touching \<, \>, and braces.
+% ---A special version of the package would be necessary for those
+% having no `<', `>' on their keyboards.)
+% *Overlapping lemmas:* -------------------------------------------
+% \Anotelabel{LABEL}LEMMA\donote{LABEL}{NOTE}
+% works just like \Anote{LEMMA}{NOTE} above. However, by using
+% proper LABELs, you can indicate which of overlapping lemmas
+% begins and ends where. Note that the second command is only
+% \donote, not \Adonote. In LEMMA, \pause{LABEL} and \resume{LABEL}
+% act analogously to \< and \> above for lemma substitutes, and
+% \pause{LABEL}<ELL> employs your own ELL for the ellipsis.
+% LEMMA may contain \Anote and the other way round (in some way).
+% However, \pause{LABEL} must not be hidden in braces etc.
+% *Commands in lemma as repeated in a note:* ----------------------
+% Some commands should work in main text, but not in the lemma
+% text of the note, e.g. \label. With respect to some of them,
+% `ednotes.sty' makes an adjustment for this. Nesting of lemmas,
+% e.g., is enabled this way.
+% For other commands, you can hide code from a note
+% by \notinnote, e.g.: \notinnote{\footnote{...}}.
+% If you know about relevant (La)TeX internals, you can define
+% behaviour of commands in lemmas using \addlemmaexpands, e.g.
+% \addlemmaexpands{\let\footnote\@gobble}.
+% (However, the latter code is bad if \footnote should occur
+% with an optional argument. Moreover, in some cases
+% \let...\notinnote may handle spaces better than
+% \let...\@gobble, since \notinnote uses a variant of LaTeX's
+% \@bsphack and \@esphack.
+% ---\addlemmaexpands has only local effect inside group.)
+% \showlemmaexpands displays all these extra definitions
+% which would apply in the lemma ahead.
+% (A lot of commands might be changed here, we chose only few.
+% Cf. EDMAC's \no@expands; EDMAC, however, deals with the
+% problem in a different way and needs more changes
+% than we do.)
+% *"Optional" user commands:* -------------------------------------
+% Each of \Bnote, \Bnotelabel, \Cnote, \Cnotelabel, \Dnote,
+% \Dnotelabel, \Enote, and \Enotelabel is defined by calling
+% respective package options `Bpara' or `Bplain' etc., see
+% `package options' below. They work like \Anote and \Anotelabel,
+% respectively, and nesting and overlapping of their lemmas works
+% as for \Anote and \Anotelabel. \donote works with each of
+% \Anotelabel, \Bnotelabel etc.---care for different labels.
+% \nopunct may help you in case of certain changes of \notefmt, see
+% `customizing' below (not active outside notes).
+% *Miscellaneous:* ------------------------------------------------
+% As a byproduct, we provide \textsymmdots as an alternative to
+% \dots or (more specific) to LaTeX2e's \textellipsis. We feel that,
+% in the middle of the short version of a lemma, the text dropped
+% should be replaced by symmetrically spaced dots, i.e., in
+% L1 ... L3, the space between L1 and the dots should be the same
+% as the space between the dots and L3. \textellipsis obstructs this
+% by calling a space after the final dot which is not balanced by a
+% space before the first dot. \textsymmdots just closes without that
+% final space---that's all the difference to \textellipsis. (Cf.
+% TeXbook p. 73 where $\ldots$ is recommended for the same purpose.)
+% Of course, it is now your job to care for proper spacing on left
+% and right, e.g., use it this \textsymmdots\ way.
+% Note that with a comma following \dots is quite right while
+% `\textsymmdots,' is bad. %% TODO: delimiters!? e.g. [...]
+% -- Now (since Sep 2004) indeed there is the `ellipsis' package
+% by Peter J. Heslin on CTAN in the /macros/latex/contrib directory!
+% It deals with this problem much more thoroughly.
+% *Wrong placement:* ----------------------------------------------
+% We do not provide helpful error messages for badly placed \<,
+% \pause, and the like in this version. You will just get
+% `undefined' errors, complaints about \mskip, or `runaway
+% argument' errors.---Doubling labels with \Anotelabel etc. may
+% work well if you know what you are doing.
+%
+% *Package options:*
+% 1.) Options `left', `right', `switch', `switch*', `columnwise',
+% `pagewise', `running', `modulo', `mathlines', `displaymath',
+% `edtable' (edit tabular environments), `longtable' (edit
+% `longtable' environments), `nolongtablepatch' are passed to
+% package `lineno'; cf. the latter package for information
+% (not yet tested all). %% TODO
+% `left' and `running' act by default.
+% Option `mathnotes' calls `lineno.sty' package option `mathrefs',
+% see `lineno' documentation as well.
+% 2.) Option `Aplain' arranges all notes for one page generated
+% by \Anote and \Anotelabel in a single footnote paragraph.
+% Option `Bplain' generates an apparatus using one footnote
+% paragraph for each note, with commands \Bnote, and \Bnotelabel.
+% Option `Bpara' does the same but arranging all notes
+% for one page in a single footnote paragraph.
+% Analogues apply to `Cplain', `Cpara', `Dplain', `Dpara',
+% `Eplain', and `Epara'. (There is `Apara' as well---default.)
+% Option `para*' suppresses indentation of footnote paragraphs
+% coming from options like `Apara' (cf. package `manyfoot').
+%% TODO: para indent correct?
+% 3.) Option `edmacpara' makes up for problems with `para'
+% footnotes that are discussed in `EDMAC.doc' section
+% `Paragraphed footnotes'. See our package `mfparptc.sty' for
+% details (for the time being).
+% 4.) Option `perpage' is just passed to `manyfoot.sty'.
+% 5.) Option `countoccurrences' provides a command \countword
+% for a half-way solution of the problem of lemma words that
+% occur more than once in a line. See our package `edcntwd0.sty'.
+% (With `ednotes.sty' v1.1 you need `edcntwd0.sty' v0.31.)
+%
+% *Customizing:* (important change v1.1!)
+% Appearance of notes is directed by macros \extrafootnoterule,
+% \linesfmt etc. occurring in the following lines
+% (each starting with \renewcommand).
+% For customizing, copy the respective lines to your own file,
+% remove left hand comment mark, and change the definition in the
+% right hand pair of braces. (The definition you find there is our
+% original one; we hope you understand from these definitions how
+% they work in general and what the arguments are. E.g., \linesfmt
+% applies to printing of line numbers and, originally, renders them
+% bold-faced, followed by \enspace.)
+% This controls identical behaviour in *every apparatus*.
+% For changing appearance of a single apparatus without changing
+% the remaining, see below.---Note: With v1.1, \ref has been
+% removed from the definition of \repeatref, and a \ref in any
+% customization of it will not work any longer. As well, earlier
+% \linewithpage used \ref and \pageref, and this will not work any
+% longer. \linewithpage has been replaced by \pageandline.
+% \renewcommand{\extrafootnoterule}{\footnoterule}
+% ---This is a `manyfoot.sty' command for separating each extra
+% apparatus from the other ones.---
+% \renewcommand*{\sameline}[1]{\linesfmt{#1}}
+% \renewcommand*{\differentlines}[2]{\linesfmt{#1--#2}}
+% %% TODO: \linesfmt into \@EN@note!?
+% \renewcommand*{\linesfmt}[1]{\textbf{#1}\enspace}
+% \renewcommand*{\pageandline}[2]{#1.#2} % #1 page, #2 line.
+% \renewcommand{\lemmafmt}[1]{#1\thinspace]\enskip}
+% \renewcommand*{\repeatref}[1]{#1}
+% ---E.g., for replacing repeated line numbers by non-bold slash:
+% % \renewcommand*{\repeatref}[1]{\textnormal{/}}
+% \renewcommand{\lemmaellipsis}{\textsymmdots}
+% \renewcommand{\notefmt}[1]{#1}
+% Note: \notefmt, originally, takes your note just as it is.
+% By redefinition
+% \renewcommand*{\notefmt}[1]{#1.}
+% you might add an automatic closing full stop to each note.
+% In a single note of the same apparatus, however, you might then
+% want to close by a question mark (e.g.) instead of the fullstop.
+% For this purpose, close that note by `?\nopunct'. \nopunct then
+% gobbles the full stop waiting ahead. (So much as to \notefmt.)
+% ---Customizing a *single apparatus*:
+% For changing appearance of the apparatus feeded by \Anote
+% without changing remaining apparatuses (feeded by \Bnote etc.),
+% take the following lines (the one with a single right brace
+% being the last one) to your own file and remove the left hand
+% column of comment marks. Remove then left hand comment marks
+% of single lines containing commands whose behaviour in the
+% apparatus you want to change. Change their definitions in
+% right hand braces. (It is quite important never to remove
+% right hand comment marks, as you may know!)
+% \newcommand{\Anotefmt}{%
+% % \renewcommand*{\sameline}[1]{\linesfmt{##1}}%
+% % \renewcommand*{\differentlines}[2]{\linesfmt{##1\textendash##2}}%
+% % \renewcommand*{\linesfmt}[1]{\textbf{##1}\enspace}%
+% % \renewcommand*{\pageandline}[2]{##1.##2}% ##1 page, ##2 line.
+% % \renewcommand*{\repeatref}[1]{##1}% E.g., ...
+% % % \renewcommand*{\repeatref}[1]{\textnormal{/}}% ... instead.
+% % \renewcommand{\lemmafmt}[1]{##1\thinspace]\enskip}%
+% % \renewcommand{\lemmaellipsis}{\textsymmdots}%
+% % \renewcommand{\notefmt}[1]{##1}%
+% }
+% For changing the \Bnote apparatus, do the same and change
+% \Anotefmt into \Bnotefmt. Analogues apply to \Cnote etc.
+% ---You can, moreover, add code in the definition of \Anotefmt etc.
+% for additional settings to be active throughout the note
+% (including line numbers and lemma reference),
+% e.g., for selection of a certain font type.
+% ---`manyfoot' v1.9 offers a command \SetFootnoteHook for
+% controlling the appearance of the whole paragraph of an apparatus
+% in `para' or `para*' style---please see the `manyfoot'
+% documentation for examples. `ednotes' v1.2 makes use of this
+% through a new command \PrecedeLevelWith{X}{CODE}. E.g.,
+% \PrecedeLevelWith{A}{\textit{Var.:}} and
+% \PrecedeLevelWith{B}{\textit{Sim.:}} (once and for all)
+% may distinguish the variant from the similia apparatus.
+% CODE may also be used to contol the paragraph indent of
+% the apparatus (so the paragraphs may have different
+% indents) or to shape the paragraph more generally
+% (according to TeXbook chapter 14, especially pp. 101f.).
+% To give a general rule, \PrecedeLevelWith{X}{CODE} has
+% the same effect as \SetFootnoteHook{CODE}
+% \DeclareNewFootnote[para]{X} would have with `manyfoot'.
+% Without the `para' option or with the `plain' style of
+% notes, CODE just is executed starting each note (preceding
+% even the line number and the lemma).
+% ---*Special characters:* As is noted in EDMAC's documentation,
+% the en-dash for line number printing or the separating right
+% square bracket might be coded unusually in some special font
+% which has been chosen and so may escape being printed. Should you
+% encounter this problem indeed, you can use the previous for remedy
+% (e.g., change \lemmafmt). (EDMAC's solution is use of
+% \endashchar etc. for taking these characters from the \rm font.)
+% ---You may *redefine* most of the commands provided by the
+% package. *Exceptions* are \donote, \<, and \>. So you might
+% put \newcommand{\variant}{\Anote} or even (for TeXperts)
+% \let\variant\Anote into your file (after `ednotes.sty' has been
+% read). No problem about nesting will arise (as did with EDMAC).
+% EDMAC's suggestion to make <...> a shorthand, however, would
+% conflict with our lemma mechanism. (Coexistence would be possible
+% by suitable use of braces and repeating present definitions
+% after change of <'s catcode.)
+%
+% *A problem:*
+% With run-in-paragraph footnotes (options `para' or `para*'), notes
+% may end too deep on the page or (with `longtable.sty') even overlap
+% with main text. `ednotes.sty' shares this "feature" with EDMAC and
+% LEDMAC. Output gets worse as the number of paragraphed-footnote
+% series increases. `manyfoot.sty' version 1.7 (!) accounts for this
+% by a command \ExtraParaSkip (as an interim solution). This command
+% reserves additional vertical space for the notes (so there is less
+% space for main text---at the expense of too large empty space on
+% some pages). After `ednotes.sty' (or `manyfoot.sty') has been
+% loaded (i.e., below \usepackage...), type `\ExtraParaSkip{<skip>}'
+% (still in the preamble) where <skip> may be any glue parameter.
+% <skip> may be a multiple of any absolute space unit (e.g., `4pt' or
+% `2mm'), it may even be a multiple of a space unit depending on the
+% font size of notes (\footnotesize)---like `em', `ex', or
+% `\normalbaselineskip' (e.g., `.5\normalbaselineskip'). (However,
+% stretch and shrink of, e.g., \normalbaselineskip are ignored.)
+% Experiment with choices for <skip> such that notes neither overlap
+% with main text nor hang too deep on the page. The most safe choice
+% is `\ExtraParaSkip{.5\normalbaselineskip}'.
+% ---Manyfoot.sty did something similar before; i.e., it reserved
+% .5\normalbaselineskip (with respect to \footnotesize) for the notes.
+% This may not be needed on some pages (on such pages there may be
+% too much empty vertical space).
+% ---For the best solution you should, when your work is ready and
+% only needs optimization of formatting, type
+% \ExtraParaSkip{-.5\normalbaselineskip}
+% (to remove the space that Manyfoot.sty reserves) and then insert
+% \pagebreak's in your main text to avoid overful pages.
+% ---We formerly offered a command \MFparaxbuffer in file
+% `mfparxsp.sty' instead. This could be used once only in the
+% document preamble. \ExtraParaSkip does not have this limitation.
+% This allows, e.g., first setting a "default" value and changing it
+% under certain conditions, e.g.:
+% \ExtraParaSkip{<skip1>} ... \if... \ExtraParaSkip{<skip2>} ... \fi
+% (Thanks to Florian Kragl who presented a similar first remedy for
+% the problem.)
+%
+% *The problem of oscillating page breaks:*
+% In typesetting critical editions, there is an increased danger
+% of page break oscillations, causing wrong numberings,
+% placements, and cross-references. Our package `lblchng1.sty'
+% (same CTAN directory) offers help with this. However,
+% `ednotes.sty' v1.1 takes over most of the job from
+% `lblchng1.sty'. We still recommend to *read the file*
+% `lblchng1.sty' on how to use the messages from `lblchng1.sty'
+% and `ednotes.sty' on page number changes (be sure that it is
+% v0.32 or higher). Yet the messages may suffice. Just look at the
+% final messages on screen or in .log.
+%
+% *A problem with `hyperref.sty':*
+% To guarantee compatibility with `hyperref', updating lineno.sty
+% to v4.3 is recommended.
+%
+% *Note on EDMAC:*
+% `edmac.doc' is a macro package by John Lavagnino and
+% Dominik Wujastyk made for critical editions to be used in presence
+% of Plain TeX only. We refer to the macros and documentation of
+% this package by `EDMAC'. There is an enhancement `edmacfss.sty'
+% for additionally employing the New Font Selection Scheme (NFSS)
+% from LaTeX2e. With `edmacfss.sty', some LaTeX commands work by
+% accident. However, it replaces LaTeX's \end by PlainTeX's \end,
+% so LaTeX environments don't work. Moreover,
+% EDMAC defines its own output routine in place of LaTeX's,
+% so LaTeX's page assembly and related commands (\marginpar ...)
+% are disabled. EDMAC still provides facilities
+% (columnar footnotes, endnotes, sublines) which are neither
+% implemented here nor in packages `manyfoot' and `lineno'
+% on which the present one is based. However, there are authors
+% who have had a desire to stay in LaTeX's paradise and to enjoy
+%% TODO: Hilbert translation
+% EDMAC features at the same time. (E.g., edition may be only part
+% of your document, or you want to use many LaTeX packages.)
+% Fortunately, Christian was led to packages `manyfoot' and `lineno'
+% which implement the most desirable of EDMAC's facilities for use
+% with LaTeX. A version of EDMAC's \text and assembly of notes
+% remained to be done. We even go beyond EDMAC concerning lemma
+% substitutes and overlapping lemmas.
+% ---For explanation of present solutions, we sometimes refer to
+% EDMAC where similar problems are dealt with in similar but
+% sometimes essentially differing ways. Therefore, knowledge of
+% EDMAC may foster your understanding commands and remarks
+% presented here, but it is not required.
+% ---Dominik maintains a homepage for EDMAC and related software:
+% http://www.homepages.ucl.ac.uk/~ucgadkw/edmac/
+%
+% *Comparison with LEDMAC:*
+% (Cf. http://ednotes.sty.de.vu and `ednotugb.pdf'.)
+% Peter Wilson's LEDMAC ports EDMAC to LaTeX, i.e., you get
+% almost exactly EDMAC *functionality* and same *user interface*
+% as in good old EDMAC (some slight changes of command names
+% were necessary). Thus it offers a very easy switch to LaTeX
+% for EDMAC addicts and is superior in functionality to `ednotes.sty'
+% where EDMAC is (columnar footnotes, endnotes, sublines, etc.?
+% --first two might change over the years). `ednotes.sty' might
+% be favoured if you really need overlapping lemmas, and we tried
+% to offer further user-friendly features as spelled out above.
+% --Some users want to edit tables. For EDMAC there is the
+% TABMAC package providing special commands for this. A TABMAC
+% port is part of LEDMAC. This is nice for EDMAC/TABMAC addicts.
+% Our additional package `edtable.sty' allows for lemmas in (some)
+% LaTeX tabular environments and numbers their rows as if they were
+% lines. This is nice for those who only know the LaTeX tabular
+% environments. However, TABMAC and its mirror in LEDMAC offer
+% facilities which are not provided by LaTeX/ednotes/edtable.
+% --LEDMAC *implementation* is very close to EDMAC's as well,
+% differing very much from `ednotes.sty', especially concerning
+% use of auxiliary files. However, this seems to have no practical
+% effects. On very old machines, EDMAC/LEDMAC might be slower, while
+% Ednotes might cause memory overflow with small TeX versions and
+% many notes. Peter Wilson [3/3 2004] estimates that rather
+% EDMAC's/LEDMAC's typesetting everything twice might be a
+% disadvantage in comparison with `ednotes.sty'.
+% ---In 2004 LEDMAC has been enhanced considerably beyond the
+% functionality of EDMAC and `ednotes.sty'.
+% It now also includes indexing by line as well as by page,
+% a port of Wayne Sullivan's EDSTANZA, new options for line
+% numbering, a minipage-like environment (which may break across
+% pages) such that remarks are printed immediately after some piece
+% of edited text (a letter, e.g.), and "sidenotes".
+% Finally an extension package `ledpar' adds parallel typsetting.
+% --At least for some time LEDMAC will be more user-friendly
+% in providing all functions in a single file with *one*
+% *printable* documentation file. %% TODO
+% On the other hand, packages we build on are still being enhanced
+% in functionality by their authors.
+%
+%
+%% Acknowledgements
+%
+% Christian saved me from most of the work by having found
+% packages `lineno.sty' by Stephan I. B"ottcher and `manyfoot.sty'
+% by Alexander I. Rozhenko which do the output stuff. Thanks to
+% Christian, Stephan and Alex! I appreciate their work (especially
+% Stephan's approach to adding and remembering line numbers), and I
+% admire John Lavagnino's and Dominik Wujastyk's work on EDMAC.
+% I am also grateful for their encouragement. U.L.
+%
+% Moreover I am much indebted to Stephan B"ottcher and Alex
+% Rozhenko for their co-operation in reducing the number of
+% package files that `ednotes.sty' needs. (This was 2004,
+% version v1.0.)
+%
+% For pointing out errors and problems, we are grateful to test
+% users Robert Alessi, Sergei Mariev---see version history.
+% Florian contributed to now `manyfoot.sty's \ExtraParaSkip as
+% described above. v1.1 is due to problems that Roy Flechner
+% reported. v1.12 is due to
+%
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+% 1994/12/01: \newcommand* etc. %% TODO: more recent needed?
+\ProvidesPackage{ednotes}
+ [\filedate\space v\fileversion,
+ for critical editions]
+ %%%(ul)]%%%by Uwe L\string\"uck.]
+%
+%% Package Options:
+%
+% Own options
+% (must appear before `para*' so this can override `para'):
+%% TODO: true!?
+%% TODO: Something to make use of Alex' \SplitNote!?
+\let\if@EN@Apara\iftrue % Makes option `Apara' default.
+\DeclareOption{Apara}{% Redundant, just in case ...
+ \PackageWarning{ednotes}{Package Option `Apara' is redundant}
+% \PassOptionsToPackage{para}{manyfoot}%
+% \AtEndOfPackage{%
+% \newfootnote[para]{A}%
+% \newcommand{\Anote}{\@EN@note A}%
+% \newcommand{\Anotelabel}{\@EN@notelabel A}%
+% }}
+}
+\DeclareOption{Aplain}{%
+ \let\if@EN@Apara\iffalse
+% \AtEndOfPackage{%
+% \newfootnote{A}%
+% \newcommand{\Anote}{\@EN@note A}%
+% \newcommand{\Anotelabel}{\@EN@notelabel A}%
+% }}
+}
+\DeclareOption{Bpara}{%
+ \PassOptionsToPackage{para}{manyfoot}%
+ \AtEndOfPackage{%
+ \SetFootnoteHook{\@EN@MF@hook@B}%
+ \let\@EN@MF@hook@B\@empty
+ \newfootnote[para]{B}%
+ \newcommand{\Bnote}{\@EN@note B}%
+ \newcommand{\Bnotelabel}{\@EN@notelabel B}%
+}}
+\DeclareOption{Bplain}{%
+ \AtEndOfPackage{%
+ \SetFootnoteHook{\@EN@MF@hook@B}%
+ \let\@EN@MF@hook@B\@empty
+ \newfootnote{B}%
+ \newcommand{\Bnote}{\@EN@note B}%
+ \newcommand{\Bnotelabel}{\@EN@notelabel B}%
+}}
+\DeclareOption{Cpara}{%
+ \PassOptionsToPackage{para}{manyfoot}%
+ \AtEndOfPackage{%
+ \SetFootnoteHook{\@EN@MF@hook@C}%
+ \let\@EN@MF@hook@C\@empty
+ \newfootnote[para]{C}%
+ \newcommand{\Cnote}{\@EN@note C}%
+ \newcommand{\Cnotelabel}{\@EN@notelabel C}%
+}}
+\DeclareOption{Cplain}{%
+ \AtEndOfPackage{%
+ \SetFootnoteHook{\@EN@MF@hook@C}%
+ \let\@EN@MF@hook@C\@empty
+ \newfootnote{C}%
+ \newcommand{\Cnote}{\@EN@note C}%
+ \newcommand{\Cnotelabel}{\@EN@notelabel C}%
+}}
+\DeclareOption{Dpara}{%
+ \PassOptionsToPackage{para}{manyfoot}%
+ \AtEndOfPackage{%
+ \SetFootnoteHook{\@EN@MF@hook@D}%
+ \let\@EN@MF@hook@D\@empty
+ \newfootnote[para]{D}%
+ \newcommand{\Dnote}{\@EN@note D}%
+ \newcommand{\Dnotelabel}{\@EN@notelabel D}%
+}}
+\DeclareOption{Dplain}{%
+ \AtEndOfPackage{%
+ \SetFootnoteHook{\@EN@MF@hook@D}%
+ \let\@EN@MF@hook@D\@empty
+ \newfootnote{D}%
+ \newcommand{\Dnote}{\@EN@note D}%
+ \newcommand{\Dnotelabel}{\@EN@notelabel D}%
+}}
+\DeclareOption{Epara}{%
+ \PassOptionsToPackage{para}{manyfoot}%
+ \AtEndOfPackage{%
+ \SetFootnoteHook{\@EN@MF@hook@E}%
+ \let\@EN@MF@hook@E\@empty
+ \newfootnote[para]{E}%
+ \newcommand{\Enote}{\@EN@note E}%
+ \newcommand{\Enotelabel}{\@EN@notelabel E}%
+}}
+\DeclareOption{Eplain}{%
+ \AtEndOfPackage{%
+ \SetFootnoteHook{\@EN@MF@hook@E}%
+ \let\@EN@MF@hook@E\@empty
+ \newfootnote{E}%
+ \newcommand{\Enote}{\@EN@note E}%
+ \newcommand{\Enotelabel}{\@EN@notelabel E}%
+}}
+% This is as much as EDMAC provides.
+%% TODO: efficiency!?
+%% TODO: shorten previous by temporary defining macro
+%% \@EN@tempa!? (dangerous)
+%
+% Load `mfparptc.sty' after `manyfoot.sty':
+\DeclareOption{edmacpara}{%
+ \AtEndOfPackage{\RequirePackage{mfparptc}[2004/08/21]}}
+% <- `center' bug fix.
+%
+% Load `edcntwd0.sty' after `lineno.sty':
+\DeclareOption{countoccurrences}{%
+ \AtEndOfPackage{\RequirePackage{edcntwd0}[2004/07/28]}}
+% <- pagewise numbering.
+%
+% `edtable' options remain "unkown" and thus are passed to
+% `lineno.sty'.
+%
+% Options for package `manyfoot':
+% Calling option `ruled' or `para' for `ednotes' is redundant,
+% but in case ...
+\DeclareOption{ruled}{\PackageWarning{ednotes}%
+ {Package Option `ruled' is redundant}}
+\DeclareOption{para}{\PackageWarning{ednotes}%
+ {Package Option `para' is redundant}}
+\DeclareOption{para*}{\PassOptionsToPackage{para*}{manyfoot}}
+% Suppresses footnote indentation.
+% Overrides `para' as called from own options.
+\DeclareOption{perpage}{\PassOptionsToPackage{perpage}{manyfoot}}
+%
+% Options for package `lineno':
+\DeclareOption{mathnotes}{\PassOptionsToPackage{mathrefs}{lineno}}
+\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{lineno}}
+%
+% %% TODO: Really load lineno.sty here!? Otherwise remove options.
+% %% TODO: Interfaces for alternative auxiliary packages.
+% \ExecuteOptions{Apara} % \newcommand... bad for opposite option.
+\ProcessOptions
+%
+%% Load required packages:
+\RequirePackage[ruled\if@EN@Apara,para\fi]{manyfoot}
+%% TODO: Leave choice to user!?
+%% TODO: 2004/10/20 v1.7!? (\ExtraParaSkip)
+%% -- cf. reminder about `mfparxsp.sty' below.
+%% TODO: ruled -> \Execute...!?
+
+\RequirePackage{lineno}[2004/10/11]
+% Hack for `lineno.sty' version. If \@LN@postlabel is defined, assume
+% `lineno' version 4 has been loaded. %% TODO
+\@ifundefined{@LN@postlabel}{%
+ \PackageWarning{ednotes}{We urge you to use `lineno.sty' version 4!}
+ \RequirePackage{linenox0}[2004/08/12]%% No page break after heading
+%% (left to `linenox1.sty').
+}\relax
+%
+%% Execute option concerning first apparatus:
+\SetFootnoteHook{\@EN@MF@hook@A}
+\let\@EN@MF@hook@A\@empty
+\if@EN@Apara
+ \newfootnote[para]{A}% Needs `manyfoot.sty'.
+ \newcommand{\Anote}{\@EN@note A}%
+ \newcommand{\Anotelabel}{\@EN@notelabel A}%
+\else
+ \newfootnote{A}%
+ \newcommand{\Anote}{\@EN@note A}%
+ \newcommand{\Anotelabel}{\@EN@notelabel A}%
+\fi
+%
+%% User commands (if not defined in option code etc.):
+\newcommand{\addlemmaexpands}{\@EN@addtomacro\@EN@lemmaexpands}
+%% <- local; cf. using LaTeX's \g@addto@macro: %% TODO: decide
+% \newcommand{\addlemmaexpands}{\g@addto@macro\@EN@lemmaexpands}
+\newcommand{\showlemmaexpands}{%
+ \typeout{\string\@EN@lemmaexpands=\meaning\@EN@lemmaexpands}%
+}
+%
+\DeclareTextCommandDefault{\textsymmdots}{%
+ .\kern\fontdimen3\font.\kern\fontdimen3\font.\@%
+}
+%
+%
+%% Customizable commands:
+%
+\newcommand*{\sameline}[1]{\linesfmt{#1}}
+\newcommand*{\differentlines}[2]{\linesfmt{#1\textendash#2}}
+%% TODO: \linesfmt into \@EN@note!?
+\newcommand*{\linesfmt}[1]{\textbf{#1}\enspace}
+\newcommand*{\pageandline}[2]{#1.#2}
+\newcommand*{\repeatref}[1]{#1}
+% \newcommand*{\repeatref}[1]{\textnormal{/}}
+\newcommand{\lemmafmt}[1]{#1\thinspace]\enskip} %% TODO: \long!?
+\newcommand{\lemmaellipsis}{\textsymmdots}
+\newcommand{\notefmt}[1]{#1} \let\notefmt\@firstofone
+%% <- TODO: \long!?
+% \newcommand{\notefmt}[1]{#1.}
+%
+%% Core code:
+% Interface for manyfoot's \SetFootnoteHook facility:
+\newcommand{\PrecedeLevelWith}[2]{%
+ \expandafter \renewcommand \csname @EN@MF@hook@#1\endcsname{#2}}
+% \renewcommand might help when an level is addressed that
+% has not been called through an option.
+
+% Auxiliary needed before calling \addlemmaexpands below:
+\long\def\@EN@addtomacro#1#2{% #1 cs, #2 new.
+% Local, cf. LaTeX's \g@addto@macro.
+ \expandafter\def\expandafter#1\expandafter{#1#2}%
+}
+% %% TODO: \long!? see building of lemmaarg and lemmatag.
+%
+% Our sphack for going around control sequences in text:
+% %% TODO: improve for repetition!? But seems to suffice.
+\def\@EN@sphack{\relax
+ \ifhmode\ifdim\lastskip>\z@\ignorespaces\fi\fi}
+%
+% Basic handling of \Anote etc.:
+\long\def\@EN@note#1#2{% #1 note family, #2 lemma.
+% %% TODO: \long!?
+ \def\@EN@notefam{#1}%
+ \@EN@process #2\<\>\@nil
+}
+%
+% Lemma versions and preparing label:
+\long\def\@EN@process#1\<#2\>#3\@nil{% %% TODO: \long!?
+% Usage: \@EN@process #k\<\>\@nil.
+%% TODO: simplify using LaTeX's \in@!?
+% Implementation: don't leave control to user's input unless \<, \>
+% have been processed. <...> is postponed in main text.
+ \def\@EN@lemmaarg{\ignorespaces#1}%
+% \ifx\@EN@lemmaarg\@empty %% \fi %% TODO: complain!?
+% \let\@EN@lemmatag\@EN@lemmaarg %% Would be overridden.
+ \ifx\@nnil#2#3\@nnil
+ % No ellipsis, #1 all of user's input, dummy \<\> gobbled.
+ \@EN@addtomacro\@EN@lemmaarg\unskip
+ \@EN@simplelemmatag
+% \let\@EN@lemmatag\@EN@lemmaarg
+ \@EN@mathlemmatag
+ \else
+ \@EN@simplelemmatag
+% %% TODO: this case is the rare one, so put it into an extra
+% %% macro for efficiency!?
+ \def\@EN@tempa{#3}%
+ \ifx\@EN@tempa\@empty % \<, but no \> from user.
+ % #2 ends on \<, \>\@nil gobbled.
+ \@EN@withdummy#2\@nil
+ \else
+ % #3 ends on dummy \<\>.
+ \@EN@killresume\@EN@withdummy#2\@EN@sphack\@nil#3%
+ % This \@EN@sphack replacing \> in main text.
+ \fi
+ \fi
+ \global\advance\c@EN@label\@ne
+% Much must be expanded, especially for storing the note in a
+% hook (some tables):
+ \edef\@EN@tempa{\noexpand\@EN@putdown{EN@l\number\c@EN@label}}%
+ \expandafter\expandafter\expandafter \@EN@tempa
+ \expandafter \@EN@notefam \expandafter {\@EN@lemmatag}%
+}
+\long\def\@EN@withdummy#1\<{\@EN@finishlemma#1\@nil} %% TODO: \long!?
+% #1 contains \@nil separating arguments.
+% Variant of LaTeX's \@ifnextchar---don't gobble spaces:
+\def\@EN@finishlemma{\futurelet\@let@token\@EN@finlem}
+\def\@EN@finlem{%
+ \ifx\@let@token<%
+ \let\@EN@next\@EN@xfinlem
+ \else
+ \def\@EN@next{\@EN@xfinlem<\lemmaellipsis>}%
+ \fi
+ \@EN@next
+}
+\long\def\@EN@xfinlem<#1>#2\@nil#3\@nil{% %% TODO: \long!?
+ \@EN@addtomacro\@EN@lemmaarg{\@EN@sphack#2#3\unskip}%
+ \@EN@addtomacro\@EN@lemmatag{#1\@EN@CWhook{#2}#3\unskip}%
+ \@EN@mathlemmatag
+ % %% TODO: doc.: final \unskip -> space properly!
+}
+% Brackets might have been used instead of <ELL>; however,
+% I am afraid that the user might use brackets at symbols to be
+% printed right here. Alternative (but needs extra code to test
+% for \extraellipsis): \extraellipsis{ELL}. %% TODO: decide
+% Think of keyboards without `<', `>'?
+\long\def\@EN@killresume#1\>{#1} %% TODO: \long!?
+\let\@EN@CWhook\@gobble %% For counting words package.
+\def\@EN@simplelemmatag{\let\@EN@lemmatag\@EN@lemmaarg}
+% Useful for math mode extension as well.
+\let\@EN@mathlemmatag\relax %% Hook for math mode.
+%
+\newcount\c@EN@label
+%
+% .aux entries, note, and lemma in main text:
+% (v1.1: much changes. I just remove what was before, see stored
+% older version.)
+\long\def\@EN@putdown#1#2#3#4{%
+% #1 label, #2 note family, #3 lemma tag, #4 note.
+% %% TODO: \long!?
+ \linelabel{-#1}% Ensures hmode.
+% Insert footnote:
+ \@EN@hookfn{%
+ \csname Footnotetext#2\endcsname\@empty{%
+% \@empty v1.12, due to HCY's report of spurious footnote marks.
+ \csname#2notefmt\endcsname
+ \let\@currentlabel\@empty
+ \label{#1}% Need page number of note.
+ \let\nopunct\@gobble % or by \if...
+% Print line numbers; use especially LaTeX's mechanisms for
+% undefined references, therefore `r@':
+ \@ifundefined{r@#1}%
+ {\differentlines{\ref{#1}}{\ref{#1}}}%
+ {\expandafter\expandafter\expandafter
+ \@EN@extract\csname r@#1\endcsname
+ \@tempswatrue
+ \ifx\@EN@bleml\@EN@eleml \else \@tempswafalse \fi
+% Restart of line numbers / different page!?
+ \ifx\@EN@blemp\@EN@elemp \else \@tempswafalse \fi
+ \if@tempswa
+ \sameline{\@EN@plref\@EN@blemp\@EN@bleml}%
+ \else
+ \@EN@lastline@z@
+ \differentlines{\@EN@plref\@EN@blemp\@EN@bleml}%
+ {\@EN@plref\@EN@elemp\@EN@eleml}%
+ \@EN@lastline@z@
+ \fi}%
+% \strut % Redundant (\rule\z@\footnotesep TODO: CHECK)
+% \expandafter \let \csname r@#1\endcsname \relax %% v1.1.
+%% <- 2005/02/21: No, need label for testing.
+ \lemmafmt{{\@EN@lemmaexpands#3}}%
+ \notefmt{#4}%
+ }%
+ }%
+ % Lemma in main text:
+ \@EN@lemmaarg %% TODO: should not end on space.
+ \linelabel{+#1}%
+ % \csname #1rightmark\endcsname %% Suggested.
+}
+\let\@EN@hookfn\@firstofone
+\def\@EN@extract#1#2#3#4#5{%
+% #1 note page, #2 first lemma line, #3 first lemma page,
+% #4 last lemma line #5 last lemma page.
+ \def\@EN@tempa{#1}%
+ \def\@EN@bleml{#2}\def\@EN@blemp{#3}%
+ \def\@EN@eleml{#4}\def\@EN@elemp{#5}%
+}
+\def\@EN@lastline@z@{\global\let\@EN@lastline\z@}
+\@EN@lastline@z@ % Next line number in note explicitly.
+\def\@EN@plref#1#2{% #1 page, #2 line.
+% \@EN@tempa is note page from \@EN@extract.
+ \ifx#1\@EN@tempa %% Note and lemma part on same page.
+ \ifx#2\@EN@lastline %% Same line as before.
+ \repeatref#2% %% v1.1: changed use!
+ \else
+ #2\global\let\@EN@lastline#2%
+ \fi
+ \else
+ \pageandline#1#2% %% v1.1: new!
+ \fi
+}
+%
+% Expanding in note version of lemma:
+\let\@EN@lemmaexpands\@empty
+%% TODO: \long below!? Cf. properly expanding versions.
+\long\def\@EN@lemmawonote#1#2#3{\@EN@sphack#2\@EN@sphack}
+\def\@EN@gobblenotelabel#1#2{\@EN@sphack}
+\long\def\@EN@gobbledonote#1#2{\@EN@sphack}
+\long\def\@EN@notinnote#1{\@EN@sphack}
+\addlemmaexpands{%
+ \let\@EN@note\@EN@lemmawonote
+ \let\@EN@notelabel\@EN@gobblenotelabel
+ \let\donote\@EN@gobbledonote
+% \let\notinnote\@gobble
+ \let\notinnote\@EN@notinnote
+ \let\pause\notinnote \let\resume\notinnote
+ \let\label\notinnote \let\linelabel\notinnote
+}
+%% TODO: cf. EDMAC's tag (fonts? accents? -- lineno.sty commands?)
+\let\notinnote\@firstofone
+%
+% Handling \Anotelabel etc.:
+% \@EN@lemmaarg is to become the LEMMA argument for \@EN@process.
+% A first version is obtained by reading unto the \donote
+% bearing the same label. \@EN@lemmaarg is then rebuilt,
+% replacing \pause and \resume by \< and \>.
+% %% TODO: \long below!? -> lemma.
+\def\@EN@notelabel#1#2{% #1 note family, #2 label.
+ \def\@EN@notefam{#1}%
+ \def\@EN@laplabel{#2}%
+ \let\@EN@lemmaarg\@empty
+ \long\def\@EN@next##1\donote##2##3{% %% TODO: \long!? Alex!?
+ \def\@EN@tempa{##2}%
+ \ifx \@EN@tempa \@EN@laplabel
+ \@EN@addtomacro\@EN@lemmaarg{##1}%
+ \expandafter \def \expandafter \@EN@next \expandafter {%
+ \expandafter \@EN@replacepause
+ \@EN@lemmaarg \pause\@nil\resume\@nil{##3}}%
+ \else
+ \@EN@addtomacro\@EN@lemmaarg{##1\donote{##2}{##3}}%
+ \fi
+ \@EN@next
+ }%
+ \@EN@next
+% The following removed braces urgently needed:
+% \@EN@getlabel\donote
+% {\@EN@laplabel
+% \expandafter\def\expandafter\@EN@next\expandafter
+% {\expandafter\@EN@replacepause
+% \@EN@lemmaarg\pause\@nil\resume\@nil}%
+% \else
+% \@EN@appendwrong
+% }%
+}
+\def\@EN@getlabel#1#2{%
+% jump to cs #1, #2: on \@EN@tempa=...
+% \let#2\@empty
+ \def\@EN@appendwrong{%
+ \expandafter\@EN@addtomacro \expandafter\@EN@lemmaarg
+ \expandafter {\expandafter#1\expandafter{\@EN@tempa}}%
+ }%
+ \long\def\@EN@next##1#1##2{% %% TODO: \long!? Alex!?
+ % %% TODO: \let [pre-defined] for efficiency!?
+ \@EN@addtomacro\@EN@lemmaarg{##1}%
+ \def\@EN@tempa{##2}%
+ \ifx\@EN@tempa#2\fi
+ \@EN@next
+ }%
+ \@EN@next
+}
+\def\@EN@replacepause{%
+ \let\@EN@lemmaarg\@empty
+ \@EN@getlabel\pause
+ {\@nnil
+ \def\@EN@next\resume\@nil{\@EN@donote}%
+ % %% TODO: \let [pre-defined] for efficiency!?
+ \else
+ \ifx\@EN@tempa\@EN@laplabel
+ \@EN@addtomacro\@EN@lemmaarg\<%
+ \let\@EN@next\@EN@replaceresume
+ \else
+ \@EN@appendwrong
+ \fi
+ }%
+}
+\long\def\@EN@replaceresume#1\pause\@nil{% %% TODO: \long!?
+ \@EN@getlabel\resume
+ {\@nnil
+ \let\@EN@next\@EN@donote
+ \else
+ \ifx\@EN@tempa\@EN@laplabel
+ \long\def\@EN@next####1\resume\@nil %% TODO: \long!?
+ % %% TODO: \let [pre-defined] for efficiency!?
+ {\@EN@addtomacro\@EN@lemmaarg{\>####1}\@EN@donote}%
+ \else
+ \@EN@appendwrong
+ \fi
+ }%
+ #1% \resume\@nil ahead.
+}
+\def\@EN@donote{\expandafter\@EN@process\@EN@lemmaarg \<\>\@nil}
+%
+%% TODO: \afterassignment possible anywhere?
+%% TODO: \AtBeginDocument: \misplaced\< etc.
+%% TODO: remove testing \typeout's.
+% v1.1: reduce number of control strings from \newlabel.
+% We keep using \linelabel and \label for kind of simplicity and
+% because modifying them would hardly save time or save us from
+% the difficulties that we face here. Instead we modify
+% \newlabel to prevent it from dealing with labels coming from
+% annotations in the usual way.
+%
+% Storing and restoring of \newlabel and `lineno.sty's
+% \getpagewiselinenumber: %% TODO: do without the latter anyway?
+\let\@EN@newlabel\newlabel
+\let\@EN@getpagewiselno\getpagewiselinenumber
+\let\getpagewiselinenumber\relax
+\AtBeginDocument{\let\getpagewiselinenumber\@EN@getpagewiselno}
+%
+% For each lemma and note, there will be one macro carrying the
+% corresponding line and page numbers. Below, \@EN@tempa will
+% carry the name that macro. \@EN@bleml will be the line number,
+% \@EN@blemp the page number from the \newlabel arguments.
+% \@EN@extractcslp will do the assignments for \@EN@tempa,
+% \@EN@bleml, and \@EN@blemp. Three \newlabel's will come to
+% deliver the numbers for one note, each will add to the
+% expansion code of the corresponding macro. The page number of
+% the note is attached to the left; ensuring that it is on the
+% same place in each case. (Indeed, usually the .aux entry from
+% the note comes .aux after the final entry from the lemma, but
+% when a page break happens within the latter, this order may
+% reverse.) \@EN@addtolabeldef will do this. It will at first
+% look as if \@EN@extractcslp and \@EN@addtolabeldef should
+% better have been merged into one single macro; however, we
+% need them for the final testing function below, where they
+% appear in different contexts.
+% TODO: The format of the numbers list is
+% {<notepage>}{<blemline>}{<blempage>}{<elemline>}{<elempage>}
+% This is LaTeX-like, cf. storing of the numbers for a usual
+% \ref. It is easy to read the second or so term. Yet it wastes
+% a lot of memory with critical editions. It might be better to
+% use a single token as separator, as (L)EDMAC do.
+%
+\def\@EN@addtolabeldef#1#2{% add #1 left, #2 right.
+ \expandafter \protected@xdef \@EN@tempa{%
+ #1\@EN@tempa#2}}
+\def\@EN@fornotelabel#1#2#3{% #1 sign, #2 label, #3 def.
+ \in@{\@@#1EN@l}{\@@#2}% LaTeX's \in@, \ifin@.
+ \ifin@
+ \@EN@extractcslp#2\@nil#3\@nil
+% Now, in one step, \@EN@tempa expands to the name of the macro
+% that \newlabel defines at \begin{document}.
+% The \newlabel with `-' will always come first, so this macro
+% has not been defined yet:
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi}
+\def\newlabel#1#2{%
+% It should be possible to read #2 later, but it's difficult.
+% ...extractcslp might be split into parts of ...fornotelabel
+% and some other macro doing more. [TODO]
+ \@EN@fornotelabel-{#1}{#2}{%
+ \@EN@addtolabeldef\@gobble{{\@EN@bleml}{\@EN@blemp}}%
+% \typeout{\expandafter\string\@EN@tempa \space
+% (-) \expandafter\meaning\@EN@tempa}%
+ }{\@EN@fornotelabel+{#1}{#2}{%
+ \@EN@addtolabeldef{}{{\@EN@bleml}{\@EN@blemp}}%
+% \typeout{\expandafter\string\@EN@tempa \space
+% (+) \expandafter\meaning\@EN@tempa}%
+ }{\@EN@fornotelabel{}{#1}{#2}{%
+ \@EN@addtolabeldef{{\@EN@blemp}}{}%
+% \typeout{\expandafter\string\@EN@tempa \space
+% (p) \expandafter\meaning\@EN@tempa}%
+ }{\@EN@newlabel{#1}{#2}}%
+ }% +
+ }% -
+}
+\@onlypreamble\newlabel % Unlike LaTeX, but get rid of all of
+% % this. A new version comes \AtEnd...
+%
+\def\@EN@extractcslp#1E#2\@nil#3#4#5\@nil{%
+% #1 "sign", #2 label after `E'; #5 for `hyperref.sty'.
+% The `E' is needed when neither - nor + ...
+ \expandafter \def \expandafter \@EN@tempa \expandafter{%
+ \csname r@E#2\endcsname}%
+% Use `r@' for \ref, cf. \@EN@putdown.
+ \def\@EN@bleml{#3}\def\@EN@blemp{#4}}
+% <- Just avoid additional control strings.
+% No \@onlypreamble, use it in the final run as well.
+%
+% v1.1: final testing of label changes with the compressed
+% definitions (cf. `lblchng1.sty').
+% We use the compression mechanism from the beginning to
+% determine the definitions for the next run. To compare them
+% with the present definitions, the latter must be stored
+% before. With nesting or overlapping lemmas, other notes may
+% send their information before the new definition for one note
+% has been finished. And when we receive data from these other
+% notes, we must store their previous data as well. So we cannot
+% use one single control string to \let it be the string that
+% carries the previous data corresponding to a note. Yet we
+% don't want to double the number of strings corresponding to
+% notes here. So we store the definitions in one single list,
+% yet only for as long as the comparison has not been completed.
+%
+% To tell to the third \newlabel that it is the third indeed,
+% the second \newlabel adds \@EN@ready together with number(s):
+\def\@EN@test@addtolabeldef#1#2{%
+ \expandafter
+ \ifx \@EN@tempa \relax \else
+% Test whether this is the third \newlabel for the note:
+ \expandafter\expandafter\expandafter \in@
+ \expandafter\expandafter\expandafter \@EN@ready
+ \expandafter\expandafter\expandafter {\@EN@tempa}%
+ \ifin@ \let\@EN@ready\@empty \fi
+ \@EN@addtolabeldef{#1}{#2}% Warning: should not use \in@!
+ \ifin@
+ \let\@EN@ready\relax
+ \expandafter\@EN@prepare@fromtl\@EN@tempa\@nil
+ \expandafter\@tempa\@EN@testinglist\@nil
+ \expandafter
+ \ifx \@EN@tempa \@tempa \else
+ \@tempswatrue
+ \ifx\@tempa\relax \else
+ \expandafter\@EN@takepagesto\@tempa\@tempa
+ \expandafter\expandafter\expandafter
+ \@EN@takepagesto\@EN@tempa\@EN@tempa
+% The message may come when line numbers have changed, not page
+% numbers. This may puzzle some users, but should be harmless.
+ \typeout{^^JPackage `ednotes.sty':^^J%
+ *** A lemma or note moved. ^^J*** Page numbers
+ \@tempa\space turned into \@EN@tempa.^^J***
+ Watch whether they come to rest and references
+ get right.^^J}%
+ \let\newlabel\@EN@newlabel
+ \def\@newl@bel{\@gobblefour\relax}% Cf. `lblchng1.sty'.
+ \fi
+ \fi
+ \fi
+ \fi
+}%
+\let\@EN@ready\relax
+\let\@EN@testinglist\@empty
+\def\@EN@testlabel#1#2{% Don't change \@testdef -- `lblchng1.sty'.
+% Cf. our \newlabel for details. \@EN@testlabel is an extension
+% of it.
+% \typeout{testinglist: \meaning\@EN@testinglist}%
+ \@EN@fornotelabel-{#1}{#2}{%
+ \expandafter
+ \ifx \@EN@tempa \relax % Label #1 not used in previous run.
+ \@tempswatrue % Just to behave like LaTeX's \@testdef.
+ \else % Only otherwise delicate procedure is required.
+% Put to testing list:
+ \protected@edef \@EN@testinglist{\@EN@testinglist
+ \expandafter \protect \@EN@tempa{\@EN@tempa}}%
+% First contribution to ...:
+ \@EN@addtolabeldef\@gobble{{\@EN@bleml}{\@EN@blemp}}%
+ \fi
+% \typeout{\expandafter\string\@EN@tempa \space
+% (-) \expandafter\meaning\@EN@tempa}%
+ }{\@EN@fornotelabel+{#1}{#2}{%
+ \@EN@test@addtolabeldef\@EN@ready{%
+ {\@EN@bleml}{\@EN@blemp}}%
+% \typeout{\expandafter\string\@EN@tempa \space
+% (+) \expandafter\meaning\@EN@tempa}%
+ }{\@EN@fornotelabel{}{#1}{#2}{%
+ \@EN@test@addtolabeldef{{\@EN@blemp}}\@EN@ready
+% \typeout{\expandafter\string\@EN@tempa \space
+% (p) \expandafter\meaning\@EN@tempa}%
+ }{\@EN@newlabel{#1}{#2}}%
+ }% +
+ }% -
+}
+%
+\def\@EN@prepare@fromtl#1\@nil{%
+ \def\@tempa##1\protect#1##2##3\@nil{%
+ \def\@tempa{##2}\def\@EN@testinglist{##1##3}}}
+\def\@EN@takepagesto#1#2#3#4#5#6{\def#6{#1, #3, #5}}
+\AtEndDocument{\let\newlabel\@EN@testlabel
+ \let\getpagewiselinenumber\relax} %% TODO without!?
+%
+%
+%% Reminder about `mfparxsp.sty':
+\AtBeginDocument{%
+ \@ifpackageloaded{mfparxsp}{%
+ \PackageWarningNoLine{ednotes}{%
+%% TODO: \PackageError?
+ You have loaded `mfparxsp.sty',\MessageBreak
+ which defines \string\MFparaxbuffer.\MessageBreak
+ We recommend, instead, \string\ExtraParaSkip\space
+ \MessageBreak
+ from `manyfoot.sty' version 1.7\MessageBreak
+ (CTAN:macros/latex/ncctools).\MessageBreak
+ Cf. ednotes package documentation%
+ }%
+ }\relax
+}
+
+\endinput
+
+%% TODO: with v1.1: warn about \label{[-+]EN@l...}. Maybe make
+%% \label and \linelabel internal, new user versions check
+%% the argument.
+%% TODO: warn about \usepackage{foo} where foo is loaded by option!?
+%% TODO: .dtx
+%% TODO: license for *bundle*
+%% TODO: ... or cf. the brief and clear conditions in Eurofont
+%% (Rowland McDonnell)
+%% TODO: Bigfoot/e-TeX (Kastrup)
+%% TODO: compatibility with Parallel.sty -- Sergei Mariev 2003/06/19.
+%% (hopeless, I'm afraid) -- 2005/02/19: Cf. Peter Wilson's
+%% ledpar.
+
+%% VERSION HISTORY:
+v0.36 2003/01/13 First version sent around.
+v0.37 2003/01/22 Added version history and reference to
+ `mfparptc.sty'.
+v0.38 2003/01/27 Improved copyright notice.
+v0.39 2003/02/06 Documentation: output + splitting problem,
+ explanations of recommended packages.
+v0.4 2003/03/03 Splitting problem remedied by linenox0.
+v0.41 2003/03/03 our owns -> ourselves. + !?
+v0.42 2003/03/04 Some remarks/TODOs, especially concerning \SplitNote,
+ changed lppl hint.
+v0.43 2003/03/23 Doc.: "may" -> "must" [not be hidden].
+v0.44 2003/03/24 Took e-mail addresses list from edtab;
+ added comparison with LEDMAC.
+ TODOs for reading `MFPartPtc.sty';
+ \Require...{linenox0}[2003/03/23];
+ changed acknowledgements: still remains?
+ Stephan's approach, encouragement, U.L.;
+ minor changes in `overview'; point to
+ EDMAC homepage; TODO: ruled user's choice?
+ ---Sent to Peter and Dominik.
+v0.45 2003/03/28 LEDMAC hint: replaced `Correct me ...' by
+ "single printable file" + "enhanced";
+ Version History: 04 -> 03 at v0.44;
+ MFParPtc ToDo below: !! -> !?
+ ---Sent to Peter.
+v0.46 2003/04/15 \renewcommand -> \newcommand in \Anotefmt
+ customization---thanks to Robert Alessi!
+ added bug report acknowledgement.
+v0.47 2003/05/01 Added \@ in \textsymmdots.
+v0.48 2003/06/22 Replaced \@secondoftwo by \@EN@second (Hyperref);
+ placed \let\@EN@lastline correctly---both
+ thanks to Sergei Mariev!
+ 2003/07/09 Added note on `hyperref.sty'.
+v0.49 2003/09/03 Added documentation to evade the \donote bug.
+ 2003/11/06 Require corrected `linenox0.sty'.
+ 2003/11/13 Require corrected `lineno.sty'.
+v0.5b 2003/12/30 Added \@EN@first and \@EN@gtempa for \repeatref.
+ 2003/12/31 Removed argument redundancy in \addlemmaexpands.
+v0.5 2004/01/04 Added \@EN@CWhook for counting words package.
+v0.51 2004/01/06 Require corrected `linenox0.sty'.
+v0.6 2004/03/01 Removed two lines from preamble and mention of
+ \donote bug (v0.49), fixed the latter.
+v0.61 2004/04/15 Changed `Comparison with LEDMAC' concerning TABMAC
+ and implementation, reformulated `acknowledgements'.
+ Unified quotation marks with `....sty'.
+ 2004/04/22 Removed `wait vor Alex...' and `CTAN soon'
+ concerning LEDMAC.
+ 2004/04/28 Removed `New with v0.4'.
+ 2004/05/12 Removed `few weeks' before `similar' in doc.,
+ changed doc. concerning effects of different
+ implementations. Mentioned indexing, `Edstanza',
+ "minipage", and sidenotes concerning LEDMAC.
+ Included Florian Kragl in acknowledgements.
+ Added `A problem' (notes height estimation).
+ Sent around. Added Christian to copyright,
+ L"uck -> L\"uck. `edtab02' -> `edtable'.
+ 2004/07/20 Suggested \csname #2leftmark etc.
+ 2004/07/22 Used \DeclareOption*, removed `BETA TEST RELEASE'.
+v0.62 2004/08/16 \RequirePackage{linenox0}[2004/08/12], LPPL v1.3;
+ \@EN@shortlemmatag, \@EN@initlemmatag,
+ \@EN@finmathlemmatag.
+v0.63 2004/08/16 Replaced previous by \@EN@simplelemmatag and
+ \@EN@mathlemmatag.
+v0.64 2004/08/19 Removed stars from ...newcommands of macros
+ that have no parameter, added some with
+ parameters (undid this?), however made
+ \lemmafmt and \notefmt long (star).
+ 2004/08/22 Changed `Packages required'.
+ 2004/08/31 Rearranged preamble concerning maintenance.
+v0.7 2004/09/19 \Req...{linenox0}... etc. only with lineno v<4.
+ 2004/09/20 Adjustment of instructions to bundle changes;
+ `I.' after `Alexander'.
+v0.71 2004/09/21 Took explanation for \ExtraP... from `mfparxsp.sty'
+ and removed mention of the latter;
+ removed a comment mark from a documentation line.
+ Changed lineno.sty/tex into ...pdf.
+v1.0 2004/10/07 Changed documentation for additional options for
+ `edtable', `edmacpara', `countoccurrences'; hint at
+ TUGboat article; removed mention of `linenox0.sty'.
+ 2004/10/08 Replaced \newif\if@EN@Apara@; replaced redundant
+ option passes redundancy warnings; options
+ `edmacpara' and `countoccurences'; removed TODOs
+ concerning `mfparptc.sty'.
+ 2004/10/11 `perpage' option; acknowledgements for co-operation.
+ 2004/10/13 Require debugged `mfparptc.sty' and `edcntwd0.sty'
+ as well as `lineno.sty' equipped with new options.
+ 2004/10/18 Reminder on `mfparxsp.sty', changed TODOs.
+v1.0a 2004/11/07 LPPL v1.3a.
+v1.0b 2005/01/10 Contact via http.
+ 2005/01/19 Mentioned `ellipsis' package.
+v1.01 2005/02/05 \Packagewarning -> \PackageWarning.
+v1.1b 2005/02/20 Documentation: `ledpar', `ednotugb.pdf',
+ implementation. Only one cs per note -> much
+ different! Require new `edcntwd0,sty'.
+ With v1.1b, testing (`lblchng1.sty') is
+ disabled.
+v1.1c 2005/02/20 Deleted \tracingmacros, earlier kept erroneously.
+v1.1d 2005/02/21 Final testing of label changes. Moved v1.1 macros
+ towards end.
+ 2005/03/06 Reimplemented compression (v1.1b) and final
+ testing (v1.1d) very much + minor changes.
+v1.1 2005/03/08 Notes on \repeatref, \pageandline, and new
+ `edcntwd0.sty' version. Top: `editory notes' ->
+ `critical editions'. Acknowledgement to Roy
+ Flechner.
+v1.11 2005/04/07 Doc typo with ...plref.
+ 2005/04/09 \Provides...: `editory notes' -> `critical
+ editions'. Sent to Ednotes.news .
+v1.12 2005/04/09 \@empty with Footnotetext...
+v1.12a /04/09 Acknowl. Hillel Chayim Yisraeli.
+ 2005/04/10 Supplied LPPL URL, corrected \file...
+ Sent to CTAN and Ednotes.news .
+v1.12b /04/11 address -> URL .
+ 2005/05/01 Due to removing \@EN@first, older version of
+ edcntwd0.sty suffices.
+ 2005/05/12 Remark on hyperref changed due to
+ lineno.sty v4.3 .
+[not sent, not tested]
+v1.12c /09/21 Doubled some hash marks in explanation of
+ customization, adapted doc. to \@EN@sphack.
+[not sent]
+v1.2b 2005/09/22 Updated doc. wrt. availability of manyfoot.sty;
+ \PrecedeLevelWith .
+ 2005/09/24 \let\notthislemma\@firstofone (was bug without).
+v1.2 2005/10/01 \notthislemma -> \notinnote; explained \Precede...
+