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
on:
push:
pull_request:
branches:
- main
on: [push]
jobs:
run-ci-linux:
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:
- name: Check out repository code
uses: actions/checkout@v3
@ -25,9 +16,5 @@ jobs:
uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Stylecheck
run: nix-shell --run "./run-fmt.sh --check src/lib.typ"
- id: build
name: Build
run: |
nix-shell --run ./run-ci.sh
- name: Run CI
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:
push:
branches:
- main
tags:
- 'v*.*.*'
jobs:
build:
name: Check Template and Build example
release:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
@ -16,49 +15,16 @@ jobs:
uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Stylecheck
run: nix-shell --run "./run-fmt.sh --check src/lib.typ"
- 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: Run CI
run: nix-shell --run ./run-ci.sh
- name: Setup go
uses: actions/setup-go@v4
uses: https://github.com/actions/setup-go@v4
with:
go-version: '>=1.20.1'
- name: Download Artifcat
id: download
uses: actions/download-artifact@v3
- name: Create release
id: create-release
uses: https://gitea.com/actions/release-action@main
with:
name: example-document
path: ${{ github.workspace }}/Example.pdf
- name: 'Artifact Download Path'
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
files: |-
example.pdf
api_key: '${{secrets.RELEASE_TOKEN}}'

18
LICENSE
View File

@ -2,20 +2,8 @@ MIT License
Copyright (c) 2024 Sven Vogel
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:
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:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
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.
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.

View File

@ -75,78 +75,31 @@ The default configuration can be found in `src/conf.typ`.
#import "src/lib.typ": *
#show: dhbw-template.with((
// language settings used to make decisions about hyphenation and others
lang: "en", // ISO 3166 language code of text: "de", "en"
region: "en", // region code
// mark this thesis as draft
// Adds preleminarry note page and watermark
draft: true,
// information about author(s)
university: (
lang: "en",
region: "en",
author: (
name: "Sven Vogel",
semester: 4,
program: "Informationtechnology",
course: "TINF19IT1",
faculty: "Technik",
name: "dualen Hochschule Baden-Württemberg",
campus: "Eppelheim"
),
authors: (
(
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
university: "DHBW Mannheim",
company: "ABB AG",
supervisor: "Benny Goodman",
matriculation-number: 123456789),
thesis: (
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",
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,
summary: summary,
abstract: abstract,
preface: include "preface.typ",
keywords: ( "IT", "other stuff" ),
bibliography: none /* bibliography("refs.bib") */,
glossary: none,
appendices: none),
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)))
bibliography: bibliography("refs.bib"),
glossary: yaml("glossary.yml"),
appendices: include "appendix.typ")))
// Your document code goes here!
@ -178,10 +131,9 @@ Complies with ABB branding guidelines such as:
## 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:
- [Fira Sans](https://github.com/bBoxType/FiraSans)
- [Fira Math](https://github.com/firamath/firamath)
- [Fira Code NF](https://www.nerdfonts.com/font-downloads)
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:
- [Montserrat](https://fonts.google.com/specimen/Montserrat)
- [Open Sans](https://fonts.google.com/specimen/Open+Sans)
Consider giving the creators of the font credit for their amazing work!

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
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
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 = []; };
in

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -13,7 +13,7 @@
#let render_filtered_outline(title: str, kind: selector) = (
context {
let elems = query(figure.where(kind: kind))
let elems = query(figure.where(kind: kind), here())
let count = elems.len()
show outline.entry: it => {

View File

@ -10,55 +10,39 @@
context [
#let thesis = config.thesis
// 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))
})
#let author = config.author
#set align(center)
// title
#v(2cm)
#par(justify: false, leading: 1.5em)[
#text(size: 2em, weight: "bold", hyphenate: false, thesis.title)
#linebreak()
// subtitle
#text(size: 2em, weight: "light", thesis.subtitle)
]
#set par(justify: false)
#text(size: 2em, weight: "semibold", hyphenate: false, thesis.title)
#set align(center + horizon)
// subtitle
#text(size: 1.5em, thesis.subtitle)
// type of paper
#text(size: 1.5em, weight: "medium", thesis.kind)
#v(1cm)
#text(size: 1.5em, weight: "bold", thesis.kind)
// faculty
#pad()[
#pad(top: 0.5cm)[
#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" [
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 [
#context panic("no translation for language: ", text.lang)
]
]
// university
#pad()[
#pad(top: 0.5cm)[
#if text.lang == "de" [
an der
] else if text.lang == "en" [
@ -66,82 +50,41 @@
] else [
#context panic("no translation for language: ", text.lang)
]
#config.university.name
#linebreak()
#config.university.campus
#author.university
]
#pad(top: 1em)[
#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)
#set align(horizon + left)
#if text.lang == "de" [
#grid(
#table(
columns: 2,
column-gutter: 1cm,
row-gutter: 0.5cm,
align: top + left,
align: left,
stroke: none,
[Matrikelnummer, Kurs:],
par(
leading: 0.5em,
for author in config.authors {
str(author.matriculation-number) + ", " + author.course
linebreak()
},
),
[*Verfasser:*], author.name,
[*Bearbeitungszeitraum:*], thesis.timeframe,
[*Matrikelnummer, Kurs:*],
str(author.matriculation-number) + ", " + author.course,
[Betrieb, Betreuer:],
par(
leading: 0.5em,
for author in config.authors {
author.company + ", " + author.supervisor
linebreak()
},
),
[*Ausbildungsbetrieb:*], author.company,
[*Betrieblicher Betreuer:*], author.supervisor,
[*Abgabedatum:*], thesis.submission-date,
)
] else if text.lang == "en" [
#grid(
#table(
columns: 2,
column-gutter: 1cm,
row-gutter: 0.5cm,
align: top + left,
align: left,
stroke: none,
[Student ID, Course:],
par(
leading: 0.5em,
for author in config.authors {
str(author.matriculation-number) + ", " + author.course
linebreak()
},
),
[*Author:*], author.name,
[*Editing period:*], thesis.timeframe,
[*Matriculation number, course:*],
str(author.matriculation-number) + ", " + author.course,
[Company, Supervisor:],
par(
leading: 0.5em,
for author in config.authors {
author.company + ", " + author.supervisor
linebreak()
},
),
[*Training company:*], author.company,
[*Company supervisor:*], author.supervisor,
[*Submission date:*], thesis.submission-date,
)
] else [
#context panic("no translation for language: ", text.lang)

View File

@ -75,7 +75,7 @@
show heading: set text(
font: style.heading.font,
weight: "bold",
weight: "semibold",
)
let header-supplement = if config.lang == "de" {
@ -87,7 +87,6 @@
set heading(supplement: [#header-supplement])
set math.equation(numbering: "(1)")
show math.equation: set text(font: "Fira Math", size: 12pt)
// Set header spacing
show heading.where(level: 1): it => v(2em) + it + v(1em)
@ -183,8 +182,8 @@
// based on: https://github.com/typst/typst/discussions/3871
show figure.caption: c => [
#if c.body.fields().len() > 0 {
text(weight: "medium")[
#c.supplement #context c.counter.display("1.1.1")
text(weight: "semibold")[
#c.supplement #c.counter.display("1.1.1")
]
c.separator
}
@ -294,7 +293,15 @@
let current-page = here().page()
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>)
.first()

View File

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