This article is based on the video LaTeX Tutorial pt 5 - Bibliographies and Natbib, which explains how to write bibliographies using bibtex, which requires the list to be written in a file that is separate from the original document.
In the top left corner on Overleaf, click the new file button and save the file as a .bib file, for example “file.bib”. The source details will be written in this file, while the sources will be referenced in the .tex file. In the .bib file, each source has to be classified into one specific category- these include articles, books, manuals and more. Within each of these categories, more specific details must be provided about the source (these requirements can be found online). For an article, the format should look like the following: @article{Label, author = “ “, title = “ “, journal = “ “, volume = “ “, number = “ “, pages = “ “, year = “ “, month = “ “, note = “ “ }
The “Label” is the citation key, which can be referenced in the .tex file later on. The information should be filled in within the quotation marks. For a book, the format should look like the following: @book{Label, author = “ “, title = “ “, publisher = “ “, volume = “ “, number = “ “, series = “ “, address = “ “, edition = “ “, year = “ “, month = “ “, note = “ “ }
The format for miscellaneous sources should look like the following; all the keywords are optional, but adding a url for a web entry is suggested: @misc{Label, author = “ “, title = “ “, year = “ “, url = “ “ }
When a source has multiple authors, all authors should be written in the format First Name Last Name within the quotations, and the word “and” separating them. Another format to enter an author’s name is Last Name, First Name Last Name, which helps LaTeX understand which is the surname, especially if an author also has a middle name. *Curly brackets can be added to make sure the capital letters are maintained, since some styles of bibtex change the letters.
In the .tex file, a source is cited through the code “\cite{key}”, key being the Label in the .bib file. To add the bibliography into the document, add the two commands: “\bibliographystyle{}” and “\bibliography{}”. Information must be input into the brackets, and there are different styles- a common style is the plain style. The bibliography bracket requires the title of the .bib file that has the bibliography information. To add bibliographies together, input all the titles of the files within the brackets and separate each one with commas. After recompiling the document, a references section should appear along with the numbered references.
The natbib package is a different way to insert a bibliography, and can be started with the code “\usepackage[]{natbib}”, and keywords can be inserted into the square brackets to change the design of the bibliography (these can be found online). All the references can be referenced with the code “\citep”, and the bibliography style must be compatible with the package.
Kommentarer