Skip to content

Conversation

ServeurpersoCom
Copy link
Collaborator

So inline and block equations are converted before KaTeX rendering, enabling proper display of model-generated LaTeX in the WebUI:

  • Added a dedicated remarkMathJaxDelimiters plugin that rewrites MathJax bracket delimiters into KaTeX-friendly dollar math while limiting the normalization to text nodes so code blocks and other literals remain untouched.

  • Wired the new plugin into the existing Markdown processor ahead of remark-math and dropped the prior global string replace, keeping the established remark/rehype pipeline intact while still rendering centered and inline equations correctly.

Missing stage in #16505 because of KaTeX

Close #16598

@ServeurpersoCom
Copy link
Collaborator Author

Raw default output for many model :
LaTeX-Inline
LaTeX-Centered

Result with this PR :

KaTeX-vs-MathJax.mp4

@ServeurpersoCom ServeurpersoCom force-pushed the mathjax-style-delimiters branch from 35ee04c to 99957e3 Compare October 16, 2025 04:15
@ServeurpersoCom ServeurpersoCom marked this pull request as draft October 16, 2025 04:42
…iters

So inline and block equations are converted before KaTeX rendering,
enabling proper display of model-generated LaTeX in the WebUI
@ServeurpersoCom ServeurpersoCom force-pushed the mathjax-style-delimiters branch from 99957e3 to 877f0bd Compare October 16, 2025 04:51
@ServeurpersoCom
Copy link
Collaborator Author

Sorry for the spam : I had two versions coexisting in my Git history, so I reverted to the simple version that works on its own, without the remark plugin.

@ServeurpersoCom ServeurpersoCom marked this pull request as ready for review October 16, 2025 04:54
@ggerganov
Copy link
Member

This patch renders correctly mathematical expressions on my end.

Just a minor note - probably the "Show raw LLM output" option should not be located in the "Reasoning" tab. And the name should be shortened to just "Show raw LLM output".

image

@ServeurpersoCom
Copy link
Collaborator Author

ServeurpersoCom commented Oct 16, 2025

I realized it and told Alek on discord:D
Sans titre
Because we should group all the debug options into a dedicated developer section, since we’re going to add toolcall debugging soon.
And also "Custom JSON parameters to send to the API. Must be valid JSON format." -> Debug or Developer...
And eventually, the “Advanced” section could be renamed to “Sampling.”
And current "Sampler" inside "Sampling"
What do you think?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Misc. bug: Svelte WebUI Improve default LaTeX rendering

2 participants