On Mon, Oct 23, 2006 at 05:07:04PM +0200, Charpentier Philippe wrote:

> Hi,
> I noted the following strange comportment of LyX-1.4.3 (and didn't see 
> something similar on bugzilla):
> If I define a math command in the preamble, for example \def\MR{\mathscr},
> when I use it in a math formula there is something curious:
> 
> If I type: \MR{C}, I see exactly this on the screen (\MR{ } in red, C in 
> blue) and it is traduced (in TeX) by: $\MR{C}$
> 
> If I type: \MR{C}^2, the (red) { and } disappear (I see \MRC2, with \MR 
> in red C in blue and 2 an exponent)
> and it is traduced by:  $\MR  C^{2}$ (which is curious but OK for 
> compilation)
> 
> If I type \MR{CD}^2 it is traduced (correctly) by $\MR{CD}^{2}$, but the 
> { and } disappear also on the screen
> 
> This is not the comportment of lyx for the internal commands it recognize
> for example for \mathbb: \mathbb{C}^2  is traduced by: $\mathbb{C}^{2}$
> 
> This comportment appears in 1.4.3, it does not exists in the previous 
> versions 1.4.x, 0<=x<3
> which all traduce the second example by $\MR{C}^{2}$ (and show on the 
> screen exactly what I type)
> 
> Is this a bug?

IMO this is not a bug. Things are represented a bit differently
on screen but the produced latex code is correct. You know that
the macro applies to the whole of the following script inset, so
it is clear what you will get.

If you want the old appearance on screen, then you should write
{\MR{CD}}^2, which more explicitly indicates what is the nucleus
of the script inset.

There is instead a bug in the Windows version as when you type
{whatever}^2 everything enclosed by braces disappear...

> At least I don't like that.

Instead I like it, sort of...

-- 
Enrico

Reply via email to