How do I change the formatting of elements in the output

Post here questions and problems related to editing and publishing DITA content.
OxUser
Posts: 18
Joined: Tue Mar 12, 2013 1:39 am

How do I change the formatting of elements in the output

Post by OxUser »

How do I change the formatting of elements in the output? For example, I want to change to size and font color of all the headings. I'd also like this change to apply to all of the topics contained in a DITA map, rather than to only one topic at a time.

Do I add a CSS file? If so, where do I add/refer to this in the DITA map?

Do I edit the existing oxygen xsl file?

Thanks for your help
OxUser
Posts: 18
Joined: Tue Mar 12, 2013 1:39 am

Re: How do I change the formatting of elements in the output

Post by OxUser »

I have created a CSS stylesheet with the desired formatting, but even if I add a link in the DITA map file (or in the individual topic files) to the CSS file, the output processing ignores my custom CSS file and instead uses the default stylesheet. As a result, my custom stylesheet is not applied and the output is not custom formated.

What do I need to edit to get the output processing to use my custom CSS? And if I require more than 1 CSS (say for a differnt department) how do I switch between them?

Thanks
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: How do I change the formatting of elements in the output

Post by Radu »

Hi,

I will assume you want this for XHTML-based output like WebHelp.
If you edit the transformation scenario in the Parameters tab you have two parameters:

args.copycss should be set to yes.
args.css should point to the custom CSS.

If you set these parameters, all generated HTML files will contain a link to the custom CSS which will also be copied to the output folder.

You can open one of the generated HTML files and see that the generated HTML elements contain by default class attributes which come from the original DITA elements from which they were generated. In your CSS you can match based on those @class attribute values.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply