You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Added possibility for shared numbering of theorems. (#164)
* feat: Added possibility for shared numbering of theorems, fixing issue #64 (#161)
Added optioin to have directives share numbering. Reflected also in docs.
* Add config validation
Introduces a check_config_values function to validate Sphinx configuration values at runtime, ensuring correct types and defaults for proof-related settings.
---------
Co-authored-by: Leonid Ryvkin <ryvkin@gmx.com>
Copy file name to clipboardExpand all lines: docs/source/options.md
+55Lines changed: 55 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,6 +31,61 @@ sphinx:
31
31
32
32
Add `proof_minimal_theme = True` to your `conf.py`
33
33
34
+
## Shared numbering
35
+
36
+
By default, each type of (prf-)directive has their own numbering and counter. This can be changed by setting the option `prf_realtyp_to_countertyp` to a dictionary associating to a directive which the counter of which directive it should use.
37
+
38
+
### Sphinx Project
39
+
40
+
In `conf.py`, e.g. to have a shared counter for all directives:
41
+
42
+
```
43
+
prf_realtyp_to_countertyp = {
44
+
"axiom": "theorem",
45
+
"theorem": "theorem",
46
+
"lemma": "theorem",
47
+
"algorithm": "theorem",
48
+
"definition": "theorem",
49
+
"remark": "theorem",
50
+
"conjecture": "theorem",
51
+
"corollary": "theorem",
52
+
"criterion": "theorem",
53
+
"example": "theorem",
54
+
"property": "theorem",
55
+
"observation": "theorem",
56
+
"proposition": "theorem",
57
+
"assumption": "theorem",
58
+
"notation": "theorem",
59
+
}
60
+
```
61
+
62
+
In the following case, the directives `lemma`, `conjecture`, `corollary` and `proposition` will share the counter with `theorem`, while `axiom` and `assumption` will share the counter with `definition`. All other directives would use their original counter.
63
+
64
+
65
+
```
66
+
prf_realtyp_to_countertyp = {
67
+
"lemma": "theorem",
68
+
"conjecture": "theorem",
69
+
"corollary": "theorem",
70
+
"proposition": "theorem",
71
+
"axiom": "definition",
72
+
"assumption": "definition",
73
+
}
74
+
```
75
+
76
+
````{warning}
77
+
The association of a counter to a directive is not transitive: Let us consider the following configuration:
78
+
79
+
```
80
+
prf_realtyp_to_countertyp = {
81
+
"lemma": "theorem",
82
+
"conjecture": "lemma",
83
+
}
84
+
```
85
+
86
+
The `lemma` and `theorem` directives share a counter, however the `conjecture` directive has a separate counter (the `lemma` counter which is **not** used by `lemma` directives).
87
+
````
88
+
34
89
## Title format
35
90
36
91
By default, the directive titles are formatted as `Name x.y.z (Title)`, where `Name` is the name of the directive (e.g., Proof, Theorem, Definition), `x.y.z` is the numbering of the directive, and `Title` is the optional title provided by the user.
0 commit comments