My undergraduate thesis on a capability based security system for a data-centric operating system.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 229 lines 6.2 kB view raw
1 2#import "@preview/great-theorems:0.1.2": * 3#import "@preview/rich-counters:0.2.2": * 4 5 6 7// A show rule for the template. 8#let mol-thesis(body) = [ 9 /* 10 LaTeX-like look from https://typst.app/docs/guides/guide-for-latex-users, 11 tweaked to look like https://codeberg.org/m4lvin/illc-mol-thesis-template 12 (page margins cannot quite be the same, as Typst and LaTeX 13 handle margins/paddings somewhat differently). 14 15 Of course, we still comply with article A, comma 2 of the "Rules and 16 Guidelines of the Examinations Board Logic" 17 (https://msclogic.illc.uva.nl/current-students/regulations/oer/). 18 */ 19 #set page(margin: (bottom: 2.8cm, rest: 2.1cm), footer-descent: 40%) 20 #set par(leading: .85em, first-line-indent: 1.8em, justify: true) 21 #set text(font: "New Computer Modern", size: 11pt) 22 // New computer Moderno Mono is not shipped with Typst, and it would be 23 // excessive to only ship it with the package for raw text, as it requires its 24 // own CLi flag 25 // #show raw: set text(font: "New Computer Modern Mono") 26 #show heading: set block(above: 1.4em, below: 1em) 27 28 // MoL thesis look from https://codeberg.org/m4lvin/illc-mol-thesis-template 29 #set page(numbering: "1") 30 #set heading(numbering: "1.1.1.1") 31 #set outline.entry(fill: repeat(". ")) 32 #show outline.entry.where( 33 level: 1, 34 ): set block(above: 1.5em) 35 #show outline.entry.where(level: 1): it => [ 36 #set block(above: 1.5em) 37 *#link(it.element.location(), it.indented(it.prefix(), it.inner()))* 38 ] 39 40 #set cite(style: "alphanumeric") 41 #set bibliography(style: "elsevier-vancouver") 42 #show: great-theorems-init 43 44 #body 45] 46 47// A parametric, non-numbered thesis titlepage that follows the 48// recommendations of the Master of Logic. 49#let mol-titlepage( 50 title: "Title of the Thesis", 51 author: "John Q. Public", 52 birth-date: "April 1st, 1980", 53 birth-place: "Alice Springs, Australia", 54 defence-date: "August 28, 2005", 55 supervisors: ("Dr Jack Smith", "Prof Dr Jane Williams"), 56 committee: ( 57 "Dr Jack Smith", 58 "Prof Dr Jane Williams", 59 "Dr Jill Jones", 60 "Dr Albert Heijn", 61 ), 62 degree: "MSc in Logic", 63) = align(alignment.center)[ 64 // Size of the thesis's title 65 #let title-size = 17pt 66 // Size of frontpage elements that should be smaller of the thesis's title 67 // alone 68 #let subtitle-size = 12pt 69 70 #set page(numbering: none, margin: (bottom: 3.5cm)) 71 #set par(spacing: 1.45em) 72 73 #v(30pt) 74 75 #text(smallcaps(title), size: title-size, weight: 100) 76 77 #v(40pt) 78 79 #text([*BSc Thesis* ], size: subtitle-size) 80 81 written by 82 83 *#author* 84 85 under the supervision of #supervisors.map(x => [*#x*]).join(", ", last: " and"), and submitted to the 86 87 Examinations Board in partial fulfillment of the requirements for the 88 degree of 89 90 #text([*#degree*], size: subtitle-size) 91 92 at the _University of California, Santa Cruz_. 93 94 #v(50pt) 95 96 #box(width: 75%, columns(2, gutter: -10%, align(alignment.left, [ 97 #set par(first-line-indent: 0em) 98 99 // *Date of the public defence:* 100 101 // _#defence-date _ 102 103 #colbreak() 104 105 *Members of the Thesis Committee:* 106 107 #committee.join("\n") 108 ]))) 109 110 // #align(bottom, image("../img/illclogo.svg", alt: "ILLC Logo. A 3-by-3 jigsaw puzzle. The 111 // center piece is white, while the surrounding pieces are black. The text 112 // below the puzzle reads 'Institute for Logic, Language, and Computation'", 113 // width: 60%)) 114 115 #pagebreak() 116] 117 118// A non-numbered page dedicated to the thesis abstract. 119#let mol-abstract(body) = [ 120 #set page(numbering: none) 121 #align(center + horizon, heading( 122 "Abstract", 123 numbering: none, 124 outlined: false, 125 )) 126 #body 127 #pagebreak() 128 #counter(page).update(1) 129] 130 131// A first-level heading dedicated to thesis chapters. 132#let mol-chapter(body) = [ 133 #pagebreak() 134 #hide( 135 heading(body, hanging-indent: 0pt, level: 1, supplement: [Chapter]), 136 ) 137 #text(size: 28pt, weight: "bold")[ 138 #set par(first-line-indent: 0pt) 139 #text(size: 24pt, [Chapter #context counter(heading).display()]) 140 141 #body] 142] 143 144// A counter for mathematical blocks 145#let mathcounter = rich-counter( 146 identifier: "mathblocks", 147 inherited_levels: 1, 148) 149 150// A block for mathematical definitions 151#let definition = mathblock( 152 blocktitle: "Definition", 153 counter: mathcounter, 154) 155 156// A block for mathematical theorems 157#let theorem = mathblock( 158 blocktitle: "Theorem", 159 counter: mathcounter, 160) 161 162// A block for mathematical examples 163#let example = mathblock( 164 blocktitle: "Example", 165 counter: mathcounter, 166) 167 168// A block for mathematical propositions 169#let proposition = mathblock( 170 blocktitle: "Proposition", 171 counter: mathcounter, 172) 173 174// A block for mathematical lemmas 175#let lemma = mathblock( 176 blocktitle: "Lemma", 177 counter: mathcounter, 178) 179 180// A block for mathematical corollaries 181#let corollary = mathblock( 182 blocktitle: "Corollary", 183 counter: mathcounter, 184) 185 186// A block for mathematical remarks 187#let remark = mathblock( 188 blocktitle: "Remark", 189 prefix: [_Remark._], 190) 191 192// A block for mathematical proofs 193#let proof = proofblock() 194 195// Bibliography function that does not throw an error if called multiple times. 196// This allows you to invoke it once per file in your thesis. This is important, 197// because Typst would otherwise raise an error if you were to cite a source in 198// a file with no bibliography. 199// 200// https://forum.typst.app/t/how-to-share-bibliography-in-a-multi-file-setup/1605/9 201// 202// If invoked with "true", it actually displays the bibliography. 203// 204// ```typst 205// // main.typ 206// #include "chapter-1.typ" 207// #load-bib(read("works.bib"), main: true) 208// ``` 209// 210// Otherwise, it still makes the sources citable in the current file. Should be 211// invoked with "true" at most once. 212// 213// ```typst 214// // chapter-1.typ 215// We build on the work of @Author_2025. 216// #load-bib(read("works.bib")) 217// ``` 218#let load-bib(sources, main: false) = { 219 counter("illc-mol-thesis-bibs").step() 220 context if main { 221 [#bibliography(bytes(sources)) <main-bib>] 222 } else if ( 223 counter("illc-mol-thesis-bibs").get().first() == 1 224 and query(<main-bib>) == () 225 ) { 226 // This is the first bibliography, and there is no main bibliography 227 bibliography(bytes(sources)) 228 } 229}