# How to give latex names to generators of polynomial rings?

Apologies if I don't use the right terminology in my question. I'm fairly new to Sage and programming.

The question is basically in the title but here are more details:

Ideally I would like to create a multivariate polynomial ring with generators indexed by multiindices. As far as I understand this is not directly supported at the moment, although I've found a useful workaround here.

What I'm missing though is the ability to display these generators correctly in LaTex (say as a_{i,j}). I know that one can assign latex names to symbolic variables with the command

`sage: a_ij=var('a_ij', latex_name="a_{i,j}");`

`sage: latex(a_ij);`

`a_{i,j}`

And I've tried putting this before the definition of my polynomial ring. But as soon as I declare the polynomial ring the latex name I assigned seems to be forgotten:

`sage: inject_on();`

`sage: PolynomialRing(QQ,a_ij)`

`sage: latex(a_ij);`

`a_{\mbox{ij}}`

So:

Question: How can I define a multivariate polynomial ring in Sage and assign my preferred latex names to its generators?