Hey guys.
I'm having some difficulties with counters.
Here's my code (in SASS):
Only target-counter seems to be working, every other counter seems to be stuck at 1. Any help?
(attached is a screenshot of the issue. The two counts on the screenshot refer to the same element. The first one uses a target counter)
I'm having some difficulties with counters.
Here's my code (in SASS):
.chapter {
border: 0;
page: chapter;
prince-page-group: start;
page-break-after: always;
h1.chapter-title {
margin: -35.2mm -15mm 5.2mm;
padding: 35.2mm 15mm 0;
counter-increment: chapter_count;
counter-reset: section_count;
counter-reset: figure_count;
&::before {
content: counter(chapter_count) '.';
}
}
h2 {
counter-increment: section_count;
&::before {
content: counter(chapter_count) '.' counter(section_count) '.';
}
}
figure {
counter-increment: figure_count;
margin-bottom: 5mm;
figcaption {
font-size: 9pt;
color: #555;
&::before {
content: 'Figure ' counter(chapter_count) '.' counter(figure_count) ': ';
}
}
}
a.figure-link {
content: 'Figure ' target-counter(attr(href), chapter_count) '.' target-counter(attr(href), figure_count);
}
ul, ol {
page-break-inside: avoid;
}
}
Only target-counter seems to be working, every other counter seems to be stuck at 1. Any help?
(attached is a screenshot of the issue. The two counts on the screenshot refer to the same element. The first one uses a target counter)