ppt-editing-skill
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseEditing Presentations
编辑演示文稿
Template-Based Workflow
基于模板的工作流
When using an existing presentation as a template:
-
Copy and analyze:bash
cp /path/to/user-provided.pptx template.pptx python -m markitdown template.pptx > template.mdReviewto see placeholder text and slide structure.template.md -
Plan slide mapping: For each content section, choose a template slide.⚠️ USE VARIED LAYOUTS — monotonous presentations are a common failure mode. Don't default to basic title + bullet slides. Actively seek out:
- Multi-column layouts (2-column, 3-column)
- Image + text combinations
- Full-bleed images with text overlay
- Quote or callout slides
- Section dividers
- Stat/number callouts
- Icon grids or icon + text rows
Avoid: Repeating the same text-heavy layout for every slide.Match content type to layout style (e.g., key points → bullet slide, team info → multi-column, testimonials → quote slide). -
Unpack
-
Build presentation (do this yourself, not with subagents):
- Delete unwanted slides (remove from )
<p:sldIdLst> - Duplicate slides you want to reuse ()
add_slide.py - Reorder slides in
<p:sldIdLst> - Complete all structural changes before step 5
- Delete unwanted slides (remove from
-
Edit content: Update text in each. Use subagents here if available — slides are separate XML files, so subagents can edit in parallel.
slide{N}.xml -
Clean
-
Pack
当使用现有演示文稿作为模板时:
-
复制与分析:bash
cp /path/to/user-provided.pptx template.pptx python -m markitdown template.pptx > template.md查看了解占位符文本和幻灯片结构。template.md -
规划幻灯片映射:为每个内容板块选择对应的模板幻灯片。⚠️ 请使用多样化的版式 —— 单调的演示文稿是常见的失败场景。不要默认使用基础的标题+项目符号幻灯片,主动选择以下版式:
- 多栏版式(2栏、3栏)
- 图文组合版式
- 全 bleed 图片叠加文本版式
- 引语或标注幻灯片
- 章节分隔页
- 数据/数字标注页
- 图标网格或图标+文本行版式
避免:每张幻灯片都重复使用同样的重文本版式。将内容类型与版式风格匹配(例如:核心要点→项目符号幻灯片,团队信息→多栏版式,用户评价→引语幻灯片)。 -
解压
-
构建演示文稿(请自行完成,不要使用子Agent):
- 删除不需要的幻灯片(从中移除)
<p:sldIdLst> - 复制你想要复用的幻灯片(使用)
add_slide.py - 在中重排幻灯片顺序
<p:sldIdLst> - 在步骤5前完成所有结构变更
- 删除不需要的幻灯片(从
-
编辑内容:更新每个中的文本。 如果有可用的子Agent可以在此处使用——幻灯片是独立的XML文件,因此子Agent可以并行编辑。
slide{N}.xml -
清理
-
打包
Output Structure
输出结构
Copy the user-provided file to in cwd. This preserves the original and gives a predictable name for all downstream scripts.
template.pptxbash
cp /path/to/user-provided.pptx template.pptxtext
./
├── template.pptx # Copy of user-provided file (never modified)
├── template.md # markitdown extraction
├── unpacked/ # Editable XML tree
└── edited.pptx # Final repacked deckMinimum expected deliverable: .
edited.pptx将用户提供的文件复制到当前工作目录下的,这样可以保留原始文件,同时为所有下游脚本提供固定的文件名。
template.pptxbash
cp /path/to/user-provided.pptx template.pptxtext
./
├── template.pptx # 用户提供文件的副本(永不修改)
├── template.md # markitdown提取的内容
├── unpacked/ # 可编辑的XML目录树
└── edited.pptx # 最终重新打包的演示文稿最低预期交付物:。
edited.pptxScripts
脚本说明
| Script | Purpose |
|---|---|
| Extract and pretty-print PPTX |
| Duplicate slide or create from layout |
| Remove orphaned files |
| Repack with validation |
Removes slides not in , unreferenced media, orphaned rels.
<p:sldIdLst>Always write to first, then copy to the final path. Python's module uses internally, which fails on some volume mounts (e.g. Docker bind mounts). Writing to a local temp path avoids this.
/tmp/zipfileseekValidates, repairs, condenses XML, re-encodes smart quotes.
| 脚本 | 用途 |
|---|---|
| 解压并格式化PPTX文件 |
| 复制幻灯片或从版式创建新幻灯片 |
| 移除孤立文件 |
| 带验证的重新打包 |
会移除不在中的幻灯片、未被引用的媒体文件、孤立的关联关系。
<p:sldIdLst>请始终先写入目录,再复制到最终路径。Python的模块内部使用操作,在某些挂载卷(例如Docker绑定挂载)上会失败,写入本地临时路径可以避免该问题。
/tmp/zipfileseek会执行验证、修复、压缩XML、重新编码智能引号等操作。
Slide Operations
幻灯片操作
Slide order is in → .
ppt/presentation.xml<p:sldIdLst>Reorder: Rearrange elements.
<p:sldId>Delete: Remove , then run .
<p:sldId>clean.pyAdd: Use . Never manually copy slide files—the script handles notes references, Content_Types.xml, and relationship IDs that manual copying misses.
add_slide.py幻灯片顺序存储在的节点中。
ppt/presentation.xml<p:sldIdLst>重排:重新排列元素的顺序。
<p:sldId>删除:移除元素,然后运行。
<p:sldId>clean.py新增:使用。永远不要手动复制幻灯片文件——脚本会处理备注引用、Content_Types.xml和关联ID,这些是手动复制容易遗漏的。
add_slide.pyEditing Content
内容编辑
Subagents: If available, use them here (after completing step 4). Each slide is a separate XML file, so subagents can edit in parallel. In your prompt to subagents, include:
- The slide file path(s) to edit
- "Use the Edit tool for all changes"
- The formatting rules and common pitfalls below
For each slide:
- Read the slide's XML
- Identify ALL placeholder content—text, images, charts, icons, captions
- Replace each placeholder with final content
Use the Edit tool, not sed or Python scripts. The Edit tool forces specificity about what to replace and where, yielding better reliability.
子Agent:如果有可用的子Agent,可以在此步骤(完成步骤4后)使用。每张幻灯片都是独立的XML文件,因此子Agent可以并行编辑。在给子Agent的提示词中,请包含:
- 需要编辑的幻灯片文件路径
- "所有变更都使用Edit工具完成"
- 下方的格式规则和常见陷阱
对每张幻灯片:
- 读取幻灯片的XML内容
- 识别所有占位符内容——文本、图片、图表、图标、标题
- 将每个占位符替换为最终内容
使用Edit工具,不要使用sed或Python脚本。Edit工具会强制明确要替换的内容和位置,可靠性更高。
Formatting Rules
格式规则
- Bold all headers, subheadings, and inline labels: Use on
b="1". This includes:<a:rPr>- Slide titles
- Section headers within a slide
- Inline labels like (e.g.: "Status:", "Description:") at the start of a line
- Never use unicode bullets (•): Use proper list formatting with or
<a:buChar><a:buAutoNum> - Bullet consistency: Let bullets inherit from the layout. Only specify or
<a:buChar>.<a:buNone>
- 所有标题、副标题和行内标签都加粗:在上设置
<a:rPr>,包括:b="1"- 幻灯片标题
- 幻灯片内的章节标题
- 行首的行内标签(例如:"状态:"、"描述:")
- 永远不要使用Unicode项目符号(•):使用或
<a:buChar>实现规范的列表格式<a:buAutoNum> - 项目符号一致性:让项目符号继承版式的设置,仅指定或
<a:buChar>即可。<a:buNone>
Common Pitfalls
常见陷阱
Template Adaptation
模板适配
When source content has fewer items than the template:
- Remove excess elements entirely (images, shapes, text boxes), don't just clear text
- Check for orphaned visuals after clearing text content
- Run content QA with to catch mismatched counts
markitdown
When replacing text with different length content:
- Shorter replacements: Usually safe
- Longer replacements: May overflow or wrap unexpectedly
- Verify with after text changes
markitdown - Consider truncating or splitting content to fit the template's design constraints
Template slots ≠ Source items: If template has 4 team members but source has 3 users, delete the 4th member's entire group (image + text boxes), not just the text.
当源内容的条目数量少于模板时:
- 完全移除多余的元素(图片、形状、文本框),不要仅清空文本
- 清空文本内容后检查是否有孤立的视觉元素
- 使用运行内容QA,捕捉数量不匹配的问题
markitdown
当替换的内容长度与原占位符不同时:
- 更短的替换内容:通常安全
- 更长的替换内容:可能出现溢出或意外换行
- 文本变更后用验证
markitdown - 考虑截断或拆分内容,以适配模板的设计约束
模板槽位≠源条目:如果模板有4个团队成员位置,但源内容只有3个用户,请删除第4个成员的整个组(图片+文本框),而不仅仅是文本。
Multi-Item Content
多条目内容
If source has multiple items (numbered lists, multiple sections), create separate elements for each — never concatenate into one string.
<a:p>❌ WRONG — all items in one paragraph:
xml
<a:p>
<a:r><a:rPr .../><a:t>Step 1: Do the first thing. Step 2: Do the second thing.</a:t></a:r>
</a:p>✅ CORRECT — separate paragraphs with bold headers:
xml
<a:p>
<a:pPr algn="l"><a:lnSpc><a:spcPts val="3919"/></a:lnSpc></a:pPr>
<a:r><a:rPr lang="en-US" sz="2799" b="1" .../><a:t>Step 1</a:t></a:r>
</a:p>
<a:p>
<a:pPr algn="l"><a:lnSpc><a:spcPts val="3919"/></a:lnSpc></a:pPr>
<a:r><a:rPr lang="en-US" sz="2799" .../><a:t>Do the first thing.</a:t></a:r>
</a:p>
<a:p>
<a:pPr algn="l"><a:lnSpc><a:spcPts val="3919"/></a:lnSpc></a:pPr>
<a:r><a:rPr lang="en-US" sz="2799" b="1" .../><a:t>Step 2</a:t></a:r>
</a:p>
<!-- continue pattern -->Copy from the original paragraph to preserve line spacing. Use on headers.
<a:pPr>b="1"如果源内容有多个条目(有序列表、多个章节),为每个条目创建独立的元素——永远不要拼接成一个字符串。
<a:p>❌ 错误——所有条目放在一个段落中:
xml
<a:p>
<a:r><a:rPr .../><a:t>Step 1: Do the first thing. Step 2: Do the second thing.</a:t></a:r>
</a:p>✅ 正确——独立段落搭配加粗标题:
xml
<a:p>
<a:pPr algn="l"><a:lnSpc><a:spcPts val="3919"/></a:lnSpc></a:pPr>
<a:r><a:rPr lang="en-US" sz="2799" b="1" .../><a:t>Step 1</a:t></a:r>
</a:p>
<a:p>
<a:pPr algn="l"><a:lnSpc><a:spcPts val="3919"/></a:lnSpc></a:pPr>
<a:r><a:rPr lang="en-US" sz="2799" .../><a:t>Do the first thing.</a:t></a:r>
</a:p>
<a:p>
<a:pPr algn="l"><a:lnSpc><a:spcPts val="3919"/></a:lnSpc></a:pPr>
<a:r><a:rPr lang="en-US" sz="2799" b="1" .../><a:t>Step 2</a:t></a:r>
</a:p>
<!-- 延续该模式 -->从原始段落复制以保留行间距,标题使用加粗。
<a:pPr>b="1"Smart Quotes
智能引号
Handled automatically by unpack/pack. But the Edit tool converts smart quotes to ASCII.
When adding new text with quotes, use XML entities:
xml
<a:t>the “Agreement”</a:t>| Character | Name | Unicode | XML Entity |
|---|---|---|---|
| Left double quote | U+201C | |
| Right double quote | U+201D | |
| Left single quote | U+2018 | |
| Right single quote | U+2019 | |
解压/打包过程会自动处理智能引号,但Edit工具会将智能引号转换为ASCII字符。
新增带引号的文本时,请使用XML实体:
xml
<a:t>the “Agreement”</a:t>| 字符 | 名称 | Unicode | XML实体 |
|---|---|---|---|
| 左双引号 | U+201C | |
| 右双引号 | U+201D | |
| 左单引号 | U+2018 | |
| 右单引号 | U+2019 | |
Other
其他
- Whitespace: Use on
xml:space="preserve"with leading/trailing spaces<a:t> - XML parsing: Use , not
defusedxml.minidom(corrupts namespaces)xml.etree.ElementTree
- 空白字符:带有首尾空格的标签请设置
<a:t>xml:space="preserve" - XML解析:使用,不要使用
defusedxml.minidom(会损坏命名空间)xml.etree.ElementTree