On 18 Feb 2003, Jean-Marc Lasgouttes wrote:

> >>>>> "Davor" == Davor Cengija <[EMAIL PROTECTED]> writes:
> 
> Davor> ERT's, either open or closed, my document looks really ugly on
> Davor> the screen, almost unreadable. An option 'turn all ERT's to
> Davor> inlined/open/closed' would be really useful.
> 
> Uh? But \emph is exactly what you get with the '!' icon... Why do you
> need ERT?

I haven't followed this discussion seriously, so with the risk of fueling 
a previous discussion, it sounds like it's actually character styles that 
are needed here  --- if it's correct that the ERT is mostly used to do 
stuff such as \emph...  (which you can also get that through C-e)

Then I realized I ought to read this discussion so now I have, and my 
post below is a bit more thought through now.

Davor, in your first mail you wrote that you use ERT for:
 1. \emphs
 2. \myCodeFormat
 3. other latex
 4. your own commands

N:o 1 is already there with '!' or C-e, if all you want is \emph.

The \myCodeFormat sounds like what you really would like is either a 
paragraph style (environment) or a character style. Formatting on a 
paragraph level is already well handled by lyx in my opinion, and 
character styles is hopefully sometime in the future.

As for n:o 3 and 4, maybe you could give a few examples?
However, if this is mostly about that you've been using ERT to do stuff 
that you (now at least) can do directly from lyx, then that doesn't make 
it very important to change the ERT behaviour.

On the other hand, yesterday I actually realized that I personally like 
inlined ERT in some circumstances, e.g. I have some "macros" like these
        \matlab{}       -> MATLAB(c)
        \warp{}         -> Warp1
i.e. where I want to write a word in a consistent way all the time. In 
this case, the text flows better if it's inlined.

But when I think about, what I really want here is something like the 
math macros, i.e. something where you can specify both the (latex) output 
and the appearance in Lyx. 

Actually, I can do something quite similar using math macros, it just 
feels a bit weird starting in math mode and then changing to text mode. 
See here for a very simple example:
        http://www.md.kth.se/~chr/lyx/examples/math-macro_as_text-macro.lyx
and here for a much more advanced exxample:
        http://www.md.kth.se/~chr/lyx/songbook/example/
(there are screensshots). So it would probably be better to continue with 
this approach.

These are the alternatives (and a new one) I've seen so far:
 1. A user preference indicating how new ERTs are created: open or inline.
 2. Modify inset-toggle() to switch between three modes instead of two.
 3. A lyx function for changing all insets to a specific mode.
 4. A lyx function, such as inset-change-to-inlined-mode() that could be 
    bound to a key, S-C-I (for instance).
 5. A user preference for how large the closed insets can be.

1. I don't understand what is so bad about having new latex-insets 
created in an inline mode, but I think alternative 4 above would be almost 
as convenient - it would only be one key to change the newly created inset 
into inline mode.

2. I'm more sceptical. I'm not sure it would be useful to open all insets 
(it could be nice to close all of them though...).

3. The third alternative might work too, but then the behaviour of the
inset-toggle (C-i) would have to change, so that if the cursor is directly
behind an inset it can toggle that inset. (This assumes that there the 
cursor is not standing directly between two insets of course...)

4. Actually, if there is a lyx function for popping up the dialog where 
you can change mode to inline, you ought to be able to create a key macro 
that does this.

5. The insets actually do show their content, but only up to a few 
characters. What's the developers opinion about making the maximum n:o 
visible characters (within some range) be a user defined setting? Or 
perhaps a setting for each inset, but that might be overkill.

/Christian


-- 
Christian Ridderström                           http://www.md.kth.se/~chr


Reply via email to