Search code examples
pythonpython-sphinxrst2pdf

Sphinx - rst2pdf: is it possible to specify the document footer in the conf.py file?


I saw from The Rst2pdf Handbook that when you use rst2pdf standalone you can specify a default footer in its configuration file. Is it possible to do something similar when using it via Sphinx, e.g. by specifying the desired footer as pdf_footer or a similar entry in the conf.py file? I did try pdf_footer in a project of mine, but it didn't work.


Solution

  • Yes. It requires knowledge of how to customize a theme using Jinja2 templating. There is a block footer in layout.html of each theme that you can modify.

    When customizing a theme, you should not modify the theme directly, but instead place "files with the same name as the original filename into the template directory of the structure the Sphinx quickstart generated for you" as mentioned in the Jinja/Sphinx Templating Primer.