Created on Nov. 13, 2012, 6:03 p.m. by Hevok & updated by Hevok on June 26, 2013, 10:38 a.m.
A data entry can be rendered in various forms, like html and pdf. Specifically for pdf outputs rst2pdf is used.
This renders a data entry output as a legal size, serif document with code in murphy style:
$ rst2pdf article.rst -o article.pdf -s serif,murphy,legal
(perldoc looks better though)
In order to leverage the full set of UTF8 characters one should use a font that supports those encodings such as Dejavu:
$ rst2pdf article.rst -o article.pdf -s serif,dejavu,legal
Code syntax highlighting works via the code-block directive:
.. code-block:: python import this # Test for something in here: print something, "more"
import this # Test for something in here: print something, "more"
ReStructuredText can highlight itself:
.. code-block:: rest reST Test ========= .. class:: test
reST Test ========= .. class:: test
The linenos option can be used to display line numbers
Python in console
>>> print("Console online") Console online
Python traceback
Code can also be included into a document:
.. code-block:: python :include: setup.py
start-at: | string Will start here |
---|
raw pdf can be used to control the page count:
.. raw:: pdf SetPageCounter 1 lowerroman
Possible styles are:
romans start at 1. Arabic can start at 0, and alphas cannot go beyond 26 (of course).
PageBreak, EvenPageBreak or OddPageBreak can be used to break a page. Each of these can take an additional arguments which os the name of next page template:
.. raw:: pdf
PageBreak oneColumn
TwoColumn would create a two columned page in the following.
For formula and equation use the math directive:
.. math:: \frac{2 \pm \sqrt{7}}{3}
For mathematical symbols use the math role or directive:
:math:`\pi`
π
1 Comment to Rendering
Daniel Wuttke (Hevok) on May 7, 2013, 11:30 a.m.