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_macro.h"
12 #include "math_macrotable.h"
13 #include "math_macroarg.h"
14 #include "math_notinset.h"
15 #include "math_rootinset.h"
16 #include "math_spaceinset.h"
17 #include "math_specialcharinset.h"
18 #include "math_sqrtinset.h"
19 #include "math_symbolinset.h"
20 #include "math_stackrelinset.h"
23 MathInset * createMathInset(latexkeys const * l)
27 return new MathFuncLimInset(l);
29 return new MathSpecialCharInset(l->id);
37 return new MathSymbolInset(l);
39 return new MathStackrelInset;
41 return new MathKernInset;
44 return new MathBinomInset;
47 return new MathFracInset;
49 return new MathFracInset(true);
51 return new MathNotInset;
53 return new MathSqrtInset;
55 return new MathRootInset;
56 case LM_TK_DECORATION:
57 return new MathDecorationInset(l->name);
59 return new MathSpaceInset(l->id);
61 return new MathDotsInset(l->name);
63 return new MathFuncInset(l->name);
67 MathInset * createMathInset(string const & s)
69 //cerr << "creating inset with name: '" << s << "'\n";
70 if (s.size() == 2 && s[0] == '#' && s[1] >= '1' && s[1] <= '9')
71 return new MathMacroArgument(s[1] - '0');
73 latexkeys const * l = in_word_set(s);
75 return createMathInset(l);
77 if (MathMacroTable::hasTemplate(s))
78 return new MathMacro(MathMacroTable::provideTemplate(s));
80 return new MathFuncInset(s);