Code
1 + 1
#> [1] 2
Overview
I have embedded most of the pre-defined cross-references in callout boxes. The exceptions are figure (fig
) and table (tbl
)
What follows is an overview of
- crossref-cnj-title: "R Code" # replaces "Conjecture"
- crossref-cor-title: "Assessment" # replaces "Corollary"
- crossref-def-title: "Experiment" # remains "Definition"
- crossref-exm-title: "R Code Collection" # replaces "Example"
- crossref-exr-title: "Exercise" # remains "Exercise"
- crossref-fig-title: "Screenshot" # replaces "Figure"
- crossref-rem-title: "Remark " # remains "Remark"
- crossref-lem-title: "Resource" # replaces "Lemma"
- crossref-lst-title: "Listing / Output" # replaces "Listing"
- crossref-prp-title: "Procedure" # replaces "Proposition"
- crossref-sol-title: "Solution" # remains "Solution"
- crossref-tbl-title: "Table" # remains "Table"
- crossref-thm-title: "Formula" # replaces "Theorem" (needs "formula")
The following table lists all callout boxes. Besides of the difference between numbered boxes and unnumbered boxes there are two different types of (numbered) boxes:
exr
), Definition (def
) and Conjecture (con
).
quarto.yml
under the metadata heading language
. For instance I replaced Definition
with Experiment
, Conjecture
with R Code
, but kept Exercise
.bul
) and Checklists (tdo
).The fourth column snippet
shows the shortcut to call the Markdown snippet I have prepared. (Learn more about RStudio code snippets.) For each of these snippets there exist a corresponding CSS style. As I am not very experienced in CSS I gratefully adapted code by Andreas Handel (2023). (I just noticed there there was recently an update (2025) that I still need to read.)
The fifth column is a reference to an empty example showing just the bones of the callout-boxes. It is not necessary to jump to the location. If you hover with the mouse over the link Quarto will show you a small version of the callout box.
My Title | Quarto | Ref | Snippet | Reference to example |
---|---|---|---|---|
Assessment | Corollary | — | my-assessment | Section C.2.1 |
Assessment | Corollary | cor | num-assessment | Section C.2.2 |
Bullet List | ———- | — | my-bullet | Section C.3.1 |
Bullet List | ———- | bul | num-bullet | Section C.3.2 |
Checklist | ———- | — | my-check | Section C.4.1 |
Checklist | ———- | tdo | num-check | Section C.4.2 |
Exercise | Exercise | — | my-exercise | Section C.5.1 |
Exercise | Exercise | exr | num-exercise | Section C.5.2 |
Exercise | Exercise | exr | ab-exercise | Section C.5.3 |
Exercise | Exercise | exr | abc-exercise | Section C.5.4 |
Experiment | Definition | — | my-experiment | Section C.6.1 |
Experiment | Definition | def | num-experiment | Section C.6.2 |
Important | ———- | — | my-important | Section C.7.1 |
Listing / Output | Listing | lst | ——————- | Section C.14 |
Objectives | ———- | obj | my-objectives | Section C.8.1 |
Package Profile | ———- | — | my-package | Section C.9.1 |
Package Profile | ———- | — | packagebox | Section C.9.2 |
Procedure | Proposition | — | my-procedure | Section C.10.1 |
Procedure | Proposition | prp | num-procedure | Section C.10.2 |
R Code | Conjecture | — | my-r-code | Section C.11.1 |
R Code | Conjecture | cnj | num-r-code | Section C.11.2 |
R Code | Conjecture | cnj | num-r-code-listing | Section C.11.3 |
R Code Collection | Example | exm | ab-code | Section C.12.3 |
R Code Collection2 | ———- | col | ab-code2 | Section C.12.4 |
R Code Shiny | Conjecture | cnj | num-r-shiny | Section C.18.1 |
Remark | Remark | — | my-remark | Section C.15.1 |
Remark | Remark | rem | num-remark | Section C.15.2 |
Report | ———- | rep | num-report | Section C.16.1 |
Resource | Lemma | my-resource | Section C.17.1 | |
Resource | num-resource | Section C.17.2 | ||
Screenshot | Figure | figure | Section C.13.1 | |
Screenshot | figure-border | Section C.13.2 | ||
Solution | sr2 | Section C.19.1 | ||
Solution | my-solution | Section C.19.2 | ||
Solution | num-solution | Section C.19.3 | ||
Table | Table | ——————- | Section C.20 | |
Tip | ———- | — | my-tip | Section C.21.1 |
Typo | ———- | — | my-typo | Section C.23.1 |
Theorem | Theorem | formula | Section C.22.1 | |
Theorem | Theorem | my-theorem | Section C.22.2 | |
Theorem | Theorem | num-theorem | Section C.22.3 | |
Watch Out | ———- | my-watch | Section C.24.1 | |
Watch Out | ———- | num-watch | Section C.24.2 |
Title for assessment comes here
Here include text for assessment
Assessment C.1 : Numbered Assessment Title
Here include assessment text
Title for bullet text
Here include bullet text
: Title for bullet text
Here include bullet text
Title for checklist text
Here include checklist text
: Title for checklist text
Here include checklist text
Exercise Title
Here include exercise text
Exercise C.1 : Numbered Exercise Title
Here include exercise text
Exercise C.2 : Numbered Exercise Title
R Code C.1 : Numbered R Code Title 1
1 + 1
#> [1] 2
R Code C.2 b: Numbered R Code Title (Tidyverse)
1 + 1
#> [1] 2
Exercise C.3 : Title of abc-exercise
R Code C.3 : Title of code exercise
Solution C.1. : Title of solution
Solution C.2. : Title of Shiny app
#| '!! shinylive warning !!': |
#| shinylive does not work in self-contained HTML documents.
#| Please set `embed-resources: false` in your metadata.
#| standalone: true
#| viewerHeight: 550
#| components: [editor, viewer]
Title of Experiment
Here include text for experiment
Experiment C.1 : Numbered Experiment Title
Here include text for experiment
Important Title
Here include text for important box
Learning Objectives:
Here include text for objectives
Package Name
Here include package description
Package Profile: package-name
personal comment
This above snippets generates also a level two header and is intended for my annex chapter Appendix A. I have changed the level two header to a level four header, otherwise it would destroy my section structure of this chapter.
Additionally this snippets needs an image (or the deletion of the corresponding code lines) and bibliography (reference tot the author of the package).
Procedure Title
Here include procedure text
Procedure C.1 : Numbered Procedure Title
Here include procedure text
Title for R-Code
Here include code lines
R Code C.4 : Numbered R Code Title
1 + 1
#> [1] 2
R Code C.5 : Numbered R Code Listing Title
1 + 1
#> [1] 2
Title for my example
Here include text
Code Collection C.1 : Numbered Example Title
Here include example text
Code Collection C.2 : Title for code collection
R Code C.6 : Numbered R Code Title (Original)
1 + 1
#> [1] 2
R Code C.7 : Numbered R Code Title (Tidyverse)
1 + 1
#> [1] 2
R Code C.8 : Numbered R Code Title (Original)
1 + 1
#> [1] 2
R Code C.9 : Numbered R Code Title (Tidyverse)
1 + 1
#> [1] 2
There is no snippet for listings. Listings is included in num-r-code-listing
(see: Section C.11.3).
Title for remark
Here include remark lines
Remark C.1. : Numbered Remark Title
Here include remark text
: Numbered Reportbox Title
Here include report box text
Title for resource
Here include resource text
Resource C.1 : Numbered Resource Title
Here include text for the resource
R Code C.10 : Numbered R Code Title
#| '!! shinylive warning !!': |
#| shinylive does not work in self-contained HTML documents.
#| Please set `embed-resources: false` in your metadata.
#| standalone: true
#| viewerHeight: 550
#| components: [editor, viewer]
#| layout: vertical
library(shiny)
start coding here
Exercise ID: Header
Description more in Detail
My Solution
Here comes the solution
The above box is intended for the text description of a task or challenge, followed by the R code as the solution. But it has no numbering!
Solution:
Here include solution text
Solution C.3. : Numbered Solution Title
Here include text for the solution
No changes, no snippet.
Title for Tip / Hint
Here include text for tip / hint box
\[ \begin{align*} formula \end{align*} \tag{C.1}\]
Read Mathematics in R Markdown
The numbering for theorems / formula is different than from the other cross-references / callout boxes.
Title of theorem
Here include theorem text
Formula C.1 : Numbered Theorem Title
\[ \begin{align*} \text{Here include text for the theorem} \end{align*} \tag{C.2}\]
Typo Title
Here include typo text
Title for watch-out text
Here include watch-out text
: Title for watch-out text
Here include watch-out text
term | definition |
---|---|
CSS | Cascading Style Sheets (CSS) is a style sheet language used for specifying the presentation and styling of a document written in a markup language such as HTML or XML (including XML dialects such as SVG, MathML or XHTML). CSS is a cornerstone technology of the World Wide Web, alongside HTML and JavaScript. CSS is designed to enable the separation of content and presentation, including layout, colors, and fonts. (<a href="https://en.wikipedia.org/wiki/CSS">Wikipedia</a>) |
Session Info
sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#> setting value
#> version R version 4.5.0 (2025-04-11)
#> os macOS Sequoia 15.5
#> system aarch64, darwin20
#> ui X11
#> language (EN)
#> collate en_US.UTF-8
#> ctype en_US.UTF-8
#> tz Europe/Vienna
#> date 2025-06-23
#> pandoc 3.7.0.2 @ /opt/homebrew/bin/ (via rmarkdown)
#> quarto 1.8.4 @ /usr/local/bin/quarto
#>
#> ─ Packages ───────────────────────────────────────────────────────────────────
#> package * version date (UTC) lib source
#> cli 3.6.5 2025-04-23 [1] CRAN (R 4.5.0)
#> commonmark 1.9.5 2025-03-17 [1] CRAN (R 4.5.0)
#> curl 6.3.0 2025-06-06 [1] CRAN (R 4.5.0)
#> dichromat 2.0-0.1 2022-05-02 [1] CRAN (R 4.5.0)
#> digest 0.6.37 2024-08-19 [1] CRAN (R 4.5.0)
#> evaluate 1.0.3 2025-01-10 [1] CRAN (R 4.5.0)
#> farver 2.1.2 2024-05-13 [1] CRAN (R 4.5.0)
#> fastmap 1.2.0 2024-05-15 [1] CRAN (R 4.5.0)
#> glossary * 1.0.0.9003 2025-06-08 [1] local
#> glue 1.8.0 2024-09-30 [1] CRAN (R 4.5.0)
#> htmltools 0.5.8.1 2024-04-04 [1] CRAN (R 4.5.0)
#> htmlwidgets 1.6.4 2023-12-06 [1] CRAN (R 4.5.0)
#> jsonlite 2.0.0 2025-03-27 [1] CRAN (R 4.5.0)
#> kableExtra 1.4.0 2024-01-24 [1] CRAN (R 4.5.0)
#> knitr 1.50 2025-03-16 [1] CRAN (R 4.5.0)
#> lifecycle 1.0.4 2023-11-07 [1] CRAN (R 4.5.0)
#> litedown 0.7 2025-04-08 [1] CRAN (R 4.5.0)
#> magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.5.0)
#> markdown 2.0 2025-03-23 [1] CRAN (R 4.5.0)
#> R6 2.6.1 2025-02-15 [1] CRAN (R 4.5.0)
#> RColorBrewer 1.1-3 2022-04-03 [1] CRAN (R 4.5.0)
#> rlang 1.1.6 2025-04-11 [1] CRAN (R 4.5.0)
#> rmarkdown 2.29 2024-11-04 [1] CRAN (R 4.5.0)
#> rstudioapi 0.17.1 2024-10-22 [1] CRAN (R 4.5.0)
#> rversions 2.1.2 2022-08-31 [1] CRAN (R 4.5.0)
#> scales 1.4.0 2025-04-24 [1] CRAN (R 4.5.0)
#> sessioninfo 1.2.3 2025-02-05 [1] CRAN (R 4.5.0)
#> stringi 1.8.7 2025-03-27 [1] CRAN (R 4.5.0)
#> stringr 1.5.1 2023-11-14 [1] CRAN (R 4.5.0)
#> svglite 2.2.1 2025-05-12 [1] CRAN (R 4.5.0)
#> systemfonts 1.2.3 2025-04-30 [1] CRAN (R 4.5.0)
#> textshaping 1.0.1 2025-05-01 [1] CRAN (R 4.5.0)
#> vctrs 0.6.5 2023-12-01 [1] CRAN (R 4.5.0)
#> viridisLite 0.4.2 2023-05-02 [1] CRAN (R 4.5.0)
#> xfun 0.52 2025-04-02 [1] CRAN (R 4.5.0)
#> xml2 1.3.8 2025-03-14 [1] CRAN (R 4.5.0)
#> yaml 2.3.10 2024-07-26 [1] CRAN (R 4.5.0)
#>
#> [1] /Library/Frameworks/R.framework/Versions/4.5-arm64/library
#> [2] /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/library
#> * ── Packages attached to the search path.
#>
#> ──────────────────────────────────────────────────────────────────────────────