Compare commits

..

No commits in common. "main" and "v0.2.0" have entirely different histories.
main ... v0.2.0

39 changed files with 1147 additions and 1389 deletions

View File

@ -5,16 +5,15 @@ on: [push]
jobs: jobs:
run-ci-linux: run-ci-linux:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
TYPST_INSTALL: /usr/local
TYPST_VERSION: 0.11.1
steps: steps:
- name: Check out repository code - name: Check out repository code
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Install dependencies for Nix setup action - name: Install Typst CLI
run: | run: curl -fsSL https://typst.community/typst-install/install.sh | sh -s "$TYPST_VERSION"
apt update -y - name: Set up Python 3
apt install sudo -y run: apt update -y && apt install python3-pip -y
- name: Setup Nix
uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Run CI - name: Run CI
run: nix-shell --run ./run-ci.sh run: bash -c ./run-ci.sh

View File

@ -1,31 +1,28 @@
name: release name: release
on: on:
push: push:
tags: tags:
- 'v*.*.*' - '*'
jobs: jobs:
release: release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check out repository code - uses: actions/checkout@v3
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: with:
nix_path: nixpkgs=channel:nixos-unstable fetch-depth: 0
- name: Install Typst CLI
run: curl -fsSL https://typst.community/typst-install/install.sh | sh -s "$TYPST_VERSION"
- name: Set up Python 3
run: apt update -y && apt install python3-pip -y
- name: Run CI - name: Run CI
run: nix-shell --run ./run-ci.sh run: bash -c ./run-ci.sh
- name: Setup go - name: Setup go
uses: https://github.com/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: 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
with: with:

View File

@ -1,16 +0,0 @@
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,30 +0,0 @@
name: release
on:
push:
tags:
- 'v*.*.*'
jobs:
release:
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
- 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}}'

114
README.md
View File

@ -1,41 +1,15 @@
<div align="center"> # DHBW-ABB Typst template 📃
<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/github/actions/workflow/status/Servostar/dhbw-abb-typst-template/ci.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/badge/license-MIT-ff0000">
<img src="https://img.shields.io/badge/Typst-2B9CB0">
<img src="https://img.shields.io/gitea/languages/count/dhbw/dhbw-abb-typst-template?gitea_url=https%3A%2F%2Fgit.montehaselino.de">
<br>
<br>
<b>Unofficial</b> but feature rich Typst template for writing a thesis or report at DHBW<br>
with according ABB AG branding in mind.
<br>
<br>
<img width="1000pt" src="./assets/banner.png">
</div>
## Table of Contents ![last-commit-bade](https://img.shields.io/gitea/last-commit/dhbw/dhbw-abb-typst-template?gitea_url=https%3A%2F%2Fgit.montehaselino.de)
![release-badge](https://img.shields.io/gitea/v/release/dhbw/dhbw-abb-typst-template?gitea_url=https%3A%2F%2Fgit.montehaselino.de&display_name=release)
![typst-badge](https://img.shields.io/badge/Typst-2B9CB0)
![language-count-badge](https://img.shields.io/gitea/languages/count/dhbw/dhbw-abb-typst-template?gitea_url=https%3A%2F%2Fgit.montehaselino.de)
![license-badge](https://img.shields.io/badge/license-MIT-ff0000)
1. [Contribution](#contribution) **Unofficial** but feature rich Typst template for writing a thesis or report at DHBW with according ABB AG branding in mind.
1. [Features](#features)
2. [Usage](#usage)
2. [Preview of pages](#preview)
3. [Relation to DHBW docx template](#dhbw-docx-template)
4. [Format and branding conformance](#format)
5. [Fonts](#fonts)
6. [Legal](#legal)
7. [For LaTeX users](#for-users-jumping-over-from-latex)
8. [FAQ](#faq)
1. [Typst vs LaTeX](#why-typst-instead-of-latex)
2. [Source of logos](#where-are-the-logos-from)
## Contribution ![thumbnail](https://git.montehaselino.de/DHBW/dhbw-abb-typst-template/raw/commit/cd325b7076da91e58849512539460a481e48ef4e/assets/thumbnail.png)
> ⚠️ **Important** <br>
> Development happens at an external site [here](https://git.montehaselino.de/DHBW/dhbw-abb-typst-template).
> The GitHub repository is only a push mirror, but issues are still welcome at any time!
## Features ## Features
@ -45,78 +19,6 @@
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.
A short overview of all features the template is capable of:
- Acronyms
- Glossary
- Table of Contents for: headings, figures, tables and listings and appendecis
- Appendix
- Extra page for:
- Declaration of Authorship
- Confidentiality Statement
- Preleminary notice
- Watermark for draft versions
- Automatic form filling for data provided via configuration
- Styles for captions, tables and equations
- ABB branding inspired code theme
## Preview
![](./assets/page-preview.png)
## Usage
### Without Typst package manager
Clone the repository into a subfolder of your project or add it a git submodule. The you can import the `lib.typ` file from `src`.
Once thats done calling the following snippet `#show: dhbw-template.with(conf)` will setup the template. You can provide a configuration for the template to use.
The default configuration can be found in `src/conf.typ`.
```typst
#import "src/lib.typ": *
#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: summary,
abstract: abstract,
preface: include "preface.typ",
keywords: ( "IT", "other stuff" ),
bibliography: bibliography("refs.bib"),
glossary: yaml("glossary.yml"),
appendices: include "appendix.typ")))
// Your document code goes here!
= Introduction
lorem(50)
= Chapter 1
#lorem(230)
```
## DHBW DOCX template
The official [DHBW template for Word](https://blog.fakultaet-technik.de/wp-content/uploads/2015/06/Studienarbeitsvorlage.docx) was used a strong inspiration but not as base template.
## Format ## Format
All pages have a margin of 2.5cm between header/footer/content and the page border. All pages have a margin of 2.5cm between header/footer/content and the page border.
Header and footer do not overlap into this margin in order to conform to university requirements. Header and footer do not overlap into this margin in order to conform to university requirements.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 MiB

20
base16/abb.yml Normal file
View File

@ -0,0 +1,20 @@
# Base16 ABB branded color scheme
scheme-author: "Sven Vogel"
scheme-slug: "abb-base16"
scheme-name: "ABB Base16"
base00: "ffffff" # Default Background
base01: "fafafa" # Lighter Background
base02: "f0f0f0" # Selection Background
base03: "6e6e6e" # Comments, Invisibles, Line Highlighting
base04: "000000" # Dark Foreground
base05: "000000" # Default Foreground, Caret, Delimiters, Operators
base06: "fafafa" # Light Foreground (Not often used)
base07: "fafafa" # Light Background (Not often used)
base08: "262626" # Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted
base09: "004c97" # Integers, Boolean, Constants, XML Attributes, Markup Link Url
base0A: "ff000f" # Classes, Markup Bold, Search Text Background
base0B: "004c97" # Strings, Inherited Class, Markup Code, Diff Inserted
base0C: "262626" # Support, Regular Expressions, Escape Characters, Markup Quotes
base0D: "007a33" # Functions, Methods, Attribute IDs, Headings
base0E: "ff000f" # Keywords, Storage, Selector, Markup Italic, Diff Changed
base0F: "6e6e6e" # Deprecated, Opening/Closing Embedded Language Tags

30
base16/generator.py Normal file
View File

@ -0,0 +1,30 @@
import yaml
import logging
import sys
import re
global data
def replace_tag(match):
return data[match.group(1)]
if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
logger = logging.getLogger()
with open(sys.argv[1], 'r') as file:
data = yaml.safe_load(file)
content = ""
with open(sys.argv[2], "r") as file:
logger.info(f"opened file: {sys.argv[2]}")
content = file.read()
logger.info(f"read file: {sys.argv[2]}")
logger.info(f"converting...")
content = re.sub("\\{\\{([a-z0-9-]+)\\}\\}", replace_tag, content, 0, re.IGNORECASE)
with open(sys.argv[3], "w") as file:
logger.info(f"writing changes...")
file.write(content)

1
base16/requirements.txt Normal file
View File

@ -0,0 +1 @@
pyyaml

561
base16/template.tmTheme Normal file
View File

@ -0,0 +1,561 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>author</key>
<string>Template: Chris Kempson, Scheme: {{scheme-author}}</string>
<key>name</key>
<string>Base16 {{scheme-name}}</string>
<key>semanticClass</key>
<string>theme.base16.{{scheme-slug}}</string>
<key>colorSpaceName</key>
<string>sRGB</string>
<key>gutterSettings</key>
<dict>
<key>background</key>
<string>#{{base01}}</string>
<key>divider</key>
<string>#{{base01}}</string>
<key>foreground</key>
<string>#{{base03}}</string>
<key>selectionBackground</key>
<string>#{{base02}}</string>
<key>selectionForeground</key>
<string>#{{base04}}</string>
</dict>
<key>settings</key>
<array>
<dict>
<key>settings</key>
<dict>
<key>background</key>
<string>#{{base00}}</string>
<key>caret</key>
<string>#{{base05}}</string>
<key>foreground</key>
<string>#{{base05}}</string>
<key>invisibles</key>
<string>#{{base03}}</string>
<key>lineHighlight</key>
<string>#{{base03}}55</string>
<key>selection</key>
<string>#{{base02}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Text</string>
<key>scope</key>
<string>variable.parameter.function</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#{{base05}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Comments</string>
<key>scope</key>
<string>comment, punctuation.definition.comment</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#{{base03}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Punctuation</string>
<key>scope</key>
<string>punctuation.definition.string, punctuation.definition.variable, punctuation.definition.string, punctuation.definition.parameters, punctuation.definition.string, punctuation.definition.array</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#{{base05}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Delimiters</string>
<key>scope</key>
<string>none</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#{{base05}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Operators</string>
<key>scope</key>
<string>keyword.operator</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#{{base05}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Keywords</string>
<key>scope</key>
<string>keyword</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#{{base0E}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Variables</string>
<key>scope</key>
<string>variable</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#{{base08}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Functions</string>
<key>scope</key>
<string>entity.name.function, meta.require, support.function.any-method, variable.function, variable.annotation, support.macro</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#{{base0D}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Labels</string>
<key>scope</key>
<string>entity.name.label</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#{{base0F}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Classes</string>
<key>scope</key>
<string>support.class, entity.name.class, entity.name.type.class</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#{{base0A}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Classes</string>
<key>scope</key>
<string>meta.class</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#{{base07}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Methods</string>
<key>scope</key>
<string>keyword.other.special-method</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#{{base0D}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Storage</string>
<key>scope</key>
<string>storage</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#{{base0E}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Support</string>
<key>scope</key>
<string>support.function</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#{{base0C}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Strings, Inherited Class</string>
<key>scope</key>
<string>string, constant.other.symbol, entity.other.inherited-class</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#{{base0B}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Integers</string>
<key>scope</key>
<string>constant.numeric</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#{{base09}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Floats</string>
<key>scope</key>
<string>none</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#{{base09}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Boolean</string>
<key>scope</key>
<string>none</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#{{base09}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Constants</string>
<key>scope</key>
<string>constant</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#{{base09}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Tags</string>
<key>scope</key>
<string>entity.name.tag</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#{{base08}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Attributes</string>
<key>scope</key>
<string>entity.other.attribute-name</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#{{base09}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Attribute IDs</string>
<key>scope</key>
<string>entity.other.attribute-name.id, punctuation.definition.entity</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#{{base0D}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Selector</string>
<key>scope</key>
<string>meta.selector</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#{{base0E}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Values</string>
<key>scope</key>
<string>none</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#{{base09}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Headings</string>
<key>scope</key>
<string>markup.heading punctuation.definition.heading, entity.name.section</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#{{base0D}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Units</string>
<key>scope</key>
<string>keyword.other.unit</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#{{base09}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Bold</string>
<key>scope</key>
<string>markup.bold, punctuation.definition.bold</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>bold</string>
<key>foreground</key>
<string>#{{base0A}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Italic</string>
<key>scope</key>
<string>markup.italic, punctuation.definition.italic</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>italic</string>
<key>foreground</key>
<string>#{{base0E}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Code</string>
<key>scope</key>
<string>markup.raw.inline</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#{{base0B}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Link Text</string>
<key>scope</key>
<string>string.other.link, punctuation.definition.string.end.markdown, punctuation.definition.string.begin.markdown</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#{{base08}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Link Url</string>
<key>scope</key>
<string>meta.link</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#{{base09}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Lists</string>
<key>scope</key>
<string>markup.list</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#{{base08}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Quotes</string>
<key>scope</key>
<string>markup.quote</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#{{base09}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Separator</string>
<key>scope</key>
<string>meta.separator</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#{{base02}}</string>
<key>foreground</key>
<string>#{{base05}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Inserted</string>
<key>scope</key>
<string>markup.inserted</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#{{base0B}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Deleted</string>
<key>scope</key>
<string>markup.deleted</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#{{base08}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Changed</string>
<key>scope</key>
<string>markup.changed</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#{{base0E}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Colors</string>
<key>scope</key>
<string>constant.other.color</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#{{base0C}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Regular Expressions</string>
<key>scope</key>
<string>string.regexp</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#{{base0C}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Escape Characters</string>
<key>scope</key>
<string>constant.character.escape</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#{{base0C}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Embedded</string>
<key>scope</key>
<string>punctuation.section.embedded, variable.interpolation</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#{{base0E}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Illegal</string>
<key>scope</key>
<string>invalid.illegal</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#{{base08}}</string>
<key>foreground</key>
<string>#{{base07}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Broken</string>
<key>scope</key>
<string>invalid.broken</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#{{base09}}</string>
<key>foreground</key>
<string>#{{base00}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Deprecated</string>
<key>scope</key>
<string>invalid.deprecated</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#{{base0F}}</string>
<key>foreground</key>
<string>#{{base07}}</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Unimplemented</string>
<key>scope</key>
<string>invalid.unimplemented</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#{{base03}}</string>
<key>foreground</key>
<string>#{{base07}}</string>
</dict>
</dict>
</array>
<key>uuid</key>
<string>uuid</string>
</dict>
</plist>

0
generate-theme.sh Executable file → Normal file
View File

View File

@ -25,29 +25,19 @@ function enter-section() {
printf "\\n" printf "\\n"
eval "$2" eval "$2"
exit_status=$? if [ $? -neq $3 ]; then
abort "command: $2 failed in section: $1"
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 fi
printf "\\n" printf "\\n"
log "INFO" "section $1 completed successfully" log "INFO" "section $1 completed successfully"
} }
enter-section "Typstyle checking" "./run-fmt.sh --check src/lib.typ" 0 enter-section "BUILD: ABB code theme" "./generate-theme.sh" 0
enter-section "Compiling template..." "typst compile template/main.typ --root . example.pdf" enter-section "Compiling template..." "typst compile template/main.typ --root . example.pdf" 0
enter-section "TEST: local template import" "typst compile tests/local-import/main.typ --root ." enter-section "TEST: local template import" "typst compile tests/local-import/main.typ --root ." 0
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 1" "typst compile tests/invalid-config/test-case-1.typ --root ." 1
enter-section "TEST: invalid config case 2" "typst compile tests/invalid-config/test-case-2.typ --root ." enter-section "TEST: invalid config case 2" "compile tests/invalid-config/test-case-2.typ" 0
enter-section "TEST: invalid config case 3" "typst compile tests/invalid-config/test-case-3.typ --root ." "should fail" enter-section "TEST: invalid config case 3" "typst compile tests/invalid-config/test-case-3.typ --root ." 1
log "INFO" "CI completed successfully" log "INFO" "CI completed successfully"

View File

@ -1,42 +0,0 @@
#!/bin/bash
function format() {
# format file
# typstyle --format $1
if [ -z "$1" ]; then
return
fi
local wd=$(dirname $(realpath "$1"))
echo "processing file $1..."
typstyle "$2" "$1" > /dev/null
if [ $? -eq 1 ]; then
echo "failed format validation: $1"
exit 1
fi
local imports=$(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 <<< "$imports"
}
case $1 in
"--format")
format "$2" "--inplace"
;;
"--check")
format "$2" "--check"
;;
*)
echo "unknown option: $1"
exit 1
;;
esac

View File

@ -1,13 +0,0 @@
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
];
}

View File

@ -1,18 +0,0 @@
// Reference color scheme can be found here:
// https://brand.abb/portal/en/branding-principles/basic-brand-elements/color
// ABB branding colors
#let ABB-RED = cmyk(0%, 100%, 95%, 0%)
#let ABB-BLACK = cmyk(0%, 0%, 0%, 100%)
#let ABB-GRAY-01 = cmyk(0%, 0%, 0%, 90%)
#let ABB-GRAY-02 = cmyk(0%, 0%, 0%, 75%)
#let ABB-GRAY-03 = cmyk(0%, 0%, 0%, 55%)
#let ABB-GRAY-04 = cmyk(0%, 0%, 0%, 35%)
#let ABB-GRAY-05 = cmyk(0%, 0%, 0%, 15%)
#let ABB-GRAY-06 = cmyk(0%, 0%, 0%, 5%)
#let ABB-WHITE = cmyk(0%, 0%, 0%, 0%)
// ABB branding functinal colors
#let ABB-BLUE = cmyk(100%, 53%, 2%, 16%)
#let ABB-GREEN = cmyk(91%, 4%, 100%, 25%)
#let ABB-YELLOW = cmyk(0%, 9%, 100%, 0%)

View File

@ -7,8 +7,6 @@
// Edited: 27.06.2024 // Edited: 27.06.2024
// License: MIT // License: MIT
#import "branding.typ": *
// 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
@ -53,23 +51,17 @@
page: ( page: (
format: "a4", format: "a4",
margin: ( margin: (
left: 3cm, left: 3cm,
right: 2.5cm, right: 2.5cm,
top: 2.5cm, top: 2.5cm,
bottom: 2.5cm)), bottom: 2.5cm)),
text: ( text: (
size: 12pt, size: 12pt,
font: "Open Sans"), font: "Open Sans"),
heading: ( heading: (
font: "Montserrat"), font: "Montserrat"),
code: (
theme: "res/abb.tmTheme",
font: "FiraCode Nerd Font",
lines: false,
size: 10pt,
tab-size: 4),
link: ( link: (
color: ABB-GRAY-02))) color: red.darken(15%))))
// 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
@ -83,20 +75,20 @@
} }
for (key, val) in base { for (key, val) in base {
if key in update { if key in update {
let update_val = update.at(key) let update_val = update.at(key)
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)) 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 {
panic("missmatched dictionary entry `" + key + "` type: expected `" + type(val) + "` got `" + type(update_val) + "`")
}
} else { } else {
panic("missmatched dictionary entry `" + key + "` type: expected `" + type(val) + "` got `" + type(update_val) + "`") base.insert(key, val)
} }
} else {
base.insert(key, val)
} }
}
return base return base
} }

View File

@ -1,255 +0,0 @@
// .--------------------------------------------------------------------------.
// | Glossarium@4.1.0 with custom format |
// '--------------------------------------------------------------------------'
// Authors: ENIB-Community
// Changed: Sven Vogel
// Edited: 08.07.2024
// License: MIT
// Customized version of https://github.com/ENIB-Community/glossarium/tree/release-0.4.1
// in order to conform to DHBW requirements in terms of format
/* 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.*/
// glossarium figure kind
#let __glossarium_figure = "glossarium_entry"
// prefix of label for references query
#let __glossary_label_prefix = "glossary:"
// global state containing the glossary entry and their location
#let __glossary_entries = state("__glossary_entries", (:))
#let __glossarium_error_prefix = "glossarium error : "
#let __query_labels_with_key(loc, key, before: false) = {
if before {
query(
selector(label(__glossary_label_prefix + key)).before(
loc,
inclusive: false,
),
loc,
)
} else {
query(selector(label(__glossary_label_prefix + key)), loc)
}
}
// key not found error
#let __not-found-panic-error-msg(key) = {
__glossarium_error_prefix + "key '" + key + "' not found"
}
// Reference a term
#let gls(key, suffix: none, long: none, display: none) = {
context {
let __glossary_entries = __glossary_entries.final(here())
if key in __glossary_entries {
let entry = __glossary_entries.at(key)
let gloss = __query_labels_with_key(here(), key, before: true)
let is_first = gloss == ()
let entlong = entry.at("long", default: "")
let textLink = if display != none {
[#display]
} else if (
is_first or long == true
) and entlong != [] and entlong != "" and long != false {
[#entlong (#entry.short#suffix)]
} else {
[#entry.short#suffix]
}
[#link(
label(entry.key),
textLink,
)#label(__glossary_label_prefix + entry.key)]
} else {
panic(__not-found-panic-error-msg(key))
}
}
}
// Reference to term with pluralisation
#let glspl(key, long: none) = {
let suffix = "s"
context {
let __glossary_entries = __glossary_entries.final(here())
if key in __glossary_entries {
let entry = __glossary_entries.at(key)
let gloss = __query_labels_with_key(here(), key, before: true)
let is_first = gloss == ()
let entlongplural = entry.at("longplural", default: "")
let entlong = if entlongplural == [] or entlongplural == "" {
// if the entry long plural is not provided, then fallback to adding 's' suffix
let entlong = entry.at("long", default: "")
if entlong != [] and entlong != "" {
[#entlong#suffix]
} else {
entlong
}
} else {
[#entlongplural]
}
let entplural = entry.at("plural", default: "")
let short = if entplural == [] or entplural == "" {
[#entry.short#suffix]
} else {
[#entplural]
}
let textLink = if (
is_first or long == true
) and entlong != [] and entlong != "" and long != false {
[#entlong (#short)]
} else {
[#short]
}
[#link(
label(entry.key),
textLink,
)#label(__glossary_label_prefix + entry.key)]
} else {
panic(__not-found-panic-error-msg(key))
}
}
}
// show rule to make the references for glossarium
#let make-glossary(body) = {
show ref: r => {
if r.element != none and r.element.func() == figure and r
.element
.kind == __glossarium_figure {
// call to the general citing function
gls(str(r.target), suffix: r.citation.supplement)
} else {
r
}
}
body
}
#let __normalize-entry-list(entry_list) = {
let new-list = ()
for entry in entry_list {
new-list.push((
key: entry.key,
short: entry.short,
plural: entry.at("plural", default: ""),
long: entry.at("long", default: ""),
longplural: entry.at("longplural", default: ""),
desc: entry.at("desc", default: ""),
group: entry.at("group", default: ""),
))
}
return new-list
}
#let print-glossary(
entry_list,
show-all: false,
disable-back-references: false,
enable-group-pagebreak: false,
) = {
let entries = __normalize-entry-list(entry_list)
__glossary_entries.update(x => {
for entry in entry_list {
x.insert(entry.key, entry)
}
x
})
let groups = entries.map(x => x.at("group")).dedup()
for group in groups.sorted() {
if group != "" [#heading(group, level: 1, outlined: false) ]
for entry in entries.sorted(key: x => x.key) {
if entry.group == group {
[
#show figure.where(kind: __glossarium_figure): it => it.caption
#figure(
supplement: "",
kind: __glossarium_figure,
numbering: none,
caption: {
context {
let key = if entry.key.ends-with("__glossary_entry") {
entry.key.replace("__glossary_entry", "")
} else {
entry.key
}
let term_references = __query_labels_with_key(here(), key)
if term_references.len() != 0 or show-all [
#let desc = entry.at("desc", default: "")
#let long = entry.at("long", default: "")
#let hasLong = long != "" and long != []
#let hasDesc = desc != "" and desc != []
#block(
below: 1.5em,
par(hanging-indent: 1em)[
#text(weight: "bold", entry.short)
#if hasLong and hasDesc [
(#text(entry.long))
] else if hasLong {
text(entry.long)
}
#if hasDesc [ #sym.dash.en ]
#if hasDesc [ #desc ]
#if disable-back-references != true {
term_references
.map(x => x.location())
.sorted(key: x => x.page())
.fold(
(values: (), pages: ()),
((values, pages), x) => if pages.contains(
x.page(),
) {
(values: values, pages: pages)
} else {
values.push(x)
pages.push(x.page())
(values: values, pages: pages)
},
)
.values
.map(x => {
let page-numbering = x.page-numbering()
if page-numbering == none {
page-numbering = "1"
}
link(x)[#numbering(
page-numbering,
..counter(page).at(x),
)]
}
)
.join(", ")
}
],
)
]
}
},
)[] #label(entry.key)
]
}
}
if enable-group-pagebreak {
pagebreak(weak: true)
}
}
};

View File

@ -1,100 +0,0 @@
// .--------------------------------------------------------------------------.
// | Glossary Utilities |
// '--------------------------------------------------------------------------'
// Author: Sven Vogel
// Edited: 08.07.2024
// License: MIT
#let glossary(entries, config) = {
assert(
type(entries) == dictionary,
message: "The glossary is not a dictionary",
)
let processed_glossary = (:)
for (k, v) in entries.pairs() {
assert(
type(v) == dictionary,
message: "The glossary entry `" + k + "` is not a dictionary",
)
for key in v.keys() {
assert(
key in ("short", "long", "desc", "group"),
message: "Found unexpected key `" + key + "` in glossary entry `" + k,
)
}
assert(
type(v.short) == str,
message: "The short form of glossary entry `" + k + "` is not a string",
)
if "long" in v {
assert(
type(v.long) == str,
message: "The long form of glossary entry `" + k + "` is not a string",
)
}
if "desc" in v {
assert(
type(v.desc) == str,
message: "The description of glossary entry `" + k + "` is not a string",
)
}
if "group" in v {
assert(
type(v.group) == str,
message: "The optional group of glossary entry `" + k + "` is not a string",
)
} else {
let acronym_group = if config.lang == "de" {
"Abkürzungsverzeichnis"
} else {
"List of Acronyms"
}
let glossary_group = if config.lang == "de" {
"Begriffe"
} else {
"Glossary"
}
let group = if "long" in v {
acronym_group
} else {
glossary_group
}
// create dedicated entries for
// acronym and glossary
if "long" in v and "desc" in v {
processed_glossary.insert(
k,
(short: v.short, long: v.long, group: acronym_group),
)
processed_glossary.insert(
k + "__glossary_entry",
(short: v.short, desc: v.desc, long: v.long, group: glossary_group),
)
} else {
processed_glossary.insert(k, v)
processed_glossary.at(k).group = group
}
}
}
return processed_glossary.pairs().map(((key, entry)) => (
key: key,
short: entry.short,
long: eval(entry.at("long", default: ""), mode: "markup"),
desc: eval(entry.at("desc", default: ""), mode: "markup"),
group: entry.at("group", default: ""),
))
}

View File

@ -7,57 +7,16 @@
// Edited: 27.06.2024 // Edited: 27.06.2024
// License: MIT // License: MIT
#import "conf.typ": validate-config, default-config #import "conf.typ": validate-config
#import "branding.typ": * #import "style.typ": global_styled_doc, content_styled, end_styled
#import "style.typ": global_styled_doc, content_styled, end_styled #import "pages/titlepage.typ": new_title_page
#import "glossary.typ": glossary #import "pages/declaration-of-authorship.typ": new_declaration_of_authorship
#import "pages/titlepage.typ": new_title_page #import "pages/confidentiality-statement.typ": new_confidentiality_statement_page
#import "pages/declaration-of-authorship.typ": new_declaration_of_authorship #import "pages/prerelease-note.typ": new_prerelease_note
#import "pages/confidentiality-statement.typ": new_confidentiality_statement_page #import "pages/outline.typ": new_outline
#import "pages/prerelease-note.typ": new_prerelease_note #import "pages/abstract.typ": new_abstract
#import "pages/outline.typ": new_outline #import "pages/preface.typ": new-preface
#import "pages/abstract.typ": new_abstract #import "pages/appendix.typ": show-appendix
#import "pages/preface.typ": new-preface
#import "pages/appendix.typ": show-appendix
#let group-break() = {
[#pagebreak()]
}
#let inline-color(color, content) = {
box(
stroke: 1pt + ABB-GRAY-05,
radius: 2pt,
inset: (left: 2pt, right: 2pt),
outset: (top: 4pt, bottom: 4pt),
fill: ABB-GRAY-06,
[#box(
fill: rgb(color),
radius: 2pt,
inset: 0pt,
width: 0.75em,
height: 0.75em,
) #text(
font: default-config.style.code.font,
size: default-config.style.code.size,
content,
)],
)
}
#let url(label, content) = {
link(label)[#underline(
offset: 2pt,
stroke: 0.5pt + blue,
text(fill: blue)[
#content
#let domain = label.find(regex("\w+\.\w+(?:\.\w+)*"))
#if domain.len() > 0 [
(#domain)
]
],
)]
}
// start of template pages and styles // start of template pages and styles
#let dhbw-template(config, body) = [ #let dhbw-template(config, body) = [
@ -71,14 +30,12 @@
#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)
)
// configure text locale // configure text locale
#set text( #set text(
lang: config.lang, lang: config.lang,
region: config.region, region: config.region)
)
// preppend title page // preppend title page
#new_title_page(config) #new_title_page(config)
@ -94,23 +51,20 @@
#new-preface(config) #new-preface(config)
#new_outline() #new_outline()
// glossary is built inline here because the links must be // glossary is built inline here because the links must be
// exposed to the entire document // exposed to the entire document
#import "glossarium.typ": * #import "@preview/glossarium:0.4.1": make-glossary, print-glossary
#show: make-glossary #show: make-glossary
#pagebreak(weak: true) #pagebreak(weak: true)
#if "glossary" in config.thesis and config.thesis.glossary != none { #if "glossary" in config.thesis and config.thesis.glossary != none {
print-glossary( heading(supplement: [outline], "Glossar")
show-all: false,
disable-back-references: true, print-glossary(config.thesis.glossary)
enable-group-pagebreak: true,
glossary(config.thesis.glossary, config),
)
pagebreak(weak: true) pagebreak(weak: true)
} }
#counter(page).update(1) #counter(page).update(1)
// mark end of prelude // mark end of prelude
@ -133,4 +87,4 @@
#show-appendix(config: config) #show-appendix(config: config)
] ]
] ]
] ]

View File

@ -6,24 +6,22 @@
// Edited: 28.06.2024 // Edited: 28.06.2024
// License: MIT // License: MIT
#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
if text.lang == "de" [
// Summary is supposed to be on separate page
#pagebreak(weak: true)
// only include summary when a language other than english is used = Zusammenfassung
if text.lang == "de" [ #config.thesis.summary
// Summary is supposed to be on separate page ]
#pagebreak(weak: true)
= Zusammenfassung // abstract is supposed to be on separate page
#config.thesis.summary pagebreak(weak: true)
]
// abstract is supposed to be on separate page heading("Abstract")
pagebreak(weak: true) config.thesis.abstract
}
heading("Abstract")
config.thesis.abstract
}
)

View File

@ -6,41 +6,37 @@
// Edited: 28.06.2024 // Edited: 28.06.2024
// License: MIT // License: MIT
#let show-appendix(config: dictionary) = ( #let show-appendix(config: dictionary) = context {
context { counter(heading).update(0)
counter(heading).update(0)
let title = if text.lang == "en" { let title = if text.lang == "en" {
"Appendix" "Appendix"
} else { } else {
"Anhang" "Anhang"
}
if "appendices" in config.thesis {
pagebreak(weak: true)
// appendix will be invisible on the appendecies page
// but still listed in the ToC
show heading: it => []
heading(level: 1, numbering: none, title)
// APA style appendix
show heading: it => {
let number = if it.numbering != none {
counter(heading).display(it.numbering)
}
block()[
#title #number - #it.body
]
}
show heading.where(level: 1): it => v(2em) + it + v(1em)
show heading.where(level: 2): it => v(1em) + it + v(0.5em)
show heading.where(level: 3): it => v(0.5em) + it + v(0.25em)
set heading(numbering: "A.1", supplement: title)
config.thesis.appendices
}
} }
)
if "appendices" in config.thesis {
pagebreak(weak: true)
heading(level: 1, numbering: none, title)
v(-2em)
// APA style appendix
show heading: it => {
let number = if it.numbering != none {
counter(heading).display(it.numbering)
}
block()[
#title #number - #it.body
]
}
show heading.where(level: 1): it => v(2em) + it + v(1em)
show heading.where(level: 2): it => v(1em) + it + v(0.5em)
show heading.where(level: 3): it => v(0.5em) + it + v(0.25em)
set heading(numbering: "A.1", supplement: title)
config.thesis.appendices
}
}

View File

@ -6,52 +6,51 @@
// Edited: 28.06.2024 // Edited: 28.06.2024
// License: MIT // License: MIT
#let new_confidentiality_statement_page(config) = ( #let new_confidentiality_statement_page(config) = context {
context {
pagebreak(weak: true) pagebreak(weak: true)
let thesis = config.thesis let thesis = config.thesis
let author = config.author let author = config.author
if text.lang == "de" [ if text.lang == "de" [
#heading(level: 1, "Sperrvermerk") #heading(level: 1, "Sperrvermerk", supplement: [special])
] else if text.lang == "en" [ ] else if text.lang == "en" [
#heading(level: 1, "Confidentiality Statement") #heading(level: 1, "Confidentiality Statement", supplement: [special])
] ]
if text.lang == "de" [ if text.lang == "de" [
Der Inhalt dieser Arbeit mit dem Thema Der Inhalt der dieser Arbeit mit dem Thema
] else if text.lang == "en" [ ] else if text.lang == "en" [
The content of this work with the topic The content of this work with the topic
] ]
v(1em) v(1em)
set align(center) set align(center)
text(weight: "bold", thesis.title) text(weight: "bold", thesis.title)
if thesis.subtitle != none { if thesis.subtitle != none {
linebreak() linebreak()
thesis.subtitle thesis.subtitle
} }
set align(left) set align(left)
v(1em) v(1em)
set par(justify: true) set par(justify: true)
if text.lang == "de" [ if text.lang == "de" [
darf weder als Ganzes noch in Auszügen Personen außerhalb des Prüfungsprozesses und des Evaluationsverfahrens zugänglich gemacht werden, sofern keine anderslautende Genehmigung der Ausbildungsstätte vorliegt. darf weder als Ganzes noch in Auszügen Personen außerhalb des Prüfungsprozesses und des Evalua-tionsverfahrens zugänglich gemacht werden, sofern keine anderslautende Genehmigung der Ausbildungsstätte vorliegt.
] else if text.lang == "en" [ ] else if text.lang == "en" [
may not be made accessible to persons outside the examination process and the evaluation procedure, either as a whole or in excerpts, unless otherwise authorized by the training institution. may not be made accessible to persons outside the examination process and the evaluation procedure, either as a whole or in excerpts, unless otherwise authorized by the training institution.
] ]
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%),
@ -60,5 +59,4 @@
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(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) })) align(left, if text.lang == "de" [ Unterschrift ] else if text.lang == "en" [ Signature ] else { panic("no translation for language: ", text.lang) }))
} }
)

View File

@ -6,54 +6,53 @@
// Edited: 28.06.2024 // Edited: 28.06.2024
// License: MIT // License: MIT
#let new_declaration_of_authorship(config) = ( #let new_declaration_of_authorship(config) = context {
context {
pagebreak(weak: true) pagebreak(weak: true)
let thesis = config.thesis let thesis = config.thesis
let author = config.author let author = config.author
if text.lang == "de" [ if text.lang == "de" [
#heading("Selbständigkeitserklärung") #heading("Selbständigkeitserklärung")
] else if text.lang == "en" [ ] else if text.lang == "en" [
#heading("Declaration of Authorship") #heading("Declaration of Authorship")
] ]
v(1em) v(1em)
if text.lang == "de" [ if text.lang == "de" [
Ich versichere hiermit, dass ich meine Prüfung mit dem Thema Ich versichere hiermit, dass ich meine Prüfung mit dem Thema
] else if text.lang == "en" [ ] else if text.lang == "en" [
I hereby confirm that I have written this thesis with the subject I hereby confirm that I have written this thesis with the subject
] ]
v(1em) v(1em)
set align(center) set align(center)
text(weight: "bold", thesis.title) text(weight: "bold", thesis.title)
if thesis.subtitle != none { if thesis.subtitle != none {
linebreak() linebreak()
thesis.subtitle thesis.subtitle
} }
set align(left) set align(left)
v(1em) v(1em)
set par(justify: true) set par(justify: true)
if text.lang == "de" [ if text.lang == "de" [
selbständig verfasst und keine anderen als die angegebenen Quellen und Hilfsmittel benutzt habe. Ich versichere zudem, dass die eingereichte elektronische Fassung mit der gedruckten Fassung übereinstimmt. selbständig verfasst und keine anderen als die angegebenen Quellen und Hilfsmittel benutzt habe. Ich versichere zudem, dass die eingereichte elektronische Fassung mit der gedruckten Fassung übereinstimmt.
] else if text.lang == "en" [ ] else if text.lang == "en" [
independently and have not used any sources or aids other than those specified. I also confirm that the electronic version submitted is identical to the printed version. independently and have not used any sources or aids other than those specified. I also confirm that the electronic version submitted is identical to the printed version.
] ]
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%),
@ -62,5 +61,4 @@
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(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) })) align(left, if text.lang == "de" [ Unterschrift ] else if text.lang == "en" [ Signature ] else { panic("no translation for language: ", text.lang) }))
} }
)

View File

@ -9,127 +9,97 @@
// render an outline of figures // render an outline of figures
// with a specific title and filter by a specifc kind of figure // with a specific title and filter by a specifc kind of figure
// can optionally insert a pagebreak after the outline // can optionally insert a pagebreak after the outline
// 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), here()) let elems = query(figure.where(kind: kind), here())
let count = elems.len() let count = elems.len()
show outline.entry: it => { // only show outline if there is something to list
link(it.element.location())[ if count > 0 {
#v(12pt, weak: true) pagebreak(weak: true)
#text(weight: "regular", it.body) outline(
#box(width: 1fr, it.fill) title: heading(level: 3, title),
#[ #it.page] target: figure.where(kind: kind))
]
}
// only show outline if there is something to list
if count > 0 {
pagebreak(weak: true)
outline(
title: title,
target: figure.where(kind: kind),
)
}
} }
) }
#let render_figures_outline() = ( #let render_figures_outline() = context {
context { let title = if (text.lang == "de") {
let title = if (text.lang == "de") {
"Abbildungsverzeichnis" "Abbildungsverzeichnis"
} else if text.lang == "en" { } else if text.lang == "en" {
"List of Figures" "List of Figures"
} }
render_filtered_outline(title: title, kind: image) render_filtered_outline(title: title, kind: image)
} }
)
#let render_table_outline() = ( #let render_table_outline() = context {
context { let title = if (text.lang == "de") {
let title = if (text.lang == "de") {
"Tabellenverzeichnis" "Tabellenverzeichnis"
} else if text.lang == "en" { } else if text.lang == "en" {
"List of Tables" "List of Tables"
} }
render_filtered_outline(title: title, kind: table) render_filtered_outline(title: title, kind: table)
} }
)
#let render_raw_outline() = ( #let render_raw_outline() = context {
context { let title = if (text.lang == "de") {
let title = if (text.lang == "de") {
"Quelltextverzeichnis" "Quelltextverzeichnis"
} else if text.lang == "en" { } else if text.lang == "en" {
"Code Snippets" "Code Snippets"
} }
render_filtered_outline(title: title, kind: raw) render_filtered_outline(title: title, kind: raw)
} }
)
#let render_heading_outline() = ( #let render_heading_outline() = context {
context { let title = if (text.lang == "de") {
let title = if (text.lang == "de") {
"Inhaltsverzeichnis" "Inhaltsverzeichnis"
} else if text.lang == "en" { } else if text.lang == "en" {
"Table of Contents" "Table of Contents"
} }
pagebreak(weak: true)
outline(
target: heading.where(supplement: [chapter]),
title: heading(level: 3, title),
indent: auto)
}
let header-supplement = if (text.lang == "de") { #let render_appendix_outline() = context {
"Kapitel" let supplement = if text.lang == "en" {
} else { [Appendix]
"chapter" } else {
[Anhang]
}
if query(heading.where(supplement: supplement)).len() > 0 {
let title = if (text.lang == "de") {
"Anhangsverzeichnis"
} else if text.lang == "en" {
"Table of Appendices"
} }
pagebreak(weak: true) pagebreak(weak: true)
outline( outline(
target: heading.where(supplement: [#header-supplement]),
title: title,
indent: auto,
)
}
)
#let render_appendix_outline() = (
context {
let supplement = if text.lang == "en" {
[Appendix]
} else {
[Anhang]
}
if query(heading.where(supplement: supplement)).len() > 0 {
let title = if (text.lang == "de") {
"Anhangsverzeichnis"
} else if text.lang == "en" {
"Table of Appendices"
}
pagebreak(weak: true)
outline(
target: heading.where(supplement: supplement), target: heading.where(supplement: supplement),
title: title, title: heading(level: 3, title),
indent: auto, indent: auto)
)
}
} }
) }
#let new_outline() = { #let new_outline() = {
pagebreak(weak: true) pagebreak(weak: true)
show outline.entry.where(level: 1): it => { show outline.entry.where(
level: 1,
): it => {
v(1.5em, weak: true) v(1.5em, weak: true)
strong(it) strong(it)
} }
render_heading_outline()
render_figures_outline() render_figures_outline()
render_table_outline() render_table_outline()
@ -137,4 +107,6 @@
render_raw_outline() render_raw_outline()
render_appendix_outline() render_appendix_outline()
}
render_heading_outline()
}

View File

@ -11,4 +11,4 @@
pagebreak(weak: true) pagebreak(weak: true)
config.thesis.preface config.thesis.preface
} }
} }

View File

@ -6,53 +6,51 @@
// Edited: 28.06.2024 // Edited: 28.06.2024
// License: MIT // License: MIT
#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
let author = config.author let author = config.author
if text.lang == "de" [ if text.lang == "de" [
#heading("Vorabfassung") #heading("Vorabfassung")
] else if text.lang == "en" [ ] else if text.lang == "en" [
#heading("Preliminary Version") #heading("Preliminary Version")
] ]
v(1em) v(1em)
if text.lang == "de" [ if text.lang == "de" [
Bei dieser Ausgabe der Arbeit mit dem Thema Bei dieser Ausgabe der Arbeit mit dem Thema
] else if text.lang == "en" [ ] else if text.lang == "en" [
This edition of the work with the subject This edition of the work with the subject
] ]
v(1em) v(1em)
set align(center) set align(center)
text(weight: "bold", thesis.title) text(weight: "bold", thesis.title)
if thesis.subtitle != none { if thesis.subtitle != none {
linebreak() linebreak()
thesis.subtitle thesis.subtitle
}
set align(left)
v(1em)
set par(justify: true)
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 #author.university nicht zur Bewertung freigegeben und ein anderer Verwendungszweck als eine Vorschau ist nicht gestattet.
] 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 #author.university as part of the assignment, and any use other than a preview is not permitted.
]
v(1em)
h(1em)
[#author.name, #datetime.today().display()]
} }
)
set align(left)
v(1em)
set par(justify: true)
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 #author.university nicht zur Bewertung freigegeben und ein anderer Verwendungszweck als eine Vorschau ist nicht gestattet.
] 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 #author.university as part of the assignment, and any use other than a preview is not permitted.
]
v(1em)
h(1em)
[#author.name, #datetime.today().display()]
}

View File

@ -6,93 +6,110 @@
// Edited: 28.06.2024 // Edited: 28.06.2024
// License: MIT // License: MIT
#let new_title_page(config) = ( #let new_title_page(config) = context [
context [
#let thesis = config.thesis #let thesis = config.thesis
#let author = config.author #let author = config.author
#set align(center) #set align(center)
// title // title
#v(2cm) #v(2cm)
#set par(justify: false) #text(size: 2em, weight: "semibold", thesis.title)
#text(size: 2em, weight: "semibold", hyphenate: false, thesis.title)
// subtitle // subtitle
#text(size: 1.5em, thesis.subtitle) #text(size: 1.5em, thesis.subtitle)
// type of paper // type of paper
#v(1cm) #v(1cm)
#text(size: 1.5em, weight: "bold", thesis.kind) #text(size: 1.5em, weight: "bold", thesis.kind)
// faculty
#pad(top: 0.5cm)[
#if text.lang == "de" [
Praxisphase des #author.semester Semesters an der Fakultät für #author.faculty
#linebreak()
im Studiengang #author.program
] else if text.lang == "en" [
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(top: 0.5cm)[
#if text.lang == "de" [
an der
] else if text.lang == "en" [
at
] else [
#context panic("no translation for language: ", text.lang)
]
#linebreak()
#author.university
]
#set align(horizon + left)
// faculty
#pad(top: 0.5cm)[
#if text.lang == "de" [ #if text.lang == "de" [
#table( Praxisphase des #author.semester Studienjahrs an der Fakultät für #author.faculty
columns: 2, #linebreak()
column-gutter: 1cm, im Studiengang #author.program
align: left,
stroke: none,
[*Verfasser:*], author.name,
[*Bearbeitungszeitraum:*], thesis.timeframe,
[*Matrikelnummer, Kurs:*],
str(author.matriculation-number) + ", " + author.course,
[*Ausbildungsbetrieb:*], author.company,
[*Betrieblicher Betreuer:*], author.supervisor,
[*Abgabedatum:*], thesis.submission-date,
)
] else if text.lang == "en" [ ] else if text.lang == "en" [
#table( Practical phase of the #author.semester academic year at the Faculty of #author.faculty
columns: 2, #linebreak()
column-gutter: 1cm, in the degree program #author.program
align: left,
stroke: none,
[*Author:*], author.name,
[*Editing period:*], thesis.timeframe,
[*Matriculation number, course:*],
str(author.matriculation-number) + ", " + author.course,
[*Training company:*], author.company,
[*Company supervisor:*], author.supervisor,
[*Submission date:*], thesis.submission-date,
)
] else [ ] else [
#context panic("no translation for language: ", text.lang) #context panic("no translation for language: ", text.lang)
] ]
]
#align( // university
bottom, #pad(top: 0.5cm)[
grid( #if text.lang == "de" [
an der
] else if text.lang == "en" [
at
] else [
#context panic("no translation for language: ", text.lang)
]
#linebreak()
#author.university
]
#set align(horizon + left)
#if text.lang == "de" [
#table(
columns: 2,
column-gutter: 1cm,
align: left,
stroke: none,
[*Verfasser:*],
author.name,
[*Bearbeitungszeitraum:*],
thesis.timeframe,
[*Matrikelnummer, Kurs:*],
str(author.matriculation-number) + ", " + author.course,
[*Ausbildungsbetrieb:*],
author.company,
[*Betrieblicher Betreuer:*],
author.supervisor,
[*Abgabedatum:*],
thesis.submission-date
)
] else if text.lang == "en" [
#table(
columns: 2,
column-gutter: 1cm,
align: left,
stroke: none,
[*Author:*],
author.name,
[*Editing period:*],
thesis.timeframe,
[*Matriculation number, course:*],
str(author.matriculation-number) + ", " + author.course,
[*Training company:*],
author.company,
[*Company supervisor:*],
author.supervisor,
[*Submission date:*],
thesis.submission-date
)
] else [
#context panic("no translation for language: ", text.lang)
]
#align(bottom,
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: (60%, 40%), columns: (60%, 40%),
@ -104,9 +121,7 @@
#context panic("no translation for language: ", text.lang) #context panic("no translation for language: ", text.lang)
] ]
), ),
align(right, {line(length: 6cm)})), align(right, {line(length: 6cm)})))
)
#counter(page).update(0) #counter(page).update(0)
] ]
)

View File

@ -7,4 +7,4 @@
// Edited: 05.07.2024 // Edited: 05.07.2024
// License: MIT // License: MIT
#import "glossary.typ": * #import "@preview/glossarium:0.4.1": *

View File

@ -7,57 +7,22 @@
// Edited: 27.06.2024 // Edited: 27.06.2024
// License: MIT // License: MIT
#import "branding.typ": * #let watermark-color = luma(50%).transparentize(70%)
#let watermark-color = luma(50%).transparentize(70%)
#let watermark-pattern = pattern(size: (5pt, 5pt))[
#place(
line(
start: (50%, 0%),
end: (50%, 100%),
stroke: (paint: watermark-color, thickness: 3pt),
),
)
]
#let watermark(config) = if config.draft { #let watermark(config) = if config.draft {
rotate(-22.5deg)[ rotate(-22.5deg)[
#rect( #rect(
radius: 1em, radius: 1em,
inset: 1em, inset: 1em,
stroke: watermark-color, stroke: watermark-color)[
)[ #text(size: 4em, weight: "bold", fill: watermark-color, "DRAFT")
#text(size: 4em, weight: "bold", fill: watermark-pattern, "DRAFT")
#linebreak() #linebreak()
#text(size: 1.25em, weight: "bold", fill: watermark-color)[ #text(size: 1.25em, weight: "bold", fill: watermark-color)[
This page is part of a preliminary This page is part of a preliminary
#linebreak() #linebreak()
document version. document version.
#linebreak() #linebreak()
#text( #text(size: 0.75em, "Further usage without the authors consent is not permitted.")]]]}
size: 0.75em,
"Further usage without the authors consent is not permitted.",
)]]]
}
#let numberingH(c) = {
return numbering(c.numbering, ..counter(heading).at(c.location()))
}
#let currentH(level: 1) = {
let elems = query(selector(heading.where(level: level)).after(here()))
if elems.len() != 0 and elems.first().location().page() == here().page() {
return (numberingH(elems.first()), elems.first().body)
} else {
elems = query(selector(heading.where(level: level)).before(here()))
if elems.len() != 0 {
return (numberingH(elems.last()), elems.last().body)
}
}
return ""
}
// global style of document // global style of document
#let global_styled_doc(config, body) = { #let global_styled_doc(config, body) = {
@ -69,24 +34,13 @@
ligatures: true, ligatures: true,
hyphenate: true, hyphenate: true,
dir: ltr, dir: ltr,
font: style.text.font, font: style.text.font)
fill: ABB-BLACK,
)
show heading: set text( show heading: set text(
font: style.heading.font, font: style.heading.font,
weight: "semibold", weight: "semibold")
)
let header-supplement = if config.lang == "de" { set heading(supplement: [chapter])
"Kapitel"
} else {
"chapter"
}
set heading(supplement: [#header-supplement])
set math.equation(numbering: "(1)")
// 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)
@ -94,143 +48,15 @@
show heading.where(level: 3): it => v(0.5em) + it + v(0.25em) show heading.where(level: 3): it => v(0.5em) + it + v(0.25em)
// set theme for code blocks // set theme for code blocks
set raw(tab-size: style.code.tab-size) set raw(tab-size: 4, theme: "res/abb.tmTheme")
show raw.where(block: false): it => box(
stroke: 1pt + ABB-GRAY-05,
radius: 2pt,
inset: (left: 2pt, right: 2pt),
outset: (top: 4pt, bottom: 4pt),
fill: ABB-GRAY-06,
text(font: style.code.font, size: style.code.size, it.text),
)
show figure.where(kind: raw): it => align(left)[
#let content = it.body
#let lang = if content.has("lang") {
it.body.lang
} else {
none
}
#block(
width: 100%,
fill: ABB-GRAY-06,
stroke: 1pt + ABB-GRAY-05,
radius: 0.5em,
inset: 0.75em,
clip: false,
{
let (columns, align, make_row) = {
if style.code.lines {
(
(auto, 1fr),
(right + top, left),
e => {
let (i, l) = e
let n = i + 1
let n_str = if (calc.rem(n, 1) == 0) or (true and i == 0) {
text(
font: style.code.font,
size: style.code.size,
fill: ABB-BLACK,
str(n),
)
} else {
none
}
(n_str + h(0.5em), raw(block: true, lang: lang, l))
},
)
} else {
(
(1fr,),
(left,),
e => {
let (i, l) = e
raw(block: true, lang: lang, l)
},
)
}
}
grid(
stroke: none,
columns: columns,
rows: (auto,),
gutter: 0pt,
inset: 0.25em,
align: (col, _) => align.at(col),
fill: ABB-GRAY-06,
..content
.text
.split("\n")
.enumerate()
.map(make_row)
.flatten()
.map(c => if c.has("text") and c.text == "" {
v(1em)
} else {
c
})
)
},
)
#v(-1em)
#align(center + top, it.caption)
]
show figure: set block(breakable: true) show figure: set block(breakable: true)
// make figure supplements bold
// based on: https://github.com/typst/typst/discussions/3871
show figure.caption: c => [
#if c.body.fields().len() > 0 {
text(weight: "semibold")[
#c.supplement #c.counter.display("1.1.1")
]
c.separator
}
#c.body
]
// change the display supplement according to the text langugae
// based on: https://github.com/typst/typst/issues/3273
show figure.where(kind: raw): set figure(supplement: context {
if text.lang == "de" {
"Quelltext"
} else {
"Listing"
}
})
// APA style table
set table(
inset: 0.5em,
align: left,
stroke: (x, y) => (
left: none,
right: none,
top: if y == 0 {
1.5pt
} else if y < 2 {
1pt
} else {
0.5pt
},
bottom: if y == 0 {
1pt
} else {
1.5pt
},
),
)
// make table header bold
show table.cell.where(y: 0): set text(weight: "bold")
set block(spacing: 2em) set block(spacing: 2em)
set par( set par(
justify: true, justify: true,
first-line-indent: 1em, first-line-indent: 1em,
leading: 1em, leading: 1em)
)
// give links a color // give links a color
show link: set text(fill: style.link.color) show link: set text(fill: style.link.color)
@ -243,56 +69,39 @@
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 + style.header.logo-height + style.header.underline-top-padding + style.header.content-padding,
.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),
),
numbering: (..nums) => { numbering: (..nums) => {
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 query(<end-of-prelude>).first().location().page() > current-page {
.first()
.location()
.page() > current-page {
numbering("I", nums.pos().first()) numbering("I", nums.pos().first())
} else if query(<end-of-content>) } else if query(<end-of-content>).first().location().page() >= current-page {
.first()
.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())
} }
}, },
footer: context [ footer: context [
#set align(center)
#let page-counter = counter(page).get().first() #let page-counter = counter(page).get().first()
#let page-number = here().page() #let page-number = here().page()
#set align(center)
#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)
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", page-counter, counter(page).at(<end-of-content>).last())
"1 / 1",
page-counter,
counter(page).at(<end-of-content>).last(),
)
} else { } else {
numbering("a", page-counter) numbering("a", page-counter)
} }
], ],
header: context { header: context {
set align(left) set align(left)
let current-page = here().page() if here().page() == 1 {
if current-page == 1 {
// logo of ABB and DHBW // logo of ABB and DHBW
grid( grid(
// set width of columns // set width of columns
@ -303,39 +112,52 @@
// right align logo of DHBW // right align logo of DHBW
align(right, image("res/DHBW.svg", height: style.header.logo-height))) align(right, image("res/DHBW.svg", height: style.header.logo-height)))
} else if query(<end-of-content>) } else if query(<end-of-prelude>).first().location().page() <= here().page() {
.first() let headers-before = query(selector(heading.where(numbering: "1.", level: 1)).before(here()))
.location()
.page() >= current-page and query(<end-of-prelude>)
.first()
.location()
.page() < current-page + 1 {
let heading = currentH()
heading.at(0) let header-title = thesis.title
h(0.5em)
heading.at(1) if headers-before.len() > 0 {
header-title = headers-before.last().body
} else {
let headers-after = query(selector(heading.where(numbering: "1.", level: 1)).after(here()))
if headers-after.len() > 0 {
header-title = headers-after.first().body
}
}
grid(
columns: (1fr, auto),
align: (horizon, bottom),
context [ _ #header-title _ ],
image("res/DHBW.svg", height: style.header.logo-height))
v(style.header.underline-top-padding - 1em) v(style.header.underline-top-padding - 1em)
line(length: 100%) line(length: 100%)
} else { } else {
config.thesis.title grid(
columns: (1fr, auto),
align: (horizon, bottom),
context [ _ #config.thesis.title _ ],
image("res/DHBW.svg", height: style.header.logo-height)
)
v(style.header.underline-top-padding - 1em) v(style.header.underline-top-padding - 1em)
line(length: 100%) line(length: 100%)
} }
}, })
)
body body
} }
#let content_styled(config, body) = { #let content_styled(config, body) = {
set heading(numbering: "1.1.1") set heading(numbering: "1.")
body body
} }
#let end_styled(config, body) = { #let end_styled(config, body) = {
set heading(numbering: "1.1.1") set heading(numbering: "1.")
body body
} }

View File

@ -4,9 +4,6 @@
#lorem(50) #lorem(50)
== More raw data == More raw data
#lorem(50) #lorem(50)
#figure(```
```)

15
template/glossary.typ Normal file
View File

@ -0,0 +1,15 @@
#let glossary = (
(
key: "oidc",
short: "OIDC",
long: "OpenID Connect",
desc: [OpenID is an open standard and decentralized authentication protocol promoted by the non-profit #link("https://en.wikipedia.org/wiki/OpenID#OpenID_Foundation")[OpenID Foundation].]
),
(
key: "potato",
short: "potato",
plural: "potatoes",
desc: [#lorem(10)]
),
)

View File

@ -1,13 +0,0 @@
oidc:
short: OIDC
long: OpenID Connect
desc: "OpenID is an open standard and decentralized authentication protocol promoted by the non-profit #link(\"https://en.wikipedia.org/wiki/OpenID#OpenID_Foundation\")[OpenID Foundation]."
potato:
short: potato
desc: "#lorem(50)"
HTTP:
short: HTTP
long: Hyper Text Transfer Protocol

View File

@ -1,11 +1,11 @@
#import "../src/lib.typ": * #import "../src/lib.typ": dhbw-template
#import "glossary.typ": glossary
#import "abstract.typ": abstract, summary #import "abstract.typ": abstract, summary
#show: dhbw-template.with(( #show: dhbw-template.with((
lang: "de", lang: "en",
region: "de", region: "en",
draft: false,
author: ( author: (
name: "Sven Vogel", name: "Sven Vogel",
semester: 4, semester: 4,
@ -15,8 +15,7 @@
university: "DHBW Mannheim", university: "DHBW Mannheim",
company: "ABB AG", company: "ABB AG",
supervisor: "Benny Goodman", supervisor: "Benny Goodman",
matriculation-number: 123456789, matriculation-number: 123456789),
),
thesis: ( thesis: (
title: "Unofficial ABB/DHBW Typst template", title: "Unofficial ABB/DHBW Typst template",
subtitle: "for reports and thesises", subtitle: "for reports and thesises",
@ -26,22 +25,17 @@
summary: summary, summary: summary,
abstract: abstract, abstract: abstract,
preface: include "preface.typ", preface: include "preface.typ",
keywords: ("IT", "other stuff"), keywords: ( "IT", "other stuff" ),
bibliography: bibliography("refs.bib"), bibliography: bibliography("refs.bib"),
glossary: yaml("glossary.yml"), glossary: glossary,
appendices: include "appendix.typ", appendices: include "appendix.typ")))
),
))
#import "@preview/wrap-it:0.1.0": wrap-content #import "@preview/wrap-it:0.1.0": wrap-content
= Lorem Ipsum = Lorem Ipsum
#text(fill: ABB-RED, "Hello ABB branding")
#lorem(25) #lorem(25)
@oidc @oidc
@potato
#lorem(100) #lorem(100)
@Anhang-A @Anhang-A
@ -51,66 +45,68 @@
#lorem(200) #lorem(200)
@einstein @einstein
= Lorem Ipsum 3 <sec:hello> = Lorem Ipsum 3
#lorem(15) t `Hello, World!` #lorem(50) #lorem(15)
$ $
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.
$ $
#lorem(140) #lorem(140)
#wrap-content( #wrap-content(
figure(image("assets/digitaldog.jpg", width: 200pt), caption: [ Some image caption ]), figure(image("assets/digitaldog.jpg", width: 200pt), caption: [ Some image caption ]),
lorem(200), lorem(200))
)
#url("https://github.com", "text") @sec:hello
#lorem(50)
#figure( #figure(
table( table(
columns: 3, columns: 2,
table.header[Date][Exercise Type][Calories Burned], "Hello", "World"),
[2023-03-15], [Swimming], [400], caption: [ Some table ])
[2023-03-17], [Weightlifting], [250],
[2023-03-18], [Yoga], [200],
[2023-03-15], [Swimming], [400],
[2023-03-17], [Weightlifting], [250],
[2023-03-18], [Yoga], [200],
[2023-03-15], [Swimming], [400],
[2023-03-17], [Weightlifting], [250],
[2023-03-18], [Yoga], [200],
),
caption: [ Some table ],
)
#pagebreak() #pagebreak()
#lorem(100)
#inline-color("#ff0000", "red") @HTTP
#figure( #figure(
```rust ```rust
use std::env; use std::env;
use std::fs::OpenOptions; use std::fs::OpenOptions;
use std::io::Write; use std::io::Write;
fn main() { fn main() {
println!("Hello, World!!!"); // Get the file path from the environment variable
} let file_path = match env::var("OUTPUT_FILE") {
```, Ok(path) => path,
caption: [Some code], Err(_) => {
) eprintln!("Error: OUTPUT_FILE environment variable is not set");
return;
}
};
#lorem(100) // Open the file in append mode, create it if it doesn't exist
let mut file = match OpenOptions::new()
.append(true)
.create(true)
.open(&file_path)
{
Ok(file) => file,
Err(e) => {
eprintln!("Error opening file {}: {}", file_path, e);
return;
}
};
#pagebreak() // Write "Hello, World" to the file
if let Err(e) = writeln!(file, "Hello, World") {
eprintln!("Error writing to file: {}", e);
} else {
println!("Successfully appended 'Hello, World' to {}", file_path);
}
}
```, caption: [Some code])
= Conclusion = Conclusion
#lorem(320) #lorem(320)

View File

@ -1,7 +1,8 @@
#import "../../src/lib.typ": dhbw-template #import "../../src/lib.typ": dhbw-template
#show: dhbw-template.with(( #show: dhbw-template.with(
config: (
lang: none, lang: none,
region: "en", region: "en",
author: ( author: (

View File

@ -1,34 +1,30 @@
#import "../../src/lib.typ": dhbw-template #import "../../src/lib.typ": dhbw-template
#show: dhbw-template.with(( #show: dhbw-template.with(
lang: "en", config: (
this-key-is-not-in-config: "Ha Ha", lang: "en",
region: "en", this-key-is-not-in-config: "Ha Ha",
author: ( region: "en",
name: "Sven Vogel", author: (
semester: 4, name: "Sven Vogel",
program: "Informationtechnology", semester: 4,
course: "TINF19IT1", program: "Informationtechnology",
faculty: "Technik", course: "TINF19IT1",
university: "DHBW Mannheim", faculty: "Technik",
company: "ABB AG", university: "DHBW Mannheim",
supervisor: "Benny Goodman", company: "ABB AG",
matriculation-number: 123456789, supervisor: "Benny Goodman",
), matriculation-number: 123456789),
thesis: ( thesis: (
title: "Unofficial ABB/DHBW Typst template", title: "Unofficial ABB/DHBW Typst template",
subtitle: "for reports and thesises", 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",
summary: none, summary: none,
abstract: none, abstract: none,
keywords: ("IT", "other stuff"), keywords: ( "IT", "other stuff" ),
bibliography: none, bibliography: none,
glossary: none, glossary: none,
appendices: none, appendices: none)))
),
))
= Heading

View File

@ -1,26 +1,24 @@
#import "../../src/lib.typ": dhbw-template #import "../../src/lib.typ": dhbw-template
#show: dhbw-template.with(( #show: dhbw-template.with(
lang: "en", config: (
region: "en", lang: "en",
author: ( region: "en",
university: "DHBW Mannheim", author: (
company: "ABB AG", university: "DHBW Mannheim",
supervisor: none, company: "ABB AG",
matriculation-number: 123456789, supervisor: none,
), matriculation-number: 123456789),
thesis: ( thesis: (
title: "Unofficial ABB/DHBW Typst template", title: "Unofficial ABB/DHBW Typst template",
subtitle: "for reports and thesises", 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",
summary: none, summary: none,
abstract: none, abstract: none,
keywords: ("IT", "other stuff"), keywords: ( "IT", "other stuff" ),
bibliography: none, bibliography: none,
glossary: none, glossary: none,
appendices: none, appendices: none)))
),
))

View File

@ -1,7 +1,8 @@
#import "../../src/lib.typ": dhbw-template #import "../../src/lib.typ": dhbw-template
#show: dhbw-template.with(( #show: dhbw-template.with(
config: (
lang: "en", lang: "en",
region: "en", region: "en",
author: ( author: (
@ -26,5 +27,3 @@
bibliography: none, bibliography: none,
glossary: none, glossary: none,
appendices: none))) appendices: none)))
= Heading

View File

@ -1,6 +1,6 @@
[package] [package]
name = "dhbw-abb-typst-template" name = "dhbw-abb-typst-template"
version = "0.4.1" version = "0.1.0"
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"