]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_factory.C
make \newcommand{\bb}[1]{\mathbf{#1}} work for read/write/display.
[lyx.git] / src / mathed / math_factory.C
index 4a6d21c336708dc8f6e0285e203b148b086e0d17..1c49eb935b1fc1c7c36dbb95bae71219d8110789 100644 (file)
@@ -2,31 +2,35 @@
 
 #include "math_parser.h"
 #include "math_binominset.h"
+#include "math_boxinset.h"
 #include "math_decorationinset.h"
 #include "math_dotsinset.h"
 #include "math_funcinset.h"
 #include "math_funcliminset.h"
 #include "math_fracinset.h"
 #include "math_kerninset.h"
+#include "math_lefteqninset.h"
 #include "math_macro.h"
 #include "math_macrotable.h"
 #include "math_macroarg.h"
 #include "math_notinset.h"
 #include "math_rootinset.h"
+#include "math_sizeinset.h"
 #include "math_spaceinset.h"
 #include "math_specialcharinset.h"
 #include "math_sqrtinset.h"
-#include "math_symbolinset.h"
 #include "math_stackrelinset.h"
+#include "math_symbolinset.h"
+#include "math_unknowninset.h"
 
 
 MathAtom createMathInset(latexkeys const * l)
 {
        switch (l->token) {
        case LM_TK_FUNCLIM:
-               return MathAtom(new MathFuncLimInset(l));
+               return MathAtom(new MathFuncLimInset(l->name));
        case LM_TK_SPECIAL:
-               return MathAtom(new MathSpecialCharInset(l->id));
+               return MathAtom(new MathSpecialCharInset(static_cast<char>(l->id)));
        case LM_TK_SYM:
        case LM_TK_CMR:
        case LM_TK_CMSY:
@@ -49,6 +53,8 @@ MathAtom createMathInset(latexkeys const * l)
                return MathAtom(new MathFracInset(true));
        case LM_TK_NOT:
                return MathAtom(new MathNotInset);
+       case LM_TK_LEFTEQN:
+               return MathAtom(new MathLefteqnInset);
        case LM_TK_SQRT:
                return MathAtom(new MathSqrtInset);
        case LM_TK_ROOT:
@@ -59,8 +65,14 @@ MathAtom createMathInset(latexkeys const * l)
                return MathAtom(new MathSpaceInset(l->id));
        case LM_TK_DOTS:
                return MathAtom(new MathDotsInset(l->name));
+       case LM_TK_BOX:
+               return MathAtom(new MathBoxInset(l->name));
+       case LM_TK_FUNC:
+               return MathAtom(new MathFuncInset(l->name));
+       case LM_TK_STY:
+               return MathAtom(new MathSizeInset(l));
        }
-       return MathAtom(new MathFuncInset(l->name));
+       return MathAtom(new MathUnknownInset(l->name));
 }
 
 
@@ -70,7 +82,8 @@ MathAtom createMathInset(string const & s)
        if (s.size() == 2 && s[0] == '#' && s[1] >= '1' && s[1] <= '9')
                return MathAtom(new MathMacroArgument(s[1] - '0'));
 
-       if (s.size() == 3 && s[0] == '\\' && s[1] == '#' && s[2] >= '1' && s[2] <= '9')
+       if (s.size() == 3 && s[0] == '\\' && s[1] == '#'
+                       && s[2] >= '1' && s[2] <= '9')
                return MathAtom(new MathMacroArgument(s[2] - '0'));
 
        latexkeys const * l = in_word_set(s);
@@ -80,5 +93,6 @@ MathAtom createMathInset(string const & s)
        if (MathMacroTable::has(s)) 
                return MathAtom(new MathMacro(s));
 
-       return MathAtom(new MathFuncInset(s));
+       //cerr << "creating inset 2 with name: '" << s << "'\n";
+       return MathAtom(new MathUnknownInset(s));
 }