GithubHelp home page GithubHelp logo

Subtle context matching about hsnips HOT 3 CLOSED

draivin avatar draivin commented on September 2, 2024
Subtle context matching

from hsnips.

Comments (3)

draivin avatar draivin commented on September 2, 2024

Hi @gruvw, the cleanest way for this to be fixed would be for LaTeX-Workshop to update their syntax files so that the math environment wouldn't be active inside a \text command, or alternatively to add another distinguishable scope once inside such a command (this implementation has the clear drawback where we are just pushing the problem one step down the scope ladder, what happens if we have a math block inside a \text command?).

On our end, the best we can probably do is to create a vscode extension that injects the relevant LaTeX grammar. The end result would be the same, but it would require one additional extension installation.

Unfortunately, my knowledge of textmate grammars isn't all that great (I'm barely able to add syntax highlighting to the .hsnips files), so I'd have to take some time to find out how to do that.

from hsnips.

gruvw avatar gruvw commented on September 2, 2024

Ok...

I don't think that the solution is to create a special extension just for this purpose and I hope we don't need to go that way...

About pushing the problem to the next text nesting, I don't really see the point: if you are in text mode (within a math block), why would you nest a new \text context ?
In short: \text{test $x+3 \text{ test}$} is the same as \text{test $x+3$ test}.
At least for me, one level nesting would be enough.

I will create a new issue in the LaTeX Workshop repository to see what they can do about it.

from hsnips.

gruvw avatar gruvw commented on September 2, 2024

will be merged into main branch of LaTeX-Workshop extension

from hsnips.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.