Go to page:

Search:   Help

Navigation

Groups

LyX documentation

Edit

Shared groups

Links

LyX /

FiguresInLyX

Categories: Uncategorized
<< LyXServer | Page list | LyXForX >>

Figures in LyX

How LyX handles figures

The LyX Team

LyX has the ability to handle literally any graphics format in the known universe so long as a conversion path from this graphics format to the target output format can be created. If that sounds a little obtuse, consider how LyX handles Encapsulated PostScript® figures. LaTeX provides native support for this format, so LyX needs do nothing other than use the \includegraphics LaTeX command to insert the figure in the final document.

To view the figure on the LyX screen, however, some additional work is required because neither the XForms nor the Qt GUI libraries can load PostScript® figures themselves. Thus, LyX must initiate a conversion from Encapsulated PostScript® to a loadable graphics format.

The XForms library can load figures in the following, widely used, graphics formats: bmp, gif, jpeg, pbm, pgm, ppm, tif, xbm whilst the Qt library can also handle mng, png and xpm format figures. This information and much more about the conversion process can be obtained by running LyX from the command line as

	lyx -dbg graphics

If you're having problems with your figures, then it's almost certain that the reason why things are going wrong can be found in the output generated by the above command.

To view the figure on the LyX screen LyX must initiate a conversion from Encapsulated PostScript® to a loadable graphics format. It does this using the powerful, configurable converters mechanism exposed in the Converters section of the Edit→Preferences dialog. Adding a new converter will result in a line like

	\converter "eps" "png" "my_ps2png $$i $$o" ""

being added to your .lyx/preferences file. This line defines a converter from Encapsulated PostScript® to PNG format using the external program my_ps2png. The placeholders $$i and $$o are replaced by LyX by the names of the input and output files, respectively.

If LyX cannot create a conversion path (which might have many steps) from Encapsulated PostScript® to one of the loadable formats listed above, then it defaults to the use of a shell script convertDefault.sh. This latter is a simple wrapper for ImageMagick's convert utility. Clearly, therefore, it can work only if you have convert installed and if convert can handle the conversion from one format to the other.

If, after all that, LyX still cannot load the figure, then it'll tell you so with a message "Error converting to loadable format" in place of an on-screen view of your figure. If you're presented with such a message, then you'll need to augment the list of known converters.

(If you're experiencing problems with previews after upgrading, you may wish to try to reset your personal settings. The default settings typically work fine, but seem to change over time...) Uncategorized

Edit - History - Print - Recent Changes - All Recent Changes - Search
Page last modified on 2006-10-11 15:13 CEST