CSS to PDF - Style one string set in footer

Post here questions and problems related to editing and publishing DITA content.
Julie P
Posts: 18
Joined: Fri Dec 02, 2016 7:34 pm

CSS to PDF - Style one string set in footer

Post by Julie P »

Hi all,
Is it possible to style differently string sets that are in the same margin box?
I would like to put in bold the string(maptitle), and I cannot figure out how to do this.
The only thing I have come up with was to write the map title in the code as an oxy_label, but not sure this is the best to do in the long term because this stylesheet will be reused for other maps.

Here is my footer when using the string-set:

Code: Select all

@bottom-center {
        content: string(maptitle) " | " string(mapvrm) string(chaptertitle) ;
          }
When using the oxy-label:


Code: Select all

@bottom-center {
        content: oxy_label(text, “Name of the guide”, styles, "font-weight:bold") " | " string(mapvrm) string(chaptertitle) ;
    }
Thank you.
julien_lacour
Posts: 498
Joined: Wed Oct 16, 2019 3:47 pm

Re: CSS to PDF - Style one string set in footer

Post by julien_lacour »

Hello,

Unfortunately it isn't possible to customize the style of a string-set. So your solution is the correct way to do.
As an improvement you can use the oxy_xpath() function to dynamically get the maptitle value. You will obtain something like:

Code: Select all

@bottom-center {
  content: oxy_label(text, oxy_xpath("/some/xpath"), styles, "font-weight:bold") " | " string(mapvrm) string(chaptertitle);
}
You can test the XPath by opening the merged.html file generated by the transformation inside Oxygen and by using Oxygen's XPath Builder view.

You will find a more detailed example on our user-guide.

Regards,
Julien
Julie P
Posts: 18
Joined: Fri Dec 02, 2016 7:34 pm

Re: CSS to PDF - Style one string set in footer

Post by Julie P »

Hi,
OK, I will try this. Thank you!
Regards.
Post Reply