Coder Social home page Coder Social logo

Comments (5)

lervag avatar lervag commented on June 12, 2024

Describe the solution you'd like We can use the new synctex feature (explained in user202729/luatex@0831bb6#commitcomment-139418652 ) (if the feature is available with the installed synctex version that is)

To be honest, I don't quite understand how to use the new synctex feature based on that comment (and the linked threads).

Also, it looks like this stuff is brand new and not really available in any releases yet? That is, the PR jlaurens/synctex#75 is not even merged yet. But perhaps I'm misunderstanding this?

The main question is: How should I update VimTeX to take use this new feature?

Another option is to use the C interface libsynctex, but I think this would complicate the distribution process (require the user to compile C and/or distribute platform-dependent executables)

Yes, this seems too complicated.

from vimtex.

user202729 avatar user202729 commented on June 12, 2024

Basically the feature works like this:

Currently, in vimtex you have a command <Plug>(vimtex-view) that invokes synctex view ....

The problem with this approach is that each time you invoke the executable, it has to parse the synctex file (which let's say takes 1-2 second), then the executable exits immediately, so the parsing result is lost and next time it needs to be parsed again.

With the new change, you invoke the synctex executable with --interactive, then the executable will remain there in the background, the next time you want to invoke synctex view …, you just pass it to the standard input of the executable.


Indeed, it's not available in any release yet. This is just a proposal to see if you're interested in implementing it (or at least have it implemented, I can try to pull request in the latter case).


On the vimtex side, I think an implementation would need to:

  • keep track of the running synctex job as well as the latexmk job
  • change the logic as needed to use the synctex job instead of spawning a new process
  • other bookkeeping stuff (e.g. on \lx plugin reload, terminate the synctex job as well, and on \ll... should the synctex job be kept running?)

from vimtex.

lervag avatar lervag commented on June 12, 2024

Currently, in vimtex you have a command <Plug>(vimtex-view) that invokes synctex view ....

Well, that's not quite right. VimTeX never really uses synctex explicitly, except in a single specific sub case: It is used for the MuPDF viewer, because MuPDF does not have built-in support for synctex.

Instead, the viewers use synctex behind the scenes.

So, IMHO, it would make much more sense to delegate this responsibility to the viewers. Then it would also benefit users who don't use VimTeX.

With the new change, you invoke the synctex executable with --interactive, then the executable will remain there in the background, the next time you want to invoke synctex view …, you just pass it to the standard input of the executable.

I'm curious: Does synctex --interactive work be creating a daemon process such that subsequent standard synctex ... calls will reuse the daemon process?

That is, would it sort of suffice for VimTeX to start this daemon process when someone invokes the viewer, and then just ensure to kill it when the specific LaTeX project is closed?

from vimtex.

user202729 avatar user202729 commented on June 12, 2024

That's interesting, I made a wrong assumption. Looks like it's zathura's fault then.

I'm curious: Does synctex --interactive work be creating a daemon process such that subsequent standard synctex ... calls will reuse the daemon process?

Unfortunately, no. But that sounds like a nice idea.

from vimtex.

lervag avatar lervag commented on June 12, 2024

That's interesting, I made a wrong assumption. Looks like it's zathura's fault then.

No problem!

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.