I found this guide for rst2pdf to find out how to style a reStructuredText file in the resulting pdf document. Having the following in my JSON stylesheet, for example, it is successfully applied to the whole document:
"pageSetup" : {
"size": "A4",
"width": null,
"height": null,
"margin-top": "2cm",
[...]
"margin-gutter": "0cm"
}
How is a particular style applied only to a specific class? For example, how can I apply a particular font the to the h1
class? My immediate difficulty stems from the fact that I'm unsure about whether it's actually called h1
, H1
, header1
, or Header1
.
The
rst2pdf.py
manual does not seem very informative with regards to the style names. However, the section on Styles (chapter 8) has this example:So it seems that
heading1
is the appropriate style name.One thing to note is that
So presuming that you don't get any warnings when generating your document the styles must be set in the default stylesheet, so have a look through this to get a feel for the style names used.
You can make rst2pdf print the default stylesheet using
If you want to add styles, just create a stylesheet, (or take the standard stylesheet and modify it) and pass it with the -s option