Juergen Spitzmueller wrote: > A bonus would be to use AMS \text instead of \textrm and require ams (the > bonus is that ams is automatically chosen and the sizes are always > correct). But AFAICS \text is not yet implemented (and I am not going to > implement it).
\text is implemented: See lib/symbols. Unfortunately it does not trigger amsmath, but the attached patch fixes that. I am applying that to 1.3 and 1.4. > BTW I also noticed that math_scriptinset doesn't seem to return neither > MATH_MODE nor TEXT_MODE initially. Is this correct? I don't think so: IMHO all math insets should return MATH_MODE unless they are special text insets. But then I don't understand how UNDECIDED_MODE works, so maybe this is wrong. So maybe the test above should read - flag.enabled((currentMode() == MATH_MODE && !textarg) - || (currentMode() == TEXT_MODE && textarg)); + flag.enabled(currentMode() != TEXT_MODE || textarg)); > P.S.: Next problem arises at the horizon: using LFUN_BOLD and friends in > text mode inserts the math font changes (mathbf etc.) instead of the \text > equivalents. This results in LaTeX errors. I think the handling in > math_nestinset::doDispatch schould care about currentMode(), no? Please don't look at mathed text mode at all. It is broken in many aspects, and fixing it would be wasted effort IMHO because we are going to use MathMBoxInset in 1.5 and that contains a proper LyXText. Georg
Index: src/mathed/ChangeLog =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/ChangeLog,v retrieving revision 1.500 diff -u -p -r1.500 ChangeLog --- src/mathed/ChangeLog 17 Jun 2005 14:35:19 -0000 1.500 +++ src/mathed/ChangeLog 24 Jun 2005 08:22:53 -0000 @@ -1,3 +1,7 @@ +2005-06-24 Georg Baum <[EMAIL PROTECTED]> + + * math_fontinset.C (validate): require amsmath for \text + 2005-06-16 Georg Baum <[EMAIL PROTECTED]> * math_colorinset.C (normalcolor): remove ... Index: src/mathed/math_fontinset.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_fontinset.C,v retrieving revision 1.31 diff -u -p -r1.31 math_fontinset.C --- src/mathed/math_fontinset.C 3 Apr 2005 07:48:20 -0000 1.31 +++ src/mathed/math_fontinset.C 24 Jun 2005 08:22:53 -0000 @@ -85,6 +85,8 @@ void MathFontInset::validate(LaTeXFeatur // Fraktur used: if (key_->name == "mathfrak" || key_->name == "mathbb") features.require("amssymb"); + if (key_->name == "text") + features.require("amsmath"); }