fix(quarto): repair LaTeX + Typst branded templates (#11 #12 #13 #14) #15

Merged
jared merged 2 commits from fix/quarto-template-bugs into master 2026-07-09 16:18:29 -04:00
Owner

Fixes several bugs in the Quarto branded templates found while rendering a real PDF report.

LaTeX (inst/quarto/latex/)

  • \thesubtitle undefined (#13): the title partial referenced \thesubtitle, which Quarto never defines, so any subtitled PDF failed to compile. civilytics.tex now captures pandoc's \subtitle into \thesubtitle (it loads before pandoc's provider, so its definition wins).
  • Double title (#13): Quarto emits its default \maketitle + abstract before the include-before-body title page. civilytics.tex now neutralises the default \maketitle/abstract at \begin{document} so only the branded title page renders. (The branded title page does not display the abstract — documented inline.)
  • tikz dependency (#13): dropped an empty tikzpicture from the title partial that required tikz (never loaded).
  • SemiBold font (#14): the preamble required a Source Serif 4 SemiBold face that the package never installs and standard installs don't ship. Now uses the family's native Bold weight.

Typst (inst/quarto/typst/)

  • Keyword crash (#12): title/subtitle/date were injected as bare Typst, so any of them containing a keyword word (for, in, ...) broke compilation. Now wrapped in [ ] content brackets.

URL (#11)

  • Footer civilytics.consulting → civilytics.com in the LaTeX preamble, the Typst template, and the slides example.

Version bumped 0.2.0 → 0.3.0.

Verification

  • Rendered a subtitled + abstract .qmd through the LaTeX template with xelatex: compiles, single branded title page, subtitle shown, native Bold, footer correct.
  • Rendered a subtitled .qmd through the Typst template: compiles, footer correct.

Test plan

  • quarto render a report .qmd (with subtitle) → pdf using include-in-header: civilytics.tex + include-before-body: civilytics-title.tex
  • Same content → typst
  • Confirm footers read civilytics.com

Closes #11, #12, #13, #14

Fixes several bugs in the Quarto branded templates found while rendering a real PDF report. ## LaTeX (`inst/quarto/latex/`) - **`\thesubtitle` undefined (#13):** the title partial referenced `\thesubtitle`, which Quarto never defines, so any subtitled PDF failed to compile. `civilytics.tex` now captures pandoc's `\subtitle` into `\thesubtitle` (it loads before pandoc's provider, so its definition wins). - **Double title (#13):** Quarto emits its default `\maketitle` + abstract *before* the include-before-body title page. `civilytics.tex` now neutralises the default `\maketitle`/`abstract` at `\begin{document}` so only the branded title page renders. *(The branded title page does not display the abstract — documented inline.)* - **tikz dependency (#13):** dropped an empty `tikzpicture` from the title partial that required `tikz` (never loaded). - **SemiBold font (#14):** the preamble required a `Source Serif 4 SemiBold` face that the package never installs and standard installs don't ship. Now uses the family's native Bold weight. ## Typst (`inst/quarto/typst/`) - **Keyword crash (#12):** `title`/`subtitle`/`date` were injected as bare Typst, so any of them containing a keyword word (`for`, `in`, ...) broke compilation. Now wrapped in `[ ]` content brackets. ## URL (#11) - Footer `civilytics.consulting` → `civilytics.com` in the LaTeX preamble, the Typst template, and the slides example. Version bumped 0.2.0 → 0.3.0. ## Verification - Rendered a subtitled + abstract `.qmd` through the LaTeX template with `xelatex`: compiles, single branded title page, subtitle shown, native Bold, footer correct. - Rendered a subtitled `.qmd` through the Typst template: compiles, footer correct. ## Test plan - [ ] `quarto render` a report `.qmd` (with subtitle) → `pdf` using `include-in-header: civilytics.tex` + `include-before-body: civilytics-title.tex` - [ ] Same content → `typst` - [ ] Confirm footers read `civilytics.com` Closes #11, #12, #13, #14
jared added 1 commit 2026-07-09 15:58:46 -04:00
fix(quarto): repair LaTeX + Typst branded templates
R-CMD-check / R CMD check (pull_request) Successful in 3m56s
a904d2313a
- LaTeX: capture pandoc's \subtitle into \thesubtitle so subtitled PDFs
  compile; suppress the default \maketitle/abstract so only the branded
  title page renders (no double title); drop the unused tikz dependency
  from the title partial (#13)
- LaTeX: stop requiring a "Source Serif 4 SemiBold" face that the setup
  never installs; use the family's native Bold weight (#14)
- Typst: wrap title/subtitle/date in [ ] so text containing Typst keywords
  ("for"/"in") no longer breaks compilation (#12)
- Fix footer URL civilytics.consulting -> civilytics.com in the LaTeX and
  Typst templates and the slides example (#11)
- Bump version to 0.3.0
jared added 1 commit 2026-07-09 16:10:17 -04:00
fix(typst): ship template as partials so code blocks render (#12)
R-CMD-check / R CMD check (pull_request) Successful in 3m54s
b9d427eb76
The single-file `template: civilytics-typst.typ` discarded Quarto's
auto-generated `definitions` partial, so any Typst document containing a
code block failed with `unknown variable: Skylighting`.

Ship the template as Quarto template-partials instead, so Quarto keeps its
definitions (Skylighting + token functions) and syntax-highlighted code
blocks render while the Civilytics branding still applies:

- split civilytics-typst.typ into typst-template.typ (the styling function)
  and typst-show.typ (the show/entry point, keyword-safe [ ] wrapping kept);
  remove the single-file template
- use_civilytics_theme() now copies both partials and prints the
  template-partials usage
- example report.qmd uses template-partials

Verified: a report with an R code block renders with working syntax
highlighting and full branding.
Author
Owner

Added a follow-up commit (b9d427e) that fully resolves #12: the Typst template now ships as Quarto template-partials ( + ) instead of a single-file , so code blocks keep Quarto Skylighting definitions and render with syntax highlighting + branding. Verified against a report with an R code block.

Added a follow-up commit (b9d427e) that fully resolves #12: the Typst template now ships as Quarto **template-partials** ( + ) instead of a single-file , so code blocks keep Quarto Skylighting definitions and render with syntax highlighting + branding. Verified against a report with an R code block.
jared merged commit 6ea9265236 into master 2026-07-09 16:18:29 -04:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Civilytics/civilyticsR#15