math-frc.lmt /size: 2466 b    last modification: 2024-01-16 10:22
1if not modules then modules = { } end modules ['math-frc'] = {
2    version   = 1.001,
3    comment   = "companion to math-frc.mkiv",
4    author    = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
5    copyright = "PRAGMA ADE / ConTeXt Development Team",
6    license   = "see context related readme files"
7}
8
9-- obsolete
10--
11-- \def\math_frac_command_u
12--   {\clf_umathfraction % we can get this bakc to the tex end
13--      {\mathfractionparameter\c!rule}%
14--      \ifempty\p_math_fraction_fences
15--        \mathfractionparameter\c!left \space
16--        \mathfractionparameter\c!right\space
17--      \else
18--        \math_frac_no_delim\space
19--        \math_frac_no_delim\space
20--      \fi
21--      \dimexpr\mathfractionparameter\c!rulethickness\relax
22--      {\number\namedboxanchor{\mathfractionparameter\c!source}}%
23--    \relax}
24--
25-- local utfchar   = utf.char
26--
27-- local context   = context
28-- local variables = interfaces.variables
29--
30-- local v_no      = variables.no
31-- local v_yes     = variables.yes
32-- local v_hidden  = variables.hidden
33--
34-- local resolved  = {
35--     [0x007B] = "\\{",
36--     [0x007D] = "\\}",
37-- }
38--
39-- table.setmetatableindex(resolved, function(t,k)
40--     local v = utfchar(k)
41--     t[k] = v
42--     return v
43-- end)
44--
45-- local function umathfraction(how,left,right,width,source)
46--     source = tonumber(source) or 0
47--     if how == v_no then
48--         if left == 0x002E and right == 0x002E then
49--             context("\\Uatop source %i ",source)
50--         else
51--             context("\\Uatopwithdelims %s%s source %i ",resolved[left],resolved[right],source)
52--         end
53--     elseif how == v_yes or how == v_hidden then
54--         local norule = how == v_hidden and "norule" or ""
55--         if left == 0x002E and right == 0x002E then
56--             context("\\Uabove source %i %s %ssp",source,norule,width)
57--         else
58--             context("\\Uabovewithdelims %s%s source %i %s %ssp",resolved[left],resolved[right],source,norule,width)
59--         end
60--     else -- v_auto
61--         if left == 0x002E and right == 0x002E then
62--             context("\\Uover source %i ",source)
63--         else
64--             context("\\Uoverwithdelims %s%s source %i ",resolved[left],resolved[right],source)
65--         end
66--     end
67-- end
68--
69-- interfaces.implement {
70--     name      = "umathfraction",
71--     actions   = umathfraction,
72--     protected = true,
73--     arguments = { "string", "number", "number", "dimen", "string" }
74-- }
75