From 0b29820e46441d42e767fa6f63c17d8d2f9d184f Mon Sep 17 00:00:00 2001 From: Katia Gatt Date: Tue, 25 Mar 2025 22:44:04 +0100 Subject: [PATCH 01/11] update 9.2 --- book/syntax_exercises/009.md | 45 ++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/book/syntax_exercises/009.md b/book/syntax_exercises/009.md index 8b23a46..924bacd 100644 --- a/book/syntax_exercises/009.md +++ b/book/syntax_exercises/009.md @@ -12,8 +12,8 @@ Referencing elements properly ensures that readers can navigate your book more e ## 1. Referencing a Chapter or Section -1. Open the Markdown file where you want to add a reference. -2. Lets start with the simplest way to create a reference to another chapter or section. This is by directly linking it through the file path as shown in the following syntax: +1. Open a new or existing Markdown file where you want to add a reference. +2. Let's start with the simplest way to create a reference to another chapter. This is by directly linking it through the file path as shown in the following syntax: ```md [Text to display](path/to/file.md) @@ -24,7 +24,7 @@ For example, if you want to link to Exercise 7, you can write: ```md [Go to Exercise 7](../exercises/007.md) ``` -3. Try out another way of referencing by using a target header. Navigate to the chapter or section you want to reference and assign it an identifier using `{ref}` as shown in the example below. +3. Try out another way of referencing by using a target header. Navigate to the chapter or section you want to reference and assign it an identifier using `{ref}` as shown in the example below. This could be either in the same markdown file, or a different file altogether. ```md (exercise_1)= @@ -32,13 +32,14 @@ For example, if you want to link to Exercise 7, you can write: Let's start with the most basic edit: add some text to a file and see that the website is updated... ``` -4. Now, lets explore three different ways to reference this section! For the first method, we use the standard title text by calling the identifier as follows: +4. 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: ```md My favourite exercise was {ref}`exercise_1`. ``` This will display: My favourite exercise was {ref}`exercise_1`. + 5. 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 the `` and calling the identifier within the <> as follows: ```md @@ -46,6 +47,7 @@ Let's start with the most basic edit: add some text to a file and see that the w ``` This will display: My favourite exercise was {ref}`the first one `. + 6. The final 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 the [] and calling the identifier within the <> as shown below: @@ -58,23 +60,32 @@ These three referencing methods can also be used for referencing equations, tabl ## 2. Referencing an Equation -To reference an equation, you need to define a label when creating the equation and refer to it elsewhere in your text using `{eq}`: +7. 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 + + $$ F = m \cdot a$$ (eq:Newton) + + ``` + +This will display as follows: + + $$ F = m \cdot a$$ (eq:Newton) + +8. In this step, we will use the three referencing methods discussed above to reference this equation as follows: + ```md - - ```{math} - :label: eq-example - E = mc^2 - ``` - -``` - -You can then reference this equation using: - -```md -Equation {eq}`eq-example` +Refer to Equation {eq}`eq:Newton` +Refer to the {eq}'above equation ' +Refer to [this equation](eq:Newton) ``` +These will display as: +Refer to Equation {eq}`eq:Newton` +Refer to the {eq}'above equation ' +Refer to [this equation](eq:Newton) ## 3. Referencing a Table From c574592c841ccec2ee45cede57cd7e99c6ed4767 Mon Sep 17 00:00:00 2001 From: Katia Gatt Date: Tue, 25 Mar 2025 23:27:06 +0100 Subject: [PATCH 02/11] update rest of 9 --- book/syntax_exercises/009.md | 78 ++++++++++++++++++++---------------- 1 file changed, 43 insertions(+), 35 deletions(-) diff --git a/book/syntax_exercises/009.md b/book/syntax_exercises/009.md index 924bacd..e2dc43f 100644 --- a/book/syntax_exercises/009.md +++ b/book/syntax_exercises/009.md @@ -24,7 +24,16 @@ For example, if you want to link to Exercise 7, you can write: ```md [Go to Exercise 7](../exercises/007.md) ``` -3. Try out another way of referencing by using a target header. Navigate to the chapter or section you want to reference and assign it an identifier using `{ref}` as shown in the example below. This could be either in the same markdown file, or a different file altogether. + +3. If we want to refer to a section within the same file, we can use local refencing by directly inputting the name of the required section. + +```md +[Jump to the next section](# 2. Referencing an Equation) +``` +[Jump to the next section](# 2. Referencing an Equation) + + +4. Try out another way of referencing by using a target header. Navigate to the chapter or section you want to reference and assign it an identifier using `{ref}` as shown in the example below. This could be once again in the same markdown file, or a different file altogether. ```md (exercise_1)= @@ -32,7 +41,7 @@ For example, if you want to link to Exercise 7, you can write: Let's start with the most basic edit: add some text to a file and see that the website is updated... ``` -4. 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: +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: ```md My favourite exercise was {ref}`exercise_1`. @@ -40,7 +49,7 @@ Let's start with the most basic edit: add some text to a file and see that the w This will display: My favourite exercise was {ref}`exercise_1`. -5. 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 the `` and calling the identifier within the <> as follows: +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 the `` and calling the identifier within the <> as follows: ```md My favourite exercise was {ref}`the first one `. @@ -48,7 +57,7 @@ Let's start with the most basic edit: add some text to a file and see that the w This will display: My favourite exercise was {ref}`the first one `. -6. The final 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 the [] and calling the identifier within the <> as shown below: +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 the [] and calling the identifier within the <> as shown below: ```md @@ -56,11 +65,11 @@ Let's start with the most basic edit: add some text to a file and see that the w ``` 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 -7. 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 @@ -69,48 +78,46 @@ These three referencing methods can also be used for referencing equations, tabl ``` -This will display as follows: - $$ F = m \cdot a$$ (eq:Newton) -8. In this step, we will use the three referencing methods discussed above to reference this equation as follows: - +8. To refer to this equation we need to use {eq} and call the identifier within the ``. This will display: Refer to Equation {eq}`eq:Newton`. ```md Refer to Equation {eq}`eq:Newton` -Refer to the {eq}'above equation ' -Refer to [this equation](eq:Newton) ``` -These will display as: - -Refer to Equation {eq}`eq:Newton` -Refer to the {eq}'above equation ' -Refer to [this equation](eq:Newton) ## 3. Referencing a Table -To reference a table, assign a label when defining it: +9. Similar methods can also be used to refer to a table. Start by creating a table by copying the markdown below. The identifier is defined using ':name:'. ```md ```{table} Example Table - :label: tab-example + :name: tab-example | Column 1 | Column 2 | |----------|----------| | A | B | ``` ``` -And refer to it using `{numref}`: +```{table} Example Table +name: tab-example +| Column 1 | Column 2 | +|----------|----------| +| A | B | +``` + +10. Refer to the table like {numref}`Table {number} ` using {numref} and {number} as follows: + ```md -Table {numref}`tab-example` +{numref}`Table {number} ` ``` ## 4. Referencing a Figure -To reference a figure, label it when inserting it: +11. This can also be done for a figure. Let's add a figure as we learnt in [Exercise 7](007.md), but this time adding an identifier using 'name:'. ```md ```{figure} figures/example.png @@ -123,36 +130,37 @@ To reference a figure, label it when inserting it: ``` ``` -And refer to it using `{numref}`: +12. Refer to the figure in the format {numref}`Figure {number} ` using `{numref}` as follows: ```md -Figure {numref}`fig-example` +{numref}`Figure {number} ` ``` ## 5. Referencing a Link -To reference a link, use the following syntax: +13. Finally, lets reference a link, using the following syntax: ```md -[Text to display](https://teachbooks.github.io/template/) +[Text to display](url) ``` -For example, you can write: +For example, you can use the code below to display: Here is the [link to the template](https://teachbooks.github.io/template/). + ```md Here is the [link to the template](https://teachbooks.github.io/template/). ``` -This wil display: Here is the [link to the template](https://teachbooks.github.io/template/). - - - ## 6. Commit Your Changes -1. Once you have added your references, commit your changes to the repository. -2. Click the green `Commit changes` button. -3. Add a commit message. -4. View your changes using the `Actions` tab and check if they appear correctly. +14. When you are ready, commit your changes to the repository by clicking on the green `Commit changes` button. + +15. Add a commit message. + +16. To see you changes, go to {octicon}`play;1em` `Actions` - The most recent workflow run `overview.md / the commit message of the commit you just made` - Wait for it to finish - In the summary, click on the link of your book shown in the table `Branches deployed` and under `Primary book at root` (getting bored of waiting? There'll be exercising on doing this locally which prevents you from waiting). + +17. Do you see your change? If you don't see it click `CTRL`+`F5`/`Control`+`F5`to refresh the page. + ```{admonition} Check your understanding :class: note From d7fc0a3a70dbb6cc283c90bae3f1de600bfb7aee Mon Sep 17 00:00:00 2001 From: Katia Gatt Date: Tue, 25 Mar 2025 23:51:57 +0100 Subject: [PATCH 03/11] Update 009.md --- book/syntax_exercises/009.md | 45 ++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/book/syntax_exercises/009.md b/book/syntax_exercises/009.md index e2dc43f..63743c6 100644 --- a/book/syntax_exercises/009.md +++ b/book/syntax_exercises/009.md @@ -10,7 +10,7 @@ Can you create internal references to other sections, equations, tables, figures Referencing elements properly ensures that readers can navigate your book more easily. More details can be found in the [JupyterBook documentation](https://jupyterbook.org/en/stable/content/references.html). ``` -## 1. Referencing a Chapter or Section +## Referencing a Chapter or Section 1. Open a new or existing Markdown file where you want to add a reference. 2. Let's start with the simplest way to create a reference to another chapter. This is by directly linking it through the file path as shown in the following syntax: @@ -25,15 +25,14 @@ For example, if you want to link to Exercise 7, you can write: [Go to Exercise 7](../exercises/007.md) ``` -3. If we want to refer to a section within the same file, we can use local refencing by directly inputting the name of the required section. +3. If we want to refer to a section within the same file, we can use local refencing by directly inputting the name of the required section. For example: [Jump to the next section](#referencing-an-equation) ```md -[Jump to the next section](# 2. Referencing an Equation) +[Jump to the next section](#referencing-an-equation) ``` -[Jump to the next section](# 2. Referencing an Equation) -4. Try out another way of referencing by using a target header. Navigate to the chapter or section you want to reference and assign it an identifier using `{ref}` as shown in the example below. This could be once again in the same markdown file, or a different file altogether. +4. Try out another way of referencing by using a target header. Navigate to the chapter or section you want to reference and assign it an identifier using `{ref}` as shown in the example below. This could be once again in the same markdown file, or a different file in the same repository. ```md (exercise_1)= @@ -41,33 +40,30 @@ For example, if you want to link to Exercise 7, you can write: Let's start with the most basic edit: add some text to a file and see that the website is updated... ``` -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: +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 My favourite exercise was {ref}`exercise_1`. ``` - This will display: 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 the `` and calling the identifier within the <> as follows: +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 `. ```md My favourite exercise was {ref}`the first one `. ``` - This will display: My favourite exercise was {ref}`the first one `. -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 the [] and calling the identifier within the <> as shown below: +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 the [] and calling the identifier within the <> as shown below. This will display: My favourite exercise was [this one](exercise_1). ```md My favourite exercise was [this one](exercise_1). ``` - This will display: My favourite exercise was [this one](exercise_1). - -## 2. Referencing an Equation +## Referencing an Equation 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. @@ -80,25 +76,26 @@ Let's start with the most basic edit: add some text to a file and see that the w $$ F = m \cdot a$$ (eq:Newton) -8. To refer to this equation we need to use {eq} and call the identifier within the ``. This will display: Refer to Equation {eq}`eq:Newton`. +8. To refer to this equation we need to use `{eq}` and call the identifier within the `` to achieve: Refer to Equation {eq}`eq:Newton`. ```md Refer to Equation {eq}`eq:Newton` ``` -## 3. Referencing a Table +## Referencing a Table -9. Similar methods can also be used to refer to a table. Start by creating a table by copying the markdown below. The identifier is defined using ':name:'. +9. 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 :name: tab-example | Column 1 | Column 2 | |----------|----------| | A | B | ``` -``` + ``` + ```{table} Example Table name: tab-example @@ -115,11 +112,11 @@ name: tab-example ``` -## 4. Referencing a Figure +## Referencing a Figure -11. This can also be done for a figure. Let's add a figure as we learnt in [Exercise 7](007.md), but this time adding an identifier using 'name:'. +11. This can also be done for a figure. Let's add a figure as we learnt to do in [Exercise 7](007.md), but this time adding an identifier using `name:`. -```md + ```md ```{figure} figures/example.png --- width: 80% @@ -128,7 +125,7 @@ name: tab-example --- Example figure. ``` -``` + ``` 12. Refer to the figure in the format {numref}`Figure {number} ` using `{numref}` as follows: @@ -136,7 +133,7 @@ name: tab-example {numref}`Figure {number} ` ``` -## 5. Referencing a Link +## Referencing a Link 13. Finally, lets reference a link, using the following syntax: @@ -151,8 +148,6 @@ Here is the [link to the template](https://teachbooks.github.io/template/). ``` -## 6. Commit Your Changes - 14. When you are ready, commit your changes to the repository by clicking on the green `Commit changes` button. 15. Add a commit message. From 222cfedacdbe21a38a0b34034f275b8209579560 Mon Sep 17 00:00:00 2001 From: Katia Gatt Date: Wed, 26 Mar 2025 00:01:22 +0100 Subject: [PATCH 04/11] Update 009.md --- book/syntax_exercises/009.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/book/syntax_exercises/009.md b/book/syntax_exercises/009.md index 63743c6..6fda948 100644 --- a/book/syntax_exercises/009.md +++ b/book/syntax_exercises/009.md @@ -25,14 +25,14 @@ For example, if you want to link to Exercise 7, you can write: [Go to Exercise 7](../exercises/007.md) ``` -3. If we want to refer to a section within the same file, we can use local refencing by directly inputting the name of the required section. For example: [Jump to the next section](#referencing-an-equation) +3. If we want to refer to a section within the same file, we can use local refencing by directly inputting the name of the required section. The code below gives: [Jump to the next section](#referencing-an-equation) ```md [Jump to the next section](#referencing-an-equation) ``` -4. Try out another way of referencing by using a target header. Navigate to the chapter or section you want to reference and assign it an identifier using `{ref}` as shown in the example below. This could be once again in the same markdown file, or a different file in the same repository. +4. Try out another way of referencing by using a target header. Navigate to the chapter or section you want to reference and assign it an identifier within brackets as shown in the example below. This could be once again in the same markdown file, or a different file in the same repository. ```md (exercise_1)= @@ -55,7 +55,7 @@ This will display: My favourite exercise was {ref}`the first one `. ``` -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 the [] and calling the identifier within the <> 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 @@ -104,7 +104,7 @@ name: tab-example | A | B | ``` -10. Refer to the table like {numref}`Table {number} ` using {numref} and {number} as follows: +10. Refer to the table like {numref}`Table {number} ` using `{numref}` and `{number}` as follows: ```md From 8df769acf7a3b4a218d8a9fb98f2eb94b5c024e0 Mon Sep 17 00:00:00 2001 From: Katia Gatt Date: Wed, 26 Mar 2025 15:40:46 +0100 Subject: [PATCH 05/11] Update 009.md --- book/syntax_exercises/009.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/book/syntax_exercises/009.md b/book/syntax_exercises/009.md index 6fda948..3cbf0e1 100644 --- a/book/syntax_exercises/009.md +++ b/book/syntax_exercises/009.md @@ -13,7 +13,7 @@ Referencing elements properly ensures that readers can navigate your book more e ## Referencing a Chapter or Section 1. Open a new or existing Markdown file where you want to add a reference. -2. Let's start with the simplest way to create a reference to another chapter. This is by directly linking it through the file path as shown in the following syntax: +2. Let's start with the simplest way to create a reference to another chapter. Try this out by directly linking the chapter through the file path as shown in the following syntax. ```md [Text to display](path/to/file.md) @@ -25,7 +25,7 @@ For example, if you want to link to Exercise 7, you can write: [Go to Exercise 7](../exercises/007.md) ``` -3. If we want to refer to a section within the same file, we can use local refencing by directly inputting the name of the required section. The code below gives: [Jump to the next section](#referencing-an-equation) +3. If we want to refer to a section within the same file, we can use local refencing by directly inputting the name of the required section. Use the example below to test this out. This code gives: [Jump to the next section](#referencing-an-equation) ```md [Jump to the next section](#referencing-an-equation) @@ -76,7 +76,7 @@ This will display: My favourite exercise was {ref}`the first one `. $$ F = m \cdot a$$ (eq:Newton) -8. To refer to this equation we need to use `{eq}` and call the identifier within the `` to achieve: Refer to Equation {eq}`eq:Newton`. +8. Refer to this equation by using `{eq}` and calling the identifier within the `` to achieve: Refer to Equation {eq}`eq:Newton`. ```md Refer to Equation {eq}`eq:Newton` @@ -135,7 +135,7 @@ name: tab-example ## Referencing a Link -13. Finally, lets reference a link, using the following syntax: +13. Finally, let's reference a link, using the following syntax: ```md [Text to display](url) From 3a2db9bc6f666340c3728a5abd3df5d6ee4b195f Mon Sep 17 00:00:00 2001 From: Katia Gatt Date: Wed, 26 Mar 2025 15:50:13 +0100 Subject: [PATCH 06/11] updated numbering 09 --- book/syntax_exercises/009.md | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/book/syntax_exercises/009.md b/book/syntax_exercises/009.md index 3cbf0e1..f7c1720 100644 --- a/book/syntax_exercises/009.md +++ b/book/syntax_exercises/009.md @@ -76,7 +76,7 @@ This will display: My favourite exercise was {ref}`the first one `. $$ F = m \cdot a$$ (eq:Newton) -8. Refer to this equation by using `{eq}` and calling the identifier within the `` to achieve: Refer to Equation {eq}`eq:Newton`. +9. Refer to this equation by using `{eq}` and calling the identifier within the `` to achieve: Refer to Equation {eq}`eq:Newton`. ```md Refer to Equation {eq}`eq:Newton` @@ -85,16 +85,17 @@ Refer to Equation {eq}`eq:Newton` ## Referencing a Table -9. 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 - ```{table} Example Table - :name: tab-example - | Column 1 | Column 2 | - |----------|----------| - | A | B | - ``` + ```{table} Example Table + :name: tab-example + | Column 1 | Column 2 | + |----------|----------| + | A | B | ``` + ``` + ```{table} Example Table @@ -104,7 +105,7 @@ name: tab-example | A | B | ``` -10. Refer to the table like {numref}`Table {number} ` using `{numref}` and `{number}` as follows: +11. Refer to the table like {numref}`Table {number} ` using `{numref}` and `{number}` as follows: ```md @@ -114,7 +115,7 @@ name: tab-example ## Referencing a Figure -11. This can also be done for a figure. Let's add a figure as we learnt to do in [Exercise 7](007.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 ```{figure} figures/example.png @@ -127,7 +128,7 @@ name: tab-example ``` ``` -12. Refer to the figure in the format {numref}`Figure {number} ` using `{numref}` as follows: +13. Refer to the figure in the format {numref}`Figure {number} ` using `{numref}` as follows: ```md {numref}`Figure {number} ` @@ -135,7 +136,7 @@ name: tab-example ## Referencing a Link -13. Finally, let's reference a link, using the following syntax: +14. Finally, let's reference a link, using the following syntax: ```md [Text to display](url) @@ -148,13 +149,13 @@ Here is the [link to the template](https://teachbooks.github.io/template/). ``` -14. When you are ready, commit your changes to the repository by clicking on the green `Commit changes` button. +15. When you are ready, commit your changes to the repository by clicking on the green `Commit changes` button. -15. Add a commit message. +16. Add a commit message. -16. To see you changes, go to {octicon}`play;1em` `Actions` - The most recent workflow run `overview.md / the commit message of the commit you just made` - Wait for it to finish - In the summary, click on the link of your book shown in the table `Branches deployed` and under `Primary book at root` (getting bored of waiting? There'll be exercising on doing this locally which prevents you from waiting). +17. To see you changes, go to {octicon}`play;1em` `Actions` - The most recent workflow run `overview.md / the commit message of the commit you just made` - Wait for it to finish - In the summary, click on the link of your book shown in the table `Branches deployed` and under `Primary book at root` (getting bored of waiting? There'll be exercising on doing this locally which prevents you from waiting). -17. Do you see your change? If you don't see it click `CTRL`+`F5`/`Control`+`F5`to refresh the page. +18. Do you see your change? If you don't see it click `CTRL`+`F5`/`Control`+`F5`to refresh the page. ```{admonition} Check your understanding From 278ac39643d074e04ba01a6e6175d91b9b1e60b3 Mon Sep 17 00:00:00 2001 From: Katia Gatt Date: Wed, 26 Mar 2025 15:55:38 +0100 Subject: [PATCH 07/11] updated indent --- book/syntax_exercises/009.md | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/book/syntax_exercises/009.md b/book/syntax_exercises/009.md index f7c1720..f526538 100644 --- a/book/syntax_exercises/009.md +++ b/book/syntax_exercises/009.md @@ -97,14 +97,6 @@ Refer to Equation {eq}`eq:Newton` ``` - -```{table} Example Table -name: tab-example -| Column 1 | Column 2 | -|----------|----------| -| A | B | -``` - 11. Refer to the table like {numref}`Table {number} ` using `{numref}` and `{number}` as follows: @@ -118,14 +110,14 @@ name: tab-example 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 - ```{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. + ``` ``` 13. Refer to the figure in the format {numref}`Figure {number} ` using `{numref}` as follows: From efbfe489f6f322169a417085806c2215252b45f4 Mon Sep 17 00:00:00 2001 From: Katia Gatt Date: Wed, 26 Mar 2025 16:00:50 +0100 Subject: [PATCH 08/11] Update 009.md --- book/syntax_exercises/009.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/book/syntax_exercises/009.md b/book/syntax_exercises/009.md index f526538..cb2fdd4 100644 --- a/book/syntax_exercises/009.md +++ b/book/syntax_exercises/009.md @@ -87,14 +87,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:`. - ```md +```md ```{table} Example Table :name: tab-example | Column 1 | Column 2 | |----------|----------| | A | B | ``` - ``` +``` 11. Refer to the table like {numref}`Table {number} ` using `{numref}` and `{number}` as follows: @@ -109,7 +109,7 @@ 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:`. - ```md +```md ```{figure} figures/example.png --- width: 80% @@ -118,7 +118,7 @@ Refer to Equation {eq}`eq:Newton` --- Example figure. ``` - ``` +``` 13. Refer to the figure in the format {numref}`Figure {number} ` using `{numref}` as follows: From 99e915ad0745751ba9474ccb44192a0854907d9e Mon Sep 17 00:00:00 2001 From: Katia Gatt Date: Wed, 26 Mar 2025 16:16:16 +0100 Subject: [PATCH 09/11] indent retry --- book/syntax_exercises/009.md | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/book/syntax_exercises/009.md b/book/syntax_exercises/009.md index cb2fdd4..e7384e9 100644 --- a/book/syntax_exercises/009.md +++ b/book/syntax_exercises/009.md @@ -87,15 +87,22 @@ 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:`. -```md + ```md ```{table} Example Table :name: tab-example | Column 1 | Column 2 | |----------|----------| | A | B | ``` -``` + ``` + ``` +```{table} Example Table +:name: tab-example +| Column 1 | Column 2 | +|----------|----------| +| A | B | +``` 11. Refer to the table like {numref}`Table {number} ` using `{numref}` and `{number}` as follows: @@ -103,6 +110,7 @@ Refer to Equation {eq}`eq:Newton` ```md {numref}`Table {number} ` ``` + ## Referencing a Figure @@ -110,14 +118,15 @@ 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:`. ```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. +``` +``` ``` 13. Refer to the figure in the format {numref}`Figure {number} ` using `{numref}` as follows: From 537a5794175ce0dd3756c3f1929d176c32114f47 Mon Sep 17 00:00:00 2001 From: Katia Gatt Date: Wed, 26 Mar 2025 16:19:11 +0100 Subject: [PATCH 10/11] indent retry 2 --- book/syntax_exercises/009.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/book/syntax_exercises/009.md b/book/syntax_exercises/009.md index e7384e9..e612a30 100644 --- a/book/syntax_exercises/009.md +++ b/book/syntax_exercises/009.md @@ -95,7 +95,7 @@ Refer to Equation {eq}`eq:Newton` | A | B | ``` ``` - ``` + ```{table} Example Table :name: tab-example @@ -117,17 +117,17 @@ 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:`. -```md -```{figure} figures/example.png ---- -width: 80% -align: center -name: fig-example ---- -Example figure. -``` -``` -``` + ```md + ```{figure} figures/example.png + --- + width: 80% + align: center + name: fig-example + --- + Example figure. + ``` + ``` + 13. Refer to the figure in the format {numref}`Figure {number} ` using `{numref}` as follows: From 42f6aeebefae43505cfbb95ba299cea17cf9ac37 Mon Sep 17 00:00:00 2001 From: Katia Gatt Date: Wed, 26 Mar 2025 16:29:10 +0100 Subject: [PATCH 11/11] indent retry 3 --- book/syntax_exercises/009.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/book/syntax_exercises/009.md b/book/syntax_exercises/009.md index e612a30..cbc41b4 100644 --- a/book/syntax_exercises/009.md +++ b/book/syntax_exercises/009.md @@ -87,14 +87,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:`. - ```md + ````md ```{table} Example Table :name: tab-example | Column 1 | Column 2 | |----------|----------| | A | B | ``` - ``` + ```` ```{table} Example Table @@ -117,7 +117,7 @@ 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:`. - ```md + ````md ```{figure} figures/example.png --- width: 80% @@ -126,7 +126,7 @@ Refer to Equation {eq}`eq:Newton` --- Example figure. ``` - ``` + ```` 13. Refer to the figure in the format {numref}`Figure {number} ` using `{numref}` as follows: