#include <config.h>
#include "InsetMathExInt.h"
+
+#include "LaTeXFeatures.h"
#include "MathData.h"
#include "MathStream.h"
#include "MathStream.h"
}
+void InsetMathExInt::htmlize(HtmlStream & os) const
+{
+ // At the moment, we are not extracting sums and the like for HTML.
+ // So right now this only handles integrals.
+ InsetMathSymbol sym(symbol_);
+ bool const lower = !cell(2).empty();
+ bool const upper = !cell(3).empty();
+
+ os << MTag("span", "class='integral'")
+ << MTag("span", "class='intsym'");
+ sym.htmlize(os, false);
+ os << ETag("span");
+
+ if (lower && upper) {
+ os << MTag("span", "class='limits'")
+ << MTag("span") << cell(2) << ETag("span")
+ << MTag("span") << cell(3) << ETag("span")
+ << ETag("span");
+ } else if (lower)
+ os << MTag("sub", "class='limit'") << cell(2) << ETag("sub");
+ else if (upper)
+ os << MTag("sup", "class='limit'") << cell(3) << ETag("sup");
+ os << cell(0) << "<b>d</b>" << cell(1) << ETag("span");
+}
+
+
void InsetMathExInt::write(WriteStream &) const
{
LYXERR0("should not happen");
}
-
} // namespace lyx
///
void mathmlize(MathStream &) const;
///
+ void htmlize(HtmlStream &) const;
+ ///
void write(WriteStream & os) const;
///
InsetCode lyxCode() const { return MATH_EXINT_CODE; }
}
-void InsetMathSymbol::validate(LaTeXFeatures & features) const
-{
- if (!sym_->requires.empty())
- features.require(to_utf8(sym_->requires));
-}
-
-
void InsetMathSymbol::normalize(NormalStream & os) const
{
os << "[symbol " << name() << ']';
}
-void InsetMathSymbol::htmlize(HtmlStream & os) const
+void InsetMathSymbol::htmlize(HtmlStream & os, bool spacing) const
{
// FIXME We may need to do more interesting things
// with MathMLtype.
if (sym_->xmlname == "x")
// unknown so far
os << ' ' << name() << ' ';
- else if (op)
+ else if (op && spacing)
os << ' ' << sym_->xmlname << ' ';
else
os << sym_->xmlname;
}
+void InsetMathSymbol::htmlize(HtmlStream & os) const
+{
+ htmlize(os, true);
+}
+
+
void InsetMathSymbol::octave(OctaveStream & os) const
{
if (name() == "cdot")
}
+void InsetMathSymbol::validate(LaTeXFeatures & features) const
+{
+ // this is not really the ideal place to do this, but we can't
+ // validate in InsetMathExInt.
+ if (features.runparams().flavor == OutputParams::HTML
+ && sym_->name == from_ascii("int")) {
+ features.addPreambleSnippet("<style type=\"text/css\">\n"
+ "span.limits{display: inline-block; vertical-align: middle; text-align:center; font-size: 75%;}\n"
+ "span.limits span{display: block;}\n"
+ "span.intsym{font-size: 150%;}\n"
+ "sub.limit{font-size: 75%;}\n"
+ "sup.limit{font-size: 75%;}\n"
+ "</style>");
+ } else {
+ if (!sym_->requires.empty())
+ features.require(to_utf8(sym_->requires));
+ }
+}
+
} // namespace lyx
void mathmlize(MathStream &) const;
///
void htmlize(HtmlStream &) const;
+ /// \param spacing controls whether we print spaces around
+ /// "operator"-type symbols or just print them raw
+ void htmlize(HtmlStream &, bool spacing) const;
///
void octave(OctaveStream &) const;
///