Skip to content

Commit eb3249d

Browse files
authored
sos-ugent-style:0.1.0 (#2870)
Co-authored-by: Thijs Paelman <>
1 parent 4668f65 commit eb3249d

File tree

60 files changed

+2716
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+2716
-0
lines changed
Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
1+
# SOS-UGent-style
2+
> Jouw hulplijn voor de UGent huisstijl in Typst.
3+
> Your hotline for UGent styling in Typst.
4+
5+
An unofficial template to bring the UGent style to Typst.
6+
For students and staff alike.
7+
8+
## Table of Contents
9+
- [Goals](#goals)
10+
- [Features](#features)
11+
- [Demo](#demo)
12+
- [Usage](#usage)
13+
- [Installation](#installation-options)
14+
- [Fonts](#fonts)
15+
- [License](#license)
16+
- [Community and contributions](#community-and-contributions)
17+
- [TODO's](#todos)
18+
- [Used in](#used-in)
19+
- [Inspired by](#inspired-by)
20+
- [About the name](#about-the-name)
21+
22+
## Goals
23+
It is often needed to present very similar content in different formats.
24+
This is why this template contains multiple entry points:
25+
- [x] ugent-doc
26+
Bare bones document with front page
27+
- [ ] Front page (all infrastructure is in place, just needs to be
28+
finalized to correctly show content)
29+
- [x] ugent-dissertation
30+
- Integrates some handy utility functions for dissertations.
31+
- [ ] ugent-beamer
32+
(not yet started. Contributions are welcome.)
33+
These should all work together, but unneeded formats can be deleted.
34+
35+
## Features:
36+
- Closely resemble the official [UGent MS Word/PowerPoint cover templates](https://styleguide.ugent.be/templates/index.html).
37+
- Localized for:
38+
- [x] English
39+
- [x] Dutch/Nederlands
40+
- [ ] Create Dutch readme
41+
- Take the faculty as option and load corresponding logo & colors.
42+
- [x] Works with two faculties. For example for the 'Educatieve Master'.
43+
- [x] The logos are also localized.
44+
- Fonts
45+
- [x] For students: a good default, free font.
46+
- [x] For staff: good integration with UGent Panno Text.
47+
- [x] Easily adjustable according to preferences
48+
- Smart referencing (go beyond the default capabilities of Typst)
49+
- [x] Reference math equations _with_ parentheses.
50+
- [x] Correctly reference elements depending on the current language, the requested
51+
capitalization and the element being referenced
52+
(e.g. Annex A instead of the default Chapter A).
53+
- [x] When referencing an unnumbered subheading, textually refer to the closest
54+
numbered heading, but digitally link to the original target.
55+
- Other options
56+
- [x] Color internal and external links for clarity.
57+
- [Utility functions](utils/README.md)
58+
- [x] `todo`: Use margin or inline notes about todo's in different colors.
59+
With a separate `todo-outline` to keep track of them.
60+
- [x] `flex-caption`: Long figure captions, short summaries in the outline.
61+
- [x] Math:
62+
- [x] `all-math-figures`: easily collect all math figures in one outline.
63+
- [x] `outline-group-by`: group all math figures by type in this single outline.
64+
- ...
65+
- Reproducibility
66+
Scientific results (including documents) should be as reproducible as
67+
possible, preferably bit-for-bit.
68+
- [x] [Guix](https://guix.gnu.org/) integration
69+
(implemented, but only tested in 1 scenario)
70+
- [ ] Multi-file projects with individually-compilable parts (~ LaTeX' subfiles).
71+
Not yet feasable, see [design docs](src/design-docs/TODO-subfiles.md).
72+
- No mandatory dependencies. Only integrated optional dependencies.
73+
See [`utils/`](utils/lib.typ) and [`src/utils/`](src/utils/README.md) for background.
74+
- [x] Integrated ['glossy'](https://typst.app/universe/package/glossy)
75+
- [x] Integrated [margin/inline notes](https://typst.app/universe/package/drafting)
76+
77+
## Demo
78+
<table>
79+
<tr>
80+
<td><img alt="Example of a dissertation title page. Dutch." src="examples/compiled/eduma-dissertation-nl.png"></td>
81+
<td><img alt="Example of a dissertation title page. English." src="examples/compiled/eduma-dissertation-en.png"></td>
82+
</tr>
83+
</table>
84+
85+
## Usage
86+
Create a new copy of the template by executing
87+
`typst init @preview/sos-ugent-style`
88+
or "Start from template" in the web app.
89+
Use `typst compile dissertation.typ` to create the dissertation pdf.
90+
The same goes for `doc.typ` or `beamer.typ`. Remove the files you don't want.
91+
92+
Most options are mentioned under [features](#features) and/or explained in
93+
the template itself. [Let me know](#community-and-contributions) if you have
94+
remarks or ideas to improve this section or the template itself.
95+
96+
## Installation options
97+
* **Use Typst Universe**
98+
See [usage](#usage). This uses the latest version uploaded to the Universe,
99+
not necessarily the latest version.
100+
* To get the latest version or to work on the package itself:
101+
[download & symlink](https://github.com/typst/packages?tab=readme-ov-file#local-packages)
102+
to `~/.local/share/typst/packages/preview/sos-ugent-style/0.1.0`.
103+
As long as [my contributions](https://github.com/swaits/typst-collection/pull/55)
104+
are not merged into _glossy_ itself and this repo is not yet updated to
105+
glossy:0.9.0+, you should also download and link
106+
[my fork](https://github.com/th1j5/typst-glossy/tree/main/glossy).
107+
* **Use GUIX**
108+
<TODO: these instructions can be a lot clearer, certainly since we aim to
109+
provide easy access to this package for users not familiar with guix.
110+
If you read this and are interested in better guix documentation, open an
111+
issue or send a mail. An example about how guix is used to enable
112+
reproducibility is found in [my dissertation](#used-in).>
113+
See [Specifying Additional Channels](https://guix.gnu.org/manual/en/guix.html#Specifying-Additional-Channels)
114+
in the Guix manual for instructions how to add it to your installation
115+
or simply add the following snippet to your channels.scm:
116+
```guile
117+
(channel
118+
(name 'sos-ugent-style)
119+
(url "https://codeberg.org/th1j5/typst-sos-ugent-style")
120+
(branch "main")
121+
; To pin to a certain release or commit, use the tag or commit hash here
122+
; This enables reproducibility with guix time-machine. Remove this field
123+
; to follow the latest commits.
124+
(commit "v0.1.0"))
125+
```
126+
If you are on a tagged release (like `v0.1.0`), use `typst-sos-ugent-style`
127+
in your manifest and `@preview/sos-ugent-style:0.1.0` in `.typ` files.
128+
Besides the hassle-free font installation and free reproducibility
129+
garanties, the experience should be exactly the same as from Typst Universe.
130+
131+
If you're following the main branch or are pinned to a non-release commit,
132+
use `typst-sos-ugent-style-next` in your manifest and
133+
`@next/sos-ugent-style:0.1.0` in `.typ` files.
134+
This is to signal to non-guix users that an unreleased version is used.
135+
136+
### Fonts
137+
[Fonts cannot be packaged together with a Typst package/template.
138+
](https://forum.typst.app/t/where-should-template-fonts-be-placed/2094)
139+
The only way for Typst to find fonts are command-line options or environment
140+
variables. For reproducibility, we add fonts using Guix.
141+
If you don't use Guix, you can still find & install the fonts in the
142+
directory 'fonts', or point typst to this location. Read the license remarks.
143+
144+
## License
145+
This software is released under the [GNU GPL v3.0 License](https://www.gnu.org/licenses/gpl-3.0.en.html).
146+
Some bundled assets are copyrighted by their respective owners.
147+
See [fonts](fonts/README.md) and [logos](src/logos/README.md).
148+
The `template` directory is available under the [MIT-0 license](https://opensource.org/license/mit-0),
149+
thus requiring no attribution.
150+
151+
## Community and contributions
152+
This is intended to be useful for UGent students AND staff, but I will most
153+
likely not be maintaining it (I will be an ex-student). If you send me the
154+
location of a maintained fork, I'll gladly advertise it here.
155+
In the meantime, contributions are welcome.
156+
You can checkout `src/design-docs/` to learn about some design decisions.
157+
158+
Contact: open an issue on codeberg or send a mail to
159+
thijs.paelman+ugenttypst at hotmail.be (yes, I know, I should really switch
160+
away from our evil overlords service 😓).
161+
162+
### TODO's
163+
- [ ] Template
164+
- [ ] Show how to use a yaml file for abbreviations
165+
- [ ] How to set ugent font (not the default since this package is also used by students)
166+
- [ ] Maybe provide content about the perfect integration with Zotero?
167+
- [ ] Replace bookman font by a free alternative
168+
- [ ] Support both UGent Panno Text and our default font for headings.
169+
(the optimal font sizes differ between them - see code comments)
170+
- [ ] Rewrite goals & features in this readme to be clearer.
171+
- [ ] GUIX
172+
- [ ] Test and document GUIX more.
173+
- [ ] Contribute to guix-science
174+
- [ ] Remove the need for `flex-caption`:
175+
Add a show rule which parses array or dict captions as a flex-caption,
176+
without needing to import & specify the `flex-caption` function.
177+
(not yet possible - cannot provide array/dict to a figure.caption, see
178+
also https://github.com/typst/typst/issues/1295)
179+
180+
### Used in:
181+
Are you using this template? Drop me a line! And tell your colleagues and
182+
friends :). This list can serve as an inspiration. Remember to distribute
183+
your version of `sos-ugent-style` _if_ you adapted it to your needs (GPLv3
184+
license), or even better: create a pull request to contribute your
185+
enhancements!
186+
- [Educatieve Masterpraktijkproef "Automatisch afleiden. Een nieuwe manier van
187+
afleiden met veel potentieel?" -- Nederlands -- CC BY-NC-SA 4.0](https://codeberg.org/th1j5/masterpraktijkproef-eduma)
188+
- Appendix B is about `sos-ugent-style` and Typst.
189+
- Creates a complete 50 page appendix directly from a Jupyter Notebook.
190+
Includes some (interesting) hacks to accomplish this.
191+
- Renders graphs created almost directly by Python.
192+
- Uses Guix for reproducibility.
193+
- Embeds a lot of source data in the pdf, to distribute the ground truth.
194+
- Tried to do 'subfiles', did not yet succeed.
195+
- Counts words with `wordometer`.
196+
- Tries to use `typst-languagetool` to check grammar when using offline.
197+
198+
### Inspired by
199+
- https://github.com/Dherse/masterproef/ (typst - Sébastien d'Herbais de Thun)
200+
MIT licensed here: https://github.com/Dherse/masterproef/tree/6d0cbab9afc8c53e4bd2518794cd13ca8063b4a2
201+
- [ugent-beamer](https://github.com/driesbenoit/ugent-beamer) (LaTeX - Dries Benoit)
202+
- [ugent-doc](https://github.com/driesbenoit/ugent-doc) (LaTeX - Dries Benoit)
203+
- [masterproef-template](https://github.com/merlijn-sebrechts/masterproef-template) (LaTeX - Merlijn Sebrechts)
204+
- [ugent-thesis-latex-template](https://github.ugent.be/aavdiere/ugent-thesis-latex-template)
205+
- UGent [style guide](https://styleguide.ugent.be/) and faculty guidelines
206+
(mostly engineering & architecture and 'Educatieve master')
207+
- My own dissertations:
208+
- [Educatieve Masterpraktijkproef "Automatisch afleiden. Een nieuwe manier
209+
van afleiden met veel potentieel?" -- Nederlands -- CC BY-NC-SA 4.0](
210+
https://codeberg.org/th1j5/masterpraktijkproef-eduma)
211+
- [Master's dissertation "Rerouting in-flight data packets on address
212+
changes" -- English -- CC BY-NC-SA 4.0](TODO: publish online)
213+
214+
### About the name
215+
The original working title of the project was `ugent-style`, but the naming
216+
guidelines of Typst Universe required something more fun 😁. Thanks Noor for
217+
the excellent suggestion! Thank you everyone who responded on my little
218+
opinion poll.
696 KB
Loading
735 KB
Loading
568 KB
Loading
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# About the included UGent Panno Text fonts
2+
The UGent Panno Text **is property of Ghent University.**
3+
These fonts can **only be used for tasks related to UGent purposes, by UGent staff**.
4+
Specifically, my interpretation is that **students cannot use this font** for
5+
their dissertation, but sometimes faculties [propose or demand this nonetheless?](
6+
https://www.ugent.be/fw/nl/voor-studenten/reglementen/algemene-richtlijnen-masterproef-2024-2025)
7+
8+
They are packaged here since the goal of this template is to be easy in use,
9+
certainly also for the creation of course materials, slides and UGent documents.
10+
The secondary goal of this template is to be reproducible (using Guix), thus
11+
all files needed to produce the result need to be available.
12+
(My hope is that Ghent University - while still retaining the rights over its
13+
branding - shares this concern for reproducibility in (scientific) documents.)
14+
15+
These fonts can already be found online elsewhere:
16+
- https://github.com/Dherse/masterproef/tree/main/fonts
17+
- https://github.com/merlijn-sebrechts/masterproef-template/tree/main/fonts (outdated fonts)
18+
- https://github.com/niknetniko/ugent2016
19+
- ...
20+
21+
# Font usage in Typst
22+
## In the document
23+
Although Typst makes it easy to style different elements in different fonts
24+
if wanted, it is encouraged to use the same font in the whole document.
25+
However, in this template, special care is taken to keep the following easy*:
26+
- Select the coverpage title font
27+
- Select the coverpage subtitle font
28+
- Select the coverpage text font
29+
- Select the document headings font
30+
- Select the document text font
31+
When no font is specified, this template uses "Liberation Sans".
32+
This is different from the Typst default.
33+
At the moment, a `font` argument is used. See `../src/DESIGN_RATIONALE.md`
34+
for how & why the template is designed this way.
35+
36+
*Remark that these capabilities stem purely from Typst itself, but keeping
37+
it easy to differentiate between the coverpage & document body, while providing
38+
a different default is at the moment not obvious.
39+
40+
## Using Guix
41+
This template supports using Guix to create bit-for-bit reproducible documents.
42+
The fonts cannot be installed using Typst alone, either you install them
43+
manually (see Typst documentation) OR you use guix to incorporate this template
44+
and the used fonts in 1 reproducible whole. The guix package for the proposed
45+
fonts is indicated further down.
46+
TODO: instructions
47+
48+
# Possible fonts
49+
There are two large groups of fonts: Serif and Sans-serif.
50+
51+
## Groups
52+
### Serif fonts (Dutch: geschreefde letters)
53+
For **longer** pieces of text when they are printed **on paper**.
54+
They have small projecting features at the letterform edges.
55+
56+
### Sans-serif fonts (Dutch: ongeschreefde letters, schreefloos)
57+
For digital documents which are read **on a screen**. Also for short texts on paper.
58+
Should also be easier to read for dyslexic people, but if you consciously target or
59+
work with dyslexic people, consider using [OpenDyslexic](https://opendyslexic.org/).
60+
When submitting on paper *and* digitally, use this family.
61+
62+
### Others
63+
There are also monospaced fonts, ...
64+
The distinction doesn't end at (sans-)serif.
65+
66+
## Proposed fonts
67+
According to the UGent styleguide, the preference is:
68+
1. UGent Panno Text
69+
2. Arial
70+
3. For Korean: Seoul NamSam (free)
71+
72+
These are all sans-serif.
73+
74+
But, these are non-free and not suited for student dissertations.
75+
An alternative proposal is:
76+
1. Liberation (~ Arial)
77+
2. Libertinus (Typst default, Arial alternative)
78+
3. New Computer Modern (professional LaTeX look)
79+
80+
These are all families with both serif & sans-serif versions.
81+
82+
### UGent Panno Text
83+
See intro and the UGent styleguide.
84+
**Nonfree, only for UGent staff for UGent purposes.**
85+
- Guix: Included in this package
86+
- License: Nonfree
87+
- Category: Sans-serif
88+
89+
### Arial
90+
While the font is proposed in many works around how to write your dissertation,
91+
the font is actually not free to use (using the GNU definition).
92+
Since most users use Windows or maybe because they study at UGent (TODO: check the particulars),
93+
they can in practice use them without any problems.
94+
- Guix (channel nonguix): font-microsoft-arial
95+
- License: Nonfree (https://corefonts.sourceforge.net/eula.htm)
96+
- Category: Sans-serif
97+
98+
### Liberation
99+
> The Liberation font family aims at metric compatibility with Arial, Times New Roman, and Courier New.
100+
- Guix: font-liberation
101+
- License: SIL OFL 1.1
102+
- Category: font family (both serif & sans-serif)
103+
104+
### Libertinus
105+
The font "libertinus serif" is the default in Typst.
106+
Based on the abandoned Linux Libertine project, which is designed to be
107+
an alternative for Times/Times New Roman and Helvetica/Arial.
108+
- Guix: font-libertinus (abandoned: font-linuxlibertine)
109+
- License: SIL OFL 1.1
110+
- Category: font family (both serif & sans-serif)
111+
112+
### New Computer Modern (LaTeX look)
113+
This provides the [LaTeX look of documents](https://typst.app/docs/guides/guide-for-latex-users/#latex-look).
114+
Includes a Mono and Math font.
115+
- Guix: texlive-newcomputermodern
116+
- License: GUST font license 1.0 (free)
117+
- Category: font family (both serif & sans-serif)
118+
119+
# Sources:
120+
- @polleflietScorenMetJe2023[pg. 286]
121+
- https://styleguide.ugent.be/basisprincipes/typografie.html
122+
- https://www.ugent.be/student/nl/studeren/taaladvies/schrijven/verzorg-je-lay-out
123+
- Enkele UGent sjablonen (2024-2025)
124+
- https://www.ugent.be/bw/nl/voor-studenten/curriculum/masterproef/masterproefrapport
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/// Usage:
2+
/// `#import "@preview/sos-ugent-style:0.1.0" as ugent`
3+
/// `#show ugent.dissertation-template.with(...)`
4+
#import "src/ugent-doc.typ": ugent-doc-template as doc-template
5+
#import "src/ugent-dissertation.typ": (
6+
ugent-dissertation-template as dissertation-template,
7+
// Use: `show: ugent.section.with("preface")`
8+
ugent-section as section,
9+
ugent-abstract-info as dissertation-abstract-info,
10+
ugent-dissertation-info as info,
11+
ugent-dissertation-info-full as info-full,
12+
)
13+
14+
#import "src/styling/elements.typ": ugent-glossary as glossary
15+
/// Proprietary UGent font, only use as UGent staff for UGent purposes. See fonts/README.md
16+
#let font-panno = "UGent Panno Text"
17+
#import "src/ugent-doc.typ": font-default
18+
19+
20+
// Some submodules are lazy loaded
21+
/// Usage (different ways, according to preference):
22+
/// #import "@preview/sos-ugent-style:0.1.0" as ugent: utils.todo
23+
/// #import ugent.utils.glossy(): *
24+
/// #import todo(): *
25+
/// The brackets are to execute the function, it returns the module
26+
#import "utils/lib.typ" as utils
27+
#import "src/i18n.typ"
28+
29+
30+
/// There should be no need to access anything except the exported functions.
31+
/// If you still have some advanced use-case, use `ugent.modules.ugent-doc.special-function`
32+
#let modules = (
33+
ugent-dissertation: { import "src/ugent-dissertation.typ"; ugent-dissertation },
34+
ugent-doc: { import "src/ugent-doc.typ"; ugent-doc },
35+
// Everything related to covers, should you feel a need to customize
36+
//cover: ,
37+
styling: (
38+
elements: { import "src/styling/elements.typ"; elements },
39+
),
40+
)

0 commit comments

Comments
 (0)