You are not logged in.

#1 2010-02-23 18:22:08

zeug
Member
Registered: 2009-05-08
Posts: 25

vim LaTeX-suite compile

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

#2 2010-02-23 19:03:05

Runiq
Member
From: Germany
Registered: 2008-10-29
Posts: 1,053

Re: vim LaTeX-suite compile

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

#3 2010-02-23 20:19:00

zeug
Member
Registered: 2009-05-08
Posts: 25

Re: vim LaTeX-suite compile

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

#4 2010-02-23 22:08:04

makimaki
Member
From: Ireland
Registered: 2009-04-02
Posts: 109

Re: vim LaTeX-suite compile

Runiq wrote:

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 smile


====* -- Joke
    O
    \|/ --- Me
    / \             Whooooosh

Offline

#5 2010-02-23 22:45:50

Runiq
Member
From: Germany
Registered: 2008-10-29
Posts: 1,053

Re: vim LaTeX-suite compile

zeug wrote:

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 hmm 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. hmm 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.

makimaki wrote:

Thanks for that tip smile

Yer welcome. smile

Edit: Found the aforementioned thread.

Last edited by Runiq (2010-02-23 22:49:26)

Offline

#6 2010-02-27 06:46:56

zeug
Member
Registered: 2009-05-08
Posts: 25

Re: vim LaTeX-suite compile

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

#7 2010-02-27 07:12:29

Runiq
Member
From: Germany
Registered: 2008-10-29
Posts: 1,053

Re: vim LaTeX-suite compile

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 smile

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

#8 2010-02-27 08:00:12

zeug
Member
Registered: 2009-05-08
Posts: 25

Re: vim LaTeX-suite compile

Awesome! It works.

Danke schön.

Also, do you know how to change behaviors like "$$" being turned into "$$<++>", etc.?

Offline

#9 2010-02-27 08:24:33

Runiq
Member
From: Germany
Registered: 2008-10-29
Posts: 1,053

Re: vim LaTeX-suite compile

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. tongue

Edit: By the by: link has a similar issue.

Last edited by Runiq (2010-02-27 10:57:46)

Offline

Board footer

Powered by FluxBB