Unable to render footer using Asciidoctor pdf

1.4k views Asked by At


I'm trying to render a document with asciidoctor-pdf which has a footer with chapter title/page number. From the examples found so far I have come with this:

= Title of the book
:notitle:
:toc: left
:toclevels: 8 
:sectnums:
:sectnumlevels: 8
:source-highlighter: coderay 
:icons: font
:front-cover-image: pic.jpg

footer:
  height: 0.5in
  line_height: 1
  recto_content:
    right: '{chapter-title} | *{page-number}*'
  verso_content:
    left: '*{page-number}* | {chapter-title}

   == Chapter 1

However it does not produce the footer. I've tried both using the footer and the :footer top directive. Any help what could be wrong?

1

There are 1 answers

0
EhmKah a.k.a. Michael Krauße On

If you want to style your pdfs you can not put your settings in the adoc-file. You have to use pdf-theming. You find a long explanation here

A very short summary looks like

  1. create a file basic-theme.yml in directory themes (example for basic-theme.yml)
  2. put your footer settings basic-theme.yml
  3. use your styles asciidoctor-pdf -a pdf-stylesdir=themes -a pdf-style=basic Details