-
-
-MathMacro * MathMacroTable::cloneTemplate(string const & name)
-{
- return new MathMacro(provideTemplate(name));
-}
-
-
-void MathMacroTable::builtinMacros()
-{
- built = true;
-
- lyxerr[Debug::MATHED] << "Building macros" << endl;
-
- // This macro doesn't have arguments
- {
- MathMacroTemplate & m = provideTemplate("notin", 0);
- m.push_back(new MathAccentInset(LM_in, LM_TC_BOPS, LM_not), LM_TC_INSET);
- }
-
- // This macro doesn't have arguments
- {
- MathMacroTemplate & m = provideTemplate("silentmult", 0);
- istringstream is("\\cdot\0");
- mathed_parser_file(is, 0);
- MathParInset * p = &m;
- mathed_parse(m.array, p, 0);
- }
-
- {
- MathMacroTemplate & m = provideTemplate("emptyset", 0);
- m.push_back(new MathAccentInset('0', LM_TC_RM, LM_not), LM_TC_INSET);
- }
-
- {
- MathMacroTemplate & m = provideTemplate("perp", 0);
- m.GetData().push_back(LM_bot, LM_TC_BOP);
- }
-
- {
- MathMacroTemplate & m = provideTemplate("lint", 4);
- istringstream is("\\int_{#1}^{#2}#3 d#4\0");
- mathed_parser_file(is, 0);
- MathParInset * p = &m;
- mathed_parse(m.array, p, 0);
- }
-
- // binom has two arguments
- {
- MathFracInset * frac = new MathFracInset(LM_OT_ATOP);
- frac->push_back(new MathMacroArgument(1), LM_TC_INSET);
- frac->denom()->push_back(new MathMacroArgument(2), LM_TC_INSET);
-
- MathParInset * inset = new MathDelimInset('(', ')');
- inset->push_back(frac, LM_TC_ACTIVE_INSET);
-
- MathMacroTemplate & m = provideTemplate("binom", 2);
- m.push_back(inset, LM_TC_ACTIVE_INSET);
- }
-}