2.5 KiB
Exercise 9: Use equations
In this exercise, you will learn how to write and format mathematical equations in your TeachBook, both inline and as standalone blocks.
::::::{topic} Exercise objective Can you format and reference equations correctly in your book? ::::::
Using properly formatted equations makes mathematical expressions clearer and more professional. More details can be found in the [JupyterBook documentation](https://jupyterbook.org/en/stable/content/math.html).
Writing equations
- Open a new or existing Markdown file where you want to include an equation.
- Start with a simple block equation using double dollar signs. Try adding the following equation in your Markdown file:
$$ F_{res} = m \cdot a $$
- Now, add an inline equation by enclosing the equation with single dollar signs. Try this example:
The displacement can be found using the equation $s = v \cdot t$.
Formatting mathematical symbols
- In this step we will experiment with different LaTeX symbols. Use the following table and test each example in your Markdown file:
| Name | Script |
|---|---|
| Square root | \sqrt{4} |
| Power | ^{2x} |
| Fraction | \frac{2}{3} |
| Subscript | _{gem} |
| Superscript | ^{N} |
| Multiplication | \cdot |
- Extend this exercise by trying more advanced mathematical expressions:
| Name | Script |
|---|---|
| Derivative | \frac{\Delta f}{\Delta t} |
| Integral | \int_a^b dx |
| Sine function | \sin(x) |
-
Test your understanding by adding a new equation of your choice, ideally one that requires many LaTex symbols!
-
When you are ready, commit your changes to the repository by clicking on the green
Commit changesbutton. -
Add a commit message.
-
To see your changes, go to {octicon}
play;1emActions- The most recent workflow runoverview.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 tableBranches deployedand underPrimary book at root(getting bored of waiting? There'll be exercising on doing this locally which prevents you from waiting). -
Do you see your change? If you don't see it click
CTRL+F5/Control+F5to refresh the page.
:class: note
Before moving on to the next exercise, make sure you understand the following:
- What is the difference between inline and block equations?
- How do you use LaTeX formatting for different mathematical symbols?