4 #include "math_stringinset.h"
5 #include "math_mathmlstream.h"
6 #include "math_streamstr.h"
7 #include "math_support.h"
11 MathStringInset::MathStringInset(string const & s)
16 MathInset * MathStringInset::clone() const
18 return new MathStringInset(*this);
22 void MathStringInset::metrics(MetricsInfo & mi, Dimension & dim) const
24 mathed_string_dim(mi.base.font, str_, dim);
28 void MathStringInset::draw(PainterInfo & pi, int x, int y) const
30 //lyxerr << "drawing '" << str_ << "' code: " << code_ << endl;
31 drawStr(pi, pi.base.font, x, y, str_);
35 void MathStringInset::normalize(NormalStream & os) const
37 os << "[string " << str_ << ' ' << "mathalpha" << ']';
41 void MathStringInset::maple(MapleStream & os) const
43 if (/*code_ != LM_TC_VAR ||*/ str_.size() <= 1) {
44 os << ' ' << str_ << ' ';
48 // insert '*' between adjacent chars if type is LM_TC_VAR
50 for (string::size_type i = 1; i < str_.size(); ++i)
55 void MathStringInset::mathematica(MathematicaStream & os) const
57 os << ' ' << str_ << ' ';
61 void MathStringInset::octave(OctaveStream & os) const
63 if (/*code_ != LM_TC_VAR ||*/ str_.size() <= 1) {
64 os << ' ' << str_ << ' ';
68 // insert '*' between adjacent chars if type is LM_TC_VAR
70 for (string::size_type i = 1; i < str_.size(); ++i)
75 void MathStringInset::mathmlize(MathMLStream & os) const
78 if (code_ == LM_TC_VAR)
79 os << "<mi> " << str_ << " </mi>";
80 else if (code_ == LM_TC_CONST)
81 os << "<mn> " << str_ << " </mn>";
82 else if (code_ == LM_TC_RM || code_ == LM_TC_TEXTRM)
83 os << "<mtext> " << str_ << " </mtext>";
90 void MathStringInset::write(WriteStream & os) const