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

Isa*_*aac 11 pdf-generation asciidoc

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

我会做类似的事情

My book title
=============
:author: myself
:toc:
image:images/titelimage.png[width=400]
Run Code Online (Sandbox Code Playgroud)

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

My book title
<titleimage>
subtitle
Run Code Online (Sandbox Code Playgroud)

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

Lei*_*ldt 15

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

:title-logo-image: images/titelimage.png
Run Code Online (Sandbox Code Playgroud)

请在此处查看示例pdf原始adoc.

  • 我认为它现在被称为'title-logo-image',请参阅[https://github.com/asciidoctor/asciidoctor-pdf/tree/master/examples](examples)目录(新链接) (2认同)

ele*_*ead 5

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

= Book title
Authors
:front-cover-image: image::./images/title_page.png[]
Run Code Online (Sandbox Code Playgroud)

这为您提供了图像本身作为第一页,然后是显示标题、作者、修订等的页面。

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


小智 0

您只需在目录和图像之间添加一个空行:指令。这就是 asciidoc 分隔块的方式。