2 * \file math_envinset.C
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 #include "math_envinset.h"
14 #include "math_data.h"
15 #include "math_mathmlstream.h"
16 #include "math_streamstr.h"
17 #include "support/std_ostream.h"
24 InsetMathEnv::InsetMathEnv(string const & name)
25 : InsetMathNest(1), name_(name)
29 auto_ptr<InsetBase> InsetMathEnv::doClone() const
31 return auto_ptr<InsetBase>(new InsetMathEnv(*this));
35 void InsetMathEnv::metrics(MetricsInfo & mi, Dimension & dim) const
37 cell(0).metrics(mi, dim);
43 void InsetMathEnv::draw(PainterInfo & pi, int x, int y) const
45 cell(0).draw(pi, x + 1, y);
46 drawMarkers(pi, x, y);
50 void InsetMathEnv::write(WriteStream & os) const
52 os << "\\begin{" << name_ << '}' << cell(0) << "\\end{" << name_ << '}';
56 void InsetMathEnv::normalize(NormalStream & os) const
58 os << "[env " << name_ << ' ' << cell(0) << ']';
62 void InsetMathEnv::infoize(std::ostream & os) const
64 os << "Env: " << name_;