[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: FO: Alphabetical index layout problem with justifi
I have needed to do exactly what you state, on short and long lines:
At 2015-06-03 14:32 +0000, Michael MC<ller-Hillebrand mmh@xxxxxxxxx wrote: ...We are challenged with a layout for an alphabetical index that uses leader dots and forces page numbers to the right border of the current column, like this: What we (think we) want is nicely right-aligned numbers (and if possible a continuation of the leader line): ... and I've accomplished that with the following standard XSL-FO: <?xml version="1.0" encoding="US-ASCII"?><!--dual leaders.fo--> <root xmlns="http://www.w3.org/1999/XSL/Format" font-family="Times" font-size="20pt"> <layout-master-set> <simple-page-master master-name="frame" page-height="297mm" page-width="210mm" margin-top="15mm" margin-bottom="15mm" margin-left="15mm" margin-right="125mm"> <region-body region-name="frame-body" background-color="#dddddd"/> </simple-page-master> </layout-master-set> <page-sequence master-reference="frame"> <flow flow-name="frame-body" xmlns="http://www.w3.org/1999/XSL/Format"> <block>This is a test</block> <block space-before="1em" text-align="justify" text-align-last="justify"> <inline keep-together="always">Keyword<leader leader-length.optimum=".5em" leader-pattern="dots"/></inline><inline keep-together="always"><leader leader-length.optimum=".5em" leader-pattern="dots"/>23</inline> </block> <block space-before="1em" text-align="justify" text-align-last="justify"> <inline keep-together="always">Other keyword<leader leader-length.optimum=".5em" leader-pattern="dots"/></inline><inline keep-together="always"><leader leader-length.optimum=".5em" leader-pattern="dots"/>5, 11, 25, 42</inline> </block> </flow> </page-sequence> </root> Note that I had to be careful in the above not to introduce any white-space between the constructs. The constructs are identical and can be used in XSLT template rules, the content of the left and right bits is arbitrary. You can use any construct to create the list of page numbers. My choice of the optimum size of .5em for the leader results in one line being used when the space between the text and the first page number is at least 1em, but if it is less than 1em, two lines are used. My client was producing a catalogue of titles and the list of associated contract numbers and needed this presentation. The principle is that in a justified line, all elastic leaders are stretched to fill the line, so I keep together an elastic leader with the text on the left and another elastic leader with the text on the right. When they both fit on one line, both leaders grow. I hope this helps. . . . . . . . . Ken At 2015-06-03 14:32 +0000, Michael MC<ller-Hillebrand mmh@xxxxxxxxx wrote: Hello experts, -- Check our site for free XML, XSLT, XSL-FO and UBL developer resources | Free 5-hour lecture: http://www.CraneSoftwrights.com/links/video.htm | Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ | G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx | Google+ profile: http://plus.google.com/+GKenHolman-Crane/about | Legal business disclaimers: http://www.CraneSoftwrights.com/legal |
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|