Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/units.typ
Original file line number Diff line number Diff line change
Expand Up @@ -313,13 +313,14 @@
sym.wj
separator
if not breakable.unit { sym.wj }
box(show-unit(
show-unit(
unit.numerator,
unit.denominator,
fraction: num-state.unit.fraction,
unit-separator: num-state.unit.unit-separator,
math: num-state.math,
))
use-sqrt: num-state.unit.use-sqrt
)
}

result
Expand Down
5 changes: 5 additions & 0 deletions tests/zi/sqrt/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# generated by tytanic, do not edit

/diff/
/out/
/ref/
37 changes: 37 additions & 0 deletions tests/zi/sqrt/ref.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#set page(width: auto, height: auto, margin: .5em)


#let th = sym.space.thin

$"K"^(0.5)$ \
$42th"K"^(0.5)$ \
$"s"th"K"^(-0.5)$ \
$42th"s"th"K"^(-0.5)$

$"K"^(0.5)$ \
$42th"K"^(0.5)$ \
$"s"\/"K"^(0.5)$ \
$42th"s"\/"K"^(0.5)$ \

$"K"^(0.5)$ \
$42th"K"^(0.5)$ \
$"s"/"K"^(0.5)$ \
$42th"s"/"K"^(0.5)$ \

#pagebreak()


$√"K"$ \
$42th√"K"$ \
$"s"th"K"^(-0.5)$ \
$42th"s"th"K"^(-0.5)$

$√"K"$ \
$42th√"K"$ \
$"s"\/√"K"$ \
$42th"s"\/√"K"$ \

$√"K"$ \
$42th√"K"$ \
$"s"/sqrt("K")$ \
$42th"s"/sqrt("K")$ \
43 changes: 43 additions & 0 deletions tests/zi/sqrt/test.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#import "/src/zero.typ": *

#set page(width: auto, height: auto, margin: .5em)


#let Kroot = zi.declare("K^0.5")
#let K-root = zi.declare("s/K^0.5")


#let sample = [
#Kroot() \
#Kroot()[42] \
#K-root() \
#K-root()[42] \
]
#set-unit(use-sqrt: false)
#set-unit(fraction: "power")
#sample

#set-unit(fraction: "inline")
#sample

#set-unit(fraction: "fraction")
#sample

#pagebreak()


#set-unit(use-sqrt: true)
#set-unit(fraction: "power")
#sample

#set-unit(fraction: "inline")
#sample

#set-unit(fraction: "fraction")
#sample
// $
// #kg-K1-2(use-sqrt: false) \
// #kg-K1-2(use-sqrt: false, fraction: "inline") \
// #kg-K1-2(use-sqrt: false)[42] \
// #kg-K1-2(use-sqrt: false, fraction: "inline")[42]
// $
Loading