I'm not sure if I understand your problem. But i think you get end program look like that, you can either use any latex form API if avaliable or use Opengl to build your own!

ssharish