} else {
- if (precedence <= level)
- c.s << "(";
+ if (precedence <= level) {
+ if (is_of_type(c, print_latex))
+ c.s << "{(";
+ else
+ c.s << "(";
+ }
numeric coeff;
bool first = true;
// First print the overall numeric coefficient, if present
if (!overall_coeff.is_zero()) {
- overall_coeff.print(c, precedence);
+ if (!is_of_type(c, print_tree))
+ overall_coeff.print(c, 0);
+ else
+ overall_coeff.print(c, precedence);
first = false;
}
else
coeff.print(c, precedence);
}
- c.s << '*';
+ if (is_of_type(c, print_latex))
+ c.s << ' ';
+ else
+ c.s << '*';
}
it->rest.print(c, precedence);
it++;
}
- if (precedence <= level)
- c.s << ")";
+ if (precedence <= level) {
+ if (is_of_type(c, print_latex))
+ c.s << ")}";
+ else
+ c.s << ")";
+ }
}
}