-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Description
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:
- ChatGPT (
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. - When called from the API, GPT 3.5 Turbo uses an unusual default format for equations. But upon request, it outputs equations using the same
\(...\)
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 a UI 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
and remark-math
in LibreChat. rehype-katex
renders math contents via KaTeX, while remark-math
converts contents surrounded by dollar signs into math content. While exploring the issue list of remark-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
- I agree to follow this project's Code of Conduct