+ bool is_tex = is_a<print_latex>(c);
+
+ if (is_tex && is_exactly_a<numeric>(exponent) && ex_to<numeric>(exponent).is_negative()) {
+
+ // Powers with negative numeric exponents are printed as fractions in TeX
+ c.s << "\\frac{1}{";
+ power(basis, -exponent).eval().print(c);
+ c.s << "}";
+
+ } else if (exponent.is_equal(_ex1_2)) {
+
+ // Square roots are printed in a special way
+ c.s << (is_tex ? "\\sqrt{" : "sqrt(");