1

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?

2
  • 1
    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
    – daleif
    May 20, 2020 at 20:04
  • Thanks! That worked
    – Peter Flom
    May 20, 2020 at 21:20

1 Answer 1

1
  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

6
  • Thanks. How do I do #3? That is, do I put \latexmk in the preamble? Or what? I will look into \setsecheadstyle (although that part is working OK for now)
    – Peter Flom
    May 20, 2020 at 12:23
  • 1
    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.
    – daleif
    May 20, 2020 at 12:28
  • Sorry to be dense here. I am using WinEdt. It has a "make index" button. I ran that, and then pdflatex. This again produced no errors but did not create a name index.
    – Peter Flom
    May 20, 2020 at 12:37
  • 1
    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)
    – daleif
    May 20, 2020 at 12:53
  • It's been a few decades since I used the the DOS prompt, but, I tried it. I got more errors about the file not being found (even though I see the file).
    – Peter Flom
    May 20, 2020 at 13:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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