## LaTeX forum ⇒ MakeIndex, Nomenclature, Glossaries and Acronyms ⇒ How do I create index

Information and discussion about MakeIndex - the tool to generate subject indices for LaTeX documents.
nlct
Posts: 275
Joined: Thu Nov 06, 2008 11:15 am

### Re: How do I create index

A proper index needs skill which is why some publishers hire a specialist index editor: you can't expect any system to do that automatically. I think the key is to plan in advance before writing your book, rather than leaving it until you have written 20-30 chapters. What kind of things are you likely to index? If I'm writing a technical report, I often define \keyword{word} which prints its argument and indexes it:
1. \newcommand*{\keyword}[1]{#1\index{#1}}

1. \newcommand*{\keyword}[2][]{#2\index{#2#1}}

For example:
1. Here I mention \keyword{term}. Here is the principle definition of \keyword[|textbf]{term}.

Regards
Nicola Talbot

arwintcher
Posts: 29
Joined: Thu Feb 19, 2009 3:23 pm
Probably because you don't always want every single instance of a word in your index, just the meaningful ones.

diamondsteed
Posts: 2
Joined: Sat Nov 07, 2009 4:19 am
I am writing my .tex file in a text editor and then I use a .bat file to run texify.exe. Where do I put the line
1. makeindex -s mcgillnopage.ist abbr
to properly generate my index?
Do I put it in the .bat file? Or somewhere in the .tex file (see stripped down version below)?

2. %various \usepackages
3. \makeindex[abbr]
4. \begin{document}
5.
6. \maketitle%
7.
8. \begin{romanPagenumber}{2}%
9.
10. %various frontmatter
11.
12. \tableofcontents %
13. \listoftables %
14. \listoffigures %
15. \printindex[abbr]{List of Symbols and Abbreviations}{List of Symbols and Abbreviations}
16.
17. \end{romanPagenumber}
18.
19. %mainmatter
20.
21. \index[abbr]{EG@example}
22.
23. \end{document}

localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm
diamondsteed wrote:[...] Do I put it in the .bat file? Or somewhere in the .tex file (see stripped down version below)? [...]

This line goes into the batch file.

Best regards and welcome to the board
Thorsten¹
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

diamondsteed
Posts: 2
Joined: Sat Nov 07, 2009 4:19 am
localghost wrote:
diamondsteed wrote:[...] Do I put it in the .bat file? Or somewhere in the .tex file (see stripped down version below)? [...]

This line goes into the batch file.

Best regards and welcome to the board
Thorsten¹

Thanks!
Linda