No Search Results
- Bibliography management with bibtex
- 1 Advisory note
- 2 Introduction
- 3.1 A note on compilation times
- 4.1 Some notes on using \(\mathrm{Bib\TeX}\) and .bib files
- 5.1 Multiple authors in \(\mathrm{Bib\TeX}\)
- 5.2 Multiple-word last names
- 5.3 I tried to use % to comment out some lines or entries in my .bib file, but I got lots of error messages instead?
- 6.1 Edit the .bib file as plain text
- 6.2 Help from GUI-based .bib editors
- 6.3 Export from reference library services
- 6.4 I’ve already got a reference list in a Microsoft Word/HTML/PDF file; can I somehow reuse the data without re-typing everything?
- 7.1 Further reading

Advisory note
If you are starting from scratch we recommend using biblatex because that package provides localization in several languages, it’s actively developed and makes bibliography management easier and more flexible.
Introduction
Many tutorials have been written about what \(\mathrm{Bib\TeX}\) is and how to use it . However, based on our experience of providing support to Overleaf’s users, it’s still one of the topics that many newcomers to \(\mathrm{\LaTeX}\) find complicated—especially when things don’t go quite right; for example: citations aren’t appearing; problems with authors’ names; not sorted to a required order; URLs not displayed in the references list, and so forth.
In this article we’ll pull together all the threads relating to citations, references and bibliographies, as well as how Overleaf and related tools can help users manage these.
We’ll start with a quick recap of how \(\mathrm{Bib\TeX}\) and bibliography database ( .bib ) files work and look at some ways to prepare .bib files. This is, of course, running the risk of repeating some of the material contained in many online tutorials, but future articles will expand our coverage to include bibliography styles and biblatex —the alternative package and bibliography processor.
Bibliography: just a list of \bibitems
Let’s first take a quick look “under the hood” to see what a \(\mathrm{\LaTeX}\) reference list is comprised of—please don’t start coding your reference list like this because later in this article we’ll look at other, more convenient, ways to do this.
A reference list really just a thebibliography list of \bibitems :
By default, this thebibliography environment is a numbered list with labels [1] , [2] and so forth. If the document class used is article , \begin{thebibliography} automatically inserts a numberless section heading with \refname (default value: References ). If the document class is book or report, then a numberless chapter heading with \bibname (default value: Bibliography ) is inserted instead. Each \bibitem takes a cite key as its parameter, which you can use with \cite commands, followed by information about the reference entry itself. So if you now write
together with the thebibliography block from before, this is what gets rendered into your PDF when you run a \(\mathrm{\LaTeX}\) processor (i.e. any of latex , pdflatex , xelatex or lualatex ) on your source file:

Figure 1: Citing entries from a thebibliography list.
Notice how each \bibitem is automatically numbered, and how \cite then inserts the corresponding numerical label.
\begin{thebibliography} takes a numerical argument: the widest label expected in the list. In this example we only have two entries, so 9 is enough. If you have more than ten entries, though, you may notice that the numerical labels in the list start to get misaligned:

Figure 2: thebibliography with a label that’s too short.
We’ll have to make it \begin{thebibliography}{99} instead, so that the longest label is wide enough to accommodate the longer labels, like this:

Figure 3: thebibliography with a longer label width.
If you compile this example code snippet on a local computer you may notice that after the first time you run pdflatex (or another \(\mathrm{\LaTeX}\) processor), the reference list appears in the PDF as expected, but the \cite commands just show up as question marks [?] .
This is because after the first \(\mathrm{\LaTeX}\) run the cite keys from each \bibitem ( texbook , lamport94 ) are written to the .aux file and are not yet available for reading by the \cite commands. Only on the second run of pdflatex are the \cite commands able to look up each cite key from the .aux file and insert the corresponding labels ( [1] , [2] ) into the output.
On Overleaf, though, you don’t have to worry about re-running pdflatex yourself. This is because Overleaf uses the latexmk build tool , which automatically re-runs pdflatex (and some other processors) for the requisite number of times needed to resolve \cite outputs. This also accounts for other cross-referencing commands, such as \ref and \tableofcontents .
A note on compilation times
Processing \(\mathrm{\LaTeX}\) reference lists or other forms of cross-referencing, such as indexes, requires multiple runs of software—including the \(\mathrm{\TeX}\) engine (e.g., pdflatex ) and associated programs such as \(\mathrm{Bib\TeX}\), makeindex , etc. As mentioned above, Overleaf handles all of these mulitple runs automatically, so you don’t have to worry about them. As a consequence, when the preview on Overleaf is refreshing for documents with bibliographies (or other cross-referencing), or for documents with large image files (as discussed separately here ), these essential compilation steps may sometimes make the preview refresh appear to take longer than on your own machine. We do, of course, aim to keep it as short as possible! If you feel your document is taking longer to compile than you’d expect, here are some further tips that may help.
Enter \(\mathrm{Bib\TeX}\)
There are, of course, some inconveniences with manually preparing the thebibliography list:
- It’s up to you to accurately format each \bibitem based on the reference style you’re asked to use—which bits should be in bold or italic? Should the year come immediately after the authors, or at the end of the entry? Given names first, or last names first?
- If you’re writing for a reference style which requires the reference list to be sorted by the last names of first authors, you’ll need to sort the \bibitem s yourself.
- For different manuscripts or documents that use different reference styles you’ll need to rewrite the \bibitem for each reference.
This is where \(\mathrm{Bib\TeX}\) and bibliography database files ( .bib files) are extremely useful, and this is the recommended approach to manage citations and references in most journals and theses. The biblatex approach, which is slightly different and gaining popularity, also requires a .bib file but we’ll talk about biblatex in a future post.
Instead of formatting cited reference entries in a thebibliography list, we maintain a bibliography database file (let’s name it refs.bib for our example) which contains format-independent information about our references. So our refs.bib file may look like this:
You can find more information about other \(\mathrm{Bib\TeX}\) reference entry types and fields here —there’s a huge table showing which fields are supported for which entry types. We’ll talk more about how to prepare .bib files in a later section.
Now we can use \cite with the cite keys as before, but now we replace thebibliography with a \bibliographystyle{...} to choose the reference style, as well as \bibliography{...} to point \(\mathrm{Bib\TeX}\) at the .bib file where the cited references should be looked-up.
This is processed with the following sequence of commands, assuming our \(\mathrm{\LaTeX}\) document is in a file named main.tex (and that we are using pdflatex ):
- pdflatex main
- bibtex main
and we get the following output:

Figure 4: \(\mathrm{Bib\TeX}\) output using the plain bibliography style.
Whoah! What’s going on here and why are all those (repeated) processes required? Well, here’s what happens.
During the first pdflatex run, all pdflatex sees is a \bibliographystyle{...} and a \bibliography{...} from main.tex . It doesn’t know what all the \cite{...} commands are about! Consequently, within the output PDF, all the \cite{...} commands are simply rendered as [?], and no reference list appears, for now. But pdflatex writes information about the bibliography style and .bib file, as well as all occurrences of \cite{...} , to the file main.aux .
It’s actually main.aux that \(\mathrm{Bib\TeX}\) is interested in! It notes the .bib file indicated by \bibliography{...} , then looks up all the entries with keys that match the \cite{...} commands used in the .tex file. \(\mathrm{Bib\TeX}\) then uses the style specified with \bibliographystyle{...} to format the cited entries, and writes a formatted thebibliography list into the file main.bbl . The production of the .bbl file is all that’s achieved in this step; no changes are made to the output PDF.
When pdflatex is run again, it now sees that a main.bbl file is available! So it inserts the contents of main.bbl i.e. the \begin{thebibliography}....\end{thebibliography} into the \(\mathrm{\LaTeX}\) source, where \bibliography{...} is. After this step, the reference list appears in the output PDF formatted according to the chosen \bibliographystyle{...} , but the in-text citations are still [?].
pdflatex is run again, and this time the \cite{...} commands are replaced with the corresponding numerical labels in the output PDF!
As before, the latexmk build tool takes care of triggering and re-running pdflatex and bibtex as necessary, so you don’t have to worry about this bit.
Some notes on using \(\mathrm{Bib\TeX}\) and .bib files
A few further things to note about using \(\mathrm{Bib\TeX}\) and .bib files :
- You may have noticed that although refs.bib contained five \(\mathrm{Bib\TeX}\) reference entries, only two are included in the reference list in the output PDF. This is an important point about \(\mathrm{Bib\TeX}\): the .bib file’s role is to store bibliographic records, and only entries that have been cited (via \cite{...} ) in the .tex files will appear in the reference list. This is similar to how only cited items from an EndNote database will be displayed in the reference list in a Microsoft Word document. If you do want to include all entries—to be displayed but without actually citing all of them—you can write \nocite{*} . This also means you can reuse the same .bib file for all your \(\mathrm{\LaTeX}\) projects: entries that are not cited in a particular manuscript or report will be excluded from the reference list in that document.
- \(\mathrm{Bib\TeX}\) requires one \bibliographystyle{...} and one \bibliography{...} to function correctly—in future posts we’ll see how to create multiple bibliographies in the same document. If you keep getting “undefined citation” warnings, check that you have indeed included those two commands, and that the names are spelled correctly. File extensions are not usually required, but bear in mind that file names are case sensitive on some operating systems—including on Overleaf! Therefore, if you typed \bibliographystyle{IEEetran} (note the typo: “e”) instead of \bibliographystyle{IEEEtran} , or wrote \bibliography{refs} when the actual file name is Refs.bib , you’ll get the dreaded [?] as citations.
- In the same vein, treat your cite keys as case-sensitive, always. Use the exact same case or spelling in your \cite{...} as in your .bib file.
- The order of references in the .bib file does not have any effect on how the reference list is ordered in the output PDF: the sorting order of the reference list is determined by the \bibliographystyle{...} . For example, some readers might have noticed that, within my earlier example, the first citation in the text latex2e is numbered [2], while the second citation in the text ( texbook ) is numbered [1]! Have \(\mathrm{\LaTeX}\) and \(\mathrm{Bib\TeX}\) lost the plot? Not at all: this is actually because the plain style sorts the reference list by alphabetical order of the first author’s last name . If you prefer a scheme where the numerical citation labels are numbered sequentially throughout the text, you’ll have to choose a bibliography style which implements this. For example, if instead we had used \bibliographystyle{IEEEtran} for that example, we’d get the following output. Notice also how the formatting of each cited item in the reference list has automatically updated to suit the IEEE’s style:

Figure 5: IEEEtran bibliography style output.
We’ll talk more about different bibliography styles, including author–year citation schemes, in a future article. For now, let’s turn our attention to .bib file contents, and how we can make the task of preparing .bib files a bit easier.
Taking another look at .bib files
As you may have noticed earlier, a .bib file contains \(\mathrm{Bib\TeX}\) bibliography entries that start with an entry type prefixed with an @ . Each entry has a some key–value \(\mathrm{Bib\TeX}\) fields , placed within a pair of braces ( {...} ). The cite key is the first piece of information given within these braces, and every field in the entry must be separated by a comma :
As a general rule, every bibliography entry should have an author , year and title field, no matter what the type is. There are about a dozen entry types although some bibliography styles may recognise/define more; however, it is likely that you will most frequently use the following entry types:
- @article for journal articles (see example above).
- @inproceedings for conference proceeding articles:
- @book for books (see examples above).
- @phdthesis , @masterthesis for dissertations and theses:
- @inbook is for a book chapter where the entire book was written by the same author(s): the chapter of interest is identified by a chapter number:
- @incollection is for a contributed chapter in a book, so would have its own author and title . The actual title of the entire book is given in the booktitle field; it is likely that an editor field will also be present:
- you will often find it useful to add \usepackage{url} or \usepackage{hyperref} in your .tex files’ preamble (for more robust handling of URLs);
- not all bibliography styles support the url field: plain doesn’t, but IEEEtran does. All styles support note . More on this in a future post;
- you should be mindful that even web pages and @misc entries should have an author , a year and a title field:
Multiple authors in \(\mathrm{Bib\TeX}\)
In a .bib file, commas are only used to separate the last name from the first name of an author—if the last name is written first. Individual author names are separated by and . So these are correct:
But none of the following will work correctly —you’ll get weird output, or even error messages from \(\mathrm{Bib\TeX}\)! So take extra care if you are copying author names from a paper or from a web page.
Multiple-word last names
If an author’s last name is made up of multiple words separated by spaces, or if it’s actually an organisation, place an extra pair of braces around the last name so that \(\mathrm{Bib\TeX}\) will recognise the grouped words as the last name:
Alternatively, you can use the Lastname, Firstname format; some users find that clearer and more readable:
Remember: Whether the first or last name appears first in the output (“John Doe” vs “Doe, John”), or whether the first name is automatically abbreviated “J. Doe” or “Doe, J.” vs “John Doe” “J. Doe”), all such details are controlled by the \bibliographystyle .
I tried to use % to comment out some lines or entries in my .bib file, but I got lots of error messages instead?
% is actually not a comment character in .bib files! So, inserting a % in .bib files not only fails to comment out the line, it also causes some \(\mathrm{Bib\TeX}\) errors. To get \(\mathrm{Bib\TeX}\) to ignore a particular field we just need to rename the field to something that \(\mathrm{Bib\TeX}\) doesn’t recognise. For example, if you want to keep a date field around but prefer that it’s ignored (perhaps because you want \(\mathrm{Bib\TeX}\) to use the year field instead) write Tdate = {...} or the more human-readable IGNOREdate = {...} .
To get \(\mathrm{Bib\TeX}\) to ignore an entire entry you can remove the @ before the entry type. A valid reference entry always starts with a @ followed by the entry type; without the @ character \(\mathrm{Bib\TeX}\) skips the lines until it encounters another @ .
How/where do I actually get those .bib files?
Edit the .bib file as plain text.
Because .bib files are plain text you can certainly write them by hand—once you’re familiar with \(\mathrm{Bib\TeX}\)’s required syntax. Just make sure that you save it with a .bib extension, and that your editor doesn’t surreptitiously add a .txt or some other suffix. On Overleaf you can click on the “Files…” link at the top of the file list panel, and then on “Add blank file” to create a fresh .bib file to work on.
Pro tip: Did you know that Google Scholar search results can be exported to a \(\mathrm{Bib\TeX}\) entry? Click on the “Cite” link below each search result, and then on the “\(\mathrm{Bib\TeX}\)” option search. You can then copy the \(\mathrm{Bib\TeX}\) entry generated. Here’s a video that demonstrates the process. Note that you should always double-check the fields presented in the entry, as the automatically populated information isn’t always comprehensive or accurate!
Help from GUI-based .bib editors
Many users prefer to use a dedicated \(\mathrm{Bib\TeX}\) bibliography database editor/manager, such as JabRef or BibDesk to maintain, edit and add entries to their .bib files. Using a GUI can indeed help reduce syntax and spelling errors whilst creating bibliography entries in a \(\mathrm{Bib\TeX}\) file. If you prefer, you can prepare your .bib file on your own machine using JabRef, BibDesk or another utility, and then upload it to your Overleaf.
Pro tip: If you’d like to use the same .bib for multiple Overleaf projects, have a look at this help article to set up a “master project”, or this one for sharing files from Google Drive (the instructions apply to other cloud-based storage solutions, such as Dropbox).
Export from reference library services
If you click on the Upload files button above the file list panel, you'll notice some options: Import from Mendeley, and Import from Zotero. If you’re already using one of those reference library management services, Overleaf can now hook into the Web exporter APIs provided by those services to import the .bib file (generated from your library) into your Overleaf project. For more information, see the Overleaf article How to link your Overleaf account to Mendeley and Zotero .
For other reference library services that don’t have a public API, or are not yet directly integrated with Overleaf, such as EndNote or Paperpile , look for an “export to .bib ” option in the application or service. Once you have a .bib file, you can then add it to your Overleaf project.
I’ve already got a reference list in a Microsoft Word/HTML/PDF file; can I somehow reuse the data without re-typing everything?
It used to be that you would have to hand-code each line into a \bibitem or an @article{...} entry (or another entry type) in a .bib file. As you can imagine, it’s not exactly a task that many people look forward to. Fortunately, these days some tools are available to help. They typically take a plain text file, e.g.
and attempt to parse the lines, converting it into a structured bibliography as a \(\mathrm{Bib\TeX}\) .bib file. For example, have a look at text2bib or Edifix . Be sure to go through the options of these tools carefully, so that they work well with your existing unstructured bibliography in plain text.
Summary and further reading
We’ve had a quick look at how \(\mathrm{Bib\TeX}\) processes a .bib bibliography database file to resolve \cite commands and produce a formatted reference list, as well as how to prepare .bib files.
Happy \(\mathrm{Bib\TeX}\)ing!
Further reading
For more information see:
- Bibtex bibliography styles
- Bibliography management with natbib
- Bibliography management with biblatex
- BibTeX documentation at CTAN web site
- tocbind package documentation
- Table of contents
- Management in a large project
- Multi-file LaTeX projects
- Documentation Home
- Learn LaTeX in 30 minutes
Overleaf guides
- Creating a document in Overleaf
- Uploading a project
- Copying a project
- Creating a project from a template
- Using the Overleaf project menu
- Including images in Overleaf
- Exporting your work from Overleaf
- Working offline in Overleaf
- Using Track Changes in Overleaf
- Using bibliographies in Overleaf
- Sharing your work with others
- Using the History feature
- Debugging Compilation timeout errors
- How-to guides
- Guide to Overleaf’s premium features
LaTeX Basics
- Creating your first LaTeX document
- Choosing a LaTeX Compiler
- Paragraphs and new lines
- Bold, italics and underlining
Mathematics
- Mathematical expressions
- Subscripts and superscripts
- Brackets and Parentheses
- Fractions and Binomials
- Aligning equations
- Spacing in math mode
- Integrals, sums and limits
- Display style in math mode
- List of Greek letters and math symbols
- Mathematical fonts
- Using the Symbol Palette in Overleaf
Figures and tables
- Inserting Images
- Positioning Images and Tables
- Lists of Tables and Figures
- Drawing Diagrams Directly in LaTeX
- TikZ package
References and Citations
- Natbib bibliography styles
- Natbib citation styles
- Biblatex bibliography styles
- Biblatex citation styles
- Multilingual typesetting on Overleaf using polyglossia and fontspec
- Multilingual typesetting on Overleaf using babel and fontspec
- International language support
- Quotations and quotation marks
Document structure
- Sections and chapters
- Cross referencing sections, equations and floats
- Nomenclatures
- Lengths in L a T e X
- Headers and footers
- Page numbering
- Paragraph formatting
- Line breaks and blank spaces
- Text alignment
- Page size and margins
- Single sided and double sided documents
- Multiple columns
- Code listing
- Code Highlighting with minted
- Using colours in LaTeX
- Margin notes
- Font sizes, families, and styles
- Font typefaces
- Supporting modern fonts with X Ǝ L a T e X
Presentations
- Environments
Field specific
- Theorems and proofs
- Chemistry formulae
- Feynman diagrams
- Molecular orbital diagrams
- Chess notation
- Knitting patterns
- CircuiTikz package
- Pgfplots package
- Typesetting exams in LaTeX
- Attribute Value Matrices
Class files
- Understanding packages and class files
- List of packages and class files
- Writing your own package
- Writing your own class
Advanced TeX/LaTeX
- In-depth technical articles on TeX/LaTeX
Have you checked our knowledge base ?
Message sent! Our team will review it and reply by email.
- Interlibrary Loan and Scan & Deliver
- Course Reserves
- Purchase Request
- Collection Development & Maintenance
- Current Negotiations
- Ask a Librarian
- Instructor Support
- Library How-To
- Research Guides
- Research Support
- Study Rooms
- Research Rooms
- Partner Spaces
- Loanable Equipment
- Print, Scan, Copy
- 3D Printers
- Poster Printing
- OSULP Leadership
- Strategic Plan
- BibTeX Overview
Citing with BibTeX
Specifying the .bib file to use, available bibtex styles, using a specific citation style, using the natbib package.
- Displaying the Citations
- BibTeX Help
The basic command used to cite references stored in . bib files is the \cite{citation_key} command where citation_key is the unique identifier associated with the entry in the . bib file. To cite the Fenn article noted on the front page of this guide, the command would look like this:
\cite{fenn2006}
The command is placed in the document in the location where the in-text citation is needed. This command will not only add the in-text citation but add the reference list entry as well.
Multiple references can be cited by comma-separating them in the cite command: \cite{fenn2006,markey2009,daly2010}
If you want to include any bibliography entries that you did not cite in your document, you may add the \nocite{citation_key} for each reference you wish to include. If you want to include all entries, use the \nocite{*} command.
In order for BibTeX and LaTeX to know from what file to pull the citations indentified in the \cite command, include the \bibliography{file} command where file is the name of the .bib file where the citations are stored. To pull citations from a reference file called sample.bib , the command would look like this:
\bibliography{sample}
This command is placed between the \begin{document} and \end{document} commands. Place it in the document where the bibliography will start.
BibTeX comes pre-loaded with a number of different citation style files ( .bst files). This guide from Reed College gives examples of each of the pre-loaded citation styles. Other BibTeX citation styles can be obtained from the CTAN* website . The Reed College guide provides a nice listing of discipline-specific BibTeX citation styles ; always check publisher websites to see which citation style is required by the publication for which you are writing.
*CTAN, the (C)omprehensive (T)eX (A)rchive (N)etwork, is the authoritative collection of materials related to the TeX typesetting system.
In order to display in-text citations and reference list entries is a specific citaiton style, include the \bibliographystyle{style} command where style refers to the citation style needed and calls the citation style file needed. BibTeX citation style files have the .bst extension To cite references in the SIAM citation style, the command would look like this:
\bibliographystyle{siam}
Usually the command is placed at the end of the document (after the content) but before the \end{document} command.
The regular \cite command generates numerical citations. The natbib package allows users to include either numerical citations or author-date citations. Natbib must be available in the implementation of LaTeX being used. Get it from CTAN and install it if needed. To use the natbib package, include this in the preamble:
\usepackage[options]{natbib}
To review some of the "options" available for use with the \usepackage command, see the Options section at the end of this guide .
The natbib package allows for the use of textual (\citet) or parenthetical (\citep) citations (see website for examples). Revised bibliography styles must also be used and three of the more common are plainnat.bst , abbrvnat.bst and unsrtnat.bst . They correspond to the standard .bst styles but are configured to work with natbib.
- << Previous: BibTeX Overview
- Next: Displaying the Citations >>
- Last Updated: Apr 30, 2021 6:09 PM
- URL: https://guides.library.oregonstate.edu/bibtex

Contact Info
121 The Valley Library Corvallis OR 97331–4501
Phone: 541-737-3331
Services for Persons with Disabilities
In the Valley Library
- Oregon State University Press
- Special Collections and Archives Research Center
- Undergrad Research & Writing Studio
- Graduate Student Commons
- Tutoring Services
- Northwest Art Collection
Digital Projects
- Oregon Explorer
- Oregon Digital
- ScholarsArchive@OSU
- Digital Publishing Initiatives
- Atlas of the Pacific Northwest
- Marilyn Potts Guin Library  
- Cascades Campus Library
- McDowell Library of Vet Medicine


Referencing, Citing, and Structuring Bibliographies
- Referencing Styles
- EndNote Basic
- Using Zotero with LaTeX
- Using Mendeley with LaTeX
What is Natbib?
The natbib package allows more flexibility in terms of citing and referencing styles, including Harvard style. Please see this video for more information:
My references are not appearing right - why?
Much time and effort can be saved by automatically generating BibTeX files through bulk export of multiple references either direct from databases or from reference management software. This automatic process may cause some issues and require you to tidy up the BibTeX files.
Here are some suggestions to help with this:
- LaTeX special characters (e.g. $, %, &, \,) present in a BibTeX file can create problems during typesetting. To avoid this, all these characters should be prefixed with the ‘\’ character. Use a text editor such as Notepad or TeXworks to Find and Replace e.g. replace $ with \$
- The BibTeX file is likely to contain extra fields of information not required for the actual reference. This information may pull through into the reference e.g. Notes field. It is recommended to remove this information from the BibTeX file
- Retaining capitalization. Some bibliography styles strip out capitalization in fields such as the title field; this can be a problem if you want to preserve e.g. acronyms. To preserve capitalization, edit the BibTeX file and enclose the specific text (whole not partial words) in curly brackets:
e.g. title={Study of incompressible {MHD} flow in a circular pipe with transverse magnetic field using a spectral/finite element solver},
Thanks to Imperial College's guide for this information.
Citing and referencing in LaTex - using BibTeX
You can manage your references and bibliography in LaTex using the BibTex system. BibTex allows you to automatically generate and format a bibliography in a LaTeX document. You can do this by storing them in separate BibTeX database files (.bib extension). Advantages to doing this include:
- Once stored in a BibTeX file, a reference can be re-used in future documents (you may choose to maintain one master or a series of BibTeX files)
- Many databases and reference management software allows automatic export of reference details as BibTeX files
You can then use the following commands in your LaTeX document:
- To insert a citation where label is the label of a bibliographic entry in a .bib file.
- To insert a bibliography where bibfilename is the name of a .bib file.
- To choose a BibTeX bibliographic style file with the extension .bst .
There is a wealth of guides on how to do this available on the web, including LaTeX's own guide on bibliography management here .
This is also a really helpful guide on how BibTex works: https://www.latex-tutorial.com/tutorials/bibtex/
- LaTeX/Bibliography Management Wiki Book
- Share LaTeX YouTube Channel
- << Previous: Zotero
- Next: Using Zotero with LaTeX >>
- Last Updated: Nov 22, 2023 10:38 AM
- URL: https://libguides.rhul.ac.uk/referencing


How to Reference in Latex – 7 Steps to Bibliography with BibTeX
This post may contain affiliate links that allow us to earn a commission at no expense to you. Learn more

Want to learn how to Reference in Latex? Here are 7 Steps to Master Bibliography with BibTeX.
Adding references and citations to any document can be a time-consuming task. You may need to include a single reference multiple times and also ensure each one follows a consistent referencing style.
The good news is that LaTeX’s bibliography management tool BibTeX makes much of the work involved in reference management a breeze. This is because BibTeX bibliography entries are kept within a separate BibTeX database file that can be imported easily into your main document.
Some of the benefits of using BibTeX file for reference in LaTex include:
- Having to type each reference only once
- Achieving a consistent citation style throughout your document
- Easily getting each item you cite to show up as a reference at the end of the document
In general, using bib file for referencing saves a lot of time. This makes it useful for researchers that need to cite or include a large number of references that are presented consistently in their document.
Table of Contents
How to Add a Reference in LaTeX Bibliography Management
Adding a reference in a LaTex bibliography file, or bib file can seem intimidating at first. However, managing a bib file is a relatively simple and straightforward process once you understand the steps involved. We have broken down the procedure into 7 simple steps for this guide.
Step 1 – Begin Document – Making a LaTeX document
Begin document: Create an empty LaTeX document with “.tex” extension in your preferred LaTeX editor. This could be TeXstudio, ShareLaTeX, or Texmaker.

Step 2 – Creating a new reference bib file with “.bib” extension
Create a new empty file and rename it to “citation.bib”.
The “bib” extension informs the LaTeX compiler that the bib file contains all the references for your document. Each of these files will be formatted in a particular style discussed in later steps.
Step 3 – Locating the paper to be cited in Google Scholar
The next step is to obtain your citation. Look for the paper you wish to cite in Google Scholar. Once you have located the paper on Google Scholar’s search results, look for a set of inverted commas next to a star symbol.
Step 4 – Obtaining the citation in BibTeX format for Reference in LaTex
Select the inverted commas, and a window titled “cite” should appear.
This Cite window will list a number of different citation styles such as MLA and APA. At the bottom of this window, there should be a set of hyperlinks for BibTeX, EndNote, RefMan, and RefWorks. Select BibTeX and your citation should appear in the following format:
@article{yaggi2006sleep,
title={Sleep duration as a risk factor for the development of type 2 diabetes},
author={Yaggi, H Klar and Araujo, Andre B and McKinlay, John B},
journal={Diabetes care},
volume={29},
number={3},
pages={657–661},
year={2006},
publisher={Am Diabetes Assoc}
You can also add a second citation by following the same steps for a second paper in Google Scholar.
@article{weitzman1982chronobiology,
title={Chronobiology of aging: temperature, sleep-wake rhythms and entrainment},
author={Weitzman, Elliot D and Moline, Margaret L and Czeisler, Charles A and Zimmerman, Janet C},
journal={Neurobiology of aging},
volume={3},
number={4},
pages={299–309},
year={1982},
publisher={Elsevier}
For these citations, “ yaggi2006sleep” and “ weitzman1982chronobiology ” are referred to as the key of their respective papers. You can follow the above steps to add each reference you would like to cite in your document. Once this is complete, you can return to your main LaTeX file and cite your papers individually.
How to Call a Reference in LaTex Bibliography
Step 5 – calling a latex reference.
Calling a reference in the LaTex bibliography is also quite straightforward. In a new line, you can type:
The references for the paper in our example are \cite{yaggi2006sleep} and \cite{weitzman1982chronobiology}.
Remember that the document keys are vital for citing each paper, so ensure you enter them correctly.
[Need example of what this looks like]
Step 6 – Managing and Creating Your Preferred LaTex Bibliography Styles
In the next line, you can choose your preferred bibliography style. For this example, we will be using IEEE referencing style. This is a numbered referencing bibliography style that uses citation numbers provided in square brackets in your document.
Type the following:
\bibliographystyle{ieeetr}
\bibliography{citation}
You can also add references in the following bibtex styles by simply including the style code in place of ieeetr :
With this bibliography style, references are shown in alphabetical order and are labeled numerically. Use plain in the above code to add citations in this style.
References appear in order of citation and are labeled numerically. Use unsrt in the above code to add citations in this style.
Same as plain, but the references are labeled by entry. Use alpha in the above code to add citations in this style.
Same as plain, but first names and journal names use abbreviations. Use abbrv in the above code to add citations in this style.
This style shows in-text citations as numbers enclosed in square brackets and separated with commas such as [1, 2]. Use acm in the above code to add citations in this style.
Step 7 – Compiling the Code for Reference in LaTex
Next, compile and run your code. Your document will refresh a few times. You can then view the bibliography at the end of the LaTeX document. The references for our IEETR style example will show up as:
The references for this paper are [1] and [2] .
[1] and [2] refer to the citations list at the end of the document.
For example:
The above steps are summarized as:
- Create an empty LaTeX document in the .tex extension.
- Create a new reference file in the .bib extension.
- Locate the paper, journal, or book to be cited in Google Scholar.
- Obtain the citation in BibTeX format
- Call the reference
- Select your citation style in LaTex.
- Compile the code in LaTex.
Additional Tips
As you can see, adding and calling references in LaTeX is a relatively straightforward process. Some tips to keep in mind when working with references in BibTeX and LaTeX include:
- Running your .tex LaTeX file through LaTeX before running BibTeX as the latter program requires the auxiliary file produced by LaTeX.
- Noting down the key for your paper, book, or journal properly as they will be vital for calling your reference in the bibliography.
- Ensuring the code mentioned above is entered with the correct syntax to avoid any compilation errors in LaTex.
Frequently Asked Questions
Q1: how do you reference equations in latex.
You can reference equations in LaTeX by inserting a label in your equation with an “eqn:” prefix. A typical LaTeX equation resembles the following: \begin{equation} \label{eqn:somelabel} e=mc^2 \end{equation}
Q2: What is Documentclass LaTeX?
The first line of code in a LaTeX document is referred to as the Documentclass declaration command. It resembles the following: \documentclass[options]{class} Documentclass informs LaTex about which layout standard to use. Some common document classes include: article : For articles from scientific journals and presentations. book : For books. letter : For writing letters
Q3: How do you add references in LaTeX without citations?
If you wish to list references without citing them in the text body, you can add a single input using: \nocite{keyname} You can then mark any key within the .bib file by using: \nocite{*} Add this command for each entry in the bib data file or \nocite{key} for a single one that isn’t cited in the text.
Q4: How do you reference labels in LaTeX?
You can reference labels in LaTeX by placing a \label{key} command behind a sectioning command, chapter, or image. You should then assign a unique key to it. Following this, you can use \ref{key} and \pageref{key} commands to reference them.
Q5: How do you change the reference style in LaTeX?
You can change the reference style in LaTeX by altering the \bibliographystyle{ filename} line in your LaTeX document. Filename here should be replaced with your preferred reference style such as plain and ieeetr .
Q6: How do you cite all references in LaTeX?
You can cite all your sources by typing \citeall .
Q7: Where can you get more help with LaTex?
You can get more help with LaTeX by visiting https://en.wikibooks.org/wiki/LaTeX .
Further Reading
LaTex Tutorial
- 27 Pros and Cons of Using LaTex for Scientific Writing
- 6 easy steps to create your first Latex document examples
- How to add circuit diagrams in Latex
- How to change Latex font and font size
- How to create a Latex table of contents
- How to create footnotes in LaTeX and how to refer to them, using the builtin commands
- How to create Glossaries in LaTeX
- How to create plots in Latex – codes and examples
- How to create symbols in LaTeX – commands for Latex greek alphabet
- How to create tables in LaTeX – rows, columns, pages and landscape tables
- How to drawing graphs in Latex – vector graphics with tikz
- How to highlight source code in LaTeX
- How to insert an image in LaTeX – Managing Latex figure and picture
- How to Itemize and Number List – Adding Latex Bullet Points
- How to make hyperlink in latex – Clickable links
- How to use Latex Packages with examples
- How to use LaTeX paragraphs and sections
- LaTeX Installation Guide – Easy to follow steps to install LaTex
- Learn to typeset and align Latex equations and math
3 thoughts on “How to Reference in Latex – 7 Steps to Bibliography with BibTeX”
Thanks for this invaluable support to LaTeX users.
I feel you should tell to use \bibliography{} command and refer to the .bib file here.
I want to cite in 4 referencing, for example: [1-4] But, I see: [1], [2], [3], [4]
how can I write: [1-4]
Leave a Comment Cancel reply
Save my name, email, and website in this browser for the next time I comment.
We maintain and update science journals and scientific metrics. Scientific metrics data are aggregated from publicly available sources. Please note that we do NOT publish research papers on this platform. We do NOT accept any manuscript.

2012-2023 © scijournal.org
- Plagiarism and grammar
- Citation guides
BIBTEX Citation Generator
- powered by chegg.
Keep all of your citations in one safe place
Create an account to save all of your citations
Check your paper before your teacher does!
Avoid plagiarism — quickly check for missing citations and check for writing mistakes., is this source credible consider the criteria below..
Is the purpose to entertain, sell, persuade, or inform/teach ? Journal articles are often designed to inform or teach. Books and websites could have any of these or a combination of the purposes above. So it is important to determine why the source was created and if it is appropriate for your research. For websites in particular, looking at their "About Us" page or "Mission Statement" can help you evaluate purpose.
Accuracy is the reliability and truthfulness of the source. Here are a few indicators of an accurate source:
- Citations or a works cited list. For websites, this can be links to other credible sites.
- Evidence that backs up claims made by the author(s).
- Text that is free of spelling and grammatical errors.
- Information that matches that in other, credible sources.
- Language that is unbiased and free of emotion.
Based on the above the source could be accurate, inaccurate, a mixture of accurate and inaccurate, or hard to tell.
Authority: Author
The author is the individual or organization who wrote the information in the book, in the journal article, or on the website. If no author is listed, there may be another contributor instead. For example, an editor or a translator. A credible author has:
- Written several articles or books on the topic.
- Provided contact information. For example, an email address, mailing address, social media account, etc.
- The experience or qualifications to be an expert on the topic.
Authority: Publisher
The credibility of the publisher can contribute to the authority of a source. The publisher can be a person, company or organization. Authoritative publishers:
- Accept responsibility for content.
- Are often well-known.
- Often publish multiple works on the same or related topics.
Relevance describes how related or important a source is to your topic. While a source may be credible, it does not necessarily mean it is relevant to your assignment. To determine relevance, you should:
- Determine the website's intended audience. Look at the level of the information and the tone of the writing. For example, is it meant for academics or the general public?
- Make sure that the information is related to your research topic.
- Make sure that the information helps you answer your research question.
A publication date is an important part of evaluating the credibility of a source and its appropriateness for your topic. It is generally best to use content that was recently published or updated, but depending on your assignment, it may be appropriate to use older information. For example, a journal entry from Abraham Lincoln during the Civil War is too outdated to use in a discussion about modern politics and war, but would be appropriate for a paper about the Civil War. Consider the following when evaluating currency:
- Was it published or updated recently? If a website, is there even a publication date listed?
- Is the date of the source appropriate or inappropriate for my assignment?
After analyzing your source, do you believe it is credible, not credible, partially credible, or are you unsure? If you are still unsure, it may help to ask your instructor a librarian for assistance.
- Citation Guides
- Chicago Style
- Terms of Use
- Global Privacy Policy
- Cookie Notice
- DO NOT SELL MY INFO

Overleaf - LaTeX: Bibliographies and Citing
- Getting Started
- Creating a LaTeX Document in Overleaf
- Structuring and Formatting
- Lists, Tables, Images, and Labelling
- Mathematics in LaTeX
- Bibliographies and Citing
- Books and Dissertations
- Submitting from Overleaf
Bibliographies in LaTeX
In order to cite references, you first need to create a separate bibliography file ending with a .bib extension within your LaTeX project. You can do that by clicking on the New File icon on the upper-left corner of the screen.

Then, enter your file name. Note that the default file extension in LaTeX is .tex. Your bibliography file must end in .bib. Once you create your file, you can add references to it in the BibTeX format.
Exporting references from ProQuest RefWorks
If you use RefWorks to manage your references, you can export your references from RefWorks into the BibTeX format. To export your references from RefWorks, click on the Share tab. Then, click on Export References and select the BibTeX option. You can import the references you exported from RefWorks into LaTeX as a .bib file.
To learn more about RefWorks, visit the RefWorks e-course module .
Exporting references from a database or Google Scholar
The easiest way to add references to your .bib file, other than exporting them from RefWorks, is to import or copy them directly from Google Scholar or from a database. To cite from Google Scholar, click on the cite icon underneath the article, which is represented with a quotation sign. Select the option BibTeX at the bottom of the pop-up screen. You will be directed to another page where you can copy the reference in the BibTeX format. Make sure to check that the relevant fields are entered correctly before copying the reference into your .bib file.
Note that Google Scholar does not include a DOI, which is often needed as part of your reference.
Some databases also provide the option to export a reference in the BibTeX format. The way to export a reference from a database can vary depending on the database being used.
Note: Not all databases allow you to export citation information in the BibTeX format. To work around this, use RefWorks to manage your references which you can then export in the BibTeX format.
Entering references manually
When entering a reference to BibTeX, the fields that are required to be filled in for each citation will vary depending on the type of the work you are citing. The reference type is specified by using the @ symbol followed by the type. Regardless of the reference type, the first field to be entered in the reference is the label that you want to give to a particular reference. You will later be able to use this label to cite the reference in the main text of the document.
Below is an example of the fields you are required to enter for articles.
Here's another example illustrating the fields required for a Ph.D. thesis.
Visit the page on standard templates for BibTeX to see how other types of works can be included.
Citing in LaTeX
To begin citing sources within your LaTeX document, you can use the biblatex package. Add \usepackage { biblatex } to your preamble. Note that there are other packages that you could use for this, including the natbib package, which is also a popular option.
There are a number of specifications you can enter to the \usepackage { biblatex } command. The first specification you should add within the square brackets of the command is backend = biber . Biber provides the relevant information needed to implement the biblatex package.
You can also specify the style of your bibliography by using the style parameter. For instance, style=authoryear will print your references in the author-year format. Another common variant is style=authoryear-comp , which will only print the author's last name once, and not for the subsequent references. Visit the page on biblatex's citation styles for a full list.
Using biblatex, you can also determine what criteria should be used to sort your bibliography by specifying the sorting parameter. For instance, sorting=nyt will sort your bibliography by name, title, and year. The end result of specifying these parameters may look something like this:
To be able to cite the references from your bibliography, you will need to implement a command mapping your BibTeX file to your document. To do that, you can use the \addbibresource {..} command and add your file name in between the curly brackets.
There are many options to call and format your in-text citations in LaTeX. Below is a list of common commands you can use with the corresponding output. For instance, the command \parencite {JonesandSmith1997} will result in (Jones and Smith 1997) in the pdf.
Adding the \printbibliography command at the end of the document will instruct LaTeX to print your references.
- << Previous: Mathematics in LaTeX
- Next: Books and Dissertations >>
- Last Updated: Mar 14, 2022 9:28 AM
- URL: https://libguides.eur.nl/overleaf
BibTeX Guide: Mastering Reference Management for Bibliographies
For those diving into academic or technical writing, BibTeX is an indispensable ally. Despite the intricate details surrounding LaTeX packages, citation styles, and formatting, with a structured approach, BibTeX can be easy to grasp.
Understanding BibTeX
Developed in the 1980s by Oren Patashnik and Leslie Lamport, BibTeX has become the go-to software for managing and formatting bibliographies in LaTeX and markdown documents. Its widespread acceptance in academic circles, especially in fields like math, computer science, and physics, is a testament to its efficiency. By storing references in plain text .bib files and associating each with a unique key, BibTeX simplifies citations in the main LaTeX document.
The beauty of BibTeX lies in its versatility. The .bib-file entries can range from articles and books to conference papers, each containing fields like authors, title, journal, volume, and year, tailored to the reference type.
BibTeX eliminates redundancy. Once you've detailed a reference in the '.bib-file', simply use its unique key for citations in the LaTeX or Markdown document. During compilation, BibTeX takes care of the formatting, drawing from the .bib file and the style guidelines in the LaTeX document.
Advantages of Using BibTeX
- Consistency : BibTeX ensures uniform citation styles, minimizing manual errors.
- Efficiency : Change styles or reuse references without starting from scratch.
- Flexibility : Compatible with diverse tools, including Pandoc for Markdown.
- Control : Customize fields and types to fit specific requirements.
- Reliability : Being text-file based, BibTeX databases are easy to backup and share.
Limitations of BibTeX
While BibTeX is harmonious with LaTeX and Markdown, its integration with Microsoft Word, Libre Office, and Google Docs is somewhat patchy. Workarounds exist, like Bibtex4Word (exclusive to Windows). For frequent users of these platforms, Zotero might be more appropriate.
Moreover, the static nature of BibTeX can be a drawback. Its maintenance is sparse, which might leave users wanting more up-to-date fields or types. And while its format is easily readable, minor errors like a missing parenthesis can disrupt your LaTeX/Pandoc flow. To avoid such pitfalls, consider BibTeX tools like CiteDrive or jabRef , which offer features like duplication prevention.
Biber, BibLaTeX
Please keep some of the alternatives in mind, especially Biber in conjunction with BibLaTeX. It is a complete reimplementation of BibTeX's bibliographic features; in addition to a large number of supported types and fields, it supports a wide range of customizations, including sorting bibliographies by types, keywords, authors, and other fields, as well as full Unicode and multi-language support and customizations with in-text citations without the need for additional packages, such as natbib. Although BibTeX is still highly regarded for its durability, it should be noted that bibLatex is far more powerful and well-maintained, as many significant BibTeX updates occurred decades ago. Although the tutorial is primarily geared toward BibTeX, much of it also applies to biblatex, making it an excellent place to start. The format remains the same; entries are saved in bib files with additional fields and types. Additional biblatex tutorials can be found on this page.
In a markdown file, you can specify your bibliography '.bib-file'in the YAML section for use with citations and in conjunction with Pandoc, which formats your document using Citation Style Language as a formatter and CiteProc as a processesor as a backend. More information is available on their website, or in our guides.
Quick Start Guide
BibTeX, while well-established, is evolving with the rise of Markdown-based systems such as Pandoc, Jupyter, Obsidian, Quarto, and R Markdown. Here's a brief tutorial on integrating BibTeX with LaTeX. Don't forget to check out our sections on BibLaTeX and Pandoc.
Preparations
1. install a latex distribution .
If you wish to utilize BibTeX, ensure you have a LaTeX distribution installed:
- TeX Live and MiKTeX are renowned open-source options.
- Platforms like Overleaf come pre-packaged, removing the need for manual installations.
2. Organize Your Document Structure
Your project folder might look like this:
Step-by-Step Guide
Step 1: crafting a .bib file .
- Create a .bib file named bibliography.bib . This will house your BibTeX entries.
- Use text editors like Notepad or specialized tools such as CiteDrive or JabRef .
- A typical BibTeX entry might resemble:
Key Components :
- Entry-type : E.g., @book .
- Entry fields : E.g., title , author .
- Citation-key : E.g., Hemingway1952 (used as \cite{Hemingway1952} in LaTeX).
Step 2: Picking a Style
- With your .bib file ready, select a citation style.
- Use the \bibliographystyle{style-name} command in LaTeX to specify your chosen style, omitting the .bst extension.
- Common styles include: plain , alpha , unsrt , abbrv , ieee , apalike , apa , and acm .
Step 3: Integrating with LaTeX
- Embed your references within a LaTeX document:
Upon compilation, the \cite{Hemingway1952} command will be replaced with a relevant citation.
Tool Recommendations
Managing BibTeX entries manually can be cumbersome. Here are some tools to simplify the process:
- CiteDrive : A web-based, collaborative tool offering seamless export functionalities to Overleaf and R Markdown.
- Zotero : A powerful, free reference manager. For optimal BibTeX integration, consider the Better BibTeX For Zotero plugin.
- JabRef : An open-source, BibTeX-centric reference manager available across major operating systems.
Resources
Entry types .
Next to @book from our example above, BibTeX supports a wide range of reference types, including journal articles, theses, conference papers, and much more. Here's a list of some of the most commonly used reference types in BibTeX:
- @article : used for articles in journals or magazines
- @book : used for complete books
- @inbook : used for chapters in a book
- @incollection : used for articles in a collection
- @inproceedings : used for conference or workshop papers
- @phdthesis : used for PhD theses
- @mastersthesis : used for Master's theses
- @techreport : used for technical reports
- @manual : used for software manuals or guides
Entry fields
For each reference type, you'll need to provide a set of fields that describe the reference. The ones you'll need are determined by the type of reference and citation style you're using. For example, a @article reference will typically include fields for the author, title, journal, year, volume, and pages.
- author : the author of the reference
- title : the title of the reference
- journal : the name of the journal or magazine
- year : the year the reference was published
- volume : the volume number of the journal or book
- pages : the page numbers of the reference
- booktitle : the title of the book in which the reference was published (for @inbook and @incollection references)
- editor : the editor of the book in which the reference was published (for @book references)
- series : the series in which the book was published (for @book references)
- chapter : the chapter number of the reference (for @inbook references)
- address : the address of the publisher
- edition : the edition of the book
- publisher : the name of the publisher
- school : the name of the school at which the thesis was written (for @phdthesis and @mastersthesis references)
- institution : the name of the institution that published the report (for @techreport references)
- howpublished : any special instructions for publishing the reference
- note : any additional notes about the reference
It is important to note that not all citation styles support all reference types and fields, but you should enter as much information into your BibTeX database as accurately and completely as possible. This ensures that your references are formatted correctly and that the information is correct. Fields that are not supported are simply ignored, so the more, the better. You should double-check any journal requirements.
- Advantages of Using BibTeX
- Limitations of BibTeX
- Biber, BibLaTeX
- Preparations
- Step-by-Step Guide
- Tool Recommendations
- Entry Types
- Entry fields
Are you in search of a simple and cost-free online BibTeX manager?
CiteDrive is a bibtex-based collaborative reference manager that integrates seamlessly with Overleaf and RStudio.
Online BibTeX Manager →

IMAGES
COMMENTS
Social referencing is term that refers to the tendency of a person particularly an infant, to analyze the facial expressions of a significant other in order to be able to determine what to do.
A works cited page lists the references used in a paper written in MLA or APA format. The works cited page differs from a bibliography; a works cited page lists references used throughout the paper, while a bibliography page lists all the s...
To cite a website in a paper using APA format, gather the author’s name, the title of the article, the date of publication and the URL for that website. Add an in-text parenthetical note, and include the source information in the list of re...
bib file's role is to store bibliographic records, and only entries that have been cited (via \cite{...} ) in the .tex files will appear in the reference list.
If you want to include any bibliography entries that you did not cite in your document, you may add the \nocite{citation_key} for each reference
Rather than include reference details for your document within the document itself you can store them in separate BibTeX database files (.bib extension).
Citing and referencing in LaTex - using BibTeX · \cite{label}. To insert a citation where label is the label of a bibliographic entry in a . · \
Step 4 – Obtaining the citation in BibTeX format for Reference in LaTex. Select the inverted commas, and a window titled “cite” should appear.
BibMe Free Bibliography & Citation Maker - MLA, APA, Chicago, Harvard.
I quickly show how to setup a LaTex document with citations/references/bibliography using BibTeX. I demonstrate both APA and IEEE citations
Citing a Website using BibTeX · Author or Organization name · Title of the webpage · Date of publication or last update · URL of the webpage · Date
When entering a reference to BibTeX, the fields that are required to be filled in for each citation will vary depending on the type of the work
Step 3: Citing references. To cite a reference in your document, use the \cite{} command with the key that corresponds to the reference in your
bib-file', simply use its unique key for citations in the LaTeX or Markdown document. During compilation, BibTeX takes care of the formatting, drawing from the