9 #include "math_macrotable.h"
10 #include "math_macro.h"
11 #include "math_macrotemplate.h"
12 #include "math_parser.h"
13 #include "math_mathmlstream.h"
15 #include "math_support.h" // math_font_available
18 MathMacroTable::table_type MathMacroTable::macro_table;
21 void MathMacroTable::dump()
24 lyxerr << "\n------------------------------------------\n";
25 table_type::const_iterator it;
26 for (it = macro_table.begin(); it != macro_table.end(); ++it)
28 << " [" << it->second->asMacroTemplate()->nargs() << "] : "
29 << it->second->cell(0) << "\n";
30 lyxerr << "------------------------------------------\n";
35 MathAtom & MathMacroTable::provide(string const & name)
37 table_type::iterator pos = macro_table.find(name);
38 if (pos == macro_table.end()) {
39 lyxerr << "MathMacroTable::provideTemplate: no template with name '"
40 << name << "' available.\n";
46 void MathMacroTable::create(MathAtom const & at)
48 macro_table[at->asMacroTemplate()->name()] = at;
52 bool MathMacroTable::has(string const & name)
54 return macro_table.find(name) != macro_table.end();