-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.qmd
70 lines (49 loc) · 1.58 KB
/
example.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
title: "Quarto Shortcode for SI Values"
---
# Summary
This extension creates a shortcode `si` for setting SI values and units. The structure of the shortcode is as follows
```{shortcodes=false}
{{< si 1.45 m s-1 >}}
```
which renders as
{{< si 1.45 m s-1 >}}
Numbers with an order of magnitude can be rendered by adding `e` or `E`
```{shortcodes=false}
{{< si 1.45E2 m s-1 >}}
```
which renders as {{< si 1.45E2 m s-1 >}}.
SI prefixes and exponents of units are recognized. `.` is rendered as centered dot, slashes `/` are rendered as slashes.
```{shortcodes=false}
{{< si 1.45 kg . m2 s-3 / cm >}}
```
{{< si 1.45 kg . m2 s-3 / cm >}}
Furthermore, some units that use non-ASCII symbols can instead be typed by ASCII characters
```{shortcodes=false}
{{< si 1.45 ohm ang um-3>}}
```
{{< si 1.45 ohm ang um-3>}}
Uncertainties can be speficied using `+-`
```{shortcodes=false}
{{< si 1.45+-0.01 ohm ang um-3 >}}
```
{{< si 1.45+-0.01 ohm ang um-3 >}}
More correct is to enclose the value in `()` when specifying uncertainties
```{shortcodes=false}
{{< si (1.45+-0.01) ohm ang um-3 >}}
```
{{< si (1.45+-0.01) ohm ang um-3 >}}
Sometimes subscripts are added to units such as when specifying whether an amplitude is peak-to-peak or RMS
```{shortcodes=false}
{{< si (1.45+-0.01) V_pp >}}
```
{{< si (1.45+-0.01) V_pp >}}
The shortcode does not take care of the difference between degree (in terms of angles) and degree Celsius, but it allows typesetting them correctly.
```{shortcodes=false}
{{< si 15.2° >}}
```
{{< si 15.2° >}}
```{shortcodes=false}
{{< si 15.2 °C >}}
```
{{< si 15.2 °C >}}