ChHecker / unify

Format numbers, units, and ranges in Typst correctly.
MIT License
23 stars 17 forks source link

Degree after percent causes error #34

Closed alex210-1 closed 3 months ago

alex210-1 commented 3 months ago

both $qty("0.393", "% / d K")$ and $qty("0.393", "percent per degree kelvin")$

Cause the error unknown variable: percentdegree in unify 0.6.0

ChHecker commented 3 months ago

This is actually intended behavior. The degree symbol by its own may only be used directly after a number. The temperature units, however, are allowed on their own. If you e.g. want to use "percent per degree Celsius", #qty("0.393", "% / dC") will work because instead of manually using d C, the unit dC is used as one. In the case of Kelvin, this won't work for a very specific reason: Kelvin is not given in degrees, as it is an absolute scale. The physically proper way would thus be #qty("0.393", "% / K").