-MathMacroArgument::MathMacroArgument(int n)
- : MathNestInset(1), number_(n), expanded_(false)
+MathMacroArgument::MathMacroArgument(int n, MathTextCodes code)
+ : MathNestInset(1), number_(n), expanded_(false), code_(code)
{
if (n < 1 || n > 9) {
lyxerr << "MathMacroArgument::MathMacroArgument: wrong Argument id: "
void MathMacroArgument::write(WriteStream & os) const
{
- os << str_;
+ if (code_ == LM_TC_MIN)
+ os << str_;
+ else
+ os << '\\' << math_font_name(code_) << '{' << str_ << '}';
}
void MathMacroArgument::substitute(MathMacro const & m)
{
cell(0) = m.cell(number_ - 1);
+ for (MathArray::iterator it = cell(0).begin(); it != cell(0).end(); ++it)
+ it->nucleus()->handleFont(code_);
expanded_ = true;
}
class MathMacroArgument : public MathNestInset {
public:
///
- explicit MathMacroArgument(int);
+ explicit MathMacroArgument(int, MathTextCodes = LM_TC_MIN);
///
MathInset * clone() const;
///
bool expanded_;
///
mutable MathMetricsInfo mi_;
+ ///
+ MathTextCodes code_;
};
#endif
else if (t.cat() == catParameter) {
Token const & n = getToken();
- array.push_back(MathAtom(new MathMacroArgument(n.character() - '0')));
+ array.push_back(MathAtom(new MathMacroArgument(n.character()-'0', code)));
}
else if (t.cat() == catBegin) {