void handleFont(MathTextCodes t);
///
bool match(MathInset *) const;
+ /// identifies complicated things that need braces if used as arg
+ bool needsBraces() const { return false; }
private:
/// the character
virtual MathTextCodes code() const { return LM_TC_MIN; }
/// identifies things that can get \limits or \nolimits
virtual bool takesLimits() const { return false; }
+ /// identifies complicated things that need braces if used as arg
+ virtual bool needsBraces() const { return true; }
///
virtual void edit(BufferView *, int, int, unsigned int) {}
#warning this might be wrong in general!
#endif
// ignore braces around simple items
- if (ar.size() == 1 || (ar.size() == 2 && ar.back()->asScriptInset())) {
+ if ((ar.size() == 1 && !ar.front()->needsBraces()
+ || (ar.size() == 2 && !ar.front()->needsBraces()
+ && ar.back()->asScriptInset())))
+ {
array.push_back(ar);
} else {
array.push_back(MathAtom(new MathBraceInset));
bool match(MathInset *) const;
/// request "external features"
void validate(LaTeXFeatures & features) const;
+ /// identifies complicated things that need braces if used as arg
+ bool needsBraces() const { return false; }
///
void normalize(NormalStream &) const;