|
1 | 1 | # assignment-template-typst
|
2 |
| -UiT assignment typst template |
| 2 | + |
| 3 | +This repository provides a simple Typst template for writing your Assignments at UiT (The Arctic University of Tromsø). The template is _supercharged_ with the [typst](https://typst.app/home) language, which is a simple and powerful language for writing scientific documents. |
| 4 | + |
| 5 | +> [!NOTE] |
| 6 | +> This is only a template. You have to adapt the template to your current assignment! |
| 7 | +
|
| 8 | +## Installation |
| 9 | + |
| 10 | +To use this template, you need to have the `typst` language installed on your computer. There are several ways to install `typst`: |
| 11 | + |
| 12 | +- Use your OS package manager like `apt` or `brew` to install Typst. Take note that these could be several versions behind the latest release. |
| 13 | + |
| 14 | +- You can also download the latest release from the [GitHub releases page](https://github.com/typst/typst/releases), which provides precompiled binaries for Windows, Linux, and macOS. |
| 15 | + |
| 16 | +- Nix users can use the provided flake, which contains the `typst`, `typstfmt` and `typst-lsp` packages. It can be activated using `direnv allow` or simply `nix flake build`. |
| 17 | + |
| 18 | +For more information on how to install `typst`, please refer to the [official documentation](https://github.com/typst/typst?tab=readme-ov-file#installation). |
| 19 | + |
| 20 | +## Usage |
| 21 | + |
| 22 | +### Set up the assignments metadata |
| 23 | + |
| 24 | +Fill in your assignment details in the `uit_template` function, it should contain the following: |
| 25 | + |
| 26 | +- Your name, Email ( [email protected]) and GitHub user |
| 27 | +- Assignment title |
| 28 | +- Your Index Terms |
| 29 | +- An Abstract |
| 30 | + |
| 31 | +### Build PDFs locally |
| 32 | + |
| 33 | +Once you have installed Typst, you can use it like this: |
| 34 | + |
| 35 | +```console |
| 36 | +# Creates `main.pdf` in working directory. |
| 37 | +typst compile main.typ |
| 38 | + |
| 39 | +# Creates PDF file at the desired path. |
| 40 | +typst compile main.typ path/to/output.pdf |
| 41 | +``` |
| 42 | + |
| 43 | +You can also watch source files and automatically recompile on changes. This is |
| 44 | +faster than compiling from scratch each time because Typst has incremental compilation. |
| 45 | + |
| 46 | +```console |
| 47 | +# Watches source files and recompiles on changes. |
| 48 | +typst watch main.typ |
| 49 | +``` |
| 50 | + |
| 51 | +### Working in the Typst Web Editort |
| 52 | + |
| 53 | +If you prefer an Overleaf-like experience with autocompletion, preview and (soon)spellchecking, then the Typst web editor is for you. It allows you to import files directly into a new or existing document. Here's a step-by-step guide: |
| 54 | + |
| 55 | +1. Navigate to the [Typst Web Editor](https://typst.app/). |
| 56 | + |
| 57 | +2. Create or Sign in to your Account. |
| 58 | + |
| 59 | +2. Create a new blank document. |
| 60 | + |
| 61 | +3. Click on "File" on the top left menu, then "Upload File". |
| 62 | + |
| 63 | +4. Select all `.typ` and `.bib` files along with the figures (svg and png) provided in this template repository. |
| 64 | + |
| 65 | +> [!NOTE] |
| 66 | +> You can select multiple files to import at the same time. The editor will import and arrange all the files accordingly. Watch out if your figures are in a directory, the may end up in root. |
| 67 | +
|
0 commit comments