Skip to main content
October 17, 2013
Question

Font style issues in DITA

  • October 17, 2013
  • 1 reply
  • 701 views

Hello,

I am working on DITA topics, I have defined bodytext paragraph tag font as regular in the template. But i need some words/sentence as bold and italics. If i change a word/sentence as bold, when i close it and reopen the file i am seeing regular font again.

Could some one help on this issue.

Thanks,

Harsha..

This topic has been closed for replies.

1 reply

ScottPrentice
Inspiring
October 17, 2013

Hi Harsha...

You can't use standard paragraph and character styling in an XML file .. that information is lost when you save/repoen the file (as you've noticed). You need to set up your EDD so it applies the necessary formatting from the template based on elements and attributes.

If you want to change the formatting of a standard <p> element, you'd set the @outputclass attribute to some value (like "boldpara") .. then in the EDD, you'd modify the context rules for the <p> element definition so it tests for the value of @outputclass and assigns the needed para tag instead of the default para tag.

If you're trying to assign inline formatting, you'd use one of the inline elements (<ph> if nothing else works better, but there's always <b> and <i> for bold and italic). If the standard formatting for one of these inline elements doesn't do what you want, you'd use the same process as described above. Set the @outputclass attribute value of the inline element to something meaningful, then modify the element definition in the EDD to apply the proper formatting.

Remember to import the EDD into the template after updating.

Remember that DITA is all about semantic tagging, so if possible, it's best to use one of the semantic tags (like <uicontrol> or <wintitle>) for inline tagging. You're free to modify the actual formatting that's applied by those elements in the EDD and template, so rather than making up a bunch of special @outputclass settings that you have to manually apply, you might see if the default elements will support your model.

Cheers,

...scott

October 18, 2013

Hello Scott,

Thank you very much.

I am bit confused by setting up the EDD and @outputclass attribute, but sure I will setup as soon as possible. For now i am using <b> and <i> elements to change the font style.

Thanks a lot once again for your answer.

Cheers,

Harsha...