commit 3d3e006b59f1753f07c2f27372fac0fa5b8e4a4c Author: Weetile Date: Thu Oct 17 11:12:28 2024 +0100 Initial commit diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e18e5c7 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Otto Helen-Goldring + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..4ace1bd --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +# rhul-template-typst + +Unofficial report template for reports at Royal Holloway, University of London. +Created by Otto Helen-Goldring and heavily modified from [light-report-uia](https://typst.app/universe/package/light-report-uia/). diff --git a/lib.typ b/lib.typ new file mode 100644 index 0000000..24eaf02 --- /dev/null +++ b/lib.typ @@ -0,0 +1,95 @@ +// Royal Holloway, University of London Report template +// Created by Otto Helen-Goldring in 2024 under the MIT License. +// Modified from light-report-uia (https://typst.app/universe/package/light-report-uia/) + +#let report( + title: none, + author: none, + group_name: none, + course_name: none, + unit_type: none, + report_type: none, + supervisor: none, + date: none, + location: "Egham", + references: "references.yml", + body +) = { + set document(title: [#title - #group_name], author: author) + set text(font: "Fira Sans") + set par(justify: true) + show link: underline + + show heading: set block(above: 30pt, below: 30pt) + + show heading.where(level: 1): set text(size: 20pt) + + show heading.where(level: 1): set heading(supplement: [Chapter]) + show heading.where(level: 1): it => block({ + let prefix = if it.numbering != none { + it.supplement + [ ] + counter(heading).display(it.numbering) + [: ] + } + text(weight: "regular",prefix) + it.body + }) + + show heading.where(level: 2): set text(size: 16pt) + + set page(header: context {if counter(page).get().first() > 1 [#report_type #h(1fr) #author]}) + + + // FRONT PAGE + set align(center) + + text(10pt, author + ", " + date) + v(5mm) + + text(22pt, "Final Year Project Report") + v(1mm) + text(14pt, unit_type + " - " + report_type, weight: "bold") + v(3mm) + line(length: 30%) + text(25pt, weight: "bold", title) + v(3mm) + + text(18pt, group_name) + text(18pt, author) + v(3mm) + line(length: 30%) + + text(14pt, report_type + " submitted in part fulfilment of the degree of ") + v(3mm) + text(16pt, weight: "bold")[ #course_name ] + v(3mm) + text(18pt, "Supervisor: ", weight: "bold") + text(18pt, supervisor) + + v(1fr) // to bottom + block(height: 25%, image("media/rhul.jpg", height: 75%)) + text(14pt)[Department of Computer Science#linebreak()Royal Holloway, University of London] + v(20mm) + + text(12pt)[#location, #date] + + pagebreak() + + // contents page + set align(left) + set heading(numbering: "1.1") + + + outline(indent:2em, title: "Contents") + + pagebreak() + + // after the front page and content things + + set page(numbering: "1", number-align: center) + counter(page).update(1) + + // main.typ + body + + pagebreak() + + bibliography("template/" + references, title: "Bibliography") +} diff --git a/media/rhul.jpg b/media/rhul.jpg new file mode 100644 index 0000000..669190c Binary files /dev/null and b/media/rhul.jpg differ diff --git a/template/main.typ b/template/main.typ new file mode 100644 index 0000000..e15aec0 --- /dev/null +++ b/template/main.typ @@ -0,0 +1,60 @@ +#import "../lib.typ": * + +#show: report.with( + title: "Algorithms for Lightsaber dueling", // Change accordingly + author: "Anakin Skywalker", // Add your name here + unit_type: "Full Unit", // Full Unit or Half Unit + report_type: "Final Report", // Project Plan, Interim Report, Final Report + course_name: "BSc (Hons) in Computer Science", // Change accordingly + supervisor: "Obi-Wan Kenobi", // Add your supervisor's name here + date: "October 2024", // Change accordingly +) + +#import "@preview/codly:1.0.0": * +#show: codly-init.with() +#codly(zebra-fill: color.hsl(200deg, 80%, 95%, 98%)) +#codly(display-name: false) + += Examples + +#lorem(20) + +== Citation +This is something stated from a source @example-source. + +== Tables +Here's a table: +#figure( + caption: [Table of numbers], + table( + columns: (auto, auto), + inset: 8pt, + align: horizon, + table.header( + [*Letters*], [*Number*], + ), + [Five], [5], + [Eight], [8], + ) +) + +== Code blocks +Here's a code block in Golang: + +```go +package main +import "fmt" +func main() { + fmt.Println("Hello, world!") +} +``` + + +== Math +Let $a$, $b$, and $c$ be the side +lengths of right-angled triangle. +Then, we know that: +$ a^2 + b^2 = c^2 $ + +Prove by induction: +$ sum_(k=1)^n k = (n(n+1)) / 2 $ \ No newline at end of file diff --git a/template/references.yml b/template/references.yml new file mode 100644 index 0000000..4a7aa58 --- /dev/null +++ b/template/references.yml @@ -0,0 +1,7 @@ +# https://typst.app/docs/reference/model/bibliography/ + +example-source: + type: Web + author: "Bob" + title: Example web source + url: https://example.org/ \ No newline at end of file diff --git a/typst.toml b/typst.toml new file mode 100644 index 0000000..42a7998 --- /dev/null +++ b/typst.toml @@ -0,0 +1,15 @@ +[package] +name = "rhul-report-template" +version = "0.1.0" +entrypoint = "lib.typ" +authors = ["Otto Helen-Goldring"] +license = "MIT" +description = "Template for reports at the University of Agder" +repository = "https://github.com/Weetile/rhul-report-template" +keywords = ["rhul", "University of Royal Holloway", "Royal Holloway"] +categories = ["report"] + +[template] +path = "template" +entrypoint = "main.typ" +thumbnail = "thumbnail.png" \ No newline at end of file