graph LR
Q1[Quarto] --> L[LaTeX Markup] --> P1[PDF]
Q1 --> T[Typst Markup] --> P1[PDF]
2 ZHAW thesis template
In Chapter 1 you developped a Quarto based document in a bottom up approach. This was very important for you to get a good understanding of how Quarto works. However the output did not look at all like a document you could submit as a thesis.
In this chapter, we will introduce a Quarto extension we developped that will turn your quarto document into a PDF that meets the ZHAW LSFM requirements. This extension uses Typst as a backend to generate a pdf.
All information on the thesis template / extension can be found here:
What do we mean by backend?
Quarto does not have a custom PDF renderer. But Quarto is based on pandoc, which means that Quarto files are converted to a markup language that does have a PDF renderer. There are two choices:
- Latex: The classical approach to rendering pdfs. Very old, very mature, but very complex.
- Typst: A new markup language designed with an improved syntax and much faster compilation. It has a young, vibrant and growing community and we believe Typst will replace LaTeX in the long run.
2.1 Tasks
Task 1: Change output format
Open the document from Chapter 1. Change the output format in the metadata to typst and preview your document (quarto preview index.qmd). If you already have a preview session running in the terminal, you will need to interrupt it with Ctrl+C and then run the preview command.
You can also give the latex renderer a try by compiling to format: pdf.
---
title: "Robust Regression and Outlier Detection"
subtitle: "Chapter 2: Simple Regression"
author:
- Peter J. Rousseeuw
- Annick M. Leroy
date: "1987-10-19"
format: html
------
title: "Robust Regression and Outlier Detection"
subtitle: "Chapter 2: Simple Regression"
author:
- Peter J. Rousseeuw
- Annick M. Leroy
date: "1987-10-19"
format: typst
---Task 2: Install the extension
To facilitate the writing of your thesis, we’ve created a ZHAW LSFM template that meets the requirements made by the department. We’ve packaged this template as a Quarto extension.
Quarto has a convenient way to distribute extension. Since we host our code on GitHub, you can simply install the extension using the GitHub Username/oganisation like so:
quarto use template zhaw-lsfm/quarto-thesis
# (we recommend you use a new, empty folder for this step and
# answer the followup questions with `Yes`)This will create the following folder structure on your computer:
- 1
-
The folder
extensionsis not important right now - 2
- A Quarto file with the same name as the parent folder is your starter file!
Task 3: Preview the document
Now, run quarto preview SOMENAME.qmd to get a first look at how your output looks like. Change the YAML metadata to meet your thesis and check the output.
Task 4: Read the template manual
We’ve written a manual on our template / extension. Have a look at it here
https://zhaw-lsfm.github.io/quarto-thesis/
Now, you are ready to write your thesis!