]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathRoot.cpp
Do not throw exceptions here either. See r22806.
[lyx.git] / src / mathed / InsetMathRoot.cpp
index 38c09469c90473840745c441e2b1fe307c47ce6c..050787cca891d696fe7dde721aab2b75dc403396 100644 (file)
@@ -12,6 +12,8 @@
 #include <config.h>
 
 #include "InsetMathRoot.h"
+
+#include "LaTeXFeatures.h"
 #include "MathData.h"
 #include "MathStream.h"
 #include "Cursor.h"
@@ -118,4 +120,24 @@ void InsetMathRoot::mathmlize(MathStream & os) const
 }
 
 
+void InsetMathRoot::htmlize(HtmlStream & os) const
+{
+       os << MTag("span", "class='root'")
+          << MTag("sup") << cell(0) << ETag("sup")
+          << from_ascii("&radic;") 
+          << MTag("span", "class='rootof'")    << cell(1) << ETag("span") 
+                << ETag("span");
+}
+
+
+void InsetMathRoot::validate(LaTeXFeatures & features) const
+{
+       if (features.runparams().math_flavor == OutputParams::MathAsHTML)
+               features.addPreambleSnippet("<style type=\"text/css\">\n"
+                       "span.rootof{border-top: thin solid black;}\n"
+                       "span.root sup{font-size: 75%;}\n"
+                       "</style>");
+       InsetMathNest::validate(features);
+}
+
 } // namespace lyx