assemble_front_matter
Insert title page, abstract, TOC, and lists at document start, switching page numbering from lower Roman to decimal. Refuses if front matter already exists unless forced.
Instructions
Assemble long-document front matter in one call: the requested sequence is inserted at the START (existing content becomes the body), page breaks separate front-matter pages, and one section break lets page numbering switch (front lowerRoman, body decimal restarting at 1, by default).
spec = {"sections": [{"kind": "title_page", "lines": [...]}, {"kind": "blank_or_copyright", "lines": [...]}, {"kind": "abstract", "title": "Abstract", "text": "..."}, {"kind": "toc"}, {"kind": "list_of_figures"}, {"kind": "list_of_tables"}], "page_numbering": {"front": "lowerRoman", "body": "decimal", "body_restart_at": 1}}
Title-page lines are centered; the abstract gets a Heading-styled title. Refuses when front matter appears to exist (leading TOC, or a lowerRoman section) unless spec has "force": true. Reports what was inserted and which sections carry which numbering. Auto-backup: prev/anchor slots in .ks4w-backups (backup=False skips rotation only); atomic validated save. Refuses documents open in Word.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| spec | Yes | ||
| backup | No | ||
| file_path | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||