#endif
#include "math_rootinset.h"
-#include "support/LOstream.h"
+#include "math_mathmlstream.h"
#include "Painter.h"
xp[2] = x + w; yp[2] = y + d;
xp[3] = x + w - 2; yp[3] = y + (d - a)/2 + 2;
xp[4] = x; yp[4] = y + (d - a)/2 + 2;
- pain.lines(xp, yp, 5, LColor::mathline);
+ pain.lines(xp, yp, 5, LColor::math);
}
-void MathRootInset::write(MathWriteInfo & os) const
+void MathRootInset::write(WriteStream & os) const
{
os << "\\sqrt[" << cell(0) << "]{" << cell(1) << '}';
}
-void MathRootInset::writeNormal(std::ostream & os) const
+void MathRootInset::normalize(NormalStream & os) const
{
- os << "[root ";
- cell(1).writeNormal(os);
- os << " ";
- cell(0).writeNormal(os);
- os << "]";
+ os << "[root " << cell(1) << ' ' << cell(1) << ']';
}
-bool MathRootInset::idxUp(int & idx, int & pos) const
+bool MathRootInset::idxUp(idx_type & idx) const
{
if (idx == 0)
return false;
idx = 0;
- pos = cell(0).size();
return true;
}
-bool MathRootInset::idxDown(int & idx, int & pos) const
+bool MathRootInset::idxDown(idx_type & idx) const
{
if (idx == 1)
return false;
idx = 1;
- pos = 0;
return true;
}
-string MathRootInset::octavize() const
+void MathRootInset::octavize(OctaveStream & os) const
{
- return "root(" + cell(1).octavize() + ',' + cell(0).octavize() + ')';
+ os << "root(" << cell(1) << ',' << cell(0) <<')';
+}
+
+
+void MathRootInset::mathmlize(MathMLStream & os) const
+{
+ os << MTag("mroot") << cell(1) << cell(0) << ETag("mroot");
}