vim 與 cwTeX 配合

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

這是 vimrc 的部分:

" TeX
function MakeTeX()
    let textfilename = expand("%:p:r")
    execute "silent !cwtex " . textfilename
    execute "silent !pdflatex " . textfilename
    execute "silent !pdflatex " . textfilename 
endfunction

function MakeTeX2()
    let textfilename = expand("%:p:r")
    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 = expand("%:p:r")
    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>
This entry was posted in Computer, Editor, Murmuring, Software. Bookmark the permalink.

2 Responses to vim 與 cwTeX 配合

  1. Pingback: 抓~ 抓到一隻瞌睡蟲 » Blog Archive » vim 與 latex 配合 (+ CJK)

  2. Pingback: Melody…Sleepless » 當cwtex遇見vim-latex

Leave a Reply

Your email address will not be published. Required fields are marked *