Expresso.Element.Math.Each (expresso v0.1.0)

Copy Markdown View Source

The parts of a formula that name each occurrence of a symbol

A part entity with each: "x" names each occurrence of x. An occurrence is a token element of the MathML, mi, mn or mo, with the text x. The scope is the part of within, or the part with the name of the entity in the short form, or else the whole formula. With bare: true, the base of a symbol with an index, such as the x of x_1, is not an occurrence. docs/each-occurrence.md gives the design.

The occurrence n of a set also gets the class set-n. A copy to a set thus becomes one copy for each occurrence, and Expresso.Element.Math.Links can take one occurrence as the source of a link.

Summary

Functions

Give each occurrence of each part with each the class of its part

Functions

place(math)

Give each occurrence of each part with each the class of its part

A named set keeps its name, and its occurrences get it as a class. In the short form, the name of the part is the name of its scope, so the part takes the name each-name, and its occurrences get that class. The occurrence n also gets the class name-n.

A copy to a set becomes one copy for each occurrence, with the target set-n and the name copy-n. A copy of a set to a set pairs the occurrences in order.

The function raises for a scope that the formula does not have, for a part with no occurrence, for a copy of a set to a set with a different number of occurrences, and for a copy of a copy to a set.