document-pptx
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDocument PPTX Skill - Quick Reference
文档PPTX技能 - 快速参考
This skill enables creation and editing of PowerPoint presentations programmatically. Claude should apply these patterns when users need to generate pitch decks, reports, training materials, or automate presentation workflows.
Modern Best Practices (Jan 2026):
- One slide = one takeaway; design the deck around a decision or audience goal.
- Cite numbers (definition + timeframe + source) and keep a single source of truth for charts.
- Accessibility: slide titles, reading order, contrast, and meaningful alt text; follow your org's standard (often WCAG 2.2 AA / EN 301 549).
- Version decks and enforce review loops (avoid "final_final_v7.pptx").
本技能支持通过编程方式创建和编辑PowerPoint演示文稿。当用户需要生成推介演示文稿、报告、培训材料或实现演示文稿工作流自动化时,Claude应遵循这些模式。
2026年1月现代最佳实践:
- 一张幻灯片只传递一个核心信息;围绕决策目标或受众需求设计演示文稿。
- 引用数据时需包含定义、时间范围和来源,并为图表维护单一可信数据源。
- 可访问性:设置幻灯片标题、合理阅读顺序、对比度和有意义的替代文本;遵循组织标准(通常为WCAG 2.2 AA / EN 301 549)。
- 对演示文稿进行版本管理并执行审核流程(避免使用类似"final_final_v7.pptx"的命名)。
Quick Reference
快速参考
| Task | Tool/Library | Language | When to Use |
|---|---|---|---|
| Create PPTX | python-pptx | Python | Presentations, slide decks |
| Create PPTX | PptxGenJS | Node.js | Server-side generation |
| Template-driven | PPTX-Automizer | Node.js | Corporate branding, template injection |
| Templates | python-pptx | Python | Master slides, themes |
| Charts | python-pptx | Python | Data visualizations |
| Extract content | python-pptx | Python | Parse existing decks |
Selection guide
- Prefer PPTX-Automizer when you have a branded .pptx template and need to "inject data into slides".
- Prefer python-pptx in Python-heavy pipelines (reporting, notebooks, ETL).
- Prefer PptxGenJS in Node.js pipelines (server-side generation, web apps).
| 任务 | 工具/库 | 语言 | 使用场景 |
|---|---|---|---|
| 创建PPTX | python-pptx | Python | 演示文稿、幻灯片集 |
| 创建PPTX | PptxGenJS | Node.js | 服务端生成 |
| 模板驱动生成 | PPTX-Automizer | Node.js | 企业品牌化、模板注入 |
| 模板使用 | python-pptx | Python | 母版幻灯片、主题 |
| 图表生成 | python-pptx | Python | 数据可视化 |
| 内容提取 | python-pptx | Python | 解析现有演示文稿 |
工具选择指南
- 当你有品牌化的.pptx模板并需要将数据注入幻灯片时,优先使用PPTX-Automizer。
- 在以Python为主的流水线(报告、笔记本、ETL)中,优先使用python-pptx。
- 在Node.js流水线(服务端生成、Web应用)中,优先使用PptxGenJS。
Core Operations
核心操作
Create Presentation (Python)
创建演示文稿(Python)
python
from pptx import Presentation
prs = Presentation()python
from pptx import Presentation
prs = Presentation()Title slide
Title slide
title_layout = prs.slide_layouts[0] # Title Slide layout
slide = prs.slides.add_slide(title_layout)
title = slide.shapes.title
subtitle = slide.placeholders[1]
title.text = "Q4 2025 Business Review"
subtitle.text = "Presented by Product Team"
title_layout = prs.slide_layouts[0] # Title Slide layout
slide = prs.slides.add_slide(title_layout)
title = slide.shapes.title
subtitle = slide.placeholders[1]
title.text = "Q4 2025 Business Review"
subtitle.text = "Presented by Product Team"
Content slide with bullets
Content slide with bullets
bullet_layout = prs.slide_layouts[1] # Title and Content
slide = prs.slides.add_slide(bullet_layout)
slide.shapes.title.text = "Key Highlights"
body = slide.placeholders[1]
tf = body.text_frame
tf.text = "Revenue grew 25% YoY"
p = tf.add_paragraph()
p.text = "Customer base expanded to 10,000+"
p.level = 0
p = tf.add_paragraph()
p.text = "New enterprise tier launched"
p.level = 1 # Indented bullet
bullet_layout = prs.slide_layouts[1] # Title and Content
slide = prs.slides.add_slide(bullet_layout)
slide.shapes.title.text = "Key Highlights"
body = slide.placeholders[1]
tf = body.text_frame
tf.text = "Revenue grew 25% YoY"
p = tf.add_paragraph()
p.text = "Customer base expanded to 10,000+"
p.level = 0
p = tf.add_paragraph()
p.text = "New enterprise tier launched"
p.level = 1 # Indented bullet
Add speaker notes
Add speaker notes
notes_slide = slide.notes_slide
notes_slide.notes_text_frame.text = "Emphasize the enterprise growth story here."
prs.save('presentation.pptx')
undefinednotes_slide = slide.notes_slide
notes_slide.notes_text_frame.text = "Emphasize the enterprise growth story here."
prs.save('presentation.pptx')
undefinedCreate Presentation (Node.js)
创建演示文稿(Node.js)
typescript
import pptxgen from 'pptxgenjs';
async function main() {
const pptx = new pptxgen();
pptx.author = 'Product Team';
pptx.title = 'Q4 Business Review';
// Title slide
let slide = pptx.addSlide();
slide.addText('Q4 2025 Business Review', {
x: 1, y: 2, w: '80%',
fontSize: 36, bold: true, color: '363636',
align: 'center',
});
slide.addText('Presented by Product Team', {
x: 1, y: 3.5, w: '80%',
fontSize: 18, color: '666666',
align: 'center',
});
// Content slide with bullets
slide = pptx.addSlide();
slide.addText('Key Highlights', {
x: 0.5, y: 0.5, w: '90%',
fontSize: 28, bold: true,
});
slide.addText([
{ text: 'Revenue grew 25% YoY', options: { bullet: true } },
{ text: 'Customer base expanded to 10,000+', options: { bullet: true } },
{ text: 'New enterprise tier launched', options: { bullet: true, indentLevel: 1 } },
], { x: 0.5, y: 1.5, w: '90%', fontSize: 18 });
// Add chart
slide = pptx.addSlide();
slide.addChart(pptx.ChartType.bar, [
{ name: 'Sales', labels: ['Q1', 'Q2', 'Q3', 'Q4'], values: [100, 150, 180, 225] },
], { x: 1, y: 1.5, w: 8, h: 4 });
await pptx.writeFile({ fileName: 'presentation.pptx' });
}
main();typescript
import pptxgen from 'pptxgenjs';
async function main() {
const pptx = new pptxgen();
pptx.author = 'Product Team';
pptx.title = 'Q4 Business Review';
// Title slide
let slide = pptx.addSlide();
slide.addText('Q4 2025 Business Review', {
x: 1, y: 2, w: '80%',
fontSize: 36, bold: true, color: '363636',
align: 'center',
});
slide.addText('Presented by Product Team', {
x: 1, y: 3.5, w: '80%',
fontSize: 18, color: '666666',
align: 'center',
});
// Content slide with bullets
slide = pptx.addSlide();
slide.addText('Key Highlights', {
x: 0.5, y: 0.5, w: '90%',
fontSize: 28, bold: true,
});
slide.addText([
{ text: 'Revenue grew 25% YoY', options: { bullet: true } },
{ text: 'Customer base expanded to 10,000+', options: { bullet: true } },
{ text: 'New enterprise tier launched', options: { bullet: true, indentLevel: 1 } },
], { x: 0.5, y: 1.5, w: '90%', fontSize: 18 });
// Add chart
slide = pptx.addSlide();
slide.addChart(pptx.ChartType.bar, [
{ name: 'Sales', labels: ['Q1', 'Q2', 'Q3', 'Q4'], values: [100, 150, 180, 225] },
], { x: 1, y: 1.5, w: 8, h: 4 });
await pptx.writeFile({ fileName: 'presentation.pptx' });
}
main();Add Charts (Python)
添加图表(Python)
python
from pptx import Presentation
from pptx.util import Inches
from pptx.chart.data import CategoryChartData
from pptx.enum.chart import XL_CHART_TYPE
prs = Presentation()
slide = prs.slides.add_slide(prs.slide_layouts[6]) # Blankpython
from pptx import Presentation
from pptx.util import Inches
from pptx.chart.data import CategoryChartData
from pptx.enum.chart import XL_CHART_TYPE
prs = Presentation()
slide = prs.slides.add_slide(prs.slide_layouts[6]) # BlankChart data
Chart data
chart_data = CategoryChartData()
chart_data.categories = ['Q1', 'Q2', 'Q3', 'Q4']
chart_data.add_series('Revenue', (100, 150, 180, 225))
chart_data.add_series('Expenses', (80, 90, 100, 110))
chart_data = CategoryChartData()
chart_data.categories = ['Q1', 'Q2', 'Q3', 'Q4']
chart_data.add_series('Revenue', (100, 150, 180, 225))
chart_data.add_series('Expenses', (80, 90, 100, 110))
Add chart
Add chart
x, y, cx, cy = Inches(1), Inches(1.5), Inches(8), Inches(5)
chart = slide.shapes.add_chart(
XL_CHART_TYPE.COLUMN_CLUSTERED,
x, y, cx, cy,
chart_data
).chart
chart.has_legend = True
chart.legend.include_in_layout = False
prs.save('charts.pptx')
undefinedx, y, cx, cy = Inches(1), Inches(1.5), Inches(8), Inches(5)
chart = slide.shapes.add_chart(
XL_CHART_TYPE.COLUMN_CLUSTERED,
x, y, cx, cy,
chart_data
).chart
chart.has_legend = True
chart.legend.include_in_layout = False
prs.save('charts.pptx')
undefinedAdd Images and Tables
添加图片和表格
python
from pptx import Presentation
from pptx.util import Inches
prs = Presentation()
slide = prs.slides.add_slide(prs.slide_layouts[6]) # Blankpython
from pptx import Presentation
from pptx.util import Inches
prs = Presentation()
slide = prs.slides.add_slide(prs.slide_layouts[6]) # BlankAdd image
Add image
slide.shapes.add_picture('logo.png', Inches(0.5), Inches(0.5), width=Inches(2))
slide.shapes.add_picture('logo.png', Inches(0.5), Inches(0.5), width=Inches(2))
Add table
Add table
rows, cols = 4, 3
table = slide.shapes.add_table(rows, cols, Inches(1), Inches(2), Inches(8), Inches(3)).table
rows, cols = 4, 3
table = slide.shapes.add_table(rows, cols, Inches(1), Inches(2), Inches(8), Inches(3)).table
Set column headers
Set column headers
table.cell(0, 0).text = 'Product'
table.cell(0, 1).text = 'Sales'
table.cell(0, 2).text = 'Growth'
table.cell(0, 0).text = 'Product'
table.cell(0, 1).text = 'Sales'
table.cell(0, 2).text = 'Growth'
Fill data
Fill data
data = [
('Widget A', '$1.2M', '+25%'),
('Widget B', '$800K', '+15%'),
('Widget C', '$500K', '+40%'),
]
for row_idx, (product, sales, growth) in enumerate(data, 1):
table.cell(row_idx, 0).text = product
table.cell(row_idx, 1).text = sales
table.cell(row_idx, 2).text = growth
prs.save('images_and_tables.pptx')
undefineddata = [
('Widget A', '$1.2M', '+25%'),
('Widget B', '$800K', '+15%'),
('Widget C', '$500K', '+40%'),
]
for row_idx, (product, sales, growth) in enumerate(data, 1):
table.cell(row_idx, 0).text = product
table.cell(row_idx, 1).text = sales
table.cell(row_idx, 2).text = growth
prs.save('images_and_tables.pptx')
undefinedExtract Content
提取内容
python
from pptx import Presentation
prs = Presentation('existing.pptx')
for slide_num, slide in enumerate(prs.slides, 1):
print(f"\n--- Slide {slide_num} ---")
for shape in slide.shapes:
if shape.has_text_frame:
for paragraph in shape.text_frame.paragraphs:
print(paragraph.text)
if shape.has_table:
table = shape.table
for row in table.rows:
row_text = [cell.text for cell in row.cells]
print(row_text)python
from pptx import Presentation
prs = Presentation('existing.pptx')
for slide_num, slide in enumerate(prs.slides, 1):
print(f"\n--- Slide {slide_num} ---")
for shape in slide.shapes:
if shape.has_text_frame:
for paragraph in shape.text_frame.paragraphs:
print(paragraph.text)
if shape.has_table:
table = shape.table
for row in table.rows:
row_text = [cell.text for cell in row.cells]
print(row_text)Slide Layout Reference
幻灯片布局参考
| Layout Index | Name | Use Case |
|---|---|---|
| 0 | Title Slide | Opening, section dividers |
| 1 | Title and Content | Standard bullet slides |
| 2 | Section Header | Section transitions |
| 3 | Two Content | Side-by-side comparison |
| 4 | Comparison | Pros/cons, before/after |
| 5 | Title Only | Custom content placement |
| 6 | Blank | Full creative control |
| 7 | Content with Caption | Image + description |
| 布局索引 | 名称 | 使用场景 |
|---|---|---|
| 0 | 标题幻灯片 | 开场、章节分隔 |
| 1 | 标题与内容 | 标准项目符号幻灯片 |
| 2 | 章节标题 | 章节过渡 |
| 3 | 双内容布局 | 并列对比 |
| 4 | 对比布局 | 优缺点、前后对比 |
| 5 | 仅标题 | 自定义内容布局 |
| 6 | 空白布局 | 完全自定义创作 |
| 7 | 内容加说明 | 图片+描述 |
Presentation Structure Patterns
演示文稿结构模式
Pitch Deck (10 slides)
推介演示文稿(10张幻灯片)
text
PITCH DECK STRUCTURE
1. Title (company, tagline)
2. Problem (pain point)
3. Solution (your product)
4. Market Size (TAM/SAM/SOM)
5. Business Model (how you make money)
6. Traction (metrics, growth)
7. Team (founders, advisors)
8. Competition (landscape)
9. Financials (projections)
10. Ask (funding, next steps)text
PITCH DECK STRUCTURE
1. Title (company, tagline)
2. Problem (pain point)
3. Solution (your product)
4. Market Size (TAM/SAM/SOM)
5. Business Model (how you make money)
6. Traction (metrics, growth)
7. Team (founders, advisors)
8. Competition (landscape)
9. Financials (projections)
10. Ask (funding, next steps)Quarterly Review (8 slides)
季度业务回顾(8张幻灯片)
text
QUARTERLY REVIEW STRUCTURE
1. Title + Agenda
2. Executive Summary (KPIs dashboard)
3. Revenue & Growth
4. Product Updates
5. Customer Highlights
6. Challenges & Learnings
7. Next Quarter Goals
8. Q&Atext
QUARTERLY REVIEW STRUCTURE
1. Title + Agenda
2. Executive Summary (KPIs dashboard)
3. Revenue & Growth
4. Product Updates
5. Customer Highlights
6. Challenges & Learnings
7. Next Quarter Goals
8. Q&ADo / Avoid (Dec 2025)
建议/禁忌(2025年12月)
Do
建议
- Use a slide narrative plan (title + 1-sentence takeaway + supporting visual).
- Put the executive summary up front for decision decks.
- Keep speaker notes aligned with slide takeaways.
- 使用幻灯片叙事规划(标题+1句话核心信息+支持性视觉元素)。
- 针对决策类演示文稿,将执行摘要放在最前面。
- 保持演讲备注与幻灯片核心信息一致。
Avoid
禁忌
- Dense slides with multiple messages.
- Uncited numbers or charts without definitions.
- Pixelated screenshots and unreadable tables.
- 避免一张幻灯片包含多个核心信息。
- 避免引用无来源的数据或无定义的图表。
- 避免使用像素化截图和无法阅读的表格。
What Good Looks Like
优秀演示文稿的标准
- Narrative: each slide has a 1-sentence takeaway and supports a single decision or insight.
- Structure: opening executive summary + clear arc (problem -> insight -> recommendation -> next steps).
- Data hygiene: charts show units, timeframes, sources, and consistent axes.
- Design: consistent typography, spacing, and contrast; no "wall of text" slides.
- Accessibility: reading order set and meaningful alt text where needed.
- 叙事性:每张幻灯片有1句话核心信息,且支撑单一决策或洞察。
- 结构:开场执行摘要+清晰逻辑线(问题→洞察→建议→下一步行动)。
- 数据合规:图表包含单位、时间范围、来源,且坐标轴统一。
- 设计:排版、间距、对比度一致;避免"文字墙"式幻灯片。
- 可访问性:设置合理阅读顺序,必要时添加有意义的替代文本。
Optional: AI / Automation
可选:AI/自动化
Use only when explicitly requested and policy-compliant.
- Draft slide headlines and speaker notes; humans verify accuracy and tone.
- Generate chart code from data; humans verify labels, units, and sources.
仅在明确要求且符合政策时使用。
- 草拟幻灯片标题和演讲备注;由人工验证准确性和语气。
- 根据数据生成图表代码;由人工验证标签、单位和来源。
Navigation
导航
Resources
- references/pptx-layouts.md - Master slides, themes, templates
- references/pptx-charts.md - Chart types, data visualization
- references/pptx-animations-transitions.md - Slide transitions, build animations, timing
- references/pptx-speaker-notes-delivery.md - Speaker notes, presenter mode, delivery prep
- references/pptx-template-branding.md - Corporate templates, multi-brand support
- data/sources.json - Library documentation links
Templates
- assets/pitch-deck.md - Startup pitch structure
- assets/quarterly-review.md - Business review template
- assets/slide-narrative-template.md - 1-sentence takeaway per slide
Related Skills
- ../document-pdf/SKILL.md - Export presentations to PDF
- ../document-xlsx/SKILL.md - Data source for charts
- ../product-management/SKILL.md - Product strategy decks
资源
- references/pptx-layouts.md - 母版幻灯片、主题、模板
- references/pptx-charts.md - 图表类型、数据可视化
- references/pptx-animations-transitions.md - 幻灯片切换、构建动画、计时
- references/pptx-speaker-notes-delivery.md - 演讲备注、演示者模式、交付准备
- references/pptx-template-branding.md - 企业模板、多品牌支持
- data/sources.json - 库文档链接
模板
- assets/pitch-deck.md - 创业公司推介演示文稿结构
- assets/quarterly-review.md - 业务回顾模板
- assets/slide-narrative-template.md - 单幻灯片1句话核心信息模板
相关技能
- ../document-pdf/SKILL.md - 将演示文稿导出为PDF
- ../document-xlsx/SKILL.md - 图表数据源
- ../product-management/SKILL.md - 产品策略演示文稿
Fact-Checking
事实核查
- Use web search/web fetch to verify current external facts, versions, pricing, deadlines, regulations, or platform behavior before final answers.
- Prefer primary sources; report source links and dates for volatile information.
- If web access is unavailable, state the limitation and mark guidance as unverified.
- 在给出最终答案前,使用网页搜索/网页抓取验证当前外部事实、版本、定价、截止日期、法规或平台行为。
- 优先使用原始来源;针对易变信息,需提供来源链接和日期。
- 若无法访问网页,需说明限制并标记指导内容为未验证。