@nguyenphp/antigravity-marketing 1.0.18 → 1.0.19

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.
Files changed (127) hide show
  1. package/README.md +186 -78
  2. package/package.json +4 -3
  3. package/templates/.agent/skills/marketing-report-expert/SKILL.md +70 -0
  4. package/templates/.agent/skills/minimax-docx/LICENSE +21 -0
  5. package/templates/.agent/skills/minimax-docx/SKILL.md +274 -0
  6. package/templates/.agent/skills/minimax-docx/assets/styles/academic_styles.xml +250 -0
  7. package/templates/.agent/skills/minimax-docx/assets/styles/corporate_styles.xml +284 -0
  8. package/templates/.agent/skills/minimax-docx/assets/styles/default_styles.xml +449 -0
  9. package/templates/.agent/skills/minimax-docx/assets/xsd/aesthetic-rules.xsd +470 -0
  10. package/templates/.agent/skills/minimax-docx/assets/xsd/business-rules.xsd +130 -0
  11. package/templates/.agent/skills/minimax-docx/assets/xsd/common-types.xsd +159 -0
  12. package/templates/.agent/skills/minimax-docx/assets/xsd/wml-subset.xsd +589 -0
  13. package/templates/.agent/skills/minimax-docx/references/cjk_typography.md +357 -0
  14. package/templates/.agent/skills/minimax-docx/references/cjk_university_template_guide.md +184 -0
  15. package/templates/.agent/skills/minimax-docx/references/comments_guide.md +191 -0
  16. package/templates/.agent/skills/minimax-docx/references/design_good_bad_examples.md +829 -0
  17. package/templates/.agent/skills/minimax-docx/references/design_principles.md +819 -0
  18. package/templates/.agent/skills/minimax-docx/references/openxml_element_order.md +308 -0
  19. package/templates/.agent/skills/minimax-docx/references/openxml_encyclopedia_part1.md +4061 -0
  20. package/templates/.agent/skills/minimax-docx/references/openxml_encyclopedia_part2.md +2820 -0
  21. package/templates/.agent/skills/minimax-docx/references/openxml_encyclopedia_part3.md +3381 -0
  22. package/templates/.agent/skills/minimax-docx/references/openxml_namespaces.md +82 -0
  23. package/templates/.agent/skills/minimax-docx/references/openxml_units.md +72 -0
  24. package/templates/.agent/skills/minimax-docx/references/scenario_a_create.md +284 -0
  25. package/templates/.agent/skills/minimax-docx/references/scenario_b_edit_content.md +295 -0
  26. package/templates/.agent/skills/minimax-docx/references/scenario_c_apply_template.md +456 -0
  27. package/templates/.agent/skills/minimax-docx/references/track_changes_guide.md +200 -0
  28. package/templates/.agent/skills/minimax-docx/references/troubleshooting.md +506 -0
  29. package/templates/.agent/skills/minimax-docx/references/typography_guide.md +294 -0
  30. package/templates/.agent/skills/minimax-docx/references/xsd_validation_guide.md +158 -0
  31. package/templates/.agent/skills/minimax-docx/scripts/doc_to_docx.sh +40 -0
  32. package/templates/.agent/skills/minimax-docx/scripts/docx_preview.sh +37 -0
  33. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Cli/MiniMaxAIDocx.Cli.csproj +19 -0
  34. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Cli/Program.cs +18 -0
  35. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/AnalyzeCommand.cs +147 -0
  36. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/ApplyTemplateCommand.cs +322 -0
  37. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/CreateCommand.cs +324 -0
  38. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/DiffCommand.cs +155 -0
  39. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/EditContentCommand.cs +487 -0
  40. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/FixOrderCommand.cs +108 -0
  41. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/MergeRunsCommand.cs +122 -0
  42. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/ValidateCommand.cs +107 -0
  43. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/MiniMaxAIDocx.Core.csproj +15 -0
  44. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/CommentSynchronizer.cs +169 -0
  45. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/ElementOrder.cs +80 -0
  46. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/NamespaceConstants.cs +42 -0
  47. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/RunMerger.cs +81 -0
  48. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/StyleAnalyzer.cs +81 -0
  49. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/TrackChangesHelper.cs +99 -0
  50. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/UnitConverter.cs +23 -0
  51. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/AestheticRecipeSamples.cs +1832 -0
  52. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/AestheticRecipeSamples_Batch1.cs +910 -0
  53. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/AestheticRecipeSamples_Batch2.cs +999 -0
  54. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/AestheticRecipeSamples_Batch3.cs +1048 -0
  55. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/AestheticRecipeSamples_Batch4.cs +1038 -0
  56. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/CharacterFormattingSamples.cs +1020 -0
  57. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/DocumentCreationSamples.cs +1121 -0
  58. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/FieldAndTocSamples.cs +624 -0
  59. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/FootnoteAndCommentSamples.cs +675 -0
  60. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/HeaderFooterSamples.cs +838 -0
  61. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/ImageSamples.cs +917 -0
  62. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/ListAndNumberingSamples.cs +826 -0
  63. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/ParagraphFormattingSamples.cs +1199 -0
  64. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/StyleSystemSamples.cs +1487 -0
  65. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/TableSamples.cs +1163 -0
  66. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/TrackChangesSamples.cs +595 -0
  67. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Typography/CjkHelper.cs +39 -0
  68. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Typography/FontDefaults.cs +24 -0
  69. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Typography/PageSizes.cs +20 -0
  70. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Validation/BusinessRuleValidator.cs +224 -0
  71. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Validation/GateCheckValidator.cs +148 -0
  72. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Validation/ValidationResult.cs +23 -0
  73. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Validation/XsdValidator.cs +69 -0
  74. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.slnx +4 -0
  75. package/templates/.agent/skills/minimax-docx/scripts/env_check.sh +196 -0
  76. package/templates/.agent/skills/minimax-docx/scripts/setup.ps1 +274 -0
  77. package/templates/.agent/skills/minimax-docx/scripts/setup.sh +504 -0
  78. package/templates/.agent/skills/minimax-multimodal-toolkit/SKILL.md +359 -0
  79. package/templates/.agent/skills/minimax-pdf/README.md +222 -0
  80. package/templates/.agent/skills/minimax-pdf/SKILL.md +201 -0
  81. package/templates/.agent/skills/minimax-pdf/design/design.md +381 -0
  82. package/templates/.agent/skills/minimax-pdf/scripts/cover.py +1579 -0
  83. package/templates/.agent/skills/minimax-pdf/scripts/fill_inspect.py +200 -0
  84. package/templates/.agent/skills/minimax-pdf/scripts/fill_write.py +242 -0
  85. package/templates/.agent/skills/minimax-pdf/scripts/make.sh +491 -0
  86. package/templates/.agent/skills/minimax-pdf/scripts/merge.py +112 -0
  87. package/templates/.agent/skills/minimax-pdf/scripts/palette.py +559 -0
  88. package/templates/.agent/skills/minimax-pdf/scripts/reformat_parse.py +374 -0
  89. package/templates/.agent/skills/minimax-pdf/scripts/render_body.py +1055 -0
  90. package/templates/.agent/skills/minimax-pdf/scripts/render_cover.cjs +111 -0
  91. package/templates/.agent/skills/minimax-xlsx/SKILL.md +138 -0
  92. package/templates/.agent/skills/minimax-xlsx/references/create.md +691 -0
  93. package/templates/.agent/skills/minimax-xlsx/references/edit.md +684 -0
  94. package/templates/.agent/skills/minimax-xlsx/references/fix.md +37 -0
  95. package/templates/.agent/skills/minimax-xlsx/references/format.md +768 -0
  96. package/templates/.agent/skills/minimax-xlsx/references/ooxml-cheatsheet.md +231 -0
  97. package/templates/.agent/skills/minimax-xlsx/references/read-analyze.md +97 -0
  98. package/templates/.agent/skills/minimax-xlsx/references/validate.md +772 -0
  99. package/templates/.agent/skills/minimax-xlsx/scripts/formula_check.py +422 -0
  100. package/templates/.agent/skills/minimax-xlsx/scripts/libreoffice_recalc.py +248 -0
  101. package/templates/.agent/skills/minimax-xlsx/scripts/shared_strings_builder.py +163 -0
  102. package/templates/.agent/skills/minimax-xlsx/scripts/style_audit.py +575 -0
  103. package/templates/.agent/skills/minimax-xlsx/scripts/xlsx_add_column.py +395 -0
  104. package/templates/.agent/skills/minimax-xlsx/scripts/xlsx_insert_row.py +274 -0
  105. package/templates/.agent/skills/minimax-xlsx/scripts/xlsx_pack.py +87 -0
  106. package/templates/.agent/skills/minimax-xlsx/scripts/xlsx_reader.py +362 -0
  107. package/templates/.agent/skills/minimax-xlsx/scripts/xlsx_shift_rows.py +396 -0
  108. package/templates/.agent/skills/minimax-xlsx/scripts/xlsx_unpack.py +130 -0
  109. package/templates/.agent/skills/minimax-xlsx/templates/minimal_xlsx/[Content_Types].xml +9 -0
  110. package/templates/.agent/skills/minimax-xlsx/templates/minimal_xlsx/_rels/.rels +6 -0
  111. package/templates/.agent/skills/minimax-xlsx/templates/minimal_xlsx/xl/_rels/workbook.xml.rels +19 -0
  112. package/templates/.agent/skills/minimax-xlsx/templates/minimal_xlsx/xl/sharedStrings.xml +33 -0
  113. package/templates/.agent/skills/minimax-xlsx/templates/minimal_xlsx/xl/styles.xml +160 -0
  114. package/templates/.agent/skills/minimax-xlsx/templates/minimal_xlsx/xl/workbook.xml +30 -0
  115. package/templates/.agent/skills/minimax-xlsx/templates/minimal_xlsx/xl/worksheets/sheet1.xml +70 -0
  116. package/templates/.agent/skills/pptx-generator/SKILL.md +249 -0
  117. package/templates/.agent/skills/pptx-generator/references/design-system.md +392 -0
  118. package/templates/.agent/skills/pptx-generator/references/editing.md +162 -0
  119. package/templates/.agent/skills/pptx-generator/references/pitfalls.md +112 -0
  120. package/templates/.agent/skills/pptx-generator/references/pptxgenjs.md +420 -0
  121. package/templates/.agent/skills/pptx-generator/references/slide-types.md +413 -0
  122. package/templates/.agent/skills/tutorial-video-expert/SKILL.md +88 -0
  123. package/templates/.agent/skills/ui-ux-pro-max/SKILL.md +170 -585
  124. package/templates/.agent/skills/vision-analysis/SKILL.md +174 -0
  125. package/templates/.agent/workflows/analyze.md +3 -0
  126. package/templates/.agent/workflows/brand-report.md +44 -0
  127. package/templates/.agent/workflows/report.md +49 -0
@@ -0,0 +1,910 @@
1
+ // ============================================================================
2
+ // AestheticRecipeSamples_Batch1.cs — IEEE & ACM conference paper recipes
3
+ // ============================================================================
4
+ // Two-column academic conference styles faithfully reproducing the typographic
5
+ // conventions of IEEEtran.cls and acmart.cls for DOCX output.
6
+ //
7
+ // UNIT REFERENCE:
8
+ // Font size: half-points (20 = 10pt, 18 = 9pt, 16 = 8pt)
9
+ // Spacing: DXA = twentieths of a point (1440 DXA = 1 inch)
10
+ // Borders: eighth-points (4 = 0.5pt, 8 = 1pt, 12 = 1.5pt)
11
+ // Line spacing "line": 240ths of single spacing (240 = 1.0x)
12
+ // ============================================================================
13
+
14
+ using DocumentFormat.OpenXml;
15
+ using DocumentFormat.OpenXml.Packaging;
16
+ using DocumentFormat.OpenXml.Wordprocessing;
17
+
18
+ using WpColumns = DocumentFormat.OpenXml.Wordprocessing.Columns;
19
+ using WpPageSize = DocumentFormat.OpenXml.Wordprocessing.PageSize;
20
+
21
+ namespace MiniMaxAIDocx.Core.Samples;
22
+
23
+ public static partial class AestheticRecipeSamples
24
+ {
25
+ // ════════════════════════════════════════════════════════════════════════
26
+ // RECIPE 6: IEEE CONFERENCE (IEEEtran)
27
+ // ════════════════════════════════════════════════════════════════════════
28
+
29
+ /// <summary>
30
+ /// Recipe: IEEE Conference Paper (IEEEtran.cls v1.8b)
31
+ /// Source: IEEEtran.cls v1.8b — the standard LaTeX class for IEEE transactions
32
+ /// and conference proceedings.
33
+ ///
34
+ /// Feel: Dense, formal, information-rich two-column layout.
35
+ /// Best for: IEEE conference submissions, transactions papers, technical reports
36
+ /// following IEEE style.
37
+ ///
38
+ /// Design rationale (all values from IEEEtran.cls source):
39
+ /// - US Letter, narrow margins (0.625in L/R): maximizes text area for the
40
+ /// two-column layout. IEEE papers prioritize information density.
41
+ /// - Two columns with 0.25in (360 DXA) gutter: standard IEEE column separation.
42
+ /// Narrow gutter is feasible because the small font creates short line lengths.
43
+ /// - 10pt Times New Roman body (sz=20): IEEE's standard body size. TNR is the
44
+ /// required typeface. 10pt in two columns yields ~40 characters per line —
45
+ /// optimal for rapid technical reading.
46
+ /// - 24pt title, centered, NOT bold (sz=48): IEEEtran titles are large but
47
+ /// use regular weight. The size alone provides hierarchy.
48
+ /// - Section headings (H1): 10pt small caps, centered, Roman numeral prefix
49
+ /// convention (sz=20). Small caps at body size creates subtle hierarchy
50
+ /// without disrupting the dense layout.
51
+ /// - Subsection headings (H2): 10pt italic, flush left (sz=20). Italic at
52
+ /// body size is the minimal viable distinction from body text.
53
+ /// - Single spacing (line=240): mandatory for IEEE camera-ready format.
54
+ /// - First-line indent 0.125in (180 DXA): very small indent suits the narrow
55
+ /// column width.
56
+ /// - 0pt paragraph spacing: IEEE uses no inter-paragraph space; the first-line
57
+ /// indent is the sole paragraph separator.
58
+ /// - Captions: 8pt (sz=16) — subordinate to body, centered under figures/tables.
59
+ /// </summary>
60
+ public static void CreateIEEEConferenceDocument(string outputPath)
61
+ {
62
+ using var doc = WordprocessingDocument.Create(outputPath, WordprocessingDocumentType.Document);
63
+
64
+ var mainPart = doc.AddMainDocumentPart();
65
+ mainPart.Document = new Document(new Body());
66
+ var body = mainPart.Document.Body!;
67
+
68
+ // ── Styles ──
69
+ var stylesPart = mainPart.AddNewPart<StyleDefinitionsPart>();
70
+ stylesPart.Styles = new Styles();
71
+ var styles = stylesPart.Styles;
72
+
73
+ // DocDefaults: Times New Roman 10pt, single spacing, 0.125in first-line indent
74
+ styles.Append(new DocDefaults(
75
+ new RunPropertiesDefault(
76
+ new RunPropertiesBaseStyle(
77
+ new RunFonts
78
+ {
79
+ Ascii = "Times New Roman",
80
+ HighAnsi = "Times New Roman",
81
+ EastAsia = "SimSun",
82
+ ComplexScript = "Times New Roman"
83
+ },
84
+ new FontSize { Val = "20" }, // 10pt body (IEEEtran standard)
85
+ new FontSizeComplexScript { Val = "20" },
86
+ new Color { Val = "000000" }, // Pure black
87
+ new Languages { Val = "en-US", EastAsia = "zh-CN" }
88
+ )
89
+ ),
90
+ new ParagraphPropertiesDefault(
91
+ new ParagraphPropertiesBaseStyle(
92
+ new SpacingBetweenLines
93
+ {
94
+ // Single spacing: mandatory for IEEE camera-ready
95
+ Line = "240",
96
+ LineRule = LineSpacingRuleValues.Auto,
97
+ After = "0",
98
+ Before = "0"
99
+ },
100
+ // First-line indent: 0.125in = 180 DXA (very small, suits narrow columns)
101
+ new Indentation { FirstLine = "180" }
102
+ )
103
+ )
104
+ ));
105
+
106
+ // ── Normal style ──
107
+ styles.Append(CreateParagraphStyle(
108
+ styleId: "Normal",
109
+ styleName: "Normal",
110
+ isDefault: true,
111
+ uiPriority: 0
112
+ ));
113
+
114
+ // ── Title style: 24pt centered, NOT bold ──
115
+ // IEEEtran.cls \maketitle: \LARGE (24pt at 10pt base), centered, no bold
116
+ var titleRPr = new StyleRunProperties(
117
+ new RunFonts
118
+ {
119
+ Ascii = "Times New Roman",
120
+ HighAnsi = "Times New Roman",
121
+ EastAsia = "SimSun",
122
+ ComplexScript = "Times New Roman"
123
+ },
124
+ new FontSize { Val = "48" }, // 24pt
125
+ new FontSizeComplexScript { Val = "48" },
126
+ new Color { Val = "000000" }
127
+ // No Bold — IEEEtran titles are NOT bold
128
+ );
129
+
130
+ styles.Append(new Style(
131
+ new StyleName { Val = "Title" },
132
+ new BasedOn { Val = "Normal" },
133
+ new NextParagraphStyle { Val = "Normal" },
134
+ new UIPriority { Val = 10 },
135
+ new PrimaryStyle(),
136
+ new StyleParagraphProperties(
137
+ new Justification { Val = JustificationValues.Center },
138
+ new SpacingBetweenLines { Before = "0", After = "240" },
139
+ new Indentation { FirstLine = "0" } // No indent for title
140
+ ),
141
+ titleRPr
142
+ )
143
+ {
144
+ Type = StyleValues.Paragraph,
145
+ StyleId = "Title",
146
+ Default = false
147
+ });
148
+
149
+ // ── Heading 1: 10pt small caps, centered ──
150
+ // IEEEtran \section: \centering\scshape at body size, Roman numeral prefix
151
+ var h1RPr = new StyleRunProperties(
152
+ new RunFonts
153
+ {
154
+ Ascii = "Times New Roman",
155
+ HighAnsi = "Times New Roman",
156
+ EastAsia = "SimSun",
157
+ ComplexScript = "Times New Roman"
158
+ },
159
+ new FontSize { Val = "20" }, // 10pt — same as body
160
+ new FontSizeComplexScript { Val = "20" },
161
+ new Color { Val = "000000" },
162
+ new SmallCaps() // Small caps for section headings
163
+ );
164
+
165
+ styles.Append(new Style(
166
+ new StyleName { Val = "heading 1" },
167
+ new BasedOn { Val = "Normal" },
168
+ new NextParagraphStyle { Val = "Normal" },
169
+ new UIPriority { Val = 9 },
170
+ new PrimaryStyle(),
171
+ new StyleParagraphProperties(
172
+ new KeepNext(),
173
+ new KeepLines(),
174
+ new Justification { Val = JustificationValues.Center },
175
+ new SpacingBetweenLines { Before = "240", After = "120" },
176
+ new Indentation { FirstLine = "0" },
177
+ new OutlineLevel { Val = 0 }
178
+ ),
179
+ h1RPr
180
+ )
181
+ {
182
+ Type = StyleValues.Paragraph,
183
+ StyleId = "Heading1",
184
+ Default = false
185
+ });
186
+
187
+ // ── Heading 2: 10pt italic, flush left ──
188
+ // IEEEtran \subsection: \itshape at body size, flush left
189
+ var h2RPr = new StyleRunProperties(
190
+ new RunFonts
191
+ {
192
+ Ascii = "Times New Roman",
193
+ HighAnsi = "Times New Roman",
194
+ EastAsia = "SimSun",
195
+ ComplexScript = "Times New Roman"
196
+ },
197
+ new FontSize { Val = "20" }, // 10pt — same as body
198
+ new FontSizeComplexScript { Val = "20" },
199
+ new Color { Val = "000000" },
200
+ new Italic() // Italic for subsection headings
201
+ );
202
+
203
+ styles.Append(new Style(
204
+ new StyleName { Val = "heading 2" },
205
+ new BasedOn { Val = "Normal" },
206
+ new NextParagraphStyle { Val = "Normal" },
207
+ new UIPriority { Val = 9 },
208
+ new PrimaryStyle(),
209
+ new StyleParagraphProperties(
210
+ new KeepNext(),
211
+ new KeepLines(),
212
+ new SpacingBetweenLines { Before = "180", After = "60" },
213
+ new Indentation { FirstLine = "0" },
214
+ new OutlineLevel { Val = 1 }
215
+ ),
216
+ h2RPr
217
+ )
218
+ {
219
+ Type = StyleValues.Paragraph,
220
+ StyleId = "Heading2",
221
+ Default = false
222
+ });
223
+
224
+ // ── Abstract style: 9pt bold "Abstract" label convention ──
225
+ styles.Append(CreateParagraphStyle(
226
+ styleId: "Abstract",
227
+ styleName: "Abstract",
228
+ basedOn: "Normal",
229
+ uiPriority: 11
230
+ ));
231
+
232
+ // ── Caption style: 8pt (sz=16) ──
233
+ styles.Append(CreateCaptionStyle(
234
+ fontSizeHalfPts: "16", // 8pt — IEEE standard caption size
235
+ color: "000000",
236
+ italic: false // IEEE captions are not italic
237
+ ));
238
+
239
+ // ── Page setup: US Letter, IEEE margins, two-column ──
240
+ // IEEEtran.cls: top=0.75in, bottom=1in, left=right=0.625in
241
+ var sectPr = new SectionProperties(
242
+ new WpPageSize { Width = 12240U, Height = 15840U }, // US Letter
243
+ new PageMargin
244
+ {
245
+ Top = 1080, // 0.75in
246
+ Bottom = 1440, // 1in
247
+ Left = 900U, // 0.625in
248
+ Right = 900U, // 0.625in
249
+ Header = 720U, Footer = 720U, Gutter = 0U
250
+ },
251
+ // Two-column layout: 0.25in gutter = 360 DXA
252
+ new WpColumns { ColumnCount = 2, Space = "360" }
253
+ );
254
+
255
+ // ── Page numbers: bottom center, 8pt ──
256
+ AddPageNumberFooter(mainPart, sectPr,
257
+ alignment: JustificationValues.Center,
258
+ fontSizeHalfPts: "16", // 8pt
259
+ color: "000000",
260
+ format: PageNumberFormat.Plain
261
+ );
262
+
263
+ // ── Sample content: IEEE paper structure ──
264
+
265
+ // Title (spans both columns via the Title style)
266
+ body.Append(new Paragraph(
267
+ new ParagraphProperties(
268
+ new ParagraphStyleId { Val = "Title" }
269
+ ),
270
+ new Run(new Text("Deep Learning Approaches for Automated Document Layout Analysis"))
271
+ ));
272
+
273
+ // Author line (centered, no indent)
274
+ body.Append(new Paragraph(
275
+ new ParagraphProperties(
276
+ new Justification { Val = JustificationValues.Center },
277
+ new SpacingBetweenLines { After = "120" },
278
+ new Indentation { FirstLine = "0" }
279
+ ),
280
+ new Run(
281
+ new RunProperties(new FontSize { Val = "20" }, new FontSizeComplexScript { Val = "20" }),
282
+ new Text("Jane A. Smith, John B. Doe, and Alice C. Johnson")
283
+ )
284
+ ));
285
+
286
+ // Affiliation (centered, italic, smaller)
287
+ body.Append(new Paragraph(
288
+ new ParagraphProperties(
289
+ new Justification { Val = JustificationValues.Center },
290
+ new SpacingBetweenLines { After = "240" },
291
+ new Indentation { FirstLine = "0" }
292
+ ),
293
+ new Run(
294
+ new RunProperties(
295
+ new FontSize { Val = "18" }, new FontSizeComplexScript { Val = "18" },
296
+ new Italic()
297
+ ),
298
+ new Text("Department of Computer Science, Example University, City, Country")
299
+ )
300
+ ));
301
+
302
+ // Abstract
303
+ body.Append(new Paragraph(
304
+ new ParagraphProperties(
305
+ new ParagraphStyleId { Val = "Abstract" },
306
+ new Indentation { FirstLine = "0" },
307
+ new SpacingBetweenLines { After = "120" }
308
+ ),
309
+ new Run(
310
+ new RunProperties(new Bold(), new Italic(), new FontSize { Val = "18" }, new FontSizeComplexScript { Val = "18" }),
311
+ new Text("Abstract") { Space = SpaceProcessingModeValues.Preserve }
312
+ ),
313
+ new Run(
314
+ new RunProperties(new FontSize { Val = "18" }, new FontSizeComplexScript { Val = "18" }),
315
+ new Text("\u2014This paper presents a comprehensive framework for automated document "
316
+ + "layout analysis using deep learning. We propose a novel architecture that "
317
+ + "combines convolutional neural networks with transformer-based attention "
318
+ + "mechanisms to accurately segment and classify document regions. Experimental "
319
+ + "results on benchmark datasets demonstrate state-of-the-art performance.")
320
+ { Space = SpaceProcessingModeValues.Preserve }
321
+ )
322
+ ));
323
+
324
+ // I. INTRODUCTION (Roman numeral convention rendered in text)
325
+ body.Append(new Paragraph(
326
+ new ParagraphProperties(
327
+ new ParagraphStyleId { Val = "Heading1" }
328
+ ),
329
+ new Run(new Text("I. Introduction"))
330
+ ));
331
+
332
+ AddSampleParagraph(body, "Document layout analysis is a fundamental step in document "
333
+ + "understanding pipelines. The ability to automatically identify and classify "
334
+ + "regions within a document image has applications in digitization, information "
335
+ + "extraction, and accessibility.", "Normal");
336
+
337
+ AddSampleParagraph(body, "Recent advances in deep learning have significantly improved "
338
+ + "the accuracy of layout analysis systems. However, challenges remain in handling "
339
+ + "complex multi-column layouts and heterogeneous document types.", "Normal");
340
+
341
+ // II. RELATED WORK
342
+ body.Append(new Paragraph(
343
+ new ParagraphProperties(
344
+ new ParagraphStyleId { Val = "Heading1" }
345
+ ),
346
+ new Run(new Text("II. Related Work"))
347
+ ));
348
+
349
+ // A. Subsection
350
+ body.Append(new Paragraph(
351
+ new ParagraphProperties(
352
+ new ParagraphStyleId { Val = "Heading2" }
353
+ ),
354
+ new Run(new Text("A. Traditional Methods"))
355
+ ));
356
+
357
+ AddSampleParagraph(body, "Early approaches to document layout analysis relied on "
358
+ + "rule-based methods and connected component analysis. These methods perform well "
359
+ + "on structured documents but struggle with complex layouts.", "Normal");
360
+
361
+ // B. Subsection
362
+ body.Append(new Paragraph(
363
+ new ParagraphProperties(
364
+ new ParagraphStyleId { Val = "Heading2" }
365
+ ),
366
+ new Run(new Text("B. Deep Learning Methods"))
367
+ ));
368
+
369
+ AddSampleParagraph(body, "Convolutional neural networks have been successfully applied "
370
+ + "to document layout analysis, achieving significant improvements over traditional "
371
+ + "methods on standard benchmarks.", "Normal");
372
+
373
+ // III. PROPOSED METHOD
374
+ body.Append(new Paragraph(
375
+ new ParagraphProperties(
376
+ new ParagraphStyleId { Val = "Heading1" }
377
+ ),
378
+ new Run(new Text("III. Proposed Method"))
379
+ ));
380
+
381
+ AddSampleParagraph(body, "Our proposed framework integrates a feature pyramid network "
382
+ + "backbone with a transformer decoder module. The architecture processes document "
383
+ + "images at multiple scales to capture both fine-grained character-level features "
384
+ + "and coarse layout structures.", "Normal");
385
+
386
+ // Table
387
+ body.Append(CreateThreeLineTable(
388
+ new[] { "Method", "Precision", "Recall", "F1" },
389
+ new[]
390
+ {
391
+ new[] { "Rule-based", "0.823", "0.791", "0.807" },
392
+ new[] { "CNN-only", "0.912", "0.887", "0.899" },
393
+ new[] { "Ours", "0.956", "0.943", "0.949" }
394
+ }
395
+ ));
396
+
397
+ AddSampleParagraph(body, "TABLE I: Comparison of layout analysis methods on PubLayNet.", "Caption");
398
+
399
+ // IV. CONCLUSION
400
+ body.Append(new Paragraph(
401
+ new ParagraphProperties(
402
+ new ParagraphStyleId { Val = "Heading1" }
403
+ ),
404
+ new Run(new Text("IV. Conclusion"))
405
+ ));
406
+
407
+ AddSampleParagraph(body, "We have presented a novel deep learning framework for document "
408
+ + "layout analysis that achieves state-of-the-art results. Future work will explore "
409
+ + "extending the approach to handle more diverse document types.", "Normal");
410
+
411
+ // Section properties must be last child of body
412
+ body.Append(sectPr);
413
+ }
414
+
415
+
416
+ // ════════════════════════════════════════════════════════════════════════
417
+ // RECIPE 7: ACM CONFERENCE (acmart)
418
+ // ════════════════════════════════════════════════════════════════════════
419
+
420
+ /// <summary>
421
+ /// Recipe: ACM Conference Paper (acmart.cls v2.x, ACM Author Guide)
422
+ /// Source: acmart.cls v2.x — the consolidated ACM master article template,
423
+ /// and the ACM Author Guide for typographic specifications.
424
+ ///
425
+ /// Feel: Clean, structured, slightly more open than IEEE.
426
+ /// Best for: ACM conference proceedings (SIGCHI, SIGMOD, SIGGRAPH, etc.),
427
+ /// ACM journal submissions.
428
+ ///
429
+ /// Design rationale (all values from acmart.cls and ACM Author Guide):
430
+ /// - US Letter, 1.25in top/bottom, 0.75in L/R: more generous vertical margins
431
+ /// than IEEE, giving a less cramped appearance.
432
+ /// - Two columns with 0.33in (480 DXA) gutter: slightly wider than IEEE's
433
+ /// 0.25in, providing better visual separation between columns.
434
+ /// - 9pt Times New Roman body (sz=18): ACM's standard body size. The original
435
+ /// acmart uses Linux Libertine, but TNR is the accessible fallback specified
436
+ /// in the ACM Author Guide for systems without Libertine.
437
+ /// - 14.4pt bold title, flush left (sz=29): ACM titles are bold and left-aligned,
438
+ /// unlike IEEE's centered unbolded titles. The 14.4pt size (1.6x body) creates
439
+ /// strong but not overwhelming hierarchy.
440
+ /// - H1: 10pt bold ALL CAPS, flush left, arabic numbered (sz=20). ALL CAPS at
441
+ /// body size with bold creates definitive section breaks.
442
+ /// - H2: 10pt bold title case, flush left (sz=20). Bold without caps is the
443
+ /// minimal step down from H1.
444
+ /// - H3: 10pt bold italic, flush left (sz=20). Adding italic distinguishes
445
+ /// from H2 while maintaining the same weight.
446
+ /// - Single spacing: required for ACM camera-ready format.
447
+ /// - First-line indent ~10pt (200 DXA): slightly larger than IEEE's 0.125in,
448
+ /// matching ACM's convention of a roughly 1em indent at 9pt.
449
+ /// - Captions: 8pt (sz=16) — consistent with ACM figure/table caption style.
450
+ /// - References: 7.5pt (sz=15) — ACM uses a smaller font for the bibliography
451
+ /// to maximize space for content.
452
+ /// </summary>
453
+ public static void CreateACMConferenceDocument(string outputPath)
454
+ {
455
+ using var doc = WordprocessingDocument.Create(outputPath, WordprocessingDocumentType.Document);
456
+
457
+ var mainPart = doc.AddMainDocumentPart();
458
+ mainPart.Document = new Document(new Body());
459
+ var body = mainPart.Document.Body!;
460
+
461
+ // ── Styles ──
462
+ var stylesPart = mainPart.AddNewPart<StyleDefinitionsPart>();
463
+ stylesPart.Styles = new Styles();
464
+ var styles = stylesPart.Styles;
465
+
466
+ // DocDefaults: Times New Roman 9pt (TNR as Libertine fallback), single spacing
467
+ styles.Append(new DocDefaults(
468
+ new RunPropertiesDefault(
469
+ new RunPropertiesBaseStyle(
470
+ new RunFonts
471
+ {
472
+ // ACM specifies Linux Libertine; TNR is the accessible fallback
473
+ // per ACM Author Guide for systems without Libertine installed
474
+ Ascii = "Times New Roman",
475
+ HighAnsi = "Times New Roman",
476
+ EastAsia = "SimSun",
477
+ ComplexScript = "Times New Roman"
478
+ },
479
+ new FontSize { Val = "18" }, // 9pt body (acmart standard)
480
+ new FontSizeComplexScript { Val = "18" },
481
+ new Color { Val = "000000" }, // Pure black
482
+ new Languages { Val = "en-US", EastAsia = "zh-CN" }
483
+ )
484
+ ),
485
+ new ParagraphPropertiesDefault(
486
+ new ParagraphPropertiesBaseStyle(
487
+ new SpacingBetweenLines
488
+ {
489
+ // Single spacing: ACM camera-ready requirement
490
+ Line = "240",
491
+ LineRule = LineSpacingRuleValues.Auto,
492
+ After = "0",
493
+ Before = "0"
494
+ },
495
+ // First-line indent: ~10pt = 200 DXA (roughly 1em at 9pt)
496
+ new Indentation { FirstLine = "200" }
497
+ )
498
+ )
499
+ ));
500
+
501
+ // ── Normal style ──
502
+ styles.Append(CreateParagraphStyle(
503
+ styleId: "Normal",
504
+ styleName: "Normal",
505
+ isDefault: true,
506
+ uiPriority: 0
507
+ ));
508
+
509
+ // ── Title style: 14.4pt bold, flush left ──
510
+ // acmart \maketitle: \LARGE\bfseries, left-aligned
511
+ var titleRPr = new StyleRunProperties(
512
+ new RunFonts
513
+ {
514
+ Ascii = "Times New Roman",
515
+ HighAnsi = "Times New Roman",
516
+ EastAsia = "SimSun",
517
+ ComplexScript = "Times New Roman"
518
+ },
519
+ new FontSize { Val = "29" }, // 14.4pt (≈29 half-points)
520
+ new FontSizeComplexScript { Val = "29" },
521
+ new Color { Val = "000000" },
522
+ new Bold() // ACM titles ARE bold
523
+ );
524
+
525
+ styles.Append(new Style(
526
+ new StyleName { Val = "Title" },
527
+ new BasedOn { Val = "Normal" },
528
+ new NextParagraphStyle { Val = "Normal" },
529
+ new UIPriority { Val = 10 },
530
+ new PrimaryStyle(),
531
+ new StyleParagraphProperties(
532
+ // Flush left — ACM titles are NOT centered
533
+ new SpacingBetweenLines { Before = "0", After = "200" },
534
+ new Indentation { FirstLine = "0" }
535
+ ),
536
+ titleRPr
537
+ )
538
+ {
539
+ Type = StyleValues.Paragraph,
540
+ StyleId = "Title",
541
+ Default = false
542
+ });
543
+
544
+ // ── Heading 1: 10pt bold ALL CAPS, flush left ──
545
+ // acmart \section: \bfseries at body size, uppercase
546
+ var h1RPr = new StyleRunProperties(
547
+ new RunFonts
548
+ {
549
+ Ascii = "Times New Roman",
550
+ HighAnsi = "Times New Roman",
551
+ EastAsia = "SimSun",
552
+ ComplexScript = "Times New Roman"
553
+ },
554
+ new FontSize { Val = "20" }, // 10pt
555
+ new FontSizeComplexScript { Val = "20" },
556
+ new Color { Val = "000000" },
557
+ new Bold(),
558
+ new Caps() // ALL CAPS for H1
559
+ );
560
+
561
+ styles.Append(new Style(
562
+ new StyleName { Val = "heading 1" },
563
+ new BasedOn { Val = "Normal" },
564
+ new NextParagraphStyle { Val = "Normal" },
565
+ new UIPriority { Val = 9 },
566
+ new PrimaryStyle(),
567
+ new StyleParagraphProperties(
568
+ new KeepNext(),
569
+ new KeepLines(),
570
+ new SpacingBetweenLines { Before = "240", After = "120" },
571
+ new Indentation { FirstLine = "0" },
572
+ new OutlineLevel { Val = 0 }
573
+ ),
574
+ h1RPr
575
+ )
576
+ {
577
+ Type = StyleValues.Paragraph,
578
+ StyleId = "Heading1",
579
+ Default = false
580
+ });
581
+
582
+ // ── Heading 2: 10pt bold title case, flush left ──
583
+ // acmart \subsection: \bfseries, no case change
584
+ var h2RPr = new StyleRunProperties(
585
+ new RunFonts
586
+ {
587
+ Ascii = "Times New Roman",
588
+ HighAnsi = "Times New Roman",
589
+ EastAsia = "SimSun",
590
+ ComplexScript = "Times New Roman"
591
+ },
592
+ new FontSize { Val = "20" }, // 10pt
593
+ new FontSizeComplexScript { Val = "20" },
594
+ new Color { Val = "000000" },
595
+ new Bold() // Bold, no caps
596
+ );
597
+
598
+ styles.Append(new Style(
599
+ new StyleName { Val = "heading 2" },
600
+ new BasedOn { Val = "Normal" },
601
+ new NextParagraphStyle { Val = "Normal" },
602
+ new UIPriority { Val = 9 },
603
+ new PrimaryStyle(),
604
+ new StyleParagraphProperties(
605
+ new KeepNext(),
606
+ new KeepLines(),
607
+ new SpacingBetweenLines { Before = "200", After = "80" },
608
+ new Indentation { FirstLine = "0" },
609
+ new OutlineLevel { Val = 1 }
610
+ ),
611
+ h2RPr
612
+ )
613
+ {
614
+ Type = StyleValues.Paragraph,
615
+ StyleId = "Heading2",
616
+ Default = false
617
+ });
618
+
619
+ // ── Heading 3: 10pt bold italic, flush left ──
620
+ // acmart \subsubsection: \bfseries\itshape
621
+ var h3RPr = new StyleRunProperties(
622
+ new RunFonts
623
+ {
624
+ Ascii = "Times New Roman",
625
+ HighAnsi = "Times New Roman",
626
+ EastAsia = "SimSun",
627
+ ComplexScript = "Times New Roman"
628
+ },
629
+ new FontSize { Val = "20" }, // 10pt
630
+ new FontSizeComplexScript { Val = "20" },
631
+ new Color { Val = "000000" },
632
+ new Bold(),
633
+ new Italic() // Bold italic for H3
634
+ );
635
+
636
+ styles.Append(new Style(
637
+ new StyleName { Val = "heading 3" },
638
+ new BasedOn { Val = "Normal" },
639
+ new NextParagraphStyle { Val = "Normal" },
640
+ new UIPriority { Val = 9 },
641
+ new PrimaryStyle(),
642
+ new StyleParagraphProperties(
643
+ new KeepNext(),
644
+ new KeepLines(),
645
+ new SpacingBetweenLines { Before = "160", After = "60" },
646
+ new Indentation { FirstLine = "0" },
647
+ new OutlineLevel { Val = 2 }
648
+ ),
649
+ h3RPr
650
+ )
651
+ {
652
+ Type = StyleValues.Paragraph,
653
+ StyleId = "Heading3",
654
+ Default = false
655
+ });
656
+
657
+ // ── Caption style: 8pt (sz=16) ──
658
+ styles.Append(CreateCaptionStyle(
659
+ fontSizeHalfPts: "16", // 8pt — ACM standard caption size
660
+ color: "000000",
661
+ italic: false
662
+ ));
663
+
664
+ // ── References style: 7.5pt (sz=15) ──
665
+ var refsRPr = new StyleRunProperties(
666
+ new FontSize { Val = "15" }, // 7.5pt
667
+ new FontSizeComplexScript { Val = "15" }
668
+ );
669
+
670
+ styles.Append(new Style(
671
+ new StyleName { Val = "References" },
672
+ new BasedOn { Val = "Normal" },
673
+ new UIPriority { Val = 37 },
674
+ new PrimaryStyle(),
675
+ new StyleParagraphProperties(
676
+ new SpacingBetweenLines { After = "40" },
677
+ new Indentation { FirstLine = "0", Left = "360", Hanging = "360" }
678
+ ),
679
+ refsRPr
680
+ )
681
+ {
682
+ Type = StyleValues.Paragraph,
683
+ StyleId = "References",
684
+ Default = false
685
+ });
686
+
687
+ // ── Page setup: US Letter, ACM margins, two-column ──
688
+ // acmart.cls: top=1.25in, bottom=1.25in, left=right=0.75in
689
+ var sectPr = new SectionProperties(
690
+ new WpPageSize { Width = 12240U, Height = 15840U }, // US Letter
691
+ new PageMargin
692
+ {
693
+ Top = 1800, // 1.25in
694
+ Bottom = 1800, // 1.25in
695
+ Left = 1080U, // 0.75in
696
+ Right = 1080U, // 0.75in
697
+ Header = 720U, Footer = 720U, Gutter = 0U
698
+ },
699
+ // Two-column layout: 0.33in gutter = 480 DXA
700
+ new WpColumns { ColumnCount = 2, Space = "480" }
701
+ );
702
+
703
+ // ── Page numbers: bottom center, 8pt ──
704
+ AddPageNumberFooter(mainPart, sectPr,
705
+ alignment: JustificationValues.Center,
706
+ fontSizeHalfPts: "16", // 8pt
707
+ color: "000000",
708
+ format: PageNumberFormat.Plain
709
+ );
710
+
711
+ // ── Sample content: ACM paper structure ──
712
+
713
+ // Title (flush left, bold)
714
+ body.Append(new Paragraph(
715
+ new ParagraphProperties(
716
+ new ParagraphStyleId { Val = "Title" }
717
+ ),
718
+ new Run(new Text("Towards Scalable Graph Neural Networks for Heterogeneous Document Understanding"))
719
+ ));
720
+
721
+ // Author block (flush left)
722
+ body.Append(new Paragraph(
723
+ new ParagraphProperties(
724
+ new SpacingBetweenLines { After = "60" },
725
+ new Indentation { FirstLine = "0" }
726
+ ),
727
+ new Run(
728
+ new RunProperties(new FontSize { Val = "18" }, new FontSizeComplexScript { Val = "18" }),
729
+ new Text("Maria R. Garcia")
730
+ )
731
+ ));
732
+
733
+ body.Append(new Paragraph(
734
+ new ParagraphProperties(
735
+ new SpacingBetweenLines { After = "60" },
736
+ new Indentation { FirstLine = "0" }
737
+ ),
738
+ new Run(
739
+ new RunProperties(
740
+ new FontSize { Val = "16" }, new FontSizeComplexScript { Val = "16" },
741
+ new Italic()
742
+ ),
743
+ new Text("Example University, City, Country")
744
+ )
745
+ ));
746
+
747
+ body.Append(new Paragraph(
748
+ new ParagraphProperties(
749
+ new SpacingBetweenLines { After = "200" },
750
+ new Indentation { FirstLine = "0" }
751
+ ),
752
+ new Run(
753
+ new RunProperties(
754
+ new FontSize { Val = "16" }, new FontSizeComplexScript { Val = "16" }
755
+ ),
756
+ new Text("garcia@example.edu")
757
+ )
758
+ ));
759
+
760
+ // Abstract section
761
+ body.Append(new Paragraph(
762
+ new ParagraphProperties(
763
+ new Indentation { FirstLine = "0" },
764
+ new SpacingBetweenLines { After = "80" }
765
+ ),
766
+ new Run(
767
+ new RunProperties(
768
+ new Bold(),
769
+ new FontSize { Val = "18" }, new FontSizeComplexScript { Val = "18" }
770
+ ),
771
+ new Text("ABSTRACT")
772
+ )
773
+ ));
774
+
775
+ AddSampleParagraph(body, "Graph neural networks (GNNs) have emerged as a powerful tool for "
776
+ + "document understanding tasks that require modeling relationships between document "
777
+ + "elements. We present a scalable GNN architecture that processes heterogeneous "
778
+ + "document graphs containing text, table, and figure nodes. Our approach achieves "
779
+ + "competitive results while reducing computational costs by 40%.", "Normal");
780
+
781
+ // CCS Concepts / Keywords (ACM-specific metadata)
782
+ body.Append(new Paragraph(
783
+ new ParagraphProperties(
784
+ new Indentation { FirstLine = "0" },
785
+ new SpacingBetweenLines { Before = "120", After = "120" }
786
+ ),
787
+ new Run(
788
+ new RunProperties(
789
+ new Bold(),
790
+ new FontSize { Val = "16" }, new FontSizeComplexScript { Val = "16" }
791
+ ),
792
+ new Text("Keywords: ") { Space = SpaceProcessingModeValues.Preserve }
793
+ ),
794
+ new Run(
795
+ new RunProperties(
796
+ new FontSize { Val = "16" }, new FontSizeComplexScript { Val = "16" }
797
+ ),
798
+ new Text("graph neural networks, document understanding, scalability")
799
+ )
800
+ ));
801
+
802
+ // 1 INTRODUCTION (arabic numbered, ALL CAPS via style)
803
+ body.Append(new Paragraph(
804
+ new ParagraphProperties(
805
+ new ParagraphStyleId { Val = "Heading1" }
806
+ ),
807
+ new Run(new Text("1 Introduction"))
808
+ ));
809
+
810
+ AddSampleParagraph(body, "Document understanding encompasses a broad set of tasks including "
811
+ + "layout analysis, information extraction, and document classification. Recent work "
812
+ + "has demonstrated that modeling the structural relationships between document "
813
+ + "elements can significantly improve performance on these tasks.", "Normal");
814
+
815
+ AddSampleParagraph(body, "Graph neural networks provide a natural framework for representing "
816
+ + "and reasoning about document structure. However, existing GNN-based approaches face "
817
+ + "scalability challenges when processing large or complex documents.", "Normal");
818
+
819
+ // 2 RELATED WORK
820
+ body.Append(new Paragraph(
821
+ new ParagraphProperties(
822
+ new ParagraphStyleId { Val = "Heading1" }
823
+ ),
824
+ new Run(new Text("2 Related Work"))
825
+ ));
826
+
827
+ // 2.1 Subsection
828
+ body.Append(new Paragraph(
829
+ new ParagraphProperties(
830
+ new ParagraphStyleId { Val = "Heading2" }
831
+ ),
832
+ new Run(new Text("2.1 Document Representation Learning"))
833
+ ));
834
+
835
+ AddSampleParagraph(body, "Pre-trained language models have been adapted for document "
836
+ + "understanding by incorporating layout information. LayoutLM and its successors "
837
+ + "demonstrate the value of multi-modal pre-training for document tasks.", "Normal");
838
+
839
+ // 2.1.1 Sub-subsection
840
+ body.Append(new Paragraph(
841
+ new ParagraphProperties(
842
+ new ParagraphStyleId { Val = "Heading3" }
843
+ ),
844
+ new Run(new Text("2.1.1 Multi-Modal Approaches"))
845
+ ));
846
+
847
+ AddSampleParagraph(body, "Multi-modal approaches jointly model text, layout, and visual "
848
+ + "features. This integration has proven critical for tasks where visual appearance "
849
+ + "carries semantic meaning, such as form understanding.", "Normal");
850
+
851
+ // 3 METHOD
852
+ body.Append(new Paragraph(
853
+ new ParagraphProperties(
854
+ new ParagraphStyleId { Val = "Heading1" }
855
+ ),
856
+ new Run(new Text("3 Proposed Method"))
857
+ ));
858
+
859
+ AddSampleParagraph(body, "We propose HetDocGNN, a heterogeneous graph neural network "
860
+ + "designed specifically for document understanding. The architecture operates on "
861
+ + "a document graph where nodes represent text blocks, tables, and figures, and "
862
+ + "edges encode spatial and logical relationships.", "Normal");
863
+
864
+ // Results table
865
+ body.Append(CreateThreeLineTable(
866
+ new[] { "Model", "DocVQA", "InfoVQA", "Params" },
867
+ new[]
868
+ {
869
+ new[] { "LayoutLMv3", "83.4", "45.1", "133M" },
870
+ new[] { "UDOP", "84.7", "47.4", "770M" },
871
+ new[] { "HetDocGNN", "85.2", "48.9", "89M" }
872
+ }
873
+ ));
874
+
875
+ AddSampleParagraph(body, "Table 1: Comparison on document understanding benchmarks.", "Caption");
876
+
877
+ // 4 CONCLUSION
878
+ body.Append(new Paragraph(
879
+ new ParagraphProperties(
880
+ new ParagraphStyleId { Val = "Heading1" }
881
+ ),
882
+ new Run(new Text("4 Conclusion"))
883
+ ));
884
+
885
+ AddSampleParagraph(body, "We have presented HetDocGNN, a scalable graph neural network "
886
+ + "for heterogeneous document understanding. Our approach achieves state-of-the-art "
887
+ + "results with significantly fewer parameters than competing methods.", "Normal");
888
+
889
+ // REFERENCES section
890
+ body.Append(new Paragraph(
891
+ new ParagraphProperties(
892
+ new ParagraphStyleId { Val = "Heading1" }
893
+ ),
894
+ new Run(new Text("References"))
895
+ ));
896
+
897
+ // Sample references in ACM style (7.5pt)
898
+ AddSampleParagraph(body, "[1] Yiheng Xu, et al. 2020. LayoutLM: Pre-training of Text and "
899
+ + "Layout for Document Image Understanding. In KDD '20. ACM, 1192\u20131200.", "References");
900
+
901
+ AddSampleParagraph(body, "[2] Zhiliang Peng, et al. 2023. UDOP: Unifying Vision, Text, "
902
+ + "and Layout for Universal Document Processing. In CVPR '23. 19254\u201319264.", "References");
903
+
904
+ AddSampleParagraph(body, "[3] Zilong Wang, et al. 2022. DocFormer: End-to-End Transformer "
905
+ + "for Document Understanding. In ICCV '22. 993\u20131003.", "References");
906
+
907
+ // Section properties must be last child of body
908
+ body.Append(sectPr);
909
+ }
910
+ }