fanzhuo

Create PowerPoint

办公效率v1.0.0
作者:fanzhuo更新于 2026-05-11create-pptx@clawhub_scottliu007/create-pptx
PPT 生成

据 AlphaMoat 统计,截至 2026-09,Create PowerPoint 累计下载 2,574 次、获 0 个星标,在全部 5,078 个 AI 技能中排名第 4,038 位,在「办公效率」分类(435 个)中排名第 302 位。

累计安装
123
累计下载
2,574
星标
-
全站排名
#4,038
全站前 80% · 「办公效率」前 70%
平台累计安装累计下载星标评论
ClawHub ↗692,574--
SkillHub ↗1232,511-—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

主文涵盖幻灯片布局、时间线、图表、形状、文字格式、切换效果和模板资源,并建议在 WPS 场景用多页渐进呈现代替点击动画。模板素材可能要求保留署名页;生成前还应确认演示文稿语言,并在需要可复现结果时固定依赖版本。

资料发布于 2026-10-29

可以用来做什么

  • 规划演示文稿的页面结构和布局
  • 使用 python-pptx 绘制时间线、图表或示意图
  • 检查 WPS 兼容性和模板署名要求

什么时候用

  • 用户要求创建或修改 PPTX,并已提供内容、语言和目标用途时

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

不生成文件,先为一个业务演示文稿规划页面结构和图表类型。
使用模板前列出需要确认的版权署名、语言和依赖版本事项。

月度数据趋势

累计下载2,574
3191,5302,7412026-03 · 累计下载 4862026-05 · 累计下载 1,5102026-06 · 累计下载 1,6922026-07 · 累计下载 2,0982026-08 · 累计下载 2,3792026-09 · 累计下载 2,57426-0326-09
星标-
0112026-03 · 星标 -2026-05 · 星标 -2026-06 · 星标 -2026-07 · 星标 -2026-08 · 星标 -2026-09 · 星标 -26-0326-09

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-092,574—-
2026-082,379+13.4%-
2026-072,098+24.0%-
2026-061,692+12.1%-
2026-051,510—-
2026-03486—-

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

5.1 KB · ClawHub v1.0.0
---
name: create-pptx
description: >
  Create PowerPoint presentations (PPTX) using Python and python-pptx. Handles
  timelines, charts, diagrams, slide layouts, custom colors, shapes, connectors,
  text formatting, and slide transitions. Knows WPS compatibility pitfalls.
  Use when the user asks to: generate a PPT/PPTX file, create a presentation,
  make a slide deck, draw a timeline, visualize data as slides, or export
  something to PowerPoint. Also use when the user says "做成 PPT"、"生成幻灯片"、
  "做个演示文稿"、"做个 pptx".
展开全部(共 142 行)
---

# Create PowerPoint (python-pptx)

## Setup

```bash
pip install python-pptx   # or: uv pip install python-pptx
```

Output scripts to a logical location (e.g., `前端开发/demo/` or project folder),
then run with `python3 <script.py>` and open the result.

## Core helpers

Read and import `scripts/pptx_helpers.py` for ready-made drawing primitives:
background, horizontal/vertical lines, textboxes, ovals, diagonal connectors,
and fade transitions. Copy or `import` as needed.

Key units: **EMU** (English Metric Units). 1 pt = 12700 EMU, 1 cm ≈ 360000 EMU.
Standard 16:9 slide = 12192000 × 6858000 EMU.

## Workflow

1. **Understand the content** — milestones, categories, colors, # slides
2. **Plan layout** — compute X/Y positions in EMU up front; avoid magic numbers
3. **Build shapes** — use helpers or `slide.shapes.add_shape/add_textbox`
4. **Add transitions** — always call `add_fade_transition(slide)` from helpers
5. **Run and open** — `python3 script.py && open output.pptx`

### Multi-slide instead of click animations (WPS-safe default)

WPS does not reliably support click-triggered PowerPoint animations.
**Always use multiple slides** to reveal content progressively:

```
Slide 1 → skeleton / structure only
Slide 2 → skeleton + first data layer
Slide 3 → skeleton + all data layers
```

Add a fade transition (`add_fade_transition`) to each slide for smooth switching.

If the user explicitly asks for animations AND they are using Microsoft PowerPoint
(not WPS), you may attempt XML-based animations — but read `references/wps-compat.md`
first for the XML structure and known pitfalls.

## Common patterns

### Colors & theme

Define all colors as `RGBColor` constants at the top. Dark backgrounds look
premium — use near-black (`0x06, 0x0D, 0x1E`) with bright accents.

### Timeline layout

```python
TL_L, TL_R = 850000, 11950000        # left/right margins (EMU)
TL_W  = TL_R - TL_L
M_STEP = TL_W // 11                   # 12 months → 11 intervals

def month_x(m):                       # 1-based month → EMU x-position
    return TL_L + M_STEP * (m - 1)
```

### Collision resolution

When multiple cards share the same or nearby X position, spread them:

```python
def resolve_collisions(events, card_w, gap):
    events.sort(key=lambda e: e['cx'])
    need = card_w + gap
    for _ in range(120):
        moved = False
        for i in range(len(events) - 1):
            a, b = events[i], events[i+1]
            if b['cx'] - a['cx'] < need:
                push = (need - (b['cx'] - a['cx'])) / 2
                a['cx'] -= push; b['cx'] += push; moved = True
        if not moved:
            break
```

### Shape IDs for animation

`python-pptx` assigns shape IDs automatically. To retrieve them after creation:

```python
shp = slide.shapes.add_shape(...)
shape_id = shp.shape_id        # use this in animation XML
```

For connectors added via raw XML, read back the max existing ID first:

```python
def _max_existing_id(slide):
    return max((int(el.get('id')) for el in slide.element.iter()
                if el.get('id') and el.get('id').isdigit()), default=1)
```

## Template assets

Ready-to-use `.pptx` base files in `assets/`. Use them as the starting
`Presentation()` object to inherit their design/theme:

```python
from pptx import Presentation
prs = Presentation('/Users/scott/.cursor/skills/create-pptx/assets/business-dark.pptx')
```

| File | Style | Source |
|------|-------|--------|
| `assets/business-dark.pptx` | 深色商务 · Pitch Deck 风格 · 60 slides | Slidesgo "Product Vision Pitch Deck" (Attribution required) |
| `assets/education.pptx` | 明亮教育 · 笔记本课程风格 · 多 slides | Slidesgo "Notebook Lesson XL" (Attribution required) |

> **Attribution**: Free Slidesgo templates require keeping the attribution slide.
> When using these files, do NOT delete the last "Credits" slide.

## Reference files

Read the relevant file based on the task:

- **`references/pptx-patterns.md`** — EMU 单位速查、预设形状 ID、连接器 XML、
  过渡 XML、多段落文字框、典型脚本结构
- **`references/charts.md`** — python-pptx 原生图表 API:柱状、折线、饼图、散点、
  多系列、样式设置(当用户需要数据图表时读此文件)
- **`references/standard-slides.md`** — 标准商务幻灯片函数库:标题页、目录页、
  要点页、图文并排、数据页、章节分隔页、结尾页(当用户需要完整 PPT 结构时读此文件)
- **`references/wps-compat.md`** — WPS 动画兼容性踩坑记录(当用户提到 WPS 或
  动画效果异常时读此文件)

「办公效率」分类下的热门技能

数据月份:2026-09 · 下载/星标/安装数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。