>>>>> "Dekel" == Dekel Tsur <[EMAIL PROTECTED]> writes:

Dekel> On Fri, Feb 15, 2002 at 02:14:39PM +0100, Jean-Marc Lasgouttes
Dekel> wrote: Change to \newcommand{\shortcaption}[1]{%
Dekel> \let\lyxcaption=\caption%
Dekel> \renewcommand{\caption}[1]{\lyxcaption[#1]{##1}}% }
>>  Except that the short caption will be used for all subsequent
>> captions without short caption. So the code has to be slightly more
>> complicated.

Dekel> It only affects the current scope which is usually the current
Dekel> float (and it is rare to have more than one caption in one
Dekel> float).

Fair enough. Nevertheless, we would want to do the same for \section,
and this will break.

Moreover, I do not like redefining \caption, since
you never now what bad intereaction it can create with another
package. And outputing systematically \lyxcaption is just bad, I
think.

There could be a C++ solution to the problem, which would not be too
difficult. It would go like this

Style ShortVersion
  LatexType     OptArg
...
End

Style Caption
  LatexType     Command
  UseOptArg     1
...
End

It would go like this: when the latex generator sees a OptArg, it will
output its contents to a optarg ostringstream, but output no latex
code.

Then, on next layout
- if optarg is empty, do nothing special
- if optarg is not empty
  - if layout is UseOptArg 1, output \commandname[optarg]{...}
  - if layout is UseOptArg 0, output normally \commandname{...}, but
  add an error inset.
  In any case, clear the optarg stream.

This scheme looks like both easy to implement, and solid. And I think
having this 'ShortVersion' layout would actually make sense.

However, if we decide to have a proer insetcaption and insetsection,
(or whatever), we will get in serious trouble when trying to ensure
backwards compatibility.

JMarc

Reply via email to