Skip to main content

Dewdrop Theme

This theme takes inspiration from Zhibo Wang's BeamerTheme and has been modified by OrangeX4.

The Dewdrop theme features an elegantly designed navigation, including two modes: sidebar and mini-slides.

Initialization​

You can initialize it using the following code:

#import "@preview/touying:0.8.0": *
#import themes.dewdrop: *

#import "@preview/numbly:0.1.0": numbly

#show: dewdrop-theme.with(
aspect-ratio: "16-9",
footer: self => self.info.institution,
navigation: "mini-slides",
config-info(
title: [Title],
subtitle: [Subtitle],
author: [Authors],
date: datetime.today(),
institution: [Institution],
contact: [contact\@mail.com],
),
)

#title-slide()

#outline-slide()

The dewdrop-theme function accepts the following parameters:

  • aspect-ratio: The aspect ratio of the slides, which can be "16-9" or "4-3", with a default of "16-9".
  • navigation: The style of the navigation bar, which can be "sidebar", "mini-slides", or none, with a default of "sidebar".
  • sidebar: Settings for the sidebar navigation, with default values of (width: 10em, filled: false, numbered: false, indent: .5em, short-heading: true).
    • width: The width of the sidebar.
    • filled: Whether the outline in the sidebar is filled.
    • numbered: Whether the outline in the sidebar is numbered.
    • indent: The indent of the outline in the sidebar.
    • short-heading: Whether the sidebar uses the short version of the headings.
  • mini-slides: Settings for the mini-slides navigation, with default values of (height: 4em, x: 2em, display-section: false, display-subsection: true, linebreaks: true, short-heading: true).
    • height: The height of the mini-slides, with a default of 4em.
    • x: The x-axis padding for the mini-slides, with a default of 2em.
    • display-section: Whether to display slides after the section and before the subsection, with a default of false.
    • display-subsection: Whether to display slides in subsections, with a default of true.
    • linebreaks: Whether to break the line between the section links and the subsection links, with a default of true.
    • short-heading: Whether to use the short version of the headings, with a default of true.
    • inline: Whether the dots sit on the same line as the section/subsection label, with a default of false.
  • footer: The content displayed in the footer of the slides, with a default of none. You can customize it with a function, such as self => self.info.author.
  • footer-right: The content displayed on the right side of the footer, with a default of context utils.slide-counter.display() + " / " + utils.last-slide-number.
  • primary: The primary color of the theme, with a default of rgb("#0c4842").
  • alpha: The transparency of the covered (not-yet-reached) headings in the outlines, with a default of 60%.
  • subslide-preamble: The content inserted before the body of every slide, with a default of self => block(text(1.2em, weight: "bold", fill: self.colors.primary, utils.display-current-heading(depth: self.slide-level, style: auto))), i.e. the heading of the current slide level. Pass none to remove it.

Additionally, the Dewdrop theme provides a #alert[..] function, which you can use with the #show strong: alert syntax to create emphasized alert text.

Color Theme​

The Dewdrop theme uses the following color scheme by default:

config-colors(
neutral-darkest: rgb("#000000"),
neutral-dark: rgb("#202020"),
neutral-light: rgb("#f3f3f3"),
neutral-lightest: rgb("#ffffff"),
primary: primary,
)

You can modify this color scheme using the config-colors() function. This allows you to tailor the color palette of your slides to match the aesthetic you're aiming for or to conform to a specific branding guideline.

Slide Function Family​

The Dewdrop theme provides a variety of custom slide functions:

#title-slide(config: (:), extra: none, ..args)

title-slide reads information from self.info for display, and you can also pass in an extra parameter to display additional information.


#slide(
config: (:),
repeat: auto,
setting: body => body,
composer: auto,
)[
...
]

A default slide with navigation and footer, where the footer is what you set.


#outline-slide(config: (:), title: utils.i18n-outline-title, ..args)

Display an outline slide. The ..args are forwarded to the built-in outline.

The outline slide places an invisible heading with place(hide(heading(..))), so that both the slide header and the speaker-note panel can pick the title up through utils.display-current-heading.


#new-section-slide(config: (:), title: utils.i18n-outline-title, ..args, body)

Start a new section with the given title, showing a progressive outline that highlights the current section. It is already registered through config-common(new-section-slide-fn: ..), so it is normally triggered by writing = Title and does not need to be called by hand.


#focus-slide[
...
]

Used to draw attention, with the background color set to self.colors.primary.

Speaker Notes​

Dewdrop defines its own notes function and registers it with config-common(notes-fn: notes), so the notes panel on a second screen and in the only-notes view follows the theme's colors. It is built on top of touying-notes, and you can override it with your own implementation:

#show: dewdrop-theme.with(
config-common(notes-fn: my-notes),
)

See Speaker Notes for details.

Example​

#import "@preview/touying:0.8.0": *
#import themes.dewdrop: *

#import "@preview/numbly:0.1.0": numbly

#show: dewdrop-theme.with(
aspect-ratio: "16-9",
footer: self => self.info.institution,
navigation: "mini-slides",
config-info(
title: [Title],
subtitle: [Subtitle],
author: [Authors],
date: datetime.today(),
institution: [Institution],
contact: [contact\@mail.com],
),
)

#set heading(numbering: numbly("{1}.", default: "1.1"))

#title-slide()

#outline-slide()

= Section A

== Subsection A.1

$ x_(n+1) = (x_n + a/x_n) / 2 $

== Subsection A.2

A slide without a title but with *important* infos

= Section B

== Subsection B.1

#lorem(80)

#focus-slide[
Wake up!
]

== Subsection B.2

We can use `#pause` to #pause display something later.

#pause

Just like this.

#meanwhile

Meanwhile, #pause we can also use `#meanwhile` to #pause display other content synchronously.

#show: appendix

= Appendix

== Appendix

Please pay attention to the current slide number.
Touying example output