Bert Bos W3C Position paper: A list of missing features in CSS Pagination and new requirements on CSS -------------------------------------- Originally, CSS was meant to be an easy-to-use style sheet language for simple layouts, to be replaced or complemented later with some other language for complex documents. A few years after CSS, W3C indeed created XSL as a complementary technology, but it has become clear that XSL is no longer enough and there is demand for CSS itself to grow into a style sheet language that is powerful enough for a large class of books and magazines, both on paper and in electronic form. E.g., the EPUB standard for e-books requires CSS for layout. Much of the needed complexity comes from the fact that books and magazines rely on pagination rather than scrolling and the fact that CSS traditionally has had very little support for that. Looking at aspects of layout associated with pagination, such as page numbers, footnotes, and running headers, is thus a useful way to develop a new list of requirements for CSS. I have been working on such a list (http://www.w3.org/Style/2013/paged-media-tasks). It currently contains a few dozen topics and, where known, also the ideas that have been proposed in the past for corresponding extensions to CSS. There is doubtlessly still more to add. As has been the case for all of CSS, for these topics also it is difficult to find experts on the typographic traditions of all languages. The requirements for some languages (English, French, Japanese…) are thus almost certainly more complete than the requirements for other ones. An important next step is also to determine the priorities of the various features, because, obviously, neither the CSS working group nor the implementers will be able to work on everything at once. Further discussions and workshops such as this one are needed. And it is possible that in some cases the conclusion will be that CSS is not the right technology, but that SVG, XSLT, or something else entirely should be used instead. To get a flavor of the challenges for CSS, let's look at a few examples from the list. Challenge 1: Running headers & footers -------------------------------------- CSS already has a simple mechanism for running headers and footers, enough to put a page number and a simple text in the margin of each page, but not enough if the running header includes, e.g., mathematics or bidirectional text. A quick sampling, recently, by a group of mathematicians of books in their possession showed that about a quarter to a third of math text books have one or two running headers with math in it. Which means that the existing mechanism in CSS is clearly not enough. Some people have started thinking about extensions for running headers in CSS and there are some experiments in software, too. The current status is that we know extensions are necessary, but the ideas for solutions have not been analyzed in any depth yet. Challenge 2: page templates --------------------------- Books and magazines that contain pictures often have one or a handful of “page templates,” usually based on a typographic grid: photos can only have certain sizes and be in certain places on the page, ditto for titles, and there is a fixed number of text columns. In the case of Japanese magazines, some of the areas on the page may contain vertical text, while others are horizontal. Although there has been a bit more research on this than on running headers (see, e.g., the work by César Acebal at the University of Oviedo) this topic also needs more analysis. Challenge 3: cross-references ----------------------------- Interactive documents can use hyperlinks for cross-references within the document, but in printed material the “links” have to include page numbers or section numbers (“See page 7”). There have been experiments in some CSS implementations with extensions to make such cross-references possible, (e.g., in the program Prince by YesLogic) but the results have not been analyzed yet. Some questions are, e.g., how to refer to page numbers that are numbered with roman numerals, or to pages whose page number isn't printed. If the referent is actually on the same page as the text that refers to it, the reference should obviously not say “on page 7,” but something like “on this page” or ”above.” None of the experiments so far have dealt with these questions. Challenge 4: indexes -------------------- Alphabetical indexes are another challenge. Obviously, the sorting order is dependent on the language, but also some aspects of the index depend on the pagination: e.g., it is not usual to list the same page number twice if the page contains two occurrences of the same term. And a range of page numbers (“12, 13, 14, 15”) should really be replaced by a dash (“12–15”). In fact, the task may even be more complex than that, because some typographers hold that, if the pages of a range are actually in two different chapters, they shouldn't be be presented as a single range, but as two (“12–14, 15”). This means that good indexes cannot be made until after pagination. And, if the index isn't at the end of the book, inserting the index can in turn change the pagination… There are no known proposals for indexes in CSS yet. An unsolved problem in e-books is also how to make indexes accessible to screen readers. It is generally recommended that the text of a hyperlinks's source anchor gives a hint about what it links to. (E.g., don't say “click [here] for the summary,” but say “see the [summary],” because the word “here” tells you nothing about the target.) But in an index, the link anchor is just a number. Challenge 5: copy fitting ------------------------- As a final example, consider copy fitting. One example of copy fitting is making a text fill a certain space completely, e.g., a text in two columns such that the last column is filled all the way to the bottom. The French weekly newspaper Le Canard enchainé is an example of a publication that varies the line spacing of articles so that articles fill a given space without any gap at the bottom of the last column. But not every typographer may want variable line spacing, because it means lines in different columns no longer line up. In ideographic scripts it is often important that all characters stay aligned to a grid. In other words, CSS must provide control over line height variations. CSS currently offers almost no control over line height and none of the current proposals for extensions support copy-fitting yet. Conclusion and next steps ------------------------- CSS is currently enough only for the simplest kinds of books and e-books. A novel that doesn't have very complex running headers and footers is possible. Some existing software offers experimental implementations of proposed extensions, which allows a somewhat wider class of publications. But there is still a lot of work to do on CSS before it can lay out text books or magazines. Creating lists of requirements, such as the work cited in this paper, is a first step. Collecting ideas for solutions is a second step. Those two tasks have been started, but are by no means finished. The third step, which hasn't been commenced yet, is to prioritize the requirements. Bert