6

My pdf compile rule is

pdflatex -interaction=nonstopmode $* & bibtex $* & pdflatex -interaction=nonstopmode $*

Everything works fine except for the bibtex call. The reason is that "$*" is expanded to "file.tex" rather than "file", and bibtex subsequently appends ".aux". I.e. the call is

bibtex file.tex

and then bibtex looks for a "file.tex.aux" which obviously won't exist.

I can manually run bibtex with

:!bibtex file

and it works.

Is there any way to change how $* is expanded? I would prefer to just hit \ll rather than manually typing in the call!

NOTE: This is on MS Windows.

  • Welcome to TeX.SX! You can have a look on our starter guide to familiarize yourself further with our format. – Heiko Oberdiek Jun 6 '13 at 1:17
  • 1
    I'm a heavy vim user- this type of thing is a very good reason to consider using arara- you could add directives % arara: pdflatex and % arara: bibtex and then just run arara myfile and all would be good. Better still, I map a key to run arara myfile which is a one-hit fixes all approach :) – cmhughes Jun 6 '13 at 1:55
  • What happens if you replace bibtex $* with bibtex $(basename $* .tex)? – Predrag Punosevac Jun 6 '13 at 4:44
  • 1
    @bdforbes Use the code in the first part of this question and change let g:Tex_BibtexFlavor = 'biber' to let g:Tex_BibtexFlavor = 'bibtex'. I don't use vim-latex anymore but I believed that this used to work. In fact by setting let g:Tex_MultipleCompileFormats='pdf'you should be able to press \ll and latex-suite will automatically run pdflatex, bibtex etc. as many times as needed. – petobens Dec 24 '13 at 4:25
  • 1
    The answer is here Get the file name without file extension in Vim function. – rvaneijk Apr 21 '15 at 14:24
0

Thanks to @rvaneijk who alerted me to this answer by @tonio.

The compile rule should be changed to

"pdflatex -interaction=nonstopmode %:r & bibtex %:r & pdflatex -interaction=nonstopmode %:r"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.