How to Manage a BibTeX Library for Your Thesis with Mitra

The Mitra team · · Updated · 9 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 can do much of this. Mitra goes a step further for LaTeX writers: it writes refs.bib for you from the papers you actually cite, with stable keys, inside a LaTeX editor that sits next to your PDFs.

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.

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, so fixing a typo in an author’s name later doesn’t break a \cite you already wrote.

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.

How Mitra keeps your .bib in step with your library

Both of those tools still leave you juggling three apps: the reference manager, the PDF reader and the LaTeX editor. Mitra puts them in one window, and the .bib becomes something you stop maintaining.

Here’s how it works, step by step:

  1. Bring in what you have. Drag your existing thesis.bib into Mitra, or use Settings → Library → Import. Mitra reads Zotero, JabRef and Mendeley file fields, so linked PDFs come along. Zotero on the same computer can be imported directly, collections and all. Each imported file shows up as a Bibliography in the sidebar and stays in step with the file, with Export, Re-read and Show in Finder in its menu.
  2. Let Mitra catch duplicates as they arrive. The same file or link is caught as “Already in your library”. A paper whose DOI matches one you have gets “Looks like a version of X”, with Merge or Keep both. That’s your preprint-versus-published decision, made at the moment it comes up.
  3. Fill in DOIs and metadata. Mitra finds DOI and arXiv IDs in each PDF and looks them up on Crossref, arXiv and OpenAlex. References without a PDF sit under “Without PDF” with Find PDF, which tries legal open copies first (OpenAlex, Unpaywall, arXiv), then your publisher access or university proxy.
  4. Write in Mitra’s LaTeX editor. Open your thesis folder or an Overleaf .zip. Type \cite and keys autocomplete from your library, or press ⌘⇧C to search for a paper by title. Mitra generates refs.bib from the library sources you cite, with stable keys like smith2023lean, and keeps any entries you wrote by hand. Your draft’s own .bib files also appear as “From your writing” bibliographies, where each entry shows “In your library”, Find PDF or Add as reference.
  5. Cite what you don’t have yet. Cite online searches millions of papers through OpenAlex, adds the one you pick and cites it in one go.
  6. Export when a journal asks. Select papers and export BibTeX with stable cite keys, RIS or EndNote XML.

It compiles with TeX Live (an existing install, or TinyTeX installed on first compile), installs missing packages itself, and when a build fails the co-writer reads the log and fixes it, asking before it installs anything. Every change it makes can be undone.

Download Mitra free and drop your current .bib on it. You’ll see the duplicates before your examiner does.

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 Mitra, the “Looks like a version of X” prompt does this as papers arrive. 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 (plan details from Overleaf’s plans page, as of November 2026):

  • Linked reference manager. On paid plans only, 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.

If you’d rather work on your own computer, Mitra opens an Overleaf .zip and compiles it locally, so the project and its .bib don’t depend on a connection or a plan. The project stays a plain folder, so you can push it to Git or zip it back to Overleaf whenever co-authors need it.

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.

Stop hand-editing your .bib: let Mitra write it

A clean BibTeX library comes down to one master file, stable keys, DOIs everywhere and duplicates caught early. Mitra does all four inside the app where you already read and write. Your PDFs, notes and drafts stay on your own computer, and the co-writer drafts and rewrites using only papers in your library, citing them as it goes, so it never hands you a reference you’d have to dig out later. Before a chapter goes to your supervisor, the Citation check (no AI needed) flags citations to papers you never opened and sentences their source doesn’t support.

Mitra is free on one computer, for good, on macOS, Windows and Linux, and works with the AI you already have: ChatGPT Plus or Pro, Claude Code, Codex, Cursor, or a model running offline (beta). Download Mitra and open your thesis folder in its LaTeX editor.

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 links to Zotero or Mendeley only on its paid plans, and refreshes 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, GitHub or Dropbox, so an auto-exported file arrives on its own. Mitra opens an Overleaf .zip and compiles it on your own computer with TeX Live, with the .bib generated from your library.

Can Mitra manage my .bib file?

Yes. Mitra imports .bib files (including Zotero, JabRef and Mendeley exports) and keeps each one in step as a Bibliography in the sidebar. In its LaTeX editor, refs.bib is generated from the library sources you cite, with stable keys such as smith2023lean, and entries you wrote by hand are kept. Mitra is free on one computer.

Keep reading