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
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,12 @@ Digit grouping can be configured with the `set-group()` function.
```typ
#set-group(
size: int = 3,
separator: content = sym.space.thin,
separator: content = sym.space.narrow,
threshold: int | dictionary = 5
)
```
- `size: int = 3` : Determines the size of the groups.
- `separator: content = sym.space.thin` : Separator between groups.
- `separator: content = sym.space.narrow` : Separator between groups.
- `threshold: int | dictionary = 5` : Necessary number of digits needed for digit grouping to kick in. Four-digit numbers for example are usually not grouped at all since they can still be read easily. This parameter also accepts dictionary arguments of the form `(integer: int, fractional: int)` to allow turning on grouping for only the integer or fractional part, for example `(integer: 5, fractional: calc.inf)`.


Expand Down Expand Up @@ -380,7 +380,7 @@ Similar to `num`, the function `quan` takes one argument, specifying a value and
- `quan[GHz]` - units can also go without a value
- `quan[600us]` - "u" is changed to "µ"

The precise syntax for specifying units is explained in the next section.
The precise syntax for specifying units is explained in the next section.
Units of the SI system and units that may be used in compliance with the SI system are automatically recognized and annotated with alt descriptions, see also [accessibility](#accessibility) below.


Expand Down Expand Up @@ -436,7 +436,7 @@ If you need to build more complex units, consisting of symbols, math, or other c
The appearance of units can be configured via `set-unit`:
```typ
#set-unit(
unit-separator: content = sym.space.thin,
unit-separator: content = sym.space.narrow,
fraction: str = "power",
prefix: auto | none = auto
)
Expand Down
4 changes: 2 additions & 2 deletions src/state.typ
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
breakable: false,
group: (
size: 3,
separator: sym.space.thin,
separator: sym.space.narrow,
threshold: 5,
),
round: (
Expand All @@ -32,7 +32,7 @@
ties: "away-from-zero",
),
unit: (
unit-separator: sym.space.thin,
unit-separator: sym.space.narrow,
fraction: "power",
use-sqrt: true,
prefix: auto,
Expand Down
13 changes: 13 additions & 0 deletions tests/breakable/ref.typ
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
#block(stroke: gray, width: 10em)[
The length is $(1plus.minus$\ $2)×10^2th"m"th"s"^(-1)$.
]
#block(stroke: gray, width: 6em)[
ABC\ $1th 000th 000$
]

#pagebreak()

Expand All @@ -45,6 +48,9 @@
#block(stroke: gray, width: 10em)[
The length is (1#th±#th\ 2) ⁠× ⁠10#super[2]#th;m#th;s#super[−1].
]
#block(stroke: gray, width: 4em)[
ABC\ 1#th;000#th;000
]

#pagebreak()

Expand All @@ -66,6 +72,9 @@
#block(stroke: gray, width: 10em)[
The length is $(1plus.minus$\ $2)#h(0pt)×#h(0pt)10^2th"m"th"s"^(-1)$.
]
#block(stroke: gray, width: 6em)[
ABC\ $1th 000th 000$
]


#pagebreak()
Expand All @@ -88,6 +97,10 @@
#block(stroke: gray, width: 10em)[
The length is (1#hair±#hair\ 2)#hair;⁠×#hair;⁠10#super[2]#th;m#th;s#super[−1].
]
#block(stroke: gray, width: 4em)[
ABC\ 1#th;000#th;000
]



#pagebreak()
Expand Down
4 changes: 4 additions & 0 deletions tests/breakable/test.typ
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#block(stroke: gray, width: 13em, test-clause(breakable: (unit: true)))
#block(stroke: gray, width: 12em, test-clause(breakable: (power: true)))
#block(stroke: gray, width: 10em, test-clause(breakable: (uncertainty: true)))
#block(stroke: gray, width: 6em, [ABC #num[1000000]])

#pagebreak()

Expand All @@ -28,6 +29,7 @@
#block(stroke: gray, width: 11em, test-clause(breakable: (unit: true)))
#block(stroke: gray, width: 10.5em, test-clause(breakable: (power: true)))
#block(stroke: gray, width: 10em, test-clause(breakable: (uncertainty: true)))
#block(stroke: gray, width: 4em, [ABC #num[1000000]])

#pagebreak()

Expand All @@ -40,6 +42,7 @@
#block(stroke: gray, width: 11em, test-clause(breakable: (unit: true)))
#block(stroke: gray, width: 10.5em, test-clause(breakable: (power: true)))
#block(stroke: gray, width: 10em, test-clause(breakable: (uncertainty: true)))
#block(stroke: gray, width: 6em, [ABC #num[1000000]])


#pagebreak()
Expand All @@ -53,6 +56,7 @@
#block(stroke: gray, width: 11em, test-clause(breakable: (unit: true)))
#block(stroke: gray, width: 10.5em, test-clause(breakable: (power: true)))
#block(stroke: gray, width: 10em, test-clause(breakable: (uncertainty: true)))
#block(stroke: gray, width: 4em, [ABC #num[1000000]])


#pagebreak()
Expand Down
Loading