# Multiple indexes in memoir

I am using the memoir class and would like to create two indexes: One for general terms and one for names. Following the documentation in "The Memoir Class for Configurable Typesetting" by Peter Wilson, p. 310 I included

\usepackage{makeidx}
\makeindex
\makeindex[names]


in my preamble.

\index{Wisdom} \index[names]{Alfonso}


in the body and

\printindex
\printindex[names]
\end{document}


at the end. This gave me no errors, but it only produced one index.

I also tried the imkindex package but this gave me an error about incompatible versions of luatex being used.

What am I doing wrong?

MWE follows

Main file:

\documentclass{memoir}
\title{Great quotations}
\author{Peter Flom}
% \usepackage{hyperref}
\usepackage[marginpar]{todo}
\usepackage{url}
\usepackage{varioref}
\usepackage{titlesec}
\usepackage{makeidx}

\titleformat*{\section}{\LARGE\bfseries}
\titleformat*{\subsection}{\large\bfseries}

\epigraphwidth 6in

\makeindex
\makeindex[names]

\begin{document}

\include{AtoC}

\printindex
\printindex[names]
\end{document}


A to C file

\chapter{A to C}
\section*{Alfonso el Sabio}
\subsection{On simplicity}\label{Alfonso1} \index{Wisdom} \index[names]{Alfonso}
\epigraph{%
Had I been present at the creation, I would have recommended something simpler}{%
Alfonso el Sabio (Alfonso X) of Castille \\ 1221 -- 1284}

\subsection{Who was Alfonso?}


EDIT: Following the suggestions, I went to the command prompt and entered

makeindex [c:\writing\nonfiction\quotes\names.idx]


I got the following

Input index file [c:\writing\nonfiction\quotes\names.idx] not found.
Usage: makeindex [-ilqrcgLT] [-s sty] [-o ind] [-t log] [-p num] [idx0 idx1 ...]


but when I look, I see names.idx in the specified spot.

I don't understand the usage note. Are all the things in [] brackets optional?

• Why are you using [] and why are you using a full path? Change to the folder where names.idx lives and run makeindex names.idx May 20, 2020 at 20:04
• Thanks! That worked May 20, 2020 at 21:20

1. with memoir the makeidx is build in, so no need to load it
2. I would not use titlesec with memoir, see the build in \setsecheadstyle etc
3. You need to manually run makeindex (or similar) on all generated .idx files. If you use the latexmk tool, it will automatically do that.
4. If you want to use automatic index generation via imakeidx you need to be aware that it changes the syntax for \makeindex such that \makeindex[names] needs to be changed to \makeindex[name=names], see the imakeidx documentation for more details.
Seems to run fine with lualatex under TeXLive 2020
• No latexmk is a script that can do compilations for you, you run it instead of, say, pdflatex (latexmk -pdf) or lualatex (latexmk -lualatex), it will then automatically run a number of times to resolve references, citations, index, toc etc. It is what Overleaf is using to compile projects. May 20, 2020 at 12:28
• I don't use WinEdt so I cannot help you. Presumably when you press that button WinEdt runs makeindex on file.idx (where file.tex is your main latex file), but it never touches names.idx and thus that index is never made. This is one of the problems with editors, there is no special button to do unusual compilations. You'll probably have to use the command line (yes it is scary, but it is a good idea to learn to use it). Or consider item (4) May 20, 2020 at 12:53