Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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

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 => 'α'

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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)

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading