Uwe Stöhr wrote: > Georg Baum schrieb: > >>> We need to parse everything as a valid TeX expression. > > I don't understand this because the content of ERT insets are also not > parsed as valid TeX.
The difference between text and math in .lyx files is that math is stored in TeX syntax, and text has its own file format. Each text insets reads its own contents, but in math we have a global parser that reads the whole equation and creates all the different insets. Therefore it is easy to have real ERT insets in text (\begin_insert ERT ... \end_inset), but for math you would need to invent an escaping mechanism that breaks out of the TeX syntax. This is certainly possible (and we'll need something like that anyway when we introduce real text in math), but this is some work (it is assumed at many places that LyX math is represented in TeX syntax) and of course a file format change. > Fixing the bugs is of course the best solution but LyX cannot take care > of all math specialities that some users might want to use. OK math-ERT > is something for the future and we should keep our focus on fixing the > most annoying math bugs. The problem (apart from simple bugs) is that we have some math insets that don't support everything that is supported by their LaTeX counterpart (e.g. xymatrix). I don't see any need for a real math ERT inset if we follow a simple rule: If native support for some LaTeX command is implemented in math, it must cover all possible arguments. Then we have only fully supported commands and commands that are not supported at all, resulting in red text. The latter should not be a problem, problematic are the "half-supported" ones. Georg