3  Links chapter

\(\definecolor{frog}{rgb}{1,0,0}\) \(\newcommand{\dx}{\,\text{d}x}\) \(\newcommand{\du}{\,\text{d}u}\) \(\newcommand{\dy}{\,\text{d}y}\) \(\newcommand{\dt}{\,\text{d}t}\)

This chapter can even link back to other whole chapters Section 1.1. Or equations in other chapters Equation 1.1. This is only true for the book template.

3.1 Equations

There is good Quarto documentation on how to crossref things Quarto Cross References.

The key thing to note is that if you plan to reference a standard object like a heading/section, the internal label name is restricted to begin with a particular three-letter prefix (except equations which get just the two letters eq). Plus Quarto recommends against using underscores in labels, hyphens are great.

New prefixes can be created, as this template does below to create new figures for videos called vid. Various default ones already exist like Theorems, Lemmas etc.. this template will demo the numbered-custom-boxes in Chapter 4 as an alternative. This alternative gives fine-grained numbering control, so you’ll need to avoid Quarto’s numbering. So if you do follow this recommendation then you must avoid using standard Quarto names like #thm-fermat because Quarto will be confused about which method you wish. So in the examples presented in Chapter 4 I have just started all references with #r to avoid overlap, e.g. #rthm-fermat.

Here’s an equation: \[ x^2 + y^2 = z^2 \tag{3.1}\] This equation was created using Quarto labelling syntax, i.e. like this

$$
x^2 + y^2 = z^2
$$ {#eq-squares}

Then you type @eq-squares to get Equation 3.1.

This section was defined like this

## Equations {#sec-equations}

as such we can now type @sec-equations and it will render as Section 3.1.

Quarto even provides a clever ‘hover to see a preview function’. (There is a way to disable it if you really wish)

The main difference/drawback to using the Quarto numbering system for equations is in equation blocks (equations on many consecutive lines), where LaTeX offers individually labelling of lines Quarto doesn’t. There is a more complex workaround to delegate all labelling of equations to MathJax which can replicate LaTeX behaviour but it’s easier to work around it.

3.2 Handling videos

One way to include videos is to use the Quarto syntax used to insert any figures. You can define a new type of figure. This template has defined a new float object called vid, then we can embed videos (using normal Quarto code) but label them and caption them like a figure but use vid instead of fig.

::: {#vid-vid3}
{{﹤video https://youtu.be/d2nG7Y17sQw 
  title = "Binomial response models applied to beetle mortality data (9m59s)",
  <other customizations can be put here>
>}}

This is the caption.
:::

For more details: Quarto video manual

Here it is:

Video 3.1: This is the caption.

Referencing is simple, like this Video 3.1. Such video blocks must contain actual text (the caption is drawn from the final line). You must use the three-letter code defined in Quarto for your object type.

Personally I prefer to hide the videos from direct view to keep the window clean, so you’ll see an alternative method in Chapter 4, where I put them inside folded boxes.