On Thu, Sep 08, 2016 at 10:13:27PM +0000, Guenter Milde wrote:

> On 2016-09-08, Enrico Forestieri wrote:
> > On Thu, Sep 08, 2016 at 04:42:30PM +0000, Guenter Milde wrote:
> 
> 
> >> I don't want blurring the distinction of text-mode and math-mode commands.
> 
> > I don't understand this argument. 
> 
> For me (and others), LyX is also a way to learn LaTeX. Typing LaTeX macros
> in LyX that work in LyX but not in TeX is counter-productive in this case.

Come on! If you really put forward that argument I can say that by
looking at the source pane you get the same result. And you have to look
at it, otherwise you can miss that lyx was inserting \ensuremath, for
example, explicitly or not.

> > If you enter a text-mode command
> > directly in a latex equation, you get the same kind of error. You
> > have to insert it in a proper environment for it to work and you
> > could still do it in lyx. Now, you have to do it for avoiding
> > the error, while, with the patch, lyx will do it for you.
> 
> However, this is inconsistent:
> 
> * if I insert a literal degree-sign from the keyboard into mathed, LyX
>   wraps it in \text while inserting, 

Yes, this was my doing after you insisted so much that at the end
I surrendered and changed this from the previous behavior of "silently"
wrapping it in \lyxmathsym. I will never do again the same error.

> * if I write \textdegree in mathed, LyX wraps it when exporting (after your
>   patch).

Maybe I should go back and reconsider the insertion of the literal
degree-sign in explicit \text.

> >> It is far more difficult to restore this distinction after starting to
> >> support commands in the wrong mode with "silent additions".
> 
> > LyX is full of silent additions aimed at avoiding the occurrence of errors.
> > I don't buy the argument that a further inset has to be explicitly
> > inserted. 
> 
> Silent "helpers" all too often stay in the way when doing something the
> original author did not think of...

Yes, I agree in principle, but not in this case.

> > If you copy and paste an equation outside of lyx, the
> > "silent additions" are also provided, so they are not so silent.
> 
> Really? With an integral in "mathed text" I got:
> 
> * in the source pane: $A=\text{\ensuremath{\int}d}x$
> 
> * copying the complete mathbox: A=\text{\ensuremath{\int}d}x
>  
> * copying from inside the math-box: \text{\int d}x

This is really strange. I did the same, progressively reducing the
selection from outside to inside I obtain:

1) A=\text{\ensuremath{\int}d}x
2) =\text{\ensuremath{\int}d}x
3) =\text{\ensuremath{\int}d}
4) \text{\ensuremath{\int}d}
5) \ensuremath{\int}d

So, it seems that I cannot reproduce.

-- 
Enrico

Reply via email to