为什么我必须重新打开 PDF 查看器才能看到文档添加的内容?

为什么我必须重新打开 PDF 查看器才能看到文档添加的内容?

我使用的是装有 latex-suite 的 Mac。一切运行良好,只是在点击\ls或查看我的 pdf 输出后,如果我对我的 tex 文件进行了其他更改,我必须先关闭 pdf,然后才能通过再次点击或\lv显示这些其他更改。\ls\lv

以下是我对 latex-suite 环境进行的一些更改。也许它们(虽然我不知道如何)可以解决此问题?

在compiler.vim中(位于以下目录下)

/Users/Muno/.vim/ftplugin/latex-suite,我在正向搜索函数的条件中扩展了正则表达式。正则表达式将viewer变量(实际上是g:Tex_ViewRule_pdf)与潜在的文件查看器(在本例中为 Skim、PDFView 或 Texniscope)进行匹配。

 elseif (has('macunix') && (viewer =~ '^ *\(Skim\|PDFView\|TeXniscope\)\( \|$\)'))
376                 " We're on a Mac using a traditional Mac viewer
377 
378                 
379                 if viewer =~ '^ *\(Skim\)'
380 
381                                 let execString .= '/Applications/Skim.app/Contents/SharedSupport/displayline '
382                                 let execString .= join([linenr, target_file, sourcefileFull])

 elseif (has('macunix') && (viewer =~ '^ *\(Skim\|PDFView\|TeXniscope\|open -a Skim\)\( \|$\)'))
376                 " We're on a Mac using a traditional Mac viewer
377 
378                 echo viewer
379                 if viewer =~ '^ *\(Skim\|open -a Skim\)'
380 
381                                 let execString .= '/Applications/Skim.app/Contents/SharedSupport/displayline '
382                                 let execString .= join([linenr, target_file, sourcefileFull])

我的.vimrc 如下:

" REQUIRED. This makes vim invoke Latex-Suite when you open a tex file.
filetype plugin on

" IMPORTANT: win32 users will need to have 'shellslash' set so that latex
" can be called correctly.
set shellslash

" IMPORTANT: grep will sometimes skip displaying the file name if you
" search in a singe file. This will confuse Latex-Suite. Set your grep
" program to always generate a file-name.
set grepprg=grep\ -nH\ $*

" OPTIONAL: This enables automatic indentation as you type.
filetype indent on

" OPTIONAL: Starting with Vim 7, the filetype of empty .tex files defaults to
" 'plaintex' instead of 'tex', which results in vim-latex not being loaded.
" The following changes the default filetype back to 'tex':
let g:tex_flavor='latex'

" This changes the pdf viewer from some other viewer to Preview.app

let g:Tex_TreatMacViewerAsUNIX = 1
let g:Tex_DefaultTargetFormat = 'pdf'
let g:Tex_CompileRule_pdf = 'pdflatex -synctex=1 --interaction=nonstopmode $*'
let g:Tex_ViewRule_pdf = "open -a Skim"
let g:Tex_ViewRule_ps = "open -a Preview.app"

    " Command-R will write, compile, and forward search--thanks to
    " http://reference-man.blogspot.com/2011/09/fully-integrated-latex-in-macvim.html
    " preview, switch back to main window
    map <D-r> :w<cr><leader>ll<leader>ls
    imap <D-r> <ESC><D-r>



"Coloration
colorscheme darkblue

set number                      "Line numbers are good
"let mapleader=","

相关内容