Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sphinx PDF themes

Does the Sphinx documentation tool offer different PDF themes like it offers different HTML themes?

I Googled the issue but can't find an answer, which leads me to believe the answer is 'no'. Still, i thought i'd ask here.

Thanks.

like image 431
araichev Avatar asked Mar 16 '12 23:03

araichev


People also ask

What is Sphinx theme?

Sphinx theme is skin that changes the appearance of HTML version of the documentation. It contains HTML templates, CSS stylesheets, and static files like images, favicon, fonts, etc.

What is Toctree?

The toctree directive is the central element. Note. Simple “inclusion” of one file in another can be done with the include directive. Note. To create table of contents for current document (.


1 Answers

Firstly, Sphinx doesn't generate PDF output by itself, though there are two general methods to get from Sphinx source files to PDF output:

  1. Use the Latex builder, and then a separate tool like latex2pdf to generate the PDF output
  2. Use the Sphinx plugin from the rst2pdf project

That being said there is lots of potential for customizing the styling of your PDF output using either method.

  1. When using the latex->pdf method, you can customize your latex output using a number of options in your sphinx config file. See here. This method is somewhat less convenient than the HTML themes that Sphinx uses for HTML generation, though (IMO).
  2. When using rst2pdf you can define your own stylesheet, which his described in more detail in the manual (look under the "Styles" heading). rst2pdf includes a number of stylesheets, which can be combined for various results. And of course, you can also modify them or create your own (they're just JSON files). These stylesheets also support a kind of inheritance, so act more like the Sphinx HTML themes than the previous method.
like image 178
Kevin Horn Avatar answered Sep 23 '22 05:09

Kevin Horn