2 * \file InsetMathEnsureMath.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
7 * \author Enrico Forestieri
9 * Full author contact details are available in file CREDITS.
14 #include "InsetMathEnsureMath.h"
16 #include "MathExtern.h"
18 #include "MathStream.h"
25 InsetMathEnsureMath::InsetMathEnsureMath(Buffer * buf)
26 : InsetMathNest(buf, 1)
30 Inset * InsetMathEnsureMath::clone() const
32 return new InsetMathEnsureMath(*this);
36 void InsetMathEnsureMath::metrics(MetricsInfo & mi, Dimension & dim) const
38 FontSetChanger dummy(mi.base, "mathnormal");
39 cell(0).metrics(mi, dim);
44 void InsetMathEnsureMath::draw(PainterInfo & pi, int x, int y) const
46 FontSetChanger dummy(pi.base, "mathnormal");
47 cell(0).draw(pi, x, y);
48 drawMarkers(pi, x, y);
52 void InsetMathEnsureMath::metricsT(TextMetricsInfo const & mi, Dimension & dim) const
54 cell(0).metricsT(mi, dim);
58 void InsetMathEnsureMath::drawT(TextPainter & pain, int x, int y) const
60 cell(0).drawT(pain, x, y);
64 void InsetMathEnsureMath::write(WriteStream & os) const
66 ModeSpecifier specifier(os, MATH_MODE);
67 os << "\\ensuremath{" << cell(0) << "}";
71 docstring InsetMathEnsureMath::mathmlize(MathStream & os) const
73 return lyx::mathmlize(cell(0), os);
77 void InsetMathEnsureMath::infoize(odocstream & os) const