Martin Vermeer wrote: >> Something even simpler would be to do the mutate call only if there are >> no dollar signs, > > That will still pass through non-latexable stuff.
Yes. But if we want to prevent that we have to disable C-M with a selection completely (and also unknown commands in mathed). >> but I am not sure whether we should do anything here at all. >> formulas of type "none" are not officially supported after all. > > This is something people are allowed to do by the UI. They tend to get > distressed if LyX accepts stuff that then makes LaTeX mutter obtuse > satanistic incantations under its breath. Of course, and I agree that these cases should be avoided whereever possible. > I know there is more of that, > but this one is sooo easy to prevent. I don't think so. This particular case may be easy, but what about "\[a\] some text \[b\]"? Of course we can add checks for \[ and every other valid delimiter, too, but to avoid exactly that I used MathHullInset::Read() for the conversion. Or we need to go back to require the delimiters and and do any mutate() call, but I am not sure wehther that is more user friendly. >> I don't think that this is a good idea. We should not do anything with >> \textrm etc. These should be replaced by a working MathMBoxInset that >> stores its content as a InsetText. That will solve all problems, because >> then the InsetText can contain any math formula. > > Yes, but when? For 1.5.0 IMO. > This is a here and now problem, with a ready fix. I have to look at the fix, but I fear that it will have side effects. What about multiple nesting in \textrm? Since the effort to check all possible side effects will be wasted once we are going to the "real" solution we should not spend any time on improving the current thing, especially since it is like that since ages. The sooner we have a solution in the 1.5 tree, the better. Georg