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.