mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-08 12:40:32 -05:00
[GH-ISSUE #50] Math not rendering correctly #50581
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @florencekl on GitHub (Nov 3, 2023).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/50
Originally assigned to: @tjbck on GitHub.
Describe the bug
Mathjax/Katex/Latex/Math is not rendering correctly in ollama-webui, specifically matrices seem to be rendering wrong.
To Reproduce
Ask Ollama to calculate any math equation, for this example i asked it to:
Or ask it to repeat this exact answer:
Expected behavior
The rendering should show the matrices/vectors in this case and display the katex notation correctly.
I am not sure what the cause of this is because the HTML output of both example look the same to me so some outer div might be the cause,
Screenshots
Ollama Example:

In ChatGPT the same output looks like this:

@tjbck commented on GitHub (Nov 3, 2023):
Hi, Could you please copy both outputs and verify both outputs have the same latex equation (in text) to rule out the issue from the model end? Thanks.
@florencekl commented on GitHub (Nov 4, 2023):
Im unable to recreate the exact results of earlier but here are two examples with their exact outputs and how theyre rendering.
It seems to be a specific issue with how matrices are rendered because all other math equations i have seen so far seem correct.
Prompt:
Using ChatGPT:

Using Llama2 with ollama-webui
@tjbck commented on GitHub (Nov 4, 2023):
Hi, The issue should be solved with #51. The culprit was the markdown rendering engine. Let me know if you're facing any other additional issues with the Katex support. Thanks!
@tjbck commented on GitHub (Nov 4, 2023):
@florencekl commented on GitHub (Nov 4, 2023):
Thanks so much! 👍🏻
@fugohan commented on GitHub (Jun 8, 2024):
I tried the same thing with a llama3 and it's not working.
I also figured out that the $$ notation isn't working as well.