A typst plugin for unit-aware calculations
typst
at main 787 B view raw
1#import "@local/evaltor:0.1.0": print_eval 2 3#show heading: it => { 4 it.body 5 v(1pt) 6} 7#set text(size:16pt) 8 9= Evaltor: Typst plugin for unit-aware calculations 10 11The function `print_eval` will print the input along with its result, calculated using `fend` backend, which is unit-aware. 12 13Some examples: 14 15#print_eval("2 km + 30 m") 16 17#print_eval("1 ft to cm") 18 19#print_eval("5'7\" to cm") 20 21#print_eval("cos (pi/4) + i * (sin (pi/4))") 22 23#print_eval("0b1001 + 3") 24 25#print_eval("0xffff to decimal") 26 27#print_eval("100 C to F") 28 29#print_eval("1 lightyear to parsecs") 30 31#print_eval("temperature = 30 °C; temperature to °F") 32 33#print_eval("((10um)/(0.334cm) + (0.6mm)/(35.28cm) + (1mm)/(47.57cm) + (0.4mm)/(35.28cm) + (2um)/(3.56cm)) to percent") 34 35*Currently, random numbers are not available.*