.bib file, cite their keys in your document with \cite{...}, and place \bibliographystyle{...} and \bibliography{...} where the reference list should appear. Use BibTeX when a journal template, publisher, or existing project requires .bst styles; for new projects that need native UTF-8 sorting or finer formatting options, use BibLaTeX with Biber.
Step 1: Create a .bib file and print a reference list
Put your bibliography entries in a file such as references.bib in the same project as your .tex file. Each entry begins with an entry type (such as @book or @article) and a unique citation key (rivera2023, chen2021).
In main.tex, cite entries with \cite{key} and print the reference list at the end with \bibliographystyle{plain} and \bibliography{references}. Omit the .bib extension inside \bibliography{...}. To load more than one .bib file, list their base names separated by commas, such as \bibliography{books,articles}.
main.tex
references.bib
Ready to use this syntax? Continue in the browser editor when you want to adapt the example in a real project.Open LaTeX Cloud Studio
The plain style sorts the reference list alphabetically by the first author’s surname and assigns bracketed numbers ([1], [2]). To compare other BibTeX styles such as unsrt, alpha, abbrv, ieeetr, and apalike with compiled previews, see Choosing citation styles.
Compiling your bibliography
Locally on the command line, BibTeX requires a multi-pass build because LaTeX writes cited keys into an.aux file, BibTeX formats the matching entries into a .bbl file, and subsequent LaTeX passes insert the bibliography and resolve labels:
.bst styles are preinstalled. Upload or create references.bib in the project; during a full editor compile, LaTeX Cloud Studio runs latexmk and invokes BibTeX when the document needs a bibliography pass.
If citations appear as [?] or the reference list stays empty, see Fix bibliography build errors.
Step 2: Cite multiple sources, add page notes, and list uncited entries
You can pass several keys in one\cite command separated by commas (\cite{rivera2023,chen2021}). Base LaTeX’s \cite accepts one optional argument in square brackets, which appends a note such as a page number after the citation label (\cite[p.~14]{rivera2023}). Base \cite does not take a second optional argument for a prefix; for prenotes such as see or author-year citations like Rivera and Bowen (2023), use natbib or BibLaTeX.
BibTeX only prints entries that are cited in the text. To include a source in the reference list without citing it inline, add \nocite{agency2025} (or \nocite{*} to list every entry in the .bib file).
citations.tex
references.bib
Step 3: Write @misc entries, corporate authors, and protected capitals
Classic BibTeX does not define a separate @online or @website type; standard styles fall back to @misc for websites, datasets, and online reports. Two things are commonly called the “@misc key”:
- The citation key sits right after
@misc{(for example,archive2024). You pass this identifier to\cite{archive2024}. - The
keyfield (key = {River Survey Archive}) is an optional fallback field inside the entry. When an entry has noauthororeditor,plainandabbrvsort the entry usingkeyinstead of issuing a missing-sort-key warning, without printing thekeytext itself in the bibliography.
.bib rules prevent broken formatting in standard styles:
- Corporate authors: wrap an organization name in double braces (
author = {{Example Water Agency}}) so BibTeX treats it as a single name rather than taking the last word as the surname (without the inner braces,plainsorts the entry under “Agency” andabbrvprints “E. W. Agency”). - Capitalization in titles: standard styles such as
plainconvert non-initial words in article and@misctitles to lowercase. Wrap acronyms or proper nouns in inner braces ({GIS}) to keep their letter case.
\usepackage{url} (or hyperref) when a howpublished or note field contains \url{...}, because base LaTeX does not define \url and the compile stops with Undefined control sequence.
misc-entries.tex
references.bib
Standard BibTeX entry types
The table below lists the entry types defined by BibTeX’s standard styles (plain, unsrt, alpha, abbrv) and the fields they check as required.
When writing entries by hand or cleaning up exports from a reference manager:
- Separate multiple authors with
and(Rivera, Maya and Bowen, Sam), never commas or&. - Use an en-dash (
--) for page ranges (pages = {31--45}). - Use consistent, ASCII citation keys such as
surname2023orsurname2023topic, and keep every key unique across your.bibfiles. Classic BibTeX matches a single citation key spelling case-insensitively, but citing the same entry with two different capitalizations in one document triggers a case mismatch error.
BibTeX vs. BibLaTeX
- Stay with BibTeX (optionally paired with natbib for author-year citations) when a journal class or university template supplies a
.bststyle file. - Use BibLaTeX with Biber for new documents where you want UTF-8 author names, native
@onlineentries, or package-level options such asmaxcitenames.
Related guides
- Choosing citation styles
- Natbib guide
- BibLaTeX guide
- Fix bibliography build errors
- Cross-referencing
main.tex with the complete example, and add references.bib to the project.