2 * \file InsetMathEnv.cpp
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 "InsetMathEnv.h"
15 #include "MathStream.h"
16 #include "MathStream.h"
17 #include "support/std_ostream.h"
22 InsetMathEnv::InsetMathEnv(docstring const & name)
23 : InsetMathNest(1), name_(name)
27 Inset * InsetMathEnv::clone() const
29 return new InsetMathEnv(*this);
33 void InsetMathEnv::metrics(MetricsInfo & mi, Dimension & dim) const
35 cell(0).metrics(mi, dim);
37 // Cache the inset dimension.
42 void InsetMathEnv::draw(PainterInfo & pi, int x, int y) const
44 cell(0).draw(pi, x + 1, y);
45 drawMarkers(pi, x, y);
49 void InsetMathEnv::write(WriteStream & os) const
51 os << "\\begin{" << name_ << '}' << cell(0) << "\\end{" << name_ << '}';
55 void InsetMathEnv::normalize(NormalStream & os) const
57 os << "[env " << name_ << ' ' << cell(0) << ']';
61 void InsetMathEnv::infoize(odocstream & os) const
63 os << "Env: " << name_;