5

I'm using Sublime Text 2 (ST2) with LaTeXTools to build my .tex-documents. But the .bib-file is not found or doesn't build (I believe the last one). The LaTeX log reports undefined citations, and the entire bibliography is missing form the PDF. I have searched the web for a solution. Although a similar problem occurs in Bibliography missing from PDF (Sublime Text 2 and Miktex), I made a new LaTeX build command using the answer from elleestcrimi, but it doesn't work.

Somebody have an idea about what I can do? I call the .bib-file from the \bibliography{ref.bib} command and have the standard LaTeXTools build-file:

{
"cmd": ["latexmk", "-cd",
            "-e", "\\$pdflatex = 'pdflatex %O -interaction=nonstopmode -synctex=1 %S'",
            //"-silent",
            "-f", "-pdf"],
"path": "$PATH:/usr/texbin:/usr/local/bin",
"file_regex": "^(...*?):([0-9]+): ([0-9]*)([^\\.]+)"
},

Edit: As the latexmk documentation points out that bibtex will be run even if there is no .bib-file present, I haven't really considered the alternative to manually run bibtex. I would like bibtex to build anyhow.

Edit2: When I build my document from ST2 with LaTeXTools (see above), then the bibtex-command from github:

{
"cmd": ["bibtex", "$file_base_name"],
"path": "$PATH:/usr/texbin:/usr/local/bin",
"file_regex": "^(...*?):([0-9]+): ([0-9]*)([^\\.]+)",
"selector": "text.tex.latex"
}

and rebuild with LaTeXTools the bibliography is included and the sun is shining.

EDIT3: I'm now not able to reproduce the problem. It somehow seems to have solved itself. Typesetting with ST2 produces all the files it should, and the bibliography is included.

Holene
  • 6,920
  • Have you actually run bibtex (i.e. bibtex myfile.tex)? – Ian Thompson Nov 20 '12 at 10:02
  • When bibtex is run on myfile.tex, it generates myfile.bbl. Is there a .bbl file in your directory? – Ian Thompson Nov 20 '12 at 10:50
  • @IanThompson Comment 1: See edit =) Comment 2: No. There are no .bbl file in my dir. – Holene Nov 20 '12 at 10:56
  • To narrow down the problem, try doing bibtex myfile.tex directly from the command line, then typesetting your document. What happens? – Ian Thompson Nov 20 '12 at 11:14
  • @IanThompson See edit2. Seems my bibtex runs fine when it is run solo. What I don't understand is why either my bibtex doesn't work with latexmk, or latexmk doesn't call bibtex. – Holene Nov 20 '12 at 11:22
  • @Holene Do you also see the problem if you invoke latexmk from the command line? – John Collins Nov 20 '12 at 18:55
  • @JohnCollins No, when running latexmk from the command line, everything works fine. I have set pdf_mode = 1 and dvi_mode = 0in the latexmk perl script, though. – Holene Nov 21 '12 at 08:26
  • @Holene Because you find latexmk works from the command line but not from within ST2, the problem is probably a difference between the environments in ST2 and at the command line. If you could send me a copy of latexmk's output with an explanation of exactly what you did, I could maybe debug the problem. (It would help if you removed the -silent and -f options from your configured command line for latexmk in ST2. That would give more debugging information.) Send me this off-line, to the e-mail given in latexmk's documentation. – John Collins Nov 26 '12 at 20:51
  • Thanks for the help guys, the problem has now somehow solved itself. Everything works fine. – Holene Dec 05 '12 at 18:22

0 Answers0