columns in xsl
1. | Half page with multicolumn and the other half page without columns |
No, currently it is not possible, because column-count is a property of fo:region-body, and there can be exactly one fo:region-body on a page. However, <fo:block span=all> may be used as a hack, but it is very difficult to position such blocks properly. | |
2. | newspaper layout with FOs |
XSL 1.0 is heavily attuned to content-driven layout: one central body region and up to 4 peripheral regions per page master, page masters generally intended to select on rather unsophisticated conditions (first or last page, even/odd, etc), and most devastating for what you want: exactly _one_ flow per page-sequence. You pretty much have to wait for XSL 2.0 to see layout-driven support. You can find papers dating back to '98, say (check out http://www.seyboldseminars.com/Events/sf98/transcripts/ETAPE_30.html, Stephen Deach's part near the end, for example), when the first XSL draft just came out, where the WG people are talking about the flow-map object that is only mentioned as an aside in the CR, and at that time they were also talking about multiple "content queues" per page sequence, switched into various regions by the flow-map. This all went away when reality set in. :-) (For those who are curious about the difference, Deach has a useful paper, one URL for which is http://www.infoloom.com/gcaconfs/WEB/paris98/deach.HTM). Ironically the issue may have been more with the spec...who was happy with what feature, in other words. Because N flows are about as simple to implement as one, and if you can properly handle 1-5 regions on each of a whole bunch of page-masters, you sure as heck can handle more than 5. | |
3. | Spanning text across a two column page |
By using the span="all" property on the blocks that you want to span on the page. Note in XSL-FO 1.0 you can only span all of the columns or keep the width to the one column you are in. | |
4. | Multi-column text |
Have you considered native declarative xsl-fo solution? Just declare how much columns you want on a region-body and let your favorite formatter to format your items appropriatively. <fo:region-body column-count="{$user-defined-number-of-columns}" column-gap="10pt"/> See 1. spec: xsl rec 2. example: "Multi-Column Regions" example at RenderX examples. | |
5. | Two columns aligned at the end |
Use display-align="after" on the <region-body> and all columns will be aligned to the after edge of the page ... which doesn't mean last baselines if you are using different font sizes, but if you are using the same font size then the baselines will coincidentally aligned on the last line. | |
6. | One and two columns in single page? |
To do this you have to define your fo:region-body to have two columns and then use span="all" on the blocks that should *not* be two columns. Note that span= can only legally be specified on blocks that are direct children of fo:flow, which can complicate your block generation a little bit if you're in the habit of just blindly throwing container blocks around stuff whether they are really needed or not. Not all FO implementations enforce this rule, but some do. To balance columns you follow a multi-column block by an empty, zero-height spanning block. | |
7. | How to balance columns |
To balance columns issue an empty block with span="all": <fo:block>Content in multiple columns</fo:block> <fo:block span="all"><fo:leader leader-length="0pt" leader-pattern="space"/></fo:block> The empty leader is to ensure that the block is honored as some processors will discard empty blocks. This should work in all FO implementations that support multiple columns. | |
8. | Balanced two column ending |
"Yes, include an empty spanned block at the end of your flow. The formatter will try to balance all of your columns on top of this empty block. Modulo keeps, breaks, widows, orphans, etc." With XEP, you can omit the empty spanned block and just use a flow-section (one of the RenderX extensions). The columns inside of your flow-section will be balanced. See xep lists |