summaryrefslogtreecommitdiff
path: root/tex/context/modules/mkiv/x-asciimath.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2017-03-23 18:35:01 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2017-03-23 18:35:01 +0100
commit576286d4c1349c644bea833c99ec5364668ffc8a (patch)
treeddaa0e3880a084eb52cf0cc9658d5e2d59377392 /tex/context/modules/mkiv/x-asciimath.lua
parent1987348696a38821137cc579a986d37086b87404 (diff)
downloadcontext-576286d4c1349c644bea833c99ec5364668ffc8a.tar.gz
2017-03-23 17:26:00
Diffstat (limited to 'tex/context/modules/mkiv/x-asciimath.lua')
-rw-r--r--tex/context/modules/mkiv/x-asciimath.lua12
1 files changed, 11 insertions, 1 deletions
diff --git a/tex/context/modules/mkiv/x-asciimath.lua b/tex/context/modules/mkiv/x-asciimath.lua
index 927e1cd97..677d3519b 100644
--- a/tex/context/modules/mkiv/x-asciimath.lua
+++ b/tex/context/modules/mkiv/x-asciimath.lua
@@ -1274,6 +1274,15 @@ local function collapse_bars(t)
i = i + 1
end
if l then
+ -- problem: we can have a proper nesting
+local d = false
+for i=1,m do
+ if find(t[i],"\\left") then
+ d = true
+ break
+ end
+end
+if not d then
local tt = { s_lnothing } -- space fools final checker
local tm = 1
for i=1,m do
@@ -1290,6 +1299,7 @@ local function collapse_bars(t)
tt[tm] = s_rnothing -- space fools final checker
m = tm
t = tt
+end
elseif m < n then
for i=n,m+1,-1 do
t[i] = nil
@@ -1739,7 +1749,7 @@ collapse = function(t,level)
-- steps
t = collapse_matrices (t) if trace_detail then show_state(t,level,"matrices") end
t = collapse_bars (t) if trace_detail then show_state(t,level,"bars") end
-t = collapse_stupids (t) if trace_detail then show_state(t,level,"stupids") end
+ t = collapse_stupids (t) if trace_detail then show_state(t,level,"stupids") end
t = collapse_pairs (t) if trace_detail then show_state(t,level,"pairs") end
t = collapse_parentheses(t) if trace_detail then show_state(t,level,"parentheses") end
t = collapse_signs (t) if trace_detail then show_state(t,level,"signs") end