Producing an index

Longer documents, such as technical books, often contain an index. This is usually placed at the end of the document. It contains a list of words and the page numbers at which a reader can find them in the document. Such a list may contain key words, topics, or person's names.

How to do it...

Indexing may be done at the very end. Reading through the document, a command \index{keyword} should be placed for each place relevant to that key word. A good place can be right before the occurrence of that key word in the text. Don't leave a space between the \index{...} command and the indexed word.

We will use the makeidx package. We will now insert the indexing commands while writing by following these steps:

  1. Start with a document class. ...

Get LaTeX Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.