John McCabe-Dansted wrote:
> In LyX 1.4.4, 2^Q in an mbox now no longer breaks the LaTeX run,
> however if we type "Cntl-M" "Cntl-M" "\phi" we get:
> 1) Something that looks exactly like $\phi$ on the screen.
> 2) Something ($\mbox{\phi}$) that produces obscure LaTeX errors as
> discussed previously in this thread.
>
> My suggestion is that we make it obvious that we are no longer in
> plain math mode. In a mbox, typing "\" should result in
> "textbackslash" on screen and "\" in the dvi/ps/pdf.
>
> As it stands the user has 3+ ways of entering a "\" in an mbox, the
> "\" key, the "Cntl-L" key and the GUI "TeX" button. If the user really
> wants to enter a TeX command in an mbox, the user can still press
> Cntl-L or TeX to get a TeX "\".
>
> Likewise copying a "\phi" symbol into a mbox should result in "\phi"
> as ASCII text in the PDF, just as if we had pasted the "\phi" symbol
> completely outside any math-mode environment.
>
> For consistency, I would also suggest that we replace '^'s with
> "\textasciicircum{}" in mboxes, just like we do in all other non-math
> environments.
All what you write distills down to a single problem: text in math, like
\mbox or \textrm contents is not implemented correctly. See e.g.
http://bugzilla.lyx.org/show_bug.cgi?id=1435,
http://bugzilla.lyx.org/show_bug.cgi?id=1527 and
http://bugzilla.lyx.org/show_bug.cgi?id=1092
The solution for all these problems is to implement text in math with a real
text inset (the same that is also used in table cells, the main text etc.).
Then all these problems are gone.
This has not happened so far because some internal code dependencies made it
almost impossible. Abdel has cleaned this up a lot, and I believe it is
possible to implement it now, but in won't happen for 1.5.0, since it would
still be a bigger change, and we are currently trying to iron out the
remaining bugs.
Georg