diff --git a/packages/preview/basic-report/0.1.2/LICENSE b/packages/preview/basic-report/0.1.2/LICENSE new file mode 100644 index 000000000..2c644e94d --- /dev/null +++ b/packages/preview/basic-report/0.1.2/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Roland Schätzle + +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. diff --git a/packages/preview/basic-report/0.1.2/README.md b/packages/preview/basic-report/0.1.2/README.md new file mode 100644 index 000000000..bcb063f4f --- /dev/null +++ b/packages/preview/basic-report/0.1.2/README.md @@ -0,0 +1,53 @@ +# Basic Report + +A [Typst](https://typst.app/home/) template for shorter non-fiction documents like reports, manuals, requirements documentation, student assignments etc. An example document (PDF) that shows how it looks like, can be found [here](https://github.com/roland-KA/basic-report-typst-template/blob/main/examples/main.pdf). + +The template comes without bells and whistles and consists just of +- a titlepage with + - logo + - title & document category + - info block (date, author, affiliation) +- the TOC +- and then the contents (with currently three levels of headings) + +The TOC uses roman page numbers, the rest of the document arabic numbers. + +## Usage + +You can use this template in the Typst web app by clicking "Start from template" on the dashboard and searching for `basic-report`. + +Alternatively, you can use the CLI to kick this project off using the command + +```shell +typst init @preview/basic-report +``` + +Typst will create a new directory with all the files needed to get you started. + +## Fonts + + _**Vollkorn**_ is used for the body text. It's a high quality font for long texts designed by [Friedrich Althausen](http://friedrichalthausen.de/). It was one of the first Google Fonts. But I recommend to download it from the designers [project web page](http://vollkorn-typeface.com/), because that variant has the small caps font included (on [Google Fonts](https://fonts.google.com/specimen/Vollkorn) that's a separate font). + + In it's current version it's an extensive font with 12 styles as well as true small caps, a variety of localisations, a complete set of figures (proportional/tabular, lining/old style, small caps), many ligatures etc. + + [_**Ubuntu**_](https://design.ubuntu.com/font) is the contrasting companion for headings, labels, the header, the titlepage etc. Designed by [Dalton Maag](https://www.daltonmaag.com/) it adds a contemporary touch with its own personality. Ubuntu is available via [Google Fonts](https://fonts.google.com/specimen/Ubuntu). + + +## Packages Used + +The [Hydra package](https://github.com/tingerrr/hydra) is used to display the current heading within the header. + + +## Configuration + +The template exports one function `basic-report` with the following named parameters: + +- `doc-category (str)`: The documents category (e.g. "User Manual", "Lab Report", "Monthly Review") +- `doc-title (str)`: The documents title +- `author (str)`: The author; if there are several authors, they can just be listed within one string argument. +- `affiliation (str)`: Organisation/Company etc. +- `logo (image)`: an `image` (usage: e.g. `image("path/to/image.svg")`) +- `language (str)`: Language of the document (default is "de") +- `show-outline (boolean)`: Show the outline (default is `true`) + +Have a look at the example file [`main.typ`](https://github.com/roland-KA/basic-report-typst-template/blob/main/template/main.typ) whithin the [`template`](https://github.com/roland-KA/basic-report-typst-template/tree/main/template) directory on how to use the `basic-report`-function with these parameters. \ No newline at end of file diff --git a/packages/preview/basic-report/0.1.2/lib.typ b/packages/preview/basic-report/0.1.2/lib.typ new file mode 100644 index 000000000..f6df0bef0 --- /dev/null +++ b/packages/preview/basic-report/0.1.2/lib.typ @@ -0,0 +1,179 @@ +#import "@preview/hydra:0.6.0": hydra +#import "titlepage.typ": * + +// ----- Main Template Function: `basic-report` ---------------------- + +#let basic-report( + doc-category: none, + doc-title: none, + author: none, + affiliation: none, + logo: none, + language: "de", + show-outline: true, + body, +) = { + + // ----- Global Parameters ------------------------ + + set document(title: doc-title, author: author) + set text(lang: language) + + counter(page).update(0) // so TOC after titlepage begins with page no 1 (roman) + + let body-font = "Vollkorn" + let body-size = 11pt + let heading-font = "Ubuntu" + let info-size = 10pt // heading font is used in this size for kind of "information blocks" + let label-size = 9pt // heading font is used in this size for different sorts of labels + let in-outline = state("in-outline", true) // are we inside or outside of the outline (for roman/arabic page numbers)? + + // ----- Title Page ------------------------ + + titlepage( + doc-category, + doc-title, + author, + affiliation, + logo, + heading-font, + info-size, + ) + + // ----- Basic Text- and Page-Setup ------------------------ + + set text( + font: body-font, + size: body-size, + // Vollkorn has a broader stroke than other fonts; in order to adapt the grey value (Grauwert) + // of the page the font gets printed in a dark grey (80% instead of completely black) + fill: luma(80) + ) + + set par( + justify: true, + leading: 0.65em, + spacing: 1.65em, + first-line-indent: 0em, + ) + + set page( + paper: "a4", + // horizontal 1.5cm-grid = 14u: 3u left margin, 9u text, 2u right margin + // Idea: one-sided document; if printed on paper, the pages are often bound or stapled + // on the left side; so more space needed on the left. On-screen it doesn't matter. + // vertical 1.5cm-grid ≈ 20u: 2u top margin, 14u text, 2u botttom margin + // header with height ≈ 0.6cm is visually part of text block --> top margin = 3cm + 0.6cm + margin: (top: 3.6cm, left: 4.5cm, right: 3cm, bottom: 3cm), + // the header shows the main chapter heading on the left and the page number on the right + header: + grid( + columns: (1fr, 1fr), + align: (left, right), + row-gutter: 0.5em, + text(font: heading-font, size: label-size, + context {hydra(1, use-last: true, skip-starting: false)},), + text(font: heading-font, size: label-size, + number-type: "lining", + context {if in-outline.get() { + counter(page).display("i") // roman page numbers for the TOC + } else { + counter(page).display("1") // arabic page numbers for the rest of the document + } + } + ), + grid.cell(colspan: 2, line(length: 100%, stroke: 0.5pt)), + ), + header-ascent: 1.5em, + ) + + // ----- Numbering Schemes ------------------------ + + set heading(numbering: "1.") + show heading: it => { + set text(font: heading-font, fill: blue, weight: "regular") + block(it, + height: 1 * body-size, + above: 2 * body-size, + below: 1 * body-size, + sticky: true) + } + + set figure(numbering: "1") + show figure.caption: it => { + set text(font: heading-font, size: label-size) + block(it) + } + + // ----- Table of Contents ------------------------ + + // to detect, if inside or outside the outline (for different page numbers) + show outline: it => { + in-outline.update(true) + it + in-outline.update(false) + } + + // top-level TOC entries in bold without filling + show outline.entry.where(level: 1): it => { + set block(above: 2 * body-size) + set text(font: heading-font, weight: "bold", size: info-size) + link( + it.element.location(), // make entry linkable + it.indented(it.prefix(), it.body() + box(width: 1fr,) + it.page()) + ) + } + + // other TOC entries in regular with adapted filling + show outline.entry.where(level: 2).or(outline.entry.where(level: 3)): it => { + set block(above: body-size) + set text(font: heading-font, size: info-size) + link( + it.element.location(), // make entry linkable + it.indented( + it.prefix(), + it.body() + " " + + box(width: 1fr, repeat([.], gap: 2pt)) + + " " + it.page() + ) + ) + } + + if show-outline { + outline( + title: if language == "de" { + "Inhalt" + } else if language == "fr" { + "Table des matières" + } else if language == "es" { + "Contenido" + } else if language == "it" { + "Indice" + } else if language == "pt" { + "Índice" + } else if language == "zh" { + "目录" + } else if language == "ja" { + "目次" + } else if language == "ru" { + "Содержание" + } else if language == "ar" { + "المحتويات" + } else { + "Contents" + }, + indent: auto, + ) + counter(page).update(0) // so the first chapter starts at page 1 (now in arabic numbers) + } else { + in-outline.update(false) // even if outline is not shown, we want to continue with arabic page numbers + counter(page).update(1) + } + + pagebreak() + + // ----- Body Text ------------------------ + + body + +} \ No newline at end of file diff --git a/packages/preview/basic-report/0.1.2/template/assets/aerospace-engineering.png b/packages/preview/basic-report/0.1.2/template/assets/aerospace-engineering.png new file mode 100644 index 000000000..db710ddfe Binary files /dev/null and b/packages/preview/basic-report/0.1.2/template/assets/aerospace-engineering.png differ diff --git a/packages/preview/basic-report/0.1.2/template/main.typ b/packages/preview/basic-report/0.1.2/template/main.typ new file mode 100644 index 000000000..dba10889d --- /dev/null +++ b/packages/preview/basic-report/0.1.2/template/main.typ @@ -0,0 +1,46 @@ + +#import "@preview/basic-report:0.1.2": * + +#show: it => basic-report( + doc-category: "Betriebsanleitung", + doc-title: "Raketenstart für Dummies", + author: "Daniel Düsentrieb", + affiliation: "MouseTec, Entenhausen", + logo: image("assets/aerospace-engineering.png", width: 2cm), + // Aerospace icons created by gravisio - Flaticon + language: "de", + it +) + += Einleitung + +#lorem(120) + +#lorem(150) + +== Fluggeräte + +#lorem(100) + +=== Raketen – Eine Übersicht + +#lorem(80) + += Dein erster Raketenstart + +#lorem(150) + +== Wie du in die Rakete einsteigst + +#lorem(90) + +== Das Cockpit + +#lorem(120) + + +=== Die wichtigsten Knöpfe und Hebel + +#lorem(50) + + diff --git a/packages/preview/basic-report/0.1.2/thumbnail.png b/packages/preview/basic-report/0.1.2/thumbnail.png new file mode 100644 index 000000000..004e263f8 Binary files /dev/null and b/packages/preview/basic-report/0.1.2/thumbnail.png differ diff --git a/packages/preview/basic-report/0.1.2/titlepage.typ b/packages/preview/basic-report/0.1.2/titlepage.typ new file mode 100644 index 000000000..c2706fa6a --- /dev/null +++ b/packages/preview/basic-report/0.1.2/titlepage.typ @@ -0,0 +1,54 @@ +// ----- Title Page ------------------------ + +#let titlepage( + doc-category, + doc-title, + author, + affiliation, + logo, + heading-font, // the heading-font is also used for all text on the titlepage + info-size, // used throughout the document for "info text" +) = { + + // ----- Page-Setup ------------------------ + set page( + paper: "a4", + margin: (top: 3cm, left: 4.5cm, right: 3cm, bottom: 4.5cm), + ) + + // Some basic rules for the title page layout: + // - logo is right-justified + // - all other elements are left-justified + // - the page uses a grid of 1.5 cm units + + // ----- Logo ------------------------ + place(top + right, // `place` so that the remaining layout is independent of the size of the logo + logo, + ) + + v(6cm) // = 4 x 1.5 cm + + // ----- Title Category & Title ------------------------ + align( + left, // 1 x 14pt + 2 x 36pt ≈ 2 x 1.5 cm + text(font: heading-font, weight: "regular", size: 14pt, + doc-category), + ) + + text(font: heading-font, weight: "light", size: 36pt, fill: blue, + doc-title, + ) + + // ----- Info Block ------------------------ + set par(leading: 1em) + + place( + bottom + left, + text( + font: heading-font, weight: "regular", size: info-size, fill: black, + datetime.today().display("[day].[month].[year]") + str("\n") + + author + str("\n") + + affiliation), + ) + +} \ No newline at end of file diff --git a/packages/preview/basic-report/0.1.2/typst.toml b/packages/preview/basic-report/0.1.2/typst.toml new file mode 100644 index 000000000..5bf401098 --- /dev/null +++ b/packages/preview/basic-report/0.1.2/typst.toml @@ -0,0 +1,16 @@ +[package] +name = "basic-report" +version = "0.1.2" +entrypoint = "lib.typ" +authors = ["Roland Schätzle <@roland-KA>"] +license = "MIT" +description = "A simple template for reports" +repository = "https://github.com/roland-KA/basic-report-typst-template" +keywords = ["report", "non-fiction", "basic"] +categories = ["paper", "report"] +exclude = ["template/main.pdf"] + +[template] +path = "template" +entrypoint = "main.typ" +thumbnail = "thumbnail.png" \ No newline at end of file diff --git a/packages/preview/clean-dhbw/0.2.1/LICENSE b/packages/preview/clean-dhbw/0.2.1/LICENSE new file mode 100644 index 000000000..6ba01b2d1 --- /dev/null +++ b/packages/preview/clean-dhbw/0.2.1/LICENSE @@ -0,0 +1,22 @@ +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 + +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. diff --git a/packages/preview/clean-dhbw/0.2.1/README.md b/packages/preview/clean-dhbw/0.2.1/README.md new file mode 100644 index 000000000..311b5011f --- /dev/null +++ b/packages/preview/clean-dhbw/0.2.1/README.md @@ -0,0 +1,290 @@ +# Clean DHBW + +A (modernized) [Typst](https://typst.app/) template for DHBW documents like Bachelor theses, "Studienarbeiten", project documentation etc. It is the official Typst template for Computer Science at DHBW Karlsruhe. + +You can see an example of how the template looks in this [PDF file](https://github.com/roland-KA/clean-dhbw-typst-template/blob/main/template/main.pdf). + +## Introduction and Motivation + +In my experience as an end-user (i.e. reader) of documents like Bachelor theses and similar works which are currently produced at DHBW, there is room for improvement with respect to their usability. There exists a recommendation at DHBW on how to structure and design such documents. I have the impression that some of the usability issues I identified are rooted directly within these recommendations, but others stem from the fact that some recommendations are just not thoroughly followed. + +In order to give an example on how an improved document structure and layout could look like, I have created the present "*Clean DHBW Typst Template*". In the meantime it is the official Typst template for Computer Science at DHBW Karlsruhe. But of course anyone interested is welcome to use it too. + +Of course such a concept is always a bit biased in some way. Therefore I explain the whys and hows below and I'm looking forward to the discussions it will provoke 😃. The name has been chosen in the sense "clean" is used in Software Engineering in terms like *clean architecture* or *clean code*, where it describes concepts and structures which are easy to understand, to use und to maintain. Furthermore they have a clear separation of concerns and responsibilities – for the case at hand that means: the template defines the typography, whereas the author is responsible for the contents. + +There exists already a Typst template for these sorts of documents: It's the ["supercharged-dhbw"-template](https://github.com/DannySeidel/typst-dhbw-template) by Danny Seidel. It is a great piece of work with a lot of functionality covering a broad variety of use cases. But with respect to structure and layout, it implements exactly the above criticized state (which is without doubt what many people want or maybe have to use). I discussed with Danny on how to realize further development. We agreed to keep `supercharged-dhbw` more or less as-is in order to reflect current state and needs and in consequence to build this new template as a fork of his work. This gave me also more freedom to go new ways. + +For those interested, further and more detailed explanations about the design of the "*Clean DHBW Typst Template*" can be found here: +- [Assumptions](https://github.com/roland-KA/clean-dhbw-typst-template/blob/main/docs/assumptions.md) made for the development +- [Usability issues](https://github.com/roland-KA/clean-dhbw-typst-template/blob/main/docs/usability-issues.md) mentioned above in detail +- [Explanation of the new document structure and layout](https://github.com/roland-KA/clean-dhbw-typst-template/blob/main/docs/design-explained.md) + +## Usage + +You can use this template in the Typst web app by clicking "Start from template" on the dashboard and searching for `clean-dhbw`. + +Alternatively (if you use Typst on your local computer), you can use the CLI to kick this project off using the command + +```shell +typst init @preview/clean-dhbw MyFancyThesis +``` + +Typst will create a new directory (`MyFancyThesis` in this example) with all the files needed to get you started. + +## Support + +If you have questions, find bugs or have proposals for new features regarding the template or if you want to contribute, please create an issue in the [GitHub-repo](https://github.com/roland-KA/clean-dhbw-typst-template?tab=readme-ov-file). + +For more general questions with respect to Typst, please consult the [Typst documentation](https://typst.app/docs/), the [Typst book](https://sitandr.github.io/typst-examples-book/book/about.html) or use the [Typst forum](https://forum.typst.app/), where you find a helpful and responsive community. + +## Fonts + +This template uses the following fonts (from Google fonts): + +- [Source Serif 4](https://fonts.google.com/specimen/Source+Serif+4) +- [Source Sans 3](https://fonts.google.com/specimen/Source+Sans+3) + +If you want to use typst locally, you can download the fonts from the links above and install them on your system (_Hint_: You need the TTF-files located within the `static` subfolders of both font-distributions). Otherwise, when using the web version, add the fonts to your project. + +For further information on how to add fonts to your project, please refer to the [Typst documentation](https://typst.app/docs/reference/text/text/#parameters-font). + +[**Source Serif 4**](https://fonts.google.com/specimen/Source+Serif+4) (formerly known as *Source Serif Pro*) has been chosen for the **body text** as it is a high-quality font especially made for on-screen use and the reading of larger quantities of text. It was designed in 2014 by [Frank Grießhammer](https://fonts.adobe.com/designers/frank-griesshammer) for Adobe as a companion to *Source Sans Pro*, thus expanding their selection of Open Source fonts. It belongs to the category of transitional style fonts. Its relatively large x-height is typical for on-screen fonts and adds to the legibility even at small sizes. The font ist constantly being further developed. In the meantime there are special variants available e.g. for small print (*Source Serif Caption*, *Source Serif Small Text*) or large titles (*Source Serif Display*) and headings (*Source Serif Headings*). For people with a Computer Science background, the font might be familiar as it is used for the online documentation of the Rust programming language. + +For the **headlines** as well as for **other guiding elements** of the document, the font [**Source Sans 3**](https://fonts.google.com/specimen/Source+Sans+3) has been chosen. It comes as a natural choice since *Source Serif 4* has been especially designed for this combination. But it has its virtues of its own, e.g. its reduced run length which permits more characters per line. This helps to avoid line-breaks within headings in our use case. *Source Sans 3* (originally named *Source Sans Pro*) has been designed by [Paul D. Hunt](https://blog.typekit.com/2013/11/20/interview-paul-hunt/) in 2012 as Adobes first Open Source font. It has its roots in the family of Gothic fonts thus belonging to a different category than *Source Serif 4*. But under [Robert Slimbachs](https://de.wikipedia.org/wiki/Robert_Slimbach) supervision, both designers succeeded to create a combination that fits well and at the same time the different rootings make the pairing not too "boring". + +## Packages Used + +This template uses the following packages: + +- [codelst](https://typst.app/universe/package/codelst): To create code snippets +- [hydra](https://github.com/tingerrr/hydra): To display the current heading within the header. + +## Configuration + +This template exports the `clean-dhbw` function with the following named arguments: + +`title (str*)`: Title of the document + +`authors (dictionary*)`: List of authors with the following named arguments (max. 6 authors when in the company or 8 authors when at DHBW): + +- name (str*): Name of the author +- student-id (str*): Student ID of the author +- course (str*): Course of the author +- course-of-studies (str*): Course of studies of the author +- company (dictionary): Company of the author (only needed when `at-university` is `false`) with the following named arguments: + - name (str*): Name of the company + - post-code (str): Post code of the company + - city (str*): City of the company + - country (str): Country of the company + +CAVEAT: The template hasn't been adapted nor tested for more than two authors. + +`abstract (content)`: Content of the abstract, it is recommended that you pass a variable containing the content or a function that returns the content + +`acronym-spacing (length)`: Spacing between the acronym and its long form (check the [Typst documentation](https://typst.app/docs/reference/layout/length/) for examples on how to provide parameters of type length), default is `5em` + +`acronyms (dictionary)`: Pass a dictionary containing the acronyms and their long forms (See the example in the `acronyms.typ` file) + +`appendix (content)`: User-defined content of the appendix. It is recommended that you pass a variable containing the content or a function that returns the content + +`at-university (bool*)`: Whether the document is written at university or not, default is `false` + +`bibliography (content)`: Path to the bibliography file + +`bib-style (str)`: Style of the bibliography, default is `ieee` + +`city (str)`: City of the author (only needed when `at-university` is `true`) + +`confidentiality-marker: (dictionary)`: Configure the confidentially marker (red or green circle) on the title page (using this option reduces the maximum number of authors by 2 to 4 authors when in the company or 6 authors when at DHBW) + +- display (bool*): Whether the confidentiality marker should be shown, default is `false` +- offset-x (length): Horizontal offset of the confidentiality marker, default is `0pt` +- offset-y (length): Vertical offset of the confidentiality marker, default is `0pt` +- size (length): Size of the confidentiality marker, default is `7em` +- title-spacing (length): Adds space below the title to make room for the confidentiality marker, default is `2em` + +`confidentiality-statement-content (content)`: Provide a custom confidentiality statement + +`date (datetime* | array*)`: Provide a datetime object to display one date (e.g. submission date) or a array containing two datetime objects to display a date range (e.g. start and end date of the project), default is `datetime.today()` + +`date-format (str)`: Format of the displayed dates, default is `"[day].[month].[year]"` (for more information on possible formats check the [Typst documentation](https://typst.app/docs/reference/foundations/datetime/#format)) + +`declaration-of-authorship-content (content)`: Provide a custom declaration of authorship + +`glossary (dictionary)`: Pass a dictionary containing the glossary terms and their definitions (See the example in the `glossary.typ` file) + +`glossary-spacing (length)`: Spacing between the glossary term and its definition (check the [Typst documentation](https://typst.app/docs/reference/layout/length/) for examples on how to provide parameters of type length), default is `1.5em` + +`ignored-link-label-keys-for-highlighting (array)`: List of keys of labels that should be ignored when highlighting links in the document, default is `()` + +`language (str*)`: Language of the document which is either `en` or `de`, default is `en` + +`logo-left (content)`: Path to the logo on the left side of the title page (usage: image("path/to/image.png")), default is the `DHBW logo`. If it is the only logo given, then it will be displayed centered. + +`logo-right (content)`: Path to the logo on the right side of the title page (usage: image("path/to/image.png")), default is `no logo` + +`math-numbering (str)`: Numbering style of the math equations, set to `none` to turn off equation numbering, default is `"(1)"` (for more information on possible numbering formats check the [Typst documentation](https://typst.app/docs/reference/model/numbering)) + +`show-abstract (bool)`: Whether the abstract should be shown, default is `true` + +`show-acronyms (bool)`: Whether the list of acronyms should be shown, default is `true` + +`show-confidentiality-statement (bool)`: Whether the confidentiality statement should be shown, default is `true` + +`show-declaration-of-authorship (bool)`: Whether the declaration of authorship should be shown, default is `true` + +`show-table-of-contents (bool)`: Whether the table of contents should be shown, default is `true` + +`supervisor (dictionary*)`: Name of the supervisor at the university and/or company (e.g. supervisor: (company: "John Doe", university: "Jane Doe")) + +- company (str): Name of the supervisor at the company (note while the argument is optional at least one of the two arguments must be provided) +- university (str): Name of the supervisor at the university (note while the argument is optional at least one of the two arguments must be provided) + +`titlepage-content (content)`: Provide a custom title page + +`type-of-thesis (str)`: Type of the thesis, default is `none` (using this option reduces the maximum number of authors by 2 to 4 authors when in the company or 6 authors when at DHBW) + +`university (str*)`: Name of the university + +`university-location (str*)`: Campus or city of the university + +`university-short (str*)`: Short name of the university (e.g. DHBW), displayed for the university supervisor + +For each argument the expected type of the value is given in parentheses. All arguments marked with `*` are required. + +Have a look at the example file [`main.typ`](https://github.com/roland-KA/clean-dhbw-typst-template/blob/main/template/main.typ) whithin the [`template`](https://github.com/roland-KA/clean-dhbw-typst-template/tree/main/template) directory on how to use the `clean-dhbw`-function with a typical subset of these parameters. + +### A typical configuration for a Bachelor Thesis + +A typical Bachelor Thesis which has _one author_ and takes place in cooperation between _DHBW_ and the _partner company,_ could have the following parametrization: + +```typ + title: "Exploration of Typst for the Composition of a University Thesis", + authors: ( + (name: "Max Mustermann", student-id: "7654321", + course: "TIS21", course-of-studies: "Informatik", + company: ((name: "MouseTec GmbH", post-code: "70435", city: "Karlsruhe")) + ), + ), + acronyms: acronyms, // displays acronyms from acronyms dictionary + at-university: false, + type-of-thesis: "Bachelorarbeit", + show-confidentiality-statement: true, // optional, if company desires so + show-declaration-of-authorship: true, + bibliography: bibliography("sources.bib"), + date: datetime.today(), + glossary: glossary, // displays glossary terms from glossary dictionary + language: "de", // en, de + supervisor: ( + company: "John Appleseed", + university: "Prof. Dr. Daniel Düsentrieb" + ), + logo-right: image("path/to/company-logo-image.png"), + university: "Duale Hochschule Baden-Württemberg", + university-location: "Karlsruhe", + university-short: "DHBW", +``` + +### A typical configuration for a "Studienarbeit" + +A typical Studienarbeit which has _two authors_ and takes place at _DHBW only,_ could have the following parametrization: + +```typ + title: "Exploration of Typst for the Composition of a University Thesis", + authors: ( + (name: "Max Mustermann", student-id: "7654321", + course: "TIS21", course-of-studies: "Informatik", + ), + (name: "Luise Müller", student-id: "7653451", + course: "TIS21", course-of-studies: "Informatik", + ), + ), + city: "Karlsruhe", + acronyms: acronyms, // displays acronyms from acronyms dictionary + at-university: true, + type-of-thesis: "Studienarbeit", + show-confidentiality-statement: true, // optional, if company desires so + show-declaration-of-authorship: true, + bibliography: bibliography("sources.bib"), + date: datetime.today(), + glossary: glossary, // displays glossary terms from glossary dictionary + language: "de", // en, de + supervisor: ( + university: "Prof. Dr. Daniel Düsentrieb" + ), + university: "Duale Hochschule Baden-Württemberg", + university-location: "Karlsruhe", + university-short: "DHBW", +``` + +## Acronyms + +This template provides functions to reference acronyms in the text. To use these functions, you need to define the acronyms in the `acronyms` attribute of the template. +The acronyms referenced with the functions below will be linked to their definition in the list of acronyms. + +### Functions + +This template provides the following functions to reference acronyms: + +`acr`: Reference an acronym in the text (e.g. `acr("API")` -> `Application Programming Interface (API)` or `API`) + +`acrpl`: Reference an acronym in the text in plural form (e.g. `acrpl("API")` -> `Application Programming Interfaces (API)` or `APIs`) + +`acrs`: Reference an acronym in the text in short form (e.g. `acrs("API")` -> `API`) + +`acrspl`: Reference an acronym in the text in short form in plural form (e.g. `acrpl("API")` -> `APIs`) + +`acrl`: Reference an acronym in the text in long form (e.g. `acrl("API")` -> `Application Programming Interface`) + +`acrlpl`: Reference an acronym in the text in long form in plural form (e.g. `acrlpl("API")` -> `Application Programming Interfaces`) + +`acrf`: Reference an acronym in the text in full form (e.g. `acrf("API")` -> `Application Programming Interface (API)`) + +`acrfpl`: Reference an acronym in the text in full form in plural form (e.g. `acrfpl("API")` -> `Application Programming Interfaces (API)`) + +### Definition + +To define acronyms use a dictionary and pass it to the acronyms attribute of the template. +The dictionary should contain the acronyms as keys and their long forms as values. + +```typst +#let acronyms = ( + API: "Application Programming Interface", + HTTP: "Hypertext Transfer Protocol", + REST: "Representational State Transfer", +) +``` + +To define the plural form of an acronym use a array as value with the first element being the singular form and the second element being the plural form. +If you don't define the plural form, the template will automatically add an "s" to the singular form. + +```typst +#let acronyms = ( + API: ("Application Programming Interface", "Application Programming Interfaces"), + HTTP: ("Hypertext Transfer Protocol", "Hypertext Transfer Protocols"), + REST: ("Representational State Transfer", "Representational State Transfers"), +) +``` + +## Glossary + +Similar to the acronyms, this template provides a function to reference glossary terms in the text. To use the function, you need to define the glossary terms in the `glossary` attribute of the template. +The glossary terms referenced with the function below will be linked to their definition in the list of glossary terms. + +### Reference + +`gls`: Reference a glossary term in the text (e.g. `gls("Vulnerability")` -> link to the definition of "Vulnerability" in the glossary) + +### Definition + +The definition works analogously to the acronyms. +Define the glossary terms in a dictionary and pass it to the glossary attribute of the template. +The dictionary should contain the glossary terms as keys and their definitions as values. + +```typst +#let glossary = ( + Vulnerability: "A Vulnerability is a flaw in a computer system that weakens the overall security of the system.", + Patch: "A patch is data that is intended to be used to modify an existing software resource such as a program or a file, often to fix bugs and security vulnerabilities.", + Exploit: "An exploit is a method or piece of code that takes advantage of vulnerabilities in software, applications, networks, operating systems, or hardware, typically for malicious purposes.", +) +``` diff --git a/packages/preview/clean-dhbw/0.2.1/acronym-lib.typ b/packages/preview/clean-dhbw/0.2.1/acronym-lib.typ new file mode 100644 index 000000000..cd45789a6 --- /dev/null +++ b/packages/preview/clean-dhbw/0.2.1/acronym-lib.typ @@ -0,0 +1,125 @@ +#import "locale.typ": ACRONYMS +#import "shared-lib.typ": display, display-link, assert-in-dict + +#let prefix = "acronym-state-" +#let acros = state("acronyms", none) + +#let init-acronyms(acronyms) = { + acros.update(acronyms) +} + + +#let acrs(acr, plural: false, link: true) = { + if plural { + display("acronyms", acros, acr, acr + "s", link: link) + } else { + display("acronyms", acros, acr, acr, link: link) + } +} + +#let acrspl(acr, link: true) = { + acrs(acr, plural: true, link: link) +} + + +#let acrl(acr, plural: false, link: true) = { + context { + let acronyms = acros.get() + + assert-in-dict("acronyms", acros, acr) + let defs = acronyms.at(acr) + if type(defs) == str { + if plural { + display("acronyms", acros, acr, defs + "s", link: link) + } else { + display("acronyms", acros, acr, defs, link: link) + } + } else if type(defs) == array { + if defs.len() == 0 { + panic("No definitions found for acronym " + acr + ". Make sure it is defined in the dictionary passed to #init-acronyms(dict)") + } + if plural { + if defs.len() == 1 { + display("acronyms", acros, acr, defs.at(0) + "s", link: link) + } else if defs.len() == 2 { + display("acronyms", acros, acr, defs.at(1), link: link) + } else { + panic("Definitions should be arrays of one or two strings. Definition of " + acr + " is: " + type(defs)) + } + } else { + display("acronyms", acros, acr, defs.at(0), link: link) + } + } else { + panic("Definitions should be arrays of one or two strings. Definition of " + acr + " is: " + type(defs)) + } + } +} + +#let acrlpl(acr, link: true) = { + acrl(acr, plural: true, link: link) +} + +#let acrf(acr, plural: false, link: true) = { + if plural { + display("acronyms", acros, acr, [#acrlpl(acr) (#acr\s)], link: link) + } else { + display("acronyms", acros, acr, [#acrl(acr) (#acr)], link: link) + } + state(prefix + acr, false).update(true) +} + +#let acrfpl(acr, link: true) = { + acrf(acr, plural: true, link: link) +} + +#let acr(acr, plural: false, link: true) = { + context { + let seen = state(prefix + acr, false).get() + + if seen { + if plural { + acrspl(acr, link: link) + } else { + acrs(acr, link: link) + } + } else { + if plural { + acrfpl(acr, link: link) + } else { + acrf(acr, link: link) + } + } + } +} + +#let acrpl(acronym, link: true) = { + acr(acronym, plural: true, link: link) +} + +#let print-acronyms(language, acronym-spacing) = { + heading(level: 1)[#ACRONYMS.at(language)] + + context { + let acronyms = acros.get() + let acronym-keys = acronyms.keys() + + let max-width = 0pt + for acr in acronym-keys { + let result = measure(acr).width + + if (result > max-width) { + max-width = result + } + } + + let acr-list = acronym-keys.sorted() + + for acr in acr-list { + grid( + columns: (max-width + 0.5em, auto), + gutter: acronym-spacing, + [*#acr#label("acronyms-" + acr)*], [#acrl(acr, link: false)], + ) + } + } +} \ No newline at end of file diff --git a/packages/preview/clean-dhbw/0.2.1/check-attributes.typ b/packages/preview/clean-dhbw/0.2.1/check-attributes.typ new file mode 100644 index 000000000..b93716658 --- /dev/null +++ b/packages/preview/clean-dhbw/0.2.1/check-attributes.typ @@ -0,0 +1,212 @@ +#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-acronyms, + show-abstract, + acronym-spacing, + glossary-spacing, + abstract, + appendix, + acronyms, + university, + university-location, + supervisor, + date, + city, + bibliography, + bib-style, + logo-left, + logo-right, + university-short, + math-numbering, + ignored-link-label-keys-for-highlighting, +) = { + if (title == none or title == "") { + panic("Title is missing. Specify a title in the 'title' attribute of the template.") + } + + let boolean-attributes = ( + at-university: at-university, + show-confidentiality-statement: show-confidentiality-statement, + show-table-of-contents: show-table-of-contents, + show-acronyms: show-acronyms, + 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.") + } + } + + let string-attributes = ( + university: university, + university-location: university-location, + university-short: university-short, + ) + + 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.") + } + } + + 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.") + } + } + + 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.") + } + } + + let length-attributes = ( + acronym-spacing: acronym-spacing, + glossary-spacing: glossary-spacing, + ) + + 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.") + } + } + + 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" not in author or author.course == none or author.course == "") { + panic("Course of '" + author.name + "' is missing. Specify a course 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.") + } + + 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.") + } + } + } + + 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.") + } + + 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.") + } + + 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.") + } + } + + if (type(bibliography) != content and bibliography != none) { + panic("Bibliography is invalid. Specify a bibliography in the 'bibliography' attribute of the template.") + } + + 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.") + } + + 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.") + } + } + } +} \ No newline at end of file diff --git a/packages/preview/clean-dhbw/0.2.1/confidentiality-statement.typ b/packages/preview/clean-dhbw/0.2.1/confidentiality-statement.typ new file mode 100644 index 000000000..7f4a47702 --- /dev/null +++ b/packages/preview/clean-dhbw/0.2.1/confidentiality-statement.typ @@ -0,0 +1,74 @@ +#import "locale.typ": * + +#let confidentiality-statement( + authors, + title, + confidentiality-statement-content, + university, + university-location, + date, + language, + many-authors, + date-format, +) = { + let authors-by-city = authors.map(author => author.company.city).dedup() + + heading(level: 1, CONFIDENTIALITY_STATEMENT_TITLE.at(language)) + v(1em) + + if (confidentiality-statement-content != none) { + confidentiality-statement-content + } else { + let authors-by-company = authors.map(author => author.company.name).dedup() + let authors-by-study = authors.map(author => author.course-of-studies).dedup() + let companies = authors-by-company.join(", ", last: AND.at(language)) + + let institution = if (authors-by-company.len() == 1) { + INSTITUTION_SINGLE.at(language) + } else { + INSTITUTION_PLURAL.at(language) + } + + text(CONFIDENTIALITY_STATEMENT_SECTION_A.at(language)) + v(1em) + align( + center, + text(weight: "bold", title), + ) + + v(1em) + + par( + justify: true, + CONFIDENTIALITY_STATEMENT_SECTION_B.at(language) + [ ] + companies + CONFIDENTIALITY_STATEMENT_SECTION_C.at(language) + [ ] + authors-by-study.join(" | ") + CONFIDENTIALITY_STATEMENT_SECTION_D.at(language) + university + [ ] + university-location + CONFIDENTIALITY_STATEMENT_SECTION_E.at(language) + institution + [ (#companies)] + CONFIDENTIALITY_STATEMENT_SECTION_F.at(language), + ) + } + + let end-date = if (type(date) == datetime) { + date + } else { + date.at(1) + } + + v(2em) + text(authors-by-city.dedup().join(", ", last: AND.at(language)) + [ ] + end-date.display(date-format)) + + v(0.5em) + if (many-authors) { + grid( + columns: (1fr, 1fr), + gutter: 20pt, + ..authors.map(author => { + v(3.5em) + line(length: 80%) + author.name + }) + ) + } else { + for author in authors { + v(4em) + line(length: 40%) + author.name + } + } +} diff --git a/packages/preview/clean-dhbw/0.2.1/declaration-of-authorship.typ b/packages/preview/clean-dhbw/0.2.1/declaration-of-authorship.typ new file mode 100644 index 000000000..697a4081a --- /dev/null +++ b/packages/preview/clean-dhbw/0.2.1/declaration-of-authorship.typ @@ -0,0 +1,68 @@ +#import "locale.typ": * + +#let declaration-of-authorship( + authors, + title, + declaration-of-authorship-content, + date, + language, + many-authors, + at-university, + city, + date-format, +) = { + heading(level: 1, DECLARATION_OF_AUTHORSHIP_TITLE.at(language)) + v(1em) + + if (declaration-of-authorship-content != none) { + declaration-of-authorship-content + } else { + if (authors.len() == 1) { + par(justify: true, DECLARATION_OF_AUTHORSHIP_SECTION_A_SINGLE) + v(1em) + align(center, text(weight: "bold", title)) + v(1em) + par(justify: true, DECLARATION_OF_AUTHORSHIP_SECTION_B_SINGLE) + } else { + par(justify: true, DECLARATION_OF_AUTHORSHIP_SECTION_A_PLURAL) + v(1em) + align(center, text(weight: "bold", title)) + v(1em) + par(justify: true, DECLARATION_OF_AUTHORSHIP_SECTION_B_PLURAL) + } + } + + let end-date = if (type(date) == datetime) { + date + } else { + date.at(1) + } + + v(2em) + if (at-university) { + text(city + [, ] + end-date.display(date-format)) + } else { + let authors-by-city = authors.map(author => author.company.city).dedup() + + text(authors-by-city.join(", ", last: AND.at(language)) + [ ] + end-date.display(date-format)) + } + + v(1em) + if (many-authors) { + grid( + columns: (1fr, 1fr), + gutter: 20pt, + ..authors.map(author => { + v(3.5em) + line(length: 80%) + author.name + }) + ) + } else { + for author in authors { + v(4em) + line(length: 40%) + author.name + } + } +} diff --git a/packages/preview/clean-dhbw/0.2.1/dhbw.svg b/packages/preview/clean-dhbw/0.2.1/dhbw.svg new file mode 100644 index 000000000..4a9598b7a --- /dev/null +++ b/packages/preview/clean-dhbw/0.2.1/dhbw.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/packages/preview/clean-dhbw/0.2.1/docs/assumptions.md b/packages/preview/clean-dhbw/0.2.1/docs/assumptions.md new file mode 100644 index 000000000..f1b408045 --- /dev/null +++ b/packages/preview/clean-dhbw/0.2.1/docs/assumptions.md @@ -0,0 +1,7 @@ +# Assumptions + +For the development of the "*Clean DHBW Typst Template*", I've made the following assumptions: + +- The main "end-users" of these documents are the reviewers at DHBW and its partner companies. +- The documents are used for linear reading (*lineares Lesen*) as well as for selective reading (*selektierendes Lesen*). I.e. within the review process the document is typically read from beginning to end and on further review steps the reader will lookup specific sections or pages again. +- The majority of users will read these documents on-screen using some sort of PDF-reader. If printed on paper, a one-sided layout will be used and the document is bound or stapled on the left-hand side. \ No newline at end of file diff --git a/packages/preview/clean-dhbw/0.2.1/docs/design-explained.md b/packages/preview/clean-dhbw/0.2.1/docs/design-explained.md new file mode 100644 index 000000000..a0bc5c087 --- /dev/null +++ b/packages/preview/clean-dhbw/0.2.1/docs/design-explained.md @@ -0,0 +1,113 @@ +# New Document Structure and Layout + +## General Typographic Objectives + +A famous typographer once explained the fundamentals of good typographic design in the following way: If you want to draw attention on a crowded fun fair or carnival, you have to scream. In the silence of a church, some whispers are sufficient. Typography should work as described in the latter case, using subtle elements and especially not trying to be "louder" than the content. So it es easy to emphasize important content with little means. + +This is also the guiding principle of this template. Typographically it can be achieved e.g. by the following means: + +- Use as few font styles as possible +- Apply a uniform grey value (*Grauwert*) for the pages; e.g. don't make headlines "too black and bold" in comparison to the body text +- Place all page elements on a uniform grid + +In addition, some parameters are intentionally fixed to retain the document "calm" and to avoid "typographic accidents". + +## Document Structure +The document defined by the template consists of the following **parts**: +- Frontmatter + - Title page + - Abstract (*optional*) + - Table of Contents +- Body text (consisting of several chapters) +- Appendix + - References + - Acronyms (*optional*) + - Glossary (*optional*) + - User-defined appendix (*optional*) +- Legal backmatter + - Confidentiality Statement (*optional*) + - Declaration of Authorship + +I've added the "*optional*" markers from a content viewpoint to the elements in the list above. I.e. I consider them optional in a thesis or a similar document. On a technical level all components can be switched off, if desired. + +This structure reduces the frontmatter to 2-4 pages as it contains in its simplest form just the title page and one page for the TOC or, in a more typical case of a thesis with an abstract and two pages of the TOC, of four pages. + +**Page numbering** ist done as follows: +- Titel page: no page number +- Frontmatter (TOC & abstract): small roman numbers +- Rest of the document: arabic numerals (starting with 1 on the first page of chapter 1) + +The template defines four levels of **headings**: +- H1: Chapter heading (numbered) +- H2, H3: Subsection headings (numbered) +- H4: Subsection heading (without numbering) + +H1-H3 use the "1.1.1"-numbering format within the document body. In the Appendix this changes to an "A.1"-format. The first three heading levels are shown in the table of contents. + +H1 to H4 headings can be easily distinguished by their different typographic styles using sizes of 40/16/11/11 pt respectively and bold weighs for H1-H3, whereas H4 is printed in semibold small-caps. A1 (i.e. H1-format within the appendix) is reduced to a size of 32 pt as these headlines typically introduce parts which consist of only a few pages. + +## Page Typography + +### Body Text and Page Measures +The page has been designed starting with the selection of the body font and an adequate line length. + +[**Source Serif 4**](https://fonts.google.com/specimen/Source+Serif+4) (formerly known as *Source Serif Pro*) has been chosen for the **body text** as it is a high-quality font especially made for on-screen use and the reading of larger quantities of text. It was designed in 2014 by [Frank Grießhammer](https://fonts.adobe.com/designers/frank-griesshammer) for Adobe as a companion to *Source Sans Pro*, thus expanding their selection of Open Source fonts. It belongs to the category of transitional style fonts. Its relatively large x-height is typical for on-screen fonts and adds to the legibility even at small sizes. The font ist constantly being further developed. In the meantime there are special variants available e.g. for small print (*Source Serif Caption*, *Source Serif Small Text*) or large titles (*Source Serif Display*) and headings (*Source Serif Headings*). For people with a Computer Science background, the font might be familiar as it is used for the online documentation of the Rust programming language. + +Of the 21 cm of width an A4 page offers, two thirds (14 cm) are used for the body text. This results in a **line length** of about 77 characters, which exceeds the typical recommendation of 70. This is a slight compromise as a thesis and similar documents contain elements like figures, tables or large formulas which also have to fit into this space. + +This leaves the remaining third (7 cm) of the page for **margins**. They are unevenly distributed with 4 cm for the left and 3 cm for the right margin, leaving enough space for a binding of printed versions on the left side. + +Vertically these margins are repeated with 4 cm at the top (giving room to a heading) and 3 cm for the bottom margin. This leaves 22.7 cm for the **text block** whose aspect ratio thus results being the _golden section_. + +The underlying structure of the text block is a **vertical grid** of 16 pt height (called `page-grid` within the template), whereof 11 pt are taken by the body text, so that there is a *leading* of 5 pt (i.e. the space between lines). This **line height** produces good legibility for the *Source Serif 4* in this context. + +> *Note*: A font-size of 11 pt means different things in different type setting applications; it seems to me, that Typst uses "*hg-Höhe ohne Fleisch*" (see: [Schriftgrad](https://www.typolexikon.de/schriftgrad/) on this topic), whereas programs like InDesign or Word use "*hg-Höhe mit Fleisch*". Apart from that, the glyphs of a 11 pt font have different measures in each font (see: [Font-size, Line-height, Measure & Alignment](http://www.typographicwebdesign.com/setting-text/font-size-line-height-measure-alignment/#:~:text=A%20good%20rule%20of%20thumb,a%20good%20place%20to%20start.) and [Point size](https://practicaltypography.com/point-size.html)). + +This grid is used for **vertical spaces** wherever possible (e.g. for the paragraph spacing). But elements like headings, figures or tables may need to break it sometimes. + +### Guidance Systems +One of the main guiding systems besides page numbers (especially for selective reading) are the **headlines**. Their main structure has already been explained above. + +For the headlines as well as for other guiding elements of the document, the **font** [**Source Sans 3**](https://fonts.google.com/specimen/Source+Sans+3) has been chosen. It comes as a natural choice since *Source Serif 4* has been especially designed for this combination. But it has its virtues of its own, e.g. its reduced run length which permits more characters per line. This helps to avoid line-breaks within headings in our use case. *Source Sans 3* (originally named *Source Sans Pro*) has been designed by [Paul D. Hunt](https://blog.typekit.com/2013/11/20/interview-paul-hunt/) in 2012 as Adobes first Open Source font. It has its roots in the family of Gothic fonts thus belonging to a different category than *Source Serif 4*. But under [Robert Slimbachs](https://de.wikipedia.org/wiki/Robert_Slimbach) supervision, both designers succeeded to create a combination that fits well and at the same time the different rootings make the pairing not too "boring". + +In larger documents the chapters are an important structuring element. Therefore the **start of a new chapter** must be easily identifiable. This goal is implemented by using an especially large font-size for the chapter heading and by separating the chapter number into the upper right corner of the page (using an even larger size; see example below). This separation has more advantages: It gives the heading text more space, thus avoiding line-breaks and it brings two important guiding elements, namely chapter number and page number to the same place of a page. This allows you, when searching for some specific part of the document (especially when printed on paper), to scroll through the pages quickly and focus your attention on the top right-hand corner. + + + +This brings us to the next guiding element: The **page header**, containing page number and the heading of the current chapter (thus being repeated on each page). So, most important guiding information is gathered at the top of the page, making selective reading hopefully easier. + + +## Title Page + +To solve the problem of overcrowding on the title page, the content itseslf as well as the number of typographic means have been reduced: + +- Contentwise only the elements listed in [Usability Issues](usability-issues.md) are shown +- Typographic styles have been reduced to + - Three font sizes: + - 1.5 x `page-grid` for the title + - 1 x `page-grid` for all sub-titles and the author + - 11 pt (size of body text) for the info block on the botttom of the page + - Two font weights: regular and bold (in dark-grey as for the headings within the document) + - Centered alignment for _all_ elements + +Logos are placed at the top of the page on the same level as the header is displayed within the rest of the document. Centered alignment for the logo(s) means: + +- _One_ logo is actually placed centered +- _Two_ logos are treated as a "pair" with equivalent distance to the center of the page + + +# Recommended Reading + +[1] Bringhurst, Robert: *The Elements of Typographic Style*, Hartley & Marks Publishers, Vancouver (Canada), 1997 + +[2] [Beier, Sofie](https://www.researchgate.net/profile/Sofie-Beier): *Typeface Legibility: Towards defining familiarity*, PhD thesis, Royal College of Art, 2009 + +[3] Spiekermann, Erik: *Ursache & Wirkung: Ein typografischer Roman*, Context, Erlangen, 1986 + +[4] Tschichold, Jan: *Ausgewählte Aufsätze über Fragen der Gestalt des Buches und der Typografie*, Birkhäuser Verlag, Basel 1987, ISBN 3-7643-1946-1 + +[5] Willberg, Hans Peter; Forssman, Friedrich: *Lesetypographie*, H. Schmidt, Mainz, 1997 + +Especially [5] is helpful for the design of templates like `clean-dhwb` as it covers all aspects of a document (title page, toc, body text, use of fonts etc.) for different reading purposes. Moreover it shows many examples to explain the advantages and disadvantages of specific design decisions. + +The PhD thesis of Sofie Beier [2] makes clear how difficult it is to grasp the concept of "legibility" as there are so many different reading situations. Reading a traffic sign from 50m apart is completely different from reading a novel from a paper-back book you hold in your hand. Apart from that, what we perceive as "good legibility" may also be influenced by our reading experience when we learned to read in first grade. \ No newline at end of file diff --git a/packages/preview/clean-dhbw/0.2.1/docs/im-begin-chapter.png b/packages/preview/clean-dhbw/0.2.1/docs/im-begin-chapter.png new file mode 100644 index 000000000..7aadf8be9 Binary files /dev/null and b/packages/preview/clean-dhbw/0.2.1/docs/im-begin-chapter.png differ diff --git a/packages/preview/clean-dhbw/0.2.1/docs/usability-issues.md b/packages/preview/clean-dhbw/0.2.1/docs/usability-issues.md new file mode 100644 index 000000000..c67cd2907 --- /dev/null +++ b/packages/preview/clean-dhbw/0.2.1/docs/usability-issues.md @@ -0,0 +1,80 @@ +# Usability Issues + +The main purpose of good typography (i.e. a documents structure, design etc.) is to convey the contents as good as possible to the reader. Or how the famous typographer [Jan Tschichold](https://www.typolexikon.de/tschichold-jan/) puts it: + +> Zweck jeder Typographie ist Mitteilung. Die Mitteilung muss in kürzester, einfachster, eindringlichster Form erscheinen. +> +> (*The purpose of all typography is communication. The message must appear in the shortest, simplest, most emphatic form*.) + +## Abundant Frontmatter + +Current Bachelor theses and similar works at DHBW don't fulfill this goal very well. One prevalent problem is the amount of frontmatter they contain. I.e. from the title-page up to the beginning of the first chapter there is an abundant amount of pages with contents that could be placed elsewhere or be omitted at all. + +I've analyzed the last ten documents I reviewed. They have the following number of pages for frontmatter (F) and contents proper (C): +1. F: 11 – C: 61 +2. F: 10 – C: 73 +3. F: 10 – C: 57 +4. F: 12 – C: 71 +5. F: 6 – C: 60 +6. F: 11 – C: 64 +7. F: 12 – C: 78 +8. F: 10 – C: 70 +9. F: 16 – C: 57 +10. F: 6 – C: 57 + +That means, the reader has to scroll through up to 16 pages to get to the contents of the document – each time the file is opened! This qualifies easily as bloatware. + +The only elements I consider ***necessary*** as ***frontmatter*** are: +- title-page +- table of contents + +Even the latter is debatable in a PDF-docu +ment if a PDF-TOC is included, which can be displayed nicely in the sidebar of the PDF reader. + +Considering the above mentioned end-users, it is also debatable, if these documents really need an abstract. All stakeholders involved typically discuss what contents is expected before the document is written and the introductory chapter (if done well) transports these ideas too (perhaps on 2-5 pages instead of one as in an abstract). + +Other content is ***necessary or helpful***, but can be ***placed in the appendix*** of the document: +- declaration of authorship (necessary for legal reasons) +- confidentiality statement (necessary if the partner company desires so) +- glossary (helpful) +- list of abbreviations/acronyms (helpful) + +Then there is content which I consider merely as page filler and can be ***omitted*** at all (or if really necessary in special cases, can be placed in the appendix too): +- list of tables +- list of figures +- list of source code + +A last word onto this topic: I have the faint suspicion, that many students like these page fillers, because they think a comprehensive document is more impressive and leads to better grades. But I hope that it has become clear now, that this is rather annoying for the reader. + +## Crowded Title-Page + +The title-page should convey the most important information about the document it covers. But the title-pages I've seen are actually a vast collection of words and text wherein the reader has to search for the information he or she wants. Moreover there seems to be a competition on using as many font styles and sizes as possible, which adds to the impression of overcrowding. + +Apart from that, there is no real standard for the title-page – neither for the content nor for the layout. The above mentioned ten documents showed about five different base layouts, each with its own variations. + +A title-page for these documents should show the following information with different levels of importance: +- Level 1: + - Title +- Level 2: + - Author +- Level 3: + - Document category (e.g. "Bachelor Thesis", "Project Documentation") + - Faculty/department/study programme (e.g. "Computer Science") + - DHBW location (*Studienakademie*) +- Level 4 (there may be variations here, depending on the document category): + - Date of submission + - Reviewer at partner company + - Reviewer at DHBW + - Partner Company + - Course-ID, Student-ID + +Other text currently visible on the title-pages adds just some kind of "noise". There are e.g. prepositions like "*in* Computer Science", "*at* DHBW Karlsruhe" or "*by* John Doe" that add no real information but some even use a line of their own. Or phrases like "*für die Prüfung zum Bachelor of Science*" ... well, what else is the purpose of a Bachelor thesis? And do we really need the complete address of the partner company on the title page or would the company name not suffice? + +## Sub-Optimal Page Typography +Good page typography strives for optimal legibility. This is mainly achieved by using a high-quality body font in an adequate size with a line length of about 60-70 letters. All other measures of the page layout like line height, margins or paragraph spacing are derived thereof. I do not have the impression that the current recommendations are determined by these goals and therefore need some overhaul. + +Just one example is the recommendation for a 1.5x line-height, which presumably stems from times when typewrites were used. On a typewriter one could only choose a line-height of 1x/1.5x/2x and 3x (1x being the standard). So, it was common practice to use a 1.5x line-height for situations where reviewers wanted to add handwritten comments to a text later on. + +Nowadays people use the comment function of their favorite PDF reader to solve this problem. And for those working on paper, a good page layout offers sufficient whitespace on the margins for comments. + +As we are no longer restricted to typewriter mechanics or other technical limitations, we can (and should) exploit all possibilities of modern digital typesetting systems to implement good typography, thus producing documents with a high degree of legibility and usability. \ No newline at end of file diff --git a/packages/preview/clean-dhbw/0.2.1/glossary-lib.typ b/packages/preview/clean-dhbw/0.2.1/glossary-lib.typ new file mode 100644 index 000000000..71ace8313 --- /dev/null +++ b/packages/preview/clean-dhbw/0.2.1/glossary-lib.typ @@ -0,0 +1,43 @@ +#import "locale.typ": GLOSSARY +#import "shared-lib.typ": display, display-link + +#let prefix = "glossary-state-" +#let glossary-state = state("glossary", none) + +#let init-glossary(glossary) = { + glossary-state.update(glossary) +} + +// Display acronym. Expands it if used for the first time +#let gls(element, link: true) = { + display("glossary", glossary-state, element, element, link: link) +} + +// Print an index of all the acronyms and their definitions. +#let print-glossary(language, glossary-spacing) = { + heading(level: 1)[#GLOSSARY.at(language)] + + context { + let glossary = glossary-state.get() + let glossary-keys = glossary.keys() + + let max-width = 0pt + for key in glossary-keys { + let result = measure(key).width + + if (result > max-width) { + max-width = result + } + } + + let glossary-list = glossary-keys.sorted() + + for element in glossary-list { + grid( + columns: (max-width + 1em, auto), + gutter: glossary-spacing, + [*#element#label("glossary-" + element)*], [#glossary.at(element)], + ) + } + } +} \ No newline at end of file diff --git a/packages/preview/clean-dhbw/0.2.1/lib.typ b/packages/preview/clean-dhbw/0.2.1/lib.typ new file mode 100644 index 000000000..59f2dc8ee --- /dev/null +++ b/packages/preview/clean-dhbw/0.2.1/lib.typ @@ -0,0 +1,369 @@ +#import "@preview/codelst:2.0.2": * +#import "@preview/hydra:0.6.0": hydra +#import "acronym-lib.typ": init-acronyms, print-acronyms, acr, acrpl, acrs, acrspl, acrl, acrlpl, acrf, acrfpl +#import "glossary-lib.typ": init-glossary, print-glossary, gls +#import "locale.typ": TABLE_OF_CONTENTS, APPENDIX, REFERENCES +#import "titlepage.typ": * +#import "confidentiality-statement.typ": * +#import "declaration-of-authorship.typ": * +#import "check-attributes.typ": * + +// Workaround for the lack of an `std` scope. +#let std-bibliography = bibliography + +#let clean-dhbw( + title: none, + authors: (:), + language: none, + at-university: none, + confidentiality-marker: (display: false), + type-of-thesis: none, + show-confidentiality-statement: true, + show-declaration-of-authorship: true, + show-table-of-contents: true, + show-acronyms: true, + show-abstract: true, + acronym-spacing: 5em, + glossary-spacing: 1.5em, + abstract: none, + appendix: none, + acronyms: none, + glossary: none, + confidentiality-statement-content: none, + declaration-of-authorship-content: none, + titlepage-content: none, + university: none, + university-location: none, + university-short: none, + city: none, + supervisor: (:), + date: none, + date-format: "[day].[month].[year]", + bibliography: none, + bib-style: "ieee", + math-numbering: "(1)", + logo-left: image("dhbw.svg"), + logo-right: none, + ignored-link-label-keys-for-highlighting: (), + body, +) = { + // check required attributes + check-attributes( + title, + authors, + language, + at-university, + confidentiality-marker, + type-of-thesis, + show-confidentiality-statement, + show-declaration-of-authorship, + show-table-of-contents, + show-acronyms, + show-abstract, + acronym-spacing, + glossary-spacing, + abstract, + appendix, + acronyms, + university, + university-location, + supervisor, + date, + city, + bibliography, + bib-style, + logo-left, + logo-right, + university-short, + math-numbering, + ignored-link-label-keys-for-highlighting, + ) + + // ---------- Fonts & Related Measures --------------------------------------- + + let body-font = "Source Serif 4" + let body-size = 11pt + let heading-font = "Source Sans 3" + let h1-size = 40pt + let h2-size = 16pt + let h3-size = 11pt + let h4-size = 11pt + let page-grid = 16pt // vertical spacing on all pages + + + // ---------- Basic Document Settings --------------------------------------- + + set document(title: title, author: authors.map(author => author.name)) + let many-authors = authors.len() > 3 + let in-frontmatter = state("in-frontmatter", true) // to control page number format in frontmatter + let in-body = state("in-body", true) // to control heading formatting in/outside of body + + init-acronyms(acronyms) + init-glossary(glossary) + + // customize look of figure + set figure.caption(separator: [ --- ], position: bottom) + + // math numbering + set math.equation(numbering: math-numbering) + + // set link style for links that are not acronyms + let acronym-keys = if (acronyms != none) { + acronyms.keys().map(acr => ("acronyms-" + acr)) + } else { + () + } + + let glossary-keys = if (glossary != none) { + glossary.keys().map(gls => ("glossary-" + gls)) + } else { + () + } + + // show link: it => if (str(it.dest) not in (acronym-keys + glossary-keys + ignored-link-label-keys-for-highlighting)) { + // text(fill: blue, it) + // } else { + // it + // } + + // ========== TITLEPAGE ======================================== + + if (titlepage-content != none) { + titlepage-content + } else { + titlepage( + authors, + date, + heading-font, + language, + logo-left, + logo-right, + many-authors, + supervisor, + title, + type-of-thesis, + university, + university-location, + at-university, + date-format, + show-confidentiality-statement, + confidentiality-marker, + university-short, + page-grid, + ) + } + counter(page).update(1) + + // ---------- Page Setup --------------------------------------- + + // adapt body text layout to basic measures + set text( + font: body-font, + lang: language, + size: body-size - 0.5pt, // 0.5pt adjustment because of large x-hight + top-edge: 0.75 * body-size, + bottom-edge: -0.25 * body-size, + ) + set par( + spacing: page-grid, + leading: page-grid - body-size, + justify: true, + ) + + set page( + margin: (top: 4cm, bottom: 3cm, left: 4cm, right: 3cm), + header: + grid( + columns: (1fr, 1fr), + align: (left, right), + row-gutter: 0.5em, + smallcaps(text(font: heading-font, size: body-size, + context { + hydra(1, display: (_, it) => it.body, use-last: true, skip-starting: false) + }, + )), + text(font: heading-font, size: body-size, + number-type: "lining", + context {if in-frontmatter.get() { + counter(page).display("i") // roman page numbers for the frontmatter + } else { + counter(page).display("1") // arabic page numbers for the rest of the document + } + } + ), + grid.cell(colspan: 2, line(length: 100%, stroke: 0.5pt)), + ), + header-ascent: page-grid, + ) + + + // ========== FRONTMATTER ======================================== + + // ---------- Heading Format (Part I) --------------------------------------- + + show heading: set text(weight: "bold", fill: luma(80), font: heading-font) + show heading.where(level: 1): it => {v(2 * page-grid) + text(size: 2 * page-grid, it)} + + // ---------- Abstract --------------------------------------- + + if (show-abstract and abstract != none) { + heading(level: 1, numbering: none, outlined: false, ABSTRACT.at(language)) + text(abstract) + pagebreak() + } + + // ---------- ToC (Outline) --------------------------------------- + + // top-level TOC entries in bold without filling + show outline.entry.where(level: 1): it => { + set block(above: page-grid) + set text(font: heading-font, weight: "semibold", size: body-size) + link( + it.element.location(), // make entry linkable + it.indented(it.prefix(), it.body() + box(width: 1fr,) + it.page()) + ) + } + + // other TOC entries in regular with adapted filling + show outline.entry.where(level: 2).or(outline.entry.where(level: 3)): it => { + set block(above: page-grid - body-size) + set text(font: heading-font, size: body-size) + link( + it.element.location(), // make entry linkable + it.indented( + it.prefix(), + it.body() + " " + + box(width: 1fr, repeat([.], gap: 2pt), baseline: 30%) + + " " + it.page() + ) + ) + } + + if (show-table-of-contents) { + outline( + title: TABLE_OF_CONTENTS.at(language), + indent: auto, + depth: 3, + ) + } + + in-frontmatter.update(false) // end of frontmatter + counter(page).update(0) // so the first chapter starts at page 1 (now in arabic numbers) + + // ========== DOCUMENT BODY ======================================== + + // ---------- Heading Format (Part II: H1-H4) --------------------------------------- + + set heading(numbering: "1.1.1") + + show heading: it => { + set par(leading: 4pt, justify: false) + text(it, top-edge: 0.75em, bottom-edge: -0.25em) + v(page-grid, weak: true) + } + + show heading.where(level: 1): it => { + set par(leading: 0pt, justify: false) + pagebreak() + context{ + if in-body.get() { + v(page-grid * 10) + place( // place heading number prominently at the upper right corner + top + right, + dx: 9pt, // slight adjustment for optimal alignment with right margin + text(counter(heading).display(), + top-edge: "bounds", + size: page-grid * 10, weight: 900, luma(235), + ) + ) + text( // heading text on separate line + it.body, size: h1-size, + top-edge: 0.75em, + bottom-edge: -0.25em, + ) + } else { + v(2 * page-grid) + text(size: 2 * page-grid, counter(heading).display() + h(0.5em) + it.body) // appendix + } + } + } + + show heading.where(level: 2): it => {v(16pt) + text(size: h2-size, it)} + show heading.where(level: 3): it => {v(16pt) + text(size: h3-size, it)} + show heading.where(level: 4): it => {v(16pt) + smallcaps(text(size: h4-size, weight: "semibold", it.body))} + + // ---------- Body Text --------------------------------------- + + body + + + // ========== APPENDIX ======================================== + + in-body.update(false) + set heading(numbering: "A.1") + counter(heading).update(0) + + // ---------- Bibliography --------------------------------------- + + show std-bibliography: set heading(numbering: "A.1") + if bibliography != none { + set std-bibliography( + title: REFERENCES.at(language), + style: bib-style, + ) + bibliography + } + + // ---------- Acronyms & Glossary --------------------------------------- + + if (show-acronyms and acronyms != none and acronyms.len() > 0) { + print-acronyms(language, acronym-spacing) + } + + if (glossary != none and glossary.len() > 0) { + print-glossary(language, glossary-spacing) + } + + // ---------- Appendix (other contents) --------------------------------------- + + if (appendix != none) { // the user has to provide heading(s) + appendix + } + + // ========== LEGAL BACKMATTER ======================================== + + set heading(numbering: it => h(-18pt) + "", outlined: false) + + // ---------- Confidentiality Statement --------------------------------------- + + if (not at-university and show-confidentiality-statement) { + confidentiality-statement( + authors, + title, + confidentiality-statement-content, + university, + university-location, + date, + language, + many-authors, + date-format, + ) + } + + // ---------- Declaration Of Authorship --------------------------------------- + + if (show-declaration-of-authorship) { + declaration-of-authorship( + authors, + title, + declaration-of-authorship-content, + date, + language, + many-authors, + at-university, + city, + date-format, + ) + } + +} diff --git a/packages/preview/clean-dhbw/0.2.1/locale.typ b/packages/preview/clean-dhbw/0.2.1/locale.typ new file mode 100644 index 000000000..122619b25 --- /dev/null +++ b/packages/preview/clean-dhbw/0.2.1/locale.typ @@ -0,0 +1,123 @@ +#let TITLEPAGE_SECTION_B = ( + "de": "Studiengang ", + "en": "Course of Studies ", +) + +#let TITLEPAGE_DATE = ( + "de": "Eingereicht am:", + "en": "Submitted on:", +) + +#let TITLEPAGE_STUDENT_ID = ( + "de": "Matrikelnummer, Kurs:", + "en": "Student ID, Course:", +) + +#let TITLEPAGE_COMPANY = ( + "de": "Unternehmen:", + "en": "Company:", +) + +#let TITLEPAGE_COMPANY_SUPERVISOR = ( + "de": "Betreuer im Unternehmen:", + "en": "Supervisor in the Company:", +) + +#let TITLEPAGE_SUPERVISOR = ( + "de": "Betreuer an der ", + "en": "Supervisor at ", +) + +#let DECLARATION_OF_AUTHORSHIP_TITLE = ( + "de": "Selbstständigkeitserklärung", + "en": "Declaration of Authorship", +) + +#let DECLARATION_OF_AUTHORSHIP_SECTION_A_SINGLE = "Gemäß Ziffer 1.1.13 der Anlage 1 zu §§ 3, 4 und 5 der Studien- und Prüfungsordnung für die Bachelorstudiengänge im Studienbereich Technik der Dualen Hochschule Baden- Württemberg vom 29.09.2017. Ich versichere hiermit, dass ich meine Arbeit mit dem Thema:" + +#let DECLARATION_OF_AUTHORSHIP_SECTION_A_PLURAL = "Gemäß Ziffer 1.1.13 der Anlage 1 zu §§ 3, 4 und 5 der Studien- und Prüfungsordnung für die Bachelorstudiengänge im Studienbereich Technik der Dualen Hochschule Baden- Württemberg vom 29.09.2017. Wir versichern hiermit, dass wir unsere Arbeit mit dem Thema:" + +#let DECLARATION_OF_AUTHORSHIP_SECTION_B_SINGLE = "selbstständig verfasst und keine anderen als die angegebenen Quellen und Hilfsmittel benutzt habe. Ich versichere zudem, dass alle eingereichten Fassungen übereinstimmen." + +#let DECLARATION_OF_AUTHORSHIP_SECTION_B_PLURAL = "selbstständig verfasst und keine anderen als die angegebenen Quellen und Hilfsmittel benutzt haben. Wir versichern zudem, dass alle eingereichten Fassungen übereinstimmen." + +#let CONFIDENTIALITY_STATEMENT_TITLE = ( + "de": "Sperrvermerk", + "en": "Confidentiality Statement", +) + +#let CONFIDENTIALITY_STATEMENT_SECTION_A = ( + "de": "Die vorliegende Arbeit mit dem Titel", + "en": "The Thesis on hand", +) + +#let CONFIDENTIALITY_STATEMENT_SECTION_B = ( + "de": "enthält unternehmensinterne bzw. vertrauliche Informationen der", + "en": "contains internal respective confidential data of", +) +#let CONFIDENTIALITY_STATEMENT_SECTION_C = ( + "de": ", ist deshalb mit einem Sperrvermerk versehen und wird ausschließlich zu Prüfungszwecken im Studiengang", + "en": ". It is intended solely for inspection by the assigned examiner, the head of the", +) +#let CONFIDENTIALITY_STATEMENT_SECTION_D = ( + "de": " der ", + "en": " department and, if necessary, the Audit Committee at the ", +) +#let CONFIDENTIALITY_STATEMENT_SECTION_E = ( + "de": " vorgelegt. + +Der Inhalt dieser Arbeit darf weder als Ganzes noch in Auszügen Personen außerhalb des Prüfungsprozesses und des Evaluationsverfahrens zugänglich gemacht werden, sofern keine anders lautende Genehmigung der ", + "en": ". + +The content of this thesis may not be made available, either in its entirety or in excerpts, to persons outside of the examination process and the evaluation process, unless otherwise authorized by the training ", +) + +#let CONFIDENTIALITY_STATEMENT_SECTION_F = ( + "de": " vorliegt.", + "en": ".", +) + +#let INSTITUTION_SINGLE = ( + "de": "Ausbildungsstätte", + "en": "institution", +) + +#let INSTITUTION_PLURAL = ( + "de": "Ausbildungsstätten", + "en": "institutions", +) + +#let AND = ( + "de": " und ", + "en": " and ", +) + +#let TABLE_OF_CONTENTS = ( + "de": "Inhalt", + "en": "Contents", +) + +#let ABSTRACT = ( + "de": "Zusammenfassung", + "en": "Abstract", +) + +#let ACRONYMS = ( + "de": "Abkürzungen", + "en": "Acronyms", +) + +#let GLOSSARY = ( + "de": "Glossar", + "en": "Glossary", +) + +#let REFERENCES = ( + "de": "Literatur", + "en": "References", +) + +#let APPENDIX = ( + "de": "Anhang", + "en": "Appendix", +) diff --git a/packages/preview/clean-dhbw/0.2.1/shared-lib.typ b/packages/preview/clean-dhbw/0.2.1/shared-lib.typ new file mode 100644 index 000000000..d7863a2ca --- /dev/null +++ b/packages/preview/clean-dhbw/0.2.1/shared-lib.typ @@ -0,0 +1,21 @@ +#let assert-in-dict(dict-type, state, element) = { + context { + let list = state.get() + if element not in list { + panic(element + " is not a key in the " + dict-type + " dictionary.") + } + } +} + +#let display-link(dict-type, state, element, text) = { + assert-in-dict(dict-type, state, element) + link(label(dict-type + "-" + element), text) +} + +#let display(dict-type, state, element, text, link: true) = { + if link { + display-link(dict-type, state, element, text) + } else { + text + } +} diff --git a/packages/preview/clean-dhbw/0.2.1/template/acronyms.typ b/packages/preview/clean-dhbw/0.2.1/template/acronyms.typ new file mode 100644 index 000000000..f7c4ab14a --- /dev/null +++ b/packages/preview/clean-dhbw/0.2.1/template/acronyms.typ @@ -0,0 +1,5 @@ +#let acronyms = ( + API: "Application Programming Interface", + HTTP: "Hypertext Transfer Protocol", + REST: "Representational State Transfer", +) \ No newline at end of file diff --git a/packages/preview/clean-dhbw/0.2.1/template/assets/ts.svg b/packages/preview/clean-dhbw/0.2.1/template/assets/ts.svg new file mode 100644 index 000000000..f5acd4ea8 --- /dev/null +++ b/packages/preview/clean-dhbw/0.2.1/template/assets/ts.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/preview/clean-dhbw/0.2.1/template/glossary.typ b/packages/preview/clean-dhbw/0.2.1/template/glossary.typ new file mode 100644 index 000000000..8bd391532 --- /dev/null +++ b/packages/preview/clean-dhbw/0.2.1/template/glossary.typ @@ -0,0 +1,4 @@ +#let glossary = ( + Softwareschnittstelle: "Ein logischer Berührungspunkt in einem Softwaresystem: Sie ermöglicht und regelt den Austausch von Kommandos und Daten zwischen verschiedenen Prozessen und Komponenten.", + Komponente: "Ein Architekturbaustein. Zusammengesetzte Komponenten bestehen aus weiteren Subkomponenten. Einfache Komponenten sind nicht weiter unterteilt.", +) \ No newline at end of file diff --git a/packages/preview/clean-dhbw/0.2.1/template/main.typ b/packages/preview/clean-dhbw/0.2.1/template/main.typ new file mode 100644 index 000000000..c374b35b1 --- /dev/null +++ b/packages/preview/clean-dhbw/0.2.1/template/main.typ @@ -0,0 +1,138 @@ +#import "@preview/clean-dhbw:0.2.1": * +#import "acronyms.typ": acronyms +#import "glossary.typ": glossary + +#show: clean-dhbw.with( + title: "Evaluation von Typst zur Erstellung einer Abschlussarbeit", + authors: ( + (name: "Max Mustermann", student-id: "7654321", course: "TINF22B2", course-of-studies: "Informatik", company: ( + (name: "ABC GmbH", post-code: "76131", city: "Karlsruhe") + )), + // (name: "Juan Pérez", student-id: "1234567", course: "TIM21", course-of-studies: "Mobile Computer Science", company: ( + // (name: "ABC S.L.", post-code: "08005", city: "Barcelona", country: "Spain") + // )), + ), + type-of-thesis: "Bachelorarbeit", + acronyms: acronyms, // displays the acronyms defined in the acronyms dictionary + at-university: false, // if true the company name on the title page and the confidentiality statement are hidden + bibliography: bibliography("sources.bib"), + date: datetime.today(), + glossary: glossary, // displays the glossary terms defined in the glossary dictionary + language: "de", // en, de + supervisor: (company: "John Appleseed", university: "Prof. Dr. Daniel Düsentrieb"), + university: "Duale Hochschule Baden-Württemberg", + university-location: "Karlsruhe", + university-short: "DHBW", + // for more options check the package documentation (https://typst.app/universe/package/clean-dhbw) +) + +// Edit this content to your liking + += Einleitung + +#lorem(100) + +#lorem(80) + +#lorem(120) + += Erläuterungen + +Im folgenden werden einige nützliche Elemente und Funktionen zum Erstellen von Typst-Dokumenten mit diesem Template erläutert. + +== Abkürzungen + +Verwende die `acr`-Funktion und deren Geschwister `acrpl`, `acrs` und `acrspl`, um Abkürzungen aus dem Abkürzungsverzeichnis einzufügen. Beispiele dafür sind: + +- #acr("HTTP") – `acr`: Singular mit Erläuterung +- #acrpl("API") – `acrpl`: Plural mit Erläuterung +- #acrs("REST") - `acrs`: Singular ohne Erläuterung +- #acrspl("API") – `acrspl`: Plural ohne Erläuterung + +== Glossar + +Verwende die `gls`-Funktion, um Ausdrücke aus dem Glossar einzufügen, die dann dorthin verlinkt werden. Ein Beispiel dafür ist: + +- Eine #gls("Softwareschnittstelle") ist ein logischer Berührungspunkt in einem Softwaresystem. Sie ermöglicht und regelt den Austausch von Kommandos und Daten zwischen verschiedenen Prozessen und Komponenten. + +== Listen + +Es gibt Aufzählungslisten oder nummerierte Listen: + +- Dies +- ist eine +- Aufzählungsliste + ++ Und ++ hier wird ++ alles nummeriert. + +== Abbildungen und Tabellen + +Abbildungen und Tabellen (mit entsprechenden Beschriftungen) werden wie folgt erstellt. + +=== Abbildungen + +#figure(caption: "Eine Abbildung", image(width: 4cm, "assets/ts.svg")) + +=== Tabellen + +#figure( + caption: "Eine Tabelle", + table( + columns: (1fr, 50%, auto), + inset: 10pt, + align: horizon, + table.header( + [], + [*Area*], + [*Parameters*], + ), + + text("cylinder.svg"), + $ pi h (D^2 - d^2) / 4 $, + [ + $h$: height \ + $D$: outer radius \ + $d$: inner radius + ], + + text("tetrahedron.svg"), $ sqrt(2) / 12 a^3 $, [$a$: edge length], + ), +)