k

kthesis

@preview

Unofficial thesis template for KTH Royal Institute of Technology

v0.1.8
MIT AND MIT-0
Template

Package Information

Last Updated
Minimum Typst Version
0.13.0
Categories
thesislayout

Preview

Template preview

1. Get the package

Download the package using the TPIX CLI:

tpix get @preview/kthesis:0.1.8

2. Initialize from template

Create a new project from this template:

typst init @preview/kthesis:0.1.8

Version History

0.1.80.13.0
bdce218138b9...
0.1.70.13.0
924bee9798bc...
0.1.60.13.0
c2da5ba28501...
0.1.50.13.0
541d5a2e55e4...
0.1.40.13.0
87f6b2531942...
0.1.30.13.0
37080a56617d...
0.1.20.13.0
3bef2185c9e0...
0.1.10.12.0
243b9aa297ea...
0.1.00.12.0
9a3afe6a5b72...

KTHesis

An unofficial, slightly opinionated, extensible Typst
template for writing a Degree Project thesis for KTH Royal Institute of
Technology in Stockholm, Sweden.

Inspired by and partially adapted from Gerald Q. Maguire Jr.'s LaTeX template
and KTH's official degree project report covers as published on the
institution's website.

Overview

This template is primarily targeted at Master's Degree theses, though it aims to
be sufficiently generic so to also be suitable for other kinds of reports. It
strives to simplify drafting and counts with the following features, among
others:

  • Supports both English and Swedish as primary language, with built-in
    translations for template-managed headings and sections;
  • Supports additional Abstracts in other languages;
  • Supports arbitrary extra preamble sections, such as a Glossary / Table of
    Acronyms - i.e., integrates well with
    glossarium or similar;
  • Does not conflict with Typst's native
    bibliography mechanism
    even without requiring any additional configuration - "plug and play";
  • Uses hydra to show the current
    Chapter title in the page header;
  • Uses headcount to make figure,
    table, and listing numbers dependent on Chapter number;
  • Includes built-in selective inclusion of indices: an index for figures,
    tables, and listings is automatically added if needed and omitted if not;
  • Can generate a "For DiVA" JSON-based trailing section for compatibility with
    existing, school-prevalent automation scripts; and
  • Provides a simple interface and tuning options.

Getting Started

Visit the template's homepage and
click "Create project in app" to try it out in the Typst web app.

Alternatively, you can also run typst init @preview/kthesis to bootstrap a new
project via the Typst CLI.

Usage

The main entrypoint is the function kth-thesis, which should be invoked with
a show rule at the beginning of the document:

#show: kth-thesis.with(primary-lang: "en")

Additional configuration options are passed as needed. After this rule has been
declared, you can write your thesis's content as normal. Level 1 headings (=)
mark Chapters, Level 2 headings (==) delimitate Sections, Level 3 headings
(===) indicate Subsections, and so on.

The second and last point of contact with the template is the function
setup-appendices, which you may (if needed) opt to invoke in a show rule to
mark the subsequent sections as appendices and switch the numbering to letters:

#show: setup-appendices

Configuration

There are a number of options that can be passed to the kth-thesis function to
customize how the final document looks. All of them are optional since they come
with default values, but in most cases you'll gradually end up having to set
all of them to get the behavior you want. Here's a description of what is
available:

  • primary-lang: Primary document language; either en or sv
  • localized-info: Language-specific information, including title, subtitle,
    abstract, and keywords
  • authors: Information about who is conducting the degree project
  • supervisors: Information about who is supervising the degree project
  • examiner: Information about who is evaluating the degree project
  • course: Degree project course of which this thesis is part
  • degree: Degree within the scope of which this project is being conducted
  • national-subject-categories: One or more mandatory classification codes,
    from SCB's list
  • school: KTH institution hosting the project
  • trita-number: TRITA number assigned by the school upon project completion
  • host-company: Company hosting the degree project, if any
  • host-org: Organization hosting the degree project, if any
  • opponents: Names of assigned opponents, if known
  • presentation: Final presentation details, if known
  • cover-image: Image to include on the front cover, if any
  • acknowledgements: Body of acknowledgements section
  • extra-preambles: Additional, arbitrary front-matter sections, if needed
  • doc-date: Document authoring/submission date
  • doc-city: Document city, for acknowledgments signature
  • doc-extra-keywords: Additional keywords for document metadata (but not text)
  • with-for-diva: Whether to include meta "For DiVA" section after back cover
  • style: Miscellaneous settings affecting the document's appearance

Exact syntax and semantics for each option are shown in the starter thesis.typ
main file provided by this template.

Note: if with-for-diva is enabled, abstracts must use only very simple
Typst constructs since content must be converted to HTML (which is a very lossy
and naive process).

Future Work

Feature requests (via issues) and patch submissions (via PRs) are very welcome.

Among others, in the future it might be nice to support:

  • G5 size paper (traditional for theses in Sweden), instead of just A4;
  • Alternative, shorter author names for acknowledgements signature;
  • Multiple degrees, including the "Same"/"Both" mechanism for similar or
    distinct subject areas, respectively; and
  • Copyleft option, instead of just copyright;

Conformance

This template is unofficial and has not been verified to fully conform to KTH's
requirements, therefore you should use it at your own risk. However, available
information appears to imply that the covers are the only standardized part of
the degree project report, with students having freedom to decide on all other
formatting, styling, and layout aspects (if accepted by the Examiner).

Covers (June 2024 version) have been replicated as best as possible in Typst
from the provided DOTX templates, but future bids at refining fidelity may be
attempted in the future, especially if and when LaTeX versions are published.

The covers use Arial, which is a proprietary font and may be difficult to get
access to. This template will use Arial if it is available on the system at
compile-time and style.use-arial is manually enabled (opt-in); otherwise, it
will be replaced by an open, metric-compatible substitute: Liberation Sans.

Licensing

This project and all materials in this repository are made available under the
MIT License, except for the contents of the /template directory (i.e., the
files given for the thesis authors to edit), which are instead licensed under
MIT No Attribution.

SPDX-License-Identifier: MIT AND MIT-0