3 #include "math_parser.h"
4 #include "math_binominset.h"
5 #include "math_boxinset.h"
6 #include "math_decorationinset.h"
7 #include "math_dotsinset.h"
8 #include "math_funcinset.h"
9 #include "math_funcliminset.h"
10 #include "math_fracinset.h"
11 #include "math_kerninset.h"
12 #include "math_lefteqninset.h"
13 #include "math_macro.h"
14 #include "math_macrotable.h"
15 #include "math_macroarg.h"
16 #include "math_notinset.h"
17 #include "math_rootinset.h"
18 #include "math_spaceinset.h"
19 #include "math_specialcharinset.h"
20 #include "math_sqrtinset.h"
21 #include "math_symbolinset.h"
22 #include "math_stackrelinset.h"
25 MathAtom createMathInset(latexkeys const * l)
29 return MathAtom(new MathFuncLimInset(l->name));
31 return MathAtom(new MathSpecialCharInset(l->id));
39 return MathAtom(new MathSymbolInset(l));
41 return MathAtom(new MathStackrelInset);
43 return MathAtom(new MathKernInset);
46 return MathAtom(new MathBinomInset);
49 return MathAtom(new MathFracInset);
51 return MathAtom(new MathFracInset(true));
53 return MathAtom(new MathNotInset);
55 return MathAtom(new MathLefteqnInset);
57 return MathAtom(new MathSqrtInset);
59 return MathAtom(new MathRootInset);
60 case LM_TK_DECORATION:
61 return MathAtom(new MathDecorationInset(l->name));
63 return MathAtom(new MathSpaceInset(l->id));
65 return MathAtom(new MathDotsInset(l->name));
67 return MathAtom(new MathBoxInset(l->name));
69 return MathAtom(new MathFuncInset(l->name));
73 MathAtom createMathInset(string const & s)
75 //cerr << "creating inset with name: '" << s << "'\n";
76 if (s.size() == 2 && s[0] == '#' && s[1] >= '1' && s[1] <= '9')
77 return MathAtom(new MathMacroArgument(s[1] - '0'));
79 if (s.size() == 3 && s[0] == '\\' && s[1] == '#'
80 && s[2] >= '1' && s[2] <= '9')
81 return MathAtom(new MathMacroArgument(s[2] - '0'));
83 latexkeys const * l = in_word_set(s);
85 return createMathInset(l);
87 if (MathMacroTable::has(s))
88 return MathAtom(new MathMacro(s));
90 //cerr << "creating inset 2 with name: '" << s << "'\n";
91 return MathAtom(new MathFuncInset(s));