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:Resolve multi-token brace constructs (
\mathbin{\mathsf{U}},\mathsf{G}and the other temporal/deontic markers,\left(/\right)grouping,{:}the sort colon).Unescape
\_to a literal underscore (thec_-constant escape thatto_latexemits) so it is not later read as a subscript operator.Unwrap
\mathrm{Sort}toSort.Collapse generic subscript braces
X_{...}toX_....Map every remaining backslash control sequence by its full letter run (longest-match), covering both the
to_latexglyphs and common hand-written synonyms; the letter-run spacing macros map to nothing.Delete the non-letter spacing macros (
\,\;\!and a backslash-space).Strip leftover grouping braces
{}(LaTeX grouping carries no parser-relevant information; precedence is explicit via the operators).Collapse redundant whitespace.