lervag / vimtex

VimTeX: A modern Vim and neovim filetype plugin for LaTeX files.
MIT License
5.51k stars 389 forks source link

zathura_simple on wayland not outputting pdf #2880

Closed pyfb78 closed 8 months ago

pyfb78 commented 8 months ago

Description

I am trying to use Zathura on my manjaro linux setup which uses wayland. I have use put zathura_simple as my view method and while vimtex is able to compile my document, it is not able to actually give me a pdf output for me to see it.

Steps to reproduce

minimal init.vim

let g:vimtex_view_method = 'zathura_simple'

Go to any random latex document, mine is poop.tex

\documentclass{article}

\begin{document}
hi
\end{document}

Compile it using :VimtexCompile.

Expected behavior

I expect it to have a pdf show up in zathura so that I can see my edits in live time.

Actual behavior

When the following steps are followed on my system, nothing comes up and all I have is VimTex: Compilation Complete at the bottom of my vim.

Do you use a latexmkrc file?

No

VimtexInfo

System info:
  OS: Manjaro Linux
  Vim version: NVIM v0.9.5
  Has clientserver: true
  Servername: /run/user/1000/nvim.35723.0

VimTeX project: poop
  base: poop.tex
  root: /home/daddy
  tex: /home/daddy/poop.tex
  main parser: current file verified
  document class: article
  compiler: latexmk
    engine: -pdf
    options:
      -verbose
      -file-line-error
      -synctex=1
      -interaction=nonstopmode
    callback: 1
    continuous: 1
    executable: latexmk
    job: 
      jobid: 8
      output: /tmp/nvim.daddy/9GtxsR/0
      cmd: max_print_line=2000 latexmk -verbose -file-line-error -synctex=1 -interaction=nonstopmode  -pdf -pvc -pvctimeout- -view=none -e '$compiling_cmd = ($compiling_cmd ? $compiling_cmd . " ; " : "") . "echo vimtex_compiler_callback_compiling"' -e '$success_cmd = ($success_cmd ? $success_cmd . " ; " : "") . "echo vimtex_compiler_callback_success"' -e '$failure_cmd = ($failure_cmd ? $failure_cmd . " ; " : "") . "echo vimtex_compiler_callback_failure"' 'poop.tex'
      pid: 35807
  viewer: Zathura
    cmd_start: zathura  -x "/usr/bin/nvim --headless -c \"VimtexInverseSearch %{line} '%{input}'\"" --synctex-forward 3:1:'/home/daddy/poop.tex' 'poop.pdf'&
  qf method: LaTeX logfile
lervag commented 8 months ago

What happens if you run

zathura  -x "/usr/bin/nvim --headless -c \"VimtexInverseSearch %{line} '%{input}'\"" --synctex-forward 3:1:'/home/daddy/poop.tex' 'poop.pdf'&

from a terminal; I'm assuming that the .pdf and .synctex.gz files exist and are in the same folder.

PS! poop.tex?

pyfb78 commented 8 months ago

If I run that command in the terminal, then I get the following output

[1] 3663
error: Could not connect to session bus: Could not connect: Connection refused
error: Got no usable data from SyncTeX or D-Bus failed in some way.

[1]  + 3663 exit 255   zathura -x  --synctex-forward 3:1:'/home/daddy/poop.tex' 'poop.pdf'

Also, I use poop.tex out of habit as I've been doing it for years when testing out things lol.

lervag commented 8 months ago

Ah, then I believe you should check :help vimtex-faq-zathura-macos.

pyfb78 commented 8 months ago

I followed the instructions listed there, but I still get the same issue. I also tried restarting dbus using systemctl, but it isn't working. Is there anything else I could try?

pyfb78 commented 8 months ago

Also, when I check the status of dbus using systemctl status dbus, I get the following output.


● dbus-broker.service - D-Bus System Message Bus
     Loaded: loaded (/usr/lib/systemd/system/dbus-broker.service; static)
     Active: active (running) since Sat 2024-02-03 17:58:14 PST; 9min ago
TriggeredBy: ● dbus.socket
       Docs: man:dbus-broker-launch(1)
   Main PID: 801 (dbus-broker-lau)
      Tasks: 2 (limit: 47299)
     Memory: 6.7M (peak: 8.5M)
        CPU: 259ms
     CGroup: /system.slice/dbus-broker.service
             ├─801 /usr/bin/dbus-broker-launch --scope system --audit

Feb 03 17:58:14 laptop systemd[1]: Starting D-Bus System Message Bus...
Feb 03 17:58:14 laptop systemd[1]: Started D-Bus System Message Bus.
Feb 03 17:58:14 laptop dbus-broker-launch[801]: Ready
Feb 03 17:58:17 laptop dbus-broker-launch[801]: Activation request for 'org.freedesktop.home1' failed: The systemd unit 'dbus-org.freedesktop.home1.service' could not be found.
Feb 03 17:58:18 laptop dbus-broker-launch[801]: Activation request for 'org.freedesktop.Avahi' failed: The systemd unit 'dbus-org.freedesktop.Avahi.service' could not be found.
Feb 03 17:58:19 laptop dbus-broker-launch[801]: Activation request for 'org.freedesktop.resolve1' failed: The systemd unit 'dbus-org.freedesktop.resolve1.service' could not be found.```
pyfb78 commented 8 months ago

Also, echo $DBUS_LAUNCHD_SESSION_BUS_SOCKET gives me nothing when run in the terminal.

lervag commented 8 months ago

I see. I don't use MacOS, and your problem is clearly related to running Zathura on MacOS - the issue is not with VimTeX. I've had some help in the past writing things like :help vimtex-faq-zathura-macos, but if that doesn't work for you, then I really don't know how to help further. Sorry!