7 #include "math_stringinset.h"
8 #include "math_mathmlstream.h"
9 #include "math_streamstr.h"
10 #include "math_support.h"
14 MathStringInset::MathStringInset(string const & s)
19 MathInset * MathStringInset::clone() const
21 return new MathStringInset(*this);
25 void MathStringInset::metrics(MathMetricsInfo & mi) const
27 mathed_string_dim(mi.base.font, str_, dim_);
31 void MathStringInset::draw(MathPainterInfo & pi, int x, int y) const
33 //lyxerr << "drawing '" << str_ << "' code: " << code_ << endl;
34 drawStr(pi, pi.base.font, x, y, str_);
38 void MathStringInset::normalize(NormalStream & os) const
40 os << "[string " << str_ << ' ' << "mathalpha" << "]";
44 void MathStringInset::maplize(MapleStream & os) const
46 if (/*code_ != LM_TC_VAR ||*/ str_.size() <= 1) {
47 os << ' ' << str_ << ' ';
51 // insert '*' between adjacent chars if type is LM_TC_VAR
53 for (string::size_type i = 1; i < str_.size(); ++i)
58 void MathStringInset::mathematicize(MathematicaStream & os) const
60 os << ' ' << str_ << ' ';
64 void MathStringInset::octavize(OctaveStream & os) const
66 if (/*code_ != LM_TC_VAR ||*/ str_.size() <= 1) {
67 os << ' ' << str_ << ' ';
71 // insert '*' between adjacent chars if type is LM_TC_VAR
73 for (string::size_type i = 1; i < str_.size(); ++i)
78 void MathStringInset::mathmlize(MathMLStream & os) const
81 if (code_ == LM_TC_VAR)
82 os << "<mi> " << str_ << " </mi>";
83 else if (code_ == LM_TC_CONST)
84 os << "<mn> " << str_ << " </mn>";
85 else if (code_ == LM_TC_RM || code_ == LM_TC_TEXTRM)
86 os << "<mtext> " << str_ << " </mtext>";
93 void MathStringInset::write(WriteStream & os) const