# Texshop cannot typeset .idx files

For some reason, Texshop refuses to typeset my index idx files. I'm working with a mac and a .ltx file

this is my code:

% XeLaTeX can use any Mac OS X font. See the setromanfont command below.
% Input to XeLaTeX is full Unicode, so Unicode characters can be typed directly into the source.

% The next lines tell TeXShop to typeset with xelatex, and to open and save the source with Unicode encoding.

%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode
\documentclass[11pt]{book}
\usepackage{ledmac}
\usepackage{fancyhdr}
\usepackage{hanging}
\textheight = 180.5 mm
\textwidth = 108.5 mm
\pagenumbering{arabic}
\usepackage{amsmidx}
\makeindex{nominum}
\makeindex{rerum}

\input{style}
\raggedbottom

\newcommand*{\LeftWidth}{3.0cm}%
\newcommand*{\RightWidth}{\dimexpr\linewidth-\LeftWidth-2em\relax}%
\newcommand{\AlignedBrace}[2]{%
\medskip\par\noindent%
\parbox{\LeftWidth}{\raggedleft\textbf{#1}\strut~}%
$\left\{~\parbox{\RightWidth}{\strut\textit{#2}\strut}\right.$%
}%

%\usepackage{geometry}                % See geometry.pdf to learn the layout options. There are lots.
%\geometry{a4paper}                   % ... or a4paper or a5paper or ...
%\geometry{landscape}                % Activate for for rotated page geometry
%\usepackage[parfill]{parskip}    % Activate to begin paragraphs with an empty line rather than an indent
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{amsmath}
%\renewcommand %These two commands are for double-spacing
%\baselinestretch{2}

% Will Robertson's fontspec.sty can be used to simplify font choices.
% To experiment, open /Applications/Font Book to examine the fonts provided on Mac OS X,
% and change "Hoefler Text" to any of these choices.

\usepackage{fontspec,xltxtra,xunicode}
\defaultfontfeatures{Mapping=tex-text}
\setromanfont[Mapping=tex-text]{Brill}
\setsansfont[Scale=MatchLowercase,Mapping=tex-text]{Gill Sans}
\setmonofont[Scale=MatchLowercase]{Andale Mono}
\frenchspacing

\begin{document}
.............................
\backmatter
\Printindex{nominum}{Index nominum}
\Printindex{rerum}{Index rerum}
\end{document}


and this is the log file I get:

This is XeTeXk, Version 3.141592-2.2-0.996 (Web2C 7.5.6)
%&-line parsing enabled.
entering extended mode
(./medlyeM2.ltx
LaTeX2e <2005/12/01>
Babel <v3.8h> and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, arabic, basque, bulgarian, coptic, welsh, czech, slovak, german, ng
erman, danish, esperanto, spanish, catalan, galician, estonian, farsi, finnish,
french, greek, monogreek, ancientgreek, croatian, hungarian, interlingua, ibyc
us, indonesian, icelandic, italian, latin, mongolian, dutch, norsk, polish, por
tuguese, pinyin, romanian, russian, slovenian, uppersorbian, serbian, swedish,
(/usr/local/texlive/2007/texmf-dist/tex/latex/base/book.cls
Document Class: book 2005/09/16 v1.4f Standard LaTeX document class
(/usr/local/texlive/2007/texmf-dist/tex/latex/base/bk11.clo))
(/usr/local/texlive/2007/texmf-dist/tex/latex/ledmac/ledmac.sty
(/usr/local/texlive/2007/texmf-dist/tex/latex/ledmac/ledpatch.sty))
(/usr/local/texlive/2007/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty)
(/usr/local/texlive/2007/texmf-dist/tex/latex/hanging/hanging.sty)
(./amsmidx.sty

! LaTeX Error: \printindex undefined.

! LaTeX Error: \indexchap undefined.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
...

l.108 \renewcommand{\indexchap}

-
As far as I can tell, amsmidx is for the amsbook class. I recommend using imakeidx (I'm one of the authors): the syntax is slightly different, though. – egreg Jul 18 '12 at 21:42
as mentioned by @egreg, amsmidx is intended only for ams document classes, and it is the only multi-index package compatible with ams classes. don't expect it to work anywhere else, please. amsmidx was based on multind, so if you need multiple indexes and are using a non-ams document class, you might try that package. – barbara beeton Jul 19 '12 at 18:18
I can't use multind with an ams math package. – Guillaume Coatalen Jul 19 '12 at 19:11
If someone could send me a simple code for imakeidx for two indexes that would be wonderful, I'm having problems with the pdf on how imakeidx works. – Guillaume Coatalen Jul 20 '12 at 7:35
Since you have some responses one ,ost of your questions, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. – Tobi Dec 13 '12 at 14:24

Here's a stripped down version of a document like you want; you just need to run XeLaTeX on it and the indices will automatically be compiled and produced.

\documentclass[11pt]{book}

\usepackage{imakeidx}
\makeindex[name=nominum,title=Index nominum,intoc]
\makeindex[name=rerum,title=Index rerum,intoc]

\usepackage{fontspec}
\setromanfont[Ligatures=TeX]{Brill}
\setsansfont[Scale=MatchLowercase,Ligatures=TeX]{Gill Sans}
\setmonofont[Scale=MatchLowercase]{Andale Mono}
\frenchspacing

\begin{document}
\frontmatter
\tableofcontents
\mainmatter
\chapter{Title}
Here we mention the name of a famous mathematician, Carl Friedrich
Gauss\index[nominum]{Gauss, Carl Friedrich} who is very well known
for his work in mathematics\index[rerum]{mathematics} and
physics\index[rerum]{physics}

\backmatter
\printindex[nominum]
\printindex[rerum]
\end{document}


## The "Index rerum"

-

The \printindex command is defined in the makeindex package so you need to add

\usepackage{makeindex}


You (or your IDE) will also need to run the makeindex program to generate the index after LaTeX has run, and then run latex again to typeset the index.


-
\indexchap is defined in lines 1158-1173 of amsbook.cls. The documentation says in the first two lines that amsmidx is for AMS document classes. – egreg Jul 18 '12 at 21:52