7 #include "math_macrotemplate.h"
8 #include "math_macro.h"
9 #include "macro_support.h"
10 #include "support/LOstream.h"
11 #include "support/LAssert.h"
15 //using namespace std;
17 MathMacroTemplate::MathMacroTemplate() :
18 MathParInset(LM_ST_TEXT, "undefined", LM_OT_MACRO),
23 MathMacroTemplate::MathMacroTemplate(string const & nm, int na) :
24 MathParInset(LM_ST_TEXT, nm, LM_OT_MACRO),
29 int MathMacroTemplate::nargs() const
35 void MathMacroTemplate::WriteDef(ostream & os, bool fragile) const
37 os << "\n\\newcommand{\\" << name << "}";
40 os << "[" << na_ << "]";
46 const_cast<MathMacroTemplate *>(this)->Write(os, fragile);
51 void MathMacroTemplate::Metrics()
53 MathParInset::Metrics();
60 void MathMacroTemplate::draw(Painter & pain, int x, int y)
62 MathParInset::draw(pain, x + 2, y + 1);
66 pain.rectangle(x, y - a, w, h, LColor::blue);