{ "spec": { "title": "MathML Core", "url": "https://w3c.github.io/mathml-core/" }, "algorithms": [ { "html": "Boxes used for MathML elements rely on several parameters in order to perform layout\n in a way that is compatible with CSS but also to take into account\n very accurate positions and spacing within math formulas:", "rationale": "block", "steps": [ { "html": "Inline metrics.\n min-content inline size,\n max-content inline size and\n inline size\n from CSS. See Figure 1.\n
\n \n
Figure 1 Generic Box Model for MathML elements
\n
" }, { "html": "

\n Block metrics.\n The block size,\n first baseline set\n and\n last baseline set.\n The following baselines are defined for MathML boxes:\n

\n \n \n Unless specified otherwise, the last baseline set is equal to the\n first baseline set for MathML boxes.", "ignored": [ "The alphabetic baseline which typically aligns with the bottom of uppercase Latin glyphs. The algebraic distance from the alphabetic baseline to the line-over edge of the box is called the line-ascent. The algebraic distance from the line-under edge to the alphabetic baseline of the box is called the line-descent. The mathematical baseline, also called math axis, which typically aligns with the fraction bar, middle of fences and binary operators. It is shifted away from the alphabetic baseline by AxisHeight towards the line-over. The ink-over baseline, indicating the line-over theorical limit of the math content drawn, excluding any extra space. If not specified, it is aligned with the line-over edge. The algebraic distance from the alphabetic baseline to the ink-over baseline is called the ink line-ascent. The ink-under baseline, indicating the line-under theorical limit of the math content drawn, excluding any extra space. If not specified, it is aligned with the line-under edge. The algebraic distance from the ink-under baseline to the alphabetic baseline is called the ink line-descent." ] }, { "html": "An optional italic correction\n which provides a measure of how much the text of a box is\n slanted along the inline axis.\n See Figure 2.\n
\n \n
Figure 2 Examples of italic correction for italic f and large integral
\n
\n If it is requested during calculation of\n min-content inline size and\n max-content inline size or during layout\n then 0 is used as a fallback value." }, { "html": "An optional top accent attachment\n which provides a reference offset on the\n inline axis of a box that should be used when\n positioning that box as an accent.\n See Figure 3.\n
\n \n
Figure 3 Example of top accent attachment for a circumflex accent
\n
\n If it is requested during calculation of\n min-content inline size\n (respectively max-content inline size) then half the\n min-content inline size (respectively max-content inline size) is used as a\n fallback value.\n If it is requested during layout then half the\n inline size of the box is used as a fallback value." } ] }, { "name": "embellished operator/core operator", "href": "https://w3c.github.io/mathml-core/#dfn-core-operator", "html": "The core operator of an embellished operator\n is the <mo> element defined recursively as\n follows:", "rationale": ".algorithm", "steps": [ { "html": "The core operator of an mo\n element; is the element itself." }, { "html": "The core operator of an embellished\n scripted element or\n mfrac\n element is the core operator of its first in-flow child." }, { "html": "The core operator of an embellished\n grouping element or mpadded\n is the core operator of its unique embellished operator\n in-flow child." } ] }, { "name": "algorithm for determining the form of an embellished operator", "href": "https://w3c.github.io/mathml-core/#dfn-algorithm-for-determining-the-form-of-an-embellished-operator", "html": "The algorithm for determining the form of an embellished operator is as follows:", "rationale": ".algorithm", "steps": [ { "html": "If the form attribute is present and valid\n on the core operator, then its\n ASCII lowercased value\n is used." }, { "html": "If the embellished operator is the first in-flow child of a\n grouping element,\n mpadded or\n msqrt with more than one in-flow child\n (ignoring all space-like children) then it has\n form prefix." }, { "html": "Or, if the embellished operator is the last in-flow child of\n a\n grouping element,\n mpadded or\n msqrt\n with more than one in-flow child\n (ignoring all space-like children) then it has\n form postfix." }, { "html": "Or, if the embellished operator is an in-flow child of a\n scripted element, other than the first in-flow\n child, then it has form postfix." }, { "html": "Otherwise, the embellished operator has form\n infix." } ] }, { "name": "algorithm for determining the properties of an embellished operator", "href": "https://w3c.github.io/mathml-core/#algorithm-for-determining-the-properties-of-an-embellished-operator", "html": "The algorithm for determining the properties of\n an embellished operator is as follows:", "rationale": ".algorithm", "steps": [ { "html": "If the corresponding\n stretchy,\n symmetric,\n largeop,\n movablelimits,\n lspace,\n rspace,\n maxsize or\n minsize\n attribute is present and valid\n on the core operator, then the\n ASCII lowercased value\n of this property is used." }, { "html": "Otherwise, run the algorithm for determining the form of an embellished operator." }, { "html": "If the core operator contains only text\n content Content, then set Category\n to the result of the\n algorithm to determine the category of an operator\n (Content, Form)\n where Form is the form\n calculated at the previous step." }, { "html": "If Category is Default and\n the form\n of embellished operator was not explicitly specified\n as an attribute on its core operator:", "rationale": "set", "steps": [ { "html": "Set Category to the result of the\n algorithm to determine the category of an operator\n (Content, Form) where Form is\n infix." }, { "html": "If Category is Default, then\n run the algorithm again with Form set to\n postfix." }, { "html": "If Category is Default, then\n run the algorithm again with Form set to\n prefix." } ] }, { "html": "Run the\n algorithm to set the properties of an operator from its\n category Category." } ] }, { "html": "Operators are laid out as follows:", "rationale": ".algorithm", "steps": [ { "html": "If the content of the <mo> element is not\n made\n of a single character c then fall back to the\n layout algorithm of 3.2.1.1 Layout of <mtext>.\n If it is not possible to get a glyph corresponding to\n c given directionality dir, then\n fall back to the layout algorithm of 3.2.1.1 Layout of <mtext>.\n Otherwise, let g be the result of running\n get a glyph corresponding to c\n given directionality dir." }, { "html": "If the stretch axis of the operator is inline:", "rationale": "if", "steps": [ { "html": "If it is not possible to shape a stretchy glyph\n g in the inline direction with the\n first available font then fall back to the\n layout algorithm of 3.2.1.1 Layout of <mtext>." }, { "html": "The min-content inline size and\n max-content inline size of the math content\n are set to the one obtained by the layout algorithm of\n 3.2.1.1 Layout of <mtext>." }, { "html": "If there is not any\n inline stretch size constraint\n Tinline\n then\n fall back to the\n layout algorithm of 3.2.1.1 Layout of <mtext>." }, { "html": "The inline size and (ink) block metrics of the math content\n are given by algorithm to\n shape a stretchy glyph g to\n inline dimension Tinline." }, { "html": "The painting of the operator is performed by the\n algorithm\n to shape a stretchy glyph g\n stretched to inline dimension\n Tinline and\n at position determined by the previous box metrics." } ], "additional": [ { "html": "Otherwise, the stretch axis of the operator is\n block. The following steps are performed:", "rationale": "if", "steps": [ { "html": "If it is not possible to shape a stretchy glyph\n g in the block direction with the\n first available font then fall back to the\n layout algorithm of 3.2.1.1 Layout of <mtext>." }, { "html": "The min-content inline size and\n max-content inline size of the math content\n are set to the\n preferred inline size of a glyph stretched\n along the block axis." }, { "html": "If there is not any\n block stretch size constraint\n (Uascent, Udescent)\n then\n fall back to the\n layout algorithm of 3.2.1.1 Layout of <mtext>." }, { "html": "If the operator has the symmetric property\n then set the target sizes\n Tascent and\n Tdescent to\n Sascent and\n Sdescent respectively:\n \n\n Otherwise set them to\n Uascent and\n Udescent respectively." }, { "html": "Let minsize and maxsize\n be the minsize and maxsize properties on the\n operator. Percentage values are interpreted relative\n to the height of g.\n Let T =\n Tascent +\n Tdescent be the target size.\n If minsize < 0 then set minsize\n to 0.\n If maxsize < minsize then\n set maxsize to minsize.\n With 0 ≤ minsize ≤ maxsize:\n " }, { "html": "The inline size,\n ink line-ascent,\n ink line-descent,\n line-ascent and\n line-descent\n of the math content\n are obtained by the algorithm to\n shape a stretchy glyph g\n to block dimension\n Tascent +\n Tdescent.\n The inline size of the math content is the width of\n the stretchy glyph. The stretchy glyph is shifted\n towards the line-under by a value Δ so that its\n center aligns with the center of the target:\n the ink ascent of the math content is\n the ascent of the stretchy glyph − Δ\n and the ink descent of the math content is\n the descent of the stretchy glyph + Δ.\n These centers have coordinates \"½(ascent − descent)\"\n so Δ = [(ascent of stretchy glyph − descent of stretchy glyph) − (Tascent − Tdescent)] / 2." }, { "html": "The painting of the operator is performed by the\n algorithm to shape a stretchy glyph g\n stretched to block dimension\n Tascent +\n Tdescent\n and at position determined by the previous box metrics\n shifted by Δ towards the line-over." } ] } ] }, { "html": "If the operator has the largeop property and\n if math-style on\n the <mo> element is normal,\n then:", "rationale": "if", "steps": [ { "html": "If it is not possible to shape a stretchy glyph\n g in the block direction with the\n first available font then fall back to the\n layout algorithm of 3.2.1.1 Layout of <mtext>." }, { "html": "The min-content inline size and\n max-content inline size of the math content\n are set to the preferred inline size of a glyph\n stretched along the block axis." }, { "html": "The inline size,\n ink line-ascent,\n ink line-descent,\n line-ascent and\n line-descent\n of the math content\n are obtained by the algorithm to\n shape a stretchy glyph g\n to block dimension\n DisplayOperatorMinHeight.\n The inline size of the math content is the width of\n the stretchy glyph. The stretchy glyph is shifted\n towards the line-under by a value Δ so that its\n center aligns with the center of the target when\n symmetric:\n the ink ascent of the math content is\n the ascent of the stretchy glyph − Δ\n and the ink descent of the math content is\n the descent of the stretchy glyph + Δ.\n " }, { "html": "The painting of the operator is performed by the\n algorithm to shape a stretchy glyph g\n stretched to block dimension\n DisplayOperatorMinHeight\n and at position determined by the previous box metrics\n shifted by Δ towards the line-over." } ] }, { "html": "Otherwise fall back to the\n layout algorithm of 3.2.1.1 Layout of <mtext>." } ] }, { "name": "algorithm for stretching operators along the block axis", "href": "https://w3c.github.io/mathml-core/#dfn-algorithm-for-stretching-operators-along-the-block-axis", "html": "The algorithm for stretching operators along the block axis\n consists in the following steps:", "rationale": ".algorithm", "steps": [ { "html": "If there is a block stretch size constraint\n or an inline stretch size constraint\n then the element being laid out is an\n embellished operator. Lay out the one in-flow child that\n is an embellished operator\n with the same stretch size constraint and\n all the other in-flow children\n without any stretch size constraint\n and stop." }, { "html": "Otherwise,\n split the list of in-flow children into a first list\n LToStretch containing\n embellished operators with\n a stretchy property and block stretch axis;\n and a second list LNotToStretch." }, { "html": "Perform layout without any stretch size constraint on\n all the items of LNotToStretch.\n If LToStretch is empty then stop.\n If LNotToStretch is empty, perform\n layout with block stretch size constraint\n (0, 0) for\n all the items of LToStretch." }, { "html": "Calculate the unconstrained target sizes\n Uascent\n and Udescent as respectively the maximum\n ink ascent and maximum ink descent of the margin boxes of\n in-flow children that\n have been laid out in the previous step." }, { "html": "Lay out or relayout all the elements of\n LToStretch with\n block stretch size constraint\n (Uascent, Udescent)." } ] }, { "html": "The min-content inline size\n (respectively max-content inline size) are\n calculated using the following algorithm:", "rationale": ".algorithm", "steps": [ { "html": "Set add-space to true if\n the box corresponds to a math element\n or is not an\n embellished operator; and to false otherwise." }, { "html": "Set inline-offset to 0." }, { "html": "Set previous-italic-correction to 0." }, { "html": "For each in-flow child:", "rationale": "if", "steps": [ { "html": "If the child is not slanted, then increment\n inline-offset by\n previous-italic-correction." }, { "html": "If the child is an embellished operator\n and add-space is true then\n increment inline-offset by\n its lspace property." }, { "html": "Increment inline-offset by\n the min-content inline size\n (respectively max-content inline size) of\n the child's margin box." }, { "html": "If the child is slanted then\n set previous-italic-correction to\n its italic correction. Otherwise set it to 0." }, { "html": "If the child is an embellished operator\n and add-space is true then\n increment inline-offset by\n its rspace property." } ] }, { "html": "Increment inline-offset by\n previous-italic-correction." }, { "html": "Return inline-offset." } ] }, { "html": "The in-flow children are positioned using the following\n algorithm:", "rationale": ".algorithm", "steps": [ { "html": "Set add-space to true if\n the box corresponds to a math element\n or is not an\n embellished operator; and to false otherwise." }, { "html": "Set inline-offset to 0." }, { "html": "Set previous-italic-correction to 0." }, { "html": "For each in-flow child:", "rationale": "if", "steps": [ { "html": "If the child is not slanted, then increment\n inline-offset by\n previous-italic-correction." }, { "html": "If the child is an embellished operator\n and add-space is true then\n increment inline-offset by\n its lspace property." }, { "html": "Set the inline offset of the child\n to inline-offset and its block offset such\n that the alphabetic baseline of the child is aligned with the alphabetic baseline." }, { "html": "Increment inline-offset by\n the inline size of the child's margin box." }, { "html": "If the child is slanted then\n set previous-italic-correction to\n its italic correction. Otherwise set it to 0." }, { "html": "If the child is an embellished operator\n and add-space is true then\n increment inline-offset by\n its rspace property." } ] } ] }, { "html": "SubSuperGap is the gap between the two scripts\n along the block axis and is defined by\n (SubShift − the ink line-ascent of the msubsup subscript's\n margin box) +\n (SuperShift − the ink line-descent of the\n msubsup superscript's margin box).\n If SubSuperGap is not at least\n SubSuperscriptGapMin then the following steps are\n performed to ensure that the condition holds:", "rationale": ".algorithm", "steps": [ { "html": "Let Δ be SuperscriptBottomMaxWithSubscript\n − (SuperShift − the ink line-descent of the\n msubsup superscript's margin box).\n If Δ > 0 then set Δ to the minimum between Δ set\n SubSuperscriptGapMin − SubSuperGap and\n increase SuperShift (and so\n SubSuperGap too) by Δ." }, { "html": "Let Δ be SubSuperscriptGapMin − SubSuperGap.\n If Δ > 0 then\n increase SubscriptShift (and so\n SubSuperGap too) by Δ." } ] }, { "name": "algorithm for stretching operators along the inline axis", "href": "https://w3c.github.io/mathml-core/#dfn-algorithm-for-stretching-operators-along-the-inline-axis", "html": "The algorithm for stretching operators along the inline\n axis\n is as follows.", "rationale": ".algorithm", "steps": [ { "html": "If there is an\n inline stretch size constraint or\n block stretch size constraint\n then the element being laid out is an\n embellished operator. Lay out the base\n with the same stretch size constraint." }, { "html": "Split the list of in-flow children that have not been\n laid out yet into a first list\n LToStretch containing\n embellished operators with\n a stretchy property and inline stretch axis;\n and a second list LNotToStretch." }, { "html": "Perform layout without any stretch size constraint on\n all the items of LNotToStretch.\n If LToStretch is empty then stop.\n If LNotToStretch is empty, perform\n layout with inline stretch size constraint 0 for\n all the items of LToStretch." }, { "html": "Calculate the target size T to\n the maximum inline size of the\n margin boxes of child boxes that have been laid out in the\n previous step." }, { "html": "Lay out or relayout all the elements of\n LToStretch\n with inline stretch size constraint T." } ] }, { "html": "Parameters\n UnderShift and UnderExtraDescender\n are determined by considering three cases in the following order:", "rationale": "/^otherwise(\\,| )/i", "steps": [ { "html": "

\n The munder base is an\n embellished operator with the\n largeop property.\n UnderShift is the maximum of\n

\n \n

\n UnderExtraDescender is 0.\n

" }, { "html": "

\n The munder base is an\n embellished operator with the\n stretchy property\n and stretch axis inline.\n UnderShift is the maximum of:\n

\n \n UnderExtraDescender is 0." }, { "html": "Otherwise,\n UnderShift is equal to UnderbarVerticalGap\n if the accentunder attribute is not an\n ASCII case-insensitive match to true\n and to zero otherwise.\n UnderExtraAscender is\n UnderbarExtraDescender." } ] }, { "html": "Parameters\n OverShift and OverExtraDescender\n are determined by considering three cases in the following order:", "rationale": "/^otherwise(\\,| )/i", "steps": [ { "html": "

\n The mover base is an\n embellished operator with the\n largeop property.\n OverShift is the maximum of\n

\n \n

\n OverExtraAscender is 0.\n

" }, { "html": "

\n The mover base is an\n embellished operator with the\n stretchy property and\n stretch axis inline.\n OverShift is the maximum of:\n

\n \n OverExtraDescender is 0." }, { "html": "

\n Otherwise, OverShift is equal to

\n \n

\n OverExtraAscender is OverbarExtraAscender.\n

", "ignored": [ "OverbarVerticalGap if the accent attribute is not an ASCII case-insensitive match to true. Or AccentBaseHeight minus the line-ascent of the mover base's margin box if this difference is nonnegative. Or 0 otherwise." ] } ] }, { "html": "The inline size of the math content\n is calculated with the following algorithm:", "rationale": ".algorithm", "steps": [ { "html": "Set inline-offset to 0." }, { "html": "

\n For each subscript/superscript pair of\n mmultiscripts prescripts, increment\n inline-offset by SpaceAfterScript + the\n maximum of\n

\n " }, { "html": "Increment inline-offset by the inline size of the\n mmultiscripts base's margin box and\n set inline-size to inline-offset." }, { "html": "

\n For each subscript/superscript pair of\n mmultiscripts postscripts, modify\n inline-size to be at least:\n

\n \n

Increment inline-offset to the maximum of:

\n \n

\n Increment inline-offset by\n SpaceAfterScript.\n

" }, { "html": "Return inline-size." } ] }, { "html": "Finally, the placement of the in-flow children is performed using\n the\n following algorithm:", "rationale": ".algorithm", "steps": [ { "html": "Set inline-offset to 0." }, { "html": "For each subscript/superscript pair of\n mmultiscripts prescripts:", "rationale": "increment", "steps": [ { "html": "Increment inline-offset by\n SpaceAfterScript." }, { "html": "Set pair-inline-size to the maximum of\n " }, { "html": "Place the subscript at inline-start position\n inline-offset + pair-inline-size\n − the inline size of the subscript's margin box." }, { "html": "Place the superscript at inline-start position\n inline-offset + pair-inline-size\n − the inline size of the superscript's margin box." }, { "html": "Place the subscript (respectively superscript) so its\n alphabetic baseline is\n shifted away from the alphabetic baseline by\n SubShift (respectively SuperShift)\n towards the line-under (respectively line-over)." }, { "html": "Increment inline-offset by\n pair-inline-size." } ] }, { "html": "Place the mmultiscripts base\n and <mprescripts> boxes\n at inline offsets\n inline-offset and with their alphabetic baselines\n aligned with the alphabetic baseline." }, { "html": "For each subscript/superscript pair of\n mmultiscripts postscripts:", "rationale": "set", "steps": [ { "html": "Set pair-inline-size to the maximum of\n " }, { "html": "Place the subscript\n at inline-start position inline-offset\n − LargeOpItalicCorrection." }, { "html": "Place the superscript\n at inline-start position inline-offset\n + ItalicCorrection." }, { "html": "Place the subscript (superscript) so its alphabetic baseline is\n shifted away from the alphabetic baseline by\n SubShift (respectively SuperShift)\n towards the line-under (respectively line-over)." }, { "html": "Increment inline-offset by\n pair-inline-size." }, { "html": "Increment inline-offset by\n SpaceAfterScript." } ] } ] }, { "name": "mathmlanchorelement-href-getter", "html": "The href getter steps are:", "rationale": ".algorithm", "steps": [ { "html": "Reinitialize url." }, { "html": "Let url be this's url." }, { "html": "If url is null and this has no href content attribute, then return the empty string." }, { "html": "Otherwise, if url is null, then return this's href content attribute's value." }, { "html": "Return url, serialized." } ] }, { "name": "set the url", "href": "https://w3c.github.io/mathml-core/#dfn-set-the-url", "html": "The set the url algorithm for a MathMLAnchorElement are:", "rationale": ".algorithm", "steps": [ { "html": "If this element's href content attribute is absent, then return." }, { "html": "Let url be the result of encoding-parsing a URL given this element's href content attribute's value, relative to this element's node document." }, { "html": "If url is not failure, then set this's url to url." } ] }, { "html": "If the specified value of \n font-size\n is math then the\n computed value of\n font-size\n is obtained by multiplying the inherited value of\n font-size\n by a nonzero scale factor calculated by the\n following procedure:", "rationale": ".algorithm", "steps": [ { "html": "Let A be the inherited math-depth value,\n B the computed math-depth value,\n C be 0.71 and S be 1.0" }, { "html": "" }, { "html": "Let E be B - A, which is positive." }, { "html": "If the inherited first available font has an OpenType MATH table:\n " }, { "html": "Multiply S by CE." }, { "html": "Return S if InvertScaleFactor is false and 1/S otherwise." } ] }, { "name": "shaping of the glyph assembly", "href": "https://w3c.github.io/mathml-core/#dfn-shaping-of-the-glyph-assembly", "html": "The shaping of the glyph assembly\n is performed with the following algorithm:", "rationale": ".algorithm", "steps": [ { "html": "Calculate rmin and\n omax." }, { "html": "Set (x, y) to (0, 0),\n RepetitionCounter to 0 and\n PartIndex to -1." }, { "html": "Repeat the following steps:", "rationale": "if", "steps": [ { "html": "If RepetitionCounter is 0:", "rationale": "increment", "steps": [ { "html": "Increment PartIndex." }, { "html": "If PartIndex is\n GlyphAssembly.partCount\n then stop." }, { "html": "Otherwise, set\n Part to\n GlyphAssembly.partRecords[PartIndex].\n Set RepetitionCounter to\n rmin if\n Part is an extender and to 1 otherwise." } ] }, { "html": "" }, { "html": "Decrement RepetitionCounter." } ] } ] }, { "name": "preferred inline size of a glyph stretched along the block axis", "href": "https://w3c.github.io/mathml-core/#dfn-preferred-inline-size-of-a-glyph-stretched-along-the-block-axis", "html": "The preferred inline size of a glyph stretched along the block\n axis\n is calculated using the following algorithm:", "rationale": ".algorithm", "steps": [ { "html": "Set S to the glyph's advance width." }, { "html": "If there is a MathGlyphConstruction table\n in the MathVariants.vertGlyphConstructionOffsets\n table for the given glyph:", "rationale": "for", "steps": [ { "html": "For each MathGlyphVariantRecord in\n MathGlyphConstruction.mathGlyphVariantRecord,\n ensure that S is at least\n the advance width of the glyph of id\n MathGlyphVariantRecord.variantGlyph." }, { "html": "If there is valid GlyphAssembly subtable,\n then ensure\n that S is at least the\n glyph assembly width." } ] }, { "html": "Return S." } ] }, { "name": "shape a stretchy glyph", "href": "https://w3c.github.io/mathml-core/#dfn-shape-a-stretchy-glyph", "html": "The algorithm to shape a stretchy glyph to inline\n (respectively block) dimension T\n is the following:", "rationale": ".algorithm", "steps": [ { "html": "If there is not any MathGlyphConstruction table\n in the MathVariants.horizGlyphConstructionOffsets\n table (respectively\n MathVariants.vertGlyphConstructionOffsets table)\n for the given glyph then exit with failure." }, { "html": "If the glyph's advance width\n (respectively height) is at least T\n then use normal shaping and bounding box for that glyph,\n the MathItalicsCorrectionInfo for that glyph as\n italic correction and exit with success." }, { "html": "Browse the list of MathGlyphVariantRecord in\n MathGlyphConstruction.mathGlyphVariantRecord.\n If one MathGlyphVariantRecord.advanceMeasurement\n is at least T then use\n normal shaping and bounding box\n for MathGlyphVariantRecord.variantGlyph,\n the MathItalicsCorrectionInfo for that glyph as\n italic correction and exit with success." }, { "html": "If there is valid GlyphAssembly subtable\n then use the bounding box given by\n glyph assembly width,\n glyph assembly height,\n glyph assembly ascent,\n glyph assembly descent, the value\n GlyphAssembly.italicsCorrection as italic\n correction, perform shaping of the glyph assembly and\n exit with success." }, { "html": "If none of the stretch options above allowed to cover the target\n size T, then choose last one that was tried and exit\n with success." } ] }, { "name": "algorithm to determine the category of an operator", "href": "https://w3c.github.io/mathml-core/#dfn-algorithm-to-determine-the-category-of-an-operator", "html": "The algorithm to determine the category of an operator\n (Content, Form) is as folllows:", "rationale": ".algorithm", "steps": [ { "html": "If Content as an UTF-16 string does not have length\n or 1 or 2 then exit with category Default." }, { "html": "If Content is a single character in the\n range U+0320–U+03FF\n then exit with category Default. Otherwise,\n if it has two characters:\n " }, { "html": "If Form is infix and Content corresponds\n to one of U+007C VERTICAL LINE or U+223C TILDE OPERATOR then exit\n with category ForceDefault. If the category of\n (Content, Form)\n provided by table\n Figure 25\n has N/A encoding in table\n Figure 26\n (namely if it has category L or M), then\n exit with that category.\n Otherwise:\n " } ] } ] }