Skip to content

Commit 0b2bf67

Browse files
author
Moritz Jörg
committed
Initial commit
1 parent f21167f commit 0b2bf67

File tree

12 files changed

+15651
-1
lines changed

12 files changed

+15651
-1
lines changed

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.{yml,yaml}]
12+
indent_style = space
13+
indent_size = 2
14+
15+
[*.md]
16+
trim_trailing_whitespace = true

.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake

.github/workflows/release_pdf.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Build and release pdf
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release_pdf:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v3
17+
with:
18+
fetch-depth: '0'
19+
20+
- name: Create initial tag
21+
run: |
22+
if [ -z "$(git tag -l 'v*')" ]; then
23+
git tag v0.0.0
24+
fi
25+
26+
- name: Bump version and push tag
27+
id: bump
28+
uses: anothrNick/[email protected]
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
WITH_V: true
32+
DEFAULT_BUMP: 'patch'
33+
34+
- name: Create Release
35+
id: create_release
36+
uses: softprops/action-gh-release@v1
37+
with:
38+
tag_name: ${{ steps.bump.outputs.new_tag }}
39+
name: Version ${{ steps.bump.outputs.new_tag }}
40+
draft: false
41+
prerelease: false
42+
43+
- name: Compile Typst
44+
uses: lvignoli/typst-action@main
45+
with:
46+
source_file: |
47+
main.typ
48+
49+
- name: Upload Release Asset - Assignment
50+
uses: actions/upload-release-asset@v1
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
with:
54+
upload_url: ${{ steps.create_release.outputs.upload_url }}
55+
asset_path: ./main.pdf
56+
asset_name: main.pdf
57+
asset_content_type: application/pdf

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Nix
2+
.direnv
3+
result
4+
5+
# Output
6+
*.pdf

README.md

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,67 @@
11
# 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

Comments
 (0)