Skip to content

bug: math equations rendered as raw LaTeX source — agents not instructed to use KaTeX-compatible syntax #15053

@alberti42

Description

@alberti42

Description

The opencode web/desktop frontend renders math using KaTeX, which requires $...$ for inline equations and $$...$$ (flush-left, surrounded by blank lines) for display equations. However, the system prompts for all agent families give no instruction about this. LLMs default to \(...\) and \[...\], which KaTeX cannot parse, so equations appear as raw LaTeX source instead of rendered formulas (see the screenshot).

Expected behavior: Equations should be rendered by KaTeX as properly formatted math.

Plugins

None

OpenCode version

dev branch (SHA1 68cf011)

Steps to reproduce

Ask any agent (OpenAI, Claude, Gemini, …) a question that involves a mathematical equation, e.g.:

Answer quickly: Can you remind me how the Schrödinger equation looks like?

Screenshot and/or share link

Image

Operating System

All systems

Terminal

Does not apply

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions