You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running Ubuntu 22.04.2. After entering command \lv to open Zathura, I receive an error message saying "VimTeX: Viewer cannot find Zathura window ID!", and Zathura doesn't display the pdf.
I have already checked to ensure that Zathura is synctex-enabled.
Moreover, I have indeed ensured that Zathura works from the command line in displaying the desired pdf. If it helps, my version of Zathura is listed below:
Additionally, when entering the cmd_start output (see below) in the command line, I receive the following error:
$ zathura -x "/usr/local/bin/vim -T dumb --not-a-term -n -c \"VimtexInverseSearch %{line} '%{input}'\"" --synctex-forward 5:14:'/home/cantorian_infinity/test.tex''test.pdf'
$ error: Could not connect to session bus: Could not connect: No such file or directory
error: Got no usable data from SyncTeX or D-Bus failed in some way.
callplug#begin()
"VimTeX
Plug 'lervag/vimtex'callplug#end()
letg:vimtex_viewer_method='zathura'" This will only work if `vim --version` includes `+clientserver`!" To enable Zathura and Vim to speak to each otherifempty(v:servername) &&exists('*remote_startserver')
callremote_startserver('VIM')
endif" Get Vim's window ID for switching focus from Zathura to Vim using xdotool." Only set this variable once for the current Vim instance.if!exists("g:vim_window_id")
letg:vim_window_id=system("xdotool getactivewindow")
endiffunction!s:TexFocusVim() abort" Give window manager time to recognize focus moved to Zathura;" tweak the 200m (200 ms) as needed for your hardware and window manager.sleep200m
" Refocus Vim and redraw the screensilentexecute"!xdotool windowfocus " . expand(g:vim_window_id)
redraw!endfunctionaugroupvimtex_event_focusau!auUserVimtexEventViewcalls:TexFocusVim()
augroupEND" So Vim finds Zathura window IDfunction!ZathuraHook() abortifexists('b:vimtex.viewer.xwin_id') &&b:vimtex.viewer.xwin_id <=0silentcallsystem('xdotool windowactivate ' . b:vimtex.viewer.xwin_id . ' --sync')
silentcallsystem('xdotool windowraise ' . b:vimtex.viewer.xwin_id)
endifendfunctionaugroupvimrc_vimtexautocmd!autocmdUserVimtexEventViewcallZathuraHook()
augroupEND
Just out of curiosity, I notice you have Vim 9.1 - as far as I know, Ubuntu 22 runs with Vim 8.2. Did you install Vim 9.1 from other repos or manually?
After entering command \lv to open Zathura, I receive an error message saying "VimTeX: Viewer cannot find Zathura window ID!", and Zathura doesn't display the pdf.
That Zathura doesn't even display the pdf is strange.
I have already …
Thanks for useful info.
Additionally, when entering the cmd_start output (see below) in the command line, I receive the following error: …
Great, glad to see I don't need to ask for this! And as you see from the output, there is clearly an important problem here that is not with VimTeX, but with your Zathura + Ubuntu installation. Are you on WSL?
minimal.vim …
Is this based on your current config? It seems you are using two hooks that are trying to do somewhat "opposing" things on VimtexEventView. I would simplify it, something like this:
if!exists("g:vim_window_id")
letg:vim_window_id=system("xdotool getactivewindow")
endiffunction!ZathuraHook() abort" sleep 100m " not sure if you need sleep...ifexists('b:vimtex.viewer.xwin_id') &&b:vimtex.viewer.xwin_id <=0silentcallsystem('xdotool windowactivate ' . b:vimtex.viewer.xwin_id . ' --sync')
silentcallsystem('xdotool windowraise ' . b:vimtex.viewer.xwin_id)
endif" sleep 200m " not sure if you need sleep...silentexecute"!xdotool windowfocus " . expand(g:vim_window_id)
endfunctionaugroupvimrc_vimtexautocmd!autocmdUserVimtexEventViewcallZathuraHook()
augroupEND
Feel free to add the comments back if you want. Also, when the viewer works, you should experiment with the sleep, it may not be necessary.
Description
Running Ubuntu 22.04.2. After entering command
\lv
to open Zathura, I receive an error message saying "VimTeX: Viewer cannot find Zathura window ID!", and Zathura doesn't display the pdf.I have already checked to ensure that Zathura is synctex-enabled.
Moreover, I have indeed ensured that Zathura works from the command line in displaying the desired pdf. If it helps, my version of Zathura is listed below:
Additionally, when entering the
cmd_start
output (see below) in the command line, I receive the following error:Steps to reproduce
vim -u minimal.vim minimal.tex
minimal.tex
minimal.vim
Expected behavior
Zathura to display minimal.pdf
Actual behavior
VimTeX: Viewer cannot find Zathura window ID! error appears
Do you use a latexmkrc file?
No
VimtexInfo
The text was updated successfully, but these errors were encountered: