Write a .bib file in LaTeX (entry types and fields)

A .bib file is a text file with one entry per source. Each entry has a type such as @article, a key that you use in \cite, and a list of fields in the form name = {value}.

The parts of an entry

The key follows the opening brace; it has to be unique and contains no spaces or commas. The fields are separated by commas. Several authors are joined with the word and, each written as Last, First. A page range uses two hyphens.

@article{weber2019,
  author  = {Weber, Ben and Schmidt, Anna},
  title   = {Ultrasonic Sensors in Wind Tunnels},
  journal = {Journal of Example Studies},
  volume  = {12},
  number  = {3},
  pages   = {45--67},
  year    = {2019}
}

Common entry types

@book needs author or editor, title, publisher and year. @inproceedings is a paper in conference proceedings, with the title of the volume in booktitle. @mastersthesis and @phdthesis name the university in school. @online is for web pages, with url and the date of access in urldate. @incollection (a chapter in an edited book), @techreport and @misc follow the same pattern.

@book{schmidt2021,
  author    = {Schmidt, Anna},
  title     = {Wind Measurement in Practice},
  edition   = {2},
  publisher = {Example Press},
  address   = {Berlin},
  year      = {2021}
}

@inproceedings{keller2022,
  author    = {Keller, Mia and Weber, Ben},
  title     = {Filtering Noisy Wind Data},
  booktitle = {Proceedings of the 5th Example Conference on Sensors},
  pages     = {101--110},
  publisher = {Example Press},
  year      = {2022}
}

@mastersthesis{mueller2020,
  author = {Müller, Jörg},
  title  = {Kalibrierung von {Ultraschallsensoren}},
  school = {Example University},
  year   = {2020}
}

@online{keller2023,
  author  = {Keller, Mia},
  title   = {Calibrating a Wind Sensor},
  year    = {2023},
  url     = {https://www.example.org/calibration},
  urldate = {2025-03-01}
}

Organisations, long author lists and capitals

A second pair of braces around an organisation keeps its name from being split into first and last name. and others at the end of the author list becomes "et al.". Braces around a word in the title, as in {Doppler}, protect its capital letter in styles that turn titles into lower case.

@misc{committee2017,
  author = {{International Example Committee}},
  title  = {A Guideline for {Doppler} Wind Sensors},
  year   = {2017}
}

@article{weber2023,
  author  = {Weber, Ben and Schmidt, Anna and Keller, Mia and others},
  title   = {Wind Tunnel Tests at 20 m/s},
  journal = {Journal of Example Studies},
  volume  = {16},
  pages   = {3--19},
  year    = {2023}
}

Check the file

A short document with \nocite{*} prints every entry of the file, which shows typing errors at once.

Complete document:

\documentclass{article}
\usepackage[style=authoryear]{biblatex}
\addbibresource{references.bib}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
Result
The compiled example

Open in the editor

File references.bib:

@article{weber2019,
  author  = {Weber, Ben and Schmidt, Anna},
  title   = {Ultrasonic Sensors in Wind Tunnels},
  journal = {Journal of Example Studies},
  volume  = {12},
  number  = {3},
  pages   = {45--67},
  year    = {2019}
}

@book{schmidt2021,
  author    = {Schmidt, Anna},
  title     = {Wind Measurement in Practice},
  edition   = {2},
  publisher = {Example Press},
  address   = {Berlin},
  year      = {2021}
}

@inproceedings{keller2022,
  author    = {Keller, Mia and Weber, Ben},
  title     = {Filtering Noisy Wind Data},
  booktitle = {Proceedings of the 5th Example Conference on Sensors},
  pages     = {101--110},
  publisher = {Example Press},
  year      = {2022}
}

@mastersthesis{mueller2020,
  author = {Müller, Jörg},
  title  = {Kalibrierung von {Ultraschallsensoren}},
  school = {Example University},
  year   = {2020}
}

@online{keller2023,
  author  = {Keller, Mia},
  title   = {Calibrating a Wind Sensor},
  year    = {2023},
  url     = {https://www.example.org/calibration},
  urldate = {2025-03-01}
}

@misc{committee2017,
  author = {{International Example Committee}},
  title  = {A Guideline for {Doppler} Wind Sensors},
  year   = {2017}
}

@article{weber2023,
  author  = {Weber, Ben and Schmidt, Anna and Keller, Mia and others},
  title   = {Wind Tunnel Tests at 20 m/s},
  journal = {Journal of Example Studies},
  volume  = {16},
  pages   = {3--19},
  year    = {2023}
}

Pitfalls

Compiled with pdfLaTeX from TeX Live 2023.

Related pages