1
2
3
4
5
6
7
8
9
10
11
12
13
14\unprotect
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42\installcorenamespace{textnote}
43
44\installcommandhandler \??textnote {textnote} \??textnote
45
46\definebar
47 [\v!textnote:\v!underbar]
48 [\v!underbar]
49
50\definenote
51 [\v!textnote:\v!note]
52
53\setuptextnote
54 [\c!rule=\v!textnote:\v!underbar,
55 \c!note=\v!textnote:\v!note,
56 \c!n=10]
57
58\appendtoks
59 \frozen\instance\protected\edefcsname\currenttextnote\endcsname{\educ_textnote[\currenttextnote]}
60\to \everydefinetextnote
61
62\tolerant\protected\def\educ_textnote[#1]#*[#S#2]#:#3
63 {\dontleavehmode
64 \begingroup
65 \def\currenttextnote{#1}
66 \ifparameter#2\or\setupcurrenttextnote[#2]\fi
67 \edef\p_n{\textnoteparameter\c!n}
68 \edef\p_empty{\textnoteparameter\c!empty}
69 \edef\currentbar{\textnoteparameter\c!rule}
70 \edef\currentnote{\textnoteparameter\c!note}
71 \ifx\p_n\wildcardsymbol
72 \donefalse
73 \ifx\p_empty\v!yes
74 \donetrue
75 \orelse\ifx\p_empty\v!number
76 \donetrue
77 \orelse\ifx\p_empty\v!none
78 \donetrue
79 \fi
80 \ifdone
81 \setupbar[\currentbar][\c!empty=\v!yes]
82 \fi
83 \inlinebar[\currentbar]\bgroup
84 \wordboundary#3
85 \ifx\p_empty\v!yes
86 \setnotetext[\currentnote]{#3}
87 \orelse\ifx\p_empty\v!number
88 \runninghbox{\resetbar\setnote[\currentnote]{#3}}
89 \orelse\ifx\p_empty\v!none
90 \setupnote[\currentnote][\c!location=\v!none]
91 \runninghbox{\resetbar\setnote[\currentnote]{#3}}
92 \fi
93 \egroup
94 \else
95 \inlinebar[\currentbar]\bgroup
96 \scratchcounter{\p_n\plustwo}
97 \ifx\p_empty\v!yes
98 \interwordspacesbefore\scratchcounter
99 \setnotetext[\currentnote]{#3}
100 \interwordspacesafter\scratchcounter
101 \orelse\ifx\p_empty\v!number
102 \interwordspacesbefore\scratchcounter
103 \zwnj\runninghbox{\resetbar\setnote[\currentnote]{#3}}\zwnj
104 \interwordspacesafter\scratchcounter
105 \orelse\ifx\p_empty\v!none
106 \setupnote[\currentnote][\c!location=\v!none]
107 \interwordspacesbefore\scratchcounter
108 \zwnj\runninghbox{\resetbar\setnote[\currentnote]{#3}}\zwnj
109 \interwordspacesafter\scratchcounter
110 \else
111 #3
112 \fi
113 \egroup
114 \fi
115 \endgroup}
116
117\protect \endinput
118 |