From: Christian Bauer Date: Tue, 5 Mar 2002 20:32:16 +0000 (+0000) Subject: fixed LaTeX output of indexed objects X-Git-Tag: release_1-0-7~4 X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=commitdiff_plain;h=b89179d5c32459bd61f161278e2cae24abe36d4e fixed LaTeX output of indexed objects --- diff --git a/ginac/idx.cpp b/ginac/idx.cpp index 160bc378..a3767fe8 100644 --- a/ginac/idx.cpp +++ b/ginac/idx.cpp @@ -157,7 +157,7 @@ void idx::print(const print_context & c, unsigned level) const } else { if (is_a(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(c)) { - if (covariant) - c.s << "_{"; - else - c.s << "^{"; - } else { + if (is_a(c)) + c.s << "{"; + else { if (covariant) c.s << "."; else diff --git a/ginac/indexed.cpp b/ginac/indexed.cpp index 6c2683c3..765a07c8 100644 --- a/ginac/indexed.cpp +++ b/ginac/indexed.cpp @@ -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(*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 << "_{";