inst/quarto/latex/civilytics-title.tex references \thesubtitle, but nothing ever defines it, so any PDF document that sets a subtitle fails to compile.
Reproduction
A .qmd with a subtitle, using the civilytics LaTeX template:
It defines \subtitle (which appends to \@title) — it never defines \thesubtitle. The titling package provides \thetitle/\theauthor/\thedate but has no subtitle equivalent.
Suggested fix
include-in-header (civilytics.tex) is emitted before pandoc's \subtitle provider (verified: line 133 vs 280), and pandoc uses \providecommand, so a definition in civilytics.tex wins. Add to civilytics.tex:
% Capture the pandoc subtitle into \thesubtitle for the title page
\makeatletter\newcommand{\thesubtitle}{}\newcommand{\subtitle}[1]{\renewcommand{\thesubtitle}{#1}}\makeatother
Also suppress pandoc's default \maketitle in civilytics-title.tex (it runs after the custom title page and would otherwise print a second, unstyled title), and add a \providecommand{\thesubtitle}{} guard in the title partial so it degrades gracefully if used without the preamble.
Found while rendering a branded PDF (COG finance API spec).
## Summary
`inst/quarto/latex/civilytics-title.tex` references `\thesubtitle`, but nothing ever defines it, so **any PDF document that sets a `subtitle` fails to compile**.
## Reproduction
A `.qmd` with a subtitle, using the civilytics LaTeX template:
```yaml
---
title: "My Title"
subtitle: "A subtitle"
format:
pdf:
pdf-engine: xelatex
include-in-header: latex/civilytics.tex
include-before-body: latex/civilytics-title.tex
---
```
Fails with:
```
! Undefined control sequence.
l.318 ...selectfont\color{ink2}\thesubtitle
```
## Root cause
Quarto/pandoc emits the subtitle like this (verified in the generated `.tex`):
```
\title{My Title}
\providecommand{\subtitle}[1]{\apptocmd{\@title}{\par {\large #1 \par}}{}{}}
\subtitle{A subtitle}
```
It defines **`\subtitle`** (which appends to `\@title`) — it never defines **`\thesubtitle`**. The `titling` package provides `\thetitle`/`\theauthor`/`\thedate` but has no subtitle equivalent.
## Suggested fix
`include-in-header` (civilytics.tex) is emitted *before* pandoc's `\subtitle` provider (verified: line 133 vs 280), and pandoc uses `\providecommand`, so a definition in civilytics.tex wins. Add to `civilytics.tex`:
```latex
% Capture the pandoc subtitle into \thesubtitle for the title page
\makeatletter
\newcommand{\thesubtitle}{}
\newcommand{\subtitle}[1]{\renewcommand{\thesubtitle}{#1}}
\makeatother
```
Also suppress pandoc's default `\maketitle` in `civilytics-title.tex` (it runs *after* the custom title page and would otherwise print a second, unstyled title), and add a `\providecommand{\thesubtitle}{}` guard in the title partial so it degrades gracefully if used without the preamble.
Found while rendering a branded PDF (COG finance API spec).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
inst/quarto/latex/civilytics-title.texreferences\thesubtitle, but nothing ever defines it, so any PDF document that sets asubtitlefails to compile.Reproduction
A
.qmdwith a subtitle, using the civilytics LaTeX template:Fails with:
Root cause
Quarto/pandoc emits the subtitle like this (verified in the generated
.tex):It defines
\subtitle(which appends to\@title) — it never defines\thesubtitle. Thetitlingpackage provides\thetitle/\theauthor/\thedatebut has no subtitle equivalent.Suggested fix
include-in-header(civilytics.tex) is emitted before pandoc's\subtitleprovider (verified: line 133 vs 280), and pandoc uses\providecommand, so a definition in civilytics.tex wins. Add tocivilytics.tex:Also suppress pandoc's default
\maketitleincivilytics-title.tex(it runs after the custom title page and would otherwise print a second, unstyled title), and add a\providecommand{\thesubtitle}{}guard in the title partial so it degrades gracefully if used without the preamble.Found while rendering a branded PDF (COG finance API spec).
Fixed in PR #15 (merged to master).