Giter Club home page Giter Club logo

Comments (7)

lervag avatar lervag commented on August 16, 2024 1

My main.tex which I call via vim main.tex in a folder containing the .tex file and above .vimrc is: …

FYI: I updated your example and removed the unnecessary white space.

Inverse search with "Shift + Left Mouse Click" on the Okular pdf file location, however, does not work.

I indeed have set within "Configure Okular dialog box" following https://docs.kde.org/stable5/en/okular/okular/inverse_search.html the setup of "Custom Text Editor" with Command: vim --remote-silent +%l %f

Ah, but you didn't set it following the VimTeX docs. ;)

Please see :help vimtex-view-okular and :help vimtex-synctex-inverse-search. I'll be glad to help if you still find it hard to set up, but I believe the docs should give the necessary info.

from vimtex.

lervag avatar lervag commented on August 16, 2024 1

You can try to run the command from a terminal. E.g.:

  1. Open your LaTeX file (e.g. test.tex) with Vim like you normally would.
  2. Verify that you have a servername (e.g. with \li).
  3. Compile the file from VimTeX.
  4. In a different terminal, cd to the directory where your LaTeX file is.
  5. Run vim -v --not-a-term -T dumb -c "VimtexInverseSearch 3 'test.tex'" in the terminal.

This should move your cursor to line 3 inside the VimTeX buffer. If it works as expected, then we should be able to make it work in Okular as well.

While debugging in Okular, one simple trick is to use echo CMD ARGS > /home/USER/okular.log. E.g., you can try to use echo "vim -v --not-a-term -T dumb -c ""VimtexInverseSearch %l '%f'"" > /home/USER/okular.log" (notice how "" becomes a single double quote within a double quoted string).

from vimtex.

lervag avatar lervag commented on August 16, 2024 1

I am able to confirm that your steps 1 through 5 indeed work as you describe. When I copy pasted your echo command modifying USER appropriately, strangely, no log file is created in /home/USER

Perhaps this is a bug with Okular than. :-(

My initial thought is that you may be using the wrong sequence for activating backward search? E.g., perhaps it is CTRL + right click? I'm not sure, but that would be one thing to look into.

I tried within Okular simply echo "pwd > /home/TryerGit/Okular.log" and this also does not create any log file.

You should use echo "pwd" > /home/TryerGit/Okular.log (or echo $PWD ...).

I installed qpdfview and it seems to work. So, all is well now. In the qpdfview documentation, perhaps you can consider adding the place where the setting should be specified. I could not find it specified otherwise.

I'm glad to hear it! I've found qpdfview to be a solid viewer (although I personally prefer Zathura). And thanks, I'll update the docs.

from vimtex.

TryerGit avatar TryerGit commented on August 16, 2024 1

Just wanted to close the loop in terms of my tests thus far. While reverse-search seems to work in single .tex files, somehow neither Okular/Zathura/qpdfview seem to work for me with multi-file projects. Time permitting, I will create some minimal working example and share it.
----Edit----
On a simple small example multifile project's forward and reverse search work fine. On my larger main project, it does not work. So, there is something in my config that is incorrect. VimTeX seems fine.

from vimtex.

TryerGit avatar TryerGit commented on August 16, 2024

I am still struggling, @lervag .

Are you referring to the line?

To configure with `VimtexInverseSearch`, use: >bash

  vim -v --not-a-term -T dumb -c "VimtexInverseSearch %l '%f'"

in https://github.com/lervag/vimtex/blob/master/doc/vimtex.txt

Initially, I was confused about the >bash at the beginning line there before I opened this issue. Then, after your post, when I looked into :help from within Vim, I realized that the >bash is used for formatting purposes. (something new is learned everyday!)

In any case, I put in vim -v --not-a-term -T dumb -c "VimtexInverseSearch %l '%f'" into the command argument of Okular and tried it again and it still does not work. Is there a way to capture within Vim (some debug output?) what is happening when Shift Click is pressed in Okular?

Thanks for your patient help.

----Edit---
I should add that :echo serverlist() does return VIM, so I would imagine that the server is indeed running on my Vim side.

from vimtex.

TryerGit avatar TryerGit commented on August 16, 2024

I am able to confirm that your steps 1 through 5 indeed work as you describe.
When I copy pasted your echo command modifying USER appropriately, strangely, no log file is created in /home/USER

Perhaps this is a bug with Okular than. :-(

I tried within Okular simply echo "pwd > /home/TryerGit/Okular.log" and this also does not create any log file.

from vimtex.

TryerGit avatar TryerGit commented on August 16, 2024

@lervag

I installed qpdfview and it seems to work. So, all is well now. In the qpdfview documentation, perhaps you can consider adding the place where the setting should be specified. I could not find it specified otherwise.

It is in Edit->Setting->Source Editor->vim -v --not-a-term -T dumb -c "VimtexInverseSearch %2 '%1'"

Then, rightclicking on the document pdf opens up a popup the first option of which is the file / line number of the .tex file.
Thank you!

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.