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
Add options for proof directive title formatting (#163)
* Add options for proof directive title formatting
Introduces new configuration options: proof_title_format, proof_number_weight, and proof_title_weight, allowing users to customize the format and font weight of proof directive titles. Documentation and CSS updated to reflect these changes, and directive logic now applies the user-defined title format.
Copy file name to clipboardExpand all lines: docs/source/options.md
+55-2Lines changed: 55 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,57 @@ 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
+
## Title format
35
+
36
+
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.
37
+
38
+
If no title is provided, only `Name x.y.z` is displayed.
39
+
40
+
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.
41
+
42
+
In the reminder we call the part `Name x.y.z` the "number" and the part `(Title)` the "title".
43
+
44
+
You can customize the title format using the `proof_title_format` option:
45
+
46
+
- This option allows you to define how the title should be displayed by using `%t` as a placeholder for the user-provided title.
47
+
- The default format is ` (%t)`.
48
+
- A value of an empty string will result in no title being displayed.
49
+
- A `markdown` string can be used to format the title.
50
+
- For example, ` *%t*` will emphasize the title and contain no brackets.
51
+
52
+
Note that the initial part of the title (i.e., `Name x.y.z`) is not customizable and will always be displayed.
53
+
54
+
The font weight of the title can be adjusted using the `proof_title_weight` option:
55
+
56
+
- Any valid CSS font-weight value can be used, such as `normal`, `bold`, `bolder`, `lighter`, or numeric values like `400`, `700`, etc.
57
+
- Default value is `var(--pst-admonition-font-weight-heading)`.
58
+
59
+
The font weight of the number can be adjusted using the `proof_number_weight` option:
60
+
- Any valid CSS font-weight value can be used, such as `normal`, `bold`, `bolder`, `lighter`, or numeric values like `400`, `700`, etc.
61
+
- Default value is `var(--pst-admonition-font-weight-heading)`.
62
+
63
+
### Jupyter Book Project
64
+
65
+
Add `proof_title_format`, `proof_number_weight` and/or `proof_title_weight` to your `_config.yml`
66
+
67
+
```yaml
68
+
sphinx:
69
+
config:
70
+
proof_title_format: " *%t*"
71
+
proof_number_weight: "bold"
72
+
proof_title_weight: "normal"
73
+
```
74
+
75
+
### Sphinx Project
76
+
77
+
Add `proof_title_format`, `proof_number_weight` and/or `proof_title_weight` to your `conf.py`
0 commit comments