bibtex_formatting.md
908 lines · skills/citation-management/references/bibtex_formatting.md at 5f2bc03
Most marks come from matching words in the file, so treat them as pointers.
BibTeX Formatting Guide
Comprehensive guide to BibTeX entry types, required fields, formatting conventions, and best practices.
Raw lines 1 to 4Overview
BibTeX is the standard bibliography format for LaTeX documents. Proper formatting ensures:
- Correct citation rendering
- Consistent formatting
- Compatibility with citation styles
- No compilation errors
This guide covers all common entry types and formatting rules.
Raw lines 5 to 14Entry Types
Raw lines 15 to 16@article - Journal Articles
Most common entry type for peer-reviewed journal articles.
Required fields:
author: Author namestitle: Article titlejournal: Journal nameyear: Publication year
Optional fields:
volume: Volume numbernumber: Issue numberpages: Page rangemonth: Publication monthdoi: Digital Object Identifierurl: URLnote: Additional notes
Template:
@article{CitationKey2024,
author = {Last1, First1 and Last2, First2},
title = {Article Title Here},
journal = {Journal Name},
year = {2024},
volume = {10},
number = {3},
pages = {123--145},
doi = {10.1234/journal.2024.123456},
month = jan
}Example:
@article{Jumper2021,
author = {Jumper, John and Evans, Richard and Pritzel, Alexander and others},
title = {Highly Accurate Protein Structure Prediction with {AlphaFold}},
journal = {Nature},
year = {2021},
volume = {596},
number = {7873},
pages = {583--589},
doi = {10.1038/s41586-021-03819-2}
}Raw lines 17 to 64@book - Books
For entire books.
Required fields:
authorOReditor: Author(s) or editor(s)title: Book titlepublisher: Publisher nameyear: Publication year
Optional fields:
volume: Volume number (if multi-volume)series: Series nameaddress: Publisher locationedition: Edition numberisbn: ISBNurl: URL
Template:
@book{CitationKey2024,
author = {Last, First},
title = {Book Title},
publisher = {Publisher Name},
year = {2024},
edition = {3},
address = {City, Country},
isbn = {978-0-123-45678-9}
}Example:
@book{Kumar2021,
author = {Kumar, Vinay and Abbas, Abul K. and Aster, Jon C.},
title = {Robbins and Cotran Pathologic Basis of Disease},
publisher = {Elsevier},
year = {2021},
edition = {10},
address = {Philadelphia, PA},
isbn = {978-0-323-53113-9}
}Raw lines 65 to 108@inproceedings - Conference Papers
For papers in conference proceedings.
Required fields:
author: Author namestitle: Paper titlebooktitle: Conference/proceedings nameyear: Year
Optional fields:
editor: Proceedings editor(s)volume: Volume numberseries: Series namepages: Page rangeaddress: Conference locationmonth: Conference monthorganization: Organizing bodypublisher: Publisherdoi: DOI
Template:
@inproceedings{CitationKey2024,
author = {Last, First},
title = {Paper Title},
booktitle = {Proceedings of Conference Name},
year = {2024},
pages = {123--145},
address = {City, Country},
month = jun
}Example:
@inproceedings{Vaswani2017,
author = {Vaswani, Ashish and Shazeer, Noam and Parmar, Niki and others},
title = {Attention is All You Need},
booktitle = {Advances in Neural Information Processing Systems 30 (NeurIPS 2017)},
year = {2017},
pages = {5998--6008},
address = {Long Beach, CA}
}Note: @conference is an alias for @inproceedings.
@incollection - Book Chapters
For chapters in edited books.
Required fields:
author: Chapter author(s)title: Chapter titlebooktitle: Book titlepublisher: Publisher nameyear: Publication year
Optional fields:
editor: Book editor(s)volume: Volume numberseries: Series nametype: Type of section (e.g., "chapter")chapter: Chapter numberpages: Page rangeaddress: Publisher locationedition: Editionmonth: Month
Template:
@incollection{CitationKey2024,
author = {Last, First},
title = {Chapter Title},
booktitle = {Book Title},
editor = {Editor, Last and Editor2, Last},
publisher = {Publisher Name},
year = {2024},
pages = {123--145},
chapter = {5}
}Example:
@incollection{Brown2020,
author = {Brown, Peter O. and Botstein, David},
title = {Exploring the New World of the Genome with {DNA} Microarrays},
booktitle = {DNA Microarrays: A Molecular Cloning Manual},
editor = {Eisen, Michael B. and Brown, Patrick O.},
publisher = {Cold Spring Harbor Laboratory Press},
year = {2020},
pages = {1--45},
address = {Cold Spring Harbor, NY}
}Raw lines 157 to 206@phdthesis - Doctoral Dissertations
For PhD dissertations and theses.
Required fields:
author: Author nametitle: Thesis titleschool: Institutionyear: Year
Optional fields:
type: Type (e.g., "PhD dissertation", "PhD thesis")address: Institution locationmonth: Monthurl: URLnote: Additional notes
Template:
@phdthesis{CitationKey2024,
author = {Last, First},
title = {Dissertation Title},
school = {University Name},
year = {2024},
type = {{PhD} dissertation},
address = {City, State}
}Example:
@phdthesis{Johnson2023,
author = {Johnson, Mary L.},
title = {Novel Approaches to Cancer Immunotherapy Using {CRISPR} Technology},
school = {Stanford University},
year = {2023},
type = {{PhD} dissertation},
address = {Stanford, CA}
}Note: @mastersthesis is similar but for Master's theses.
@mastersthesis - Master's Theses
For Master's theses.
Required fields:
author: Author nametitle: Thesis titleschool: Institutionyear: Year
Template:
@mastersthesis{CitationKey2024,
author = {Last, First},
title = {Thesis Title},
school = {University Name},
year = {2024}
}Raw lines 250 to 269@misc - Miscellaneous
For items that don't fit other categories (preprints, datasets, software, websites, etc.).
Required fields:
author(if known)titleyear
Optional fields:
howpublished: Repository, website, formaturl: URLdoi: DOInote: Additional informationmonth: Month
Template for preprints:
@misc{CitationKey2024,
author = {Last, First},
title = {Preprint Title},
year = {2024},
howpublished = {bioRxiv},
doi = {10.1101/2024.01.01.123456},
note = {Preprint}
}Template for datasets:
@misc{DatasetName2024,
author = {Last, First},
title = {Dataset Title},
year = {2024},
howpublished = {Zenodo},
doi = {10.5281/zenodo.123456},
note = {Version 1.2}
}Template for software:
@misc{SoftwareName2024,
author = {Last, First},
title = {Software Name},
year = {2024},
howpublished = {GitHub},
url = {https://github.com/user/repo},
note = {Version 2.0}
}Raw lines 270 to 321@techreport - Technical Reports
For technical reports.
Required fields:
author: Author name(s)title: Report titleinstitution: Institutionyear: Year
Optional fields:
type: Type of reportnumber: Report numberaddress: Institution locationmonth: Month
Template:
@techreport{CitationKey2024,
author = {Last, First},
title = {Report Title},
institution = {Institution Name},
year = {2024},
type = {Technical Report},
number = {TR-2024-01}
}Raw lines 322 to 349@unpublished - Unpublished Work
For unpublished works (not preprints - use @misc for those).
Required fields:
author: Author name(s)title: Work titlenote: Description
Optional fields:
month: Monthyear: Year
Template:
@unpublished{CitationKey2024,
author = {Last, First},
title = {Work Title},
note = {Unpublished manuscript},
year = {2024}
}Raw lines 350 to 372@online/@electronic - Online Resources
For web pages and online-only content.
Note: Not standard BibTeX, but supported by many bibliography packages (biblatex).
Required fields:
authorORorganizationtitleurlyear
Template:
@online{CitationKey2024,
author = {{Organization Name}},
title = {Page Title},
url = {https://example.com/page},
year = {2024},
note = {Accessed: 2024-01-15}
}Raw lines 373 to 395Formatting Rules
Raw lines 396 to 397Citation Keys
Convention: FirstAuthorYEARkeyword
Examples:
Smith2024protein
Doe2023machine
JohnsonWilliams2024cancer % Multiple authors, no space
NatureEditorial2024 % No author, use publication
WHO2024guidelines % Organization authorRules:
- Alphanumeric plus:
-,_,.,: - No spaces
- Case-sensitive
- Unique within file
- Descriptive
Avoid:
- Special characters:
@,#,&,%,$ - Spaces: use CamelCase or underscores
- Starting with numbers:
2024Smith(some systems disallow)
Author Names
Recommended format: Last, First Middle
Single author:
author = {Smith, John}
author = {Smith, John A.}
author = {Smith, John Andrew}Multiple authors - separate with and:
author = {Smith, John and Doe, Jane}
author = {Smith, John A. and Doe, Jane M. and Johnson, Mary L.}Many authors (10+):
author = {Smith, John and Doe, Jane and Johnson, Mary and others}Special cases:
% Suffix (Jr., III, etc.)
author = {King, Jr., Martin Luther}
% Organization as author
author = {{World Health Organization}}
% Note: Double braces keep as single entity
% Multiple surnames
author = {Garc{\'i}a-Mart{\'i}nez, Jos{\'e}}
% Particles (van, von, de, etc.)
author = {van der Waals, Johannes}
author = {de Broglie, Louis}Wrong formats (don't use):
author = {Smith, J.; Doe, J.} % Semicolons (wrong)
author = {Smith, J., Doe, J.} % Commas (wrong)
author = {Smith, J. & Doe, J.} % Ampersand (wrong)
author = {Smith J} % No commaRaw lines 423 to 469Title Capitalization
Protect capitalization with braces:
% Proper nouns, acronyms, formulas
title = {{AlphaFold}: Protein Structure Prediction}
title = {Machine Learning for {DNA} Sequencing}
title = {The {Ising} Model in Statistical Physics}
title = {{CRISPR-Cas9} Gene Editing Technology}Reason: Citation styles may change capitalization. Braces protect.
Examples:
% Good
title = {Advances in {COVID-19} Treatment}
title = {Using {Python} for Data Analysis}
title = {The {AlphaFold} Protein Structure Database}
% Will be lowercase in title case styles
title = {Advances in COVID-19 Treatment} % covid-19
title = {Using Python for Data Analysis} % pythonWhole title protection (rarely needed):
title = {{This Entire Title Keeps Its Capitalization}}Raw lines 470 to 500Page Ranges
Use en-dash (double hyphen --):
pages = {123--145} % Correct
pages = {1234--1256} % Correct
pages = {e0123456} % Article ID (PLOS, etc.)
pages = {123} % Single pageWrong:
pages = {123-145} % Single hyphen (don't use)
pages = {pp. 123-145} % "pp." not needed
pages = {123–145} % Unicode en-dash (may cause issues)Raw lines 501 to 518Month Names
Use three-letter abbreviations (unquoted):
month = jan
month = feb
month = mar
month = apr
month = may
month = jun
month = jul
month = aug
month = sep
month = oct
month = nov
month = decOr numeric:
month = {1} % January
month = {12} % DecemberOr full name in braces:
month = {January}Standard abbreviations work without quotes because they're defined in BibTeX.
Raw lines 519 to 550Journal Names
Full name (not abbreviated):
journal = {Nature}
journal = {Science}
journal = {Cell}
journal = {Proceedings of the National Academy of Sciences}
journal = {Journal of the American Chemical Society}Bibliography style will handle abbreviation if needed.
Avoid manual abbreviation:
% Don't do this in BibTeX file
journal = {Proc. Natl. Acad. Sci. U.S.A.}
% Do this instead
journal = {Proceedings of the National Academy of Sciences}Exception: If style requires abbreviations, use full abbreviated form:
journal = {Proc. Natl. Acad. Sci. U.S.A.} % If required by styleRaw lines 551 to 578DOI Formatting
Bare identifier in the doi field:
doi = {10.1038/s41586-021-03819-2}Not:
doi = {https://doi.org/10.1038/s41586-021-03819-2} % Don't include URL
doi = {doi:10.1038/s41586-021-03819-2} % Don't include prefixLaTeX will format as URL automatically.
Note: No period after DOI field!
Raw lines 579 to 596URL Formatting
url = {https://www.example.com/article}Use:
- When DOI not available
- For web pages
- For supplementary materials
Don't duplicate:
% Don't include both if DOI URL is same as url
doi = {10.1038/nature12345}
url = {https://doi.org/10.1038/nature12345} % Redundant!Raw lines 597 to 614Special Characters
Accents and diacritics:
author = {M{\"u}ller, Hans} % ü
author = {Garc{\'i}a, Jos{\'e}} % í, é
author = {Erd{\H{o}}s, Paul} % ő
author = {Schr{\"o}dinger, Erwin} % öOr use UTF-8 (with proper LaTeX setup):
author = {Müller, Hans}
author = {García, José}Mathematical symbols:
title = {The $\alpha$-helix Structure}
title = {$\beta$-sheet Prediction}Chemical formulas:
title = {H$_2$O Molecular Dynamics}
% Or with chemformula package:
title = {\ce{H2O} Molecular Dynamics}Raw lines 615 to 643Field Order
Recommended order (for readability):
@article{Key,
author = {},
title = {},
journal = {},
year = {},
volume = {},
number = {},
pages = {},
doi = {},
url = {},
note = {}
}Rules:
- Most important fields first
- Consistent across entries
- Use formatter to standardize
Best Practices
Raw lines 668 to 6691. Consistent Formatting
Use same format throughout:
- Author name format
- Title capitalization
- Journal names
- Citation key style
2. Required Fields
Always include:
- All required fields for entry type
- DOI when assigned, regardless of publication year
- Volume and pages or article number when assigned
- Publisher for books
3. Protect Capitalization
Use braces for:
- Proper nouns:
{AlphaFold} - Acronyms:
{DNA},{CRISPR} - Formulas:
{H2O} - Names:
{Python},{R}
4. Complete Author Lists
Include all authors when possible:
- Preserve the full verified author list
- Let the bibliography style truncate the display when required
- Don't abbreviate to "et al." manually
5. Use Standard Entry Types
Choose correct entry type:
- Journal article →
@article - Book →
@book - Conference paper →
@inproceedings - Preprint →
@misc
6. Validate Syntax
Check for:
- Balanced braces
- Commas after fields
- Unique citation keys
- Valid entry types
7. Use Formatters
Use automated tools:
python scripts/format_bibtex.py references.bibBenefits:
- Consistent formatting
- Catch syntax errors
- Standardize field order
- Fix common issues
Common Mistakes
Raw lines 730 to 7311. Wrong Author Separator
Wrong:
author = {Smith, J.; Doe, J.} % Semicolon
author = {Smith, J., Doe, J.} % Comma
author = {Smith, J. & Doe, J.} % AmpersandCorrect:
author = {Smith, John and Doe, Jane}Raw lines 732 to 7452. Missing Commas
Wrong:
@article{Smith2024,
author = {Smith, John} % Missing comma!
title = {Title}
}Correct:
@article{Smith2024,
author = {Smith, John}, % Comma after each field
title = {Title}
}Raw lines 746 to 7633. Unprotected Capitalization
Wrong:
title = {Machine Learning with Python}
% "Python" will become "python" in title caseCorrect:
title = {Machine Learning with {Python}}Raw lines 764 to 7764. Single Hyphen in Pages
Wrong:
pages = {123-145} % Single hyphenCorrect:
pages = {123--145} % Double hyphen (en-dash)Raw lines 777 to 7885. Redundant "pp." in Pages
Wrong:
pages = {pp. 123--145}Correct:
pages = {123--145}Raw lines 789 to 8006. DOI with URL Prefix
Wrong:
doi = {https://doi.org/10.1038/nature12345}
doi = {doi:10.1038/nature12345}Correct:
doi = {10.1038/nature12345}Raw lines 801 to 813Example Complete Bibliography
% Journal article
@article{Jumper2021,
author = {Jumper, John and Evans, Richard and Pritzel, Alexander and others},
title = {Highly Accurate Protein Structure Prediction with {AlphaFold}},
journal = {Nature},
year = {2021},
volume = {596},
number = {7873},
pages = {583--589},
doi = {10.1038/s41586-021-03819-2}
}
% Book
@book{Kumar2021,
author = {Kumar, Vinay and Abbas, Abul K. and Aster, Jon C.},
title = {Robbins and Cotran Pathologic Basis of Disease},
publisher = {Elsevier},
year = {2021},
edition = {10},
address = {Philadelphia, PA},
isbn = {978-0-323-53113-9}
}
% Conference paper
@inproceedings{Vaswani2017,
author = {Vaswani, Ashish and Shazeer, Noam and Parmar, Niki and others},
title = {Attention is All You Need},
booktitle = {Advances in Neural Information Processing Systems 30 (NeurIPS 2017)},
year = {2017},
pages = {5998--6008}
}
% Book chapter
@incollection{Brown2020,
author = {Brown, Peter O. and Botstein, David},
title = {Exploring the New World of the Genome with {DNA} Microarrays},
booktitle = {DNA Microarrays: A Molecular Cloning Manual},
editor = {Eisen, Michael B. and Brown, Patrick O.},
publisher = {Cold Spring Harbor Laboratory Press},
year = {2020},
pages = {1--45}
}
% PhD thesis
@phdthesis{Johnson2023,
author = {Johnson, Mary L.},
title = {Novel Approaches to Cancer Immunotherapy},
school = {Stanford University},
year = {2023},
type = {{PhD} dissertation}
}
% Preprint
@misc{Zhang2024,
author = {Zhang, Yi and Chen, Li and Wang, Hui},
title = {Novel Therapeutic Targets in {Alzheimer}'s Disease},
year = {2024},
howpublished = {bioRxiv},
doi = {10.1101/2024.01.001},
note = {Preprint}
}
% Dataset
@misc{AlphaFoldDB2021,
author = {{DeepMind} and {EMBL-EBI}},
title = {{AlphaFold} Protein Structure Database},
year = {2021},
howpublished = {Database},
url = {https://alphafold.ebi.ac.uk/},
doi = {10.1093/nar/gkab1061}
}Raw lines 814 to 889Summary
BibTeX formatting essentials:
✓ Choose correct entry type (@article, @book, etc.) ✓ Include all required fields ✓ **Use and for multiple authors ✓ Protect capitalization with braces ✓ Use -- for page ranges ✓ Include DOI for modern papers ✓ Validate syntax** before compilation
Use formatting tools to ensure consistency:
python scripts/format_bibtex.py references.bibProperly formatted BibTeX ensures correct, consistent citations across all bibliography styles!
Raw lines 890 to 908