Jean-Pierre.Chretien wrote:
> man xfig
> man transfig
> 
> But what I like in xfig (in addition to its powerful import and
> export capabilities and the batch processing features) is the
> object oriented interface (update settings/update objects)
> and the adaptive help and  particularly the dynamic mouse at the
> top right corner.
> 
> Once the initial learning effort made, I can use it from time
> to time without having to dig again in the manual.

Incidentally all, 
LyX 1.4.x (current cvs) has really powerful support for xfig images via the 
External inset.

I have written a couple of converters to produce 'best quality' documents when 
the latex file is run through either the latex or pdflatex compilers and to 
just use a 'quick and easy' converter for display on the LyX screen:

\converter fig pdftex "sh $$s/fig2pdftex.sh $$i $$o" ""
\converter fig pstex  "sh $$s/fig2pstex.sh $$i $$o" ""
\converter fig ppm "fig2dev -L ppm $$i $$o" ""
\converter fig png "fig2dev -L png $$i $$o" ""

FYI, I attach the fig2pstex.sh script and the External Template that we use to 
define XFIG support.

I do this because there is no reason not to support dia, tgif and sketch also. 

If these programs don't need some sort of 'latex support' to produce optimal 
results, then you can use the existing graphics inset together with an 
appropriate set of converters and all will be fine.

However, from what I understand, tgif can export snippets of latex just as 
xfig can. If that is the case, then it would be nice to have an External 
Template equivalent to the XFIG one that we have already. Don't you think?

Any tgif users out there interested in showing me the way forward?

-- 
Angus

Attachment: fig2pstex.sh
Description: application/shellscript

# An External Template for XFIG support by LyX

PreambleDef XFigInput
        %% This inputs the file if it exists, else prints a warning
        %% encased in an fbox.
        \def\stripprefix#1>{}
        \newcommand*{\xfiginput}[1]{%
            \edef\tempfilename{#1}%
            \InputIfFileExists{#1}{}{%
                \fbox{Could not find
                    \ttfamily\expandafter\stripprefix\meaning\tempfilename!}
                \typeout{xfiginput: Could not find \tempfilename!}
            }
        }
PreambleDefEnd

Template XFig
        GuiName "[XFig: $$Basename]"
        HelpText
                An XFig figure.
                This template uses XFig for editing.
        HelpTextEnd
        InputFormat fig
        FileFilter "*.fig"
        EditCommand "xfig $$FName"
        AutomaticProduction true
        Format LaTeX
                Product "\\xfiginput{$$Basename.pstex_t}"
                UpdateFormat pstex
                UpdateResult "$$Basename.pstex_t"
                Requirement "graphicx"
                Preamble XFigInput
        FormatEnd
        Format PDFLaTeX
                Product "\\xfiginput{$$Basename.pdftex_t}"
                UpdateFormat pdftex
                UpdateResult "$$Basename.pdftex_t"
                Requirement "graphicx"  
                Preamble XFigInput
        FormatEnd
        Format Ascii
                Product "$$Contents(\"$$Basename.asc\")"
                UpdateFormat asciixfig
                UpdateResult "$$Basename.asc"
        FormatEnd
        Format DocBook
                Product "<graphic fileref=\"$$Basename.eps\"></graphic>"
                UpdateFormat eps
                UpdateResult "$$Basename.eps"
        FormatEnd
        Format LinuxDoc
                Product "[XFig: $$FName]"
        FormatEnd
TemplateEnd

Reply via email to