setup_chapter_headers
Puts the current chapter title in each Word page header using STYLEREF fields, avoiding section breaks. Can include heading numbers and skip the first-page header.
Instructions
Put the current chapter title in the running header via a STYLEREF
field referencing the Heading style of level: the standard Word
mechanism, evaluated per page, no per-chapter section breaks needed.
include_number adds the heading number (STYLEREF \n). scope 'auto'
targets every section containing body headings of that level; pass a
list of section indices to override. first_page_blank sets titlePg (no
header on section-opening pages). Watermarks are preserved; other
header content is replaced and reported, with the exact field codes
written. 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 |
|---|---|---|---|
| level | No | ||
| scope | No | auto | |
| backup | No | ||
| alignment | No | right | |
| file_path | Yes | ||
| include_number | No | ||
| first_page_blank | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||