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

'\lv' opens new instance of okular #1374

Closed
ZhiyuanLck opened this issue Apr 28, 2019 · 13 comments
Closed

'\lv' opens new instance of okular #1374

ZhiyuanLck opened this issue Apr 28, 2019 · 13 comments

Comments

@ZhiyuanLck
Copy link

ZhiyuanLck commented Apr 28, 2019

Promblem

I'm using gvim with vimtex and the pdf viewer is okular obtained from chocolatey.

With arbitrary *.tex files the first call of :VimtexCompile causes okular to be lauched once with a popup saying "There is already a unique Okular instance running. This instance won't be the unique one." Enter "ok" and there is actually one instance. But when I use \lv to perform a forward search, the same popup occur. After "ok" is pushed, a new instance is created.

Viewer set in .vimrc

    let g:vimtex_view_general_viewer = 'okular'
    let g:vimtex_view_general_options = '--unique file:@pdf\#src:@line@tex'
    let g:vimtex_view_general_options_latexmk = '--unique'
@lervag
Copy link
Owner

lervag commented Apr 29, 2019

Is this the same as #1364? If so, it should have been fixed recently. Can you confirm that you are on latest version of vimtex?

@ZhiyuanLck
Copy link
Author

Not the same. I've read #1364 carefully and sure the code causing the problem in #1364 has been removed. It is when I call <plug>(vimtex-view) that the similar problem occurs.

@lervag
Copy link
Owner

lervag commented Apr 30, 2019

I can not reproduce your problem, sorry. Can you specify a full minimal example, similar to this, and explain the steps required to reproduce?

@ZhiyuanLck
Copy link
Author

Ok, I'll try it soon. I guess gvim has a strange reaction with xelatex.

@ZhiyuanLck
Copy link
Author

Sorry, I'm late!
Here is the minimal example.
_vimrc

set rtp+=~/.vim
call plug#begin('~/.vim/bundles')
    Plug 'lervag/vimtex', {'for': ['tex', 'plaintex', 'bst']}
    let g:tex_flavor='latex'
    let g:vimtex_view_general_viewer = 'okular'
    let g:vimtex_view_general_options = '--unique file:@pdf\#src:@line@tex'
    let g:vimtex_view_general_options_latexmk = '--unique'
call plug#end()

test.tex

\documentclass{article}
\begin{document}
	hello
\end{document}

No .latexmkrc.

  1. Run gvim test.tex and then :VimtexCompile. Then a popup occurs saying "There is already a unique Okular instance running. This instance won't be the unique one." Push the ok button and then a new instance of Okular is created.
  2. Run :VimtexView, and then come with the same popup. Push the ok button, an another new instance is created. Hence then there are two windows of Okular.

@lervag
Copy link
Owner

lervag commented May 3, 2019

Ok, I still can not reproduce.

Can you give me the output of :VimtexInfo when you've opened the minimal example?

Further, can you specify which system you are on? OS/Distribution, (g)vim version and okular version. Also, latexmk version may be relevant.

@ZhiyuanLck
Copy link
Author

ZhiyuanLck commented May 4, 2019

Thank you for helping me tirelessly. Below is the related information.
:VimtexInfo

System info
  OS: Microsoft Windows 10 Pro (10.0.16299 N/A Build 16299)
  Vim version: VIM 8.1 (1-239)
  Has clientserver: true
  Servername: GVIM1

vimtex project: test
  base: test.tex
  root: D:\code\tex\2
  tex: D:\code\tex\2\test.tex
  out: D:\code\tex\2/test.pdf
  log: D:\code\tex\2/test.log
  aux: D:\code\tex\2/test.aux
  fls: D:\code\tex\2/test.fls
  compiler: latexmk
    backend: jobs
    output: D:\Temp\VIAC913.tmp
    configuration: 
      continuous: 1
      callback: 1
      latexmk options:
        -verbose
        -file-line-error
        -synctex=1
        -interaction=nonstopmode
      latexmk engine: -pdf
    job: process 14084 run
    cmd: set max_print_line=2000 & latexmk -verbose -file-line-error -synctex=1 -interaction=nonstopmode -pdf -pvc -e "$pdf_previewer = 'okular --unique'" -e "$success_cmd = 'echo vimtex_compiler_callback_success'" -e "$failure_cmd = 'echo vimtex_compiler_callback_failure'" "test.tex"
  viewer: General
    process: 
      pid: -
      cmd: start /b cmd /s /c "okular --unique file:"D:\code\tex\2/test.pdf"\#src:4"D:\code\tex\2\test.tex" >nul"
  qf: LaTeX logfile
    config: 
      fix_paths: 1
      packages: 
        default: 1
      default: 1
  document class: article

OS version

Microsoft Windows 10 Professional
10.0.16299 version 16299

gvim --version

VIM - Vi IMproved 8.1 (2018 May 18, compiled Aug  4 2018 22:02:19)
MS-Windows 64-bit GUI version with OLE surrport
Included patches: 1-239
Compiled by appveyor@APPVYR-WIN
Huge version with GUI.  Features included (+) or not (-):
+acl                +emacs_tags         +mouseshape         -tag_any_white
+arabic             +eval               +multi_byte_ime/dyn +tcl/dyn
+autocmd            +ex_extra           +multi_lang         -termguicolors
+autochdir          +extra_search       +mzscheme/dyn       +terminal
+autoservername     +farsi              +netbeans_intg      -tgetent
+balloon_eval       +file_in_path       +num64              -termresponse
-balloon_eval_term  +find_in_path       +ole                +textobjects
+browse             +float              +packages           +timers
++builtin_terms     +folding            +path_extra         +title
+byte_offset        -footer             +perl/dyn           +toolbar
+channel            +gettext/dyn        +persistent_undo    +user_commands
+cindent            -hangul_input       -postscript         +vartabs
+clientserver       +iconv/dyn          +printer            +vertsplit
+clipboard          +insert_expand      +profile            +virtualedit
+cmdline_compl      +job                +python/dyn         +visual
+cmdline_hist       +jumplist           +python3/dyn        +visualextra
+cmdline_info       +keymap             +quickfix           +viminfo
+comments           +lambda             +reltime            +vreplace
+conceal            +langmap            +rightleft          -vtp
+cryptv             +libcall            +ruby/dyn           +wildignore
+cscope             +linebreak          +scrollbind         +wildmenu
+cursorbind         +lispindent         +signs              +windows
+cursorshape        +listcmds           +smartindent        +writebackup
+dialog_con_gui     +localmap           +startuptime        -xfontset
+diff               +lua/dyn            +statusline         -xim
+digraphs           +menu               -sun_workshop       +xpm_w32
+directx            +mksession          +syntax             -xterm_save
-dnd                +modify_fname       +tag_binary         
-ebcdic             +mouse              +tag_old_static     
     system vimrc file: "$VIM\vimrc"
         user vimrc file: "$HOME\_vimrc"
  2nd user vimrc file: "$HOME\vimfiles\vimrc"
   3rd user vimrc file: "$VIM\_vimrc"
           user exrc file: "$HOME\_exrc"
    2nd user exrc file: "$VIM\_exrc"
   system gvimrc file: "$VIM\gvimrc"
       user gvimrc file: "$HOME\_gvimrc"
2nd user gvimrc file: "$HOME\vimfiles\gvimrc"
 3rd user gvimrc file: "$VIM\_gvimrc"
       defaults file: "$VIMRUNTIME\defaults.vim"
system menu file: "$VIMRUNTIME\menu.vim"
Compilation: cl -c /W3 /nologo  -I. -Iproto -DHAVE_PATHDEF -DWIN32  
-DFEAT_CSCOPE -DFEAT_TERMINAL -DFEAT_NETBEANS_INTG -DFEAT_JOB_CHANN
EL   -DFEAT_XPM_W32   -DWINVER=0x0501 -D_WIN32_WINNT=0x0501 /MP 
-DHAVE_STDINT_H /Ox /GL -DNDEBUG  /Zl /MT -DFEAT_OLE -DFEAT_MBYTE_IME 
-DDYNAMIC_IME -DFEAT_MBYTE -DFEAT_GUI_W32 -DFEAT_DIRECTX 
-DDYNAMIC_DIRECTX -DFEAT_DIRECTX_COLOR_EMOJI -DDYNAMIC_ICONV 
-DDYNAMIC_GETTEXT -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl86
t.dll\" -DDYNAMIC_TCL_VER=\"8.6\" -DFEAT_LUA -DDYNAMIC_LUA 
-DDYNAMIC_LUA_DLL=\"lua53.dll\" -DFEAT_PYTHON -DDYNAMIC_PYTHON 
-DDYNAMIC_PYTHON_DLL=\"python27.dll\" -DFEAT_PYTHON3 
-DDYNAMIC_PYTHON3 -DDYNAMIC_PYTHON3_DLL=\"python36.dll\" 
-DFEAT_MZSCHEME -I "C:\Program Files\Racket\include" -DMZ_PRECISE_GC 
-DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"libracket3m_a36fs8.dll\" 
-DDYNAMIC_MZGC_DLL=\"libracket3m_a36fs8.dll\" -DFEAT_PERL 
-DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DDYNAMIC_PERL 
-DDYNAMIC_PERL_DLL=\"perl524.dll\" -DFEAT_RUBY -DDYNAMIC_RUBY 
-DDYNAMIC_RUBY_VER=24 -DDYNAMIC_RUBY_DLL=\"x64-msvcrt-ruby240.dll\" 
-DFEAT_HUGE /Fd.\ObjGXOULYHTRZAMD64/ /Zi
Linking: link  /nologo /subsystem:windows,5.02 /opt:ref /LTCG:STATUS 
/HIGHENTROPYVA:NO oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib  
comdlg32.lib ole32.lib netapi32.lib uuid.lib /machine:AMD64 gdi32.lib version.lib 

latexmk --version

Latexmk, John Collins, 17 Jan. 2018. Version 4.55

okular --version

okular 1.6.70

@lervag
Copy link
Owner

lervag commented May 4, 2019

Thanks. I'm sorry to say that I can't be of much more help. I don't use Windows, and so I can't look into this directly. Okular works as expected on Linux. I was not aware that Okular was also available on Windows. In any case, have you tried to use the SumatraPDF viewer? I know that it should work quite well on Windows.

@ZhiyuanLck
Copy link
Author

Thanks. I have tried SumatraPDF, and it has some little trouble reloading changed file, so I tend to okular. Actually the case in this issue is trivial and I have tried to use vimtex in manjaro. Whatever, so thankful to your help!

@lervag
Copy link
Owner

lervag commented May 5, 2019

Happy to help, and sorry I could not be of more help. :)

@bernwo
Copy link

bernwo commented Apr 20, 2023

I also have the same exact problem on native windows (not WSL). My nvim info (installed using pre-built binary for Windows):

NVIM v0.9.0
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3

and I'm running Okular version 22.12.1 straight from the Windows Microsoft Store (official by KDE).

@lervag
Copy link
Owner

lervag commented Apr 20, 2023

I understand that it is annoying, but I sorry to say that I still don't have anything to add to my earlier statements on this matter.

@bernwo
Copy link

bernwo commented Apr 21, 2023

Fair enough. I will just use SumatraPDF which seems to work fine. Thanks!

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

No branches or pull requests

3 participants