Update 009.md

This commit is contained in:
Tom van Woudenberg 2025-03-27 08:41:51 +01:00
parent 52cb1ae06a
commit 551c3f0a30

View file

@ -51,25 +51,25 @@ Let's start with the most basic edit: add some text to a file and see that the w
``` ```
5. Now, let's explore three different ways to reference this section or chapter! For the first method, we use the standard title text by calling the identifier as follows. This will display: My favourite exercise was {ref}`exercise_1`. 5. Now, let's explore three different ways to reference this section or chapter! For the first method, we use the standard title text by calling the identifier as follows. This will display: My favourite exercise was {ref}`exercise_1`.
```md ```md
My favourite exercise was {ref}`exercise_1`. My favourite exercise was {ref}`exercise_1`.
``` ```
6. For the second method, we want to refer to the section using a custom title text. Try this out by placing the text that you want to be displayed within `` and calling the identifier within <>. 6. For the second method, we want to refer to the section using a custom title text. Try this out by placing the text that you want to be displayed within `` and calling the identifier within <>.
This will display: My favourite exercise was {ref}`the first one <exercise_1>`. This will display: My favourite exercise was {ref}`the first one <exercise_1>`.
```md ```md
My favourite exercise was {ref}`the first one <exercise_1>`. My favourite exercise was {ref}`the first one <exercise_1>`.
``` ```
7. The last method uses markdown syntax to also display a custom title text. Refer to the desired section once again, this time by putting the custom text within [] and calling the identifier within <> as shown below. This will display: My favourite exercise was [this one](exercise_1). 7. The last method uses markdown syntax to also display a custom title text. Refer to the desired section once again, this time by putting the custom text within [] and calling the identifier within <> as shown below. This will display: My favourite exercise was [this one](exercise_1).
```md ```md
My favourite exercise was [this one](exercise_1). My favourite exercise was [this one](exercise_1).
``` ```
## Referencing an Equation ## Referencing an Equation
@ -77,11 +77,11 @@ This will display: My favourite exercise was {ref}`the first one <exercise_1>`.
8. Now we will test our knowledge using an equation. Similar to the code below, create an equation using $$ and identify it using a label within the brackets. 8. Now we will test our knowledge using an equation. Similar to the code below, create an equation using $$ and identify it using a label within the brackets.
```md ```md
$$ F = m \cdot a$$ (eq:Newton) $$ F = m \cdot a$$ (eq:Newton)
``` ```
$$ F = m \cdot a$$ (eq:Newton) $$ F = m \cdot a$$ (eq:Newton)
@ -96,14 +96,14 @@ Refer to Equation {eq}`eq:Newton`
10. Similar methods can also be used to refer to a table. Start by creating a table by copying the code below. The identifier is defined using `:name:`. 10. Similar methods can also be used to refer to a table. Start by creating a table by copying the code below. The identifier is defined using `:name:`.
````md ````md
```{table} Example Table ```{table} Example Table
:name: tab-example :name: tab-example
| Column 1 | Column 2 | | Column 1 | Column 2 |
|----------|----------| |----------|----------|
| A | B | | A | B |
``` ```
```` ````
```{table} Example Table ```{table} Example Table
@ -126,16 +126,16 @@ Refer to Equation {eq}`eq:Newton`
12. This can also be done for a figure. Let's add a figure as we learnt to do in [Exercise 8](008.md), but this time adding an identifier using `name:`. 12. This can also be done for a figure. Let's add a figure as we learnt to do in [Exercise 8](008.md), but this time adding an identifier using `name:`.
````md ````md
```{figure} figures/example.png ```{figure} figures/example.png
--- ---
width: 80% width: 80%
align: center align: center
name: fig-example name: fig-example
--- ---
Example figure. Example figure.
``` ```
```` ````
13. Refer to the figure in the format {numref}`Figure {number} <fig-example>` using `{numref}` as follows: 13. Refer to the figure in the format {numref}`Figure {number} <fig-example>` using `{numref}` as follows:
@ -175,3 +175,4 @@ Before moving on to the next exercise, make sure you understand the following:
- How do you reference another chapter or section? - How do you reference another chapter or section?
- How do you create a reference to an equation, table or figure in your book? - How do you create a reference to an equation, table or figure in your book?
- How do you reference a link? - How do you reference a link?
```