On 2016-09-16, Enrico Forestieri wrote: > On Fri, Sep 16, 2016 at 12:33:08AM +0100, Guillaume Munch wrote: >> Le 15/09/2016 à 23:52, Enrico Forestieri a écrit : >> >On Thu, Sep 15, 2016 at 01:41:30PM +0100, Guillaume Munch wrote:
>> >>Also, I was surprised to see that when I enter \textit,\mbox,... it gets >> >>wrapped inside a \text environment. >> > >> >Both issues should be solved now. >> Yes, I confirm. Thank you. I suggest different keywords for a) commands that switch to text mode, and b) commands that only work in text mode. How about "textmode" for a) # as before in lib/symbols and "textcommand" for b)? # cf. lib/unicodesymbols >> In practice I find that one has to change one's habits when writing text >> in math. The new behaviour seems consistent and understandable though. > I simply hate it ;-) I am not happy with it either... >> I am wondering though, as I thought that the original patch was only >> supposed to change what happens when one inserts a macro: how come does >> the code to output to latex had to change? Did I miss something about >> the effect of the patch? > There are two different series of patches. > The one from #9742 simply adjusts things on export. The other one > implements the desiderata from Günter so that proper real insets are > inserted to assure the correct mode. These are orthogonal to each > other. ... My aims are * keep it simple * promote clean formula writing * enable fast formula writing * ensure that the content of a Formula Inset is valid LaTeX (as far as possible, but this is a topic for a different thread). I appreciate the concessions. However, with the current status none of my aims is reached. > I really hate the automatic insertion of real insets because they are not > practical from my point of view. They make hard navigation and selection. > For example, if you type "\int a" in an \mbox, you now get > "\mbox{\ensuremath{\int a}}", but if you dissolve \ensuremath, you > get "\mbox{\ensuremath{\int}a}" at export time. This is what I think > should be the case, as if I type \int in textmode I only want an > integral sign in the middle of text. In a formula, \int is usually followed by the limits or a variable. Both require math-mode. When typing a mathcommand with the cursor at the last position of an \mbox, I usually want to get out of the "mathematical text" (back to the enclosing math-mode) not in a new inset. > Instead, now I have to remember to move out of \ensuremath in order to > obtain a textmode "a" (or remember to dissolve the now real > \ensuremath). Moving out of math-mode is fortunately simple ([Space]). Moving out of "mathematical text" is more cumbersome. Dissolving an inset would become simpler if LyX supported dissolving with [Del] at the last position. Günter