On Saturday 24 January 2004 4:51 pm, Nirmal Govind wrote: > > LyX 1.4.x will give you a truly powerful External Inset that will > > be able to handle export to PDF also (+ give you a preview in the > > LyX window). > > Angus - did you mean exporting to PDF via pdflatex? And preview - > you mean preview with the latex math showing up properly in LyX??
Yes and yes. LyX screenshot attached.
> Both these features would be really cool!
The external inset in the 1.4.x series does everything that the graphics
inset does (rotate, resize, crop, visualize in LyX) but in addition allows
you to specify arbitrary latex and visualize as a preview.
It doesn't support subfigure, but then this shouldn't be in the graphics
inset either.
I have to figure out how best to deal with eps.gz files, but once that's done
then the graphics inset can just be thrown away ;-)
For example, the Xfig template is defined below. (I'll probably throw the
\inputOrWarn bit away...) Note also that the templates use the same
converter mechanism as is used by the graphics inset.
Regards,
Angus
PreambleDef WarnNotFound
%% Print a warning encased in an fbox.
\def\lyxstripprefix#1>{}
\newcommand{\warnNotFound}[1]{%
\def\lyxtempfilename{#1}%
\fbox{Could not find
\ttfamily\expandafter\lyxstripprefix\meaning\lyxtempfilename!}%
\typeout{Could not find \lyxtempfilename!}%
}
PreambleDefEnd
PreambleDef InputOrWarn
%% Input the file if it exists, using \input, else print a warning
\newcommand{\inputOrWarn}[1]{%
\IfFileExists{#1}{\input{#1}}{\warnNotFound{#1}}}
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
Transform Rotate
Transform Resize
Format LaTeX
TransformCommand Rotate RotationLatexCommand
TransformCommand Resize ResizeLatexCommand
Product
"$$RotateFront$$ResizeFront\\inputOrWarn{$$Basename.pstex_t}$$ResizeBack$$RotateBack"
UpdateFormat pstex
UpdateResult "$$Basename.pstex_t"
Requirement "graphicx"
Preamble WarnNotFound
Preamble InputOrWarn
FormatEnd
Format PDFLaTeX
TransformCommand Rotate RotationLatexCommand
TransformCommand Resize ResizeLatexCommand
Product
"$$RotateFront$$ResizeFront\\inputOrWarn{$$Basename.pdftex_t}$$ResizeBack$$RotateBack"
UpdateFormat pdftex
UpdateResult "$$Basename.pdftex_t"
Requirement "graphicx"
Preamble WarnNotFound
Preamble InputOrWarn
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
<<attachment: snapshot1.png>>
