I'd like an index entry for a page in the book and the book cover. The answer at created a fixed page number of an index entry doesn't handle a text reference. The one at Make index entries refer to something other than the page numbers looks much more complex than my need-just-once use case.

This MWE (not absolutely minimal but maybe fun to read) produces the correct .ilg file


but not the right index.



The story headlined in the Boston Post on the cover of this book tells
of a January 15th, 1919 disaster in Boston's North End. 
Chuck Lyons retold the story in \emph{History Today} in 2009,
describing how a tank of molasses ruptured, ``releasing two million
gallons of molasses in a 15 foot high, 160 foot wide wave.''
Wikipedia adds that 
``Several blocks were flooded to a depth of 2 to 3 feet.''

Several years later the auditor appointed to decide on compensation

\ldots around \$300,000 in damages, equivalent to around \$30
million today, with about \$6,000 going to the families of those
killed, \$25,000 to the City of Boston, and \$42,000 to the Boston
Elevated Railway Company.

\item How long was the wave?

Estimate the number of blocks that could be covered two to three feet

Is Lyons's inflation calculation correct?

Estimate the number of families that lost loved ones.
How much would each receive, in today's dollars? How does that amount
compare to damage awards in similar cases today?

In this short document, the index should include the line

molasses, cover, 1

A hack solution is fine since this only happens once.



If you look at your file filename.ilg, you will find the error message:

!! Input index error (file = 274651.idx, line = 2):
   -- Illegal Roman number: position 2 in cover.

which gives you a hint about the problem: Apparently, \indexentry always expects a number, or at most a roman number.

You can use the following workaround: The package makeidx provides commands to set page numbers in specific styles. For example, \index{molasses|textbf} would print the corresponding page number in bold face. So let's define a new "style" (i.e. a command with a single argument that formats the argument):


Then the following line adds the desired entry in the index:

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.