You are not logged in.
Pages: 1
I have the latex-suite in vim and I use it to compile. However, by default it compiles to DVI. I would like for it to compile to PDF by default instead. As of right now, if I try setting it to PDF (for example, using :TTarget pdf), it does not carry over from session to session. Is there a way to make it set on startup (mabye via the .vimrc)?
If not, how does one get the present directory of the file currently being editted? For example, :!cd DIRECTORY ; pdflatex FILE.tex , works when typed in manually. How about if one wanted to create a keybinding in .vimrc to yield this?
Thanks,
zeug.
Offline
Look in your ~/.vim/ftplugin/tex.vim:
let g:Tex_DefaultTargetFormat='pdf'
let g:Tex_MultipleCompileFormats='dvi,pdf'
It's been a while since I changed something in there, but IIRC this was what made vimlatex compile to pdf by default.
Offline
I do not seem to have that directory. I did find that file a bunch of locations, though. Any idea which one should be editted?
/usr/share/vim/addons/compiler/tex.vim
/usr/share/vim/addons/indent/tex.vim
/usr/share/vim/vim72/compiler/tex.vim
/usr/share/vim/vim72/ftplugin/tex.vim
/usr/share/vim/vim72/syntax/tex.vim
/var/lib/vim/addons/compiler/tex.vim
/var/lib/vim/addons/indent/tex.vim
Thanks.
Offline
Look in your ~/.vim/ftplugin/tex.vim:
let g:Tex_DefaultTargetFormat='pdf' let g:Tex_MultipleCompileFormats='dvi,pdf'
It's been a while since I changed something in there, but IIRC this was what made vimlatex compile to pdf by default.
Thanks for that tip
====* -- Joke
O
\|/ --- Me
/ \ Whooooosh
Offline
I do not seem to have that directory. I did find that file a bunch of locations, though. Any idea which one should be editted?
(…LOCATIONS!…)
Thanks.
Uhh, I'm never able to recall which directory gets overwritten on each vim update, sorry There was a thread about this once, but I can't seem to find it just now…
The manual explains the options very well, I think, but it still doesn't say where this stuff should belong. However, unless you intend to write your documents as root, I'd say just create the ~/.vim/ftplugin folder and put tex.vim in it.
Thanks for that tip
Yer welcome.
Edit: Found the aforementioned thread.
Last edited by Runiq (2010-02-23 22:49:26)
Offline
I cannot seem to find what you said to look for in any of those files. Should I put it in one of them?
Danke.
Offline
This is my ~/.vim/ftplugin/tex.vim:
let g:Tex_DefaultTargetFormat='pdf'
let g:Tex_MultipleCompileFormats='dvi,pdf'
let g:Tex_UseMakefile=1
let g:Tex_ViewRule_pdf='zathura'
let g:Tex_Menus=0
let g:Tex_FoldedCommands='ctable
I'm obviously using zathura as a pdf viewer and don't have gvim installed. Don't know whether I put these lines in there myself or whether they were already there to begin with; as I said, it's been a while
Edit: I misread your post, sorry. I still think you should put this in your ~/.vim/ftplugin/tex.vim.
Last edited by Runiq (2010-02-27 07:13:42)
Offline
Awesome! It works.
Danke schön.
Also, do you know how to change behaviors like "$$" being turned into "$$<++>", etc.?
Offline
Bitte bitte! (Now why didn't we do this in the German bbs?)
I think you'll have to redefine the appropriate macros (look here, "overriding latex-suite macros", and here and here).
By now you have probably realized that all I do is direct you towards the general direction of the latex-suite manual, this would be because I'm nowhere near as firm with vim as I want to be.
Edit: By the by: link has a similar issue.
Last edited by Runiq (2010-02-27 10:57:46)
Offline
Pages: 1