28.03.2013 Views

Guide to LaTeX (4th Edition) (Tools and Techniques

Guide to LaTeX (4th Edition) (Tools and Techniques

Guide to LaTeX (4th Edition) (Tools and Techniques

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

9.4. Keyword index 227<br />

An entry may be terminated with the character sequences |( or |)<br />

<strong>to</strong> designate the beginning <strong>and</strong> end of a range of page numbers. For<br />

example,<br />

\index{table|(} on page 95<br />

\index{table|)} on page 110<br />

produces the entry ‘table’ with page numbers given as 95–110.<br />

Instead of having the page number printed after the entry, a reference<br />

may be made <strong>to</strong> another index entry. For example, with<br />

\index{space|see{blank}}<br />

\index{table|seealso{array}}<br />

the entries ‘space, see blank’ <strong>and</strong> ‘table, see also array’ are made in the<br />

index.<br />

The three characters !, @, <strong>and</strong> | therefore have special functions for<br />

the MakeIndex program. In order <strong>to</strong> print these characters literally as<br />

text without their functions, the quote character " must precede them.<br />

For example, "! represents a literal exclamation point <strong>and</strong> not the entry<br />

divider.<br />

The quote character itself is thus a fourth special symbol <strong>and</strong> must be<br />

entered literally as "". However, there is a special rule in MakeIndex syntax<br />

that says a quote character preceded by a backslash will be interpreted<br />

as part of a comm<strong>and</strong>: thus \" may be used <strong>to</strong> put a German umlaut in<br />

an entry (as in \index{Knappen, J\"org}). This special rule can lead <strong>to</strong><br />

additional problems at times: in this book the index entry \! had <strong>to</strong> be<br />

typed as "\"!.<br />

It is possible <strong>to</strong> specify varying fonts for the page number. For example,<br />

in the index of this book, page numbers are set in bold face <strong>to</strong> indicate<br />

the page where a comm<strong>and</strong> is defined or first explained. This is achieved<br />

with an entry of the form<br />

\index{blank} on page 11, <strong>and</strong><br />

\index{blank|textbf} on page 22<br />

which in the second case puts the page number for this entry as the<br />

argument of a comm<strong>and</strong> \textbf. The line in the theindex environment<br />

becomes<br />

\item blank, 11, \textbf{22}<br />

Note: The vertical bar in the \index entry is not a typing error, but<br />

must replace the backslash as the L AT E X comm<strong>and</strong> symbol under these<br />

circumstances.<br />

There is a file idx.tex in the L AT E X installation, which can improve the read-<br />

! ability of the .idx files. By processing the idx.tex file (that is, calling latex<br />

idx), the user is prompted for the name of the.idx file <strong>to</strong> list:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!