-
Notifications
You must be signed in to change notification settings - Fork 0
/
extension_documentation.qmd
122 lines (95 loc) · 4.65 KB
/
extension_documentation.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
---
title: "Custom-numbered-blocks Example"
number-sections: true
filters:
- custom-numbered-blocks
format:
html: default
pdf: default
custom-numbered-blocks:
groups:
thmlike:
colors: [948bde, 584eab]
boxstyle: foldbox.simple
collapse: false
listin: [mathstuff]
todos: default
classes:
Theorem:
group: thmlike
Corollary:
group: thmlike
Conjecture:
group: thmlike
collapse: true
Definition:
group: thmlike
colors: [d999d3, a01793]
Feature: default
TODO:
label: "To do"
colors: [e7b1b4, 8c3236]
group: todos
listin: [stilltodo]
DONE:
label: "Done"
colors: [cce7b1, 86b754]
group: todos
---
# Custom blocks and crossreferencing
With this filter, you can define custom div classes (environments) that come with numbering, such as theorems, examples, exercises. The filter supports output formats pdf and html.
::: Feature
### Numbering
Numbering is (currently) within section for single documents, or within chapter for books. Grouped classes share the same counter, and the same default style.
Numbered custom blocks can be cross-referenced with `\ref`.
Default numbering can be switched off for the whole class by setting the `numbered` to false, or for an individual block by adding the class `unnumbered`.
Crossreferences my need a re-run to update.
::: Feature
### Boxes can be nested
However, inner boxes are not numbered -- it would be hard to put them in a sequence with outer boxes anyway.
:::
:::
::: {.Feature title="Block box style"}
The default style for custom divs is `foldbox`: a collapsible similar to quarto's callouts, with a collapse button at the bottom that makes it easier collapse long boxes, and box open to the right. It comes with the variant `foldbox.simple`, with closed box and no additional close button. (needs a fix for the moment)
:::
::: TODO
### Custom styles
- [ ] create an API for user defined block styles
- [ ] provide an example
- [ ] and documentation
:::
::: {.DONE label="Done, may change"}
### Custom list of blocks
Generate `.qmd` files that contains a list of selected block classes, intermitted with headers from the document for easy customization and commenting.
This way, one can make a list of all definitions, examples, or {theorems, propositions and lemmas} etc., edit it later and attach to the main document.
If you edit, make sure to rename the autogenerated list first, otherwise it will get overwritten in the next run and all work is lost ...
Currently, you need to give a key `listin` for any class or group of classes that should appear in a list of things. The value of this key is an array of names, also if only one list is to be generated. These names are turned into files `list-of-`name`.qmd`. I am considering replacing the yaml interface by a sub-key to `custom-numbered-classes`. This would allow to define arbitrary classes that can be attached to any custom div block, such as `.important`.
:::
# Pseudomath examples
::: Definition
### F$\alpha$ncybox {#fancy}
A box is called *f$\alpha$ncybox* if it looks quite fancy.
In this context, by *fancy* we mean that the title of the box appears as a clickable button when rendered as html, where *clickable* implies that it throws a small shadow that becomes bigger when hovering over it.
:::
::: {.Definition}
A box is called *f$\alpha$ncybox* if it looks quite fancy.
In this context, by *fancy* we mean that the title of the box appears as a clickable button when rendered as html, where *clickable* implies that it throws a small shadow that becomes bigger when hovering over it.
:::
::: Corollary
By Definition \ref{fancy}, `foldboxes` are fancyboxes.
:::
::: {.Conjecture #TeachersHope}
Students are lured into clicking on the title and unfolding the fancybox.
:::
::: {.Theorem #TeacherHopes collapse="true"}
This extension has been written by a teacher who hopes that students read the course notes...
:::
Theorem \ref{TeacherHopes} is suggested by Conjecture \ref{TeachersHope}, but it cannot be proven theoretically. It does give rise to more conjectures, though. \ref{fancy}
::: {.Conjecture .unnumbered}
The teacher mentioned in Theorem \ref{TeacherHopes} is a statistician who got addicted to quarto due to James J Balamuta's web-r extension, and desparately wanted to have a common counter for theorem and alike. She got also convinced that everything is possible in quarto by the many nice extensions from Shafayet Khan Shafee.
:::
<!-- append autogenerated list here. You may want to rename and edit first.
# List of math boxes
to append the list-of-mathstuff, enclose next line in shortcut parentheses
include list-of-mathstuff.qmd
-->