├── .gitignore ├── example ├── main.pdf ├── files │ ├── helix.pdf │ ├── logo.png │ ├── main.pdf │ ├── mesh.png │ ├── sine.pdf │ ├── dc-eqns.png │ ├── dc-setup.png │ ├── slicer.png │ ├── dc-results.png │ ├── divergence.png │ ├── screenshot.png │ ├── hilbertcurves.pdf │ ├── sample-handout.pdf │ ├── MathClubTalk2009.pdf │ ├── weak-formulation.png │ └── et_midjourney_transparent.png ├── main.bib └── main.typ ├── fonts ├── texgyreheros-bold.otf ├── texgyreheros-italic.otf ├── texgyreheros-regular.otf ├── texgyreheros-bolditalic.otf ├── et-book-bold-line-figures.ttf ├── et-book-roman-line-figures.ttf ├── et-book-roman-old-style-figures.ttf ├── et-book-semi-bold-old-style-figures.ttf └── et-book-display-italic-old-style-figures.ttf ├── README.md └── tufte_handout_template.typ /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | **/*/.DS_Store 3 | -------------------------------------------------------------------------------- /example/main.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredguth/tufte-typst/HEAD/example/main.pdf -------------------------------------------------------------------------------- /example/files/helix.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredguth/tufte-typst/HEAD/example/files/helix.pdf -------------------------------------------------------------------------------- /example/files/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredguth/tufte-typst/HEAD/example/files/logo.png -------------------------------------------------------------------------------- /example/files/main.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredguth/tufte-typst/HEAD/example/files/main.pdf -------------------------------------------------------------------------------- /example/files/mesh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredguth/tufte-typst/HEAD/example/files/mesh.png -------------------------------------------------------------------------------- /example/files/sine.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredguth/tufte-typst/HEAD/example/files/sine.pdf -------------------------------------------------------------------------------- /example/files/dc-eqns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredguth/tufte-typst/HEAD/example/files/dc-eqns.png -------------------------------------------------------------------------------- /example/files/dc-setup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredguth/tufte-typst/HEAD/example/files/dc-setup.png -------------------------------------------------------------------------------- /example/files/slicer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredguth/tufte-typst/HEAD/example/files/slicer.png -------------------------------------------------------------------------------- /example/files/dc-results.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredguth/tufte-typst/HEAD/example/files/dc-results.png -------------------------------------------------------------------------------- /example/files/divergence.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredguth/tufte-typst/HEAD/example/files/divergence.png -------------------------------------------------------------------------------- /example/files/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredguth/tufte-typst/HEAD/example/files/screenshot.png -------------------------------------------------------------------------------- /fonts/texgyreheros-bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredguth/tufte-typst/HEAD/fonts/texgyreheros-bold.otf -------------------------------------------------------------------------------- /example/files/hilbertcurves.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredguth/tufte-typst/HEAD/example/files/hilbertcurves.pdf -------------------------------------------------------------------------------- /fonts/texgyreheros-italic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredguth/tufte-typst/HEAD/fonts/texgyreheros-italic.otf -------------------------------------------------------------------------------- /fonts/texgyreheros-regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredguth/tufte-typst/HEAD/fonts/texgyreheros-regular.otf -------------------------------------------------------------------------------- /example/files/sample-handout.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredguth/tufte-typst/HEAD/example/files/sample-handout.pdf -------------------------------------------------------------------------------- /fonts/texgyreheros-bolditalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredguth/tufte-typst/HEAD/fonts/texgyreheros-bolditalic.otf -------------------------------------------------------------------------------- /example/files/MathClubTalk2009.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredguth/tufte-typst/HEAD/example/files/MathClubTalk2009.pdf -------------------------------------------------------------------------------- /example/files/weak-formulation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredguth/tufte-typst/HEAD/example/files/weak-formulation.png -------------------------------------------------------------------------------- /fonts/et-book-bold-line-figures.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredguth/tufte-typst/HEAD/fonts/et-book-bold-line-figures.ttf -------------------------------------------------------------------------------- /fonts/et-book-roman-line-figures.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredguth/tufte-typst/HEAD/fonts/et-book-roman-line-figures.ttf -------------------------------------------------------------------------------- /fonts/et-book-roman-old-style-figures.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredguth/tufte-typst/HEAD/fonts/et-book-roman-old-style-figures.ttf -------------------------------------------------------------------------------- /example/files/et_midjourney_transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredguth/tufte-typst/HEAD/example/files/et_midjourney_transparent.png -------------------------------------------------------------------------------- /fonts/et-book-semi-bold-old-style-figures.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredguth/tufte-typst/HEAD/fonts/et-book-semi-bold-old-style-figures.ttf -------------------------------------------------------------------------------- /fonts/et-book-display-italic-old-style-figures.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredguth/tufte-typst/HEAD/fonts/et-book-display-italic-old-style-figures.ttf -------------------------------------------------------------------------------- /example/main.bib: -------------------------------------------------------------------------------- 1 | @report{weissman:2009, 2 | doi = {10.1190/tle35080703.1}, 3 | url = {https://people.ucsc.edu/~weissman/MathClubTalk2009.pdf}, 4 | year = 2009, 5 | month = {jan}, 6 | publisher = {UCSC}, 7 | author = {Martin H. Weissman}, 8 | title = {Well-rounded facts about spheres}, 9 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # tufte-typst 2 | A Tufte inspired template for Typst 3 | 4 | ## Usage 5 | there is an example in the `./example` directory. Run from root directory with: 6 | 7 | ```sh 8 | 9 | typst watch example/main.typ --root . 10 | ``` 11 | 12 | 13 | ## Example 14 | 15 | [Example PDF](https://github.com/fredguth/tufte-typst/blob/main/example/main.pdf) 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tufte_handout_template.typ: -------------------------------------------------------------------------------- 1 | #let sidenote(content) = { 2 | place(dx: 29em, 3 | block( 4 | // fill: yellow, 5 | breakable: false, 6 | width: 14em, 7 | content 8 | ) 9 | ) 10 | } 11 | 12 | 13 | #let template( 14 | title: none, 15 | abstract: none, 16 | authors: (), 17 | date: datetime.today(), 18 | doc, 19 | ) = { 20 | 21 | set page( 22 | paper: "a4", 23 | margin: (y:9em, left: 5em, right: 23em), 24 | header: context { 25 | if(here().page() !=1) { 26 | set text(font: "EtBembo", weight: "semibold", size: 8pt, tracking: 1.1pt, number-type: "old-style", number-width: "tabular") 27 | place(right, dy: 8em, dx: 25em)[#upper(title) #h(1em) #text(size:12pt, counter(page).display() 28 | )] 29 | } 30 | } 31 | 32 | ) 33 | 34 | // Paper identification (title, author, date) 35 | block( 36 | // fill: luma(230), 37 | width: 100%+23em-5em, 38 | inset: 0pt, 39 | radius: 4pt, 40 | text(font: "TeX Gyre Heros", size: 10pt, tracking: 2pt)[ 41 | // title 42 | 43 | #text(size:13pt, upper(title)) 44 | 45 | // authors 46 | // #set par(leading: 1pt, ) 47 | #upper(authors.join(", ", last: " and ")) 48 | 49 | // date 50 | #upper(date.display("[month repr:long] [day],[year]")) 51 | 52 | // abstract 53 | #pad(x: 5em, block( 54 | // fill: yellow, 55 | text(tracking: 0pt, abstract) 56 | )) 57 | ] 58 | ) 59 | // Configure headings. 60 | set heading(numbering: none, ) 61 | show heading: it => context{ 62 | // Find out the final number of the heading counter. 63 | let levels = counter(heading).get() 64 | set text(16pt, weight: 400) 65 | if it.level == 1 [ 66 | // We don't want to number of the acknowledgment section. 67 | #let is-ack = it.body in ([Acknowledgment], [Acknowledgement]) 68 | // #set align(center) 69 | #set text(if is-ack { 10pt } else { 13pt }) 70 | #set text(style: "italic") 71 | #v(18pt, weak: true) 72 | #if it.numbering != none and not is-ack { 73 | numbering(heading-numbering, ..levels) 74 | [.] 75 | h(7pt, weak: true) 76 | } 77 | #it.body 78 | #v(16pt, weak: true) 79 | ] else if it.level == 2 [ 80 | // Second-level headings are run-ins. 81 | #set par(first-line-indent: 0pt) 82 | #set text(style: "italic", size: 12pt) 83 | #v(14pt, weak: true) 84 | #if it.numbering != none { 85 | numbering(heading-numbering, ..levels) 86 | [.] 87 | h(7pt, weak: true) 88 | } 89 | #it.body 90 | #v(10pt, weak: true) 91 | ] else [ 92 | // Third level headings are run-ins too, but different. 93 | #if it.level == 3 { 94 | numbering(heading-numbering, ..levels) 95 | [. ] 96 | } 97 | _#(it.body):_ 98 | ] 99 | } 100 | 101 | 102 | 103 | set text(font: "EtBembo", weight: "regular", size: 11pt, tracking: 0pt, number-type: "old-style", number-width: "tabular") 104 | doc 105 | } 106 | -------------------------------------------------------------------------------- /example/main.typ: -------------------------------------------------------------------------------- 1 | #import "../tufte_handout_template.typ": template, sidenote 2 | 3 | #import "@preview/tablex:0.0.9": tablex, rowspanx, colspanx, hlinex 4 | #let tbl_1 = text(size: 9pt, weight: "thin", tablex( 5 | columns: (1fr, 2fr, 2fr), 6 | rows: auto, 7 | inset: .3em, 8 | auto-lines: false, 9 | hlinex(stroke:.75pt), 10 | [$n$],[$C_n=V_n (1)$], [#align(right, $V_n (r)$)], 11 | hlinex(stroke:.5pt), 12 | align: left, 13 | [$0$], [$1$], [$1$], 14 | [$1$], [$2$], [$2r$], 15 | [$2$], [$pi$], [$pi r^2$], 16 | [$3$], [$4/3 pi$], [$4/3 pi r^3$], 17 | [$4$], [$1/2 pi^2$], [$1/2 pi^2 r^4$], 18 | [$5$], [$8/15 pi^2$], [$8/15 pi^2 r^5$], 19 | [],[],[], 20 | hlinex(stroke:.5pt) 21 | )) 22 | 23 | #show: doc => template( 24 | title: [Well-rounded facts about spheres for typsts], 25 | authors: ("Fred Guth",), 26 | abstract: [This document showcases a layout for handouts inspired by the work of Edward Tufte (@edward_tufte), and typeset of the tufte-LaTex class. The contents of the handouts were copied from (cite Weissman) ],//be aware of the comma after name 27 | doc,) 28 | 29 | = Computing the Volume 30 | #sidenote([#v(-4em)#figure( 31 | image("./files/et_midjourney_transparent.png", width: 75%), 32 | caption: [Edward Tufte.], 33 | ) ]) 34 | The closed n-dimensional ball of radius $r$, centered at the origin, is 35 | defined by: 36 | 37 | #align(center, $B^n = {accent(x, arrow) in bb(R)^n | x_1^2 + x_2^2 + ... + x_n^2 <= r^2}.$) 38 | #sidenote(align(right, block(width: 12em)[#v(5em)#tbl_1])) 39 | As a bounded closed subset of $bb(R)^n$, the $n$-ball has a well-defined 40 | volume, which we call $V_n (r)$. A table of volumes is given in the 41 | margin. Of course, the word “volume” might be a bit misleading 42 | in this degree of generality. In dimension $0$, the “volume” $V_0 (r)$ 43 | is the cardinality of the one-point set $bb(R)^0$. In dimension 1, the 44 | “volume”, $V_1 (r) = 2r$, is simply the length of the line segment 45 | $[−r, r]$. In dimension $2$, the “volume” of a circle is its area, and 46 | $V_2 (r) = pi r^2$. #sidenote(text(size:8pt, [#v(5em)Don’t confuse a definition with a computation. Of course, one could “compute” the area of a circle with an integral, but such an argument would necessarily be circular, pun intended. Perhaps the only fact that needs to be proven is that the circumference is the derivative of the area, as functions of the radius, which follows from Stokes theorem. 47 | 48 | Scaling is a particularly simple instance of the technique of change of variables. Scaling a measurable subset of $bb(R)^n$ by $r$ changes its volume by a factor of $r^n$. 49 | 50 | ])) This, in essence, is the definition of $pi$. In dimension Don’t confuse a definition with a computation. Of course, one could “compute” the area of a circle with an integral, but such an argument would necessarily be circular, pun intended. Perhaps the only fact that needs to be proven is that the circumference is the derivative of the area, as functions of the radius, which follows from Stokes theorem. 3, the “volume” of a sphere is its volume as the word is used by the English-speaking community at large. 51 | 52 | There is one fact about volumes of balls – the functions $V_n(r)$ – that can be deduced from the simplest change of variables: a ball of radius $r$ can be obtained by scaling a unit ball by $r$. It follows that $V_n (r) = V_n (1)r^n$. 53 | 54 | // For this reason, it is convenient to define Scaling is a particularly simple instance of the technique of change of variables. Scaling a measurable subset of Rn by r changes its volume by a factor of rn Cn = Vn(1), so that Vn(r) = Cnrn 55 | 56 | // In high dimensions, volume is more difficult to imagine, but 57 | // no easier and no more difficult to define mathematically. The 58 | // basic techniques of calculus suffice to compute the volumes Vn(r) 59 | // in any dimension. It is a useful exercise to identify precisely the 60 | // techniques required to compute these volumes. 61 | 62 | == Basic slicing 63 | Slicing the n-dimensional ball like an egg is helpful for computing 64 | the volume $V_n (r)$: 65 | 66 | // #sidenote([#v(-4em)#figure( 67 | // image("./files/slicer.png", width: 80%), 68 | // caption: [#text(size: 8pt)[Egg slicers, good for slicing eggs and teaching calculus.]], 69 | // ) ]) 70 | 71 | 72 | 73 | 74 | 75 | 76 | = Layout inconsistencies 77 | - leading between author and date 78 | - margin note font size should be set automatically 79 | - figure caption should be left aligned 80 | - table fractions should be slanted 81 | 82 | = Roadmap 83 | - add image 84 | - add references in the margin 85 | - integrate python/R rendering via Quarto 86 | #lorem(90) 87 | 88 | #lorem(90) 89 | 90 | 91 | 92 | = Conclusion 93 | #lorem(90) 94 | --------------------------------------------------------------------------------