5.1 Math Details

§ 5.1.1 Internal Math Representation

The XMath element is the container for the internal representation

The following attributes can appear on all XM* elements:

role

the grammatical role that this element plays

open, close

parenthese or delimiters that were used to wrap the expression represented by this element.

argopen, argclose, separators

delimiters on an function or operator (the first element of an XMApp) that were used to delimit the arguments of the function. The separators is a string of the punctuation characters used to separate arguments.

xml:id

a unique identifier to allow reference (XMRef) to this element.

Math Tags

The following tags are used for the intermediate math representation:

XMTok

represents a math token. It may contain text for presentation. Additional attributes are:

name

the name that represents the meaning of the token; this overrides the content for identifying the token.

omcd

the OpenMath content dictionary that the name belongs to.

font

the font to be used for presenting the content.

style

?

size

?

stackscripts

whether scripts should be stacked above/below the item, instead of the usual script position.

XMApp

represents the generalized application of some function or operator to arguments. The first child element is the operator, the remainig elements are the arguments. Additional attributes:

name

the name that represents the meaning of the construct as a whole.

stackscripts

?

XMDual

combines representations of the content (the first child) and presentation (the second child), useful when the two structures are not easily related.

XMHint

represents spacing or other apparent purely presentation material.

name

names the effect that the hint was intended to achieve.

style

?

XMWrap

serves to assert the expected type or role of a subexpression that may otherwise be difficult to interpret — the parser is more forgiving about these.

name

?

style

?

XMArg

serves to wrap individual arguments or subexpressions, created by structured markup, such as \frac. These subexpressions can be parsed individually.

rule

the grammar rule that this subexpression should match.

XMRef

refers to another subexpression,. This is used to avoid duplicating arguments when constructing an XMDual to represent a function application, for example. The arguments will be placed in the content branch (wrapped in an XMArg) while XMRef’s will be placed in the presentation branch.

idref

the identifier of the referenced math subexpression.