Asger Kunuk Alstrup wrote:

> I don't think you understood what I meant. I am not arguing to remove the
> entering and configuration of the rotation angle, or crippling the
> functionality to remove the "Extra" feature.

Yes, I had misunderstood.

However, I really don't like your proposal either, now that you have 
spelled it out. You are making the whole thing hard coded which means
the code has to know how and where to insert a transform into a new 
template.

With my approach you get existing transformations in new templates for free,
even if the command has arbitrary complex syntax.

For example, how would you add rotation to this Product (which is quite 
possible NOW by the way --- things have moved on in external_template land ;-)

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

Template XFig
        ...
        Format LaTeX
                Product 
"\IfFileExists{#1}{\input{$$BaseName.pstex_t}}{\warnNotFound{$$BaseName.pstex_t}}"
                UpdateFormat pstex
                UpdateResult "$$Basename.pstex_t"
                Requirement "graphicx"
                Preamble WarnNotFound
        FormatEnd
TemplateEnd

For me, it is trivial:
Template XFig
        ...
        Transform Rotate
        Format LaTeX
                TransformCommand Rotate RotationLatexCommand
                Product 
"\IfFileExists{#1}{$$RotateFront\input{$$BaseName.pstex_t}$$RotateBack}{\warnNotFound{$$BaseName.pstex_t}}"
                UpdateFormat pstex
                UpdateResult "$$Basename.pstex_t"
                Requirement "graphicx"
                Preamble WarnNotFound
        FormatEnd
TemplateEnd

> Keep the API to the user as simple as possible. You have not convinced
> me that we need the complex syntax yet.

Shrug. Nobody is using InsetExternal and that isn't because it has
a complex API. Anyway, I think that the above example should get
you on my side.

-- 

Reply via email to