Top News, Articles, and Interviews in Philosophy

A LaTeX indexing trick

Philosophy News image
Oh, the joys of indexing … Though using the LaTeX indexing tools reduces the pain a bit. Encounted one problem, though: Suppose you mention Aristotle (as you do) at the top of p. 40. And then you discuss a quite different point from Aristotle e.g. from the bottom of p. 41 over to page 43. Then you surely want the index entry to read Aristotle, 40, 41–43 So you put \index{Aristotle} in your text around the top p. 40, and then mark the start of the page range with \index{Aristotle|(} near the bottom of p. 41 and finish the range with \index{Aristotle|)}. Only to find to your annoyance that Makeindex produces Aristotle, 40–43 Drat! What to do? Well it turns out that putting on p. 40 \index{Aristotle|text} or \index{Aristotle|textrm} will have the desired result, and stop the p. 40 index entry being run into the following page range. Why? Because \index{headword}, \index{headword|text}, \index{headword|textrm} produce different styles of entry in a .ind file, \item headword, \hyperpage{x}, \text{y}, \textrm{z} where x, y, z are the relevant page numbers. And adjacent numbers in notionally different styles won’t be run together, though of course they will all be printed the same and the style differences are invisible (at least in a dead tree document without hyperlinks). Easy, eh? Well it took me a while to stumble across this undocumented LaTeX indexing trick; I’ll write it up for posterity on LaTeX for Logicians and on tex.stackexchange. The post A LaTeX indexing trick appeared first on Logic Matters.

Continue reading . . .

News source: Logic Matters

blog comments powered by Disqus