CtrlK
BlogDocsLog inGet started
Tessl Logo
SkillPublic

pdf-generator

This skill explains how to install and use Quarto with Typst to render styled PDFs and EPUBs from Markdown. It includes frontmatter and template examples, design and typography guidance, and shell-based checks for common rendering and source-file issues.

Quality

77%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Passed

No findings from the security scan

Fix and improve this skill with Tessl

tessl review fix ./examples/skills/pdf-generator/SKILL.md
SKILL.md
Quality
Evals
Security

PDF generator skill

Generate professional PDFs with modern typography using Quarto + Typst.

Skill purpose

This skill assists with:

  • Setting up Quarto/Typst projects
  • Creating document templates
  • Generating PDFs from Markdown
  • Troubleshooting rendering issues
  • Customizing design systems

Stack

ToolVersionRole
Quarto≥1.4.0Document rendering engine
Typstbundled with Quarto (quarto typst --version)Modern typography (integrated)
Pandoc3.xMarkdown conversion (integrated)

Generation pipeline

SOURCE              TOOL            TEMPLATE              OUTPUT
  ──────              ────            ────────              ──────

  .qmd  ──────────► Quarto ────► --to whitepaper-typst ──► Typst ──► .pdf ✅
  (Markdown           │           (_extensions/               (~270K–1.7M,
  + YAML)             │            typst-template.typ)         styled)
                      │
                      └──────► --to epub ──► Pandoc ──────────────────► .epub
                                             + epub-styles.css

  ⚠️  --to pdf (no template) → small, unstyled PDF → always prefer --to whitepaper-typst

Available formats

┌──────────────────────┬────────────────────────┬──────────────────┐
  │ Format               │ Command                │ Output           │
  ├──────────────────────┼────────────────────────┼──────────────────┤
  │ Styled PDF ✅        │ --to whitepaper-typst  │ ~270K–1.7M       │
  │ Standard PDF ❌      │ --to pdf               │ ~80-190K, raw    │
  │ EPUB                 │ --to epub              │ epub-output/     │
  └──────────────────────┴────────────────────────┴──────────────────┘

Quick start

Installation

# macOS
brew install quarto

# Linux: download the .deb for your architecture from
# https://github.com/quarto-dev/quarto-cli/releases, then:
sudo dpkg -i quarto-<version>-linux-amd64.deb

# Windows
winget install Posit.Quarto

Generate PDF

# Single file
quarto render document.qmd

# All files
quarto render *.qmd

# Preview with hot-reload
quarto preview document.qmd

YAML frontmatter template

---
title: "Document Title"
subtitle: "Optional subtitle"
author: "Author Name"
date: 2026-01-17
date-format: "MMMM YYYY"
format:
  typst:
    toc: true
    toc-depth: 2
    section-numbering: "1.1"
lang: en
---

Available parameters

ParameterTypeDescription
titlestringMain title (cover page)
subtitlestringOptional subtitle
authorstringAuthor(s)
datedateISO format (YYYY-MM-DD)
date-formatstringDisplay format (MMMM YYYY)
tocbooleanShow table of contents
toc-depthnumberTOC depth (1-3)
section-numberingstringFormat (1.1, 1.a)
langstringLanguage (fr, en)

Project structure

project/
├── _extensions/
│   └── custom-template/
│       ├── _extension.yml      # Extension metadata
│       ├── typst-template.typ  # Main template
│       └── typst-show.typ      # Quarto → Typst bridge
├── document.qmd                # Source file
└── document.pdf                # Generated output

Markdown syntax

Page breaks

{{< pagebreak >}}

Code blocks

Standard fenced blocks with syntax highlighting:

```bash
npm install
```

Tables

| Column A | Column B |
|----------|----------|
| Value 1  | Value 2  |

Images

![Caption](path/to/image.png){width=50%}

Custom template

Extension configuration

Create _extensions/mytemplate/_extension.yml:

title: My Template
author: Your Name
version: 1.0.0
contributes:
  formats:
    typst:
      template: typst-template.typ
      template-partials:
        - typst-show.typ

Design system (Typst)

// Colors (Slate + Indigo palette)
#let primary = rgb("#0f172a")      // Slate 900 - titles
#let secondary = rgb("#334155")    // Slate 700 - subtitles
#let accent = rgb("#6366f1")       // Indigo 500 - accents
#let muted = rgb("#64748b")        // Slate 500 - metadata
#let light-bg = rgb("#f8fafc")     // Slate 50 - code bg
#let border-light = rgb("#e2e8f0") // Slate 200 - borders

Typography

#set text(
  font: ("Inter", "Helvetica Neue", "Arial"),
  size: 11pt,
)

#set par(
  leading: 0.75em,
  justify: true,
)

// Code blocks
#show raw.where(block: true): it => {
  block(
    fill: light-bg,
    stroke: (left: 3pt + accent),
    inset: 10pt,
    radius: 4pt,
    it,
  )
}

Callout boxes

#let info(title: "Note", body) = {
  block(
    fill: rgb("#E0F2FE"),
    stroke: (left: 3pt + rgb("#0284C7")),
    inset: 12pt,
    [*#title*: #body]
  )
}

#let warning(title: "Warning", body) = {
  block(
    fill: rgb("#FEF3C7"),
    stroke: (left: 3pt + rgb("#D97706")),
    inset: 12pt,
    [*#title*: #body]
  )
}

#let success(title: "Success", body) = {
  block(
    fill: rgb("#DCFCE7"),
    stroke: (left: 3pt + rgb("#16A34A")),
    inset: 12pt,
    [*#title*: #body]
  )
}

#let danger(title: "Danger", body) = {
  block(
    fill: rgb("#FEE2E2"),
    stroke: (left: 3pt + rgb("#DC2626")),
    inset: 12pt,
    [*#title*: #body]
  )
}

Troubleshooting

Quick validation

# Check Quarto version
quarto --version  # >= 1.4.0

# Verify extension exists
ls _extensions/*/

# Validate code block pairs (must be even)
grep -c '^```' document.qmd

# Check encoding
file -i document.qmd  # Must show utf-8

Common issues

IssueCauseFix
Nested code blocks breakInner ``` closes outerUse 4+ backticks for outer
Tables render as codeUnmatched ``` aboveCheck delimiter count
Extension not foundWrong directoryVerify _extensions/ path
Font warningsFonts not installedNormal; uses fallbacks
Characters brokenWrong encodingConvert to UTF-8

Nested code blocks

Use more backticks for outer block:

````markdown
# This is the outer block

```bash
echo "This is nested"
```

Outer continues...
````

Validation script

#!/bin/bash
for f in *.qmd; do
  count=$(grep -c '^```' "$f")
  if [ $((count % 2)) -ne 0 ]; then
    echo "ERROR: $f has odd count ($count)"
  fi
done

Full validation pipeline

#!/bin/bash
# validate-qmd.sh

echo "=== Validating QMD files ==="
errors=0

for f in *.qmd; do
  # Check code block pairs
  count=$(grep -c '^```' "$f")
  if [ $((count % 2)) -ne 0 ]; then
    echo "ERROR: $f - odd code block count ($count)"
    ((errors++))
  fi

  # Check UTF-8
  encoding=$(file -i "$f" | grep -o 'charset=[^;]*')
  if [[ "$encoding" != *"utf-8"* ]]; then
    echo "WARNING: $f - encoding is $encoding"
  fi
done

echo "=== Validation complete: $errors errors ==="
exit $errors

Example use cases

Technical documentation

---
title: "API Reference"
subtitle: "v2.0"
author: "Engineering Team"
date: 2026-01-17
format:
  typst:
    toc: true
    toc-depth: 3
---

# Authentication

All requests require an API key...

Whitepaper series

---
title: "Security Best Practices"
series: "Engineering Whitepapers"
wp-number: "03"
author: "Security Team"
date: 2026-01-17
format:
  whitepaper-typst:
    toc: true
---

Internal report

---
title: "Q1 Performance Report"
author: "Analytics Team"
date: 2026-01-17
date-format: "Q1 YYYY"
format:
  typst:
    toc: false
---

Resources

  • Quarto Documentation
  • Typst Documentation
  • Quarto + Typst Guide
  • Workflow Guide
Repository

FlorianBruniaux/claude-code-ultimate-guide

Path

examples/skills/pdf-generator/SKILL.md

Last updated
First committed
Purpose
DevelopmentTesting and QADebugging and error handlingDocumentationContent creation
Form
WorkflowRulesBest practicesReferenceTemplate
Commands
brewbrew installquartoquarto renderquarto previewquarto typstsudosudo dpkgdpkgwingetwinget installnpmnpm installlsgrepfilebashechoexit
Tools
QuartoTypst

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.