Horizontally aligining blocks
- Please forgive my "alignment fetishism." I want to left-, center- or
right-align a block inside another block. Thanks to Nikolai, I know I can
do that by specifying start-indent for the contained block; however, in
order to do so, I must calculate the difference between the widths of the
two blocks, then divide that by two. I am writing an XSLT transformation to
generate the FO. Sometimes the widths of the blocks aren't explicitly
given. For example, what happens if the contained block's width is
determined by its contents?
And even if I know or can discover the widths, I am having problems
calculating the start-indent in XEP. According to the Candidate
Recommendation, I should be able to given an expression for start-indent.
Sure enough, if I assign it "100% - 75%" the block is right-aligned.
However, CR says I can use mixed units, e.g., "100% - 150pt". When I do
that, the block is left-aligned (i.e., "100% - 150pt" seems to evaluate to
zero). Out of curiosity I tried using from-parent(width) instead of 100%.
All experiments seemed to result in zero start-indent, including
1. Any suggestion how to achieve horizontal alignment of a block within a
block? If this can only be done with start-indent, then the width of the
contained block must be established before the evaluation of start-indent,
and there must be a function to get it.
2. Does XEP fully implement mixed-unit calculations and from-parent()?
Richard R. Liu
Tel.: 061/361 32 75