Open gdahia opened 6 months ago
Hi, thank you! It should be using the ref
function:
#import "@preview/lemmify:0.1.5": default-theorems
#let (theorem, rules: thm-rules) = default-theorems("thm-group")
#show: thm-rules
#show ref: text.with(red)
#theorem[Test] <thm>
@thm
and so in template customization either we get links with this custom style, or theorem references that do not match the style of the normal text.
I'm not sure what you mean, can you give an example?
I'm not sure what you mean, can you give an example?
Sure! The following renders "Section 1" in red, but "Theorem 1" in blue:
#import "@preview/lemmify:0.1.5": default-theorems
#let (theorem, rules: thm-rules) = default-theorems("thm-group")
#show: thm-rules
#show ref: text.with(red)
#show link: text.with(blue)
= Introduction
<introduction>
#theorem[Test] <thm>
@thm
@introduction
Ok so I looked into it and unfortunately I don't think there is much that can be done about this. The problem is that the ref
function only accepts a target (ie a label) and a supplement and then basically just displays supplement + counter(label).display()
and links this to the target. The problem however is that this package allows custom numberings based on the headings counter, which makes it impossible to use the ref
function. So the only solution (I could come up with) is to use link
instead, which results in this behaviour.
Perhaps we should take this issue to the maintainers of typst
, then? Do you think that there is a good reason for the different behavior in ref
and link
?
Thanks for the great lib! I am using it a lot for my personal notes and for writing preliminary versions of papers.
That said, I was trying to customize the styling of a template, and realized that referencing for theorems is using the
link
function instead of theref
function with a custom kind. This makes these references follow thelink
show rules instead of theref
ones, and so in template customization either we get links with this custom style, or theorem references that do not match the style of the normal text.I think I figured it out how to do this without changing
lemmify
by customizing theref-styling
configuration, but I think this changing this inside the core lib might be useful to others. What do you think?