latex_converter

LaTeX to Discord Formatting Converter.

Converts LaTeX/math formatting to Discord-friendly text with Unicode symbols.

Strategy: - Preserve fenced and inline code as-is. - Convert display math to plain text (no code fences). - Convert inline math to inline code with lightweight symbol mapping. - Replace common LaTeX commands with Unicode equivalents. - Handle nested \frac{}{}, \sqrt{}, superscript/subscript to Unicode. - Support matrix environments and special math fonts.

latex_converter.convert_latex_to_discord(text)[source]

Convert common LaTeX/math formatting to Discord-friendly text.

Preserves fenced code blocks and inline code spans untouched. Everything else is scanned for LaTeX delimiters and converted using Unicode symbols.

Return type:

str

Parameters:

text (str)