Skip to content

Commit

Permalink
Allow environments produced by thmbox to override block styling on an…
Browse files Browse the repository at this point in the history
… individual basis
  • Loading branch information
sahasatvik committed Feb 24, 2024
1 parent 369ff2a commit 90466e0
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 7 deletions.
Binary file modified basic.pdf
Binary file not shown.
Binary file modified differential_calculus.pdf
Binary file not shown.
Binary file modified manual.pdf
Binary file not shown.
11 changes: 6 additions & 5 deletions manual.typ
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ The functions `thmbox` and `thmplain` provide some simple defaults for the
appearance of `thmenv`s.


= Feature demonstration
= Feature demonstration <feat>

Create box-like _theorem environments_ using `thmbox`, a wrapper around
`thmenv` which provides some simple defaults.
Expand Down Expand Up @@ -341,16 +341,17 @@ On the other hand, the positional argument `"for Reals"` will always be
interpreted as the `name` argument in `fmt`.

```typst
#lemma(title: "Lem.")[
#lemma(title: "Lem.", stroke: 1pt)[
All multiples of 3 greater than 3 are composite.
]
```
#lemma(title: "Lem.")[
#lemma(title: "Lem.", stroke: 1pt)[
All multiples of 3 greater than 3 are composite.
]

Here, we override the `title` (which defaults to the `head`) in the `fmt`
produced by `thmbox`.
Here, we override the `title` (which defaults to the `head`) as well as the
`stroke` in the `fmt` produced by `thmbox`. All `block` arguments can be
overridden in `thmbox` environments in this way.


== Labels and references <references>
Expand Down
Binary file modified manual_examples.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion manual_examples.typ
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ these has been explained in full detail there.
The variable $x$ is reserved for real numbers.
]

#lemma(title: "Lem.")[
#lemma(title: "Lem.", stroke: 1pt)[
All multiples of 3 greater than 3 are composite.
]

Expand Down
3 changes: 2 additions & 1 deletion theorems.typ
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
if supplement == auto {
supplement = head
}
let boxfmt(name, number, body, title: auto) = {
let boxfmt(name, number, body, title: auto, ..blockargs_individual) = {
if not name == none {
name = [ #namefmt(name)]
} else {
Expand All @@ -133,6 +133,7 @@
radius: 0.3em,
breakable: false,
..blockargs.named(),
..blockargs_individual.named(),
[#title#name#separator#body]
)
)
Expand Down

0 comments on commit 90466e0

Please # to comment.