# autopagebreak

    .autopagebreak maxdepth:{Int} -> Void

Content copied to clipboard

Sets a new automatic page break threshold when a heading is found: if a heading's depth value (the amount of leading `#`s) is equal to or less than maxdepth, a page break is forced before the heading.

If this function is not called, automatic page breaks are set depending on the document type. For instance, `paged` documents have automatic page breaks enabled for headings of depth `1` by default.

Any page break can be disabled via disableAutoPageBreak (or by setting maxdepth to `0`).

#### Parameters

maxdepth

heading depth to force page breaks for (positive only).

#### See also

disableAutoPageBreak

#### Throws

IllegalArgumentException

if maxdepth is a negative value

#### Wiki page

page-break