Vscode-markdown: Language configuration for LaTeX math area (auto closing, auto surrounding, etc.)

Created on 13 Dec 2019  ·  3Comments  ·  Source: yzhang-gh/vscode-markdown

I use a lot LaTeX workshop and it would be nice if some feature from this (very) popular extension would be also supported:

  • add autoclosing brackets/curly bracket/dollar sign.
  • adding pairs of brackets/curly bracket/dollar sign on selection. Example, I select a word and type {, which adds a pair of curly brackets around the word instead of replacing the word by {

I think theses little tricks really help to write faster, which IMHO is quite important for this extension because I see markdown+LaTeX as a nice way to take notes during seminars.

math Feature

Most helpful comment

add autoclosing brackets/curly bracket/dollar sign

How about using the "toggle math" command we provide?

toggle math

As for the curly braces (autoclosing, surrounding), it is defined here (VSCode repo).
surrounding:
It might be a good idea to change there, for example, adding { to the surrounding pairs.
autoclosing:
Sometimes { doesn't auto-close because it is right before some characters. I'm not sure whether we can make some changes to that.

All 3 comments

add autoclosing brackets/curly bracket/dollar sign

How about using the "toggle math" command we provide?

toggle math

As for the curly braces (autoclosing, surrounding), it is defined here (VSCode repo).
surrounding:
It might be a good idea to change there, for example, adding { to the surrounding pairs.
autoclosing:
Sometimes { doesn't auto-close because it is right before some characters. I'm not sure whether we can make some changes to that.

Sorry, you are right autoclosing works for brackets, I do not remember why I thought it did not.

In LaTeX-Workshop, they managed to add surrounding by {, [ and $. May be we can look how they did it ? May be this can help: https://github.com/James-Yu/LaTeX-Workshop/issues/1530#issuecomment-514523815

It looks like they make use of the VSCode "language configuration" as I mentioned above (see the link).

link

So I suggested that we add { to the surrounding pairs in VSCode repo (otherwise we need to override the "language configuration").

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rdhar picture rdhar  ·  4Comments

smallprogram picture smallprogram  ·  3Comments

maoturing picture maoturing  ·  4Comments

alexb148 picture alexb148  ·  3Comments

ichirou2910 picture ichirou2910  ·  3Comments