correct latex rendering of indexes and figures

added makeindex also in the template generator