mirror of
https://github.com/TeachBooks/manual.git
synced 2026-11-13 14:55:51 +00:00
Added new pages for Sphinx exercise and Sphinx proof extensions, including installation and usage instructions. Updated references, credits, and feature pages to reflect inclusion in TeachBooks Template and Favourites. Improved consistency of external links and badges, and updated submodules to latest versions.
80 lines
2.4 KiB
Markdown
80 lines
2.4 KiB
Markdown
````{margin}
|
||
```{attributiongrey} Attribution
|
||
:class: attribution
|
||
This page reuses MIT licensed content from {cite:t}`sphinx-proof`. {fa}`quote-left`{ref}`Find out more here.<external_resources>`
|
||
```
|
||
|
||
```{admonition} User types
|
||
:class: tip
|
||
This section is useful for user type 3-5.
|
||
```
|
||
+++
|
||
{bdg-primary}`Sphinx Extension`
|
||
{bdg-link-light}`Included in TeachBooks Template <https://teachbooks.io/manual/external/template/README.html>`
|
||
{bdg-link-primary-line}`Included in TeachBooks Favourites <https://teachbooks.io/manual/features/favourites.html>`
|
||
````
|
||
|
||
# Sphinx proof
|
||
|
||
This extensions provides an easy way to add proofs, theorem, axioms and much more to your book. It is documented on https://sphinx-proof.readthedocs.io/en/latest/.
|
||
|
||
TeachBooks has made some small modifications to the original extension, such that it works well with translated books.
|
||
|
||
## What does it do?
|
||
|
||
This extension defines proofs, theorems, axioms and other similar concepts as new admonition types:
|
||
|
||
````{prf:example}
|
||
:label: my-example
|
||
|
||
Next, we shut down randomness in demand and assume that the demand shock
|
||
$\nu_t$ follows a deterministic path:
|
||
|
||
|
||
```{math}
|
||
\nu_t = \alpha + \rho \nu_{t-1}
|
||
```
|
||
|
||
Again, we’ll compute and display outcomes in some figures
|
||
|
||
```python
|
||
ex2 = SmoothingExample(C2=[[0], [0]])
|
||
|
||
x0 = [0, 1, 0]
|
||
ex2.simulate(x0)
|
||
```
|
||
````
|
||
|
||
More information can be found in the [official documentation](https://sphinx-proof.readthedocs.io/en/latest/index.html). It can be [configured in combination the TeachBooks extension to include examples with executable code and visuals](https://teachbooks.io/manual/_git/github.com_TeachBooks_sphinx-code-examples/main/MANUAL.html).
|
||
|
||
## Installation
|
||
To use this extenstion, follow these steps:
|
||
|
||
**Step 1: Install the Package**
|
||
|
||
Install the TeachBooks' version of `sphinx-exercise` package using `pip`:
|
||
```
|
||
pip install sphinx-proof @ git+https://github.com/TeachBooks/sphinx-proof.git
|
||
```
|
||
|
||
**Step 2: Add to `requirements.txt`**
|
||
|
||
Make sure that the package is included in your project's `requirements.txt` to track the dependency:
|
||
```
|
||
sphinx-proof @ git+https://github.com/TeachBooks/sphinx-proof.git
|
||
```
|
||
|
||
**Step 3: Enable in `_config.yml`**
|
||
|
||
In your `_config.yml` file, add the extension to the list of Sphinx extra extensions (**important**: underscore, not dash this time):
|
||
```
|
||
sphinx:
|
||
extra_extensions:
|
||
.
|
||
.
|
||
.
|
||
- sphinx_proof
|
||
.
|
||
.
|
||
.
|
||
```
|