| name | make-pdf |
| description | Convert markdown or plain text files to PDF using pandoc + tectonic.
Use when: user asks to generate a PDF, convert markdown to PDF, or export a document.
Triggers on: make pdf, convert to pdf, generate pdf, export pdf, /pdf.
|
| context | fork |
| allowed-tools | ["Bash(scripts/make-pdf.sh *)","Bash(FONT_FAMILY=* scripts/make-pdf.sh *)","Bash(FONT_SIZE=* scripts/make-pdf.sh *)","Bash(MARGIN=* scripts/make-pdf.sh *)","Bash(OUTPUT=* scripts/make-pdf.sh *)","Bash(FONT_FAMILY=* FONT_SIZE=* scripts/make-pdf.sh *)","Bash(FONT_FAMILY=* MARGIN=* scripts/make-pdf.sh *)","Bash(FONT_FAMILY=* OUTPUT=* scripts/make-pdf.sh *)","Bash(FONT_FAMILY=* FONT_SIZE=* MARGIN=* scripts/make-pdf.sh *)","Bash(FONT_FAMILY=* FONT_SIZE=* MARGIN=* OUTPUT=* scripts/make-pdf.sh *)","Read","Glob"] |
Make PDF
Convert markdown or plain text files to PDF using pandoc and tectonic.
Script Location
scripts/make-pdf.sh
Workflow
- Identify the input file from the user's message. If ambiguous, ask.
- Ask the user: serif or sans-serif? (unless they already specified a preference).
- Run the conversion script with appropriate env knobs.
- Report the output path and file size.
Usage
Basic Conversion
scripts/make-pdf.sh document.md
With Font Override
FONT_FAMILY=serif scripts/make-pdf.sh document.md
With Custom Output Path
OUTPUT=~/Desktop/report.pdf scripts/make-pdf.sh document.md
With All Options
FONT_FAMILY=serif FONT_SIZE=12pt MARGIN=0.75in OUTPUT=~/out.pdf scripts/make-pdf.sh doc.md
Environment Knobs
| Variable | Default | Description |
|---|
FONT_FAMILY | sans | sans or serif |
FONT_SIZE | 11pt | Font size (e.g. 10pt, 11pt, 12pt) |
MARGIN | 1in | Page margins (e.g. 0.75in, 1in, 1.5in) |
OUTPUT | <input>.pdf | Override output file path |
MAX_LINES | 40 | Max error lines printed |
KEEP_DIR | 0 | Set to 1 to keep temp log dir on success |
Output Format
- Step header:
Step: convert
- Input/output paths, font, size, margin printed
- Result:
PASS or FAIL
- On success: file size in bytes
- On failure: first
MAX_LINES lines of pandoc output
- Overall result:
Overall: PASS or Overall: FAIL
Important Notes
- Requires
pandoc and tectonic to be installed
- Supports markdown (
.md) and plain text (.txt) input
- Output defaults to the same filename with
.pdf extension
- The script uses tectonic as the LaTeX engine (auto-downloads packages on first run)