只要涉及 .pptx 文件——无论是作为输入、输出还是两者兼有——都应使用本技能。包括:创建幻灯片、路演文稿或演示文稿;读取、解析或从任何 .pptx 文件中提取文本(即使提取的内容将用于其他场合,例如邮件或摘要);编辑、修改或更新现有演示文稿;合并或拆分幻灯片文件;使用模板、版式、演讲者备注或批注。只要用户提到“deck”“slides”“presentation”,或引用了某个 .pptx 文件名,无论其后打算如何处理内容,都应触发本技能。只要需要打开、创建或接触 .pptx 文件,就使用本技能。
| 任务 | 指南 |
|------|-------|
| 读取/分析内容 | python -m markitdown presentation.pptx |
| 基于模板编辑或创建 | 阅读 editing.md |
| 从零创建 | 阅读 pptxgenjs.md |
# Text extraction
python -m markitdown presentation.pptx
# Visual overview
python scripts/thumbnail.py presentation.pptx
# Raw XML
python scripts/office/unpack.py presentation.pptx unpacked/
完整细节请阅读 editing.md。
thumbnail.py 分析模板完整细节请阅读 pptxgenjs.md。
在没有模板或参考演示文稿可用时使用。
不要制作乏味的幻灯片。白底配纯项目符号的页面不会打动任何人。请为每一张幻灯片参考下面清单中的创意。
选择与主题匹配的颜色——不要默认使用千篇一律的蓝色。可将以下配色作为灵感:
| 主题 | 主色 | 辅色 | 强调色 |
|-------|---------|-----------|--------|
| 午夜高管 | 1E2761(藏青) | CADCFC(冰蓝) | FFFFFF(白) |
| 森林苔藓 | 2C5F2D(森林绿) | 97BC62(苔藓绿) | F5F5F5(奶油白) |
| 珊瑚活力 | F96167(珊瑚红) | F9E795(金黄) | 2F3C7E(藏青) |
| 暖调陶土 | B85042(陶土红) | E7E8D1(沙色) | A7BEAE(鼠尾草绿) |
| 海洋渐变 | 065A82(深蓝) | 1C7293(青蓝) | 21295C(午夜蓝) |
| 炭灰极简 | 36454F(炭灰) | F2F2F2(灰白) | 212121(黑) |
| 青色信赖 | 028090(青) | 00A896(海泡绿) | 02C39A(薄荷绿) |
| 浆果奶油 | 6D2E46(浆果紫) | A26769(灰玫瑰) | ECE2D0(奶油色) |
| 鼠尾草静谧 | 84B59F(鼠尾草绿) | 69A297(桉树绿) | 50808E(石板灰) |
| 樱桃大胆 | 990011(樱桃红) | FCF6F5(灰白) | 2F3C7E(藏青) |
每张幻灯片都需要视觉元素——图片、图表、图标或形状。纯文字的幻灯片令人过目即忘。
布局选项:
数据展示:
视觉润色:
选择有特色的字体搭配——不要默认使用 Arial。选一个有个性的标题字体,再搭配一个干净的正文字体。
| 标题字体 | 正文字体 |
|-------------|-----------|
| Georgia | Calibri |
| Arial Black | Arial |
| Calibri | Calibri Light |
| Cambria | Calibri |
| Trebuchet MS | Calibri |
| Impact | Arial |
| Palatino | Garamond |
| Consolas | Calibri |
| 元素 | 字号 |
|---------|------|
| 幻灯片标题 | 36-44pt 加粗 |
| 章节标题 | 20-24pt 加粗 |
| 正文 | 14-16pt |
| 说明文字 | 10-12pt 弱化 |
margin: 0,或将形状偏移以补偿内边距默认一定存在问题。你的任务就是把它们找出来。
第一次渲染几乎不可能是正确的。把 QA 当作一场找错行动,而不是确认步骤。如果第一遍检查没有发现任何问题,说明你检查得还不够仔细。
python -m markitdown output.pptx
检查内容缺失、错别字、顺序错误。
使用模板时,检查是否残留占位文本:
python -m markitdown output.pptx | grep -iE "xxxx|lorem|ipsum|this.*(page|slide).*layout"
如果 grep 有返回结果,先修复再宣布完成。
⚠️ 使用子代理(SUBAGENTS)——哪怕只有 2-3 张幻灯片。你一直盯着代码,看到的会是你预期的内容而非实际内容。子代理拥有全新的视角。
将幻灯片转换为图片(见转换为图片),然后使用以下提示词:
Visually inspect these slides. Assume there are issues — find them.
Look for:
- Overlapping elements (text through shapes, lines through words, stacked elements)
- Text overflow or cut off at edges/box boundaries
- Decorative lines positioned for single-line text but title wrapped to two lines
- Source citations or footers colliding with content above
- Elements too close (< 0.3" gaps) or cards/sections nearly touching
- Uneven gaps (large empty area in one place, cramped in another)
- Insufficient margin from slide edges (< 0.5")
- Columns or similar elements not aligned consistently
- Low-contrast text (e.g., light gray text on cream-colored background)
- Low-contrast icons (e.g., dark icons on dark backgrounds without a contrasting circle)
- Text boxes too narrow causing excessive wrapping
- Leftover placeholder content
For each slide, list issues or areas of concern, even if minor.
Read and analyze these images:
1. /path/to/slide-01.jpg (Expected: [brief description])
2. /path/to/slide-02.jpg (Expected: [brief description])
Report ALL issues found, including minor ones.
在完成至少一轮“修复—验证”循环之前,不要宣布成功。
将演示文稿转换为单张幻灯片图片,以便进行视觉检查:
python scripts/office/soffice.py --headless --convert-to pdf output.pptx
pdftoppm -jpeg -r 150 output.pdf slide
这会生成 slide-01.jpg、slide-02.jpg 等文件。
修复后如需重新渲染特定幻灯片:
pdftoppm -jpeg -r 150 -f N -l N output.pdf slide-fixed
pip install "markitdown[pptx]" - 文本提取pip install Pillow - 缩略图网格npm install -g pptxgenjs - 从零创建soffice)- PDF 转换(通过 scripts/office/soffice.py 为沙箱环境自动配置)pdftoppm)- PDF 转图片
评论区