Helge Hafting ha scritto:
You get the preview "for free" if we set up conversion all the way from .gnumeric to .eps (via .tex).
Just tried, but doesn't work. I patched lib/configure.py as in the attachment, where the converter is the attached script. When I use "Insert->graphics...", and I specify a ".gn" file, it crashes.
(of course I'm in an attempt to build-up something usable for the very next papers I'm going to write, waiting for LyX 1.6.+ with some Insert-support for such things).
I was thinking of only converting to .tex, and have LyX include the generated .tex file directly. This has several advantages:
Perfectly agree. This is absolutely the way to do it. T.
* gnumeric exports the spreadsheet as a longtable. If you make a .eps, then this is limited to a single page. And you'll get one big figure that cannot be broken across pages. (This is sometimes a problem when there are more figures than text). A longtable imported as .tex have no such problems. It can start anywhere on the page because it will be broken, and it can go on for many pages - again because it supports page breaking. * Importing gnumeric as a longtable means that style choices in LyX (font etc.) can affect the longtable layout. Using eps means LyX cannot affect the output in any way. * Finally, longtables work equally well with all the latex exporters, i.e. both latex and pdflatex."No automatic preview" seems to be the only disadvantage of importing .tex Now, of course a preview is possible anyway because we can specify a differentconverter for previewing. Helge Hafting
Index: lib/configure.py =================================================================== --- lib/configure.py (revisione 21533) +++ lib/configure.py (copia locale) @@ -241,6 +241,9 @@ checkViewer('a FEN viewer and editor', ['xboard -lpf $$i -mode EditPosition'], rc_entry = [r'\Format fen fen FEN "" "%%" "%%" ""']) # + checkViewer('a Gnumeric viewer and editor', ['gnumeric'], + rc_entry = [r'\Format gn gn gn "" "%%" "%%" "vector"']) + # path, iv = checkViewer('a raster image viewer', ['xv', 'kview', 'gimp-remote', 'gimp']) path, ie = checkViewer('a raster image editor', ['gimp-remote', 'gimp']) addToRC(r'''\Format bmp bmp BMP "" "%s" "%s" "" @@ -409,6 +412,9 @@ addToRC(r'\converter lyxpreview png "python -tt $$s/scripts/lyxpreview2bitmap.py" ""') else: addToRC(r'\converter lyxpreview png "" ""') + # + checkProg('a Gnumeric to EPS converter', ['gnumeric2eps.sh $$i $$o'], + rc_entry = [ r'\converter gn eps "%%" ""' ]) # checkProg('a fax program', ['kdeprintfax $$i', 'ksendfax $$i'], rc_entry = [ r'\converter ps fax "%%" ""'])
gnumeric2eps.sh
Description: application/shellscript