Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
Fix function supplements
Browse files Browse the repository at this point in the history
Closes #12
  • Loading branch information
EpicEricEE committed Jul 2, 2024
1 parent ce54027 commit 820a82a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions equate/src/equate.typ
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@

let supplement = if it.supplement == auto {
it.element.supplement
} else if type(it.supplement) == function {
(it.supplement)(it.element)
} else {
it.supplement
}
Expand Down
Binary file modified equate/tests/reference/ref/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions equate/tests/reference/test.typ
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,13 @@ $ a + b \
@outer, @inner, @no-sub, @labelled

See @inner[] and @outer[eq.]

#set ref(supplement: it => {
if it.label == <inner> {
"Subequation"
} else {
"Equation"
}
})

@inner, @outer

0 comments on commit 820a82a

Please sign in to comment.