
Paper Slide Deck
- 454 installs
- 787 repo stars
- Updated August 1, 2026
- luwill/research-skills
paper-slide-deck is an agent skill that converts a research paper into a structured slide deck with section outlines, figures, and citations for lab meetings, conference talks, or stakeholder briefings.
About
paper-slide-deck is a skill from luwill/research-skills that transforms academic research papers into structured presentation slide decks without manually rebuilding every figure, citation, and section outline. The agent reads paper sections—abstract, methods, results, discussion—and maps them to slide titles, bullet hierarchies, and figure callouts suitable for lab meetings or conference talks. Developers and researchers reach for paper-slide-deck when a PDF paper must become briefing slides quickly while preserving citation accuracy and visual narrative flow. The skill handles section pacing, key claim extraction, and placeholder notes for charts reproduced from the source document.
- Maps paper sections to slide flow
- Preserves citations and key figures
- Produces presentation-ready structure
- Speeds research-to-talk turnaround
- Keeps technical accuracy intact
Paper Slide Deck by the numbers
- 454 all-time installs (skills.sh)
- +10 installs in the week ending Aug 2, 2026 (Skillselion tracking)
- Ranked #159 of 688 Office & Documents skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/luwill/research-skills --skill paper-slide-deckAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 454 |
|---|---|
| repo stars | ★ 787 |
| Last updated | August 1, 2026 |
| Repository | luwill/research-skills ↗ |
How do you turn a research paper into slides?
Turn a research paper into a structured slide deck for lab meetings, conference talks, or stakeholder briefings without manually rebuilding every figure, citation, and section outline.
Who is it for?
Developers and researchers who must present a dense academic paper at a lab meeting or conference and need slides without manual figure-by-figure rebuild.
Skip if: Skip paper-slide-deck when you need journal-quality figure redesign, Beamer LaTeX compilation, or investor pitch decks from business metrics.
When should I use this skill?
User uploads or references a research paper and asks for slides, a talk deck, or a lab-meeting presentation outline.
What you get
Structured slide deck outline with section titles, figure placements, bullet summaries, and citation references.
Files
Paper Slide Deck Generator
Transform academic papers and content into professional slide deck images with automatic figure extraction.
Usage
/paper-slide-deck path/to/paper.pdf
/paper-slide-deck path/to/paper.pdf --style academic-paper
/paper-slide-deck path/to/content.md --style sketch-notes
/paper-slide-deck path/to/content.md --audience executives
/paper-slide-deck path/to/content.md --lang zh
/paper-slide-deck path/to/content.md --slides 10
/paper-slide-deck path/to/content.md --outline-only
/paper-slide-deck # Then paste contentScript Directory
Important: All scripts are located in the scripts/ subdirectory of this skill.
Agent Execution Instructions: 1. Determine this SKILL.md file's directory path as SKILL_DIR 2. Script path = ${SKILL_DIR}/scripts/<script-name>.ts 3. Replace all ${SKILL_DIR} in this document with the actual path
Script Reference:
| Script | Purpose |
|---|---|
scripts/generate-slides.py | Generate AI slides via Gemini API (Python) |
scripts/merge-to-pptx.ts | Merge slides into PowerPoint |
scripts/merge-to-pdf.ts | Merge slides into PDF |
scripts/detect-figures.ts | Auto-detect figures/tables in PDF |
scripts/extract-figure.ts | Extract figure from PDF page (uses PyMuPDF fallback) |
scripts/apply-template.ts | Apply figure container template |
Options
| Option | Description |
|---|---|
--style <name> | Visual style (see Style Gallery) |
--audience <type> | Target audience: beginners, intermediate, experts, executives, general |
--lang <code> | Output language (en, zh, ja, etc.) |
--slides <number> | Target slide count |
--outline-only | Generate outline only, skip image generation |
Style Gallery
| Style | Description | Best For |
|---|---|---|
academic-paper | Clean professional, precise charts | Conference talks, thesis defense |
blueprint (Default) | Technical schematics, grid texture | Architecture, system design |
chalkboard | Black chalkboard, colorful chalk | Education, tutorials, classroom |
notion | SaaS dashboard, card-based layouts | Product demos, SaaS, B2B |
bold-editorial | Magazine cover, bold typography, dark | Product launches, keynotes |
corporate | Navy/gold, structured layouts | Investor decks, proposals |
dark-atmospheric | Cinematic dark mode, glowing accents | Entertainment, gaming |
editorial-infographic | Magazine explainers, flat illustrations | Tech explainers, research |
fantasy-animation | Ghibli/Disney style, hand-drawn | Educational, storytelling |
intuition-machine | Technical briefing, bilingual labels | Technical docs, academic |
minimal | Ultra-clean, maximum whitespace | Executive briefings, premium |
pixel-art | Retro 8-bit, chunky pixels | Gaming, developer talks |
scientific | Academic diagrams, precise labeling | Biology, chemistry, medical |
sketch-notes | Hand-drawn, warm & friendly | Educational, tutorials |
vector-illustration | Flat vector, retro & cute | Creative, children's content |
vintage | Aged-paper, historical styling | Historical, heritage, biography |
watercolor | Hand-painted textures, natural warmth | Lifestyle, wellness, travel |
Auto Style Selection
| Content Signals | Selected Style |
|---|---|
| paper, thesis, defense, conference, ieee, acm, icml, neurips, cvpr, acl, aaai, iclr | academic-paper |
| tutorial, learn, education, guide, intro, beginner | sketch-notes |
| classroom, teaching, school, chalkboard, blackboard | chalkboard |
| architecture, system, data, analysis, technical | blueprint |
| creative, children, kids, cute, illustration | vector-illustration |
| briefing, bilingual, infographic, concept | intuition-machine |
| executive, minimal, clean, simple, elegant | minimal |
| saas, product, dashboard, metrics, productivity | notion |
| investor, quarterly, business, corporate, proposal | corporate |
| launch, marketing, keynote, bold, impact, magazine | bold-editorial |
| entertainment, music, gaming, creative, atmospheric | dark-atmospheric |
| explainer, journalism, science communication | editorial-infographic |
| story, fantasy, animation, magical, whimsical | fantasy-animation |
| gaming, retro, pixel, developer, nostalgia | pixel-art |
| biology, chemistry, medical, pathway, scientific | scientific |
| history, heritage, vintage, expedition, historical | vintage |
| lifestyle, wellness, travel, artistic, natural | watercolor |
| Default | blueprint |
Layout Gallery
Optional layout hints for individual slides. Specify in outline's // LAYOUT section.
Slide-Specific Layouts
| Layout | Description | Best For |
|---|---|---|
title-hero | Large centered title + subtitle | Cover slides, section breaks |
quote-callout | Featured quote with attribution | Testimonials, key insights |
key-stat | Single large number as focal point | Impact statistics, metrics |
split-screen | Half image, half text | Feature highlights, comparisons |
icon-grid | Grid of icons with labels | Features, capabilities, benefits |
two-columns | Content in balanced columns | Paired information, dual points |
three-columns | Content in three columns | Triple comparisons, categories |
image-caption | Full-bleed image + text overlay | Visual storytelling, emotional |
agenda | Numbered list with highlights | Session overview, roadmap |
bullet-list | Structured bullet points | Simple content, lists |
Infographic-Derived Layouts
| Layout | Description | Best For |
|---|---|---|
linear-progression | Sequential flow left-to-right | Timelines, step-by-step |
binary-comparison | Side-by-side A vs B | Before/after, pros-cons |
comparison-matrix | Multi-factor grid | Feature comparisons |
hierarchical-layers | Pyramid or stacked levels | Priority, importance |
hub-spoke | Central node with radiating items | Concept maps, ecosystems |
bento-grid | Varied-size tiles | Overview, summary |
funnel | Narrowing stages | Conversion, filtering |
dashboard | Metrics with charts/numbers | KPIs, data display |
venn-diagram | Overlapping circles | Relationships, intersections |
circular-flow | Continuous cycle | Recurring processes |
winding-roadmap | Curved path with milestones | Journey, timeline |
tree-branching | Parent-child hierarchy | Org charts, taxonomies |
iceberg | Visible vs hidden layers | Surface vs depth |
bridge | Gap with connection | Problem-solution |
Academic-Specific Layouts
| Layout | Description | Best For |
|---|---|---|
paper-title | Title, authors, affiliations, venue | Conference paper cover |
outline-agenda | Numbered section list with highlights | Talk structure overview |
methods-diagram | Central architecture/pipeline diagram | Methods, system design |
results-chart | Chart area + data annotations | Quantitative results |
equation-focus | Centered equation + variable definitions | Mathematical derivations |
qualitative-grid | 2x2 or 3x2 image comparison grid | Visual results, ablations |
references-list | Numbered citation list | Key references slide |
contributions | Numbered contribution points | Contributions summary |
Usage: Add Layout: <name> in slide's // LAYOUT section to guide visual composition.
Design Philosophy
This deck is designed for reading and sharing, not live presentation:
- Each slide must be self-explanatory without verbal commentary
- Structure content for logical flow when scrolling
- Include all necessary context within each slide
- Optimize for social media sharing and offline reading
File Management
Output Directory
Each session creates an independent directory named by content slug:
slide-deck/{topic-slug}/
├── source-{slug}.{ext} # Source files (text, images, etc.)
├── outline.md
├── outline-{style}.md # Style variant outlines
├── prompts/
│ └── 01-slide-cover.md, 02-slide-{slug}.md, ...
├── 01-slide-cover.png, 02-slide-{slug}.png, ...
├── {topic-slug}.pptx
└── {topic-slug}.pdfSlug Generation: 1. Extract main topic from content (2-4 words, kebab-case) 2. Example: "Introduction to Machine Learning" → intro-machine-learning
Conflict Resolution
If slide-deck/{topic-slug}/ already exists:
- Append timestamp:
{topic-slug}-YYYYMMDD-HHMMSS - Example:
intro-mlexists →intro-ml-20260118-143052
Source Files
Copy all sources with naming source-{slug}.{ext}:
source-article.md(main text content)source-diagram.png(image from conversation)source-data.xlsx(additional file)
Multiple sources supported: text, images, files from conversation.
Workflow
Step 1: Analyze Content
1. Save source content (if pasted, save as source.md) 2. Follow references/analysis-framework.md for deep content analysis 3. Determine style (use --style or auto-select from signals) 4. Detect languages (source vs. user preference) 5. Plan slide count (--slides or dynamic) 6. For academic papers (PDF with figures): Run automatic figure detection:
npx -y bun ${SKILL_DIR}/scripts/detect-figures.ts --pdf source-paper.pdf --output figures.jsonThis outputs a JSON file with all detected figures/tables, their page numbers, and captions.
Step 2: Generate Outline Variants
1. Generate 3 style variant outlines based on content analysis 2. Follow references/outline-template.md for structure 3. Auto-populate IMAGE_SOURCE for academic papers:
- Read
figures.jsonfrom Step 1 - Map figures to slides using rules in
references/analysis-framework.mdSection 8 - Automatically add
// IMAGE_SOURCEblocks to appropriate slides: - Architecture/pipeline figures → Methods slides (
Source: extract) - Results tables → Quantitative results slides (
Source: extract) - Comparison images → Qualitative results slides (
Source: extract) - Conceptual/simple diagrams → Leave for AI generation (
Source: generateor omit)
4. Save as outline-{style}.md for each variant
Step 3: User Confirmation
Single AskUserQuestion with all applicable options:
| Question | When to Ask |
|---|---|
| Style variant | Always (3 options + custom) |
| Language | Only if source ≠ user language |
After selection:
- Copy selected
outline-{style}.mdtooutline.md - Regenerate in different language if requested
- User may edit
outline.mdfor fine-tuning
If --outline-only, stop here.
Step 4: Generate Prompts
1. Read references/base-prompt.md 2. Combine with style instructions from outline 3. Add slide-specific content 4. If Layout: specified in outline, include layout guidance in prompt:
- Reference layout characteristics for image composition
- Example:
Layout: hub-spoke→ "Central concept in middle with related items radiating outward"
5. Save to prompts/ directory
Step 5: Image Generation Method Selection
Before generating images, ask user to choose generation method:
Use AskUserQuestion with options:
| Option | Label | Description |
|---|---|---|
| 1 | Gemini API (Recommended) | Official Google API via Python. Requires GOOGLE_API_KEY env var. |
| 2 | Gemini Web (Browser-based) | ⚠️ Uses reverse-engineered web API. No API key needed but may break. |
Based on selection:
Option 1: Gemini API (Python)
1. Verify API key: Check GOOGLE_API_KEY or GEMINI_API_KEY environment variable 2. Run generation script:
python ${SKILL_DIR}/scripts/generate-slides.py <slide-deck-dir> --model gemini-3-pro-image-previewScript Features:
- Auto-installs
google-genaipackage if missing - Retry logic with exponential backoff (3 retries)
- Skips already-generated slides (> 10KB)
- Supports custom model via
--modelflag - Outputs to
slides/subdirectory
Troubleshooting:
- If server disconnection errors occur, script auto-retries
- For persistent failures, re-run the script (it skips completed slides)
- Check API quota if many failures occur
Option 2: Gemini Web Skill
1. Consent Check: Read consent file at:
- Windows:
$APPDATA/baoyu-skills/gemini-web/consent.json - macOS:
~/Library/Application Support/baoyu-skills/gemini-web/consent.json - Linux:
~/.local/share/baoyu-skills/gemini-web/consent.json
2. If no consent or version mismatch, display disclaimer and ask:
⚠️ DISCLAIMER: This uses a reverse-engineered Gemini Web API (NOT official).
Risks: May break anytime, no support, possible account risk.3. For each slide, run:
npx -y bun ${GEMINI_WEB_SKILL_DIR}/scripts/main.ts \
--promptfiles prompts/01-slide-cover.md \
--image 01-slide-cover.png \
--sessionId slides-{topic-slug}-{timestamp}Where GEMINI_WEB_SKILL_DIR = path to baoyu-danger-gemini-web skill directory.
4. Proxy support: If user is in restricted network, prepend:
HTTP_PROXY=http://127.0.0.1:7890 HTTPS_PROXY=http://127.0.0.1:7890Step 5.5: Process IMAGE_SOURCE (Automatic Figure Extraction)
For academic presentations, IMAGE_SOURCE metadata was auto-populated in Step 2 based on figure detection from Step 1.
Automatic Execution:
1. Parse outline to identify slides with Source: extract 2. Create figures directory: mkdir -p figures 3. For each extract slide, automatically:
- Read the Figure number, Page, and Caption from metadata
- Run figure extraction script:
npx -y bun ${SKILL_DIR}/scripts/extract-figure.ts \
--pdf source-paper.pdf \
--page <page-number> \
--output figures/figure-<N>.png- Run template application script:
npx -y bun ${SKILL_DIR}/scripts/apply-template.ts \
--figure figures/figure-<N>.png \
--title "<slide-headline>" \
--caption "Figure <N>: <caption-text>" \
--output <NN>-slide-<slug>.png- Report: "Extracted: Figure N → slide NN"
4. For slides with `Source: generate` (or no IMAGE_SOURCE):
- Proceed to Step 6 for AI generation
Note: Source PDF must be saved as source-paper.pdf in output directory.
Troubleshooting:
- If figure detection missed a figure: manually add
// IMAGE_SOURCEblock to outline - If wrong figure mapped: edit the
Figure:andPage:values in outline - If extraction fails: check PDF page number (1-indexed)
PyMuPDF Fallback for Page Extraction: If extract-figure.ts fails with "Image or Canvas expected" error (common with complex PDFs), use PyMuPDF:
import fitz
doc = fitz.open("source-paper.pdf")
page = doc[page_num - 1] # 0-indexed
mat = fitz.Matrix(3, 3) # 3x scale for high resolution
pix = page.get_pixmap(matrix=mat)
pix.save(f"extracted/page-{page_num}.png")Then apply template using apply-template.ts.
Step 6: Generate Images
1. Use selected method from Step 5 2. Skip slides already processed in Step 5.5 (those with Source: extract) 3. Generate session ID: slides-{topic-slug}-{timestamp} 4. Generate each remaining slide with same session ID 5. Report progress: "Generated X/N" 6. Auto-retry once on generation failure
Step 7: Merge to PPTX and PDF
npx -y bun ${SKILL_DIR}/scripts/merge-to-pptx.ts <slide-deck-dir>
npx -y bun ${SKILL_DIR}/scripts/merge-to-pdf.ts <slide-deck-dir>Step 8: Output Summary
Slide Deck Complete!
Topic: [topic]
Style: [style name]
Location: [directory path]
Slides: N total
- 01-slide-cover.png ✓ Cover
- 02-slide-intro.png ✓ Content
- ...
- {NN}-slide-back-cover.png ✓ Back Cover
Outline: outline.md
PPTX: {topic-slug}.pptx
PDF: {topic-slug}.pdfSlide Modification
See references/modification-guide.md for:
- Edit single slide workflow
- Add new slide (with renumbering)
- Delete slide (with renumbering)
- File naming conventions
Image Generation Dependencies
Gemini API (Option 1 - Recommended)
Requires:
GOOGLE_API_KEYorGEMINI_API_KEYenvironment variable- Python 3.8+ with pip
google-genaipackage (auto-installed by script)
Model: gemini-3-pro-image-preview (default)
Gemini Web Skill (Option 2)
Requires:
baoyu-danger-gemini-webskill installed at.claude/skills/baoyu-danger-gemini-web- Google Chrome browser with logged-in Google account
- User consent for reverse-engineered API disclaimer
PDF Figure Extraction
Requires:
- Primary:
pdfjs-distnpm package (use legacy build for Node.js) - Fallback:
pymupdfPython package (more reliable for complex PDFs) canvasnpm package for apply-template.ts
References
| File | Content |
|---|---|
references/analysis-framework.md | Deep content analysis for presentations |
references/outline-template.md | Outline structure and STYLE_INSTRUCTIONS format |
references/modification-guide.md | Edit, add, delete slide workflows |
references/content-rules.md | Content and style guidelines |
references/base-prompt.md | Base prompt for image generation |
references/figure-container-template.md | Visual specs for extracted figure containers |
references/styles/<style>.md | Full style specifications |
Notes
Image Generation
- Nano Banana Pro API: Recommended. Stable, reliable, requires API key
- Gemini Web: No API key needed, but uses reverse-engineered API with account risk
- Generation time: 10-30 seconds per slide
- Auto-retry once on generation failure
- Maintain style consistency via session ID
Content Guidelines
- Use stylized alternatives for sensitive public figures
- Both methods use the same underlying Gemini model for image generation
Extension Support
Custom styles and configurations via EXTEND.md.
Check paths (priority order): 1. .paper-skills/paper-slide-deck/EXTEND.md (project) 2. ~/.paper-skills/paper-slide-deck/EXTEND.md (user)
If found, load before Step 1. Extension content overrides defaults.
Presentation Analysis Framework
Deep content analysis for effective slide deck creation.
1. Message Hierarchy
Identify the core message structure before designing slides.
Core Message (One Sentence)
- What is the single most important takeaway?
- If the audience remembers only one thing, what should it be?
- Can you state it in ≤15 words?
Supporting Points (3-5 Maximum)
- What evidence supports the core message?
- What sub-topics must be covered?
- Prioritize by audience relevance, not source order
Call-to-Action
- What should the audience DO after viewing?
- Is it clear, specific, and achievable?
- Where does it appear (slide position)?
2. Audience Decision Matrix
| Question | Analysis |
|---|---|
| Who is the primary audience? | [Role, expertise level, relationship to topic] |
| What do they currently believe? | [Existing knowledge, assumptions, biases] |
| What decision do we want them to make? | [Specific action or conclusion] |
| What barriers exist? | [Objections, concerns, missing information] |
| What evidence will convince them? | [Data types, credibility sources, emotional hooks] |
Audience Adaptation
| Audience Type | Content Focus | Visual Treatment |
|---|---|---|
| Executives | Outcomes, ROI, strategic impact | High-level, clean, data highlights |
| Technical | Architecture, implementation, specs | Detailed diagrams, code, schematics |
| General | Benefits, stories, relatability | Visual metaphors, simple charts |
| Investors | Market size, traction, team | Growth charts, milestones, comparisons |
| Learners | Step-by-step, examples, practice | Progressive reveals, exercises |
3. Visual Opportunity Map
Identify which content benefits from visualization.
Content-to-Visual Mapping
| Content Type | Visual Treatment | Example |
|---|---|---|
| Comparisons | Side-by-side, before/after | Feature comparison table |
| Processes | Flow diagrams, numbered steps | Workflow illustration |
| Hierarchies | Org charts, pyramids, trees | Organizational structure |
| Timelines | Horizontal/vertical timelines | Project milestones |
| Statistics | Charts, highlighted numbers | Key metrics with context |
| Concepts | Icons, metaphors, illustrations | Abstract idea visualization |
| Relationships | Venn diagrams, networks | Ecosystem or dependencies |
| Lists | Structured grids, icon rows | Feature bullets with icons |
Visual Priority
Rate each piece of content:
- Must Visualize: Complex data, key differentiators, memorable moments
- Should Visualize: Supporting evidence, secondary points
- Text Only: Simple statements, transitions, minor details
4. Presentation Flow
Structure for impact and retention.
Opening (First 2-3 Slides)
| Element | Purpose |
|---|---|
| Hook | Capture attention (surprising stat, question, story) |
| Context | Why this matters now |
| Preview | What audience will learn/gain |
Middle (Content Slides)
| Pattern | When to Use |
|---|---|
| Problem → Solution | Introducing new products/ideas |
| Situation → Complication → Resolution | Complex business cases |
| What → Why → How | Educational content |
| Past → Present → Future | Transformation stories |
| Claim → Evidence → Implication | Data-driven arguments |
Closing (Final 2-3 Slides)
| Element | Purpose |
|---|---|
| Synthesis | Tie back to core message |
| Call-to-Action | Clear next steps |
| Memorable Close | Resonant quote, image, or statement |
Transitions
- Each slide should answer: "What comes next?"
- Use narrative connectors between sections
- Build logical progression, not topic jumps
5. Content Adaptation
Decide what to keep, transform, or omit.
Keep (High Value)
- Core arguments and evidence
- Unique insights or data
- Audience-relevant examples
- Memorable quotes or statistics
Simplify (Medium Value)
- Technical details → Visual summaries
- Long explanations → Bullet hierarchies
- Multiple examples → Best 1-2 examples
- Background context → Brief framing
Visualize (Transform)
- Data tables → Charts or highlighted numbers
- Process descriptions → Flow diagrams
- Comparisons in text → Side-by-side visuals
- Abstract concepts → Concrete metaphors
Omit (Low Value)
- Tangential information
- Redundant examples
- Excessive caveats
- Background the audience already knows
6. Analysis Checklist
Before outline creation, confirm:
Message Clarity
- [ ] Core message stated in one sentence
- [ ] 3-5 supporting points identified
- [ ] Call-to-action defined
Audience Fit
- [ ] Primary audience identified
- [ ] Existing beliefs mapped
- [ ] Desired decision clear
- [ ] Evidence matches audience needs
Visual Planning
- [ ] Key visualizations identified
- [ ] Chart/diagram types selected
- [ ] Visual priority assigned
Flow Design
- [ ] Opening hook defined
- [ ] Middle pattern selected
- [ ] Closing approach planned
- [ ] Transitions considered
Content Decisions
- [ ] Keep/simplify/visualize/omit applied
- [ ] Source material fully processed
- [ ] No important content overlooked
7. Academic Presentation Analysis
For conference talks, thesis defense, and research presentations.
Paper Structure to Slide Mapping
| Paper Section | Slide Type | Suggested Layout |
|---|---|---|
| Title + Abstract | Cover + Motivation | paper-title, title-hero |
| Introduction | Problem Statement + Background | split-screen, bullet-list |
| Related Work | Context (optional, can condense) | comparison-matrix, hub-spoke |
| Methods | Architecture/Pipeline | methods-diagram, linear-progression |
| Experiments | Setup + Results | results-chart, qualitative-grid |
| Ablation Studies | Detailed Analysis | comparison-matrix, results-chart |
| Conclusions | Summary + Future Work | contributions, bullet-list |
| References | Key Citations | references-list |
Academic Slide Count Guidelines
| Talk Duration | Recommended Slides | Pace |
|---|---|---|
| 5 min (spotlight) | 5-7 slides | ~1 min/slide |
| 10 min (short) | 8-12 slides | ~1 min/slide |
| 15 min (standard) | 12-18 slides | ~1 min/slide |
| 20 min (full) | 15-22 slides | ~1 min/slide |
| 30+ min (invited) | 25-35 slides | ~1 min/slide |
Citation Handling
Inline Citations:
- Key works: "[Author et al., Year]" or "[1]"
- Include only most relevant citations on slides
- Full bibliographic details optional
Reference Slide:
- List 5-10 key references at end
- Format: [N] Author et al. "Title." Venue, Year.
Results Presentation Checklist
- [ ] Baseline comparisons clearly labeled
- [ ] Best results highlighted (bold or color)
- [ ] Statistical significance noted where applicable
- [ ] Units and metrics clearly stated
- [ ] Error bars or confidence intervals if available
- [ ] Ablation results in separate table/chart
Academic Talk Flow
1. Hook (1 slide): Problem motivation, why it matters 2. Background (1-2 slides): Essential context only 3. Approach (2-4 slides): Your method, architecture 4. Results (2-4 slides): Main experiments, comparisons 5. Analysis (1-2 slides): Ablations, insights (optional) 6. Conclusion (1 slide): Summary, contributions, future work 7. References (1 slide): Key citations
8. Automatic Figure Detection and Mapping
For academic papers, automatically detect and map figures/tables to slides.
Figure Detection Process
1. Run detection script on source PDF:
npx -y bun ${SKILL_DIR}/scripts/detect-figures.ts --pdf source-paper.pdf --output figures.json2. Parse detection results to identify:
- Figure numbers, pages, and captions
- Table numbers, pages, and captions
- Total figure/table count
Figure-to-Slide Mapping Rules
| Figure Type | Maps To | Extract? | Reasoning |
|---|---|---|---|
| Architecture/Pipeline diagram | Methods slide | Yes | Core visual, must be accurate |
| Network structure | Methods slide | Yes | Technical precision required |
| Quantitative results table | Results slide | Yes | Data accuracy critical |
| Qualitative comparison grid | Results slide | Yes | Visual comparison must be authentic |
| Ablation study table | Analysis slide | Yes | Precise numbers needed |
| Challenge/motivation illustration | Background slide | Maybe | Depends on complexity |
| Conceptual diagram | Any | No | Can be re-stylized by AI |
| Simple flowchart | Any | No | AI can render cleanly |
Automatic Mapping Algorithm
For each detected figure:
1. Analyze caption keywords:
- "architecture", "framework", "pipeline", "network" → Methods slide
- "comparison", "results", "performance" → Results slide
- "ablation", "analysis" → Analysis slide
- "qualitative", "visual" → Qualitative Results slide
2. Determine extraction necessity:
- Contains numerical data (tables) → Extract
- Contains precise diagrams (architecture) → Extract
- Contains comparison images → Extract
- Simple conceptual illustration → Generate
3. Match to outline slide:
- Find slide with matching topic
- Add IMAGE_SOURCE metadata automaticallyMapping Confidence Levels
| Confidence | Action |
|---|---|
| High (>80%) | Auto-map and extract |
| Medium (50-80%) | Auto-map, flag for review |
| Low (<50%) | Skip, use AI generation |
Figure Caption Keywords
Extract (High Priority):
- "architecture", "framework", "pipeline", "overview", "structure"
- "comparison", "results", "performance", "evaluation"
- "ablation", "analysis", "study"
- "qualitative", "visual", "segmentation", "detection"
- Table I/II/III, Table 1/2/3
Generate (Low Priority):
- "illustration", "example", "concept", "motivation"
- "schematic", "diagram" (simple ones)
- Generic workflow without specific data
Auto-Population Format
When auto-populating IMAGE_SOURCE in outline:
// IMAGE_SOURCE
Source: extract
Figure: Figure 2
Page: 4
Caption: Overview of the proposed two-stage framework
Confidence: high
Mapping: Methods slide - "architecture" keyword matchReview Checklist
After auto-detection, verify:
- [ ] All key figures detected (architecture, results tables)
- [ ] Page numbers correct
- [ ] No duplicate mappings
- [ ] Conceptual slides correctly marked as "generate"
9. Practical Implementation Notes
Lessons learned from real-world slide generation sessions.
PDF Figure Extraction
pdfjs-dist Compatibility:
- Use
pdfjs-dist/legacy/build/pdf.mjsfor Node.js compatibility - The modern build requires browser APIs (DOMMatrix) not available in Node
- If extraction fails with "Image or Canvas expected", fall back to PyMuPDF
PyMuPDF (fitz) Fallback:
import fitz
doc = fitz.open("paper.pdf")
page = doc[page_num - 1] # 0-indexed
mat = fitz.Matrix(3, 3) # 3x scale for 4K quality
pix = page.get_pixmap(matrix=mat)
pix.save("output.png")PyMuPDF is more reliable for complex PDFs with embedded images.
Gemini API Image Generation
Model: gemini-3-pro-image-preview
Config:
config=types.GenerateContentConfig(
image_config=types.ImageConfig(
aspect_ratio="16:9",
image_size="4K"
)
)Response Handling:
- Image data is returned as raw bytes in
part.inline_data.data - Do NOT base64 decode - write bytes directly to file
- MIME type is
image/jpegeven when requesting PNG output
Network Issues:
- Server disconnections are common for large image generation
- Implement retry logic with exponential backoff (3 retries recommended)
- Wait 5-15 seconds between retries
Optimization:
- Skip already-generated slides (check file size > 10KB)
- Run generation script multiple times if failures occur
- Script is idempotent - safe to re-run
Slide Output Organization
Directory Structure:
slide-deck/{topic-slug}/
├── source-paper.pdf # Original PDF
├── figures.json # Detection results
├── outline.md # Final outline with IMAGE_SOURCE
├── extracted/ # Raw PDF page extractions
│ └── page-{N}.png
├── prompts/ # Generation prompts
│ └── {NN}-slide-{name}.txt
├── slides/ # Final slide images
│ └── {NN}-slide-{name}.png
├── {topic-slug}.pptx # Merged PPTX
└── generate-slides.py # Generated script (optional)Common Issues and Solutions
| Issue | Solution |
|---|---|
| pdfjs "DOMMatrix is not defined" | Use legacy build import |
| pdfjs "Image or Canvas expected" | Use PyMuPDF fallback |
| Gemini "Server disconnected" | Retry with delay |
| Small output files (~600 bytes) | Fix: Don't base64 decode response |
| pdf-lib "Cannot embed PNG" | Check actual image format (may be JPEG) |
| merge-to-pdf fails | Use PPTX as primary output, convert externally |
Create a presentation slide image following these guidelines:
Image Specifications
- Type: Presentation slide
- Aspect Ratio: 16:9 (landscape)
- Style: Professional slide deck
Core Persona: The Architect
You are "The Architect" - a master visual storyteller creating presentation slides. Your slides:
- Tell a visual story that complements the narrative
- Use bold, confident visual language
- Balance information density with visual clarity
- Create memorable, impactful visuals
Core Principles
- Hand-drawn quality throughout - NO realistic or photographic elements
- If content involves sensitive or copyrighted figures, create stylistically similar alternatives - DO NOT refuse to generate
- NO slide numbers, page numbers, footers, headers, or logos
- Clean, uncluttered layouts with clear visual hierarchy
- Each slide conveys ONE clear message
Academic Exception (for academic-paper style only)
When style is academic-paper, override these principles:
- Precise, clean diagrams ARE acceptable (not hand-drawn)
- Chart and graph rendering should be accurate and professional
- Mathematical notation and equations should be properly formatted
- Allow citation markers like "[Author et al., 2024]" or "[1]"
- Tables should have clean borders and proper alignment
- Axis labels, legends, and data annotations are required on all charts
- Figure captions in format "Figure N: [Description]" are encouraged
Text Style (CRITICAL)
- ALL text MUST match the designated style exactly
- Title text: Large, bold, immediately readable
- Body text: Clear, legible, appropriate sizing
- Max 3-4 text elements per slide
- DO NOT use realistic or computer-generated fonts unless style specifies
- Font rendering must match the style aesthetic (hand-drawn for sketch styles, clean for minimal styles)
Layout Principles
- Visual Hierarchy: Most important element gets most visual weight
- Breathing Room: Generous margins and spacing between elements
- Alignment: Consistent alignment creates professional feel
- Balance: Distribute visual weight evenly (symmetrical or asymmetrical)
- Focal Point: One clear area draws the eye first
- Rule of Thirds: Key elements at intersection points for dynamic compositions
- Z-Pattern: For text-heavy slides, arrange content in natural reading flow
Language
- Use the same language as the content provided below for all text elements
- Match punctuation style to the content language
- Write in direct, confident language
- Avoid AI-sounding phrases like "dive into", "explore", "let's", "journey"
---
STYLE_INSTRUCTIONS
[Insert style-specific instructions here]
---
Please use nano banana pro to generate the slide image based on the content provided below:
Content & Style Rules
Guidelines for slide deck content quality and style consistency.
Content Rules
1. Respect Reader Attention
- Each slide should communicate ONE main idea
- Remove redundant information
- Prioritize clarity over comprehensiveness
2. Data Traceability
- All statistics must include source attribution
- Cite sources directly on slides with data
- Use specific numbers over vague claims
3. Self-Contained Prompts
- Every detail must be in the image prompt
- No external references (e.g., "like slide 2")
- Include all colors, layouts, and content explicitly
4. No Placeholders
- Every element must be fully specified
- No "[insert data here]" or "TBD"
- All text content finalized before generation
Style Rules
1. Narrative Headlines
Headlines tell the story, not label the content.
| Bad | Good |
|---|---|
| "Key Statistics" | "Usage doubled in 6 months" |
| "Our Solution" | "One platform replaces five tools" |
| "Benefits" | "Teams save 10 hours weekly" |
2. Avoid AI Clichés
Remove these patterns:
- "Dive into", "explore", "journey"
- "Let's look at", "let me show you"
- "Exciting", "amazing", "revolutionary"
- "In conclusion", "to summarize"
3. Meaningful Back Cover
Not just "Thank you" or "Questions?"
Include one of:
- Clear call-to-action
- Memorable key takeaway
- Thought-provoking closing statement
- Contact information with purpose
4. Consistent Visual Language
Throughout the deck:
- Same icon style
- Same color usage patterns
- Same layout grid system
- Same typography hierarchy
Slide Structure
| Position | Type | Purpose |
|---|---|---|
| 1 | Cover | Title, visual hook, topic introduction |
| 2 to N-1 | Content | Key points, data, explanations |
| N | Back Cover | Summary, call-to-action, memorable close |
Key Specifications
| Specification | Value |
|---|---|
| Aspect Ratio | 16:9 (landscape) |
| Slide Count | Dynamic based on content |
| Required Slides | Cover + Back Cover minimum |
| Footers | None (no slide numbers, logos) |
| Language Priority | --lang → source language → ask user |
| Tone | Direct, confident (avoid AI phrases) |
Style Quick Reference
| Style | Visual Summary |
|---|---|
sketch-notes | Hand-drawn, warm off-white, conceptual icons |
blueprint | Technical schematics, grid texture, blue tones |
bold-editorial | High contrast, dark backgrounds, magazine impact |
vector-illustration | Flat vector, black outlines, retro colors |
minimal | Maximum whitespace, single accent, zen-like |
storytelling | Full-bleed imagery, cinematic, emotional |
warm | Soft gradients, rounded shapes, wellness palette |
notion | Dashboard aesthetic, clean data viz, SaaS-inspired |
corporate | Navy/gold, structured layouts, business polish |
playful | Vibrant coral/teal/yellow, dynamic, energetic |
Full style specifications: references/styles/<style>.md
Figure Container Template
Visual specifications for applying the academic-paper style container to extracted PDF figures.
Container Dimensions
| Property | Value | Notes |
|---|---|---|
| Aspect Ratio | 16:9 | Standard presentation format |
| Resolution | 1920 x 1080 px | Full HD |
| High-Res Option | 3840 x 2160 px | 4K for print quality |
Layout Specifications
┌─────────────────────────────────────────────────────────────────┐
│ TITLE AREA │
│ (120px height) │
├─────────────────────────────────────────────────────────────────┤
│ │
│ │
│ FIGURE AREA │
│ (centered, scaled) │
│ max 85% width │
│ max 70% height │
│ │
│ │
├─────────────────────────────────────────────────────────────────┤
│ CAPTION AREA │
│ (80px height) │
└─────────────────────────────────────────────────────────────────┘Dimensions (1920x1080)
| Area | Position | Size |
|---|---|---|
| Title | y: 40px, centered | height: 80px |
| Figure Container | centered | max-width: 1632px (85%), max-height: 756px (70%) |
| Caption | y: 960px, centered | height: 60px |
| Margins | all sides | 60px |
Color Specifications (academic-paper style)
| Element | Color | Hex |
|---|---|---|
| Background | White | #FFFFFF |
| Title Text | Dark Blue-Gray | #1E3A5F |
| Caption Text | Medium Gray | #6B7280 |
| Figure Border | Light Gray | #E5E7EB |
| Figure Shadow | Gray (10% opacity) | rgba(0,0,0,0.1) |
Typography
Title
- Font: Sans-serif (system default: Arial, Helvetica)
- Size: 48px (1920w) / 96px (3840w)
- Weight: Bold (700)
- Color: #1E3A5F
- Alignment: Center
- Max lines: 2
Caption
- Font: Sans-serif (system default: Arial, Helvetica)
- Size: 24px (1920w) / 48px (3840w)
- Weight: Normal (400)
- Style: Italic
- Color: #6B7280
- Alignment: Center
- Format: "Figure N: [Caption text]"
Figure Area Styling
Container
- Background: White (#FFFFFF)
- Border: 1px solid #E5E7EB
- Border Radius: 8px
- Box Shadow: 0 4px 6px rgba(0,0,0,0.1)
- Padding: 20px
Figure Scaling
- Maintain aspect ratio
- Scale to fit container (contain mode)
- Center horizontally and vertically
- Minimum margin from container edge: 20px
Implementation Notes
Canvas Setup (Node.js)
import { createCanvas, loadImage } from 'canvas';
const WIDTH = 1920;
const HEIGHT = 1080;
const canvas = createCanvas(WIDTH, HEIGHT);
const ctx = canvas.getContext('2d');
// Background
ctx.fillStyle = '#FFFFFF';
ctx.fillRect(0, 0, WIDTH, HEIGHT);Title Rendering
ctx.fillStyle = '#1E3A5F';
ctx.font = 'bold 48px Arial, Helvetica, sans-serif';
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
ctx.fillText(title, WIDTH / 2, 80);Figure Placement
// Load and scale figure
const figure = await loadImage(figurePath);
const maxWidth = WIDTH * 0.85;
const maxHeight = HEIGHT * 0.70;
const scale = Math.min(maxWidth / figure.width, maxHeight / figure.height);
const scaledWidth = figure.width * scale;
const scaledHeight = figure.height * scale;
// Center position
const x = (WIDTH - scaledWidth) / 2;
const y = (HEIGHT - scaledHeight) / 2;
// Draw shadow
ctx.shadowColor = 'rgba(0,0,0,0.1)';
ctx.shadowBlur = 12;
ctx.shadowOffsetY = 4;
// Draw border
ctx.strokeStyle = '#E5E7EB';
ctx.lineWidth = 1;
ctx.strokeRect(x - 20, y - 20, scaledWidth + 40, scaledHeight + 40);
// Draw figure
ctx.drawImage(figure, x, y, scaledWidth, scaledHeight);Caption Rendering
ctx.fillStyle = '#6B7280';
ctx.font = 'italic 24px Arial, Helvetica, sans-serif';
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
ctx.fillText(`Figure ${figureNum}: ${caption}`, WIDTH / 2, HEIGHT - 60);Variants
Minimal Container
- No border or shadow
- Figure fills more space (90% width)
- Smaller title/caption (36px/18px)
With Sub-caption
- Add second line below caption
- For additional notes or source attribution
- Smaller font (18px), lighter gray (#9CA3AF)
Table Container
- Same layout as figure
- Replace "Figure N" with "Table N"
- Consider larger padding for table borders
Output Format
- Format: PNG
- Color Space: sRGB
- Compression: Lossless
- Filename: Same as slide filename from outline
Slide Modification Guide
Workflows for modifying individual slides after initial generation.
Edit Single Slide
Regenerate a specific slide with modified content:
1. Identify slide to edit (e.g., 03-slide-key-findings.png) 2. Update prompt in prompts/03-slide-key-findings.md 3. If content changes significantly, update slug in filename 4. Regenerate image using same session ID 5. Regenerate PPTX and PDF
Add New Slide
Insert a new slide at specified position:
1. Specify insertion position (e.g., after slide 3) 2. Create new prompt with appropriate slug (e.g., 04-slide-new-section.md) 3. Generate new slide image 4. Renumber files: All subsequent slides increment NN by 1
04-slide-conclusion.png→05-slide-conclusion.png- Slugs remain unchanged
5. Update outline.md with new slide entry 6. Regenerate PPTX and PDF
Delete Slide
Remove a slide and renumber:
1. Identify slide to delete (e.g., 03-slide-key-findings.png) 2. Remove image file and prompt file 3. Renumber files: All subsequent slides decrement NN by 1
04-slide-conclusion.png→03-slide-conclusion.png- Slugs remain unchanged
4. Update outline.md to remove slide entry 5. Regenerate PPTX and PDF
File Naming Convention
Files use meaningful slugs for better readability:
NN-slide-[slug].png
NN-slide-[slug].md (in prompts/)Examples:
01-slide-cover.png02-slide-problem-statement.png03-slide-key-findings.png04-slide-back-cover.png
Slug Rules
| Rule | Description |
|---|---|
| Format | Kebab-case (lowercase, hyphens) |
| Source | Derived from slide title/content |
| Uniqueness | Must be unique within the deck |
| Updates | Change slug when content changes significantly |
Renumbering Rules
| Scenario | Action |
|---|---|
| Add slide | Increment NN for all subsequent slides |
| Delete slide | Decrement NN for all subsequent slides |
| Reorder slides | Update NN to match new positions |
| Edit slide | NN unchanged, update slug if needed |
Important: Slugs remain unchanged during renumbering. Only the NN prefix changes.
Post-Modification Checklist
After any modification:
- [ ] Image file renamed/created correctly
- [ ] Prompt file renamed/created correctly
- [ ] Subsequent files renumbered (if add/delete)
- [ ]
outline.mdupdated to reflect changes - [ ] PPTX regenerated
- [ ] PDF regenerated
- [ ] Slide count in outline header updated
Outline Template
Standard structure for slide deck outlines with style instructions.
Outline Format
# Slide Deck Outline
**Topic**: [topic description]
**Style**: [selected style]
**Audience**: [target audience]
**Language**: [output language]
**Slide Count**: N slides
**Generated**: YYYY-MM-DD HH:mm
---
<STYLE_INSTRUCTIONS>
Design Aesthetic: [2-3 sentence description from style file]
Background:
Color: [Name] ([Hex])
Texture: [description]
Typography:
Primary Font: [detailed description for image generation]
Secondary Font: [detailed description for image generation]
Color Palette:
Primary Text: [Name] ([Hex]) - [usage]
Background: [Name] ([Hex]) - [usage]
Accent 1: [Name] ([Hex]) - [usage]
Accent 2: [Name] ([Hex]) - [usage]
Visual Elements:
- [element 1 with rendering guidance]
- [element 2 with rendering guidance]
- ...
Style Rules:
Do: [guidelines from style file]
Don't: [anti-patterns from style file]
</STYLE_INSTRUCTIONS>
---
[Slide entries follow...]Cover Slide Template
## Slide 1 of N
**Type**: Cover
**Filename**: 01-slide-cover.png
// NARRATIVE GOAL
[What this slide achieves in the story arc]
// KEY CONTENT
Headline: [main title]
Sub-headline: [supporting tagline]
// VISUAL
[Detailed visual description - specific elements, composition, mood]
// LAYOUT
Layout: [optional: layout name from gallery, e.g., title-hero]
[Composition, hierarchy, spatial arrangement]Content Slide Template
## Slide X of N
**Type**: Content
**Filename**: {NN}-slide-{slug}.png
// NARRATIVE GOAL
[What this slide achieves in the story arc]
// KEY CONTENT
Headline: [main message - narrative, not label]
Sub-headline: [supporting context]
Body:
- [point 1 with specific detail]
- [point 2 with specific detail]
- [point 3 with specific detail]
// VISUAL
[Detailed visual description]
// LAYOUT
Layout: [optional: layout name from gallery]
[Composition, hierarchy, spatial arrangement]Image Source Metadata (Automatic Figure Extraction)
For academic presentations, IMAGE_SOURCE metadata is automatically populated based on figure detection.
Auto-Population Process
1. Figure Detection: detect-figures.ts scans PDF and outputs figures.json 2. Mapping Algorithm: Agent maps figures to slides using caption keywords:
- "architecture", "framework", "pipeline" → Methods slides
- "comparison", "results", "performance" → Results slides (quantitative)
- "qualitative", "visual", "segmentation" → Results slides (qualitative)
- Table I/II/III → Quantitative results slides
3. Auto-Insert: // IMAGE_SOURCE blocks added to outline during generation
IMAGE_SOURCE Format
// IMAGE_SOURCE
Source: generate | extract
Figure: [Figure/Table number from paper, e.g., "Figure 2", "Table 1"]
Page: [PDF page number, 1-indexed]
Caption: [Figure caption for container template]IMAGE_SOURCE Values
| Value | Description | Processing |
|---|---|---|
generate | AI generates the slide image (default) | Standard prompt → Gemini generation |
extract | Extract figure from source PDF | PDF extraction → Apply container template |
Auto-Mapping Rules
| Figure Caption Contains | Maps To | Default Source |
|---|---|---|
| architecture, framework, pipeline, network, overview | Methods slide | extract |
| comparison, results, performance, evaluation | Quantitative results | extract |
| qualitative, visual, segmentation, detection | Qualitative results | extract |
| ablation, analysis | Analysis slide | extract |
| Table I, Table II, TABLE 1, TABLE 2 | Results slide | extract |
| motivation, challenge, problem | Background slide | generate |
| illustration, concept, example | Any | generate |
Manual Override
To override auto-detection, manually edit the // IMAGE_SOURCE block in outline:
// IMAGE_SOURCE
Source: extract # Change to 'generate' if needed
Figure: Figure 3 # Correct figure number if wrong
Page: 5 # Correct page number if wrong
Caption: Corrected caption textExample: Extracted Figure Slide
## Slide 5 of 12
**Type**: Content
**Filename**: 05-slide-architecture.png
// NARRATIVE GOAL
Present the core network architecture
// KEY CONTENT
Headline: Proposed Architecture
Sub-headline: Two-Stage Coarse-to-Fine Framework
Body:
- Stage 1: Global feature extraction
- Stage 2: Local refinement module
// VISUAL
Central architecture diagram from Figure 2 of the paper
// LAYOUT
Layout: methods-diagram
// IMAGE_SOURCE
Source: extract
Figure: Figure 2
Page: 4
Caption: Overall architecture of our proposed two-stage frameworkExample: Generated Slide (Default)
## Slide 3 of 12
**Type**: Content
**Filename**: 03-slide-motivation.png
// NARRATIVE GOAL
Establish the problem motivation
// KEY CONTENT
Headline: Current Methods Fall Short
Body:
- Existing approaches struggle with X
- Performance gap in Y scenarios
// VISUAL
Split comparison showing limitation vs desired outcome
// LAYOUT
Layout: binary-comparison
// IMAGE_SOURCE
Source: generateNote: If // IMAGE_SOURCE section is omitted, defaults to Source: generate.
Back Cover Slide Template
## Slide N of N
**Type**: Back Cover
**Filename**: {NN}-slide-back-cover.png
// NARRATIVE GOAL
[Meaningful closing - not just "thank you"]
// KEY CONTENT
Headline: [memorable closing statement or call-to-action]
Body: [optional summary points or next steps]
// VISUAL
[Visual that reinforces the core message]
// LAYOUT
Layout: [optional: layout name from gallery]
[Clean, impactful composition]STYLE_INSTRUCTIONS Block
The <STYLE_INSTRUCTIONS> block contains all style-specific guidance for image generation:
| Section | Content |
|---|---|
| Design Aesthetic | Overall visual direction from style file |
| Background | Base color and texture details |
| Typography | Font descriptions for Gemini (no font names, describe appearance) |
| Color Palette | Named colors with hex codes and usage guidance |
| Visual Elements | Specific graphic elements with rendering instructions |
| Style Rules | Do/Don't guidelines from style file |
Important: Typography descriptions must describe the visual appearance (e.g., "rounded sans-serif", "bold geometric") since image generators cannot use font names.
Section Dividers
Use --- (horizontal rule) between:
- Header metadata and STYLE_INSTRUCTIONS
- STYLE_INSTRUCTIONS and first slide
- Each slide entry
Slide Numbering
- Cover is always Slide 1
- Content slides use sequential numbers
- Back Cover is always final slide (N)
- Filename prefix matches slide position:
01-,02-, etc.
Filename Slugs
Generate meaningful slugs from slide content:
| Slide Type | Slug Pattern | Example |
|---|---|---|
| Cover | cover | 01-slide-cover.png |
| Content | {topic-slug} | 02-slide-problem-statement.png |
| Back Cover | back-cover | 10-slide-back-cover.png |
Slug rules:
- Kebab-case (lowercase, hyphens)
- Derived from headline or main topic
- Maximum 30 characters
- Unique within deck
Academic Slide Templates
For academic-paper style presentations.
Academic Cover Slide
## Slide 1 of N
**Type**: Cover
**Filename**: 01-slide-cover.png
// NARRATIVE GOAL
Establish paper title, authors, affiliations, and venue
// KEY CONTENT
Headline: [Paper Title - can be multi-line]
Sub-headline: [Conference/Journal Name, Year]
Authors: [Author1, Author2, Author3]
Affiliations: [University/Company logos or names]
// VISUAL
Clean white background, centered title in dark blue, author names below, institutional logos/names at bottom
// LAYOUT
Layout: paper-titleMethods/Architecture Slide
## Slide X of N
**Type**: Content
**Filename**: {NN}-slide-method.png
// NARRATIVE GOAL
Present the core methodology or system architecture
// KEY CONTENT
Headline: [Method Name] / Our Approach
Body:
- Architecture diagram with labeled components
- Data flow arrows between modules
- Key innovation highlighted
// VISUAL
Central pipeline/architecture diagram, labeled boxes for each component, arrows showing data flow, key module emphasized with accent color
// LAYOUT
Layout: methods-diagramResults Slide (Quantitative)
## Slide X of N
**Type**: Content
**Filename**: {NN}-slide-results.png
// NARRATIVE GOAL
Present main experimental results with clear comparisons
// KEY CONTENT
Headline: [Key finding - narrative, e.g., "Our method achieves state-of-the-art on X"]
Body:
- Table or chart with baselines
- Best results highlighted
- Metric names and units clear
// VISUAL
Clean table or bar chart, baseline rows in gray, our method highlighted in blue, best values in bold, clear column headers
// LAYOUT
Layout: results-chartResults Slide (Qualitative)
## Slide X of N
**Type**: Content
**Filename**: {NN}-slide-qualitative.png
// NARRATIVE GOAL
Show visual comparison of results
// KEY CONTENT
Headline: [Qualitative Comparison]
Body:
- 2x2 or 3x2 grid of comparison images
- Labels: Input, Baseline, Ours, Ground Truth
- Caption describing what to observe
// VISUAL
Grid layout with equal-sized images, clear labels below each, subtle borders between cells
// LAYOUT
Layout: qualitative-gridContributions Slide
## Slide X of N
**Type**: Content
**Filename**: {NN}-slide-contributions.png
// NARRATIVE GOAL
Summarize key contributions of the work
// KEY CONTENT
Headline: Contributions
Body:
1. [First contribution - specific and measurable]
2. [Second contribution]
3. [Third contribution]
(Optional: Code/data release information)
// VISUAL
Numbered list with checkmarks or icons, each contribution on separate line, clean spacing
// LAYOUT
Layout: contributionsReferences Slide
## Slide N of N
**Type**: Back Cover
**Filename**: {NN}-slide-references.png
// NARRATIVE GOAL
Acknowledge key related work and provide resources
// KEY CONTENT
Headline: References / Thank You
Body:
[1] Author et al. "Title." Venue, Year.
[2] Author et al. "Title." Venue, Year.
...
(Optional: QR code for paper/code, contact email)
// VISUAL
Two-column reference list, smaller font, optional QR code in corner, "Questions?" or contact info at bottom
// LAYOUT
Layout: references-listacademic-paper
Professional academic presentation style for conference talks, thesis defense, and research presentations
Design Aesthetic
Clean, professional academic presentation aesthetic. Precise diagrams and charts with clear data visualization. White or light gray backgrounds with restrained color usage. Formal typography hierarchy suitable for academic venues. Think ICML/NeurIPS/CVPR presentation standards.
Background
- Color: Pure White (#FFFFFF) or Light Gray (#F8FAFC)
- Texture: None - clean and distraction-free
Typography
Primary Font (Headlines)
Clean serif font for formal academic authority. Bold weight for main titles. Professional, scholarly presence similar to Times or Georgia.
Secondary Font (Labels)
Sans-serif for diagram labels, axis titles, and annotations. Clear, readable at small sizes. Consistent weight throughout.
Body Font
Sans-serif for body text, bullet points, and descriptions. Clean and modern for readability. Proper spacing for dense information.
Color Palette
| Role | Color | Hex | Usage |
|---|---|---|---|
| Background | White | #FFFFFF | Primary background |
| Alt Background | Light Gray | #F8FAFC | Alternate sections |
| Primary Text | Dark Blue-Gray | #1E3A5F | Headlines, body text |
| Secondary Text | Medium Gray | #6B7280 | Captions, annotations |
| Primary Accent | Academic Blue | #2563EB | Key highlights, links |
| Chart Color 1 | Deep Blue | #1E40AF | Primary data series |
| Chart Color 2 | Teal | #0891B2 | Secondary data series |
| Chart Color 3 | Orange | #EA580C | Tertiary data, emphasis |
| Chart Color 4 | Purple | #7C3AED | Fourth data series |
| Success | Green | #059669 | Positive results |
| Error | Red | #DC2626 | Negative results, errors |
Visual Elements
- Clean bar charts, line graphs, scatter plots
- Architecture diagrams with labeled components
- Flow charts for methods and pipelines
- Tables with clear headers and alignment
- Mathematical equations and notation
- Numbered figure captions
- Citation markers [Author, Year]
- Section numbers and headers
- Bullet points with consistent markers
Style Rules
Do
- Use precise, accurate diagram rendering
- Include clear axis labels and legends on all charts
- Add figure numbers and captions
- Use citation markers for referenced work
- Maintain consistent spacing and alignment
- Show data with appropriate precision
- Use numbered sections for navigation
- Keep color usage minimal and purposeful
Don't
- Use decorative or artistic illustrations
- Add hand-drawn or sketch elements
- Use gradients or 3D effects on charts
- Include logos or watermarks
- Add slide numbers in visual area
- Use more than 4 colors in a single chart
- Omit units or axis labels
- Create cluttered or dense layouts
Academic-Specific Elements
Equation Formatting
- Center-aligned equations with equation numbers
- Clear variable definitions
- Proper mathematical notation (subscripts, superscripts, Greek letters)
Citation Style
- Inline citations: [Author et al., Year]
- Key references highlighted
- Full reference list on dedicated slide
Results Presentation
- Clear comparison tables with baseline highlights
- Statistical significance markers where applicable
- Confidence intervals or error bars on charts
- Before/after or ablation study layouts
Figure Standards
- Figure N: [Caption] format
- Source attribution for external figures
- Consistent sizing across slides
Best For
Conference presentations (ICML, NeurIPS, CVPR, ACL, etc.), thesis defense, research seminars, academic job talks, paper presentations, grant proposal presentations, lab meetings
blueprint
Precise technical blueprint style with professional analytical visual presentation
Design Aesthetic
Clean, structured visual metaphors using blueprints, diagrams, and schematics. Precise, analytical and aesthetically refined. Information presented in triptych or grid-based layouts with engineering precision.
Background
- Color: Blueprint Off-White (#FAF8F5)
- Texture: Subtle grid overlay, light engineering paper feel
Typography
Primary Font (Headlines)
Neue Haas Grotesk Display Pro or similar clean sans-serif. Bold weight for titles. Precise letterforms with consistent spacing. Technical, authoritative presence.
Secondary Font (Body)
Tiempos Text or similar elegant serif for body explanations. Clean, readable at smaller sizes. Professional editorial quality.
Color Palette
| Role | Color | Hex | Usage |
|---|---|---|---|
| Background | Blueprint Paper | #FAF8F5 | Primary background |
| Grid | Light Gray | #E5E5E5 | Background grid lines |
| Primary Text | Deep Slate | #334155 | Headlines, body text |
| Primary Accent | Engineering Blue | #2563EB | Key elements, highlights |
| Secondary Accent | Navy Blue | #1E3A5F | Supporting elements |
| Tertiary | Light Blue | #BFDBFE | Backgrounds, fills |
| Warning | Amber | #F59E0B | Warnings, emphasis points |
Visual Elements
- Precise lines with consistent stroke weights
- Technical schematics and clean vector graphics
- Thin line work in technical drawing style
- Connection lines use straight lines or 90-degree angles only
- Data visualization with clean, minimal charts
- Dimension lines and measurement indicators
- Cross-section style diagrams
- Isometric or orthographic projections
Style Rules
Do
- Maintain consistent line weights throughout
- Use grid alignment for all elements
- Keep color palette restrained and unified
- Create clear visual hierarchy through scale
- Use geometric precision for all shapes
Don't
- Use hand-drawn or organic shapes
- Add decorative flourishes
- Use curved connection lines
- Include photographic elements
- Add slide numbers, footers, or logos
Best For
Technical architecture, system design, data analysis, professional business presentations, engineering documentation, process flows
bold-editorial
High-impact magazine editorial style with bold visual expression
Design Aesthetic
Strong visual impact at magazine cover level. Bold typography and dramatic contrast. Full-bleed imagery and large color blocks create commanding presence. Every slide feels like a premium publication cover.
Background
- Color: Deep Black (#0A0A0A) primary, or Deep Blue (#0F172A) alternative
- Texture: None - clean solid backgrounds, or pure white with bold color blocks
Typography
Primary Font (Headlines)
Bold condensed typeface like Impact, Oswald Bold, or Bebas Neue. Oversized headlines that dominate the slide. All-caps for maximum impact. Tight letter-spacing.
Secondary Font (Body)
Clean sans-serif such as Inter, SF Pro, or Helvetica Neue. Medium weight for body text. High contrast against background.
Color Palette
| Role | Color | Hex | Usage |
|---|---|---|---|
| Background Dark | Deep Black | #0A0A0A | Primary dark background |
| Background Alt | Deep Blue | #0F172A | Alternative dark background |
| Background Light | Pure White | #FFFFFF | Light mode background |
| Primary Text | Pure White | #FFFFFF | Text on dark backgrounds |
| Alt Text | Pure Black | #000000 | Text on light backgrounds |
| Accent 1 | Electric Blue | #3B82F6 | Primary highlights |
| Accent 2 | Bright Orange | #FB923C | Energy, urgency |
| Accent 3 | Magenta | #EC4899 | Creative, bold accents |
| Accent 4 | Neon Green | #22C55E | Success, growth |
| Accent 5 | Violet | #8B5CF6 | Innovation, premium |
Visual Elements
- Strong typography as visual element itself
- Geometric shapes and bold color blocks
- Full-bleed images or solid color backgrounds
- High contrast gradients (subtle, not garish)
- Minimal decoration - let content speak
- Dynamic diagonal lines and angles
- Dramatic lighting effects on text
Style Rules
Do
- Use extreme scale contrast (huge headlines, small body)
- Create bold color block compositions
- Let negative space create tension
- Use full-bleed backgrounds
- Make every slide feel like a magazine cover
Don't
- Use soft or muted colors
- Add unnecessary decorative elements
- Create busy, cluttered layouts
- Use thin or delicate typography
- Add slide numbers, footers, or logos
Best For
Product launches, marketing presentations, keynote speeches, brand showcases, investor pitches, high-stakes presentations
chalkboard
Black chalkboard background with colorful chalk drawing style
Design Aesthetic
Classic classroom chalkboard aesthetic with hand-drawn chalk illustrations. Nostalgic educational feel with imperfect, sketchy lines that capture the warmth of traditional teaching. Colorful chalk creates visual hierarchy while maintaining the authentic chalkboard experience.
Background
- Color: Chalkboard Black (#1A1A1A) or Dark Green-Black (#1C2B1C)
- Texture: Realistic chalkboard texture with subtle scratches, dust particles, and faint eraser marks
Typography
Primary Font (Headlines)
Hand-drawn chalk lettering style. Bold, slightly uneven strokes with visible chalk texture. Imperfect baseline adds authenticity. White or bright colored chalk for emphasis.
Secondary Font (Body)
Neater chalk handwriting for readability. Consistent sizing with natural variation. Light chalk texture, thinner strokes than headlines.
Color Palette
| Role | Color | Hex | Usage |
|---|---|---|---|
| Background | Chalkboard Black | #1A1A1A | Primary background |
| Alt Background | Green-Black | #1C2B1C | Traditional green board |
| Primary Text | Chalk White | #F5F5F5 | Main text, outlines |
| Accent 1 | Chalk Yellow | #FFE566 | Highlights, emphasis |
| Accent 2 | Chalk Pink | #FF9999 | Secondary highlights |
| Accent 3 | Chalk Blue | #66B3FF | Diagrams, links |
| Accent 4 | Chalk Green | #90EE90 | Success, nature |
| Accent 5 | Chalk Orange | #FFB366 | Warnings, energy |
Visual Elements
- Hand-drawn chalk illustrations with sketchy, imperfect lines
- Chalk dust effects around text and key elements
- Doodles: stars, arrows, underlines, circles, checkmarks
- Mathematical formulas and simple diagrams
- Eraser smudges and chalk residue textures
- Wooden frame border optional
- Stick figures and simple icons
- Connection lines with hand-drawn feel
Style Rules
Do
- Maintain authentic chalk texture on all elements
- Use imperfect, hand-drawn quality throughout
- Add subtle chalk dust and smudge effects
- Create visual hierarchy with color variety
- Include playful doodles and annotations
Don't
- Use perfect geometric shapes
- Create clean digital-looking lines
- Add photorealistic elements
- Use gradients or glossy effects
- Add slide numbers, footers, or logos
Best For
Educational presentations, classroom content, tutorials, teaching materials, back-to-school themes, workshop presentations, informal learning sessions, knowledge sharing
corporate
Professional business style with navy/gold palette and structured layouts
Design Aesthetic
Clean lines, structured layouts, and business-appropriate sophistication. Projects competence, reliability, and institutional credibility. Balances professionalism with approachability through careful use of whitespace and refined color choices.
Background
- Color: Pure White (#FFFFFF) with navy structural elements
- Texture: None - crisp digital clarity for maximum professionalism
Typography
Primary Font (Headlines)
Modern geometric sans-serif (Inter, SF Pro, or similar). Clean, professional, and highly legible. Conveys competence and contemporary business sensibility. Medium to semi-bold weight.
Secondary Font (Body)
Humanist sans-serif (Source Sans Pro style) for body text. Friendly yet professional, optimized for reading comprehension. Regular weight with comfortable line height.
Color Palette
| Role | Color | Hex | Usage |
|---|---|---|---|
| Background | Pure White | #FFFFFF | Main slide background |
| Primary Text | Navy | #1E3A5F | Headlines, key text |
| Secondary Text | Dark Gray | #4A5568 | Body text |
| Primary Accent | Gold | #C9A227 | Premium highlights, emphasis |
| Secondary Accent | Light Navy | #3D5A80 | Secondary elements |
| Success | Corporate Green | #059669 | Positive metrics |
| Alert | Corporate Red | #DC2626 | Attention items |
| Neutral | Light Gray | #F3F4F6 | Background sections |
Visual Elements
- Clean charts and data visualizations
- Professional iconography (outlined style)
- Structured grid layouts
- Subtle shadows for depth (minimal)
- Progress bars and metrics displays
- Organizational charts
- Timeline graphics
- Comparison tables
Style Rules
Do
- Maintain clear visual hierarchy
- Use consistent grid alignment
- Apply accent colors strategically (gold for emphasis)
- Keep data visualizations clean and readable
- Use professional outlined iconography
Don't
- Use playful or casual elements
- Apply heavy decorative effects
- Mix too many accent colors
- Crowd slides with information
- Use informal illustration styles
- Add slide numbers, footers, or logos
Best For
Business presentations, investor decks, quarterly reports, executive summaries, client proposals, corporate communications, board meetings
dark-atmospheric
Dark moody aesthetic with deep colors and glowing accent elements
Design Aesthetic
Cinematic dark mode aesthetic with atmospheric depth. Deep purples, blacks, and rich shadows with glowing accents creating dramatic visual contrast. Mysterious, sophisticated, and visually striking. Perfect for evening events, creative industries, and premium brand presentations.
Background
- Color: Deep Purple-Black (#0D0D1A) or Rich Navy (#1A1A2E)
- Texture: Subtle gradient from darker edges to slightly lighter center, atmospheric fog effect
Typography
Primary Font (Headlines)
Elegant serif or refined sans-serif in light/white. High contrast against dark background. Medium to bold weight. Letterforms may have subtle glow effect.
Secondary Font (Body)
Clean sans-serif in light gray or muted white. Readable against dark backgrounds. Regular weight with generous line height.
Color Palette
| Role | Color | Hex | Usage |
|---|---|---|---|
| Background | Deep Purple-Black | #0D0D1A | Primary background |
| Alt Background | Rich Navy | #1A1A2E | Secondary areas |
| Primary Text | Pure White | #FFFFFF | Headlines |
| Secondary Text | Light Gray | #A0AEC0 | Body text |
| Glow Accent 1 | Electric Purple | #8B5CF6 | Primary glow |
| Glow Accent 2 | Cyan Blue | #06B6D4 | Secondary glow |
| Glow Accent 3 | Magenta Pink | #EC4899 | Tertiary accent |
| Glow Accent 4 | Amber | #F59E0B | Warm highlights |
| Subtle | Dark Gray | #2D3748 | Dividers, borders |
Visual Elements
- Glowing accent elements and borders
- Subtle gradient backgrounds
- Atmospheric fog or particle effects
- Neon-style highlights on key elements
- Silhouettes with backlit edges
- Audio waveforms or sound visualizations
- Radiating light circles and orbs
- Cinematic letterboxing optional
Style Rules
Do
- Maintain high contrast for readability
- Use glowing effects sparingly for emphasis
- Create atmospheric depth with gradients
- Design dramatic visual focal points
- Keep text crisp against dark backgrounds
Don't
- Overuse neon effects (less is more)
- Create low-contrast text combinations
- Use bright backgrounds
- Add cluttered busy elements
- Add slide numbers, footers, or logos
Best For
Entertainment presentations, music and audio content, creative agency pitches, evening events, premium brand reveals, gaming content, cinematic storytelling, tech product launches
editorial-infographic
Modern magazine-style editorial infographic with clear visual storytelling
Design Aesthetic
High-quality magazine explainer aesthetic. Clear visual storytelling that transforms complex information into digestible narratives. Clean illustrations, structured layouts, and professional typography. Think Wired, The Verge, or high-end science publications.
Background
- Color: Pure White (#FFFFFF) or Light Gray (#F8F9FA)
- Texture: None or subtle paper grain for print feel
Typography
Primary Font (Headlines)
Bold display serif or modern sans-serif. Strong visual presence. Clean letterforms with editorial sophistication. Large scale for impact.
Secondary Font (Subheads)
Semi-bold sans-serif for section headers. Clear hierarchy distinction from body text. Consistent styling throughout.
Body Font
Humanist sans-serif optimized for reading. Clean, professional, accessible. Comfortable line height (1.6).
Color Palette
| Role | Color | Hex | Usage |
|---|---|---|---|
| Background | Pure White | #FFFFFF | Primary background |
| Alt Background | Light Gray | #F8F9FA | Section backgrounds |
| Primary Text | Near Black | #1A1A1A | Headlines, body |
| Secondary Text | Dark Gray | #4A5568 | Captions, metadata |
| Accent 1 | Editorial Blue | #2563EB | Primary accent |
| Accent 2 | Coral | #F97316 | Secondary accent |
| Accent 3 | Emerald | #10B981 | Positive elements |
| Accent 4 | Amber | #F59E0B | Warning, attention |
| Dividers | Medium Gray | #D1D5DB | Section dividers |
Visual Elements
- Clean flat illustrations (not photos)
- Structured multi-section layouts
- Callout boxes for key insights
- Icon-based data visualization
- Visual metaphors for abstract concepts
- Flow diagrams with clear directional hierarchy
- Pull quotes and highlight boxes
- Section dividers and visual breaks
Style Rules
Do
- Create clear visual narrative flow
- Use structured multi-section layouts
- Include callout boxes for key insights
- Design visual metaphors for complex ideas
- Maintain magazine-quality polish
Don't
- Use photographic imagery
- Create cluttered dense layouts
- Mix too many visual styles
- Add decorative elements without purpose
- Add slide numbers, footers, or logos
Best For
Technology explainers, science communication, research summaries, policy briefings, investigative content, educational deep-dives, thought leadership pieces
fantasy-animation
Whimsical hand-drawn animation style inspired by classic fantasy illustration
Design Aesthetic
Charming hand-drawn animation aesthetic reminiscent of classic Disney, Studio Ghibli, or European storybook illustration. Soft, painterly textures with warm, inviting colors. Friendly characters, magical elements, and storybook layouts. Enchanting, nostalgic, and emotionally engaging.
Background
- Color: Soft Sky Blue (#E8F4FC) or Warm Cream (#FFF8E7)
- Texture: Subtle watercolor wash, soft brush strokes, gentle paper texture
Typography
Primary Font (Headlines)
Whimsical serif or decorative hand-lettered style. Slight curvature and organic feel. Warm, friendly character. Think fairy tale book titles.
Secondary Font (Body)
Rounded sans-serif or casual handwritten style. Friendly and readable. Maintains storybook aesthetic while staying legible.
Color Palette
| Role | Color | Hex | Usage |
|---|---|---|---|
| Background | Soft Sky Blue | #E8F4FC | Primary background |
| Alt Background | Warm Cream | #FFF8E7 | Secondary areas |
| Primary Text | Deep Forest | #2D5A3D | Headlines |
| Body Text | Warm Brown | #5D4E37 | Body content |
| Accent 1 | Golden Yellow | #F4D03F | Magic, highlights |
| Accent 2 | Rose Pink | #E8A0BF | Warmth, charm |
| Accent 3 | Sage Green | #87A96B | Nature elements |
| Accent 4 | Sky Blue | #7EC8E3 | Air, water, dreams |
| Accent 5 | Coral | #F08080 | Emphasis, life |
Visual Elements
- Central illustrated character (friendly, expressive)
- Small companion creatures (animals, magical beings)
- Storybook-style environment backgrounds
- Magical floating objects (books, bags, boxes, orbs)
- Decorative elements: stars, sparkles, flowers, leaves
- Soft shadows and gentle highlights
- Layered depth with foreground/background elements
- Themed content containers (trunks, satchels, scroll boxes)
Style Rules
Do
- Create warm, inviting compositions
- Use soft edges and painterly textures
- Include charming character illustrations
- Add magical decorative touches
- Maintain storybook narrative feel
Don't
- Use harsh geometric shapes
- Create dark or intimidating imagery
- Add photorealistic elements
- Use cold color palettes
- Add slide numbers, footers, or logos
Best For
Educational content, children's presentations, storytelling, creative workshops, book presentations, fantasy/gaming content, inspirational talks, family-friendly events
intuition-machine
Technical briefing infographic style with aged paper texture and bilingual explanatory text boxes
Design Aesthetic
Academic/technical briefing presentation style, NOT artistic 3D renders. Clean 2D or isometric technical illustrations with multiple explanatory text boxes containing article content. Split layouts with visuals on left/center and text on right/bottom. Information-dense but organized with clear visual hierarchy. Vintage blueprint aesthetic with modern clarity.
Background
- Color: Aged Cream (#F5F0E6)
- Texture: Subtle paper texture with light creases, warm nostalgic feel reminiscent of vintage technical prints
Typography
Primary Font (Headlines)
Bold display font in dark maroon, ALL CAPS in brackets for main titles. English subtitle below in smaller size. Technical, authoritative presence with vintage character.
Secondary Font (Labels)
Clean sans-serif for bilingual callout labels. Format: "ENGLISH TERM 中文翻译". High contrast against background.
Body Font
Clean geometric sans-serif for text box content. Readable at smaller sizes. Consistent weight throughout.
Color Palette
| Role | Color | Hex | Usage |
|---|---|---|---|
| Background | Aged Cream | #F5F0E6 | Primary background |
| Paper Texture | Warm White | #F5F0E1 | Blueprint paper effect |
| Primary Text | Dark Maroon | #5D3A3A | Headlines, titles |
| Body Text | Near Black | #1A1A1A | Text box content |
| Accent 1 | Teal | #2F7373 | Primary illustrations |
| Accent 2 | Warm Brown | #8B7355 | Secondary elements |
| Accent 3 | Maroon | #722F37 | Titles, emphasis |
| Outline | Deep Charcoal | #2D2D2D | Element outlines |
Visual Elements
- Isometric 3D technical illustrations OR flat 2D diagrams (choose based on concept)
- 3-5 explanatory text boxes per slide with labeled content
- Bilingual callout labels pointing to key parts
- Faded thematic background patterns (circuits, gears, flowcharts related to topic)
- Clean black outlines on all elements
- Split or triptych layouts
- "KEY QUOTE:" box at bottom with core insight
- No title blocks, stamps, or watermarks in corners
Style Rules
Do
- Include 3-5 text boxes with substantive content from source material
- Use bilingual labels (English + Chinese) for key elements
- Add faded thematic background patterns related to the topic
- Maintain aged paper texture throughout
- Create clear visual hierarchy with split layouts
Don't
- Create photorealistic renders or artistic 3D scenes
- Leave slides without explanatory text content
- Add title blocks or stamps in corners
- Use gradients or glossy effects
- Add slide numbers, footers, or logos
Best For
Technical explanations, concept breakdowns, academic presentations, knowledge documentation, research summaries, educational content with depth, bilingual audiences
minimal
Ultra-clean keynote style with maximum whitespace and zen-like simplicity
Design Aesthetic
Maximum whitespace with minimal elements. Zen-like simplicity where every element earns its place. Premium, refined aesthetic suitable for executive audiences. Less is more - remove until nothing more can be taken away.
Background
- Color: Pure White (#FFFFFF)
- Texture: None - absolute clean, no grain or patterns
Typography
Primary Font (Headlines)
Clean geometric sans-serif like SF Pro Display, Inter, or Helvetica Neue. Light to medium weight for elegant restraint. Generous letter-spacing. Large scale for impact without boldness.
Secondary Font (Body)
Same family as headlines in lighter weight. Minimal size contrast. Clean, airy feeling throughout.
Color Palette
| Role | Color | Hex | Usage |
|---|---|---|---|
| Background | Pure White | #FFFFFF | Primary background |
| Primary Text | Near Black | #1A1A1A | Headlines, body |
| Secondary Text | Medium Gray | #6B7280 | Captions, metadata |
| Accent | Single Brand Color | #2563EB | One accent only, sparingly |
| Dividers | Light Gray | #E5E7EB | Subtle separators |
Visual Elements
- Single accent color used sparingly
- Thin hairline rules for separation
- Generous margins (minimum 15% on all sides)
- Center or left-aligned layouts
- Simple geometric shapes only when necessary
- No decorative elements
- Data visualizations in single color or grayscale
Style Rules
Do
- Embrace empty space as a design element
- Use single accent color only
- Keep text minimal (10 words or less per slide)
- Create breathing room between elements
- Use scale to create hierarchy
Don't
- Fill empty space with decoration
- Use multiple accent colors
- Add icons or illustrations unless essential
- Create dense information layouts
- Add slide numbers, footers, or logos
Best For
Executive briefings, keynote presentations, premium brand communications, minimalist products, investor meetings, high-level strategy
notion
SaaS dashboard aesthetic with clean data focus and productivity tool styling
Design Aesthetic
Clean, functional SaaS interface aesthetic. Dashboard-inspired layouts with clear data hierarchy. Notion, Linear, and modern productivity tool styling. Information-dense but organized. Professional and trustworthy.
Background
- Color: Light Gray (#F7F7F5) or Pure White (#FFFFFF)
- Texture: None - clean solid backgrounds
Typography
Primary Font (Headlines)
System UI stack or Inter. Semi-bold weight for emphasis. Clean, functional letterforms. Slightly tighter letter-spacing.
Secondary Font (Body)
Same family in regular weight. Optimized for screen reading. Comfortable line height (1.5-1.6).
Color Palette
| Role | Color | Hex | Usage |
|---|---|---|---|
| Background | Light Gray | #F7F7F5 | Primary background |
| Card Background | Pure White | #FFFFFF | Content cards |
| Primary Text | Near Black | #1F1F1F | Headlines, body |
| Secondary Text | Gray | #6B6B6B | Metadata, labels |
| Border | Light Border | #E5E5E5 | Card borders, dividers |
| Accent Blue | Notion Blue | #2383E2 | Links, primary actions |
| Accent Green | Success | #0F7B6C | Positive metrics |
| Accent Red | Alert | #E03E3E | Negative metrics |
| Accent Yellow | Warning | #DFAB01 | Cautions |
Visual Elements
- Card-based layouts with subtle borders or shadows
- Clean data tables and charts
- Progress bars and metric displays
- Icon-based navigation hints
- Checkbox and toggle styling
- Tag and label chips
- Subtle hover state styling
- Breadcrumb and hierarchy indicators
Style Rules
Do
- Use card-based content organization
- Create clear data hierarchy
- Use subtle shadows and borders
- Keep layouts grid-aligned
- Present metrics prominently
Don't
- Use decorative illustrations
- Add gradients or complex backgrounds
- Create artistic layouts
- Use rounded blob shapes
- Add slide numbers, footers, or logos
Best For
Product demos, SaaS presentations, productivity tool pitches, metrics dashboards, feature walkthroughs, B2B presentations, technical product marketing
pixel-art
Retro 8-bit pixel art aesthetic with nostalgic gaming visual style
Design Aesthetic
Pixelated retro aesthetic reminiscent of classic 8-bit and 16-bit era games. Chunky pixels, limited color palettes, and nostalgic gaming references. Simple geometric shapes rendered in blocky pixel form. Fun, playful, and immediately recognizable retro tech aesthetic.
Background
- Color: Light Blue (#87CEEB) or Soft Lavender (#E6E6FA)
- Texture: Subtle pixel grid pattern, CRT scanline effect optional
Typography
Primary Font (Headlines)
Pixelated bitmap font style. Chunky, blocky letterforms with visible pixel structure. All caps for maximum readability. Render as actual pixel art, not smooth vectors.
Secondary Font (Body)
Smaller pixel font with consistent 8x8 or 16x16 character grid. High contrast against background. Limited anti-aliasing to maintain retro feel.
Color Palette
| Role | Color | Hex | Usage |
|---|---|---|---|
| Background | Light Blue | #87CEEB | Primary background |
| Alt Background | Soft Lavender | #E6E6FA | Secondary backgrounds |
| Primary Text | Dark Navy | #1A1A2E | Headlines, body text |
| Accent 1 | Pixel Green | #00FF00 | Success, highlights |
| Accent 2 | Pixel Red | #FF0000 | Alerts, emphasis |
| Accent 3 | Pixel Yellow | #FFFF00 | Warnings, energy |
| Accent 4 | Pixel Cyan | #00FFFF | Info, tech elements |
| Accent 5 | Pixel Magenta | #FF00FF | Special elements |
Visual Elements
- All elements rendered with visible pixel structure
- Simple iconography: notepad, checkboxes, gears, rockets, play buttons
- Text bubbles and speech boxes with pixel borders
- 8-bit style decorative elements: stars, hearts, arrows
- Progress bars with chunky pixel segments
- Dithering patterns for gradients and shadows
- Limited to 16-32 color palette per slide
Style Rules
Do
- Maintain consistent pixel grid throughout
- Use limited color palette (16-32 colors max)
- Create blocky, geometric shapes
- Add nostalgic gaming references where appropriate
- Use dithering for color transitions
Don't
- Use smooth gradients or anti-aliasing
- Create photorealistic elements
- Use thin lines or fine details
- Add modern glossy effects
- Add slide numbers, footers, or logos
Best For
Gaming presentations, tech tutorials, nostalgic content, developer talks, retro-themed events, educational content for younger audiences, creative tech presentations
scientific
Educational scientific illustration style for pathways, processes, and technical diagrams
Design Aesthetic
Academic scientific illustration aesthetic for biological pathways, chemical processes, and technical systems. Clean, precise diagrams with proper labeling and clear visual flow. Educational clarity with professional polish. Think textbook quality illustrations and academic journal figures.
Background
- Color: Off-White (#FAFAFA) or Light Blue-Gray (#F0F4F8)
- Texture: None or very subtle paper grain for print feel
Typography
Primary Font (Headlines)
Clean serif font (Times New Roman style) for formal academic feel. Bold weight for main titles. Professional, authoritative presence.
Secondary Font (Labels)
Sans-serif for diagram labels and annotations. Clear, readable at small sizes. Consistent sizing for hierarchy.
Body Font
Serif for body paragraphs, sans-serif for bullet points and lists. Academic publication styling.
Color Palette
| Role | Color | Hex | Usage |
|---|---|---|---|
| Background | Off-White | #FAFAFA | Primary background |
| Primary Text | Dark Slate | #1E293B | Headlines, body |
| Label Text | Medium Gray | #475569 | Annotations |
| Pathway 1 | Teal | #0D9488 | Primary pathway |
| Pathway 2 | Blue | #3B82F6 | Secondary pathway |
| Pathway 3 | Purple | #8B5CF6 | Tertiary pathway |
| Membrane | Amber | #F59E0B | Biological membranes |
| Alert | Red | #EF4444 | Key molecules, emphasis |
| Positive | Green | #22C55E | Products, outputs |
Visual Elements
- Horizontal membrane or structure bases
- Labeled modular components with distinct colors
- Flow arrows (electron, proton, molecule movement)
- Chemical formulas and molecular notation
- Cross-section and pathway diagrams
- Numbered step sequences
- Key molecule callouts
- Process summary boxes
Style Rules
Do
- Use precise, consistent line weights
- Label all components clearly
- Show directional flow with arrows
- Include chemical/molecular notation where relevant
- Create clear numbered sequences
Don't
- Use decorative illustrations
- Create imprecise or artistic diagrams
- Omit important labels
- Use inconsistent visual language
- Add slide numbers, footers, or logos
Best For
Biology lectures, chemistry presentations, medical education, research presentations, academic papers, scientific conferences, textbook illustrations, process documentation
sketch-notes
Soft hand-drawn illustration style with fresh, refined minimalist editorial aesthetic
Design Aesthetic
Illustration or hand-drawn feel with soft, relaxed brush strokes. Fresh, refined overall style with minimalist editorial approach. Emphasis on precision, clarity and intelligent elegance while prioritizing warmth, approachability and friendliness.
Background
- Color: Warm Off-White (#FAF8F0)
- Texture: Subtle paper grain, slightly warm tone to avoid clinical feel
Typography
Primary Font (Headlines)
Bold hand-written marker font or cartoon poster font. Slightly uneven baseline for organic feel. Thick strokes with soft edges. Render as hand-drawn letters, not typed text.
Secondary Font (Body)
Clear handwritten round or hard-pen style mimicking everyday notes. Consistent sizing with slight natural variation. Render as casual handwriting, legible but not mechanical.
Color Palette
| Role | Color | Hex | Usage |
|---|---|---|---|
| Background | Warm Off-White | #FAF8F0 | Primary background |
| Primary Text | Deep Charcoal | #2C3E50 | Headlines, body text |
| Alt Text | Deep Brown | #4A4A4A | Secondary text elements |
| Accent 1 | Soft Orange | #F4A261 | Highlights, emphasis |
| Accent 2 | Mustard Yellow | #E9C46A | Secondary highlights |
| Accent 3 | Sage Green | #87A96B | Nature, growth concepts |
| Accent 4 | Light Blue | #7EC8E3 | Tech, AI elements |
| Accent 5 | Red Brown | #A0522D | Land, infrastructure |
Visual Elements
- Connection lines with hand-drawn wavy feel, not perfectly straight
- Conceptual abstract icons illustrating ideas rather than literal scenes
- Color fills don't need to completely fill outlines - preserve hand-painted casual feel
- Simple geometric shapes with rounded corners
- Arrows and pointers with sketchy, informal style
- Doodle-style decorative elements: stars, spirals, underlines
Style Rules
Do
- Keep layouts open and well-structured
- Emphasize information hierarchy and readability
- Use hand-drawn quality for all elements
- Allow imperfection - slight wobbles add character
- Layer elements with subtle overlaps
Don't
- Use perfect geometric shapes
- Create photorealistic elements
- Overcrowd with too many elements
- Use pure white backgrounds
- Add slide numbers, footers, or logos
Best For
Educational content, knowledge sharing, technical explanations, friendly presentations, tutorials, onboarding materials
vector-illustration
Flat vector illustration style with clear black outlines and retro soft color palette
Design Aesthetic
Flat vector illustration with no gradients or 3D effects. Clear, uniform-thickness black outlines on all elements. Geometric simplification reducing complex objects to basic shapes. Toy model aesthetic that's cute, playful, and approachable. Panoramic horizontal compositions work well.
Background
- Color: Cream Off-White (#F5F0E6)
- Texture: Subtle paper texture, warm nostalgic feel reminiscent of vintage prints
Typography
Primary Font (Headlines)
Large, bold retro serif for titles conveying authority and elegance. Think classic advertising posters. Clean letterforms with strong presence.
Secondary Font (Subtitles)
All-caps sans-serif inside colored rectangular blocks. Label-like appearance. High contrast against block color.
Body Font
Clean geometric sans-serif for readability. Futura, Avenir, or similar. Consistent weight throughout.
Color Palette
| Role | Color | Hex | Usage |
|---|---|---|---|
| Background | Cream Off-White | #F5F0E6 | Primary background |
| Outlines | Deep Charcoal | #2D2D2D | All element outlines |
| Primary Text | Black | #1A1A1A | Headlines, body |
| Accent 1 | Coral Red | #E07A5F | Primary accent, warmth |
| Accent 2 | Mint Green | #81B29A | Secondary accent, nature |
| Accent 3 | Mustard Yellow | #F2CC8F | Highlights, energy |
| Accent 4 | Burnt Orange | #D4764A | Tertiary accent |
| Accent 5 | Rock Blue | #577590 | Cool balance, tech |
Visual Elements
- All objects have closed black outlines (coloring book style)
- Rounded line endings, avoid sharp corners
- Trees simplified to lollipop or triangle shapes
- Buildings simplified to rectangular blocks with grid windows
- 2.5D perspective (isometric-like but more free-form)
- Depth through layering and overlap, not atmospheric perspective
- Decorative geometric elements: radiating lines (sunbursts), pill-shaped clouds, dots, stars
- People as simple geometric figures with minimal facial detail
Style Rules
Do
- Maintain consistent outline thickness throughout
- Use soft, vintage color palette
- Simplify all objects to basic geometric shapes
- Create depth through layering
- Add playful decorative elements
Don't
- Use gradients or realistic shading
- Create photorealistic elements
- Use thin or varying line weights
- Include complex detailed illustrations
- Add slide numbers, footers, or logos
Best For
Educational presentations, creative proposals, children's content, brand showcases, warm approachable topics, explainer content
vintage
Vintage aged-paper aesthetic for historical and expedition-style presentations
Design Aesthetic
Nostalgic vintage aesthetic with aged paper textures and historical document styling. Think explorer's journals, antique maps, and museum exhibits. Rich warm tones with weathered textures. Evokes discovery, heritage, and timeless knowledge.
Background
- Color: Aged Parchment (#F5E6D3) or Sepia Cream (#FFF8DC)
- Texture: Heavy aged paper texture with subtle creases, coffee stains, and worn edges
Typography
Primary Font (Headlines)
Classic serif with historical character (Garamond, Baskerville, or similar). Elegant, authoritative, timeless. May include decorative flourishes.
Secondary Font (Labels)
Condensed serif or clean sans-serif for map labels and annotations. Period-appropriate styling. Consistent with vintage aesthetic.
Body Font
Readable serif for longer text. Traditional book typography. Comfortable reading experience.
Color Palette
| Role | Color | Hex | Usage |
|---|---|---|---|
| Background | Aged Parchment | #F5E6D3 | Primary background |
| Alt Background | Sepia Cream | #FFF8DC | Secondary areas |
| Primary Text | Dark Brown | #3D2914 | Headlines, body |
| Secondary Text | Medium Brown | #6B4423 | Annotations |
| Accent 1 | Forest Green | #2D5A3D | Maps, nature |
| Accent 2 | Navy Blue | #1E3A5F | Ocean, lines |
| Accent 3 | Burgundy | #722F37 | Emphasis, borders |
| Accent 4 | Gold | #C9A227 | Highlights, compass |
| Ink | Sepia Black | #3D3D3D | Fine details |
Visual Elements
- Antique maps with route lines and landmarks
- Compass roses and nautical elements
- Expedition ship or vehicle illustrations
- Specimen drawings (flora, fauna, fossils)
- Handwritten-style annotations
- Rope, leather, and brass decorative motifs
- Wave and terrain texture patterns
- Vintage photograph-style image frames
Style Rules
Do
- Apply consistent aged texture throughout
- Use period-appropriate visual language
- Include map and journey elements where relevant
- Create layered collage compositions
- Maintain warm sepia-toned palette
Don't
- Use modern digital styling
- Create crisp clean edges
- Use cold or bright colors
- Add contemporary elements
- Add slide numbers, footers, or logos
Best For
Historical presentations, travel and exploration content, museum exhibits, heritage brand storytelling, biography presentations, scientific discovery narratives, educational history content
watercolor
Soft watercolor illustration style with hand-painted textures and natural warmth
Design Aesthetic
Gentle watercolor aesthetic with visible brush strokes and natural color bleeding. Hand-painted feel with soft edges and organic shapes. Warm, approachable, and artistically refined. Combines artistic expression with clear information delivery.
Background
- Color: Warm Off-White (#FAF8F0) or Soft Cream (#FFF9E6)
- Texture: Subtle watercolor paper texture with visible grain
Typography
Primary Font (Headlines)
Elegant handwritten or brush script for titles. Organic letterforms with natural variation. Warm, personal feeling. May appear as actual hand-painted lettering.
Secondary Font (Body)
Clean rounded sans-serif or casual handwriting style. Readable at smaller sizes. Maintains artistic cohesion while staying functional.
Color Palette
| Role | Color | Hex | Usage |
|---|---|---|---|
| Background | Warm Off-White | #FAF8F0 | Primary background |
| Primary Text | Warm Charcoal | #3D3D3D | Headlines, body |
| Accent 1 | Soft Coral | #F4A261 | Primary warmth |
| Accent 2 | Dusty Rose | #E8A0A0 | Secondary warmth |
| Accent 3 | Sage Green | #87A96B | Nature, growth |
| Accent 4 | Sky Blue | #7EC8E3 | Water, calm |
| Accent 5 | Soft Lavender | #C5B4E3 | Accent, creativity |
| Wash | Pale Yellow | #FFF3C4 | Background washes |
Visual Elements
- Watercolor washes as section backgrounds
- Illustrated icons with visible brush strokes
- Natural elements: leaves, bubbles, flowers
- Color bleeds and soft edges on all elements
- Hand-drawn arrows and connection lines
- Labeled diagrams with watercolor fills
- Small expressive character illustrations
- Decorative nature accents scattered thoughtfully
Style Rules
Do
- Allow color to bleed beyond sharp edges
- Use visible brush stroke textures
- Create soft, organic shapes
- Include hand-drawn quality in all elements
- Maintain warm, inviting color palette
Don't
- Use sharp geometric shapes
- Create hard edges or digital precision
- Use cold or stark colors
- Add photographic elements
- Add slide numbers, footers, or logos
Best For
Lifestyle content, wellness presentations, travel guides, food and cooking content, personal stories, creative workshops, artistic portfolios, warm educational content
/**
* apply-template.ts
* Apply the academic-paper figure container template to an extracted figure.
*
* Usage:
* npx -y bun apply-template.ts --figure figure.png --title "Title" --caption "Figure 1: Caption" --output slide.png
*
* Options:
* --figure Path to extracted figure image (required)
* --title Slide title/headline (required)
* --caption Figure caption, e.g., "Figure 1: Description" (required)
* --output Output slide PNG file path (required)
* --width Output width, default 1920 (optional)
* --height Output height, default 1080 (optional)
*/
import { existsSync, writeFileSync, mkdirSync } from "fs";
import { dirname, resolve } from "path";
import { createCanvas, loadImage, CanvasRenderingContext2D } from "canvas";
// Color palette from academic-paper style
const COLORS = {
background: "#FFFFFF",
titleText: "#1E3A5F",
captionText: "#6B7280",
border: "#E5E7EB",
shadow: "rgba(0, 0, 0, 0.1)",
};
// Layout constants
const LAYOUT = {
titleY: 80,
titleFontSize: 48,
captionFontSize: 24,
figureMaxWidthRatio: 0.85,
figureMaxHeightRatio: 0.65,
padding: 20,
borderRadius: 8,
marginBottom: 80,
};
interface Args {
figure: string;
title: string;
caption: string;
output: string;
width: number;
height: number;
}
function parseArgs(): Args {
const args = process.argv.slice(2);
let figure = "";
let title = "";
let caption = "";
let output = "";
let width = 1920;
let height = 1080;
for (let i = 0; i < args.length; i++) {
switch (args[i]) {
case "--figure":
figure = args[++i];
break;
case "--title":
title = args[++i];
break;
case "--caption":
caption = args[++i];
break;
case "--output":
output = args[++i];
break;
case "--width":
width = parseInt(args[++i], 10);
break;
case "--height":
height = parseInt(args[++i], 10);
break;
}
}
if (!figure || !title || !caption || !output) {
console.error("Usage: bun apply-template.ts --figure <image> --title <title> --caption <caption> --output <output.png>");
console.error("\nOptions:");
console.error(" --figure Path to extracted figure image (required)");
console.error(" --title Slide title/headline (required)");
console.error(" --caption Figure caption (required)");
console.error(" --output Output slide PNG file path (required)");
console.error(" --width Output width, default 1920 (optional)");
console.error(" --height Output height, default 1080 (optional)");
process.exit(1);
}
return { figure, title, caption, output, width, height };
}
function wrapText(ctx: CanvasRenderingContext2D, text: string, maxWidth: number): string[] {
const words = text.split(" ");
const lines: string[] = [];
let currentLine = "";
for (const word of words) {
const testLine = currentLine ? `${currentLine} ${word}` : word;
const metrics = ctx.measureText(testLine);
if (metrics.width > maxWidth && currentLine) {
lines.push(currentLine);
currentLine = word;
} else {
currentLine = testLine;
}
}
if (currentLine) {
lines.push(currentLine);
}
return lines;
}
function drawRoundedRect(
ctx: CanvasRenderingContext2D,
x: number,
y: number,
width: number,
height: number,
radius: number
) {
ctx.beginPath();
ctx.moveTo(x + radius, y);
ctx.lineTo(x + width - radius, y);
ctx.quadraticCurveTo(x + width, y, x + width, y + radius);
ctx.lineTo(x + width, y + height - radius);
ctx.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);
ctx.lineTo(x + radius, y + height);
ctx.quadraticCurveTo(x, y + height, x, y + height - radius);
ctx.lineTo(x, y + radius);
ctx.quadraticCurveTo(x, y, x + radius, y);
ctx.closePath();
}
async function applyTemplate(args: Args) {
const { figure, title, caption, output, width, height } = args;
// Validate figure exists
const absoluteFigurePath = resolve(figure);
if (!existsSync(absoluteFigurePath)) {
throw new Error(`Figure image not found: ${absoluteFigurePath}`);
}
console.log(`Loading figure: ${absoluteFigurePath}`);
// Load the figure image
const figureImage = await loadImage(absoluteFigurePath);
console.log(`Figure size: ${figureImage.width}x${figureImage.height}`);
// Create output canvas
const canvas = createCanvas(width, height);
const ctx = canvas.getContext("2d");
// Scale factors for different resolutions
const scaleFactor = width / 1920;
const titleFontSize = Math.round(LAYOUT.titleFontSize * scaleFactor);
const captionFontSize = Math.round(LAYOUT.captionFontSize * scaleFactor);
const padding = Math.round(LAYOUT.padding * scaleFactor);
const borderRadius = Math.round(LAYOUT.borderRadius * scaleFactor);
// Fill background
ctx.fillStyle = COLORS.background;
ctx.fillRect(0, 0, width, height);
// Draw title
ctx.fillStyle = COLORS.titleText;
ctx.font = `bold ${titleFontSize}px Arial, Helvetica, sans-serif`;
ctx.textAlign = "center";
ctx.textBaseline = "middle";
const titleMaxWidth = width * 0.9;
const titleLines = wrapText(ctx, title, titleMaxWidth);
const titleLineHeight = titleFontSize * 1.3;
const titleStartY = Math.round(LAYOUT.titleY * scaleFactor);
titleLines.forEach((line, index) => {
ctx.fillText(line, width / 2, titleStartY + index * titleLineHeight);
});
// Calculate figure area
const titleBottomY = titleStartY + titleLines.length * titleLineHeight + padding * 2;
const captionY = height - Math.round(LAYOUT.marginBottom * scaleFactor);
const figureAreaHeight = captionY - titleBottomY - padding * 2;
const maxFigureWidth = width * LAYOUT.figureMaxWidthRatio;
const maxFigureHeight = Math.min(height * LAYOUT.figureMaxHeightRatio, figureAreaHeight);
// Calculate scaled figure dimensions
const figureAspect = figureImage.width / figureImage.height;
let scaledWidth: number;
let scaledHeight: number;
if (figureAspect > maxFigureWidth / maxFigureHeight) {
// Width constrained
scaledWidth = maxFigureWidth;
scaledHeight = scaledWidth / figureAspect;
} else {
// Height constrained
scaledHeight = maxFigureHeight;
scaledWidth = scaledHeight * figureAspect;
}
// Center figure horizontally and vertically in available space
const figureX = (width - scaledWidth) / 2;
const figureY = titleBottomY + (figureAreaHeight - scaledHeight) / 2;
// Draw figure container with shadow and border
const containerX = figureX - padding;
const containerY = figureY - padding;
const containerWidth = scaledWidth + padding * 2;
const containerHeight = scaledHeight + padding * 2;
// Shadow
ctx.save();
ctx.shadowColor = COLORS.shadow;
ctx.shadowBlur = 12 * scaleFactor;
ctx.shadowOffsetX = 0;
ctx.shadowOffsetY = 4 * scaleFactor;
ctx.fillStyle = COLORS.background;
drawRoundedRect(ctx, containerX, containerY, containerWidth, containerHeight, borderRadius);
ctx.fill();
ctx.restore();
// Border
ctx.strokeStyle = COLORS.border;
ctx.lineWidth = 1;
drawRoundedRect(ctx, containerX, containerY, containerWidth, containerHeight, borderRadius);
ctx.stroke();
// Draw figure
ctx.drawImage(figureImage, figureX, figureY, scaledWidth, scaledHeight);
// Draw caption
ctx.fillStyle = COLORS.captionText;
ctx.font = `italic ${captionFontSize}px Arial, Helvetica, sans-serif`;
ctx.textAlign = "center";
ctx.textBaseline = "middle";
const captionMaxWidth = width * 0.85;
const captionLines = wrapText(ctx, caption, captionMaxWidth);
const captionLineHeight = captionFontSize * 1.4;
captionLines.forEach((line, index) => {
ctx.fillText(line, width / 2, captionY + index * captionLineHeight);
});
// Ensure output directory exists
const outputDir = dirname(output);
if (outputDir && !existsSync(outputDir)) {
mkdirSync(outputDir, { recursive: true });
}
// Save as PNG
const buffer = canvas.toBuffer("image/png");
writeFileSync(output, buffer);
console.log(`\nSaved: ${output}`);
console.log(`Size: ${width}x${height}`);
console.log(`File size: ${Math.round(buffer.length / 1024)} KB`);
}
async function main() {
const args = parseArgs();
try {
await applyTemplate(args);
console.log("\nTemplate applied successfully!");
} catch (error) {
console.error("\nError:", error instanceof Error ? error.message : error);
process.exit(1);
}
}
main();
/**
* detect-figures.ts
* Automatically detect figures and tables from academic PDF papers.
*
* Usage:
* npx -y bun detect-figures.ts --pdf paper.pdf --output figures.json
*
* Options:
* --pdf Path to source PDF file (required)
* --output Output JSON file path (optional, prints to stdout if omitted)
*
* Output JSON format:
* {
* "figures": [
* { "type": "figure", "number": "1", "page": 2, "caption": "...", "label": "Figure 1" },
* { "type": "table", "number": "I", "page": 5, "caption": "...", "label": "Table I" }
* ],
* "totalPages": 10
* }
*/
import { existsSync, writeFileSync } from "fs";
import { resolve } from "path";
// Use legacy build for Node.js compatibility
import * as pdfjsLib from "pdfjs-dist/legacy/build/pdf.mjs";
interface FigureInfo {
type: "figure" | "table";
number: string;
page: number;
caption: string;
label: string;
}
interface DetectionResult {
figures: FigureInfo[];
totalPages: number;
pdfPath: string;
}
interface Args {
pdf: string;
output: string | null;
}
function parseArgs(): Args {
const args = process.argv.slice(2);
let pdf = "";
let output: string | null = null;
for (let i = 0; i < args.length; i++) {
switch (args[i]) {
case "--pdf":
pdf = args[++i];
break;
case "--output":
output = args[++i];
break;
}
}
if (!pdf) {
console.error("Usage: bun detect-figures.ts --pdf <pdf-path> [--output <output.json>]");
console.error("\nOptions:");
console.error(" --pdf Path to source PDF file (required)");
console.error(" --output Output JSON file path (optional)");
process.exit(1);
}
return { pdf, output };
}
/**
* Extract text content from a PDF page
*/
async function getPageText(page: any): Promise<string> {
const textContent = await page.getTextContent();
const items = textContent.items as any[];
// Sort by y position (top to bottom), then x position (left to right)
items.sort((a, b) => {
const yDiff = b.transform[5] - a.transform[5]; // y is inverted in PDF
if (Math.abs(yDiff) > 5) return yDiff;
return a.transform[4] - b.transform[4];
});
// Group items by line (similar y position)
const lines: string[][] = [];
let currentLine: string[] = [];
let lastY = items[0]?.transform[5] ?? 0;
for (const item of items) {
const y = item.transform[5];
if (Math.abs(y - lastY) > 8) {
if (currentLine.length > 0) {
lines.push(currentLine);
}
currentLine = [];
lastY = y;
}
if (item.str.trim()) {
currentLine.push(item.str);
}
}
if (currentLine.length > 0) {
lines.push(currentLine);
}
return lines.map(line => line.join(" ")).join("\n");
}
/**
* Parse figure and table references from text
*/
function parseFiguresFromText(text: string, pageNum: number): FigureInfo[] {
const figures: FigureInfo[] = [];
// Patterns for figure captions
// Match: "Fig. 1.", "Figure 1:", "Fig. 1 ", "FIGURE 1."
const figurePatterns = [
/(?:^|\n)\s*(?:Fig(?:ure|\.)?)\s*(\d+)[.:\s]+([^\n]+(?:\n(?![A-Z]{2,}|\d+\.|Fig|Table)[^\n]+)*)/gi,
/(?:^|\n)\s*FIGURE\s+(\d+)[.:\s]+([^\n]+(?:\n(?![A-Z]{2,}|\d+\.|Fig|Table)[^\n]+)*)/g,
];
// Patterns for table captions
// Match: "Table I", "TABLE 1", "Table 1:"
const tablePatterns = [
/(?:^|\n)\s*(?:Table|TABLE)\s+([IVX\d]+)[.:\s]+([^\n]+(?:\n(?![A-Z]{2,}|\d+\.|Fig|Table)[^\n]+)*)/gi,
];
// Extract figures
for (const pattern of figurePatterns) {
let match;
while ((match = pattern.exec(text)) !== null) {
const number = match[1];
const caption = match[2].trim().replace(/\s+/g, " ").substring(0, 300);
const label = `Figure ${number}`;
// Avoid duplicates
if (!figures.some(f => f.label === label)) {
figures.push({
type: "figure",
number,
page: pageNum,
caption,
label,
});
}
}
}
// Extract tables
for (const pattern of tablePatterns) {
let match;
while ((match = pattern.exec(text)) !== null) {
const number = match[1];
const caption = match[2].trim().replace(/\s+/g, " ").substring(0, 300);
const label = `Table ${number}`;
// Avoid duplicates
if (!figures.some(f => f.label === label)) {
figures.push({
type: "table",
number,
page: pageNum,
caption,
label,
});
}
}
}
return figures;
}
/**
* Detect all figures and tables in a PDF
*/
async function detectFigures(pdfPath: string): Promise<DetectionResult> {
const absolutePath = resolve(pdfPath);
if (!existsSync(absolutePath)) {
throw new Error(`PDF file not found: ${absolutePath}`);
}
console.error(`Loading PDF: ${absolutePath}`);
const loadingTask = pdfjsLib.getDocument({
url: absolutePath,
useSystemFonts: true,
standardFontDataUrl: "node_modules/pdfjs-dist/standard_fonts/",
});
const pdfDoc = await loadingTask.promise;
const totalPages = pdfDoc.numPages;
console.error(`PDF loaded: ${totalPages} pages`);
console.error("Scanning for figures and tables...\n");
const allFigures: FigureInfo[] = [];
const seenLabels = new Set<string>();
for (let pageNum = 1; pageNum <= totalPages; pageNum++) {
const page = await pdfDoc.getPage(pageNum);
const text = await getPageText(page);
const pageFigures = parseFiguresFromText(text, pageNum);
for (const fig of pageFigures) {
// Only add if not already seen (captions may span pages)
if (!seenLabels.has(fig.label)) {
seenLabels.add(fig.label);
allFigures.push(fig);
console.error(` Found: ${fig.label} on page ${fig.page}`);
}
}
}
// Sort by type then number
allFigures.sort((a, b) => {
if (a.type !== b.type) {
return a.type === "figure" ? -1 : 1;
}
// Handle Roman numerals for tables
const numA = romanToInt(a.number) || parseInt(a.number, 10) || 0;
const numB = romanToInt(b.number) || parseInt(b.number, 10) || 0;
return numA - numB;
});
console.error(`\nTotal: ${allFigures.length} figures/tables detected`);
return {
figures: allFigures,
totalPages,
pdfPath: absolutePath,
};
}
/**
* Convert Roman numeral to integer
*/
function romanToInt(roman: string): number | null {
const romanMap: { [key: string]: number } = {
I: 1, V: 5, X: 10, L: 50, C: 100, D: 500, M: 1000,
};
const upper = roman.toUpperCase();
if (!/^[IVXLCDM]+$/.test(upper)) {
return null;
}
let result = 0;
for (let i = 0; i < upper.length; i++) {
const current = romanMap[upper[i]];
const next = romanMap[upper[i + 1]] || 0;
if (current < next) {
result -= current;
} else {
result += current;
}
}
return result;
}
async function main() {
const { pdf, output } = parseArgs();
try {
const result = await detectFigures(pdf);
const json = JSON.stringify(result, null, 2);
if (output) {
writeFileSync(output, json);
console.error(`\nSaved to: ${output}`);
} else {
console.log(json);
}
} catch (error) {
console.error("\nError:", error instanceof Error ? error.message : error);
process.exit(1);
}
}
main();
/**
* extract-figure.ts
* Extract a specific page from a PDF and save as PNG image.
*
* Usage:
* npx -y bun extract-figure.ts --pdf paper.pdf --page 4 --output figure.png
*
* Options:
* --pdf Path to source PDF file (required)
* --page Page number to extract, 1-indexed (required)
* --output Output PNG file path (required)
* --scale Render scale factor, default 2.0 for high quality (optional)
*/
import { existsSync, writeFileSync, mkdirSync } from "fs";
import { dirname, resolve } from "path";
// Use legacy build for Node.js compatibility
import * as pdfjsLib from "pdfjs-dist/legacy/build/pdf.mjs";
import { createCanvas } from "canvas";
interface Args {
pdf: string;
page: number;
output: string;
scale: number;
}
function parseArgs(): Args {
const args = process.argv.slice(2);
let pdf = "";
let page = 0;
let output = "";
let scale = 2.0;
for (let i = 0; i < args.length; i++) {
switch (args[i]) {
case "--pdf":
pdf = args[++i];
break;
case "--page":
page = parseInt(args[++i], 10);
break;
case "--output":
output = args[++i];
break;
case "--scale":
scale = parseFloat(args[++i]);
break;
}
}
if (!pdf || !page || !output) {
console.error("Usage: bun extract-figure.ts --pdf <pdf-path> --page <number> --output <output.png>");
console.error("\nOptions:");
console.error(" --pdf Path to source PDF file (required)");
console.error(" --page Page number to extract, 1-indexed (required)");
console.error(" --output Output PNG file path (required)");
console.error(" --scale Render scale factor, default 2.0 (optional)");
process.exit(1);
}
return { pdf, page, output, scale };
}
async function extractPage(pdfPath: string, pageNum: number, outputPath: string, scale: number) {
// Validate PDF exists
const absolutePdfPath = resolve(pdfPath);
if (!existsSync(absolutePdfPath)) {
throw new Error(`PDF file not found: ${absolutePdfPath}`);
}
console.log(`Loading PDF: ${absolutePdfPath}`);
// Load the PDF document
const loadingTask = pdfjsLib.getDocument({
url: absolutePdfPath,
useSystemFonts: true,
standardFontDataUrl: "node_modules/pdfjs-dist/standard_fonts/",
});
const pdfDoc = await loadingTask.promise;
const totalPages = pdfDoc.numPages;
console.log(`PDF loaded: ${totalPages} pages`);
// Validate page number
if (pageNum < 1 || pageNum > totalPages) {
throw new Error(`Page ${pageNum} out of range (1-${totalPages})`);
}
// Get the page
const page = await pdfDoc.getPage(pageNum);
const viewport = page.getViewport({ scale });
console.log(`Page ${pageNum}: ${Math.round(viewport.width)}x${Math.round(viewport.height)} px (scale: ${scale})`);
// Create canvas
const canvas = createCanvas(viewport.width, viewport.height);
const ctx = canvas.getContext("2d");
// Fill white background
ctx.fillStyle = "#FFFFFF";
ctx.fillRect(0, 0, viewport.width, viewport.height);
// Render page to canvas
const renderContext = {
canvasContext: ctx as any,
viewport: viewport,
};
console.log("Rendering page...");
await page.render(renderContext).promise;
// Ensure output directory exists
const outputDir = dirname(outputPath);
if (outputDir && !existsSync(outputDir)) {
mkdirSync(outputDir, { recursive: true });
}
// Save as PNG
const buffer = canvas.toBuffer("image/png");
writeFileSync(outputPath, buffer);
console.log(`\nSaved: ${outputPath}`);
console.log(`Size: ${Math.round(buffer.length / 1024)} KB`);
}
async function main() {
const { pdf, page, output, scale } = parseArgs();
try {
await extractPage(pdf, page, output, scale);
console.log("\nExtraction complete!");
} catch (error) {
console.error("\nError:", error instanceof Error ? error.message : error);
process.exit(1);
}
}
main();
"""
generate-slides.py - Generate slide images using Gemini API
Usage:
python generate-slides.py <slide-deck-dir> [--model MODEL]
Arguments:
slide-deck-dir Directory containing prompts/ folder with slide prompts
Options:
--model MODEL Gemini model to use (default: gemini-3-pro-image-preview)
Environment:
GOOGLE_API_KEY or GEMINI_API_KEY must be set
Example:
python generate-slides.py ./slide-deck/my-presentation --model gemini-3-pro-image-preview
"""
import os
import sys
import time
import argparse
from pathlib import Path
def check_dependencies():
"""Check and install required dependencies."""
try:
from google import genai
from google.genai import types
return genai, types
except ImportError:
print("Installing google-genai package...")
import subprocess
subprocess.check_call([sys.executable, "-m", "pip", "install", "google-genai", "-q"])
from google import genai
from google.genai import types
return genai, types
def generate_slide(client, types, model: str, prompt: str, output_path: Path, max_retries: int = 3) -> bool:
"""Generate a single slide image with retry logic."""
for attempt in range(max_retries):
try:
if attempt > 0:
wait_time = 5 * (attempt + 1)
print(f" Retry {attempt}/{max_retries-1} (waiting {wait_time}s)...")
time.sleep(wait_time)
else:
print(f" Generating image...")
response = client.models.generate_content(
model=model,
contents=prompt,
config=types.GenerateContentConfig(
image_config=types.ImageConfig(
aspect_ratio="16:9",
image_size="4K"
)
)
)
# Extract image from response
if response.candidates:
for part in response.candidates[0].content.parts:
if hasattr(part, 'inline_data') and part.inline_data and part.inline_data.data:
image_data = part.inline_data.data
# Save image (data is already bytes)
output_path.parent.mkdir(parents=True, exist_ok=True)
with open(output_path, "wb") as f:
f.write(image_data)
size_kb = len(image_data) / 1024
print(f" Saved: {output_path.name} ({size_kb:.1f} KB)")
return True
print(f" Warning: No image in response")
except Exception as e:
print(f" Error: {e}")
if attempt == max_retries - 1:
return False
return False
def find_slides_to_generate(prompts_dir: Path, slides_dir: Path) -> list:
"""Find slides that need generation (have prompts but no output or small output)."""
slides = []
for prompt_file in sorted(prompts_dir.glob("*.txt")):
slide_name = prompt_file.stem
output_file = slides_dir / f"{slide_name}.png"
# Skip if output exists and is valid (> 10KB)
if output_file.exists() and output_file.stat().st_size > 10000:
continue
slides.append({
"name": slide_name,
"prompt_file": prompt_file,
"output_file": output_file,
})
return slides
def main():
parser = argparse.ArgumentParser(description="Generate slide images using Gemini API")
parser.add_argument("slide_deck_dir", help="Directory containing prompts/ folder")
parser.add_argument("--model", default="gemini-3-pro-image-preview",
help="Gemini model to use (default: gemini-3-pro-image-preview)")
args = parser.parse_args()
# Check dependencies
genai, types = check_dependencies()
# Initialize paths
deck_dir = Path(args.slide_deck_dir)
prompts_dir = deck_dir / "prompts"
slides_dir = deck_dir / "slides"
if not prompts_dir.exists():
print(f"Error: Prompts directory not found: {prompts_dir}")
sys.exit(1)
# Get API key
api_key = os.environ.get("GOOGLE_API_KEY") or os.environ.get("GEMINI_API_KEY")
if not api_key:
print("Error: GOOGLE_API_KEY or GEMINI_API_KEY environment variable not set")
sys.exit(1)
# Initialize client
client = genai.Client(api_key=api_key)
# Create output directory
slides_dir.mkdir(parents=True, exist_ok=True)
# Find slides to generate
slides = find_slides_to_generate(prompts_dir, slides_dir)
if not slides:
print("All slides already generated. Nothing to do.")
# List existing slides
existing = sorted(slides_dir.glob("*.png"))
print(f"\nExisting slides ({len(existing)}):")
for slide in existing:
size_kb = slide.stat().st_size / 1024
print(f" - {slide.name} ({size_kb:.1f} KB)")
return
print(f"Generating {len(slides)} slides using {args.model}...")
print(f"Output directory: {slides_dir}\n")
success_count = 0
failed_slides = []
for i, slide in enumerate(slides):
print(f"[{i + 1}/{len(slides)}] {slide['name']}")
# Read prompt
prompt = slide["prompt_file"].read_text(encoding="utf-8")
# Generate slide
if generate_slide(client, types, args.model, prompt, slide["output_file"]):
success_count += 1
else:
failed_slides.append(slide["name"])
print(f"\nDone! Generated {success_count}/{len(slides)} slides.")
if failed_slides:
print(f"\nFailed slides ({len(failed_slides)}):")
for name in failed_slides:
print(f" - {name}")
# List all slides in output directory
all_slides = sorted(slides_dir.glob("*.png"))
print(f"\nTotal slides in output: {len(all_slides)}")
for slide in all_slides:
size_kb = slide.stat().st_size / 1024
print(f" - {slide.name} ({size_kb:.1f} KB)")
if __name__ == "__main__":
main()
import { existsSync, readdirSync, readFileSync } from "fs";
import { join, basename } from "path";
import { PDFDocument, rgb } from "pdf-lib";
interface SlideInfo {
filename: string;
path: string;
index: number;
promptPath?: string;
}
function parseArgs(): { dir: string; output?: string } {
const args = process.argv.slice(2);
let dir = "";
let output: string | undefined;
for (let i = 0; i < args.length; i++) {
if (args[i] === "--output" || args[i] === "-o") {
output = args[++i];
} else if (!args[i].startsWith("-")) {
dir = args[i];
}
}
if (!dir) {
console.error("Usage: bun merge-to-pdf.ts <slide-deck-dir> [--output filename.pdf]");
process.exit(1);
}
return { dir, output };
}
function findSlideImages(dir: string): SlideInfo[] {
if (!existsSync(dir)) {
console.error(`Directory not found: ${dir}`);
process.exit(1);
}
const files = readdirSync(dir);
const slidePattern = /^(\d+)-slide-.*\.(png|jpg|jpeg)$/i;
const promptsDir = join(dir, "prompts");
const hasPrompts = existsSync(promptsDir);
const slides: SlideInfo[] = files
.filter((f) => slidePattern.test(f))
.map((f) => {
const match = f.match(slidePattern);
const baseName = f.replace(/\.(png|jpg|jpeg)$/i, "");
const promptPath = hasPrompts ? join(promptsDir, `${baseName}.md`) : undefined;
return {
filename: f,
path: join(dir, f),
index: parseInt(match![1], 10),
promptPath: promptPath && existsSync(promptPath) ? promptPath : undefined,
};
})
.sort((a, b) => a.index - b.index);
if (slides.length === 0) {
console.error(`No slide images found in: ${dir}`);
console.error("Expected format: 01-slide-*.png, 02-slide-*.png, etc.");
process.exit(1);
}
return slides;
}
async function createPdf(slides: SlideInfo[], outputPath: string) {
const pdfDoc = await PDFDocument.create();
pdfDoc.setAuthor("paper-slide-deck");
pdfDoc.setSubject("Generated Slide Deck");
for (const slide of slides) {
const imageData = readFileSync(slide.path);
const ext = slide.filename.toLowerCase();
const image = ext.endsWith(".png")
? await pdfDoc.embedPng(imageData)
: await pdfDoc.embedJpg(imageData);
const { width, height } = image;
const page = pdfDoc.addPage([width, height]);
page.drawImage(image, {
x: 0,
y: 0,
width,
height,
});
console.log(`Added: ${slide.filename}${slide.promptPath ? " (prompt available)" : ""}`);
}
const pdfBytes = await pdfDoc.save();
await Bun.write(outputPath, pdfBytes);
console.log(`\nCreated: ${outputPath}`);
console.log(`Total pages: ${slides.length}`);
}
async function main() {
const { dir, output } = parseArgs();
const slides = findSlideImages(dir);
const dirName = basename(dir) === "slide-deck" ? basename(join(dir, "..")) : basename(dir);
const outputPath = output || join(dir, `${dirName}.pdf`);
console.log(`Found ${slides.length} slides in: ${dir}\n`);
await createPdf(slides, outputPath);
}
main().catch((err) => {
console.error("Error:", err.message);
process.exit(1);
});
{
"dependencies": {
"canvas": "^3.2.1",
"pdf-lib": "^1.17.1",
"pdfjs-dist": "^5.4.530",
"pptxgenjs": "^4.0.1"
}
}
Related skills
FAQ
What input does paper-slide-deck need?
paper-slide-deck accepts a research paper—typically PDF or pasted text—and produces a structured slide deck with section outlines, figure callouts, and citations mapped for lab meetings, conference talks, or stakeholder briefings.
Does paper-slide-deck preserve citations?
paper-slide-deck structures slides from paper sections while preserving citation references and figure placements, so presenters avoid manually rebuilding bibliographies and chart callouts from the original academic source.