Heading
constructor(depth: Int, text: InlineContent, customId: String? = null, canBreakPage: Boolean = true, canTrackLocation: Boolean = true, excludeFromTableOfContents: Boolean = false)
Parameters
depth
importance (depth=1 for H1, depth=6 for H6)
customId
optional custom ID. If null, the ID is automatically generated. If not null, the ID is used for cross-referencing.
canBreakPage
whether this heading can trigger an automatic page break. Decorative headings and auto-generated section headings typically disable this.
canTrackLocation
whether this heading's position in the document hierarchy is tracked and displayed. When false, the heading is not numbered.
excludeFromTableOfContents
if true, this heading is never included in the table of contents, even if its location is trackable. Useful for headings generated by functions such as .tableofcontents and .bibliography to prevent self-referencing.