Compare commits

..

No commits in common. "main" and "fix/ci-failing-on-github" have entirely different histories.

60 changed files with 340 additions and 529 deletions

View File

@ -1,19 +1,10 @@
name: Build'n check name: Gitea Action for checking typst compilation
run-name: Performing Typst compilation run-name: Performing Typst compilation
on: on: [push]
push:
pull_request:
branches:
- main
jobs: jobs:
run-ci-linux: run-ci-linux:
runs-on: ubuntu-latest runs-on: ubuntu-latest
# run action mutally exclusive on PRs or
# push with commit containing "Run-Checks"
if: >
(contains(github.event.head_commit.message, 'Run-Checks') &&
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
@ -25,9 +16,5 @@ jobs:
uses: cachix/install-nix-action@v27 uses: cachix/install-nix-action@v27
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
- name: Stylecheck - name: Run CI
run: nix-shell --run "./run-fmt.sh --check src/lib.typ" run: nix-shell --run ./run-ci.sh
- id: build
name: Build
run: |
nix-shell --run ./run-ci.sh

View File

@ -0,0 +1,34 @@
name: release
on:
push:
tags:
- 'v*.*.*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- 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: Run CI
run: nix-shell --run ./run-ci.sh
- name: Setup go
uses: https://github.com/actions/setup-go@v4
with:
go-version: '>=1.20.1'
- name: Create release
id: create-release
uses: https://gitea.com/actions/release-action@main
with:
files: |-
example.pdf
api_key: '${{secrets.RELEASE_TOKEN}}'

16
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,16 @@
name: GitHub Action for checking typst compilation
run-name: Performing Typst compilation
on: [push]
jobs:
run-ci-linux:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Setup Nix
uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Run CI
run: nix-shell --run ./run-ci.sh

View File

@ -1,13 +1,12 @@
name: Build'n check name: release
on: on:
push: push:
branches: tags:
- main - 'v*.*.*'
jobs: jobs:
build: release:
name: Check Template and Build example
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check out repository code - name: Check out repository code
@ -16,49 +15,16 @@ jobs:
uses: cachix/install-nix-action@v27 uses: cachix/install-nix-action@v27
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
- name: Stylecheck - name: Run CI
run: nix-shell --run "./run-fmt.sh --check src/lib.typ" run: nix-shell --run ./run-ci.sh
- id: build
name: Build
run: |
nix-shell --run ./run-ci.sh
- name: Upload artifact
id: artifact-upload
uses: actions/upload-artifact@v3
with:
name: example-document
path: ${{ github.workspace }}/example.pdf
if-no-files-found: error
retention-days: 1
- name: Output artifact ID
run: echo 'Artifact ID is ${{ steps.artifact-upload.outputs.artifact-id }}'
release:
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Setup go - name: Setup go
uses: actions/setup-go@v4 uses: https://github.com/actions/setup-go@v4
with: with:
go-version: '>=1.20.1' go-version: '>=1.20.1'
- name: Download Artifcat - name: Create release
id: download id: create-release
uses: actions/download-artifact@v3 uses: https://gitea.com/actions/release-action@main
with: with:
name: example-document files: |-
path: ${{ github.workspace }}/Example.pdf example.pdf
- name: 'Artifact Download Path' api_key: '${{secrets.RELEASE_TOKEN}}'
run: echo ${{ steps.download.outputs.download-path }}
- name: Prepare Release
run: echo ${{ github.sha }} > Release.txt
- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
Example.pdf
Release.txt
LICENSE

18
LICENSE
View File

@ -2,20 +2,8 @@ MIT License
Copyright (c) 2024 Sven Vogel Copyright (c) 2024 Sven Vogel
Permission is hereby granted, free of charge, to any person obtaining a copy of Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -40,7 +40,7 @@
## Features ## Features
> ⚠️ **Notice** <br> > ⚠️ **Notice** <br>
> Typst ist under active development and thus may lack features an experienced LaTeX is used to. > Typst ist under active development and thus may lack features an experienced LaTeX is used to.
This template includes designs for a titlepage, confidantiality statement, declaration of authorship and more with a consistent design inspired by various unofficial works made by students at DHBW. Layout and the choise fonts are based on the unofficial [supercharged-dhbw](https://github.com/DannySeidel/typst-dhbw-template) Typst template. It comes with automatic generation of outlines for figures, tables, code snippets and appendices. This template includes designs for a titlepage, confidantiality statement, declaration of authorship and more with a consistent design inspired by various unofficial works made by students at DHBW. Layout and the choise fonts are based on the unofficial [supercharged-dhbw](https://github.com/DannySeidel/typst-dhbw-template) Typst template. It comes with automatic generation of outlines for figures, tables, code snippets and appendices.
The template can generate sections for a glossary, combinging acronyms and technical terms into a singular section. The template can generate sections for a glossary, combinging acronyms and technical terms into a singular section.
@ -57,7 +57,7 @@ A short overview of all features the template is capable of:
- Watermark for draft versions - Watermark for draft versions
- Automatic form filling for data provided via configuration - Automatic form filling for data provided via configuration
- Styles for captions, tables and equations - Styles for captions, tables and equations
- ABB branding inspired code theme - ABB branding inspired code theme
## Preview ## Preview
@ -75,78 +75,31 @@ The default configuration can be found in `src/conf.typ`.
#import "src/lib.typ": * #import "src/lib.typ": *
#show: dhbw-template.with(( #show: dhbw-template.with((
// language settings used to make decisions about hyphenation and others lang: "en",
lang: "en", // ISO 3166 language code of text: "de", "en" region: "en",
region: "en", // region code author: (
// mark this thesis as draft name: "Sven Vogel",
// Adds preleminarry note page and watermark semester: 4,
draft: true,
// information about author(s)
university: (
program: "Informationtechnology", program: "Informationtechnology",
course: "TINF19IT1",
faculty: "Technik", faculty: "Technik",
name: "dualen Hochschule Baden-Württemberg", university: "DHBW Mannheim",
campus: "Eppelheim" company: "ABB AG",
), supervisor: "Benny Goodman",
authors: ( matriculation-number: 123456789),
(
name: "Sven Vogel",
course: "TINF19IT1",
company: "ABB AG",
supervisor: "Benny Goodman",
matriculation-number: 123456789
),
(
name: "Kurt Jammer",
course: "TINF24AI2",
company: "Siemens",
supervisor: "Henry Badman",
matriculation-number: 478568763
),
),
// information about thesis
thesis: ( thesis: (
title: "Unofficial ABB/DHBW Typst template", title: "Unofficial ABB/DHBW Typst template",
subtitle: "for reports and thesises", // subtitle may be none subtitle: "for reports and thesises",
submission-date: "23rd march 2020", submission-date: "23rd march 2020",
timeframe: "1st january 2020 - 20th march 2020", timeframe: "1st january 2020 - 20th march 2020",
kind: "T2000", kind: "T2000",
// translated version of abstract, only used in case language is not english summary: summary,
summary: none, abstract: abstract,
abstract: none, preface: include "preface.typ",
preface: none,
keywords: ( "IT", "other stuff" ), keywords: ( "IT", "other stuff" ),
bibliography: none /* bibliography("refs.bib") */, bibliography: bibliography("refs.bib"),
glossary: none, glossary: yaml("glossary.yml"),
appendices: none), appendices: include "appendix.typ")))
style: (
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)))
// Your document code goes here! // Your document code goes here!
@ -178,10 +131,9 @@ Complies with ABB branding guidelines such as:
## Fonts ## Fonts
Both fonts used in the document are licensed under the [Open Font License](https://openfontlicense.org/) and can be used for non-commercial as well as commercial purposes: Both fonts used in the document are licensed under the [Open Font License](https://openfontlicense.org/) and can be used for non-commercial as well as commercial purposes. They can be downloaded from google fonts:
- [Fira Sans](https://github.com/bBoxType/FiraSans) - [Montserrat](https://fonts.google.com/specimen/Montserrat)
- [Fira Math](https://github.com/firamath/firamath) - [Open Sans](https://fonts.google.com/specimen/Open+Sans)
- [Fira Code NF](https://www.nerdfonts.com/font-downloads)
Consider giving the creators of the font credit for their amazing work! Consider giving the creators of the font credit for their amazing work!
@ -192,8 +144,8 @@ The developers around Typst have made pretty handy comparison guide between LaTe
## Legal ## Legal
This template and its content is in no way officially affiliaterd with either DHBW or ABB AG. This template and its content is in no way officially affiliaterd with either DHBW or ABB AG.
Its only purpose is to simplify the process of getting started with the typsetting language Typst for writing a university report or thesis. Its only purpose is to simplify the process of getting started with the typsetting language Typst for writing a university report or thesis.
As author and owner of the reposity I claim no copyright of the logos used in the document, the software used to compile the source or the documents based on this template. As author and owner of the reposity I claim no copyright of the logos used in the document, the software used to compile the source or the documents based on this template.
## FAQ ## FAQ
@ -214,4 +166,4 @@ Typst in comparison is serval orders of magnitudes faster and has native support
The logos for both ABB AG and DHBW are freely available at Wikimedia Commons: The logos for both ABB AG and DHBW are freely available at Wikimedia Commons:
- [ABB logo as svg](https://commons.wikimedia.org/wiki/File:ABB_logo.svg) - [ABB logo as svg](https://commons.wikimedia.org/wiki/File:ABB_logo.svg)
- [DHBW logo as svg](https://upload.wikimedia.org/wikipedia/de/1/1d/DHBW-Logo.svg) - [DHBW logo as svg](https://upload.wikimedia.org/wikipedia/de/1/1d/DHBW-Logo.svg)

View File

@ -1,93 +0,0 @@
Copyright (c) 2014, The Fira Code Project Authors (https://github.com/tonsky/FiraCode)
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

View File

@ -1,48 +0,0 @@
# Nerd Fonts
This is an archived font from the Nerd Fonts release v3.2.1.
For more information see:
* https://github.com/ryanoasis/nerd-fonts/
* https://github.com/ryanoasis/nerd-fonts/releases/latest/
# Fira Code
**Fira Code** is a free monospaced font with programming ligatures.
For more information have a look at the upstream website: https://github.com/tonsky/FiraCode
Version: 6.2
## Which font?
### TL;DR
* Pick your font family:
* If you are limited to monospaced fonts (because of your terminal, etc) then pick a font with `Nerd Font Mono` (or `NFM`).
* If you want to have bigger icons (usually around 1.5 normal letters wide) pick a font without `Mono` i.e. `Nerd Font` (or `NF`). Most terminals support this, but ymmv.
* If you work in a proportional context (GUI elements or edit a presentation etc) pick a font with `Nerd Font Propo` (or `NFP`).
### Ligatures
Ligatures are generally preserved in the patched fonts.
Nerd Fonts `v2.0.0` had no ligatures in the `Nerd Font Mono` fonts, this has been dropped with `v2.1.0`.
If you have a ligature-aware terminal and don't want ligatures you can (usually) disable them in the terminal settings.
### Explanation
Once you narrow down your font choice of family (`Droid Sans`, `Inconsolata`, etc) and style (`bold`, `italic`, etc) you have 2 main choices:
#### `Option 1: Download already patched font`
* For a stable version download a font package from the [release page](https://github.com/ryanoasis/nerd-fonts/releases)
* Or download the development version from the folders here
#### `Option 2: Patch your own font`
* Patch your own variations with the various options provided by the font patcher (i.e. not include all symbols for smaller font size)
For more information see: [The FAQ](https://github.com/ryanoasis/nerd-fonts/wiki/FAQ-and-Troubleshooting#which-font)
[SIL-RFN]:http://scripts.sil.org/cms/scripts/page.php?item_id=OFL_web_fonts_and_RFNs#14cbfd4a

Binary file not shown.

View File

@ -1,92 +0,0 @@
Copyright (C) 2018--2023 by Xiangdong Zeng <xdzeng96@gmail.com>
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION AND CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

4
generate-theme.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
pip install -r base16/requirements.txt
python base16/generator.py base16/abb.yml base16/template.tmTheme src/res/abb.tmTheme

View File

@ -1,3 +1,53 @@
#!/bin/bash #!/bin/bash
typst compile template/main.typ --root . --font-path fonts example.pdf function log() {
local timestamp=$(date +"%Y-%m-%d %H:%M:%S")
echo "$1 at $timestamp: $2"
}
function abort() {
log "ERROR" "test case $1 has failed"
exit 1
}
function print-box() {
printf "\\n"
echo ".----------------------------------------------------------------."
printf "| %-62s |\\n" "$1"
echo "'----------------------------------------------------------------'"
}
function enter-section() {
print-box "$1"
log "INFO" "running task in section $1: $2"
log "INFO" "section output following..."
printf "\\n"
eval "$2"
exit_status=$?
if [ "$3" == "should fail" ]; then
log "INFO" "expected to fail..."
if [ $exit_status -eq 0 ]; then
abort "command: $2 failed in section: $1 with: $exit_status"
fi
else
log "INFO" "expected to pass..."
if [ ! $exit_status -eq 0 ]; then
abort "command: $2 failed in section: $1 with: $exit_status"
fi
fi
printf "\\n"
log "INFO" "section $1 completed successfully"
}
enter-section "Typstyle checking" "./run-fmt.sh --check src/lib.typ" 0
enter-section "Compiling template..." "typst compile template/main.typ --root . example.pdf"
enter-section "TEST: local template import" "typst compile tests/local-import/main.typ --root ."
enter-section "TEST: invalid config case 1" "typst compile tests/invalid-config/test-case-1.typ --root ." "should fail"
enter-section "TEST: invalid config case 2" "typst compile tests/invalid-config/test-case-2.typ --root ."
enter-section "TEST: invalid config case 3" "typst compile tests/invalid-config/test-case-3.typ --root ." "should fail"
log "INFO" "CI completed successfully"

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

@ -18,28 +18,16 @@
// 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: ( author: (
name: "Sven Vogel",
semester: 4,
program: "Informationtechnology", program: "Informationtechnology",
course: "TINF19IT1",
faculty: "Technik", faculty: "Technik",
name: "dualen Hochschule Baden-Württemberg", university: "DHBW Mannheim",
campus: "Eppelheim" company: "ABB AG",
), supervisor: "Benny Goodman",
authors: ( matriculation-number: 123456789),
(
name: "Sven Vogel",
course: "TINF19IT1",
company: "ABB AG",
supervisor: "Benny Goodman",
matriculation-number: 123456789
),
(
name: "Kurt Jammer",
course: "TINF24AI2",
company: "Siemens",
supervisor: "Henry Badman",
matriculation-number: 478568763
),
),
// information about thesis // information about thesis
thesis: ( thesis: (
title: "Unofficial ABB/DHBW Typst template", title: "Unofficial ABB/DHBW Typst template",
@ -59,8 +47,7 @@
header: ( header: (
content-padding: 1.5em, content-padding: 1.5em,
underline-top-padding: 0pt, underline-top-padding: 0pt,
logo-height: 5em, logo-height: 3em),
logo-image: "res/ABB.svg"),
footer: ( footer: (
content-padding: 1.5em), content-padding: 1.5em),
page: ( page: (
@ -72,9 +59,9 @@
bottom: 2.5cm)), bottom: 2.5cm)),
text: ( text: (
size: 12pt, size: 12pt,
font: "Fira Sans"), font: "Open Sans"),
heading: ( heading: (
font: "Fira Sans"), font: "Montserrat"),
code: ( code: (
theme: "res/abb.tmTheme", theme: "res/abb.tmTheme",
font: "FiraCode Nerd Font", font: "FiraCode Nerd Font",
@ -99,9 +86,7 @@
if key in update { if key in update {
let update_val = update.at(key) let update_val = update.at(key)
if type(val) == array { if type(val) == dictionary and type(update_val) == dictionary {
// ignore checking arraay
} 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)

View File

@ -34,9 +34,10 @@ SOFTWARE.*/
loc, loc,
inclusive: false, inclusive: false,
), ),
loc,
) )
} else { } else {
query(selector(label(__glossary_label_prefix + key))) query(selector(label(__glossary_label_prefix + key)), loc)
} }
} }
@ -48,7 +49,7 @@ SOFTWARE.*/
// Reference a term // Reference a term
#let gls(key, suffix: none, long: none, display: none) = { #let gls(key, suffix: none, long: none, display: none) = {
context { context {
let __glossary_entries = __glossary_entries.final() let __glossary_entries = __glossary_entries.final(here())
if key in __glossary_entries { if key in __glossary_entries {
let entry = __glossary_entries.at(key) let entry = __glossary_entries.at(key)
@ -199,8 +200,7 @@ SOFTWARE.*/
#block( #block(
below: 1.5em, below: 1.5em,
width: 100%, par(hanging-indent: 1em)[
par(hanging-indent: 1em, align(left)[
#text(weight: "bold", entry.short) #text(weight: "bold", entry.short)
#if hasLong and hasDesc [ #if hasLong and hasDesc [
(#text(entry.long)) (#text(entry.long))
@ -239,7 +239,7 @@ SOFTWARE.*/
) )
.join(", ") .join(", ")
} }
]), ],
) )
] ]
} }

View File

@ -13,9 +13,7 @@
#import "glossary.typ": glossary #import "glossary.typ": glossary
#import "pages/titlepage.typ": new_title_page #import "pages/titlepage.typ": new_title_page
#import "pages/declaration-of-authorship.typ": new_declaration_of_authorship #import "pages/declaration-of-authorship.typ": new_declaration_of_authorship
#import "pages/confidentiality-statement.typ": ( #import "pages/confidentiality-statement.typ": new_confidentiality_statement_page
new_confidentiality_statement_page,
)
#import "pages/prerelease-note.typ": new_prerelease_note #import "pages/prerelease-note.typ": new_prerelease_note
#import "pages/outline.typ": new_outline #import "pages/outline.typ": new_outline
#import "pages/abstract.typ": new_abstract #import "pages/abstract.typ": new_abstract
@ -71,7 +69,7 @@
// set document properties // set document properties
#set document( #set document(
// author: config.author.name, author: config.author.name,
keywords: config.thesis.keywords, keywords: config.thesis.keywords,
title: config.thesis.title, title: config.thesis.title,
) )

View File

@ -12,6 +12,7 @@
pagebreak(weak: true) pagebreak(weak: true)
let thesis = config.thesis let thesis = config.thesis
let author = config.author
if text.lang == "de" [ if text.lang == "de" [
#heading(level: 1, "Sperrvermerk") #heading(level: 1, "Sperrvermerk")

View File

@ -12,6 +12,7 @@
pagebreak(weak: true) pagebreak(weak: true)
let thesis = config.thesis let thesis = config.thesis
let author = config.author
if text.lang == "de" [ if text.lang == "de" [
#heading("Selbständigkeitserklärung") #heading("Selbständigkeitserklärung")

View File

@ -13,7 +13,7 @@
#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), here())
let count = elems.len() let count = elems.len()
show outline.entry: it => { show outline.entry: it => {

View File

@ -10,55 +10,39 @@
context [ context [
#let thesis = config.thesis #let thesis = config.thesis
#let author = config.author
// logo of ABB and DHBW
#v(-config.style.header.content-padding)
#grid(
// set width of columns
// we need two, so make both half the page width
columns: (50%, 50%),
// left align logo of ABB
if config.style.header.logo-image == none {
// error
} else if config.style.header.logo-image.len() > 0 {
align(left, image(config.style.header.logo-image, height: config.style.header.logo-height))
} else {
align(left, image("../res/DHBW.svg", height: config.style.header.logo-height))
},
// right align logo of DHBW
if config.style.header.logo-image.len() > 0 {
align(right, image("../res/DHBW.svg", height: config.style.header.logo-height))
})
#set align(center) #set align(center)
// title // title
#v(2cm) #v(2cm)
#par(justify: false, leading: 1.5em)[ #set par(justify: false)
#text(size: 2em, weight: "bold", hyphenate: false, thesis.title) #text(size: 2em, weight: "semibold", hyphenate: false, thesis.title)
#linebreak()
// subtitle
#text(size: 2em, weight: "light", thesis.subtitle)
]
#set align(center + horizon) // subtitle
#text(size: 1.5em, thesis.subtitle)
// type of paper // type of paper
#text(size: 1.5em, weight: "medium", thesis.kind) #v(1cm)
#text(size: 1.5em, weight: "bold", thesis.kind)
// faculty // faculty
#pad()[ #pad(top: 0.5cm)[
#if text.lang == "de" [ #if text.lang == "de" [
aus dem Studiengang #config.university.program | #config.university.faculty Praxisphase des #author.semester Semesters an der Fakultät für #author.faculty
#linebreak()
im Studiengang #author.program
] else if text.lang == "en" [ ] else if text.lang == "en" [
from the course of studies #config.university.program | #config.university.faculty Practical phase of the #author.semester semester at the Faculty of #author.faculty
#linebreak()
in the degree program #author.program
] else [ ] else [
#context panic("no translation for language: ", text.lang) #context panic("no translation for language: ", text.lang)
] ]
] ]
// university // university
#pad()[ #pad(top: 0.5cm)[
#if text.lang == "de" [ #if text.lang == "de" [
an der an der
] else if text.lang == "en" [ ] else if text.lang == "en" [
@ -66,82 +50,41 @@
] else [ ] else [
#context panic("no translation for language: ", text.lang) #context panic("no translation for language: ", text.lang)
] ]
#config.university.name
#linebreak() #linebreak()
#config.university.campus #author.university
] ]
#pad(top: 1em)[ #set align(horizon + left)
#let names = ()
#for author in config.authors {
names.push(author.name)
}
#if text.lang == "de" [
von
] else if text.lang == "en" [
by
] else [
#context panic("no translation for language: ", text.lang)
]
#set text(size: 16pt)
#grid(columns: 1, row-gutter: 1em, ..names)
]
#pad(top: 1em)[
#thesis.timeframe
]
#set align(bottom + left)
#if text.lang == "de" [ #if text.lang == "de" [
#grid( #table(
columns: 2, columns: 2,
column-gutter: 1cm, column-gutter: 1cm,
row-gutter: 0.5cm, align: left,
align: top + left,
stroke: none, stroke: none,
[Matrikelnummer, Kurs:], [*Verfasser:*], author.name,
par( [*Bearbeitungszeitraum:*], thesis.timeframe,
leading: 0.5em, [*Matrikelnummer, Kurs:*],
for author in config.authors { str(author.matriculation-number) + ", " + author.course,
str(author.matriculation-number) + ", " + author.course
linebreak()
},
),
[Betrieb, Betreuer:], [*Ausbildungsbetrieb:*], author.company,
par( [*Betrieblicher Betreuer:*], author.supervisor,
leading: 0.5em, [*Abgabedatum:*], thesis.submission-date,
for author in config.authors {
author.company + ", " + author.supervisor
linebreak()
},
),
) )
] else if text.lang == "en" [ ] else if text.lang == "en" [
#grid( #table(
columns: 2, columns: 2,
column-gutter: 1cm, column-gutter: 1cm,
row-gutter: 0.5cm, align: left,
align: top + left,
stroke: none, stroke: none,
[Student ID, Course:], [*Author:*], author.name,
par( [*Editing period:*], thesis.timeframe,
leading: 0.5em, [*Matriculation number, course:*],
for author in config.authors { str(author.matriculation-number) + ", " + author.course,
str(author.matriculation-number) + ", " + author.course
linebreak()
},
),
[Company, Supervisor:], [*Training company:*], author.company,
par( [*Company supervisor:*], author.supervisor,
leading: 0.5em, [*Submission date:*], thesis.submission-date,
for author in config.authors {
author.company + ", " + author.supervisor
linebreak()
},
),
) )
] else [ ] else [
#context panic("no translation for language: ", text.lang) #context panic("no translation for language: ", text.lang)

View File

@ -75,7 +75,7 @@
show heading: set text( show heading: set text(
font: style.heading.font, font: style.heading.font,
weight: "bold", weight: "semibold",
) )
let header-supplement = if config.lang == "de" { let header-supplement = if config.lang == "de" {
@ -87,7 +87,6 @@
set heading(supplement: [#header-supplement]) set heading(supplement: [#header-supplement])
set math.equation(numbering: "(1)") set math.equation(numbering: "(1)")
show math.equation: set text(font: "Fira Math", size: 12pt)
// Set header spacing // Set header spacing
show heading.where(level: 1): it => v(2em) + it + v(1em) show heading.where(level: 1): it => v(2em) + it + v(1em)
@ -183,8 +182,8 @@
// based on: https://github.com/typst/typst/discussions/3871 // based on: https://github.com/typst/typst/discussions/3871
show figure.caption: c => [ show figure.caption: c => [
#if c.body.fields().len() > 0 { #if c.body.fields().len() > 0 {
text(weight: "medium")[ text(weight: "semibold")[
#c.supplement #context c.counter.display("1.1.1") #c.supplement #c.counter.display("1.1.1")
] ]
c.separator c.separator
} }
@ -294,7 +293,15 @@
let current-page = here().page() let current-page = here().page()
if current-page == 1 { if current-page == 1 {
// logo moved to content // logo of ABB and DHBW
grid(
// set width of columns
// we need two, so make both half the page width
columns: (50%, 50%),
// left align logo of ABB
align(left, image("res/ABB.svg", height: style.header.logo-height)),
// right align logo of DHBW
align(right, image("res/DHBW.svg", height: style.header.logo-height)))
} else if query(<end-of-content>) } else if query(<end-of-content>)
.first() .first()

View File

@ -31,11 +31,6 @@
glossary: yaml("glossary.yml"), glossary: yaml("glossary.yml"),
appendices: include "appendix.typ", appendices: include "appendix.typ",
), ),
style: (
header: (
logo-image: ""
)
)
)) ))
#import "@preview/wrap-it:0.1.0": wrap-content #import "@preview/wrap-it:0.1.0": wrap-content
@ -63,8 +58,7 @@
$ $
angle.l a, b angle.r &= arrow(a) dot arrow(b) \ angle.l a, b angle.r &= arrow(a) dot arrow(b) \
&= a_1 b_1 + a_2 b_2 + ... a_n b_n \ &= a_1 b_1 + a_2 b_2 + ... a_n b_n \
&= sum_(i=1)^n a_i b_i. \ &= sum_(i=1)^n a_i b_i.
integral_2^4(3x + 4x^2)
$ $
#lorem(140) #lorem(140)

View File

@ -0,0 +1,28 @@
#import "../../src/lib.typ": dhbw-template
#show: dhbw-template.with((
lang: none,
region: "en",
author: (
name: "Sven Vogel",
semester: 4,
program: "Informationtechnology",
course: "TINF19IT1",
faculty: "Technik",
university: "DHBW Mannheim",
company: "ABB AG",
supervisor: "Benny Goodman",
matriculation-number: 123456789),
thesis: (
title: "Unofficial ABB/DHBW Typst template",
subtitle: "for reports and thesises",
submission-date: "23rd march 2020",
timeframe: "1st january 2020 - 20th march 2020",
kind: "T2000",
summary: none,
abstract: none,
keywords: ( "IT", "other stuff" ),
bibliography: none,
glossary: none,
appendices: none)))

View File

@ -0,0 +1,34 @@
#import "../../src/lib.typ": dhbw-template
#show: dhbw-template.with((
lang: "en",
this-key-is-not-in-config: "Ha Ha",
region: "en",
author: (
name: "Sven Vogel",
semester: 4,
program: "Informationtechnology",
course: "TINF19IT1",
faculty: "Technik",
university: "DHBW Mannheim",
company: "ABB AG",
supervisor: "Benny Goodman",
matriculation-number: 123456789,
),
thesis: (
title: "Unofficial ABB/DHBW Typst template",
subtitle: "for reports and thesises",
submission-date: "23rd march 2020",
timeframe: "1st january 2020 - 20th march 2020",
kind: "T2000",
summary: none,
abstract: none,
keywords: ("IT", "other stuff"),
bibliography: none,
glossary: none,
appendices: none,
),
))
= Heading

View File

@ -0,0 +1,26 @@
#import "../../src/lib.typ": dhbw-template
#show: dhbw-template.with((
lang: "en",
region: "en",
author: (
university: "DHBW Mannheim",
company: "ABB AG",
supervisor: none,
matriculation-number: 123456789,
),
thesis: (
title: "Unofficial ABB/DHBW Typst template",
subtitle: "for reports and thesises",
submission-date: "23rd march 2020",
timeframe: "1st january 2020 - 20th march 2020",
kind: "T2000",
summary: none,
abstract: none,
keywords: ("IT", "other stuff"),
bibliography: none,
glossary: none,
appendices: none,
),
))

View File

@ -0,0 +1,30 @@
#import "../../src/lib.typ": dhbw-template
#show: dhbw-template.with((
lang: "en",
region: "en",
author: (
name: "Sven Vogel",
semester: 4,
program: "Informationtechnology",
course: "TINF19IT1",
faculty: "Technik",
university: "DHBW Mannheim",
company: "ABB AG",
supervisor: "Benny Goodman",
matriculation-number: 123456789),
thesis: (
title: "Unofficial ABB/DHBW Typst template",
subtitle: "for reports and thesises",
submission-date: "23rd march 2020",
timeframe: "1st january 2020 - 20th march 2020",
kind: "T2000",
summary: none,
abstract: none,
keywords: ( "IT", "other stuff" ),
bibliography: none,
glossary: none,
appendices: none)))
= Heading