How to add image to asciidoc book cover page?

I would like to create a pdf book using asciidoc. The title page should include the title, subtitles and image. So far, I have not been able to find documentation on how to achieve this.

Intuivly I would do something like

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

but it just adds image:images/titelimage.png[width=400] as subtitles. I would like to have 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?

+6
source share
4 answers

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

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

See pdf example here and raw adoc .

+10
source

If you need a PDF file with docbook 4.x output, you should:

Create a docinfo file with an image for the first page. This is an XML file similar to the following example. This is discussed at http://www.methods.co.nz/asciidoc/userguide.html#X87

Example:

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

Then set up your DocBook style sheets to include the media element for the cover page (by default, style sheets do not include this). http://www.sagehill.net/docbookxsl/TitlePagePrint.html

DocBook 5 includes a cover element in its style sheets.

+2
source

you just need to add an empty line between the toc statement and images :. The way asciidoc sort separates blocks.

0
source

It:

 = The Book Title :author: First Last :email: first.last@company.com :toc: :toc-placement: preamble :doctype: book image:./images/title_page.jpg[] 

It produces:

 My book title first.last@company.com - first.last@company.com Image Table of Contents ... 
0
source

Source: https://habr.com/ru/post/955891/


All Articles