* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
- * \author André Pönitz
+ * \author André Pönitz
*
* Full author contact details are available in file CREDITS.
*/
#include <config.h>
#include "InsetMathSqrt.h"
+
+#include "LaTeXFeatures.h"
#include "MathData.h"
#include "MathStream.h"
#include "TextPainter.h"
namespace lyx {
-InsetMathSqrt::InsetMathSqrt()
- : InsetMathNest(1)
+InsetMathSqrt::InsetMathSqrt(Buffer * buf)
+ : InsetMathNest(buf, 1)
{}
void InsetMathSqrt::write(WriteStream & os) const
{
- bool brace = ensureMath(os);
+ MathEnsurer ensurer(os);
os << "\\sqrt{" << cell(0) << '}';
- os.pendingBrace(brace);
}
}
+void InsetMathSqrt::htmlize(HtmlStream & os) const
+{
+ os << MTag("span", "class='sqrt'")
+ << from_ascii("√")
+ << 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