Topic titles in a header

Post here questions and problems related to editing and publishing DITA content.
MyMoon
Posts: 23
Joined: Thu Feb 28, 2019 2:19 pm

Topic titles in a header

Post 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?
Dan
Posts: 501
Joined: Mon Feb 03, 2003 10:56 am

Re: Topic titles in a header

Post 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
Manohar_1024
Posts: 53
Joined: Wed Mar 27, 2019 10:12 am

Re: Topic titles in a header

Post 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
MyMoon
Posts: 23
Joined: Thu Feb 28, 2019 2:19 pm

Re: Topic titles in a header

Post by MyMoon »

Thanks, Dan! It works.
Dan
Posts: 501
Joined: Mon Feb 03, 2003 10:56 am

Re: Topic titles in a header

Post 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
Manohar_1024
Posts: 53
Joined: Wed Mar 27, 2019 10:12 am

Re: Topic titles in a header

Post 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.
Dan
Posts: 501
Joined: Mon Feb 03, 2003 10:56 am

Re: Topic titles in a header

Post by Dan »

You should change the stringset definition for chapter:
In your case you can remove the

Code: Select all


" | " counter(chapter) 
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
Manohar_1024
Posts: 53
Joined: Wed Mar 27, 2019 10:12 am

Re: Topic titles in a header

Post 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
Dan
Posts: 501
Joined: Mon Feb 03, 2003 10:56 am

Re: Topic titles in a header

Post 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
Manohar_1024
Posts: 53
Joined: Wed Mar 27, 2019 10:12 am

Re: Topic titles in a header

Post by Manohar_1024 »

Thanks Dan,
I got want i wanted.
Post Reply