[GH-ISSUE #2769] [BUG]: Latex blocks wrapped with \[\] are not rendered #1781

Closed
opened 2026-02-22 18:26:29 -05:00 by yindo · 4 comments
Owner

Originally created by @i0ntempest on GitHub (Dec 7, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2769

How are you running AnythingLLM?

AnythingLLM desktop app

What happened?

As stated here: https://github.com/Mintplex-Labs/anything-llm/issues/2018#issuecomment-2289005011, AnythingLLM only supports latex blocks wrapped with $ but not braces. A lot of models use braces for latex blocks by default, so I must tell it to switch symbols instead to get it to render correctly.

Are there known steps to reproduce?

Ask a llama model a math question that requires latex. I asked "Why is e^(B_t-2/t) a martingale".

Originally created by @i0ntempest on GitHub (Dec 7, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2769 ### How are you running AnythingLLM? AnythingLLM desktop app ### What happened? As stated here: https://github.com/Mintplex-Labs/anything-llm/issues/2018#issuecomment-2289005011, AnythingLLM only supports latex blocks wrapped with $ but not braces. A lot of models use braces for latex blocks by default, so I must tell it to switch symbols instead to get it to render correctly. ### Are there known steps to reproduce? Ask a llama model a math question that requires latex. I asked "Why is e^(B_t-2/t) a martingale".
yindo added the possible bug label 2026-02-22 18:26:29 -05:00
yindo closed this issue 2026-02-22 18:26:29 -05:00
Author
Owner

@timothycarambat commented on GitHub (Dec 11, 2024):

Closing as this is behavior oriented. The main reason is we dont want to load 10 different *TeX parsers into the renderer to support the dozens of whats TeX content can come from - ultimately whatever the model is trained on or predicts to be the best is what it will output, telling it to use the format we support via system prompt is currently the way forward

@timothycarambat commented on GitHub (Dec 11, 2024): Closing as this is behavior oriented. The main reason is we dont want to load 10 different *TeX parsers into the renderer to support the dozens of whats TeX content can come from - ultimately whatever the model is trained on or predicts to be the best is what it will output, telling it to use the format we support via system prompt is currently the way forward
Author
Owner

@i0ntempest commented on GitHub (Dec 11, 2024):

I have tried and at least some models insisted on using square braces instead of \, even after I explicitly told them to use \\.

@i0ntempest commented on GitHub (Dec 11, 2024): I have tried and at least some models insisted on using square braces instead of \\$, even after I explicitly told them to use \\$.
Author
Owner

@i0ntempest commented on GitHub (Dec 11, 2024):

Also see https://github.com/lmstudio-ai/lmstudio-bug-tracker/issues/228#issuecomment-2536615337. qwen models are an example of the problem above, not following the instruction.

@i0ntempest commented on GitHub (Dec 11, 2024): Also see https://github.com/lmstudio-ai/lmstudio-bug-tracker/issues/228#issuecomment-2536615337. qwen models are an example of the problem above, not following the instruction.
Author
Owner

@quank123wip commented on GitHub (Dec 20, 2024):

Closing as this is behavior oriented. The main reason is we dont want to load 10 different *TeX parsers into the renderer to support the dozens of whats TeX content can come from - ultimately whatever the model is trained on or predicts to be the best is what it will output, telling it to use the format we support via system prompt is currently the way forward

Forgive me, but this could simply be done by updating upstream extension. The 'markdown-it-katex' version you use is unmaintained and @vscode/markdown-it-katex actively maintained. I will submit a pull request to upstream package to support this simple feature. Would you like to switch to @vscode/markdown-it-katex afterwards?

@quank123wip commented on GitHub (Dec 20, 2024): > Closing as this is behavior oriented. The main reason is we dont want to load 10 different *TeX parsers into the renderer to support the dozens of whats TeX content can come from - ultimately whatever the model is trained on or predicts to be the best is what it will output, telling it to use the format we support via system prompt is currently the way forward Forgive me, but this could simply be done by updating upstream extension. The 'markdown-it-katex' version you use is unmaintained and @vscode/markdown-it-katex actively maintained. I will submit a pull request to upstream package to support this simple feature. Would you like to switch to @vscode/markdown-it-katex afterwards?
yindo changed title from [BUG]: Latex blocks wrapped with `\[\]` are not rendered to [GH-ISSUE #2769] [BUG]: Latex blocks wrapped with `\[\]` are not rendered 2026-06-05 14:42:39 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#1781