---
title: Theory
author: Author
chapter: 2
in_context: False
knit: iheiddown::chapter_pdf
abstract: |
  This is an example of a chapter abstract.
  Ordinarily this would only be used for paper-based dissertations.
  All you need to do is add an 'abstract' line to this metadata header,
  and fill it in with your (paper) abstract.
  It is currently ignored when the entire dissertation is compiled,
  but is printed when just the chapter is compiled.
output: iheiddown::chapter_pdf
---

\setcounter{chapter}{1}
# Theory {#theory}

## Referencing

Your dissertation, and perhaps your theory/literature review chapter in particular,
will likely have plenty of citations.
Indeed, you will probably accumulate an armful of sources.
This section outlines how to assemble a bibliography and cite in text.

### Assembling a bibliography

_RMarkdown_ uses [_pandoc_](https://pandoc.org/) to build its bibliographies.
^[One nice feature of this is that, unlike using straight \LaTeX\, you won't need to do a second compile to load in references.]
*pandoc* (and \LaTeX\) rely on one or more external bibliography databases that contain all the bibliographic information
that you may use in your thesis.
In the end though, when it builds your bibliography, 
it will only create an entry for those items that you actually cite.

The required format for these bibliography database files is **BibTeX**.
**BibTeX** files are stored in a plain text file with the .bib extension.
See [this link](https://www.economics.utoronto.ca/osborne/latex/BIBTEX.HTM) for more.
I have placed an example file under the `/bib/` folder.
You can simply replace this with your own file under the same name,
or point to your file instead by changing the correct field
in the YAML header in the main .Rmd file.

There are a variety of tools available for creating these files.
For example, you may want to consider using the free and easy-to-use tool called Zotero.  
Our wonderful librarians have created documentation on [how to use Zotero](https://libguides.graduateinstitute.ch/zotero/home).

### Citing with `citr`

After creating your personal bibliographic database,
you can cite these entries in your dissertation with an `@` symbol, 
followed by the correct, unique identifier for that entry.
Let's take for example the `Darwin1859` entry that appears in the `references.bib` file in the `bib` folder.  

Standard parenthetical citations can be indicated with square brackets [@Darwin1859].
Without them, you will get a text citation.
For example, @Darwin1859 said some smart things.
If you wish to drop the name, 
say because you wish to replace it with something more fitting in the context,
you could say that Darwin's -@Darwin1859 theory of evolution is brilliant.

To cite multiple entries together, you can just concatenate the entries, 
separated by semi-colons.
For example, this package [@iheiddown2020] very much builds and relies upon the excellent work of others [@bookdown2016; @solomon2020].

You can also add page numbers and notes.
For example, you should start reading a book from the first page [@Darwin1859, p. 1],
though often all of them are good [@Darwin1859, pp. 1-502].
These need not be page numbers, but could be other suffixes.
You can add prefixes too [see @bookdown2016; cf. @solomon2020].

A more efficient way for entering these into your documents is by using the R package `citr`.
The `citr` package includes an 'addin' for RStudio that you can bind a keyboard shortcut to,
and that raises a search window where you can type author, year, or title information in to to find the required entry/ies.
It is enormously useful, particularly as your bibliography gets larger.
If you'd like to learn more, see [the README of its GitHub account](https://github.com/crsh/citr).

![Citing with citr](../figures/citr.png){ width=100%, height=45% }


\newpage

### Tips for bibliographies

- Like with thesis formatting, the sooner you start compiling your bibliography for something as large as thesis, the better. 
Typing in source after source is mind-numbing enough; do you really want to do it for hours on end in late May? 
Think of it as procrastination.
- The cite key (a citation's label) needs to be unique from the other entries.
- When you have more than one author or editor, you need to separate each author's name by the word "and" e.g. `Author = {Noble, Sam and Youngberg, Jessica},`.
- Bibliographies made using BibTeX (whether manually or using a manager) accept \LaTeX\ markup, so you can italicize and add symbols as necessary.
- To force capitalization in an article title or where all lowercase is generally used, bracket the capital letter in curly braces.
- You can add an iheiddown citation.^[@iheiddown2020] 
