6

the following script produces the default index on page 2 with an entry "names 1", on page 3 the single line "namestitle=Names" and on page 3 a repeat of the index on page 2. The names.ind file is not created. How do I get two indices?

\documentclass{book}
\usepackage{index}
\makeindex
\newindex{names}{idx}{ind}{Name Index}
\begin{document}
this is a test of using multi indices
\index{1st entry into default index=Book 1}
\index{names}{1st entry into names index=Author 1}
\index{2nd entry into default index=Book}
\index{names}{2nd entry into names index=Author 2}
\printindex{names}{title=Names}
\printindex
\end{document}

the log file is

This is pdfeTeXk, Version 3.141592-1.20a-2.2 (Web2c 7.5.3) (format=LATEX 2014.1.7)  26 JAN 2014 21:29
 Source specials enabled.
 %&-line parsing enabled.
**&latex Mult_IndexGNY.tex
(./Mult_IndexGNY.tex
LaTeX2e <2005/12/01>
(c:/Program Files (x86)/PCTeX/PCTeXv6/texmf-dist/tex/latex/base/book.cls
Document Class: book 2005/09/16 v1.4f Standard LaTeX document class
(c:/Program Files (x86)/PCTeX/PCTeXv6/texmf-dist/tex/latex/base/bk10.clo
File: bk10.clo 2005/09/16 v1.4f Standard LaTeX file (size option)
)
\c@part=\count79
\c@chapter=\count80
\c@section=\count81
\c@subsection=\count82
\c@subsubsection=\count83
\c@paragraph=\count84
\c@subparagraph=\count85
\c@figure=\count86
\c@table=\count87
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
(c:/Program Files (x86)/PCTeX/PCTeXv6/texmf-dist/tex/latex/index/index.sty
Package: index 2004/01/20 v4.2beta Improved index support (dmj)
\@indexbox=\insert233
\indexproofstyle=\toks14
)
\idxtitle@default=\toks15
\tf@default=\write3
\openout3 = `Mult_IndexGNY.idx'.

Package index Info: Writing index file Mult_IndexGNY.idx on input line 5.
\idxtitle@names=\toks16
\tf@names=\write4
\openout4 = `Mult_IndexGNY.idx'.

Package index Info: Writing index file Mult_IndexGNY.idx on input line 6.

(./Mult_IndexGNY.aux)
\openout1 = `Mult_IndexGNY.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
 (./Mult_IndexGNY.ind [1

] [2


]) (./Mult_IndexGNY.ind
[3

] [4


]) (./Mult_IndexGNY.aux) ) 
Here is how much of TeX's memory you used:
 308 strings out of 95374
 3662 string characters out of 1187507
 1046293 words of memory out of 2500000
 3357 multiletter control sequences out of 10000+50000
 4599 words of font info for 17 fonts, out of 1000000 for 2000
 14 hyphenation exceptions out of 8191
 23i,4n,17p,152b,222s stack positions out of 5000i,500n,1000p,200000b,5000s
 0 PDF objects out of 300000
 0 named destinations out of 131072
 1 words of extra memory for PDF output out of 65536

Output written on Mult_IndexGNY.dvi (4 pages, 1384 bytes).
6

You're loading index, but using the syntax of multind. Here's the correct index style:

\documentclass{book}
\usepackage{index}
\makeindex
\newindex{names}{idn}{inn}{Name Index}
\begin{document}
this is a test of using multi indices
\index{1st entry into default index=Book 1}
\index[names]{1st entry into names index=Author 1}
\index{2nd entry into default index=Book}
\index[names]{2nd entry into names index=Author 2}
\printindex[names]
\printindex
\end{document}

You'll have to run makeindex on the two files <filename>.idx and <filename>.idn. If the main file is thesis.tex, the calls should be

makeindex thesis
makeindex -o thesis.inn thesis.idn

You should consider imakeidx: the syntax would be pretty similar:

\documentclass{book}
\usepackage{imakeidx}
\makeindex
\makeindex[name=names,title=Name Index]
\begin{document}
this is a test of using multi indices
\index{1st entry into default index=Book 1}
\index[names]{1st entry into names index=Author 1}
\index{2nd entry into default index=Book}
\index[names]{2nd entry into names index=Author 2}
\printindex[names]
\printindex
\end{document}

and you don't have to run MakeIndex

  • when I use your script with index, there is no names.ind file created. – ashley Jan 28 '14 at 20:50
  • @ashley That's right; the file will be thesis.idn (change thesis into the real name of the main file). You're confusing with how multind works. – egreg Jan 28 '14 at 20:52

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.