Academic Paper Skill
Create formally structured Word documents with Table of Contents, equations (LaTeX to OMML), footnotes/endnotes, bibliography, and scholarly formatting. Output is a single .docx file. This skill supersedes the docx creating.md Academic Paper recipe -- use THIS skill for any document requiring TOC + equations + footnotes + formal structure.
BEFORE YOU START (CRITICAL)
Every time before using officecli, run this check:
CODEBLOCK0
Use When
- - User wants to create a research paper, journal manuscript, or conference paper with academic structure (abstract, numbered sections, references)
- User wants a white paper, policy brief, or technical report with formal structure (executive summary, TOC, branded headers)
- User needs math equations (LaTeX to OMML) in a Word document
- User needs footnotes, endnotes, or bibliography with hanging indent
- User needs a Table of Contents that auto-updates in Word
- User mentions "APA", "MLA", "Chicago", or any citation style formatting
- User needs multi-column abstract or mixed portrait/landscape sections
Don't Use When
- - User wants a general letter, memo, contract, or simple report -- use docx skill
- User wants a presentation -- use pptx skill
- User wants a spreadsheet or dashboard -- use xlsx or data-dashboard skill
- User needs LaTeX output (.tex file) -- this skill produces .docx only
- User needs graduate thesis with Roman numeral front-matter pagination -- deferred to Phase 2
- User needs tracked changes or collaborative editing markup -- use docx skill with raw-set
What This Skill Produces
A single .docx file with:
| Component | Description |
|---|
| Cover / title block | Centered title, authors, affiliations |
| Table of Contents |
Native Word TOC field (levels 1-3), updateable |
| Structured sections | Heading1/2/3 hierarchy with consistent styling |
| Equations | Display and inline OMML from LaTeX subset |
| Footnotes / endnotes | Inline references at correct paragraph positions |
| Bibliography | Hanging indent, per-citation-style formatting |
| Headers / footers | Page numbers, optional branding |
| Optional: watermark, charts, custom bordered blocks, cross-references |
Core Concepts
Style-First Architecture (NON-NEGOTIABLE)
Define ALL styles before adding ANY content. Skipping style definitions causes formatting failures in 100% of cases. Different Word versions define Heading1 as 14pt, 16pt, or 13pt -- explicit style setup eliminates this variance.
Font Size Hierarchy
| Style | Size | Weight | spaceBefore | spaceAfter |
|---|
| Heading1 | >= 16pt | bold | 360 (18pt) | 120 (6pt) |
| Heading2 |
>= 14pt | bold | 360 (18pt) | 80 (4pt) |
| Heading3 | >= 12pt | bold + italic | 240 (12pt) | 80 (4pt) |
| Body (Normal) | 11-12pt | regular | per paper type | per paper type |
| Caption | 9-10pt | italic | -- | -- |
| FootnoteText | 9-10pt | regular | -- | -- |
Verified LaTeX Subset
| Category | LaTeX | Notes |
|---|
| Fractions | INLINECODE2 | Nested supported |
| Sub/superscripts |
x_i,
x^{n+1} | Multi-char needs braces |
| Summation |
\sum_{n=1}^{\infty} | Limits above/below in display |
| Integration |
\int_0^{\infty},
\oint | Single, double, and contour |
| Products |
\prod_{i=1}^{n} | |
| Limits |
\lim_{x \to 0} | |
| Square roots |
\sqrt{x},
\sqrt[3]{x} | nth-root supported |
| Greek letters |
\alpha ..
\Omega | Both cases |
| Nabla / partial |
\nabla,
\partial | |
| Accents |
\hat{x},
\bar{x},
\tilde{x},
\vec{x},
\dot{x} | |
| Bold math |
\mathbf{x} | For vectors |
| Aligned |
\begin{aligned}...\end{aligned} | Multi-line systems |
| Matrices |
\begin{pmatrix}...\end{pmatrix} | Also bmatrix, vmatrix |
| Angle brackets |
\langle,
\rangle | For bra-ket notation |
| Simple delimiters |
\left[...\right] | ONLY when NO sub/super inside |
|
DO NOT USE |
\left[...\right] + subscript/superscript inside | Cast error crash |
|
DO NOT USE |
\left(...\right) + subscript/superscript inside | Same crash |
|
DO NOT USE |
\mathcal{L} | Invalid XML -- use
\mathit{L} |
Footnote Behavior
Footnotes are inline reference runs within the target paragraph. They do NOT create new paragraphs and do NOT shift paragraph indices. You can add footnotes in any order -- forward, reverse, or arbitrary. The old "reverse order" advice is obsolete as of v1.0.24.
Workflow Overview
Phase 1: Analyze Input
Classify paper type (social science, physics/math, white paper). Look up the Feature Selection Table in creating.md Section A. Plan which sections to follow.
Phase 2: Setup
Create document, set defaults + margins, define ALL styles upfront. Plan section breaks if multi-column or landscape is needed.
Phase 3: Build
Add content in order: cover, TOC, abstract, body sections, equations, tables, footnotes, bibliography, headers/footers, watermark.
Phase 4: QA
Run verification loop:
validate,
view outline,
view issues,
view text. Fix and re-verify.
Quick Reference: Key Warnings
| Warning | Detail |
|---|
INLINECODE35 /\right + sub/super | Crashes with cast error. Use plain (), [] -- OMML auto-sizes. |
| pbdr at style level |
add /styles --prop pbdr.all=... is silently dropped.
set /styles/X --prop pbdr.all=... is rejected. Always set borders per-paragraph after creation. |
| Section break +1 offset | Each section break inserts one empty paragraph into /body. Account for +1 index offset on all subsequent
p[N] references. |
| Shell escaping for LaTeX | Double backslashes in bash:
--prop "formula=\\frac{a}{b}". Use heredoc for complex formulas. |
| Dollar sign
$ in text | Bash expands
$ as variable in double quotes. Use single quotes or
\$. See creating.md D-10. |
| Batch JSON values | ALL values must be strings:
"true" not
true,
"24" not
24. |
| Batch intermittent failure | ~1-in-15 failure rate. Retry on error. Keep arrays to 10-15 max. |
Quick Start (Social Science Paper Skeleton)
CODEBLOCK1
Follow creating.md for the full step-by-step guide.
References
学术论文技能
创建具有正式结构的Word文档,包含目录、公式(LaTeX转OMML)、脚注/尾注、参考文献和学术格式。输出为单个.docx文件。本技能取代了docx creating.md中的学术论文配方——对于任何需要目录+公式+脚注+正式结构的文档,请使用本技能。
开始之前(关键)
每次使用officecli之前,请运行此检查:
bash
if ! command -v officecli &> /dev/null; then
echo 正在安装officecli...
curl -fsSL https://raw.githubusercontent.com/iOfficeAI/OfficeCli/main/install.sh -o /tmp/officecliinstall.sh && bash /tmp/officecliinstall.sh && rm -f /tmp/officecli_install.sh
# Windows: irm https://raw.githubusercontent.com/iOfficeAI/OfficeCli/main/install.ps1 -OutFile $env:TEMP\officecliinstall.ps1; & $env:TEMP\officecliinstall.ps1
else
CURRENT=$(officecli --version 2>&1 | grep -oE [0-9]+\.[0-9]+\.[0-9]+ | head -1)
LATEST=$(curl -fsSL https://api.github.com/repos/iOfficeAI/OfficeCLI/releases/latest | grep tag_name | sed -E s/.v?([0-9.]+)./\1/)
if [ $CURRENT != $LATEST ]; then
echo 正在升级officecli $CURRENT -> $LATEST...
curl -fsSL https://raw.githubusercontent.com/iOfficeAI/OfficeCli/main/install.sh -o /tmp/officecliinstall.sh && bash /tmp/officecliinstall.sh && rm -f /tmp/officecli_install.sh
else
echo officecli $CURRENT 已是最新版本
fi
fi
officecli --version
使用场景
- - 用户希望创建具有学术结构(摘要、编号章节、参考文献)的研究论文、期刊稿件或会议论文
- 用户希望创建具有正式结构(执行摘要、目录、品牌页眉)的白皮书、政策简报或技术报告
- 用户需要在Word文档中插入数学公式(LaTeX转OMML)
- 用户需要脚注、尾注或参考文献(悬挂缩进)
- 用户需要可在Word中自动更新的目录
- 用户提及APA、MLA、Chicago或任何引文样式格式
- 用户需要多栏摘要或混合纵向/横向章节
不使用场景
- - 用户希望创建普通信函、备忘录、合同或简单报告——请使用docx技能
- 用户希望创建演示文稿——请使用pptx技能
- 用户希望创建电子表格或仪表板——请使用xlsx或data-dashboard技能
- 用户需要LaTeX输出(.tex文件)——本技能仅生成.docx文件
- 用户需要带罗马数字前页页码的研究生论文——推迟到第二阶段
- 用户需要修订标记或协作编辑标记——请使用带raw-set的docx技能
本技能生成的内容
单个.docx文件,包含:
原生Word目录字段(1-3级),可更新 |
| 结构化章节 | Heading1/2/3层级,样式一致 |
| 公式 | 来自LaTeX子集的显示和行内OMML |
| 脚注/尾注 | 正确段落位置的行内引用 |
| 参考文献 | 悬挂缩进,按引文样式格式化 |
| 页眉/页脚 | 页码,可选品牌标识 |
| 可选:水印、图表、自定义边框块、交叉引用 |
核心概念
样式优先架构(不可协商)
在添加任何内容之前,先定义所有样式。跳过样式定义会导致100%的格式失败。不同Word版本将Heading1定义为14pt、16pt或13pt——显式样式设置消除了这种差异。
字号层级
| 样式 | 字号 | 粗细 | spaceBefore | spaceAfter |
|---|
| Heading1 | >= 16pt | 加粗 | 360 (18pt) | 120 (6pt) |
| Heading2 |
>= 14pt | 加粗 | 360 (18pt) | 80 (4pt) |
| Heading3 | >= 12pt | 加粗+斜体 | 240 (12pt) | 80 (4pt) |
| 正文(Normal) | 11-12pt | 常规 | 按论文类型 | 按论文类型 |
| 题注(Caption) | 9-10pt | 斜体 | -- | -- |
| 脚注文本(FootnoteText) | 9-10pt | 常规 | -- | -- |
已验证的LaTeX子集
| 类别 | LaTeX | 说明 |
|---|
| 分数 | \frac{a}{b} | 支持嵌套 |
| 上下标 |
x_i, x^{n+1} | 多字符需加花括号 |
| 求和 | \sum_{n=1}^{\infty} | 显示模式下上下限 |
| 积分 | \int_0^{\infty}, \oint | 单重、双重和围道积分 |
| 乘积 | \prod_{i=1}^{n} | |
| 极限 | \lim_{x \to 0} | |
| 平方根 | \sqrt{x}, \sqrt[3]{x} | 支持n次根 |
| 希腊字母 | \alpha .. \Omega | 大小写 |
| 纳布拉/偏微分 | \nabla, \partial | |
| 重音符号 | \hat{x}, \bar{x}, \tilde{x}, \vec{x}, \dot{x} | |
| 粗体数学 | \mathbf{x} | 用于向量 |
| 对齐 | \begin{aligned}...\end{aligned} | 多行系统 |
| 矩阵 | \begin{pmatrix}...\end{pmatrix} | 也支持bmatrix, vmatrix |
| 尖括号 | \langle, \rangle | 用于bra-ket符号 |
| 简单定界符 | \left[...\right] | 仅当内部无上下标时 |
|
禁止使用 | \left[...\right] + 内部上下标 | 强制转换错误崩溃 |
|
禁止使用 | \left(...\right) + 内部上下标 | 同样崩溃 |
|
禁止使用 | \mathcal{L} | 无效XML——请使用\mathit{L} |
脚注行为
脚注是目标段落内的行内引用运行。它们不会创建新段落,也不会改变段落索引。您可以按任意顺序添加脚注——正向、反向或任意顺序。自v1.0.24起,旧的反向顺序建议已过时。
工作流程概述
第一阶段:分析输入
分类论文类型(社会科学、物理/数学、白皮书)。查阅creating.md中的功能选择表A部分。规划要遵循的章节。
第二阶段:设置
创建文档,设置默认值+页边距,预先定义所有样式。如果需要多栏或横向布局,规划分节符。
第三阶段:构建
按顺序添加内容:封面、目录、摘要、正文章节、公式、表格、脚注、参考文献、页眉/页脚、水印。
第四阶段:质量检查
运行验证循环:validate、view outline、view issues、view text。修复并重新验证。
快速参考:关键警告
| 警告 | 详情 |
|---|
| \left/\right + 上下标 | 强制转换错误崩溃。请使用普通()、[]——OMML自动调整大小。 |
| 样式级别的pbdr |
add /styles --prop pbdr.all=... 被静默忽略。set /styles/X --prop pbdr.all=... 被拒绝。始终在创建后按段落设置边框。 |
| 分节符+1偏移 | 每个分节符在/body中插入一个空段落。后续所有p[N]引用需考虑+1索引偏移。 |
| LaTeX的Shell转义 | bash中双反斜杠:--prop formula=\\frac{a}{b}。复杂公式请使用heredoc。 |
| 文本中的美元符号$ | bash在双引号中将$扩展为变量。请使用单引号或\$。参见creating.md D-10。 |
|