Skip to content

HTML Partials docs do not describe the title block partials Quarto uses by default #14794

Open

Description

@cwickham

What the docs say

The HTML Partials section points readers at the pandoc/ resource directory and documents three replaceable partials: metadata.html, title-block.html, and toc.html.

What the code does

The title-block.html in that directory is not what a default format: html document renders. For every Bootstrap-themed document, Quarto injects a different set of title partials from templates/, selected by title-block-style and title-block-banner (format-html-title.ts#L133-L184):

YAML Partial that renders
default (or title-block-style: plain) templates/title-block.html
title-block-banner set templates/banner/title-block.html
title-block-style: manuscript templates/manuscript/title-block.html
title-block-style: none pandoc/title-block.html

templates/title-metadata.html and templates/_title-meta-author.html are always injected with them. Because staged partials resolve by basename, the injected templates/title-block.html replaces the documented pandoc/title-block.html in every default render — and a user partial named title-block.html replaces both.

Why this matters

A reader who follows the docs and copies pandoc/title-block.html as their starting point gets Pandoc's plain markup, not the markup Quarto renders. Their customization silently drops the quarto-title-block classes, so the theme's title styling and the title-block-banner options stop applying. In website projects it is worse: a postprocessor mangles any title block without those classes into two headers with duplicate ids — that rendering bug is tracked in #13841, which is also where this confusion was first reported. The correct starting point for customizing the default title block is templates/title-block.html (plus title-metadata.html, which it calls) — the docs never mention that these files exist.

Suggested additions to the HTML Partials section

  1. State that title-block.html has variants in templates/, list them, and say which YAML options select each one (the table above).
  2. Point readers to templates/title-block.html as the starting point for customizing the default title block, and note that it calls title-metadata.html, which can also be replaced.
  3. Document styles.html, which is in the format's supported list and is referenced by both the HTML and Revealjs templates, but appears in neither format's documented partials.

An AI assistant helped investigate this issue, grounded in a local clone of quarto-cli (per CONTRIBUTING.md "Using AI tools to investigate").

Activity

  1. added
    documentation
    html
    on Aug 21, 2026
  2. mcanouil commented on Aug 21, 2026

    @mcanouil
    Collaborator

    My comment from the mentioned issues: #13841 (comment)

    I believe this to be a documentation issue but not limited to it.
    Unfortunately the path pattern for partials is not consistent from one format to another which is likely the reason of this issue.

    Here is the current situation:

    • Typst:
      • Pandoc: src/resources/formats/typst/pandoc
      • Quarto: src/resources/formats/typst/pandoc/quarto
    • Beamer:
      • Pandoc+Quarto: src/resources/formats/beamer/pandoc
    • LaTeX:
      • Pandoc+Quarto: src/resources/formats/pdf/pandoc
    • HTML:
      • Pandoc: src/resources/formats/html/pandoc
      • Quarto: src/resources/formats/html/templates - this contains the real title-block partial used by Quarto (the other partials are in pandoc directory), note that there are several discussions about this being an issue when trying to customise the title-block)
    • Reveal.js:
      • Pandoc+quarto: src/resources/formats/revealjs/pandoc

    For HTML, the title-block.html being used depend on several options which makes it not as trivial as the documentation implies:

    Option Template path used Code
    default (or unspecified) src/resources/formats/html/templates/title-block.html
    if (manuscriptTitle) {
    partials.push("manuscript/title-block.html");
    partials.push("manuscript/title-metadata.html");
    } else if (banner) {
    partials.push("banner/title-block.html");
    } else {
    partials.push("title-block.html");
    }
    plain src/resources/formats/html/templates/title-block.html
    if (manuscriptTitle) {
    partials.push("manuscript/title-block.html");
    partials.push("manuscript/title-metadata.html");
    } else if (banner) {
    partials.push("banner/title-block.html");
    } else {
    partials.push("title-block.html");
    }
    manuscript src/resources/formats/html/templates/manuscript/title-block.html
    if (manuscriptTitle) {
    partials.push("manuscript/title-block.html");
    partials.push("manuscript/title-metadata.html");
    } else if (banner) {
    none or false No title block rendered (empty partials)
    if (
    format.metadata[kTitleBlockStyle] === false ||
    format.metadata[kTitleBlockStyle] === "none"
    ) {
    return {
    partials: [],
    templateParams: {},
    };
    title-block.html partial (basic HTML) src/resources/formats/html/pandoc/title-block.html
    const templateDir = formatResourcePath("html", "pandoc");
    const partials = [
    "metadata.html",
    "title-block.html",
    "toc.html",
    "styles.html",
    ];
    const templateContext = {
    template: join(templateDir, "template.html"),
    partials: partials.map((partial) => join(templateDir, partial)),
    };
    title-block-banner (true or any value) src/resources/formats/html/templates/banner/title-block.html
    } else if (banner) {
    partials.push("banner/title-block.html");
    } else {
    partials.push("title-block.html");
  3. cwickham commented on Aug 21, 2026

    @cwickham
    MemberAuthor

    @mcanouil You got here before I managed to post the comment over on #13841. Just trying to reconcile our tables...I'm arguing your first two rows collapse into one, and the "none or false" row collapses into "title-block.html partial (basic HTML)".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationhtmltemplates

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions