This is a Typst template for an Imperial Bachelor/Master's Dissertation/Thesis.
The base template was adapted from TUM's thesis template. The goal template is the LaTeX template that Imperial has released on Overleaf.
(I don't plan on particularly maintaining this, but will happily merge PRs or let someone else maintain this)
Note
The main branch contains the default template based completely on the EEE department's template
The doc_format branch contains an adapted template that I've modified for my usage in the Computing department
Tip
This is only a template. You have to adapt the template to your thesis and discuss the structure of your thesis with your supervisor!
Fill in your thesis details in the metadata.typ file:
university, e.g."Imperial College London"department, e.g."Department of Computing"logo_file- path to university logo image, e.g."/figures/icl_logo.png"program- or course, e.g."Electronic and Information Engineering"degree_type, e.g."Master of Engineering","Bachelor of Science"report_level, e.g."Interim","Final"supervisors- add names to this array, e.g.("Dr Marios Kogias", "Prof. A. Nother",)advisors- add names to this array, e.g.("Karl der Krümelmonster (MSc)",)author- your name, e.g."E.A. Sports"student_id, e.g."02020202"(CIDs for Imperial students)paper_title, e.g."Attention is All you Need"subtitle, e.g."And maybe some sleep"submissionDate, e.g.datetime(day: 23, month: 1, year: 2025)
These datetimes don't need to be set lest you plan to add them to the document:
startDate, e.g.datetime(day: 1, month: 10, year: 2024)presentationDate, e.g.datetime(day: 24, month: 1, year: 2025)feedbacklogSubmissionDate, e.g.datetime(day: 1, month: 1, year: 2024)
These values will be used to fill in various bits of data within the template, mostly within the titlepage.
Most of the formatting is handled within the layout/ files, so your written content can just look like regular content.
Your written content goes in the files in the content/ sections:
content/preamble/contains the contents of the preamble, e.g. abstract, disclaimers, etc.content/sections/contains the main content sections, e.g. Introduction, Background, etc.content/appendices/contains any appendices you want to addcontent/conclusionsis a file for the conclusions section (sth. that Imperial added after the rest of the sections)
To ensure that things are correctly imported and displayed, there are a few things in thesis.typ, you'll need to update:
sectionsandappendicesvariables to include/exclude new or modified filesfigure_listandtable_listboolean variables passed into#thesis(...)- they just define whether or not these will be displayed (default: true)
- at the top, there are multiple includes/imports to get preamble section contents, e.g.
abstract,conclusions, etc. acronymsis a file containing a variable containing 2-tuples with acronyms to be used in the text
If there are things you wish to change in the base layout or otherwise, please feel free to edit the thesis_template directly.
Important
In order to maintain the minitoc at the start of each content section, please remember to include the #minitoc() command after the primary heading, e.g. = Introduction
Though one should be able to get by without needing to touch the layout/ folder at all, lest you do, these are the most important files:
titlepage- styling for the title page...basic_formatting- handles the more basic sections, like the preamble and conclusions section- sets the page numbering header style
- styles the headings, particularly the level 1 headings
- sets the text styling
content_formatting- style the main content sections, likesections/andappendices/- styles the headings, particularly Imperial's imposing level 1 headings
- sets the page numbering header style
- computes and places the chapter numbering thumb labels
- sets the text styling
thesis_template- defines the main layout for the thesis, and handles applying the styles to the various sections- breaks all sections that require different primary styles into separate scopes
- and sets configurations for the basic/content formatting layout rules
- defines the order that sections and section content is laid out
- resets counters and counter styling for page and heading numbering
- breaks all sections that require different primary styles into separate scopes
You shouldn't need to worry about these too much, but in case you wish to use them:
print_pagebreak- previously written function to automatically reconfigure pagebreaks for print and non-print settings- Imperial prefers the
is_print == truesetting, with chapters and things starting on the left page of a double-page spread
- Imperial prefers the
minitoc- I wrote my own implementation of theminitocfunction since it wasn't working for metitlepage_spacer- a small convenience function to compute the spacing of the titles, names, and bottom section on the titlepagetodo- previously written function to print prominent todo blocks for things yet to be written
I, personally, use the VSCode extension. Please refer to this section if you'd prefer this.
To compile, the Run Code button can be used, while the main file thesis.typ is open. Or, you can follow the CLI instructions.
This has the added benefit of syntax highlighting and a preview that recompiles on changes.
This is also a great option, and the compilation is as easy as pressing a little button in the top corner, too.
See here for instructions on setting this up.
Once you have installed Typst, you can use it like this:
# Creates `thesis.pdf` in working directory.
typst compile thesis.typ
# Creates PDF file at the desired path.
typst compile thesis.typ path/to/output.pdfYou can also watch source files and automatically recompile on changes. This is faster than compiling from scratch each time because Typst has incremental compilation.
# Watches source files and recompiles on changes.
typst watch thesis.typMy assumption is that if you're here, it's because you already prefer Typst to LaTeX, so probably don't need this, but just in case:
For detailed installation instructions, please refer to the official installation guide.
If you prefer an integrated IDE-like experience with autocompletion and instant preview, the Typst web editor allows you to import files directly into a new or existing document. Here's how you can do this:
- Navigate to the Typst Web Editor.
- Create a new blank document.
- Click on "File" on the top left menu, then "Upload File".
- Select all .typ and .bib files along with the figures provided in this template repository.
Note: You can select multiple files to import. The editor will import and arrange all the files accordingly. Always ensure you have all the necessary .typ, .bib, and figures files you need for your document.
If you prefer to have a more integrated experience with your favorite code editor, you can use the Typst VS Code extension. The extension provides syntax highlighting, autocompletion, and error checking for Typst files. You can install the extension from the VS Code Marketplace.
- Open your project in VS Code
- Set the correct file (
thesis.typorproposal.typ) as the main file. This can be done by opening the respective file and running the commandTypst: Pin the main file to the currently opened document. Just hitCMD + Shift + Pand search for the command.