Code
1 + 1
#> [1] 2
I am using five different types of cross references. Many numbered links refer to three different types of callout boxes:
#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.references.bib
file.In Quarto there are five predefined callout blocks: note, tip, caution, warning and important. Callout boxes have different features.
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"
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.
There are several ways to change the appearance of the callout.
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
#
than the content of the header is included into the header of the callout block.{#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.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:
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
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”.
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.
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.
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.
callout
classCallout | 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 |
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:
theorem
variant“Solution” and “Remark” are somewhat different as the other Theorems variants: They have a cursive header name.
#cnj-
R Code B.1 : Numbered R Code Title
1 + 1
#> [1] 2
#cor-
Assessment B.1 : Numbered Assessment Title
Here include assessment text
#def-
Experiment B.1 : Numbered Experiment Title
Here include text for experiment
#exm-
Example B.1 : Numbered Example Title
Here include example text
#exr-
Exercise B.1 : Numbered Exercise Title
Here include exercise text
#lem-
Resource B.1 : Numbered Resource Title
Here include text for the resource
#prp-
Procedure B.1 : Numbered Procedure Title
Here include procedure text
#rem-
Remark B.1. : Numbered Remark Title
Here include remark text
#sol-
Solution B.1. : Numbered Solution Title
Here include text for the solution
#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
Title for bullet list
Here include bullet list
#bul-
Package Name
Here include package description
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.
TODO
Here include checklist text
Numbered TODO list (checklist) #tdo
Numbered important title
Here include important text
Title for important text
Typo Title
Here include typo text
Standard Box to compare.
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
: 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
: 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