Page 1 of 1
Topic titles in a header
Posted: Wed Apr 03, 2019 6:29 pm
by MyMoon
Hi!
I've prepared stringsets for headers:
Code: Select all
*[class ~= "map/map"] >
*[class ~= "topic/topic"] >
*[class ~= "topic/topic"] >
*[class ~= "topic/title"]
{
string-set: chaptertitle2 content()
}
*[class ~= "map/map"] >
*[class ~= "topic/topic"] >
*[class ~= "topic/topic"] >
*[class ~= "topic/topic"] >
*[class ~= "topic/title"]
{
string-set: chaptertitle3 content()
}
And assigned it to place:
Code: Select all
@page :left {
@top-right {
content: string(maptitle) "\A" string(chaptertitle2) "\A" string(chaptertitle3);
font-family: 'PT Sans', PTSans, sans-serif !important;
font-size:8pt;
color:white;
}
But it appears that 3-rd level topic's title repeats on pages of next chapter, with higher level. How is that possible? How to interrupt it?
Re: Topic titles in a header
Posted: Fri Apr 05, 2019 12:59 pm
by Dan
You need to reset that string on chapters of higher level. See that a string-set may define multiple values at once.
For example in the default CSS we have a reset of the
sectiontitle at each top level chapter title element:
Code: Select all
..
*[class ~= "topic/topic"][is-chapter]:not([is-part]) > *[class ~= "topic/title"] {
string-set: chaptertitle " | " counter(chapter) " - " content(), sectiontitle "";
}
..
Probably it should be like:
Code: Select all
*[class ~= "map/map"] >
*[class ~= "topic/topic"] >
*[class ~= "topic/title"]
{
string-set: chaptertitle1 content(), chaptertitle2 "", chaptertitle3 "";
}
*[class ~= "map/map"] >
*[class ~= "topic/topic"] >
*[class ~= "topic/topic"] >
*[class ~= "topic/title"]
{
string-set: chaptertitle2 content(), chaptertitle3 "";
}
....
Many regards,
Dan
Re: Topic titles in a header
Posted: Mon Apr 08, 2019 9:33 am
by Manohar_1024
hello,
How to not get chapter number on top.(header)i do not want 5 | vehicle operation
And how to get chapter number at bottom (footer)like...Chap. 5
I am using CSS for PDF output. Please help me out this small issue
Re: Topic titles in a header
Posted: Mon Apr 08, 2019 1:51 pm
by MyMoon
Thanks, Dan! It works.
Re: Topic titles in a header
Posted: Mon Apr 08, 2019 3:40 pm
by Dan
@Manohar_1024
Please change the string set definitions, or modify the headers directly, using the @page selectors:
https://www.oxygenxml.com/doc/versions/ ... aid-title9
Please read the entire page. Let me know if the documentation is not clear.
Many regards,
Dan
Re: Topic titles in a header
Posted: Wed Apr 10, 2019 4:23 pm
by Manohar_1024
Thank you, I have gone through that,
But in header
Code: Select all
@top-right {
content: string(chaptertitle) ;
font-size: 10pt;}
Then i am getting
1| Introduction
But i do not want
1|
this part in my header
And for footer i want
Chap.4 -Page 30 but note able to achieve that the below is the CSS code
Code: Select all
@bottom-right {
content: "Chap."counter(chapter)" - " "Page " counter(page);
font-size: 10pt;}
i am getting
Chap. -Page 30 in this manner if i use the above CSS
Please help me in this issue
Thank you.
Re: Topic titles in a header
Posted: Thu Apr 11, 2019 2:52 pm
by Dan
You should change the stringset definition for chapter:
In your case you can remove the
from the string-set:
Code: Select all
*[class ~= "map/map"] *[class ~= "topic/topic"][is-chapter]:not([is-part]) > *[class ~= "topic/title"] {
string-set: chaptertitle " | " counter(chapter) " - " content(), sectiontitle "" !important;
}
Many regards,
Dan
Re: Topic titles in a header
Posted: Thu Apr 11, 2019 3:34 pm
by Manohar_1024
Thanks Dan,
It is working for header
But in footer i am still not able to get the Chapter number like i previously mentioned
Chap.4- Page 13... in this manner.
Thank You
Re: Topic titles in a header
Posted: Mon Apr 15, 2019 3:36 pm
by Dan
You should use the string defined earlier, like:
Code: Select all
@page {
...
@bottom-right {
content: string(chaptertitle)" - " "Page " counter(page);
font-size: 10pt;
}
..
}
Please read more information about string sets here (this is the userguide for the Oxygen PDF Chemistry engine that is used by the DITA PDF CSS transformation):
https://www.oxygenxml.com/doc/versions/ ... aid-title2
Although the examples are for HTML, they can be easily changed for DITA.
Many regards,
Dan
Re: Topic titles in a header
Posted: Mon Apr 15, 2019 4:32 pm
by Manohar_1024
Thanks Dan,
I got want i wanted.