Compare commits
3 Commits
201e991ac4
...
093ed09293
Author | SHA1 | Date |
---|---|---|
Sven Vogel | 093ed09293 | |
Sven Vogel | 946a16fce6 | |
Sven Vogel | 7ad138dc00 |
|
@ -25,7 +25,8 @@ function enter-section() {
|
||||||
printf "\\n"
|
printf "\\n"
|
||||||
|
|
||||||
eval "$2"
|
eval "$2"
|
||||||
if [ $? -neq $3 ]; then
|
exit_status=$?
|
||||||
|
if ! [ $exit_status -eq $3 ]; then
|
||||||
abort "command: $2 failed in section: $1"
|
abort "command: $2 failed in section: $1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -33,6 +34,7 @@ function enter-section() {
|
||||||
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 "BUILD: ABB code theme" "./generate-theme.sh" 0
|
||||||
enter-section "Compiling template..." "typst compile template/main.typ --root . example.pdf" 0
|
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 ." 0
|
enter-section "TEST: local template import" "typst compile tests/local-import/main.typ --root ." 0
|
||||||
|
|
|
@ -129,7 +129,9 @@ 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.element.kind == __glossarium_figure {
|
if r.element != none and r.element.func() == figure and r
|
||||||
|
.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 {
|
||||||
|
@ -200,16 +202,23 @@ SOFTWARE.*/
|
||||||
if hasLong and hasDesc [:]
|
if hasLong and hasDesc [:]
|
||||||
if hasDesc [ #desc ] else [. ]
|
if hasDesc [ #desc ] else [. ]
|
||||||
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)
|
||||||
} else {
|
} else {
|
||||||
values.push(x)
|
values.push(x)
|
||||||
pages.push(x.page())
|
pages.push(x.page())
|
||||||
(values: values, pages: pages)
|
(values: values, pages: pages)
|
||||||
},
|
},
|
||||||
).values.map(x => {
|
)
|
||||||
|
.values
|
||||||
|
.map(x => {
|
||||||
let page-numbering = x.page-numbering()
|
let page-numbering = x.page-numbering()
|
||||||
if page-numbering == none {
|
if page-numbering == none {
|
||||||
page-numbering = "1"
|
page-numbering = "1"
|
||||||
|
@ -218,7 +227,8 @@ SOFTWARE.*/
|
||||||
page-numbering,
|
page-numbering,
|
||||||
..counter(page).at(x),
|
..counter(page).at(x),
|
||||||
)]
|
)]
|
||||||
}).join(", ")
|
})
|
||||||
|
.join(", ")
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
|
@ -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)
|
||||||
|
|
||||||
|
@ -25,3 +26,4 @@
|
||||||
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" {
|
||||||
|
@ -40,3 +41,4 @@
|
||||||
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)
|
||||||
|
|
||||||
|
@ -60,3 +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) }))
|
||||||
}
|
}
|
||||||
|
)
|
|
@ -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)
|
||||||
|
|
||||||
|
@ -62,3 +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) }))
|
||||||
}
|
}
|
||||||
|
)
|
|
@ -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()
|
||||||
|
@ -24,8 +25,10 @@
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
)
|
||||||
|
|
||||||
#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" {
|
||||||
|
@ -34,8 +37,10 @@
|
||||||
|
|
||||||
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" {
|
||||||
|
@ -44,8 +49,10 @@
|
||||||
|
|
||||||
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" {
|
||||||
|
@ -54,8 +61,10 @@
|
||||||
|
|
||||||
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" {
|
||||||
|
@ -69,8 +78,10 @@
|
||||||
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 {
|
||||||
|
@ -92,6 +103,7 @@
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
)
|
||||||
|
|
||||||
#let new_outline() = {
|
#let new_outline() = {
|
||||||
pagebreak(weak: true)
|
pagebreak(weak: true)
|
||||||
|
|
|
@ -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)
|
||||||
|
|
||||||
|
@ -54,3 +55,4 @@
|
||||||
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
|
||||||
|
@ -107,3 +108,4 @@
|
||||||
|
|
||||||
#counter(page).update(0)
|
#counter(page).update(0)
|
||||||
]
|
]
|
||||||
|
)
|
||||||
|
|
|
@ -111,7 +111,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.header.underline-top-padding + style.header.content-padding,
|
top: style.page.margin.top + style.header.logo-height + 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,
|
||||||
|
@ -120,9 +122,15 @@
|
||||||
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())
|
||||||
} else if query(<end-of-content>).first().location().page() >= current-page {
|
} else if query(<end-of-content>)
|
||||||
|
.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())
|
||||||
|
@ -159,7 +167,10 @@
|
||||||
// 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>).first().location().page() <= here().page() {
|
} else if query(<end-of-prelude>)
|
||||||
|
.first()
|
||||||
|
.location()
|
||||||
|
.page() <= here().page() {
|
||||||
let headers-before = query(
|
let headers-before = query(
|
||||||
selector(heading.where(numbering: "1.", level: 1)).before(here()),
|
selector(heading.where(numbering: "1.", level: 1)).before(here()),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue