我使用docbook 5(docbook xsl ns),用apache fop生成pdf,我想将所有文本移到左边。
我该怎么做?
源XML是:

<section>
        <title>Usage</title>
        <programlisting>mvn archetype:generate -DarchetypeGroupId=cz.csob.javor -DarchetypeArtifactId=javor-archetypes-subcomponent -DarchetypeVersion=X.Y.Z</programlisting>
        <para>During the subcomponent project generation you will be asked for the following properties:</para>
        <itemizedlist>
            <listitem>
                <para><emphasis>parent-component-id</emphasis> - ID of the parent component, should be the name of the directory the parent component project is placed in</para>
            </listitem>
            <listitem>...

谢谢。

最佳答案

段落缩进由body.start.indent参数添加。
您应该使用度量将值设置为此参数,因为它在其他xslt模板中用于计算。例如,下一行将完全删除段落缩进:

<xsl:param name="body.start.indent">0pt</xsl:param>

所有xslt自定义层都应该类似于:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:fo="http://www.w3.org/1999/XSL/Format"
    version="1.0">
    <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"/>
    <xsl:param name="body.start.indent">0pt</xsl:param>
</xsl:stylesheet>

Reference documentation for this topic
也可以使用其他缩进选项:
page.margin.inner-左页边距
page.margin.outer-右页边距
xml - XSL FO Docbook内容左边距-LMLPHP
例如,下一个参数将使此页面布局3
<xsl:param name="page.margin.inner">20mm</xsl:param>
<xsl:param name="page.margin.outer">10mm</xsl:param>
<xsl:param name="page.margin.top">12.5mm</xsl:param>
<xsl:param name="page.margin.bottom">15mm</xsl:param>

<xsl:param name="region.before.extent">10mm</xsl:param>
<xsl:param name="region.after.extent">5mm</xsl:param>

<xsl:param name="body.margin.top">15mm</xsl:param>
<xsl:param name="body.margin.bottom">15mm</xsl:param>

xml - XSL FO Docbook内容左边距-LMLPHP

07-26 03:35