Topic titles in a header

MyMoon
Posts: 23
Joined: Thu Feb 28, 2019 2:19 pm

Topic titles in a header

Post by MyMoon » Wed Apr 03, 2019 6:29 pm

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: 395
Joined: Mon Feb 03, 2003 10:56 am

Re: Topic titles in a header

Post by Dan » Fri Apr 05, 2019 12:59 pm

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: 34
Joined: Wed Mar 27, 2019 10:12 am

Re: Topic titles in a header

Post by Manohar_1024 » Mon Apr 08, 2019 9:33 am

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 » Mon Apr 08, 2019 1:51 pm

Thanks, Dan! It works.

Dan
Posts: 395
Joined: Mon Feb 03, 2003 10:56 am

Re: Topic titles in a header

Post by Dan » Mon Apr 08, 2019 3:40 pm

@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: 34
Joined: Wed Mar 27, 2019 10:12 am

Re: Topic titles in a header

Post by Manohar_1024 » Wed Apr 10, 2019 4:23 pm

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: 395
Joined: Mon Feb 03, 2003 10:56 am

Re: Topic titles in a header

Post by Dan » Thu Apr 11, 2019 2:52 pm

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: 34
Joined: Wed Mar 27, 2019 10:12 am

Re: Topic titles in a header

Post by Manohar_1024 » Thu Apr 11, 2019 3:34 pm

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: 395
Joined: Mon Feb 03, 2003 10:56 am

Re: Topic titles in a header

Post by Dan » Mon Apr 15, 2019 3:36 pm

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: 34
Joined: Wed Mar 27, 2019 10:12 am

Re: Topic titles in a header

Post by Manohar_1024 » Mon Apr 15, 2019 4:32 pm

Thanks Dan,
I got want i wanted.

Post Reply