Compare commits
No commits in common. "main" and "v0.4.1" have entirely different histories.
|
@ -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
|
||||||
|
|
|
@ -3,24 +3,21 @@ 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:
|
||||||
|
|
|
@ -5,12 +5,16 @@ on: [push]
|
||||||
jobs:
|
jobs:
|
||||||
run-ci-linux:
|
run-ci-linux:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
TYPST_INSTALL: $HOME/.typst
|
||||||
|
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: Setup Nix
|
- name: Install Typst CLI
|
||||||
uses: cachix/install-nix-action@v27
|
run: curl -fsSL https://typst.community/typst-install/install.sh | sh -s "$TYPST_VERSION"
|
||||||
|
- uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
nix_path: nixpkgs=channel:nixos-unstable
|
python-version: '3.11'
|
||||||
- name: Run CI
|
- name: Run CI
|
||||||
run: nix-shell --run ./run-ci.sh
|
run: export PATH="$TYPST_INSTALL/bin:$PATH" && bash -c ./run-ci.sh
|
||||||
|
|
|
@ -1,30 +1,32 @@
|
||||||
name: release
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
# Sequence of patterns matched against refs/tags
|
||||||
tags:
|
tags:
|
||||||
- 'v*.*.*'
|
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
|
||||||
|
|
||||||
|
name: Create Release
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
build:
|
||||||
|
name: Create Release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository code
|
- name: Check out repository code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Setup Nix
|
- name: Install Typst CLI
|
||||||
uses: cachix/install-nix-action@v27
|
run: curl -fsSL https://typst.community/typst-install/install.sh | sh -s "$TYPST_VERSION"
|
||||||
|
- uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
nix_path: nixpkgs=channel:nixos-unstable
|
python-version: '3.11'
|
||||||
- name: Run CI
|
- name: Run CI
|
||||||
run: nix-shell --run ./run-ci.sh
|
run: export PATH="$TYPST_INSTALL/bin:$PATH" && bash -c ./run-ci.sh
|
||||||
- name: Setup go
|
- name: Create Release
|
||||||
uses: https://github.com/actions/setup-go@v4
|
id: create_release
|
||||||
|
uses: actions/create-release@latest
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.PAT }}
|
||||||
with:
|
with:
|
||||||
go-version: '>=1.20.1'
|
tag_name: ${{ github.ref }}
|
||||||
- name: Create release
|
release_name: Release ${{ github.ref }}
|
||||||
id: create-release
|
draft: false
|
||||||
uses: https://gitea.com/actions/release-action@main
|
prerelease: false
|
||||||
with:
|
|
||||||
files: |-
|
|
||||||
example.pdf
|
|
||||||
api_key: '${{secrets.RELEASE_TOKEN}}'
|
|
26
run-ci.sh
26
run-ci.sh
|
@ -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"
|
||||||
|
|
42
run-fmt.sh
42
run-fmt.sh
|
@ -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
|
|
13
shell.nix
13
shell.nix
|
@ -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
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -30,10 +30,7 @@ SOFTWARE.*/
|
||||||
#let __query_labels_with_key(loc, key, before: false) = {
|
#let __query_labels_with_key(loc, key, before: false) = {
|
||||||
if before {
|
if before {
|
||||||
query(
|
query(
|
||||||
selector(label(__glossary_label_prefix + key)).before(
|
selector(label(__glossary_label_prefix + key)).before(loc, inclusive: false),
|
||||||
loc,
|
|
||||||
inclusive: false,
|
|
||||||
),
|
|
||||||
loc,
|
loc,
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
@ -59,18 +56,13 @@ SOFTWARE.*/
|
||||||
let entlong = entry.at("long", default: "")
|
let entlong = entry.at("long", default: "")
|
||||||
let textLink = if display != none {
|
let textLink = if display != none {
|
||||||
[#display]
|
[#display]
|
||||||
} else if (
|
} else if (is_first or long == true) and entlong != [] and entlong != "" and long != false {
|
||||||
is_first or long == true
|
|
||||||
) and entlong != [] and entlong != "" and long != false {
|
|
||||||
[#entlong (#entry.short#suffix)]
|
[#entlong (#entry.short#suffix)]
|
||||||
} else {
|
} else {
|
||||||
[#entry.short#suffix]
|
[#entry.short#suffix]
|
||||||
}
|
}
|
||||||
|
|
||||||
[#link(
|
[#link(label(entry.key), textLink)#label(__glossary_label_prefix + entry.key)]
|
||||||
label(entry.key),
|
|
||||||
textLink,
|
|
||||||
)#label(__glossary_label_prefix + entry.key)]
|
|
||||||
} else {
|
} else {
|
||||||
panic(__not-found-panic-error-msg(key))
|
panic(__not-found-panic-error-msg(key))
|
||||||
}
|
}
|
||||||
|
@ -108,18 +100,13 @@ SOFTWARE.*/
|
||||||
[#entplural]
|
[#entplural]
|
||||||
}
|
}
|
||||||
|
|
||||||
let textLink = if (
|
let textLink = if (is_first or long == true) and entlong != [] and entlong != "" and long != false {
|
||||||
is_first or long == true
|
|
||||||
) and entlong != [] and entlong != "" and long != false {
|
|
||||||
[#entlong (#short)]
|
[#entlong (#short)]
|
||||||
} else {
|
} else {
|
||||||
[#short]
|
[#short]
|
||||||
}
|
}
|
||||||
|
|
||||||
[#link(
|
[#link(label(entry.key), textLink)#label(__glossary_label_prefix + entry.key)]
|
||||||
label(entry.key),
|
|
||||||
textLink,
|
|
||||||
)#label(__glossary_label_prefix + entry.key)]
|
|
||||||
} else {
|
} else {
|
||||||
panic(__not-found-panic-error-msg(key))
|
panic(__not-found-panic-error-msg(key))
|
||||||
}
|
}
|
||||||
|
@ -129,9 +116,7 @@ SOFTWARE.*/
|
||||||
// show rule to make the references for glossarium
|
// show rule to make the references for glossarium
|
||||||
#let make-glossary(body) = {
|
#let make-glossary(body) = {
|
||||||
show ref: r => {
|
show ref: r => {
|
||||||
if r.element != none and r.element.func() == figure and r
|
if r.element != none and r.element.func() == figure and r.element.kind == __glossarium_figure {
|
||||||
.element
|
|
||||||
.kind == __glossarium_figure {
|
|
||||||
// call to the general citing function
|
// call to the general citing function
|
||||||
gls(str(r.target), suffix: r.citation.supplement)
|
gls(str(r.target), suffix: r.citation.supplement)
|
||||||
} else {
|
} else {
|
||||||
|
@ -185,13 +170,7 @@ SOFTWARE.*/
|
||||||
numbering: none,
|
numbering: none,
|
||||||
caption: {
|
caption: {
|
||||||
context {
|
context {
|
||||||
let key = if entry.key.ends-with("__glossary_entry") {
|
let term_references = __query_labels_with_key(here(), entry.key)
|
||||||
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 [
|
if term_references.len() != 0 or show-all [
|
||||||
#let desc = entry.at("desc", default: "")
|
#let desc = entry.at("desc", default: "")
|
||||||
#let long = entry.at("long", default: "")
|
#let long = entry.at("long", default: "")
|
||||||
|
@ -199,7 +178,6 @@ SOFTWARE.*/
|
||||||
#let hasDesc = desc != "" and desc != []
|
#let hasDesc = desc != "" and desc != []
|
||||||
|
|
||||||
#block(
|
#block(
|
||||||
below: 1.5em,
|
|
||||||
par(hanging-indent: 1em)[
|
par(hanging-indent: 1em)[
|
||||||
#text(weight: "bold", entry.short)
|
#text(weight: "bold", entry.short)
|
||||||
#if hasLong and hasDesc [
|
#if hasLong and hasDesc [
|
||||||
|
@ -215,9 +193,7 @@ SOFTWARE.*/
|
||||||
.sorted(key: x => x.page())
|
.sorted(key: x => x.page())
|
||||||
.fold(
|
.fold(
|
||||||
(values: (), pages: ()),
|
(values: (), pages: ()),
|
||||||
((values, pages), x) => if pages.contains(
|
((values, pages), x) => if pages.contains(x.page()) {
|
||||||
x.page(),
|
|
||||||
) {
|
|
||||||
(values: values, pages: pages)
|
(values: values, pages: pages)
|
||||||
} else {
|
} else {
|
||||||
values.push(x)
|
values.push(x)
|
||||||
|
@ -231,10 +207,7 @@ SOFTWARE.*/
|
||||||
if page-numbering == none {
|
if page-numbering == none {
|
||||||
page-numbering = "1"
|
page-numbering = "1"
|
||||||
}
|
}
|
||||||
link(x)[#numbering(
|
link(x)[#numbering(page-numbering, ..counter(page).at(x))]
|
||||||
page-numbering,
|
|
||||||
..counter(page).at(x),
|
|
||||||
)]
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.join(", ")
|
.join(", ")
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
// Edited: 08.07.2024
|
// Edited: 08.07.2024
|
||||||
// License: MIT
|
// License: MIT
|
||||||
|
|
||||||
#let glossary(entries, config) = {
|
#let glossary(entries) = {
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
type(entries) == dictionary,
|
type(entries) == dictionary,
|
||||||
|
@ -54,13 +54,13 @@
|
||||||
message: "The optional group of glossary entry `" + k + "` is not a string",
|
message: "The optional group of glossary entry `" + k + "` is not a string",
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
let acronym_group = if config.lang == "de" {
|
let acronym_group = if (context text.lang) == "de" {
|
||||||
"Abkürzungsverzeichnis"
|
"Akronyme"
|
||||||
} else {
|
} else {
|
||||||
"List of Acronyms"
|
"Acronyms"
|
||||||
}
|
}
|
||||||
|
|
||||||
let glossary_group = if config.lang == "de" {
|
let glossary_group = if (context text.lang) == "de" {
|
||||||
"Begriffe"
|
"Begriffe"
|
||||||
} else {
|
} else {
|
||||||
"Glossary"
|
"Glossary"
|
||||||
|
@ -75,14 +75,8 @@
|
||||||
// create dedicated entries for
|
// create dedicated entries for
|
||||||
// acronym and glossary
|
// acronym and glossary
|
||||||
if "long" in v and "desc" in v {
|
if "long" in v and "desc" in v {
|
||||||
processed_glossary.insert(
|
processed_glossary.insert(k, (short: v.short, long: v.long, group: acronym_group))
|
||||||
k,
|
processed_glossary.insert(k + "__glossary_entry", (short: v.short, desc: v.desc, long: v.long, group: glossary_group))
|
||||||
(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 {
|
} else {
|
||||||
processed_glossary.insert(k, v)
|
processed_glossary.insert(k, v)
|
||||||
processed_glossary.at(k).group = group
|
processed_glossary.at(k).group = group
|
||||||
|
|
20
src/lib.typ
20
src/lib.typ
|
@ -31,13 +31,7 @@
|
||||||
inset: (left: 2pt, right: 2pt),
|
inset: (left: 2pt, right: 2pt),
|
||||||
outset: (top: 4pt, bottom: 4pt),
|
outset: (top: 4pt, bottom: 4pt),
|
||||||
fill: ABB-GRAY-06,
|
fill: ABB-GRAY-06,
|
||||||
[#box(
|
[#box(fill: rgb(color), radius: 2pt, inset: 0pt, width: 0.75em, height: 0.75em) #text(
|
||||||
fill: rgb(color),
|
|
||||||
radius: 2pt,
|
|
||||||
inset: 0pt,
|
|
||||||
width: 0.75em,
|
|
||||||
height: 0.75em,
|
|
||||||
) #text(
|
|
||||||
font: default-config.style.code.font,
|
font: default-config.style.code.font,
|
||||||
size: default-config.style.code.size,
|
size: default-config.style.code.size,
|
||||||
content,
|
content,
|
||||||
|
@ -46,17 +40,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
#let url(label, content) = {
|
#let url(label, content) = {
|
||||||
link(label)[#underline(
|
link(label)[#underline(offset: 2pt, stroke: 0.5pt + blue, text(fill: blue)[
|
||||||
offset: 2pt,
|
|
||||||
stroke: 0.5pt + blue,
|
|
||||||
text(fill: blue)[
|
|
||||||
#content
|
#content
|
||||||
#let domain = label.find(regex("\w+\.\w+(?:\.\w+)*"))
|
#let domain = label.find(regex("\w+\.\w+(?:\.\w+)*"))
|
||||||
#if domain.len() > 0 [
|
#if domain.len() > 0 [
|
||||||
(#domain)
|
(#domain)
|
||||||
]
|
]
|
||||||
],
|
])]
|
||||||
)]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// start of template pages and styles
|
// start of template pages and styles
|
||||||
|
@ -103,10 +93,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,
|
show-all: true,
|
||||||
disable-back-references: true,
|
disable-back-references: true,
|
||||||
enable-group-pagebreak: true,
|
enable-group-pagebreak: true,
|
||||||
glossary(config.thesis.glossary, config),
|
glossary(config.thesis.glossary),
|
||||||
)
|
)
|
||||||
|
|
||||||
pagebreak(weak: true)
|
pagebreak(weak: true)
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
]
|
]
|
||||||
|
|
||||||
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
|
||||||
]
|
]
|
||||||
|
|
|
@ -80,15 +80,9 @@
|
||||||
"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: [#header-supplement]),
|
target: heading.where(supplement: [chapter]),
|
||||||
title: title,
|
title: title,
|
||||||
indent: auto,
|
indent: auto,
|
||||||
)
|
)
|
||||||
|
|
|
@ -16,8 +16,7 @@
|
||||||
|
|
||||||
// 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)
|
||||||
|
@ -64,9 +63,7 @@
|
||||||
stroke: none,
|
stroke: none,
|
||||||
[*Verfasser:*], author.name,
|
[*Verfasser:*], author.name,
|
||||||
[*Bearbeitungszeitraum:*], thesis.timeframe,
|
[*Bearbeitungszeitraum:*], thesis.timeframe,
|
||||||
[*Matrikelnummer, Kurs:*],
|
[*Matrikelnummer, Kurs:*], str(author.matriculation-number) + ", " + author.course,
|
||||||
str(author.matriculation-number) + ", " + author.course,
|
|
||||||
|
|
||||||
[*Ausbildungsbetrieb:*], author.company,
|
[*Ausbildungsbetrieb:*], author.company,
|
||||||
[*Betrieblicher Betreuer:*], author.supervisor,
|
[*Betrieblicher Betreuer:*], author.supervisor,
|
||||||
[*Abgabedatum:*], thesis.submission-date,
|
[*Abgabedatum:*], thesis.submission-date,
|
||||||
|
@ -79,9 +76,7 @@
|
||||||
stroke: none,
|
stroke: none,
|
||||||
[*Author:*], author.name,
|
[*Author:*], author.name,
|
||||||
[*Editing period:*], thesis.timeframe,
|
[*Editing period:*], thesis.timeframe,
|
||||||
[*Matriculation number, course:*],
|
[*Matriculation number, course:*], str(author.matriculation-number) + ", " + author.course,
|
||||||
str(author.matriculation-number) + ", " + author.course,
|
|
||||||
|
|
||||||
[*Training company:*], author.company,
|
[*Training company:*], author.company,
|
||||||
[*Company supervisor:*], author.supervisor,
|
[*Company supervisor:*], author.supervisor,
|
||||||
[*Submission date:*], thesis.submission-date,
|
[*Submission date:*], thesis.submission-date,
|
||||||
|
|
104
src/style.typ
104
src/style.typ
|
@ -12,13 +12,7 @@
|
||||||
#let watermark-color = luma(50%).transparentize(70%)
|
#let watermark-color = luma(50%).transparentize(70%)
|
||||||
|
|
||||||
#let watermark-pattern = pattern(size: (5pt, 5pt))[
|
#let watermark-pattern = pattern(size: (5pt, 5pt))[
|
||||||
#place(
|
#place(line(start: (50%, 0%), end: (50%, 100%), stroke: (paint: watermark-color, thickness: 3pt)))
|
||||||
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 {
|
||||||
|
@ -35,10 +29,7 @@
|
||||||
#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) = {
|
#let numberingH(c) = {
|
||||||
|
@ -78,13 +69,7 @@
|
||||||
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 math.equation(numbering: "(1)")
|
||||||
|
|
||||||
|
@ -126,27 +111,17 @@
|
||||||
e => {
|
e => {
|
||||||
let (i, l) = e
|
let (i, l) = e
|
||||||
let n = i + 1
|
let n = i + 1
|
||||||
let n_str = if (calc.rem(n, 1) == 0) or (true and i == 0) {
|
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 }
|
||||||
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))
|
(n_str + h(0.5em), raw(block: true, lang: lang, l))
|
||||||
},
|
})
|
||||||
)
|
}
|
||||||
} else {
|
else {
|
||||||
(
|
( ( 1fr, ),
|
||||||
(1fr,),
|
|
||||||
( left, ),
|
( left, ),
|
||||||
e => {
|
e => {
|
||||||
let (i, l) = e
|
let (i, l) = e
|
||||||
raw(block: true, lang: lang, l)
|
raw(block: true, lang: lang, l)
|
||||||
},
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -164,13 +139,9 @@
|
||||||
.enumerate()
|
.enumerate()
|
||||||
.map(make_row)
|
.map(make_row)
|
||||||
.flatten()
|
.flatten()
|
||||||
.map(c => if c.has("text") and c.text == "" {
|
.map(c => if c.has("text") and c.text == "" { v(1em) } else { c })
|
||||||
v(1em)
|
|
||||||
} else {
|
|
||||||
c
|
|
||||||
})
|
|
||||||
)
|
)
|
||||||
},
|
}
|
||||||
)
|
)
|
||||||
#v(-1em)
|
#v(-1em)
|
||||||
#align(center + top, it.caption)
|
#align(center + top, it.caption)
|
||||||
|
@ -207,20 +178,8 @@
|
||||||
stroke: (x, y) => (
|
stroke: (x, y) => (
|
||||||
left: none,
|
left: none,
|
||||||
right: none,
|
right: none,
|
||||||
top: if y == 0 {
|
top: if y == 0 { 1.5pt } else if y < 2 { 1pt } else { 0.5pt },
|
||||||
1.5pt
|
bottom: if y == 0 { 1pt } else { 1.5pt } ))
|
||||||
} else if y < 2 {
|
|
||||||
1pt
|
|
||||||
} else {
|
|
||||||
0.5pt
|
|
||||||
},
|
|
||||||
bottom: if y == 0 {
|
|
||||||
1pt
|
|
||||||
} else {
|
|
||||||
1.5pt
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
||||||
// make table header bold
|
// make table header bold
|
||||||
show table.cell.where(y: 0): set text(weight: "bold")
|
show table.cell.where(y: 0): set text(weight: "bold")
|
||||||
|
@ -229,8 +188,7 @@
|
||||||
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,26 +201,17 @@
|
||||||
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.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())
|
||||||
|
@ -279,11 +228,7 @@
|
||||||
set align(center)
|
set align(center)
|
||||||
numbering("I", page-counter)
|
numbering("I", page-counter)
|
||||||
} else if query(<end-of-content>).first().location().page() >= page-number {
|
} else if query(<end-of-content>).first().location().page() >= page-number {
|
||||||
numbering(
|
numbering("1 / 1", 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)
|
||||||
}
|
}
|
||||||
|
@ -303,13 +248,7 @@
|
||||||
// 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-content>).first().location().page() >= current-page and query(<end-of-prelude>).first().location().page() < current-page + 1 {
|
||||||
.first()
|
|
||||||
.location()
|
|
||||||
.page() >= current-page and query(<end-of-prelude>)
|
|
||||||
.first()
|
|
||||||
.location()
|
|
||||||
.page() < current-page + 1 {
|
|
||||||
let heading = currentH()
|
let heading = currentH()
|
||||||
|
|
||||||
heading.at(0)
|
heading.at(0)
|
||||||
|
@ -322,8 +261,7 @@
|
||||||
v(style.header.underline-top-padding - 1em)
|
v(style.header.underline-top-padding - 1em)
|
||||||
line(length: 100%)
|
line(length: 100%)
|
||||||
}
|
}
|
||||||
},
|
})
|
||||||
)
|
|
||||||
|
|
||||||
body
|
body
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
#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,
|
draft: false,
|
||||||
author: (
|
author: (
|
||||||
name: "Sven Vogel",
|
name: "Sven Vogel",
|
||||||
|
@ -51,7 +51,7 @@
|
||||||
#lorem(200)
|
#lorem(200)
|
||||||
@einstein
|
@einstein
|
||||||
|
|
||||||
= Lorem Ipsum 3 <sec:hello>
|
= Lorem Ipsum 3
|
||||||
|
|
||||||
#lorem(15) t `Hello, World!` #lorem(50)
|
#lorem(15) t `Hello, World!` #lorem(50)
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ $
|
||||||
lorem(200),
|
lorem(200),
|
||||||
)
|
)
|
||||||
|
|
||||||
#url("https://github.com", "text") @sec:hello
|
#url("https://github.com", "text")
|
||||||
|
|
||||||
#lorem(50)
|
#lorem(50)
|
||||||
|
|
||||||
|
|
|
@ -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: (
|
||||||
|
|
|
@ -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",
|
||||||
this-key-is-not-in-config: "Ha Ha",
|
this-key-is-not-in-config: "Ha Ha",
|
||||||
region: "en",
|
region: "en",
|
||||||
|
@ -14,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",
|
||||||
|
@ -27,8 +27,4 @@
|
||||||
keywords: ( "IT", "other stuff" ),
|
keywords: ( "IT", "other stuff" ),
|
||||||
bibliography: none,
|
bibliography: none,
|
||||||
glossary: none,
|
glossary: none,
|
||||||
appendices: none,
|
appendices: none)))
|
||||||
),
|
|
||||||
))
|
|
||||||
|
|
||||||
= Heading
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
|
|
||||||
#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: (
|
||||||
university: "DHBW Mannheim",
|
university: "DHBW Mannheim",
|
||||||
company: "ABB AG",
|
company: "ABB AG",
|
||||||
supervisor: none,
|
supervisor: none,
|
||||||
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",
|
||||||
|
@ -21,6 +21,4 @@
|
||||||
keywords: ( "IT", "other stuff" ),
|
keywords: ( "IT", "other stuff" ),
|
||||||
bibliography: none,
|
bibliography: none,
|
||||||
glossary: none,
|
glossary: none,
|
||||||
appendices: none,
|
appendices: none)))
|
||||||
),
|
|
||||||
))
|
|
||||||
|
|
|
@ -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
|
|
||||||
|
|
Loading…
Reference in New Issue