* 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.
*/
void InsetMathUnderset::write(WriteStream & os) const
{
MathEnsurer ensurer(os);
+ if (os.fragile())
+ os << "\\protect";
os << "\\underset{" << cell(0) << "}{" << cell(1) << '}';
}
}
+void InsetMathUnderset::mathmlize(MathStream & ms) const
+{
+ ms << "<munder accent='false'>" << cell(1) << cell(0) << "</munder>";
+}
+
+
+void InsetMathUnderset::htmlize(HtmlStream & os) const
+{
+ os << MTag("span", "class='underset'")
+ << MTag("span") << cell(0) << ETag("span")
+ << MTag("span", "class='bottom'") << cell(1) << ETag("span")
+ << ETag("span");
+}
+
+
void InsetMathUnderset::validate(LaTeXFeatures & features) const
{
- features.require("amsmath");
+ if (features.runparams().isLaTeX())
+ features.require("amsmath");
+ else if (features.runparams().math_flavor == OutputParams::MathAsHTML)
+ features.addPreambleSnippet("<style type=\"text/css\">\n"
+ "span.underset{display: inline-block; vertical-align: top; text-align:center;}\n"
+ "span.underset span {display: block;}\n"
+ "span.bottom{font-size: 66%;}\n"
+ "</style>");
+
InsetMathNest::validate(features);
}