Skip to content

Commit b6b1e13

Browse files
authored
simple-inria-touying-theme:0.1.0 (#3487)
1 parent 1977b6c commit b6b1e13

File tree

9 files changed

+691
-0
lines changed

9 files changed

+691
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Copyright © 2025 Sylvain Soliman <[email protected]>
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of
4+
this software and associated documentation files (the “Software”), to deal in
5+
the Software without restriction, including without limitation the rights to
6+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
7+
the Software, and to permit persons to whom the Software is furnished to do so,
8+
subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
15+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Lines changed: 247 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,247 @@
1+
# Inria Theme
2+
3+
| Title Slide | Sample Slide | Section Slide |
4+
|:-----------:|:------------:|:-------------:|
5+
|![image](https://gitlab.inria.fr/soliman/inria-touying-theme/-/raw/main/thumbnail.png) | ![image](https://gitlab.inria.fr/soliman/inria-touying-theme/-/raw/main/assets/page.png) | ![image](https://gitlab.inria.fr/soliman/inria-touying-theme/-/raw/main/assets/section.png) |
6+
7+
This theme draws inspiration from the default Metropolis theme for the [touying](https://touying-typ.github.io/) presentation framework for [typst](https://typst.app/home/).
8+
It and has been adapted to comply roughly with Inria's graphic charter while remaining simple and elegant.
9+
Note that this is however an unofficial theme.
10+
11+
<!-- [![Typst Universe](https://img.shields.io/badge/dynamic/xml?url=https%3A%2F%2Ftypst.app%2Funiverse%2Fpackage%2Fsimple-inria-touying-theme&query=%2Fhtml%2Fbody%2Fdiv%2Fmain%2Fdiv%5B2%5D%2Faside%2Fsection%5B2%5D%2Fdl%2Fdd%5B3%5D&logo=typst&label=universe&color=%2339cccc)](https://typst.app/universe/package/inria-touying-theme) -->
12+
[![GitLab License](https://img.shields.io/gitlab/license/soliman%2Finria-touying-theme?gitlab_url=https%3A%2F%2Fgitlab.inria.fr%2F&color=green)](https://gitlab.inria.fr/soliman/inria-touying-theme/-/raw/main/LICENSE)
13+
14+
It is recommended to have the [Inria Sans](https://font.download/font/inria-sans) font installed (the theme will fallback to Fira Sans or Noto Sans otherwise, since they are reasonably close).
15+
The logo itself is property of Inria (see https://www.inria.fr/fr/charte-dutilisation-de-lidentite-visuelle-dinria)
16+
17+
## Initialization
18+
19+
You can initialize it using the following code:
20+
21+
```typst
22+
#import "@preview/touying:0.6.1": *
23+
#import "@preview/simple-inria-touying-theme:0.1.0": *
24+
25+
#show: inria-theme.with(
26+
aspect-ratio: "16-9",
27+
config-info(
28+
title: [Title],
29+
subtitle: [Subtitle],
30+
author: [Authors],
31+
date: datetime.today(),
32+
),
33+
footer-progress: true,
34+
section-slides: true,
35+
black-title: true,
36+
)
37+
38+
#title-slide()
39+
40+
= First Slide
41+
42+
Content
43+
44+
= New Section <touying:hidden>
45+
46+
#new-section-slide([Hello there!])
47+
48+
= Another Slide
49+
50+
More Content
51+
```
52+
53+
The `inria-theme` in the theme accepts the following parameters:
54+
55+
- `aspect-ratio`: The aspect ratio of the slides, which can be "16-9" or "4-3", with a default of "16-9".
56+
- `align`: The alignment of the content within the slides, with a default of `horizon` (horizontal alignment).
57+
- `header`: The content displayed in the header of the slides, with a default that displays the current heading adjusted to fit the width (`utils.display-current-heading(setting: utils.fit-to-width.with(grow: false, 100%))`). Alternatively, you can provide a function like `self => self.info.title` to customize the header content.
58+
- `header-right`: The content displayed on the right side of the header, with a default that shows the logo specified in `self.info.logo`.
59+
- `logo`: A logo image, for the title slide, with a default to the red Inria logo.
60+
- `footer`: The content displayed in the footer of the slides, with a default of the logo. You can customize it with a function, for example, to display the author's information: `self => self.info.author`.
61+
- `footer-right`: The content displayed on the right side of the footer, with a default that shows the slide number (`context utils.slide-counter.display()`).
62+
- `footer-progress`: A boolean value indicating whether to display a progress bar at the bottom of the slides, with a default of `true`.
63+
- `section-slides`: A boolean value indicating whether sections (first level headers) should be considered as defining slides directly, with a default of `true`. Setting it to `false` will use subsections and will display specific slides for each new section.
64+
- `black-title`: A boolean value indicating whether to use the normal text color for titles instead of the accent color, with a default of `true`.
65+
66+
## Color Theme
67+
68+
Inria uses the following default color theme (precise RGB values are given below):
69+
70+
```typst
71+
config-colors(
72+
primary: inria-rouge, // accent
73+
primary-light: inria-bleu-nuit, // progress
74+
secondary: inria-framboise,
75+
neutral-lightest: white, // bg
76+
neutral-darkest: inria-gris-bleu, // fg
77+
),
78+
```
79+
80+
You can modify this color theme using `config-colors()`.
81+
The official Inria graphic charter would use `black` as neutral-darkest.
82+
83+
## Slide Function Family
84+
85+
The Inria theme provides a variety of custom slide functions:
86+
87+
```typst
88+
#title-slide(extra: none, ..args)
89+
```
90+
91+
`title-slide` reads information from `self.info` for display, and you can also pass in an `extra` parameter to display additional information.
92+
93+
## Other Customizations
94+
95+
Consider using:
96+
97+
```typst
98+
#set text(lang: "en")
99+
#show math.equation: set text(font: "Fira Math")
100+
#set strong(delta: 100)
101+
#set par(justify: true)
102+
```
103+
104+
## Convenience Variables and Functions
105+
106+
The theme defines variables corresponding to the official Inria colors.
107+
108+
``` typst
109+
#let inria-rouge = rgb("#c9191e")
110+
#let inria-framboise = rgb("#a60f79")
111+
#let inria-violet = rgb("#5d4b9a")
112+
#let inria-bleu-nuit = rgb("#27348b")
113+
#let inria-bleu-canard = rgb("#1067a3")
114+
#let inria-bleu-azur = rgb("#00a5cc")
115+
#let inria-bleu-vert = rgb("#88ccca")
116+
#let inria-gris-bleu = rgb("#384257")
117+
#let inria-cactus = rgb("#608b37")
118+
#let inria-vert-tendre = rgb("#95c11f")
119+
#let inria-jaune = rgb("#ffcd1c")
120+
#let inria-orange = rgb("#ff8300")
121+
#let inria-sable = rgb("#d6bc86")
122+
```
123+
124+
and a few other utility functions
125+
126+
``` typst
127+
// Utility function when you want bold but not alert
128+
#let bold(body) = {
129+
text(weight: "bold", body)
130+
}
131+
132+
#let fullcite(label) = {
133+
set text(size: .5em)
134+
cite(label, form: "full")
135+
}
136+
```
137+
138+
---
139+
140+
```typst
141+
#slide(
142+
config: (:),
143+
repeat: auto,
144+
setting: body => body,
145+
composer: components.side-by-side,
146+
// inria theme
147+
title: auto,
148+
footer: auto,
149+
align: horizon,
150+
)[
151+
...
152+
]
153+
```
154+
155+
A default slide with headers and footers, where the title defaults to the current section title, and the footer is what you set.
156+
157+
---
158+
159+
```typst
160+
#focus-slide[
161+
...
162+
]
163+
```
164+
165+
Used to draw attention, with the background color set to `self.colors.primary-dark`.
166+
167+
---
168+
169+
```typst
170+
#new-section-slide(short-title: auto, title)
171+
```
172+
173+
Creates a new section with the given title.
174+
175+
## Example
176+
177+
```typst
178+
#import "@preview/touying:0.6.1": *
179+
#import "@preview/simple-inria-touying-theme:0.1.0": *
180+
181+
#import "@preview/numbly:0.1.0": numbly
182+
183+
#show: inria-theme.with(
184+
aspect-ratio: "16-9",
185+
footer: self => self.info.institution,
186+
config-info(
187+
title: [Title],
188+
subtitle: [Subtitle],
189+
author: [Authors],
190+
date: datetime.today(),
191+
institution: [Institution],
192+
logo: emoji.city,
193+
),
194+
)
195+
196+
#set heading(numbering: numbly("{1}.", default: "1.1"))
197+
198+
#title-slide()
199+
200+
= Outline <touying:hidden>
201+
202+
#outline(title: none, indent: 1em, depth: 1)
203+
204+
= First Section
205+
206+
---
207+
208+
A slide without a title but with some *important* information.
209+
210+
== A long long long long long long long long long long long long long long long long long long long long long long long long Title
211+
212+
=== sdfsdf
213+
214+
A slide with equation:
215+
216+
$ x_(n+1) = (x_n + a/x_n) / 2 $
217+
218+
#lorem(200)
219+
220+
= Second Section
221+
222+
#focus-slide[
223+
Wake up!
224+
]
225+
226+
== Simple Animation
227+
228+
We can use `#pause` to #pause display something later.
229+
230+
#meanwhile
231+
232+
Meanwhile, #pause we can also use `#meanwhile` to display other content synchronously.
233+
234+
#speaker-note[
235+
+ This is a speaker note.
236+
+ You won't see it unless you use `config-common(show-notes-on-second-screen: right)`
237+
]
238+
239+
#show: appendix
240+
241+
= Appendix
242+
243+
---
244+
245+
Please pay attention to the current slide number.
246+
```
247+
Lines changed: 1 addition & 0 deletions
Loading
139 KB
Loading
149 KB
Loading
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#import "@preview/touying:0.6.1": *
2+
#import "@preview/simple-inria-touying-theme:0.1.0": *
3+
4+
#show: inria-theme.with(
5+
aspect-ratio: "16-9",
6+
config-info(
7+
title: [Title],
8+
subtitle: [Subtitle],
9+
author: [Authors],
10+
date: datetime.today(),
11+
),
12+
footer-progress: true,
13+
section-slides: true,
14+
black-title: true,
15+
)
16+
17+
#title-slide()
18+
19+
= First Slide
20+
21+
Content
22+
23+
= New Section <touying:hidden>
24+
25+
#new-section-slide([Hello there!])
26+
27+
= Another Slide
28+
29+
More Content

0 commit comments

Comments
 (0)