]> www.ginac.de Git - ginac.git/commitdiff
* Sync 1.1 branch to 1.0 mainline.
authorChristian Bauer <Christian.Bauer@uni-mainz.de>
Fri, 8 Mar 2002 21:21:25 +0000 (21:21 +0000)
committerChristian Bauer <Christian.Bauer@uni-mainz.de>
Fri, 8 Mar 2002 21:21:25 +0000 (21:21 +0000)
NEWS
ginac/idx.cpp
ginac/indexed.cpp

diff --git a/NEWS b/NEWS
index 81208447d5064c278c551b2b5c41d143094b6c67..6536046ba7f89efcac47376a009ba13e93772c2b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ This file records noteworthy changes.
 
 1.1.0 (<date>)
 * "(x+1).subs(x==x-1)" now returns the correct result "x" instead of "x-1".
+* Fixed LaTeX output of indexed objects.
 
 1.0.5 (<date>)
 * (l)degree(s), coeff(s, n) and collect(s) were extended to accept expressions
index 160bc378f563550e1b5491ca272704954ca77428..a3767fe8c5c65e7dc357e712cf79b34756737347 100644 (file)
@@ -157,7 +157,7 @@ void idx::print(const print_context & c, unsigned level) const
        } else {
 
                if (is_a<print_latex>(c))
-                       c.s << "_{";
+                       c.s << "{";
                else
                        c.s << ".";
                bool need_parens = !(is_ex_exactly_of_type(value, numeric) || is_ex_of_type(value, symbol));
@@ -184,12 +184,9 @@ void varidx::print(const print_context & c, unsigned level) const
                dim.print(c, level + delta_indent);
 
        } else {
-               if (is_a<print_latex>(c)) {
-                       if (covariant)
-                               c.s << "_{";
-                       else
-                               c.s << "^{";
-               } else {
+               if (is_a<print_latex>(c))
+                       c.s << "{";
+               else {
                        if (covariant)
                                c.s << ".";
                        else
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 << "_{";