-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
19a7933
commit da6da8f
Showing
7 changed files
with
57 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Find next heading | ||
|
||
It can be very convenient to specify something like slide titles using headings | ||
as they have a dedicated Typst syntax. | ||
While it might suffice to just style how a heading is displayed using a show | ||
rule, this is not feasible when the slide title is supposed to be part of the | ||
page header, for example. | ||
|
||
For these situations, the toolbox provides `#toolbox.next-heading`. | ||
It takes a function mapping the body of the first heading on the same page (if | ||
it exists) to some content. | ||
|
||
The intended use is as such: | ||
|
||
```typ | ||
{{#include next-heading.typ:4:100}} | ||
``` | ||
![next-heading](next-heading.png) | ||
|
||
Note the extra show rule for level-one headings making them invisible. | ||
|
||
You can make `#toolbox.next-heading` look for headings of other levels as well, | ||
just specify the optional `level` argument that defaults to `1`. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#import "../../../src/polylux.typ": * | ||
#set text(size: 40pt, font: "Atkinson Hyperlegible") | ||
|
||
#set page( | ||
paper: "presentation-16-9", | ||
header: toolbox.next-heading(h => underline(h)) | ||
) | ||
|
||
#show heading.where(level: 1): none | ||
|
||
#set align(horizon) | ||
|
||
#slide[ | ||
= My slide title | ||
|
||
#lorem(10) | ||
] | ||
|
||
#slide[ | ||
slide without a title | ||
] | ||
|
||
#slide[ | ||
= Another title | ||
|
||
#lorem(10) | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
typst-compose side-by-side 1 gray --root ../../.. | ||
typst-compose side-by-side-kwargs 1 gray --root ../../.. | ||
typst-compose big 1 gray --root ../../.. | ||
typst-compose big-complex 1 gray --root ../../.. | ||
typst-compose big-complex 3 gray --root ../../.. | ||
typst-compose progress 3 gray --root ../../.. | ||
typst-compose sections-band 2 gray --root ../../.. | ||
typst-compose sections 4 gray --root ../../.. | ||
typst-compose full-width 1 gray --root ../../.. | ||
typst-compose next-heading 3 gray --root ../../.. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters