# .index command (Output processor)

The .index command inserts a phrase
and the current page number into the index. The .index command may
be embedded in text, in which case the end of the index text must
be indicated by the .xindex command.

**Synonyms:** .ix

## Syntax

```
.index ’phrase’
.index: ’main.heading’ ’phrase’ {’phrase’...}
```

## Parameter(s)

| phrase | Subheading or phrase inserted into the index. A subheading is specified by appending a colon to the .index command. |
| --- | --- |
| main.heading | Phrase following the colon is inserted as the main heading into the index. All subsequent phrases are inserted as subheadings into the index. If the main heading or phrase consists of multiple words, the words must be enclosed in quotation marks. |
Note: The index can be saved in an item with the .save index command, and can be printed with the .print index command.

## Example(s)

```
.index ’Schedule’
.xindex
```
Produces the index entry:

```
Schedule . . . 13
```

```
.index: ’Schedule’ ’production’
.xindex
```
Produces the index entry:

```
Schedule
production . . . 13
```

## See also

- [.index heading command](https://d3codex.com/output-processor/dot-index-heading-command/)
- [.print index command (Output processor)](https://d3codex.com/output-processor/dot-print-index-command-output-processor/)
- [.save index command (Output processor)](https://d3codex.com/output-processor/dot-save-index-command-output-processor/)
- [.xindex command](https://d3codex.com/output-processor/dot-xindex-command/)
- [Output processor commands](https://d3codex.com/output-processor/output-processor-commands/)
- [Output processor overview](https://d3codex.com/output-processor/output-processor-overview/)

---
Source: https://d3codex.com/output-processor/dot-index-command-output-processor/ - part of the D3Codex reference.
