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. > 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, * if I write \textdegree in mathed, LyX wraps it when exporting (after your patch). >> 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... > 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 one seems to me a philosophical argument that I don't understand. > Ideally, I would avoid any non necessary inset that simply clutter > the display and cause problems when you do not exactly position the > cursor when making an insertion. >> This is why I strongly prefer a clear specification of the desired behaviour >> and LyX format before any changes of text-in-math support. > There is no such a change but simply a prosecution of a work initiated > many years ago that proved to be effective. I am going to commit the > patch because it is no change of direction, unless the majority votes > against and stops me. At least, this will stop the silent wrapping of text-mode macros in \ensuremath if correctly used... Günter