rst2pdf Examples

Here are a few examples of the kinds of things that rst2pdf can do, along with the source and style files so that you can use them as starting points for your own projects. You are very welcome to suggest additional examples by opening an issue on our source repo and to add your own examples - follow the CONTRIBUTING.md file for more information.

Basic Document

_images/document1-thumbnail.png

A simple document with some headings and the basic rst2pdf styling.

Document with Simple Styling

_images/document1-simple-thumbnail.png

The same basic document with some styles added.

Basic Presentation: Dark and Light Themes

_images/presentation1-light-thumbnail.png _images/presentation1-dark-thumbnail.png

Here is a simple sample presentation (inspired by https://github.com/akrabat/rst2pdf_example_presentation), with both dark and light styles. These could be a starting point for your own presentations.

Code Samples

_images/code1-thumbnail.png

A document with a few code samples (pull requests to expand the set are very welcome) to show how to use the syntax highlight. You can use any of the built in styles or create your own!

  • PDF: code1.pdf

  • Content: code1.rst

  • Command: rst2pdf code1.rst … try using some of the built in stylesheets such as murphy, solarized-light or xcode to change the way the code looks.

Tip: to set the background, use the backColor directive in the code section of your style file.

Structured Document

_images/structured-document-thumbnail.png

This document has automatically numbered headings and a generated table of contents. These are ReStructuredText Directives, more info in the docs for that here: https://docutils.sourceforge.io/docs/ref/rst/directives.html#document-parts