BibTeX Cleaning Agent Guide

  • Author: Yusaku Horiuchi
  • Affiliation: Syde P. Deeb Eminent Scholar in Political Science, Florida State University
  • Created: July 7, 2026
  • Last revised: July 7, 2026

Page views

A source-backed protocol for agentic AI systems that clean BibTeX entries for LaTeX manuscripts without damaging citation style, publication metadata, or rendered references.

If you are starting a new manuscript, consider using my LaTeX Research Article Template so the bibliography, manuscript structure, and compilation workflow are easier for an agent to inspect and maintain.

How to Use This Guide

  1. Click Copy Agent Instructions and paste the instructions into the agent that will clean the bibliography.
  2. Give the agent the manuscript root, active .tex, .aux, .bib, .bst, and appendix files, plus the target journal or house style.
  3. Tell the agent the access date to use for web sources.
  4. Require a cleaned .bib file and a detailed Markdown cleanup report.

What the Agent Must Do

  • Work from active citations in .aux files.
  • Check original sources as much as possible before changing entries.
  • Preserve the manuscript’s style unless the user changes it.
  • Apply the style guide’s Title Case or sentence-case rule consistently.
  • Compile the manuscript and inspect BibTeX warnings.
  • Return a complete cleanup report.

What the Agent Must Avoid

  • Inventing metadata.
  • Renaming keys unnecessarily.
  • Deleting uncited entries by default.
  • Changing .bst or citation packages casually.
  • Publishing manuscript-specific cleanup details without approval.

Core Workflow

  1. Establish scope. Identify the manuscript root, bibliography style, `.bib` files, and active citation keys from `main.aux`, appendix `.aux` files, or a regenerated build.
  2. Audit the database. Scan the full `.bib` file for duplicate keys, malformed entries, stray characters, and records inside LaTeX comments that BibTeX may still parse.
  3. Verify metadata. Check original sources as much as possible: publisher pages, DOI landing pages, Crossref, official preprint servers, institutional pages, news pages, government pages, and cited web pages before changing fields.
  4. Normalize by entry type. Use `@article` for published journal articles, `@book` and `@incollection` for books and chapters, and `@misc` with URLs for unpublished manuscripts, working papers, newspaper articles, web, news, policy, and government sources.
  5. Protect rendering. Preserve acronyms such as `{U.S.}`, `{US}`, `{UK}`, `{UN}`, `{EU}`, `{IO}`, and `{NATO}` where BibTeX might downcase them.
  6. Apply the capitalization rule. Check the style guide's Title Case versus sentence-case convention and apply it consistently.
  7. Build and inspect. Run the manuscript build, rerun BibTeX as needed, inspect `.blg` and `.log` files, and spot-check rendered references.
  8. Report every decision. The final Markdown report should document substantive metadata changes, style cleanup, duplicate handling, verification commands, and remaining risks.

Use @misc for unpublished manuscripts, working papers, preprints, newspaper articles, policy sources, government pages, and ordinary web records. Add a public URL in howpublished whenever one exists, especially when the bibliography style renders separate url fields poorly.

@misc{key,
  author       = {...},
  title        = {...},
  year         = {...},
  howpublished = {\textit{The New York Times}, June 14, available at \url{https://...}, last accessed Month Day, Year}
}

For working papers and preprints with DOIs, keep the DOI while formatting the source and URL in howpublished.

@misc{key,
  author       = {...},
  title        = {...},
  year         = {...},
  howpublished = {\textit{SSRN}, available at \url{https://...}, last accessed Month Day, Year},
  doi          = {10.2139/ssrn.0000000}
}

Online-First Journal Articles

For articles that are published online before final volume, issue, or page numbers are assigned, default to a journal-name comma plus volume = {forthcoming}. The comma after the journal name is intentional for local .bst rendering and should not be removed as a typo.

@article{Horiuchi2026Civilian,
  author  = {Horiuchi, Yusaku and Tago, Atsushi},
  title   = {Civilian Control and Casualty Sensitivity in a Pacifist Democracy: Evidence from Japan's 2021 Evacuation Mission},
  journal = {Conflict Management and Peace Science,},
  volume  = {forthcoming},
  year    = {2026}
}

Use forthcoming as the default status label. Users may choose FirstView, Advance online publication, or an equivalent publisher-specific label when that better matches the journal’s terminology.

Metadata Evidence Hierarchy

  1. Original publisher, journal, book, preprint, institutional, government, news, or web landing page.
  2. DOI resolver landing page.
  3. Crossref, DataCite, PubMed, JSTOR, Cambridge, Oxford, Wiley, SAGE, Taylor & Francis, Elsevier, Springer, or another publisher database.
  4. Official book publisher page or library catalog.
  5. Official institutional, government, think-tank, preprint, SSRN, APSA Preprints, arXiv, OSF, or author page.
  6. The cited web page itself.
  7. Reliable news or archival sources.

Do not rely only on citation aggregators, Zotero imports, Google Scholar, or copied BibTeX records when an original source or stronger source exists.

Style Rules Worth Making Explicit

Verification Checklist

latexmk -pdf -interaction=nonstopmode -halt-on-error main.tex
bibtex main.aux
bibtex appendix.aux

The exact commands may differ, but the agent should always check:

Report Structure

Every cleanup run should produce a detailed Markdown report. This is important for provenance: the user should be able to see which AI system did the work, how much reasoning was requested, which sources were checked, and what changed entry by entry.

The final cleanup report should include: