14  Captioning and referencing equations

For a scientific report to be completely credible, it must be reproducible. The full computational environment used to derive the results, including the data and code used for statistical analysis should be available for others to reproduce. quarto is a tool that allows you integrate your code, text and figures in a single file in order to make high quality, reproducible reports. A paper published with an included quarto file and data sets can be reproduced by anyone with a computer.

This section introduces how to add captions to equations, and reference them in text. Note that when using captioning, you need to use the bookdown::html_document2 output.

14.1 Overview

  • Teaching: 5 minutes
  • Exercises: 5 minutes

14.2 Questions

  • How do I caption an equation?
  • How do I reference an equation?

14.2.1 Numbering equations

You can provide a number for an equation by adding \begin{equation} along with a label, provided with (\#eq:label)

\[\begin{equation} Y \sim X\beta_0 + X\beta_1 + \epsilon (\#eq:model) \end{equation}\]

You can then refer to the equation in text using \@ref(eq:model):

Our model is given in @ref(eq:model)

If you want to provide a specific number to the equation, you can use \tag{XX.XX}

\[ Y \sim X\beta_0 + X\beta_1 + \epsilon \tag{1} \]

14.3 Numbering equations

14.4 Referencing equations