Skip to content

Commit 11a3d3f

Browse files
committed
fixes
1 parent a6b23e2 commit 11a3d3f

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

main.pdf

0 Bytes
Binary file not shown.

src/base.typ

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,14 @@
9090
) = {
9191
let _body = body
9292
if fmt-suffix != none {
93-
if body.has("children") {
94-
if body.children.last() == [ ] {
93+
if _body.has("children") {
94+
let candidate = _body.children.last()
95+
if candidate == [ ] {
9596
_body = body.children.slice(0, -1).join()
97+
if _body.has("children") {
98+
candidate = _body.children.last()
99+
} // TODO: else ?
96100
}
97-
let candidate = _body.children.last()
98101
if candidate.func() == math.equation and candidate.block and math.equation.numbering == none {
99102
_body = {
100103
_body.children.slice(0, -1).join()
@@ -222,7 +225,7 @@
222225
}
223226

224227
/// Default "show" function for theorems. Note that in your versions of this, you cannot use `it` to generate the default options, but you can fall back to `theoretic.show.theorem(it)`.
225-
///
228+
///
226229
/// For your own style, make sure to always handle the "link" option, which will be set by @restate and @solutions and contains a link target for the supplement (to link to the original location).
227230
#let show-theorem(
228231
/// A dictionary with keys:
@@ -502,7 +505,10 @@
502505
number = thmnr
503506
} else {
504507
let h = counter(heading).get().first()
505-
let h_fmt = numbering(heading.numbering, h).trim(".", at: end)
508+
let h_fmt = numbering(heading.numbering, h)
509+
if type(h_fmt) == str {
510+
h_fmt = h_fmt.trim(".", at: end)
511+
}
506512
number = {
507513
h_fmt
508514
"."

0 commit comments

Comments
 (0)