2 * \file InsetMathMatrix.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 "InsetMathMatrix.h"
15 #include "MathStream.h"
20 InsetMathMatrix::InsetMathMatrix(InsetMathGrid const & p,
21 docstring const & left, docstring const & right)
22 : InsetMathGrid(p), left_(left), right_(right)
26 Inset * InsetMathMatrix::clone() const
28 return new InsetMathMatrix(*this);
32 void InsetMathMatrix::write(WriteStream & os) const
34 InsetMathGrid::write(os);
38 void InsetMathMatrix::normalize(NormalStream & os) const
40 InsetMathGrid::normalize(os);
44 void InsetMathMatrix::maple(MapleStream & os) const
46 os << "matrix(" << int(nrows()) << ',' << int(ncols()) << ",[";
47 for (idx_type idx = 0; idx < nargs(); ++idx) {
56 void InsetMathMatrix::maxima(MaximaStream & os) const
59 for (row_type row = 0; row < nrows(); ++row) {
63 for (col_type col = 0; col < ncols(); ++col) {
66 os << cell(index(row, col));
74 void InsetMathMatrix::mathematica(MathematicaStream & os) const
77 for (row_type row = 0; row < nrows(); ++row) {
81 for (col_type col = 0; col < ncols(); ++col) {
84 os << cell(index(row, col));
92 void InsetMathMatrix::mathmlize(MathStream & os) const
94 os << "<mo form='prefix' fence='true' stretchy='true' symmetric='true' lspace='thinmathspace'>"
97 for (row_type row = 0; row < nrows(); ++row) {
99 for (col_type col = 0; col < ncols(); ++col)
100 os << MTag("mtd") << cell(index(row, col)) << ETag("mtd");
103 os << ETag("mtable");
104 os << "<mo form='postfix' fence='true' stretchy='true' symmetric='true' lspace='thinmathspace'>"
105 << right_ << "</mo>";
109 void InsetMathMatrix::octave(OctaveStream & os) const
112 for (row_type row = 0; row < nrows(); ++row) {
116 for (col_type col = 0; col < ncols(); ++col)
117 os << cell(index(row, col)) << ' ';