Page 1 of 1

Generation of Table of contents and index page

Posted: Thu Apr 04, 2019 3:36 pm
by Manohar_1024
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.

Re: Generation of Table of contents and index page

Posted: Fri Apr 05, 2019 12:53 pm
by Dan
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

Re: Generation of Table of contents and index page

Posted: Fri Apr 05, 2019 2:42 pm
by Manohar_1024
Hello,
Thanks for the reply.
I have got that for my output i want in index like
T
Table of contents 3
Turbine 6

Re: Generation of Table of contents and index page

Posted: Mon Apr 08, 2019 3:30 pm
by Dan
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

Re: Generation of Table of contents and index page

Posted: Tue Apr 09, 2019 8:31 am
by Manohar_1024
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.

Re: Generation of Table of contents and index page

Posted: Wed Apr 10, 2019 3:19 pm
by Dan
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

Re: Generation of Table of contents and index page

Posted: Wed Apr 10, 2019 4:10 pm
by Manohar_1024
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

Re: Generation of Table of contents and index page

Posted: Thu Apr 11, 2019 9:31 am
by Dan
Send to the support@oxygenxml.com the transformation console log.

Re: Generation of Table of contents and index page

Posted: Thu Dec 05, 2019 9:42 pm
by chrispitude
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!

Re: Generation of Table of contents and index page

Posted: Fri Dec 06, 2019 12:53 pm
by Costin
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

Re: Generation of Table of contents and index page

Posted: Fri Oct 09, 2020 11:45 am
by Manohar_1024
Hello Dan,

I have succeeded in getting Index list at the end of the manual as per our requirement, thanks to you.
But is there anyway that the indexlist can be placed in after 1 chapter and can that also behave like a chapter.
So like I want to get chapter 2 as index list.

Thank you,
Manohar.


Dan wrote: 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

Re: Generation of Table of contents and index page

Posted: Mon Oct 12, 2020 1:46 pm
by Dan
No, unfortunately the index must be placed in either frontmatter or backmatter, and those elements cannot be placed between chapters.
I understand the first chapter plays a special role, is a kind of abstract. Why not placing in in the frontmatter, as an abstract?
If you need more information about the DITA information architecture, you could ask questions on the DITA-users list: https://dita-users.groups.io

Many regards,
Dan