Appendix B: Callout Boxes

This page is still under construction

B.1 Introduction

I am using five different types of cross references. Many numbered links refer to three different types of callout boxes:

  1. Quarto callout blocks: These are five standard small callout boxes: Note, Tip, Important, Caution, and Warning. In contrast to the other two types of callout boxes I am not using menu tabs inside these boxes. (Section B.2)
  2. Theorems: These boxes are the commonly used theorems in articles and books in mathematics. There are ten theorem variations supported, each with their own label prefix: Theorem, Lemma, Corollary, Proposition, Conjecture, Definition, Example, Exercise, Solution, and Remark. I have changed most of these labels to highlight certain text types of my personal notes. Some of the theorems variation are used (partly with different name / label) as a collection of related R code chunks.
  3. Custom boxes: As I needed more text types I have added several custom boxes. In contrast to the theorems and callout blocks is the numbering and title not in header but in an extra line above or under the box.
  4. Special cases: Figures, Tables and Listings have special treatments. They are used inside R code chunks, have special and have routines in \(\LaTeX\) to generate listings. You can also generate dynamic captions and labels. Unfortunately there is still a glitch in Quarto version 1.4.549 with #lst- for code listing: If you are using it inside the code chunk then the code is always visible, e.g., your code-fold: true argument does not work. I have therefore used the listings — similar as custom boxes — with the header as an extra top line.
  5. Citations: I am using Zotero to organize my citations and have all references collected into the references.bib file.

B.2 Quarto callout blocks

In Quarto there are five predefined callout blocks: note, tip, caution, warning and important. Callout boxes have different features.

B.2.1 Default

B.2.1.1 With default title

Important

This is the default mode for a callout block, in this case for callout type important.

You can change the default title in _quarto.yml, for instance, with the line callout-important-title: "Your default title"

B.2.1.2 With Header

Callout with header

This is still the default mode for a callout block, but in this case with a header specified by you.

For this to happen you have either to provide the first line as a markdown header (e.g., ## Your default title) or to add title="Your default title" in the definition line of the callout.

B.2.2 Changing appearances

There are several ways to change the appearance of the callout.

B.2.2.1 Collapsed / Expanded (default)

This is the default mode for a callout block of type important, but in this case collapsed.

There is the expanded default mode but with collapse=true you can fold and therefore hide the text inside the callout. With clicking on the header users can open the callout box and read the text.

I haven’t used the collapse mode in this book, because the text inside a closed box cannot be found with a browser search.

See cross-reference: Important B.1

  • If the first text line is a header starting with a sequence of # than the content of the header is included into the header of the callout block.
  • If the definition line does not contain the code for cross references (starting with {#nte-}) than the box is not numbered. If you have provided a different title for the block (for instance in _quarto.yml) than this title will appear unnumbered at the block header.
  • If you include style="color: <color>;" in the definition line, than the block text will be colored. You can use Hex code for the colors or color names, but — as far as I know — only the first color of the different 78 boxes in R Charts Colors works, e.g. colors without a number behind the name.

I have used the Quarto callout blocks in this book for the following purposes:

B.2.3 Callout Note

Note B.1: Differences between book and my notes

I am using this box to specify and rationalize my code changes with respect to the book’s code patterns.

For more theoretical or personal thoughts I have used the theorem variation “Remark.”

There is a second usage of callout note without numbering: In this case it highlights the wording for the null and alternate hypotheses with the title “Wording for H0 and HA”.

See cross-reference: Note B.1

B.2.4 Callout Tip

Tip B.1: Until now (chapter 9, 2023-04-11) not used in this book

So far I haven’t used the “Tip” callout box with numbering. As I have provided many theorems with different names I haven’t needed the tip box so far. Most of the tips are links collected under the theorem variation “Lemma” with the label “Resource”. Sometimes I have written essential reminders for my learning activities into the “Important” box.

In the future, I will use it as a reminder for my own learning. It could contain also some links, but this box is not a link collection as the resource callout, but an argumentation and description what to learn.

But I have used this box without numbering with the label “Report”. Under this heading I have summarized the analysis of data, mostly taken the text from the book. Sometimes I had to refer to another “Report” box to compare some wording. In this case I have added the custom box #rep- with the label “Report”.

B.2.5 Callout Caution

Caution B.1: When to use the caution box?

Caution is typically used to indicate a potential hazard that may cause minor injuries or damage if not taken seriously. It serves as a reminder to be careful and exercise caution in order to prevent accidents. (Caution versus Warning)

In the context of this book I am using the caution box to draw attention to something. If you don’t mind it will result in more complex work, results or other issues one should prevent. If you don’t pay attention to the caution box then the chances for errors will grow.

So far I haven’t applied this callout box. But I have used very heavily the custom unnumbered box “Watch Out” (35x) with the same — resp. similar — purpose. I am planning to transfer these paragraphs to a numbered alternative either as custom box or as a caution callout box.

B.2.6 Callout Warning

Warning B.1: When to use the warning box?

Warning is used to indicate a more serious and immediate danger that could result in severe injuries or even death if not heeded. It implies a higher level of urgency and demands immediate attention and action to avoid potential harm. (Caution versus Warning)

In the context of this book I am using the warning box to prevent a mistake, a wrong procedure. If you don’t mind it will result in an error or other glitch that will lead to wrong results. If you don’t pay attention to the warning blunder will occur.

So far I have used this callout box only 3 times. I have to check if these applications conforms with the purpose of the box.

B.2.7 Callout Important

Important B.2: Essential statements and take home messages

This box indicates crucial points, very often reminder to me to observe something or to learn something in greater detail or more thoroughly.

So far I haven’t used this callout box, instead,I have applied an unnumbered custom box alternative 22 times. Again I am planning an transfer to a numbered alternative, possibly to this callout box.

B.2.8 Plain callout class

Exercise

You can also use a plain callout class to get a simple callout treatment.

B.2.9 Summary

Table B.1: Purpose and appearances of callout boxes
Callout Code CSS-style Code Purpose / without Code
Note #nte- style=“color: blue;” Book differences / H0-HA
Tip #tip- style=“color: darkgreen;” Learning reminder / Report
Caution #cau- style=“color: darkgoldenrod;” Pay attention
Warning #wrn- style=“color: darkorange;” Prevent mistake
Important #imp- style=“color: red;”. Crucial observations, definitions

B.3 Theorems and variations

All theorem boxes are provided in two forms: numbered and unnumbered. They use the provided cross-reference code for numbering but their names are often changed for my purposes.

In the following collection I have provided the header with the following seqeunce:

  • original name of theorem variant
  • name in the output in parenthesis
  • cross reference code

“Solution” and “Remark” are somewhat different as the other Theorems variants: They have a cursive header name.

B.3.1 Conjecture (R Code) #cnj-

R Code B.1 : Numbered R Code Title

Code
1 + 1
#> [1] 2

B.3.2 Corollary (Assessment) #cor-

Assessment B.1 : Numbered Assessment Title

Here include assessment text

B.3.3 Definition (Experiment) #def-

Experiment B.1 : Numbered Experiment Title

Here include text for experiment

B.3.4 Example (Example) #exm-

Example B.1 : Numbered Example Title

Here include example text

B.3.5 Exercise (Exercise) #exr-

Exercise B.1 : Numbered Exercise Title

Here include exercise text

B.3.6 Lemma (Resource) #lem-

Resource B.1 : Numbered Resource Title

Here include text for the resource

B.3.7 Proposition (Procedure) #prp-

Procedure B.1 : Numbered Procedure Title

Here include procedure text

B.3.8 Remark (Remark) #rem-

Remark B.1. : Numbered Remark Title

Here include remark text

B.3.9 Solution (Solution) #sol-

Solution B.1. : Numbered Solution Title

Here include text for the solution

B.3.10 Theorem (Formula) #thm-

Formula B.1 : Numbered Theorem Title

\[ \begin{align*} \text{Here include text for the theorem} \end{align*} \tag{B.1}\]

See Formula B.1

B.4 Custom boxes

B.4.1 Bullet list unnumbered

Title for bullet list

Here include bullet list

B.4.2 Bullet list numbered #bul-

Title for bullet list

Here include bullet list

Bullet List B.1: Title for bullet list

B.4.3 Package description

Package Name

Here include package description

B.4.4 Package description example

cranlogs: Download Logs from the ‘RStudio’ ‘CRAN’ Mirror


{cranlogs}: Download Logs from the RStudio CRAN Mirror (Csárdi 2019)


API to the database of CRAN package downloads from the RStudio CRAN mirror. The database itself is at http://cranlogs.r-pkg.org, see https://github.com/r-hub/cranlogs.app for the raw API.

RStudio publishes the download logs from their CRAN package mirror daily at http://cran-logs.rstudio.com.

This R package queries a web API maintained by R-hub that contains the daily download numbers for each package.

The RStudio CRAN mirror is not the only CRAN mirror, but it’s a popular one: it’s the default choice for RStudio users. The actual number of downloads over all CRAN mirrors is unknown.

{cranlogs}: Download Logs from the ‘RStudio’ ‘CRAN’ Mirror


This is the first line.

And this is the second line.


And here is normal text again.

B.4.5 TODO (checklist)

TODO

Here include checklist text

Numbered TODO list (checklist) #tdo

Numbered TODO title

Here include checklist text

TODO B.1: Title for TODO List

Objectives for Chapter XX

Here include solution text

Objectives B.1: Achievements for chapter XX

Numbered watch-out title

Here include watch-out text

Watch-Out B.1: Title for watch-out text

Numbered important title

Here include important text

Title for important text

Typo Title

Here include typo text

B.5 Generating new box types

Note B.2

Standard Box to compare.

B.5.1 Callout blocks with pre-defined name

Solution B.2.

This is my test for a new kind of solution box

It uses a with pre-defined cross reference #exm-

And here comes some other content inside of it

This is my test solution box without numbering

And some content inside of it

See: Solution B.2

B.5.2 Callout block with custom name

Bullet List B.2

: This is my test for a new kind of bullet list box

It uses a with pre-defined cross reference #bul-

Ass you can see the generated number has a different header style

See: Bullet List B.2

B.5.3 Callout box with custom name

Report B.1

: This is my test for a theorem box

I use a custom cross reference #rep-.

The percentage of uninsured residents in a county is a statistically significant predictor of the distance to the nearest syringe program (b = 7.82; p < .05) in our sample. For every 1% increase in uninsured residents in a county, the predicted distance to the nearest syringe program increases by 7.82 miles.

And here comes some other content inside of it

See cross reference on this page: Report B.1

See cross reference in another chapter: Section A.92