* 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 "InsetMathStackrel.h"
+
+#include "LaTeXFeatures.h"
#include "MathData.h"
#include "MathStream.h"
namespace lyx {
-InsetMathStackrel::InsetMathStackrel()
+InsetMathStackrel::InsetMathStackrel(Buffer * buf) : InsetMathFracBase(buf)
{}
void InsetMathStackrel::write(WriteStream & os) const
{
- bool brace = ensureMath(os);
+ MathEnsurer ensurer(os);
os << "\\stackrel{" << cell(0) << "}{" << cell(1) << '}';
- os.pendingBrace(brace);
}
}
+void InsetMathStackrel::mathmlize(MathStream & ms) const
+{
+ ms << "<mover accent='false'>" << cell(1) << cell(0) << "</mover>";
+}
+
+
+void InsetMathStackrel::htmlize(HtmlStream & os) const
+{
+ // at the moment, this is exactly the same as overset
+ os << MTag("span", "class='overset'")
+ << MTag("span", "class='top'") << cell(0) << ETag("span")
+ << MTag("span") << cell(1) << ETag("span")
+ << ETag("span");
+}
+
+
+void InsetMathStackrel::validate(LaTeXFeatures & features) const
+{
+ // from overset
+ if (features.runparams().math_flavor == OutputParams::MathAsHTML)
+ features.addPreambleSnippet("<style type=\"text/css\">\n"
+ "span.overset{display: inline-block; vertical-align: bottom; text-align:center;}\n"
+ "span.overset span {display: block;}\n"
+ "span.top{font-size: 66%;}\n"
+ "</style>");
+
+ InsetMathNest::validate(features);
+}
+
} // namespace lyx