Open haje01 opened 6 months ago
Thanks for bringing this up!
I can reproduce the issue, but I'm not sure how we can tackle it. We use marked but I can't see an option for delimiters there. 👀
Would be open to ideas on how to fix this
I also couldn't find a Katex setting to change the delimiter, so I worked around it by appending the following text in the ChatGPT prompt
Use $ as a delimiter at the beginning and end of the formula.
If the answer from the ChatGPT is in non-Latin characters, such as CJK, for example, the following prompt would be useful.
Use $ as a delimiter at the beginning and end of the formula. Make sure to put a single space after the delimiter $ whenever it's followed by a non-Latin character, such as CJK
I hope this helps.
There seems to be an extension for configuring delimiters: https://katex.org/docs/autorender
Specifying the following system prompt for the ChatGPT model seems to resolve most issues with equation rendering:
Indicate the start and end of inline equations with '$ ' and ' $', respectively. Use $$ to delimit the start and end of block equations.
I am using Chat UI version 0.8.3 and ChatGPT version gpt-4-turbo-2024-04-09.
ChatGPT is outputting formula delimiters as
\[
,\]
,\(
,\)
and katex in the current version of ChatUI is not rendering them correctly. Based on my experiments, katex renders only formulas with$
delimiters correctly.I did a quick test with the following prompts
echo following text as is: \[ D_i \]
<- Fail to renderecho following text as is: $ D_i $
<- SuccessfulThank you in advance.