Coder Social home page Coder Social logo

Comments (3)

lervag avatar lervag commented on June 12, 2024 1

Hi!

I have a custom \beforetext command that adds text on the left side of an equation. Following #2755, I'd like to know how to setup a local syntax to tell vimtex that what's inside is text. I looked up the commit you made for witharrows and could easily reproduce it, but my command is not attached to any package. Would you be able to point me in the right direction to do that?

  syntax match texMathCmdText "\\beforetext\>"
        \ contained skipwhite nextgroup=texMathTextArg

I believe you can solve this with the g:vimtex_syntax_custom_cmds option. Specify it wherever you specify your other VimTeX options. Something like this:

let g:vimtex_syntax_custom_cmds = [
      \ {'name': 'beforetext', 'mathmode': v:true,
      \  'nextgroup': 'texMathTextArg'},
      \]

As always, thank you for this fantastic plugin and your maintenance of it :-).

Thanks for the kind words! <3

from vimtex.

lervag avatar lervag commented on June 12, 2024 1

Thank you! I must've missed it, I just started using the useful concealing tools and changed the highlighting groups, but didn't stumble on that.

I'll be the first to admit it's easy to miss things when the documentation has reached 7000 lines of text... in any case, no problem!

from vimtex.

Nora-n avatar Nora-n commented on June 12, 2024

Thank you! I must've missed it, I just started using the useful concealing tools and changed the highlighting groups, but didn't stumble on that.

Cheers! :-)

from vimtex.

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.