How to store mathematical equations in db and render them on frontend

Hi guys, I am trying to build a quiz project in which users would be able to select STEM subjects (maths, physics and CS) and then solve quiz and get the result... But the questions of mathematics and Physics etc might have equations etc so my question is how do I store these equations embedded within the prompt of the question and then show it on frontend (currently using svelte.js but would also build a mobile app with flutter in future)...I have googled it and something called TEX seems to be the answer BUT my main question is can I store the equation along with the equation e.g "What is the answer of <maths part here: integral of blah blah>" And then what packages or frameworks would I use to show them on the frontend? Btw I am using postgres and prisma with express on the backend
2 Replies
Josh
Josh14mo ago
youll just store it as a string in your db in latex format do some research on latex
Quinn
Quinn13mo ago
This library is also good for rendering your latex: https://katex.org/, it can be a bit clunky with React though but it probably would work better with Svelte
Want results from more Discord servers?
Add your server