page counter reset issue
Having trouble installing Oxygen PDF Chemistry? Got a bug to report? Post it all here.
-
- Posts: 5
- Joined: Wed Jun 26, 2019 3:58 pm
page counter reset issue
I want a contigious page count from first to last page in my generated pdf file.
However, I get a "counter-reset: page 1" on table-of-contents and chapter pages as per default when generating the pdf file.
How can I dissable this counter-reset?
(I'm running XML Editor 21.0, build 2019022207)
However, I get a "counter-reset: page 1" on table-of-contents and chapter pages as per default when generating the pdf file.
How can I dissable this counter-reset?
(I'm running XML Editor 21.0, build 2019022207)
-
- Posts: 846
- Joined: Mon Dec 05, 2011 6:04 pm
Re: page counter reset issue
Hello,
If you use your internet browser's CSS inspector to inspect the intermediate merged.html file resulted in the output folder (as per the method suggested in the Debugging the CSS section from the User-Guide), you should see there is a rule that applies on the very first topic following the TOC and that comes from the default CSS from oxygen_install_dir/frameworks/dita/css/print. For example, in case you are using shallow numbering, the rule comes from the "p-numbering-shallow.css" CSS file.
You could then overwrite that rule in your own customization CSS file, with:
For deep numbering, the default CSS that handles it is "p-numbering-deep.css" and the rule is slightly different (it also has a namespace to control the selected parameter).
So, for deep numbering, in your customization CSS you should add:
Regards,
Costin
If you use your internet browser's CSS inspector to inspect the intermediate merged.html file resulted in the output folder (as per the method suggested in the Debugging the CSS section from the User-Guide), you should see there is a
Code: Select all
[class~="map/map"] > [class~="toc/toc"] + [class~="topic/topic"] {
counter-reset: page 1;
}
You could then overwrite that rule in your own customization CSS file, with:
Code: Select all
[class~="map/map"] > [class~="toc/toc"] + [class~="topic/topic"] {
counter-reset: none;
}
So, for deep numbering, in your customization CSS you should add:
Code: Select all
@namespace p "http://www.oxygenxml.com/extensions/publishing/dita/css/params";
*[class ~= "map/map"][p|numbering^='deep'] > *[class ~= "toc/toc"] + *[class ~= "topic/topic"]{
counter-reset: none;
}
Costin
Costin Sandoi
oXygen XML Editor and Author Support
oXygen XML Editor and Author Support
-
- Posts: 41
- Joined: Wed Aug 14, 2019 9:16 am
Re: page counter reset issue
Hi Costin,
I recently enabled the "deep-chapter-scope-no-page-reset" which works well, however my page numbers no longer reset to 1 (from roman) after the frontmatter. I have tried the following CSS rule, without success:
I would like to set it to start at 1 after the front matter, instead of the tablelist, to enable some flexibility in cases where there is not a tablelist. Is this possible?
Thanks.
I recently enabled the "deep-chapter-scope-no-page-reset" which works well, however my page numbers no longer reset to 1 (from roman) after the frontmatter. I have tried the following CSS rule, without success:
Code: Select all
*[class ~= "map/map"][p|numbering^='deep-chapter-scope-no-page-reset'] *[class ~= "topic/topic"][is-chapter]{
counter-reset: page 1 !important;
}
Thanks.
-
- Posts: 665
- Joined: Wed Oct 16, 2019 3:47 pm
Re: page counter reset issue
Post by julien_lacour »
Hello Duncan,
Why don't you directly use the "deep-chapter-scope" numbering parameter instead of the "deep-chapter-scope-no-page-reset"? (see here for more details)
If you want to customize the numbering, you can copy the default CSS selectors from the Numbering chapter and paste them inside your custom CSS file.
Then just modify until you obtain the desired behavior. The custom CSS files are always processed with bigger priority than the default ones.
Regards,
Julien
Why don't you directly use the "deep-chapter-scope" numbering parameter instead of the "deep-chapter-scope-no-page-reset"? (see here for more details)
If you want to customize the numbering, you can copy the default CSS selectors from the Numbering chapter and paste them inside your custom CSS file.
Then just modify until you obtain the desired behavior. The custom CSS files are always processed with bigger priority than the default ones.
Regards,
Julien
-
- Posts: 41
- Joined: Wed Aug 14, 2019 9:16 am
Re: page counter reset issue
Hi,
If you have any suggestions for the css I would appreciate your input Julien.
As you suggested, I have now tried the "deep-chapter-scope" numbering parameter but am not getting the desired result - it appears to not be prioritising my custom CSS.
For example, it looks like the main difference between the two parameters for the counter reset is the 'page 1', which is not present for the "deep-chapter-scope-no-page-reset".
Copying either of these selectors and adjusting them in my custom CSS isn't having any effect. 
If you have any suggestions for the css I would appreciate your input Julien.
As you suggested, I have now tried the "deep-chapter-scope" numbering parameter but am not getting the desired result - it appears to not be prioritising my custom CSS.
For example, it looks like the main difference between the two parameters for the counter reset is the 'page 1', which is not present for the "deep-chapter-scope-no-page-reset".
Code: Select all
*[class ~= "map/map"][p|numbering^='deep-chapter-scope'] *[class ~= "topic/topic"][is-chapter]{
counter-reset:page 1 section1 tablecount figcount !important;
}
Code: Select all
*[class ~= "map/map"][p|numbering^='deep-chapter-scope-no-page-reset'] *[class ~= "topic/topic"][is-chapter]{
counter-reset: section1 tablecount figcount !important;
}

-
- Posts: 665
- Joined: Wed Oct 16, 2019 3:47 pm
Re: page counter reset issue
Post by julien_lacour »
Hello Duncan,
The page counter is used to reset the page number, it is used in deep-chapter-scope to reset the page numbering at every chapter.
It's not used in the deep-chapter-scope-no-page-reset numbering as we don't want to reset the page at every chapter.
If you need more information about counters, you can see here.
Please note that these selectors use the "p" namespace:
If you edit your CSS file inside Oxygen and you do not declare the namespace it should shows errors when compiling.
After that, the selectors copied in your CSS stylesheet should be applied in the transformation.
Regards,
Julien
The page counter is used to reset the page number, it is used in deep-chapter-scope to reset the page numbering at every chapter.
It's not used in the deep-chapter-scope-no-page-reset numbering as we don't want to reset the page at every chapter.
If you need more information about counters, you can see here.
Please note that these selectors use the "p" namespace:
Code: Select all
@namespace p "http://www.oxygenxml.com/extensions/publishing/dita/css/params";
After that, the selectors copied in your CSS stylesheet should be applied in the transformation.
Regards,
Julien
-
- Posts: 41
- Joined: Wed Aug 14, 2019 9:16 am
Re: page counter reset issue
It isn't working still unfortunately.
I can see and understand how the two different numbering parameters are supposed to work but I can't seem to use either parameter and overrule it in my custom CSS.
Current attempt:
With this, I am getting the following error in Oxygen: "The namespace "p" is not defined"?
Are you able to suggest the CSS (along with the applicable numbering parameter) that will reset the page numbers after the frontmatter only?
Thanks.
I can see and understand how the two different numbering parameters are supposed to work but I can't seem to use either parameter and overrule it in my custom CSS.
Current attempt:
Code: Select all
@namespace p "http://www.oxygenxml.com/extensions/publishing/dita/css/params";
*[class ~= "map/map"][p|numbering^='deep-chapter-scope'] *[class ~= "topic/topic"][is-chapter]{
counter-reset:tablecount figcount !important;
}
Are you able to suggest the CSS (along with the applicable numbering parameter) that will reset the page numbers after the frontmatter only?
Thanks.
-
- Posts: 665
- Joined: Wed Oct 16, 2019 3:47 pm
Re: page counter reset issue
Post by julien_lacour »
Hello Duncan,
To reset your page numbering after the frontmatter do the following:
Julien
To reset your page numbering after the frontmatter do the following:
- Change the args.css.param.numbering parameter to "deep-chapter-scope-no-page-reset"
- In your CSS customization add the following lines:
Please note that the namespace declaration should be done at the beginning of the document.
Code: Select all
@namespace p "http://www.oxygenxml.com/extensions/publishing/dita/css/params"; *[class ~= "map/map"][p|numbering^='deep-chapter-scope-no-page-reset'] *[class ~= "topic/topic"][is-chapter]:first-of-type{ counter-reset:page 1 !important; }
Julien
-
- Posts: 41
- Joined: Wed Aug 14, 2019 9:16 am
Re: page counter reset issue
Hi Julien,
Thanks for that; it did work when the only content in the frontmatter was <toc/>, <figurelist/>, <tablelist/>, as children of a <booklists> element. However, it stops working when there is another child of the <frontmatter>. In my case I use a </preface> element before the <booklists> element to contain a topicref to a revision history topic. When the </preface> element is present, it reverts back to continuing the numbering from the start of the document, even though it isn't classed as a chapter.
Any suggestions as to how to get around this?
I can send you the resulting PDF if that would help.
Regards.
Thanks for that; it did work when the only content in the frontmatter was <toc/>, <figurelist/>, <tablelist/>, as children of a <booklists> element. However, it stops working when there is another child of the <frontmatter>. In my case I use a </preface> element before the <booklists> element to contain a topicref to a revision history topic. When the </preface> element is present, it reverts back to continuing the numbering from the start of the document, even though it isn't classed as a chapter.
Any suggestions as to how to get around this?
I can send you the resulting PDF if that would help.
Regards.
-
- Posts: 665
- Joined: Wed Oct 16, 2019 3:47 pm
Re: page counter reset issue
Post by julien_lacour »
Hello Duncan,
In this case, please use the following:
Regards,
Julien
In this case, please use the following:
Code: Select all
*[class ~= "map/map"][p|numbering^='deep-chapter-scope-no-page-reset'] *[class ~= "topic/topic"]:not([is-chapter]) + *[class ~= "topic/topic"][is-chapter] {
counter-reset:page 1 !important;
}
Julien
-
- Posts: 846
- Joined: Mon Dec 05, 2011 6:04 pm
Re: page counter reset issue
Hi Duncan,
I also tried the Julien's rule and it works correctly - page numbering is reset by the very first chapter, which starts at page 1 in the PDF output.
Most probably, in your CSS you have another rule that uses a selector who overrides this. You should debug your customization CSS and look for any other rules that mess with the page counter.
If you still won't succeed, you could send us both the entire customization .css file that you are using and the intermediary merged.html file from the output folder and we could try to find what's wrong.
Regards,
Costin
I also tried the Julien's rule and it works correctly - page numbering is reset by the very first chapter, which starts at page 1 in the PDF output.
Most probably, in your CSS you have another rule that uses a selector who overrides this. You should debug your customization CSS and look for any other rules that mess with the page counter.
If you still won't succeed, you could send us both the entire customization .css file that you are using and the intermediary merged.html file from the output folder and we could try to find what's wrong.
Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
oXygen XML Editor and Author Support
-
- Posts: 41
- Joined: Wed Aug 14, 2019 9:16 am
Re: page counter reset issue
Hi Costin,
I have been unsuccessful in resolving this issue and cannot find anything that conflicts or overrides the selector unfortunately.
I have emailed the relevant files to recreate the issue, including those you mentioned.
Kind regards.
I have been unsuccessful in resolving this issue and cannot find anything that conflicts or overrides the selector unfortunately.
I have emailed the relevant files to recreate the issue, including those you mentioned.
Kind regards.
-
- Posts: 41
- Joined: Wed Aug 14, 2019 9:16 am
Re: page counter reset issue
Thank you very much for your support and for finding the solution Julien!
Code: Select all
@namespace p "http://www.oxygenxml.com/extensions/publishing/dita/css/params";
*[class ~= "map/map"][p|numbering^='deep-chapter-scope-no-page-reset'] *[class ~= "topic/topic"][is-chapter]{
counter-reset:page 1 !important;
}
*[class ~= "map/map"][p|numbering^='deep-chapter-scope-no-page-reset'] *[class ~= "topic/topic"][is-chapter] + *[class ~= "topic/topic"][is-chapter]{
counter-reset:none !important;
}
-
- Posts: 41
- Joined: Wed Aug 14, 2019 9:16 am
Re: page counter reset issue
Revisiting this topic again: unfortunately I have found with subsequent publications (since upgrade to 22.0) that there is an issue with the figure and table numbering being reset for each chapter. They are numbered according to their chapter; however, the second number is continuous throughout the publication.
I'm using the CSS shown in the previous post, with the args.css.param.numbering parameter set to "deep-chapter-scope-no-page-reset"
List of Figures displays as:
Thanks.
I'm using the CSS shown in the previous post, with the args.css.param.numbering parameter set to "deep-chapter-scope-no-page-reset"
List of Figures displays as:
image.png
List of Tables displays as:
image.png
Any suggestions how I can maintain the flexibility discussed previously regarding frontmatter content, whilst also upholding the intended behaviour of "deep-chapter-scope-no-page-reset"?Thanks.
You do not have the required permissions to view the files attached to this post.
-
- Posts: 665
- Joined: Wed Oct 16, 2019 3:47 pm
Re: page counter reset issue
Post by julien_lacour »
Hello,
I cannot reproduce the issue on my side, normally the figure counter is reset in each chapter:
Then incremented on each <fig> element:
Please check in your CSS customization there is no additional counter-increment on figcount and no <fig> surrounding each others.
Regards,
Julien
I cannot reproduce the issue on my side, normally the figure counter is reset in each chapter:
Code: Select all
*[class ~= "map/map"][numbering^='deep-chapter-scope-no-page-reset'] *[class ~= "topic/topic"][is-chapter]{
counter-reset: section1 tablecount figcount !important;
}
Code: Select all
*[class~="topic/fig"] {
counter-increment: figcount;
}
Regards,
Julien
-
- Posts: 41
- Joined: Wed Aug 14, 2019 9:16 am
Re: page counter reset issue
Hello Julien,
I have had a look into this and cannot find any additional counter-increment on figcount and no <fig> related rules.
Having done some testing, it looks like when the second rule is commented, and the first counter-reset rule is extended to figcount and tablecount, the figure and table numbering is reset at the start of each chapter; however, the page numbers are reset at each chapter :
Making the small change to include the tablecount and figcount to the counter-reset, has no effect on the figure and table numbering, but the page numbers are correct once again (starting at 1 after the frontmatter and continuous through the document):
I have had a look into this and cannot find any additional counter-increment on figcount and no <fig> related rules.
Having done some testing, it looks like when the second rule is commented, and the first counter-reset rule is extended to figcount and tablecount, the figure and table numbering is reset at the start of each chapter; however, the page numbers are reset at each chapter :
Code: Select all
*[class ~= "map/map"][p|numbering^='deep-chapter-scope-no-page-reset'] *[class ~= "topic/topic"][is-chapter]{
counter-reset: tablecount figcount page 1 !important;
}
/*
*[class ~= "map/map"][p|numbering^='deep-chapter-scope-no-page-reset'] *[class ~= "topic/topic"][is-chapter] + *[class ~= "topic/topic"][is-chapter]{
counter-reset:none !important;
}
*/
Code: Select all
*[class ~= "map/map"][p|numbering^='deep-chapter-scope-no-page-reset'] *[class ~= "topic/topic"][is-chapter]{
counter-reset: tablecount figcount page 1 !important;
}
*[class ~= "map/map"][p|numbering^='deep-chapter-scope-no-page-reset'] *[class ~= "topic/topic"][is-chapter] + *[class ~= "topic/topic"][is-chapter]{
counter-reset:none !important;
}
-
- Posts: 665
- Joined: Wed Oct 16, 2019 3:47 pm
Re: page counter reset issue
Post by julien_lacour »
Hello,
Normally the first rule should be used and it should reset the figure number to 1 each time:
Could you precise which version of Oxygen you are currently using?
Could you still reproduce it on the lasts versions (21.1 or 22.0 - I did not reproduce on both).
You can send us a small sample at support@oxygenxml.com for further analysis.
Regards,
Julien
Normally the first rule should be used and it should reset the figure number to 1 each time:
Code: Select all
*[class ~= "map/map"][p|numbering^='deep-chapter-scope-no-page-reset'] *[class ~= "topic/topic"][is-chapter]{
counter-reset: tablecount figcount page 1 !important;
}
Could you still reproduce it on the lasts versions (21.1 or 22.0 - I did not reproduce on both).
You can send us a small sample at support@oxygenxml.com for further analysis.
Regards,
Julien
-
- Posts: 41
- Joined: Wed Aug 14, 2019 9:16 am
Re: page counter reset issue
I am using: XML Editor 22.0, build 2020021016. I believe there was no issue for 21.0, but cannot validate that now.
I have sent you a sample of the files: PDF output, ditamap, CSS, merged HTML.
Thanks.
I have sent you a sample of the files: PDF output, ditamap, CSS, merged HTML.
Thanks.
-
- Posts: 41
- Joined: Wed Aug 14, 2019 9:16 am
Re: page counter reset issue
Thanks for finding the solution Julien.
Figure, table, and page numbering all correct.
Code: Select all
*[class ~= "map/map"][numbering^='deep-chapter-scope-no-page-reset'] *[class ~= "topic/topic"][is-chapter]{
counter-reset: page section1 tablecount figcount !important;
}
*[class ~= "map/map"][numbering^='deep-chapter-scope-no-page-reset'] *[class ~= "topic/topic"][is-chapter] + *[class ~= "topic/topic"][is-chapter]{
counter-reset: section1 tablecount figcount !important;
}
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service