Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions packages/preview/clean-othaw/0.3.5/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
MIT License

Copyright (c) 2024 Danny Seidel for base repo: https://github.com/DannySeidel/typst-dhbw-template
Copyright (c) 2025 Roland Schätzle for `clean-dhbw-typst-template` created as a fork on 7th of Jan. 2025 of the aforementioned repo
Copyright (c) 2025 Christopher Bongert for `othaw-typst` created as a fork on 20th of October. 2025 of the aforementioned repo


Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
267 changes: 267 additions & 0 deletions packages/preview/clean-othaw/0.3.5/README.md

Large diffs are not rendered by default.

60 changes: 60 additions & 0 deletions packages/preview/clean-othaw/0.3.5/abstract.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#import "locale.typ": *

#let abstract(
authors,
title,
date,
language,
many-authors,
at-university,
university,
date-format,
type-of-thesis,
course-of-studies,
abstract-text,
abstract-content,
supervisor,
keywords,
formalities-in-frontmatter,
) = {
heading(level: 1, type-of-thesis+" "+ABSTRACT.at(language),outlined:(not formalities-in-frontmatter))
v(1em)

if (abstract-content != none) {
abstract-content
} else {
if (authors.len() == 1) {
par(justify:true, DECLARATION_OF_AUTHORSHIP_SECTION_A_SINGLE.at(language)+" "+authors.first().name)


} else {
let author-list = ""
for (author) in authors {
author-list = author-list + author.name
if (not (author==authors.last())){author-list=author-list+", "}
}
par(justify:true, DECLARATION_OF_AUTHORSHIP_SECTION_A_PLURAL.at(language)+" "+author-list)

}
par(justify:true, DECLARATION_OF_AUTHORSHIP_SECTION_B.at(language)+" "+authors.first().course-of-studies)
v(1em)
par(justify:true, ABSTRACT_SUPERVISOR.at(language)+" "+supervisor.university-first)
if(at-university){
par(justify:true, ABSTRACT_CONDUCTION.at(language)+" "+university)
}else{
par(justify:true, ABSTRACT_CONDUCTION.at(language)+" "+authors.first().company.name+", "+authors.first().company.city)
par(justify:true,TITLEPAGE_COMPANY_SUPERVISOR.at(language)+" "+ supervisor.company)
}
par(justify:true, ABSTRACT_DATE_1.at(language)+" "+date.at(0).display(date-format) + " "+ABSTRACT_DATE_2.at(language)+" "+date.at(1).display(date-format))

v(1em)
line(length: 100%)
par(justify:true,ABSTRACT_TITLE.at(language)+" "+ title)
v(1em)
line(length: 100%)
text(ABSTRACT.at(language)+": ")
linebreak()
text(abstract-text)
par(ABSTRACT_KEYWORDS.at(language)+" "+keywords)
}
}
246 changes: 246 additions & 0 deletions packages/preview/clean-othaw/0.3.5/check-attributes.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,246 @@
#let check-attributes(
title,
authors,
language,
at-university,
confidentiality-marker,
type-of-thesis,
show-confidentiality-statement,
show-declaration-of-authorship,
show-table-of-contents,
show-abstract,
abstract,
appendix,
university,
university-location,
supervisor,
date,
city,
bibliography,
glossary,
bib-style,
logo-left,
logo-right,
university-short,
math-numbering,
ignored-link-label-keys-for-highlighting,
) = {


// Check availability of title

if (title == none or title == "") {
panic("Title is missing. Specify a title in the 'title' attribute of the template.")
}


// Check type of boolean attributes

let boolean-attributes = (
at-university: at-university,
show-confidentiality-statement: show-confidentiality-statement,
show-table-of-contents: show-table-of-contents,
show-declaration-of-authorship: show-declaration-of-authorship,
show-abstract: show-abstract,
)

for (key, attribute) in boolean-attributes {
if (type(attribute) != bool) {
panic("Attribute '" + key + "' is invalid. Specify 'true' or 'false' in the '" + key + "' attribute of the template.")
}
}


// Check type and content (some shouldn't be empty) of string attributes

let string-attributes = (
university: university,
university-location: university-location,
university-short: university-short,
)

// required string attributes
for (key, attribute) in string-attributes {
if (type(attribute) != str or attribute.len() == 0) {
panic("Attribute '" + key + "' is missing. Specify a " + key + " in the '" + key + "' attribute of the template.")
}
}

// optional string attribute
let optional-string-attributes = (
type-of-thesis: type-of-thesis,
bib-style: bib-style,
math-numbering: math-numbering,
)
for (key, attribute) in optional-string-attributes {
if (attribute != none and (type(attribute) != str or attribute.len() == 0)) {
panic("Attribute '" + key + "' is invalid. Specify a string in the '" + key + "' attribute of the template.")
}
}


// Check validity of confidentialty-marker attributes

if (type(confidentiality-marker) != none) {
if (
type(confidentiality-marker) != dictionary or "display" not in confidentiality-marker or type(confidentiality-marker.display) != bool
) {
panic("Confidentiality marker is invalid. Specify a dictionary in the 'confidentiality-marker' attribute of the template containing a 'display' attribute with a boolean value.")
}
}


// Check type of attributes containing `length`-values

let length-attributes = ()

if ("offset-x" in confidentiality-marker) {
length-attributes.insert("offset-x (confidentiality-marker)", confidentiality-marker.offset-x)
}
if ("offset-y" in confidentiality-marker) {
length-attributes.insert("offset-y (confidentiality-marker)", confidentiality-marker.offset-y)
}
if ("size" in confidentiality-marker) {
length-attributes.insert("size (confidentiality-marker)", confidentiality-marker.size)
}
if ("title-spacing" in confidentiality-marker) {
length-attributes.insert("title-spacing (confidentiality-marker)", confidentiality-marker.title-spacing)
}

for (key, attribute) in length-attributes {
if (type(attribute) != length) {
panic("Attribute '" + key + "' is invalid. Specify a length in the '" + key + "' attribute of the template.")
}
}


// Check consistency of all attributes related to `authors`

if (authors == none or authors == ()) {
panic("Author is missing. Specify authors in the 'authors' attribute of the template.")
}

let max-authors = if at-university {
8
} else {
6
}

if (
(type-of-thesis != none and type-of-thesis != "") or (
confidentiality-marker.display == true
)
) {
max-authors -= 2
}

if (authors.len() > max-authors) {
panic("Too many authors. Specify a maximum of " + str(max-authors) + " authors in the 'authors' attribute of the template. To increase the maximum number of authors (max. 8), change one of the following attributes: 'at-university', 'type-of-thesis'. (See the package documentation for more information.)")
}

for author in authors {
if ("name" not in author or author.name == none or author.name == "") {
panic("Author name is missing. Specify a name for each author in the 'authors' attribute of the template.")
}

if ("student-id" not in author or author.student-id == none or author.student-id == "") {
panic("Student ID of '" + author.name + "' is missing. Specify a student ID for each author in the 'authors' attribute of the template.")
}


if ("course-of-studies" not in author or author.course-of-studies == none or author.course-of-studies == "") {
panic("Course of studies of '" + author.name + "' is missing. Specify a course of studies for each author in the 'authors' attribute of the template.")
}

if (at-university) {
if ("company" in author) {
panic("Company of '" + author.name + "' is not allowed. Remove the 'company' object from the author.")
}
city = university-location
if (type(city) != str or city == "") {
panic("City is invalid. Specify a string containing a city in the 'city' attribute.")
}
} else {
if (type(city) == str) {
panic("Remove the City attribute. When 'at-university' is true the city inside the company object is used.")
}

if ("company" not in author) {
panic("Author '" + author.name + "' is missing a company. Add the 'company' object to the author.")
}
}
}


// Check allowed languages

if (language != "en" and language != "de") {
panic("Language is invalid. Specify 'en' for English or 'de' for German in the 'language' attribute of the template.")
}


// Check correctness of `date`

if (
type(date) != datetime and (
type(date) != array or date.len() != 2 or type(date.at(0)) != datetime or type(date.at(1)) != datetime
)
) {
panic("Date is invalid. Specify a datetime in the 'date' attribute of the template to display a specific date or use a array containing two datetime elements to display a date range.")
}


// Checkt type and content of image-attributes

let image-attributes = (
logo-left: logo-left,
logo-right: logo-right,
)

for (key, attribute) in image-attributes {
if (type(attribute) != content and attribute != none) {
panic("Attribute '" + key + "' is invalid. Specify an image in the '" + key + "' attribute of the template.")
}
}


// Check type of `glossary`
if (glossary != none and type(glossary) != array) {
panic("Type of `glossary` is invalid. It must be an array of arrays")
}


// Check availability of `bibliography`

if (type(bibliography) != content and bibliography != none) {
panic("Bibliography is invalid. Specify a bibliography in the 'bibliography' attribute of the template.")
}


// Check correctness of `supervisor`

if (
type(supervisor) != dictionary or (
"company" not in supervisor or supervisor.company == none or supervisor.company == ""
) and ("university" not in supervisor or supervisor.university == none or supervisor.university == "")
) {
panic("Supervisor(s) is/are invalid. Specify a supervisor either for the company and/or the university in the 'supervisor' attribute of the template.")
}


// Check type and content (not empty) of string array attributes

let string-array-attributes = (
ignored-link-label-keys-for-highlighting: ignored-link-label-keys-for-highlighting,
)

for (key, attribute) in string-array-attributes {
if (type(attribute) != array) {
panic("Attribute '" + key + "' is invalid. Specify an array of strings in the '" + key + "' attribute of the template.")
} else if (attribute.len() > 0) {
if (type(attribute.at(0)) != str) {
panic("Attribute '" + key + "' is invalid. Specify an array of strings in the '" + key + "' attribute of the template.")
}
}
}
}
Loading
Loading