Have you looked at MathType, or mt.editor?
It can be done in MathType, but "automated"? I'm not sure about that. There is some automation you can do, but there will almost certainly be some manual tweaking for every one of them. Here's an example I created with InDesign CC (Windows) and MathType 6.9:
If you'll write me privately, I'll describe the process to you. (Hover over or click my avatar for my email address.)