}
-docstring InsetMathBox::mathmlize(MathStream & ms) const
+void InsetMathBox::mathmlize(MathStream & ms) const
{
- // FIXME This doesn't actually work yet. We need to be able to signal
- // that we are in text mode and then just call ms << cell(0). So we
- // need something like ModeSpecifier for MathStream.
- ms << MTag("mtext");
- ms.os() << cell(0);
- ms << ETag("mtext");
- return docstring();
+ SetMode textmode(ms, true, from_ascii("class='mathbox'"));
+ ms << cell(0);
}
}
+void InsetMathFBox::mathmlize(MathStream & ms) const
+{
+ SetMode textmode(ms, true, from_ascii("class='fbox'"));
+ ms << cell(0);
+}
+
+
void InsetMathFBox::infoize(odocstream & os) const
{
os << "FBox: ";
}
+void InsetMathFBox::validate(LaTeXFeatures & features) const
+{
+ // FIXME XHTML
+ // It'd be better to be able to get this from an InsetLayout, but at present
+ // InsetLayouts do not seem really to work for things that aren't InsetTexts.
+ if (features.runparams().flavor == OutputParams::HTML)
+ features.addPreambleSnippet("<style type=\"text/css\">\n"
+ "mtext.fbox { border: 1px solid black; }\n"
+ "</style>");
+}
+
+
+
/////////////////////////////////////////////////////////////////////
//
// InsetMathMakebox
}
+void InsetMathMakebox::mathmlize(MathStream & ms) const
+{
+ // FIXME We could do something with the other arguments.
+ std::string const cssclass = framebox_ ? "framebox" : "makebox";
+ SetMode textmode(ms, true, from_ascii("class='" + cssclass + "'"));
+ ms << cell(2);
+}
+
+
+void InsetMathMakebox::validate(LaTeXFeatures & features) const
+{
+ // FIXME XHTML
+ // It'd be better to be able to get this from an InsetLayout, but at present
+ // InsetLayouts do not seem really to work for things that aren't InsetTexts.
+ if (features.runparams().flavor == OutputParams::HTML)
+ features.addPreambleSnippet("<style type=\"text/css\">\n"
+ "mtext.framebox { border: 1px solid black; }\n"
+ "</style>");
+}
+
+
+
/////////////////////////////////////////////////////////////////////
//
// InsetMathBoxed
}
+void InsetMathBoxed::mathmlize(MathStream & ms) const
+{
+ SetMode mathmode(ms, false, from_ascii("class='boxed'"));
+ ms << cell(0);
+}
+
+
void InsetMathBoxed::validate(LaTeXFeatures & features) const
{
features.require("amsmath");
+ // FIXME XHTML
+ // It'd be better to be able to get this from an InsetLayout, but at present
+ // InsetLayouts do not seem really to work for things that aren't InsetTexts.
+ if (features.runparams().flavor == OutputParams::HTML)
+ features.addPreambleSnippet("<style type=\"text/css\">\n"
+ "mstyle.boxed { border: 1px solid black; }\n"
+ "</style>");
InsetMathNest::validate(features);
}