MathML 标准符合性

Antenna House Formatter V7.5 利用其自主开发的引擎,能够渲染 W3C 所定义的 Mathematical Markup Language (MathML) Version 3.0 2nd Edition(PDF 版本)。因此,可以在 PDF 中渲染高分辨率的图像。若要了解如何利用 MathML,另请参阅图形。另请参阅选项设置文件。

Antenna House Formatter V7.5 Lite 的客户必须购买“Antenna House Formatter MathML Option”才能原生渲染 MathML。有关详细信息,另请参阅 Antenna House 网站。

下表列出了已实现的 MathML 元素和属性。

  • 列表中的 [是] 表示该元素或属性已实现。
  • [部分] 表示该元素或属性部分实现。
  • [否] 表示未实现。

表现标记

元素属性条件备注
2.1.6 id 是会对以下 CSS 属性求值:
  • font-family
  • font-weight
  • font-style
  • font-size
  • color
  • background-color
对于 id 和 class,将反映外部 CSS 的设置。该设置优先于同一标签内所指定的 mathvariant、fontfamily 等设置。在 CSS 中,指定给 <math> 的 CSS 属性即使未在上面列出,也会作为图像的属性进行求值。
class 是
style 是
href 是超链接不起作用。
xref 否
other 否 [已弃用的属性]
2.2 <math> 是 xmlns="http://www.w3.org/1998/Math/MathML"
display 是可以在选项设置文件中更改默认值。
maxwidth 是
overflow 部分仅实现 linebreak。除 linebreak 外,不会发生自动换行,而是行溢出。已扩展为可接受 none 值。该情况不会输出错误消息。
altimg 否忽略。
altimg-width 否忽略。
altimg-height 否忽略。
altimg-valign 否忽略。
alttext 是
cdgroup 否
macros 否 [已弃用的属性]
mode 是 [已弃用的属性] display 的设置优先。
3.1.10 mathcolor 是
mathbackground 是
3.2.1.2 <mglyph> 是
src 是仅支持 JPEG、PNG 等栅格图像。
width 是
height 是
valign 是
alt 是
fontfamily 是 [已弃用的属性] 指定 src 时无效。
index 是 [已弃用的属性] 指定 src 时无效。index 的值将被视为 GlyphID。
3.2.2 mathvariant 部分 不支持 initial、tailed、looped 和 stretched。
mathsize 是
dir 是 另请参阅 限制事项。
fontfamily 是 [已弃用的属性] 与 mathvariant 一起使用时,不保证效果。
fontweight 是 [已弃用的属性] 与 mathvariant 一起使用时,不保证效果。
fontstyle 是 [已弃用的属性] 与 mathvariant 一起使用时,不保证效果。
fontsize 是 [已弃用的属性] 与 mathsize 一起使用时,不保证效果。
color 是 [已弃用的属性] 与 mathcolor 一起使用时,不保证效果。
background 是 [已弃用的属性] 与 mathbackground 一起使用时,不保证效果。
3.2.3 <mi> 是虽然规范中并未写明 <mi>3</mi> 这样的数字不设为斜体,但参照众多实现的做法,该数字不会变为斜体。该限制可以在选项设置文件中调整。
3.2.4 <mn> 是
3.2.5 <mo> 是
form 是
lspace 是未注册到运算符字典时,可以在选项设置文件中更改默认值。
rspace 是未注册到运算符字典时,可以在选项设置文件中更改默认值。
fence 是
separator 否忽略。
stretchy 是 已扩展为可以用 stretchy="-0.2em" 这样的值指定带符号长度。请注意,不能指定无符号长度。指定带符号长度同时也意味着 true。通常字符会保持原有宽度等进行拉伸。通过为 stretchy 指定正长度,字符会向左右(或上下)两侧拉伸至所指定的长度;反之,通过为 stretchy 指定负长度,字符会收缩至所指定的长度。该长度受 minsize 和 maxsize 的限制影响。
symmetric 是
maxsize 是
minsize 是可以在选项设置文件中更改默认值。
largeop 是
movablelimits 是
accent 是
linebreak 是
lineleading 是默认值为 0。可以在选项设置文件中更改默认值。
linebreakstyle 是
linebreakmultchar 是
indentalign 是
indentshift 是
indenttarget 是当该属性所引用的 id 位于该属性之后,或处于不允许引用的位置时,不保证效果。
indentalignfirst 是
indentshiftfirst 是
indentalignlast 是
indentshiftlast 是
3.2.6 <mtext> 是
3.2.7 <mspace> 是 mathvariant、mathcolor 无效。
width 是
height 是
depth 是
linebreak 是 indentingnewline 已废止。虽然会被视为 newline,但缩进量可以在选项设置文件中指定,该值将被加到 indentshift 的值上。
indentalign 是
indentshift 是
indenttarget 是当该属性所引用的 id 位于该属性之后,或处于不允许引用的位置时,不保证效果。
indentalignfirst 是
indentshiftfirst 是
indentalignlast 是
indentshiftlast 是
3.2.8 <ms> 是可以在选项设置文件中更改转义字符。当 lquote 和 rquote 为空时,不执行转义处理。
lquote 是
rquote 是
3.3.1 <mrow> 是
dir 是
3.3.2 <mfrac> 是
linethickness 是
numalign 是
denomalign 是
bevelled 是
3.3.3 <msqrt> 是
3.3.3 <mroot> 是
3.3.4 <mstyle> 是
scriptlevel 是适用于 <math>。
displaystyle 是适用于 <math>。
scriptsizemultiplier 是适用于 <math>。可以在选项设置文件中更改默认值。
scriptminsize 是适用于 <math>。可以在选项设置文件中更改默认值。
infixlinebreakstyle 是适用于 <math>。
decimalpoint 是适用于 <math>。
任意属性 是适用于 <math>。接受以下内容:
accent accentunder align alignmentscope bevelled charalign charspacing close columnalign columnlines columnspacing columnspan columnwidth crossout denomalign depth dir edge equalcolumns equalrows fence form frame framespacing groupalign height indentalign indentalignfirst indentalignlast indentshift indentshiftfirst indentshiftlast indenttarget largeop leftoverhang length linebreak linebreakmultchar linebreakstyle lineleading linethickness location longdivstyle lquote lspace mathsize mathvariant maxsize minlabelspacing minsize movablelimits mslinethickness notation numalign open position rightoverhang rowalign rowlines rowspacing rowspan rquote rspace selection separator separators shift side stackalign stretchy subscriptshift superscriptshift symmetric valign width
这些是属于内部元素的相关属性的默认值。
veryverythinmathspace 是 [已弃用的属性]
verythinmathspace 是 [已弃用的属性]
thinmathspace 是 [已弃用的属性]
mediummathspace 是 [已弃用的属性]
thickmathspace 是 [已弃用的属性]
verythickmathspace 是 [已弃用的属性]
veryverythickmathspace 是 [已弃用的属性]
fontfamily 是 [已弃用的属性]
fontweight 是 [已弃用的属性]
fontstyle 是 [已弃用的属性]
fontsize 是 [已弃用的属性]
color 是 [已弃用的属性]
background 是 [已弃用的属性]
3.3.5 <merror> 是 可以在选项设置文件中指定显示样式。
3.3.6 <mpadded> 是
width 是
height 是
depth 是
lspace 是
voffset 是
3.3.7 <mphantom> 是
3.3.8 <mfenced> 是
open 是
close 是
separators 是
3.3.9 <menclose> 是
notation 部分 未实现 *arrow 和 madruwb。circle 将内接于边界矩形。可以通过 选项设置文件 更改为使圆外接。已扩展为可以用 circumscribed-circle 显式表示外接圆,用 inscribed-circle 显式表示内接圆。
3.4.1 <msub> 是
subscriptshift 是
3.4.2 <msup> 是
superscriptshift 是
3.4.3 <msubsup> 是
subscriptshift 是
superscriptshift 是
3.4.4 <munder> 是
accentunder 是
align 是
3.4.5 <mover> 是
accent 是
align 是
3.4.6 <munderover> 是
accent 是
accentunder 是
align 是
3.4.7 <mmultiscripts> 是
3.4.7 <mprescripts> 是
3.4.7 <none> 是
3.5.1 <mtable> 是
align 是
rowalign 是
columnalign 是
groupalign 是
alignmentscope 否
columnwidth 是
width 是
rowspacing 是 可以在选项设置文件中更改默认值。
columnspacing 是 可以在选项设置文件中更改默认值。
rowlines 是
columnlines 是
frame 是
framespacing 是 已扩展为可以指定三个框间距长度。第三个长度可以省略;指定时,它表示指定了 frame="none" 处的左/右间距。可以在选项设置文件中更改默认值。
equalrows 是
equalcolumns 是
displaystyle 是
side 是
minlabelspacing 是
3.5.2 <mtr> 是
rowalign 是
columnalign 是
groupalign 是
3.5.3 <mlabeledtr> 是
3.5.4 <mtd> 是
rowspan 是
columnspan 是如果某单元格的 columnspan 大于 1,则 <maligngroup> 将被忽略。
rowalign 是
columnalign 是
groupalign 是
3.5.5 <maligngroup> 是如果 <maligngroup> 不在 <mtd> 内部,则 <maligngroup> 将被忽略。
groupalign 是
3.5.5 <malignmark> 是如果 <malignmark> 不在 <mtd> 内部,则 <malignmark> 将被忽略。
edge 是
3.6.1 <mstack> 是
align 是
stackalign 是
charalign 是
charspacing 是与 tight、medium 和 loose 相对应的间距可以在选项设置文件中指定。不执行间距的自动调整。
3.6.2 <mlongdiv> 是当除数或结果中不包含 <msrow> 时,视为错误。也可以将 <mscarries> 应用于除数、被除数和结果。
longdivstyle 是
3.6.3 <msgroup> 是
position 是 对于 <mlongdiv> 的除数,position 会被忽略。此外,当 <mlongdiv> 的结果不位于被除数上时,position 也会被忽略。
shift 是
3.6.4 <msrow> 是
position 是 对于 <mlongdiv> 的除数,position 会被忽略。此外,当 <mlongdiv> 的结果不位于被除数上时,position 也会被忽略。
3.6.5 <mscarries> 是当 <msrow> 未跟在 <mscarries> 之后时,视为错误。
position 是
location 部分 对应 n、ne 和 nw。其他则视为 n。
crossout 是
scriptsizemultiplier 是
3.6.6 <mscarry> 是
location 部分 对应 n、ne 和 nw。其他则视为 n。
crossout 是
3.6.7 <msline> 是
position 是
length 是
leftoverhang 是
rightoverhang 是
mslinethickness 是
3.7.1 <maction> 是
actiontype 是指定 actiontype="toggle" 时,显示指定给 selection 的元素;其他情况下,仅显示第一个元素。
selection 是

内容标记

无法动态参照外部内容字典来改变外观。其显示不一定与 MathML3 规范的图示相同。

元素属性条件备注
4.2 encoding 否
definitionURL 否
4.2.1 <cn> 是
type 是
base 是
4.2.1 <sep> 是
4.2.2 <ci> 是
type 否忽略。
4.2.3 <csymbol> 部分
type 否
cd 否
4.2.4 <cs> 是
4.2.5 <apply> 是对于与运算符相对应的操作数的不足与过剩,可以通过用括号括住操作数并应用 <merror> 来调整外观。
4.2.6 <bind> 是
4.2.6 <bvar> 是
4.2.7 <share> 是仅支持对自身的引用,即 href="#id"。
src 否
4.2.9 <cerror> 是
4.2.10 <cbytes> 是
4.3.3.1 <domainofapplication> 是
4.3.3.1 <condition> 是
4.3.3.1 <lowlimit> 是
4.3.3.1 <uplimit> 是
4.3.3.2 <degree> 是
4.3.3.3 <momentabout> 是
4.3.3.3 <logbase> 是
4.4.1.1 <interval> 是
4.4.1.2 <inverse> 是
4.4.1.3 <lambda> 是
4.4.1.4 <compose> 是
4.4.1.5 <ident> 是
4.4.1.6 <domain> 是
4.4.1.7 <codomain> 是
4.4.1.8 <image> 是
4.4.1.9 <piecewise> 是
4.4.1.9 <piece> 是
4.4.1.9 <otherwise> 是
4.4.2.1 <quotient> 是
4.4.2.2 <factorial> 是
4.4.2.3 <divide> 是
4.4.2.4 <max> 是
4.4.2.5 <min> 是
4.4.2.6 <minus> 是
4.4.2.7 <plus> 是虽然规范中没有一元“+”,但允许以下写法:
<apply>
 <plus/>
 <ci>x</ci>
</apply>
4.4.2.8 <power> 是
4.4.2.9 <rem> 是
4.4.2.10 <times> 是通常使用 U+2062 (&InvisibleTimes;),但当第二个操作数为 <cn> 时,则按如下方式使用 U+00D7 (&times;):
<apply>
 <times/>
 <cn>1</cn>
 <cn>7</cn>
</apply>
4.4.2.11 <root> 是
4.4.2.12 <gcd> 是
4.4.2.13 <and> 是
4.4.2.14 <or> 是
4.4.2.15 <xor> 是
4.4.2.16 <not> 是
4.4.2.17 <implies> 是
4.4.2.18 <forall> 是
4.4.2.19 <exists> 是
4.4.2.20 <abs> 是
4.4.2.21 <conjugate> 是
4.4.2.22 <arg> 是
4.4.2.23 <real> 是
4.4.2.24 <imaginary> 是
4.4.2.25 <lcm> 是
4.4.2.26 <floor> 是
4.4.2.27 <ceiling> 是
4.4.3.1 <eq> 是
4.4.3.2 <neq> 是
4.4.3.3 <gt> 是
4.4.3.4 <lt> 是
4.4.3.5 <geq> 是
4.4.3.6 <leq> 是
4.4.3.7 <equivalent> 是
4.4.3.8 <approx> 是按照 MathML2 规范或 TeX 使用 U+2248 (&TildeTilde;),而 MathML3 规范中使用的是 U+2243 (&TildeEqual;)。
4.4.3.9 <factorof> 是
4.4.4.1 <int> 是
4.4.4.2 <diff> 是
4.4.4.3 <partialdiff> 是
4.4.4.4 <divergence> 是
4.4.4.5 <grad> 是
4.4.4.6 <curl> 是
4.4.4.7 <laplacian> 是
4.4.5.1 <set> 是
type 否忽略。
4.4.5.2 <list> 是
order 否忽略。
4.4.5.3 <union> 是
4.4.5.4 <intersect> 是
4.4.5.5 <in> 是
4.4.5.6 <notin> 是
4.4.5.7 <subset> 是
4.4.5.8 <prsubset> 是
4.4.5.9 <notsubset> 是
4.4.5.10 <notprsubset> 是
4.4.5.11 <setdiff> 是
4.4.5.12 <card> 是
4.4.5.13 <cartesianproduct> 是
4.4.6.1 <sum> 是
4.4.6.2 <product> 是
4.4.6.3 <limit> 是
4.4.6.4 <tendsto> 是
type 是
4.4.7.1 <sin> 是
4.4.7.1 <cos> 是
4.4.7.1 <tan> 是
4.4.7.1 <sec> 是
4.4.7.1 <csc> 是
4.4.7.1 <cot> 是
4.4.7.1 <sinh> 是
4.4.7.1 <cosh> 是
4.4.7.1 <tanh> 是
4.4.7.1 <sech> 是
4.4.7.1 <csch> 是
4.4.7.1 <coth> 是
4.4.7.1 <arcsin> 是
4.4.7.1 <arccos> 是
4.4.7.1 <arctan> 是
4.4.7.1 <arccosh> 是
4.4.7.1 <arccot> 是
4.4.7.1 <arccoth> 是
4.4.7.1 <arccsc> 是
4.4.7.1 <arccsch> 是
4.4.7.1 <arcsec> 是
4.4.7.1 <arcsech> 是
4.4.7.1 <arcsinh> 是
4.4.7.1 <arctanh> 是
4.4.7.2 <exp> 是
4.4.7.3 <ln> 是
4.4.7.4 <log> 是
4.4.8.1 <mean> 是
4.4.8.2 <sdev> 是
4.4.8.3 <variance> 是
4.4.8.4 <median> 是
4.4.8.5 <mode> 是
4.4.8.6 <moment> 是
4.4.9.1 <vector> 是
4.4.9.2 <matrix> 是
4.4.9.3 <matrixrow> 是
4.4.9.4 <determinant> 是
4.4.9.5 <transpose> 是
4.4.9.6 <selector> 是
4.4.9.7 <vectorproduct> 是
4.4.9.8 <scalarproduct> 是
4.4.9.9 <outerproduct> 是
4.4.10.1 <integers> 是
4.4.10.2 <reals> 是
4.4.10.3 <rationals> 是
4.4.10.4 <naturalnumbers> 是
4.4.10.5 <complexes> 是
4.4.10.6 <primes> 是
4.4.10.7 <exponentiale> 是
4.4.10.8 <imaginaryi> 是
4.4.10.9 <notanumber> 是
4.4.10.10 <true> 是
4.4.10.11 <false> 是
4.4.10.12 <emptyset> 是
4.4.10.13 <pi> 是
4.4.10.14 <eulergamma> 是
4.4.10.15 <infinity> 是
4.5.1 <declare> 否 [已弃用的元素] 忽略。
<reln> 是 [已弃用的元素]
<fn> 是 [已弃用的元素]

混合标记

元素属性条件备注
5.2.1 <semantics> 部分<semantics> 标签本身会被忽略。
5.2.2 <annotation> 否忽略。
5.2.3 <annotation-xml> 否忽略。

运算符字典

MathML 3.0 2nd Edition 中所记载的内容已按原样实现于运算符字典中。不过,还添加了以下运算符:

字符字形名称formprioritylspacerspace属性备注
U+FE37︷竖排左花括号的表现形式postfix88000stretchy, accent建议使用 U+23DE
U+FE38︸竖排右花括号的表现形式postfix88000stretchy, accent建议使用 U+23DF

运算符字典的内容可以通过选项设置文件调整。存在以下限制:

  • 不支持 priority。
  • separator 将被忽略。

可与选项设置文件一起使用的默认运算符字典存储在 OperatorDictionary.xml 中。Antenna House Formatter V7.5 不会引用该文件。建议提取并使用您想更改的运算符部分。

运算符字典的 DTD 如下所示:

<!ELEMENT operator-dictionary entry*>
<!ELEMENT entry EMPTY>
<!ATTLIST entry operator       CDATA #REQUIRED>
<!ATTLIST entry form           (prefix|infix|postfix) #REQUIRED>
<!ATTLIST entry priority       %integer; "0">
<!ATTLIST entry lspace         (0|1|2|3|4|5|6|7) "5">
<!ATTLIST entry rspace         (0|1|2|3|4|5|6|7) "5">
<!ATTLIST entry minsize        %length; #IMPLIED>
<!ATTLIST entry maxsize        %length: #IMPLIED>
<!ATTLIST entry accent         (false|true) "false">
<!ATTLIST entry fence          (false|true) "false">
<!ATTLIST entry separator      (false|true) "false">
<!ATTLIST entry stretchy       (false|true) "false">
<!ATTLIST entry symmetric      (false|true) "false">
<!ATTLIST entry largeop        (false|true) "false">
<!ATTLIST entry movablelimits  (false|true) "false">
<!ATTLIST entry linebreakstyle (before|after|duplicate) "before">

字符替换

在 MathML 中,部分输入字符会被替换后再处理。在 Antenna House Formatter V7.5 的情况下,字符按如下方式替换。

  • <mi>、<mn> 和 <mo> 内部的字符会被替换。例如:
    1. U+0027 U+0027 U+0027 U+0027 替换为 U+2057
    2. U+0027 U+0027 U+0027 替换为 U+2034
    3. U+0027 U+0027 替换为 U+2033
    4. U+0027 替换为 U+2032
    5. U+002D 替换为 U+2212
    分别如此。
  • 对于 <mtext> 等其他标签内部的字符,U+002D 替换为 U+2010。

可以通过 选项设置文件 使该替换无效。

字符实体引用

限制事项

  • 以下元素内部不会发生换行。

    • <mfrac>
    • <menclose>
    • <msub>
    • <msup>
    • <msubsup>
    • <munder>
    • <mover>
    • <munderover>
    • <mmultiscripts>
    • <msqrt>
    • <mroot>
    • <mstack>
    • <mlongdiv>

  • 以下元素内部不会发生自动换行。

    • <mtable>

  • 不支持阿拉伯语等复杂文字以及表情符号。

  • 指定 dir="rtl" 时,虽然会对区域执行水平反转处理,但行内推进方向上的反转、根号或 Σ 等不会被镜像。

  • <csymbol> 中有许多未实现。

  • <bvar> 中有许多实现方法不明。

  • 在 GUI 中显示 MathML 时,= 和 - 等符号的显示位置在某些字体中可能会垂直偏移。此时,请参阅限制事项了解 GUI 渲染的解决方法。PDF 输出等则没有问题。