Headline numbering totally distorted when using sections

Steffen Heller
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 26, 2018

Hi everybody,

I use automic numbering for the headlines in my PDF documents (see CSS code below) and it used to work with no problem in a lot of different documents.

Now, for the first time, I needed to use a different structure (sections with two columns side by side) in a documents and that somehow distorts the numbering completely.

To find a solution I created a test document.

The test document contains the same content twice:

  • The first half has all the content within one section
  • The second half has the same content split into three sections

 

Check the result below. It is the outcome of a single PDF file from where I took the text and copied it here.

The result is strange and difficult to describe.

To me, it seems as if each time a new section starts the counters for h2 and h3 were reset in some way (the counter for h1 not, surprisingly!?)

 

Anyone any idea what is happening?

(Using Atlassian Confluence 4.3.7, Server)

 

----------------------------

 

All content within one section (everything correct!):

1. Headline h1

1.1. Headline h2

1.1.1. Headline h3

1.1.2. Headline h3

1.2. Headline h2

1.2.1. Headline h3

1.2.2. Headline h3

1.2.3. Headline h3

1.3. Headline h2

 

The same content split in three sections:

2. Headline h1

2.1. Headline h2

2.1.1. Headline h3

2.1.2. Headline h3

------ New section starts ----------------------------------

2.1. Headline h2 (instead of 2.2.)

2.0.1. Headline h3 (instead of 2.2.1.)

2.0.2. Headline h3 (instead of 2.2.2.)

------ New section starts ----------------------------------

2.0.1. Headline h3 (instead of 2.2.3.)

2.1. Headline h2 (instead of 2.3.)

 

CSS used for automatic headline numbering:

body {
counter-reset: levelA;
}
h2:before {
content: counter(levelA) ". ";
counter-increment: levelA;
}
h2 {
counter-reset:levelB;
}
h3:before {
content: counter(levelA) "." counter(levelB) ". ";
counter-increment: levelB;
}
h3 {
counter-reset:levelC;
}
h4:before {
content: counter(levelA) "." counter(levelB) "." counter(levelC) ". ";
counter-increment: levelC;

 

1 answer

0 votes
Heth Siemer
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 29, 2018

I'm not sure about the CSS... when I tested it myself it worked just fine. (I'm on 5.10.8 so that might be why).

But, there's a macro that handles this for you that you might be interested in, that way you don't have to build the CSS every time:

https://marketplace.atlassian.com/plugins/nl.avisi.confluence.plugins.numberedheadings/cloud/overview

Steffen Heller
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 4, 2018

Thanks for trying. Unfortunately, macros are not an option (long winding internal process and only in very rare cases supported by IT).

But it would be interesting to know if later Confluence versions can handle sections plus numbering!?

For the time being, I will have to remove the headline numbering.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events