3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Alejandro Aguilar Sierra
9 * Full author contact details are available in file CREDITS.
14 #include "InsetMath.h"
16 #include "MathStream.h"
20 #include "support/lstrings.h"
22 #include <boost/current_function.hpp>
30 MathArray & InsetMath::cell(idx_type)
32 static MathArray dummyCell;
33 lyxerr << BOOST_CURRENT_FUNCTION << ": I don't have any cell" << endl;
38 MathArray const & InsetMath::cell(idx_type) const
40 static MathArray dummyCell;
41 lyxerr << BOOST_CURRENT_FUNCTION << ": I don't have any cell" << endl;
46 void InsetMath::dump() const
48 lyxerr << "---------------------------------------------" << endl;
50 WriteStream wi(os, false, true);
52 lyxerr << to_utf8(os.str());
53 lyxerr << "\n---------------------------------------------" << endl;
57 void InsetMath::metricsT(TextMetricsInfo const &, Dimension &) const
60 lyxerr << "InsetMath::metricsT(Text) called directly!" << endl;
65 void InsetMath::drawT(TextPainter &, int, int) const
68 lyxerr << "InsetMath::drawT(Text) called directly!" << endl;
74 void InsetMath::write(WriteStream & os) const
76 docstring const s = name();
78 // We need an extra ' ' unless this is a single-char-non-ASCII name
79 // or anything non-ASCII follows
80 if (s.size() != 1 || isalpha(s[0]))
81 os.pendingSpace(true);
85 int InsetMath::plaintext(Buffer const &, odocstream &,
86 OutputParams const &) const
88 // all math plain text output shall take place in InsetMathHull
94 void InsetMath::normalize(NormalStream & os) const
96 os << '[' << name() << "] ";
100 void InsetMath::octave(OctaveStream & os) const
102 NormalStream ns(os.os());
107 void InsetMath::maple(MapleStream & os) const
109 NormalStream ns(os.os());
114 void InsetMath::maxima(MaximaStream & os) const
116 MapleStream ns(os.os());
121 void InsetMath::mathematica(MathematicaStream & os) const
123 NormalStream ns(os.os());
128 void InsetMath::mathmlize(MathStream & os) const
130 NormalStream ns(os.os());
135 HullType InsetMath::getType() const
141 docstring InsetMath::name() const
143 return from_ascii("unknown");
147 std::ostream & operator<<(std::ostream & os, MathAtom const & at)
149 odocstringstream oss;
150 WriteStream wi(oss, false, false);
152 return os << to_utf8(oss.str());
156 odocstream & operator<<(odocstream & os, MathAtom const & at)
158 WriteStream wi(os, false, false);