Gea-Suan Lin's BLOG

Monday, December 26, 2005

vim 與 cwTeX 配合

F8 比較慢 (cwtex + latex + latex + dvips + ps2pdf),F9 比較快 (cwtex + pdflatex + pdflatex)。跑兩次 latex 的目的在 的 manual 裡面有提到原因。

這是 vimrc 的部分:

" TeX function MakeTeX()     let textfilename     execute "silent !cwtex " . textfilename     execute "silent !pdflatex " . textfilename     execute "silent !pdflatex " . textfilename endfunction  function MakeTeX2()     let textfilename     execute "silent !cwtex " . textfilename     execute "silent !latex " . textfilename     execute "silent !latex " . textfilename     execute "silent !dvips " . textfilename     execute "silent !ps2pdf " . textfilename . ".ps" endfunction  function LanuchPDF()     let textfilename     execute "silent !start C:\\Program\ Files\\Foxit\ Reader\\Foxit\ Reader.exe " . textfilename . ".pdf" endfunction  au BufNewFile,BufRead *.ctx setf tex map <F8> :call MakeTeX2()<CR>:call LanuchPDF()<CR> map <F9> :call MakeTeX()<CR>:call LanuchPDF()<CR>

Links to this post:

Create a Link

<< Home