pythonpython-sphinxrinohtype

Rinohtype/Sphinx background images on pages for book template


I'm trying to add a background image on the pages of my book using rinohtype/sphinx as described here. I'm using the book template (rather than article in the linked question), the build does not complain if the background file does not exist which makes me think it is not trying to find it. Is this feature available for the book template? Also if I add the scale=fill to my template the build fails. My template is below (I also tried with [contents_page] instead of [page] to no effect):

[TEMPLATE_CONFIGURATION]
name = lxr
template = book
stylesheet = lxr.rts

[VARIABLES]
paper_size = A4

[page]
background = 'lxr_background_public.pdf'

Update: The following works (article base template and using contents_page) will try to figure out how to get a background in the book base template:

[TEMPLATE_CONFIGURATION]
name = lxr
template = article
stylesheet = lxr.rts

[VARIABLES]
paper_size = A4

[contents_page]
background = 'lxr_background_public.pdf'

Solution

  • I'm afraid you're running into issue #179. The book template defines separate templates for left and right pages with contents_page as the base. However, when a property is not set on the left/right page templates, rinohtype for some reason fails to look it up in the base template

    The workaround is to set background on both contents_left_page and contents_right_page until this gets fixed.