summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/ednotes
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-06-21 00:01:18 +0000
committerKarl Berry <karl@freefriends.org>2006-06-21 00:01:18 +0000
commit63e65439abe4d48cf9eeb759a0ceffae275b1417 (patch)
tree382c94cb0265f27690705634e2220c2c9aecf1ce /Master/texmf-dist/tex/latex/ednotes
parent6f9c09cec9ce9728f48b2cbcab0ce70b5b142741 (diff)
ednotes update
git-svn-id: svn://tug.org/texlive/trunk@1709 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/ednotes')
-rw-r--r--Master/texmf-dist/tex/latex/ednotes/edcntwd0.sty123
-rw-r--r--Master/texmf-dist/tex/latex/ednotes/ednotes.sty311
2 files changed, 330 insertions, 104 deletions
diff --git a/Master/texmf-dist/tex/latex/ednotes/edcntwd0.sty b/Master/texmf-dist/tex/latex/ednotes/edcntwd0.sty
index 913a5416588..64ff79827d8 100644
--- a/Master/texmf-dist/tex/latex/ednotes/edcntwd0.sty
+++ b/Master/texmf-dist/tex/latex/ednotes/edcntwd0.sty
@@ -1,8 +1,8 @@
%% EdCntWd0.sty--count word occurrences with ednotes.sty.
-\def\fileversion{0.32} \def\filedate{2005/05/01} %% TODO
+\def\fileversion{0.32a} \def\filedate{2006/06/16} %% TODO
%% Copyright (C) 2004 Uwe L\"uck & Christian Tapp (direction)
-%% 2005 Uwe L\"uck.
+%% 2005 2006 Uwe L\"uck.
%% Munich, http://www.contact-ednotes.sty.de.vu.
%% Current maintainer is Uwe L\"uck.
@@ -55,7 +55,7 @@
% or \let\CWtextscript\textsuperscript .
% 5.) Pagewise/running line numbering: Switching from pagewise to
% running line numbering needs an extra run or deletion of
-% \jobname.aux. So don't be frightened by error message.
+% \jobname.aux. So don't be frightened by an error message.
%% Please send comments via http://www.contact-ednotes.sty.de.vu.
@@ -71,41 +71,64 @@
%%
%% * Main ideas: *
% \countword occurrences write their order (per paragraph) and line
-% numbers into \jobname.aux. With these informations from
-% \jobname.aux, a table is created which assigns line and place
+% numbers into the .aux-file. With these informations from the
+% latter, a table is created which assigns line and place
% numbers to words. A second table re-orders the first one and
% assigns an index to each place number. An index of 0 means that the
% corresponding word appears only once in a line. A higher index
% tells the order in which an occurrence follows others in the line.
% When processed for the lemma tag, \countword realizes its place
% number and, using this, reads the index from the former table and
-% prints or not prints and index accordingly.
+% prints or does not print an index accordingly.
% \RequirePackage{ednotes}[2004/01/04]
%% Does this work for mere version checking?
%% No--had the problem with edtable. See LaTeX bug latex/3730.
-\newcount\c@CW@repword
-% \newcounter{repword} %% Don't need \the...
+% Auxiliaries:
\def\@CW@stepcnt#1{\advance#1\@ne}
\def\@CW@emptylist{\@eltt} %% Need bound for table rows.
-\newcount\c@CW@par
+% \newif\if@CW@firstinpar \global\@CW@firstinpartrue %% !
+
+% \c@CW@par identifies paragraphs which contain \countword.
+% From v0.32a onwards, it is a LaTeX counter in order to
+% work properly with \includeonly
+\newcounter{CW@par} % \newcount\c@CW@par
+
+% \@CW@wordlist is made a list of \countword-arguments in one
+% paragraph, to be written to the .aux .
+\global\let\@CW@wordlist\@empty
+
+% At the first occurrence of \countword in a paragraph,
+% \@CW@makeplaceindex reads the corresponding \@CW@wordlist
+% and transforms it into \@CW@wordlinelist -- if it has been
+% written in the previous run. Whether the latter is the case
+% is recorded by \if@CW@pardef.
+\global\let\@CW@make@placindexlist\@CW@makeplaceindexlist
\newif\if@CW@pardef \global\@CW@pardeffalse
+\global\let\@CW@wordlinelist\@CW@emptylist
+% When there is evidence that there are more occurrences of
+% \countword than in the previous run:
+\def\@CW@missingdata{\G@refundefinedtrue
+ \@EN@warning{Missing data for \string\countword}%
+ \CWtextscript?}
+%% <- TODO: warning when some \countword has been removed!?
-\def\@CW@cntwi{%
- \global\let\@CW@wordlinelist\@CW@emptylist
+\def\@CW@makeplaceindexlist{%
+ \global\let\@CW@make@placeindexlist\relax
+ \stepcounter{CW@par}% % v0.32a
+% \global\@CW@stepcnt\c@CW@par
+ \@ifundefined{CWp\romannumeral\c@CW@par}%
+% {\G@refundefinedtrue \global\@CW@pardeffalse}%
+ {\global\@CW@pardeffalse}%
+ {%
+ \global\@CW@pardeftrue
+% \global\let\@CW@wordlinelist\@CW@emptylist
%% \@CW@wordlinelist is built as a "table", each row being
%% <WORD>\@elt<LINENO>\@elt<PLACENO>\@eltt
%% --and there is an extra leading \@eltt.
%% Latter needed for determining exact matching.
- \global\let\@CW@placeindexlist\@CW@emptylist
-%% \@CW@placeindexlist has, after starting \@eltt, rows of form
-%% <PLACE>\@elt<INDEX>\@eltt .
- \global\@CW@stepcnt\c@CW@par
- \@ifundefined{CWp\romannumeral\c@CW@par}%
- {\G@refundefinedtrue \global\@CW@pardeffalse}%
- {%
- \global\@CW@pardeftrue
+% \global\let\@CW@placeindexlist\@CW@emptylist
\begingroup
\count@\z@ \let\@elt\relax \let\@eltt\relax
\edef\@tempa{\noexpand\@tfor \noexpand\@tempa :=%
@@ -145,6 +168,7 @@
\@tempb}%
%% TODO: empty referring macros after use -> ednotes as well.
\xdef\@CW@numberofwords{\number\count@}%
+%% \@CW@wordlinelist next is transformed into \@CW@placeindexlist:
\loop
% \typeout{WL=\meaning\@CW@wordlinelist}%% TEST
\ifx\@CW@wordlinelist\@CW@emptylist \else
@@ -159,9 +183,13 @@
\endgroup
}%
% \typeout{PI=\meaning\@CW@placeindexlist}%% TEST
- \global\let\countword\@CW@cntwii
- \@CW@cntwii
+% \global\let\countword\@CW@cntwii
+% \@CW@cntwii
}
+%% \@CW@placeindexlist has, after starting \@eltt, rows of form
+%% <PLACE>\@elt<INDEX>\@eltt .
+\global\let\@CW@placeindexlist\@CW@emptylist
+
\def\@CW@takerow\@eltt#1\@elt#2\@elt#3\@eltt#4\@nil{%
\count@\@ne
\g@addto@macro\@CW@placeindexlist{#3\@elt}%
@@ -210,9 +238,13 @@
\ifx\@nnil#1\@nnil \else
\g@addto@macro\@CW@nextwordlinelist{\@eltt#1}\fi}
-\@ifdefinable\countword{\global\let\countword\@CW@cntwi}
+% \c@CW@repword counts occurrences of \countword in a paragraph:
+\newcount\c@CW@repword
-\newcommand*\@CW@cntwii[2][\@nil]{%
+\newcommand*\countword[2][\@nil]{%
+% \newcommand*\@CW@cntwii[2][\@nil]{%
+% \global\@CW@firstinparfalse
+ \@CW@make@placeindexlist
\global\@CW@stepcnt\c@CW@repword
\def\@tempa{#1}%
\ifx\@tempa\@nnil
@@ -225,15 +257,21 @@
\@tempa
#2}
+% \@ifdefinable\countword{\global\let\countword\@CW@cntwi}
+
+% In the lemma tag of the note, \countword behaves as follows.
+\addlemmaexpands{\let\countword\@CW@cntwl
+ \global\c@CW@nrepword\c@CW@repword}
\newcount\c@CW@nrepword
\newcommand*\@CW@cntwl[2][]{%% First argument just gobbled,
%% using place number instead.
#2%
+ \@CW@make@placeindexlist
\if@CW@pardef
\global\@CW@stepcnt\c@CW@nrepword
\ifnum\c@CW@repword>\@CW@numberofwords\relax
- \G@refundefinedtrue
+ \@CW@missingdata
\else
\edef\@tempc{%
\def\noexpand\@tempb####1\noexpand\@eltt
@@ -242,11 +280,17 @@
\@tempc \@elt##2\@eltt##3\@nil{\def\@tempa{##2}}%
\expandafter\@tempb \@CW@placeindexlist \@nil
\if 0\@tempa \else
- \CWtextscript{\if ?\@tempa ?\else \@tempa \fi}%
+% \CWtextscript{\if ?\@tempa ?\else \@tempa \fi}%
+ \if ?\@tempa \@CW@missingdata
+ \else \CWtextscript\@tempa \fi
\fi
\fi
\else
- \CWtextscript?%
+%% \if@CW@pardef and the question marks could have been given up,
+%% since there is already the `undefined references' warning.
+% \if@CW@firstinpar \CWtextscript 1\else \CWtextscript ?\fi
+% \CWtextscript?%
+ \@CW@missingdata
\fi}
\providecommand*\textsubscript[1]{%
%% Cf. LaTeX \textsuperscript: we will be in a note here!
@@ -256,21 +300,24 @@
%% TODO: empty referring macros after use. -> ednotes as well.
-\addlemmaexpands{\let\countword\@CW@cntwl
- \global\c@CW@nrepword\c@CW@repword}
-
-\global\let\@CW@wordlist\@empty
-
+% \CWClosePar writes \@CW@wordlist to the .aux-file and
+% resets the lists and \if@CWpardef:
\newcommand*\CWClosePar{% %% TODO: -> doc.!? Useful?
\ifx\@CW@wordlist\@empty \else
- \immediate\write\@mainaux{%
+% \immediate\write\@mainaux{%
+ \immediate\write\@auxout{%% for \includeonly
\gdef\expandafter\noexpand
\csname CWp\romannumeral\c@CW@par\endcsname
{\@CW@wordlist}}%
\global\let\@CW@wordlist\@empty
\global\c@CW@repword\z@
\fi
- \global\let\countword\@CW@cntwi
+% \global\let\countword\@CW@cntwi
+ \global\let\@CW@placeindexlist\@CW@emptylist
+ \global\let\@CW@make@placeindexlist\@CW@makeplaceindexlist
+ \global\let\@CW@wordlinelist\@CW@emptylist
+ \global\let\@CW@nextwordlinelist\@empty
+% \global\@CW@firstinpartrue
\global\@CW@pardeffalse}
\expandafter\def\expandafter\linenumberpar\expandafter{%
\expandafter\CWClosePar\linenumberpar}
@@ -303,4 +350,12 @@ v0.3b 2005/01/10 Contact via http.
v0.31 2005/02/20 Added \@EN@first.
2005/03/08 Added Copyright 2005.
v0.32 2005/05/01 Replaced \@EN@first by LaTeX's \@car.
-[not sent, not tested]
+ [sent to CTAN, contrary to final line!]
+ 2006/02/25 Typo fix `USAGE' 5.
+ 2006/05/01 \if@CW@firstinpar to avoid spurious `?'.
+ [given to Lekhtman]
+v0.32a /06/07 \c@CW@par with \includeonly.
+ 2006/06/15 replaced \if@CW@firstinpar by
+ \@CW@make@placeindexlist etc.;
+ extended documentation; rearranged code.
+ 2006/06/16 \@CW@missingdata.
diff --git a/Master/texmf-dist/tex/latex/ednotes/ednotes.sty b/Master/texmf-dist/tex/latex/ednotes/ednotes.sty
index 087a658fae1..646bee669cc 100644
--- a/Master/texmf-dist/tex/latex/ednotes/ednotes.sty
+++ b/Master/texmf-dist/tex/latex/ednotes/ednotes.sty
@@ -1,11 +1,11 @@
%% Macro package `ednotes.sty' for LaTeX2e,
%% copyright (C) 2002--2005 Uwe L\"uck & Christian Tapp (direction)
+%% 2006 Uwe L\"uck
%% http://www.contact-ednotes.sty.de.vu
-%% --author-maintained,
-%% for critical editions
+%% --author-maintained, for critical editions
%% (varying J. Lavagnino's and D. Wujastyk's EDMAC).
%%
-\def\fileversion{1.2} \def\filedate{2005/10/01} %% TODO
+\def\fileversion{1.23a} \def\filedate{2006/06/20} %% TODO
%
%% This file can be redistributed and/or modified under
%% the terms of the LaTeX Project Public License; either
@@ -321,7 +321,30 @@
% by suitable use of braces and repeating present definitions
% after change of <'s catcode.)
%
-% *A problem:*
+% *Your shorthands:*
+% \Anote etc. prevent editorial notes from appearing in the
+% table of contents when such commands (\Anote etc., i.e.)
+% appear in a heading (e.g.). But when you define a shorthand macro
+% (using \newcommand) that has an optional parameter and \Anote
+% or so in the defining code, something more is needed to have
+% the lemma, without the note, in the table of contents (or ...)
+% E.g., you might \newcommand*{\variant}[1][A]{\Anote{#2}{#1}}
+% so \variant{res} works like \Anote{res}{A} and \variant[B]{res}
+% works like \Anote{res}{B}. ednotes v1.22 offers two solutions
+% to this problem:
+% 1. You can precede your shorthand with \RobustTestOpt whenever it
+% appears in a "moving" argument like a chapter heading --
+% \RobustTestOpt\variant{res} as well as
+% \RobustTestOpt\variant[B]{res} , e.g.
+% 2. You can save yourself from caring for \RobustTestOpt by using
+% \NewEdnotesCommand instead of \newcommand --
+% \NewEdnotesCommand*{\variant}[2][A]{\Anote{#2}{#1}}
+% These facilities work only when the shorthand has an *optional*
+% parameter and at least one *mandatory* parameter -- well, if it
+% doesn't have, you can use \RobustTestOpt if you put a pair of
+% braces after the shorthand macro name, this would work as well.
+%
+% *Known problems:*
% 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
@@ -368,8 +391,14 @@
% `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.
+% v0.32 or higher). The warnings from ednotes.sty may suffice.
+% Just look at the final messages on screen or in .log.
+% -- You can overcome such problems using \pagebreak
+% (Standard LaTeX) or \warningpagebreak (from present package)
+% -- force the earlier page break!
+% \warningpagebreak works like Standard LaTeX \pagebreak, it just
+% adds a reminder for the case that such a manual page break
+% may become bad after revisions of your entire work.
%
% *A problem with `hyperref.sty':*
% To guarantee compatibility with `hyperref', updating lineno.sty
@@ -466,9 +495,10 @@
%
% 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
+% Florian Kragl 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 Hillel Chayim Yisraeli's discovery
+% of spurious footnote marks.
%
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
% 1994/12/01: \newcommand* etc. %% TODO: more recent needed?
@@ -477,6 +507,9 @@
for critical editions]
%%%(ul)]%%%by Uwe L\string\"uck.]
%
+%% Our warnings:
+\def\@EN@warning{\PackageWarning{ednotes}}
+%
%% Package Options:
%
% Own options
@@ -485,7 +518,7 @@
%% 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}
+ \@EN@warning{Package Option `Apara' is redundant}
% \PassOptionsToPackage{para}{manyfoot}%
% \AtEndOfPackage{%
% \newfootnote[para]{A}%
@@ -581,18 +614,18 @@
%
% Load `edcntwd0.sty' after `lineno.sty':
\DeclareOption{countoccurrences}{%
- \AtEndOfPackage{\RequirePackage{edcntwd0}[2004/07/28]}}
-% <- pagewise numbering.
+ \AtEndOfPackage{\RequirePackage{edcntwd0}[2006/06/16]}}
+% <- first occurrence bug fix.
%
-% `edtable' options remain "unkown" and thus are passed to
+% `edtable' options remain "unknown" 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}%
+\DeclareOption{ruled}{\@EN@warning%
{Package Option `ruled' is redundant}}
-\DeclareOption{para}{\PackageWarning{ednotes}%
+\DeclareOption{para}{\@EN@warning%
{Package Option `para' is redundant}}
\DeclareOption{para*}{\PassOptionsToPackage{para*}{manyfoot}}
% Suppresses footnote indentation.
@@ -619,7 +652,7 @@
% 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!}
+ \@EN@warning{We urge you to use `lineno.sty' version 4!}
\RequirePackage{linenox0}[2004/08/12]%% No page break after heading
%% (left to `linenox1.sty').
}\relax
@@ -666,6 +699,7 @@
% \newcommand{\notefmt}[1]{#1.}
%
%% Core code:
+
% Interface for manyfoot's \SetFootnoteHook facility:
\newcommand{\PrecedeLevelWith}[2]{%
\expandafter \renewcommand \csname @EN@MF@hook@#1\endcsname{#2}}
@@ -678,17 +712,21 @@
\expandafter\def\expandafter#1\expandafter{#1#2}%
}
% %% TODO: \long!? see building of lemmaarg and lemmatag.
+%% TODO: \tok@ so no doubling of `#'!?
%
% 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}
+ \ifhmode\ifdim\lastskip>\z@ \ignorespaces \fi\fi}
%
+\def\@EN@xpxpxp{\expandafter\expandafter\expandafter} % :-) v1.23
% 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
+ \ifx\protect\@typeset@protect \expandafter \@firstoftwo
+ \else \expandafter \@secondoftwo
+ \fi
+ {\def\@EN@notefam{#1}\@EN@process #2\<\>\@nil}%
+ {\@EN@robust@process #2\<\>\@nil}%
}
%
% Lemma versions and preparing label:
@@ -710,24 +748,30 @@
\@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
+ \ifx\@nnil#3\@nnil % \<, but no \> from user.
+ % #2 ends on \<, \>\@nil gobbled.
+ \@EN@gobble@pause#2\@nil
\else
% #3 ends on dummy \<\>.
- \@EN@killresume\@EN@withdummy#2\@EN@sphack\@nil#3%
+ \@EN@gobble@resume\@EN@gobble@pause#2\@EN@sphack\@nil#3%
% This \@EN@sphack replacing \> in main text.
\fi
\fi
- \global\advance\c@EN@label\@ne
+ \ifLemmaTag \expandafter \@firstoftwo
+ \else \expandafter \@secondoftwo
+ %% <- TODO: \...process might be redirected to
+ %% \...robust@process immediately.
+ \fi
+ {\@EN@lemmaarg\@gobble}%
+ {\stepcounter{EN@label}% % v1.23
+% {\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}%
+ \edef\@EN@tempa{\noexpand\@EN@putdown{EN@l\number\c@EN@label}}%
+ \@EN@xpxpxp \@EN@tempa
+ \expandafter \@EN@notefam \expandafter {\@EN@lemmatag}}%
}
-\long\def\@EN@withdummy#1\<{\@EN@finishlemma#1\@nil} %% TODO: \long!?
+\long\def\@EN@gobble@pause#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}
@@ -750,14 +794,31 @@
% 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!?
+\long\def\@EN@gobble@resume#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
+\newcounter{EN@label} %% for \includeonly; v1.23
+%% <- TODO: problem with final label test
+% \newcount\c@EN@label
%
+% New mechanism for ellipsis in lemma -- supporting nested lemmas
+% or at least lemmas shared by apparatuses exceeding one
+% (v1.22b 2006/01/13):
+\def\@EN@lemma@ellipsis{%
+ \futurelet\@let@token\@EN@make@nested@lemmaellipsis}%
+\def\@EN@make@nested@lemmaellipsis{%
+ \ifx\@let@token<%
+ \expandafter \@EN@ellipsis@only
+ \else
+ \expandafter \@EN@ellipsis@only
+ \expandafter <\expandafter \lemmaellipsis \expandafter >%
+ \fi}
+\long\def\@EN@ellipsis@only<#1>#2\>{#1}
+%
+
% .aux entries, note, and lemma in main text:
% (v1.1: much changes. I just remove what was before, see stored
% older version.)
@@ -773,12 +834,18 @@
\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@':
+% Print line numbers:
\@ifundefined{r@#1}%
- {\differentlines{\ref{#1}}{\ref{#1}}}%
- {\expandafter\expandafter\expandafter
- \@EN@extract\csname r@#1\endcsname
+%%% ...unknown + ...incomplete@ref v1.23: %%%
+ {\differentlines\@EN@unknown\@EN@unknown}%
+ {\let\@EN@incomplete@ref\relax
+ \@EN@xpxpxp \@EN@extract\csname r@#1\endcsname
+ \@EN@incomplete@ref\@EN@incomplete@ref
+ \@EN@incomplete@ref\@EN@incomplete@ref
+ \ifx\@EN@elemp\@EN@Incomplete
+ \G@refundefinedtrue
+ \let\@EN@incomplete@ref\@EN@unknown
+ \fi
\@tempswatrue
\ifx\@EN@bleml\@EN@eleml \else \@tempswafalse \fi
% Restart of line numbers / different page!?
@@ -788,7 +855,12 @@
\else
\@EN@lastline@z@
\differentlines{\@EN@plref\@EN@blemp\@EN@bleml}%
- {\@EN@plref\@EN@elemp\@EN@eleml}%
+ {\ifx\@EN@blemp\@EN@elemp % v1.23
+ \@EN@eleml
+ \else
+ \pageandline\@EN@elemp\@EN@eleml
+ \fi}%
+% {\@EN@plref\@EN@elemp\@EN@eleml}%
\@EN@lastline@z@
\fi}%
% \strut % Redundant (\rule\z@\footnotesep TODO: CHECK)
@@ -799,7 +871,9 @@
}%
}%
% Lemma in main text:
- \@EN@lemmaarg %% TODO: should not end on space.
+ \nobreak \hskip\z@skip %% 2006/01/12 cf. german.sty: \allowhyphens
+ \@EN@lemmaarg %% Should not end with space so \linelabel...
+%% \allowhyphens not needed here (tested) 2006/01/12
\linelabel{+#1}%
% \csname #1rightmark\endcsname %% Suggested.
}
@@ -811,6 +885,8 @@
\def\@EN@bleml{#2}\def\@EN@blemp{#3}%
\def\@EN@eleml{#4}\def\@EN@elemp{#5}%
}
+\def\@EN@unknown{\textnormal{\bfseries ??}} % v1.23
+\def\@EN@Incomplete{\@EN@incomplete@ref} % v1.23
\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.
@@ -827,24 +903,75 @@
}
%
% Expanding in note version of lemma:
+\newif\ifLemmaTag \LemmaTagfalse
\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}
+\def\@EN@gobble{\@EN@sphack\@gobble}
+\def\@EN@gobbletwo{\@EN@sphack\@gobbletwo}
+\def\@EN@secondofthree#1#2#3{\@EN@sphack#2}
\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
+ \LemmaTagtrue
+ \let\notinnote\@EN@gobble
+ \let\@EN@note\@EN@secondofthree
+ \let\@EN@notelabel\@EN@gobbletwo
+ \let\donote\@EN@gobbletwo
\let\label\notinnote \let\linelabel\notinnote
+ \let\<\@EN@lemma@ellipsis
}
+%% <- TODO: user commands only!? (no \let)
%% TODO: cf. EDMAC's tag (fonts? accents? -- lineno.sty commands?)
\let\notinnote\@firstofone
%
+% Variant of \@EN@process when moving:
+\long\def\@EN@robust@process#1\<#2\>#3\@nil#4{%
+ #1%
+ \ifx\@nnil#2#3\@nnil
+ % No ellipsis, #1 all of user's input, dummy \<\> gobbled.
+ \else
+ \@EN@sphack
+ \ifx\@nnil#3\@nnil % \<, but no \> from user.
+ % #2 ends on \<, \>\@nil gobbled.
+ \@EN@robust@gobble@pause#2%
+ \else % #3 ends on dummy \<\>.
+ \@EN@gobble@resume
+ \@EN@robust@gobble@pause#2\@EN@sphack#3%
+ % This \@EN@sphack replacing \> in main text.
+ \fi
+ \fi
+}
+\long\def\@EN@robust@gobble@pause#1\<{\@EN@gobble@opt#1<>\@nil\@empty}
+\long\def\@EN@gobble@opt#1<#2>#3\@nil{%
+ \ifx\@nnil#3\@nnil #1%
+ \else \ifx\@nnil#1\@nnil\else#1<#2>\fi \@EN@gobble@diamond#3%
+ \fi
+}
+\long\def\@EN@gobble@diamond#1<>{#1}
+%% TODO: all of them \long?
+%
+% Shorthand macros for lemma in moving argument:
+\newcommand\RobustTestOpt{%
+ \ifx\protect\@typeset@protect \else
+ \expandafter \@EN@robust@test@opt
+ \fi
+}
+\long\def\@EN@robust@test@opt#1#2#{%
+ \ifx\@nnil#2\@nnil
+ \@EN@xpxpxp \@EN@expand@with@default
+ \else
+ \@EN@xpxpxp \@EN@expand@with@option
+ \fi
+ #1#2}
+\newcommand\@EN@expand@with@default[4]{#3[{#4}]}
+\newcommand\@EN@expand@with@option[4]{#3}
+
+\newcommand\NewEdnotesCommand{%
+ \@ifstar{\@EN@newcommand*}{\@EN@newcommand{}}}
+\def\@EN@newcommand#1#2[#3][#4]{%
+ \expandafter \newcommand \expandafter #2\expandafter {%
+ \expandafter \RobustTestOpt \csname \string #2\endcsname}
+ \def\@tempa{\newcommand#1}%
+ \expandafter \@tempa \csname \string #2\endcsname[#3][#4]}
+
% Handling \Anotelabel etc.:
% \@EN@lemmaarg is to become the LEMMA argument for \@EN@process.
% A first version is obtained by reading unto the \donote
@@ -855,18 +982,7 @@
\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
- }%
+ \let\@EN@next\@EN@firstnext
\@EN@next
% The following removed braces urgently needed:
% \@EN@getlabel\donote
@@ -878,6 +994,18 @@
% \@EN@appendwrong
% }%
}
+\long\def\@EN@firstnext#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
+}%
\def\@EN@getlabel#1#2{%
% jump to cs #1, #2: on \@EN@tempa=...
% \let#2\@empty
@@ -926,6 +1054,7 @@
}
\def\@EN@donote{\expandafter\@EN@process\@EN@lemmaarg \<\>\@nil}
%
+%% TODO: analogue to \@EN@robust@process.
%% TODO: \afterassignment possible anywhere?
%% TODO: \AtBeginDocument: \misplaced\< etc.
%% TODO: remove testing \typeout's.
@@ -945,8 +1074,8 @@
%
% 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.
+% carry the name of 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
@@ -1036,7 +1165,7 @@
\expandafter
\ifx \@EN@tempa \relax \else
% Test whether this is the third \newlabel for the note:
- \expandafter\expandafter\expandafter \in@
+ \@EN@xpxpxp \in@
\expandafter\expandafter\expandafter \@EN@ready
\expandafter\expandafter\expandafter {\@EN@tempa}%
\ifin@ \let\@EN@ready\@empty \fi
@@ -1050,15 +1179,17 @@
\@tempswatrue
\ifx\@tempa\relax \else
\expandafter\@EN@takepagesto\@tempa\@tempa
- \expandafter\expandafter\expandafter
- \@EN@takepagesto\@EN@tempa\@EN@tempa
+ \@EN@xpxpxp \@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
+ *** A lemma or note moved. Page numbers
\@tempa\space turned into \@EN@tempa.^^J***
- Watch whether they come to rest and references
- get right.^^J}%
+ Rerun and watch whether they come to rest and references
+ get right.^^J*** If they don't, use \string\pagebreak\space
+ or \string\warningpagebreak\space to force^^J*** the earlier
+ of oscillating page breaks.^^J*** (Cf. package documentation
+ on `oscillating page breaks'.)}%
\let\newlabel\@EN@newlabel
\def\@newl@bel{\@gobblefour\relax}% Cf. `lblchng1.sty'.
\fi
@@ -1106,7 +1237,21 @@
\AtEndDocument{\let\newlabel\@EN@testlabel
\let\getpagewiselinenumber\relax} %% TODO without!?
%
-%
+% v1.23: \warningpagebreak:
+\AtEndDocument{\@EN@pagebreaks@finalwarn}
+\let\@EN@pagebreaks@finalwarn\relax
+\def\@EN@pagebreaksfinalwarn{%
+ \typeout{%
+ Package ednotes: There have been \string\warningpagebreak\space
+ occurrences.^^JFor your final version, we recommend checking
+ whether they still are^^Jappropriate.}%
+}
+\def\warningpagebreak{%
+ \@EN@warning{Page break (\string\warningpagebreak)
+ from user^^J-- still appropriate in final version!? --}%
+ \global\let\@EN@pagebreaks@finalwarn\@EN@pagebreaksfinalwarn
+ \pagebreak}
+
%% Reminder about `mfparxsp.sty':
\AtBeginDocument{%
\@ifpackageloaded{mfparxsp}{%
@@ -1125,6 +1270,7 @@
\endinput
+%% TODO: \newcommand whenever possible!?
%% TODO: with v1.1: warn about \label{[-+]EN@l...}. Maybe make
%% \label and \linelabel internal, new user versions check
%% the argument.
@@ -1260,8 +1406,33 @@ v1.12b /04/11 address -> URL .
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...
+ Sent to CTAN.
+v1.2a 2005/10/02 supplied mention of HCY for v1.12. [not sent]
+v1.21 2005/10/12 \@EN@process tests #3 on empty without \@EN@tempa;
+ withdummy -> gobble@pause,
+ killresume -> gobble@resume;
+ \@EN@robust@process.
+v1.22b /11/21 \if@EN@in@note; \@EN@firstnext.
+ 2005/11/28 @EN@in@note -> LemmaTag; \@EN@gobble[two]
+ 2006/01/12 \allowhyphens in \@EN@putdown.
+ 2006/01/13 New \<<...>...\>. [to Lekhtman]
+ 2006/01/15 \long with \@EN@lemma@ellipsis;
+ removed general definition of \< .
+v1.22 2006/01/16 \@EN@robust@process now really gobbles note,
+ removed wrong \@empty from \@EN@gobble@diamond;
+ \RobustTestOpt, \NewEdnotesCommand.
+v1.23 2006/01/23 Example on \NewEdnotesCommand: default "B" -> "A".
+ 2006/06/07 Changed page-line algorithm with \differentlines;
+ edcntwd0.sty v0.32 required;
+ \c@EN@label LaTeX counter;
+ \expandafter\expandafter\expandafter -> \@EN@xpxpxp
+ 2006/06/15 \@EN@warning; edcntwd0.sty v0.32a required.
+ 2006/06/16 Additional screen advice with oscillating page breaks
+ + explanation in manual (\warningpagebreak).
+v1.23a /06/20 Corrected \RequirePackage{edcntwd0}-date.