2 * \file InsetMathString.C
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 #include "InsetMathString.h"
14 #include "MathStream.h"
15 #include "MathStream.h"
16 #include "MathSupport.h"
25 InsetMathString::InsetMathString(docstring const & s)
30 auto_ptr<InsetBase> InsetMathString::doClone() const
32 return auto_ptr<InsetBase>(new InsetMathString(*this));
36 void InsetMathString::metrics(MetricsInfo & mi, Dimension & dim) const
38 mathed_string_dim(mi.base.font, str_, dim);
42 void InsetMathString::draw(PainterInfo & pi, int x, int y) const
48 void InsetMathString::normalize(NormalStream & os) const
50 os << "[string " << str_ << ' ' << "mathalpha" << ']';
54 void InsetMathString::maple(MapleStream & os) const
56 if (/*code_ != LM_TC_VAR ||*/ str_.size() <= 1) {
57 os << ' ' << str_ << ' ';
61 // insert '*' between adjacent chars if type is LM_TC_VAR
63 for (size_t i = 1; i < str_.size(); ++i)
68 void InsetMathString::mathematica(MathematicaStream & os) const
70 os << ' ' << str_ << ' ';
74 void InsetMathString::octave(OctaveStream & os) const
76 if (/*code_ != LM_TC_VAR ||*/ str_.size() <= 1) {
77 os << ' ' << str_ << ' ';
81 // insert '*' between adjacent chars if type is LM_TC_VAR
83 for (size_t i = 1; i < str_.size(); ++i)
88 void InsetMathString::mathmlize(MathStream & os) const
91 if (code_ == LM_TC_VAR)
92 os << "<mi> " << str_ << " </mi>";
93 else if (code_ == LM_TC_CONST)
94 os << "<mn> " << str_ << " </mn>";
95 else if (code_ == LM_TC_RM || code_ == LM_TC_TEXTRM)
96 os << "<mtext> " << str_ << " </mtext>";
103 void InsetMathString::write(WriteStream & os) const