Use new flag_save variants
This commit is contained in:
parent
3decacd033
commit
ffe3514b75
@ -22,7 +22,7 @@ lua.get_functions_table()[funcid] = function()
|
|||||||
until startmath == head or (startmath.id == math_t and startmath.subtype == 0)
|
until startmath == head or (startmath.id == math_t and startmath.subtype == 0)
|
||||||
if startmath == head then return end
|
if startmath == head then return end
|
||||||
assert(startmath.id == node.id"math")
|
assert(startmath.id == node.id"math")
|
||||||
store_column(startmath, true)
|
store_column(startmath)
|
||||||
end
|
end
|
||||||
|
|
||||||
local funcid = luatexbase.new_luafunction'__luamml_amsmath_add_box_to_row:'
|
local funcid = luatexbase.new_luafunction'__luamml_amsmath_add_box_to_row:'
|
||||||
@ -33,7 +33,7 @@ lua.get_functions_table()[funcid] = function()
|
|||||||
local boxnum = 0
|
local boxnum = 0
|
||||||
local startmath = tex.box[boxnum].list
|
local startmath = tex.box[boxnum].list
|
||||||
assert(startmath.id == math_t)
|
assert(startmath.id == math_t)
|
||||||
store_column(startmath, true)
|
store_column(startmath)
|
||||||
end
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
|
@ -3,12 +3,11 @@ local if_vertical = token.create'ifv@'
|
|||||||
local if_horizontal = token.create'ifh@'
|
local if_horizontal = token.create'ifh@'
|
||||||
local iftrue_index = token.create'iftrue'.index
|
local iftrue_index = token.create'iftrue'.index
|
||||||
|
|
||||||
local funcid = luatexbase.new_luafunction'__luamml_kernel_finalize_phantom:N'
|
local funcid = luatexbase.new_luafunction'__luamml_kernel_finalize_phantom:'
|
||||||
token.set_lua('__luamml_kernel_finalize_phantom:N', funcid, 'protected')
|
token.set_lua('__luamml_kernel_finalize_phantom:', funcid, 'protected')
|
||||||
lua.get_functions_table()[funcid] = function()
|
lua.get_functions_table()[funcid] = function()
|
||||||
-- TODO: Error handling etc
|
-- TODO: Error handling etc
|
||||||
-- At this point, box 0 contains the inner expression and the curent list ends with the noad whose nucleus should get replaced
|
-- At this point, box 0 contains the inner expression and the curent list ends with the noad whose nucleus should get replaced
|
||||||
local size = token.scan_int()//2
|
|
||||||
local boxnum = 0
|
local boxnum = 0
|
||||||
local startmath = tex.box[boxnum].list
|
local startmath = tex.box[boxnum].list
|
||||||
assert(startmath.id == node.id"math")
|
assert(startmath.id == node.id"math")
|
||||||
@ -22,16 +21,6 @@ lua.get_functions_table()[funcid] = function()
|
|||||||
local saved_props = assert(properties[startmath])
|
local saved_props = assert(properties[startmath])
|
||||||
local saved_core = saved_props.saved_mathml_core
|
local saved_core = saved_props.saved_mathml_core
|
||||||
local saved = assert(saved_props.saved_mathml_table or saved_core)
|
local saved = assert(saved_props.saved_mathml_table or saved_core)
|
||||||
if saved[0] == 'mstyle'
|
|
||||||
and (not saved.displaystyle or saved.displaystyle == (size == 0))
|
|
||||||
and (not saved.scriptlevel or saved.scriptlevel == (size == 0 and 0 or size-1))
|
|
||||||
then
|
|
||||||
saved[0], saved.displaystyle, saved.scriptlevel = 'mphantom', nil, nil
|
|
||||||
elseif saved[0] == 'mrow' then
|
|
||||||
saved[0] = 'mphantom'
|
|
||||||
else
|
|
||||||
saved = {[0] = 'mphantom', saved}
|
|
||||||
end
|
|
||||||
-- The following could be optimized for the case that both if_vertical and if_horizontal
|
-- The following could be optimized for the case that both if_vertical and if_horizontal
|
||||||
-- are set, but that should't happen ayway and is just supported for consistency.
|
-- are set, but that should't happen ayway and is just supported for consistency.
|
||||||
if if_vertical.index ~= iftrue_index then
|
if if_vertical.index ~= iftrue_index then
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
\m@th
|
\m@th
|
||||||
\displaystyle
|
\displaystyle
|
||||||
{##}
|
{##}
|
||||||
\luamml_flag_save:N \displaystyle
|
\luamml_flag_save:Nn \displaystyle {mtd}
|
||||||
$
|
$
|
||||||
\__luamml_amsmath_add_last_to_row:
|
\__luamml_amsmath_add_last_to_row:
|
||||||
\tabskip \z@skip
|
\tabskip \z@skip
|
||||||
@ -48,7 +48,7 @@
|
|||||||
{}
|
{}
|
||||||
##
|
##
|
||||||
}
|
}
|
||||||
\luamml_flag_save:N \displaystyle
|
\luamml_flag_save:Nn \displaystyle {mtd}
|
||||||
$
|
$
|
||||||
\__luamml_amsmath_add_last_to_row:
|
\__luamml_amsmath_add_last_to_row:
|
||||||
\hfil
|
\hfil
|
||||||
@ -79,7 +79,7 @@
|
|||||||
\ifmeasuring@
|
\ifmeasuring@
|
||||||
\luamml_flag_ignore:
|
\luamml_flag_ignore:
|
||||||
\else
|
\else
|
||||||
\luamml_flag_save:N \displaystyle
|
\luamml_flag_save:Nn \displaystyle {mtd}
|
||||||
\fi
|
\fi
|
||||||
$
|
$
|
||||||
}
|
}
|
||||||
@ -103,7 +103,7 @@
|
|||||||
\ifmeasuring@
|
\ifmeasuring@
|
||||||
\luamml_flag_ignore:
|
\luamml_flag_ignore:
|
||||||
\else
|
\else
|
||||||
\luamml_flag_save:N \displaystyle
|
\luamml_flag_save:Nn \displaystyle {mtd}
|
||||||
\fi
|
\fi
|
||||||
$
|
$
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
} {
|
} {
|
||||||
\__luamml_array_init_col:
|
\__luamml_array_init_col:
|
||||||
\insert@column
|
\insert@column
|
||||||
\luamml_flag_save:
|
\luamml_flag_save:n {mtd}
|
||||||
\d@llarend
|
\d@llarend
|
||||||
\__luamml_array_finalize_col:w 0~
|
\__luamml_array_finalize_col:w 0~
|
||||||
}
|
}
|
||||||
@ -33,7 +33,7 @@
|
|||||||
} {
|
} {
|
||||||
\__luamml_array_init_col:
|
\__luamml_array_init_col:
|
||||||
\insert@column
|
\insert@column
|
||||||
\luamml_flag_save:
|
\luamml_flag_save:n {mtd}
|
||||||
\d@llarend
|
\d@llarend
|
||||||
\__luamml_array_finalize_col:w 1~
|
\__luamml_array_finalize_col:w 1~
|
||||||
}
|
}
|
||||||
@ -49,7 +49,7 @@
|
|||||||
} {
|
} {
|
||||||
\__luamml_array_init_col:
|
\__luamml_array_init_col:
|
||||||
\insert@column
|
\insert@column
|
||||||
\luamml_flag_save:
|
\luamml_flag_save:n {mtd}
|
||||||
\d@llarend
|
\d@llarend
|
||||||
\__luamml_array_finalize_col:w 2~
|
\__luamml_array_finalize_col:w 2~
|
||||||
}
|
}
|
||||||
|
@ -9,9 +9,9 @@
|
|||||||
\m@th
|
\m@th
|
||||||
#1
|
#1
|
||||||
{#2}
|
{#2}
|
||||||
\luamml_flag_save:
|
\luamml_flag_save:Nn #1 {mphantom}
|
||||||
$
|
$
|
||||||
}
|
}
|
||||||
\finph@nt
|
\finph@nt
|
||||||
\__luamml_kernel_finalize_phantom:N #1
|
\__luamml_kernel_finalize_phantom:
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@ local function store_get_row()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function store_column_xml(mml, display)
|
local function store_column_xml(mml, display)
|
||||||
|
if mml[0] ~= 'mtd' then
|
||||||
if display and mml[0] == 'mstyle' and mml.displaystyle == true then
|
if display and mml[0] == 'mstyle' and mml.displaystyle == true then
|
||||||
mml[0], mml.displaystyle, mml.scriptlevel = 'mtd', nil, nil
|
mml[0], mml.displaystyle, mml.scriptlevel = 'mtd', nil, nil
|
||||||
else
|
else
|
||||||
@ -28,15 +29,16 @@ local function store_column_xml(mml, display)
|
|||||||
end
|
end
|
||||||
mml = {[0] = 'mtd', mml}
|
mml = {[0] = 'mtd', mml}
|
||||||
end
|
end
|
||||||
|
end
|
||||||
table.insert(store_get_row(), mml)
|
table.insert(store_get_row(), mml)
|
||||||
return mml
|
return mml
|
||||||
end
|
end
|
||||||
|
|
||||||
local function store_column(startmath, display)
|
local function store_column(startmath)
|
||||||
local props = properties[startmath]
|
local props = properties[startmath]
|
||||||
if not props then return end
|
if not props then return end
|
||||||
local mml = props.saved_mathml_table or props.saved_mathml_core
|
local mml = props.saved_mathml_table or props.saved_mathml_core
|
||||||
if mml then return store_column_xml(mml, display) end
|
if mml then return store_column_xml(mml) end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function store_tag(xml)
|
local function store_tag(xml)
|
||||||
|
Loading…
Reference in New Issue
Block a user