Ask Your Question
0

Defining an indexed list of variable with Latex_name

asked 3 years ago

Cyrille gravatar image

updated 3 years ago

The answer of this question Creating a vector of indexed variables asked two years ago, is deprecated for the Latex_name part which seems natural since from that time one must use either \\ or r'' in place of only \. I have tried many thing but none works.

Here is the incriminated command

x = var("x", n=8, latex_name='\overline{x}')
show(x)

PS Deprecation apart, doesn't work in Jupyter with Sagemath 9.2 but works in Sagecell.

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 3 years ago

slelievre gravatar image

This may work for you.

sage: x = [SR.var(f'x{i}', latex_name=fr'\overline{{x}}_{{{i}}}') for i in range(8)]
Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 3 years ago

Seen: 180 times

Last updated: Mar 22 '22