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
- Text mode, no math preview
\cite{einstein1905}Cite one source: [1] or (Einstein, 1905) depending on style.
- Text mode, no math preview
\cite{a, b, c}Several sources in one bracket.
- Text mode, no math preview
\cite[p.~12]{key}Cite with a page number.
- Text mode, no math preview
\citet{key} / \citep{key}natbib: "Einstein (1905)" and "(Einstein, 1905)".
- Text mode, no math preview
\bibliographystyle{plain} \bibliography{refs}BibTeX: style and .bib file name (without extension).
- Text mode, no math preview
\addbibresource{refs.bib} ... \printbibliographybiblatex: 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.
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
LaTeXE = mc^2 \quad [1]Formula with an author-year note
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
LaTeXSpecial relativity \cite{einstein1905} changed physics. \bibliographystyle{plain} \bibliography{refs}Compiled resultSpecial 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 ... \printbibliographyCompiled resultAs 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 oftitle = {The DNA of e. coli}Writetitle = {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.
- PDF to LaTeXTurn a paper or textbook PDF into a .tex project with every equation.10 credits per page
- Word to LaTeXA .docx with Word equations becomes LaTeX ready for Overleaf.10 credits per page
- LaTeX to WordA whole .tex file becomes a .docx whose equations open in Word.5 credits per file
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
@miscwithhowpublished = {\url{…}}, or@onlinewithurlandurldatein biblatex.
Related LaTeX reference
- How to Add a Hyperlink in LaTeXhyperref's \href for linked text, \url for printed addresses, internal links to sections and figures, and link colors.
- How to Insert an Image in LaTeXgraphicx, \includegraphics with width, figure placement, captions, labels and side-by-side images.
- How to Write Code in LaTeXInline code with \verb, code blocks with verbatim, listings and minted, line numbers, colors and code from files.
- LaTeX equation editorSymbol panel, live preview, and PNG, SVG, MathML or Word export.
- All LaTeX reference pagesSymbols, math structures and text formatting in one list.
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