How to Manage a BibTeX Library for Your Thesis and Papers

The Mitra team · · Updated · 7 min read

Two days before submission, you compile the full thesis for the first time in a month, and page 214 says ”[?]” three times. Somewhere in a 400-entry refs.bib is a key that changed, a duplicate, or an entry that never made it in. You’ll find it. It’ll just cost you an evening you didn’t have.

The fix is boring, and it works. To manage a BibTeX library for a thesis, keep one master .bib file generated by a reference manager rather than edited by hand, use a consistent citation key pattern like nguyen2021ceramic, fill in DOIs, and remove duplicates before they reach your bibliography. Zotero with the Better BibTeX plugin, or JabRef if you’d rather edit the file directly, does most of this for you.

Below: citation keys, one file versus many, Better BibTeX, duplicates and DOIs, biblatex versus BibTeX, and Overleaf. For where the PDFs themselves should live, see how to organize research papers. If you haven’t picked a reference manager yet, Zotero vs Mendeley vs EndNote compares them, and if your co-authors live in Word, managing citations in Word covers their side.

Why BibTeX libraries go wrong

Nobody sets out to build a bad .bib file. It happens one paste at a time.

Say you’re a PhD student in hydrology. In first year you copy entries from Google Scholar. In second year a co-author sends you their file and you append it. In third year you grab a few from publisher pages at midnight. By the time you write up, refs.bib has 410 entries, and 30 of them are duplicates under different keys: Smith2019, smith2019deep, Smith_2019. Some titles come out all lowercase because nobody protected the capitals. Half the entries have no DOI. Chapter 3 points at a different file from chapter 2, and the two disagree about the year of the one paper your whole method rests on.

None of that is hard to fix. It’s tedious, and it compounds. A few habits in the first month save you the cleanup in the last one.

Choosing clean, stable citation keys

You’ll type your keys into \cite{} hundreds of times, so they should be guessable without looking. Some common patterns:

  • nguyen2021ceramic: first author, year, first meaningful title word. Readable, and rarely collides.
  • Nguyen2021: shorter, but two Nguyen papers in 2021 become Nguyen2021a and Nguyen2021b, and you’ll never remember which is which.
  • nguyen_ceramic_2021: also fine.

Honestly, the pattern matters less than three rules. Stick to plain ASCII letters, numbers and simple punctuation: no spaces, no accents, because müller2020 will break something eventually. Never change a key once you’ve cited it; if your tool regenerates keys when metadata changes, pin them, or a renamed key turns into ?? in your PDF and a hunt through every chapter. And let the tool generate keys rather than typing them yourself. Hand-made keys drift into three patterns within a month.

One .bib file or many?

One master file, for almost everyone. Export your whole library, or a “Thesis” collection, to a single .bib and point every chapter at it:

% biblatex
\addbibresource{thesis.bib}

% classic BibTeX
\bibliography{thesis}

Only cited entries appear in the bibliography, so a big file costs you nothing.

Several files make sense only when they genuinely come from different places, say your library plus a software.bib for package citations. Both BibTeX (\bibliography{thesis,software}) and biblatex (one \addbibresource per file) can combine them. The risk is the same key living in two files with different data. At best you get warnings. At worst you get the wrong reference, silently.

What if a journal wants only the cited entries? Don’t maintain a small file by hand. Generate it at the end: tools like bibtool can pull the cited entries out using your .aux file. Plenty of journals are happy with the full .bib or the generated .bbl anyway.

Better BibTeX for Zotero

If you use Zotero and LaTeX, install Better BibTeX (BBT). It’s a free plugin that fixes the two weak spots in Zotero’s built-in export.

The first is keys. BBT builds them from a formula you set in its preferences (author, year, title word, in whatever order you like) and keeps them stable. You can pin any key so it never changes, even if you later fix a typo in the author’s name.

The second is auto-export. Right-click a collection, choose Export, pick “Better BibLaTeX” or “Better BibTeX” and tick “Keep updated”. From then on, every item you add or edit in that collection gets written to the .bib file. Save it inside your thesis folder and LaTeX always sees the current version. You stop thinking about exports at all.

BBT also handles LaTeX escaping, Unicode and title-case protection better than a plain export. Most people writing a LaTeX thesis with Zotero end up here sooner or later.

Not a Zotero person? JabRef is a free, open source editor built around .bib files. It generates keys, looks up entries by DOI, finds duplicates and cleans fields, and the file it saves is the file LaTeX reads. No export step in between.

Fixing duplicates and missing DOIs

Duplicates come from copying entries from several places, so fix them at the source rather than in the .bib. In Zotero, open the Duplicate Items view and merge. In JabRef, run the duplicate finder. A quick manual check helps too: search the .bib for each DOI, because two entries sharing a DOI are always duplicates. When you have both a preprint and the published version, keep the published one unless you’re specifically citing the preprint.

One trap after merging: the merged entry keeps only one of the old keys. Recompile, search the log for undefined citations, and update any \cite that used the key that disappeared.

DOIs make entries checkable and, in many styles, clickable. They’re also the best source of metadata. Google Scholar’s “Cite > BibTeX” is quick, but it often gives you abbreviated journal names and flattened titles. Instead, paste the DOI into your reference manager (Zotero’s magic wand, “Add Item by Identifier”, does exactly this) or ask doi.org directly:

curl -LH "Accept: application/x-bibtex" https://doi.org/10.1038/s41586-020-2649-2

Wherever an entry comes from, check the title. BibTeX styles often lowercase titles, so protect proper nouns and acronyms with braces: title = {Fouling of {TiO2} Membranes in the {Rhine} Basin}. Without the braces, your examiner reads about “tio2 membranes in the rhine basin”. They notice.

biblatex vs BibTeX: which should you use?

Both turn a .bib file into a bibliography, and the .bib file itself is mostly the same either way. The difference is in everything around it.

Classic BibTeX (often with natbib) biblatex with biber
Styles .bst files, hard to edit Configured in LaTeX, much easier to adjust
Unicode Limited Full
Entry types Standard set More, including @online and @dataset
Cite commands \citet, \citep (natbib) \textcite, \parencite, \autocite
Journal templates Very common Less common

For a thesis, or anything where you control the template, use biblatex. Per-chapter bibliographies, style tweaks and non-English names all get much easier. When a journal or conference template ships with a .bst file, use BibTeX with natbib and don’t fight it. You won’t win, and it isn’t worth the afternoon.

Better BibTeX exports in either flavour, so pick the one that matches your document. If you’re still deciding whether LaTeX is right for your thesis at all, read LaTeX vs Word for a thesis first.

Keeping Overleaf in sync with your library

Overleaf works fine with a managed .bib. It just needs a route for updates to arrive:

  • Linked reference manager. On paid plans, Overleaf can link to Zotero or Mendeley and import a .bib from your library. Click refresh after adding papers.
  • Upload. On the free plan, upload the auto-exported .bib whenever it changes. Simple, and easy to forget.
  • Git, GitHub or Dropbox. On paid plans, Overleaf can sync projects through these. Put the BBT auto-export inside the synced folder and it turns up with your next sync.

Whichever route you take, one rule holds: edit references in the reference manager, never in Overleaf’s copy of the .bib. The next export overwrites hand edits without asking. On co-authored papers, agree up front on who owns the file.

Before each chapter goes to your supervisor, spend ten minutes on a routine: refresh the .bib, compile twice, search the log for “undefined” and “multiply defined”, and scan the bibliography for lowercase acronyms. It saves you an embarrassed email, and it slots neatly into the rest of how to write a PhD thesis.

Where Mitra fits

Mitra is a free desktop app for macOS, Windows and Linux, and your papers stay on your own computer. It imports BibTeX, RIS and Zotero libraries with your collections kept as folders. It also reads titles, authors and DOIs from the PDFs themselves, so the papers that never made it into your .bib (there are always some) get proper metadata too. Duplicates are caught by first-page content rather than file name, so final_v3.pdf and nguyen2021.pdf don’t both sneak in as separate papers.

It has a LaTeX editor that builds with TeX Live and keeps the .bib in step with your library, so a citation you add is in the bibliography on the next build. Its co-writer drafts and rewrites using only papers in your library and cites them as it goes, which means no invented references to dig out later. If you want to try it on an existing thesis folder, download Mitra free.

Questions people ask

Should I use one .bib file or several for my thesis?

Keep one master .bib file generated from your reference manager, and point every chapter at it. Several hand-edited files drift apart and produce duplicate keys with different data. If a journal wants a small .bib with only the cited entries, generate it at submission time rather than maintaining it.

What is the best citation key format for BibTeX?

A short, predictable pattern such as author, year and first title word, for example nguyen2021ceramic. It is easy to guess while typing, unique enough for most libraries, and readable in the source. Whatever you choose, keep keys stable once you have cited them.

Should I use biblatex or BibTeX?

For a new thesis, biblatex with the biber backend is usually the better choice: it handles Unicode, has flexible styles and supports more entry types. Use classic BibTeX with natbib when a journal or university template requires it, which many journal templates still do.

How do I get a BibTeX entry from a DOI?

Add the DOI to your reference manager and let it fetch the metadata, or ask doi.org directly: curl -LH "Accept: application/x-bibtex" https://doi.org/ followed by the DOI returns a BibTeX entry from the registration agency. Always check the result for title capitalisation and author names.

How do I keep my Zotero library in sync with Overleaf?

Overleaf can link to Zotero or Mendeley directly on its paid plans and refresh the .bib file on request. On the free plan, export a .bib with Better BibTeX and upload it again when it changes. Paid plans can also sync a project through Git or Dropbox, so an auto-exported file arrives on its own.

Keep reading