From 3781065460b7e83cbe8f82e8b669480e245c2a32 Mon Sep 17 00:00:00 2001 From: Katia Gatt Date: Fri, 18 Apr 2025 18:46:42 +0200 Subject: [PATCH 1/4] Update 009.md --- book/syntax_exercises/009.md | 50 +++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/book/syntax_exercises/009.md b/book/syntax_exercises/009.md index c47122d..4165cb9 100644 --- a/book/syntax_exercises/009.md +++ b/book/syntax_exercises/009.md @@ -72,13 +72,55 @@ The displacement can be found using the equation $s = v \cdot t$. 10. Test your understanding by adding a new equation of your choice, ideally one that requires many LaTex symbols! -11. When you are ready, commit your changes to the repository by clicking on the green `Commit changes` button. -12. Add a commit message. +## Adding colours to equations -13. To see your changes, go to {octicon}`play` `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). +11. The TeachBooks template includes the `sphinx-named-colors` extension, which lets you add colours to parts of your equations using LaTeX. Look at the [CSS named colours](https://developer.mozilla.org/en-US/docs/Web/CSS/named-color) to explore the possible colour options. -14. Do you see your change? If you don't see it click `CTRL`+`F5`/`Control`+`F5`to refresh the page. +12. Colours are added to equations using `\namedcolour{...}`, replacing `namedcolour` with the colour of choice. Test this out with the examples in the table below: + +::::{list-table} +:widths: auto +:header-rows: 1 + * - Color + - $\LaTeX$ Code + - Result + * - olive + - `\olive{\int_a^bf(x)dx}` + - $\olive{\int_a^bf(x)dx}$ + * - hotpink + - `1.\hotpink{\mathbf{49}}` + - $1.\hotpink{\mathbf{49}}$ + * - darkturquoise + - `\dfrac{\darkturquoise{\partial}f}{\darkturquoise{\partial}x}` + - $\dfrac{\darkturquoise{\partial}f}{\darkturquoise{\partial}x}$ + * - onlylight + - `\onlylight{\LaTeX}` + - $\onlylight{\LaTeX}$ + * - lightanddark + - `\lightanddark{\sum}_{n=1}^\infty` + - $\lightanddark{\sum}_{n=1}^\infty$ +:::: + + +13. For colours with hyphens we use need to use the class-based command `\class{named-colour}{...}. Replicate the code below: + +```md +$$ \class{hyphen-color}{\sum}_{n=1}^\infty a_n $$ +``` +14. Test your understanding by creating a block equation where each term is a different colour! + +```{tip} +This is especially helpful for highlighting changes between equations or focusing attention on specific terms — great for teaching, too! +``` + +15. When you are ready, commit your changes to the repository by clicking on the green `Commit changes` button. + +16. Add a commit message. + +17. To see your changes, go to {octicon}`play` `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). + +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 5e05882034f5724edd6939c81522eaf78134e6d9 Mon Sep 17 00:00:00 2001 From: Katia Gatt Date: Fri, 18 Apr 2025 18:59:58 +0200 Subject: [PATCH 2/4] update 2 --- book/syntax_exercises/009.md | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/book/syntax_exercises/009.md b/book/syntax_exercises/009.md index 4165cb9..6fc9fc2 100644 --- a/book/syntax_exercises/009.md +++ b/book/syntax_exercises/009.md @@ -77,6 +77,8 @@ The displacement can be found using the equation $s = v \cdot t$. 11. The TeachBooks template includes the `sphinx-named-colors` extension, which lets you add colours to parts of your equations using LaTeX. Look at the [CSS named colours](https://developer.mozilla.org/en-US/docs/Web/CSS/named-color) to explore the possible colour options. +12. It is also possible to use custom colours! Look [here](https://teachbooks.io/manual/external/Sphinx-Named-Colors/README.html#) for documentation about the TeachBook extension which allows custom colours. + 12. Colours are added to equations using `\namedcolour{...}`, replacing `namedcolour` with the colour of choice. Test this out with the examples in the table below: ::::{list-table} @@ -94,24 +96,19 @@ The displacement can be found using the equation $s = v \cdot t$. * - darkturquoise - `\dfrac{\darkturquoise{\partial}f}{\darkturquoise{\partial}x}` - $\dfrac{\darkturquoise{\partial}f}{\darkturquoise{\partial}x}$ - * - onlylight - - `\onlylight{\LaTeX}` - - $\onlylight{\LaTeX}$ - * - lightanddark - - `\lightanddark{\sum}_{n=1}^\infty` - - $\lightanddark{\sum}_{n=1}^\infty$ :::: -13. For colours with hyphens we use need to use the class-based command `\class{named-colour}{...}. Replicate the code below: +13. For colours with hyphens we use need to use the class-based command `\class{named-colour}{...}. Try this using the format shown below: ```md $$ \class{hyphen-color}{\sum}_{n=1}^\infty a_n $$ ``` + 14. Test your understanding by creating a block equation where each term is a different colour! ```{tip} -This is especially helpful for highlighting changes between equations or focusing attention on specific terms — great for teaching, too! +This is especially helpful for highlighting changes between equations or focusing attention on specific terms! ``` 15. When you are ready, commit your changes to the repository by clicking on the green `Commit changes` button. From b7c56ecc41e9e7b4d854f51668d090958e9e0842 Mon Sep 17 00:00:00 2001 From: Katia Gatt Date: Fri, 18 Apr 2025 19:05:25 +0200 Subject: [PATCH 3/4] Update 009.md --- book/syntax_exercises/009.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/syntax_exercises/009.md b/book/syntax_exercises/009.md index 6fc9fc2..c2d560e 100644 --- a/book/syntax_exercises/009.md +++ b/book/syntax_exercises/009.md @@ -102,7 +102,7 @@ The displacement can be found using the equation $s = v \cdot t$. 13. For colours with hyphens we use need to use the class-based command `\class{named-colour}{...}. Try this using the format shown below: ```md -$$ \class{hyphen-color}{\sum}_{n=1}^\infty a_n $$ +$$ \class{hyphen-color}{\sum}_{n=1}^\infty $$ ``` 14. Test your understanding by creating a block equation where each term is a different colour! From f65c90769897ea24d52260c3dc0bcced9afd8947 Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Tue, 22 Apr 2025 08:38:29 +0200 Subject: [PATCH 4/4] removed result by sticking with exercise approach --- book/syntax_exercises/009.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/book/syntax_exercises/009.md b/book/syntax_exercises/009.md index c2d560e..a7e75fd 100644 --- a/book/syntax_exercises/009.md +++ b/book/syntax_exercises/009.md @@ -86,16 +86,12 @@ The displacement can be found using the equation $s = v \cdot t$. :header-rows: 1 * - Color - $\LaTeX$ Code - - Result * - olive - `\olive{\int_a^bf(x)dx}` - - $\olive{\int_a^bf(x)dx}$ * - hotpink - `1.\hotpink{\mathbf{49}}` - - $1.\hotpink{\mathbf{49}}$ * - darkturquoise - `\dfrac{\darkturquoise{\partial}f}{\darkturquoise{\partial}x}` - - $\dfrac{\darkturquoise{\partial}f}{\darkturquoise{\partial}x}$ ::::