Show/Hide Title and Subtitle in pdf target

Post here questions and problems related to editing and publishing DITA content.
IsleofGough
Posts: 34
Joined: Fri Dec 02, 2016 9:55 pm

Show/Hide Title and Subtitle in pdf target

Post by IsleofGough »

I have a reasonable pdf output from a DITA Bookmap file using custom HTML/CSS now, but would like to display the subtitle (but not the title) on the title page (since the cover image already has title and author). I imagine this requires modifying some xpath rule, but I don't really know where to start with this. How can one hide or display the Title, Alt-Title (subtitle), and Author on the front-cover page using a CSS rule? Thanks.
susannecm
Posts: 109
Joined: Wed Mar 17, 2010 1:04 pm

Re: Show/Hide Title and Subtitle in pdf target

Post by susannecm »

Hi,
just an idea: you could define a CSS rule for the main title that includes the property {display: none;}.
julien_lacour
Posts: 498
Joined: Wed Oct 16, 2019 3:47 pm

Re: Show/Hide Title and Subtitle in pdf target

Post by julien_lacour »

Hello,

As susannecm mentioned, you just need to use the display: none CSS property, like this:

Code: Select all

*[class ~= "bookmap/mainbooktitle"] {
  display: none !important;
}
Regards,
Julien
IsleofGough
Posts: 34
Joined: Fri Dec 02, 2016 9:55 pm

Re: Show/Hide Title and Subtitle in pdf target

Post by IsleofGough »

Perfect! Thanks
Post Reply