Bookup quarto format example

Author

Jane Doe

Published

August 3, 2024

This is a sample document using the bookup-html custom quarto format.

You can learn more about this format and how to use it in the bookup-html Github repository.

Code and tables

Syntax highlighting

Here is a sample code chunk, just to show that syntax highlighting works as expected as well as code annotations.

say_hello <- function(name) {
1    paste("Hello,", name, "!")
}

2say_hello("world")
1
Quite an original example.
2
This is were all the action is happening.
[1] "Hello, world !"

Verbatim

Here is the structure of the penguins dataset.

library(palmerpenguins)
str(penguins)
tibble [344 × 8] (S3: tbl_df/tbl/data.frame)
 $ species          : Factor w/ 3 levels "Adelie","Chinstrap",..: 1 1 1 1 1 1 1 1 1 1 ...
 $ island           : Factor w/ 3 levels "Biscoe","Dream",..: 3 3 3 3 3 3 3 3 3 3 ...
 $ bill_length_mm   : num [1:344] 39.1 39.5 40.3 NA 36.7 39.3 38.9 39.2 34.1 42 ...
 $ bill_depth_mm    : num [1:344] 18.7 17.4 18 NA 19.3 20.6 17.8 19.6 18.1 20.2 ...
 $ flipper_length_mm: int [1:344] 181 186 195 NA 193 190 181 195 193 190 ...
 $ body_mass_g      : int [1:344] 3750 3800 3250 NA 3450 3650 3625 4675 3475 4250 ...
 $ sex              : Factor w/ 2 levels "female","male": 2 1 1 NA 1 2 1 2 NA NA ...
 $ year             : int [1:344] 2007 2007 2007 2007 2007 2007 2007 2007 2007 2007 ...

Tables

Sample table output.

tab <- table(penguins$island, penguins$species)
kable(tab)
Adelie Chinstrap Gentoo
Biscoe 44 0 124
Dream 56 68 0
Torgersen 52 0 0

Sample DT:datatable output.

library(DT)
DT::datatable(penguins)

Styling

A simple list :

  • one mississipi
  • two mississipi
  • three mississipi

A blockquote :

Oh ! What a nice blockquote you have here. Much more wonderful than a classical lorem ipsum, really.

And we could also include links or simply URLs like this : https://www.r-project.org/1.

An incredibly complex equation :

\[ y = \sqrt{\frac{1}{x + \beta}} \]

Figures

Here is an histogram.

library(ggplot2)
ggplot(data = penguins) +
    geom_histogram(aes(x = body_mass_g)) +
    facet_grid(rows = vars(species))
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
Warning: Removed 2 rows containing non-finite outside the scale range
(`stat_bin()`).

And a wonderful scatterplot, with a caption.

ggplot(data = penguins) +
    geom_point(
        aes(x = bill_length_mm, y = bill_depth_mm)
    )
Warning: Removed 2 rows containing missing values or values outside the scale range
(`geom_point()`).

This is a scatterplot

Callouts

Note

This is a note callout.

Warning

This is a warning callout

Important

This is an important callout

Caution

This is a caution callout

Tip

This is a tip callout.With a bit of code.

Tabset

This is the first tab content.

This is the second tab content.

Footnotes

  1. And even footnotes↩︎