rst2beamer
A restructured text based tool for preparing presentations.
History & motivation
While preparing a course, I became frustrated with the length of time it took to prepare a presentation, even simple slides with bullet-pointed text and lumps of code. Preparing handouts or downloadable versions was a further problem. Given that docutils already has good LaTeX output, PDF production via the Beamer document class was a logical choice. rst2beamer is a semi-ugly hack of docutil's LaTeX machinery, making as few modifications are possible due to (a) laziness and (b) wanting to leverage as much of an existing robust code base as possible. It isn't intended to be feature-complete: it worked with the ReST that I prepared and will probably give adequate output for 90% of other simple ReST documents.
Other options were considered and discarded as follows:
- ReportLab's Pythonpoint: requires a fixed frame size and would need custom XML output. Styling is done through Reportlab stylesheets, which can be complex.
- Prosper: Another LaTeX solution. On balance, Beamer seemed better although the point is arguable.
- AxPoint: requires Perl.
- slides and foil: Old LaTeX solutions that are now somewhat creaky.
Beamer is a LaTeX document class for preparing PDF-based presentations. This script takes restructured text input and processes it to get a Beamer LaTeX document which can then be converted easily into a PDF for actual use or modified to produce handouts or article-style documents.
Usage
rst2beamer takes all the arguments that rst2latex does, save the ``documentclass`` option (which is fixed to ``beamer``) and hyperref options (which are already set in beamer). It should interpret a reasonable subset of restructured text and produce reasonable LaTeX. It works for simple presentations at least.
In practice, I use this along with ``pdflatex`` (to convert the LaTeX output to PDF), using a small script that runs the two programs to get from ReST to PDFs.
Limitations
The top level title is set as the presentation title while 2nd-level titles are set as slide titles (``frametitles`` in Beamer terms). While all other titles are converted as normal, Beamer ignores them. There is some problem in the production of literals. rst2latex converts them to ragged-right, noindent typewriter font in a quote. Under beamer however, this makes them appear as italics. This was solved by overriding literal production with a simpler enviroment, albeit one that occasionally produces buggy output. Options to hyperref are dropped, due to this already being used in beamer.
If the content for an individual slide is too large, it will simply overflow the edges of the slide and disappear.
Earlier versions of rst2beamer did not work with docutils 0.4, seemingly due to changes in the LaTeX writer. While this has been fixed, most work has been done with docutils snapshots from version 0.5 and up. In balance, users are recommended to update docutils.
References
Thanks to Dale Hathaway for helping track down the docutils 0.4 bug.
|
|
|
|

