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 2d2da2b4ce2a786f9092875f3cc24d1c4a2edf87 230 lines 6.3 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 degree: "MSc in Logic" 62) = align(alignment.center)[ 63 // Size of the thesis's title 64 #let title-size = 17pt 65 // Size of frontpage elements that should be smaller of the thesis's title 66 // alone 67 #let subtitle-size = 12pt 68 69 #set page(numbering: none, margin: (bottom: 3.5cm)) 70 #set par(spacing: 1.45em) 71 72 #v(30pt) 73 74 #text(smallcaps(title), size: title-size, weight: 100) 75 76 #v(40pt) 77 78 #text([*BSc Thesis* ], size: subtitle-size) 79 80 written by 81 82 *#author* 83 84 under the supervision of #supervisors.map(x => [*#x*]).join(", ", last: 85 " and "), and submitted to the 86 87 Examinations Board in partial fulfilment 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%, 97 columns(2, gutter: -10%, 98 align(alignment.left, [ 99 #set par(first-line-indent: 0em) 100 101 // *Date of the public defence:* 102 103 // _#defence-date _ 104 105 #colbreak() 106 107 *Members of the Thesis Committee:* 108 109 #committee.join("\n") 110 ]) 111 ) 112 ) 113 114 // #align(bottom, image("../img/illclogo.svg", alt: "ILLC Logo. A 3-by-3 jigsaw puzzle. The 115 // center piece is white, while the surrounding pieces are black. The text 116 // below the puzzle reads 'Institute for Logic, Language, and Computation'", 117 // width: 60%)) 118 119 #pagebreak() 120] 121 122// A non-numbered page dedicated to the thesis abstract. 123#let mol-abstract(body) = [ 124 #set page(numbering: none) 125 #align(center+horizon, heading("Abstract", numbering: none, outlined: false)) 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, 136 hanging-indent: 0pt, 137 level: 1, 138 supplement: [Chapter]) 139 ) 140 #text(size: 28pt, weight: "bold")[ 141 #set par(first-line-indent: 0pt) 142 #text(size: 24pt, [Chapter #context counter(heading).display()]) 143 144 #body] 145] 146 147// A counter for mathematical blocks 148#let mathcounter = rich-counter( 149 identifier: "mathblocks", 150 inherited_levels: 1 151) 152 153// A block for mathematical definitions 154#let definition = mathblock( 155 blocktitle: "Definition", 156 counter: mathcounter 157) 158 159// A block for mathematical theorems 160#let theorem = mathblock( 161 blocktitle: "Theorem", 162 counter: mathcounter 163) 164 165// A block for mathematical examples 166#let example = mathblock( 167 blocktitle: "Example", 168 counter: mathcounter 169) 170 171// A block for mathematical propositions 172#let proposition = mathblock( 173 blocktitle: "Proposition", 174 counter: mathcounter 175) 176 177// A block for mathematical lemmas 178#let lemma = mathblock( 179 blocktitle: "Lemma", 180 counter: mathcounter 181) 182 183// A block for mathematical corollaries 184#let corollary = mathblock( 185 blocktitle: "Corollary", 186 counter: mathcounter 187) 188 189// A block for mathematical remarks 190#let remark = mathblock( 191 blocktitle: "Remark", 192 prefix: [_Remark._] 193) 194 195// A block for mathematical proofs 196#let proof = proofblock() 197 198// Bibliography function that does not throw an error if called multiple times. 199// This allows you to invoke it once per file in your thesis. This is important, 200// because Typst would otherwise raise an error if you were to cite a source in 201// a file with no bibliography. 202// 203// https://forum.typst.app/t/how-to-share-bibliography-in-a-multi-file-setup/1605/9 204// 205// If invoked with "true", it actually displays the bibliography. 206// 207// ```typst 208// // main.typ 209// #include "chapter-1.typ" 210// #load-bib(read("works.bib"), main: true) 211// ``` 212// 213// Otherwise, it still makes the sources citable in the current file. Should be 214// invoked with "true" at most once. 215// 216// ```typst 217// // chapter-1.typ 218// We build on the work of @Author_2025. 219// #load-bib(read("works.bib")) 220// ``` 221#let load-bib(sources, main: false) = { 222 counter("illc-mol-thesis-bibs").step() 223 context if main { 224 [#bibliography(bytes(sources)) <main-bib>] 225 } else if (counter("illc-mol-thesis-bibs").get().first() == 1 and 226 query(<main-bib>) == ()) { 227 // This is the first bibliography, and there is no main bibliography 228 bibliography(bytes(sources)) 229 } 230}