Generation of Table of contents and index page

Manohar_1024
Posts: 47
Joined: Wed Mar 27, 2019 10:12 am

Generation of Table of contents and index page

Post by Manohar_1024 » Thu Apr 04, 2019 3:36 pm

Hello,
I need automatic generation for table of contents and index pages.
As for TOC if page numbers in body changes due to some alignments then in TOC also it should update.
Please help me in this thing.I need this urgently
Thank you.

Dan
Posts: 453
Joined: Mon Feb 03, 2003 10:56 am

Re: Generation of Table of contents and index page

Post by Dan » Fri Apr 05, 2019 12:53 pm

Any DITA map generates in the PDF output a table of contents.
If the topics contain indexterms, these are collected and added to an index page at the end of the publication.
Try transforming the DITA samples bundled in oXygen and see the output.

Many regards,
Dan

Manohar_1024
Posts: 47
Joined: Wed Mar 27, 2019 10:12 am

Re: Generation of Table of contents and index page

Post by Manohar_1024 » Fri Apr 05, 2019 2:42 pm

Hello,
Thanks for the reply.
I have got that for my output i want in index like
T
Table of contents 3
Turbine 6

Dan
Posts: 453
Joined: Mon Feb 03, 2003 10:56 am

Re: Generation of Table of contents and index page

Post by Dan » Mon Apr 08, 2019 3:30 pm

It is not clear, you succeeded in having a TOC and Index?
If not, please read below:

The index section collects all the index terms from the publication and shows them in a sorted tree.
To add index to your publication, you just need to add index terms to the topics metadata:

Code: Select all


  <title>The topic title.</title>
<prolog>
<metadata>
<keywords>
<indexterm>Installing <indexterm>Water Pump</indexterm></indexterm>
</keywords>
</metadata>
</prolog>
<body>
.....
or in the content itself:

Code: Select all


...
<p>Open the lid then turn the body pump to the right.
<indexterm>Installing <indexterm>Water Pump</indexterm></indexterm>
</p>
...
In case you are using a bookmap, you need to specify where the index list should be presented, for instance in the backmatter of the book. This is done by using an indexlist element in the booklists if the backmatter:

Code: Select all


<bookmap>
...
<chapter href="tasks/troubleshooting.dita">
...
</chapter>
<backmatter>
<booklists>
<indexlist/>
</booklists>
</backmatter>
</bookmap>
For plain maps, the index list is automatically added at the end of the publication, with no need to modify the map.

Also, for plain maps, the TOC is automatically generated.

For DITA Book Maps you will need to add a toc element in the booklist element from the frontmatter:

Code: Select all


<bookmap>
...
<frontmatter>
<booklists>
<toc/>
<figurelist/>
<tablelist/>
</booklists>
</frontmatter>
...
...
Many regards,
Dan

Manohar_1024
Posts: 47
Joined: Wed Mar 27, 2019 10:12 am

Re: Generation of Table of contents and index page

Post by Manohar_1024 » Tue Apr 09, 2019 8:31 am

Thanks Dan,
i have got that
i am getting in this way
A
Air dryers
31
Alarm
23
Auxiliary compressors
34

but Now what i want is.... in Index

A
Air dryers........................................2.31
Alarm............................................3.23
Auxiliary compressors.........................3.34
Here the above numbers (2.31) means 2 is a chapter number and 31 is the page number.

Dan
Posts: 453
Joined: Mon Feb 03, 2003 10:56 am

Re: Generation of Table of contents and index page

Post by Dan » Wed Apr 10, 2019 3:19 pm

Hello,
Unfortunately putting the chapter number before the page number is not supported by the transformation.

But putting a line of dots between the indexterm and the page can be done like this:

Code: Select all


*[class~="index/formatted-value"],
*[class~="index/refid"] {
display:inline;
}

*[class~="index/entry"] {
text-align:justify;
}
*[class~="index/entry"] *[class~="index/formatted-value"]:after {
content:leader('.');
}

Many regards,
Dan

Manohar_1024
Posts: 47
Joined: Wed Mar 27, 2019 10:12 am

Re: Generation of Table of contents and index page

Post by Manohar_1024 » Wed Apr 10, 2019 4:10 pm

Hello Dan,
Thanks for the reply but i am getting an error like this.

Description: Transformation failed. C:\Program Files\Oxygen XML Editor 21\frameworks\dita\DITA-OT3.x\plugins\com.oxygenxml.pdf.css\build.xml:603: Java returned: 1

Dan
Posts: 453
Joined: Mon Feb 03, 2003 10:56 am

Re: Generation of Table of contents and index page

Post by Dan » Thu Apr 11, 2019 9:31 am

Send to the support@oxygenxml.com the transformation console log.

chrispitude
Posts: 201
Joined: Thu May 02, 2019 2:32 pm

Re: Generation of Table of contents and index page

Post by chrispitude » Thu Dec 05, 2019 9:42 pm

Hi Dan,

We have <indexterms> in our DITA (it's content converted from FrameMaker), but we don't want to generate the index or its TOC entry at this time. How do we suppress index generation in PDF Chemistry?

At

https://www.oxygenxml.com/doc/versions/ ... om_the_toc

the "hide.frontpage.toc.index.glossary" parameter is mentioned, but we still want the frontmatter and TOC.

Thanks!

Costin
Posts: 695
Joined: Mon Dec 05, 2011 6:04 pm

Re: Generation of Table of contents and index page

Post by Costin » Fri Dec 06, 2019 12:53 pm

Hi Chris,

You could remove the Index references (from TOC/content/bookmarks), by using a CSS customization, like:

Code: Select all

*[class~="indexlist"]{
    display: none;
}

*[class~="index/groups"]{
    display: none;
    counter-reset: none;
    bookmark-level: 0;
}
This way you would remove only the Index, without using the dedicated predefined parameter (that, indeed, would also hide other components, like front page, TOC, etc.)

Cheers,
Costin
Costin Sandoi
oXygen XML Editor and Author Support

Post Reply