Compare commits

...

58 Commits

Author SHA1 Message Date
Sven Vogel 5f6ba595da style: run typstyle formatter
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 2m57s Details
2024-11-11 14:44:13 +01:00
Sven Vogel f36b23552c feat: add option to remove ABB image (s#62)
Gitea Action for checking typst compilation / run-ci-linux (push) Failing after 2m0s Details
2024-11-11 14:37:16 +01:00
Sven Vogel 56f330693d Merge pull request 'feat/fira-fonts' (#61) from feat/fira-fonts into main
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 1m59s Details
Reviewed-on: #61
2024-09-27 15:49:43 +00:00
Sven Vogel 1a263f66ac chore: added font directory to ci
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 2m0s Details
2024-09-27 17:47:08 +02:00
Sven Vogel 75d50f3207 feat: added fira fonts
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 2m16s Details
2024-09-27 17:43:58 +02:00
Sven Vogel 6a4d78ba8b Merge pull request 'removed: install of package sudo in github action' (#59) from fix/ci-failing-on-github into main
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 1m43s Details
Reviewed-on: #59
2024-08-27 19:38:31 +00:00
Sven Vogel 4da04a195c removed: install of package sudo in github action
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 1m48s Details
2024-08-27 21:35:27 +02:00
Sven Vogel 572d505701 added nix pipeline to github
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 1m46s Details
2024-08-27 21:20:17 +02:00
Sven Vogel 255cdfeae1 Merge branch 'feature/typstyle'
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 2m48s Details
2024-08-27 21:16:23 +02:00
Sven Vogel 37e60a315e make long titles break on title page but not on content (#54)
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 28s Details
2024-08-27 14:07:16 +02:00
Sven Vogel 9f9225910f fix lock notice spelling mistake (#53)
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 31s Details
2024-08-27 13:52:50 +02:00
Sven Vogel e1b8eceea6 fix heading supplement not translated (#52)
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 27s Details
2024-08-26 16:10:52 +02:00
Sven Vogel 0438d73ab5 only show used acronyms (#51)
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 28s Details
2024-08-26 15:26:28 +02:00
Sven Vogel 410c753339 fix wrong glossary and acronym group language (#50)
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 27s Details
2024-08-26 15:08:03 +02:00
Sven Vogel dd6a9ccce0 decrease padding between acronyms and glossary entries (#49)
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 27s Details
2024-08-26 14:47:37 +02:00
Sven Vogel eb21aeee99 bumped version to 0.4.1
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 25s Details
release / release (push) Successful in 1m9s Details
2024-08-22 11:23:28 +02:00
Sven Vogel f237beb6fa deprecate theme (#48) 2024-08-22 11:22:34 +02:00
Sven Vogel 2b966e42a0 fix confidentiality statement not showing up in outline (#47) 2024-08-22 10:53:37 +02:00
Sven Vogel 39c620c270 add domain name after url text (#46) 2024-08-22 10:51:35 +02:00
Sven Vogel c60d81bd2d add acronym to glossary if specified (#45) 2024-08-22 10:43:13 +02:00
Sven Vogel a95b42bac3 make weight of list of figures regular (#44) 2024-08-22 10:23:09 +02:00
Sven Vogel 4084960737 add URL function (#42)
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 26s Details
release / release (push) Successful in 1m11s Details
2024-08-20 14:17:50 +02:00
Sven Vogel dd902adebd Merge branch 'main' of https://git.montehaselino.de/DHBW/dhbw-abb-typst-template
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 34s Details
2024-08-20 09:56:39 +02:00
Sven Vogel 3026dc1a1e fixed spelling mistakes 2024-08-20 09:49:13 +02:00
Sven Vogel 418992d27f changed glossarium format
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 31s Details
2024-08-14 11:57:27 +02:00
Sven Vogel b1aca1b18b format with typstyle (#40)
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 29s Details
release / release (push) Successful in 1m11s Details
2024-08-12 18:09:14 +02:00
Sven Vogel 08a6eaf79f add inline color block (#39) 2024-08-12 18:07:44 +02:00
Sven Vogel a4e6e6c47a reset use of code theme (#39) 2024-08-12 18:01:03 +02:00
Sven Vogel a90678ffab added border around raw figures and inline raws
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 27s Details
release / release (push) Successful in 1m7s Details
2024-07-26 09:38:02 +02:00
Sven Vogel dd8ed6e2f5 fixed error when lang of raw figure was empty
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 30s Details
release / release (push) Successful in 1m3s Details
2024-07-22 08:41:02 +02:00
Sven Vogel 4e82edce06 Merge pull request 'added prettier code blocks' (#36) from feature/pretty-codeblocks into main
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 30s Details
release / release (push) Successful in 1m7s Details
Reviewed-on: #36
2024-07-19 13:09:01 +00:00
Sven Vogel ce94168b13 added prettier code blocks
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 27s Details
2024-07-19 15:08:11 +02:00
Sven Vogel acf8b73315 Merge pull request 'added push mirror notice to README.md' (#35) from github-readme into main
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 25s Details
Reviewed-on: #35

Refs: #34
2024-07-19 08:45:30 +00:00
Sven Vogel 8436a4a99a added push mirror notice to README.md
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 26s Details
2024-07-19 10:42:47 +02:00
Sven Vogel d7502e8e6b changed to PAT instead of GITHUB_TOKEN for release
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 26s Details
release / release (push) Successful in 1m2s Details
2024-07-19 09:58:26 +02:00
Sven Vogel 8988ab1491 Merge pull request 'feature/github-workflow' (#33) from feature/github-workflow into main
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 30s Details
release / release (push) Successful in 1m4s Details
Reviewed-on: #33

Refs: #32
2024-07-19 07:47:34 +00:00
Sven Vogel e1dd12cdfd added release on tag github action
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 25s Details
2024-07-19 09:45:23 +02:00
Sven Vogel b827520692 added python setup action
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 26s Details
2024-07-19 09:36:48 +02:00
Sven Vogel cc56ccecd7 changed install path for typst
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 30s Details
2024-07-19 09:31:17 +02:00
Sven Vogel 8dc61c01fe added github workflow
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 29s Details
2024-07-19 09:23:39 +02:00
Sven Vogel 0f7c6257d9 Merge pull request 'improvement/refine-readme' (#30) from improvement/refine-readme into main
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 25s Details
release / release (push) Has been cancelled Details
Reviewed-on: #30

Refs: #28
2024-07-18 13:11:31 +00:00
Sven Vogel d24d4a34e9 moved section preview on below of features
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 26s Details
2024-07-18 15:09:45 +02:00
Sven Vogel 30f011f24c updated README.md
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 27s Details
2024-07-18 15:07:59 +02:00
Sven Vogel 0c89695cda Merge pull request 'improvement/bold-figure-captions' (#27) from improvement/bold-figure-captions into main
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 25s Details
Reviewed-on: #27
2024-07-18 10:24:15 +00:00
Sven Vogel b80351fb70 added numbering format for listing caption
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 25s Details
2024-07-18 12:20:38 +02:00
Sven Vogel baba65ef41 changed display supplement for code blocks 2024-07-18 12:19:35 +02:00
Sven Vogel 6371459259 changed display supplement to bold text 2024-07-18 12:18:01 +02:00
Sven Vogel 2c801036dd Merge pull request 'feature/header-footer-format' (#25) from feature/header-footer-format into main
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 24s Details
Reviewed-on: #25
2024-07-18 09:01:12 +00:00
Sven Vogel ca4312bfde changed header numbering title spacing to 0.5em
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 34s Details
2024-07-18 10:58:23 +02:00
Sven Vogel 9ae921d52a changed footer alignment to center 2024-07-18 10:49:47 +02:00
Sven Vogel a709ad2765 changed style of header and footer 2024-07-17 15:48:15 +02:00
Sven Vogel 72d1fd84a7 Merge pull request 'added watermark stripes' (#23) from feature/header-footer-format into main
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 26s Details
Reviewed-on: #23
2024-07-12 13:08:04 +00:00
Sven Vogel 43da04143a added watermark stripes
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 26s Details
2024-07-12 15:06:32 +02:00
Sven Vogel bbd88494d7 added dhbw template note to README
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 28s Details
2024-07-11 15:46:28 +02:00
Sven Vogel b842747c3b aaadded 0.5pt line between data cells of tables 2024-07-11 15:36:55 +02:00
Sven Vogel 25adc2df91 changed appendix heading to be invisable but still show up in toc 2024-07-11 15:22:19 +02:00
Sven Vogel a7f4937f9e fixed wrong header title being used
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 27s Details
2024-07-11 14:58:18 +02:00
Sven Vogel b46660e605 changed header style to omit last dot 2024-07-11 11:41:04 +02:00
68 changed files with 799 additions and 817 deletions

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

30
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,30 @@
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}}'

129
README.md
View File

@ -1,24 +1,122 @@
# DHBW-ABB Typst template 📃 <div align="center">
<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>
![last-commit-bade](https://img.shields.io/gitea/last-commit/dhbw/dhbw-abb-typst-template?gitea_url=https%3A%2F%2Fgit.montehaselino.de) ## Table of Contents
![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)
**Unofficial** but feature rich Typst template for writing a thesis or report at DHBW with according ABB AG branding in mind. 1. [Contribution](#contribution)
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)
![thumbnail](https://git.montehaselino.de/DHBW/dhbw-abb-typst-template/raw/commit/cd325b7076da91e58849512539460a481e48ef4e/assets/thumbnail.png) ## Contribution
> ⚠️ **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
> ⚠️ **Notice** <br> > ⚠️ **Notice** <br>
> Typst ist under active development and thus may lack features an experienced LaTeX is used to. > Typst ist under active development and thus may lack features an experienced LaTeX is used to.
This template includes designs for a titlepage, confidantiality statement, declaration of authorship and more with a consistent design inspired by various unofficial works made by students at DHBW. Layout and the choise fonts are based on the unofficial [supercharged-dhbw](https://github.com/DannySeidel/typst-dhbw-template) Typst template. It comes with automatic generation of outlines for figures, tables, code snippets and appendices. This template includes designs for a titlepage, confidantiality statement, declaration of authorship and more with a consistent design inspired by various unofficial works made by students at DHBW. Layout and the choise fonts are based on the unofficial [supercharged-dhbw](https://github.com/DannySeidel/typst-dhbw-template) Typst template. It comes with automatic generation of outlines for figures, tables, code snippets and appendices.
The template can generate sections for a glossary, combinging acronyms and technical terms into a singular section. The template can generate sections for a glossary, combinging acronyms and technical terms into a singular section.
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.
@ -33,9 +131,10 @@ Complies with ABB branding guidelines such as:
## Fonts ## Fonts
Both fonts used in the document are licensed under the [Open Font License](https://openfontlicense.org/) and can be used for non-commercial as well as commercial purposes. They can be downloaded from google 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:
- [Montserrat](https://fonts.google.com/specimen/Montserrat) - [Fira Sans](https://github.com/bBoxType/FiraSans)
- [Open Sans](https://fonts.google.com/specimen/Open+Sans) - [Fira Math](https://github.com/firamath/firamath)
- [Fira Code NF](https://www.nerdfonts.com/font-downloads)
Consider giving the creators of the font credit for their amazing work! Consider giving the creators of the font credit for their amazing work!
@ -46,8 +145,8 @@ The developers around Typst have made pretty handy comparison guide between LaTe
## Legal ## Legal
This template and its content is in no way officially affiliaterd with either DHBW or ABB AG. This template and its content is in no way officially affiliaterd with either DHBW or ABB AG.
Its only purpose is to simplify the process of getting started with the typsetting language Typst for writing a university report or thesis. Its only purpose is to simplify the process of getting started with the typsetting language Typst for writing a university report or thesis.
As author and owner of the reposity I claim no copyright of the logos used in the document, the software used to compile the source or the documents based on this template. As author and owner of the reposity I claim no copyright of the logos used in the document, the software used to compile the source or the documents based on this template.
## FAQ ## FAQ
@ -68,4 +167,4 @@ Typst in comparison is serval orders of magnitudes faster and has native support
The logos for both ABB AG and DHBW are freely available at Wikimedia Commons: The logos for both ABB AG and DHBW are freely available at Wikimedia Commons:
- [ABB logo as svg](https://commons.wikimedia.org/wiki/File:ABB_logo.svg) - [ABB logo as svg](https://commons.wikimedia.org/wiki/File:ABB_logo.svg)
- [DHBW logo as svg](https://upload.wikimedia.org/wikipedia/de/1/1d/DHBW-Logo.svg) - [DHBW logo as svg](https://upload.wikimedia.org/wikipedia/de/1/1d/DHBW-Logo.svg)

BIN
assets/banner.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 MiB

BIN
assets/page-preview.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

View File

@ -1,20 +0,0 @@
# 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

View File

@ -1,30 +0,0 @@
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)

View File

@ -1 +0,0 @@
pyyaml

View File

@ -1,561 +0,0 @@
<?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>

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.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

93
fonts/Fira Code/LICENSE Normal file
View File

@ -0,0 +1,93 @@
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.

48
fonts/Fira Code/README.md Normal file
View File

@ -0,0 +1,48 @@
# 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.

92
fonts/Fira Math/LICENSE Normal file
View File

@ -0,0 +1,92 @@
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.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -44,11 +44,10 @@ function enter-section() {
} }
enter-section "Typstyle checking" "./run-fmt.sh --check src/lib.typ" 0 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 . --font-path fonts example.pdf"
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 . --font-path fonts"
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 . --font-path fonts" "should fail"
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 . --font-path fonts"
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 . --font-path fonts" "should fail"
enter-section "TEST: invalid config case 3" "typst compile tests/invalid-config/test-case-3.typ --root ." "should fail"
log "INFO" "CI completed successfully" log "INFO" "CI completed successfully"

View File

@ -47,7 +47,8 @@
header: ( header: (
content-padding: 1.5em, content-padding: 1.5em,
underline-top-padding: 0pt, underline-top-padding: 0pt,
logo-height: 3em), logo-height: 3em,
logo-image: "res/ABB.svg"),
footer: ( footer: (
content-padding: 1.5em), content-padding: 1.5em),
page: ( page: (
@ -59,12 +60,14 @@
bottom: 2.5cm)), bottom: 2.5cm)),
text: ( text: (
size: 12pt, size: 12pt,
font: "Open Sans"), font: "Fira Sans"),
heading: ( heading: (
font: "Montserrat"), font: "Fira Sans"),
code: ( code: (
theme: "res/abb.tmTheme", theme: "res/abb.tmTheme",
font: "FiraCode Nerd Font", font: "FiraCode Nerd Font",
lines: false,
size: 10pt,
tab-size: 4), tab-size: 4),
link: ( link: (
color: ABB-GRAY-02))) color: ABB-GRAY-02)))

View File

@ -185,23 +185,31 @@ SOFTWARE.*/
numbering: none, numbering: none,
caption: { caption: {
context { context {
let term_references = __query_labels_with_key(here(), entry.key) let key = if entry.key.ends-with("__glossary_entry") {
if term_references.len() != 0 or show-all { entry.key.replace("__glossary_entry", "")
let desc = entry.at("desc", default: "") } else {
let long = entry.at("long", default: "") entry.key
let hasLong = long != "" and long != [] }
let hasDesc = desc != "" and desc != []
grid( let term_references = __query_labels_with_key(here(), key)
columns: 2, if term_references.len() != 0 or show-all [
column-gutter: 1em, #let desc = entry.at("desc", default: "")
text(weight: "bold", entry.short), #let long = entry.at("long", default: "")
{ #let hasLong = long != "" and long != []
if hasLong { #let hasDesc = desc != "" and desc != []
text(weight: "bold", entry.long)
#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 hasLong and hasDesc [:] #if hasDesc [ #sym.dash.en ]
if hasDesc [ #desc ] else [. ] #if hasDesc [ #desc ]
if disable-back-references != true { #if disable-back-references != true {
term_references term_references
.map(x => x.location()) .map(x => x.location())
.sorted(key: x => x.page()) .sorted(key: x => x.page())
@ -227,16 +235,16 @@ SOFTWARE.*/
page-numbering, page-numbering,
..counter(page).at(x), ..counter(page).at(x),
)] )]
}) }
)
.join(", ") .join(", ")
} }
}, ],
) )
} ]
} }
}, },
)[] #label(entry.key) )[] #label(entry.key)
#parbreak()
] ]
} }
} }
@ -244,4 +252,4 @@ SOFTWARE.*/
pagebreak(weak: true) pagebreak(weak: true)
} }
} }
}; };

View File

@ -7,13 +7,15 @@
// Edited: 08.07.2024 // Edited: 08.07.2024
// License: MIT // License: MIT
#let glossary(entries) = { #let glossary(entries, config) = {
assert( assert(
type(entries) == dictionary, type(entries) == dictionary,
message: "The glossary is not a dictionary", message: "The glossary is not a dictionary",
) )
let processed_glossary = (:)
for (k, v) in entries.pairs() { for (k, v) in entries.pairs() {
assert( assert(
type(v) == dictionary, type(v) == dictionary,
@ -52,29 +54,47 @@
message: "The optional group of glossary entry `" + k + "` is not a string", message: "The optional group of glossary entry `" + k + "` is not a string",
) )
} else { } else {
let group = if "long" in v { let acronym_group = if config.lang == "de" {
if (context text.lang) == "de" { "Abkürzungsverzeichnis"
"Akronyme"
} else {
"Acronyms"
}
} else { } else {
if (context text.lang) == "de" { "List of Acronyms"
"Begriffe"
} else {
"Terms"
}
} }
entries.at(k).group = group 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 entries.pairs().map(((key, entry)) => ( return processed_glossary.pairs().map(((key, entry)) => (
key: key, key: key,
short: eval(entry.short, mode: "markup"), short: entry.short,
long: eval(entry.at("long", default: ""), mode: "markup"), long: eval(entry.at("long", default: ""), mode: "markup"),
desc: eval(entry.at("desc", default: ""), mode: "markup"), desc: eval(entry.at("desc", default: ""), mode: "markup"),
group: entry.at("group", default: ""), group: entry.at("group", default: ""),
)) ))
} }

View File

@ -7,13 +7,15 @@
// Edited: 27.06.2024 // Edited: 27.06.2024
// License: MIT // License: MIT
#import "conf.typ": validate-config #import "conf.typ": validate-config, default-config
#import "branding.typ": * #import "branding.typ": *
#import "style.typ": global_styled_doc, content_styled, end_styled #import "style.typ": global_styled_doc, content_styled, end_styled
#import "glossary.typ": glossary #import "glossary.typ": glossary
#import "pages/titlepage.typ": new_title_page #import "pages/titlepage.typ": new_title_page
#import "pages/declaration-of-authorship.typ": new_declaration_of_authorship #import "pages/declaration-of-authorship.typ": new_declaration_of_authorship
#import "pages/confidentiality-statement.typ": new_confidentiality_statement_page #import "pages/confidentiality-statement.typ": (
new_confidentiality_statement_page,
)
#import "pages/prerelease-note.typ": new_prerelease_note #import "pages/prerelease-note.typ": new_prerelease_note
#import "pages/outline.typ": new_outline #import "pages/outline.typ": new_outline
#import "pages/abstract.typ": new_abstract #import "pages/abstract.typ": new_abstract
@ -24,6 +26,41 @@
[#pagebreak()] [#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) = [
#let config = validate-config(config) #let config = validate-config(config)
@ -68,9 +105,10 @@
#if "glossary" in config.thesis and config.thesis.glossary != none { #if "glossary" in config.thesis and config.thesis.glossary != none {
print-glossary( print-glossary(
show-all: false,
disable-back-references: true, disable-back-references: true,
enable-group-pagebreak: true, enable-group-pagebreak: true,
glossary(config.thesis.glossary), glossary(config.thesis.glossary, config),
) )
pagebreak(weak: true) pagebreak(weak: true)
@ -97,4 +135,4 @@
#show-appendix(config: config) #show-appendix(config: config)
] ]
] ]
] ]

View File

@ -26,4 +26,4 @@
heading("Abstract") heading("Abstract")
config.thesis.abstract config.thesis.abstract
} }
) )

View File

@ -19,8 +19,10 @@
if "appendices" in config.thesis { if "appendices" in config.thesis {
pagebreak(weak: true) 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) heading(level: 1, numbering: none, title)
v(-2em)
// APA style appendix // APA style appendix
show heading: it => { show heading: it => {

View File

@ -15,13 +15,13 @@
let author = config.author let author = config.author
if text.lang == "de" [ if text.lang == "de" [
#heading(level: 1, "Sperrvermerk", supplement: [special]) #heading(level: 1, "Sperrvermerk")
] else if text.lang == "en" [ ] else if text.lang == "en" [
#heading(level: 1, "Confidentiality Statement", supplement: [special]) #heading(level: 1, "Confidentiality Statement")
] ]
if text.lang == "de" [ if text.lang == "de" [
Der Inhalt der dieser Arbeit mit dem Thema Der Inhalt 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
] ]
@ -44,7 +44,7 @@
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 Evalua-tionsverfahrens 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 Evaluationsverfahrens 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.
] ]
@ -61,4 +61,4 @@
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

@ -63,4 +63,4 @@
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

@ -16,6 +16,15 @@
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 => {
link(it.element.location())[
#v(12pt, weak: true)
#text(weight: "regular", it.body)
#box(width: 1fr, it.fill)
#[ #it.page]
]
}
// only show outline if there is something to list // only show outline if there is something to list
if count > 0 { if count > 0 {
pagebreak(weak: true) pagebreak(weak: true)
@ -71,9 +80,15 @@
"Table of Contents" "Table of Contents"
} }
let header-supplement = if (text.lang == "de") {
"Kapitel"
} else {
"chapter"
}
pagebreak(weak: true) pagebreak(weak: true)
outline( outline(
target: heading.where(supplement: [chapter]), target: heading.where(supplement: [#header-supplement]),
title: title, title: title,
indent: auto, indent: auto,
) )
@ -122,4 +137,4 @@
render_raw_outline() render_raw_outline()
render_appendix_outline() render_appendix_outline()
} }

View File

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

View File

@ -55,4 +55,4 @@
h(1em) h(1em)
[#author.name, #datetime.today().display()] [#author.name, #datetime.today().display()]
} }
) )

View File

@ -16,23 +16,26 @@
// title // title
#v(2cm) #v(2cm)
#text(size: 2em, weight: "semibold", thesis.title) #par(justify: false, leading: 1.5em)[
#text(size: 2em, weight: "bold", hyphenate: false, thesis.title)
#linebreak()
// subtitle
#text(size: 2em, weight: "light", thesis.subtitle)
]
// subtitle #set align(center + horizon)
#text(size: 1.5em, thesis.subtitle)
// type of paper // type of paper
#v(1cm) #text(size: 1.5em, weight: "medium", thesis.kind)
#text(size: 1.5em, weight: "bold", thesis.kind)
// faculty // faculty
#pad(top: 0.5cm)[ #pad()[
#if text.lang == "de" [ #if text.lang == "de" [
Praxisphase des #author.semester Studienjahrs an der Fakultät für #author.faculty Praxisphase des #author.semester Semesters an der Fakultät für #author.faculty
#linebreak() #linebreak()
im Studiengang #author.program im Studiengang #author.program
] else if text.lang == "en" [ ] else if text.lang == "en" [
Practical phase of the #author.semester academic year at the Faculty of #author.faculty Practical phase of the #author.semester semester at the Faculty of #author.faculty
#linebreak() #linebreak()
in the degree program #author.program in the degree program #author.program
] else [ ] else [
@ -41,7 +44,7 @@
] ]
// university // university
#pad(top: 0.5cm)[ #pad()[
#if text.lang == "de" [ #if text.lang == "de" [
an der an der
] else if text.lang == "en" [ ] else if text.lang == "en" [
@ -53,7 +56,7 @@
#author.university #author.university
] ]
#set align(horizon + left) #set align(bottom + left)
#if text.lang == "de" [ #if text.lang == "de" [
#table( #table(

View File

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

View File

@ -11,6 +11,16 @@
#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(
@ -18,7 +28,7 @@
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
@ -31,6 +41,24 @@
)]]] )]]]
} }
#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) = {
let thesis = config.thesis let thesis = config.thesis
@ -47,12 +75,19 @@
show heading: set text( show heading: set text(
font: style.heading.font, font: style.heading.font,
weight: "semibold", weight: "bold",
) )
set heading(supplement: [chapter]) let header-supplement = if config.lang == "de" {
"Kapitel"
} else {
"chapter"
}
set heading(supplement: [#header-supplement])
set math.equation(numbering: "(1)") set math.equation(numbering: "(1)")
show math.equation: set text(font: "Fira Math", size: 12pt)
// Set header spacing // Set header spacing
show heading.where(level: 1): it => v(2em) + it + v(1em) show heading.where(level: 1): it => v(2em) + it + v(1em)
@ -60,14 +95,112 @@
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( set raw(tab-size: style.code.tab-size)
tab-size: style.code.tab-size, show raw.where(block: false): it => box(
theme: style.code.theme, 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 raw: set text(font: style.code.font) 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: "medium")[
#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 // APA style table
set table( set table(
inset: 0.5em, inset: 0.5em,
@ -80,7 +213,7 @@
} else if y < 2 { } else if y < 2 {
1pt 1pt
} else { } else {
0pt 0.5pt
}, },
bottom: if y == 0 { bottom: if y == 0 {
1pt 1pt
@ -111,9 +244,9 @@
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.logo-height + style top: style.page.margin.top + style.header.underline-top-padding + style
.header .header
.underline-top-padding + style.header.content-padding, .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,
@ -137,12 +270,14 @@
} }
}, },
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(
@ -156,55 +291,35 @@
], ],
header: context { header: context {
set align(left) set align(left)
if here().page() == 1 { let current-page = here().page()
if current-page == 1 {
// logo of ABB and DHBW // logo of ABB and DHBW
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%),
// left align logo of ABB // left align logo of ABB
align(left, image("res/ABB.svg", height: style.header.logo-height)), align(left, image(style.header.logo-image, height: style.header.logo-height)),
// 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-prelude>) } else if query(<end-of-content>)
.first() .first()
.location() .location()
.page() <= here().page() { .page() >= current-page and query(<end-of-prelude>)
let headers-before = query( .first()
selector(heading.where(numbering: "1.", level: 1)).before(here()), .location()
) .page() < current-page + 1 {
let heading = currentH()
let header-title = thesis.title
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),
)
heading.at(0)
h(0.5em)
heading.at(1)
v(style.header.underline-top-padding - 1em) v(style.header.underline-top-padding - 1em)
line(length: 100%) line(length: 100%)
} else { } else {
grid( config.thesis.title
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%)
} }
@ -215,13 +330,13 @@
} }
#let content_styled(config, body) = { #let content_styled(config, body) = {
set heading(numbering: "1.") set heading(numbering: "1.1.1")
body body
} }
#let end_styled(config, body) = { #let end_styled(config, body) = {
set heading(numbering: "1.") set heading(numbering: "1.1.1")
body body
} }

View File

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

View File

@ -6,4 +6,8 @@ oidc:
potato: potato:
short: potato short: potato
desc: "#lorem(50)" desc: "#lorem(50)"
HTTP:
short: HTTP
long: Hyper Text Transfer Protocol

View File

@ -3,8 +3,9 @@
#import "abstract.typ": abstract, summary #import "abstract.typ": abstract, summary
#show: dhbw-template.with(( #show: dhbw-template.with((
lang: "en", lang: "de",
region: "en", region: "de",
draft: false,
author: ( author: (
name: "Sven Vogel", name: "Sven Vogel",
semester: 4, semester: 4,
@ -14,7 +15,8 @@
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",
@ -24,10 +26,12 @@
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: yaml("glossary.yml"),
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
@ -47,21 +51,27 @@
#lorem(200) #lorem(200)
@einstein @einstein
= Lorem Ipsum 3 = Lorem Ipsum 3 <sec:hello>
#lorem(15) #lorem(15) t `Hello, World!` #lorem(50)
$ $
angle.l a, b angle.r &= arrow(a) dot arrow(b) \ angle.l a, b angle.r &= arrow(a) dot arrow(b) \
&= a_1 b_1 + a_2 b_2 + ... a_n b_n \ &= a_1 b_1 + a_2 b_2 + ... a_n b_n \
&= sum_(i=1)^n a_i b_i. &= sum_(i=1)^n a_i b_i. \
integral_2^4(3x + 4x^2)
$ $
#lorem(140) #lorem(140)
#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(
@ -69,49 +79,39 @@ $
table.header[Date][Exercise Type][Calories Burned], table.header[Date][Exercise Type][Calories Burned],
[2023-03-15], [Swimming], [400], [2023-03-15], [Swimming], [400],
[2023-03-17], [Weightlifting], [250], [2023-03-17], [Weightlifting], [250],
[2023-03-18], [Yoga], [200]), [2023-03-18], [Yoga], [200],
caption: [ Some table ]) [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() {
// Get the file path from the environment variable println!("Hello, World!!!");
let file_path = match env::var("OUTPUT_FILE") { }
Ok(path) => path, ```,
Err(_) => { caption: [Some code],
eprintln!("Error: OUTPUT_FILE environment variable is not set"); )
return;
}
};
// Open the file in append mode, create it if it doesn't exist #lorem(100)
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;
}
};
// Write "Hello, World" to the file #pagebreak()
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

@ -30,3 +30,5 @@
appendices: none, appendices: none,
), ),
)) ))
= Heading

View File

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

View File

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