常见问题
本页收集了 Touying 使用中的常见问题与解决方案。
主题与配置
如何选择和切换主题?
Touying 提供多个内置主题,通过导入并应用主题函数即可切换:
#import "@preview/touying:0.7.0": *
#import themes.simple: *
#show: simple-theme
= Section
== Slide
Using the simple theme.
其他内置主题包括 themes.default、themes.metropolis、themes.aqua、themes.dewdrop、themes.stargazer、themes.university 等。
如何自定义主题颜色?
使用 config-colors(primary: ...) 自定义主题的主色调:
#import "@preview/touying:0.7.0": *
#import themes.metropolis: *
#show: metropolis-theme.with(
aspect-ratio: "16-9",
config-colors(primary: rgb("#d94f00")),
config-info(title: [Custom Color], author: [Author]),
)
= Section
== Slide
The header now uses the custom primary color.
config-common 配置参考
config-common 有哪些常用配置项?
config-common 是 Touying 的核心配置函数,以下是常用配置项及其默认值和说明:
| 配置项 | 默认值 | 说明 |
|---|---|---|
handout | false | 讲义模式,禁用动画 |
slide-level | 2 | 控制哪个标题级别创建新幻灯片 |
frozen-counters | () | 冻结计数器列表 |
show-strong-with-alert | true | 粗体文本使用 alert 样式 |
show-notes-on-second-screen | none | 第二屏幕演讲者备注(none/right/left) |
horizontal-line-to-pagebreak | true | 将 --- 水平线转换为分页符 |
nontight-list-enum-and-terms | false | 列表项间距控制 |
show-hide-set-list-marker-none | true | #pause 后隐藏列表标记 |
show-bibliography-as-footnote | none | 参考文献显示为脚注 |
scale-list-items | none | 缩放列表项大小 |
new-section-slide-fn | none | 章节幻灯片函数 |
freeze-slide-counter | false | 冻结幻灯片计数器 |
enable-pdfpc | true | 启用 pdfpc 支持 |
如何使用半透明遮罩替代完全隐藏?
使用 config-methods(cover: utils.semi-transparent-cover) 配置,使被隐藏的内容以半透明形式显示:
#show: simple-theme.with(
config-methods(cover: utils.semi-transparent-cover),
)