summaryrefslogtreecommitdiff
path: root/tex/context/modules/mkiv/x-asciimath.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2018-06-22 16:42:14 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2018-06-22 16:42:14 +0200
commitda8162d4e816cf49d9790a1c81556b499f442bed (patch)
tree5c631b1fb8282670a6cea1087afa766a8b94db43 /tex/context/modules/mkiv/x-asciimath.lua
parent204057fdc5023b5f4ff55a69bc6593388ea427e7 (diff)
downloadcontext-da8162d4e816cf49d9790a1c81556b499f442bed.tar.gz
2018-06-22 16:02:00
Diffstat (limited to 'tex/context/modules/mkiv/x-asciimath.lua')
-rw-r--r--tex/context/modules/mkiv/x-asciimath.lua24
1 files changed, 22 insertions, 2 deletions
diff --git a/tex/context/modules/mkiv/x-asciimath.lua b/tex/context/modules/mkiv/x-asciimath.lua
index b0d45659e..677ab0ce5 100644
--- a/tex/context/modules/mkiv/x-asciimath.lua
+++ b/tex/context/modules/mkiv/x-asciimath.lua
@@ -132,6 +132,12 @@ local reserved = {
["overbar"] = { false, "\\overline", "unary" },
["overline"] = { false, "\\overline", "unary" },
["underline"] = { false, "\\underline", "unary" },
+ ["overbrace"] = { false, "\\overbrace", "unary" },
+ ["underbrace"]= { false, "\\underbrace", "unary" },
+ ["overset"] = { false, "\\overset", "unary" },
+ ["underset"] = { false, "\\underset", "unary" },
+ ["obrace"] = { false, "\\overbrace", "unary" },
+ ["ubrace"] = { false, "\\underbrace", "unary" },
["ul"] = { false, "\\underline", "unary" },
["vec"] = { false, "\\overrightarrow", "unary" },
["dot"] = { false, "\\dot", "unary" }, -- 0x2D9
@@ -143,6 +149,7 @@ local reserved = {
["-"] = { true, "-" },
["*"] = { true, "⋅" },
["**"] = { true, "⋆" },
+ ["////"] = { true, "⁄⁄" }, -- crap
["//"] = { true, "⁄" }, -- \slash
["\\"] = { true, "\\" },
["xx"] = { true, "×" },
@@ -749,11 +756,14 @@ end
reserved.P = nil
reserved.S = nil
+
local isbinary = {
["\\frac"] = true,
["\\root"] = true,
["\\asciimathroot"] = true,
["\\asciimathstackrel"] = true,
+ ["\\overset"] = true,
+ ["\\underset"] = true,
}
local isunary = { -- can be taken from reserved
@@ -772,6 +782,10 @@ local isunary = { -- can be taken from reserved
["\\dot"] = true, --
["\\ddot"] = true, --
+ ["\\overbrace"] = true,
+ ["\\underbrace"] = true,
+ ["\\obrace"] = true,
+ ["\\ubrace"] = true,
}
local isfunny = {
@@ -1715,8 +1729,14 @@ local function collapse_fractions_2(t)
while i < n do
local current = t[i]
if current == "⁄" and i > 1 then -- \slash
- t[m] = "{" .. s_left .. t[i-1] .. s_mslash .. t[i+1] .. s_right .. "}"
- i = i + 2
+ if i < n and t[i+1] == "⁄" then
+ -- crap for
+ t[m] = "{" .. s_left .. t[i-1] .. s_mslash .. s_mslash .. t[i+2] .. s_right .. "}"
+ i = i + 3
+ else
+ t[m] = "{" .. s_left .. t[i-1] .. s_mslash .. t[i+1] .. s_right .. "}"
+ i = i + 2
+ end
if i < n then
m = m + 1
t[m] = t[i]