gpt4 book ai didi

xml - XSL FO Docbook 内容左边距

转载 作者:数据小太阳 更新时间:2023-10-29 01:47:32 24 4
gpt4 key购买 nike

我正在使用 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>...

enter image description here

谢谢。

最佳答案

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 - 右页边距

Top and bottom margins (from documentation)

例如下一个参数将使这个页面布局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>

Resulting page layout

关于xml - XSL FO Docbook 内容左边距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17237093/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com