Angus Leeming <[EMAIL PROTECTED]> writes:

> > existing bitmap file in <graphic>. Next thing to do is
> > generate these bitmaps (previews becoming included files,
> > isn't that a mess?)
> 
> Ok.
> 
> Points to note:
> * Instant Preview works only if the user has preview.sty installed.

Maybe we could bundle it and set the TEXINPUTS accordingly before the
latex call?

> * Can a LyX docbook document always export valid LaTeX? I ask because
> generation of these snippets relies on latex.

For the equations we would just call the latex() method. I don't know how
math macros work exactly, but I hoped we could just include them in the
preamble.

There won't be a valid LaTeX preamble with the document, though, so we
would have to generate a standard one, possibly including AMS math.

> * Assuming that the answer to the above question is yes, you should use a
> slight variation of the existing code. At the moment the bitmaps are
> generated with foreground and background colours to match those of the LyX
> screen.

Transparent background would be best, I think.

> This from src/graphics/PreviewLoader.C:
> 
>    496          cs << pconverter_->command << ' ' << pconverter_->to << ' '
>    497             << latexfile << ' ' << int(font_scaling_factor_) << ' '
>    498             << lyx_gui::hexname(LColor::preview) << ' '
>    499             << lyx_gui::hexname(LColor::background);

Yes, fontsize and scaling will be a problem. For the vertical alignment we
have the choice between top, bottom or middle :-(

> Those will probably need to be changed, as will
> 
>    230  boost::signals::connection PreviewLoader::connect(slot_type const &
> slot
> ) const
>    231  {
>    232          return pimpl_->imageReady.connect(slot);
>    233  }
> 
> because you want to do something with these bitmaps other than render them
> on screen...

And I dont need PreviewImages since they get loaded. All I need is a
file reference to a bitmap file.
So I thought about starting with PreviewLoaders methods startLoading() and
finished() and then write my own code. Should I drop the background thread
handling? No  need for that during export, is there?
And the loadable formats would be different, all one really needs is PNG or EPS 
(ah yes, and BMP for RTF, but that might be done at a later stage)

/Andreas


Reply via email to