6 #include "math_macrotable.h"
7 #include "math_macro.h"
8 #include "math_macrotemplate.h"
9 #include "math_parser.h"
10 #include "math_mathmlstream.h"
12 #include "math_support.h" // math_font_available
15 MathMacroTable::table_type MathMacroTable::macro_table;
18 void MathMacroTable::dump()
21 lyxerr << "\n------------------------------------------\n";
22 table_type::const_iterator it;
23 for (it = macro_table.begin(); it != macro_table.end(); ++it)
25 << " [" << it->second->asMacroTemplate()->nargs() << "] : "
26 << it->second->cell(0) << "\n";
27 lyxerr << "------------------------------------------\n";
32 MathAtom & MathMacroTable::provide(string const & name)
34 table_type::iterator pos = macro_table.find(name);
35 if (pos == macro_table.end()) {
36 lyxerr << "MathMacroTable::provideTemplate: no template with name '"
37 << name << "' available.\n";
43 void MathMacroTable::create(MathAtom const & at)
45 macro_table[at->asMacroTemplate()->name()] = at;
49 bool MathMacroTable::has(string const & name)
51 return macro_table.find(name) != macro_table.end();