University Theme
This theme is courtesy of Pol Dellaiera.
Initialization
You can initialize it with the following code:
#import "@preview/touying:0.2.1": *
#let s = themes.university.register(s, aspect-ratio: "16-9")
#let s = (s.methods.info)(
self: s,
title: [Title],
subtitle: [Subtitle],
author: [Authors],
date: datetime.today(),
institution: [Institution],
)
#let (init, slide, slides, title-slide, focus-slide, matrix-slide, touying-outline, alert) = utils.methods(s)
#show: init
The register
function takes the following parameters for initialization:
aspect-ratio
: Sets the aspect ratio of the slides to "16-9" or "4-3," with the default being "16-9."progress-bar
: Determines whether to display the progress bar at the top of the slides, with the default value oftrue
.
Additionally, the University theme provides an #alert[..]
function that you can use with #show strong: alert
using the *alert text*
syntax.
Color Themes
University theme defaults to using:
#let s = (s.methods.colors)(
self: s,
primary: rgb("#04364A"),
secondary: rgb("#176B87"),
tertiary: rgb("#448C95"),
neutral-lightest: rgb("#FBFEF9"),
)
You can modify the color theme by using #let s = (s.methods.colors)(self: s, ..)
.
Slide Function Family
The University theme provides a series of custom slide functions:
#title-slide(logo: none, authors: none, ..args)
The title-slide
reads information from self.info
for display, and you can pass in the logo
parameter and an array-type authors
parameter.
#slide(
repeat: auto,
setting: body => body,
composer: utils.side-by-side,
section: none,
subsection: none,
// university theme
title: none,
subtitle: none,
header: none,
footer: auto,
margin: (top: 2em, bottom: 1em, x: 0em),
padding: (x: 2em, y: .5em),
)[
...
]
The default ordinary slide function with a title and footer, where title
defaults to the current section title, and the footer is set by you.
#focus-slide(background-img: ..., background-color: ...)[
...
]
Used to capture the audience's attention, with the default background color being self.colors.primary
.
#matrix-slide(columns: ..., rows: ...)[
...
][
...
]
You can refer to the documentation.
slides
Function
The slides
function has the parameter:
title-slide
: Defaults totrue
.
You can set it using #show: slides.with(..)
.
#import "@preview/touying:0.2.1": *
#let s = themes.university.register(s, aspect-ratio: "16-9")
#let s = (s.methods.info)(
self: s,
title: [Title],
subtitle: [Subtitle],
author: [Authors],
date: datetime.today(),
institution: [Institution],
)
#let (init, slide, slides, title-slide, focus-slide, matrix-slide, touying-outline, alert) = utils.methods(s)
#show: init
#show: slides
= Title
== First Slide
Hello, Touying!
#pause
Hello, Typst!
Example
#import "@preview/touying:0.2.1": *
#let s = themes.university.register(s, aspect-ratio: "16-9")
#let s = (s.methods.info)(
self: s,
title: [Title],
subtitle: [Subtitle],
author: [Authors],
date: datetime.today(),
institution: [Institution],
)
#let (init, slide, slides, title-slide, focus-slide, matrix-slide, touying-outline, alert) = utils.methods(s)
#show: init
#title-slide(authors: ([Author A], [Author B]))
#slide(title: [Slide title], section: [The section])[
#lorem(40)
]
#slide(title: [Slide title], subtitle: emph[What is the problem?])[
#lorem(40)
]
#focus-slide[
*Another variant with an image in background...*
]
#matrix-slide[
left
][
middle
][
right
]
#matrix-slide(columns: 1)[
top
][
bottom
]
#matrix-slide(columns: (1fr, 2fr, 1fr), ..(lorem(8),) * 9)