---
title: A Template
author: Andrew Pua
date: November 11, 2022
abstract: |
  Write your abstract here. 
bibliography: references.bib
toc: true
format:
  html:
    code-fold: false
    self-contained: true
---

## Preamble

This template is a radically simplified version of @heiss-templates. This modified template can be found in my course website [@apslides]. You can combine this template with the first-ever [template](https://applied-metrics.neocities.org/template.qmd) I shared with you. You could also combine what you may have picked up from other qmd files available at the course website. 

Here you can organize the commands needed to load packages and do other formatting options (if needed). 

```{r}
# To clean R's memory, leave this alone
rm(list=ls())
```

## Reading more about Quarto 

I am repeating this section from [Exercise Set 06](https://applied-metrics.neocities.org/applied-metrics-1-exercise-set-06.html). You might find the Quarto guide on the following topics to be of interest: 

-   [Authoring](https://quarto.org/docs/authoring/markdown-basics.html): probably the highest priority
-   [Citations and footnotes](https://quarto.org/docs/authoring/footnotes-and-citations.html)
-   [Cross-references and hyperlinks](https://quarto.org/docs/authoring/cross-references.html)
-   [Showing and hiding code](https://quarto.org/docs/output-formats/html-code.html#folding-code)
-   [Wrapping code](https://quarto.org/docs/output-formats/html-code.html#code-overflow)
-   [Themes](https://quarto.org/docs/output-formats/html-themes.html): not really a priority, but this is quite a rabbit hole
-   [HTML reference](https://quarto.org/docs/reference/formats/html.html)


## How to add and cite references

Notice that in the qmd file there is a line `bibliography: references.bib`. What this means is that there is a separate file containing bibliographic information. Your job is to maintain this `bib` file and populate it with entries which you will be eventually citing in your report. The format of the entries is the BibTeX format. 

Fortunately, almost every publisher of journal articles has citation tools that make things convenient. For example, when you look up the citation information of @HAMERMESH2005369 at [this website](https://www.sciencedirect.com/science/article/abs/pii/S0272775704001165?via%3Dihub), you will can click on Cite and find Export citation to BibTeX. Sometimes a file will open in your browser, but most of the time a very small file with a `.bib` or a `.txt` file extension will be downloaded. Open this file using a text editor and copy/paste the contents to `references.bib`. Sometimes it might be a good idea to clean up the contents to make it shorter, but still containing the most important pieces of information including the digital object identifier or DOI.^[There is a slight problem with some publisher when they export citations to BibTeX. The DOI entry has to modified so that you remove the first part `https://doi.org/`.] For other publishers, your mileage may vary. I leave this for you to explore. But you got to admit that this gives everyone no excuse for not citing sources. 

If you use R packages that were never used in class, please cite them. For example, if you want to cite the `sandwich` package, then you type `print(citation("sandwich"), bibtex=TRUE)` into the R console. It will generate a BibTeX entry. Put that entry into `references.bib`. Do not forget to put a key. Usually these keys are provided or automatically generated. These keys are markers or identifiers which enable you to tie your citation in the qmd file to the entry in `references.bib`. If this key is not provided or if you want to modify it, you can find it in the first line of every BibTeX entry. This first line typically starts with something like `@Manual{Rcite,` and for this example, `Rcite` is the key. 

Open the qmd file which produced this HTML file so that you can see how to cite sources and how the keys play a role. 

For reproducibility purposes, I would include something like "All analyses were performed using R Statistical Software v4.2.1 [@Rcite] and tables are displayed using `stargazer` v5.2.3 [@starcite]. To reproduce the computer output, you need to load the `TeachingRatings` dataset from @SW2012, and install R along with the packages `foreign` and `stargazer`."

Look at the bottom: Instant reference list! 
