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"
15 #include "MathFactory.h"
16 #include "MathExtern.h"
17 #include "MathStream.h"
18 #include "MathSupport.h"
22 #include "support/debug.h"
23 #include "support/gettext.h"
24 #include "support/lassert.h"
25 #include "support/lstrings.h"
26 #include "support/textutils.h"
28 using lyx::support::escape;
33 InsetMathString::InsetMathString(docstring const & s)
38 Inset * InsetMathString::clone() const
40 return new InsetMathString(*this);
44 void InsetMathString::metrics(MetricsInfo & mi, Dimension & dim) const
46 mathed_string_dim(mi.base.font, str_, dim);
50 void InsetMathString::draw(PainterInfo & pi, int x, int y) const
56 void InsetMathString::normalize(NormalStream & os) const
58 os << "[string " << str_ << ' ' << "mathalpha" << ']';
62 void InsetMathString::maple(MapleStream & os) const
64 if (/*code_ != LM_TC_VAR ||*/ str_.size() <= 1) {
65 os << ' ' << str_ << ' ';
69 // insert '*' between adjacent chars if type is LM_TC_VAR
71 for (size_t i = 1; i < str_.size(); ++i)
76 void InsetMathString::mathematica(MathematicaStream & os) const
78 os << ' ' << str_ << ' ';
82 void InsetMathString::octave(OctaveStream & os) const
84 if (/*code_ != LM_TC_VAR ||*/ str_.size() <= 1) {
85 os << ' ' << str_ << ' ';
89 // insert '*' between adjacent chars if type is LM_TC_VAR
91 for (size_t i = 1; i < str_.size(); ++i)
96 void InsetMathString::mathmlize(MathStream &) const
98 // useless, no doubt, but we should not be here
103 void InsetMathString::write(WriteStream & os) const
105 writeString(str_, os);