X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathSymbol.cpp;h=1999846729868998005b1f628e392481e63257d1;hb=6de3c19fd63f810eed90ef3bc4469faf28e949c2;hp=6cf3a29c224e759d28a863b4e38e7dbb6867683f;hpb=9687f9beb673f73cf77c55982c04edb5194d067a;p=lyx.git diff --git a/src/mathed/InsetMathSymbol.cpp b/src/mathed/InsetMathSymbol.cpp index 6cf3a29c22..1999846729 100644 --- a/src/mathed/InsetMathSymbol.cpp +++ b/src/mathed/InsetMathSymbol.cpp @@ -23,6 +23,8 @@ #include "support/docstream.h" #include "support/textutils.h" +#include + namespace lyx { @@ -111,6 +113,12 @@ void InsetMathSymbol::draw(PainterInfo & pi, int x, int y) const } +InsetMath::mode_type InsetMathSymbol::currentMode() const +{ + return sym_->extra == "textmode" ? TEXT_MODE : MATH_MODE; +} + + bool InsetMathSymbol::isRelOp() const { return sym_->extra == "mathrel"; @@ -235,7 +243,9 @@ void InsetMathSymbol::octave(OctaveStream & os) const void InsetMathSymbol::write(WriteStream & os) const { - MathEnsurer ensurer(os); + boost::scoped_ptr ensurer; + if (currentMode() != TEXT_MODE) + ensurer.reset(new MathEnsurer(os)); os << '\\' << name(); // $,#, etc. In theory the restriction based on catcodes, but then @@ -260,13 +270,12 @@ void InsetMathSymbol::validate(LaTeXFeatures & features) const // validate in InsetMathExInt. if (features.runparams().math_flavor == OutputParams::MathAsHTML && sym_->name == from_ascii("int")) { - features.addPreambleSnippet(""); + "sup.limit{font-size: 75%;}"); } else { if (!sym_->requires.empty()) features.require(to_utf8(sym_->requires));