unicode_fol_kit.latex_to_unicode

unicode_fol_kit.latex_to_unicode(text)[source]

Translate a LaTeX math-mode formula into the toolkit’s Unicode surface syntax.

The result is a Unicode string ready for MSFLParser. The pipeline:

  1. Resolve multi-token brace constructs (\mathbin{\mathsf{U}}, \mathsf{G} and the other temporal/deontic markers, \left( / \right) grouping, {:} the sort colon).

  2. Unescape \_ to a literal underscore (the c_-constant escape that to_latex emits) so it is not later read as a subscript operator.

  3. Unwrap \mathrm{Sort} to Sort.

  4. Collapse generic subscript braces X_{...} to X_....

  5. Map every remaining backslash control sequence by its full letter run (longest-match), covering both the to_latex glyphs and common hand-written synonyms; the letter-run spacing macros map to nothing.

  6. Delete the non-letter spacing macros (\, \; \! and a backslash-space).

  7. Strip leftover grouping braces { } (LaTeX grouping carries no parser-relevant information; precedence is explicit via the operators).

  8. Collapse redundant whitespace.

Parameters:

text (str)

Return type:

str