alexander wrote:
> Hi!
Hello, Alexander.
> I have Lyx 1.2.1.
Consider upgrading to 1.2.3 which is a bugfix release, squashing several bugs
in 1.2.1 or to the recently released 1.3 release whose graphics handling is
far less clunky.
> Is there a way to make pdf figures appear in the
> document while editing it?
Yes. However, LyX does not do this itself but rather uses an external
'converter' to create an image file in a format that it can load.
LyX has two possible graphics loaders in the 1.2 series. If your version of
the xforms GUI library is old, the we supply our own, limited graphics loader
which can load only XPM format images. If you are using a more recent version
of the xforms library, then we use the image loader supplied with it. This
loader is more powerful and can load several different graphics formats.
Running from the console:
$ lyx -dbg graphics
I get the following message:
The image loader can load the following directly:
Windows/OS2 BMP file, extension "bmp"
NASA/NOST FITS, extension "fits"
CompuServ GIF, extension "gif"
JPEG/JFIF format, extension "jpg"
Portable Pixmap, extension "ppm"
Portable Graymap, extension "pgm"
Portable Bitmap, extension "pbm"
SGI Iris, extension "sgi"
Tag Image File Format, extension "tif"
X11 Bitmap, extension "xbm"
X Window Dump, extension "xwd"
which shows I have a 'modern' xforms library. In fact, I'm running LyX 1.3
here which supports only versions of the xforms library modern enough to have
this graphics loader.
So, how do you define your converter?
If no converters are defined, then LyX uses a simple script convertDefault.sh
to perform these conversions. You'll find it in /usr/local/share/lyx/scripts
(if you installed LyX in /usr/local). In turn, this script is a wrapper for
ImageMagick's 'convert' program. So, question 1: do you have Imagemagick
installed? Here I find from 'man ImageMagick' that it supports conversion
from PDF format, so I suspect that the reason why things are failing for you
is that you don't have 'convert'.
'lyx -dbg graphics' should produce a large amount of information to help you
track down what's going wrong.
You can specify your own converter by defining formats and converter in the
Edit->Preferences dialog. Something like
From: PDF
To: PPM
Converter: convert $$i PPM:$$o
would work for me. If you are using an old version of the xforms GUI library,
you should also define
From: PPM
To: XPM
Converter: ppmtoxpm $$i > $$o
You should NOT try and use 'convert' to go all the way to XPM format;
'convert' can produce XPM files that cannot be read by the xforms image
loader and, indeed, can crash both xforms and LyX.
If you decide to upgrade to LyX 1.3 and also decide to use the Qt frontend,
then you'll be able to define a converter to PNG format which results in far
smaller files than the equivalent PPM format.
HTH,
--
Angus