Closed linuxrider closed 7 months ago
Could you provide an example that doesn't work?
E.g. #num("-2.5")
works perfectly for me.
If you do calculations or use variables it works for positive numbers but not for negative numbers. The proposed change allows to directly use numbers as is and not in a string, which enhances convenience for the user.
#import "@preview/unify:0.4.3": num
#let x = -2
#let y = 3
// #num(x) // does not work
// #num(str(x)) // does not work
#num(y) // works
#num(str(y)) // works
#num(calc.exp(1)) // works
// #num(-calc.exp(1)) // does not work
Thank you for your contribution!
str()
converts minus-
to unicode\u2212
which prevents the regex to match. This is fixed by replacing it again with-
.