Metropolis 主题
这个主题的灵感来自 Matthias Vogelgesang 创作的 Metropolis beamer 主题,由 Enivex 改造而来。
这个主题美观大方,很适合日常使用,并且你最好在电脑上安装 Fira Sans 和 Fira Math 字体,以取得最佳效果。
初始化
你可以通过下面的代码来初始化:
#import "@preview/touying:0.8.0": *
#import themes.metropolis: *
#import "@preview/numbly:0.1.0": numbly
#show: metropolis-theme.with(
aspect-ratio: "16-9",
footer: self => self.info.institution,
config-info(
title: [Title],
subtitle: [Subtitle],
author: [Authors],
date: datetime.today(),
institution: [Institution],
contact: [contact\@mail.com],
logo: emoji.city,
),
)
#set heading(numbering: numbly("{1}.", default: "1.1"))
#title-slide()
其中 metropolis-theme 接收参数:
aspect-ratio: 幻灯片的长宽比为 "16-9" 或 "4-3",默认为 "16-9"。align: 幻灯片的对齐方式,默认为horizon。header: 显示在页眉的内容,默认为self => utils.display-current-heading(setting: utils.fit-to-width.with(grow: false, 100%), depth: self.slide-level),也可以传入形如self => self.info.title的函数。header-right: 展示在页眉右侧的内容,默认为self => self.info.logo。footer: 展示在页脚的内容,默认为none,也可以传入形如self => self.info.author的函数。footer-right: 展示在页脚右侧的内容,默认为context utils.slide-counter.display() + " / " + utils.last-slide-number。footer-progress: 是否显示 slide 底部的进度条,默认为true。
并且 Metropolis 主题会提供一个 #alert[..] 函数,你可以通过 #show strong: alert 来使用 *alert text* 语法。