The PDF file is not opening with Zathura after the VimTeX compilation. I am using https://github.com/benbrastmckie/.config and the file vimtex.lua in my directory ~/.config/nvim/lua/neotex/plugins contains:

return {
  init = function()
    vim.g['vimtex_view_method'] = 'zathura'        -- main variant with xdotool (requires X11; not compatible with wayland)
    -- vim.g['vimtex_view_method'] = 'zathura_simple' -- for variant without xdotool to avoid errors in wayland
    vim.g['vimtex_quickfix_mode'] = 0              -- suppress error reporting on save and build
    vim.g['vimtex_mappings_enabled'] = 0           -- Ignore mappings
    vim.g['vimtex_indent_enabled'] = 0             -- Auto Indent
    vim.g['tex_flavor'] = 'latex'                  -- how to read tex files
    vim.g['tex_indent_items'] = 0                  -- turn off enumerate indent
    vim.g['tex_indent_brace'] = 0                  -- turn off brace indent
    vim.g['vimtex_context_pdf_viewer'] = 'okular'  -- external PDF viewer run from vimtex menu command
    vim.g['vimtex_log_ignore'] = ({                -- Error suppression:
      'specifier changed to',
      'Token not allowed in a PDF string',

Initially, I was trying with vim.g['vimtex_view_method'] = 'zathura_simple' as being used in the repository. In that case, neither the error showed up nor Zathura opened the PDF.


I just figured VimTeX couldn't open the PDF through Zathura because my working directory name had a colon (:) symbol. For example, if the PDF file main.pdf is in the directory ~/Documents/testing test, I can open it:

zathura '~/Documents/testing test/main.pdf'

But my folder name was testing: test and in that case, it wasn't opening with Zathura:

zathura '~/Documents/testing: test/main.pdf'

Is there any way to fix it? Or is it recommended not to put a colon in the folder or directory names?



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.