dhbw-abb-typst-template/src/lib.typ

96 lines
2.8 KiB
Plaintext
Raw Normal View History

2024-06-27 13:57:04 +00:00
// .--------------------------------------------------------------------------.
// | Template of DHBW thesis |
// '--------------------------------------------------------------------------'
// Author: Sven Vogel
// Edited: 27.06.2024
// License: MIT
#import "conf.typ": validate-config
2024-07-08 07:55:38 +00:00
#import "branding.typ": *
2024-07-01 12:46:32 +00:00
#import "style.typ": global_styled_doc, content_styled, end_styled
#import "pages/titlepage.typ": new_title_page
#import "pages/declaration-of-authorship.typ": new_declaration_of_authorship
#import "pages/confidentiality-statement.typ": new_confidentiality_statement_page
#import "pages/prerelease-note.typ": new_prerelease_note
#import "pages/outline.typ": new_outline
#import "pages/abstract.typ": new_abstract
2024-07-04 13:09:05 +00:00
#import "pages/preface.typ": new-preface
#import "pages/appendix.typ": show-appendix
2024-07-08 11:49:04 +00:00
#let group-break()= {
[#pagebreak()]
}
// start of template pages and styles
#let dhbw-template(config, body) = [
#let config = validate-config(config)
2024-07-01 14:02:42 +00:00
#let doc = body
2024-06-27 13:57:04 +00:00
// apply global style to every element in the argument content
#global_styled_doc(config)[
// set document properties
#set document(
author: config.author.name,
keywords: config.thesis.keywords,
title: config.thesis.title)
2024-06-27 13:57:04 +00:00
2024-07-01 11:50:54 +00:00
// configure text locale
#set text(
lang: config.lang,
region: config.region)
2024-06-28 09:54:30 +00:00
2024-06-27 13:57:04 +00:00
// preppend title page
2024-07-01 10:13:57 +00:00
#new_title_page(config)
2024-06-28 09:54:30 +00:00
2024-07-01 11:50:54 +00:00
// prelude includes: title, declaration of authorship, confidentiality statement, outline and abstract
// these will have roman page numbers
2024-07-01 12:46:32 +00:00
#new_declaration_of_authorship(config)
#new_confidentiality_statement_page(config)
#if config.draft {
new_prerelease_note(config)
}
2024-07-01 14:02:42 +00:00
#new_abstract(config)
2024-07-04 13:09:05 +00:00
#new-preface(config)
2024-07-01 12:46:32 +00:00
#new_outline()
2024-06-27 13:57:04 +00:00
2024-07-01 11:50:54 +00:00
// glossary is built inline here because the links must be
// exposed to the entire document
2024-07-08 11:49:04 +00:00
#import "glossarium.typ": *
2024-07-01 10:13:57 +00:00
#show: make-glossary
#pagebreak(weak: true)
2024-07-01 12:46:32 +00:00
2024-07-01 14:17:54 +00:00
#if "glossary" in config.thesis and config.thesis.glossary != none {
print-glossary(
disable-back-references: true,
2024-07-08 11:49:04 +00:00
enable-group-pagebreak: true,
config.thesis.glossary)
2024-07-01 12:46:32 +00:00
2024-07-01 14:17:54 +00:00
pagebreak(weak: true)
}
#counter(page).update(1)
2024-07-01 10:13:57 +00:00
2024-07-01 11:50:54 +00:00
// mark end of prelude
2024-07-01 10:13:57 +00:00
#metadata("prelude terminate") <end-of-prelude>
#content_styled(config, doc)
2024-07-01 10:13:57 +00:00
2024-07-01 11:50:54 +00:00
#metadata("content terminate") <end-of-content>
#end_styled(config)[
2024-07-01 11:50:54 +00:00
// add bibliography if set
#if "bibliography" in config.thesis and config.thesis.bibliography != none {
2024-07-01 10:13:57 +00:00
pagebreak(weak: true)
counter(page).update(1)
2024-07-01 10:13:57 +00:00
set bibliography(style: "ieee")
config.thesis.bibliography
}
2024-07-01 11:50:54 +00:00
// appendix
#show-appendix(config: config)
]
]
2024-06-27 13:57:04 +00:00
]