Customize notes

Post here questions and problems related to editing and publishing DITA content.
kris
Posts: 13
Joined: Mon Aug 01, 2016 6:40 pm

Customize notes

Post by kris »

Hi all,

I have notes in my documents, like <note type="danger">Text</note>. We use DITA-OT to generate pdf. I have some doubts:

1.
I customized the image for some notes, now they are smaller than before. It looks to me that the image is put on a fixed-size area. Hence, now we have a big and ugly gap between the image and the label saying DANGER.
How can I change the size of the area that is holding the place of the image?

2. I would like to customize the sign that appears after the label of the notes. By default it is colon. Can I substitute it with an exclamation mark?

Thanks,
Kris
radu_pisoi
Posts: 403
Joined: Thu Aug 21, 2003 11:36 am
Location: Craiova
Contact:

Re: Customize notes

Post by radu_pisoi »

Hi,

Could you tell us what oXygen and DITA-OT versions are you using?

To verify the DITA-OT version, please go to oXygen's Preferences dialog and check the 'DITA' options page.
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
kris
Posts: 13
Joined: Mon Aug 01, 2016 6:40 pm

Re: Customize notes

Post by kris »

Oxygen Preferences says 1.8, but when we generate the .pdf files, we use a script. That uses a folder called DITA-OT2.0.1.
radu_pisoi
Posts: 403
Joined: Thu Aug 21, 2003 11:36 am
Location: Craiova
Contact:

Re: Customize notes

Post by radu_pisoi »

Hi,
kris wrote:I would like to customize the sign that appears after the label of the notes. By default it is colon. Can I substitute it with an exclamation mark?
Yes, you can. You need to create a PDF customization plugin that override the '#note-separator' variable. This variable is defined in 'DITA-OT2.x/plugins/org.dita.pdf2/cfg/common/vars/en.xml'.

About the PDF customization, please read the 'Customizing PDF output' topic:
http://www.dita-ot.org/2.3/dev_ref/pdf- ... ation.html
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
kris
Posts: 13
Joined: Mon Aug 01, 2016 6:40 pm

Re: Customize notes

Post by kris »

Hi Radu,

Thanks for the info about the note separator.
I would still need to know if there is a solution about the big gap that appears because of the image size. (See point 1. in the original post.)
Thanks for any response!
Kris
radu_pisoi
Posts: 403
Joined: Thu Aug 21, 2003 11:36 am
Location: Craiova
Contact:

Re: Customize notes

Post by radu_pisoi »

Hi,

Please note that my response is compatible with DITA-OT 2.3.3 that is bundled with oXygen 18.1.

To render a note image, the DITA-OT PDF2 plugin generates a fo:table with one row and two cells. On the first cell is drawn the note image and in the second its text.

This is implemented in the DITA-OT2.x/plugins/org.dita.pdf2/xsl/fo/commons.xsl stylesheet, search for *[contains(@class,' topic/note ')] template.

Code: Select all


<xsl:template match="*[contains(@class,' topic/note ')]">
<xsl:variable name="noteImagePath">
<xsl:apply-templates select="." mode="setNoteImagePath"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="not($noteImagePath = '')">
<fo:table xsl:use-attribute-sets="note__table">
<fo:table-column xsl:use-attribute-sets="note__image__column"/>
<fo:table-column xsl:use-attribute-sets="note__text__column"/>
<fo:table-body>
<fo:table-row>
....

As you can see, the table column properties are specified using the note__image__column and note__text__column columns. These attribute sets are specified in the DITA-OT2.x/plugins/org.dita.pdf2/cfg/fo/attrs/commons-attr.xsl stylesheet:

Code: Select all


    <xsl:attribute-set name="note__image__column">
<xsl:attribute name="column-number">1</xsl:attribute>
<xsl:attribute name="column-width">32pt</xsl:attribute>
</xsl:attribute-set>

<xsl:attribute-set name="note__text__column">
<xsl:attribute name="column-number">2</xsl:attribute>
</xsl:attribute-set>

So, if you want to modify the width of the table columns you have to copy the above attribute sets in your PDF2 customization and modify the column-width attribute accordingly.
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
kris
Posts: 13
Joined: Mon Aug 01, 2016 6:40 pm

Re: Customize notes

Post by kris »

Thanks for the response, I will try this.
Another question: I would like to see the same icons in oXygen, when editing an xml file.
I found that it uses the icons that are located in the folder C:\Program Files\Oxygen XML Author 17\frameworks\dita\img.
However, to use the exact same look, I need to:
- tell oXygen not to use any image for the notice type of note, and
- change the labels of some note types (to use capital letters).
My colleagues who use oXygen might get confused why they see something different in oXygen than in the generated .pdf.

Thanks in advance again!
Kris
radu_pisoi
Posts: 403
Joined: Thu Aug 21, 2003 11:36 am
Location: Craiova
Contact:

Re: Customize notes

Post by radu_pisoi »

Hi,

Did you know about DITA Map to PDF WYSIWYG Transformation?

Oxygen XML Editor comes bundled with a DITA-OT plugin that converts DITA maps to PDF using a CSS layout processor. This plugin and the Author page use the same set of CSS stylesheeets, so a change in these CSSs will affect the rendering from Author page and the PDF transformation.

To find the CSS styles associated with an element, you can use the CSS Inspector view. Just click the particular link from the CSS selector that you need to change and Oxygen XML Editor will open the CSS file and position the cursor at that selector.

You can find more details about this PDF transformation and CSS Inspector view in our documentation:
https://www.oxygenxml.com/doc/versions/ ... dita2.html

Please note that this plugin requires one of the the following processors that are not included in the Oxygen XML Editor installation kit:
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
idtp
Posts: 11
Joined: Tue Sep 02, 2014 8:20 pm

Re: Customize notes

Post by idtp »

Hi, I know this is an old treat but I ran into this anyway.

you mentioned:
... You need to create a PDF customization plugin that override the '#note-separator' variable. This variable is defined in 'DITA-OT2.x/plugins/org.dita.pdf2/cfg/common/vars/en.xml'.

About the PDF customization, please read the 'Customizing PDF output' topic:
http://www.dita-ot.org/2.3/dev_ref/pdf- ... ation.html
Now I modified this variable definition in C:\dita-ot-3.2.1\plugins\com.ditatoo.mypdf\cfg\common\vars . I tried both the 'en.xml' and the 'commonvariables.xml' (because in org.dita.pdf2 the note-separator is defined in commonvariables.xml). But - neither seems to work.

(and yes, this is the correct plugin folder that I use for my transformations ....)

Any suggestions here?

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

Re: Customize notes

Post by Radu »

Hi Wim,

If you send us (support@oxygenxml.com) your custom plugin, a small DITA content sample and details about what you want to obtain we could try to find some time to take a look at your customization.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
idtp
Posts: 11
Joined: Tue Sep 02, 2014 8:20 pm

Re: Customize notes

Post by idtp »

Thanks Radu,

we've found the cause already. It turned out to be a combination of customization rules that prevented to read 'DITA-OT2.x/plugins/org.dita.pdf2/cfg/common/vars/en.xml'.

Wim.
Post Reply