-
- MathTextCodes fcode = getCode(pos);
- unsigned char c = getChar(pos);
-
- if (MathIsSymbol(fcode)) {
- latexkeys const * l = lm_get_key_by_id(c, LM_TK_SYM);
-
- if (l == 0) {
- l = lm_get_key_by_id(c, LM_TK_BIGSYM);
- }
-
- if (l) {
- os << '\\' << l->name << ' ';
- } else {
- lyxerr << "Could not find the LaTeX name for " << c << " and fcode " << fcode << "!" << std::endl;
- }
- } else {
- if (fcode >= LM_TC_RM && fcode <= LM_TC_TEXTRM)
- os << '\\' << math_font_name[fcode - LM_TC_RM] << '{';
-
- // Is there a standard logical XOR?
- if ((fcode == LM_TC_TEX && c != '{' && c != '}') ||
- (fcode == LM_TC_SPECIAL))
- os << '\\';
- else {
- if (c == '{')
- ++brace;
- if (c == '}')
- --brace;
- }
- if (c == '}' && fcode == LM_TC_TEX && brace < 0)
- lyxerr <<"Math warning: Unexpected closing brace.\n";
- else
- os << c;
- }
-
- if (fcode >= LM_TC_RM && fcode <= LM_TC_TEXTRM)
- os << '}';
-