Compare commits

..

44 Commits

Author SHA1 Message Date
Sven Vogel 859824a42e fix: allow disabeling statement pages (#126)
Create Release Commit / prepare (push) Has been skipped Details
Create Release / Check Template and Build example (push) Successful in 4m36s Details
Create Release / release (push) Successful in 1m55s Details
Reviewed-on: #126
Co-authored-by: servostar <sven.vogel123@web.de>
Co-committed-by: servostar <sven.vogel123@web.de>
2025-04-15 16:00:41 +00:00
Sven Vogel 60f6ae0ddf feat: add coauthor to titlepage (#125)
Create Release Commit / prepare (push) Has been skipped Details
Create Release / Check Template and Build example (push) Successful in 4m50s Details
Create Release / release (push) Successful in 2m11s Details
Reviewed-on: #125
Co-authored-by: servostar <sven.vogel123@web.de>
Co-committed-by: servostar <sven.vogel123@web.de>
2025-04-15 12:16:53 +00:00
Sven Vogel 0e0e79f2fe fix: single author does not show up (#124)
Create Release Commit / prepare (push) Has been skipped Details
Create Release / Check Template and Build example (push) Successful in 5m48s Details
Create Release / release (push) Successful in 2m49s Details
Reviewed-on: #124
Co-authored-by: servostar <sven.vogel123@web.de>
Co-committed-by: servostar <sven.vogel123@web.de>
2025-04-14 17:47:11 +00:00
Sven Vogel d0b4120755 fix: adjust outline spacing (#123)
Create Release Commit / prepare (push) Has been skipped Details
Create Release / Check Template and Build example (push) Successful in 4m3s Details
Create Release / release (push) Successful in 2m3s Details
Reviewed-on: #123
Co-authored-by: servostar <sven.vogel123@web.de>
Co-committed-by: servostar <sven.vogel123@web.de>
2025-03-18 07:29:02 +00:00
Sven Vogel 99750af99f ci: bump download-artifact to v4
Create Release Commit / prepare (push) Has been skipped Details
Create Release / Check Template and Build example (push) Successful in 4m45s Details
Create Release / release (push) Successful in 1m57s Details
2025-03-10 21:36:05 +01:00
Sven Vogel a46b88addc style: run typstyle v0.13
Create Release Commit / prepare (push) Has been skipped Details
Create Release / Check Template and Build example (push) Successful in 5m47s Details
Create Release / release (push) Successful in 2m4s Details
2025-03-07 00:03:17 +01:00
Sven Vogel 35b798de18 Merge branch 'fix/typst-0.13'
Create Release Commit / prepare (push) Has been skipped Details
Create Release / Check Template and Build example (push) Failing after 3m24s Details
Create Release / release (push) Has been skipped Details
2025-03-06 23:11:30 +01:00
Sven Vogel ee3bbe9e04 fix: unexpected opening parenthesis 2025-03-06 23:11:25 +01:00
Sven Vogel 21b29fcf4c ci: bump upload artifact to v3
Build'n check / run-ci-linux (push) Has been skipped Details
2025-03-06 23:11:07 +01:00
Sven Vogel ba9f81eccb fix: typst-0.13 (#121)
Create Release Commit / prepare (push) Has been skipped Details
Create Release / Check Template and Build example (push) Successful in 4m29s Details
Create Release / release (push) Successful in 2m19s Details
Reviewed-on: #121
Co-authored-by: servostar <sven.vogel123@web.de>
Co-committed-by: servostar <sven.vogel123@web.de>
2025-03-06 16:07:55 +00:00
Sven Vogel ea04ed8cd1 style: format using typstyle 0.13.0
Build'n check / run-ci-linux (push) Has been skipped Details
Build'n check / run-ci-linux (pull_request) Successful in 5m31s Details
2025-03-06 16:14:21 +01:00
Sven Vogel f3ef05b31b fix: left align glossary
Build'n check / run-ci-linux (push) Has been skipped Details
Build'n check / run-ci-linux (pull_request) Failing after 7m42s Details
2025-03-06 16:09:20 +01:00
Sven Vogel 33aff90c56 fix: render outlines with typst 0.13 2025-03-06 15:27:53 +01:00
Sven Vogel 55b58e2699 fix: bump wrap-it to 0.1.1 in template 2025-03-06 14:11:17 +01:00
Sven Vogel b1255bdbab chore: bump release version to v0.6.3
Create Release Commit / prepare (push) Has been skipped Details
Create Release / Check Template and Build example (push) Successful in 3m21s Details
Create Release / release (push) Successful in 1m54s Details
Generated-By: servostar
2024-12-03 08:30:01 +00:00
Sven Vogel 490765d713 fix: typstyle (#120)
Create Release Commit / prepare (push) Has been cancelled Details
Reviewed-on: #120
Release-As: v0.6.3
Co-authored-by: servostar <sven.vogel123@web.de>
Co-committed-by: servostar <sven.vogel123@web.de>
2024-12-03 08:29:33 +00:00
Sven Vogel 208357eeb1 chore: bump release version to v0.6.2
Create Release Commit / prepare (push) Has been skipped Details
Create Release / Check Template and Build example (push) Successful in 2m32s Details
Create Release / release (push) Successful in 2m53s Details
Generated-By: servostar
2024-12-01 11:45:22 +00:00
Sven Vogel 93f0a30109 fix: hide empty author information (#119)
Create Release Commit / prepare (push) Has been cancelled Details
Reviewed-on: #119
Release-As: v0.6.2
Co-authored-by: servostar <sven.vogel123@web.de>
Co-committed-by: servostar <sven.vogel123@web.de>
2024-12-01 11:44:54 +00:00
Sven Vogel 0181e710b8 chore: update assets
Create Release Commit / prepare (push) Has been skipped Details
Create Release / Check Template and Build example (push) Successful in 2m25s Details
Create Release / release (push) Successful in 55s Details
Generated-By: servostar
2024-11-30 19:07:37 +00:00
Sven Vogel 674c783a4f chore: bump release version to v0.6.1
Generated-By: servostar
2024-11-30 19:04:40 +00:00
Sven Vogel a6d0d70f08 ci: autogen-banner (#118)
Create Release Commit / prepare (push) Has been cancelled Details
Reviewed-on: #118
Release-As: v0.6.1
Generate-Assets
2024-11-30 19:04:13 +00:00
Sven Vogel a8d2161efa chore: bump release version to v0.6.0
Create Release Commit / prepare (push) Has been skipped Details
Create Release / Check Template and Build example (push) Successful in 2m31s Details
Create Release / release (push) Successful in 56s Details
Generated-By: servostar
2024-11-30 12:16:00 +00:00
Sven Vogel a99f1aca86 feat: allow-no-company (#117)
Create Release Commit / prepare (push) Has been cancelled Details
Reviewed-on: #117
Release-As: v0.6.0
Co-authored-by: servostar <sven.vogel123@web.de>
Co-committed-by: servostar <sven.vogel123@web.de>
2024-11-30 12:15:44 +00:00
Sven Vogel 0a34cfe3e7 chore: bump release version to v0.5.5
Create Release Commit / prepare (push) Has been skipped Details
Create Release / Check Template and Build example (push) Successful in 2m23s Details
Create Release / release (push) Successful in 57s Details
Generated-By: servostar
2024-11-27 14:25:00 +00:00
Sven Vogel 96ff7a93af fix: convert CMYK branding color to RGB (#116)
Create Release Commit / prepare (push) Has been cancelled Details
Fixes incompatability with PDF/A format

Reviewed-on: #116
Release-As: v0.5.5
Co-authored-by: servostar <sven.vogel123@web.de>
Co-committed-by: servostar <sven.vogel123@web.de>
2024-11-27 14:24:45 +00:00
Sven Vogel ac1968bb12 fix: add missing config reference when using university name in prerelease note (#114)
Create Release Commit / prepare (push) Has been skipped Details
Reviewed-on: #114
Co-authored-by: servostar <sven.vogel123@web.de>
Co-committed-by: servostar <sven.vogel123@web.de>
2024-11-27 13:39:00 +00:00
Sven Vogel 77ed9621bd ci: make github action run on tags (#113)
Create Release Commit / prepare (push) Has been skipped Details
Reviewed-on: #113
Co-authored-by: servostar <sven.vogel123@web.de>
Co-committed-by: servostar <sven.vogel123@web.de>
2024-11-26 10:12:51 +00:00
Sven Vogel ef5400ea43 chore: bump release version to v0.5.4
Create Release Commit / prepare (push) Has been skipped Details
Create Release / Check Template and Build example (push) Successful in 2m17s Details
Create Release / release (push) Successful in 54s Details
Generated-By: servostar
2024-11-25 16:03:55 +00:00
Sven Vogel bdbf641fd4 feat: make supervisor signature optional (#112)
Create Release Commit / prepare (push) Has been cancelled Details
Release-As: v0.5.4
Reviewed-on: #112
2024-11-25 16:03:42 +00:00
Sven Vogel 1d6a900fca docs: update build badge (#106)
Create Release Commit / prepare (push) Has been skipped Details
Reviewed-on: #106
Co-authored-by: servostar <sven.vogel123@web.de>
Co-committed-by: servostar <sven.vogel123@web.de>
2024-11-25 15:21:02 +00:00
Sven Vogel 04efd8251e docs: add-contributing (#105)
Create Release Commit / prepare (push) Has been skipped Details
Reviewed-on: #105
2024-11-25 15:15:32 +00:00
Sven Vogel 081fea5a4c ci: add generated-by body to version bump commit (#103)
Create Release Commit / prepare (push) Has been skipped Details
Reviewed-on: #103
Co-authored-by: servostar <sven.vogel123@web.de>
Co-committed-by: servostar <sven.vogel123@web.de>
2024-11-25 15:12:34 +00:00
Sven Vogel 564a3f7b95 chore: bump release version to v0.5.3
Create Release / Check Template and Build example (push) Successful in 2m17s Details
Create Release / release (push) Successful in 53s Details
Build'n check / run-ci-linux (pull_request) Has been skipped Details
2024-11-25 14:50:52 +00:00
Sven Vogel 4e51d4f70e ci: use-checkout-for-pushs (#102)
Create Release Commit / prepare (push) Successful in 14s Details
Release-As: v0.5.3
Reviewed-on: #102
Co-authored-by: servostar <sven.vogel123@web.de>
Co-committed-by: servostar <sven.vogel123@web.de>
2024-11-25 14:50:39 +00:00
Sven Vogel 6b8ecbfc8a ci: add origin remote (#101)
Create Release Commit / prepare (push) Failing after 36s Details
Release-As: v0.5.3
Reviewed-on: #101
Co-authored-by: servostar <sven.vogel123@web.de>
Co-committed-by: servostar <sven.vogel123@web.de>
2024-11-25 14:30:27 +00:00
Sven Vogel cc855667cc ci: fix-git-commands (#100)
Create Release Commit / prepare (push) Failing after 35s Details
Release-As: v0.5.3
Reviewed-on: #100
Co-authored-by: servostar <sven.vogel123@web.de>
Co-committed-by: servostar <sven.vogel123@web.de>
2024-11-25 13:56:06 +00:00
Sven Vogel 728e451e66 ci: add prepare action and run release on pushed tag (#99)
Create Release Commit / prepare (push) Failing after 37s Details
Create Release / Check Template and Build example (push) Successful in 2m21s Details
Create Release / release (push) Failing after 52s Details
Release-As: v0.5.3
Reviewed-on: #99
Co-authored-by: servostar <sven.vogel123@web.de>
Co-committed-by: servostar <sven.vogel123@web.de>
2024-11-25 13:35:37 +00:00
Sven Vogel 3512cc66cc ci: add user identity to release (#98)
Build'n check / Check Template and Build example (push) Successful in 2m21s Details
Build'n check / release (push) Failing after 55s Details
Release-As: v0.5.3
Reviewed-on: #98
Co-authored-by: servostar <sven.vogel123@web.de>
Co-committed-by: servostar <sven.vogel123@web.de>
2024-11-25 12:39:31 +00:00
Sven Vogel 2e02619fdb ci/version-as-env (#97)
Build'n check / Check Template and Build example (push) Successful in 2m57s Details
Build'n check / release (push) Failing after 40s Details
Release-As: v0.5.3
Reviewed-on: #97
Co-authored-by: servostar <sven.vogel123@web.de>
Co-committed-by: servostar <sven.vogel123@web.de>
2024-11-25 12:17:58 +00:00
Sven Vogel f1df70aa96 ci: fully qualify gitea release action (#96)
Build'n check / Check Template and Build example (push) Successful in 2m48s Details
Build'n check / release (push) Failing after 40s Details
Release-As: v0.5.3
Reviewed-on: #96
Co-authored-by: servostar <sven.vogel123@web.de>
Co-committed-by: servostar <sven.vogel123@web.de>
2024-11-25 11:55:29 +00:00
Sven Vogel 70f2bde4d1 ci: fix-syntax (#95)
Build'n check / Check Template and Build example (push) Successful in 2m45s Details
Build'n check / release (push) Failing after 5s Details
Release-As: v0.5.3
Reviewed-on: #95
Co-authored-by: servostar <sven.vogel123@web.de>
Co-committed-by: servostar <sven.vogel123@web.de>
2024-11-25 11:44:40 +00:00
Sven Vogel 44d995fd28 ci: run release on push (#94)
Build'n check / Check Template and Build example (push) Successful in 2m29s Details
Build'n check / release (push) Failing after 54s Details
Release-As: v0.5.3
Reviewed-on: #94
Co-authored-by: servostar <sven.vogel123@web.de>
Co-committed-by: servostar <sven.vogel123@web.de>
2024-11-25 10:18:05 +00:00
Sven Vogel b0fc412b57 ci/fix-release-artifacts (#93)
Release-As: v0.5.3
Reviewed-on: #93
Co-authored-by: servostar <sven.vogel123@web.de>
Co-committed-by: servostar <sven.vogel123@web.de>
2024-11-25 10:01:24 +00:00
Sven Vogel 4bb731ca66 ci: test release action (#90)
Build'n check / run-ci-linux (push) Has been skipped Details
Release-As: v0.5.3
Reviewed-on: #90
Co-authored-by: servostar <sven.vogel123@web.de>
Co-committed-by: servostar <sven.vogel123@web.de>
2024-11-25 09:20:41 +00:00
30 changed files with 601 additions and 297 deletions

View File

@ -1,7 +1,13 @@
name: Build'n check name: Build'n check
run-name: Performing Typst compilation run-name: Performing Typst compilation
on: on:
pull_request:
branches:
- main
push: push:
branches-ignore:
- main
jobs: jobs:
run-ci-linux: run-ci-linux:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -9,7 +15,8 @@ jobs:
# push with commit containing "Run-Checks" # push with commit containing "Run-Checks"
if: > if: >
(contains(github.event.head_commit.message, 'Run-Checks') && (contains(github.event.head_commit.message, 'Run-Checks') &&
github.event_name == 'push') github.event_name == 'push') ||
github.event_name == 'pull_request'
steps: steps:
- name: Check out repository code - name: Check out repository code
uses: actions/checkout@v3 uses: actions/checkout@v3

View File

@ -0,0 +1,55 @@
name: Create Release Commit
on:
push:
branches:
- main
tags-ignore:
- v*.*.*
jobs:
prepare:
runs-on: ubuntu-latest
if: contains(github.event.head_commit.message, 'Release-As:')
env:
USERNAME: servostar
EMAIL: sven.vogel123@web.de
GIT_AUTH_TOKEN: ${{ secrets.RELEASE_TOKEN }}
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
steps:
- name: Check out repository code
uses: actions/checkout@v3
with:
ref: 'main'
token: ${{ secrets.RELEASE_TOKEN }}
- name: Install dependencies for Nix setup action
run: |
apt update -y
apt install sudo -y
- name: Setup Nix
uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Setup Git
run: |
git config --global user.name "${USERNAME}"
git config --global user.email "${EMAIL}"
- name: Update Typst.toml
run: |
export VERSION=$(echo "${COMMIT_MESSAGE}" | grep -Po '(?<=Release-As: )v\d+\.\d+\.\d+')
sed -i "/version/c\version = \"${VERSION#v}\"" typst.toml
git add typst.toml
git commit -m "chore: bump release version to $VERSION" -m "Generated-By: ${{ gitea.actor }}"
- name: Generate Example Document
run: nix-shell --run ./run-ci.sh
- name: Generate Assets
if: contains(github.event.head_commit.message, 'Generate-Assets')
run: |
./run-bake-assets.sh
git add assets/banner.png
git add assets/page-preview.png
git commit -m "chore: update assets" -m "Generated-By: ${{ gitea.actor }}"
- name: Tag and Push Changes
run: |
git push origin main
export VERSION=$(echo "${COMMIT_MESSAGE}" | grep -Po '(?<=Release-As: )v\d+\.\d+\.\d+')
git tag -m "Release" "${VERSION}"
git push origin "${VERSION}"

View File

@ -1,10 +1,8 @@
name: Build'n check name: Create Release
on: on:
pull_request: push:
branches: tags:
- main - 'v[0-9]+.[0-9]+.[0-9]+'
types:
- closed
jobs: jobs:
build: build:
name: Check Template and Build example name: Check Template and Build example
@ -39,9 +37,6 @@ jobs:
release: release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build
if: contains(github.event.head_commit.message, 'Release-As:')
env:
USERNAME: servostar
steps: steps:
- name: Check out repository code - name: Check out repository code
uses: actions/checkout@v3 uses: actions/checkout@v3
@ -59,14 +54,6 @@ jobs:
run: echo ${{ steps.download.outputs.download-path }} run: echo ${{ steps.download.outputs.download-path }}
- name: Prepare Release - name: Prepare Release
run: echo ${{ github.sha }} > Release.txt run: echo ${{ github.sha }} > Release.txt
- name: Tag Release Commit
run: |
echo ${{github.event.head_commit.message}} | grep -Po '(?<=Release-As: )v\d+\.\d+\.\d+' > Version.txt
echo "==> Tagging for version: $(cat Version.txt)"
git config --global credential.helper store
echo "https://${USERNAME}:${{secrets.RELEASE_TOKEN}}}@${{github.repositoryUrl}}" > ~/.git-credentials
git tag -m "Release" $(cat Version.txt)
git push ${{github.repositoryUrl}} $(cat Version.txt)
- name: Create release - name: Create release
id: create-release id: create-release
uses: https://gitea.com/actions/release-action@main uses: https://gitea.com/actions/release-action@main
@ -74,6 +61,5 @@ jobs:
files: |- files: |-
Example.pdf Example.pdf
Release.txt Release.txt
Version.txt
LICENSE LICENSE
api_key: '${{secrets.RELEASE_TOKEN}}' api_key: '${{secrets.RELEASE_TOKEN}}'

View File

@ -1,10 +1,10 @@
name: Build'n check name: Build'n check
on: on:
push: push:
branches: branches:
- main - main
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs: jobs:
build: build:
name: Check Template and Build example name: Check Template and Build example
@ -24,7 +24,7 @@ jobs:
nix-shell --run ./run-ci.sh nix-shell --run ./run-ci.sh
- name: Upload artifact - name: Upload artifact
id: artifact-upload id: artifact-upload
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: example-document name: example-document
path: ${{ github.workspace }}/example.pdf path: ${{ github.workspace }}/example.pdf
@ -47,7 +47,7 @@ jobs:
go-version: '>=1.20.1' go-version: '>=1.20.1'
- name: Download Artifcat - name: Download Artifcat
id: download id: download
uses: actions/download-artifact@v3 uses: actions/download-artifact@v4
with: with:
name: example-document name: example-document
path: ${{ github.workspace }}/Example.pdf path: ${{ github.workspace }}/Example.pdf

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
*.pdf *.pdf
*.log *.log
images/

17
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,17 @@
# Contributing
Development of this template happens at
[git.montehaselino.de](https://git.montehaselino.de/DHBW/dhbw-abb-typst-template).
For this reason pull request opened at any mirror such as on GitHub, will not be
merged as this would compromise the push mirror.
Pull requests shall be opened exclusively in the official
[repository](https://git.montehaselino.de/DHBW/dhbw-abb-typst-template).
Issues may be created at GitHub or the official repository.
Beware, that linked pull requests and issues in commits messages refer to those
in the official instance and may be broken or invalid on mirrors such as GitHub.
Direct pushes to the `main` branch are discouraged. In order to make a change
create a new pull request and wait for a maintainer to merge it. Note that in
order to be able to merge, the continuous integration pipeline must run
successfully.

View File

@ -2,7 +2,7 @@
<div align="center"> <div align="center">
<h1>DHBW-ABB template for Typst</h1> <h1>DHBW-ABB template for Typst</h1>
<img src="https://img.shields.io/gitea/last-commit/dhbw/dhbw-abb-typst-template?gitea_url=https%3A%2F%2Fgit.montehaselino.de"> <img src="https://img.shields.io/gitea/last-commit/dhbw/dhbw-abb-typst-template?gitea_url=https%3A%2F%2Fgit.montehaselino.de">
<img src="https://img.shields.io/github/actions/workflow/status/Servostar/dhbw-abb-typst-template/ci.yml?label=build"> <img src="https://img.shields.io/github/actions/workflow/status/Servostar/dhbw-abb-typst-template/release.yml?label=build">
<img src="https://img.shields.io/gitea/v/release/dhbw/dhbw-abb-typst-template?gitea_url=https%3A%2F%2Fgit.montehaselino.de&display_name=release"> <img src="https://img.shields.io/gitea/v/release/dhbw/dhbw-abb-typst-template?gitea_url=https%3A%2F%2Fgit.montehaselino.de&display_name=release">
<img src="https://img.shields.io/badge/license-MIT-ff0000"> <img src="https://img.shields.io/badge/license-MIT-ff0000">
<img src="https://img.shields.io/badge/Typst-2B9CB0"> <img src="https://img.shields.io/badge/Typst-2B9CB0">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 MiB

After

Width:  |  Height:  |  Size: 9.0 MiB

59
baker/banner.typ Normal file
View File

@ -0,0 +1,59 @@
#import "@preview/shadowed:0.1.2": shadowed
#let LE = 10cm
#let shadow = 0.25cm
#set page(margin: 0pt, width: 2 * LE, height: LE, fill: rgb(0, 0, 0, 0))
#place(
dx: 3cm,
dy: 1.1cm,
rotate(
-9deg,
shadowed(
radius: 0pt,
inset: 0pt,
blur: shadow,
image("./images/21.svg", height: LE * 0.6))))
#place(
dx: 1cm,
dy: 3.25cm,
rotate(
-20deg,
shadowed(
radius: 0pt,
inset: 0pt,
blur: shadow,
image("./images/51.svg", height: LE * 0.55))))
#place(
dx: 14cm,
dy: 1.5cm,
rotate(
6deg,
shadowed(
radius: 0pt,
inset: 0pt,
blur: shadow,
image("./images/41.svg", height: LE * 0.65))))
#place(
dx: 11cm,
dy: 2cm,
rotate(
25deg,
shadowed(
radius: 0pt,
inset: 0pt,
blur: shadow,
image("./images/31.svg", height: LE * 0.6))))
#place(
dx: 7cm,
dy: 0.75cm,
shadowed(
radius: 0pt,
inset: 0pt,
blur: shadow,
image("./images/11.svg", height: LE * 0.75)))

34
baker/preview.typ Normal file
View File

@ -0,0 +1,34 @@
#let gap = 0.5cm
#set page(margin: 0pt, width: 210mm * 3 + 2 * gap, height: 297mm * 2 + gap, fill: rgb(0, 0, 0, 0))
#place(
dx: 0mm,
dy: 0mm,
image("./images/11.svg", height: 297mm))
#place(
dx: 210mm + gap,
dy: 0mm,
image("./images/21.svg", height: 297mm))
#place(
dx: (210mm + gap) * 2,
dy: 0mm,
image("./images/31.svg", height: 297mm))
#place(
dx: 210mm * 0,
dy: 297mm + gap,
image("./images/71.svg", height: 297mm))
#place(
dx: (210mm + gap) * 1,
dy: 297mm + gap,
image("./images/41.svg", height: 297mm))
#place(
dx: (210mm + gap) * 2,
dy: 297mm + gap,
image("./images/51.svg", height: 297mm))

18
baker/run-bake-banner.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash
echo "==> generate images"
mkdir images || true
# extract images from document created by action
mutool convert -o images/1.svg "$1" 1
mutool convert -o images/2.svg "$1" 2
mutool convert -o images/2.svg "$1" 2
mutool convert -o images/3.svg "$1" 5
mutool convert -o images/7.svg "$1" 7
mutool convert -o images/4.svg "$1" 15
mutool convert -o images/5.svg "$1" 16
echo "==> generate banner"
typst compile banner.typ --ppi 360 ../assets/banner.png
echo "==> generate preview"
typst compile preview.typ --ppi 360 ../assets/page-preview.png

14
baker/shell.nix Normal file
View File

@ -0,0 +1,14 @@
let
nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-unstable";
pkgs = import nixpkgs { config = {}; overlays = []; };
in
pkgs.mkShellNoCC {
packages = with pkgs; [
python312
python312Packages.pyyaml
typst
typstyle
mupdf-headless
];
}

6
run-bake-assets.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
cd baker
echo "==> generate assets"
nix-shell --run "./run-bake-banner.sh ../example.pdf"

View File

@ -17,7 +17,7 @@ function format() {
exit 1 exit 1
fi fi
local imports=$(rg "#import \"([a-z0-9/\-]+\.typ)\"" -Nor '$1' "$1") local imports=$(rg "#import \"([a-z0-9/\-.]+\.typ)\"" -Nor '$1' "$1")
# format all included files # format all included files
while IFS= read -r line; do while IFS= read -r line; do
@ -26,6 +26,16 @@ function format() {
fi fi
format "$wd/$line" "$2" format "$wd/$line" "$2"
done <<< "$imports" done <<< "$imports"
local includes=$(rg "#import \"([a-z0-9/\-.]+\.typ)\"" -Nor '$1' "$1")
# format all included files
while IFS= read -r line; do
if [ -z "$line" ]; then
continue
fi
format "$wd/$line" "$2"
done <<< "$includes"
} }
case $1 in case $1 in

View File

@ -1,5 +1,5 @@
let let
nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-24.11"; nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-unstable";
pkgs = import nixpkgs { config = {}; overlays = []; }; pkgs = import nixpkgs { config = {}; overlays = []; };
in in

View File

@ -3,16 +3,16 @@
// https://brand.abb/portal/en/branding-principles/basic-brand-elements/color // https://brand.abb/portal/en/branding-principles/basic-brand-elements/color
// ABB branding colors // ABB branding colors
#let ABB-RED = cmyk(0%, 100%, 95%, 0%) #let ABB-RED = rgb(255, 0, 13)
#let ABB-BLACK = cmyk(0%, 0%, 0%, 100%) #let ABB-BLACK = rgb(0, 0, 0)
#let ABB-GRAY-01 = cmyk(0%, 0%, 0%, 90%) #let ABB-GRAY-01 = rgb(25, 25, 25)
#let ABB-GRAY-02 = cmyk(0%, 0%, 0%, 75%) #let ABB-GRAY-02 = rgb(64, 64, 64)
#let ABB-GRAY-03 = cmyk(0%, 0%, 0%, 55%) #let ABB-GRAY-03 = rgb(115, 115, 115)
#let ABB-GRAY-04 = cmyk(0%, 0%, 0%, 35%) #let ABB-GRAY-04 = rgb(166, 166, 166)
#let ABB-GRAY-05 = cmyk(0%, 0%, 0%, 15%) #let ABB-GRAY-05 = rgb(217, 217, 217)
#let ABB-GRAY-06 = cmyk(0%, 0%, 0%, 5%) #let ABB-GRAY-06 = rgb(242, 242, 242)
#let ABB-WHITE = cmyk(0%, 0%, 0%, 0%) #let ABB-WHITE = rgb(255, 255, 255)
// ABB branding functinal colors // ABB branding functinal colors
#let ABB-BLUE = cmyk(100%, 53%, 2%, 16%) #let ABB-BLUE = rgb(0, 101, 210)
#let ABB-GREEN = cmyk(91%, 4%, 100%, 25%) #let ABB-GREEN = rgb(17, 184, 0)
#let ABB-YELLOW = cmyk(0%, 9%, 100%, 0%) #let ABB-YELLOW = rgb(255, 232, 0)

View File

@ -11,78 +11,78 @@
// default configuration // default configuration
#let default-config = ( #let default-config = (
// language settings used to make decisions about hyphenation and others // language settings used to make decisions about hyphenation and others
lang: "en", // ISO 3166 language code of text: "de", "en" lang: "en", // ISO 3166 language code of text: "de", "en"
region: "en", // region code region: "en", // region code
// mark this thesis as draft // mark this thesis as draft
// Adds preleminarry note page and watermark // Adds preleminarry note page and watermark
draft: true, draft: true,
// information about author(s) // information about author(s)
university: ( university: (
program: "Informationtechnology", program: "Informationtechnology",
faculty: "Technik", faculty: "Technik",
name: "dualen Hochschule Baden-Württemberg", name: "dualen Hochschule Baden-Württemberg",
campus: "Eppelheim" campus: "Eppelheim",
),
supervisor-signature: false,
authors: ((), ()),
coauthors: (),
// information about thesis
thesis: (
title: "Unofficial ABB/DHBW Typst template",
subtitle: "for reports and thesises", // subtitle may be none
submission-date: "23rd march 2020",
timeframe: "1st january 2020 - 20th march 2020",
kind: "T2000",
// translated version of abstract, only used in case language is not english
summary: none,
abstract: none,
preface: none,
keywords: ("IT", "other stuff"),
bibliography: none, /* bibliography("refs.bib") */
glossary: none,
appendices: none,
confidentiality: true,
authorship: true,
),
style: (
header: (
content-padding: 1.5em,
underline-top-padding: 0pt,
logo-height: 5em,
logo-image: "res/ABB.svg",
), ),
authors: ( footer: (
( content-padding: 1.5em,
name: "Sven Vogel", ),
course: "TINF19IT1", page: (
company: "ABB AG", format: "a4",
supervisor: "Benny Goodman", margin: (
matriculation-number: 123456789 left: 3cm,
), right: 2.5cm,
( top: 2.5cm,
name: "Kurt Jammer", bottom: 2.5cm,
course: "TINF24AI2",
company: "Siemens",
supervisor: "Henry Badman",
matriculation-number: 478568763
), ),
), ),
// information about thesis text: (
thesis: ( size: 12pt,
title: "Unofficial ABB/DHBW Typst template", font: "Fira Sans",
subtitle: "for reports and thesises", // subtitle may be none ),
submission-date: "23rd march 2020", heading: (
timeframe: "1st january 2020 - 20th march 2020", font: "Fira Sans",
kind: "T2000", ),
// translated version of abstract, only used in case language is not english code: (
summary: none, theme: "res/abb.tmTheme",
abstract: none, font: "FiraCode Nerd Font",
preface: none, lines: false,
keywords: ( "IT", "other stuff" ), size: 10pt,
bibliography: none /* bibliography("refs.bib") */, tab-size: 4,
glossary: none, ),
appendices: none), link: (
style: ( color: ABB-GRAY-02,
header: ( ),
content-padding: 1.5em, ),
underline-top-padding: 0pt, )
logo-height: 5em,
logo-image: "res/ABB.svg"),
footer: (
content-padding: 1.5em),
page: (
format: "a4",
margin: (
left: 3cm,
right: 2.5cm,
top: 2.5cm,
bottom: 2.5cm)),
text: (
size: 12pt,
font: "Fira Sans"),
heading: (
font: "Fira Sans"),
code: (
theme: "res/abb.tmTheme",
font: "FiraCode Nerd Font",
lines: false,
size: 10pt,
tab-size: 4),
link: (
color: ABB-GRAY-02)))
// Insert a dictionary `update` into `base` but only the entries of update that also exist in base // Insert a dictionary `update` into `base` but only the entries of update that also exist in base
// Runs recursively on all sub dictionaries // Runs recursively on all sub dictionaries
@ -101,12 +101,21 @@
if type(val) == array { if type(val) == array {
// ignore checking arraay // ignore checking arraay
base.insert(key, update_val)
} else if type(val) == dictionary and type(update_val) == dictionary { } else if type(val) == dictionary and type(update_val) == dictionary {
base.insert(key, deep-insert-checked(val, update_val)) base.insert(key, deep-insert-checked(val, update_val))
} else if val == none or type(val) == type(update_val) { } else if val == none or type(val) == type(update_val) {
base.insert(key, update_val) base.insert(key, update_val)
} else { } else {
panic("missmatched dictionary entry `" + key + "` type: expected `" + type(val) + "` got `" + type(update_val) + "`") panic(
"missmatched dictionary entry `"
+ key
+ "` type: expected `"
+ type(val)
+ "` got `"
+ type(update_val)
+ "`",
)
} }
} else { } else {
base.insert(key, val) base.insert(key, val)

View File

@ -59,8 +59,13 @@ SOFTWARE.*/
let textLink = if display != none { let textLink = if display != none {
[#display] [#display]
} else if ( } else if (
is_first or long == true (
) and entlong != [] and entlong != "" and long != false { is_first or long == true
)
and entlong != []
and entlong != ""
and long != false
) {
[#entlong (#entry.short#suffix)] [#entlong (#entry.short#suffix)]
} else { } else {
[#entry.short#suffix] [#entry.short#suffix]
@ -108,8 +113,13 @@ SOFTWARE.*/
} }
let textLink = if ( let textLink = if (
is_first or long == true (
) and entlong != [] and entlong != "" and long != false { is_first or long == true
)
and entlong != []
and entlong != ""
and long != false
) {
[#entlong (#short)] [#entlong (#short)]
} else { } else {
[#short] [#short]
@ -128,9 +138,11 @@ SOFTWARE.*/
// show rule to make the references for glossarium // show rule to make the references for glossarium
#let make-glossary(body) = { #let make-glossary(body) = {
show ref: r => { show ref: r => {
if r.element != none and r.element.func() == figure and r if (
.element r.element != none
.kind == __glossarium_figure { and r.element.func() == figure
and r.element.kind == __glossarium_figure
) {
// call to the general citing function // call to the general citing function
gls(str(r.target), suffix: r.citation.supplement) gls(str(r.target), suffix: r.citation.supplement)
} else { } else {
@ -197,6 +209,7 @@ SOFTWARE.*/
#let hasLong = long != "" and long != [] #let hasLong = long != "" and long != []
#let hasDesc = desc != "" and desc != [] #let hasDesc = desc != "" and desc != []
#set align(left)
#block( #block(
below: 1.5em, below: 1.5em,
width: 100%, width: 100%,
@ -229,16 +242,15 @@ SOFTWARE.*/
) )
.values .values
.map(x => { .map(x => {
let page-numbering = x.page-numbering() let page-numbering = x.page-numbering()
if page-numbering == none { if page-numbering == none {
page-numbering = "1" page-numbering = "1"
}
link(x)[#numbering(
page-numbering,
..counter(page).at(x),
)]
} }
) link(x)[#numbering(
page-numbering,
..counter(page).at(x),
)]
})
.join(", ") .join(", ")
} }
], ],

View File

@ -8,7 +8,6 @@
// License: MIT // License: MIT
#let glossary(entries, config) = { #let glossary(entries, config) = {
assert( assert(
type(entries) == dictionary, type(entries) == dictionary,
message: "The glossary is not a dictionary", message: "The glossary is not a dictionary",
@ -44,14 +43,18 @@
if "desc" in v { if "desc" in v {
assert( assert(
type(v.desc) == str, type(v.desc) == str,
message: "The description of glossary entry `" + k + "` is not a string", message: "The description of glossary entry `"
+ k
+ "` is not a string",
) )
} }
if "group" in v { if "group" in v {
assert( assert(
type(v.group) == str, type(v.group) == str,
message: "The optional group of glossary entry `" + k + "` is not a string", message: "The optional group of glossary entry `"
+ k
+ "` is not a string",
) )
} else { } else {
let acronym_group = if config.lang == "de" { let acronym_group = if config.lang == "de" {
@ -90,11 +93,13 @@
} }
} }
return processed_glossary.pairs().map(((key, entry)) => ( return processed_glossary
key: key, .pairs()
short: entry.short, .map(((key, entry)) => (
long: eval(entry.at("long", default: ""), mode: "markup"), key: key,
desc: eval(entry.at("desc", default: ""), mode: "markup"), short: entry.short,
group: entry.at("group", default: ""), long: eval(entry.at("long", default: ""), mode: "markup"),
)) desc: eval(entry.at("desc", default: ""), mode: "markup"),
group: entry.at("group", default: ""),
))
} }

View File

@ -122,17 +122,29 @@
#metadata("content terminate") <end-of-content> #metadata("content terminate") <end-of-content>
#end_styled(config)[ #end_styled(
// add bibliography if set config,
#if "bibliography" in config.thesis and config.thesis.bibliography != none { context [
pagebreak(weak: true) // add bibliography if set
counter(page).update(1) #if (
set bibliography(style: "ieee") "bibliography" in config.thesis and config.thesis.bibliography != none
config.thesis.bibliography ) {
} pagebreak(weak: true)
counter(page).update(1)
set bibliography(
style: "ieee",
title: if (text.lang == "de") {
"Literaturverzeichnis"
} else if text.lang == "en" {
"Bibliography"
},
)
config.thesis.bibliography
}
// appendix // appendix
#show-appendix(config: config) #show-appendix(config: config)
] ],
)
] ]
] ]

View File

@ -8,7 +8,6 @@
#let new_abstract(config) = ( #let new_abstract(config) = (
context { context {
set align(center + horizon) set align(center + horizon)
// only include summary when a language other than english is used // only include summary when a language other than english is used

View File

@ -8,6 +8,9 @@
#let new_confidentiality_statement_page(config) = ( #let new_confidentiality_statement_page(config) = (
context { context {
if not config.thesis.confidentiality {
return
}
pagebreak(weak: true) pagebreak(weak: true)
@ -51,13 +54,24 @@
set align(horizon) set align(horizon)
grid( grid(
// set width of columns // set width of columns
// we need two, so make both half the page width // we need two, so make both half the page width
columns: (50%, 50%), columns: (50%, 50%),
row-gutter: 0.75em, row-gutter: 0.75em,
align(left, {line(length: 6cm)}), align(left, { line(length: 6cm) }),
align(left, {line(length: 6cm)}), align(left, { line(length: 6cm) }),
align(left, if text.lang == "de" [ Ort, Datum ] else if text.lang == "en" [ Place, Date ] else { panic("no translation for language: ", text.lang) }), align(
align(left, if text.lang == "de" [ Unterschrift ] else if text.lang == "en" [ Signature ] else { panic("no translation for language: ", text.lang) })) left,
if text.lang == "de" [ Ort, Datum ] else if text.lang == "en" [
Place, Date
] else { panic("no translation for language: ", text.lang) },
),
align(
left,
if text.lang == "de" [ Unterschrift ] else if text.lang == "en" [
Signature
] else { panic("no translation for language: ", text.lang) },
)
)
} }
) )

View File

@ -8,6 +8,9 @@
#let new_declaration_of_authorship(config) = ( #let new_declaration_of_authorship(config) = (
context { context {
if not config.thesis.authorship {
return
}
pagebreak(weak: true) pagebreak(weak: true)
@ -53,13 +56,24 @@
set align(horizon) set align(horizon)
grid( grid(
// set width of columns // set width of columns
// we need two, so make both half the page width // we need two, so make both half the page width
columns: (50%, 50%), columns: (50%, 50%),
row-gutter: 0.75em, row-gutter: 0.75em,
align(left, {line(length: 6cm)}), align(left, { line(length: 6cm) }),
align(left, {line(length: 6cm)}), align(left, { line(length: 6cm) }),
align(left, if text.lang == "de" [ Ort, Datum ] else if text.lang == "en" [ Place, Date ] else { panic("no translation for language: ", text.lang) }), align(
align(left, if text.lang == "de" [ Unterschrift ] else if text.lang == "en" [ Signature ] else { panic("no translation for language: ", text.lang) })) left,
if text.lang == "de" [ Ort, Datum ] else if text.lang == "en" [
Place, Date
] else { panic("no translation for language: ", text.lang) },
),
align(
left,
if text.lang == "de" [ Unterschrift ] else if text.lang == "en" [
Signature
] else { panic("no translation for language: ", text.lang) },
)
)
} }
) )

View File

@ -12,16 +12,18 @@
// NOTE: will not render in case the listing is empty // NOTE: will not render in case the listing is empty
#let render_filtered_outline(title: str, kind: selector) = ( #let render_filtered_outline(title: str, kind: selector) = (
context { context {
let elems = query(figure.where(kind: kind)) let elems = query(figure.where(kind: kind))
let count = elems.len() let count = elems.len()
show outline.entry: it => { show outline.entry: it => {
link(it.element.location())[ link(it.element.location())[
#v(12pt, weak: true) #v(12pt, weak: true)
#text(weight: "regular", it.body) #it.prefix()
#[:]
#h(0.5em)
#text(weight: "regular", it.body())
#box(width: 1fr, it.fill) #box(width: 1fr, it.fill)
#[ #it.page] #[ #it.page()]
] ]
} }
@ -123,9 +125,14 @@
#let new_outline() = { #let new_outline() = {
pagebreak(weak: true) pagebreak(weak: true)
show outline.entry.where(level: 1): it => { show outline.entry: it => {
v(1.5em, weak: true) if it.level == 1 {
strong(it) v(1.5em, weak: true)
strong(it)
} else {
v(1.0em, weak: true)
it
}
} }
render_heading_outline() render_heading_outline()

View File

@ -8,7 +8,6 @@
#let new_prerelease_note(config) = ( #let new_prerelease_note(config) = (
context { context {
pagebreak(weak: true) pagebreak(weak: true)
let thesis = config.thesis let thesis = config.thesis
@ -47,7 +46,7 @@
if text.lang == "de" [ if text.lang == "de" [
handelt es sich _nicht_ um die fertige Fassung. Das Dokument kann Inhaltliche-, Grammatikalische- sowie Format-Fehler enthalten. Das Dokument ist im Rahmen der Aufgabenstellung von Seiten der #university.name nicht zur Bewertung freigegeben und ein anderer Verwendungszweck als eine Vorschau ist nicht gestattet. handelt es sich _nicht_ um die fertige Fassung. Das Dokument kann Inhaltliche-, Grammatikalische- sowie Format-Fehler enthalten. Das Dokument ist im Rahmen der Aufgabenstellung von Seiten der #university.name nicht zur Bewertung freigegeben und ein anderer Verwendungszweck als eine Vorschau ist nicht gestattet.
] else if text.lang == "en" [ ] else if text.lang == "en" [
is not the final version. The document may contain errors in content, grammar and formatting. The document may not be released for evaluation to #university.name as part of the assignment, and any use other than a preview is not permitted. is not the final version. The document may contain errors in content, grammar and formatting. The document may not be released for evaluation to #config.university.name as part of the assignment, and any use other than a preview is not permitted.
] ]
} }
) )

View File

@ -21,14 +21,27 @@
if config.style.header.logo-image == none { if config.style.header.logo-image == none {
// error // error
} else if config.style.header.logo-image.len() > 0 { } else if config.style.header.logo-image.len() > 0 {
align(left, image(config.style.header.logo-image, height: config.style.header.logo-height)) align(
left,
image(
config.style.header.logo-image,
height: config.style.header.logo-height,
),
)
} else { } else {
align(left, image("../res/DHBW.svg", height: config.style.header.logo-height)) align(
left,
image("../res/DHBW.svg", height: config.style.header.logo-height),
)
}, },
// right align logo of DHBW // right align logo of DHBW
if config.style.header.logo-image.len() > 0 { if config.style.header.logo-image.len() > 0 {
align(right, image("../res/DHBW.svg", height: config.style.header.logo-height)) align(
}) right,
image("../res/DHBW.svg", height: config.style.header.logo-height),
)
}
)
#set align(center) #set align(center)
@ -49,9 +62,17 @@
// faculty // faculty
#pad()[ #pad()[
#if text.lang == "de" [ #if text.lang == "de" [
aus dem Studiengang #config.university.program | #config.university.faculty aus dem Studiengang #config.university.program
] else if text.lang == "en" [ ] else if text.lang == "en" [
from the course of studies #config.university.program | #config.university.faculty from the course of studies #config.university.program
] else [
#context panic("no translation for language: ", text.lang)
]
#if text.lang == "de" [
an der Fakultät #config.university.faculty
] else if text.lang == "en" [
at the faculty of #config.university.faculty
] else [ ] else [
#context panic("no translation for language: ", text.lang) #context panic("no translation for language: ", text.lang)
] ]
@ -68,14 +89,19 @@
] ]
#config.university.name #config.university.name
#linebreak() #linebreak()
#if text.lang == "de" [
in
] else if text.lang == "en" [
in
] else [
#context panic("no translation for language: ", text.lang)
]
#config.university.campus #config.university.campus
] ]
#pad(top: 1em)[ #pad(top: 1.5em)[
#let names = () #let names = ()
#for author in config.authors {
names.push(author.name)
}
#if text.lang == "de" [ #if text.lang == "de" [
von von
] else if text.lang == "en" [ ] else if text.lang == "en" [
@ -83,86 +109,72 @@
] else [ ] else [
#context panic("no translation for language: ", text.lang) #context panic("no translation for language: ", text.lang)
] ]
#set text(size: 16pt)
#grid(columns: 1, row-gutter: 1em, ..names) #v(1.5em)
#let rows = int(config.authors.len() / 3 + 0.9)
#for i in range(0, rows) {
let cols = calc.min(config.authors.len() - i * 3, 3)
grid(columns: cols, column-gutter: 1.5em, ..config
.authors
.slice(i * 3, i * 3 + cols)
.map(author => par([
#if author.at("name", default: none) != none {
text(size: 1.25em, author.name)
linebreak()
}
#if author.at("company", default: none) != none {
text(size: 1em, author.company)
linebreak()
}
#if author.at("contact", default: none) != none {
text(size: 1em, author.contact)
linebreak()
}
#str(author.matriculation-number), #author.course
])))
}
] ]
#pad(top: 1em)[ #v(1em)
#align(center)[
coauthored in part by
#linebreak()
#for author in config.coauthors {
author
}
]
#set align(bottom)
#pad(top: 1.5em)[
#thesis.timeframe #thesis.timeframe
] ]
#set align(bottom + left) #if config.supervisor-signature {
align(
#if text.lang == "de" [ bottom,
#grid( grid(
columns: 2, // set width of columns
column-gutter: 1cm, // we need two, so make both half the page width
row-gutter: 0.5cm, columns: (60%, 40%),
align: top + left, align(
stroke: none, left,
[Matrikelnummer, Kurs:], if text.lang == "de" [
par( Unterschrift des betrieblichen Betreuers
leading: 0.5em, ] else if text.lang == "en" [
for author in config.authors { Signature of the company supervisor
str(author.matriculation-number) + ", " + author.course ] else [
linebreak() #context panic("no translation for language: ", text.lang)
}, ],
), ),
align(right, { line(length: 6cm) })
[Betrieb, Betreuer:],
par(
leading: 0.5em,
for author in config.authors {
author.company + ", " + author.supervisor
linebreak()
},
), ),
) )
] else if text.lang == "en" [ }
#grid(
columns: 2,
column-gutter: 1cm,
row-gutter: 0.5cm,
align: top + left,
stroke: none,
[Student ID, Course:],
par(
leading: 0.5em,
for author in config.authors {
str(author.matriculation-number) + ", " + author.course
linebreak()
},
),
[Company, Supervisor:],
par(
leading: 0.5em,
for author in config.authors {
author.company + ", " + author.supervisor
linebreak()
},
),
)
] else [
#context panic("no translation for language: ", text.lang)
]
#align(
bottom,
grid(
// set width of columns
// we need two, so make both half the page width
columns: (60%, 40%),
align(left, if text.lang == "de" [
Unterschrift des betrieblichen Betreuers
] else if text.lang == "en" [
Signature of the company supervisor
] else [
#context panic("no translation for language: ", text.lang)
]
),
align(right, {line(length: 6cm)})),
)
#counter(page).update(0) #counter(page).update(0)
] ]

View File

@ -166,10 +166,10 @@
.map(make_row) .map(make_row)
.flatten() .flatten()
.map(c => if c.has("text") and c.text == "" { .map(c => if c.has("text") and c.text == "" {
v(1em) v(1em)
} else { } else {
c c
}) })
) )
}, },
) )
@ -193,13 +193,15 @@
// change the display supplement according to the text langugae // change the display supplement according to the text langugae
// based on: https://github.com/typst/typst/issues/3273 // based on: https://github.com/typst/typst/issues/3273
show figure.where(kind: raw): set figure(supplement: context { show figure.where(kind: raw): set figure(
if text.lang == "de" { supplement: context {
"Quelltext" if text.lang == "de" {
} else { "Quelltext"
"Listing" } else {
} "Listing"
}) }
},
)
// APA style table // APA style table
set table( set table(
@ -241,12 +243,13 @@
set page( set page(
paper: style.page.format, paper: style.page.format,
foreground: watermark(config), foreground: watermark(config),
background: [#rect(width: 100%, height: 100%, fill: white)],
header-ascent: style.header.content-padding, header-ascent: style.header.content-padding,
footer-descent: style.header.content-padding, footer-descent: style.header.content-padding,
margin: ( margin: (
top: style.page.margin.top + style.header.underline-top-padding + style top: style.page.margin.top
.header + style.header.underline-top-padding
.content-padding, + style.header.content-padding,
bottom: style.page.margin.bottom + style.footer.content-padding, bottom: style.page.margin.bottom + style.footer.content-padding,
left: style.page.margin.left, left: style.page.margin.left,
right: style.page.margin.right, right: style.page.margin.right,
@ -255,15 +258,13 @@
let current-page = here().page() let current-page = here().page()
if current-page == 1 { if current-page == 1 {
[] []
} else if query(<end-of-prelude>) } else if (
.first() query(<end-of-prelude>).first().location().page() > current-page
.location() ) {
.page() > current-page {
numbering("I", nums.pos().first()) numbering("I", nums.pos().first())
} else if query(<end-of-content>) } else if (
.first() query(<end-of-content>).first().location().page() >= current-page
.location() ) {
.page() >= current-page {
numbering("1", nums.pos().first()) numbering("1", nums.pos().first())
} else { } else {
numbering("a", nums.pos().first()) numbering("a", nums.pos().first())
@ -276,10 +277,14 @@
#if page-number == 1 { #if page-number == 1 {
[] []
} else if query(<end-of-prelude>).first().location().page() > page-number { } else if (
query(<end-of-prelude>).first().location().page() > page-number
) {
set align(center) set align(center)
numbering("I", page-counter) numbering("I", page-counter)
} else if query(<end-of-content>).first().location().page() >= page-number { } else if (
query(<end-of-content>).first().location().page() >= page-number
) {
numbering( numbering(
"1 / 1", "1 / 1",
page-counter, page-counter,
@ -295,14 +300,11 @@
if current-page == 1 { if current-page == 1 {
// logo moved to content // logo moved to content
} else if (
} else if query(<end-of-content>) query(<end-of-content>).first().location().page() >= current-page
.first() and query(<end-of-prelude>).first().location().page()
.location() < current-page + 1
.page() >= current-page and query(<end-of-prelude>) ) {
.first()
.location()
.page() < current-page + 1 {
let heading = currentH() let heading = currentH()
heading.at(0) heading.at(0)

View File

@ -6,16 +6,26 @@
lang: "de", lang: "de",
region: "de", region: "de",
draft: false, draft: false,
author: ( authors: (
name: "Sven Vogel", (
semester: 4, name: "Sven Vogel",
program: "Informationtechnology", course: "TINF19IT1",
course: "TINF19IT1", company: none,
faculty: "Technik", supervisor: "Benny Goodman",
university: "DHBW Mannheim", matriculation-number: 123456789,
company: "ABB AG", contact: "sven.vogel123@web.de"
supervisor: "Benny Goodman", ),
matriculation-number: 123456789, (
name: "Sven Vogel",
course: "TINF19IT1",
company: "ABB AG",
supervisor: "Benny Goodman",
matriculation-number: 123456789,
contact: "sven.vogel123@web.de"
)
),
coauthors: (
"Gorbatschew"
), ),
thesis: ( thesis: (
title: "Unofficial ABB/DHBW Typst template", title: "Unofficial ABB/DHBW Typst template",
@ -30,6 +40,8 @@
bibliography: bibliography("refs.bib"), bibliography: bibliography("refs.bib"),
glossary: yaml("glossary.yml"), glossary: yaml("glossary.yml"),
appendices: include "appendix.typ", appendices: include "appendix.typ",
confidentiality: false,
authorship: false
), ),
style: ( style: (
header: ( header: (
@ -38,7 +50,7 @@
) )
)) ))
#import "@preview/wrap-it:0.1.0": wrap-content #import "@preview/wrap-it:0.1.1": wrap-content
= Lorem Ipsum = Lorem Ipsum

View File

@ -1,6 +1,6 @@
[package] [package]
name = "dhbw-abb-typst-template" name = "dhbw-abb-typst-template"
version = "0.4.1" version = "0.6.3"
entrypoint = "src/template.typ" entrypoint = "src/template.typ"
authors = ["Sven Vogel <sven.vogel1@de.abb.com>"] authors = ["Sven Vogel <sven.vogel1@de.abb.com>"]
license = "MIT" license = "MIT"