Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 118 additions & 0 deletions packages/preview/uwa-thesis/0.1.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# UWA Thesis Template

A [Typst](https://typst.app) template for UWA School of Engineering theses/research project reports.

## Usage

Import the template and pass your document's metadata to `uwa-thesis.with(...)`, then use `#show:` to apply it to the rest of the document:

```typ
#import "@preview/uwa-thesis:0.1.0": uwa-thesis

#show: uwa-thesis.with(
unit-code: "GENG5512",
title: "My Long Thesis Title",
short-title: "My Thesis",
authors: (
(
name: "John Doe",
email: "123456789@student.uwa.edu.au",
department: "School of Engineering, The University of Western Australia",
),
(
name: "Professor Jimbo James",
email: "jimbo.james@uwa.edu.au",
department: "School of Engineering, The University of Western Australia",
),
),
)

= Abstract
Here's my content, already styled by the template.
```

Everything written after the `#show:` line is treated as the body of the thesis and will be automatically formatted (title page, table of contents, headings, page numbering, etc.).

### Parameters

| Parameter | Type | Required | Description |
| ------------ | ------ | -------- | ----------------------------------------------------------------------------- |
| `unit-code` | string | Yes | Unit code shown on the title page (e.g. `"GENG5512"`). |
| `title` | string | Yes | Full thesis title, shown on the title page. |
| `short-title`| string | Yes | Shortened title used in the page header of the body. |
| `authors` | array | Yes | Array of author dictionaries (see below). Can be empty to omit the section. |
| `date` | string | No | Defaults to today's date, formatted as `"[day] [month], [year]"`. |

Each entry in `authors` is a dictionary with:

- `name` — author's full name
- `email` — author's email address (optional, set to `none` to omit)
- `department` — author's department/affiliation

### Document structure

The template automatically generates, in order:

1. **Title page** — unit code, title, date, word count, authors, and institution, numbered separately (no visible numbering).
2. **Table of Contents**, **List of Figures**, and **List of Tables** — generated from headings and figures, using lowercase roman numeral page numbers.
3. **Body content** — everything below the `#show:` line, using arabic page numbers starting at 1, with `short-title` shown in the top-right header.

Headings are auto-numbered (e.g. `1`, `1.1`), and the word count (shown on the title page) excludes headings, outlines, tables, and images.

A typical body follows the structure in [main.typ](main.typ):

```typ
= Abstract
...

= Acknowledgements
...

#pagebreak()

= Introduction
= Literature Review
= Project Objectives
= Project Process
= Results and Discussion
= Conclusions and Future Work
= References
= Appendicies
```

### Figures and tables

Use standard Typst `figure` blocks — they're automatically picked up by the List of Figures / List of Tables outlines:

```typ
#figure(
image("assets/img.jpeg"),
caption: [This is a picture caption],
)

#figure(
table(
columns: 3,
align: (left, right, left),
[*Parameter*], [*Value*], [*Unit*],
[Noise density], [0.8], [mm/s\^2],
),
caption: "A test table",
)
```

Place image assets (e.g. `img.jpeg`) in the [assets/](assets/) folder and reference them with a path like `"assets/img.jpeg"`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a bit misleading: the assets folder won't exist in the user project, and generally speaking it is not mandatory to put images in a specific folder.


## Compiling

Compile with the Typst CLI:

```sh
typst compile main.typ
```

Or use the Typst preview/watch mode for live editing:

```sh
typst watch main.typ
```

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless you took this image yourself and decide to share it under the same terms as the rest of your package, can you please specify the relevant copyright and/or licensing information (for example at the end of your README).

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 65 additions & 0 deletions packages/preview/uwa-thesis/0.1.0/main.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#import "@preview/uwa-thesis:0.1.0": uwa-thesis

#show: uwa-thesis.with(
unit-code: "GENG5512",
title: "My Long Thesis Title",
short-title: "My Thesis",
authors: (
(
name: "John Doe",
email: "123456789@student.uwa.edu.au",
department: "School of Engineering, The University of Western Australia",
),
(
name: "Professor Jimbo James",
email: "jimbo.james@uwa.edu.au",
department: "School of Engieering, The University of Western Australia",
),
),
)

= Abstract
Here's my content, already styled by the template. This has major skibbidy
toilet vibes

= Acknowledgements
More text...

#pagebreak()

= Introduction

= Literature Review

= Project Objectives

= Project Process

#figure(
image("assets/img.jpeg"),
caption: [This is a picture caption],
)

= Results and Discussion
#figure(
table(
columns: 3,
align: (left, right, left),
[*Parameter*], [*Value*], [*Unit*],
[Noise density], [0.8], [mm/s\^2],
[Bandwidth], [1.30E+01], [],
[], [3.62E+00], [],
[Crest factor], [6], [],
[Pitch angle error], [0.000368889], [rad rms],
[], [0.021135799], [deg rms],
[], [0.126814793], [deg pp],
),
caption: "A test table",
)

= Conclusions and Future Work

= References

= Appendicies

86 changes: 86 additions & 0 deletions packages/preview/uwa-thesis/0.1.0/template.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#import "@preview/wordometer:0.1.5": total-words, word-count
#let today = { datetime.today().display("[day] [month repr:long], [year]") }

#let title-page(unit-code: "", title: "", authors: (), date: none) = {
set page(numbering: none)
set align(center)

text(size: 18pt, weight: "bold")[#unit-code Engineering Research Project]
v(3em)
text(size: 18pt, weight: "bold")[#title]
linebreak()
linebreak()
text(size: 18pt, weight: "bold")[#date]

v(10em)
text(size: 14pt)[
Word Count: #context total-words
]
v(10em)

if authors.len() > 0 [
#for author in authors [
#text(size: 14pt, weight: "bold")[#author.name]\
#if author.email != none [
#text(size: 14pt)[#author.email]\
]
#text(size: 14pt, weight: "light")[#author.department]
#v(0.5em)
]
]

v(5em)

text(size: 14pt, weight: "bold")[School of Engineering]
linebreak()
text(size: 14pt, weight: "bold")[The University of Western Australia]

pagebreak()
}

#let uwa-thesis(
unit-code: "",
title: "",
short-title: "",
authors: (),
date: today,
body,
) = {
set document(title: title)
set text(font: "New Computer Modern", size: 11pt, lang: "en")

set page(
paper: "a4",
margin: (x: 2.5cm, y: 3cm),
)

title-page(unit-code: unit-code, title: title, authors: authors, date: date)

set page(
paper: "a4",
margin: (x: 2.5cm, y: 3cm),
numbering: "i",
header: align(right, short-title),
)

outline(title: "Table of Contents", depth: 3)
outline(title: "List of Figures", target: figure.where(kind: image))
outline(title: "List of Tables", target: figure.where(kind: table))
counter(page).update(1)

v(1.5em)

set page(
paper: "a4",
margin: (x: 2.5cm, y: 3cm),
numbering: "1",
header: align(right, short-title),
)
set heading(numbering: "1.1")
set par(justify: true, leading: 0.65em)

// The actual document content gets inserted here
counter(page).update(1)
show: word-count.with(exclude: (heading, outline, table, image))
body
}
12 changes: 12 additions & 0 deletions packages/preview/uwa-thesis/0.1.0/typst.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "uwa-thesis"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name is still too descriptive and more importantly it can be considered to be the canonical name for that package: that's what you would expect the official package for this university to be called. Can you please pick another name? In general, adding a unique prefix or suffix to an otherwise canonical name is enough to fit our guidelines.

authors = ["Henry Chen"]
version = "0.1.0"
entrypoint = "template.typ"
license = "MIT"
description = "A thesis template for UWA School of Engineering Thesis"
categories = ["thesis", "report", "university", "uwa"]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can have at most three categories, and they should be among the allowed ones. You can use the keywords field if you need more.


[template]
path = "template"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This directory is missing. You should create it and move main.typ inside. The template also needs a thumbnail to be valid.

entrypoint = "main.typ"
Loading