Closed bing-10 closed 2 years ago
The margins of page and fo:region-body is defined in dita2fo_layoutmasterset.xsl. If you want use margin-less page-master, use "pmsCover" or "pmsCoverForPrint" fo:simple-page-master or "pmsPageSeqCover" fo:page-sequence-master.
Ok, thank you. I can do some customizations now. But another question appeared: I want to put the book title in the center of the whole page(both vertically and horizontally), so I added such attributes in the definition file:
<attribute-set name="atsCoverBookTitleBlock">
<attribute name="position">absolute</attribute>
<attribute name="top">0</attribute>
<attribute name="right">0</attribute>
<attribute name="bottom">0</attribute>
<attribute name="left">0</attribute>
<attribute name="margin">auto</attribute>
</attribute-set>
The horizontal position is placed initially, but the vertical position cannot be changed through such attributes. How should I do? I would be very grateful if you could give the cause and solution.
fo:block-container is a square whos left-side coordinate is specified by @left, right-side is specified by @right, the top position is specified as @top and bottom is specified by @bottom. So specifying all 0 to these value has no meaning.
If you want locate fo:block-container to (x,y)=(10mm, 20mm) with width=30mm & height=40mm, set the following property.
<attribute-set name="atsCoverBookTitleBlock">
<attribute name="absolute-position">absolute</attribute>
<attribute name="left">10mm</attribute>
<attribute name="top">20mm</attribute>
<attribute name="width">30mm</attribute>
<attribute name="height">40mm</attribute>
</attribute-set>
I tried this approach, but it did not work properly: the title block remained unchanged(including "left", "top", "width" and "height"). Besides, what I want to realize is that the book title can be placed in the center of the cover page automatically, instead of by assigning absolute length values, because it will fit for different page sizes.
the book title can be placed in the center of the cover page automatically
What do you mean to place book title in the center of cover page? Vertically or horizontally? Or both?
Could you attach the current plug-in ZIP archive?
I mean both vertically and horizontally. This is the ZIP archive: com.test.pdf5.zip
I mean both vertically and horizontally. This is the ZIP archive: com.test.pdf5.zip
All changes I have made are mainly in config/default_style.xml and xsl/dita2fo_custom.xsl.
Here is the modified plug-in and sample DITA file output. Please read the output XSL-FO file and find the differences between fo:block-container anbd fo:block.
Also never use margin, margin-xxx for fo:block. Instead you can use start-indent and end-indent. The margin-xxx property is only left for CSS compatibility.
Ok, I see. Thank you very much! And, I have learned from what you have modified, but one thing I still feel confused about text-align-last. I am wondering the differences among text-align, text-align-last, and display-align. (even though I have referred to the instructions from https://www.w3.org/TR/2006/REC-xsl11-20061205/#text-align-last, I still did not make sense of the application in my modified plugin...)
@text-align-last is applied to the last line of a paragraph (fo:block). The default value is @text-align="relative". So it is not needed to explicitly specify @text-align-last="center". It was my habit. It will automatically set as "center" if @text-align="center".
7.16.10 "text-align-last" 7.16.9 "text-align"
@display-align is vertical alignment specifier. It is effective such as fo:block-container, not fo:block.
Ok, I see. Thank you!
I want to position the logo and booktitle freely on the cover, but there are always margins on the cover. I checked the xsl:
and found it applied atsPageSeqBase as attribute-set to style the cover page. However, I found there are no attributes about margin in the attibute-set atsPageSeqBase:
So, what should I do to customize the cover independently?