[Feedback]: Render LaTeX math in assistant messages

未關閉
#163 0 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
48/100
Issue 類型
功能
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
latex, markdown, shell
領域
desktop

研究方向

Start by locating the chat view’s Markdown rendering pipeline and checking how assistant messages are rendered; the issue names no files or tests. Assess how math support and a locally vendored KaTeX bundle fit the app, including the optional setting and terminal CLI fallback. Done means inline and block math render as intended, the bundle works offline, and the setting or CLI behavior is covered.

由索引模型根據 Issue 內容生成。

描述

enhancement
What problem are you trying to solve?

Assistant replies that contain LaTeX math are shown as raw source in the chat view. For STEM
conversations this defeats the purpose of the answer: a derivation that should read as stacked
fractions and integrals comes out as literal \int_0^T, \frac{N_0}{2}, $$...$$.

Repro: ask for the proof of Cov(z_I, z_Q) = 0 for white Gaussian noise. The reply contains
integrals, fractions and aligned equations; all of them render as source text.

Workaround today is to ask the model to rewrite every formula in Unicode plain text
(e.g. "∫₀ᵀ", "N₀/2"). That works for simple expressions but loses stacked fractions,
sub/superscripts and aligned derivations, and it wastes tokens on reformatting.

What would improve it?

Render math in the markdown pipeline — remark-math + rehype-katex (or equivalent) — for both
inline $...$ and block $$...$$, with the KaTeX bundle vendored locally so it works offline.
A settings toggle (default on) would be good, since not every user wants it.

For the terminal CLI, a lighter option is acceptable: detect $...$ / $$...$$ and either
render a Unicode fallback or leave the source as-is with a visible hint.

What do you do today?
  1. Rewrite formulas in Unicode plain text via a follow-up prompt.
  2. Export the explanation to a .md file and preview it in VS Code (built-in KaTeX).
  3. Publish a standalone HTML page with KaTeX and read it in the browser.
Product area

None

主要語言
Shell
星號
110
分支
9
平均合併
12 分鐘
30 天內合併 PR
1

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

CommandCodeAI/desktop 的其他 Issue

查看 CommandCodeAI/desktop 的全部 Issue

相似的 Issue

更多 Shell/Bash Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。