2 * \file InsetMathString.cpp
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"
21 InsetMathString::InsetMathString(docstring const & s)
26 Inset * InsetMathString::clone() const
28 return new InsetMathString(*this);
32 void InsetMathString::metrics(MetricsInfo & mi, Dimension & dim) const
34 mathed_string_dim(mi.base.font, str_, dim);
38 void InsetMathString::draw(PainterInfo & pi, int x, int y) const
44 void InsetMathString::normalize(NormalStream & os) const
46 os << "[string " << str_ << ' ' << "mathalpha" << ']';
50 void InsetMathString::maple(MapleStream & os) const
52 if (/*code_ != LM_TC_VAR ||*/ str_.size() <= 1) {
53 os << ' ' << str_ << ' ';
57 // insert '*' between adjacent chars if type is LM_TC_VAR
59 for (size_t i = 1; i < str_.size(); ++i)
64 void InsetMathString::mathematica(MathematicaStream & os) const
66 os << ' ' << str_ << ' ';
70 void InsetMathString::octave(OctaveStream & os) const
72 if (/*code_ != LM_TC_VAR ||*/ str_.size() <= 1) {
73 os << ' ' << str_ << ' ';
77 // insert '*' between adjacent chars if type is LM_TC_VAR
79 for (size_t i = 1; i < str_.size(); ++i)
84 void InsetMathString::mathmlize(MathStream & os) const
87 if (code_ == LM_TC_VAR)
88 os << "<mi> " << str_ << " </mi>";
89 else if (code_ == LM_TC_CONST)
90 os << "<mn> " << str_ << " </mn>";
91 else if (code_ == LM_TC_RM || code_ == LM_TC_TEXTRM)
92 os << "<mtext> " << str_ << " </mtext>";
99 void InsetMathString::write(WriteStream & os) const