Skip to content

Commit

Permalink
feat: psl-thesis 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sdiebolt committed Dec 17, 2024
1 parent 4dca2a9 commit c4b8f99
Show file tree
Hide file tree
Showing 16 changed files with 2,781 additions and 0 deletions.
1,789 changes: 1,789 additions & 0 deletions packages/preview/psl-thesis/0.1.0/LICENSE

Large diffs are not rendered by default.

105 changes: 105 additions & 0 deletions packages/preview/psl-thesis/0.1.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# PSL University PhD thesis template

This is a Typst template for a thesis manuscript at Paris Sciences et Lettres (PSL)
University. Inspired by the
[`psl-cover.sty`](https://www.cri.ensmp.fr/people/guillou/psl-cover/) LaTeX style by
Pierre Guillou, and the [PhD PSL university LaTeX
template](https://www.overleaf.com/latex/templates/template-phd-psl-university-paris-sciences-et-lettres/jtntgmybzjxn)
by Arthur Chavignon.

## Usage

You can use this template in the Typst web app by clicking "Start from tempate" on the
dashboard and searching for `psl-thesis`.

Alternatively, you can use the CLI to kick this project off using the command

```bash
typst init @preview/psl-thesis
```

Typst will create a new directory with all the files needed to get you started.

## Configuration

This template exports the `psl-thesis-covers` function with the following named
arguments:

- `title`: The title of the thesis.
- `author`: The author of the thesis.
- `date`: The denfense date.
- `institute`: The institute where the thesis was prepared.
- `institute-logo`: A content (e.g. result of the `image` function) to place in the
front cover footer, or `none`.
- `doctoral-school`: Dictionnary containing the `name` and `number` of the doctoral
school.
- `specialty`: The specialty of the thesis.
- `jury`: An array of dictionaries containing the `firstname`, `lastname`, `title` and
`role` of each jury member.
- `abstracts`: A dictionary containing the thesis abstracts in French and English,
displayed on the back cover.
- `keywords`: A dictionary containing the thesis keywords in French and English,
displayed on the back cover.

The function also accepts a single, positional argument for the body of the thesis. The
front cover language can be either French or English, and is set by calling the `text`
function with the `lang` argument before calling `psl-thesis-covers`.

The template will initialize your package with a sample call to the `psl-thesis-covers`
function in a show rule. Example sections and chapter styling are also included. If you
want to use your own thesis layout with only the front and back covers, you can use the
`psl-thesis-covers` function alone:

```typst
#import "@preview/psl-thesis:0.1.0": psl-thesis-covers
// Choose between fr and en to set the front cover language.
#set text(lang: "fr", font: "Montserrat", size: 11pt)
#show: psl-thesis-covers.with(
title: [Recherches sur les substances radioactives],
author: [Marie Skłodowska-Curie],
date: [le 25 juin 1903],
doctoral-school: (name: [Faculté des sciences], number: [123]),
institute: [à la Faculté des Sciences de Paris],
institute-logo: image("./logo-institute.svg", height: 3.5cm),
specialty: [Sciences Physiques],
jury: (
(
firstname: "Name",
lastname: "Surname",
title: "PhD, Affiliation",
role: "President",
),
(
firstname: "Name",
lastname: "Surname",
title: "PhD, Affiliation",
role: "Referee",
),
(
firstname: "Name",
lastname: "Surname",
title: "PhD, Affiliation",
role: "Referee",
),
(
firstname: "Name",
lastname: "Surname",
title: "MD, PhD, Affiliation",
role: "Member",
),
(
firstname: "Name",
lastname: "Surname",
title: "PhD, Affiliation",
role: "PhD supervisor",
),
),
abstracts: (fr: lorem(128), en: lorem(128)),
keywords: (fr: lorem(4), en: lorem(4)),
)
// Your thesis content goes here.
```

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions packages/preview/psl-thesis/0.1.0/lang.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[conf]
default-lang = "en"

[lang.en]
conducted_at = "Conducted at"
presented_by = "Presented by"
doctoral_school = "Doctoral school n°"
specialty = "Specialty"
jury = "Jury members"

[lang.fr]
conducted_at = "Préparée"
presented_by = "Soutenue par"
doctoral_school = "École doctorale n°"
specialty = "Spécialité"
jury = "Composition du jury"
228 changes: 228 additions & 0 deletions packages/preview/psl-thesis/0.1.0/lib.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
#import "@preview/linguify:0.4.1": *

#let database = toml("lang.toml")

#let colors = (
psl: rgb(36, 56, 141),
)

#let psl-front-cover(
// The thesis title.
title: [PhD title],
// The thesis author.
author: [Thesis author],
// The institution name.
institute: [Institute name],
// Path to the institute logo, or none.
institute-logo: none,
// The doctoral school name and number.
doctoral-school: (
name: [Doctoral school name],
number: [Doctoral school number],
),
// The thesis specialty.
specialty: [Thesis specialty],
// The defense date.
date: [Defense date],
// The jury members.
jury: (
(
firstname: "Name",
lastname: "Surname",
title: "PhD, Affiliation",
role: "President",
),
(
firstname: "Name",
lastname: "Surname",
title: "PhD, Affiliation",
role: "Referee",
),
),
) = {
// Page setup.
set page(
background: image("assets/front-bg.jpg"),
margin: (left: 2cm, right: 1.5cm, top: 2cm, bottom: 6cm),
footer: [
#if institute-logo != none {
align(center)[#institute-logo]
}
],
)
set text(size: 14pt)

// Institute name.
v(5.6cm)
block(text(linguify("conducted_at", from: database) + [ #institute], fill: colors.psl), width: 10cm)

// Thesis title.
v(1cm)
align(center)[
#text([*#title*], size: 16pt)
]

// Thesis author, doctoral school, specialty, and jury members.
v(0.5cm)

let make-jury-table = {
set text(size: 11pt)
table(
columns: (1fr, 0.6fr),
stroke: none,
align: (left, right),
inset: 0cm,
row-gutter: 0.5cm,
column-gutter: 1cm,
..jury
.map(member => {
(
[#member.firstname #smallcaps([#member.lastname])\ #member.title],
[_#member.role _],
)
})
.flatten()
)
}

set rect(
inset: 0.3cm,
fill: luma(240),
width: 100%,
)

grid(
columns: (0.6fr, 1fr),
rows: 3,
gutter: 1cm,
[
#v(0.3cm)
#text(linguify("presented_by", from: database), fill: colors.psl)\
#text([*#author*], size: 16pt)\
#date
],
grid.cell(
rowspan: 3,
rect[
#text(linguify("jury", from: database), fill: colors.psl)\
#make-jury-table
],
),
[
#text(linguify("doctoral_school", from: database) + [ #doctoral-school.number], fill: colors.psl)\
#text([*#doctoral-school.name*], size: 16pt)
],
[
#text(linguify("specialty", from: database), fill: colors.psl)\
#text([*#specialty*], size: 16pt)
],
)

pagebreak()
}

#let psl-back-cover(
// The thesis abstracts, in French and English.
abstracts: (
fr: [Résumé],
en: [Abstract],
),
// The thesis keywords, in French and English.
keywords: (
fr: [mot clé 1, mot clé 2, mot clé 3, mot clé 4],
en: [keyword 1, keyword 2, keyword 3, keyword 4],
),
) = {
pagebreak()

set page(
background: place(top + left, image("assets/back-bg.png")),
margin: (left: 2cm, right: 1.5cm, top: 2cm, bottom: 4.5cm),
)

show heading: it => {
set text(fill: colors.psl, weight: "light")
block(smallcaps(it.body))
v(-0.5cm)
line(length: 100%, stroke: colors.psl)
}

set par(justify: true)
align(horizon)[
#heading(level: 1, outlined: false)[Résumé]
#text(size: 0.9em)[#abstracts.fr]

#heading(level: 1, outlined: false)[Mots clés]
#text(size: 0.9em)[#keywords.fr]

#heading(level: 1, outlined: false)[Abstract]
#text(size: 0.9em)[#abstracts.en]

#heading(level: 1, outlined: false)[Keywords]
#text(size: 0.9em)[#keywords.en]
]
}

#let psl-thesis-covers(
// The thesis title.
title: [PhD title],
// The thesis author.
author: [Thesis author],
// The defense date.
date: [Defense date],
// The institute where the thesis was prepared.
institute: [Institute name],
// A content (e.g. result of the `image` function) to place in the front cover footer,
// or none.
institute-logo: none,
// The doctoral school name and number.
doctoral-school: (
name: [Doctoral school name],
number: [Doctoral school number],
),
// The thesis specialty.
specialty: [Thesis specialty],
// The jury members.
jury: (
(
firstname: "Name",
lastname: "Surname",
title: "PhD, Affiliation",
role: "President",
),
(
firstname: "Name",
lastname: "Surname",
title: "PhD, Affiliation",
role: "Referee",
),
),
// The thesis abstracts, in French and English.
abstracts: (
fr: [Abstract in French],
en: [Abstract in English],
),
// The thesis keywords, in French and English.
keywords: (
fr: [Keywords in French],
en: [Keywords in English],
),
// The thesis body.
doc,
) = {
psl-front-cover(
author: author,
title: title,
institute: institute,
institute-logo: institute-logo,
doctoral-school: doctoral-school,
specialty: specialty,
date: date,
jury: jury,
)

doc

pagebreak(to: "odd", weak: false)
psl-back-cover(abstracts: abstracts, keywords: keywords)
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
= Conclusions

== General conclusions

#lorem(128)

== Perspectives

#lorem(128)

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#import "/helpers.typ": publication

#set heading(numbering: none)
= Publications

== Publications in peer-reviewed journals

#publication(
[*Author 1*, Author 2, Author 3],
"Article title",
"Journal",
doi: "a1b2c3d4.xxxxx.99999",
)

== Drafts

#publication(
[*Author 1*, Author 2, Author 3],
"Article title",
"Journal",
)

== Posters in international conferences

#publication(
[*Author 1*, Author 2, Author 3],
"Poster title",
"Conference",
)
Loading

0 comments on commit c4b8f99

Please sign in to comment.