Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile with Okular in Windows 10 #2922

Open
777uliahshafar opened this issue Apr 12, 2024 · 1 comment
Open

Compile with Okular in Windows 10 #2922

777uliahshafar opened this issue Apr 12, 2024 · 1 comment
Labels

Comments

@777uliahshafar
Copy link

777uliahshafar commented Apr 12, 2024

Description

I use Okular (I changed from SumatraPdf which is work) for compilation in Windows with Powershel in Windows Terminal. I use the basic configuration to set Okular, but I encounter two windows after run compilation.

The first window said there is already a unique Okular instance running. This instance won't be the unique one. The second window shows an error Could not open file:D:%5Ckarakter/karakter.pdf/%5C%23src:4D:%5Ckarakter%5Ckarakter.tex. After this, it didn't show the pdf. or back to dashboard of Okular.

I Installed Okular using chocolatey, because only chocolatey put the file location on program files like SumatraPdf which has worked previously. So I could refrence them on env. variable path.

For env. variabel path, I use C:\Program Files\Okular\bin, without bin it won't execute. I think it is usual.

Steps to reproduce

  1. Open file tex. Then run compilation with the config :

    cmd "syntax on"
    vim.api.nvim_command "filetype plugin indent on"
    g.vimtex_compiler_latexmk_engines = {
      _ = "-lualatex",
    }
    
    g.vimtex_compiler_latexmk = {
      options = {
        "-shell-escape",
        "-verbose",
        "-file-line-error",
        "-synctex=1",
        "-interaction=nonstopmode",
      },
    }
    
    vim.g.vimtex_view_general_viewer = "okular"
    vim.g.vimtex_view_general_options = "--unique file:@pdf\\#src:@line@tex"

Expected behavior

No response

Actual behavior

No response

Do you use a latexmkrc file?

No

VimtexInfo

System info:
  OS: DESKTOP-1FGACVB (Microsoft Windows 10 Home Single Language)
  Vim version: NVIM v0.9.5
  Has clientserver: true
  Servername: \\.\pipe\nvim.3380.0

VimTeX project: karakter
  base: karakter.tex
  root: D:\karakter
  tex: D:\karakter/karakter.tex
  main parser: current file verified
  document class: simart
  packages: arabicnumbers array atbegshi-ltx atveryend-ltx auxhook bigintcalc bitset booktabs calc caption caption3 ctablestack enumitem epstopdf-base etoolbox expl3 fancyhdr fontenc fontspec fontspec-luatex geometry gettitlestring graphics graphicx hijrical hycolor hyperref iftex ifvtex import infwarerr intcalc kvdefinekeys kvoptions kvsetkeys l3keys2e letltxmacro lipsum listings lstmisc ltxcmds luatexbase makecmds microtype nameref natbib paralist pdfescape pdftexcmds polyglossia refcount rerunfilecheck setspace stringenc subfiles tabularx titlesec trig uniquecounter url xkeyval xparse
  compiler: latexmk
    engine: -lualatex
    options:
      -shell-escape
      -verbose
      -file-line-error
      -synctex=1
      -interaction=nonstopmode
    callback: 1
    continuous: 1
    executable: latexmk
  viewer: General
  qf method: LaTeX logfile
@lervag
Copy link
Owner

lervag commented Apr 12, 2024

The first window said there is already a unique Okular instance running. This instance won't be the unique one. The second window shows an error Could not open file:D:%5Ckarakter/karakter.pdf/%5C%23src:4D:%5Ckarakter%5Ckarakter.tex. After this, it didn't show the pdf. or back to dashboard of Okular.

The settings for Okular will work on Linux. However, I have no idea if it works on Windows - your issue indicates it does not work. I don't mind to have VimTeX support for Windows, but it is only as a result of user contributions. I don't use Windows and I have no way of investigating what may be wrong in this particular case.

Based on your issue report, it seems you are doing things "correctly". My suggestion would be to start Okular with the same options as we are using from VimTeX, but from a Powershell terminal. You can see the actual command VimTeX uses with \li after VimTeX has tried to start the viewer.

  1. Open file tex. Then run compilation with the config : …

The config you provide here is very incomplete. For instance, how is VimTeX even loaded?

Notice that syntax on and filetype plugin indent on is usually not necessary if you are using a plugin manager, so you can probably remove those.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants