Hi,
Since Sage uses Python 3, we can finally use unicode symbols for variables:
sage: Φ = lambda λ: λ + 1
But how to input them? I just accidently discovered that IPython (and
thus Jupyter) makes it super easy. Type:
sage: \Phi<tab>
And you get:
sage: Φ
https://ipython.readthedocs.io/en/stable/api/generated/IPython.core.completer.html#forward-latex-unicode-completion
Reverse conversion from symbol to latex name works too:
sage: \Φ<tab>
And you get:
sage: \Phi
Not all symbols are available by default; for example \otimes. But
it's possible to add more symbols:
import IPython.core.completer
IPython.core.completer.latex_symbols[r'\otimes'] = '⊗'
(best to add it as well to reverse_latex_symbol).
A rather big caveat though: one can easily input all the usual math
glyphs (mathbb, mathfrak, ...) of a character. However they all are
considered as equal by Python itself:
sage: \mbfN<tab>
sage: 𝐍
<function numerical_approx at 0x7f712339f6a8>
sage: N
<function numerical_approx at 0x7f712339f6a8>
Cheers,
Nicolas
--
Nicolas M. Thiéry "Isil" <
nth...@users.sf.net>
http://Nicolas.Thiery.name/