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
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 34s
Details
This commit is contained in:
commit
dd902adebd
|
@ -40,7 +40,7 @@ SOFTWARE.*/
|
||||||
|
|
||||||
// key not found error
|
// key not found error
|
||||||
#let __not-found-panic-error-msg(key) = {
|
#let __not-found-panic-error-msg(key) = {
|
||||||
__glossarium_error_prefix+"key '"+key+"' not found"
|
__glossarium_error_prefix + "key '" + key + "' not found"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reference a term
|
// Reference a term
|
||||||
|
@ -80,10 +80,10 @@ SOFTWARE.*/
|
||||||
let gloss = __query_labels_with_key(here(), key, before: true)
|
let gloss = __query_labels_with_key(here(), key, before: true)
|
||||||
|
|
||||||
let is_first = gloss == ()
|
let is_first = gloss == ()
|
||||||
let entlongplural = entry.at("longplural", default: "");
|
let entlongplural = entry.at("longplural", default: "")
|
||||||
let entlong = if entlongplural == [] or entlongplural == "" {
|
let entlong = if entlongplural == [] or entlongplural == "" {
|
||||||
// if the entry long plural is not provided, then fallback to adding 's' suffix
|
// if the entry long plural is not provided, then fallback to adding 's' suffix
|
||||||
let entlong = entry.at("long", default: "");
|
let entlong = entry.at("long", default: "")
|
||||||
if entlong != [] and entlong != "" {
|
if entlong != [] and entlong != "" {
|
||||||
[#entlong#suffix]
|
[#entlong#suffix]
|
||||||
} else {
|
} else {
|
||||||
|
@ -93,7 +93,7 @@ SOFTWARE.*/
|
||||||
[#entlongplural]
|
[#entlongplural]
|
||||||
}
|
}
|
||||||
|
|
||||||
let entplural = entry.at("plural", default: "");
|
let entplural = entry.at("plural", default: "")
|
||||||
let short = if entplural == [] or entplural == "" {
|
let short = if entplural == [] or entplural == "" {
|
||||||
[#entry.short#suffix]
|
[#entry.short#suffix]
|
||||||
} else {
|
} else {
|
||||||
|
@ -171,23 +171,25 @@ SOFTWARE.*/
|
||||||
caption: {
|
caption: {
|
||||||
context {
|
context {
|
||||||
let term_references = __query_labels_with_key(here(), entry.key)
|
let term_references = __query_labels_with_key(here(), entry.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: "")
|
||||||
let hasLong = long != "" and long != []
|
#let hasLong = long != "" and long != []
|
||||||
let hasDesc = desc != "" and desc != []
|
#let hasDesc = desc != "" and desc != []
|
||||||
grid(
|
|
||||||
columns: 2,
|
#block(
|
||||||
column-gutter: 1em,
|
par(hanging-indent: 1em)[
|
||||||
text(weight: "bold", entry.short),
|
#text(weight: "bold", entry.short)
|
||||||
{
|
#if hasLong {
|
||||||
if hasLong {
|
text(entry.long)
|
||||||
text(weight: "bold", entry.long)
|
|
||||||
}
|
}
|
||||||
if hasLong and hasDesc [:]
|
#if hasLong and hasDesc [:]
|
||||||
if hasDesc [ #desc ] else [. ]
|
#if hasDesc [ #desc ]
|
||||||
if disable-back-references != true {
|
#if disable-back-references != true {
|
||||||
term_references.map(x => x.location()).sorted(key: x => x.page()).fold(
|
term_references
|
||||||
|
.map(x => x.location())
|
||||||
|
.sorted(key: x => x.page())
|
||||||
|
.fold(
|
||||||
(values: (), pages: ()),
|
(values: (), pages: ()),
|
||||||
((values, pages), x) => if pages.contains(x.page()) {
|
((values, pages), x) => if pages.contains(x.page()) {
|
||||||
(values: values, pages: pages)
|
(values: values, pages: pages)
|
||||||
|
@ -196,25 +198,29 @@ SOFTWARE.*/
|
||||||
pages.push(x.page())
|
pages.push(x.page())
|
||||||
(values: values, pages: pages)
|
(values: values, pages: pages)
|
||||||
},
|
},
|
||||||
).values.map(x => {
|
)
|
||||||
let page-numbering = x.page-numbering();
|
.values
|
||||||
|
.map(x => {
|
||||||
|
let page-numbering = x.page-numbering()
|
||||||
if page-numbering == none {
|
if page-numbering == none {
|
||||||
page-numbering = "1"
|
page-numbering = "1"
|
||||||
}
|
}
|
||||||
link(x)[#numbering(page-numbering, ..counter(page).at(x))]
|
link(x)[#numbering(page-numbering, ..counter(page).at(x))]
|
||||||
}
|
}
|
||||||
).join(", ")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
.join(", ")
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
)
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
)[] #label(entry.key)
|
)[] #label(entry.key)
|
||||||
#parbreak()
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if enable-group-pagebreak { pagebreak(weak: true) }
|
if enable-group-pagebreak {
|
||||||
|
pagebreak(weak: true)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
|
@ -14,61 +14,81 @@
|
||||||
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,
|
||||||
message: "The glossary entry `" + k + "` is not a dictionary")
|
message: "The glossary entry `" + k + "` is not a dictionary",
|
||||||
|
)
|
||||||
|
|
||||||
for key in v.keys() {
|
for key in v.keys() {
|
||||||
assert(
|
assert(
|
||||||
key in ("short", "long", "desc", "group"),
|
key in ("short", "long", "desc", "group"),
|
||||||
message: "Found unexpected key `" + key + "` in glossary entry `" + k)
|
message: "Found unexpected key `" + key + "` in glossary entry `" + k,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
type(v.short) == str,
|
type(v.short) == str,
|
||||||
message: "The short form of glossary entry `" + k + "` is not a string")
|
message: "The short form of glossary entry `" + k + "` is not a string",
|
||||||
|
)
|
||||||
|
|
||||||
if "long" in v {
|
if "long" in v {
|
||||||
assert(
|
assert(
|
||||||
type(v.long) == str,
|
type(v.long) == str,
|
||||||
message: "The long form of glossary entry `" + k + "` is not a string")
|
message: "The long form of glossary entry `" + k + "` is not a string",
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if "desc" in v {
|
if "desc" in v {
|
||||||
assert(
|
assert(
|
||||||
type(v.desc) == str,
|
type(v.desc) == str,
|
||||||
message: "The description of glossary entry `" + k + "` is not a string")
|
message: "The description of glossary entry `" + k + "` is not a string",
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if "group" in v {
|
if "group" in v {
|
||||||
assert(
|
assert(
|
||||||
type(v.group) == str,
|
type(v.group) == str,
|
||||||
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 (context text.lang) == "de" {
|
||||||
if (context text.lang) == "de" {
|
|
||||||
"Akronyme"
|
"Akronyme"
|
||||||
} else {
|
} else {
|
||||||
"Acronyms"
|
"Acronyms"
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if (context text.lang) == "de" {
|
let glossary_group = if (context text.lang) == "de" {
|
||||||
"Begriffe"
|
"Begriffe"
|
||||||
} else {
|
} else {
|
||||||
"Terms"
|
"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, group: glossary_group))
|
||||||
|
} else {
|
||||||
|
processed_glossary.insert(k, v)
|
||||||
|
processed_glossary.at(k).group = group
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
entries.at(k).group = group
|
return processed_glossary.pairs().map(((key, entry)) => (
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return entries.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: ""),
|
||||||
))
|
))
|
||||||
}
|
}
|
51
src/lib.typ
51
src/lib.typ
|
@ -7,23 +7,38 @@
|
||||||
// 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
|
||||||
#import "pages/preface.typ": new-preface
|
#import "pages/preface.typ": new-preface
|
||||||
#import "pages/appendix.typ": show-appendix
|
#import "pages/appendix.typ": show-appendix
|
||||||
|
|
||||||
#let group-break()= {
|
#let group-break() = {
|
||||||
[#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,
|
||||||
|
)],
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
// 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)
|
||||||
|
@ -36,12 +51,14 @@
|
||||||
#set document(
|
#set document(
|
||||||
author: config.author.name,
|
author: config.author.name,
|
||||||
keywords: config.thesis.keywords,
|
keywords: config.thesis.keywords,
|
||||||
title: config.thesis.title)
|
title: config.thesis.title,
|
||||||
|
)
|
||||||
|
|
||||||
// configure text locale
|
// configure text locale
|
||||||
#set text(
|
#set text(
|
||||||
lang: config.lang,
|
lang: config.lang,
|
||||||
region: config.region)
|
region: config.region,
|
||||||
|
)
|
||||||
|
|
||||||
// preppend title page
|
// preppend title page
|
||||||
#new_title_page(config)
|
#new_title_page(config)
|
||||||
|
@ -66,9 +83,11 @@
|
||||||
|
|
||||||
#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: true,
|
||||||
disable-back-references: true,
|
disable-back-references: true,
|
||||||
enable-group-pagebreak: true,
|
enable-group-pagebreak: true,
|
||||||
glossary(config.thesis.glossary))
|
glossary(config.thesis.glossary),
|
||||||
|
)
|
||||||
|
|
||||||
pagebreak(weak: true)
|
pagebreak(weak: true)
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,8 @@
|
||||||
// Edited: 28.06.2024
|
// Edited: 28.06.2024
|
||||||
// License: MIT
|
// License: MIT
|
||||||
|
|
||||||
#let new_abstract(config) = context {
|
#let new_abstract(config) = (
|
||||||
|
context {
|
||||||
|
|
||||||
set align(center + horizon)
|
set align(center + horizon)
|
||||||
|
|
||||||
|
@ -24,4 +25,5 @@
|
||||||
|
|
||||||
heading("Abstract")
|
heading("Abstract")
|
||||||
config.thesis.abstract
|
config.thesis.abstract
|
||||||
}
|
}
|
||||||
|
)
|
||||||
|
|
|
@ -6,7 +6,8 @@
|
||||||
// Edited: 28.06.2024
|
// Edited: 28.06.2024
|
||||||
// License: MIT
|
// License: MIT
|
||||||
|
|
||||||
#let show-appendix(config: dictionary) = context {
|
#let show-appendix(config: dictionary) = (
|
||||||
|
context {
|
||||||
counter(heading).update(0)
|
counter(heading).update(0)
|
||||||
|
|
||||||
let title = if text.lang == "en" {
|
let title = if text.lang == "en" {
|
||||||
|
@ -41,4 +42,5 @@
|
||||||
|
|
||||||
config.thesis.appendices
|
config.thesis.appendices
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
)
|
||||||
|
|
|
@ -6,7 +6,8 @@
|
||||||
// Edited: 28.06.2024
|
// Edited: 28.06.2024
|
||||||
// License: MIT
|
// License: MIT
|
||||||
|
|
||||||
#let new_confidentiality_statement_page(config) = context {
|
#let new_confidentiality_statement_page(config) = (
|
||||||
|
context {
|
||||||
|
|
||||||
pagebreak(weak: true)
|
pagebreak(weak: true)
|
||||||
|
|
||||||
|
@ -59,4 +60,5 @@
|
||||||
align(left, {line(length: 6cm)}),
|
align(left, {line(length: 6cm)}),
|
||||||
align(left, if text.lang == "de" [ Ort, Datum ] else if text.lang == "en" [ Place, Date ] else { panic("no translation for language: ", text.lang) }),
|
align(left, if text.lang == "de" [ Ort, Datum ] else if text.lang == "en" [ Place, Date ] else { panic("no translation for language: ", text.lang) }),
|
||||||
align(left, if text.lang == "de" [ Unterschrift ] else if text.lang == "en" [ Signature ] else { panic("no translation for language: ", text.lang) }))
|
align(left, if text.lang == "de" [ Unterschrift ] else if text.lang == "en" [ Signature ] else { panic("no translation for language: ", text.lang) }))
|
||||||
}
|
}
|
||||||
|
)
|
||||||
|
|
|
@ -6,7 +6,8 @@
|
||||||
// Edited: 28.06.2024
|
// Edited: 28.06.2024
|
||||||
// License: MIT
|
// License: MIT
|
||||||
|
|
||||||
#let new_declaration_of_authorship(config) = context {
|
#let new_declaration_of_authorship(config) = (
|
||||||
|
context {
|
||||||
|
|
||||||
pagebreak(weak: true)
|
pagebreak(weak: true)
|
||||||
|
|
||||||
|
@ -61,4 +62,5 @@
|
||||||
align(left, {line(length: 6cm)}),
|
align(left, {line(length: 6cm)}),
|
||||||
align(left, if text.lang == "de" [ Ort, Datum ] else if text.lang == "en" [ Place, Date ] else { panic("no translation for language: ", text.lang) }),
|
align(left, if text.lang == "de" [ Ort, Datum ] else if text.lang == "en" [ Place, Date ] else { panic("no translation for language: ", text.lang) }),
|
||||||
align(left, if text.lang == "de" [ Unterschrift ] else if text.lang == "en" [ Signature ] else { panic("no translation for language: ", text.lang) }))
|
align(left, if text.lang == "de" [ Unterschrift ] else if text.lang == "en" [ Signature ] else { panic("no translation for language: ", text.lang) }))
|
||||||
}
|
}
|
||||||
|
)
|
||||||
|
|
|
@ -10,7 +10,8 @@
|
||||||
// with a specific title and filter by a specifc kind of figure
|
// with a specific title and filter by a specifc kind of figure
|
||||||
// can optionally insert a pagebreak after the outline
|
// can optionally insert a pagebreak after the outline
|
||||||
// NOTE: will not render in case the listing is empty
|
// NOTE: will not render in case the listing is empty
|
||||||
#let render_filtered_outline(title: str, kind: selector) = context {
|
#let render_filtered_outline(title: str, kind: selector) = (
|
||||||
|
context {
|
||||||
|
|
||||||
let elems = query(figure.where(kind: kind), here())
|
let elems = query(figure.where(kind: kind), here())
|
||||||
let count = elems.len()
|
let count = elems.len()
|
||||||
|
@ -20,11 +21,14 @@
|
||||||
pagebreak(weak: true)
|
pagebreak(weak: true)
|
||||||
outline(
|
outline(
|
||||||
title: title,
|
title: title,
|
||||||
target: figure.where(kind: kind))
|
target: figure.where(kind: kind),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
)
|
||||||
|
|
||||||
#let render_figures_outline() = context {
|
#let render_figures_outline() = (
|
||||||
|
context {
|
||||||
let title = if (text.lang == "de") {
|
let title = if (text.lang == "de") {
|
||||||
"Abbildungsverzeichnis"
|
"Abbildungsverzeichnis"
|
||||||
} else if text.lang == "en" {
|
} else if text.lang == "en" {
|
||||||
|
@ -32,9 +36,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
render_filtered_outline(title: title, kind: image)
|
render_filtered_outline(title: title, kind: image)
|
||||||
}
|
}
|
||||||
|
)
|
||||||
|
|
||||||
#let render_table_outline() = context {
|
#let render_table_outline() = (
|
||||||
|
context {
|
||||||
let title = if (text.lang == "de") {
|
let title = if (text.lang == "de") {
|
||||||
"Tabellenverzeichnis"
|
"Tabellenverzeichnis"
|
||||||
} else if text.lang == "en" {
|
} else if text.lang == "en" {
|
||||||
|
@ -42,9 +48,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
render_filtered_outline(title: title, kind: table)
|
render_filtered_outline(title: title, kind: table)
|
||||||
}
|
}
|
||||||
|
)
|
||||||
|
|
||||||
#let render_raw_outline() = context {
|
#let render_raw_outline() = (
|
||||||
|
context {
|
||||||
let title = if (text.lang == "de") {
|
let title = if (text.lang == "de") {
|
||||||
"Quelltextverzeichnis"
|
"Quelltextverzeichnis"
|
||||||
} else if text.lang == "en" {
|
} else if text.lang == "en" {
|
||||||
|
@ -52,9 +60,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
render_filtered_outline(title: title, kind: raw)
|
render_filtered_outline(title: title, kind: raw)
|
||||||
}
|
}
|
||||||
|
)
|
||||||
|
|
||||||
#let render_heading_outline() = context {
|
#let render_heading_outline() = (
|
||||||
|
context {
|
||||||
let title = if (text.lang == "de") {
|
let title = if (text.lang == "de") {
|
||||||
"Inhaltsverzeichnis"
|
"Inhaltsverzeichnis"
|
||||||
} else if text.lang == "en" {
|
} else if text.lang == "en" {
|
||||||
|
@ -65,10 +75,13 @@
|
||||||
outline(
|
outline(
|
||||||
target: heading.where(supplement: [chapter]),
|
target: heading.where(supplement: [chapter]),
|
||||||
title: title,
|
title: title,
|
||||||
indent: auto)
|
indent: auto,
|
||||||
}
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
#let render_appendix_outline() = context {
|
#let render_appendix_outline() = (
|
||||||
|
context {
|
||||||
let supplement = if text.lang == "en" {
|
let supplement = if text.lang == "en" {
|
||||||
[Appendix]
|
[Appendix]
|
||||||
} else {
|
} else {
|
||||||
|
@ -86,16 +99,16 @@
|
||||||
outline(
|
outline(
|
||||||
target: heading.where(supplement: supplement),
|
target: heading.where(supplement: supplement),
|
||||||
title: title,
|
title: title,
|
||||||
indent: auto)
|
indent: auto,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
)
|
||||||
|
|
||||||
#let new_outline() = {
|
#let new_outline() = {
|
||||||
pagebreak(weak: true)
|
pagebreak(weak: true)
|
||||||
|
|
||||||
show outline.entry.where(
|
show outline.entry.where(level: 1): it => {
|
||||||
level: 1,
|
|
||||||
): it => {
|
|
||||||
v(1.5em, weak: true)
|
v(1.5em, weak: true)
|
||||||
strong(it)
|
strong(it)
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,8 @@
|
||||||
// Edited: 28.06.2024
|
// Edited: 28.06.2024
|
||||||
// License: MIT
|
// License: MIT
|
||||||
|
|
||||||
#let new_prerelease_note(config) = context {
|
#let new_prerelease_note(config) = (
|
||||||
|
context {
|
||||||
|
|
||||||
pagebreak(weak: true)
|
pagebreak(weak: true)
|
||||||
|
|
||||||
|
@ -53,4 +54,5 @@
|
||||||
v(1em)
|
v(1em)
|
||||||
h(1em)
|
h(1em)
|
||||||
[#author.name, #datetime.today().display()]
|
[#author.name, #datetime.today().display()]
|
||||||
}
|
}
|
||||||
|
)
|
||||||
|
|
|
@ -6,7 +6,8 @@
|
||||||
// Edited: 28.06.2024
|
// Edited: 28.06.2024
|
||||||
// License: MIT
|
// License: MIT
|
||||||
|
|
||||||
#let new_title_page(config) = context [
|
#let new_title_page(config) = (
|
||||||
|
context [
|
||||||
|
|
||||||
#let thesis = config.thesis
|
#let thesis = config.thesis
|
||||||
#let author = config.author
|
#let author = config.author
|
||||||
|
@ -60,24 +61,12 @@
|
||||||
column-gutter: 1cm,
|
column-gutter: 1cm,
|
||||||
align: left,
|
align: left,
|
||||||
stroke: none,
|
stroke: none,
|
||||||
|
[*Verfasser:*], author.name,
|
||||||
[*Verfasser:*],
|
[*Bearbeitungszeitraum:*], thesis.timeframe,
|
||||||
author.name,
|
[*Matrikelnummer, Kurs:*], str(author.matriculation-number) + ", " + author.course,
|
||||||
|
[*Ausbildungsbetrieb:*], author.company,
|
||||||
[*Bearbeitungszeitraum:*],
|
[*Betrieblicher Betreuer:*], author.supervisor,
|
||||||
thesis.timeframe,
|
[*Abgabedatum:*], thesis.submission-date,
|
||||||
|
|
||||||
[*Matrikelnummer, Kurs:*],
|
|
||||||
str(author.matriculation-number) + ", " + author.course,
|
|
||||||
|
|
||||||
[*Ausbildungsbetrieb:*],
|
|
||||||
author.company,
|
|
||||||
|
|
||||||
[*Betrieblicher Betreuer:*],
|
|
||||||
author.supervisor,
|
|
||||||
|
|
||||||
[*Abgabedatum:*],
|
|
||||||
thesis.submission-date
|
|
||||||
)
|
)
|
||||||
] else if text.lang == "en" [
|
] else if text.lang == "en" [
|
||||||
#table(
|
#table(
|
||||||
|
@ -85,30 +74,19 @@
|
||||||
column-gutter: 1cm,
|
column-gutter: 1cm,
|
||||||
align: left,
|
align: left,
|
||||||
stroke: none,
|
stroke: none,
|
||||||
|
[*Author:*], author.name,
|
||||||
[*Author:*],
|
[*Editing period:*], thesis.timeframe,
|
||||||
author.name,
|
[*Matriculation number, course:*], str(author.matriculation-number) + ", " + author.course,
|
||||||
|
[*Training company:*], author.company,
|
||||||
[*Editing period:*],
|
[*Company supervisor:*], author.supervisor,
|
||||||
thesis.timeframe,
|
[*Submission date:*], thesis.submission-date,
|
||||||
|
|
||||||
[*Matriculation number, course:*],
|
|
||||||
str(author.matriculation-number) + ", " + author.course,
|
|
||||||
|
|
||||||
[*Training company:*],
|
|
||||||
author.company,
|
|
||||||
|
|
||||||
[*Company supervisor:*],
|
|
||||||
author.supervisor,
|
|
||||||
|
|
||||||
[*Submission date:*],
|
|
||||||
thesis.submission-date
|
|
||||||
)
|
)
|
||||||
] else [
|
] else [
|
||||||
#context panic("no translation for language: ", text.lang)
|
#context panic("no translation for language: ", text.lang)
|
||||||
]
|
]
|
||||||
|
|
||||||
#align(bottom,
|
#align(
|
||||||
|
bottom,
|
||||||
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
|
||||||
|
@ -121,7 +99,9 @@
|
||||||
#context panic("no translation for language: ", text.lang)
|
#context panic("no translation for language: ", text.lang)
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
align(right, {line(length: 6cm)})))
|
align(right, {line(length: 6cm)})),
|
||||||
|
)
|
||||||
|
|
||||||
#counter(page).update(0)
|
#counter(page).update(0)
|
||||||
]
|
]
|
||||||
|
)
|
||||||
|
|
|
@ -111,22 +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)
|
||||||
},
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -138,19 +133,15 @@
|
||||||
inset: 0.25em,
|
inset: 0.25em,
|
||||||
align: (col, _) => align.at(col),
|
align: (col, _) => align.at(col),
|
||||||
fill: ABB-GRAY-06,
|
fill: ABB-GRAY-06,
|
||||||
..content.text.split("\n").enumerate().map(make_row).flatten().map(c => if c.has("text") and c.text == "" {
|
..content
|
||||||
v(1em)
|
.text
|
||||||
} else {
|
.split("\n")
|
||||||
c
|
.enumerate()
|
||||||
})
|
.map(make_row)
|
||||||
)
|
.flatten()
|
||||||
if lang != none {
|
.map(c => if c.has("text") and c.text == "" { v(1em) } else { c })
|
||||||
place(
|
|
||||||
top + right,
|
|
||||||
text(font: style.code.font, size: style.code.size, ligatures: true, fill: ABB-GRAY-03, lang),
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
|
||||||
)
|
)
|
||||||
#v(-1em)
|
#v(-1em)
|
||||||
#align(center + top, it.caption)
|
#align(center + top, it.caption)
|
||||||
|
@ -187,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")
|
||||||
|
@ -209,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)
|
||||||
|
@ -226,11 +204,10 @@
|
||||||
top: style.page.margin.top + style.header.underline-top-padding + style.header.content-padding,
|
top: style.page.margin.top + style.header.underline-top-padding + style.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>).first().location().page() > current-page {
|
} else if query(<end-of-prelude>).first().location().page() > current-page {
|
||||||
numbering("I", nums.pos().first())
|
numbering("I", nums.pos().first())
|
||||||
|
@ -271,10 +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>).first().location().page() >= current-page and query(<end-of-prelude>)
|
} 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 + 1 {
|
|
||||||
let heading = currentH()
|
let heading = currentH()
|
||||||
|
|
||||||
heading.at(0)
|
heading.at(0)
|
||||||
|
@ -287,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
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,5 @@
|
||||||
|
|
||||||
#lorem(50)
|
#lorem(50)
|
||||||
|
|
||||||
#figure(
|
#figure(```
|
||||||
```
|
```)
|
||||||
```
|
|
||||||
)
|
|
||||||
|
|
|
@ -7,3 +7,7 @@ oidc:
|
||||||
potato:
|
potato:
|
||||||
short: potato
|
short: potato
|
||||||
desc: "#lorem(50)"
|
desc: "#lorem(50)"
|
||||||
|
|
||||||
|
HTTP:
|
||||||
|
short: HTTP
|
||||||
|
long: Hyper Text Transfer Protocol
|
||||||
|
|
|
@ -15,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",
|
||||||
|
@ -25,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
|
||||||
|
|
||||||
|
@ -62,7 +65,8 @@ $
|
||||||
|
|
||||||
#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),
|
||||||
|
)
|
||||||
|
|
||||||
#figure(
|
#figure(
|
||||||
table(
|
table(
|
||||||
|
@ -76,23 +80,28 @@ $
|
||||||
[2023-03-18], [Yoga], [200],
|
[2023-03-18], [Yoga], [200],
|
||||||
[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 ])
|
),
|
||||||
|
caption: [ Some table ],
|
||||||
|
)
|
||||||
|
|
||||||
#pagebreak()
|
#pagebreak()
|
||||||
|
|
||||||
#lorem(100)
|
#lorem(100)
|
||||||
|
#inline-color("#ff0000", "red") @HTTP
|
||||||
|
|
||||||
#figure(
|
#figure(
|
||||||
```rust
|
```rust
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::fs::OpenOptions;
|
use std::fs::OpenOptions;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("Hello, World!!!");
|
println!("Hello, World!!!");
|
||||||
}
|
}
|
||||||
```, caption: [Some code])
|
```,
|
||||||
|
caption: [Some code],
|
||||||
|
)
|
||||||
|
|
||||||
#lorem(100)
|
#lorem(100)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue