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 "MathExtern.h"
16 #include "MathStream.h"
21 InsetMathMatrix::InsetMathMatrix(InsetMathGrid const & p,
22 docstring const & left, docstring const & right)
23 : InsetMathGrid(p), left_(left), right_(right)
27 Inset * InsetMathMatrix::clone() const
29 return new InsetMathMatrix(*this);
33 void InsetMathMatrix::write(WriteStream & os) const
35 InsetMathGrid::write(os);
39 void InsetMathMatrix::normalize(NormalStream & os) const
41 InsetMathGrid::normalize(os);
45 void InsetMathMatrix::maple(MapleStream & os) const
47 os << "matrix(" << int(nrows()) << ',' << int(ncols()) << ",[";
48 for (idx_type idx = 0; idx < nargs(); ++idx) {
57 void InsetMathMatrix::maxima(MaximaStream & os) const
60 for (row_type row = 0; row < nrows(); ++row) {
64 for (col_type col = 0; col < ncols(); ++col) {
67 os << cell(index(row, col));
75 void InsetMathMatrix::mathematica(MathematicaStream & os) const
78 for (row_type row = 0; row < nrows(); ++row) {
82 for (col_type col = 0; col < ncols(); ++col) {
85 os << cell(index(row, col));
93 docstring InsetMathMatrix::mathmlize(MathStream & os) const
95 os << "<mo form='prefix' fence='true' stretchy='true' symmetric='true' lspace='thinmathspace'>"
99 for (row_type row = 0; row < nrows(); ++row) {
101 for (col_type col = 0; col < ncols(); ++col) {
103 rv += lyx::mathmlize(cell(index(row, col)), os);
108 os << ETag("mtable");
109 os << "<mo form='postfix' fence='true' stretchy='true' symmetric='true' lspace='thinmathspace'>"
110 << right_ << "</mo>";
115 void InsetMathMatrix::octave(OctaveStream & os) const
118 for (row_type row = 0; row < nrows(); ++row) {
122 for (col_type col = 0; col < ncols(); ++col)
123 os << cell(index(row, col)) << ' ';