LaTeX output of indexed objects

Alexander Heide heide at
Mon Mar 4 11:18:41 CET 2002

I encountered problems while playing with GiNaC. I want to produce LaTeX
output of an indexed object. Consider the following code:

#include <iostream>
#include <ginac/ginac.h>
using namespace std;
using namespace GiNaC;

int main()
        symbol i_sym("i"), j_sym("j");
        idx i(i_sym, 4), j(j_sym, 4);
        symbol A("A");
        indexed(A, i, j).print(print_latex(std::cout));
        return 0;

This prints out:

{A}_{_{i} _{j} }

If I try to latex this piece of latex code I get an error message:

! Double subscript.

I think instead of the above expression, print_latex() should yield:

{A}_{{i} {j} }

More information about the GiNaC-list mailing list