3

The standard way of creating an index is by writing something like,

"term \index{term}"

Index will not show up in table of contents

Some random \index{random} text \index{stuff!text} about fact \cite{fact}.

It would have been much more efficient and more elegant to write only

"\index{term}"

The problem is that, Latex will not show "term" in the output pdf if only \index{term} was written.

Is there anyway to change this behavior?

1

1 Answer 1

5

Node that you should do

term\index{term}

or some recommend

\index{term}term 

never

term \index{term}

Or you may get a page break after term and the index will refer to the following page. The choice of which of the first forms to use depends if your "term" can be hyphenated and what you want to do if the page break occurs at the hyphen, index the start or end of the term.

You can define

\newcommand\zz[1]{#1\index{#1}}

then use

\zz{term}

If that is more convenient.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .