---
title: "DITA: Index entries"
date: 2014-12-27
description: "{% include notes.html %} There are various approaches for adding indexes, but here's a typical way to add index entries. {% include ads.html %} <div..."
canonical_url: https://idratherbewriting.com/indexes/index.html
---

> For AI agents: a documentation index is available at https://idratherbewriting.com/llms.txt. Markdown versions of all pages are available by appending .md to any page URL.

# DITA: Index entries

> You can add index entries to topics. Even if you don't see the value in providing an index, index entries can help searches find the right topics.

There are various approaches for adding indexes, but here's a typical way to add index entries.

In the `prolog | metadata | keywords` element of a topic, add index terms The `prolog` element comes just after the `shortdesc` element (which follows the title). Here's a sample:

```xml
<title>My Title</title>
 <shortdesc/>
<prolog>
    <metadata>
      <keywords>
        <indexterm>cars</indexterm>
      </keywords>
    </metadata>
  </prolog>
```

You can also nest index entries inside of each other to create parent-child relationships among the index terms:

```xml
  <prolog>
    <metadata>
      <keywords>
        <indexterm>cars
                <indexterm>sedan</indexterm>
        </indexterm>
      </keywords>
    </metadata>
  </prolog>
```

The result in the index will look like this:

```xml
cars
  - sedan
```

When you want to create a "see" entry for an index, code it like this:

```xml
   <indexterm>vehicle
   <index-see>car</index-see>
</indexentry>
```

The result of the index-see element is the following:

```xml
    vehicle, see car
```

If you want to include a page number with the see also reference, write it like this:

```xml
    <indexterm>vehicle
   <index-see-also>car</index-see-also>
</indexentry>
    </indexterm>
```

The output will look like this:

```xml
    vehicle ..... 23
           see also car
```

Keep in mind that index entries added to the `prolog` section will include page numbers pointing to the location of the `prolog`. Since most topics are short, this isn't a problem. Also, since the online help is usually the main deliverable, it's also not a problem. However, you can also add index entries in the middle of your topics. (But apparently this causes some problems, especially with translation.)

Also, some PDF renderers don't include page numbers to index entries. At any rate, since PDF isn't usually the main deliverable, this is not a concern with index terms.
