diff --git a/packages/math/texlike.lua b/packages/math/texlike.lua index e9b25ae27..fd192c494 100644 --- a/packages/math/texlike.lua +++ b/packages/math/texlike.lua @@ -661,8 +661,9 @@ compileToMathML( % Phantom commands from TeX/LaTeX \def{phantom}{\mphantom{#1}} - \def{hphantom}{\mphantom[special=h]{#1}} - \def{vphantom}{\mphantom[special=v]{#1}} + \def{hphantom}{\mpadded[height=0, depth=0]{\mphantom{#1}}} + \def{vphantom}{\mpadded[width=0]{\mphantom{#1}}} + %\mphantom[special=v]{#1}}} ]==], }) ) diff --git a/packages/math/typesetter.lua b/packages/math/typesetter.lua index 2faab1cf4..aaf4b9e04 100644 --- a/packages/math/typesetter.lua +++ b/packages/math/typesetter.lua @@ -177,6 +177,10 @@ function ConvertMathML (_, content) -- It's an mrow, but with some style attributes that we ignore. SU.warn("MathML mstyle is not fully supported yet") return b.stackbox("H", convertChildren(content)) + elseif content.command == "mpadded" then + -- MathML Core 3.3.6.1: The element generates an anonymous box + -- called the "impadded inner box" + return b.padded(content.options, b.stackbox("H", convertChildren(content))) else SU.error("Unknown math command " .. content.command) end