I am using Sublime Text 3 with Latextools on Miktex to compile my Latex documents and natbib for my bibliography. I installed the setup on a new laptop and have been running into the following problem:

I updated a reference from \citep{Einstein2017} to \citep{Einstein2018}. The bibliography now contains entries for both the 2017 and the 2018 version of the paper. I even removed the 2017 version from the underlying .bib file but it is still in the bibliography. I have compiled using both the basic and the traditional builder.

  • Rerun bibtex or biber. When you change contents of your .bib file, you should repeat a complete compilation cycle of latex latex biber latex. – thymaro Nov 12 '18 at 0:23

As mentioned in this answer natbib won't update your bbl file, as thymaro said in the comment, you need to run the toolchain twice for it to update. You can solve this easily with latexmk (and achieve greatness at the same time):

A better way?

Run this in your terminal from the folder you have your main.tex file (where \begin{document} is located):

latexmk -pvc -pdf -latex=ENGINE -latexoption="-synctex=1 -interaction=nonstopmode -file-line-error -recorder" -BIBENGINE MAINFILE.tex


-pvc makes latexmk run each time a file is updated (similar effect of that you see on OverLeaf

-pdf compiles to pdf (if needed)

-latexoptions allow for i.e.: sumantra PDF to work with your file.

ENGINE can be pdflatex or xelatex etc.

BIBENGINE can be bibtex or biber

and MAINFILE.tex is your main tex file.

  • Thank you this is very helpful. I have been looking at latexmk. Ideally I would want the latextools builder in sublime to call latexmk and do the magic on its own rather than me doing it from the command line each time. Do you know if that is at all possible? – Jan Bakker Nov 12 '18 at 10:32
  • Regarding my own flollow-up comment: – Jan Bakker Nov 12 '18 at 17:27
  • I do not use Sublime, but according to what I can see from the documentation, latextools seem to use latexmk behind the scenes. The options seems to be what you are looking for. If not, you could make a runlatexmk.bat or sh file and run that when sublime starts? – Ole Anders Nov 12 '18 at 17:47

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.