Skip to content

Commit d9943b8

Browse files
committed
Add sphinx-proof example
1 parent fdb14b1 commit d9943b8

File tree

4 files changed

+45
-5
lines changed

4 files changed

+45
-5
lines changed

docs/_config.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,25 @@ sphinx:
5151
- "https://nbformat.readthedocs.io/en/latest"
5252
- null
5353
sd:
54-
- https://sphinx-design.readthedocs.io/en/latest
54+
- "https://sphinx-design.readthedocs.io/en/latest"
5555
- null
56-
56+
sphinxproof:
57+
- "https://sphinx-proof.readthedocs.io/en/latest/"
58+
- null
59+
hoverxref_intersphinx:
60+
- "sphinxproof"
61+
mathjax3_config:
62+
tex:
63+
macros:
64+
"N": "\\mathbb{N}"
65+
"floor": ["\\lfloor#1\\rfloor", 1]
66+
"bmat": ["\\left[\\begin{array}"]
67+
"emat": ["\\end{array}\\right]"]
68+
5769
extra_extensions:
70+
- sphinx.ext.intersphinx
5871
- sphinx_inline_tabs
5972
- sphinx_proof
6073
- sphinx_examples
61-
- hoverxref.extension
74+
- hoverxref.extension
75+

docs/_toc.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,7 @@ chapters:
88
- file: notebooks
99
- file: markdown-notebooks
1010
- file: intersphinx
11-
- file: sphinx-hoverxref
1211
- file: sphinx-examples
12+
- file: sphinx-hoverxref
13+
- file: sphinx-proof
14+

docs/intro.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ We have also added some popular features for Jupyter Book that really you should
3333
* [intersphinx to link to other documentation and Jupyter Book projects](/intersphinx)
3434
* [sphinx-examples to show examples and results side-by-side](/sphinx-examples)
3535
* [sphinx-hoverxref to preview cross-references](/sphinx-hoverxref)
36-
* [sphinx-proof for logic and math, to write proofs, theorems, lemmas etc.](/sphinx-hoverxref) (TODO)
36+
* [sphinx-proof for logic and math, to write proofs, theorems, lemmas etc.](/sphinx-proof)
3737
* [sphinx-inline-tabs to display alternatives side-by-side with a tabbed interface](/sphinx-hoverxref) (TODO)
3838

3939

docs/sphinx-proof.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Write proofs with sphinx-proof
2+
3+
Easily render proofs, theorems, axioms, lemmas, definitions and much more with `sphinx-proof`. Read more in the [documentation of sphinx-proof](sphinxproof:syntax).
4+
5+
````{prf:proof}
6+
We'll omit the full proof.
7+
8+
But we will prove sufficiency of the asserted conditions.
9+
10+
To this end, let $y \in \mathbb R^n$ and let $S$ be a linear subspace of $\mathbb R^n$.
11+
12+
Let $\hat y$ be a vector in $\mathbb R^n$ such that $\hat y \in S$ and $y - \hat y \perp S$.
13+
14+
Let $z$ be any other point in $S$ and use the fact that $S$ is a linear subspace to deduce
15+
16+
```{math}
17+
\| y - z \|^2
18+
= \| (y - \hat y) + (\hat y - z) \|^2
19+
= \| y - \hat y \|^2 + \| \hat y - z \|^2
20+
```
21+
22+
Hence $\| y - z \| \geq \| y - \hat y \|$, which completes the proof.
23+
````
24+

0 commit comments

Comments
 (0)