Render Markdown files as high-quality, professionally formatted PDFs in Penn Carey Law house style. Use when asked to convert markdown to PDF, create a PDF from markdown content, render a readable PDF, make a polished PDF document, or format a document as PDF. Trigger phrases include "render as PDF", "convert to PDF", "make a PDF", "PDF version", "formatted PDF", "polished PDF", "readable PDF", or any request involving markdown-to-PDF conversion. Also trigger when the user has a .md file and wants a nice-looking PDF output.
This skill converts Markdown content into professionally typeset PDFs using Python's ReportLab library. Output matches Penn Carey Law house style: Times Roman body text, Penn Blue headings, styled tables with dark blue headers, shaded info boxes, and header/footer treatment with Penn Carey Law logo on the first page.
This skill works in both Claude Code CLI and Claude.ai / Cowork. Use whichever paths exist:
~/.claude/skills/ (CLI) or /mnt/skills/user/ (web)~/Downloads/ or user-specified path (CLI) or /mnt/user-data/outputs/ (web)pip install reportlab
ReportLab is the only dependency. No PIL, numpy, or other packages needed.
Uses Times-Roman (ReportLab built-in) rather than Cambria (used in the .docx skills) to avoid TTF font registration complexity. If Cambria consistency with .docx output is needed, register the font:
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
pdfmetrics.registerFont(TTFont('Cambria', '/path/to/cambria.ttc'))
The Penn Carey Law logo with white background (no compositing needed):
Path: ~/.claude/skills/law-document/assets/PennCareyLaw_UPenn_Blue-WhiteBkrnd.png (CLI)
or /mnt/skills/user/law-document/assets/PennCareyLaw_UPenn_Blue-WhiteBkrnd.png (web).
Try CLI path first; if not found, try web path.
If neither path works, stop and tell the user — do not produce a PDF without it.
Sizing: Source is 2000×358 pixels (aspect ratio 5.587:1). Target width 3.2 inches. Height = 3.2 / 5.587 = 0.573 inches.
import os
# Try CLI path first, then web path
for _p in [
os.path.expanduser("~/.claude/skills/law-document/assets/PennCareyLaw_UPenn_Blue-WhiteBkrnd.png"),
"/mnt/skills/user/law-document/assets/PennCareyLaw_UPenn_Blue-WhiteBkrnd.png",
]:
if os.path.exists(_p):
LOGO_PATH = _p
break