自定义 DocBook XSL NS 部分标题样式

发布于 2024-09-18 17:35:20 字数 780 浏览 7 评论 0原文

我将“section.autolabel”设置为 1,最大深度为 2。因此,我的部分(sect1、sect2、sect3,...)标题如下:

1. Introduction
1.1 All about it
1.2 Some more all abouts

这些标题生成为纯文本(即:“1.1 All关于它”),没有任何专门针对编号和标题的格式。

我想做的是将这两个组件分成两个单独的区域,并将编号保持在最左侧,标题更靠右,与正文开始缩进保持一致。像这样的事情:

1.       Introduction

1.1      All about it.

         Yakkety smakkety with a blue blah blah. And then
         they lived happily ever after.

1.2      Some more all abouts 

         Etc.

我正在生成 FO 输出,并使用 DocBook 5 + DocBook NS XSL 和快速增长的自定义层。

所以,我想这个问题有两个方面:

  1. 我可以覆盖什么来控制标题生成?我对 fo/sections.xsl 内部的流程以及它如何组合在一起有点困惑?

  2. 如何引入固定宽度的内联元素来为数字和标题提供所需的间距?我一直在摆弄一些 fo:inline-containers、fo:block-containers 但它们都没有产生我想要的结果。

I have "section.autolabel" set to 1 with a max.depth of 2. So, my section (sect1, sect2, sect3, ...) titles are as follows:

1. Introduction
1.1 All about it
1.2 Some more all abouts

These are generated as pure text (ie: "1.1 All about it") without any formatting specifically for the numbering and the title separately.

What I would like to do is separate the two components into two separate regions and keep the numbering far to the left and the title more right-ish, in line with the body text start indent. So something like this:

1.       Introduction

1.1      All about it.

         Yakkety smakkety with a blue blah blah. And then
         they lived happily ever after.

1.2      Some more all abouts 

         Etc.

I'm generating FO output and using the DocBook 5 + DocBook NS XSL with a rapidly growing customization layer.

So, I guess this question is two fold:

  1. What can I override to have control of the title generation? I'm a bit confused the flow inside fo/sections.xsl and how it fits together?

  2. How would I introduce a fixed-width inline element to give the numbers and title their needed spacing? I've been messing around with some fo:inline-containers, fo:block-containers but none of it is producing the result I want.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文