Currently it seems that ⍋
(Apl Functional Symbol Delta Stile U+234B) and ⍒
(Apl Functional Symbol Del Stile U+2352) are valid unicode identifiers but have no latex autocompletions. It'd be great if we could add these to the completions.
what are they in LaTeX? (i.e \xxx
)
I'm not sure if they even have standard latex names. \deltastile
and \delstile
would probably be appropriate though
I don't know how Julia indented to handle this, but I thought we only have the ones that are common in LaTeX
I don't know how Julia indented to handle this, but I thought we only have the ones that are common in LaTeX
There are some manual additions: https://github.com/JuliaLang/julia/blob/master/stdlib/REPL/src/latex_symbols.jl#L76
So far Julia has not strayed far into the territory of making up its own LaTeX-like escapes, but there's nothing in principle preventing us from doing so. It's just a matter of deciding if we should. The concerns are:
The first one is not actually all that concerning to me—we can always support multiple escapes for the same character. The latter is more concerning, but I think if the names we add are chosen so that the chance of such a collision is unlikely, then we should be ok. I rather doubt that LaTeX will add \deltastile
and \delstile
as escapes for some other characters.
Ideally there would be somewhere we can "upstream" such names, e.g. the W3C symbol mapping file. In fact we might want to create our own standard for this. We could fork off our scripts, store the mapping in a simple text format, put it in a new repo, and put a name on it.
IPython is already using our mapping (ipython/ipython#6380), so I'm guessing they might like a separate Julia-independent repo for this going forward as well (cc @ellisonbg, @Carreau)
The apl
package calls these symbols \GU
and \GD
, respectively, BTW.
⍋
and ⍒
are not allowed in identifiers in Python so this one in particular would not affect us.
But yes, storing the mapping in a simple text format would be great.
One question though – this mapping kind of exists but the names have spaces in it: Why not allowing the characters names in backslach completions?
\Apl Functional Symbol Delta Stile<tab> -> ⍋
; and even allow completion of the names themselves \Apl<tab> -> \Apl Functional Symbol <tab> -> ...
we already do that in IPython, there is nothing to reinvent and no bikeshedding on names. You can still add shorter aliases when for example symbol exists in tex;
And because my curiosity got the best of me; if you believe the "length" Apl Functional Symbol Delta Stile
might be too long to type; you can look at the minimal number of subsequent words that uniquely identify one unicode character; In the case of Apl Functional Symbol Delta Stile
, delta stile
is enough and minimal; which give you a simple and automatic rule to choose.
One word (W=1) is enough to uniquely identify 83% of unicode symbols (N= 107766) e.g: HEBREW ACCENT SHALSHELET -> SHALSHELET
Two words (W=2) are enough to uniquely identify 88% of unicode symbols (N+=7369) e.g: 'GREEK CAPITAL KAI SYMBOL -> CAPITAL KAI
,
W= 3 (+8890) covers 96% of unicode (etc...)
W= 4 (+3770) 98.66%
W= 5 (+1300) 99.67%
W= 6 (+261) 99.87%
W= 7 (+125) 99.97%
W= 8 (+40) 99.99%
W= 9 (+4) 100.00%
for the curious of those 4 poor characters that need 9 words to be uniquely identified:
ARABIC LIGATURE UIGHUR KIRGHIZ YEH WITH HAMZA ABOVE WITH ALEF MAKSURA ISOLATED FORM
ARABIC LIGATURE UIGHUR KIRGHIZ YEH WITH HAMZA ABOVE WITH ALEF MAKSURA FINAL FORM
ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH ALEF MAKSURA ISOLATED FORM
ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH ALEF MAKSURA FINAL FORM
A standard for tab insertion/completion of Unicode characters is a great idea. Needs a cute/clever name.
Most helpful comment
Ideally there would be somewhere we can "upstream" such names, e.g. the W3C symbol mapping file. In fact we might want to create our own standard for this. We could fork off our scripts, store the mapping in a simple text format, put it in a new repo, and put a name on it.