Page 1 of 1

How do I print the Example and Syntax sub headings in WebHelp/PDF

Posted: Tue Jul 21, 2015 10:48 am
by samuelthomasril
Hi,
I am using the DITA Reference topic. When I use the <refsyn> tag, I see the Syntax heading in the Editor but the heading does not get rendered in the WebHelp or PDF. Same is the case with the Example tag.
Can you please help me print the headings in the Web Help.
Thanks
Samuel

Re: How do I print the Example and Syntax sub headings in WebHelp/PDF

Posted: Fri Jul 31, 2015 5:42 pm
by Frank Ralf
Hi Samuel,

You can add these labels using CSS. Here's a sample from my WebHelp CSS for task prerequisites:

Code: Select all

div.prereq:before{
  content:"Prerequisites: ";
}


See C:\Program Files\Oxygen XML Author 16\frameworks\dita\css_classed\reference.css for sample CSS. And use a tool like Firebug to inspect the WebHelp HTML to see which the corresponding HTML elements are.

See CSS Customizations for instructions how to add your own CSS to the WebHelp.

hth
Frank

Re: How do I print the Example and Syntax sub headings in WebHelp/PDF

Posted: Fri Jul 31, 2015 5:45 pm
by Frank Ralf
PDF customization is a bit more tricky. See DITA to PDF Output Customization for instructions.

Frank

Re: How do I print the Example and Syntax sub headings in WebHelp/PDF

Posted: Mon Aug 03, 2015 8:36 am
by bogdan_cercelaru
Hello,

The WebHelp output can be styled using a custom CSS file. To see your ""Example" and "Syntax" headers (labels) in the output you should create a custom CSS file that contains styles like the one below:

Code: Select all

div.refsyn:before {
  font-weight: bold;
  font-style: normal;
  display: block;
  content: "Syntax: ";
}

div.example:before {
  font-weight: bold;
  font-style: normal;
  display: block;
  content: "Example: ";
}


To use the custom CSS file, edit the "DITA Map WebHelp" transformation scenario, switch to the "Parameters" tab and change the "args.css" parameter to point to the file that you created earlier. Also, change the "args.copycss" parameter to "yes" to have the custom CSS file automatically copied to your output.

Let me know if you need any further assistance.

Regards,
Bogdan

Re: How do I print the Example and Syntax sub headings in WebHelp/PDF

Posted: Tue May 09, 2017 12:41 am
by GKlimeck
I have a question related to the discussion in this thread.
For a task document.xml with <stepxmp>...

How do I get the subheading "Example:" to appear in the ouptput pdf from the DITA PDF transformation?
Thank you for your help,
Ginny

Re: How do I print the Example and Syntax sub headings in WebHelp/PDF

Posted: Tue May 09, 2017 10:04 pm
by GKlimeck
Using Oxygen 18.0 with DITA-OT 2.x

did not find "Example:" in file:
C:\Program Files\Oxygen XML Editor 18\frameworks\dita\DITA-OT2.x\plugins\org.dita.pdf2\cfg\common\vars\en.xml

Ginny

Re: How do I print the Example and Syntax sub headings in WebHelp/PDF

Posted: Wed May 10, 2017 10:00 pm
by radu_pisoi
Hi,

I'm not sure there is any option you can use to generate a label in front of the stepxmp element.

In this case, you need to write a PDF extension plugin to implement this behavior. Instructions about how to create an PDF extension plugin are here:
http://www.dita-ot.org/2.4/dev_ref/pdf- ... ample.html

Details about how to modify or add generated text are presented in the DITA-OT documentation:
http://www.dita-ot.org/2.4/dev_ref/plug ... dtext.html

About the development, a good starting point is to search for the task/stepxmp string in the PDF2 plugin. In this way, you will find the XSLT templates that should be overridden from your customization.