Forum How do I...?

Problem with counter-reset within a

yet
I have some problem with the following HTML

http://www.immanuel.de/tmp1/index.html

and the following CSS

http://www.immanuel.de/tmp1/styles.css

Result PDF:

http://www.immanuel.de/tmp1/handbuch.pdf

The HTML contains a nested DIV structure where each level of the document
has a CSS l0, l1, l2....

I am using related counter c1, c2, c3...for the depth of the chapters, sections, subsections ..

There is one rule to reset the 'c2' counter for the rule '.l1 .folder-metadata'.
As result I would expect that the PDF bookmark for chapter 2 would look like

2 Patient
2.1 Aufnahme
2.2 Diagnostik
...

but instead we see

2 Patient
2.5 Aufnahme
2.6 Diagnostik
....

I don't get the point why the 'c2' is not being reseted within the .l1
rule?!

Using PrinceXML 7.0b1 here.
jim_albright
You have
.l1 .bookmark-title {
    counter-increment: c1;
    counter-reset: c2;
    prince-bookmark-label: counter(c1) ' ' content();
    prince-bookmark-level: 1;
}


but your text has
<div class="type-folder l1">


It seems to me that your class is not specified correctly.

I would suggest
<div class="type-folder_l1">


.type-folder_l1 .bookmark-title {
    counter-increment: c1;
    counter-reset: c2;
    prince-bookmark-label: counter(c1) ' ' content();
    prince-bookmark-level: 1;
}

Jim Albright
Wycliffe Bible Translators

yet
'type-folder' solves a different purpose. The 'l1', 'l2' etc. classes
are correctly spelled and they are correctly referenced through CSS.

jim_albright wrote:
You have
.l1 .bookmark-title {
    counter-increment: c1;
    counter-reset: c2;
    prince-bookmark-label: counter(c1) ' ' content();
    prince-bookmark-level: 1;
}


but your text has
<div class="type-folder l1">


It seems to me that your class is not specified correctly.

I would suggest
<div class="type-folder_l1">


.type-folder_l1 .bookmark-title {
    counter-increment: c1;
    counter-reset: c2;
    prince-bookmark-label: counter(c1) ' ' content();
    prince-bookmark-level: 1;
}
jim_albright
I keep on learning. I didn't know I could include space delimited multiple classes.

Jim Albright
Wycliffe Bible Translators

yet
jim_albright wrote:
I keep on learning. I didn't know I could include space delimited multiple classes.


I could resolve this issue by moving the counter-increment|reset rules
into dedicated rules for .lX like:

.l1 {
counter-increment:c1;
counter-reset: c2;
}