Introduction to Quarto Markdown

Leykun (MSc)1, Tesfamichael (MSc)2 & Yebelay (MSc)3

1NDMC, EPHI; 2SPH, AAU; 3DMU & C4ED


October 14 - 17, 2025

What is Quarto?

  • Next-generation scientific publishing system
  • Successor to R Markdown with enhanced features
  • Creates dynamic reports, presentations, websites, and books
  • Supports multiple languages (R, Python, Julia, Observable)
  • Publisher-neutral format with consistent output

Installation

  1. Ensure you have R and RStudio installed .
  2. Install Quarto:

Creating a Quarto Document

  • Create a new file in RStudio: File -> New File -> Quarto Document.
  • Use the following YAML header:
---
title: "Document Title"
author: "Your Name"
format: html
---

Writing Content

  • Use Markdown syntax for formatting text:
    • Bold: **text**
    • Italic: *text*
    • Lists:
      • - Item 1
      • - Item 2

Code

  • Embed R code chunks:
Code
library(tidyverse)
library(ggplot2)
library(labelled)
library(forcats)
library(haven)

# Read data or import data
an_data <- read_dta("data/ESPA_2021/ETAN81FLSP.DTA")
sc_data <- read_dta("data/ESPA_2021/ETSC81FLSP.DTA")
fc_data <- read_dta("data/ESPA_2021/ETFC81FLSP.DTA")

fc_data_fct <- to_factor(fc_data)
ggplot(fc_data_fct, aes(x = fct_rev(fct_infreq(factype)))) +
  geom_bar(fill = "#2E86AB", width = 0.5) +
  coord_flip()+
  geom_text(stat = 'count', aes(label = after_stat(count)),
            hjust = -0.1, size = 4) +
    labs(title = "Healthcare Facility Type Distribution",
       subtitle = "ESPA 2021 Facility Data",
       x = "Facility Type",
       y = "Count") +
  theme_classic() +
  theme(axis.line.x = element_blank() ) 

Code

Common Chunk Options:

  • #| echo: true (Show the code in the output)
  • #| echo: false (Hide the code, show only the output)
  • #| eval: false (Show the code, but don’t run it)
  • #| label: fig-plot (A unique label for the chunk)
  • #| fig-cap: "A caption for the figure." (Adds a figure caption)

Rendering and Sharing

  • Render your document: Click the Render button in RStudio.
  • Share as HTML, PDF, or Word document.
  • Use quarto render yourfile.qmd in the terminal for command line rendering.