Specifying the destination for the pdf output when using pdflatex, from gVim
I am generating a pdf output with pdflatex
with the following command in gVim:
:!pdflatex %
This command in turns executes the following in the Command Prompt:
cmd.exe /c pdflatex /testvim.tex
Now, the problem I'm having with this is that the pdf is outputted to the system32
folder:
C:\windows\system32\testvim.pdf
How can I instruct pdflatex
to generate the pdf in the folder开发者_StackOverflow中文版 where the tex
file resides?
What about using the latex plugin for vim? http://vim-latex.sourceforge.net/
This depends mainly on your LaTeX version. Do you use MikTeX or TeXLive ?
The pdflatex
command of MikTeX has a command line option for specifying the output directory and the auxiliary directory (for .aux files).
I don't have MikTeX installed on my PC now, but you should be able to figure it out when running pdflatex --help
or pdflatex /?
from the command prompt.
If you are using TeXLive, you can first switch to the wanted output directory, then run pdflatex with the full path to your latex input file. This outputs everything into the current working directory, including temporary tex files.
I would suggest that you write your own runpdflatex.bat
file which includes the correct call to pdflatex so you don't have to bother with it every time you want to compile your latex file.
Do you start GVim per Icon? I do the following:
- Opening Dos Box
- Change to my tex-directory cd\local\tex\make
- gvim foobar.tex
- Executing :!pdflatex % creates the PDF document in local\tex\make not in the system32-folder
精彩评论