How to Cite in LaTeX

Put your references in a .bib file, cite them in the text with \cite{key}, and print the list with \bibliographystyle{plain} and \bibliography{refs} at the end. Compile LaTeX, BibTeX, then LaTeX twice; Overleaf does this for you. biblatex (\addbibresource{refs.bib} and \printbibliography) is the modern alternative.

Citation commands

  • \cite{einstein1905}
    Text mode, no math preview

    Cite one source: [1] or (Einstein, 1905) depending on style.

  • \cite{a, b, c}
    Text mode, no math preview

    Several sources in one bracket.

  • \cite[p.~12]{key}
    Text mode, no math preview

    Cite with a page number.

  • \citet{key} / \citep{key}
    Text mode, no math preview

    natbib: "Einstein (1905)" and "(Einstein, 1905)".

  • \bibliographystyle{plain} \bibliography{refs}
    Text mode, no math preview

    BibTeX: style and .bib file name (without extension).

  • \addbibresource{refs.bib} ... \printbibliography
    Text mode, no math preview

    biblatex: load the file, print the list.

Try it live

Change the formula and the preview redraws as you type. Copy the LaTeX, download a PNG or SVG, copy it for Word, or use Edit here on any example below to load it.

Templates

Citations examples

Each result below is drawn from the LaTeX under it. Copy the code, edit it on this page, or open it in the full editor.

  • A cited result in a formula

    E = m c 2 [ 1 ]
    LaTeX
    E = mc^2 \quad [1]
  • Formula with an author-year note

    β ^ = ( X ⊤ X ) − 1 X ⊤ y (Gauss, 1809)
    LaTeX
    \hat{\beta} = (X^\top X)^{-1} X^\top y \quad \text{(Gauss, 1809)}

In a LaTeX document

These commands work in the text of a .tex document (Overleaf, TeX Live, MiKTeX), not inside math. The box on the right shows what the compiled PDF looks like.

  • refs.bib entry

    LaTeX
    @article{einstein1905,
      author  = {Einstein, Albert},
      title   = {Zur Elektrodynamik bewegter K{\"o}rper},
      journal = {Annalen der Physik},
      volume  = {17},
      pages   = {891--921},
      year    = {1905}
    }
  • Citing with BibTeX

    LaTeX
    Special relativity \cite{einstein1905} changed physics.
    
    \bibliographystyle{plain}
    \bibliography{refs}
    Compiled result

    Special relativity [1] changed physics.

    References

    [1] Albert Einstein. Zur Elektrodynamik bewegter Körper. Annalen der Physik, 17:891–921, 1905.

  • biblatex with an author-year style

    LaTeX
    \usepackage[style=authoryear]{biblatex}
    \addbibresource{refs.bib}
    ...
    As \textcite{einstein1905} showed ...
    \printbibliography
    Compiled result

    As Einstein (1905) showed ...

BibTeX or biblatex

BibTeX with \bibliographystyle is what most journal templates still use; the template usually fixes the style, so you only write \cite. biblatex (with the biber program) handles Unicode, many citation styles (APA with style=apa) and multiple bibliographies more easily. Do not mix the two in one document.

Citing a website and fixing [?]

For a web page use @misc with howpublished = {\url{https://…}} and a note = {Accessed 2026-10-01}, or @online with url and urldate in biblatex.

[?] or "Citation undefined" means the bibliography has not been processed yet or the key does not match. Check the key spelling, then compile LaTeX, BibTeX (or biber) and LaTeX twice. Entries you never cite are not printed unless you add \nocite{*}.

Common mistakes

  • With BibTeX give the file name without the .bib extension.

    Instead of
    \bibliography{refs.bib}
    Write
    \bibliography{refs}
  • Keys are case-sensitive; a mismatch prints [?].

    Instead of
    \cite{Einstein1905}  (key einstein1905)
    Write
    \cite{einstein1905}
  • Many styles lower-case titles; braces protect capitals.

    Instead of
    title = {The DNA of e. coli}
    Write
    title = {The {DNA} of {E. coli}}

In Overleaf, MathJax and Word

  • Overleaf and pdfLaTeX

    Overleaf runs BibTeX or biber automatically. Upload or create refs.bib in the project; Zotero and Mendeley can sync to it.

  • MathJax and KaTeX

    Web math renderers have no citations; cite in the surrounding HTML or Markdown.

  • Microsoft Word

    In Word use References › Insert Citation, or a reference manager plugin (Zotero, Mendeley, EndNote).

Already have the whole document?

Move complete papers between PDF, Word and LaTeX without retyping; every equation stays editable.

Single printed formulas are free: 3 a day without an account, 6 with a free account. New accounts get 30 credits to try handwriting, pages and documents; failed conversions return their credits. See plans and credit prices.

Citations in LaTeX: questions

How do I cite in LaTeX?
Add the source to a .bib file, write \cite{key} in the text and \bibliography{file} at the end.
Why do my citations show [?]?
The bibliography has not been run or the key is wrong. Compile LaTeX, BibTeX, LaTeX, LaTeX.
How do I use APA style?
With biblatex: \usepackage[style=apa]{biblatex}; with BibTeX, use the apacite package and its style.
How do I cite a website?
Use @misc with howpublished = {\url{…}}, or @online with url and urldate in biblatex.

Have the formula as a picture?

Paste a screenshot or photo of the equation and get its LaTeX, ready to copy or open in the editor.

Convert an image to LaTeX