From 60ce2b7570e65ccf31738c39211b0997113e4d57 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Sat, 30 Jul 2016 00:25:09 -0400 Subject: [PATCH] Fix HTML display of math matrices. --- src/mathed/InsetMathGrid.cpp | 14 ++++++++++++++ src/mathed/InsetMathGrid.h | 2 ++ 2 files changed, 16 insertions(+) diff --git a/src/mathed/InsetMathGrid.cpp b/src/mathed/InsetMathGrid.cpp index f2d88a2bdf..3920677e60 100644 --- a/src/mathed/InsetMathGrid.cpp +++ b/src/mathed/InsetMathGrid.cpp @@ -26,6 +26,7 @@ #include "CutAndPaste.h" #include "FuncRequest.h" #include "FuncStatus.h" +#include "LaTeXFeatures.h" #include "TexRow.h" #include "frontends/Clipboard.h" @@ -1237,6 +1238,19 @@ void InsetMathGrid::htmlize(HtmlStream & os) const } +void InsetMathGrid::validate(LaTeXFeatures & features) const +{ + if (features.runparams().math_flavor == OutputParams::MathAsHTML + && (nrows() > 1 || ncols() > 1)) { + // CSS taken from InsetMathCases + features.addCSSSnippet( + "table.mathtable{display: inline-block; text-align: center; border: none;" + "border-left: thin solid black; vertical-align: middle; padding-left: 0.5ex;}\n" + "table.mathtable td {text-align: left; border: none;}"); + } +} + + void InsetMathGrid::write(WriteStream & os) const { write(os, 0, 0, nrows(), ncols()); diff --git a/src/mathed/InsetMathGrid.h b/src/mathed/InsetMathGrid.h index e9ea396930..426d941f19 100644 --- a/src/mathed/InsetMathGrid.h +++ b/src/mathed/InsetMathGrid.h @@ -239,6 +239,8 @@ public: /// void htmlize(HtmlStream &, std::string attrib) const; /// + void validate(LaTeXFeatures & features) const; + /// //void octave(OctaveStream &) const; protected: -- 2.39.5