Customizing PDF export template

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

Customizing PDF export template

unfa
Hi!

I have some documents written is Asciidoc (using Atom with Asciidoc add-ons).

I'd like to customize the PDF export template a bit.

Specifically: I need to get rid of the first title page, and add the document title (and subtitle) in a table on the top of the first page instead.

I haven't found any information on the Internet so far, so I decided to ask directly here, as I search further.
I've never dug into Asciidoctor export templates before so I feel a bit lost as it seems a vast topic.

I'd appreciate if someone can give me a hint where to go.

- unfa
Reply | Threaded
Open this post in threaded view
|

Re: Customizing PDF export template

unfa
Ok, so I'va managed to find the templates used:
$ locate asciidoctor | grep .yml
/var/lib/gems/2.3.0/gems/asciidoctor-pdf-1.5.0.alpha.16/data/themes/base-theme.yml
/var/lib/gems/2.3.0/gems/asciidoctor-pdf-1.5.0.alpha.16/data/themes/default-theme.yml

I've copied them as a reference and managed to use them for asciidoctor-pdf export from Atom's preview.

Now I just need to find out what do I have to change in that .yml.

I want to:

1. Get rid of the title page
2. Add the title and subtitle on top of first page instead

Making the table is less important, though knowing how to do that would be great later.
Reply | Threaded
Open this post in threaded view
|

Re: Customizing PDF export template

abelsromero
Hi, welcome to the  forum!

Not sure eveything you want to do can be achieved, but I think you should have a look at the theme guide:
https://github.com/asciidoctor/asciidoctor-pdf/blob/master/docs/theming-guide.adoc.

Amongst other things, it shows how to disable the title page with an attrtibute:
The title page can be disabled from the document by setting the notitle attribute in the AsciiDoc document header.
If you want ot play with it, in the maven plugin examples we have a demo ready to use (provided you have Java and maven): https://github.com/asciidoctor/asciidoctor-maven-examples/blob/master/asciidoctor-pdf-with-theme-example/.

If you want to ran directly from Ruby, you can see the required attributed to add to the command in the pom.xml.


Reply | Threaded
Open this post in threaded view
|

Re: Customizing PDF export template

mojavelinux
Administrator
In reply to this post by unfa
> Get rid of the title page

Set the notitle attribute, like this:

asciidoctor-pdf -a notitle input.adoc

> Add the title and subtitle on top of first page instead

See this discussion:


Cheers,

-Dan

On Fri, Jul 13, 2018 at 6:22 AM unfa [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Ok, so I'va managed to find the templates used:
$ locate asciidoctor | grep .yml
/var/lib/gems/2.3.0/gems/asciidoctor-pdf-1.5.0.alpha.16/data/themes/base-theme.yml
/var/lib/gems/2.3.0/gems/asciidoctor-pdf-1.5.0.alpha.16/data/themes/default-theme.yml

I've copied them as a reference and managed to use them for asciidoctor-pdf export from Atom's preview.

Now I just need to find out what do I have to change in that .yml.

I want to:

1. Get rid of the title page
2. Add the title and subtitle on top of first page instead

Making the table is less important, though knowing how to do that would be great later.



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Customizing-PDF-export-template-tp6416p6417.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: Customizing PDF export template

Dreamless
Hello, I'm learning to love Asciidoc too

I would like to create a PDF output and create a template for it. This should have a header and footer and like in a report different "placeholders" which can be passed via header info. So in some date, time, author etc..

Is this possible to create a formatted template and how does this work?
Reply | Threaded
Open this post in threaded view
|

Re: Customizing PDF export template

mojavelinux
Administrator
The capabilities (and limitations) of the theming system for Asciidoctor PDF is described in this guide:


Cheers,

-Dan

On Fri, Aug 23, 2019 at 10:48 AM Dreamless [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hello, I'm learning to love Asciidoc too

I would like to create a PDF output and create a template for it. This should have a header and footer and like in a report different "placeholders" which can be passed via header info. So in some date, time, author etc..

Is this possible to create a formatted template and how does this work?


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Customizing-PDF-export-template-tp6416p7111.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux