Small bug in power::print_latex

Stefan Weinzierl stefanw at fis.unipr.it
Thu May 24 12:38:49 CEST 2001


Hi,

if I do

 symbol x("x");
 ex f=pow(x,10);
 f.print(print_latex(cout));

I get

 x^10

which latex prints out roughly as

  1
 x 0

Putting some curly braces around the exponent should fix the problem, e.g.
if one replaces line 200 in power.cpp (GiNaC 0.8.3)

 exponent.print(x,precedence)

by something like

 if (is_of_type(c,print_latex)) c.s<<"{";
 exponent.print(x,precedence)
 if (is_of_type(c,print_latex)) c.s<<"}";


 Best wishes,

   Stefan





More information about the GiNaC-devel mailing list