Closed zyxir closed 9 months ago
I'm looking into it. The dev says to "just" fork the package yet it's not super straight-forward as it uses several different packages all published by him lol I'll dive deeper into the runtime to figure what's what
To be honest, I've encountered the same issue as well. My users and I deal with a large number of formulas every day. Although the developers of remark-math seem somewhat irresponsible, they cannot be blamed too much, as the format is not a standard latex formulas. I need a solution that is seamless for the users. Here is my solution:
@SailFlorve Thank you for your solutions. Here is my opinons on each of them:
remark
is a very popular markdown implementation, there might not be many alternatives with equal quality. Forking remark-math
might be an option.Of course, this is just a stopgap measure, not a complete solution, but a temporary patch.
@SailFlorve @zyxir
i tried to use a preset prompt but some equations didn't work
like the ( \frac{6}{8} \times h )and the what prompt should I use
i tried to use a preset prompt but some equations didn't work
My prompt is simple but works great:
Latex inline: $x^2$.
Latex block: $$e=mc^2$$.
i tried to use a preset prompt but some equations didn't work
My prompt is simple but works great:
Latex inline: $x^2$. Latex block: $$e=mc^2$$.
thanks for the reply. I tried your prompt and find out it is very useful in English, but not work very well with Chinese. but still thanks
i tried to use a preset prompt but some equations didn't work
My prompt is simple but works great:
Latex inline: $x^2$. Latex block: $$e=mc^2$$.
Latex inline: $x^2$. not\(x^2\) Latex block: $$e=mc^2$$.
this may work better
Just an update here. I think some simple parsing on the frontend would help and close this issue once and for all. I might make it optional but enabled by default to begin, as it can potentially impact performance especially on mobile and longer threads of conversation.
if this is satisfactory, I will move forward
Looks Great. Is it instantaneous or have to wait until the entire response is done? I'm looking forward to seeing the new commit.
Looks Great. Is it instantaneous or have to wait until the entire response is done? I'm looking forward to seeing the new commit.
it's instantaneous as soon as LaTeX is detected!
What a nice implementation! Thank you for your hard work.
What features would you like to see added?
Add
\(...\)
and\[...\]
delimiters for equation rendering, as in ChatGPT.More details
First, I'd like to express my sincere gratitude to the developers for their exceptional work on LibreChat. As a STEM guy who frequently interacts with mathematical equations, I've recently encountered some unexpected behavior in this area. Upon closer examination, I discovered that:
chat.openai.com
) pruduces equations surrounded by\(...\)
and\[...\]
by default. The Pictures section showcases how these equations are flawlessly displayed within ChatGPT's web interface.\(...\)
and\[...\]
delimiters as ChatGPT. To ensure LibreChat compatibility, GPT 3.5 Turbo's API must be explicitly prompted to use$...$
and$$...$$
for equation formatting, as dipicted in the Pictures section.While adjusting the system prompt offers a workaround,
\(...\)
and\[...\]
allow equations to coexist peacefully with the dollar sign's primary use as a currency symbol. That's likely why both ChatGPT and Org-mode embrace these delimiters. Since LibreChat claims to have aUI matching ChatGPT
, matching equation rendering capabilities would be a fantastic improvement.Additional information: Upon further investigatgion, I found that equation rendering is provided by
rehype-katex
andremark-math
in LibreChat.rehype-katex
renders math contents via KaTeX, whileremark-math
converts contents surrounded by dollar signs into math content. While exploring the issue list ofremark-math
, I stumbled upon this issue where the developer declined to implement\(...\)
or\[...\]
delimiters within the plugin. This may make the enhancement I propose harder or even impractical to implement. Therefore, I would appreciate the opportunity to discuss the significance and feasibility of the proposal with you.Which components are impacted by your request?
UI
Pictures
Equation rendering within ChatGPT: Equation rendering within LibreChat:
Code of Conduct