I have created Meta-ticket https://trac.sagemath.org/ticket/30111 for keeping track of Unicode issues.
On Friday, February 21, 2020 at 8:09:36 AM UTC-8, Nicolas M. Thiéry wrote: > > 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 <javascript:>> > http://Nicolas.Thiery.name/ > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/e1aadbe3-031c-41d9-a4b6-5a5b0bbec907o%40googlegroups.com.