]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_parser.C
make \newcommand{\bb}[1]{\mathbf{#1}} work for read/write/display.
[lyx.git] / src / mathed / math_parser.C
index 0a899b692c8cd4324ef27373f54497ef2d8c2097..98940b4537ccd53da89cda5bb27680a899370b0e 100644 (file)
@@ -93,7 +93,7 @@ namespace {
 
 bool stared(string const & s)
 {
-       unsigned const n = s.size();
+       string::size_type const n = s.size();
        return n && s[n - 1] == '*';
 }
 
@@ -504,7 +504,7 @@ bool Parser::parse_lines(MathAtom & t, bool numbered, bool outmost)
                return false;
        }
 
-       int const cols = p->ncols();
+       MathInset::col_type const cols = p->ncols();
 
        // save global variables
        bool   const saved_num   = curr_num_;
@@ -519,7 +519,7 @@ bool Parser::parse_lines(MathAtom & t, bool numbered, bool outmost)
                curr_label_.erase();
 
                // reading a row
-               for (int col = 0; col < cols; ++col) {
+               for (MathInset::col_type col = 0; col < cols; ++col) {
                        //lyxerr << "reading cell " << row << " " << col << "\n";
                        parse_into(p->cell(col + row * cols), FLAG_BLOCK);
 
@@ -673,6 +673,12 @@ bool Parser::parse_normal(MathAtom & matrix)
 
        string const name = getArg('{', '}');
 
+       if (name == "math") {
+               matrix = MathAtom(new MathHullInset(LM_OT_SIMPLE));
+               parse_into(matrix->cell(0), 0);
+               return true;
+       }
+
        if (name == "equation" || name == "equation*" || name == "displaymath") {
                curr_num_ = (name == "equation");
                curr_label_.erase();
@@ -782,7 +788,7 @@ void Parser::parse_into(MathArray & array, unsigned flags, MathTextCodes code)
 
                else if (t.cat() == catParameter) {
                        Token const & n = getToken();
-                       array.push_back(MathAtom(new MathMacroArgument(n.character() - '0')));
+                       array.push_back(MathAtom(new MathMacroArgument(n.character()-'0', code)));
                }
 
                else if (t.cat() == catBegin) {
@@ -948,8 +954,8 @@ void Parser::parse_into(MathArray & array, unsigned flags, MathTextCodes code)
                        return;
                }
 
-/*
                // Disabled
+#if 0
                else if (t.cs() == "mbox") {
                        array.push_back(createMathInset(t.cs()));
                        // slurp in the argument of mbox
@@ -957,7 +963,8 @@ void Parser::parse_into(MathArray & array, unsigned flags, MathTextCodes code)
                        MathBoxInset * p = array.back()->asBoxInset();
                        //lyx::assert(p);
                }
-*/
+#endif
+
        
                else if (t.cs().size()) {
                        latexkeys const * l = in_word_set(t.cs());