Ask Your Question

LaTeX Greek names for symbolic variables

asked 2021-03-17 00:15:49 +0100

Road gravatar image

updated 2021-03-17 00:19:20 +0100

Instead of the following:

x,y,z,s1,s2,s3,s4,s5 = var('x,y,z,s_1,s_2,s_3,s_4,s_5')

I want to display s_1, s_2, s_3, s_4, s_5 as $\sigma_1, \sigma_2, \sigma_3, \sigma_4, \sigma_5$. So for example, when I type show(s1/s2) , it would typeset

$$ \frac{\sigma_1}{\sigma_2}. $$

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2021-03-17 01:08:34 +0100

slelievre gravatar image

updated 2021-03-20 01:18:21 +0100

One could directly define the variables as σ1, ..., σ5.

In IPython (and Jupyter), type \sigma and hit the TAB to get σ.

Other options include copy-paste, and switching to Greek keyboard. : )

Here is a more old-fashioned way to get something like in the question.

sage: s = dict((i, SR.var(f's_{i}', latex_name=fr'\sigma_{{{i}}}')) for i in (1 .. 5))

sage: s[1] / s[2]

sage: show(s[1] / s[2])

$$ \frac{\sigma_1}{\sigma_2} $$

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


Asked: 2021-03-17 00:15:49 +0100

Seen: 391 times

Last updated: Mar 20 '21