Headers/Footers for Backmatter, Not Frontmatter
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 93
- Joined: Tue Oct 30, 2018 9:47 pm
Headers/Footers for Backmatter, Not Frontmatter
Hi,
The following page explains to use @page matter-page when setting headers and footers for frontmatter and backmatter: https://www.oxygenxml.com/doc/versions/ ... s_css.html. However, is there a way to set headers and footers only for backmatter and not frontmatter? If that isn't possible, is there a way to set headers and footers for a single topic?
Thanks!
The following page explains to use @page matter-page when setting headers and footers for frontmatter and backmatter: https://www.oxygenxml.com/doc/versions/ ... s_css.html. However, is there a way to set headers and footers only for backmatter and not frontmatter? If that isn't possible, is there a way to set headers and footers for a single topic?
Thanks!
-
- Posts: 501
- Joined: Mon Feb 03, 2003 10:56 am
Re: Headers/Footers for Backmatter, Not Frontmatter
You might find useful this topic:
https://www.oxygenxml.com/doc/versions/ ... aid-title5
It shows how to style some topic depending on the role it has in the map.
https://www.oxygenxml.com/doc/versions/ ... aid-title5
It shows how to style some topic depending on the role it has in the map.
-
- Posts: 93
- Joined: Tue Oct 30, 2018 9:47 pm
Re: Headers/Footers for Backmatter, Not Frontmatter
Hi Dan, I've been trying to set up styles for an amendments topic in the backmatter, but something's not working. In the ditamap, the topic appears as follows:
<backmatter>
<amendments
href="../topics/document_revision_history_imm_registry_cfg_5_9_3_1c89200f966e2c6fc115aefceb396acc.dita"
toc="no"/>
</backmatter>
In the css I've added this:
*[class ~= "topic/topic"][topicrefclass ~= "bookmap/amendments"] {
page: docrevhist-page;
}
@page docrefhist-page {
background-color:silver;
@top-center {
content: "Doc Rev Hist"
}
}
In the merged html file I can see the following:
<article xmlns:nd="http://www.oxygenxml.com/css2fo/named-destinations" class="- topic/topic concept/concept topic concept nested0" aria-labelledby="ariaid-title23" id="unique_23" topicrefclass="- map/topicref bookmap/amendments " nd:nd-id="c_7775247ee5eb61928e706de363d3d5f5" oid="c_7775247ee5eb61928e706de363d3d5f5">
The topic isn't being rendered with the styles I specified. Did I miss something?
Thanks again.
<backmatter>
<amendments
href="../topics/document_revision_history_imm_registry_cfg_5_9_3_1c89200f966e2c6fc115aefceb396acc.dita"
toc="no"/>
</backmatter>
In the css I've added this:
*[class ~= "topic/topic"][topicrefclass ~= "bookmap/amendments"] {
page: docrevhist-page;
}
@page docrefhist-page {
background-color:silver;
@top-center {
content: "Doc Rev Hist"
}
}
In the merged html file I can see the following:
<article xmlns:nd="http://www.oxygenxml.com/css2fo/named-destinations" class="- topic/topic concept/concept topic concept nested0" aria-labelledby="ariaid-title23" id="unique_23" topicrefclass="- map/topicref bookmap/amendments " nd:nd-id="c_7775247ee5eb61928e706de363d3d5f5" oid="c_7775247ee5eb61928e706de363d3d5f5">
The topic isn't being rendered with the styles I specified. Did I miss something?
Thanks again.
-
- Posts: 846
- Joined: Mon Dec 05, 2011 6:04 pm
Re: Headers/Footers for Backmatter, Not Frontmatter
Hello,
At a quick look, I noticed a typo in your CSS. Once you use "docrevhist-page" and once "docrefhist-page" (notice the "f" instead of "v")
Regards,
Costin
At a quick look, I noticed a typo in your CSS. Once you use "docrevhist-page" and once "docrefhist-page" (notice the "f" instead of "v")
Could that be the culprit?*[class ~= "topic/topic"][topicrefclass ~= "bookmap/amendments"] {
page: docrevhist-page;
}
@page docrefhist-page {
background-color:silver;
@top-center {
content: "Doc Rev Hist"
}
}
Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
oXygen XML Editor and Author Support
-
- Posts: 93
- Joined: Tue Oct 30, 2018 9:47 pm
Re: Headers/Footers for Backmatter, Not Frontmatter
Thanks Costin, for catching that typo. Unfortunately, even after I correct it, the styles that I specified are not getting applied to the amendments topic. Is there something else that I am missing?
Thanks!
Thanks!
-
- Posts: 93
- Joined: Tue Oct 30, 2018 9:47 pm
Re: Headers/Footers for Backmatter, Not Frontmatter
An update on my experiments: I changed the css to read as follows:
*[class ~= "topic/topic"][topicrefclass ~= "bookmap/amendments"] {
page: docrev;
color: purple;
}
@page docrev {
color: green;
@bottom-center {
content: "Footer Text from docrev page"
}
}
When I transform to PDF, the text in the topic comes out purple. So it picked up a property from our *[class ~= "topic/topic"][topicrefclass ~= "bookmap/amendments"] declaration. However, it still didn't pick up any formatting from the @page docrev declaration. And it appears that header and footer items like @top-center, @bottom-center, etc. can only be used within a @page declaration. Thus, I get a syntax error if I try something like this:
*[class ~= "topic/topic"][topicrefclass ~= "bookmap/amendments"] {
@bottom-center {
content: "Footer Text from docrev page"
}
}
So basically I'm still stuck. However, I think the above observations at least confirm that the selector *[class ~= "topic/topic"][topicrefclass ~= "bookmap/amendments"] does select the correct page. I just wish I knew how to get the reference to the @page declaration to work.
Thanks again!
*[class ~= "topic/topic"][topicrefclass ~= "bookmap/amendments"] {
page: docrev;
color: purple;
}
@page docrev {
color: green;
@bottom-center {
content: "Footer Text from docrev page"
}
}
When I transform to PDF, the text in the topic comes out purple. So it picked up a property from our *[class ~= "topic/topic"][topicrefclass ~= "bookmap/amendments"] declaration. However, it still didn't pick up any formatting from the @page docrev declaration. And it appears that header and footer items like @top-center, @bottom-center, etc. can only be used within a @page declaration. Thus, I get a syntax error if I try something like this:
*[class ~= "topic/topic"][topicrefclass ~= "bookmap/amendments"] {
@bottom-center {
content: "Footer Text from docrev page"
}
}
So basically I'm still stuck. However, I think the above observations at least confirm that the selector *[class ~= "topic/topic"][topicrefclass ~= "bookmap/amendments"] does select the correct page. I just wish I knew how to get the reference to the @page declaration to work.
Thanks again!
-
- Posts: 846
- Joined: Mon Dec 05, 2011 6:04 pm
Re: Headers/Footers for Backmatter, Not Frontmatter
Hi jmorales,
As a general rule, if there are rules that have no impact on the output, then most probably it happens because of two possible causes: the selectors you are using are incorrect (they do not match the specific elements you intend to match), or there might be other rules that have more specific selectors (coming either from the same or from other CSS files - like the default CSS files from oXygen).
You should use the technique described in the "Debugging the CSS" section from the DITA-OT CSS Publishing to PDF Plugin User-Guide
If the selector that you are using matches the right element (you can notice that using your internet browser's CSS inspector tool), then this could be a CSS selectors specificity issue, so you should try to:
- either use a more specific selector instead of
- or use the !important marker on the rule's declarations, like
as described in the "Other techniques" part from the above mentioned User-Guide section.
Regards,
Costin
As a general rule, if there are rules that have no impact on the output, then most probably it happens because of two possible causes: the selectors you are using are incorrect (they do not match the specific elements you intend to match), or there might be other rules that have more specific selectors (coming either from the same or from other CSS files - like the default CSS files from oXygen).
You should use the technique described in the "Debugging the CSS" section from the DITA-OT CSS Publishing to PDF Plugin User-Guide
If the selector that you are using matches the right element (you can notice that using your internet browser's CSS inspector tool), then this could be a CSS selectors specificity issue, so you should try to:
- either use a more specific selector instead of
Code: Select all
*[class ~= "topic/topic"][topicrefclass ~= "bookmap/amendments"]
Code: Select all
page: docrev !important;
color: purple !important;
Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
oXygen XML Editor and Author Support
Return to “DITA (Editing and Publishing DITA Content)”
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