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?
---
title: "Statistical Analysis Report"
author: "Your Name"
date: "2024-11-05"
format: html
---
# Introduction
This is an example.
---
title: "Statistical Analysis Report"
author: "Your Name"
date: "2024-11-05"
format: html
---
# Introduction
This is an example.
To generate an HTML file, specify format: html
in the YAML header.
Use quarto render
in R to generate the output.
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.
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.
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}$
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}$$
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}$$
For more advanced equations, check: https://qmd4sci.njtierney.com/math
This is how we include code in our documents.
This is how we include code in our documents.
This is how we only include code output in our documents.
This is how we only include code without output in our documents.
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)
```
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)
```
What is 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.
This 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)
```
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)
```
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.
This is how we add headings and subheadings.
This is how we can automatically number the headers.
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}
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}
This is how we add links.
---
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 links:
<https://quarto.org>
Another way is: [Quarto](https://quarto.org)
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:
![](figures/elephant.png){width="50%"}
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
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 |
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]
```
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.
:::{.callout-note}
Note that there are five types of callouts, including:
`note`, `tip`, `warning`, `caution`, and `important`.
:::
Note
Note that there are five types of callouts, including note
, tip
, warning
, caution
, and important
.
In order to create Word docs you will need to install:
In order to create Word docs you will need to install:
In order to create Word docs you will need to install:
In order to create Word docs you will need to install:
Use the docx format to create MS Word output. For example:
---
title: "My Document"
format:
docx:
toc: true
number-sections: true
highlight-style: github
---
Use the pdf
format to create PDF output. For example:
---
title: "My document"
format:
pdf:
toc: true
number-sections: true
colorlinks: true
---
In order to create PDFs you will need to install a recent distribution of TeX. We recommend the use of TinyTeX (which is based on TexLive), which you can install with the following command:
Quarto uses KOMA Script document classes by default for PDF documents and books.
For PDF documents this results in the following Pandoc options set by default:
You can set documentclass
to the standard article
, report
or book
classes.
Note
Setting your documentclass
to either book
or scrbook
will automatically handle many of the common needs for printing and binding PDFs into a physical book.
There are numerous options available for customizing PDF output, including:
Specifying document classes and their options
Including lists of figures and tables
Numerous options for customizing fonts and colors.
For example, here we use a few of these options:
Here is an example:
Quarto manuscript projects provide a framework for writing and publishing scholarly articles.
By using one or more notebooks or .qmd
documents as the source of content and computations, computations can be published alongside the manuscript, allowing readers to dive into your code.
It is possible to produce manuscripts in multiple formats (including LaTeX or MS Word)
The output of a Quarto manuscript is a website (live example)
There are lots of options for Quarto Documents:
Checkout the Quarto Guide
Most relevant are:
Please make sure that your assignments look nice from now on 😄
Popescu (JCU): Quarto Essentials