Essential Tools for Writing a Paper

Bibliography Manager, Word Processing

Bogdan G. Popescu

John Cabot University

Your Workspace

Any project needs to start with a clean workspace

You need to have dedicated folders for:

  • data
  • literature
  • paper
  • presentation

Having a clean workspace will give you clarity.

As we progress throughout the course, we will keep adding files and data to the folder

Your Workspace

Reference Software

JabRef

This is reference manager software.

It is freely available

It saves the literature in a table-like format.

It later allows to format citations in the desired format (e.g. APA)

Only commands like “cite” are necessary.

Reference Software: JabRef

Downloading

Reference Software: JabRef

Downloading

Reference Software: JabRef

Downloading

Reference Software: JabRef

Downloading

Reference Software: JabRef

Interface

Reference Software: JabRef

Interface

Reference Software: JabRef

Interface

Reference Software: JabRef

Article

Reference Software: JabRef

Article

Reference Software: JabRef

Article

Reference Software: JabRef

Article

Reference Software: JabRef

Article

Note the citation key

I typically choose “NameYear” as convention. It’s a good way to remember whom you cite.

Reference Software: JabRef

Article

Reference Software: JabRef

Article

Reference Software: JabRef

Article

Note that if you have more than one author you need to write them under the author section in JabRef:

“Acemoglu, Daron, and Robinson, James, and Johnson, Simon”

Reference Software: JabRef

Book

Reference Software: JabRef

Book

Reference Software: JabRef

Book

Reference Software: JabRef

Book

Reference Software: JabRef

Book

Reference Software: JabRef

Book

Reference Software: JabRef

Chapter in Edited Volume

Reference Software: JabRef

Chapter in Edited Volume

Reference Software: JabRef

Chapter in Edited Volume

Reference Software: JabRef

Chapter in Edited Volume

Reference Software: JabRef

Chapter in Edited Volume

Reference Software: JabRef

Chapter in Edited Volume

Reference Software: JabRef

Saving the Library

Reference Software: JabRef

Saving the Library

Reference Software: JabRef

Saving the Library

Reference Software: JabRef

Saving the Library

Citations

American Psychological Association (APA) Style

This is the recommended way to cite:

Book

Acemoglu, Daron, and James Robinson. 2012. Why Nations Fail: The Origins of Power, Prosperity and Poverty. New York: Crown.

Article

Simpser, Alberto. 2012. “Does Electoral Manipulation Discourage Voter Turnout? Evidence from Mexico.” The Journal of Politics 74: 782–95.

Chapter in Edited Volume

Tiliouine, Habib, Renima Ahmed, and Richard J. Estes. 2016. “The Changing Map of the Islamic World: From the Abbasid Era to the Ottoman Empire of the Twentieth Century.” In The State of Social Progress of Islamic Societies, edited by Habib Tiliouine and Richard J. Estes, 53–68. Routledge.

Once you use JabRef, you will no longer have to worry about citation styles !!!

Quarto

What is Quarto?

Quarto - open-source publishing system designed for creating dynamic, reproducible documents, including reports, presentations, and websites.

It supports multiple formats like HTML, PDF, Word, and slides.

Why Use Quarto?

  • Integrates well with R, Python, and Julia.
  • Enables embedding of code chunks directly in documents for dynamic content generation.
  • Facilitates reproducibility by linking code and results seamlessly.

Quarto

The Template

We want to obtain a PDF that is commonly used in academia

Quarto

The Template

We want to obtain a PDF is commonly used in academia

Quarto

The Template

We also want to obtain an HTML file that we can easily put on our website to showcase our work.

Quarto

The Anatomy

Before we delve into the anatomy of the article template, let us do some basics

  • Install R
  • Install R Studio
  • Understand the basic structure of a Quarto document

Installing R and R Studio

We can do that by going to: https://posit.co/download/rstudio-desktop/

Installing R and R Studio

We can do that by going to: https://posit.co/download/rstudio-desktop/

Installing R Studio

We can do that by going to: https://posit.co/download/rstudio-desktop/

Install the version of RStudio relevant for your OS.

Note that there are different files for Apple silicon (M1/M2) Macs and for Intel Macs.

R panels

The platform interface for R studio looks like below:

R panels

The platform interface for R studio looks like below:

R panels

The platform interface for R studio looks like below:

R panels

The platform interface for R studio looks like below:

Quarto Files

Quarto is a version of R Markdown from RStudio that allows us to run code and write text.

Quarto files have the *.qmd extension

Quarto Files

You can produce a wide variety of output types:

  • executable code blocks
  • plots
  • tabular output from data frames
  • plain text output

Installation

You can now start typing.

To use Quarto with R, you should install the rmarkdown R package:

install.packages("rmarkdown")

Installation

You can now start typing.

To use Quarto with R, you should install the rmarkdown R package:

Installation

You can now start typing.

To use Quarto with R, you should install the rmarkdown R package:

Installation

You can now start typing.

To use Quarto with R, you should install the rmarkdown R package:

Using R

Let us now use R to understand how it works.

Let’s create a new quarto document and save it in your “paper” folder

Using R

Using R

Using R

Using R

Using R

Using R

Using R

Using R

Using R

Using R

Using R

Using R

Using R

Using R

Using R

Using R

Using R

Using R

Using R

Using R

Using R

Using R

Using R

Using R

Using R

Using R

Using R

Using R

Using R

Using R

Quarto Document Structure

YAML Header

Quarto Document Structure

YAML Header

  • The YAML header defines the document metadata, such as title, author, date, and output format.
---
title: "Statistical Analysis Report"
author: "Your Name"
date: "2024-11-05"
format: html
---

# Introduction

This is an example.

Quarto Document Structure

YAML Header

Quarto Document Structure

YAML Header

Quarto Document Structure

YAML Header

Quarto Document Structure

YAML Header

Quarto Document Structure

YAML Header

  • The YAML header defines the document metadata, such as title, author, date, and output format.
---
title: "Statistical Analysis Report"
author: "Your Name"
date: "2024-11-05"
format: html
---

# Introduction

This is an example.

Creating HTML Output

Basic YAML Configuration

To generate an HTML file, specify format: html in the YAML header.

Rendering the Document:

Use quarto render in R to generate the output.

Adding a Table of Contents

Enabling TOC:

  • Add toc: true in the YAML header to automatically generate a table of contents.

  • Control depth with toc-depth (e.g., 2 for two levels of headings).

---
title: "Statistical Analysis Report"
author: "Your Name"
date: "2024-11-05"
format: html
toc: true
---

# Introduction

This is an example.

Adding a Table of Contents

Enabling TOC:

  • Add toc: true in the YAML header to automatically generate a table of contents.

  • Control depth with toc-depth (e.g., 2 for two levels of headings).

Adding a Table of Contents

Customization

  • Rename the title with toc-title: "Contents".
---
title: "Statistical Analysis Report"
author: "Your Name"
date: "2024-11-05"
format: html
toc: true
toc-title: "Contents"
---

# Introduction

This is an example.

Adding a Table of Contents

Customization

  • Rename the title with toc-title: "Contents".

Equations

You can easily add inline equations in the following way

---
title: "Statistical Analysis Report"
author: "Your Name"
date: "2024-11-05"
format: html
toc: true
toc-title: "Contents"
---

# Introduction

This is an example.

This is an equation: $E=mc^{2}$

Equations

You can easily add inline equations in the following way

---
title: "Statistical Analysis Report"
author: "Your Name"
date: "2024-11-05"
format: html
toc: true
toc-title: "Contents"
---

# Introduction

This is an example.

This is an equation: $E=mc^{2}$

This is also an equation: 

$$E=mc^{2}$$

Equations

For more advanced equations, check: https://qmd4sci.njtierney.com/math

Code

Embedding Code

This is how we include code in our documents.

---
title: "Statistical Analysis Report"
author: "Your Name"
date: "2024-11-05"
format: html
toc: true
toc-title: "Contents"
---

# Introduction

This is an example.

This is an equation: $E=mc^{2}$

This is also an equation: 

$$E=mc^{2}$$

```{r}
summary(mtcars)
```

Code

Embedding Code

This is how we include code in our documents.

---
title: "Statistical Analysis Report"
author: "Your Name"
date: "2024-11-05"
format: html
toc: true
toc-title: "Contents"
---

# Introduction

This is an example.

This is an equation: $E=mc^{2}$

This is also an equation: 

$$E=mc^{2}$$

```{r echo=TRUE, eval=TRUE}
summary(mtcars)
```

Code

Embedding Code

This is how we only include code output in our documents.

---
title: "Statistical Analysis Report"
author: "Your Name"
date: "2024-11-05"
format: html
toc: true
toc-title: "Contents"
---

# Introduction

This is an example.

This is an equation: $E=mc^{2}$

This is also an equation: 

$$E=mc^{2}$$

```{r echo=FALSE, eval=TRUE}
summary(mtcars)
```

Code

Embedding Code

This is how we only include code without output in our documents.

---
title: "Statistical Analysis Report"
author: "Your Name"
date: "2024-11-05"
format: html
toc: true
toc-title: "Contents"
---

# Introduction

This is an example.

This is an equation: $E=mc^{2}$

This is also an equation: 

$$E=mc^{2}$$

```{r echo=TRUE, eval=FALSE}
summary(mtcars)
```

Code

Embedding Code

Many times you might have seen annoying library messages:

---
title: "Statistical Analysis Report"
author: "Your Name"
date: "2024-11-05"
format: html
toc: true
toc-title: "Contents"
---

# Introduction

This is an example.

This is an equation: $E=mc^{2}$

This is also an equation: 

$$E=mc^{2}$$

```{r echo=TRUE, eval=FALSE}
summary(mtcars)
```

```{r}
library(dplyr)
```

Code

Embedding Code

To avoid them in printing, you should do:

---
title: "Statistical Analysis Report"
author: "Your Name"
date: "2024-11-05"
format: html
toc: true
toc-title: "Contents"
---

# Introduction

This is an example.

This is an equation: $E=mc^{2}$

This is also an equation: 

$$E=mc^{2}$$

```{r echo=TRUE, eval=FALSE}
summary(mtcars)
```

```{r warning=FALSE, message=FALSE}
library(dplyr)
```

Embedding Resources

What is a Self-Contained HTML?

An HTML document that includes all dependencies (images, CSS, JavaScript) within a single file.

Why Use It?

Easy to share and view without requiring external resources.

This means that you will only see an html document being produced.

Embedding Resources

This is a complicated document (with formulae, graphs) without resource-embedding.

---
title: "Statistical Analysis Report"
author: "Your Name"
date: "2024-11-05"
format: html
toc: true
toc-title: "Contents"
---

# Introduction

This is an example.

This is an equation: $E=mc^{2}$

This is also an equation: 

$$E=mc^{2}$$

```{r echo=TRUE, eval=FALSE}
summary(mtcars)
```

```{r}
library(dplyr)
```

Embedding Resources

This a complicated document (with formulae, graphs) with resource-embedding.

---
title: "Statistical Analysis Report"
author: "Your Name"
date: "2024-11-05"
format: html
toc: true
toc-title: "Contents"
embed-resources: true
---

# Introduction

This is an example.

This is an equation: $E=mc^{2}$

This is also an equation: 

$$E=mc^{2}$$

```{r echo=TRUE, eval=FALSE}
summary(mtcars)
```

```{r}
library(dplyr)
```

Embedding Resources

Sending an Email with Your Work

You should always submit embedded documents.

If you don’t send embedded documents, the formatting will be off for the recipient

Embedding Resources

Sending an Email with Your Work

You should always submit embedded documents.

If you don’t send embedded documents, the formatting will be off for the recipient

Text Formatting

This is how we format text within our document.

---
title: "Statistical Analysis Report"
author: "Your Name"
date: "2024-11-05"
format: html
toc: true
toc-title: "Contents"
---

# Introduction

```{r echo=TRUE, eval=FALSE}
summary(mtcars)
```

*This is italic text.*

**This is bold text.**

***This is bold and italic.***

This is reference to a `qmd` document.

Headings

This is how we add headings and subheadings.

---
title: "Statistical Analysis Report"
author: "Your Name"
date: "2024-11-05"
format: html
toc: true
toc-title: "Contents"
---

# Introduction

```{r echo=TRUE, eval=FALSE}
summary(mtcars)
```

The following are headers:

# Header 2
## Subheader 1
### Sub-subheader 1

Headings

This is how we can automatically number the headers.

---
title: "Statistical Analysis Report"
author: "Your Name"
date: "2024-11-05"
format: html
toc: true
toc-title: "Contents"
number-sections: true
---

# Introduction

```{r echo=TRUE, eval=FALSE}
summary(mtcars)
```

The following are headers:

# Header
## Subheader
### Sub-subheader

Headings

This is how we can remove some headers from being numbered.

---
title: "Statistical Analysis Report"
author: "Your Name"
date: "2024-11-05"
format: html
toc: true
toc-title: "Contents"
number-sections: true
---

# Introduction

```{r echo=TRUE, eval=FALSE}
summary(mtcars)
```

The following are headers:

# Header
## Subheader {.unnumbered}
### Sub-subheader {.unnumbered}

Headings

This is how we can remove some headers from being numbered and from the Table of Contents

---
title: "Statistical Analysis Report"
author: "Your Name"
date: "2024-11-05"
format: html
toc: true
toc-title: "Contents"
number-sections: true
---

# Introduction

```{r echo=TRUE, eval=FALSE}
summary(mtcars)
```

The following are headers:

# Header
## Subheader {.unnumbered .unlisted}
### Sub-subheader {.unnumbered .unlisted}

Headings

This is how we can remove some headers from being numbered and from the Table of Contents

Pictures

This is how we add pictures.

---
title: "Statistical Analysis Report"
author: "Your Name"
date: "2024-11-05"
format: html
toc: true
toc-title: "Contents"
---

# Introduction

This is how we can include pictures:

![](graphs/elephant.png){width="50%"}

You can download the picture here.

Lists

This is how we add lists.

---
title: "Statistical Analysis Report"
author: "Your Name"
date: "2024-11-05"
format: html
toc: true
toc-title: "Contents"
---

# Introduction

* unordered list
  + sub-item 1
  + sub-item 2
    - sub-sub-item 1

1. ordered list
2. item 2
    i) sub-item 1
         A.  sub-sub-item 1

Tables

This is how we add tables.

---
title: "Statistical Analysis Report"
author: "Your Name"
date: "2024-11-05"
format: html
toc: true
toc-title: "Contents"
---

# Introduction

This is a table.

| Right | Left | Default | Center |
|------:|:-----|---------|:------:|
|    12 | 12   | 12      |   12   |
|   123 | 123  | 123     |  123   |
|     1 | 1    | 1       |   1    |

Diagrams

Quarto has native support for embedding Mermaid and Graphviz diagrams.

This enables you to create flowcharts, sequence diagrams, state diagrams.

---
title: "Statistical Analysis Report"
author: "Your Name"
date: "2024-11-05"
format: html
toc: true
toc-title: "Contents"
---

# Introduction

This is a diagram.

```{mermaid}
%%| echo: fenced
flowchart LR
  A[Hard edge] --> B(Round edge)
  B --> C{Decision}
  C --> D[Result one]
  C --> E[Result two]
```

Videos

You can include videos in documents using the {{< video >}} shortcode. For example, here we embed a YouTube video:

Videos can refer to video files (e.g. MPEG) or can be links to videos published on YouTube, Vimeo, or Brightcove.

{{< video https://www.youtube.com/embed/wo9vZccmqwc >}}

Callout Blocks

Markdown Syntax

:::{.callout-note}
Note that there are five types of callouts, including: 
`note`, `tip`, `warning`, `caution`, and `important`.
:::

Output

Note

Note that there are five types of callouts, including note, tip, warning, caution, and important.

Word Basics

In order to create Word docs you will need to install:

Terminal
quarto tools install chromium

Word Basics

In order to create Word docs you will need to install:

Terminal
quarto tools install chromium

Word Basics

In order to create Word docs you will need to install:

Terminal
quarto tools install chromium

Word Basics

In order to create Word docs you will need to install:

Terminal
quarto tools install chromium

Word Basics

Use the docx format to create MS Word output. For example:

---
title: "My Document"
format:
  docx:
    toc: true
    number-sections: true
    highlight-style: github
---

PDF Basics

Use the pdf format to create PDF output. For example:

---
title: "My Document"
format:
  pdf:
    toc: true
    number-sections: true
    colorlinks: true
---

Prerequisites

In order to create PDFs you will need to install a recent distribution of TeX. I recommend the use of TinyTeX (which is based on TexLive), which you can install with the following command:

Terminal
quarto install tinytex

Anatomy of the Article

We are now ready to study the anatomy of the article

You can access the qmd file with the article template and the bib file.

Unzip the files and place them in the paper folder, as illustrated below:

Anatomy of the Article

Understanding

Anatomy of the Article

Understanding

Anatomy of the Article

Understanding

Anatomy of the Article

Understanding

Anatomy of the Article

Understanding

Anatomy of the Article

Getting References to Work

To make sure that references work, it is crucial that the the *.bib file and the *.qmd file are in the same folder.

Anatomy of the Article

Understanding

Once you are done, if you want to share your work via email, make sure to attach the embedded html to the email or the pdf

Anatomy of the Article

Understanding

Once you are done, if you want to share your work via email, make sure to attach the embedded html to the email or the pdf

Conclusion

There are lots of options for Quarto Documents:

Check out the Quarto Guide

Most relevant are:

  • Authoring
  • Computations
  • Documents
  • Presentations