Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

theme: add estonia #87

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- [Metropolis](./themes/gallery/metropolis.md)
- [University](./themes/gallery/university.md)
- [Bipartite](./themes/gallery/bipartite.md)
- [Estonia](./themes/gallery/estonia.md)
- [Build your own](./themes/your-own.md)
- [Utilities](./utils/utils.md)
- [Side by side](./utils/side-by-side.md)
Expand Down
176 changes: 176 additions & 0 deletions book/src/themes/gallery/estonia.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
# Estonia theme

![estonia](estonia.png)

This theme is inspired by the
[estonia-beamer-theme](https://github.com/mpoquet/estonia-beamer-theme)
(both the polylux and beamer themes have been created by Millian Poquet).

Use it via
```typ
{{#include ../../IMPORT.typ}}
#import themes.estonia: *

#show: estonia-theme.with(...)
```

`estonia` uses polylux' section handling, the regular `#outline()` will not work
properly, use `#estonia-outline` instead.

## Options for initialisation
`estonia-theme` accepts the following optional keyword arguments:

- `aspect-ratio`: the aspect ratio of the slides, either `"16-9"` or `"4-3"`,
default is `"16-9"`

## Slide functions
`estonia` does **not** provide a `title-slide` function.

`estonia` provides the following custom slide function:

```typ
#slide(...)[
...
]
```

This is the main function provided by `estonia`.
This function generates a slide (page) around the provided content.
It has been created as pure as possible to enable a high level of customization via its arguments.

Here is the function definition with all its arguments.

```typ
#let slide(
title: none,
title-bar: auto,
title-bar-args: (
height-per-line: 1.5em,
func: est-title-bar,
func-args: (:),
),
progress-bar: true,
progress-bar-args: (
height: 1em,
func: est-progress-bar,
func-args: (:),
),
bottom-bar: false,
bottom-bar-args: (
height: 6mm,
func: est-speaker-slide-reminder-bar,
func-args: (:)
),
body-args: (
margin: 1cm,
alignment: left+horizon,
text-fill-color: black,
bg-color: white),
body
)
```

- set `progress-bar`, `title-bar`, or `bottom-bar` to `true` or `false` to always show or hide each bar
- `title-bar` can be `auto`. In this case the title bar will be shown if and only if a `title` is provided
- how your content is displayed can be customized via the `body-args` dictionary.
- `margin` defines the margin to put around your content. By default, `1cm` is used in all directions.
- you can use `margin: 0cm` to disable all margins.
- you can use `margin: (top: 0cm, rest: 1cm)` to disable the top margin.
- the values used in this dictionary are `top`, `bottom`, `left`, `right` and `rest`.
- other variables should be self-explanatory
- each bar has its own parameters, that are given in the `progress-bar-args`, `title-bar-args` or `bottom-bar-args` args
- bars have a `height`. the title bar has a `height-per-line`, which is multiplied by the number of lines in the title.
- each bar is generated by a function. a default function is provided for each bar, but this can be customized via the `func` arg.
- bar generation functions are called with some arguments set by the `slide` function:
- `width` is the total page width. this value is higher than `100%` because things other than your content are put in the page margins
- `height` is the bar height
- `title` is the title value (only used by the title bar)
- additional arguments can be set/overriden by giving a `func-args` dictionary to each bar.

## Additional features

The `#est-blue` variables defines the blue color used in the theme.

The `#estonia-outline` customises `#polylux-outline` and displays a table of contents with all sections.

---

The `est-progress-bar` is the default function to generate a progress bar.
It displays a content in an horizontal grid for each slide in your presentation.

```typ
#let est-progress-bar(
width,
height,
inset: 1cm,
show-slide-number: true,
bg-color: black,
text-size: 0.8em,
alignment: horizon,
before-slide: loc => {circle(radius: .075em, fill: white.darken(50%))},
current-slide: loc => {circle(radius: .15em, fill: white)},
after-slide: loc => {circle(radius: .075em, fill: white.darken(50%))},
slide-number: loc => {block(width: 1em, align(right, text(fill:white, logic.logical-slide.display())))}
)
```

- `before-slide`, `current-slide` and `after-slide` are functions that generate content.
these functions are called to generate the *dots* that represent each slide in the progress bar.
- `slide-number` is a function that generates a content that should display the current slide number.
- other arguments enable visual customization

---

The `est-title-bar` is the default function to generate a title bar.
It is just meant to show the slide title.

```typ
#let est-title-bar(
title,
width,
height,
bg-color: est-blue,
inset: 1cm,
alignment: left+horizon,
text-fill-color: white,
text-size: 1.2em,
)
```

Its arguments enable visual customization.

---

The `est-speaker-slide-reminder-bar` is the default function to generate a bottom bar.
It is meant to show the speaker identity, the title presentation, and optionally the page number.

```typ
#let est-speaker-slide-reminder-bar(
width,
height,
show-slide-number: false,
text-size: .8em,
alignment: center+horizon,
author-text-fill-color: white,
author-bg-color: black,
presentation-title-text-fill-color: white,
presentation-title-bg-color: est-blue,
slide-number-text-fill-color: black,
slide-number-bg-color: white,
author: [Speaker],
presentation-title: [Presentation title],
slide-number: {logic.logical-slide.display()}
)
```

- `show-slide-number` defines whether the slide number should be shown in the bar or not.
- `author` is the speaker identity
- `presentation-title` is the presentation title
- other arguments enable visual customization

## Example code
The image at the top is created by the following code:
```typ
{{#include ../../IMPORT.typ}}
{{#include estonia.typ:3:}}
```
Loading