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

Equate: Supplement function not called if default #set ref(supplement: ..) is set #12

Closed
hbierlee opened this issue Jul 2, 2024 · 0 comments

Comments

@hbierlee
Copy link

hbierlee commented Jul 2, 2024

Hi,

Great work on your equate plugin!

I think I found an issue if I set supplement default on ref.

image

See Example on typst.app

#import "@preview/equate:0.2.0": equate
#show: equate.with(breakable: false, sub-numbering: true)
#set math.equation(numbering: "(1.1)")
#set heading(numbering: "(1.1)")

= heading
<sec>
A ref to heading with custom sup @sec

$
  1+1=2 #<dbg:eq:1-1>\
  42
$ <dbg:eq:1>

This is a ref to an equation @dbg:eq:1, and ok ref to sub-equation @dbg:eq:1-1

#set ref(supplement: el => {
  if el.func() == heading {
    [CUSTOM SUP.]
  } else {
    el.supplement
  }
})

This is a ref to an equation @dbg:eq:1, and buggy sub-equation @dbg:eq:1-1

A work-around at the moment is to use show instead, but it would be nice if we can safely overwrite ref default arguments.

Cheers,

Henk

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant