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

with \lv, okular opens but focus doesn't switch. #2993

Open
zoome0215 opened this issue Sep 6, 2024 · 1 comment
Open

with \lv, okular opens but focus doesn't switch. #2993

zoome0215 opened this issue Sep 6, 2024 · 1 comment
Labels

Comments

@zoome0215
Copy link

Description

Hi,
I am using the latest version of vimtex
okular 23.08.5 on ubuntu 24.04.
on
VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Aug 27 2024 04:08:09)

I recently upgraded my OS from 22.04 to 24.04, and now it seems that \lv no longer switches between the workspaces in Ubuntu.

so first time I use \lv opens the relevant part of the output pdf in okular. then I move the okular window to some other workspace. In the previous version of Ubuntu, when I then press \lv, it automatically switches the focus to the workspace where okular is, and displays the relevant place of the pdf. However, in 24.04, this is nolonger the feature.

Does anyone have similar problem or found a workaround on this?

VimtexInfo shows that I have Ubuntu 22.04, so may be that's contributing to something...

The relevant part of the ~/.vimrc is following/

let g:localvimrc_ask = 0

let g:vimtex_view_general_viewer = 'okular'
let g:vimtex_view_general_options = '--unique file:@pdf\#src:@line@tex'
let g:vimtex_view_automatic = 0
let g:vimtex_quickfix_autoclose_after_keystrokes = 1 
" let g:vimtex_view_general_options_latexmk = '--noraise --unique'
let g:vimtex_fold_bib_enabled = 0
let g:vimtex_enable_fold = 0
let g:vimtex_fold_manual = 1
let g:vimtex_compiler_latexmk = { 'continuous' : 0, 
        \ 'options' : [
        \   '-verbose',
        \   '-file-line-error',
        \   '--shell-escape',
        \   '-synctex=1',
        \   '-interaction=nonstopmode',
        \ ],
         \}

Steps to reproduce

  1. Open your .tex file.
  2. compile with \ll
  3. view with \lv (for the first time, okular should pop up in front of you
  4. move okular to other workspace
  5. go back to vim, and hit \lv at different place in file.

Expected behavior

Workspace should switch to where the okular is, and okular should display the relevant part of PDF file.

Actual behavior

Workspace does not change, so display is focused on vim, while if I manually go to the workspace with okular, okular do display the relevant part of the PDF.

Do you use a latexmkrc file?

No

VimtexInfo

System info:
  OS: Ubuntu 22.04.2 LTS
  Vim version: VIM 9.1 (1-16, 647, 678)
  Has clientserver: true
  Servername: LOCAL

VimTeX project: main
  base: main.tex
  main parser: current file verified
  document class: iopart
  packages: amsbsy amsfonts amsgen amssymb amstext array atbegshi atbegshi-ltx atveryend atveryend-ltx auxhook bigintcalc bitset bm braket catchfile cite color epstopdf-base etexcmds etoolbox float gettitlestring graphics graphicx hycolor hyperref ifluatex ifplatform iftex infwarerr intcalc iopams keyval kvdefinekeys kvoptions kvsetkeys ltxcmds myPreamble nameref pdfescape pdftexcmds pgfrcs pgfsys refcount rerunfilecheck scrbase scrlfile scrlfile-hook scrlogo shellesc siunitx svg translations transparent transparent-nometadata trig trimspaces ulem uniquecounter url xargs xcolor xkeyval xspace
  compiler: latexmk
    engine: -pdf
    options:
      -verbose
      -file-line-error
      --shell-escape
      -synctex=1
      -interaction=nonstopmode
    callback: 1
    continuous: 0
    executable: latexmk
    job: 
      jobid: process 97211 dead
      output: /tmp/vrNOvYn/0
      cmd: max_print_line=2000 latexmk -verbose -file-line-error --shell-escape -synctex=1 -interaction=nonstopmode -pdf 'main.tex'
  viewer: General
    job: 
      pid: 97418
      cmd: okular --unique
@zoome0215 zoome0215 added the bug label Sep 6, 2024
@lervag
Copy link
Owner

lervag commented Sep 8, 2024

Hi, I am using the latest version of vimtex okular 23.08.5 on ubuntu 24.04. on VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Aug 27 2024 04:08:09)

I recently upgraded my OS from 22.04 to 24.04, and now it seems that \lv no longer switches between the workspaces in Ubuntu.

so first time I use \lv opens the relevant part of the output pdf in okular. then I move the okular window to some other workspace. In the previous version of Ubuntu, when I then press \lv, it automatically switches the focus to the workspace where okular is, and displays the relevant place of the pdf. However, in 24.04, this is nolonger the feature.

Huh, that's strange. I don't think this is a VimTeX bug. And I'm sorry to say I have no idea what may be the cause or reason for this.

VimtexInfo shows that I have Ubuntu 22.04, so may be that's contributing to something...

That is probably caused by the caching. If you do :VimtexClearCache ALL and restart, then I believe the system info should update.

The relevant part of the ~/.vimrc is following/ …

I've simplified this for you:

let g:vimtex_view_general_viewer = 'okular'
let g:vimtex_view_general_options = '--unique file:@pdf\#src:@line@tex'
let g:vimtex_view_automatic = 0
let g:vimtex_quickfix_autoclose_after_keystrokes = 1
let g:vimtex_compiler_latexmk = {
      \ 'continuous' : 0,
      \ 'options' : [
      \   '-verbose',
      \   '-file-line-error',
      \   '--shell-escape',
      \   '-synctex=1',
      \   '-interaction=nonstopmode',
      \ ],
      \}

I removed options that were not correct VimTeX options and some that you did not change from the default value.

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