2 * \file InsetMathSize.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 "InsetMathSize.h"
15 #include "MathStream.h"
16 #include "MathParser.h"
17 #include "MathStream.h"
19 #include "support/convert.h"
20 #include "support/std_ostream.h"
28 InsetMathSize::InsetMathSize(latexkeys const * l)
29 : InsetMathNest(1), key_(l), style_(Styles(convert<int>(l->extra)))
33 auto_ptr<InsetBase> InsetMathSize::doClone() const
35 return auto_ptr<InsetBase>(new InsetMathSize(*this));
39 void InsetMathSize::metrics(MetricsInfo & mi, Dimension & dim) const
41 StyleChanger dummy(mi.base, style_);
42 cell(0).metrics(mi, dim);
48 void InsetMathSize::draw(PainterInfo & pi, int x, int y) const
50 StyleChanger dummy(pi.base, style_);
51 cell(0).draw(pi, x + 1, y);
52 drawMarkers(pi, x, y);
56 void InsetMathSize::write(WriteStream & os) const
58 os << "{\\" << key_->name << ' ' << cell(0) << '}';
62 void InsetMathSize::normalize(NormalStream & os) const
64 os << '[' << key_->name << ' ' << cell(0) << ']';
68 void InsetMathSize::infoize(odocstream & os) const
70 os << "Size: " << key_->name;