2001-08-13 14:19:16 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#include "math_parser.h"
|
|
|
|
#include "math_bigopinset.h"
|
2001-08-13 15:26:41 +00:00
|
|
|
#include "math_binominset.h"
|
2001-08-13 14:19:16 +00:00
|
|
|
#include "math_decorationinset.h"
|
|
|
|
#include "math_dotsinset.h"
|
|
|
|
#include "math_funcinset.h"
|
|
|
|
#include "math_funcliminset.h"
|
|
|
|
#include "math_fracinset.h"
|
2001-08-21 14:20:50 +00:00
|
|
|
#include "math_kerninset.h"
|
2001-08-13 14:19:16 +00:00
|
|
|
#include "math_macro.h"
|
|
|
|
#include "math_macrotable.h"
|
|
|
|
#include "math_noglyphinset.h"
|
2001-08-17 09:48:24 +00:00
|
|
|
#include "math_notinset.h"
|
2001-08-13 14:19:16 +00:00
|
|
|
#include "math_rootinset.h"
|
|
|
|
#include "math_spaceinset.h"
|
2001-08-30 08:55:13 +00:00
|
|
|
#include "math_specialcharinset.h"
|
2001-08-13 14:19:16 +00:00
|
|
|
#include "math_sqrtinset.h"
|
|
|
|
#include "math_symbolinset.h"
|
|
|
|
#include "math_stackrelinset.h"
|
|
|
|
|
|
|
|
|
|
|
|
MathInset * createMathInset(latexkeys const * l)
|
|
|
|
{
|
|
|
|
switch (l->token) {
|
|
|
|
case LM_TK_NOGLYPH:
|
|
|
|
case LM_TK_NOGLYPHB:
|
|
|
|
return new MathNoglyphInset(l);
|
|
|
|
case LM_TK_BIGSYM:
|
|
|
|
return new MathBigopInset(l);
|
|
|
|
case LM_TK_FUNCLIM:
|
|
|
|
return new MathFuncLimInset(l);
|
2001-08-30 08:55:13 +00:00
|
|
|
case LM_TK_SPECIAL:
|
|
|
|
return new MathSpecialCharInset(l->id);
|
2001-08-13 14:19:16 +00:00
|
|
|
case LM_TK_SYM:
|
|
|
|
return new MathSymbolInset(l);
|
|
|
|
case LM_TK_STACK:
|
|
|
|
return new MathStackrelInset;
|
2001-08-21 14:20:50 +00:00
|
|
|
case LM_TK_KERN:
|
|
|
|
return new MathKernInset;
|
2001-08-13 15:26:41 +00:00
|
|
|
case LM_TK_BINOM:
|
|
|
|
case LM_TK_CHOOSE:
|
|
|
|
return new MathBinomInset;
|
|
|
|
case LM_TK_OVER:
|
2001-08-13 14:19:16 +00:00
|
|
|
case LM_TK_FRAC:
|
|
|
|
return new MathFracInset;
|
2001-08-17 17:50:00 +00:00
|
|
|
case LM_TK_ATOP:
|
|
|
|
return new MathFracInset(true);
|
2001-08-17 09:48:24 +00:00
|
|
|
case LM_TK_NOT:
|
|
|
|
return new MathNotInset;
|
2001-08-13 14:19:16 +00:00
|
|
|
case LM_TK_SQRT:
|
|
|
|
return new MathSqrtInset;
|
|
|
|
case LM_TK_ROOT:
|
|
|
|
return new MathRootInset;
|
|
|
|
case LM_TK_DECORATION:
|
|
|
|
return new MathDecorationInset(l);
|
|
|
|
case LM_TK_SPACE:
|
|
|
|
return new MathSpaceInset(l->id);
|
|
|
|
case LM_TK_DOTS:
|
|
|
|
return new MathDotsInset(l);
|
|
|
|
}
|
|
|
|
return new MathFuncInset(l->name);
|
|
|
|
}
|
2001-08-15 05:50:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
MathInset * createMathInset(string const & s)
|
|
|
|
{
|
|
|
|
latexkeys const * l = in_word_set(s);
|
|
|
|
if (l)
|
|
|
|
return createMathInset(l);
|
|
|
|
|
|
|
|
if (MathMacroTable::hasTemplate(s))
|
|
|
|
return new MathMacro(MathMacroTable::provideTemplate(s));
|
|
|
|
|
|
|
|
return new MathFuncInset(s);
|
|
|
|
}
|