matter-page page counter
Having trouble installing Oxygen PDF Chemistry? Got a bug to report? Post it all here.
matter-page page counter
Hi!
I can't figure out how to continue the page count from the table of contents to the matter-page. The page number resets to 1 in the matter-page but I need it to increment from the last page count of the table of contents. I also need to reset the page count for the very first chapter but could not make it work. Please help.
@page matter-page {
counter-reset: none !important;
}
@page chapter:first {
counter-reset: page !important;
counter-increment: page 1 !important;
}
I can't figure out how to continue the page count from the table of contents to the matter-page. The page number resets to 1 in the matter-page but I need it to increment from the last page count of the table of contents. I also need to reset the page count for the very first chapter but could not make it work. Please help.
@page matter-page {
counter-reset: none !important;
}
@page chapter:first {
counter-reset: page !important;
counter-increment: page 1 !important;
}
Re: matter-page page counter
Hi Alicia,
In your customization CSS, you should overwrite the rules that come from the predefined CSS files that control numbering and content for specific named pages.
More specific, the numbering CSS files are available in Oxygen_install_dir\frameworks\dita\DITA-OT3.x\plugins\com.oxygenxml.pdf.css\css\print and their name starts with "p-numbering".
The header content for different page types is styled through "p-pages-and-headers.css", available in the same location.
For example, if you are using shallow numbering, you could use something like:
At anytime, you could use your internet browser's CSS inspector tool to better notice which rules apply and from which CSS they come, so that you could overwrite them in your customization CSS, as described in the Debugging the CSS section from the User-Guide.
Regards,
Costin
In your customization CSS, you should overwrite the rules that come from the predefined CSS files that control numbering and content for specific named pages.
More specific, the numbering CSS files are available in Oxygen_install_dir\frameworks\dita\DITA-OT3.x\plugins\com.oxygenxml.pdf.css\css\print and their name starts with "p-numbering".
The header content for different page types is styled through "p-pages-and-headers.css", available in the same location.
For example, if you are using shallow numbering, you could use something like:
Code: Select all
*[class ~= "map/map"] > *[class ~= "toc/toc"] + *[class ~= "topic/topic"]{
counter-reset: none !important;
}
@page matter-page:left {
@top-left {
content: string(maptitle) string(parttitle) string(chaptertitle) string(sectiontitle) " | " counter(page);
}
}
@page matter-page:right {
@top-right {
content: string(maptitle) string(parttitle) string(chaptertitle) string(sectiontitle) " | " counter(page);
}
}
*[class~="topic/topic"][outputclass ~= "pageReset"]{
counter-reset:page 1;
counter-increment:chapter;
}
Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
oXygen XML Editor and Author Support
Re: matter-page page counter
I forgot to mention that, in order for the selector
to work, in case you didn't figured it out yourself already, you should first set the outputclass="pageReset" to the topicref element from the DITA Map, corresponding to the very 1st Chapter in your publication.
Regards,
Costin
Code: Select all
*[class~="topic/topic"][outputclass ~= "pageReset"]
Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
oXygen XML Editor and Author Support
Re: matter-page page counter
Thanks Costin, that did it! The matter-page and chapter page numbers are fixed now.
Although, a page break gets inserted between the chapter title and the first chapter topic, which still messes up the page number for the chapter title. I'll work on fixing this with the information I got from you.
Thanks so much.
Alice
Although, a page break gets inserted between the chapter title and the first chapter topic, which still messes up the page number for the chapter title. I'll work on fixing this with the information I got from you.
Thanks so much.
Alice
Re: matter-page page counter
I added outputclass="pageReset" to the 1st topicref in the 1st ditamap (chapter).
A page-break was created after the chapter title, which caused the 1st topic to appear on the next page. The chapter title page count did not reset but the topic did. I tried adding page-break-before=avoid but that did not seem to work.
.pageReset {
page-break-before:avoid !important;
}
A page-break was created after the chapter title, which caused the 1st topic to appear on the next page. The chapter title page count did not reset but the topic did. I tried adding page-break-before=avoid but that did not seem to work.
.pageReset {
page-break-before:avoid !important;
}
- Attachments
-
- toc.PNG (9.08 KiB) Viewed 3158 times
Re: matter-page page counter
I could not reproduce this at my side, so it seems to be something specific to your document.
Implicitly, there is a rule that is already applied, coming from "p-page-breaks.css" default CSS file and that should avoid breaking the page between the chapter and the content that follows, as long as you did not overwrite the selector in your CSS.
You should try inspecting the intermediary merged.html file and see what rules and from which CSS files are applied on a specific element, so you this might help in determining the cause for the page break after the topic title. Then you could probably overwrite that behavior through your own rules in the customization CSS.
See the Debugging the CSS section from the User-Guide.
Another thing I think you could try is adding the -oxy-page-group:start; property in your [class~="topic/topic"][outputclass ~= "pageReset"] selector, and remove the page-break-before:avoid !important;.
Hope this helps.
Regards,
Costin
Implicitly, there is a
Code: Select all
[class~="topic/title"] {
page-break-after: avoid;
}
You should try inspecting the intermediary merged.html file and see what rules and from which CSS files are applied on a specific element, so you this might help in determining the cause for the page break after the topic title. Then you could probably overwrite that behavior through your own rules in the customization CSS.
See the Debugging the CSS section from the User-Guide.
Another thing I think you could try is adding the -oxy-page-group:start; property in your [class~="topic/topic"][outputclass ~= "pageReset"] selector, and remove the page-break-before:avoid !important;.
Hope this helps.
Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
oXygen XML Editor and Author Support
Re: matter-page page counter
Thanks Costin! I tried your suggestions and it does apply the following from p-page-breaks.css:
[class~="topic/title"] {
page-break-after: avoid;
}
When I looked at the output .fo file, the page sequence changed. There's now a css2fo-default page-sequence which contains my first topic.
[class~="topic/title"] {
page-break-after: avoid;
}
When I looked at the output .fo file, the page sequence changed. There's now a css2fo-default page-sequence which contains my first topic.
- image.png (12.34 KiB) Viewed 3105 times
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