Skip to content

Some inline LaTeX expressions are not rendered by Katex lib (ooba 4.0) #7423

@Kekuaka

Description

@Kekuaka

Describe the bug

@mamei16 Thank you very much for your latest fixes and improvements to LaTeX rendering capabilities.

I've tested ooba 4.0 and noticed that some inline LaTeX expressions are not detected and rendered. For example, this expression taken from recent LLM response on ooba 4.0.

some text ($P(\\nu_\\alpha \\to \\nu_\\beta) \\neq P(\\bar{\\nu}_\\alpha \\to \\bar{\\nu}_\\beta)$), some other text

I think that issue may be related to katex/auto-render.js which was added recently in #7402 and tries to detect inline LaTeX expressions.
As far as I was able to find out, in the same LLM response other inline expressions as well were enclosed in parentheses and contained 1 to 3 underscores (not 4 as this one) and were successfully detected and rendered. Unlike other expressions enclosed in parentheses, this one contains comma after right parenthesis.

If I manually remove 3rd and 4th underscores in chat history, this expression is detected and rendered as shown on the screen attached - with the proviso that the marked symbols have not been moved to the subscript. (Maybe 4 underscores is too much?)

Is there an existing issue for this?

  • I have searched the existing issues

Reproduction

Copy above LaTeX snippet into your chat history and view this history in the browser.

Screenshot

If I manually remove 3rd and 4th underscores in chat history, this expression is detected and rendered as shown on the screen attached - with the proviso that the marked symbols have not been moved to the subscript.

Image

Logs

No logs could actually show the problem details.

System Info

Ubuntu_22.04 + NVIDIA

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions