You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: undergradmath.typ
+23-20Lines changed: 23 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -84,8 +84,11 @@
84
84
it.body+h(0.67em),
85
85
)
86
86
87
-
// Black raw code
88
-
#showraw.where(block: false): it=> { it.text }
87
+
#setraw(lang: "typm")
88
+
#letmonospace= text.with(
89
+
font: "DejaVu Sans Mono",
90
+
size: 0.8em
91
+
)
89
92
90
93
// Two-column layout
91
94
#show: rest=>columns(2, rest)
@@ -130,14 +133,14 @@ The original version is available at #link("https://gitlab.com/jim.hefferon/unde
130
133
131
134
= Rule One
132
135
Any mathematics at all, even a single character, gets a mathematical setting.
133
-
Thus, for "the value of #eqn(alt: "x", $x$) is #eqn(alt: "7", $7$)" enter `the value of $x$ is $7$`.
136
+
Thus, for "the value of #eqn(alt: "x", $x$) is #eqn(alt: "7", $7$)" enter ```typ the value of $x$ is $7$```.
134
137
135
138
= Template
136
139
Your document should contain at least this.
137
140
138
141
#grid(
139
142
"",
140
-
```
143
+
```typ
141
144
-- document body here --
142
145
```,
143
146
)
@@ -163,7 +166,7 @@ Your document should contain at least this.
163
166
)
164
167
165
168
= Calligraphic letters
166
-
Use as in `$cal(A)$`.
169
+
Use as in ```typ $cal(A)$```.
167
170
168
171
#eqn(
169
172
alt: "calligraphic uppercase letters A through Z",
@@ -173,7 +176,7 @@ Use as in `$cal(A)$`.
173
176
174
177
// #show math.equation: set text(stylistic-set: 1)
175
178
// Get script letters, such as $cal(P)$ from `$cal(P)$`, by changing the `stylistic-set` parameter of `text()` to the corresponding set.
176
-
Get script letters by using `scr`, such as #eqn(alt: "script capital P", $scr(P)$) from `$scr(P)$`.
179
+
Get script letters by using `scr`, such as #eqn(alt: "script capital P", $scr(P)$) from ```typ $scr(P)$```.
177
180
See #link("https://typst.app/docs/reference/math/variants/#functions-scr")[`scr`] for more information.
178
181
179
182
= Greek
@@ -349,10 +352,10 @@ Get the set complement #eqn(alt: "complement of A", $A^(sans(c))$) with `A^(sans
349
352
// The Math fonts provide the character \varnothing (⌀, U+2300), as an alternative to \emptyset (a slashed zero), through Character Variant cv01.
350
353
// The fontsetup package provides the option ‘varnothing’ to easily switch to the alternative character.
351
354
352
-
/ Remark: Using `diameter` for `\varnothing` may cause some confusion.
353
-
However, in #LaTeX, the `\varnothing` provided through Character Variant `cv01` is also `diameter`
355
+
/ Remark: Using `diameter` for ```tex \varnothing``` may cause some confusion.
356
+
However, in #LaTeX, the ```tex \varnothing``` provided through Character Variant #monospace[cv01] is also `diameter`
354
357
(see #link("http://mirrors.ctan.org/fonts/newcomputermodern/doc/newcm-doc.pdf")[newcm #{ sym.section }14.5]).
355
-
So a simple solution with the default math font _New Computer Modern Math_ is to define a new symbol `varnothing` with `#let varnothing = math.diameter`.
358
+
So a simple solution with the default math font _New Computer Modern Math_ is to define a new symbol `varnothing` with ```typ #let varnothing = math.diameter```.
356
359
Other solutions can be found in #link("https://sitandr.github.io/typst-examples-book/book/basics/math/symbols.html#empty-set")[Typst Examples Book].
357
360
358
361
= Decorations
@@ -497,9 +500,9 @@ Just type them!
497
500
498
501
#letcosec= math.op("cosec")
499
502
500
-
If an operator you wish to use does not exist, you can create one using `math.op`. For example, to create the #eqn(alt: "cosecant", $cosec$) operator:
503
+
If an operator you wish to use does not exist, you can create one using ```typc math.op```. For example, to create the #eqn(alt: "cosecant", $cosec$) operator:
501
504
502
-
```
505
+
```typ
503
506
#let cosec = math.op("cosec")
504
507
$ cosec x = 1/(sin x) $
505
508
```
@@ -635,7 +638,7 @@ $ cosec x = 1/(sin x) $
635
638
Use `a divides b` for the divides relation, #eqn(alt: "a divides b", $a divides b$), and `a divides.not b` for the negation, #eqn(alt: "a does not divide b", $a divides.not b$).
636
639
Use `|` to get set builder notation #eqn(alt: "the set of all a in S such that a is odd", ${a in S | a "is odd"}$) with `{a in S | a "is odd"}`.
637
640
638
-
= Arrows
641
+
#block(sticky: true)[= Arrows]
639
642
#align(
640
643
center,
641
644
table(
@@ -847,15 +850,15 @@ Get a matrix with the `mat` function. You can pass an array to it.
847
850
$mat(a, b; c, d) $,
848
851
),
849
852
[
850
-
```
853
+
```typ
851
854
$ mat(a, b; c, d) $
852
855
```
853
856
],
854
857
),
855
858
)
856
859
857
860
In Typst, #link("https://typst.app/docs/reference/foundations/array")[array] is a sequence of values,
858
-
while in #LaTeX, array is a matrix without fences, which is `$mat(delim: #none, ..)$` in Typst.
861
+
while in #LaTeX, array is a matrix without fences, which is ```typ $mat(delim: #none, ..)$``` in Typst.
859
862
860
863
For the determinant use `|A|`, text operator #eqn(alt: "determinant", $det$) `det` or `mat(delim: "|", ..)`.
861
864
@@ -892,10 +895,10 @@ Improve #eqn(alt: "square root of two times x", $sqrt(2) x$) to #eqn(alt: "squar
892
895
Slightly wider are `med` and `thick` (the three are in ratio #eqn(alt: "3 to 4 to 5", $3 : 4 : 5$)).
893
896
Bigger space are: `quad` for #eqn(alt: "A right arrow, followed by a quad space, then a left arrow. The quad space is about the width of the capital letter 'M'.", box[$-> quad <-$]) and `wide` for #eqn(alt: "A right arrow, followed by a wide space, then a left arrow. The wide space is about twice the width of the capital letter 'M'.", $-> wide <-$), which are useful between parts of a display.
894
897
Get arbitrary space with the `h` function.
895
-
For example, use `#h(-0.1667em)` for `\!` in #LaTeX.
898
+
For example, use `#h(-0.1667em)` for ```tex \!``` in #LaTeX.
896
899
897
900
= Displayed equations
898
-
Display equations in a block level using `$ ... $` with at least one space separating the math content and the `$`.
901
+
Display equations in a block level using ```typ $ ... $``` with at least one space separating the math content and the #monospace[\$].
899
902
900
903
#align(
901
904
center,
@@ -908,7 +911,7 @@ Display equations in a block level using `$ ... $` with at least one space separ
908
911
$ S = k dotlg W $,
909
912
),
910
913
[
911
-
```
914
+
```typ
912
915
$ S = k dot lg W $
913
916
```
914
917
],
@@ -931,7 +934,7 @@ You can break into multiple lines.
931
934
$,
932
935
),
933
936
[
934
-
```
937
+
```typ
935
938
$ sin(x) = x - x^3 / 3! \
936
939
+ x^5 / 5! - dots.h.c $
937
940
```
@@ -954,15 +957,15 @@ Align equations using `&`
954
957
nabladotbold(B) & = 0
955
958
$,
956
959
),
957
-
```
960
+
```typ
958
961
$ nabla dot bold(D) &= rho \
959
962
nabla dot bold(B) &= 0 $
960
963
```,
961
964
),
962
965
)
963
966
964
967
(the left or right side of an alignment can be empty).
965
-
Get a numbered version by `#set math.equation(numbering: ..)`.
968
+
Get a numbered version by ```typ #set math.equation(numbering: ..)```.
0 commit comments