如何将图像添加到asciidoc图书封面?

时间:2013-10-14 05:39:23

标签: pdf-generation asciidoc

我想使用asciidoc创建一本pdf书。标题页应包括标题,副标题和图像。到目前为止,我找不到任何关于如何实现这一目标的文档。

我会做类似

的事情
My book title
=============
:author: myself
:toc:
image:images/titelimage.png[width=400]

但这只是添加image:images/titelimage.png[width=400]作为副标题。我想拥有的是像

My book title
<titleimage>
subtitle

有没有办法在ascciidoc中这样做?如果没有,我需要做什么才能得到这个?

5 个答案:

答案 0 :(得分:13)

如果您正在使用asciidoctor-pdf,则可以为徽标定义属性。它会将图像放在文档标题上。

:title-logo-image: images/titelimage.png

在此处查看example pdfraw adoc

答案 1 :(得分:2)

如果您想要使用docbook 4.x输出的PDF,您应该:

生成包含首页图像的docinfo文件。这是一个类似于以下示例的XML文件。它在http://www.methods.co.nz/asciidoc/userguide.html#X87

进行了讨论

示例:

<mediaobject>
  <imageobject>
    <imagedata align="center" depth="400" fileref="../images/tiger.png" />
  </imageobject>
</mediaobject>
<subtitle>Subtitle of this book</subtitle>

然后,自定义DocBook样式表以包含标题页的媒体元素(默认情况下,样式表不包括此内容)。 http://www.sagehill.net/docbookxsl/TitlePagePrint.html

DocBook 5在其样式表中包含一个封面元素。

答案 2 :(得分:2)

如果仍然有人在寻找这个答案,这是正确的方法(使用asciidoctor-pdf):

= Book title
Authors
:front-cover-image: image::./images/title_page.png[]

这将使图像本身作为首页,然后是显示标题,作者,修订版等的页面。

如果要将图像与标题和作者放在同一页面上,则需要使用:title-logo-image:

答案 3 :(得分:0)

你只需要在toc和images:指令之间添加一个空行。这就是asciidoc有点分裂集团的方式。

答案 4 :(得分:0)

此:

= The Book's Title
:author: First Last
:email: first.last@company.com
:toc:
:toc-placement: preamble
:doctype: book

image:./images/title_page.jpg[]

产地:

My book title
first.last@company.com - first.last@company.com
Image
Table of Contents
...
相关问题