Skip to main content

Module presentation

Module presentation 

Source
Expand description

Presentation MathML rendering rules.

Port of LaTeXML::Post::MathML::Presentation (146 lines) + the presentation portion of LaTeXML::Post::MathML (main module, ~1000 lines). Converts XMath nodes to Presentation MathML elements (mi, mo, mn, mrow, etc.).

Key concepts:

  • pmml(node) dispatches conversion by tag (XMTok, XMApp, XMDual, etc.)
  • stylizeContent(item, tag) determines text, mathvariant, size, spacing
  • Scripts (sub/sup/under/over) handle pre/mid/post positioning
  • Style context tracks display/text/script/scriptscript levels

Enums§

MathStyle
Math style levels.

Functions§

adjust_spacing
Walk the MathML tree and adjust spacing. Port of Perl adjust_spacing / space_walk (MathML.pm L1079-1133): resolves the difference between TeX’s inter-atom spacing and MathML’s operator-dictionary spacing.
clean_internal_attrs
Clean up internal _role/_lspace/_rspace attributes before serialization.
convert_to_pmml
Convert an XMath tree to Presentation MathML.
font_to_mathvariant
Map a LaTeXML font name to a MathML mathvariant value.
set_invisible_times
Set whether to emit invisible times (called by MathML processor before rendering).
set_plane1
Set the Plane-1 remapping mode (called by the MathML processor before rendering). Mirrors Perl preprocess L69-71: hackplane1 implies plane1.