Closed banana59 closed 1 month ago
this is not a issue perse, rather a request. I can't manage to find a config example for vimtex on Linux using Wayland with Mupdf (for Neovim) using Latexmk. I want to use mupdf since it is also available on windows (or any other pdf viewer available on both OS's). I have read the sections of the documentation regarding Mupdf and couldn't find a valid example using this combination.
…
I couldn't find ways to automatically update Mupdf after the pdf-file change.
MuPDF on Linux with Xorg works because we use xdotool
behind the scenes to make this happen. I believe it is possible to do something similar on Wayland, but I've never used Wayland myself and so I've never investigated thoroughly.
Can this be automated?
So, I think the answer is yes, but I'm not sure. And I'm sorry to say that I'm not interested in spending much time on this until I'm personally using Wayland. But if anyone figures it out I will be happy to accept patches or concrete suggestions.
Can the plugin be configured so that it uses the existing window if there is already one window instance open.
This again relies on xdotool
. With xdotool
we can check if there is an
existing window and avoid opening multiple windows.
As an alternative solution: did you consider testing Zathura? I believe it works on Wayland and it has many of the same benefits as MuPDF (fast, minimal). It should work better with Wayland than MuPDF.
This seems to work (auto refreshing & one window instance & jumping to the current line). Are there redundant options?
vim.g.vimtex_compiler_method = 'latexmk'
vim.g.vimtex_compiler_latexmk = {
build_dir = '',
callback = 1,
continuous = 1,
executable = 'latexmk',
options = {
'-shell-escape',
'-verbose',
'-file-line-error',
'-interaction=nonstopmode',
'-synctex=1'
}
}
vim.g.vimtex_view_method = 'zathura'
vim.g.vimtex_view_general_viewer = 'zathura'
vim.g.vimtex_view_general_options = '--shell-escape -interaction=nonstopmode -synctex=1 -file-line-error'
vim.g.vimtex_view_zathura_options = '-x "nvr --remote-silent +%{line} %{input}" --synctex-forward %l:0:%f'
No ~/.latexmkrc needed
This seems to work (auto refreshing & one window instance & jumping to the current line). Are there redundant options?
Yes, you can simplify to this:
vim.g.vimtex_compiler_latexmk = {
options = {
'-shell-escape',
'-verbose',
'-file-line-error',
'-interaction=nonstopmode',
'-synctex=1'
}
}
vim.g.vimtex_view_method = 'zathura'
When you set the view method to Zathura you don't need to configure the general view method. And I removed stuff that were already defaults.
You should not really need to specify vim.g.vimtex_view_zathura_options
, because it should already be properly specified by VimTeX. If this doesn't work as expected, in particular backward search, then that is most likely because you are lazy loading VimTeX.
I have updated it according to your advice. I now get the error that zathura window id can't be found, it opens the previewer window though.
On windows with WSL2 I get the same error and the previewer window do not open. In /etc/wsl.conf
[boot]
systemd=true
is set.
I have updated it according to your advice. I now get the error that zathura window id can't be found, it opens the previewer window though.
That's as expected: Zathura will also use xdotool
, which won't work. So, now try to use zathura_simple
instead. It should work more or less the same, except it won't require xdotool
.
![My current config]
It is much easier to help comment on config if you include the actual text content. A screenshot is harder. But ok, a few comments:
vim.g.vimtex_view_method = 'zathura_simple'
g.tex_conceal
- it is irrelevant and has nothing to do with VimTeX.vim.g.vimtex_indent_enabled
vim.g.vimtex_imaps_enabled
vim.g.vimtex_complete_enabled
vim.g.vimtex_syntax_enabled
Also, I think you might want to remove tex-conceal.vim
, because VimTeX already provides the desired conceals.
On windows with WSL2 I get the same error and the previewer window do not open.
If you have issues on Windows with WSL2, please open a new issue - it is really a different beast!
Thank you. This works great now. I will open another issue, if I can't manage to solve the WSL2 issue with the already preexisting issues.
Thanks, glad to see that things work well now!
Description
Hello,
this is not a issue perse, rather a request. I can't manage to find a config example for vimtex on Linux using Wayland with Mupdf (for Neovim) using Latexmk. I want to use mupdf since it is also available on windows (or any other pdf viewer available on both OS's). I have read the sections of the documentation regarding Mupdf and couldn't find a valid example using this combination.
Steps to reproduce
My minimal vimtex configuration looks like
Expected behavior
Actual behavior
Do you use a latexmkrc file?
No, though I have tried $dvi_update_method=2 and $new_viewer_always=0
VimtexInfo