s-math-goodriddance.mkxl /size: 1711 b    last modification: 2025-02-21 11:03
1%D \module
2%D   [      file=s-math-goodriddance.mkxl,
3%D        version=2024.04.01,
4%D          title=\CONTEXT\ Style File,
5%D       subtitle=get rid of math,
6%D         author=Hans Hagen & MIkael Sundqvist,
7%D           date=\currentdate,
8%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9%C
10%C This module is part of the \CONTEXT\ macro||package and is
11%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12%C details.
13
14%D This is a prelude to \MLTX\ and subjected to change or maybe even removal!
15
16\startmodule[math-goodriddance]
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     -- return nodes.nuts.pool.rule(1*65536,1*65536,1*65536)
51        return nil
52    end
53    nodes.tasks.appendaction("math", "finalizers", "noads.handlers.riddance", nil, "nut", "disabled")
54\stopluacode
55
56\stopmodule
57