# Writing academic papers with RMarkdown and friends

Cynthia Huang

ECC4860/ETC4860 Workshop, 9 Aug 2022

## Today's Agenda

Key Concepts

• Reproducible documents
• R Markdown
• LaTex, Bookdown
• Quarto, pandoc and more

Try it Yourself

• Hands-on authoring in RStudio
• Render a .pdf

Getting Help

• Search queries
• Good questions
• Further Resources
• Why reproducible authoring?
• How does R Markdown work?
• What about Bookdown, LaTex, Quarto and more?

## Key Concepts

### Why Reproducibility?

Image source: An Introduction to R

### Why R Markdown?

according to the internet...

Source: Stats Illustrations by Allison Horst

### Anatomy of .Rmd

natural language text

with formatting

"instructions"

procedural code

with options on how to

evaluate the code

Image source: Applied R code

### Quarto: R Markdown 2.0

• Render a .Rmd
• Add images, tables and citations

## Try It Yourself

• Make a new .Rproj in RStudio
• Render the default content
• Change the title of the document and render again

## Render This

output:
pdf_document:
toc: TRUE
• Write a sentence that contains inline R code
• What's the difference between these two examples?

I ate r 2 + 5 pieces of chocolate.
{r}
n_choc <- 7

I ate r n_choc pieces of chocolate.
• Add a sentence with a Greek Letter in it
• Switch to Visual Mode and back

This is the symbol for the greek letter lambda: $\lambda$

This is an equation:

$$x + y = 17$$
• Stay in Visual Mode
• Include a math symbol inside your table
• Change the caption of your table

• Stay in Visual Mode
• Drag and drop any image into your document
• Copy and paste an image into your document
• Insert a image using a link or local path

![local image](path/to/image)

![image from internet](image_url)

• Stay in Visual Mode
• Use the Cross-Ref search to find a paper you know
• Add a sentence using that citation

• Make advanced tables with {gt}
• Use templates to produce prettier documents (.docx)

## MS Word .docx

• RStudio's Visual mode

## Getting Help

Tutorials and How-Tos:

Quick References:

Into the weeds:

By Cynthia Huang

• 280