Gunnar G wrote:
Hi. Since you are using Qt for LyX, I wonder, is there an easy way of using a (hopefully small) part of the LyX code to display LaTeX math formulas nicely in a ordinary Qt program?Something like: QLyXWidget* myWidget = new QLyXWidget("\\frac{3+x}{xy}); would be great.
Have a look at the code, and feel free to reuse it in other gpl-licenced software. I believe lyx does something like this for previewing formulas: 1. Generate a small latex file containing the formula, using preview.sty 2. Run latex on that, then dvips in order to get an image 3. Display that image. Needless to say, doing all this takes a few seconds. You shouldn't need much code to do it though. If you need something faster, you could try extracting the formula rendering done by the math editor. Much faster, but more complicated. And there are some constructs it doesn't understand, in those cases you simply get the "offending" latex command in red instead. Helge Hafting
