Mark Bakker
Mark Bakker

Reputation: 831

Convert greek latex symbol in the jupyter-lab text editor

In Jupyter Notebooks you can type, for example \alpha and hit the tab key and the \alpha changes into α. This is a pretty cool feature. Unfortunately, it doesn't work in the jupyter-lab editor. Any reason why that doesn't work? Or do I need to set a preference somewhere?

Upvotes: 5

Views: 5935

Answers (3)

Leerro
Leerro

Reputation: 53

Although the answer of @joelostblom works fine, you can simply install the LaTeXStrings Julia package to enable the \alpha [tab] feature without needing to spawn an IPython kernel.

using Pkg
Pkg.add("LaTeXStrings")

Upvotes: 2

joelostblom
joelostblom

Reputation: 48974

This feature is provided by the IPython kernel, not the Jupyter Notebook. The kernel provides TAB completion by looking up the latex (or latex-like) symbol in this dictionary (originally from Julia) and then inserts its value (the corresponding Unicode character). As such, there needs to be an active IPython kernel to provide the TAB completion (here is the PR that added the functionality to IPython in case you want to read more about it).

An IPython kernel is automatically started with the notebook and used when running cells, but this is not the case when editing a text file (which is also why there is no TAB completion for other things such as imports, etc). You can start one manually by right clicking inside a Python text file and selecting "Create console for editor". After that autocompletion works just as in the notebook, including Greek latex symbols.

Upvotes: 1

Robin Nicole
Robin Nicole

Reputation: 662

if you type $\alpha$ it will be rendered as the greek letter thanks to latex

Upvotes: 3

Related Questions