diff --git a/.github/workflows/typst.yml b/.github/workflows/typst.yml index be17e6f..a72a51d 100644 --- a/.github/workflows/typst.yml +++ b/.github/workflows/typst.yml @@ -11,32 +11,22 @@ on: type: string permissions: contents: write + packages: read jobs: build: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 - - name: Cache Microsoft fonts - id: cache-msfonts - uses: actions/cache@v3 + uses: actions/checkout@v4 + - name: Install Typst + uses: typst-community/setup-typst@v3 with: - path: ~/.cache/ms-fonts - key: ${{ runner.os }}-msfonts-v1 - - name: Install required fonts + typst-version: 0.12 + cache-dependency-path: requirements.typ + - name: Compile Typst files run: | - sudo apt-get update - mkdir -p ~/.local/share/fonts - cp -r assets/fonts/* ~/.local/share/fonts/ - fc-cache -f -v - - name: Compile main.typ - uses: lvignoli/typst-action@main - with: - source_file: | - main.typ - documentary_page.typ - - name: Rename main.pdf - run: mv main.pdf kval_darbs_kristians_cagulis_kc22015.pdf + typst compile --font-path=assets/fonts main.typ kval_darbs_kristians_cagulis_kc22015.pdf + typst compile --font-path=assets/fonts documentary_page.typ - name: Upload PDF file uses: actions/upload-artifact@v4 with: diff --git a/assets/fonts/JetBrains Mono Regular Nerd Font Complete.ttf b/assets/fonts/JetBrainsMono/JetBrains Mono Regular Nerd Font Complete.ttf similarity index 100% rename from assets/fonts/JetBrains Mono Regular Nerd Font Complete.ttf rename to assets/fonts/JetBrainsMono/JetBrains Mono Regular Nerd Font Complete.ttf diff --git a/assets/fonts/Times/Times.TTF b/assets/fonts/TimesNewRoman/Times.TTF similarity index 100% rename from assets/fonts/Times/Times.TTF rename to assets/fonts/TimesNewRoman/Times.TTF diff --git a/assets/fonts/Times/Times.ttf b/assets/fonts/TimesNewRoman/Times.ttf similarity index 100% rename from assets/fonts/Times/Times.ttf rename to assets/fonts/TimesNewRoman/Times.ttf diff --git a/assets/fonts/Times/Timesbd.TTF b/assets/fonts/TimesNewRoman/Timesbd.TTF similarity index 100% rename from assets/fonts/Times/Timesbd.TTF rename to assets/fonts/TimesNewRoman/Timesbd.TTF diff --git a/assets/fonts/Times/Timesbi.TTF b/assets/fonts/TimesNewRoman/Timesbi.TTF similarity index 100% rename from assets/fonts/Times/Timesbi.TTF rename to assets/fonts/TimesNewRoman/Timesbi.TTF diff --git a/assets/fonts/Times/Timesi.TTF b/assets/fonts/TimesNewRoman/Timesi.TTF similarity index 100% rename from assets/fonts/Times/Timesi.TTF rename to assets/fonts/TimesNewRoman/Timesi.TTF diff --git a/documentary_page.typ b/documentary_page.typ index c481b4d..03d1ff1 100644 --- a/documentary_page.typ +++ b/documentary_page.typ @@ -1,5 +1,4 @@ #import "@preview/tablex:0.0.9": tablex -#import "@preview/dashy-todo:0.0.1": todo #import "src/layout.typ": project, indent-par #import "src/layout.typ": indent diff --git a/requirements.typ b/requirements.typ new file mode 100644 index 0000000..365f06a --- /dev/null +++ b/requirements.typ @@ -0,0 +1,6 @@ +#import "@preview/dashy-todo:0.0.1" +#import "@preview/fletcher:0.5.3" +#import "@preview/headcount:0.1.0" +#import "@preview/i-figured:0.2.4" +#import "@preview/tablex:0.0.9" +#import "@preview/wordometer:0.1.3" diff --git a/src/layout.typ b/src/layout.typ index d108c84..18f220e 100644 --- a/src/layout.typ +++ b/src/layout.typ @@ -32,14 +32,21 @@ paper: "a4", ) set text( - font: "Times New Roman", + font: ( + "Times New Roman", + "New Computer Modern", + ), size: 12pt, hyphenate: auto, lang: "lv", region: "lv", ) show raw: set text( - font: "JetBrainsMono NF", + font: ( + "JetBrainsMono NF", + "JetBrains Mono", + "Fira Code", + ), features: (calt: 0), ) @@ -192,29 +199,26 @@ if it.kind == "i-figured-table" { return align( end, - emph(it.counter.display(it.numbering) + " tabula ") - + text( - weight: "bold", - it.body, - ), + emph(it.counter.display(it.numbering) + " tabula ") + text( + weight: "bold", + it.body, + ), ) } if it.kind == "i-figured-image" { return align( start, - emph(it.counter.display(it.numbering) + " att. ") - + text( - weight: "bold", - it.body, - ), + emph(it.counter.display(it.numbering) + " att. ") + text( + weight: "bold", + it.body, + ), ) } if ( - it.kind - in ( - "i-figured-raw", - "i-figured-\"attachment\"", - ) + it.kind in ( + "i-figured-raw", + "i-figured-\"attachment\"", + ) ) { return align( end, @@ -241,9 +245,7 @@ numbering( el.numbering, ..counter(heading).at(el.location()), - ) - + " " - + el.body, + ) + " " + el.body, ) } @@ -274,8 +276,7 @@ numbering( el.numbering, ..counter(figure.where(kind: kind)).at(el.location()), - ) - + "." + ) + "." ) // Only add dot for attachments } else { numbering( @@ -287,12 +288,11 @@ // Create counter based on the kind return link( el.location(), - number - + if supplement != "" { - " " + supplement - } else { - "" - }, + number + if supplement != "" { + " " + supplement + } else { + "" + }, ) } @@ -301,17 +301,13 @@ } /* --- Figure/Table config end --- */ - set list( - marker: ( - [•], - [--], - [\*], - [·], - ), - ) - set enum( - numbering: "1aiA)", - ) // TODO: make the same style as LaTeX: 1. | (a) | i. | A. + set list(marker: ( + [•], + [--], + [\*], + [·], + )) + set enum(numbering: "1aiA)") // TODO: make the same style as LaTeX: 1. | (a) | i. | A. // Abstract include "abstract.typ"