I have a latex file (.tex) which I'm editing in vim. Usually, I just go into cmd and type pdflatex my-file.tex
, hope for the best, and a .pdf pops out :)
What would I need to change in Vim, to use Vim's "make option". So, I can just do :make, and let Vim build my .tex files for me. Also, I'd like it to display the output in a new buffer to the right?
Can anyone give me some pointers on this? I just started using that feature (:make in Vim).
EDIT: Bonus points :) for tips that handle the problems mentioned by Sebastian, as well.
I personally have the following in my .vimrc
:
autocmd FileType tex setlocal makeprg=pdflatex\ --shell-escape\ '%'
That will let you :make
in order to run pdflatex
.
It is not perfect, however:
--shell-escape
is a slightly dangerous option that allows the document to call any program, but it is needed in order to compile documents using dot2texi
. (Embedded graphviz.)For more complicated documents, I tend to use the LaTeX Makefile. It's quite large and does quite a lot of things, but usually it'll do what you want automatically with no or only minor modifications.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With