Exporting presentations in PDF format

Presentations can be converted into PDF by using a helper tool. You can install it by running:

pip install presenterm-export

important

Make sure that presenterm-export works by running presenterm-export --version before attempting to generate a PDF file. If you get errors related to weasyprint, follow their installation instructions to ensure you meet all of their dependencies. This has otherwise caused issues in macOS.

presenterm-export uses tmux to run presenterm inside it and capture its output.

After you've installed both presenterm-export and tmux, run presenterm with the --export-pdf parameter to generate the output PDF:

presenterm --export-pdf examples/demo.md

The output PDF will be placed in examples/demo.pdf.

note

If you're using a separate virtual env to install presenterm-export just make sure you activate it before running presenterm with the --export-pdf parameter.

Page sizes

The size of each page in the generated PDF will depend on the size of your terminal. Make sure to adjust accordingly before running the command above, and not to resize it while the generation is happening to avoid issues.

tmux <= 3.5a active sessions bug

Because of a bug in tmux <= 3.5a, exporting a PDF while having other tmux sessions running and attached will cause the size of the output PDF to match the size of those other sessions rather than the size of the terminal you're running presenterm in. The workaround is to only have one attached tmux session and to run the PDF export from that session.

How it works

The conversion into PDF format is pretty convoluted. If you'd like to learn more visit presenterm-export's repo.