---
name: create-pptx
description: "Generate professional PowerPoint presentations with bold design and structured layouts."
whenToUse: "User asks to create a presentation, deck, or slides"
---

# Skill: Create PowerPoint Presentation

## Description
Generate professional PowerPoint presentations (.pptx) with bold design, Chinese support, and structured layouts. Use this skill whenever the user asks for a deck, slides, presentation, or PPT.

## When to Use
- User asks to create a presentation, deck, or slides
- User asks to make a PPT/PPTX
- User says "做个PPT" or "帮我做slides"
- Any deliverable that should be in presentation format

## Prerequisites
- Python with `python-pptx` library
- Install if needed: `pip install python-pptx`

## Design Principles (from Anthropic Skills)
- **Don't create boring slides** — plain bullets on white background won't impress
- **Every slide needs a visual element** — image, chart, icon, or shape
- **Pick a bold color palette** specific to the topic
- **Dominance over equality** — one color dominates (60-70%), with 1-2 supporting tones
- **Dark/light contrast** — dark backgrounds for title + conclusion, light for content

## Color Palettes

| Theme | Primary | Secondary | Accent |
|-------|---------|-----------|--------|
| Midnight Executive | `1E2761` | `CADCFC` | `FFFFFF` |
| Ocean Gradient | `065A82` | `1C7293` | `21295C` |
| Coral Energy | `F96167` | `F9E795` | `2F3C7E` |
| Charcoal Minimal | `36454F` | `F2F2F2` | `212121` |
| Teal Trust | `028090` | `00A896` | `02C39A` |

## Typography
| Element | Size |
|---------|------|
| Slide title | 36-44pt bold |
| Section header | 20-24pt bold |
| Body text | 14-16pt |
| Captions | 10-12pt muted |

## Steps

### 1. Basic Setup
```python
from pptx import Presentation
from pptx.util import Inches, Pt, Emu
from pptx.dml.color import RGBColor
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR

prs = Presentation()
prs.slide_width = Inches(13.333)  # 16:9 widescreen
prs.slide_height = Inches(7.5)
```

### 2. Chinese Font Support
```python
from pptx.util import Pt

def set_font(run, name='Microsoft YaHei', size=14, bold=False, color=None):
    run.font.name = name
    run.font.size = Pt(size)
    run.font.bold = bold
    if color:
        run.font.color.rgb = RGBColor(*color)
    # East Asian font fallback
    run.font._element.attrib['{http://schemas.openxmlformats.org/drawingml/2006/main}altLang'] = 'zh-CN'
```

### 3. Add Shaped Backgrounds
```python
from pptx.util import Inches
from pptx.enum.shapes import MSO_SHAPE

def add_bg_rect(slide, left, top, width, height, color):
    shape = slide.shapes.add_shape(
        MSO_SHAPE.RECTANGLE, left, top, width, height
    )
    shape.fill.solid()
    shape.fill.fore_color.rgb = RGBColor(*color)
    shape.line.fill.background()  # No border
    return shape
```

### 4. Slide Layouts
- **Title slide**: Full dark background, centered title + subtitle
- **Section divider**: Half-colored, half-white with large section number
- **Content slide**: Header bar + content area with bullet points or grid
- **Two-column**: Text left, visual right (or vice versa)
- **Data slide**: Large stat callouts (60-72pt numbers) with small labels

### 5. Save & Output
```python
import os
output_path = os.path.join(os.path.expanduser('~'), 'Desktop', 'presentation.pptx')
prs.save(output_path)
```

## Important Notes
- Use `Inches()` or `Emu()` for positioning — never raw numbers
- 0.5" minimum margins
- Leave breathing room — don't fill every inch
- **Avoid text-only slides** — always add at least one visual element
- For complex presentations, consider creating a master template first
