Skip to content

Commit

Permalink
feat(math): Print resulting mbox tree to debug log
Browse files Browse the repository at this point in the history
For example, “1   1 = 2” will print:

VBox(HBox(Text(atom=0, kind=number, script=1, text="1"), Text(atom=2,
kind=operator, script=1, text=" "), Text(atom=0, kind=number, script=1,
text="1"), Text(atom=3, kind=operator, script=1, text="="), Text(atom=0,
kind=number, script=1, text="2")))
  • Loading branch information
matteodelabre committed Jul 28, 2022
1 parent 7a7c6bc commit f2e7c33
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 0 additions & 1 deletion packages/math/base-elements.lua
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 811,6 @@ elements.text = pl.class({
end
end
for attribute,value in pairs(attributes) do
SU.debug("math", "attribute = " .. attribute .. ", value = " .. tostring(value))
self[attribute] = value
end
end,
Expand Down
6 changes: 4 additions & 2 deletions packages/math/typesetter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 37,6 @@ function ConvertMathML (_, content)
local attributes = {}
if syms.symbolDefaults[text] then
for attribute,value in pairs(syms.symbolDefaults[text]) do
SU.debug("math", "attribute = " .. attribute .. ", value = " .. tostring(value))
attributes[attribute] = value
end
end
Expand Down Expand Up @@ -111,8 110,11 @@ local function handleMath (_, mbox, mode)
else
SU.error('Unknown math mode '..mode)
end
mbox:styleDescendants()

if SU.debugging("math") then
SU.debug("math", "Resulting mbox: " .. tostring(mbox))
end
mbox:styleDescendants()
mbox:shapeTree()

if mode == "display" then
Expand Down

0 comments on commit f2e7c33

Please sign in to comment.