Closed coycatrett closed 3 months ago
Do you use Xorg or Wayland?
I am unsure what those terms mean. How would I check for the one that I use?
Also, kindly see the edit I made to the initial post
I am unsure what those terms mean. How would I check for the one that I use?
When I want to view a converted pdf file from latex using zathura, vimtex reports back with "Vimtex: Viewer cannot find Zathura window ID".
Wayland and Xorg are two different display server protocols. Wayland is "modern" and expected to be the successor of Xorg. However, since Xorg is very old and very mature and mostly "just works", it's hard to really replace it. Still, Ubuntu and other distros are slowly changing to Wayland as the default.
If you use Wayland, then the "window ID" concept no longer makes sense and the standard Zathura viewer will not work properly. That's why I'm asking which of these you are using.
Edit: added
vim.cmd('filetype plugin indent on')
to init function and now the Zathura window appears after executing:VimtexView
. This did not fix the errors below with the lazy reloading nor get rid of the initial error message that the viewer cannot find the zathura window ID.
That should really not be necessary if you load VimTeX with lazy.nvim.
When I reload vimtex with lazy, here is what it reports: …
What does "reload VimTeX with lazy" mean? Is it :Lazy reload vimtex
? If so, then you really should not need to do any reloading. Also, this is an entirely different problem than the original one, so let's keep the issue focused on the Zathura thing.
Steps to reproduce
No response
Expected behavior
No response
Actual behavior
No response
It is really useful if you provide the steps to reproduce and the expected versus actual behaviour. I understand that it can feel pedantic, but the point is to avoid simple misunderstandings and confusions that are hard to catch if we are not explicit.
Something like:
cd somewhere
nvim test.tex
:VimtexCompile
VimtexInfo
viewer: Zathura cmd_start: zathura -x "/opt/nvim-linux64/bin/nvim --headless -c \"VimtexInverseSearch %{line} '%{input}'\"" --synctex-forward 5:3:'/home/ccatrett/test.tex' 'test.pdf'&
What happens if you execute the zathura command manually in a terminal?
zathura -x "/opt/nvim-linux64/bin/nvim --headless -c \"VimtexInverseSearch %{line} '%{input}'\"" --synctex-forward 5:3:'/home/ccatrett/test.tex' 'test.pdf'
If you use Wayland, then the "window ID" concept no longer makes sense and the standard Zathura viewer will not work properly. That's why I'm asking which of these you are using.
I tried researching how to check which display server protocol.
Running echo $DISPLAY
returns :0
and running echo $WAYLAND_DISPLAY
returns wayland-0
.
Running ps -e | grep -E 'Xorg|X$'
doesn't return anything. I am still unsure of which one I am using, but I think it is wayland based on the wayland display variable.
It is really useful if you provide the steps to reproduce and the expected versus actual behaviour. I understand that it can feel pedantic, but the point is to avoid simple misunderstandings and confusions that are hard to catch if we are not explicit.
I have made updates to the original report for reproduction.
What happens if you execute the zathura command manually in a terminal?
The zathura application opens and correctly displays the test.pdf file.
I tried researching how to check which display server protocol.
Running
echo $DISPLAY
returns:0
and runningecho $WAYLAND_DISPLAY
returnswayland-0
.
You can check with echo $XDG_SESSION_TYPE
, which returns x11
if you are on Xorg or wayland
if you're on Wayland.
But since you have the $WAYLAND_DISPLAY
variable, I guess you are running Wayland.
…, but I think it is wayland based on the wayland display variable.
Exactly - and the Zathura viewer config does not work well on Wayland. Try to change it to the 'zathura_simple'
variant. It should work more or less equally well. See :help vimtex-view-zathura-simple
.
let g:vimtex_view_method = 'zathura_simple'
or
vim.g.vimtex_view_method = "zathura_simple"
Thank you! That fixed the "cannot find viewer ID" message.
I'll look more into the display protocols. How would I know to think about issues like this in the future?
Thank you! That fixed the "cannot find viewer ID" message.
Glad to hear it!
I'll look more into the display protocols. How would I know to think about issues like this in the future?
It's at least partially explained in the docs. If you read :help vimtex-view-zathura
:
Zathura is, like MuPDF, a very fast and minimalistic viewer. Compared to
MuPDF, it allows more user configuration. Zathura has full support for both
forward and inverse search. ZATHURA SHOULD BE STRAIGHTFORWARD TO INSTALL AND
USE ON LINUX WITH XORG. …
...
The main variant uses `xdotool` to help avoid duplicate Zathura instances.
However, in some environments, `xdotool` is not available. Here the simple
variant should work well.
Still, if you are not aware of the concepts of the display manager (Wayland vs Xorg/X11/X window system), then I understand it is hard to catch these things.
Description
When I want to view a converted pdf file from latex using zathura, vimtex reports back with "Vimtex: Viewer cannot find Zathura window ID".
Zathura version:
minimal vimtex.lua file:
Edit: added
vim.cmd('filetype plugin indent on')
to init function and now the Zathura window appears after executing:VimtexView
. This did not fix the errors below with the lazy reloading nor get rid of the initial error message that the viewer cannot find the zathura window ID.File tree & Lazy.lua file:
Minimal tex:
When I run
:VimtexView
in the minimal tex document, this error message appears:When I reload vimtex with lazy, here is what it reports:
The relevant results after running
checkhealth
:Steps to reproduce
Expected behavior
Zathura opens the pdf with no error message from neovim displaying, 'Vimtex: Viewer cannot find Zathura window ID'
Actual behavior
Zathura opens the pdf with an error message from neovim displaying 'Vimtex: Viewer cannot find Zathura window ID'
Do you use a latexmkrc file?
No
VimtexInfo