Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant