MathCharInset::MathCharInset(char c)
- : char_(c), code_(nativeCode(c))
+ : char_(c), code_(nativeCode(c)), needbs_(false)
{
//lyxerr << "creating char '" << char_ << "' with code " << int(code_) << endl;
}
MathCharInset::MathCharInset(char c, MathTextCodes t)
- : char_(c), code_((t == LM_TC_MIN) ? nativeCode(c) : t)
+ : char_(c), code_((t == LM_TC_MIN) ? nativeCode(c) : t), needbs_(false)
+{
+//lyxerr << "creating char '" << char_ << "' with code " << int(code_) << endl;
+}
+
+
+MathCharInset::MathCharInset(char c, MathTextCodes t, bool needbs)
+ : char_(c), code_((t == LM_TC_MIN) ? nativeCode(c) : t), needbs_(needbs)
{
//lyxerr << "creating char '" << char_ << "' with code " << int(code_) << endl;
}
void MathCharInset::writeRaw(std::ostream & os) const
{
+ if (needbs_)
+ os << "\\";
os << char_;
}
void MathCharInset::writeNormal(std::ostream & os) const
{
+ if (needbs_)
+ os << "\\";
os << char_;
}
///
MathCharInset(char c, MathTextCodes t);
///
+ MathCharInset(char c, MathTextCodes t, bool needbs);
+ ///
MathInset * clone() const;
///
MathTextCodes nativeCode(char c) const;
private:
/// the character
char char_;
- ///
+ /// the font to be used on screen
MathTextCodes code_;
+ /// do wee need a backslash when writing LaTeX?
+ bool needbs_;
};
#endif