From 42f784aae92313c9935b3689d43ecc8cf10cf8b9 Mon Sep 17 00:00:00 2001 From: Joshua Lampert Date: Thu, 21 Nov 2024 16:18:47 +0100 Subject: [PATCH] simplify if-clause --- lib.typ | 11 ++++++----- template/main.pdf | Bin 90293 -> 90293 bytes 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib.typ b/lib.typ index 6338844..0656286 100644 --- a/lib.typ +++ b/lib.typ @@ -78,20 +78,21 @@ set math.equation(numbering: equation-numbering-pattern) if equate-settings != n show ref: it => { let eq = math.equation let el = it.element + + let is-normal-equation = el != none and el.func() == eq let with-subnumbers = equate-settings != none and equate-settings.keys().contains("sub-numbering") and equate-settings.sub-numbering - if equate-settings != none and el != none and el.func() == eq { - //Normal equation + let is-sub-equation = el != none and el.func() == figure and el.kind == eq + if equate-settings != none and is-normal-equation { link(el.location(), numbering( el.numbering, ..counter(eq).at(el.location()) )) - } else if equate-settings != none and not with-subnumbers and el != none and el.func() == figure and el.kind == eq { - // Equate equations + } else if equate-settings != none and not with-subnumbers and is-sub-equation { link(el.location(), numbering( el.numbering, counter(eq).at(el.location()).at(0) - 1 )) - } else if equate-settings != none and el != none and el.func() == figure and el.kind == eq { + } else if equate-settings != none and is-sub-equation { link(el.location(), numbering( el.numbering, ..el.body.value diff --git a/template/main.pdf b/template/main.pdf index f5d1ff92ece253ac5c419f077678cf2ad5151a7d..19b6396ad1082301cf995344d14373a36a8bacd7 100644 GIT binary patch delta 156 zcmdmbkag=p)(xNLiy11I8Y&nl1aT>Vfqr_ifr6>QW{w5g>y#{v%%e1c68gURDK3d6 zsR|k{Rz?O!CWeMahK8nwKRfSclX|8Dorf%6q24*>C*`ev%4+b&{ fF|t@#8JSPN9>iz}W^LyQW-Q~yp=0`t1V&i^)ub(} delta 156 zcmdmbkag=p)(xNLiy0`G8Ymbj1aT>Vfqr_ip@OO5W{w5g>y%6k&7w4c68gURDK3d6 zsR|k{Rz?O!CWeMahK8nwK3g8`UN3w7H(-Sc|PUa4+b&{ fF|wFg8JbPM9>iz}W^LyQW-Q~yp=0`t1V&i^k_;?!