-
Notifications
You must be signed in to change notification settings - Fork 391
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
i load the zathura or skim, but when i use \lv, it shows not using a previewer
#2424
Comments
As you guessed, this is quite likely a It is hard to tell what you have tried or what your configuration is, but my usual recommendation here is the same as in this comment or in this guide: start by uninstalling and re-installing the relevant software and then exactly repeat the steps in In case you haven't already, it would probably useful to read through #2391 from start to finish and see if anything applies to you. There is also another problem: your
This means using inverse search will be impossible. My guess is you are using command line Vim; you will need GUI MacVim, command line Neovim, or to compile command line Vim from source with client server enabled if you want to use inverse search on macOS. This article might be helpful. PS: If you post your |
Thanks for your reply. I follow the strict procedure before I post this question. Except one case that i change the directory Also it was not just zathura can not running but also skim would the same information |
Hmm, if you've followed
It does seem strange the Skim does not work either, I thought Skim did not require
@lervag, this appears to be his relevant VimTeX config based on the posted link; I don't see anything suspicious besides setting both let g:tex_flavor='latex'
"let g:vimtex_compiler_method='latexrun'
"set grepprg =grep\ -nH\ $*
"let g: tex_falvor='latex'
"let g:Tex_DefaultTargetFormat='pdf'
let g:vimtex_view_method='zathura'
let g:latex_view_general_viewer='zathura'
let g:vimtex_quickfix_mode =1
let g:vimtex_view_enabled=1
let g:vimtex_view_automatic=1 |
This issue is clearly not only dbus related. Without dbus, Zathura should still work, but forward and backward sync will not work.
I'm slow, sorry: Which strict procedure are you referring to?
Do you mean you first tried without changing the directory, and it didn't work? And then afterwards, you tried to change the directory, and it still doesn't work?
I'm sorry to be so blunt, but your For the VimTeX specific content in your " I'm not sure if vimtex and vim-latex-live-preview works well together.
" I would disable this when you are debugging issues with vimtex. Or, MUUUCH
" better, use the minimal example approach explained later!
Plugin 'xuhdev/vim-latex-live-preview'
let g:livepreview_previewer='zathura'
let g:livepreview_engine='latexmk'
Plugin 'lervag/vimtex'
" The following settings for VimTeX can be simplified:
let g:tex_flavor='latex'
let g:vimtex_view_method='zathura'
let g:latex_view_general_viewer='zathura'
let g:vimtex_quickfix_mode =1
let g:vimtex_view_enabled=1
let g:vimtex_view_automatic=1
" To this:
let g:vimtex_view_method = 'zathura'
let g:vimtex_quickfix_mode = 1
" VimTeX provides several similar shortcuts already, see :help vimtex-imaps
autocmd FileType tex inoremap ,alpha \alpha
autocmd FileType tex inoremap ,beta \beta
" ...
" Notice that there's a VimTeX extension for coc (coc-vimtex) to allow
" autocomplete with VimTeXs omnicompletion. E.g.:
let g:coc_global_extensions = [ ..., 'coc-vimtex' ]
If you want me to spend my time helping you with this, then I expect you to spend time creating a minimal vimrc file. It was explained in the issue template, but I can explain it again:
|
Also: You claim that you are not using a |
Oh, and thanks, @ejmastnak, for replying early and giving some initial helpful comments! |
Yes, without dbus, zathura can run in the command line. It just can not pop up when i type in vim and type
No, i did not install twice. because i know for the x86-64 mac, brew will install all the bin,library in
I am actually new to vimscript and i will learn in the near feature and i believe it will help me to command vim more better. I just roughly know what the command in vimrc does.
I created the
and it seems that the
It gives me errors shown in the following figur Do i need to reinstall vundle ? |
Yes, i did not configure latexmkrc and also zathura |
My point was simply that, since Zathura does not open after
Ok!
No problem, we all start out with little knowledge and learn as we go. And some of us really enjoy the experience of learning these things; I hope you do or will do to!
That's strange; this should be a much longer list. As a reference, with the same minimal
No, we want a minimal example, so don't use Vundle now! Let's take it step by step. In a terminal, do |
Here is the out put when i do
The |
Ok, what's And further, again with this: set nocompatible
set runtimepath^=~/.vim/bundle/vimtex
set runtimepath+=~/.vim/bundle/vimtex/after
filetype plugin indent on
syntax enable What's the output of Also, what's the output of |
I'm trying to understand what's going on. I will find answers for you, but you need to slow down and provide what I ask for. As you said yourself, you are inexperienced. I know what I am doing and what I am asking for.
Ok, now we are getting somewhere! Notice how you have several plugins that are loaded:
I advice that you, for now, remove all of these (move them to a temporary folder). You can add them back afterwards when things work. But notice that these are plugins in your config that are loaded in addition to the ones you load with Vundle.
No, that is not the output after you press
"Not using a previewer" is actually expected. I should have catched this immediately, but I understand part of this now. For the viewer to open automatically, you need |
No, that figure is not similar to the previous one. I contains what I asked for. But please, don't upload as image. Copy the text and paste it here. Notice that there is text that goes out of the image.
Nope, that's not interesting.
Nope. |
Was out of time earlier. So, to give some further explanations: VimTeX uses the callback and clientserver mechanism of Vim to start the viewers. This is an ubiquitous feature and should be available in most systems. @ejmastnak already mentioned this in the very first post:
When I read this the first time, I forgot that the clientserver is more important that communicated here. That is, it is not only used for inverse search — it is also used for automatically starting the viewers. So, without a proper clientserver, VimTeX will not open a viewer automatically. This should be relatively easy to address, but I believe it is better that we first figure out why Zathura does not start when you do |
I run
|
Great. This shows specifically why Zathura does not work. I'm sorry to say that I can not help very much further with this specific problem. If you are not able to solve this with instructions from You could use Skim; I know a lot of people uses it and it should work quite well. I believe it should already work, and that the only issue would be that you need the clientserver feature for auto open. |
I have tried both skim and zathura before, and both of them won't work. I remember i found an article that the author mention that the method to deal with zathura in vim, roughly the same with Another thing updated is that I can open the pdf file outside the terminal. In the meantime, If i compile the tex and make change to the content, zathura will still automatically update even in display mode. But the unhappy thing is that i need to open two windows not the ideal way like one terminal side by side. This is the compromise way for now. If I run zathura outside terminal, does it support inverse and forward search? |
Thought I would chime back in.
I notice that this is the same error as in #2391. As a sanity check, @EdwardWong1994, could you please open a
This is great to know, and also explains why Skim wouldn't auto-start. I didn't know VimTeX used @EdwardWong1994, you write:
The short answer is no, to the best of my knowledge. You'd need both dbus and Finally, @EdwardWong1994, @lervag quite frankly has the patience of a saint to keep helping you through all of this. Even if its not my place to say so, it would be nice to be more explicitly appreciative of his help in this thread. |
Also:
@EdwardWong1994, what happens if in your vimrc you:
|
No! I'll be brief, because @ejmastnak already provided good updates here. But it seems to me that you don't read my answers!
Stop reading arbitrary articles! I don't care about what you find in a random blog post. Read the documentation that I refer to or blog posts suggested in the thread. Ignore everything else.
What does this mean? With simply
Yes; latexmk signals Zathura to update. That's expected. Please follow the suggestions by @ejmastnak in his last post about Skim and explain the results. |
Thanks for both of you to be so patient with me. I really appreciate for the help . I tried what @ejmastnak suggested. comment out For the output of Again, forgive me for keep asking these questions, zathura with vimtex is really what i want |
Unfortunately I don't know at this point how to get Zathura working with VimTeX on macOS. Your I think your options are to either:
|
<3
What do you mean, i.e. what does "automatically jump skim" mean? That it works as expected? That Skim opens automatically? Does I don't mean to be difficult, but it is important that we communicate clearly. The details are important to properly understand the various behaviours.
Let us keep focus on the minimal examples. We can help with your full
It's OK! I advice that you don't make so many assumptions. Especially, don't try things unless you know what you are doing. Just follow up on what we ask and take it slow. I believe it should be possible to get Zathura working. I think the approach going further is to get Zathura working in the terminal. If we can't get it working from the terminal, then we can't get it working from VimTeX.
After point 2, if I'm right. In the same terminal, is |
Automatically jump means that when i compile
using
Yes. Run above code will complain dbus error. The result is as follow:
The variable is defined , the result of the variable is as follow
|
I would not describe
Thanks. Lets continue:
|
The output of above command is :
The output for
I follow the procedure and do again, still the same. Because the default homebrew install directory is different with x86-64, i change
|
I have a feeling that it's a bad sign that the dbus service is stopped. But I'm not sure. To be honest, I don't quite know how to proceed from here. You seem to think that the problem has to do with x86-64; perhaps you are right. I don't really think so, but I can't be sure. Sorry that I'm not able to be of more help. As an optional solution, I propose that you use Skim. It should work well, even though I understand that you would prefer Zathura. |
It is ok. Appreciate for all of your help. I have to compromise to skim but there are still one thing using skim. The skim can jump out when i use |
I'm glad to hear it. I hope you somehow figure it out; if you do, please give an update, as it may be helpful to others.
And yes, I have ideas. First, you really should note what we mentioned earlier, that you want to use a Vim with Next, I'm assuming that this is still your vimrc file. The following is a slightly cleaned up version where I've removed the comments (you can add them back if you want) and updated the VimTeX related configuration for you. I've grouped things, removed duplicate options and similar. I still think it is somewhat messy, but it should be better. Can you test with the following vimrc file and report if Skim works as expected? I.e., to be fully clear:
" Options
set encoding=utf-8
set modelines=0
set backspace=2
set nowritebackup
set nocp
set clipboard+=unnamed
set nu
set history=100
set autoread
set nobackup
set nowb
set noswapfile
set mouse=a
set selection=exclusive
set selectmode=mouse,key
set cursorline
set novisualbell
set laststatus=2
set showcmd
set ruler
set cmdheight=3
set complete+=kspell
set completeopt=menuone,longest
"set completeopt=longest,menu
set shortmess+=c
set showmatch
set ignorecase
set hlsearch
set incsearch
set autoindent
set smartindent
set cindent
set tabstop=4
set wildmenu
set shellslash
set hidden
set updatetime=300
if has("nvim-0.5.0") || has("patch-8.1.1564")
set signcolumn=number
else
set signcolumn=yes
endif
set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}
set foldenable
" Load plugins
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'SirVer/ultisnips'
Plugin 'honza/vim-snippets'
Plugin 'VundleVim/Vundle.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'git://git.wincent.com/command-t.git'
Plugin 'xuhdev/vim-latex-live-preview'
Plugin 'lervag/vimtex'
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
Plugin 'scrooloose/nerdtree'
Plugin 'neoclide/coc.nvim', {'branch': 'master', 'do': 'yarn install --frozen-lockfile'}
Plugin 'Xuyuanp/nerdtree-git-plugin'
Plugin 'tiagofumo/vim-nerdtree-syntax-highlight'
Plugin 'ryanoasis/vim-devicons'
Plugin 'airblade/vim-gitgutter'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'scrooloose/nerdcommenter'
Plugin 'prettier/vim-prettier', { 'do': 'yarn install' }
Plugin 'christoomey/vim-tmux-navigator'
Plugin 'yaegassy/coc-pylsp', {'do': 'yarn install --frozen-lockfile'}
Plugin 'morhetz/gruvbox'
Plugin 'HerringtonDarkholme/yats.vim'
Plugin 'neoclide/coc-snippets'
Plugin 'godlygeek/tabular'
Plugin 'plasticboy/vim-markdown'
Plugin 'mzlogin/vim-markdown-toc'
Plugin 'iamcco/markdown-preview.nvim'
Plugin 'ferrine/md-img-paste.vim'
Plugin 'junegunn/goyo.vim'
call vundle#end()
colorscheme gruvbox
" I believe you can remove the following lines, because I think Vundle includes
" them with "vundle#end()"
"filetype plugin indent on
"syntax on
" Plugin configuration
let g:UltiSnipsExpandTrigger = "<Tab>"
let g:UltiSnipsListSnippets = "<c-Tab>"
let g:UltiSnipsJumpForwardTrigger = "<Tab>"
let g:UltiSnipsJumpBackwardTrigger = "<s-tab>"
let g:UltiSnipsSnippetsDirectories=[$HOME.'/.vim/bundle/vim-snippets/UltiSnips', "~/.vim/UltiSnips"]
let g:livepreview_previewer='zathura'
let g:livepreview_engine='latexmk'
let g:vimtex_view_method = 'skim'
let g:vimtex_quickfix_mode = 1
let g:vim_markdown_math=1
let g:mdip_imgdir='~/Desktop/screenshot/markdown'
let g:mdip_imgname='image'
let g:mkdp_auto_start = 1
let g:mkdp_refresh_slow = 0
let g:mkdp_command_for_global = 1
let g:mkdp_browser = '/Applications/Google Chrome.app'
let g:mkdp_markdown_css='~/Desktop/WCC/markdown/github-css-sytle-markdown/github-markdown-css'
let g:vim_markdown_folding_level=6
autocmd Filetype markdown nmap <C-s> <Plug>MarkdownPreview
autocmd Filetype markdown nmap <C-z> <Plug>MarkdownPreviewStop
autocmd Filetype markdown map <C-q> <Plug>MarkdownPreviewToggle
autocmd Filetype markdown nnoremap <silent> <C-w>:call mdip#MarkdownClipboardImage()<CR>F%i
autocmd Filetype markdown noremap <buffer> <C-x> :GenTocMarked
autocmd Filetype markdown nnoremap <silent> <C-c> :UpdateToc
let g:WebDevIconsUnicodeDecorateFolderNodes = 1
let g:NERDTreeGitStatusWithFlags = 1
let g:NERDTreeGitStatusNodeColorization = 1
let g:NERDTreeGitStatusIndicatorMapCustom = {
\ 'Modified' :'✹',
\ 'Staged' :'✚',
\ 'Untracked' :'✭',
\ 'Renamed' :'➜',
\ 'Unmerged' :'═',
\ 'Deleted' :'✖',
\ 'Dirty' :'✗',
\ 'Ignored' :'☒',
\ 'Clean' :'✔︎',
\ 'Unknown' :'?',
\ }
let g:NERDTreeGitStatusWithFlags = 1
let g:NERDTreeIgnore = ['^node_modules$']
function! IsNERDTreeOpen()
return exists("t:NERDTreeBufName") && (bufwinnr(t:NERDTreeBufName) != -1)
endfunction
function! SyncTree()
if &modifiable && IsNERDTreeOpen() && strlen(expand('%')) > 0 && !&diff
NERDTreeFind
wincmd p
endif
endfunction
autocmd BufEnter * call SyncTree()
autocmd BufEnter * if winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
let g:prettier#autoformat = 1
command! -nargs=0 Prettier :CocCommand prettier.formatFile
let g:ctrlp_user_command = ['.git/', 'git --git-dir=%s/.git ls-files -oc --exclude-standard']
let g:coc_snippet_next='<tab>'
let g:coc_global_extensions = [
\ 'coc-snippets',
\ 'coc-pairs',
\ 'coc-tsserver',
\ 'coc-eslint',
\ 'coc-prettier',
\ 'coc-json',
\ 'coc-vimlsp',
\ 'coc-css',
\ 'coc-diagnostic',
\ 'coc-explorer',
\ 'coc-flutter-tools',
\ 'coc-gitignore',
\ 'coc-html',
\ 'coc-lists',
\ 'coc-python',
\ 'coc-syntax',
\ 'coc-todolist',
\ 'coc-translator',
\ 'coc-tslint-plugin',
\ 'coc-vetur',
\ 'coc-yaml',
\ 'coc-yank',
\ 'coc-translator',
\ 'coc-vimtex'
\]
command! -nargs=0 Format :call CocAction('format')
command! -nargs=? Fold :call CocAction('fold', <f-args>)
command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport')
augroup mygroup
autocmd!
autocmd CursorHold * silent call CocActionAsync('highlight')
autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected')
autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
augroup end
" Autocommands
autocmd BufWrite /private/tmp/crontab.* set nowritebackup nobackup
autocmd BufWrite /private/etc/pw.* set nowritebackup nobackup
autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete
autocmd FileType python set omnifunc=pythoncomplete#Complete
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
autocmd FileType java set omnifunc=javacomplete#Complet
" Configuration for options and similar
let skip_defaults_vim=1
let g:pydiction_location = '/Users/wangchenchen/.vim/tools/pydiction/complete-dict'
let g:pydiction_menu_height=20
" Mappings
inoremap jk <ESC>
nmap <C-f> :NERDTreeToggle<CR>
map <C-h> <C-w>h
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-l> <C-w>l
nmap tt :TTemplate
vmap ++ <plug>NERDCommenterToggle
nmap ++ <plug>NERDCommenterToggle
inoremap <expr> <Down> pumvisible() ? "<C-n>" :"<Down>"
inoremap <expr> <Up> pumvisible() ? "<C-p>" : "<Up>"
inoremap <expr> <Right> pumvisible() ? "<C-y>" : "<Right>"
inoremap <expr> <CR> pumvisible() ? "<C-y>" :"<CR>"
inoremap <expr> <Left> pumvisible() ? "<C-e>" : "<Left>"
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\CheckBackspace()?"\<TAB>":
\ coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
function! s:CheckBackspace() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
inoremap <silent><expr> <c-o> coc#refresh()
if has('nvim')
inoremap <silent><expr> <c-space> coc#refresh()
else
inoremap <silent><expr> <c-@> coc#refresh()
endif
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm()
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
nmap <silent> [g <Plug>(coc-diagnostic-prev)
nmap <silent> ]g <Plug>(coc-diagnostic-next)
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
nnoremap <silent> K :call <SID>ShowDocumentation()<CR>
function! ShowDocumentation()
if CocAction('hasProvider', 'hover')
call CocActionAsync('doHover')
else
call feedkeys('K', 'in')
endif
endfunction
nnoremap aa :CocCommand explorer<CR>
nmap <leader>rn <Plug>(coc-rename)
xmap <leader>f <Plug>(coc-format-selected)
nmap <leader>f <Plug>(coc-format-selected)
xmap <leader>a <Plug>(coc-codeaction-selected)
nmap <leader>a <Plug>(coc-codeaction-selected)
nmap <leader>ac <Plug>(coc-codeaction)
nmap <leader>qf <Plug>(coc-fix-current)
nmap <leader>cl <Plug>(coc-codelens-action)
xmap if <Plug>(coc-funcobj-i)
omap if <Plug>(coc-funcobj-i)
xmap af <Plug>(coc-funcobj-a)
omap af <Plug>(coc-funcobj-a)
xmap ic <Plug>(coc-classobj-i)
omap ic <Plug>(coc-classobj-i)
xmap ac <Plug>(coc-classobj-a)
omap ac <Plug>(coc-classobj-a)
nmap <silent> <C-d> <Plug>(coc-range-select)
xmap <silent> <C-d> <Plug>(coc-range-select)
nnoremap <silent> <space>a :<C-u>CocList diagnostics<cr>
nnoremap <silent> <space>e :<C-u>CocList extensions<cr>
nnoremap <silent> <space>c :<C-u>CocList commands<cr>
nnoremap <silent> <space>o :<C-u>CocList outline<cr>
nnoremap <silent> <space>s :<C-u>CocList -I symbols<cr>
nnoremap <silent> <space>j :<C-u>CocNext<CR>
nnoremap <silent> <space>k :<C-u>CocPrev<CR>
nnoremap <silent> <space>p :<C-u>CocListResume<CR>
" You may want to try similar mappings from VimTeX (:help vimtex-imaps)
"autocmd FileType tex inoremap ,alpha \alpha
"autocmd FileType tex inoremap ,beta \beta
"autocmd FileType tex inoremap ,gamma \gamma
"autocmd FileType tex inoremap ,delta \delta
"autocmd FileType tex inoremap ,del \Delta
"autocmd FileType tex inoremap ,epsilon \epsilon
"autocmd FileType tex inoremap ,zeta \zeta
"autocmd FileType tex inoremap ,eta \eta
"autocmd FileType tex inoremap ,theta \theta
"autocmd FileType tex inoremap ,kappa \kappa
"autocmd FileType tex inoremap ,lambda \lambda
"autocmd FileType tex inoremap ,mu \mu
"autocmd FileType tex inoremap ,nu \nu
"autocmd FileType tex inoremap ,pi \pi
"autocmd FileType tex inoremap ,rho \rho
"autocmd FileType tex inoremap ,sigma \sigma
"autocmd FileType tex inoremap ,tau \tau
"autocmd FileType tex inoremap ,phi \phi
"autocmd FileType tex inoremap ,Phi \Phi
"autocmd FileType tex inoremap ,psi \psi
"autocmd FileType tex inoremap ,omega \omega |
Thanks for your kind help. @lervag. You are very nice. I need to put this things down a bit cause i need to prepare my oral qualifying exam. After that, i will go back to solve this problem again. Once i have solution, i will also update here. |
Hi, Edward! Have you fixed this problem? I met the same issue. |
Description
I have been struggled for almost two days just want to make the pdfviewer show up. But i can not succeed due to the problem "not using a previewer", not much solution i can find.
Here is my environment for mac system:
I do not know what's the real problem for this. I do not know whether it is related with
dbus
. When i usebrew services list
, the status of dbus is stopped, not runing. But i can not solve.Here is one of the suspected reason, see below figure:
Steps to reproduce
I am not using
minimal.vim
, I edit all the setting in~/.vimrc
and using\ll
compile the.tex
file.Expected behavior
It run with no error but pdf viewer did not pop up.
Actual behavior
I compile my latex file without errors using
\ll
, but when I use command\lv
to show the pdf, the viewer did not show up. I try to find such problem and find a similar, but the reason is quite different. I use\lo
to output the compile information as below figureI can use
zathura a.pdf
to open the file in the terminal, but when I try to show up the pdf file after compilation, it did not showup. I also try skim as my default viewer, it occur the same "not using a previewer" information.Do you use a latexmkrc file?
No
VimtexInfo
The text was updated successfully, but these errors were encountered: