3 #include "math_parser.h"
4 #include "math_binominset.h"
5 #include "math_decorationinset.h"
6 #include "math_dotsinset.h"
7 #include "math_funcinset.h"
8 #include "math_funcliminset.h"
9 #include "math_fracinset.h"
10 #include "math_kerninset.h"
11 #include "math_lefteqninset.h"
12 #include "math_macro.h"
13 #include "math_macrotable.h"
14 #include "math_macroarg.h"
15 #include "math_notinset.h"
16 #include "math_rootinset.h"
17 #include "math_spaceinset.h"
18 #include "math_specialcharinset.h"
19 #include "math_sqrtinset.h"
20 #include "math_symbolinset.h"
21 #include "math_stackrelinset.h"
24 MathAtom createMathInset(latexkeys const * l)
28 return MathAtom(new MathFuncLimInset(l));
30 return MathAtom(new MathSpecialCharInset(l->id));
38 return MathAtom(new MathSymbolInset(l));
40 return MathAtom(new MathStackrelInset);
42 return MathAtom(new MathKernInset);
45 return MathAtom(new MathBinomInset);
48 return MathAtom(new MathFracInset);
50 return MathAtom(new MathFracInset(true));
52 return MathAtom(new MathNotInset);
54 return MathAtom(new MathLefteqnInset);
56 return MathAtom(new MathSqrtInset);
58 return MathAtom(new MathRootInset);
59 case LM_TK_DECORATION:
60 return MathAtom(new MathDecorationInset(l->name));
62 return MathAtom(new MathSpaceInset(l->id));
64 return MathAtom(new MathDotsInset(l->name));
66 return MathAtom(new MathFuncInset(l->name));
70 MathAtom createMathInset(string const & s)
72 //cerr << "creating inset with name: '" << s << "'\n";
73 if (s.size() == 2 && s[0] == '#' && s[1] >= '1' && s[1] <= '9')
74 return MathAtom(new MathMacroArgument(s[1] - '0'));
76 if (s.size() == 3 && s[0] == '\\' && s[1] == '#' && s[2] >= '1' && s[2] <= '9')
77 return MathAtom(new MathMacroArgument(s[2] - '0'));
79 latexkeys const * l = in_word_set(s);
81 return createMathInset(l);
83 if (MathMacroTable::has(s))
84 return MathAtom(new MathMacro(s));
86 return MathAtom(new MathFuncInset(s));