make '$' default delimiter for inline maths instead of \(...\)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2363 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2001-07-26 16:56:23 +00:00
parent ece9f3739c
commit 43d1fd2562
4 changed files with 24 additions and 6 deletions

View File

@ -206,6 +206,7 @@ latexkeys const wordlist[] =
{"prime", LM_TK_SYM, LM_prime, LMB_NONE},
{"prod", LM_TK_BIGSYM, LM_prod, LMB_NONE},
{"propto", LM_TK_SYM, LM_propto, LMB_RELATION},
{"protect", LM_TK_PROTECT, 0, LMB_RELATION},
{"psi", LM_TK_SYM, LM_psi, LMB_NONE},
{"qquad", LM_TK_SPACE, LM_qquad, LMB_NONE},
{"quad", LM_TK_SPACE, LM_quad, LMB_NONE},

View File

@ -236,7 +236,7 @@ void MathMatrixInset::header_write(std::ostream & os) const
switch (getType()) {
case LM_OT_SIMPLE:
os << "\\(";
os << "$ ";
break;
case LM_OT_EQUATION:
@ -270,7 +270,7 @@ void MathMatrixInset::footer_write(std::ostream & os) const
switch (getType()) {
case LM_OT_SIMPLE:
os << "\\)";
os << "$";
break;
case LM_OT_EQUATION:

View File

@ -68,6 +68,7 @@ enum lexcode_enum {
LexSpace,
LexNewLine,
LexOther,
LexMath,
LexSelf
};
@ -171,6 +172,7 @@ void lexInit()
lexcode['\n'] = LexNewLine;
lexcode['%'] = LexComment;
lexcode['#'] = LexArgument;
lexcode['$'] = LexMath;
lexcode['+'] = lexcode['-'] = lexcode['*'] = lexcode['/']
= lexcode['<'] = lexcode['>'] = lexcode['='] = LexBOP;
@ -265,6 +267,9 @@ int yylex()
} else if (lexcode[c] == LexBOP) {
yylval.i = c;
return LM_TK_BOP;
} else if (lexcode[c] == LexMath) {
yylval.i = 0;
return LM_TK_MATH;
} else if (lexcode[c] == LexSelf) {
return c;
} else if (lexcode[c] == LexArgument) {
@ -429,10 +434,12 @@ MathInset * mathed_parse()
break;
}
case LM_TK_MATH:
case LM_TK_BEGIN: {
int i = yylval.i;
//lyxerr[Debug::MATHED] << "reading math environment " << i << " "
// << latex_mathenv[i].name << "\n";
lyxerr[Debug::MATHED]
<< "reading math environment " << i << " "
<< latex_mathenv[i].name << "\n";
MathInsetTypes typ = latex_mathenv[i].typ;
p = new MathMatrixInset(typ);
@ -475,7 +482,8 @@ MathInset * mathed_parse()
}
default:
lyxerr[Debug::MATHED] << "1: unknown math environment: " << typ << "\n";
lyxerr[Debug::MATHED]
<< "1: unknown math environment: " << typ << "\n";
}
p->setName(latex_mathenv[i].basename);
@ -484,7 +492,8 @@ MathInset * mathed_parse()
}
default:
lyxerr[Debug::MATHED] << "2 unknown math environment: " << t << "\n";
lyxerr[Debug::MATHED]
<< "2 unknown math environment: " << t << "\n";
}
return p;
@ -628,6 +637,9 @@ void mathed_parse(MathArray & array, unsigned flags)
<< "found newline unexpectedly, array: '" << array << "'\n";
break;
case LM_TK_PROTECT:
break;
case LM_TK_BIGSYM:
case LM_TK_SYM:
case LM_TK_FUNCLIM:
@ -750,6 +762,7 @@ void mathed_parse(MathArray & array, unsigned flags)
array.push_back(new MathFuncInset(yytext));
break;
case LM_TK_MATH:
case LM_TK_END:
--plevel;
return;

View File

@ -82,6 +82,8 @@ enum MathTokenEnum
///
LM_TK_LIMIT,
///
LM_TK_PROTECT,
///
LM_TK_STY,
///
LM_TK_MACRO,
@ -92,6 +94,8 @@ enum MathTokenEnum
///
LM_TK_NEWCOMMAND,
///
LM_TK_MATH,
///
LM_TK_STACK
};