ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 16 Jun 2021 21:52:17 +0200How do you assign (different) LaTex names to elements of a list?https://ask.sagemath.org/question/57589/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 $v_{0,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 $v_{i,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.
sum8tionWed, 16 Jun 2021 21:52:17 +0200https://ask.sagemath.org/question/57589/Where is information passed on to var() stored?https://ask.sagemath.org/question/32357/where-is-information-passed-on-to-var-stored/ We can link additional information to expressions defined by var(), such as the domain or latex expression, e.g.
> sage: var('xt1',domain = real,latex_name = 'x_{t1}')
Where is this information stored and is there a way to modify it, e.g. change the domain or latex_name without having to redefine the expression?stanThu, 28 Jan 2016 15:38:07 +0100https://ask.sagemath.org/question/32357/