TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm writing a book using memoir with a lot of technical words. I want to have an index at the end, which, for each word or term I choose, will refer the reader to the relevant pages. Is there any efficient way to build this index as I write?

share|improve this question
up vote 10 down vote accepted

I would suggest using the memoir documentation source as a start to see how a LaTeX document, which uses the memoir document class, creates an index. Although this may not always be done "efficiently", since it depends on the writer's choice of technique, it's a start none the less.

In many cases, automated index entry generation through a macro is preferred. For example, creating


and then using


rather than constantly typing

... and then there was a word\index{word} at ...

However, this limits one to using a one-dimensional index. Multi-dimensional index usage (for example, using \index{word!sentence!paragraph}, say) requires more work to define an appropriate macro. For example, using optional parameters based on the depth.

The main motivation should be consistency, and ease of adaptation, if things require some future modification.

share|improve this answer

You can make an index. See for a description of making an index (see comment of Zooba) and for an example for an index for wiki LaTeX.

share|improve this answer
The link is actually: en.wikibooks.org/wiki/LaTeX/Indexing (I can't edit the answer because I only want to add 3 characters. Also lack of rep here, but without padding I can't even suggest an edit.) – Zooba Feb 20 '12 at 20:42

To create index, you need to include makeidx package, call \makeindex command in the preamble, put indexes in \index{}, and finally \printindex at the place where index needs to be printed. Once the document is set up as above, build the document in the following three steps:

  1. pdflatex <<filename.tex>>, then this command produces filename.idx that will be an argument for the command in step 2
  2. makeindex <<filename.idx>>, and then run
  3. pdflatex <<filename.tex>>

The following is a minimum working example.




\chapter{Chapter One}
Content of chapter one with two indexes indexone\index{indexone} and indextwo\index{indextwo}. 

\chapter{Chapter Two}
Content of chapter two with three indexes indexone\index{indexone}, indexthree\index{indexthree} and indextwo\index{indextwo}.  



Output of the above code

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.