Ask Your Question
0

Defining an indexed list of variable with Latex_name

asked 2022-03-22 15:36:04 +0200

Cyrille gravatar image

updated 2022-03-22 15:51:53 +0200

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-03-22 17:06:42 +0200

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)]
edit flag offensive delete link more

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: 2022-03-22 15:36:04 +0200

Seen: 105 times

Last updated: Mar 22 '22