diff options
author | Hans Hagen <pragma@wxs.nl> | 2010-12-02 00:11:00 +0100 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2010-12-02 00:11:00 +0100 |
commit | f8b69b75c7982cc54043d7ebea2bf3ba72962b5d (patch) | |
tree | 7891f0d658619a64fd7733820eeff31a52fbf242 /tex/context/base/strc-not.mkiv | |
parent | 292f13e9393919609bb24db1b73365c1f3e12196 (diff) | |
download | context-f8b69b75c7982cc54043d7ebea2bf3ba72962b5d.tar.gz |
beta 2010.12.02 00:11
Diffstat (limited to 'tex/context/base/strc-not.mkiv')
-rw-r--r-- | tex/context/base/strc-not.mkiv | 78 |
1 files changed, 67 insertions, 11 deletions
diff --git a/tex/context/base/strc-not.mkiv b/tex/context/base/strc-not.mkiv index 6f6f5638a..d011cf0f3 100644 --- a/tex/context/base/strc-not.mkiv +++ b/tex/context/base/strc-not.mkiv @@ -207,38 +207,85 @@ \newtoks \everysetupnote \unexpanded\def\definenote - {\dodoubleempty\dodefinenote} + {\dotripleempty\dodefinenote} -\def\dodefinenote[#1][#2]% +\def\dodefinenote[#1][#2][#3]% note [parent] [settings] {\edef\currentnote{#1}% \ifcsname\??vn:\currentnote\endcsname\else \@EA\installinsertion\csname\??vn:\currentnote\endcsname\relax \appendtoks\doprocesssomenote{#1}\to\tobeprocessednotes \fi - \defineenumeration % description + \ifsecondargument + \doifassignmentelse{#2}{\dodefinenotewithsettings{#2}}{\dodefinenotewithparent{#2}{#3}}% + \else + \dodefinenotesimple + \fi + \ctxlua{structures.notes.define("\currentnote","insert",\number\csname\??vn:\currentnote\endcsname)}% + \the\everysetupnote + \dochecknote} + +\def\dodefinenotesimple + {\defineenumeration [\currentnote] - [\c!location=\@@defaultnotedefloc, + [\s!handler=\v!note, + \c!text=, + \c!location=\@@defaultnotedefloc, \c!distance=\@@defaultnotedefdis, \c!width=\v!fit, \c!headstyle=\noteparameter\c!style, \c!headcolor=\noteparameter\c!color, - \s!handler=\v!note, - \c!text=, \c!before=, \c!after=]% \doredefinenotecommands + \presetlocalframed + [\??vn\currentnote]% \setupenumerations [\currentnote] [\s!parent=\??vn\currentnote, \c!number=\v!yes]% no inheritance from decriptions which is okay + \getparameters + [\??vn\currentnote] + [\s!parent=\??vn]} + +\def\dodefinenotewithsettings#1% + {\defineenumeration % description + [\currentnote] + [\s!handler=\v!note, + \c!text=, + \c!location=\@@defaultnotedefloc, + \c!distance=\@@defaultnotedefdis, + \c!width=\v!fit, + \c!headstyle=\noteparameter\c!style, + \c!headcolor=\noteparameter\c!color, + \c!before=, + \c!after=]% + \doredefinenotecommands \presetlocalframed [\??vn\currentnote]% + \setupenumerations + [\currentnote] + [\s!parent=\??vn\currentnote, + \c!number=\v!yes]% \getparameters [\??vn\currentnote] - [\s!parent=\??vn,#2]% - \ctxlua{structures.notes.define("\currentnote","insert",\number\csname\??vn:\currentnote\endcsname)}% - \the\everysetupnote - \dochecknote} + [\s!parent=\??vn,#1]} + +\def\dodefinenotewithparent#1#2% + {%setevalue{\??vn:#2:kids}{\ifcsname\??vn:#2:kids\endcsname\csname\??vn:#2:kids\endcsname,\fi#1}% + \defineenumeration + [\currentnote] + [\s!handler=\v!note, + \c!text=]% + \doredefinenotecommands + \presetlocalframed + [\??vn\currentnote]% + \setupenumerations + [\currentnote] + [\s!parent=\??dd#1, + \c!number=\v!yes]% + \getparameters + [\??vn\currentnote] + [\s!parent=\??vn#1,#2]} % \starttext % text \startfootnote Test.\stopfootnote @@ -265,6 +312,12 @@ \let\setupnotedefinition\setupenumerations +% \def\dodowithcurrentnoteandkids#1#2% action kid +% {\pushmacro\currentnote +% \def\currentnote{#2}% +% \dowithcurrentnoteandkids{#1}% recursive +% \popmacro\currentnote}% + \appendtoks \setupenumerations[\currentnote][]% \to \everysetupnote @@ -355,6 +408,8 @@ \def\dosetcheckednote#1{\csname\??vn @#1\endcsname} +\newtoks\everychecknote + \def\dochecknote {% node states \setnotelocation\plusone % page @@ -406,7 +461,8 @@ \global\dimen\currentnoteins\maxdimen \global\count\currentnoteins\zerocount \global\skip \currentnoteins\zeropoint - \fi} + \fi + \the\everychecknote} \def\dosetnotedistance {\begingroup |