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.

9
  • 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

Browse other questions tagged or ask your own question.