Tom Mock
9/27/22
Format | Insert | Table |
---|---|---|
You may have a set of parameters that are used to create different variations of a report. For example:
```{r}
#| label: setup
#| include: false
library(tidyverse)
library(palmerpenguins)
penguin_filter <- penguins |>
filter(species == params$species,
!is.na(body_mass_g))
diff_rows <- nrow(penguins) - nrow(penguin_filter)
```
quarto render penguin-report.qmd -P species:Gentoo --output gentoo-report.html
quarto render penguin-report.ipynb -P species:Gentoo --output gentoo-report.html
Example adapted from tidymodels
docs
Structure:
:
- minimum of 3 :::
{.class}
or {sometimes-class}
Split up and flip between sections of a page, alternative to just two columns
mpg cyl disp hp drat wt qsec vs am gear carb
Mazda RX4 21.0 6 160 110 3.90 2.620 16.46 0 1 4 4
Mazda RX4 Wag 21.0 6 160 110 3.90 2.875 17.02 0 1 4 4
Datsun 710 22.8 4 108 93 3.85 2.320 18.61 1 1 4 1
Hornet 4 Drive 21.4 6 258 110 3.08 3.215 19.44 1 0 3 1
Hornet Sportabout 18.7 8 360 175 3.15 3.440 17.02 0 0 3 2
Valiant 18.1 6 225 105 2.76 3.460 20.22 1 0 3 1
This is magic text
Structure:
[text]
{.class}
or {sometimes-class}
You can create inline footnotes like so: some inline text with a^[footnote]
If you hover your mouse over the citation and footnote in this sentence you’ll see a popup displaying the reference contents:
Layout image inline with paragraphs
::: {layout="[[30, 70], [100]]"}
![Terrier Seated](Terrier_Seated_(Boston_Public_Library).jpeg){width="50%" fig-alt="Description of boston terrier"}
...paragraph 1...
...paragraph 2...
:::
Put image into the “gutter”/column margin
For example, here we specify that we want only “View Source” (no toggling of code visibility) and no caption on the code menu:
In some situations (especially for longer documents), you may prefer to send viewers to the source code on a version-control website rather than the built in viewer.
downlit
The goal of
downlit
is to provide syntax highlighting and automatic linking of R code
Out of the box, Quarto is styled with Bootstrap 5 and opinionated defaults.
Bootstrap is the most popular CSS Framework for responsive websites, where v5 is the latest.
Quarto comes pre-installed with 25 themes from Bootswatch and you can use them like so:
See more on Journal Articles at https://github.com/quarto-journals/
Great work from the NFMS Open Science team on “Quarto titlepages”: https://nmfs-opensci.github.io/quarto_titlepages/
The tex templates were written by Eli Holmes and the lua filter along with changes to the Pandoc templates to allow themes was written by Mickaël Canouil.
Quarto supports a variety of formats for creating presentations, including:
revealjs
— reveal.js (HTML)
pptx
— PowerPoint (MS Office)
beamer
— Beamer (LaTeX/PDF)
Controllable via YAML:
format: revealjs
Alt + Click to Zoom in to a section
Absolute position allows for tight control of placement.
output-location: column-fragment
Quarto comes with 10 built-in themes:
beige
, blood
, dark
, default
, league
, moon
, night
, serif
, simple
, sky
, solarized
@import url('https://fonts.googleapis.com/css2?family=Fira+Mono&family=Open+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400;1,500;1,600;1,700;1,800&display=swap');
/*-- scss:defaults --*/
$link-color: #EE6331;
$font-family-sans-serif: 'Open Sans', sans-serif;
$font-family-monospace: 'Fira Mono', monospace;
$presentation-title-slide-text-align: left;
/*-- scss:rules --*/
h2 {
color: #447099 !important;
}
## Slide Background {background-color="black" background-image="images/howard-gentleman.jpeg" background-size="100px" background-repeat="repeat"}
Attribute | Default | Description |
---|---|---|
background-image |
URL of the image to show. GIFs restart when the slide opens. | |
background-size |
cover | See background-size on MDN. |
background-position |
center | See background-position on MDN. |
background-repeat |
no-repeat | See background-repeat on MDN. |
background-opacity |
1 | Opacity of the background image on a 0-1 scale. 0 is transparent and 1 is fully opaque. |
Changing the background color will modify the font color for better contrast
Automatically plays a full size video behind the slide.
Attribute | Default | Description |
---|---|---|
background-video |
A single video source, or a comma separated list of video sources. | |
background-video-loop |
false | Flags if the video should play repeatedly. |
background-video-muted |
false | Flags if the audio should be muted. |
background-size |
cover | Use cover for full screen and some cropping or contain for letterboxing. |
background-opacity |
1 | Opacity of the background video on a 0-1 scale. 0 is transparent and 1 is fully opaque. |
r-stack
+ fragmentsr-stack
+ fragmentsFrom Emil’s article:
Use bracketed spans: [text to color]{.yellow}
or use RStudio’s Visual Editor:
Read all the docs at https://quarto.org/docs/guide/