AsciiDoctor PDF & slide-show presentations

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

AsciiDoctor PDF & slide-show presentations

gour
After seeing the great output produced by AsciiDoctor PDf I wonder what would be procedure (when writing AsciiDoctor markup) to use the same tool to create stunning slide-show presentations with it?

Disclaimer: I belong to the old school and prefer handling PDFs instead of 'modern' JS-based stuff using bunch of Node tools.  
Reply | Threaded
Open this post in threaded view
|

Re: AsciiDoctor PDF & slide-show presentations

lodestone
Reply | Threaded
Open this post in threaded view
|

Re: AsciiDoctor PDF & slide-show presentations

gour
lodestone wrote
Well, that's still based on JS stuff, while I'd like to use pure AsciiDoctor markup + AsciiDoctor PDF and produce just *.pdf as the end result.
Ted
Reply | Threaded
Open this post in threaded view
|

Re: AsciiDoctor PDF & slide-show presentations

Ted
This post was updated on .
gour wrote
... I'd like to use pure AsciiDoctor markup + AsciiDoctor PDF and produce just *.pdf as the end result.
So you would create a PDF to be used as a slide show? I would never think to do that, but here goes...

You could use the experimental Page Break <<< and split the pages into slides. Try rendering this with Asciidoctor-PDF


= PDF Slideshow
:experimental:
:pdf-page-size: 9in x 6in

== Slide 1

Use the next and previous page buttons to navigate this 'slideshow'

<<<

== Slide 2

Here's another 'slide'

<<<

== Three

* Three
* Three
* Three

<<<

== The End

This concludes this experiment

NOTE: use :pdf-page-size: 9in x 6in to make a landscape sized PDF
- Ted @TedAtCIS
Reply | Threaded
Open this post in threaded view
|

Re: AsciiDoctor PDF & slide-show presentations

gour
Ted wrote
So you would create a PDF to be used as a slide show? I would never think to do that, but here goes...
Really?

LaTeX has e.g. Beamer package which is very  popular for creating presentations.

There is also another TeX macro package called ConTeXt which is capable of producing high-quality typeset output.

Moreover, having presentation in PDF it means it's portable  - one can put it on USB stick and present using any PDF viewer, without the need for Internet connection and/or so many Node-based dependencies.

You could use the experimental Page Break <<< and split the pages into slides. Try rendering this with Asciidoctor-PDF
That could do the job. Thank you!
Ted
Reply | Threaded
Open this post in threaded view
|

Re: AsciiDoctor PDF & slide-show presentations

Ted
gour wrote
Moreover, having presentation in PDF it means it's portable  - one can put it on USB stick and present using any PDF viewer, without the need for Internet connection and/or so many Node-based dependencies.
I typically use Asciidoctor Reveal.js which also generates a portable slide deck with all the HTML and JavaScript that I have put on a USB stick. No Internet needed, just a modern web browser. You get some extra bells and whistles compared to a PDF.

But you've opened my eyes. I think using PDF would be good a good solution the next time I need to hand someone a presentation. Everyone knows how it works and PDF readers are generally installed on most machines.


- Ted @TedAtCIS
Reply | Threaded
Open this post in threaded view
|

Re: AsciiDoctor PDF & slide-show presentations

mcp292
Exactly what I was looking for! One problem I don't know how to solve is the even page numbers show bottom left and the odd bottom right. How can I get them all to show bottom right? Is this related to the `<<<`?
Reply | Threaded
Open this post in threaded view
|

Re: AsciiDoctor PDF & slide-show presentations

mcp292
This is the theme I'm using and it's working well:
```
extends: default
base:
  font-size: 15
heading:
  h1-font-size: 30
  h2-font-size: 25    
  h3-font-size: 20
title_page:
  authors:
    font_size: $heading_h3_font_size
```

With Dan Allen's help I found you could use `{break}` for inserting vertical space, which has been useful for positioning images.
Reply | Threaded
Open this post in threaded view
|

Re: AsciiDoctor PDF & slide-show presentations

mcp292
I've since created a bash function in my ~/.bashrc. I store the above theme in a central location and can call the function to create a slide pdf from any directory:

```
adocslide()
{
    asciidoctor-pdf -a pdf-theme=/path/to/theme.yml "$1"
}
```

Use:
`adocslide presentation.adoc`

Possible improvement could be including page size in the theme, but for me it serves as a reminder to use page breaks (<<<), and an indication that I am working in an adoc file intended for slides.
Reply | Threaded
Open this post in threaded view
|

Re: AsciiDoctor PDF & slide-show presentations

mcp292
My latest theme:

```
extends: default
base:
  font_size: 15
heading:
  h1-font-size: 30  
  h2-font-size: 25    
  h3-font-size: 20
  h4-font-size: 15
title_page:
  authors:
    font_size: $heading_h3_font_size
code:
  font-size: 15
block:
  margin-top: 5  # If you start your slides with a block, could use {blank} instead
```
Reply | Threaded
Open this post in threaded view
|

Re: AsciiDoctor PDF & slide-show presentations

mcp292
I found out that the variables in the theme you extend are not updated when you change values they reference. Meaning it might be better to copy over the entire theme and change what you need. For my purposes I'd rather only change what I have to and keep the file small and readable.

I added a line to increase the page number size and got rid of the margin top stuff:

```
extends: default
base:
  font_size: 15
heading:
  h1-font-size: 30  
  h2-font-size: 25    
  h3-font-size: 20
  h4-font-size: 15
title_page:
  authors:
    font_size: $heading_h3_font_size
code:
  font-size: 15
footer:
  font-size: 12
```
Reply | Threaded
Open this post in threaded view
|

Re: AsciiDoctor PDF & slide-show presentations

mojavelinux
Administrator
> Meaning it might be better to copy over the entire theme and change what you need.

I strongly recommend against doing that. That's why the theme can be extended. What I recommend is to either override all the keys you need to override from the default theme, or extend the base theme (which is much more minimal) and define the keys you need.

Best Regards,

-Dan

On Wed, Sep 2, 2020 at 8:44 AM mcp292 [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I found out that the variables in the theme you extend are not updated when you change values they reference. Meaning it might be better to copy over the entire theme and change what you need. For my purposes I'd rather only change what I had to.

I added a line to increase the page number size and got rid of the margin top stuff:

```
extends: default
base:
  font_size: 15
heading:
  h1-font-size: 30  
  h2-font-size: 25    
  h3-font-size: 20
  h4-font-size: 15
title_page:
  authors:
    font_size: $heading_h3_font_size
code:
  font-size: 15
footer:
  font-size: 12
```


If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/AsciiDoctor-PDF-slide-show-presentations-tp6053p8206.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