Skip to content

[CLI / TUI] LaTeX math formulas ($...$, ...) rendered as raw text without formatting #49486

Description

@GoldTest

Description

When the assistant outputs mathematical expressions or logic formulas wrapped in single ($...$) or double ($$...$$) dollar signs (for example, $$\text{Prov}(x, y)$$ or $\exists x \text{Prov}(x, y)$), OpenCode CLI / TUI displays the raw LaTeX source code verbatim with the dollar signs, rather than rendering or formatting them into readable mathematical expressions.

Expected Behavior

Mathematical expressions wrapped in LaTeX delimiters should be nicely formatted or rendered in the CLI/TUI:

  1. Unicode/ASCII Fallback in CLI/TUI: Parse common LaTeX symbols, superscripts, subscripts, Greek letters, and operators into Unicode characters (e.g. \text{Prov}(x, y) → Prov(x, y), \exists → ∃, \to → →, x^2 → x²).
  2. KaTeX / MathJax support in Desktop / Web GUI: Fully render LaTeX math equations when running in graphical/web mode.
  3. Prompt or parser-level enhancement: For terminal clients, provide guidance or pre-render transformations so mathematical equations remain readable.

Actual Behavior

The terminal outputs raw LaTeX source text including the $ / $$ delimiters directly (e.g., $$\text{Prov}(x, y)$$), which impacts readability for mathematical, logical, and algorithmic discussions.

Steps to Reproduce

  1. Ask OpenCode in CLI mode a math/logic question, e.g. $$\text{Prov}(x, y)$$ 这是什么表达式.
  2. Observe the AI response containing $/$$ delimiters displayed directly as raw text without formatting.

Environment

  • Tool: OpenCode CLI / TUI
  • OS: Windows / Linux / macOS

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions