Skip to content

Use absolute path for Zathura forward search#2377

Closed
GianCarloMilanese wants to merge 1 commit intolervag:masterfrom
GianCarloMilanese:master
Closed

Use absolute path for Zathura forward search#2377
GianCarloMilanese wants to merge 1 commit intolervag:masterfrom
GianCarloMilanese:master

Conversation

@GianCarloMilanese
Copy link
Copy Markdown

Hello,

I have always had issues with Zathura forward search (backward works fine on the other hand).

The only way to fix it for me is to use absolute paths instead of relative paths.

Maybe someone else has the same issue, I hope this is somewhat useful.

Thanks for the plugin, I have been using it for quite a while :)

@lervag
Copy link
Copy Markdown
Owner

lervag commented Apr 25, 2022

I have always had issues with Zathura forward search (backward works fine on the other hand).

The only way to fix it for me is to use absolute paths instead of relative paths.

The suggested change addresses code that was last modified for #2342, and there's been no complaint on this issue since then (until now). I know for a fact that a lot of people use VimTeX + Zathura on Linux machines, so: It would be very useful to have an example where I can reproduce the problem.

Can you provide:

  1. Some basic information on your system, such as OS, vim version, etc. Most of this is provided by the output of :VimtexInfo.

  2. A minimal example (test.vim and test.tex) for reproduction of the problem. E.g.

    " test.vim
    set nocompatible
    set runtimepath^=~/.local/plugged/vimtex
    set runtimepath+=~/.local/plugged/vimtex/after
    filetype plugin indent on
    syntax enable
    
    " other options/config?
    
    silent edit test.tex
    % test.tex
    \documentclass{minimal}
    \begin{document}
    
    Hello World!
    
    \end{document}
  3. Steps to reproduce, e.g. nvim --clean -u test.vim + \ll. Go to "Hello" and do \lv - should perform forward search.

Thanks for the plugin, I have been using it for quite a while :)

Glad you like it!

@GianCarloMilanese
Copy link
Copy Markdown
Author

Thanks a lot for your time. I'm sorry for the late reply.

My OS is Ubuntu 20.04.3 LTS, and my VIM version is NVIM v0.8.0-dev.

I have tried with the following files:

" test.vim
set nocompatible
set runtimepath^=~/.local/plugged/vimtex
set runtimepath+=~/.local/plugged/vimtex/after
filetype plugin indent on
syntax enable

let g:vimtex_view_method = "zathura"

silent edit test.tex
% test.tex
\documentclass{minimal}
\usepackage{lipsum}
\begin{document}

\lipsum[1]

\newpage
\lipsum[2]

\newpage
\lipsum[3]

\end{document}

I have cloned the latest version of vimtex in ~/.local/plugged/vimtex and run nvim --clean -u test.vim.

After \ll, the pdf opens on the first page. Doing \lv while my cursor is on any line of the tex file will always move the pdf to the first page. E.g., if the pdf is on page 3 and I do \lv while on the line containing \lipsum[2], the pdf will focus on the first page instead of the second page.

After changing line 102 of autoload/vimtex/view/zathura.vim like in the PR so that it uses absolute paths, the forward search works fine.

Thanks again. Let me know if you need any other information.

@lervag
Copy link
Copy Markdown
Owner

lervag commented May 8, 2022

I still can't reproduce this. I do this:

cd ~
mkdir test
cd test
nvim test.vim # add content from the minimal vimrc
nvim test.tex # add content from the minimal tex file
nvim --clean -u test.vim

then

  1. \ll - observe that compilation is successful and a three page pdf opens in Zathura.
  2. \lv - works as expected for me generally.

Note, I don't mind making the change if I can observe specifically that it is necessary, but I hesitate to do it before I am sure it actually solves anything. There is a risk that it may break something for some users as well, which is why I want to reproduce this first.

@lervag
Copy link
Copy Markdown
Owner

lervag commented May 8, 2022

Could this be related to synctex version? Or to the Zathura version? I have

❯ synctex help
This is SyncTeX command line utility, version 1.5
Synchronize TeXnology command-line client, version 1.21

❯ zathura --version
zathura 0.4.9
girara 0.3.7 (runtime: 0.3.7)
(plugin) pdf-mupdf (0.3.8) (/usr/lib/zathura/libpdf-mupdf.so)

@lervag
Copy link
Copy Markdown
Owner

lervag commented May 18, 2022

I believe #2392 is a duplicate of this issue. I'm closing this due to inactivity; I hope this will be resolved after fixing #2392.

@lervag lervag closed this May 18, 2022
lervag added a commit that referenced this pull request May 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants