On Fri, May 19, 2006 at 03:28:31PM +0200, Helge Hafting wrote: > 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.
I think that's the wrong approach. > 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. Not really. The infracstructure is already there, just replace our homegrown 'GUII' backend with a QPainter. > And there are some constructs it doesn't understand, in those cases > you simply get the "offending" latex command in red instead. And I'd completely drop LaTeX reading for a general purpose widget. Andre'