]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathSqrt.cpp
HTML for roots.
[lyx.git] / src / mathed / InsetMathSqrt.cpp
index 7fff18f6f10a726d7ee198eb11e19fa57febd062..e27475ed1484a0575e088870abf02e864deda0d5 100644 (file)
@@ -11,6 +11,8 @@
 #include <config.h>
 
 #include "InsetMathSqrt.h"
+
+#include "LaTeXFeatures.h"
 #include "MathData.h"
 #include "MathStream.h"
 #include "TextPainter.h"
@@ -19,8 +21,8 @@
 
 namespace lyx {
 
-InsetMathSqrt::InsetMathSqrt()
-       : InsetMathNest(1)
+InsetMathSqrt::InsetMathSqrt(Buffer * buf)
+       : InsetMathNest(buf, 1)
 {}
 
 
@@ -113,4 +115,21 @@ void InsetMathSqrt::mathmlize(MathStream & os) const
 }
 
 
+void InsetMathSqrt::htmlize(HtmlStream & os) const
+{
+       os << MTag("span", "class='sqrt'")
+          << from_ascii("&radic;") 
+          << MTag("span", "class='sqrtof'")    << cell(0) << ETag("span") 
+                << ETag("span");
+}
+
+
+void InsetMathSqrt::validate(LaTeXFeatures & features) const
+{
+       if (features.runparams().math_flavor == OutputParams::MathAsHTML)
+               features.addPreambleSnippet("<style type=\"text/css\">\n"
+                       "span.sqrtof{border-top: thin solid black;}\n"
+                       "</style>");
+}
+
 } // namespace lyx