return true;
}
+ latexkeys const * l = in_word_set(s.substr(1));
+ if (l && (l->token == LM_TK_FONT || l->token == LM_TK_OLDFONT)) {
+ lastcode_ = static_cast<MathTextCodes>(l->id);
+ return true;
+ }
+
niceInsert(createMathInset(s.substr(1)));
return true;
}
}
// no special circumstances, so insert the character without any fuss
- insert(c, LM_TC_MIN);
+ insert(c, lastcode_);
+ lastcode_ = LM_TC_MIN;
return true;
}
void MathMacro::maplize(MapleStream & os) const
{
- expanded_ = tmplate_->xcell(0);
- expanded_.data_.substitute(*this);
+ updateExpansion();
::maplize(expanded_.data_, os);
}
void MathMacro::mathmlize(MathMLStream & os) const
{
- expanded_ = tmplate_->xcell(0);
- expanded_.data_.substitute(*this);
+ updateExpansion();
::mathmlize(expanded_.data_, os);
}
void MathMacro::octavize(OctaveStream & os) const
{
- expanded_ = tmplate_->xcell(0);
- expanded_.data_.substitute(*this);
+ updateExpansion();
::octavize(expanded_.data_, os);
}
if (nargs() == 0)
os << ' ';
}
+
+
+void MathMacro::updateExpansion() const
+{
+ expanded_ = tmplate_->xcell(0);
+ expanded_.data_.substitute(*this);
+}
MathMacroTemplate::MathMacroTemplate(string const & nm, int numargs)
: MathNestInset(1), numargs_(numargs), name_(nm)
{
- if (numargs_ > 9) {
+ if (numargs_ > 9)
lyxerr << "MathMacroTemplate::MathMacroTemplate: wrong # of arguments: "
<< numargs_ << std::endl;
- }
}