> PS: Since this happens very often, I think we should have an acronym for this. *hmpf* -- André Pönitz ............................................. [EMAIL PROTECTED]
Index: math_charinset.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_charinset.C,v retrieving revision 1.2 diff -u -p -r1.2 math_charinset.C --- math_charinset.C 2001/08/06 17:20:25 1.2 +++ math_charinset.C 2001/08/08 12:25:19 @@ -58,40 +58,15 @@ void MathCharInset::draw(Painter & pain, void MathCharInset::write(std::ostream & os, bool) const { - int brace = 0; + if (code_ >= LM_TC_RM && code_ <= LM_TC_TEXTRM) + os << '\\' << math_font_name[code_ - LM_TC_RM] << '{'; - if (MathIsSymbol(code_)) { - latexkeys const * l = lm_get_key_by_id(char_, LM_TK_SYM); + if ((code_ == LM_TC_TEX && char_ != '{' && char_ != '}') || + (code_ == LM_TC_SPECIAL)) + os << '\\'; - if (l == 0) - l = lm_get_key_by_id(char_, LM_TK_BIGSYM); + os << char_; - if (l) { - os << '\\' << l->name << ' '; - } else { - lyxerr << "Could not find the LaTeX name for " - << char_ << " and code_ " << code_ << "!" << std::endl; - } - } else { - if (code_ >= LM_TC_RM && code_ <= LM_TC_TEXTRM) - os << '\\' << math_font_name[code_ - LM_TC_RM] << '{'; - - // Is there a standard logical XOR? - if ((code_ == LM_TC_TEX && char_ != '{' && char_ != '}') || - (code_ == LM_TC_SPECIAL)) - os << '\\'; - else { - if (char_ == '{') - ++brace; - if (char_ == '}') - --brace; - } - if (char_ == '}' && code_ == LM_TC_TEX && brace < 0) - lyxerr <<"Math warning: Unexpected closing brace.\n"; - else - os << char_; - } - if (code_ >= LM_TC_RM && code_ <= LM_TC_TEXTRM) os << '}'; } @@ -99,7 +74,5 @@ void MathCharInset::write(std::ostream & void MathCharInset::writeNormal(std::ostream & os) const { - os << "[sqrt "; - cell(0).writeNormal(os); - os << "] "; + os << char_; }