Dear Enrico, thanks for the patch. I tested it and unfortunately, it solves only part of the problem:
On 2015-09-12, Enrico Forestieri wrote: > On Thu, Sep 10, 2015 at 02:14:26PM +0000, Guenter Milde wrote: >> LyX mis-handles some text commands in math mode. >> Try: >> * open LyX, >> * open a new document, >> * open a math box (CTRL-M) >> * write \text\AA ... >> A complete discussion and patch are at http://www.lyx.org/trac/ticket/9742 > I think that all is needed is the attached patch. While the patch fixes the worst case (i.e. the above example), it is no solution for #9742: * open LyX, * open a new document, * open a math box (CTRL-M) * write \AA The ERT is replaced by a blue italic Å, indicating that LyX regards "\AA" as a valid math command. However, when compiling, there is the error Missing character: There is no � in font cmr10! In contrast, if you input a literal Å in math mode (with the compose-key or a scandinavian keyboard, say), it is shown as just the same italic blue letter but exported as $\mathring{A}$ (due to the lib/unicodesymbols replacements) which compiles fine -- identical looking symbols, where one works and one fails! The same problem holds for "\O" and "\textdegree"¹. No error but a completely different symbol is the outcome for 17 of the 18 "wasy textmode" commands in /lib/symbols (\AC is tagged as “textmode”, but works in text and maths). Günter ¹ \textdegree works in math if and only if the textcomp package is *not* loaded and the LaTeX inputencoding is set to one of the 8-bit encodings that provide a fallback definition of \textdegree as \ensuremath{^\circ}.