|
| 1 | +# KTHesis |
| 2 | + |
| 3 | +An unofficial, slightly opinionated, extensible [Typst](https://typst.app/home/) |
| 4 | +template for writing a Degree Project thesis for KTH Royal Institute of |
| 5 | +Technology in Stockholm, Sweden. |
| 6 | + |
| 7 | +Inspired by and partially adapted from Gerald Q. Maguire Jr.'s LaTeX template |
| 8 | +and KTH's official degree project report covers as published on the |
| 9 | +[institution's website](https://www.kth.se/en/omslag-till-ditt-exjobb-1.479838). |
| 10 | + |
| 11 | +## Overview |
| 12 | + |
| 13 | +This template is primarily targeted at Master's Degree theses, though it aims to |
| 14 | +be sufficiently generic so to also be suitable for other kinds of reports. It |
| 15 | +strives to simplify drafting and counts with the following features, among |
| 16 | +others: |
| 17 | + |
| 18 | +- Supports both English and Swedish as primary language, with built-in |
| 19 | + translations for template-managed headings and sections; |
| 20 | +- Supports additional Abstracts in other languages; |
| 21 | +- Supports arbitrary extra preamble sections, such as a Glossary / Table of |
| 22 | + Acronyms - i.e., integrates well with |
| 23 | + [glossarium](https://typst.app/universe/package/glossarium) or similar; |
| 24 | +- Does not conflict with Typst's native |
| 25 | + [bibliography](https://typst.app/docs/reference/model/bibliography/) mechanism |
| 26 | + even without requiring any additional configuration - "plug and play"; |
| 27 | +- Uses [hydra](https://typst.app/universe/package/hydra) to show the current |
| 28 | + Chapter title in the page header; |
| 29 | +- Uses [headcount](https://typst.app/universe/package/headcount) to make figure, |
| 30 | + table, and listing numbers dependent on Chapter number; |
| 31 | +- Includes built-in selective inclusion of indices: an index for figures, |
| 32 | + tables, and listings is automatically added if needed and omitted if not; |
| 33 | +- Can generate a "For DiVA" JSON-based trailing section for compatibility with |
| 34 | + existing, school-prevalent automation scripts; and |
| 35 | +- Provides a simple interface and tuning options. |
| 36 | + |
| 37 | +## Getting Started |
| 38 | + |
| 39 | +Visit the template's [homepage](https://typst.app/universe/package/kthesis/) and |
| 40 | +click "Create project in app" to try it out in the Typst web app. |
| 41 | + |
| 42 | +Alternatively, you can also run `typst init @preview/kthesis` to bootstrap a new |
| 43 | +project via the Typst CLI. |
| 44 | + |
| 45 | +## Usage |
| 46 | + |
| 47 | +The main entrypoint is the function `kth-thesis`, which should be invoked with |
| 48 | +a `show` rule at the beginning of the document: |
| 49 | + |
| 50 | +```typ |
| 51 | +#show: kth-thesis.with(primary-lang: "en") |
| 52 | +``` |
| 53 | + |
| 54 | +Additional configuration options are passed as needed. After this rule has been |
| 55 | +declared, you can write your thesis's content as normal. Level 1 headings (`=`) |
| 56 | +mark Chapters, Level 2 headings (`==`) delimitate Sections, Level 3 headings |
| 57 | +(`===`) indicate Subsections, and so on. |
| 58 | + |
| 59 | +The second and last point of contact with the template is the function |
| 60 | +`setup-appendices`, which you may (if needed) opt to invoke in a `show` rule to |
| 61 | +mark the subsequent sections as appendices and switch the numbering to letters: |
| 62 | + |
| 63 | +```typ |
| 64 | +#show: setup-appendices |
| 65 | +``` |
| 66 | + |
| 67 | +## Configuration |
| 68 | + |
| 69 | +There are a number of options that can be passed to the `kth-thesis` function to |
| 70 | +customize how the final document looks. All of them are optional since they come |
| 71 | +with default values, but in most cases you'll gradually end up having to set |
| 72 | +all of them to get the behavior you want. Here's a description of what is |
| 73 | +available: |
| 74 | + |
| 75 | +- `primary-lang`: Primary document language; either `en` or `sv` |
| 76 | +- `localized-info`: Language-specific information, including title, subtitle, |
| 77 | + abstract, and keywords |
| 78 | +- `authors`: Information about who is conducting the degree project |
| 79 | +- `supervisors`: Information about who is supervising the degree project |
| 80 | +- `examiner`: Information about who is evaluating the degree project |
| 81 | +- `course`: Degree project course of which this thesis is part |
| 82 | +- `degree`: Degree within the scope of which this project is being conducted |
| 83 | +- `national-subject-categories`: One or more mandatory classification codes, |
| 84 | + from [SCB's list](https://www.scb.se/contentassets/10054f2ef27c437884e8cde0d38b9cc4/standard-for-svensk-indelning--av-forskningsamnen-2011-uppdaterad-aug-2016.pdf) |
| 85 | +- `school`: KTH institution hosting the project |
| 86 | +- `trita-number`: TRITA number assigned by the school upon project completion |
| 87 | +- `host-company`: Company hosting the degree project, if any |
| 88 | +- `host-org`: Organization hosting the degree project, if any |
| 89 | +- `opponents`: Names of assigned opponents, if known |
| 90 | +- `presentation`: Final presentation details, if known |
| 91 | +- `cover-image`: Image to include on the front cover, if any |
| 92 | +- `acknowledgements`: Body of acknowledgements section |
| 93 | +- `extra-preambles`: Additional, arbitrary front-matter sections, if needed |
| 94 | +- `doc-date`: Document authoring/submission date |
| 95 | +- `doc-city`: Document city, for acknowledgments signature |
| 96 | +- `doc-extra-keywords`: Additional keywords for document metadata (but not text) |
| 97 | +- `with-for-diva`: Whether to include meta "For DiVA" section after back cover |
| 98 | +- `style`: Miscellaneous settings affecting the document's appearance |
| 99 | + |
| 100 | +Exact syntax and semantics for each option are shown in the starter `thesis.typ` |
| 101 | +main file provided by this template. |
| 102 | + |
| 103 | +**Note:** if `with-for-diva` is enabled, abstracts must use only very simple |
| 104 | +Typst constructs since content must be converted to HTML (which is a very lossy |
| 105 | +and naive process). |
| 106 | + |
| 107 | +## Future Work |
| 108 | + |
| 109 | +Feature requests (via issues) and patch submissions (via PRs) are very welcome. |
| 110 | + |
| 111 | +Among others, in the future it might be nice to support: |
| 112 | + |
| 113 | +- G5 size paper (traditional for theses in Sweden), instead of just A4; |
| 114 | +- Alternative, shorter author names for acknowledgements signature; |
| 115 | +- Multiple degrees, including the "Same"/"Both" mechanism for similar or |
| 116 | + distinct subject areas, respectively; and |
| 117 | +- Copyleft option, instead of just copyright; |
| 118 | + |
| 119 | +## Conformance |
| 120 | + |
| 121 | +This template is unofficial and has not been verified to fully conform to KTH's |
| 122 | +requirements, therefore you should use it at your own risk. However, available |
| 123 | +information appears to imply that the covers are the only standardized part of |
| 124 | +the degree project report, with students having freedom to decide on all other |
| 125 | +formatting, styling, and layout aspects (if accepted by the Examiner). |
| 126 | + |
| 127 | +Covers (June 2024 version) have been replicated as best as possible in Typst |
| 128 | +from the provided DOTX templates, but future bids at refining fidelity may be |
| 129 | +attempted in the future, especially if and when LaTeX versions are published. |
| 130 | + |
| 131 | +The covers use Arial, which is a proprietary font and may be difficult to get |
| 132 | +access to. This template will use Arial if it is available on the system at |
| 133 | +compile-time and `style.use-arial` is manually enabled (opt-in); otherwise, it |
| 134 | +will be replaced by an open, metric-compatible substitute: Liberation Sans. |
| 135 | + |
| 136 | +## Licensing |
| 137 | + |
| 138 | +This project and all materials in this repository are made available under the |
| 139 | +MIT License, except for the contents of the `/template` directory (i.e., the |
| 140 | +files given for the thesis authors to edit), which are instead licensed under |
| 141 | +MIT No Attribution. |
| 142 | + |
| 143 | +SPDX-License-Identifier: MIT AND MIT-0 |
0 commit comments