1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16\startmodule[mathgoodriddance]
17
18\unprotect
19
20\let\math_good_riddance\relax
21
22\appendtoks
23 \aftergroup\math_good_riddance
24\to \everymathematics
25
26\def\math_good_riddance_indeed
27 {\begingroup
28 \definedfont[MathRoman sa *]
29 \getmathtextblob{\currentlanguage}\currentmathblob
30 \endgroup}
31
32\protected\def\goodriddancemath
33 {\setuptagging[\c!state=\v!start]
34 \setmathgroupset[every]
35 \enabledirectives[structures.tags.math.standalone]
36 \disabledirectives[structures.tags.shipout]
37 \ctxlua{nodes.tasks.enableaction("math", "noads.handlers.riddance")}
38 \let\math_good_riddance\math_good_riddance_indeed}
39
40\protected\def\badriddancemath
41 {\setuptagging[\c!state=\v!stop]
42 \setmathgroupset[default]
43 \disabledirectives[structures.tags.math.standalone]
44 \ctxlua{nodes.tasks.disableaction("math", "noads.handlers.riddance")}
45 \let\math_good_riddance\relax}
46
47\startluacode
48 function noads.handlers.riddance(head,...)
49 nodes.nuts.flushlist(head)
50
51 return nil
52 end
53 nodes.tasks.appendaction("math", "finalizers", "noads.handlers.riddance", nil, "nut", "disabled")
54\stopluacode
55
56\stopmodule
57 |