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
Copy file name to clipboardExpand all lines: CHANGELOG.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,18 @@
1
1
# Changelog
2
2
3
+
## Unreleased
4
+
5
+
### Added
6
+
7
+
- Options for customizing proof directive title format. [#163](https://github.com/executablebooks/sphinx-proof/pull/163)
8
+
- Possibility for shared numbering of groups of directives, fixing [\#64](https://github.com/executablebooks/sphinx-proof/issues/64). [\#https://github.com/executablebooks/sphinx-proof/pull/161](https://github.com/executablebooks/sphinx-proof/pull/161)
9
+
10
+
### Fixed
11
+
12
+
- Inconsistencies and missing colors within CSS styles. [b337c21](https://github.com/executablebooks/sphinx-proof/commit/b337c21675464224a4418beb9e70d3b6dc8e4127)
13
+
- Missing documentation for notation directive. [6f33744](https://github.com/executablebooks/sphinx-proof/commit/6f33744544b7596a30beba5b8807491d642b77a7) and [b15c7c0](https://github.com/executablebooks/sphinx-proof/commit/b15c7c09adefe85e0fdb8dea6dc460bd0f51fb1f)
14
+
- Nesting of unnumbered directives, fixing [\#165](https://github.com/executablebooks/sphinx-proof/issues/165).
Copy file name to clipboardExpand all lines: docs/source/options.md
+110-2Lines changed: 110 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,7 @@
1
1
# Options
2
2
3
+
## Minimal color scheme
4
+
3
5
This package has the option to choose a more **minimal** color scheme.
4
6
5
7
The aim is to create admonitions that are clearly different to the core text with
@@ -15,7 +17,7 @@ compared to the current default
15
17
16
18
To enable the `minimal` color scheme you can use the following.
17
19
18
-
## Jupyter Book Project
20
+
###Jupyter Book Project
19
21
20
22
Add `proof_minimal_theme = True` to your `_config.yml`
21
23
@@ -25,6 +27,112 @@ sphinx:
25
27
proof_minimal_theme: true
26
28
```
27
29
28
-
## Sphinx Project
30
+
### Sphinx Project
29
31
30
32
Add `proof_minimal_theme = True` to your `conf.py`
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
+
89
+
## Title format
90
+
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.
92
+
93
+
If no title is provided, only `Name x.y.z` is displayed.
94
+
95
+
The font weight of the entire title (`Name x.y.z (Title)` or `Name x.y.z`) is set to `--pst-admonition-font-weight-heading` by default, which commonly results in a semi-bold appearance.
96
+
97
+
In the reminder we call the part `Name x.y.z` the "number" and the part `(Title)` the "title".
98
+
99
+
You can customize the title format using the `proof_title_format` option:
100
+
101
+
- This option allows you to define how the title should be displayed by using `%t` as a placeholder for the user-provided title.
102
+
- The default format is ` (%t)`.
103
+
- A value of an empty string will result in no title being displayed.
104
+
- A `markdown` string can be used to format the title.
105
+
- For example, ` *%t*` will emphasize the title and contain no brackets.
106
+
107
+
Note that the initial part of the title (i.e., `Name x.y.z`) is not customizable and will always be displayed.
108
+
109
+
The font weight of the title can be adjusted using the `proof_title_weight` option:
110
+
111
+
- Any valid CSS font-weight value can be used, such as `normal`, `bold`, `bolder`, `lighter`, or numeric values like `400`, `700`, etc.
112
+
- Default value is `var(--pst-admonition-font-weight-heading)`.
113
+
114
+
The font weight of the number can be adjusted using the `proof_number_weight` option:
115
+
- Any valid CSS font-weight value can be used, such as `normal`, `bold`, `bolder`, `lighter`, or numeric values like `400`, `700`, etc.
116
+
- Default value is `var(--pst-admonition-font-weight-heading)`.
117
+
118
+
### Jupyter Book Project
119
+
120
+
Add `proof_title_format`, `proof_number_weight` and/or `proof_title_weight` to your `_config.yml`
121
+
122
+
```yaml
123
+
sphinx:
124
+
config:
125
+
proof_title_format: " *%t*"
126
+
proof_number_weight: "bold"
127
+
proof_title_weight: "normal"
128
+
```
129
+
130
+
### Sphinx Project
131
+
132
+
Add `proof_title_format`, `proof_number_weight` and/or `proof_title_weight` to your `conf.py`
Copy file name to clipboardExpand all lines: docs/source/syntax.md
+37Lines changed: 37 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -749,6 +749,43 @@ This is a dummy assumption directive.
749
749
750
750
You can refer to an assumption using the `{prf:ref}` role like: ```{prf:ref}`my-assumption` ```, which will replace the reference with the assumption number like so: {prf:ref}`my-assumption`. When an explicit text is provided, this caption will serve as the title of the reference.
751
751
752
+
(syntax:notation)=
753
+
### Notations
754
+
755
+
A notation directive can be included using the `prf:notation` pattern. The directive is enumerated by default and can take in an optional title argument. The following options are also supported:
756
+
757
+
*`label` : text
758
+
759
+
A unique identifier for your notation that you can use to reference it with `{prf:ref}`. Cannot contain spaces or special characters.
760
+
*`class` : text
761
+
762
+
Value of the notation’s class attribute which can be used to add custom CSS or JavaScript.
763
+
*`nonumber` : flag (empty)
764
+
765
+
Turns off notation auto numbering.
766
+
767
+
**Example**
768
+
769
+
```{prf:notation}
770
+
:label: my-notation
771
+
772
+
This is a dummy notation directive.
773
+
```
774
+
775
+
**MyST Syntax**
776
+
777
+
``````md
778
+
```{prf:notation}
779
+
:label: my-notation
780
+
781
+
This is a dummy notation directive.
782
+
```
783
+
``````
784
+
785
+
#### Referencing Notations
786
+
787
+
You can refer to a notation using the `{prf:ref}` role like: ```{prf:ref}`my-notation` ```, which will replace the reference with the notation number like so: {prf:ref}`my-notation`. When an explicit text is provided, this caption will serve as the title of the reference.
788
+
752
789
## How to Hide Content
753
790
754
791
Directive content can be hidden using the `dropdown` class which is available through [sphinx-togglebutton](https://sphinx-togglebutton.readthedocs.io/en/latest/). If your project utilizes the [MyST-NB](https://myst-nb.readthedocs.io/en/latest/) extension, there is no need to activate `sphinx-togglebutton` since it is already bundled with `MyST-NB`.
0 commit comments