Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typing greek letters (conveniently) #9363

Closed
mapio opened this issue Mar 15, 2022 · 13 comments
Closed

Typing greek letters (conveniently) #9363

mapio opened this issue Mar 15, 2022 · 13 comments
Labels
language-any Area covering general issues geared to supporting any language (not just Python) notebook-intellisense Intellisense & other language features in notebook cells for any language

Comments

@mapio
Copy link

mapio commented Mar 15, 2022

As discussed in #806, #3315, and #3677 it would be great to be able to type greek letters in notebooks.

Since all such bug reports have been closed without solving the issue, I'd like to suggest to other users looking for help in the issues I'd like to point out the hint in #9362.

@mapio mapio added the bug Issue identified by VS Code Team member as probable bug label Mar 15, 2022
@rchiodo
Copy link
Contributor

rchiodo commented Mar 15, 2022

Thanks for the issue. What more would you want besides what the Greek Alphabet Snippets provides?

I doubt we'd be implementing specific support for the greek alphabet in the jupyter extension, but maybe this request is about more than typing.

Is this more about LaTeX auto complete?

@rchiodo rchiodo added enhancement and removed bug Issue identified by VS Code Team member as probable bug labels Mar 15, 2022
@mapio
Copy link
Author

mapio commented Mar 15, 2022

[…] maybe this request is about more than typing. Is this more about LaTeX auto complete?

Yes, more LaTeX auto completetion will be nice! The external package is a workaround for part of the problem (just the greek letters). It would be nice for the novice user to have auto completion of (all) LaTeX symbols without the need to look for another package (or hints in the issues/discussions) of this repo.

I do understand that you don't want to bloat the Jupyter package, but I think it's confusing that in a Python file and in a Jupyter notebook (in vscode) the completion works so differently.

@rchiodo
Copy link
Contributor

rchiodo commented Mar 15, 2022

I do understand that you don't want to bloat the Jupyter package, but I think it's confusing that in a Python file and in a Jupyter notebook (in vscode) the completion works so differently.

That would be a bug. They should be the same for python code. Or do you mean it doesn't behave as smoothly because you need to do to Jupyter specific tasks, like LaTeX?

@mapio
Copy link
Author

mapio commented Mar 15, 2022

That would be a bug. They should be the same for python code. Or are you referring to Jupyter specific tasks, like LaTeX?

Not sure to get what you mean.

If you open a Python file (with vscode), type \alpha and press TAB, the editor substitutes \alpha with , but the same does not happen if you open a Jupyter notebook (with vscode) and type in a code cell.

What I did not realize is that the completion works in a Python file thanks to yellpika.latex-input extension that seems not to work in Jupyter notebook code cells thoug.

On the other hand, the web interface of Jupyter notebooks supports LaTeX completion.

@rchiodo
Copy link
Contributor

rchiodo commented Mar 15, 2022

It's likely yellpika.latex-input extension doesn't support jupyter notebooks.

It is strange that the web jupyter supports LaTeX and we don't though. We use the same underlying service to get completions in notebooks.

Unless you have some extra extensions installed in jupyter too. Oh maybe this one? (https://github.com/latex-lsp/texlab). That wouldn't work in VS code.

@rchiodo
Copy link
Contributor

rchiodo commented Mar 15, 2022

Looking at the source for yellpika (https://github.com/YellPika/vscode-latex-input) you might be able to get it to work in a jupyter notebook. The scheme for the selector is wrong is all. It might work if you changed/added the 'scheme' value to 'vscode-notebook-cell'

@mapio
Copy link
Author

mapio commented Mar 15, 2022

It is strange that the web jupyter supports LaTeX and we don't though. We use the same underlying service to get completions in notebooks.

Tested now, in a freshly minted virtual environment with just pip install jupyter. If you enter \alpha and TAB in a code cell it is replaced by the unicode letter; that strangely does not happen for markdown cells!

@mapio
Copy link
Author

mapio commented Mar 15, 2022

It might work if you changed/added the 'scheme' value to 'vscode-notebook-cell'

It works! That's a very good hint, thank you. I read the extension doc, but was unable to figure out the scheme myself.

@DonJayamanne DonJayamanne added notebook-intellisense Intellisense & other language features in notebook cells for any language language-any Area covering general issues geared to supporting any language (not just Python) and removed needs-triage labels Mar 17, 2022
@mapio mapio closed this as completed Apr 8, 2022
@mapio
Copy link
Author

mapio commented Oct 8, 2022

Watch out that the order seems to be relevant. This

  "latex-input.selector": [  
    {
      "scheme": "vscode-notebook-cell"
    },
    {
      "scheme": "file"
    }
  ]

works, but swapping the two "scheme" dicts does not.

@p-i-
Copy link

p-i- commented Mar 10, 2023

waitwat..?

Tested now, in a freshly minted virtual environment with just pip install jupyter. If you enter \alpha and TAB in a code cell it is replaced by the unicode letter; that strangely does not happen for markdown cells!

I just tried creating a x.ipynb in VSCode FileExplorer, opening it, running a cell (which force-installs ipykernel) and \alpha<TAB> 100% does NOT autocomplete.

This is something I sorely miss. It's super-useful to be able to use greek variables when transcribing from ArXiv ML papers.

Please can team VSCode consider getting this working? Really it's a biggie.

@mapio
Copy link
Author

mapio commented Mar 10, 2023

If you read carefully the thread, you see that it works (both in code and Markdown cells) if you just install https://github.com/YellPika/vscode-latex-input and then add #9363 (comment) in your settings.json.

Hope this helps.

@Atcold
Copy link

Atcold commented Mar 27, 2023

Does this work also for y\tilde + <Tab>?
Jupyter Notebook and Lab both replace y with .

@Yugal0
Copy link

Yugal0 commented Apr 6, 2023

Thanks for the issue. What more would you want besides what the Greek Alphabet Snippets provides?

I doubt we'd be implementing specific support for the greek alphabet in the jupyter extension, but maybe this request is about more than typing.

Is this more about LaTeX auto complete?

I installed Greek Alphabet Snippets. But don't know how to use it, I am a newbie, Any help please.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
language-any Area covering general issues geared to supporting any language (not just Python) notebook-intellisense Intellisense & other language features in notebook cells for any language
Projects
None yet
Development

No branches or pull requests

6 participants