MakeIndex, Nomenclature, Glossaries and AcronymsHow do I create index

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

How do I create index

Post by nlct »

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:

Code: Select all

\newcommand*{\keyword}[1]{#1\index{#1}}
This could be adapted to add extra information to the index:

Code: Select all

\newcommand*{\keyword}[2][]{#2\index{#2#1}}
For example:

Code: Select all

Here I mention \keyword{term}. Here is the principle definition of \keyword[|textbf]{term}.
Regards
Nicola Talbot

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
arwintcher
Posts: 29
Joined: Thu Feb 19, 2009 3:23 pm

Re: How do I create index

Post by arwintcher »

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

How do I create index

Post by diamondsteed »

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

Code: Select all

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)?

Code: Select all

\documentclass[12pt,Bold,letterpaper,TexShade]{mcgilletdclass}
%various \usepackages
\makeindex[abbr]
\begin{document}

\maketitle%

\begin{romanPagenumber}{2}%

%various frontmatter

\tableofcontents %
\listoftables %
\listoffigures %
\printindex[abbr]{List of Symbols and Abbreviations}{List of Symbols and Abbreviations}

\end{romanPagenumber}

%mainmatter

\index[abbr]{EG@example}

\end{document}
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

How do I create index

Post by localghost »

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¹
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ 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

How do I create index

Post by diamondsteed »

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
Post Reply