Handwritten notebook style template for Polylux

Initial commit

+238
+1
jotter.typ
··· 1 + #import "lib.typ": setup, title-slide, fancy-block
+145
lib.typ
··· 1 + #import "@preview/polylux:0.4.0": * 2 + 3 + #let highlight-color-state = state("jotter-highlight-color", red) 4 + 5 + #let setup(header: none, highlight-color: red, body) = { 6 + highlight-color-state.update(highlight-color) 7 + set page( 8 + paper: "presentation-16-9", 9 + margin: (left: 3cm, top: 2cm, rest: 1cm), 10 + fill: tiling( 11 + spacing: (5mm, 5mm), 12 + { 13 + place(square(width: 6mm, stroke: none, fill: white)) 14 + circle(radius: 1pt, fill: white.darken(10%)) 15 + }, 16 + ), 17 + background: { 18 + set align(top + left) 19 + let gap = 1.5cm 20 + let color = rgb("8aa") 21 + place(rect(height: 100%, width: 5mm, stroke: none, fill: black)) 22 + place(dx: 5mm, rect(height: 100%, width: 5mm, stroke: none, fill: white)) 23 + for offset in range(20) { 24 + let spiral(t, p) = curve( 25 + stroke: (thickness: t, paint: p), 26 + curve.move((.5cm, 1cm)), 27 + curve.quad((-.5cm, 1.1cm), (1cm, 1.2cm)), 28 + ) 29 + place(dy: offset * gap, spiral(2pt, color)) 30 + place( 31 + dy: offset * gap - .2mm, 32 + dx: -.2mm, 33 + spiral(.5pt, color.darken(50%)), 34 + ) 35 + place( 36 + dx: 1cm - .5mm, 37 + dy: offset * gap + 1.2cm - 1.5mm, 38 + circle(radius: 1.5mm, stroke: color + .3mm, fill: color.darken(70%)), 39 + ) 40 + } 41 + }, 42 + footer: context { 43 + set align(right) 44 + set text(size: .6em, fill: text.fill.transparentize(30%)) 45 + context box( 46 + curve( 47 + stroke: (thickness: .05em, cap: "round", paint: text.fill), 48 + curve.move((0em, 0em)), 49 + curve.quad((.8em, -.9em), (1em, -2em)), 50 + ), 51 + ) 52 + toolbox.slide-number 53 + }, 54 + header: context if header != none { 55 + set align(right) 56 + set text(size: .6em, fill: text.fill.transparentize(30%)) 57 + set par(spacing: .5em) 58 + header 59 + context { 60 + let w = measure(header).width 61 + curve( 62 + stroke: (thickness: .05em, cap: "round", paint: text.fill), 63 + curve.move((0em, 0em)), 64 + curve.quad((.25 * w, -.3em), (1.2 * w, 0em)), 65 + ) 66 + } 67 + }, 68 + ) 69 + show emph: it => underline( 70 + stroke: stroke( 71 + thickness: .3em, 72 + paint: highlight-color.transparentize(50%), 73 + cap: "round", 74 + ), 75 + offset: -.1em, 76 + extent: .1em, 77 + evade: false, 78 + background: true, 79 + it.body, 80 + ) 81 + show heading.where(level: 1): it => layout(sz => { 82 + let w = measure(..sz, it).width 83 + it 84 + move( 85 + dy: -.8em, 86 + curve( 87 + stroke: (thickness: .05em, cap: "round", paint: text.fill), 88 + curve.move((0em, 0em)), 89 + curve.quad((.75 * w, -.5em), (w, 0em)), 90 + ), 91 + ) 92 + }) 93 + set list(marker: text(fill: highlight-color.lighten(10%), sym.bullet)) 94 + set enum( 95 + numbering: (..n) => text( 96 + fill: highlight-color.lighten(10%), 97 + numbering("1.", ..n), 98 + ), 99 + ) 100 + body 101 + } 102 + 103 + #let title-slide(title, extra) = slide({ 104 + set align(center + horizon) 105 + set page(footer: none, header: none) 106 + 107 + if title != none { 108 + set text(1.5em) 109 + title 110 + context { 111 + let w = measure(title).width 112 + let c(p) = curve( 113 + stroke: (paint: p, thickness: .1em, cap: "round"), 114 + curve.cubic((.2 * w, -.4em), (.95 * w, -.5em), (w + 1em, 0em)), 115 + curve.cubic(auto, (w + .5em, .1em), (w, .3em)), 116 + ) 117 + v(-.5em) 118 + let hc = highlight-color-state.get() 119 + place(center, c(hc.transparentize(20%))) 120 + place(center, dx: .1em, dy: .1em, c(hc.transparentize(50%))) 121 + v(1.5em) 122 + } 123 + } 124 + 125 + extra 126 + }) 127 + 128 + #let fancy-block(body, sloppiness: .05, ..kwargs) = layout(sz => { 129 + let blocked-body = block(..kwargs, stroke: none, body) 130 + let (width: w, height: h) = measure(..sz, blocked-body) 131 + let deflect = sloppiness * (w + h) / 2 132 + let c(p) = curve( 133 + stroke: stroke(thickness: .1em, cap: "round", paint: p), 134 + curve.move((0pt, 0pt)), 135 + curve.quad((.8 * w, deflect), (w + deflect / 3, 0pt)), 136 + curve.move((w - deflect / 3, -deflect / 3)), 137 + curve.quad((w - deflect, .5 * h), (w - deflect / 3, h + deflect / 3)), 138 + curve.move((w + deflect / 3, h - deflect / 3)), 139 + curve.quad((.3 * w, h + deflect), (0pt, h)), 140 + curve.quad((deflect, .4 * h), (0pt, 0pt)), 141 + ) 142 + place(dx: .2em, dy: .15em, c(text.fill.transparentize(50%))) 143 + place(c(text.fill.transparentize(20%))) 144 + blocked-body 145 + })
+21
readme.md
··· 1 + ![Polylux logo](https://raw.githubusercontent.com/polylux-typ/polylux/ed1e70e74f2a525e80ace9144249c9537917731c/assets/polylux-logo.svg) 2 + 3 + # Jotter 4 + 5 + A template for creating presentation slides with Typst and 6 + [Polylux](https://github.com/polylux-typ/polylux/). 7 + 8 + Use via 9 + ```sh 10 + typst init @preview/jotter-polylux:0.1.0 your-cool-project 11 + ``` 12 + 13 + A `slides.typ` file will be created for you and contains all the design elements 14 + you can use. 15 + 16 + By default, it uses the fonts Kalam and . 17 + Either make sure you have them installed or specify other fonts in the template. 18 + 19 + ![thumbnail](thumbnail.png) 20 + 21 +
+1
template/.gitignore
··· 1 + *.pdf
+54
template/slides.typ
··· 1 + #import "@preview/polylux:0.4.0": * 2 + #import "@preview/jotter-polylux:0.1.0": setup, title-slide, fancy-block 3 + 4 + #set text( 5 + size: 25pt, 6 + font: "Kalam", 7 + fill: blue.darken(50%), 8 + ) 9 + 10 + #show math.equation: set text(font: "Pennstander Math", weight: "light") 11 + 12 + #show: setup.with(header: [A short title], highlight-color: red) 13 + 14 + #title-slide[My interesting title][ 15 + A subtitle 16 + 17 + The speaker 18 + 19 + Date, Place 20 + ] 21 + 22 + #slide[ 23 + = Title of this slide 24 + 25 + The content of this slide. 26 + 27 + Some text is *bold*, some text is _emphasized_. 28 + 29 + #fancy-block(inset: 1em, sloppiness: .05)[ 30 + A very important formula: 31 + 32 + $ 33 + hat(mu) = 1 / n sum_(i = 1)^n x_i 34 + $ 35 + ] 36 + ] 37 + 38 + #slide[ 39 + = Another slide 40 + 41 + Maxwell says: 42 + $ 43 + integral.surf_(partial Omega) bold(B) dot dif bold(S) = 0 44 + $ 45 + 46 + #toolbox.side-by-side[ 47 + - a bullet point 48 + - another bullet point 49 + ][ 50 + + first point 51 + + second point 52 + ] 53 + ] 54 +
thumbnail.png

This is a binary file and will not be displayed.

+16
typst.toml
··· 1 + [package] 2 + name = "jotter-polylux" 3 + version = "0.1.0" 4 + entrypoint = "jotter.typ" 5 + authors = ["Andreas Kröpelin"] 6 + license = "MIT" 7 + description = "Handwritten notebook style template for Polylux" 8 + homepage = "https://github.com/polylux-typ/jotter" 9 + repository = "https://github.com/polylux-typ/jotter" 10 + keywords = ["handwritten", "polylux", "presentation"] 11 + categories = ["presentation"] 12 + 13 + [template] 14 + path = "template" 15 + entrypoint = "slides.typ" 16 + thumbnail = "thumbnail.png"