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"
21 #include "MetricsInfo.h"
23 #include "support/debug.h"
24 #include "support/gettext.h"
25 #include "support/lassert.h"
26 #include "support/lstrings.h"
27 #include "support/textutils.h"
29 using lyx::support::escape;
34 InsetMathString::InsetMathString(docstring const & s)
39 Inset * InsetMathString::clone() const
41 return new InsetMathString(*this);
45 void InsetMathString::metrics(MetricsInfo & mi, Dimension & dim) const
47 mathed_string_dim(mi.base.font, str_, dim);
51 void InsetMathString::draw(PainterInfo & pi, int x, int y) const
57 void InsetMathString::normalize(NormalStream & os) const
59 os << "[string " << str_ << ' ' << "mathalpha" << ']';
63 void InsetMathString::maple(MapleStream & os) const
65 if (/*code_ != LM_TC_VAR ||*/ str_.size() <= 1) {
66 os << ' ' << str_ << ' ';
70 // insert '*' between adjacent chars if type is LM_TC_VAR
72 for (size_t i = 1; i < str_.size(); ++i)
77 void InsetMathString::mathematica(MathematicaStream & os) const
79 os << ' ' << str_ << ' ';
83 void InsetMathString::octave(OctaveStream & os) const
85 if (/*code_ != LM_TC_VAR ||*/ str_.size() <= 1) {
86 os << ' ' << str_ << ' ';
90 // insert '*' between adjacent chars if type is LM_TC_VAR
92 for (size_t i = 1; i < str_.size(); ++i)
97 void InsetMathString::mathmlize(MathMLStream &) const
99 // useless, no doubt, but we should not be here
104 void InsetMathString::write(TeXMathStream & os) const
106 writeString(str_, os);