You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何为Quarto HTML Book传入自定义布局模板?

如何为Quarto HTML Book自定义布局模板?

这是Quarto Book的默认外观:
Quarto HTML Book默认布局

我的_quarto.yml配置内容如下:

project:
  type: book

book:
  title: An example report
  subtitle: The subtitle
  author:
    - name: Jane Doe
      affiliations:
        - name: University of XXX
          department: Department of YYY
    - name: Eva Nováková
      affiliations:
        - name: University of XXX
          department: Department of YYY
    - name: Matti Meikäläinen
      affiliations:
        - name: University of XXX
          department: Department of YYY
  chapters:
    - index.qmd
    - text/conclusion.qmd
    - references.qmd

format:
  html:
    theme: cosmo
    toc: true
    toc-depth: 3

我习惯在Jekyll站点里用_layouts/default.html覆盖默认布局模板,但不清楚Quarto里该怎么操作。针对PDF输出,我已经找到了传入模板的方法:

pdf:
    documentclass: scrbook
    classoption: ["oneside"]
    template-partials: ["partials/before-body.tex"]

在通过template-partials:传入的模板中,我可以用{{author.affiliation}}这类YAML变量自定义标题页,但还没找到HTML输出对应的类似配置方法。


内容的提问来源于stack exchange,提问作者Eli Holmes

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.23 05:33:17