#How to write Units?

31 messages · Page 1 of 1 (latest)

forest ridge
#

How do you write units with typst, like in LaTeX with the \unit command?

#

How to write Units?

#

I just found stuff like :

$1000 degree.c$
#

But the problem is, that it does not have the space between the number and the unit itself.

#

My workaround for now is to just do:

1000 $degree.c$
oblique gyro
#

?render

#let degree(num) = {[#num] + " °C"}

It's #degree(23) outside.
oblique gyro
#

I guess like this?

#

Or how exactly do you want it

hexed osprey
#

I mean, LaTeX doesn't have this built in either. Someone needs to create typst-siunitx 🙂

forest ridge
#

yeah like this. But now I need to figure out how to do it with any kind of unit.

hexed osprey
#

you can do

#

?render $1000 space degree.c$

dry shadowBOT
forest ridge
#

ah so there is space inside the math block

#

perfect, thats fine with me :D

hexed osprey
#

yes

#

?render $a thin a space a quad a$

dry shadowBOT
hexed osprey
#

I can't remember if there are more

#

you can always do #h to set arbitrary spacing also

#

to your liking

oblique gyro
#

?render

$1000 space.third degree.c$ \
$1000 space.thin degree.c$ \
$1000 space.sixth degree.c$
oblique gyro
forest ridge
#

oh wow thats great :D

hexed osprey
#

thin might be easier

forest ridge
#

yeah

hexed osprey
#

?render $1000 thin degree.c$

dry shadowBOT