concrete-math.lfg /size: 6713 b    last modification: 2025-02-21 11:03
1local common  = fonts.goodies.load("common-math.lfg")
2local presets = common.mathematics.tweaks.presets
3
4return {
5    name = "concrete-math",
6    version = "1.00",
7    comment = "Goodies that complement concrete math.",
8    author = "Hans Hagen & Mikael Sundqvist",
9    copyright = "ConTeXt development team",
10    mathematics = {
11        parameters = {
12            DelimiterPercent               =  85,
13            DelimiterShortfall             = 400,
14            DelimiterDisplayPercent        =  90,
15            DelimiterDisplayShortfall      = 400,
16            DelimiterPercent               =  90,
17            DelimiterShortfall             = 400,
18            PrimeShiftUp                   = "1.2*SuperscriptShiftUp",
19            PrimeShiftUpCramped            = "1.2*SuperscriptShiftUp",
20            PrimeBaselineDropMax           = "0.5*SuperscriptBaselineDropMax",
21            RadicalDisplayStyleVerticalGap = "RadicalVerticalGap", --152, 75
22        },
23        tweaks = {
24            aftercopying = {
25                {
26                    tweak   = "fixprimes",
27                    factor  = 0.92,
28                },
29                {
30                    tweak = "fixintegrals",
31                },
32                presets.scripttocalligraphic { },
33                presets.rsfstoscript         { },
34                presets.rsfsuprighttoscript  { },
35                presets.moderntocalligraphic { },
36                presets.eulertocalligraphic  { },
37                presets.xitsarabic           { },
38                presets.fallbacks            { },
39                presets.moveitalics          { correct = true },
40                presets.moveintegrals        { factor = 1.5 },
41                presets.wipeitalics          { },
42                {
43                    tweak = "addcomposites",
44                },
45                {
46                    tweak = "checkaccents",
47                },
48                {
49                    tweak = "kerns",
50                    list  = {
51                        [0x002F] = { topleft = -0.2, bottomright = -0.2 },
52                    },
53                },
54                {
55                    tweak = "kerns",
56                    list  = {
57                        [0x002F]                = { topleft  = -0.2,  bottomright = -0.2 },
58                        ["0x002F.variants.*"]   = { topleft  = -0.2,  bottomright = -0.2 },
59                        --
60                        [0x007D]                = { topright = -0.05, bottomright = -0.05 }, -- right brace variants
61                        ["0x7D.variants.*"]     = { topright = -0.25, bottomright = -0.25 }, -- right brace variants
62                        ["0x7D.parts.top"]      = { topright = -0.25,                     }, -- right brace top
63                        ["0x7D.parts.bottom"]   = {                   bottomright = -0.25 }, -- right brace bottom
64                        [0x0029]                = { topright = -0.15, bottomright = -0.15 }, -- right parenthesis variants
65                        ["0x29.variants.*"]     = { topright = -0.15, bottomright = -0.15 }, -- right parenthesis variants
66                        ["0x29.parts.top"]      = { topright = -0.15,                     }, -- right parenthesis top
67                        ["0x29.parts.bottom"]   = {                   bottomright = -0.15 }, -- right parenthesis bottom
68                        [0x221A]                = { topright =  0.2,  bottomright =  0.2  }, -- radical
69                        ["0x221A.variants.*"]   = { topright =  0.2,  bottomright =  0.2  },
70                        ["0x221A.parts.top"]    = { topright =  0.2,                      },
71                        ["0x221A.parts.bottom"] = {                   bottomright =  0.2  },
72                        [0x27E9]                = { topright = -0.1,  bottomright = -0.1  }, -- angle
73                        ["0x27E9.variants.*"]   = { topright = -0.3,  bottomright = -0.3  },
74                        [0x27EB]                = { topright = -0.1,  bottomright = -0.1  },
75                        ["0x27EB.variants.*"]   = { topright = -0.2,  bottomright = -0.2  },
76                        --
77                        [0x00393] = { bottomright = -0.30, }, -- upright Gamma
78                    },
79                },
80
81                {
82                    tweak = "dimensions",
83                    list  = {
84                        [0x00393] = { width = 0.875, }, -- upright Gamma
85                    },
86                },
87                {
88                    tweak = "extendaccents",
89                },
90                {
91                    tweak = "flattenaccents",
92                },
93                {
94                    tweak = "accentdimensions",
95                },
96                {
97                    tweak   = "radicaldegreeanchors",
98                    list = {
99                        ["0x221A.parts.bottom"] = { location = "left", hfactor  = .0, vfactor  = 1.075 },
100                    }
101                },
102                {
103                    tweak = "fixellipses",
104                },
105                {
106                    tweak   = "addbars",
107                    advance = 0.6,
108                },
109                {
110                    tweak    = "replacerules",
111                    -- minus = {
112                    --     leftoffset  = 0,
113                    --     rightoffset = 0,
114                    -- },
115                    minus    = true,
116                    fraction = { height = .2, yoffset = .8 },
117                    -- Hans, add option not to cut off first piece
118                    -- Hans, check height.
119                    radical  = { height = .2, yoffset = .585, leftoffset = .085, rightoffset = .085, leftoverlap = 0.03, yscale = 0.8 },
120                    -- radical  = { height = .2, yoffset = .75, leftoffset = .085, rightoffset = .085, leftoverlap = 0.039 },
121                    stacker  = { height = .2, yoffset = .8 },
122                },
123                {
124                    tweak = "addactuarian",
125                },
126                {
127                    tweak = "addequals",
128                },
129                {
130                    tweak = "addfourier",
131                    variant = 2,
132                },
133                {
134                    tweak   = "addprimed",
135                },
136                {
137                    tweak = "setoptions",
138                    set   = { "ignorekerndimensions" }
139                },
140                -- this is the mkiv section
141                {
142                    tweak   = "emulatelmtx",
143                    feature = "emulatelmtx",
144                    comment = "this is for mkiv",
145                },
146            },
147        },
148        bigslots = {
149            1, 2, 3, 4
150        },
151    },
152}
153
154