word

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
<instructions> <word_document_professional_suite>
<quality_workflow> For all professional deliverables, you MUST follow the "Render & Review" loop:
  1. Edit: Use
    python-docx
    for structure/styling or the Document library for XML edits.
  2. Render: Convert to PDF/PNG using
    soffice
    and
    pdftoppm
    :
    • soffice --headless --convert-to pdf document.docx
    • pdftoppm -png -r 150 document.pdf page
  3. Inspect: Read the generated PNG images. You MUST look for clipped text, overlapping shapes, or misaligned margins.
  4. Fix: Address defects and repeat the loop until the document is visually flawless. </quality_workflow>
<technical_workflows>
<instructions> <word_document_professional_suite>
<quality_workflow> 对于所有专业交付成果,您必须遵循“渲染与审核”循环:
  1. 编辑:使用
    python-docx
    进行结构/样式编辑,或使用Document库进行XML编辑。
  2. 渲染:使用
    soffice
    pdftoppm
    转换为PDF/PNG:
    • soffice --headless --convert-to pdf document.docx
    • pdftoppm -png -r 150 document.pdf page
  3. 检查:查看生成的PNG图片。您必须检查是否存在文本截断、形状重叠或边距错位问题。
  4. 修复:解决发现的问题并重复循环,直到文档视觉效果完美。 </quality_workflow>
<technical_workflows>

1. Creating New Documents

1. 创建新文档

  • Python: You SHOULD use
    python-docx
    . Establish hierarchy with HeadingLevel styles.
  • JavaScript: You SHOULD use
    docx-js
    . Reference: See
    references/docx-js.md
    for syntax.
  • CRITICAL: You MUST NOT use
    \n
    for line breaks (use Paragraphs). You MUST NOT use Unicode bullets (use numbering config).
    PageBreak
    MUST be inside a Paragraph.
  • Python:您应使用
    python-docx
    。通过HeadingLevel样式建立文档层级。
  • JavaScript:您应使用
    docx-js
    参考:查看
    references/docx-js.md
    获取语法说明。
  • 关键注意事项:禁止使用
    \n
    换行(请使用段落)。禁止使用Unicode项目符号(请使用编号配置)。
    PageBreak
    必须放在段落内。

2. Redlining & Tracked Changes

2. 修订标记与追踪更改

For legal or business review:
  • Initialize: Use
    scripts/document.py
    . Reference: Read
    references/ooxml.md
    for XML patterns.
  • Procedure: Unpack (
    unpack.py
    ), edit XML using the Document Library, then Pack (
    pack.py
    ).
  • Standard: You MUST only mark text that actually changes. Keep unchanged text outside
    <w:del>
    /
    <w:ins>
    .
针对法律或商业审核场景:
  • 初始化:使用
    scripts/document.py
    参考:阅读
    references/ooxml.md
    了解XML模式。
  • 流程:解压(
    unpack.py
    ),使用Document库编辑XML,然后打包(
    pack.py
    )。
  • 标准:仅对实际修改的文本进行标记。未修改的文本不得包含在
    <w:del>
    /
    <w:ins>
    标签内。

3. Text Extraction

3. 文本提取

  • You SHOULD use Pandoc to convert to markdown while preserving structure:
    • pandoc --track-changes=all path-to-file.docx -o output.md
      </technical_workflows>
<quality_expectations>
  • Client-Ready: You MUST NOT use Unicode dashes (use ASCII hyphens). No internal AI tokens.
  • Element Ordering: In
    <w:pPr>
    , elements MUST follow schema order: Style -> Numbering -> Spacing -> Indent -> Alignment.
  • Visual Fidelity: Charts and tables MUST be sharp and legible in rendered previews. </quality_expectations>
</word_document_professional_suite> </instructions>
  • 您应使用Pandoc将文档转换为markdown并保留结构:
    • pandoc --track-changes=all path-to-file.docx -o output.md
      </technical_workflows>
<quality_expectations>
  • 客户就绪标准:禁止使用Unicode破折号(请使用ASCII连字符)。不得包含内部AI标记。
  • 元素顺序:在
    <w:pPr>
    中,元素必须遵循架构顺序:样式 -> 编号 -> 间距 -> 缩进 -> 对齐。
  • 视觉保真度:图表和表格在渲染预览中必须清晰可读。 </quality_expectations>
</word_document_professional_suite> </instructions>