@cteno/sdk-linux-x64 0.0.0-stage → 2.10.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.daemon +31 -0
- package/README.md +4 -2
- package/agents/flow-analyzer/AGENT.md +71 -0
- package/bin/cteno-host-cli +4 -0
- package/bin/cteno-wiki +0 -0
- package/bin/rg +0 -0
- package/bin/secret-exec +0 -0
- package/manifest.json +12 -0
- package/package.json +33 -4
- package/plugins/agent-secrets/.cteno-plugin/plugin.json +133 -0
- package/plugins/agent-secrets/bin/linux-x64/fnox +4 -0
- package/plugins/agent-secrets/bin/linux-x64/secret-exec +0 -0
- package/plugins/agent-secrets/skills/secret/SKILL.md +201 -0
- package/plugins/cteno.browser/.cteno-plugin/plugin.json +65 -0
- package/plugins/cteno.browser/skills/browser/SKILL.md +28 -0
- package/plugins/cteno.inbox/.cteno-plugin/plugin.json +132 -0
- package/plugins/cteno.inbox/bin/all/cteno-connector-credential +31 -0
- package/plugins/cteno.inbox/bin/all/cteno-telegram-connector +33 -0
- package/plugins/cteno.inbox/bin/linux-x64/cteno-inbox +0 -0
- package/plugins/cteno.inbox/skills/cteno-inbox/SKILL.md +374 -0
- package/plugins/cteno.inbox/tools/inbox_focus/TOOL.md +44 -0
- package/plugins/cteno.memory/.cteno-plugin/plugin.json +176 -0
- package/plugins/cteno.memory/agents/llm-wiki/AGENT.md +96 -0
- package/plugins/cteno.memory/bin/linux-x64/cteno-wiki +0 -0
- package/plugins/cteno.memory/skills/codebase-wiki/SKILL.md +52 -0
- package/plugins/cteno.memory/skills/cteno.memory.native/SKILL.md +110 -0
- package/plugins/cteno.memory/tools/memory/TOOL.md +492 -0
- package/plugins/cteno.memory/ui/index.html +822 -0
- package/plugins/cteno.models/.cteno-plugin/plugin.json +191 -0
- package/plugins/cteno.websearch/.cteno-plugin/plugin.json +45 -0
- package/plugins/jev/.cteno-plugin/plugin.json +309 -0
- package/plugins/jev/skills/jev-browser/SKILL.md +66 -0
- package/plugins/jev/skills/jev-browser/jev_browser.py +335 -0
- package/skills/agent-create/SKILL.md +86 -0
- package/skills/cteno-host-cli/SKILL.md +256 -0
- package/skills/docx/LICENSE +23 -0
- package/skills/docx/NOTICE.md +8 -0
- package/skills/docx/SKILL.md +69 -0
- package/skills/docx/references/cjk_typography.md +357 -0
- package/skills/docx/references/design_principles.md +819 -0
- package/skills/docx/references/revisions-and-comments.md +88 -0
- package/skills/docx/references/track_changes_guide.md +200 -0
- package/skills/docx/references/typography_guide.md +294 -0
- package/skills/docx/scripts/cjk_fonts.py +244 -0
- package/skills/docx/scripts/docx_comments.py +289 -0
- package/skills/docx/scripts/docx_common.py +92 -0
- package/skills/docx/scripts/docx_create.py +259 -0
- package/skills/docx/scripts/docx_edit.py +250 -0
- package/skills/docx/scripts/docx_read.py +149 -0
- package/skills/docx/scripts/docx_revisions.py +146 -0
- package/skills/docx/scripts/docx_template.py +70 -0
- package/skills/docx/scripts/docx_validate.py +156 -0
- package/skills/docx/scripts/render.py +250 -0
- package/skills/docx/tests/test_docx_skill.py +525 -0
- package/skills/home-devices/SKILL.md +121 -0
- package/skills/mcp/SKILL.md +72 -0
- package/skills/mcp/scripts/mcp_setup.py +439 -0
- package/skills/pdf/LICENSE +23 -0
- package/skills/pdf/NOTICE.md +8 -0
- package/skills/pdf/SKILL.md +63 -0
- package/skills/pdf/references/design-tokens.md +381 -0
- package/skills/pdf/references/forms.md +99 -0
- package/skills/pdf/references/nano-pdf-editing.md +40 -0
- package/skills/pdf/references/ocr-extraction.md +165 -0
- package/skills/pdf/scripts/_raster.py +76 -0
- package/skills/pdf/scripts/extract_marker.py +88 -0
- package/skills/pdf/scripts/extract_pymupdf.py +101 -0
- package/skills/pdf/scripts/pdf_create.py +191 -0
- package/skills/pdf/scripts/pdf_fill_form.py +97 -0
- package/skills/pdf/scripts/pdf_form_layout.py +168 -0
- package/skills/pdf/scripts/pdf_make_form.py +145 -0
- package/skills/pdf/scripts/pdf_merge.py +50 -0
- package/skills/pdf/scripts/pdf_meta.py +115 -0
- package/skills/pdf/scripts/pdf_page_image.py +99 -0
- package/skills/pdf/scripts/pdf_read.py +153 -0
- package/skills/pdf/scripts/pdf_secure.py +71 -0
- package/skills/pdf/scripts/pdf_split.py +84 -0
- package/skills/pdf/scripts/pdf_stamp.py +143 -0
- package/skills/pdf/scripts/pdf_watermark.py +51 -0
- package/skills/pdf/scripts/render.py +250 -0
- package/skills/pdf/tests/test_pdf_skill.py +415 -0
- package/skills/pptx/LICENSE +23 -0
- package/skills/pptx/NOTICE.md +8 -0
- package/skills/pptx/SKILL.md +62 -0
- package/skills/pptx/references/design-system.md +392 -0
- package/skills/pptx/references/pptxgenjs.md +420 -0
- package/skills/pptx/references/slide-types.md +413 -0
- package/skills/pptx/scripts/cjk_fonts.py +244 -0
- package/skills/pptx/scripts/pptx_create.py +240 -0
- package/skills/pptx/scripts/pptx_edit.py +436 -0
- package/skills/pptx/scripts/pptx_from_template.py +88 -0
- package/skills/pptx/scripts/pptx_read.py +131 -0
- package/skills/pptx/scripts/pptx_render.py +96 -0
- package/skills/pptx/scripts/render.py +250 -0
- package/skills/pptx/tests/test_powerpoint_skill.py +477 -0
- package/skills/skill-create/SKILL.md +114 -0
- package/skills/video-generation/SKILL.md +27 -0
- package/skills/xlsx/LICENSE +23 -0
- package/skills/xlsx/NOTICE.md +8 -0
- package/skills/xlsx/SKILL.md +63 -0
- package/skills/xlsx/references/format.md +71 -0
- package/skills/xlsx/references/restructuring.md +71 -0
- package/skills/xlsx/scripts/csv_to_xlsx.py +110 -0
- package/skills/xlsx/scripts/formula_check.py +428 -0
- package/skills/xlsx/scripts/render.py +250 -0
- package/skills/xlsx/scripts/xlsx_create.py +265 -0
- package/skills/xlsx/scripts/xlsx_edit.py +269 -0
- package/skills/xlsx/scripts/xlsx_read.py +166 -0
- package/skills/xlsx/scripts/xlsx_recalc.py +119 -0
- package/skills/xlsx/scripts/xlsx_restructure.py +343 -0
- package/skills/xlsx/scripts/xlsx_to_csv.py +75 -0
- package/skills/xlsx/tests/test_xlsx_skill.py +544 -0
- package/tools/create_goal/TOOL.md +36 -0
- package/tools/image_generation/TOOL.md +81 -0
- package/tools/skill/TOOL.md +117 -0
- package/tools/update_profile_notes/TOOL.md +39 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Revisions and Comments — XML details
|
|
2
|
+
|
|
3
|
+
Deep reference for `docx_revisions.py` and `docx_comments.py`. Read this
|
|
4
|
+
when you need to reason about the raw WordprocessingML, extend the
|
|
5
|
+
scripts, or debug an unusual document. Everyday use only needs SKILL.md.
|
|
6
|
+
|
|
7
|
+
## Tracked changes (w:ins / w:del)
|
|
8
|
+
|
|
9
|
+
Word records run-level tracked changes as wrapper elements inside a
|
|
10
|
+
paragraph (`w:p`), in the `w` namespace
|
|
11
|
+
`http://schemas.openxmlformats.org/wordprocessingml/2006/main`:
|
|
12
|
+
|
|
13
|
+
```xml
|
|
14
|
+
<w:p>
|
|
15
|
+
<w:r><w:t>Base </w:t></w:r>
|
|
16
|
+
<w:ins w:id="1" w:author="Editor" w:date="2026-01-02T03:04:05Z">
|
|
17
|
+
<w:r><w:t>inserted text</w:t></w:r>
|
|
18
|
+
</w:ins>
|
|
19
|
+
<w:del w:id="2" w:author="Editor" w:date="2026-01-02T03:04:05Z">
|
|
20
|
+
<w:r><w:delText>deleted text</w:delText></w:r>
|
|
21
|
+
</w:del>
|
|
22
|
+
</w:p>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Key facts the script relies on:
|
|
26
|
+
|
|
27
|
+
- Deleted text lives in `w:delText`, not `w:t` — that is why plain text
|
|
28
|
+
extraction naturally shows the "accepted" view (insertions visible,
|
|
29
|
+
deletions hidden).
|
|
30
|
+
- Resolution semantics:
|
|
31
|
+
- accept `w:ins` → unwrap (move child runs up, drop the wrapper)
|
|
32
|
+
- reject `w:ins` → remove the wrapper and its contents
|
|
33
|
+
- accept `w:del` → remove the wrapper and its contents
|
|
34
|
+
- reject `w:del` → rename each `w:delText` to `w:t`, then unwrap
|
|
35
|
+
- Revisions can appear anywhere block content is allowed: body, table
|
|
36
|
+
cells (nested tables too), headers, footers, text boxes. The script
|
|
37
|
+
iterates the body root plus every header/footer part root with
|
|
38
|
+
`root.iter(W+"ins", W+"del")`, which finds them at any depth.
|
|
39
|
+
- `w:id` values are unique per revision *element*, but one logical edit
|
|
40
|
+
session may produce several elements. `accept`/`reject --id` acts on
|
|
41
|
+
exactly the element(s) carrying that id.
|
|
42
|
+
|
|
43
|
+
Not handled by the script (detected by `docx_read.py --revisions` but
|
|
44
|
+
left alone): paragraph-mark revisions (`w:rPr/w:ins` on `w:pPr`), table
|
|
45
|
+
row insertions/deletions (`w:trPr/w:ins`), format-change records
|
|
46
|
+
(`w:rPrChange`, `w:pPrChange`), and moves (`w:moveFrom`/`w:moveTo`).
|
|
47
|
+
Moves are rare from typical editors; if present, treat the file with
|
|
48
|
+
Word itself rather than guessing.
|
|
49
|
+
|
|
50
|
+
## Comments
|
|
51
|
+
|
|
52
|
+
Three cooperating pieces:
|
|
53
|
+
|
|
54
|
+
1. **`word/comments.xml`** — one `w:comment` element per comment,
|
|
55
|
+
carrying `w:id`, `w:author`, `w:initials`, `w:date`, and body
|
|
56
|
+
paragraphs. Related from document.xml via the relationship type
|
|
57
|
+
`.../comments` and content type
|
|
58
|
+
`application/vnd...wordprocessingml.comments+xml` (also needs a
|
|
59
|
+
`[Content_Types].xml` override — python-docx's part machinery adds it
|
|
60
|
+
when the part is registered).
|
|
61
|
+
2. **Range markers in the story** — `w:commentRangeStart w:id="N"`
|
|
62
|
+
before the anchored runs, `w:commentRangeEnd w:id="N"` after them.
|
|
63
|
+
3. **The reference run** — a `w:r` containing `w:commentReference
|
|
64
|
+
w:id="N"`, placed right after the range end; it ties the balloon to
|
|
65
|
+
the location.
|
|
66
|
+
|
|
67
|
+
`docx_comments.py` behavior:
|
|
68
|
+
|
|
69
|
+
- **list / delete** always work at the XML level, so they handle files
|
|
70
|
+
from any producer. `anchored_text` is reconstructed by walking each
|
|
71
|
+
part root in document order and collecting `w:t` text between the
|
|
72
|
+
start and end markers for each id.
|
|
73
|
+
- **add** first isolates the target text into whole runs. If the match
|
|
74
|
+
starts or ends mid-run, the run is split at the boundary (the split
|
|
75
|
+
copies `w:rPr`, so formatting is preserved). Then:
|
|
76
|
+
- python-docx >= 1.2: the native `document.add_comment(runs, ...)`
|
|
77
|
+
API is used (it creates the comments part, markers, and reference
|
|
78
|
+
run itself).
|
|
79
|
+
- older versions or `--xml`: the script builds `word/comments.xml`,
|
|
80
|
+
registers the part + relationship through the opc layer, and
|
|
81
|
+
inserts the markers/reference manually.
|
|
82
|
+
- Deleting a comment removes the `w:comment` element and all three
|
|
83
|
+
marker kinds for that id; the anchored document text is untouched.
|
|
84
|
+
|
|
85
|
+
Modern Word also writes `commentsExtended.xml` (threading/resolved
|
|
86
|
+
state). The scripts neither read nor produce it: replies and "resolved"
|
|
87
|
+
flags are invisible here, and comments added by this skill are plain
|
|
88
|
+
top-level comments.
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
# Track Changes Guide
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Track Changes in OpenXML uses revision markup elements to record insertions, deletions, and formatting changes. Each revision has a unique ID, author, and timestamp.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Insertion: `<w:ins>`
|
|
10
|
+
|
|
11
|
+
Wraps runs that were inserted during tracking:
|
|
12
|
+
|
|
13
|
+
```xml
|
|
14
|
+
<w:ins w:id="1" w:author="John Smith" w:date="2026-03-21T10:30:00Z">
|
|
15
|
+
<w:r>
|
|
16
|
+
<w:rPr>
|
|
17
|
+
<w:rFonts w:ascii="Calibri" w:hAnsi="Calibri" />
|
|
18
|
+
<w:sz w:val="22" />
|
|
19
|
+
</w:rPr>
|
|
20
|
+
<w:t>This text was inserted.</w:t>
|
|
21
|
+
</w:r>
|
|
22
|
+
</w:ins>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
- `w:id` — unique revision ID (integer, must be unique across document)
|
|
26
|
+
- `w:author` — free text string identifying the author
|
|
27
|
+
- `w:date` — ISO 8601 format with timezone: `YYYY-MM-DDTHH:MM:SSZ`
|
|
28
|
+
- Content inside is normal runs (`w:r`) with optional formatting
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Deletion: `<w:del>`
|
|
33
|
+
|
|
34
|
+
Wraps runs that were deleted during tracking:
|
|
35
|
+
|
|
36
|
+
```xml
|
|
37
|
+
<w:del w:id="2" w:author="John Smith" w:date="2026-03-21T10:31:00Z">
|
|
38
|
+
<w:r>
|
|
39
|
+
<w:rPr>
|
|
40
|
+
<w:rFonts w:ascii="Calibri" w:hAnsi="Calibri" />
|
|
41
|
+
<w:sz w:val="22" />
|
|
42
|
+
</w:rPr>
|
|
43
|
+
<w:delText xml:space="preserve">This text was deleted.</w:delText>
|
|
44
|
+
</w:r>
|
|
45
|
+
</w:del>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**CRITICAL**: Inside `<w:del>`, text MUST use `<w:delText>`, NOT `<w:t>`. Using `<w:t>` inside a deletion is invalid and will cause corruption or unexpected behavior. Word may silently repair it, but other consumers will fail.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Formatting Change: `<w:rPrChange>`
|
|
53
|
+
|
|
54
|
+
Records that a run's formatting was changed. Placed inside `w:rPr`, it stores the **previous** formatting:
|
|
55
|
+
|
|
56
|
+
```xml
|
|
57
|
+
<w:r>
|
|
58
|
+
<w:rPr>
|
|
59
|
+
<w:b /> <!-- Current: bold -->
|
|
60
|
+
<w:rPrChange w:id="3" w:author="Jane Doe" w:date="2026-03-21T11:00:00Z">
|
|
61
|
+
<w:rPr>
|
|
62
|
+
<!-- Previous: not bold (empty rPr means no formatting) -->
|
|
63
|
+
</w:rPr>
|
|
64
|
+
</w:rPrChange>
|
|
65
|
+
</w:rPr>
|
|
66
|
+
<w:t>This text was made bold.</w:t>
|
|
67
|
+
</w:r>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
The outer `w:rPr` holds the **new** (current) formatting. The `w:rPrChange` child holds the **old** (previous) formatting.
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Paragraph Property Change: `<w:pPrChange>`
|
|
75
|
+
|
|
76
|
+
Records paragraph-level formatting changes (alignment, spacing, style):
|
|
77
|
+
|
|
78
|
+
```xml
|
|
79
|
+
<w:pPr>
|
|
80
|
+
<w:jc w:val="center" /> <!-- Current: centered -->
|
|
81
|
+
<w:pPrChange w:id="4" w:author="Jane Doe" w:date="2026-03-21T11:05:00Z">
|
|
82
|
+
<w:pPr>
|
|
83
|
+
<w:jc w:val="left" /> <!-- Previous: left-aligned -->
|
|
84
|
+
</w:pPr>
|
|
85
|
+
</w:pPrChange>
|
|
86
|
+
</w:pPr>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Revision ID Management
|
|
92
|
+
|
|
93
|
+
- Every revision element (`w:ins`, `w:del`, `w:rPrChange`, `w:pPrChange`, `w:tblPrChange`, etc.) requires a `w:id` attribute
|
|
94
|
+
- IDs must be **unique integers** across the entire document
|
|
95
|
+
- IDs should be **monotonically increasing** (not strictly required, but expected by Word)
|
|
96
|
+
- When adding revisions, scan for the current maximum `w:id` and increment from there
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
Existing max ID: 47
|
|
100
|
+
New insertion: w:id="48"
|
|
101
|
+
New deletion: w:id="49"
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Author and Date
|
|
107
|
+
|
|
108
|
+
- **Author**: Free text. Use consistent strings (e.g., `"MiniMaxAI"` for all automated edits)
|
|
109
|
+
- **Date**: ISO 8601 with UTC timezone marker: `2026-03-21T10:30:00Z`
|
|
110
|
+
- Must include the `T` separator and `Z` suffix (or `+HH:MM` offset)
|
|
111
|
+
- Omitting the date is allowed but not recommended
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Operations
|
|
116
|
+
|
|
117
|
+
### Propose Insertion
|
|
118
|
+
|
|
119
|
+
Add `<w:ins>` wrapper around new content at the target location:
|
|
120
|
+
|
|
121
|
+
```xml
|
|
122
|
+
<w:p>
|
|
123
|
+
<w:r><w:t>Existing text. </w:t></w:r>
|
|
124
|
+
<w:ins w:id="5" w:author="MiniMaxAI" w:date="2026-03-21T12:00:00Z">
|
|
125
|
+
<w:r><w:t>Proposed new text. </w:t></w:r>
|
|
126
|
+
</w:ins>
|
|
127
|
+
<w:r><w:t>More existing text.</w:t></w:r>
|
|
128
|
+
</w:p>
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Propose Deletion
|
|
132
|
+
|
|
133
|
+
Wrap existing content in `<w:del>` and change `<w:t>` to `<w:delText>`:
|
|
134
|
+
|
|
135
|
+
```xml
|
|
136
|
+
<w:p>
|
|
137
|
+
<w:r><w:t>Keep this. </w:t></w:r>
|
|
138
|
+
<w:del w:id="6" w:author="MiniMaxAI" w:date="2026-03-21T12:01:00Z">
|
|
139
|
+
<w:r>
|
|
140
|
+
<w:rPr><w:b /></w:rPr>
|
|
141
|
+
<w:delText>Remove this.</w:delText>
|
|
142
|
+
</w:r>
|
|
143
|
+
</w:del>
|
|
144
|
+
<w:r><w:t> Keep this too.</w:t></w:r>
|
|
145
|
+
</w:p>
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Accept a Tracked Change
|
|
149
|
+
|
|
150
|
+
- **Accept insertion**: Remove the `<w:ins>` wrapper, keep the inner runs as normal content
|
|
151
|
+
- **Accept deletion**: Remove the entire `<w:del>` element and its content
|
|
152
|
+
|
|
153
|
+
### Reject a Tracked Change
|
|
154
|
+
|
|
155
|
+
- **Reject insertion**: Remove the entire `<w:ins>` element and its content
|
|
156
|
+
- **Reject deletion**: Remove the `<w:del>` wrapper, change `<w:delText>` back to `<w:t>`
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Cross-Paragraph Operations
|
|
161
|
+
|
|
162
|
+
### Deleting a Paragraph Break (Merging Paragraphs)
|
|
163
|
+
|
|
164
|
+
When tracked deletion spans a paragraph boundary, use `<w:pPrChange>` on the merged paragraph:
|
|
165
|
+
|
|
166
|
+
```xml
|
|
167
|
+
<w:p>
|
|
168
|
+
<w:pPr>
|
|
169
|
+
<w:pPrChange w:id="7" w:author="MiniMaxAI" w:date="2026-03-21T12:05:00Z">
|
|
170
|
+
<w:pPr>
|
|
171
|
+
<w:pStyle w:val="Normal" />
|
|
172
|
+
</w:pPr>
|
|
173
|
+
</w:pPrChange>
|
|
174
|
+
</w:pPr>
|
|
175
|
+
<w:r><w:t>First paragraph text. </w:t></w:r>
|
|
176
|
+
<w:del w:id="8" w:author="MiniMaxAI" w:date="2026-03-21T12:05:00Z">
|
|
177
|
+
<w:r><w:delText> </w:delText></w:r>
|
|
178
|
+
</w:del>
|
|
179
|
+
<w:r><w:t>Second paragraph text (now merged).</w:t></w:r>
|
|
180
|
+
</w:p>
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Inserting a New Paragraph
|
|
184
|
+
|
|
185
|
+
The entire new paragraph is wrapped in `<w:ins>`:
|
|
186
|
+
|
|
187
|
+
```xml
|
|
188
|
+
<w:p>
|
|
189
|
+
<w:pPr>
|
|
190
|
+
<w:rPr>
|
|
191
|
+
<w:ins w:id="9" w:author="MiniMaxAI" w:date="2026-03-21T12:10:00Z" />
|
|
192
|
+
</w:rPr>
|
|
193
|
+
</w:pPr>
|
|
194
|
+
<w:ins w:id="10" w:author="MiniMaxAI" w:date="2026-03-21T12:10:00Z">
|
|
195
|
+
<w:r><w:t>Entirely new paragraph.</w:t></w:r>
|
|
196
|
+
</w:ins>
|
|
197
|
+
</w:p>
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
The paragraph mark itself is marked as inserted via `w:ins` inside `w:pPr > w:rPr`.
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
# Professional Document Design & Typography Guide
|
|
2
|
+
|
|
3
|
+
## Table of Contents
|
|
4
|
+
1. [Font Pairing](#font-pairing)
|
|
5
|
+
2. [Font Sizes by Document Type](#font-sizes-by-document-type)
|
|
6
|
+
3. [Line Spacing](#line-spacing)
|
|
7
|
+
4. [Paragraph Spacing](#paragraph-spacing)
|
|
8
|
+
5. [Page Layout](#page-layout)
|
|
9
|
+
6. [Table Design](#table-design)
|
|
10
|
+
7. [Color Schemes](#color-schemes)
|
|
11
|
+
8. [Visual Hierarchy](#visual-hierarchy)
|
|
12
|
+
9. [Quick Reference Defaults](#quick-reference-defaults)
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Font Pairing
|
|
17
|
+
|
|
18
|
+
### Recommended Pairs
|
|
19
|
+
|
|
20
|
+
| Headings | Body | Style | Best For |
|
|
21
|
+
|----------|------|-------|----------|
|
|
22
|
+
| Calibri Light | Calibri | Modern sans | Corporate reports |
|
|
23
|
+
| Aptos | Aptos | Office 365 default | Modern business docs |
|
|
24
|
+
| Cambria | Calibri | Serif + sans | Academic-corporate hybrid |
|
|
25
|
+
| Times New Roman | Times New Roman | Traditional serif | Academic, legal |
|
|
26
|
+
| Arial | Arial | Clean sans | Memos, internal docs |
|
|
27
|
+
| Georgia | Garamond | Classical serif pair | Formal reports |
|
|
28
|
+
|
|
29
|
+
### Rules
|
|
30
|
+
|
|
31
|
+
- **Limit**: 2 font families max (3 if CJK mixed)
|
|
32
|
+
- **Contrast**: Pair serif with sans-serif, OR use weight contrast within one family
|
|
33
|
+
- **Consistency**: Same font for all body text, same font for all headings
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Font Sizes by Document Type
|
|
38
|
+
|
|
39
|
+
| Document Type | Body | H1 | H2 | H3 | Footnotes |
|
|
40
|
+
|--------------|------|----|----|----|----|
|
|
41
|
+
| **Business report** | 11pt | 18-20pt | 14-16pt | 12-13pt bold | 9pt |
|
|
42
|
+
| **Business letter** | 11-12pt | — | — | — | 9-10pt |
|
|
43
|
+
| **Memo** | 11pt | 14pt bold | 12pt bold | 11pt bold | 9pt |
|
|
44
|
+
| **Contract / Legal** | 12pt | 14pt bold caps | 12pt bold | 12pt bold | 10pt |
|
|
45
|
+
| **Academic (APA 7)** | 12pt | 12pt bold center | 12pt bold left | 12pt bold italic | 10pt |
|
|
46
|
+
| **Resume / CV** | 10-11pt | 14-16pt | 12pt bold | 11pt bold | 8-9pt |
|
|
47
|
+
| **Chinese 公文** | 三号(16pt) | 二号(22pt) | 三号(16pt) | 四号(14pt) | 小四(12pt) |
|
|
48
|
+
|
|
49
|
+
### OpenXML `w:sz` Values (half-points)
|
|
50
|
+
|
|
51
|
+
| Point Size | `w:sz` Val | Common Use |
|
|
52
|
+
|-----------|-----------|------------|
|
|
53
|
+
| 9pt | 18 | Footnotes, captions |
|
|
54
|
+
| 10pt | 20 | Compact body text |
|
|
55
|
+
| 10.5pt (五号) | 21 | CJK body small |
|
|
56
|
+
| 11pt | 22 | Standard body (Calibri) |
|
|
57
|
+
| 12pt (小四) | 24 | Standard body (TNR), CJK |
|
|
58
|
+
| 14pt (四号) | 28 | CJK body, subheading |
|
|
59
|
+
| 16pt (三号) | 32 | CJK heading, western H2 |
|
|
60
|
+
| 18pt (小二) | 36 | Western H1 |
|
|
61
|
+
| 22pt (二号) | 44 | CJK document title |
|
|
62
|
+
| 26pt (一号) | 52 | Large title |
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Line Spacing
|
|
67
|
+
|
|
68
|
+
| Spacing | OpenXML `w:spacing line` | When to Use |
|
|
69
|
+
|---------|--------------------------|-------------|
|
|
70
|
+
| Single (1.0) | `line="240"` lineRule="auto" | Tables, footnotes, captions |
|
|
71
|
+
| 1.08 (MS default) | `line="259"` lineRule="auto" | Modern Office documents |
|
|
72
|
+
| 1.15 | `line="276"` lineRule="auto" | Business reports — best general default |
|
|
73
|
+
| 1.5 | `line="360"` lineRule="auto" | Some academic, drafts for markup |
|
|
74
|
+
| Double (2.0) | `line="480"` lineRule="auto" | APA/MLA manuscripts, legal briefs |
|
|
75
|
+
| Fixed 28pt | `line="560"` lineRule="exact" | Chinese 公文 (GB/T 9704) |
|
|
76
|
+
|
|
77
|
+
**`lineRule` values**: `auto` = proportional (240 = 1 line), `exact` = fixed height, `atLeast` = minimum.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Paragraph Spacing
|
|
82
|
+
|
|
83
|
+
| Element | Space Before (DXA) | Space After (DXA) |
|
|
84
|
+
|---------|-------------------|-------------------|
|
|
85
|
+
| Body paragraph | 0 | 120-160 (6-8pt) |
|
|
86
|
+
| Heading 1 | 480 (24pt) | 120-240 |
|
|
87
|
+
| Heading 2 | 360 (18pt) | 120 |
|
|
88
|
+
| Heading 3 | 240 (12pt) | 80-120 |
|
|
89
|
+
| List items | 0 | 40-80 (2-4pt) |
|
|
90
|
+
| Block quote | 120-240 | 120-240 |
|
|
91
|
+
| Table/Figure caption | 240 | 240 |
|
|
92
|
+
|
|
93
|
+
**Principle**: Space before a heading > space after, so heading visually "belongs to" content below (2:1 or 3:1 ratio).
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Page Layout
|
|
98
|
+
|
|
99
|
+
### Margins by Document Type
|
|
100
|
+
|
|
101
|
+
| Document Type | Top | Bottom | Left | Right | DXA Values |
|
|
102
|
+
|--------------|-----|--------|------|-------|------------|
|
|
103
|
+
| **Standard business** | 1 in | 1 in | 1 in | 1 in | 1440 all |
|
|
104
|
+
| **Academic (APA/MLA)** | 1 in | 1 in | 1 in | 1 in | 1440 all |
|
|
105
|
+
| **Thesis (binding)** | 1 in | 1 in | 1.5 in | 1 in | T/B:1440 L:2160 R:1440 |
|
|
106
|
+
| **Chinese 公文** | 37mm | 35mm | 28mm | 26mm | T:2098 B:1984 L:1588 R:1474 |
|
|
107
|
+
| **Narrow modern** | 0.75 in | 0.75 in | 0.75 in | 0.75 in | 1080 all |
|
|
108
|
+
| **Wide** | 1 in | 1 in | 2 in | 2 in | T/B:1440 L/R:2880 |
|
|
109
|
+
|
|
110
|
+
### Page Sizes
|
|
111
|
+
|
|
112
|
+
| Size | Width × Height | DXA Width × Height |
|
|
113
|
+
|------|---------------|-------------------|
|
|
114
|
+
| US Letter | 8.5 × 11 in | 12240 × 15840 |
|
|
115
|
+
| A4 | 210 × 297 mm | 11906 × 16838 |
|
|
116
|
+
| Legal | 8.5 × 14 in | 12240 × 20160 |
|
|
117
|
+
| A3 | 297 × 420 mm | 16838 × 23811 |
|
|
118
|
+
|
|
119
|
+
**Rule**: A4 for international audiences, Letter for US-only.
|
|
120
|
+
|
|
121
|
+
### Page Numbers
|
|
122
|
+
|
|
123
|
+
| Convention | Placement | Common In |
|
|
124
|
+
|-----------|-----------|-----------|
|
|
125
|
+
| Bottom center | Footer, centered | Academic, government |
|
|
126
|
+
| Bottom right | Footer, right-aligned | Business reports |
|
|
127
|
+
| "Page X of Y" | Footer, right-aligned | Contracts, legal |
|
|
128
|
+
| Bottom outside | Alternating L/R for odd/even | Books, bound reports |
|
|
129
|
+
| Chinese 公文 | Bottom center, format "-X-" | Government documents |
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Table Design
|
|
134
|
+
|
|
135
|
+
### Style Patterns
|
|
136
|
+
|
|
137
|
+
| Style | Description | When to Use |
|
|
138
|
+
|-------|------------|-------------|
|
|
139
|
+
| **Three-line (三线表)** | Top rule + header-bottom rule + bottom rule only, no vertical lines | Academic, scientific — gold standard |
|
|
140
|
+
| **Banded rows** | Alternating white/light-gray, no borders | Modern corporate |
|
|
141
|
+
| **Light grid** | Thin 0.5pt gray borders all cells | Business reports |
|
|
142
|
+
| **Header-accent** | Dark/colored header row, no other borders | Modern templates |
|
|
143
|
+
| **Full border** | All cells bordered | Financial tables, forms |
|
|
144
|
+
|
|
145
|
+
### Border Weights (OpenXML `w:sz` in eighths of a point)
|
|
146
|
+
|
|
147
|
+
| Visual | `Size` value | Points |
|
|
148
|
+
|--------|-------------|--------|
|
|
149
|
+
| Hairline | 2 | 0.25pt |
|
|
150
|
+
| Thin | 4 | 0.5pt |
|
|
151
|
+
| Medium | 8 | 1pt |
|
|
152
|
+
| Thick | 12 | 1.5pt |
|
|
153
|
+
|
|
154
|
+
### Cell Padding
|
|
155
|
+
|
|
156
|
+
- **Minimum**: 0.05 in (28 DXA) — too tight for most uses
|
|
157
|
+
- **Recommended**: 0.08-0.1 in (57-72 DXA) top/bottom, 0.1-0.15 in (72-108 DXA) left/right
|
|
158
|
+
- **Spacious**: 0.12 in (86 DXA) top/bottom, 0.19 in (137 DXA) left/right
|
|
159
|
+
|
|
160
|
+
### Header Row Best Practices
|
|
161
|
+
|
|
162
|
+
- Bold text, optionally SMALL CAPS
|
|
163
|
+
- Background: light gray (#F2F2F2) or dark with white text (#2F5496 + white)
|
|
164
|
+
- Repeat header row on each page (`w:tblHeader` on `w:trPr`)
|
|
165
|
+
- Right-align number columns, left-align text columns
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## Color Schemes
|
|
170
|
+
|
|
171
|
+
### Corporate / Business
|
|
172
|
+
|
|
173
|
+
| Element | Hex | Notes |
|
|
174
|
+
|---------|-----|-------|
|
|
175
|
+
| Primary heading | #1F3864 | Dark navy, authoritative |
|
|
176
|
+
| Secondary heading | #2E75B6 | Medium blue |
|
|
177
|
+
| Body text | #333333 | Near-black (softer than #000) |
|
|
178
|
+
| Table header bg | #4472C4 | With white #FFFFFF text |
|
|
179
|
+
| Alternate row | #F2F2F2 | Subtle gray banding |
|
|
180
|
+
| Hyperlink | #0563C1 | Standard blue |
|
|
181
|
+
|
|
182
|
+
### Academic
|
|
183
|
+
|
|
184
|
+
All text **#000000** (black). Color only in figures/charts.
|
|
185
|
+
|
|
186
|
+
### Chinese Government (公文)
|
|
187
|
+
|
|
188
|
+
| Element | Color |
|
|
189
|
+
|---------|-------|
|
|
190
|
+
| All body text | Black (required) |
|
|
191
|
+
| 红头 agency name | Red #FF0000 |
|
|
192
|
+
| 红线 separator | Red #FF0000 |
|
|
193
|
+
| 公章 seal | Red |
|
|
194
|
+
|
|
195
|
+
### Accessibility
|
|
196
|
+
|
|
197
|
+
- Minimum contrast ratio 4.5:1 for normal text, 3:1 for large text (WCAG AA)
|
|
198
|
+
- Never use color as sole means of conveying information
|
|
199
|
+
- Ensure distinguishable in grayscale for printed documents
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## Visual Hierarchy
|
|
204
|
+
|
|
205
|
+
### Heading Levels by Document Length
|
|
206
|
+
|
|
207
|
+
| Pages | Recommended Levels |
|
|
208
|
+
|-------|-------------------|
|
|
209
|
+
| 1-5 (memo, letter) | 1-2 levels |
|
|
210
|
+
| 5-20 (report) | 2-3 levels |
|
|
211
|
+
| 20-100 (long report) | 3-4 levels |
|
|
212
|
+
| 100+ (thesis) | 4-5 levels max |
|
|
213
|
+
|
|
214
|
+
### Numbering Systems
|
|
215
|
+
|
|
216
|
+
**Decimal (ISO 2145)** — technical, international:
|
|
217
|
+
```
|
|
218
|
+
1 → 1.1 → 1.1.1 → 1.1.1.1
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
**Traditional outline (US legal):**
|
|
222
|
+
```
|
|
223
|
+
I. → A. → 1. → a. → (1) → (a)
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
**Chinese government (公文):**
|
|
227
|
+
```
|
|
228
|
+
一、(黑体) → (一)(楷体) → 1.(仿宋加粗) → (1)(仿宋)
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### Typography Emphasis
|
|
232
|
+
|
|
233
|
+
| Format | Use For | Avoid |
|
|
234
|
+
|--------|---------|-------|
|
|
235
|
+
| **Bold** | Key terms, headings, emphasis | Entire paragraphs |
|
|
236
|
+
| *Italic* | Titles, foreign words, mild emphasis | Long passages (hard to read) |
|
|
237
|
+
| Underline | Hyperlinks only (digital) | General emphasis (archaic) |
|
|
238
|
+
| SMALL CAPS | Legal defined terms, acronyms | Body text |
|
|
239
|
+
| ALL CAPS | Very short headings | Long text (reduces readability 15%) |
|
|
240
|
+
|
|
241
|
+
**CJK note**: Chinese/Japanese have no true italic. Use bold for emphasis.
|
|
242
|
+
|
|
243
|
+
### List Formatting
|
|
244
|
+
|
|
245
|
+
**Bullets** (unordered): `•` → `○` → `■` by level
|
|
246
|
+
|
|
247
|
+
**Numbers** (ordered): `1.` → `a.` → `i.` by level
|
|
248
|
+
|
|
249
|
+
- Indent each level 0.25-0.5 in (360-720 DXA)
|
|
250
|
+
- Hanging indent: number hangs, text aligns consistently
|
|
251
|
+
- Spacing between items: 2-4pt (less than paragraph spacing)
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
## Quick Reference Defaults
|
|
256
|
+
|
|
257
|
+
### Business Report (Safe Default)
|
|
258
|
+
|
|
259
|
+
| Parameter | Value | OpenXML |
|
|
260
|
+
|-----------|-------|---------|
|
|
261
|
+
| Body font | Calibri 11pt | sz="22", RunFonts Ascii="Calibri" |
|
|
262
|
+
| H1 | 18pt Bold Dark Blue | sz="36", Bold, Color="#1F3864" |
|
|
263
|
+
| H2 | 14pt Bold Dark Blue | sz="28", Bold |
|
|
264
|
+
| H3 | 12pt Bold Dark Blue | sz="24", Bold |
|
|
265
|
+
| Line spacing | 1.15 | line="276" lineRule="auto" |
|
|
266
|
+
| Para after | 8pt | after="160" |
|
|
267
|
+
| Margins | 1 in all | 1440 DXA all |
|
|
268
|
+
| Page size | Letter or A4 | 12240×15840 or 11906×16838 |
|
|
269
|
+
| Page numbers | Bottom right, 10pt | |
|
|
270
|
+
|
|
271
|
+
### Academic Paper (APA 7th)
|
|
272
|
+
|
|
273
|
+
| Parameter | Value | OpenXML |
|
|
274
|
+
|-----------|-------|---------|
|
|
275
|
+
| Font | Times New Roman 12pt | sz="24" |
|
|
276
|
+
| Line spacing | Double | line="480" lineRule="auto" |
|
|
277
|
+
| First-line indent | 0.5 in | ind firstLine="720" |
|
|
278
|
+
| Margins | 1 in all | 1440 DXA all |
|
|
279
|
+
| Page numbers | Top right | Header, right-aligned |
|
|
280
|
+
|
|
281
|
+
### Chinese Government (公文 GB/T 9704)
|
|
282
|
+
|
|
283
|
+
| Parameter | Value | OpenXML |
|
|
284
|
+
|-----------|-------|---------|
|
|
285
|
+
| Body font | 仿宋_GB2312 三号 | sz="32", EastAsia="FangSong_GB2312" |
|
|
286
|
+
| Title | 小标宋 二号 centered | sz="44" |
|
|
287
|
+
| L1 heading | 黑体 三号 | sz="32", EastAsia="SimHei" |
|
|
288
|
+
| L2 heading | 楷体 三号 | sz="32", EastAsia="KaiTi_GB2312" |
|
|
289
|
+
| Line spacing | Fixed 28pt | line="560" lineRule="exact" |
|
|
290
|
+
| Margins | T:37mm B:35mm L:28mm R:26mm | T:2098 B:1984 L:1588 R:1474 |
|
|
291
|
+
| Page size | A4 | 11906×16838 |
|
|
292
|
+
| Page numbers | Bottom center, 宋体 四号, "-X-" | sz="28" |
|
|
293
|
+
| Chars/line | 28 | |
|
|
294
|
+
| Lines/page | 22 | |
|