I’m building a student helper app that uses OCR to scan math questions and solves them using GPT.
The OCR automation outputs a Latex styled string to represent the formula
EX: \int\left(x^{5}-6 x+3\right) d x=
I’m able to pass off the initial question to a third party service that would render the formula as an image i can use.
The problem I run into, however, is when GPT starts using formulas in its own answer. GPT also uses Tex / LaTex (specifically, this service: https://www.katex.org/) formatting, and so its response contains a mix of normal english, and these Tex strings.
EX:
Sure! Using the power rule of integration, we can integrate each term separately:
Thanks for the follow-up Darren! I could, but GPT wouldn’t necessarily honor the request all the time.
Furthermore, formulas are super-useful to have in terms of a user experience. The app would lose a lot of its utility if we remove such notation from the solution steps.
Basically I’m trying to output GPT answers with Tex formatting within Glide. Here’s an example of Tex output in Glide compared to how it looks from within GPT itself.
I see. So basically you want the output rendered in the same way as Katex would present it, yes?
It might be possible to load Katex and do it with a JavaScript column, or alternatively you could probably set up your own hosted instance and embed that in a webview.
Correct! As far as I’m aware, JS columns would not be able to import js libraries but it seems that I’m mistaken.
Maybe I should give that a shot, and if all else fails - an embedded web view may be a path forward assuming I can steal a kind developer from the team to set up a hosted instance.
Let me give both of these a shot and report back on my findings
Much appreciated sir
P.S. I’ve used multiple guides of yours in the past. Specifically, the working day calculator + CSV file output guides were eye-openers; so thanks for all the help you’ve already provided