7 #include "math_stringinset.h"
8 #include "math_mathmlstream.h"
9 #include "math_streamstr.h"
11 #include "math_support.h"
12 #include "math_parser.h"
13 #include "LaTeXFeatures.h"
17 MathStringInset::MathStringInset()
21 MathStringInset::MathStringInset(string const & s)
26 MathInset * MathStringInset::clone() const
28 return new MathStringInset(*this);
32 void MathStringInset::metrics(MathMetricsInfo & mi) const
34 mathed_string_dim(mi.base.font, str_, ascent_, descent_, width_);
38 void MathStringInset::draw(MathPainterInfo & pi, int x, int y) const
40 //lyxerr << "drawing '" << str_ << "' code: " << code_ << endl;
41 drawStr(pi, pi.base.font, x, y, str_);
45 void MathStringInset::normalize(NormalStream & os) const
47 os << "[string " << str_ << ' ' << "mathalpha" << "]";
51 void MathStringInset::maplize(MapleStream & os) const
53 if (/*code_ != LM_TC_VAR || */ str_.size() <= 1) {
54 os << ' ' << str_ << ' ';
58 // insert '*' between adjacent chars if type is LM_TC_VAR
60 for (string::size_type i = 1; i < str_.size(); ++i)
65 void MathStringInset::octavize(OctaveStream & os) const
67 if (/*code_ != LM_TC_VAR ||*/ str_.size() <= 1) {
68 os << ' ' << str_ << ' ';
72 // insert '*' between adjacent chars if type is LM_TC_VAR
74 for (string::size_type i = 1; i < str_.size(); ++i)
79 void MathStringInset::mathmlize(MathMLStream & os) const
82 if (code_ == LM_TC_VAR)
83 os << "<mi> " << str_ << " </mi>";
84 else if (code_ == LM_TC_CONST)
85 os << "<mn> " << str_ << " </mn>";
86 else if (code_ == LM_TC_RM || code_ == LM_TC_TEXTRM)
87 os << "<mtext> " << str_ << " </mtext>";
94 void MathStringInset::write(WriteStream & os) const