Home

Math Block

This is a block representation used in Stencila Schema for mathematical content.

It extends Math for displayed equations and other block-level mathematical expressions. This allows block math to share common math semantics while being rendered and serialized appropriately for block contexts.

Key properties are inherited from Math, especially the source math code, language or format, and compilation-related metadata.

Analogues

The following external types, elements, or nodes are similar to a MathBlock:

  • JATS <disp-formula>

  • Pandoc Math: Close Pandoc analogue for display math, though Pandoc distinguishes display mode via a subkind rather than a separate node type.

  • MDAST Math

Properties

The MathBlock type has these properties:

NameDescriptionTypeInherited from
labelA short label for the math block.String-
labelAutomaticallyWhether the label should be automatically updated.Boolean-
codeThe code of the equation in the mathLanguage.CordMath
mathLanguageThe language used for the equation e.g tex, mathml, asciimath.StringMath
authorsThe authors of the math.Author*Math
provenanceA summary of the provenance of the math.ProvenanceCount*Math
compilationDigestA digest of the code and mathLanguage.CompilationDigestMath
compilationMessagesMessages generated while parsing and compiling the math expression.CompilationMessage*Math
mathmlThe MathML transpiled from the code.StringMath
imagesImages of the math.ImageObject*Math
idThe identifier for this item.StringEntity

Related

The MathBlock type is related to these types:

  • Parents: Math

  • Children: none

Bindings

The MathBlock type is represented in:

Testing

During property-based (a.k.a generative) testing, the properties of the MathBlock type are generated using the following strategies.

PropertyComplexityDescriptionStrategy
codeMin+Generate a simple fixed string of math.Cord::from("math")
Low+Generate a random string of up to 10 alphanumeric characters (exclude whitespace which when leading or trailing causes issues for Markdown).r"[a-zA-Z0-9]{1,10}".prop_map(Cord::from)
High+Generate a random string of up to 100 characters (excluding control characters).r"[^\p{C}]{1,100}".prop_map(Cord::from)
MaxGenerate an arbitrary string.String::arbitrary().prop_map(Cord::from)
mathLanguageMin+Fixed as TeX (for testing with Markdown which uses dollars to delimit TeX by default)Some(String::from("tex"))
High+Generate a random string of up to 10 alphanumeric characters.option::of(r"[a-zA-Z0-9]{1,10}")
MaxGenerate an arbitrary string.option::of(String::arbitrary())

This documentation was generated from MathBlock.yaml by docs_types.rs.

© 2026 Stencila