X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathMatrix.cpp;h=4d309d13e88dba668401e28dd6b23e4562f17149;hb=573500dd04f154f27318ac5ec469a337f97fe9f0;hp=d368f217b7b1493485c0ebbc652f5bd487824ae4;hpb=05f1f323de8c11c1d4b56568a650dc4878a3749a;p=lyx.git diff --git a/src/mathed/InsetMathMatrix.cpp b/src/mathed/InsetMathMatrix.cpp index d368f217b7..4d309d13e8 100644 --- a/src/mathed/InsetMathMatrix.cpp +++ b/src/mathed/InsetMathMatrix.cpp @@ -14,6 +14,9 @@ #include "MathData.h" #include "MathStream.h" +#include "support/convert.h" + +using namespace std; namespace lyx { @@ -106,6 +109,31 @@ void InsetMathMatrix::mathmlize(MathStream & os) const } +void InsetMathMatrix::htmlize(HtmlStream & os) const +{ + os << MTag("table", "class='matrix'") << '\n'; + + // we do not print the delimiters but instead try to hack them + string const rows = convert(nrows()); + string const lattrib = + "class='ldelim' rowspan='" + rows + "'"; + string const rattrib = + "class='rdelim' rowspan='" + rows + "'"; + + for (row_type row = 0; row < nrows(); ++row) { + os << MTag("tr") << '\n'; + if (row == 0) + os << MTag("td", lattrib) << ETag("td") << '\n'; + for (col_type col = 0; col < ncols(); ++col) + os << MTag("td") << cell(index(row, col)) << ETag("td") << '\n'; + if (row == 0) + os << MTag("td", rattrib) << ETag("td") << '\n'; + os << ETag("tr") << '\n'; + } + os << ETag("table") << '\n'; +} + + void InsetMathMatrix::octave(OctaveStream & os) const { os << '[';