Ask Your Question

Revision history [back]

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

Note that in IPython (and in Jupyter), typing \sigma followed by the TAB key displays σ.

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]
s_1/s_2

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

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

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

Note that in In IPython (and in Jupyter), typing type \sigma followed by and hit the TAB key displays 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]
s_1/s_2

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

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