numbering

fun numbering(merge: Boolean = true, formats: Map<String, Any>): Void

Sets the global numbering format across the document. Numbering is applied to elements that support it, such as headings and figures.

  • If a format is none, that kind of numbering is disabled.

  • Otherwise, it accepts a string where each character represents a symbol. Some characters are reserved for counting:

    • 1 for decimal (1, 2, 3, ...)

    • a for lowercase latin alphabet (a, b, c, ...)

    • A for uppercase latin alphabet (A, B, C, ...)

    • i for lowercase roman numerals (i, ii, iii, ...)

    • I for uppercase roman numerals (I, II, III, ...)

    Any other character is considered a fixed symbol.

Sample numbering strings are 1.1.1, 1.A.a, A.A.

.numbering
- headings: 1.1
- figures: 1.a

If this function is not called, the default numbering format is picked depending on the document type.

Parameters

merge

if true, merges the given formats with the current ones (including defaults), so that unspecified formats are kept unchanged. If false, completely overrides the current formats, so that unspecified formats are disabled.

formats

dictionary of numbering formats for different element types. Built-in keys are:

  • headings, used for headings (titles) and tableofcontents entries;

  • figures, used for captioned images;

  • tables, used for captioned tables;

  • equations, used for math blocks;

  • code, used for code blocks;

  • footnotes, used for footnotes and references to them. Any other key can be addressed by custom elements (see numbered).

Wiki page

Numbering