How Do I Use LaTeX/MathQuill API In a Roblox Game?

Hi! I’m working on a game that I want to use a math typesetting library such as MathQuill in.

Unfortunately, I’m not quite sure how to do this. All of the types of libraries I can find are based in HTTP, and being relatively new to coding, I don’t know how to properly make it work. I understand HttpService, but I can’t figure how to mount any APIs.

I don’t really have any solutions here. I’ve been trying to make this work for months now, from trying to hook an API to studio to actually trying to remake MathQuill from scratch, but I’ve had no luck with any approach I’ve taken. I’m really hoping someone here would be able to help, because I’m kinda starting to lose motivation on this project. If you have any ideas, I’d be very grateful to hear them. Thank you.

2 Likes

Hello,
I found with quick search on github this lua library: github link
Maybe you could implament this ingame and only thing you have change is to handle UI, User input and maybe have to change some things around

Hopefully this will kickstart your motivation again, I’m also interested in hearing what you are making with this.

Wow, I think this might take care of the biggest problem I was going to have later on in this project, thanks! However, this still raises a few questions unfortunately.

Now that I have how I’m going to end the program, I just need to know how to start it. I’m planning on having a textbox that the player can write in, and it converts the expression into LaTeX automatically as the user types. Ideally, it would be similar to the system that can be found here. The main problem I’ve run into is that I simply lack the experience to be able to code something like this on my own, and I don’t how how to make MathQuill compatible with studio (I’ve even had a web developer friend tell me it’s very unlikely to be possible). I’ve tried looking for a lua-compatible API similar to MathQuill, but I’ve had no success. Can you think of a workaround for this problem?

Also, now that I know about MathParser.lua, I’m curious, is it able to take variable expressions and return variable answers? For instance, is it only able to return numerical answers, or if I did something like (d/dx)x^2, would it give me 2x? (I know derivatives and integrals aren’t supported and likely won’t be as the project looks a bit abandoned, but it’s the best example I can think of at the moment.) I’ve skimmed over some of the code, but can’t tell if it would be able to do this.

Yes, I believe this has helped motivate me some more. Thank you for your input. I think I’ll pick this project back up when I have more time to do so, maybe in a few months. Until then I’ll continue searching here and there for a compatible library. If you come across something again that can help, I’d be incredibly grateful. Thanks again!

I think you don’t need any web apis for this, since MathQuill is just the same as MathParser.lua, but for websites.
Regarding the variable expressions, I think it can do that. You can use example.lua template as reference on how to use some functions. Maybe using Roblox Assistant AI helps you kickstart the project.
Sorry if I don’t answer fully to your questions, since I haven’t used this library. You can probably ask in Scripting Support category for help.