You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

projectdoc Toolbox

Controls whether or not section headings should be numbered. The numbers are added via CSS, therefore they won't work for export formats that do not take CSS into account.

Tags
Identifier
enable-heading-numbers
Type
boolean
Default Value
false
Since
1.5.0

The numbering of headings can be overridden by a document property with the same name (enable-heading-numbers). If this property value is specified, the numbering configuration via space properties is overridden.

The numbering behaviour can also be overridden based on the doctype of the document. The space property suppress-heading-numbers-on-doctypes lists the document types that should not render heading numbers despite the value of the space property enable-heading-numbers.

Style Sheet

Dependent on the numberings parameter of the Section Macro one of the following CSS selectors is rendered:

  • number - renders the number with CSS.
  • nonumber - renders no number.

The style sheet to control the formatting of the headings looks like this:

Heading Formatting
/* ... Counter Configuration ............................................... */
body {
    counter-reset: h1;
}

h1.number {
    counter-reset: h2;
}

h1.number:before {
    counter-increment: h1;
    content: counter(h1) " ";
}

h2.number {
    counter-reset: h3;
}

h2.number:before {
    counter-increment: h2;
    content: counter(h1) "." counter(h2) " ";
}

h3.number {
    counter-reset: h4;
}

h3.number:before {
    counter-increment: h3;
    content: counter(h1) "." counter(h2) "." counter(h3) " ";
}

h4.number {
    counter-reset: h5;
}

h4.number:before {
    counter-increment: h4;
    content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) " ";
}

h5.number {
    counter-reset: h6;
}

h5.number:before {
    counter-increment: h5;
    content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) "." counter(h5)
        " ";
}

h6.number:before {
    counter-increment: h6;
    content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "."
        counter(h6) " ";
}

/* ... No-Counter Configuration ............................................ */
h2.nonumber:before, h3.nonumber:before, h4.nonumber:before, h5.nonumber:before,
    h6.nonumber:before {
    content: "";
    counter-increment: none
} 
 

Since version 1.11 there is an additional rule in the CSS to be applied to spaces where the heading-starting-level is set to 2.

Heading Formatting since 1.11
body {
    counter-reset: h1 h2 table;
}

h1.number {
    counter-reset: h2 h3 h4 h5 h6;
}

h1.number:before {
    counter-increment: h1;
    content: counter(h1) " ";
}

h2.number {
    counter-reset: h3 h4 h5 h6;
}

h2.number:before {
    counter-increment: h2;
    content: counter(h1) "." counter(h2) " ";
}

h2.number.h2:before {
    content: counter(h2) " ";
}

h3.number {
    counter-reset: h4 h5 h6;
}

h3.number:before {
    counter-increment: h3;
    content: counter(h1) "." counter(h2) "." counter(h3) " ";
}

h3.number.h2:before {
    content: counter(h2) "." counter(h3) " ";
}

h4.number {
    counter-reset: h5 h6;
}

h4.number:before {
    counter-increment: h4;
    content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) " ";
}

h4.number.h2:before {
    content: counter(h2) "." counter(h3) "." counter(h4) " ";
}

h5.number {
    counter-reset: h6;
}

h5.number:before {
    counter-increment: h5;
    content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) "." counter(h5)
        " ";
}

h5.number.h2:before {
    content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) " ";
}

h6.number:before {
    counter-increment: h6;
    content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "."
        counter(h6) " ";
}

h6.number.h2:before {
    counter-increment: h6;
    content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "."
        counter(h6) " ";
}

Resources

  • No labels