3 * \file math_macrotable.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
12 #ifndef MATH_MACROTABLE_H
13 #define MATH_MACROTABLE_H
27 MacroData(std::string const & def, int nargs, std::string const & disp);
29 std::string def() const { return def_; }
31 std::string disp() const { return disp_; }
33 int numargs() const { return numargs_; }
34 /// replace #1,#2,... by given MathAtom 0,1,..
35 void expand(MathArray const & from, MathArray & to) const;
47 // This contains a table of "global" macros that are always accessible,
48 // either because they implement a feature of standard LaTeX or some
49 // hack to display certain contents nicely.
53 /// Parse full "\def..." or "\newcommand..." or ...
54 void insert(std::string const & definition);
55 /// Insert pre-digested macro definition
56 void insert(std::string const & name, MacroData const & data);
57 /// Do we have a macro by that name?
58 bool has(std::string const & name) const;
60 MacroData const & get(std::string const & name) const;
65 static MacroTable & globalMacros();
69 typedef std::map<std::string, MacroData> table_type;