Debian Codegraph @

texk/makeindexk/tests/nested-range-bb.tex

raw
1 % Copyright 2011 Barbara Beeton <[email protected]>
2 % You may freely use, modify and/or distribute this file.
3 % This is the original annotated test report, with various extra info.
4 % See below \end{document}.
5 \documentclass{amsbook}
6 \usepackage{verbatim}
7
8 \makeindex
9
10 \begin{document}
11
12 \chapter{Demonstration of a Makeindex bug}
13
14 \index{random text|(}%
15 Here we open an index span for ``random text''.
16
17 \index{periodic Hilbert transform|(}%
18 How could we define the \emph{periodic Hilbert transform}?
19 Here is an open index span for ``periodic Hilbert transform''.
20
21 (lots more text omitted)
22 \newpage
23
24 We defined in Section~3 the
25 \index{periodic Hilbert transform|(}%
26 \emph{periodic Hilbert transform} or \emph{conjugate function}.
27 A second open index span for ``periodic Hilbert transform''.
28
29 \index{random text|(}%
30 (more omitted text and a second open index span for ``random text'')
31
32 Closing index spans for the two opened entries.
33 \index{periodic Hilbert transform|)}%
34 \index{random text|)}%
35
36 \vspace{1\baselineskip}
37 \verbatiminput{\jobname.tex}
38 \newpage
39 \noindent This is the .idx file from the previous run:
40 \verbatiminput{\jobname.idx-prev}
41 \vspace{2\baselineskip}
42 This is the resulting .ilg file:
43 \verbatiminput{\jobname.ilg}
44 \vspace{2\baselineskip}
45 And the resulting .ind file; note spurious \verb+\(+ inclusions.
46 \verbatiminput{\jobname.ind}
47 \end{document}
48
49
50 Date: Thu, 22 Sep 2011 12:23:48 -0400
51 From: Barbara Beeton
52 Subject: a makeindex bug
53
54 [...]
55
56 to get the desired output, run latex, then makeindex.
57 copy or rename <jobname>.idx to <jobname>.idx-prev,
58 rerun latex, and take a look at the output. (the
59 reason for the rename is that i've included in the
60 output listings of the .idx(-prev), .ilg, and .ind
61 files, all small, but very interesting.)
62
63 the problem is that if a span is begun for a string
64 and then a second span is begun for the same string
65 without the first one being closed, the |( in the
66 input is put into the output as \( -- with the
67 result that an attempt to print the index will get
68 an unmatched $ error. the unmatched span is noted
69 in the .ilg file with a warning, but since most
70 people ignore warnings the first time around (i
71 certainly do), the unrecoverable (la)tex error in
72 the index can really throw them into a tizzy.