have been thinking about Jean-Marc's proposal to scrap InsetGraphics 
entirely and use InsetExternal in its place. Essentially, he suggests 
extending the ExternalTemplate grammar so that the dialog would have 
extra widgets that 'appear by magic' if the template supports 
scaling, rotating etc.

I imagined something like (below), although it is still a little 
fuzzy around the edges. In particular, I am unsure how to tell LyX 
that it should supply the various parameters. See, eg, the $$float 
variable in <transform name="scale">. More confusingly still, I have 
no idea how to specify how these things could be nested. See the mess 
on the <success> line...

<format name="xfig">
        <target name="latex_for_latex">
                <export_formats>ps_tex</export_formats>
                <export_format name="ps_tex">
                        <files>$$base.eps $$base.ps_tex</files>
                </export_format>
                <transform name="scale">
                        <begin> \scalebox{$$float}{ </begin>
                        <end> } </end>
                </transform>
                <transform name="rotate">
                        <begin> \rotatebox{$$length}{ </begin>
                        <end> } </end>
                </transform>
                <output>
                        <success> $$transforms "\input{$$base.ps_tex}"</success>
                        <failure> \framebox{Unable to generate $$base.ps_tex} 
</failure>
                </output>
        </target>
</format>

The disadvantage of all this is that the different latex flavours (if 
Alfredo's dream comes true) will duplicate identical code. Can xml 
handle

        <target name="latex_for_pdflatex" contents="latex_for_latex">

or similar?

Presumably we would also need some grammar to specify what additional 
widgets were needed on the dialog. Here I can imagine "LyX scale" for 
the size on the LyX screen, together with "scale" and "rotate" for 
the parameters exported (in this case) to latex.

Any input from the experts?

-- 
Angus

Reply via email to