Sphinx proof

Sphinx proof#

This extensions provides an easy way to add proofs, theorem, axioms and much more to your book. It is created by the Executable Books team and is documented here.

TeachBooks has made some small modifications to the original extension, such that it works well with translated books; this modified version is located in the repository github.com/TeachBooks/sphinx-proof.

What does it do?#

This extension defines proofs, theorems, axioms and other similar concepts as new admonition types:

Example 1

Next, we shut down randomness in demand and assume that the demand shock \(\nu_t\) follows a deterministic path:

\[\nu_t = \alpha + \rho \nu_{t-1}\]

Again, we’ll compute and display outcomes in some figures

ex2 = SmoothingExample(C2=[[0], [0]])

x0 = [0, 1, 0]
ex2.simulate(x0)

More information can be found in the official documentation. It can be configured in combination the TeachBooks extension to include examples with executable code and visuals.

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
        .
        .
        .