Skip to content

Zathura fails for symbolic links (physical vs. absolute logical paths) #2865

@mms-neuro

Description

@mms-neuro

Description

This is an observation I made - I found ways to get around it, but it might be interesting to fix it anyways.

If a tex-document is compiled in a directory with symbolic links in the path (and opened by that absolute path in the command) and should be opened with Zathura, zathura could try to open the file in the wrong directory.

Steps to reproduce

The issue is probably a problem of how the paths are handled (and how symbolic links work on linux) and therefore mainly dependent on the file-structure. It should work with any minimal configuration, provided that let g:vimtex_view_method = 'zathura' (or minimal) is set.

Directory setting (bash)

My setting is quite complex, but I think this is the essence of the problem:
In practice, a device should of course be mounted.

cd /home/myusername/
mkdir /mnt/mydrive/
ln -s /mnt/mydrive 
cd mydrive
nvim /home/myusername/mydrive/test.tex

Then paste minimal example, write file and compile.

Call :VimxtexView

Comments on the setting

Vimtex-Root

If I call (in /home/myusername/mydrive)
nvim test.tex, then the Vimtex-Root is /mnt/mydrive/
If I use nvim /home/myusername/mydrive/test.tex, then the Vimtex-Root for the same file is /home/myusername/mydrive (using the symbolic link).

Note, that in that case, :pwd and !pwd return different paths, the first the physical path /mnt/mydrive (can be called in bash by pwd -P) and the second one the 'logical path' /home/myusername/mydrive (pwd -L).

Problems in Vimtex:

Expected behavior

Zathura window opens and shows test.pdf

Actual behavior

Zathura document opens and shows no file (tries to open the file in the wrong directory).

Do you use a latexmkrc file?

No

VimtexInfo

Hope the problem is clear like that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions