tried so many times and searched all over google but no one works,
finally find out by myself
so let me put it here:
in sumtrapdf, settings, option, inverse search put:
"C:\Program Files\Vim\vim73\gvim.exe" --remote-silent +%l "%f"
in latex-suite, search in ftplugin/latex-suite/compiler.vim and modify
as follows:
original:
if (has('win32') && (viewer =~? "^ *yap\( \|$\)"))
let execString = 'silent! !start '. viewer.' -s
'.line('.').expand('%').' '.mainfnameRoot
New:
if (has('win32') && (viewer =~? "^ *yap\( \|$\)" || viewer =~? "^sumatrapdf"))
if viewer =~? "^sumatrapdf"
let relativeFile=substitute(expand("%:p"),
Tex_GetMainFileName(':p:h').'/', '','')
let execString = 'silent! !start SumatraPDF
-reuse-instance "'.mainfnameFull.'.'.s:target.'" -forward-search
"'.relativeFile.'" '. line('.')
else
let execString = 'silent! !start '. viewer.' -s
'.line('.').expand('%').' '.mainfnameRoot
endif
in vimrc put:
let g:Tex_DefaultTargetFormat = 'pdf'
let g:Tex_CompileRule_pdf='xelatex --synctex=-1 -src-specials
-interaction=nonstopmode $*'
let g:Tex_ViewRule_pdf='SumatraPDF'
let g:Tex_MultipleCompileFormats='pdf'
Okay, thats it, no bother, forward(\ls) and backword searching (double click)
Thursday, August 30, 2012
Monday, August 20, 2012
vim for latex
What you need:
A text editor that can perform an action each time the document has changed
A fast way to recompile LaTeX
A viewer that can quickly reload the document.
I used gVim as the text editor, latexdaemon as the compilation engine,
and Sumatra as the PDF viewer.
In Vim, issue the command :au! CursorHoldI,CursorHold <buffer> silent!
:update to make it auto-save the document every time you stop typing.
Also :set updatetime=800 to set the timeout after which saving happens
to a low value.
latexdaemon will auto-compile the document in an efficient way every
time it's changed. Use the following at the beginning of the file to
make it produce PDF:
%Daemon> ini=pdflatex
Or just start it with latexdaemon -ini=pdflatex.
Sumatra will automatically re-load the file every time it is changed,
and it will not lock the PDF (so it can be recompiled without closing
Sumatra first).
This recipe will give you an almost real-time preview, but it takes
some effort to set up, and is not without issues. For example, you
might not want to continuously auto-save, in case you'd want to revert
to an earlier version.
There's a lot to improve on this, but I've been using it for some time
(after reading your question), and thought putting the recipe out here
might be useful for others too.
Since I was lazy, I just put everything to set this up into a .bat file:
@start C:\Path\To\Sumatra\SumatraPDF.exe %1.pdf
@start latexdaemon -ini=pdflatex %1.tex
@gvim -c ":au! CursorHoldI,CursorHold <buffer> silent! :update" -c
":set updatetime=800" %1.tex
also the sync issue, refer to
http://william.famille-blum.org/blog/static.php?page=static081010-000413
A text editor that can perform an action each time the document has changed
A fast way to recompile LaTeX
A viewer that can quickly reload the document.
I used gVim as the text editor, latexdaemon as the compilation engine,
and Sumatra as the PDF viewer.
In Vim, issue the command :au! CursorHoldI,CursorHold <buffer> silent!
:update to make it auto-save the document every time you stop typing.
Also :set updatetime=800 to set the timeout after which saving happens
to a low value.
latexdaemon will auto-compile the document in an efficient way every
time it's changed. Use the following at the beginning of the file to
make it produce PDF:
%Daemon> ini=pdflatex
Or just start it with latexdaemon -ini=pdflatex.
Sumatra will automatically re-load the file every time it is changed,
and it will not lock the PDF (so it can be recompiled without closing
Sumatra first).
This recipe will give you an almost real-time preview, but it takes
some effort to set up, and is not without issues. For example, you
might not want to continuously auto-save, in case you'd want to revert
to an earlier version.
There's a lot to improve on this, but I've been using it for some time
(after reading your question), and thought putting the recipe out here
might be useful for others too.
Since I was lazy, I just put everything to set this up into a .bat file:
@start C:\Path\To\Sumatra\SumatraPDF.exe %1.pdf
@start latexdaemon -ini=pdflatex %1.tex
@gvim -c ":au! CursorHoldI,CursorHold <buffer> silent! :update" -c
":set updatetime=800" %1.tex
also the sync issue, refer to
http://william.famille-blum.org/blog/static.php?page=static081010-000413
Subscribe to:
Comments (Atom)