]> www.ginac.de Git - ginac.git/blobdiff - ginac/indexed.cpp
fixed LaTeX output of indexed objects
[ginac.git] / ginac / indexed.cpp
index 6c2683c30b715e4640cc090a660f6068d9e780e5..765a07c8bf4c7a1f8be7a17411a55dbcb64311b9 100644 (file)
@@ -328,9 +328,10 @@ void indexed::printindices(const print_context & c, unsigned level) const
 
                        while (it != itend) {
                                bool cur_covariant = (is_ex_of_type(*it, varidx) ? ex_to<varidx>(*it).is_covariant() : true);
-                               if (first || cur_covariant != covariant) {
+                               if (first || cur_covariant != covariant) { // Variance changed
+                                       // The empty {} prevents indices from ending up on top of each other
                                        if (!first)
-                                               c.s << "}";
+                                               c.s << "}{}";
                                        covariant = cur_covariant;
                                        if (covariant)
                                                c.s << "_{";