W3C home > Mailing lists > Public > www-style@w3.org > August 2014

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

From: Liam R E Quin <liam@w3.org>
Date: Sat, 23 Aug 2014 15:04:43 -0400
To: www-style@w3.org
Message-ID: <20140823150443.31d54078.liam@w3.org>
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

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:45 UTC