Hiding chapter numbers from TOC and title

Post here questions and problems related to editing and publishing DITA content.
clarahuang
Posts: 2
Joined: Thu Jan 11, 2018 3:14 am

Hiding chapter numbers from TOC and title

Post by clarahuang »

Dear Oxygen,

I'm an Oxygen 19.1 user and wondering if there is any way to hide chapter numbers from the table of contents and the appendix title?

The use case is that topics in the appendix show up as actual chapters in the table of contents and the appendix title. For example, in the table of contents, the appendix title shows up as "9 Appendix: xxx" with 9 being the chapter number.

In my organization we are not using Bookmap but DITA map to create documentation. So my question is, is there any way to get "Appendix" to appear appropriately in the table of contents as well as in the Bookmarks of PDF output when publishing output from DITA map?

Thanks very much for your help.

Cheers,
Clara
ionela
Posts: 402
Joined: Mon Dec 05, 2011 6:08 pm

Re: Hiding chapter numbers from TOC and title

Post by ionela »

Hi Clara,

What transformation scenario are you currently using? The DITA Map PDF or DITA Map PDF - WYSIWYG?

Also, I have noticed that the appendix element is available only for bookmap and learningBookmap:
https://docs.oasis-open.org/dita/v1.2/o ... endix.html

Could you provide us a minimal sample DITA project to show us how you've added the appendix element to a DITA Map (not to a bookmap)? You can send the sample by email to sales [AT] oxygenxml [DOT] com.

Regards,
Ionela
Ionela Istodor
oXygen XML Editor and Author Support
clarahuang
Posts: 2
Joined: Thu Jan 11, 2018 3:14 am

Re: Hiding chapter numbers from TOC and Appendix title in DITA map

Post by clarahuang »

Hi Lonela,

Thanks for your quick reply.

I'm using DITA Map PDF.

We actually do not add an appendix element to our DITA map because we are aware that the appendix element is not supported in DITA map but only Bookmap. What we code in the source file of the Appendix section is as below:

<map>
<title>Appendix A: Configuring the <keyword keyref="prod-long"/> provisioning server</title>
<!-- ######### CONTENT ######### -->
<topicref href="c_ov_config_prov_srvr.xml">
<topicref href="c_reasons_for_prov_srvr.xml"/>
<topicref href="c_build_prov_srvr.xml">
<topicref href="c_prov_srvr_reqs.xml"/>
<topicref href="c_prov_protocols_provis_server.xml"/>
</topicref>
<topicref href="c_ov_appndx_samples.xml">
<topicref href="r_simple.xml">
<topicref href="r_common_json_ipbx.xml"/>
<topicref href="r_office_json_ipbx.xml"/>
</topicref>
</topicref>
</topicref>
</map>

We create the appendix section the same way as other chapter DITA maps and add it to the master DITA map as the last chapter of the document. That's why the appendix section is generated the same way as other chapters with a chapter number in the table of contents, the PDF Bookmarks, and the chapter title.

What we want to know is whether there's any workaround in the DITA map publishing to hide the chapter number from the appendix so that the appendix is not treated as the last chapter of the document but a standalone section titled "Appendix: xxx" without any chapter number in the table of contents, the PDF Bookmarks, and the chapter title.

Please let me know if you need further information.

Thanks very much for your time.

Best regards,
Clara
Costin
Posts: 829
Joined: Mon Dec 05, 2011 6:04 pm

Re: Hiding chapter numbers from TOC and title

Post by Costin »

Hi Clara,

Basically, you are using a DITA map titled "Appendix A" that contains plain topicrefs, not appendix elements.
Is Appendix A map the main DITA map you are working with, or is it a DITA submap, containing only the topicrefs you need to be considered as appendixes?

If it's the last, the recommended way would be to convert the appendixes DITA map (the one with the "Appendix A: Configuring the <keyword keyref="prod-long"/> provisioning server" title) to a bookmap, then use <appendix> elements instead of plain <topicref> ones, as <appendix/> is a specialization of <topicref/>.
An easy way to convert your DITA map into a Bookmap is to replace the "map" doctype with the one appropriate to "bookmap".
Basically, you should just replace <!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
with <!DOCTYPE bookmap PUBLIC "-//OASIS//DTD DITA BookMap//EN"
"http://docs.oasis-open.org/dita/v1.1/OS/dtd/bookmap.dtd">

Then use speciallized <appendix/> elements instead topicrefs.
Specifically, the contents of your bookmap look like:

Code: Select all

<!DOCTYPE bookmap PUBLIC "-//OASIS//DTD DITA BookMap//EN"
"http://docs.oasis-open.org/dita/v1.1/OS/dtd/bookmap.dtd">
<bookmap>
<title>apendix-map</title>
<appendix href="c_ov_config_prov_srvr.xml">
<appendix href="c_reasons_for_prov_srvr.xml"/>
<appendix href="c_build_prov_srvr.xml">
---- and so on

If, for any specific reason, you can not convert the Appenix map to a bookmap, there is still a workaround that you could use - more like a hackish one though, so it is strongly recommended to use the above proposed approach if possible.
The workaround consists in adding the appendix specialization class manually to each of the <topicref/> elements that you need to be considered as appendixes.
Specifically on your example, each of your topicrefs should look like:

Code: Select all

<topicref href="c_ov_config_prov_srvr.xml"  class="- map/topicref bookmap/appendix ">
<topicref href="c_reasons_for_prov_srvr.xml" class="- map/topicref bookmap/appendix "/>
<topicref href="c_build_prov_srvr.xml" class="- map/topicref bookmap/appendix ">
---- and so on
I hope this helps.

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
Post Reply