手动换行和格式化 Docbook

5

我正在尝试使用Docbook制作简单的帮助文档。我需要对文本进行格式化,而不是让文本紧凑且难以阅读。最好能够在输入文本时设置文本格式(即保留空格和换行符)。

到目前为止,我尝试了<?line-break?><?lb?><sbr/>。我只是尝试将它们添加到期望换行的位置,就像在基于C的语言中使用"\n"一样。

我无法解决这个问题,也找不到任何有用的资源。非常感谢任何有关手动换行或文本格式化的帮助。

<article xmlns='http://docbook.org/ns/docbook'>
    <title>Welcome to help</title>
    <section>
        <simplesect>
            <title>Abstract</title>
            <para>
              <!--Multi-lined paragraph where I 
                  need to break the lines manually
               -->
            </para>
        </simplesect>
    </section>
</article>
1个回答

9
使用Docbook时,通过使用标签<literallayout>,可以保留所有空格和换行。同时,也可像编辑纯文本一样轻松地进行手动换行!
<literallayout>
  O, for a muse of fire, that would ascend
The brightest heaven of invention!
A kingdom for a stage, princes to act,
And monarchs to behold the swelling scene!
</literallayout>

将会输出以下结果:

enter image description here


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接