7 #include "math_envinset.h"
8 #include "math_mathmlstream.h"
9 #include "math_streamstr.h"
10 #include "support/LOstream.h"
13 MathEnvInset::MathEnvInset(string const & name)
14 : MathNestInset(1), name_(name)
18 MathInset * MathEnvInset::clone() const
20 return new MathEnvInset(*this);
24 void MathEnvInset::metrics(MathMetricsInfo & mi) const
27 ascent_ = xcell(0).ascent() + 1;
28 descent_ = xcell(0).descent() + 1;
29 width_ = xcell(0).width() + 2;
33 void MathEnvInset::draw(MathPainterInfo & pi, int x, int y) const
35 xcell(0).draw(pi, x + 1, y);
36 drawMarkers2(pi, x, y);
40 void MathEnvInset::write(WriteStream & os) const
42 os << "\\begin{" << name_ << '}' << cell(0) << "\\end{" << name_ << '}';
46 void MathEnvInset::normalize(NormalStream & os) const
48 os << "[env " << name_ << " " << cell(0) << ']';
52 void MathEnvInset::infoize(std::ostream & os) const
54 os << "Env: " << name_;