Processing math: 100%

First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

asked 3 years ago

sum8tion gravatar image

How do you assign (different) LaTex names to elements of a list?

Say I have the following list of variables.

v = {(i,j): var("v_{}{}".format(i, j), latex_name="v_{{}{}}") for i in range(2) for j in range(2)}

How do I make it so that when I use the

show(v[0,0])

command, I get v0,0 as output? I've tried stuff like

v = {(i,j): var("v_{}{}".format(i, j), latex_name="v_{i,j}") for i in range(2) for j in range(2)}

and

v = {(i,j): var("v_{}{}".format(i, j), latex_name="v_{{i}{j}}") for i in range(2) for j in range(2)}

but it only ever give me stuff like vi,j where it's just the literal symbols i and j, not the entries of

v[k,m]

for some k and m I plug in, like 0, 0.