-
-
-MathMacro * MathMacroTable::cloneTemplate(string const & name)
-{
- return new MathMacro(provideTemplate(name));
-}
-
-
-void MathMacroTable::builtinMacros()
-{
- static bool built = false;
-
- if (built)
- return;
-
- built = true;
-
- lyxerr[Debug::MATHED] << "Building macros" << endl;
-
-/*
- // This macro doesn't have arguments
- {
- MathMacroTemplate * t = new MathMacroTemplate("notin", 0);
- MathDecorationInset * p = new MathDecorationInset("not");
- p->cell(0).push_back(LM_in, LM_TC_SYMB);
- t->push_back(p);
- insertTemplate(t);
- }
-*/
-
- createTemplate("silentmult", 0, "\\cdot");
- createTemplate("emptyset", 0, "\\not0");
- createTemplate("notin", 0, "\\not\\in");
-
-
-
-/*
- {
- MathMacroTemplate * t = new MathMacroTemplate("emptyset", 0);
- MathDecorationInset * p = new MathDecorationInset("not", LM_not);
- p->cell(0).push_back('O', LM_TC_VAR);
- t->push_back(p);
- insertTemplate(t);
- }
-*/
-
- {
-
- MathMacroTemplate * t = new MathMacroTemplate("land", 0);
- t->push_back(LM_wedge, LM_TC_SYMB);
- insertTemplate(t);
- }
-
- {
- MathMacroTemplate * t = new MathMacroTemplate("lor", 0);
- t->push_back(LM_vee, LM_TC_SYMB);
- insertTemplate(t);
- }
-
- {
- MathMacroTemplate * t = new MathMacroTemplate("to", 0);
- t->push_back(LM_rightarrow, LM_TC_SYMB);
- insertTemplate(t);
- }
-
- {
- MathMacroTemplate * t = new MathMacroTemplate("perp", 0);
- t->push_back(LM_bot, LM_TC_BOP);
- insertTemplate(t);
- }
-
-/*
- {
- MathMacroTemplate & m = createTemplate("lint", 4);
- istringstream is("\\int_{#1}^{#2}#3 d#4\0");
- mathed_parser_file(is, 0);
- MathMatrixInset * p = &m;
- mathed_parse(m.array, p, 0);
- }
-*/
-/*
- {
- MathMacroTemplate * t = new MathMacroTemplate("binomii", 2);
- istringstream is("\\left(\\frac{#1}{#2}\\right)\0");
- mathed_parser_file(is, 0);
- mathed_parse(t->array, t, 0);
- insertTemplate(t);
- }
-*/
-
- // binom has two arguments
- {
- MathFracInset * frac = new MathFracInset("atop");
- frac->cell(0).push_back(new MathMacroArgument(1));
- frac->cell(1).push_back(new MathMacroArgument(2));
-
- MathInset * inset = new MathDelimInset('(', ')');
- inset->push_back(frac);
-
- MathMacroTemplate * t = new MathMacroTemplate("binom", 2);
- t->push_back(inset);
-
- insertTemplate(t);
- }
-
-/*
- {
- MathFracInset * frac = new MathFracInset(LM_OT_ATOP);
- frac->cell(0)->push_back(new MathMacroArgument(1));
- frac->cell(1)->push_back(new MathMacroArgument(2));
-
- MathMacroTemplate * t = new MathMacroTemplate("choose", 2);
- t->push_back(frac);
-
- insertTemplate(t);
- }
-*/
-}