diff --git a/book/syntax_exercises/009.md b/book/syntax_exercises/009.md index 70d37f1..abe02a6 100644 --- a/book/syntax_exercises/009.md +++ b/book/syntax_exercises/009.md @@ -1,9 +1,7 @@ -# Exercise 9: Cross-referencing content - -In this exercise, you will learn how to create references to other parts of your book, such as chapters, sections, equations, tables, and figures. +In this exercise, you will learn how to create references to other parts of your book, such as chapters, sections, equations, tables, figures, and links. ::::::{topic} Exercise objective -Can you create internal references to other sections, equations, tables, and figures? +Can you create internal references to other sections, equations, tables, figures, and links? :::::: ```{tip} @@ -55,15 +53,19 @@ Then, you can reference this section in three ways: ``` This will display: My favourite exercise was [this one](exercise_1). +These three referencing methods can also be used for referencing equations, tables and figures. + ## 2. Referencing an Equation To reference an equation, you need to define a label using `{eq}` and refer to it elsewhere in your text: ```md + ```{math} :label: eq-example E = mc^2 ``` + ``` You can then reference this equation using: @@ -72,8 +74,6 @@ You can then reference this equation using: Equation {eq}`eq-example` ``` -This will display: Equation {eq}`eq-example`. - ## 3. Referencing a Table @@ -81,12 +81,12 @@ This will display: Equation {eq}`eq-example`. To reference a table, assign a label when defining it: ```md -```{table} Example Table -:label: tab-example -| Column 1 | Column 2 | -|----------|----------| -| A | B | -``` + ```{table} Example Table + :label: tab-example + | Column 1 | Column 2 | + |----------|----------| + | A | B | + ``` ``` And refer to it using: @@ -95,19 +95,20 @@ And refer to it using: Table {numref}`tab-example` ``` + ## 4. Referencing a Figure To reference a figure, label it when inserting it: ```md -```{figure} figures/example.png ---- -width: 80% -align: center -name: fig-example ---- -Example figure. -``` + ```{figure} figures/example.png + --- + width: 80% + align: center + name: fig-example + --- + Example figure. + ``` ``` And refer to it using: