A function the provides the [TAB] key latex functionality in Julia REPL

125 Views Asked by At

In the Julia REPL, if I want to type the α character, what I would do is: \alpha[TAB] which returns the Greek letter, what I would like to do/know if there is a way to emulate this behavior via a function like the following:

tab_function(raw"\alpha") # output => 'α'
1

There are 1 best solutions below

0
Bogumił Kamiński On BEST ANSWER

You can check the whole implementation of REPL completions in https://github.com/JuliaLang/julia/blob/master/stdlib/REPL/src/REPLCompletions.jl.

For your case I think that the easiest is to use REPL.REPLCompletions.latex_symbols dictionary:

julia> REPL.REPLCompletions.latex_symbols[raw"\alpha"]
"α"

(but if you need something more fancy then check the file I have linked above)