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 \setuevalue{\currenttextnote}{\educ_textnote{\currenttextnote}}
60\to \everydefinetextnote
61
62\unexpanded\def\educ_textnote#1
63 {\dontleavehmode
64 \begingroup
65 \def\currenttextnote{#1}
66 \dosingleempty\educ_textnote_indeed}
67
68\def\educ_textnote_indeed[#1]#2
69 {\iffirstargument\setupcurrenttextnote[#1]\fi
70 \edef\p_n{\textnoteparameter\c!n}
71 \edef\p_empty{\textnoteparameter\c!empty}
72 \edef\currentbar{\textnoteparameter\c!rule}
73 \edef\currentnote{\textnoteparameter\c!note}
74 \ifx\p_n\wildcardsymbol
75 \donefalse
76 \ifx\p_empty\v!yes
77 \donetrue
78 \else\ifx\p_empty\v!number
79 \donetrue
80 \else\ifx\p_empty\v!none
81 \donetrue
82 \fi\fi\fi
83 \ifdone
84 \setupbar[\currentbar][\c!empty=\v!yes]
85 \fi
86 \inlinebar[\currentbar]\bgroup
87 \wordboundary#2
88 \ifx\p_empty\v!yes
89 \setnotetext[\currentnote]{#2}
90 \else\ifx\p_empty\v!number
91 \runninghbox{\resetbar\setnote[\currentnote]{#2}}
92 \else\ifx\p_empty\v!none
93 \setupnote[\currentnote][\c!location=\v!none]
94 \runninghbox{\resetbar\setnote[\currentnote]{#2}}
95 \fi\fi\fi
96 \egroup
97 \else
98 \inlinebar[\currentbar]\bgroup
99 \scratchcounter\numexpr\p_n\plustwo\relax
100 \ifx\p_empty\v!yes
101 \interwordspacesbefore\scratchcounter
102 \setnotetext[\currentnote]{#2}
103 \interwordspacesafter\scratchcounter
104 \else\ifx\p_empty\v!number
105 \interwordspacesbefore\scratchcounter
106 \zwnj\runninghbox{\resetbar\setnote[\currentnote]{#2}}\zwnj
107 \interwordspacesafter\scratchcounter
108 \else\ifx\p_empty\v!none
109 \setupnote[\currentnote][\c!location=\v!none]
110 \interwordspacesbefore\scratchcounter
111 \zwnj\runninghbox{\resetbar\setnote[\currentnote]{#2}}\zwnj
112 \interwordspacesafter\scratchcounter
113 \else
114 #2
115 \fi\fi\fi
116 \egroup
117 \fi
118 \endgroup}
119
120\protect \endinput
121 |