Nice idea. This is one of those dream problems where you can just synthesize a ton of data and solve the inverse problem. As a student this is a great way to go for a project, but can be hard to think up.
You can generate images from Latex code easily, but generating Latex code for realistic formulas seems trickier. It would be easy to end up with a ton of formulas unlike real-world ones.
Indeed, synthesizing the data well is an equally or maybe more important part of this kind of project than the particular choice of neural network architecture.