Hacker News new | ask | show | jobs
by tylerekahn 1181 days ago
The web app also has built in support for LaTeX rendering (it uses KaTeX). See this forum post: https://community.openai.com/t/new-feature-properly-shown-ma...

You can get ChatGPT to output conforming LaTeX expressions using the following prompt:

Could you please use the specific LaTeX math mode delimiters for your response?

LaTex math mode specific delimiters as following

1. inline math mode : `\(` and `\)`

2. display math mode: insert linebreak after opening `$$`, `\[` and before closing `$$`, `\]`

2 comments

In some of the ChatGPT client-side JS (visible in the Debugger tab of DevTools), I could see references like `\triangle`. However, asking ChatGPT to print either as it is just prints the text itself.
This prompt works best with GPT 4. GPT 3.5 gives inconsistent results. There might be a way of improving the prompt for 3.5
Turns out, this actually does work.
Super nice, thanks for posting this!