1

I'm using a mac with latex-suite. Everything is working well, except that after hitting \ls or \lv to view my pdf output, if I made additional changes to my tex file, I must first close the pdf before these additional changes are displayed by hitting \ls or \lv a second time.

Here are some changes I introduced to my latex-suite environment. Perhaps they (though I don't see how) account for this fix?

In compiler.vim (which is under the following directory)

/Users/Muno/.vim/ftplugin/latex-suite, I extended the regex in a conditional of the forward search function. The regex matches the viewer variable (which is really g:Tex_ViewRule_pdf) with potential file viewers (in this case Skim, PDFView or 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])

to

 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])

And my .vimrc is as follows:

" 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=","

closed as unclear what you're asking by Stefan Pinnow, TeXnician, user31729, Kurt, Mike Nov 1 '17 at 21:40

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    Some PDF viewers will update the view when the file is changed, but apparently not the one you're using. I believe Mac Preview does update automatically. – musarithmia May 17 '17 at 15:26

Browse other questions tagged or ask your own question.