Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add an image to asciidoc book cover page?

I would like to create a pdf book using asciidoc. The title page should include the title, subtitle and an image. So far I could not find any documentation on how to achive this.

Intuivly I would do something like

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

but this just adds image:images/titelimage.png[width=400] as a subtitle. What I would like to have is something like

My book title
<titleimage>
subtitle

Is there a way to do this in ascciidoc? If not, what do I need to do to get this?

like image 855
Isaac Avatar asked Oct 14 '13 05:10

Isaac


2 Answers

If anyone is still looking for this answer, this is the correct way to do it (using asciidoctor-pdf):

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

This gives you the image by itself as the first page followed by a page that shows the title, authors, revision etc.

If you want the image on the same page as the title and author, you need to use :title-logo-image: instead.

like image 171
electrichead Avatar answered Oct 04 '22 02:10

electrichead


If you're using asciidoctor-pdf you can define an attribute for the logo. It will place the image above the document title.

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

See an example pdf here and the raw adoc.

like image 40
Leif Gruenwoldt Avatar answered Oct 04 '22 04:10

Leif Gruenwoldt