* Added output-support for Python bindings and LaTeX printing for
[ginac.git] / ginac / symbol.cpp
index 5d2ac8ced8459b84a1df3f3c1a0d43e7a8ca363b..39f2335abcd1911c8e4460aaa1d16c0ba1989e8a 100644 (file)
@@ -151,9 +151,14 @@ void symbol::print(const print_context & c, unsigned level) const
                    << std::hex << ", hash=0x" << hashvalue << ", flags=0x" << flags << std::dec
                    << std::endl;
 
-       } else if (is_a<print_latex>(c))
+       } else if (is_a<print_latex>(c)) {
                c.s << TeX_name;
-       else
+       } else if (is_a<print_python_repr>(c)) {
+               c.s << class_name() << "('" << name;
+               if (TeX_name != default_TeX_name())
+                       c.s << "','" << TeX_name;
+               c.s << "')";
+       } else
                c.s << name;
 }