Skip to content

Commit

Permalink
thesist:1.0.0 (#1544)
Browse files Browse the repository at this point in the history
  • Loading branch information
tfachada authored Jan 12, 2025
1 parent 3c3eac9 commit 4456902
Show file tree
Hide file tree
Showing 25 changed files with 1,219 additions and 0 deletions.
21 changes: 21 additions & 0 deletions packages/preview/thesist/1.0.0/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024-2025 Tomás Fachada, ThesIST contributors

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.
49 changes: 49 additions & 0 deletions packages/preview/thesist/1.0.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# ThesIST

ThesIST (pronounced "desist") is an unofficial Master's thesis template for Instituto Superior Técnico written in Typst.

This template fully meets the official formatting requirements as outlined [here](https://tecnico.ulisboa.pt/files/2021/09/guia-disserta-o-mestrado.pdf), and also attempts to follow most unwritten conventions. Regardless, you can be on the lookout for things you may want to see added.

PIC2 reports with a thesis-like format are also supported, with options to change or hide some parts.

**Please read the "Quick guide" chapter included in this template to get set up. You can keep it as a reference if you want.**

## Prerequisites

If you are just using the Typst web app, you don't need to take any extra steps.

If you want to compile your thesis offline, make sure you have the following font families installed on your computer:

- TeX Gyre Heros

- TeX Gyre Bonum

## FAQ

### My PIC template looks nothing like this one!

Contrary to the thesis itself, the PIC2 doesn't have a universal format or ruleset. Use the template you're given (or port it to Typst yourself) if it's too different from this one. You can then come back to this one when you're writing your thesis document, which will have this format for sure.

### My PIC template looks like this one, but I can't fully replicate it because X.

Take a good look at *all* the setting variables there are in `main.typ`. If none of them changes what you want: first see if you can add the code yourself (for example, a `#pagebreak()` inside one of your sections); if this still doesn't solve it, feel free to open an issue or a pull request.

### Why is some of the front matter structure imported from this template's package instead of directly editable?

To have a simple interface, in which it isn't hard to find the variable parts. Sometimes the format is rigid, so the formatting code is not always trivial. ThesIST is intended for everyone at IST, so some flexibility was sacrificed in favor of readability. The idea is that even a person who doesn't code often should find this easier to navigate than the LaTeX template they would normally use.

If you think something isn't editable by the user but should, feel free to open an issue or a pull request.

### Any tips?

Be sure to keep checking the quick guide and, if needed, Typst's documentation and online help channels.

The known breaking changes introduced by any new version of this package will always be registered in its changelog, with instructions on what to change. Always check the changelogs when updating this template's package. They are on [the Releases page](https://github.com/tfachada/thesist/releases).

## Final remarks

This template is not necessarily a finished product. Contributions are welcome!

Thanks to the Typst online community members for the help in some of the functionalities, and for the extensions used here.

The IST logo and the default cover images used in this template are under copyright of Instituto Superior Técnico, and shall not be used for non-professional purposes or by people outside of the institution without its express authorization.
Binary file added packages/preview/thesist/1.0.0/src/IST.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions packages/preview/thesist/1.0.0/src/figure-numbering.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Set/reset numbering in the given format for figures of different kinds, as well as equations.
// Does NOT apply to figures with subfigures. Those update automatically.
#let set-figure-numbering(it, new-format: none) = {

// Set chapter-relative numbering for images
let image-numbering = super => numbering(new-format, counter(heading).get().first(), super)
show heading.where(level: 1): it => it + counter(figure.where(kind: image)).update(0)
show figure.where(kind: image): set figure(numbering: image-numbering)

// Same for tables
let table-numbering = super => numbering(new-format, counter(heading).get().first(), super)
show heading.where(level: 1): it => it + counter(figure.where(kind: table)).update(0)
show figure.where(kind: table): set figure(numbering: table-numbering)

// Same for listings
let code-numbering = super => numbering(new-format, counter(heading).get().first(), super)
show heading.where(level: 1): it => it + counter(figure.where(kind: raw)).update(0)
show figure.where(kind: raw): set figure(numbering: code-numbering)

// Same for algorithms
let algorithm-numbering = super => numbering(new-format, counter(heading).get().first(), super)
show heading.where(level: 1): it => it + counter(figure.where(kind: "algorithm")).update(0)
show figure.where(kind: "algorithm"): set figure(numbering: algorithm-numbering)

// Same for equations
let equation-numbering = super => numbering("("+new-format+")", counter(heading).get().first(), super)
show heading.where(level: 1): it => it + counter(math.equation).update(0)
set math.equation(numbering: equation-numbering)

it
}
68 changes: 68 additions & 0 deletions packages/preview/thesist/1.0.0/src/heading-styles.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// Short heading style
#let short-heading(it) = {
counter(heading).display() + " - " + it.body
}

// Simple heading style
#let simple-heading(chapter-type: none, it) = {
grid(
rows: (2em, auto, 2em, auto, 1em),
[],
text(chapter-type + " " + counter(heading).display(), 21pt),
[],
it.body,
[]
)
}

// Fancy heading style
#let fancy-heading(outline-title: none, it) = {

// Title
{
set align(right+horizon)
{
set text(size: 6cm, font: "TeX Gyre Bonum")
h(3cm)
counter(heading).display()
}
{
set text(size: 25pt)
linebreak()
v(1cm)
it.body
}
}

// Chapter outline
align(bottom,
context {
let loc = here()
let after = query(selector(heading.where(outlined: true)).before(loc)).last()
let elems = query(selector(heading.where(outlined: true)).after(loc))
let last_elem = none
for e in elems {
if e.level <= 1 { break }
last_elem = e
}

if last_elem != none {

block(text(outline-title, size: 21pt), above: 0pt, below: 0pt)

set text(size: 10pt)
block(line(length: 100%), below: 1.5em)

outline(
title: none,
target: selector(heading.where(level: 2, outlined: true)).after(after.location()).before(last_elem.location())
)

block(line(length: 100%), above: 1.5em)

}
}
)

pagebreak()
}
Loading

0 comments on commit 4456902

Please sign in to comment.