I recently discovered Prince and am very excited about it. I work for a specialty publisher, and I’ve been using a demo copy to test Prince’s capabilities because I think our document-generation procedures could enormously benefit from it. I wish to make a formal proposal to my higher-ups soon, but I’ve run into a deal-breaker of a problem!
Many of the documents we publish include alphabetized entries, like those you might find in a dictionary, phone book, glossary, gazetteer, etc. As a result, guide words are an essential component of our documents. I was delighted to discover that Prince has support for guide-word generation, but I haven’t been able to get it to achieve the results I need.
Here’s some sample CSS:
The above code is intended to produce one guide word per page: a beginning guide word on left-hand pages, and an ending guide word on right-hand pages. (It also displays page numbers.) And here’s some sample HTML to ply the above CSS on:
If there’s a page break (let’s say between pp. 3 & 4) between the “ANDERSON, Charlie” and “ARBOGAST, Fred” entries, Prince does what I expect, listing “ANDERSON” as pg. 3’s guide word and “ARBOGAST” as pg. 4’s. (Apparently string(guideword) is equivalent to string(guideword, first).) But, if the break occurs between the two “ANDERSON”’s, I get an undesired result: “ARBOGAST” becomes pg. 4’s guide word, even though the “ANDERSON, Charlie” entry is clearly the first one on the page. How do I fix this (so that “ANDERSON” would be the guide word on pg. 4 too)? Using string(guideword, start) is out, since other pages would get incorrect beginning guide words. Is there another way?
(Is the “first” page policy’s unexpected implementation due to a bug or a difference in philosophy? Apparently Prince considers the “first” value of the string to be the first one that’s different from the starting value [i.e., the first value that’s different from the last value from the previous page, if there is one]. But in documents like my company’s, sometimes nonunique guide words are needed as in cases like my example. In my conception, Prince’s behavior regarding the “first” page policy is legitimately needed for some documents, but it might be better renamed something like “first-new”, whereas just plain “first” should refer to the very first instance on the page, whether or not the value is a new one. Or, I suppose, “first” can remain as it is, and my desired page policy could be named something like “absolute-first”.)
I hope some sort of fix for my documents can be made available soon. Thank you for your attention.
Many of the documents we publish include alphabetized entries, like those you might find in a dictionary, phone book, glossary, gazetteer, etc. As a result, guide words are an essential component of our documents. I was delighted to discover that Prince has support for guide-word generation, but I haven’t been able to get it to achieve the results I need.
Here’s some sample CSS:
li span.guide {string-set: guideword content()}
@page:left {@top-left {content: counter(page) "\A0\A0" string(guideword)}}
@page:right {@top-right {content: string(guideword, last) "\A0\A0" counter(page)}}
The above code is intended to produce one guide word per page: a beginning guide word on left-hand pages, and an ending guide word on right-hand pages. (It also displays page numbers.) And here’s some sample HTML to ply the above CSS on:
<li><span class="guide">ANDERSON</span>, Betty</li>
<li><span class="guide">ANDERSON</span>, Charlie</li>
<li><span class="guide">ARBOGAST</span>, Fred</li>
If there’s a page break (let’s say between pp. 3 & 4) between the “ANDERSON, Charlie” and “ARBOGAST, Fred” entries, Prince does what I expect, listing “ANDERSON” as pg. 3’s guide word and “ARBOGAST” as pg. 4’s. (Apparently string(guideword) is equivalent to string(guideword, first).) But, if the break occurs between the two “ANDERSON”’s, I get an undesired result: “ARBOGAST” becomes pg. 4’s guide word, even though the “ANDERSON, Charlie” entry is clearly the first one on the page. How do I fix this (so that “ANDERSON” would be the guide word on pg. 4 too)? Using string(guideword, start) is out, since other pages would get incorrect beginning guide words. Is there another way?
(Is the “first” page policy’s unexpected implementation due to a bug or a difference in philosophy? Apparently Prince considers the “first” value of the string to be the first one that’s different from the starting value [i.e., the first value that’s different from the last value from the previous page, if there is one]. But in documents like my company’s, sometimes nonunique guide words are needed as in cases like my example. In my conception, Prince’s behavior regarding the “first” page policy is legitimately needed for some documents, but it might be better renamed something like “first-new”, whereas just plain “first” should refer to the very first instance on the page, whether or not the value is a new one. Or, I suppose, “first” can remain as it is, and my desired page policy could be named something like “absolute-first”.)
I hope some sort of fix for my documents can be made available soon. Thank you for your attention.