LaTeXTools icon indicating copy to clipboard operation
LaTeXTools copied to clipboard

make basic builder run pdflatex and bibtex multiple times like simple builder

Open amokwao opened this issue 10 years ago • 7 comments

Hi again

I have an issue with the basic and traditional builders not showing my references in the pdf when build is complete. With simple build I get my references showing and realized that the it runs pdflatex and bibtex a couple of times (5) while basic runs it 3 times.

Is it possible to configure the basic builder to run more than 3 times or how do I get my references to show when I use the basic build?

Thank you,

amokwao avatar Jul 24 '16 19:07 amokwao

Hmmmm... Would it be possible to post the log from trying to compile with the basic builder? It really shouldn't result in less runs of pdflatex than the simple builder.

ig0774 avatar Jul 25 '16 09:07 ig0774

Thank you @ig0774 . Here's the log basic_log.txt

amokwao avatar Jul 25 '16 10:07 amokwao

I can't really figure out how to duplicate the issue, but here's a modified version of the basic builder that should work. Can you test it and check if this solves things? To use this, from the Command Palette (C-shift-p) select Preferences: Browse Packages, open the LaTeXTools folder, then the builder folder and replace basicBuilder.py with the attached file (be sure to rename it so its called basicBuilder.py. Then restart ST.

basicBuilder.py.txt

ig0774 avatar Jul 25 '16 11:07 ig0774

I am sorry to say the references still do not appear either in the text or in the bibliography section using the new basic build you sent. With the simple build they show. I am attaching the log of both runs if you would be kind to take a look. I must say that I am using classicthesis package with natbib instead of biblatex. Thank you simple_log.txt basic_log2.txt

amokwao avatar Jul 25 '16 11:07 amokwao

Oh... I think I see what's going on. Ignore the changed builder file. It shouldn't be necessary. The actual problem is resolving the path to your bib and bst file, where you used a relative path starting with ./, e.g., ./FrontBackmatter/myapsrev_bckref.

The problem is that to use an output directory, we have to run bibtex in the output directory (bibtex doesn't have a switch to tell it where to put the output file). Consequently, the path ./FrontBackmatter/myapsrev_bckref doesn't work, but only because you have an output_directory or aux_directory set. Because it wouldn't be very useful to not be able to reference files in your main directory, what we do is preprend the BIBINPUTS and BSTINPUTS environment variables with the path containing the root file so they can be correctly found. This works with relative paths, but not if relative paths are specified with a leading ./. Basically, if you change the lines of your document from:

\bibliographystyle{./FrontBackmatter/myapsrev_bckref}
\bibliography{./FrontBackmatter/myapsrev_bckref}

To:

\bibliographystyle{FrontBackmatter/myapsrev_bckref}
\bibliography{FrontBackmatter/myapsrev_bckref}

It should work.

ig0774 avatar Jul 25 '16 12:07 ig0774

You are God! Works perfectly. Tusen takk!!!

amokwao avatar Jul 25 '16 13:07 amokwao

Glad that got things working for you!

ig0774 avatar Jul 25 '16 18:07 ig0774