formatting a back-of-the-book index with CSS (no JavaScript)

I'm slowly wrking through things people currently do with XSL-FO, trying to make sure they're possible with pure HTML + CSS.

You can format an index for the back of a book using HTML easily enough, and "a" elements, but you run into a snag when you try and format the index into (say) PDF, or even for screen-based paged media.

An index will typically have entries like
   Boats, canal 17, 19-25, 38
You need the formatter to collapse ranges like 19-25 based on when items appeared on consecutive pages, and also for the formatter to remove duplicate numbers if two items appear on the same page after formatting.

I wrote a short blog entry on this:
http://barefootliam.blogspot.ca/2014/08/back-of-book-indexes-and-css.html

Right now people seem to be either using JavaScript in PrinceXML, or post-procesing the area tree or the PDF with AntennaHouse, or using extension properties.

There are still a couple of minor issues - e.g. the best way to specify the comma and dash to be inserted.

Note, I'm only talking about formatting an index, not building one. Like a table of contents, right now the markup has to be in the document - how to get it there is a separate topic.

Thanks,

Liam

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/

Received on Saturday, 23 August 2014 19:04:45 UTC