Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modern-whs-thesis:0.3.0 #1777

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
45 changes: 45 additions & 0 deletions packages/preview/modern-whs-thesis/0.3.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# WHS Thesis Template

![Title page](thumbnail.png)

This **unofficial** template can be used to write in [Typst](https://github.com/typst/typst) with the corporate design of the [Westfälische Hochschule](https://www.w-hs.de/).

#### Disclaimer

Please ask your supervisor if you are allowed to use typst and this template for your thesis or other documents.
Note that this template is not checked by the Westfälische Hochschule for correctness.
Thus, this template does not guarantee completeness or correctness.

## Usage

Create a new typst project based on this template locally.
```bash
typst init @preview/modern-whs-thesis
cd modern-whs-thesis
```

Or create a project on the typst web app based on this template.

## Configuration

The package can be configured where it is initialized. The configuration is done in the `meta.typ` file.

```typst
#show: whs-thesis.with(
meta.title,
meta.author,
meta.date,
meta.keywords,
[#abstract],
meta.bibliography,
acronyms.acronyms,
meta.degree,
meta.place,
meta.thesis-type,
meta.studyCourse,
meta.department,
meta.first-examiner,
meta.second-examiner,
meta.date-of-submission,
)
```
12 changes: 12 additions & 0 deletions packages/preview/modern-whs-thesis/0.3.0/example/acronyms.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#let acronyms = (
(
key: "api",
short: "API",
long: "Application Programming Interface",
),
(
key: "html",
short: "HTML",
long: "Hypertext Markup Language",
),
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@online{WinNT,
author = {MultiMedia LLC},
title = {{MS Windows NT} Kernel Description},
year = 1999,
url = {http://web.archive.org/web/20080207010024/http://www.808multimedia.com/winnt/kernel.htm},
urldate = {2010-09-30}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#heading(outlined: false, numbering: none)[Abstract]

Perönlicher Zugang zum Thema. Gründe für die Themenwahl.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
= Einleitung

- Kurzbeschreibung: Wie lautet das Thema? Welche Hintergründe gibt es zu diesem Thema? Was ist schon darüber bekannt?
- Beschreibung der Leistung: Was ist das Ziel der Arbeit? Für wen hat die Arbeit Relevanz? Hinweis auf Kooperationspartner. Welche Themenstellung soll mit der Arbeit bearbeitet werden?
- Darstellung der Vorgehensweise: In welche Kapitel ist die Arbeit gegliedert? Wie ist sie aufgebaut? Was behandeln die einzelnen Kapitel (kurz)?

== Beispiele

Nutzen von Abkürzungen:

Ausgeschrieben: @api und @html

Abgekürzt: @api und @html

Dieser Verweis kann dann mit `@WinNT` @WinNT referenziert werden und ist dann im Literaturverzeichnis zu finden.

#figure(
```typ
== Überschrift <HeadingLabel>

#figure(...) <AbbLabel>
```,
caption: [Dieses Codebeispiel ist auch mit einem `label` versehen.],
kind: "code",
supplement: "Code",
) <KreuzverweisBeispiel>

#figure(
table(
inset: 10pt,
columns: 4,
[t], [1], [2], [3],
[y], [0.3s], [0.4s], [0.8s],
),
caption: [Tabellen Beispiel mit Caption],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
= Definitionen

Definitionen zum Thema und zur Arbeit.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
= Konzept zu irgendwas

Konzept zum Thema und zur Arbeit.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
= Prototypeische Umsetzung

Prototypen und Ergebnisse.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
= Fazit

Zusammenfassung und Ausblick.
30 changes: 30 additions & 0 deletions packages/preview/modern-whs-thesis/0.3.0/example/main.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#import "meta.typ" as meta
#import "@preview/modern-whs-thesis:0.3.0": *
#import "chapters/00_abstract.typ" as abstract
#import "acronyms.typ" as acronyms

#show: whs-thesis.with(
meta.title,
meta.author,
meta.date,
meta.keywords,
[#abstract],
meta.bibliography,
acronyms.acronyms,
meta.degree,
meta.place,
meta.thesis-type,
meta.studyCourse,
meta.department,
meta.first-examiner,
meta.second-examiner,
meta.date-of-submission,
)

// ---------------- Main ------------------

#include "chapters/01_introduction.typ"
#include "chapters/02_definitions.typ"
#include "chapters/03_concept.typ"
#include "chapters/04_implementation.typ"
#include "chapters/05_conclusion.typ"
14 changes: 14 additions & 0 deletions packages/preview/modern-whs-thesis/0.3.0/example/meta.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#let title = "Bachelorarbeit Title"
#let thesis-type = "Bachelorarbeit"
#let author = "Max Mustermann"
#let description = "Thema Beschreibung"
#let date = datetime.today()
#let date-of-submission = "14.07.2025"
#let place = "Bocholt"
#let keywords = ("Bachelorarbeit", "Westfälische Hochschule", "Informatik")
#let degree = "Bachelor of Science (B.Sc.)"
#let studyCourse = "Informatik.Softwaresysteme"
#let department = "Wirtschaft und Informationstechnik"
#let first-examiner = "Prof. Dr. Max Mustermann"
#let second-examiner = "Prof. Dr. Max Mustermann"
#let bibliography = bibliography.with("bibliography.bib")
61 changes: 61 additions & 0 deletions packages/preview/modern-whs-thesis/0.3.0/template/elements.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#import "settings.typ" as settings

// finds the first level one header on this or some previous page
#let heading_near_to_here = context {
let here = here()
let page = here.page()

// get all headings of level 1 after this one
let next_headings = query(heading.where(level: 1).after(here))

// check if there is at least one heading ahead
if (next_headings.len() != 0) {
let n = next_headings.first()
let np = n.location().position().page
// check if the heading is on the same page as we are
let number = if n.numbering != none {
numbering(n.numbering, ..counter(heading).at(n.location()))
}

if np == page {
// return if so
return [#number #upper(n.body)]
}
}

// if we haven't found any header on this page, we take the
// nearest previous one
let nearest_prev = query(heading.where(level: 1).before(here)).last()
let number = if nearest_prev.numbering != none {
numbering(
nearest_prev.numbering,
..counter(heading).at(nearest_prev.location()),
)
}
return [#number #upper(nearest_prev.body)]
}

// the common header that is used on all pages except the first ones
#let common_header(title) = context {
let pageNum = if here().page-numbering() == "I" {
counter(page).display("I")
} else {
counter(page).display()
}

v(settings.HEADER_INNER_MARGIN)
set text(10pt)
set align(top)
block(
grid(
columns: (1fr, auto),
inset: (
x: 0pt,
y: 7pt,
),
align(left)[_ #heading_near_to_here _],
pageNum,
grid.hline()
),
)
}
Loading
Loading