Can't get theme to work with asciidoctor-pdf

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Can't get theme to work with asciidoctor-pdf

Mark S
$ asciidoctor-pdf -v
Asciidoctor PDF 1.5.0.alpha.17.dev using Asciidoctor 2.0.10 [https://asciidoctor.org]
Runtime Environment (ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu]) (lc:UTF-8 fs:UTF-8 in:UTF-8 ex:UTF-8)

I have all my files in the same dir and run this to build:

asciidoctor-pdf -o book.pdf -a pdf-themesdir=. -a pdf-theme=pdf-theme.yml -a compress book.adoc

No error output is produced (in fact no output except for book.pdf).

But when I look at book.pdf it is A4 size and doesn't use the specified fonts or the specified page size or margins. Below is pdf-theme.yml. What am I doing wrong?

extends: default
page:
    margin: [1in, 1in, 1in, 1in]
    size: [9in,7in]
base:
    font-family: DejaVuSerif
heading: # limited to WINASCII
    font-family: Helvetica
menu: # limited to WINASCII
    font-family: Helvetica
title-page: # limited to WINASCII
    font-family: Helvetica
blockquote: # limited to WINASCII
    font-family: Helvetica
sidebar: # limited to WINASCII
    font-family: Helvetica
sidebar-title: # limited to WINASCII
    font-family: Helvetica
abstract: # limited to WINASCII
    font-family: Helvetica
ulist: # limited to WINASCII
    font-family: Helvetica
table: # limited to WINASCII
    font-family: Helvetica
toc: # limited to WINASCII
    font-family: Helvetica
header: # limited to WINASCII
    font-family: Helvetica
footer: # limited to WINASCII
    font-family: Helvetica
code:
    font-family: DejaVuSansMono
literal:
    font-family: DejaVuSansMono
font:
    catalog:
        DejaVuSans:
            normal: DejaVuSans.ttf
            italic: DejaVuSans-Oblique.ttf
            bold: DejaVuSans-Bold.ttf
            bold_italic: DejaVuSans-BoldOblique.ttf
        DejaVuSansFallback:
            normal: DejaVuSans.ttf
            italic: DejaVuSans-Oblique.ttf
            bold: DejaVuSans-Bold.ttf
            bold_italic: DejaVuSans-BoldOblique.ttf
        DejaVuSerif:
            normal: DejaVuSerif.ttf
            italic: DejaVuSerif-Italic.ttf
            bold: DejaVuSerif-Bold.ttf
            bold_italic: DejaVuSerif-BoldItalic.ttf
        DejaVuSansMono:
            normal: DejaVuSansMono.ttf
            italic: DejaVuSansMono-Oblique.ttf
            bold: DejaVuSansMono-Bold.ttf
            bold_italic: DejaVuSansMono-BoldOblique.ttf
    fallbacks:
        - DejaVuSansFallback
Reply | Threaded
Open this post in threaded view
|

Re: Can't get theme to work with asciidoctor-pdf

mojavelinux
Administrator
> Asciidoctor PDF 1.5.0.alpha.17.dev

This is your problem. That is an ancient version of Asciidoctor PDF with functionality that does not match the current docs. You should at least be using Asciidoctor PDF 1.5.3. If you upgrade, I think you will find that it works as expected.

Best Regards,

-Dan


On Sun, Dec 20, 2020 at 2:53 AM Mark S [via Asciidoctor :: Discussion] <[hidden email]> wrote:
$ asciidoctor-pdf -v
Asciidoctor PDF 1.5.0.alpha.17.dev using Asciidoctor 2.0.10 [https://asciidoctor.org]
Runtime Environment (ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu]) (lc:UTF-8 fs:UTF-8 in:UTF-8 ex:UTF-8)

I have all my files in the same dir and run this to build:

asciidoctor-pdf -o book.pdf -a pdf-themesdir=. -a pdf-theme=pdf-theme.yml -a compress book.adoc

No error output is produced (in fact no output except for book.pdf).

But when I look at book.pdf it is A4 size and doesn't use the specified fonts or the specified page size or margins. Below is pdf-theme.yml. What am I doing wrong?

extends: default
page:
    margin: [1in, 1in, 1in, 1in]
    size: [9in,7in]
base:
    font-family: DejaVuSerif
heading: # limited to WINASCII
    font-family: Helvetica
menu: # limited to WINASCII
    font-family: Helvetica
title-page: # limited to WINASCII
    font-family: Helvetica
blockquote: # limited to WINASCII
    font-family: Helvetica
sidebar: # limited to WINASCII
    font-family: Helvetica
sidebar-title: # limited to WINASCII
    font-family: Helvetica
abstract: # limited to WINASCII
    font-family: Helvetica
ulist: # limited to WINASCII
    font-family: Helvetica
table: # limited to WINASCII
    font-family: Helvetica
toc: # limited to WINASCII
    font-family: Helvetica
header: # limited to WINASCII
    font-family: Helvetica
footer: # limited to WINASCII
    font-family: Helvetica
code:
    font-family: DejaVuSansMono
literal:
    font-family: DejaVuSansMono
font:
    catalog:
        DejaVuSans:
            normal: DejaVuSans.ttf
            italic: DejaVuSans-Oblique.ttf
            bold: DejaVuSans-Bold.ttf
            bold_italic: DejaVuSans-BoldOblique.ttf
        DejaVuSansFallback:
            normal: DejaVuSans.ttf
            italic: DejaVuSans-Oblique.ttf
            bold: DejaVuSans-Bold.ttf
            bold_italic: DejaVuSans-BoldOblique.ttf
        DejaVuSerif:
            normal: DejaVuSerif.ttf
            italic: DejaVuSerif-Italic.ttf
            bold: DejaVuSerif-Bold.ttf
            bold_italic: DejaVuSerif-BoldItalic.ttf
        DejaVuSansMono:
            normal: DejaVuSansMono.ttf
            italic: DejaVuSansMono-Oblique.ttf
            bold: DejaVuSansMono-Bold.ttf
            bold_italic: DejaVuSansMono-BoldOblique.ttf
    fallbacks:
        - DejaVuSansFallback



If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/Can-t-get-theme-to-work-with-asciidoctor-pdf-tp8410.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen (he, him, his) | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: Can't get theme to work with asciidoctor-pdf

Mark S
I used the asciidoctor and asciidoctor-pdf packages that come with Ubuntu 20.04 LTS.
Anyway, I've now removed those packages and installed using gem and it all works great now.
Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Can't get theme to work with asciidoctor-pdf

mojavelinux
Administrator
Super! I'm glad to hear that did the trick!

Best Regards,

-Dan

p.s. I'm not sure why Ubuntu is holding back the upgrade of asciidoctor-pdf in the LTS release. The latest distro release included 1.5.3. If anyone has some sway there, I would appreciate it if you could make the case for the package being upgraded to a stable version.

On Mon, Dec 21, 2020 at 1:53 AM Mark S [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I used the asciidoctor and asciidoctor-pdf packages that come with Ubuntu 20.04 LTS.
Anyway, I've now removed those packages and installed using gem and it all works great now.
Thanks!


If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/Can-t-get-theme-to-work-with-asciidoctor-pdf-tp8410p8413.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen (he, him, his) | @mojavelinux | https://twitter.com/mojavelinux