The texmath library provides functions to read and write TeX math, presentation
MathML, and OMML (Office Math Markup Language, used in Microsoft Office).
Support is also included for converting math formats to Gnu eqn, typst, and
pandoc's native format (allowing conversion, via pandoc, to a variety of
different markup formats). The TeX reader supports basic LaTeX and AMS
extensions, and it can parse and apply LaTeX macros. (See
<https://johnmacfarlane.net/texmath here> for a live demo of bidirectional
conversion between LaTeX and MathML.)